mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
- changed _module_*_url to only use the main module name but the mode as parameter
- custom module lang function now suffixed by _lang - added general custom function with mode and module_row parameter - do not display friends/foes if zebra has been disabled git-svn-id: file:///svn/phpbb/trunk@5767 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -176,12 +176,19 @@ class p_master
|
||||
$depth = sizeof($this->module_cache['parents'][$row['module_id']]);
|
||||
|
||||
// We need to prefix the functions to not create a naming conflict
|
||||
$url_func = '_module_' . $row['module_name'] . '_' . $row['module_mode'] . '_url';
|
||||
$lang_func = '_module_' . $row['module_name'];
|
||||
|
||||
// Function for building 'url_extra'
|
||||
$url_func = '_module_' . $row['module_name'] . '_url';
|
||||
|
||||
// Function for building the language name
|
||||
$lang_func = '_module_' . $row['module_name'] . '_lang';
|
||||
|
||||
// Custom function for calling parameters on module init (for example assigning template variables)
|
||||
$custom_func = '_module_' . $row['module_name'];
|
||||
|
||||
$names[$row['module_name'] . '_' . $row['module_mode']][] = true;
|
||||
|
||||
$this->module_ary[] = array(
|
||||
$module_row = array(
|
||||
'depth' => $depth,
|
||||
|
||||
'id' => (int) $row['module_id'],
|
||||
@@ -194,7 +201,7 @@ class p_master
|
||||
'mode' => (string) $row['module_mode'],
|
||||
'display' => (int) $row['module_display'],
|
||||
|
||||
'url_extra' => (function_exists($url_func)) ? $url_func() : '',
|
||||
'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode']) : '',
|
||||
|
||||
'lang' => ($row['module_name'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
|
||||
'langname' => $row['module_langname'],
|
||||
@@ -202,6 +209,13 @@ class p_master
|
||||
'left' => $row['left_id'],
|
||||
'right' => $row['right_id'],
|
||||
);
|
||||
|
||||
if (function_exists($custom_func))
|
||||
{
|
||||
$custom_func($row['module_mode'], $module_row);
|
||||
}
|
||||
|
||||
$this->module_ary[] = $module_row;
|
||||
}
|
||||
|
||||
unset($this->module_cache['modules'], $names);
|
||||
|
Reference in New Issue
Block a user