aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-11-23 12:42:34 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-11-23 12:42:34 +0000
commit9a7d2a3736f876d1aae7735c9a2d00a35d037e2b (patch)
treeca0af4206ba7b501c2fc2c689e80d72cc53562c8 /phpBB
parentf1b1d0c83947a2807dc4db95a8a224b1bcb65e65 (diff)
downloadforums-9a7d2a3736f876d1aae7735c9a2d00a35d037e2b.tar
forums-9a7d2a3736f876d1aae7735c9a2d00a35d037e2b.tar.gz
forums-9a7d2a3736f876d1aae7735c9a2d00a35d037e2b.tar.bz2
forums-9a7d2a3736f876d1aae7735c9a2d00a35d037e2b.tar.xz
forums-9a7d2a3736f876d1aae7735c9a2d00a35d037e2b.zip
[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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html2
-rw-r--r--phpBB/includes/functions_module.php38
2 files changed, 39 insertions, 1 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 4897535416..0a1ad6b4bb 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -95,6 +95,8 @@
<li>[Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)</li>
<li>[Fix] Properly treat punctuation marks after local urls (Bug #37055)</li>
<li>[Fix] Make searching for members by YIM address work in prosilver</li>
+ <li>[Change] Alllow applications to set custom module inclusion path (idea by HoL)</li>
+
</ul>
<a name="v302"></a><h3>1.ii. Changes since 3.0.2</h3>
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 3f1c6b39e2..d0e7c8cfc8 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -28,12 +28,48 @@ 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
*
* This creates a list, stored in $this->module_ary of all available
@@ -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)