1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 00:07:44 +02:00

In keeping with tradition I remove yet more code....

(abstraction of functionality used by the mcp to allow it to be used
elsewhere)


git-svn-id: file:///svn/phpbb/trunk@5305 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames
2005-11-17 21:54:11 +00:00
parent 5e606fc6b5
commit d6b2182c7e
2 changed files with 59 additions and 165 deletions

View File

@@ -145,6 +145,8 @@ class p_master
$right = $row['right_id'];
$url_func = $row['module_name'] . '_' . $row['module_mode'] . '_url';
$this->module_ary[$i] = array(
'depth' => $depth,
@@ -155,6 +157,8 @@ class p_master
'name' => (string) $row['module_name'],
'mode' => (string) $row['module_mode'],
'display' => (int) $row['module_display'],
'url_extra' => (function_exists($url_func)) ? $url_func() : '',
'lang' => (function_exists($row['module_name'])) ? $row['module_name']($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
'langname' => $row['module_langname'],
@@ -374,6 +378,21 @@ class p_master
page_footer();
}
/**
* Toggle whether this module will be displayed or not
*/
function set_display($id, $display = true)
{
foreach ($this->module_ary as $row_id => $itep_ary)
{
if ($itep_ary['mode'] === $id || $itep_ary['id'] === (int) $id)
{
$this->module_ary[$row_id]['display'] = (int) $display;
break;
}
}
}
}
?>