1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[Change] Alllow applications to set custom module inclusion path (idea by HoL)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9095 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2008-11-23 12:42:34 +00:00
parent f1b1d0c839
commit 9a7d2a3736
2 changed files with 39 additions and 1 deletions

View File

@@ -28,11 +28,47 @@ class p_master
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();
/**
* 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
*
@@ -395,7 +431,7 @@ class p_master
{
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)