mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12612] Prefix module url functions with phpbb_
PHPBB3-12612
This commit is contained in:
parent
e4437e19e8
commit
bba23f61b3
4 changed files with 31 additions and 27 deletions
|
@ -22,12 +22,12 @@ if (!defined('IN_PHPBB'))
|
||||||
/**
|
/**
|
||||||
* Functions used to generate additional URL paramters
|
* Functions used to generate additional URL paramters
|
||||||
*/
|
*/
|
||||||
function _module__url($mode, &$module_row)
|
function phpbb_module__url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_notes_url($mode, &$module_row)
|
function phpbb_module_notes_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
if ($mode == 'front')
|
if ($mode == 'front')
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ function _module_notes_url($mode, &$module_row)
|
||||||
return ($user_id) ? "&u=$user_id" : '';
|
return ($user_id) ? "&u=$user_id" : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_warn_url($mode, &$module_row)
|
function phpbb_module_warn_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
if ($mode == 'front' || $mode == 'list')
|
if ($mode == 'front' || $mode == 'list')
|
||||||
{
|
{
|
||||||
|
@ -64,32 +64,32 @@ function _module_warn_url($mode, &$module_row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_main_url($mode, &$module_row)
|
function phpbb_module_main_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_logs_url($mode, &$module_row)
|
function phpbb_module_logs_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_ban_url($mode, &$module_row)
|
function phpbb_module_ban_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_queue_url($mode, &$module_row)
|
function phpbb_module_queue_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function _module_reports_url($mode, &$module_row)
|
function phpbb_module_reports_url($mode, &$module_row)
|
||||||
{
|
{
|
||||||
return extra_url();
|
return phpbb_extra_url();
|
||||||
}
|
}
|
||||||
|
|
||||||
function extra_url()
|
function phpbb_extra_url()
|
||||||
{
|
{
|
||||||
global $forum_id, $topic_id, $post_id, $report_id, $user_id;
|
global $forum_id, $topic_id, $post_id, $report_id, $user_id;
|
||||||
|
|
||||||
|
|
|
@ -250,13 +250,25 @@ class p_master
|
||||||
// Function for building 'url_extra'
|
// Function for building 'url_extra'
|
||||||
$short_name = $this->get_short_name($row['module_basename']);
|
$short_name = $this->get_short_name($row['module_basename']);
|
||||||
|
|
||||||
|
$url_func = 'phpbb_module_' . $short_name . '_url';
|
||||||
|
if (!function_exists($url_func))
|
||||||
|
{
|
||||||
$url_func = '_module_' . $short_name . '_url';
|
$url_func = '_module_' . $short_name . '_url';
|
||||||
|
}
|
||||||
|
|
||||||
// Function for building the language name
|
// Function for building the language name
|
||||||
|
$lang_func = 'phpbb_module_' . $short_name . '_lang';
|
||||||
|
if (!function_exists($lang_func))
|
||||||
|
{
|
||||||
$lang_func = '_module_' . $short_name . '_lang';
|
$lang_func = '_module_' . $short_name . '_lang';
|
||||||
|
}
|
||||||
|
|
||||||
// Custom function for calling parameters on module init (for example assigning template variables)
|
// Custom function for calling parameters on module init (for example assigning template variables)
|
||||||
$custom_func = 'phpbb_module_' . $short_name;
|
$custom_func = 'phpbb_module_' . $short_name;
|
||||||
|
if (!function_exists($custom_func))
|
||||||
|
{
|
||||||
|
$custom_func = '_module_' . $short_name;
|
||||||
|
}
|
||||||
|
|
||||||
$names[$row['module_basename'] . '_' . $row['module_mode']][] = true;
|
$names[$row['module_basename'] . '_' . $row['module_mode']][] = true;
|
||||||
|
|
||||||
|
@ -286,14 +298,6 @@ class p_master
|
||||||
{
|
{
|
||||||
$custom_func($row['module_mode'], $module_row);
|
$custom_func($row['module_mode'], $module_row);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$custom_func = '_module_' . $short_name;
|
|
||||||
if (function_exists($custom_func))
|
|
||||||
{
|
|
||||||
$custom_func($row['module_mode'], $module_row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event allows to modify parameters for building modules list
|
* This event allows to modify parameters for building modules list
|
||||||
|
|
|
@ -43,7 +43,7 @@ function mcp_post_details($id, $mode, $action)
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_info = $post_info[$post_id];
|
$post_info = $post_info[$post_id];
|
||||||
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
|
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@ function mcp_topic_view($id, $mode, $action)
|
||||||
global $phpEx, $phpbb_root_path, $config;
|
global $phpEx, $phpbb_root_path, $config;
|
||||||
global $template, $db, $user, $auth, $cache, $phpbb_container;
|
global $template, $db, $user, $auth, $cache, $phpbb_container;
|
||||||
|
|
||||||
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());
|
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
|
||||||
|
|
||||||
$user->add_lang('viewtopic');
|
$user->add_lang('viewtopic');
|
||||||
$pagination = $phpbb_container->get('pagination');
|
$pagination = $phpbb_container->get('pagination');
|
||||||
|
|
Loading…
Add table
Reference in a new issue