mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Bugtracker #4268 - improve search for help files
This commit is contained in:
@@ -1,39 +1,36 @@
|
|||||||
if (ADMIN)
|
if (!ADMIN) return '';
|
||||||
{
|
|
||||||
global $ns, $pref;
|
$helpfile = '';
|
||||||
ob_start();
|
global $ns, $pref; // Used by the help renderer
|
||||||
$help_text = "";
|
|
||||||
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
|
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
|
||||||
{
|
{
|
||||||
if (!($handle=opendir(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/")))
|
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".e_PAGE))
|
||||||
{
|
{
|
||||||
$handle=opendir(e_LANGUAGEDIR."English/admin/help/");
|
$helpfile = e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".e_PAGE;
|
||||||
}
|
}
|
||||||
while(false !== ($file = readdir($handle)))
|
elseif (is_readable(e_LANGUAGEDIR."English/admin/help/".e_PAGE))
|
||||||
{
|
{
|
||||||
if ($file != "." && $file != ".." && $file != "CVS")
|
$helpfile = e_LANGUAGEDIR."English/admin/help/".e_PAGE;
|
||||||
{
|
|
||||||
if (strpos(e_SELF, $file) !== FALSE)
|
|
||||||
{
|
|
||||||
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file))
|
|
||||||
{
|
|
||||||
include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file);
|
|
||||||
}
|
|
||||||
elseif (is_readable(e_LANGUAGEDIR."English/admin/help/".$file))
|
|
||||||
{
|
|
||||||
include_once(e_LANGUAGEDIR."English/admin/help/".$file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
closedir($handle);
|
|
||||||
}
|
}
|
||||||
$plugpath = getcwd()."/help.php";
|
else
|
||||||
if(file_exists($plugpath))
|
|
||||||
{
|
{
|
||||||
@require_once($plugpath);
|
$plugpath = getcwd()."/help.php"; // deprecated file. For backwards compat. only.
|
||||||
|
$eplugpath = getcwd()."/e_help.php";
|
||||||
|
if(is_readable($eplugpath))
|
||||||
|
{
|
||||||
|
$helpfile = $eplugpath;
|
||||||
|
}
|
||||||
|
elseif(is_readable($plugpath))
|
||||||
|
{
|
||||||
|
$helpfile = $plugpath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!$helpfile) return '';
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
include_once($helpfile);
|
||||||
$help_text = ob_get_contents();
|
$help_text = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
return $help_text;
|
return $help_text;
|
||||||
}
|
|
Reference in New Issue
Block a user