aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-11-23 12:45:22 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-11-23 12:45:22 +0000
commit3bd6984785b53834ff3c61cd3452308539be2314 (patch)
tree32206ddd80fd9aeab17a2d098222ae18dc8ac377 /phpBB/includes/functions_module.php
parentdcf0b15c9fc90dc324e315ee056d3cbf67ed1928 (diff)
downloadforums-3bd6984785b53834ff3c61cd3452308539be2314.tar
forums-3bd6984785b53834ff3c61cd3452308539be2314.tar.gz
forums-3bd6984785b53834ff3c61cd3452308539be2314.tar.bz2
forums-3bd6984785b53834ff3c61cd3452308539be2314.tar.xz
forums-3bd6984785b53834ff3c61cd3452308539be2314.zip
[Change] Alllow applications to set custom module inclusion path (idea by HoL)
git-svn-id: file:///svn/phpbb/trunk@9096 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php36
1 files changed, 35 insertions, 1 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index c9d9a9770b..3d2330c965 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -28,12 +28,46 @@ 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
+ */
+ public function __construct($include_path = false)
+ {
+ $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
+ */
+ 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
*
* This creates a list, stored in $this->module_ary of all available
@@ -394,7 +428,7 @@ class p_master
{
global $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)