/** * Prints the top header * * @since 1.0 * @package facileManager */ function getTopHeader($help) { global $fm_login, $__FM_CONFIG; include ABSPATH . 'fm-modules' . DIRECTORY_SEPARATOR . 'facileManager' . DIRECTORY_SEPARATOR . 'variables.inc.php'; include ABSPATH . 'fm-includes' . DIRECTORY_SEPARATOR . 'version.php'; $module_toolbar = $fm_new_version_available = $account_menu = $user_account_menu = $module_menu = null; if (!$help) { $auth_method = getOption('auth_method'); if ($auth_method) { if ($_SESSION['user']['account_id'] != 1) { $account = getNameFromID($_SESSION['user']['account_id'], 'fm_accounts', 'account_', 'account_id', 'account_name'); $account_menu = <<<HTML \t\t<div id="topheadpart"> \t\t\t<span style="line-height: 18pt;">Account: {$account}</span> \t\t</div> HTML; } $star = currentUserCan('do_everything') ? $__FM_CONFIG['icons']['star'] . ' ' : null; $change_pwd_link = $auth_method ? sprintf('<li><a class="account_settings" id="%s" href="#"><span>%s</span></a></li>' . "\n", $_SESSION['user']['id'], _('Edit Profile')) : null; $logout = _('Logout'); $user_account_menu = <<<HTML \t\t<div id="topheadpartright" style="padding: 0 1px 0 0;"> \t\t\t<div id="cssmenu"> \t\t\t<ul> \t\t\t\t<li class="has-sub has-image"><a href="#"><span>{$__FM_CONFIG['icons']['account']}</span></a> \t\t\t\t\t<ul class="sub-right"> \t\t\t\t\t\t<li class="text-only"><span>{$star}{$_SESSION['user']['name']}</span></li> \t\t\t\t\t\t{$change_pwd_link} \t\t\t\t\t\t<li class="last"><a href="{$GLOBALS['RELPATH']}?logout"><span>{$logout}</span></a></li> \t\t\t\t\t</ul> \t\t\t\t</li> \t\t\t</ul> \t\t\t</div> \t\t</div> HTML; } /** Build app dropdown menu */ $modules = getAvailableModules(); $avail_modules = null; if (count($modules)) { foreach ($modules as $module_name) { if ($module_name == $_SESSION['module']) { continue; } if (in_array($module_name, getActiveModules(true))) { $avail_modules .= "<li class='last'><a href='{$GLOBALS['RELPATH']}?module={$module_name}'><span>{$module_name}</span></a></li>\n"; } } if ($avail_modules) { $module_menu = <<<HTML \t\t<div id="topheadpartright" style="padding: 0;"> \t\t\t<div id="cssmenu"> \t\t\t<ul> \t\t\t\t<li class="has-sub last"><a href="#"><span>{$_SESSION['module']}</span></a> \t\t\t\t\t<ul> \t\t\t\t\t{$avail_modules} \t\t\t\t\t</ul> \t\t\t\t</li> \t\t\t</ul> \t\t\t</div> \t\t</div> HTML; } /** Include module toolbar items */ if (function_exists('buildModuleToolbar')) { list($module_toolbar_left, $module_toolbar_right) = @buildModuleToolbar(); } } else { $module_menu = null; $fm_name = isset($_SESSION['module']) ? $_SESSION['module'] : $fm_name; } $help_file = buildHelpFile(); $help_text = _('Help'); $process_all_text = _('Process all available updates now'); $process_all = <<<HTML \t\t<div id="topheadpartright" style="display: none;"> \t\t\t<a class="single_line process_all_updates" href="#" title="{$process_all_text}"><i class="fa fa-refresh fa-lg"></i></a> \t\t\t<span class="update_count"></span> \t\t</div> HTML; if (FM_INCLUDE_SEARCH === true) { $search = '<div id="topheadpartright"> <a class="single_line search" href="#" title="' . _('Search this page') . '"><i class="fa fa-search fa-lg"></i></a>' . displaySearchForm() . '</div>'; } else { $search = null; } $return = <<<HTML \t<div id="tophead"> \t\t<div id="topheadpart"> \t\t\t<img src="fm-modules/{$fm_name}/images/fm.png" alt="{$fm_name}" title="{$fm_name}" /> \t\t\t{$fm_name}<br /> \t\t\tv{$fm_version} \t\t</div> {$account_menu} {$module_toolbar_left} {$user_account_menu} \t\t<div id="topheadpartright"> \t\t\t<a class="single_line help_link" href="#">{$help_text}</a> \t\t</div> {$module_menu} {$module_toolbar_right} {$search} {$process_all} \t</div> \t<div id="help"> \t\t<div id="help_topbar"> \t\t\t<p class="title">fmHelp</p> \t\t\t<p id="help_buttons">{$__FM_CONFIG['icons']['popout']} {$__FM_CONFIG['icons']['close']}</p> \t\t</div> \t\t<div id="help_file_container"> \t\t{$help_file} \t\t</div> \t</div> HTML; } else { $return = <<<HTML \t<div id="tophead"> \t\t<div id="topheadpart"> \t\t\tfmHelp<br /> \t\t\tv{$fm_version} \t\t</div> \t</div> HTML; } return $return; }
| modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | +-------------------------------------------------------------------------+ | facileManager: Easy System Administration | +-------------------------------------------------------------------------+ | http://www.facilemanager.com/ | +-------------------------------------------------------------------------+ | Shows the help files | | Author: Jon LaBass | +-------------------------------------------------------------------------+ */ define('CLIENT', true); require_once 'fm-init.php'; require_once ABSPATH . 'fm-modules/facileManager/classes/class_logins.php'; /** Enforce authentication */ if (!$fm_login->isLoggedIn()) { echo '<script>close();</script>'; printf('<pre></pre>', _('You must be logged in to view these files.')); exit; } printHeader('fmHelp', 'facileManager', true); echo '<div id="help_file_container" style="padding-top: 5em;">' . "\n"; echo buildHelpFile(); echo '</div>' . "\n"; printFooter();