.
*/
/**
* Used for generating admin-side headers.
*
* @package HTML
*/
/**
* Creates and outputs an admin-side header.
*
* The output contains HTML <head> section and the main navigation.
* The results are echoed as opposed to returned.
*
* This function offers a way to invoke modal activity messages and set the
* page title.
*
* Output will automatically become silent on asynchronous script responses
* that do not want HTML headers.
*
* @param string $pagetitle The page title
* @param string|array $message A message show to the user
* @example
* pagetop('Title', array('My error message', E_ERROR));
* echo 'My page contents.';
*/
function pagetop($pagetitle, $message = '')
{
global $siteurl, $sitename, $txp_user, $event, $step, $app_mode, $theme;
if ($app_mode == 'async') {
return;
}
$area = gps('area');
$event = (!$event) ? 'article' : $event;
$bm = gps('bm');
$areas = areas();
$area = false;
foreach ($areas as $k => $v) {
if (in_array($event, $v)) {
$area = $k;
break;
}
}
if (gps('logout')) {
$body_id = 'page-logout';
$area = 'login';
} elseif (!$txp_user) {
$body_id = 'page-login';
$area = 'login';
} else {
$body_id = 'page-'.txpspecialchars($event);
}
header('X-Frame-Options: '.X_FRAME_OPTIONS);
header('X-UA-Compatible: '.X_UA_COMPATIBLE);
$lang_direction = gTxt('lang_dir');
if (!in_array($lang_direction, array('ltr', 'rtl'))) {
// Apply biased default for missing translations.
$lang_direction = 'ltr';
} ?>