1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Bugtracker #4147 - admin help would sometimes display when it shouldn't - thanks marj

This commit is contained in:
e107steved
2007-10-14 20:12:21 +00:00
parent 7aa64c3f01
commit bda4e234d7

View File

@@ -1,22 +1,33 @@
if (ADMIN) { if (ADMIN)
{
global $ns, $pref; global $ns, $pref;
if (!($handle=opendir(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/"))) { ob_start();
$help_text = "";
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
{
if (!($handle=opendir(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/")))
{
$handle=opendir(e_LANGUAGEDIR."English/admin/help/"); $handle=opendir(e_LANGUAGEDIR."English/admin/help/");
} }
ob_start(); while(false !== ($file = readdir($handle)))
$text = ""; {
while(false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "CVS")
if ($file != "." && $file != ".." && $file != "CVS") { {
if (strpos(e_SELF, $file) !== FALSE) { if (strpos(e_SELF, $file) !== FALSE)
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file)) { {
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file))
{
include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file); include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file);
} else if (is_readable(e_LANGUAGEDIR."English/admin/help/".$file)) { }
elseif (is_readable(e_LANGUAGEDIR."English/admin/help/".$file))
{
include_once(e_LANGUAGEDIR."English/admin/help/".$file); include_once(e_LANGUAGEDIR."English/admin/help/".$file);
} }
} }
} }
} }
closedir($handle); closedir($handle);
}
$plugpath = getcwd()."/help.php"; $plugpath = getcwd()."/help.php";
if(file_exists($plugpath)) if(file_exists($plugpath))
{ {
@@ -26,5 +37,3 @@ if (ADMIN) {
ob_end_clean(); ob_end_clean();
return $help_text; return $help_text;
} }