src.dualinventive.com/mtinfo/dist/webroot/main/scripts/page/help_content.php

52 lines
1.6 KiB
PHP

<?php
/** \file scripts\page\help_content.php
* \brief DI webinterface help content script.
* \author Rob Schalken, Core|Vision
* \version 1.0
* \date 17-10-2008
*
* This file contains the help content
*/
// Realtime status extende view (on a project)?
if (((isset($_SESSION[$_PAGE_INFO['id']]['standard_view'])) || (isset($_SESSION[$_PAGE_INFO['id']]['extended_view']))) && ($_COOKIE["extended_menu_" . $_PAGE_INFO['id']])) {
// Display extended menu content
$menu = $_SESSION[$_SESSION[$_PAGE_INFO['id']]['extended_menu_id']]['MTinfo_menu'];
}
else {
// Display normal content
$menu = $_SESSION[$_PAGE_INFO['id']]['MTinfo_menu'];
}
// Display Header
echo "<h1>" . ucfirst(_("h:" . $menu)) . "</h1>";
// Get menu help info
$help_info = db_fetch_help($menu, $_SESSION[$_PAGE_INFO['id']]['i18n']);
echo "<p>";
if ((is_array($help_info)) && (strlen($help_info[0]['tekst']))) {
// Remove script calls
echo preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $help_info[0]['tekst']);
}
else {
echo _("No help information available");
}
echo "</p>";
// Logout?
if (!isset($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'])) {
// Close window
echo "<script type=\"text/javascript\">\n";
echo "self.close();";
echo "</script>\n";
}
else {
// Recall every 1000ms
echo "<script type=\"text/javascript\">\n";
echo "setTimeout('xmlhttp_data(\"\",\"content_help\", 1, \"" . $_SESSION[$_PAGE_INFO['id']]['base'] . "\", \"" . $_PAGE_INFO['id'] . "\",\"\",\"&redirect=scripts/page/help_content.php\")','1000');";
echo "</script>\n";
}
?>