From 6bc4b1412b42c275b0715ee47c5bf923ee3f2206 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 24 Mar 2007 18:00:21 +0000 Subject: #5280 git-svn-id: file:///svn/phpbb/trunk@7229 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_module.php | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'phpBB/includes/functions_module.php') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index d45358327f..651e35032c 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -464,6 +464,44 @@ class p_master } } + /** + * Check if a module is active + */ + function is_active($id = false) + { + $icat = false; + + $category = false; + foreach ($this->module_ary as $row_id => $item_ary) + { + // If this is a module and it's selected, active + // If this is a category and the module is the first within it, active + // If this is a module and no mode selected, select first mode + // If no category or module selected, go active for first module in first category + if ( + (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == false && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || + ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || + (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$item_ary['cat']) || + (!$id && !$item_ary['cat'] && $item_ary['display']) + ) + { + if ($item_ary['cat']) + { + $id = $icat; + $icat = false; + + continue; + } + + return $item_ary['id']; + } + else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat'])) + { + $category = $item_ary['id']; + } + } + } + /** * Get parents */ -- cgit v1.2.1 From 8ba8caec2dcdfcb755beeeaebc83c5ad1e057758 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 26 Mar 2007 15:42:05 +0000 Subject: some tiny bugfixes and changed is_active() a bit... git-svn-id: file:///svn/phpbb/trunk@7232 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_module.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'phpBB/includes/functions_module.php') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 651e35032c..f2494820ae 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -467,39 +467,21 @@ class p_master /** * Check if a module is active */ - function is_active($id = false) + function is_active($id, $mode = false) { - $icat = false; - - $category = false; + // If we find a name by this id and being enabled we have our active one... foreach ($this->module_ary as $row_id => $item_ary) { - // If this is a module and it's selected, active - // If this is a category and the module is the first within it, active - // If this is a module and no mode selected, select first mode - // If no category or module selected, go active for first module in first category - if ( - (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == false && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || - ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || - (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$item_ary['cat']) || - (!$id && !$item_ary['cat'] && $item_ary['display']) - ) + if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display']) { - if ($item_ary['cat']) + if ($mode === false || $mode === $item_ary['mode']) { - $id = $icat; - $icat = false; - - continue; + return true; } - - return $item_ary['id']; - } - else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat'])) - { - $category = $item_ary['id']; } } + + return false; } /** -- cgit v1.2.1 From 550f270a0027e67a0eb19d99fbe54d6045696a0b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Apr 2007 15:27:40 +0000 Subject: #10005, #10003, #10001, #9999, #9945, #9965, #9909, #9906, #9877, #9861, #9831, #9830, #9815, #9665, #9624 prosilver adjustments for important announcements in ucp - #9995 MCP fixes for user notes/warnings - #9981 Preserving imageset values on save/edit find a member link for Mass PM's - #9925 syndicate window.onload events where necessary - #9878 Duplicate topics in forums with announcements - #9840 Email template for forced re-activation - #9808 Topic pagination adjustment - #9763 Changed compose message layout in UCP - #9706, #9702 Fixed inline attachment font size (hopefully) git-svn-id: file:///svn/phpbb/trunk@7384 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_module.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'phpBB/includes/functions_module.php') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index f2494820ae..86cc93435d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -464,6 +464,33 @@ class p_master } } + /** + * Appending url parameter to the currently active module. + * + * This function is called for adding specific url parameters while executing the current module. + * It is doing the same as the _module_{name}_url() function, apart from being able to be called after + * having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters. + * One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call. + * + * @param string $url_extra Extra url parameters, e.g.: &u=$user_id + * + */ + function adjust_url($url_extra) + { + if (empty($this->module_ary[$this->active_module_row_id])) + { + return; + } + + $row = &$this->module_ary[$this->active_module_row_id]; + + // We check for the same url_extra in $row['url_extra'] to overcome doubled additions... + if (strpos($row['url_extra'], $url_extra) === false) + { + $row['url_extra'] .= $url_extra; + } + } + /** * Check if a module is active */ -- cgit v1.2.1 From 816bc5da616f1326d97fa20ccf59f3b1bca9fe1d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 30 Apr 2007 13:32:18 +0000 Subject: "Ghost" topics in active topics list when shadow topics and corresponding topic in same resultset [#10313] Find a member supporting hidden groups for those able to see them [#10305] Display hidden groups for all those able to see them across the board (composing messages, viewonline) Fix space for sending PM's to groups Let the permissions_phpbb file be included the same way as all other permission files [#10301] Add request_a-z+ handling within modules_auth suggested by Pyramide. This will allow modders to directly show/hide their module in addition to !empty() $_REQUEST variables. [#10297] git-svn-id: file:///svn/phpbb/trunk@7433 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_module.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_module.php') diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 86cc93435d..bbb44d4b3d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -298,7 +298,7 @@ class p_master break; default: - if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))#', $token)) + if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))|(?:request_([a-z_]+))#', $token)) { $token = ''; } @@ -314,7 +314,7 @@ class p_master $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id; $is_auth = false; - eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']'), $module_auth) . ');'); + eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#', '#request_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');'); return $is_auth; } -- cgit v1.2.1