phpBB

Code Changes

File: includes/functions_module.php

  Unmodified   Added   Modified   Removed
Line 28Line 28
	var $p_mode;
var $p_parent;


	var $p_mode;
var $p_parent;


 
	var $include_path = false;

	var $active_module = false;
var $active_module_row_id = false;
var $acl_forum_id = false;
var $module_ary = array();

	var $active_module = false;
var $active_module_row_id = false;
var $acl_forum_id = false;
var $module_ary = array();

 

/**
* Constuctor
* Set module include path
*/
function p_master($include_path = false)
{
global $phpbb_root_path;

$this->include_path = ($include_path !== false) ? $include_path : $phpbb_root_path . 'includes/';

// Make sure the path ends with /
if (substr($this->include_path, -1) !== '/')
{
$this->include_path .= '/';
}
}

/**
* Set custom include path for modules
* Schema for inclusion is include_path . modulebase
*
* @param string $include_path include path to be used.
* @access public
*/
function set_custom_include_path($include_path)
{
$this->include_path = $include_path;

// Make sure the path ends with /
if (substr($this->include_path, -1) !== '/')
{
$this->include_path .= '/';
}
}


/**
* List modules


/**
* List modules

Line 395Line 431
	{
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;


	{
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;


		$module_path = $phpbb_root_path . 'includes/' . $this->p_class;

		$module_path = $this->include_path . $this->p_class;

		$icat = request_var('icat', '');

if ($this->active_module === false)
{

		$icat = request_var('icat', '');

if ($this->active_module === false)
{

			trigger_error('Module not accessible', E_USER_ERROR);

			trigger_error('MODULE_NOT_ACCESS', E_USER_ERROR);

		}

if (!class_exists("{$this->p_class}_$this->p_name"))
{
if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
{

		}

if (!class_exists("{$this->p_class}_$this->p_name"))
{
if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
{

				trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR);

				trigger_error($user->lang('MODULE_NOT_FIND', "$module_path/{$this->p_class}_$this->p_name.$phpEx"), E_USER_ERROR);

			}

include("$module_path/{$this->p_class}_$this->p_name.$phpEx");

if (!class_exists("{$this->p_class}_$this->p_name"))
{

			}

include("$module_path/{$this->p_class}_$this->p_name.$phpEx");

if (!class_exists("{$this->p_class}_$this->p_name"))
{

				trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);

				trigger_error($user->lang('MODULE_FILE_INCORRECT_CLASS', "$module_path/{$this->p_class}_$this->p_name.$phpEx", "{$this->p_class}_$this->p_name"), E_USER_ERROR);

			}

if (!empty($mode))

			}

if (!empty($mode))