1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 01:36:57 +02:00

+ some fixes

git-svn-id: file:///svn/phpbb/trunk@7938 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-07-24 15:20:32 +00:00
parent 306581d905
commit 959448c935
6 changed files with 49 additions and 28 deletions

View File

@@ -410,7 +410,7 @@ class acp_icons
// Make sure the pak_ary is valid
foreach ($pak_ary as $pak_entry)
{
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data))
{
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
(sizeof($data[1]) != 6 && $mode == 'smilies'))
@@ -473,7 +473,7 @@ class acp_icons
foreach ($pak_ary as $pak_entry)
{
$data = array();
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data))
{
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
(sizeof($data[1]) != 6 && $mode == 'smilies'))

View File

@@ -29,7 +29,7 @@ class acp_modules
function main($id, $mode)
{
global $db, $user, $auth, $template;
global $db, $user, $auth, $template, $module;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
@@ -50,6 +50,11 @@ class acp_modules
$user->add_lang('mcp');
}
if ($module->p_class != $this->module_class)
{
$module->add_mod_info($this->module_class);
}
$this->page_title = strtoupper($this->module_class);
$this->parent_id = request_var('parent_id', 0);

View File

@@ -124,29 +124,7 @@ class p_master
$this->module_cache['modules'] = array_merge($this->module_cache['modules']);
// Include MOD _info files for populating language entries within the menus
if (file_exists($user->lang_path . 'mods'))
{
$add_files = array();
$dir = @opendir($user->lang_path . 'mods');
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'info_' . strtolower($this->p_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
{
$add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
}
}
closedir($dir);
}
if (sizeof($add_files))
{
$user->add_lang($add_files);
}
}
$this->add_mod_info($this->p_class);
// Now build the module array, but exclude completely empty categories...
$right_id = false;
@@ -824,6 +802,38 @@ class p_master
}
}
}
/**
* Add custom MOD info language file
*/
function add_mod_info($module_class)
{
global $user, $phpEx;
if (file_exists($user->lang_path . 'mods'))
{
$add_files = array();
$dir = @opendir($user->lang_path . 'mods');
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
{
$add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
}
}
closedir($dir);
}
if (sizeof($add_files))
{
$user->add_lang($add_files);
}
}
}
}
?>