.
*/
if (!defined('txpinterface')) {
die('txpinterface is undefined.');
}
class hive_theme extends \Textpattern\Admin\Theme
{
function html_head()
{
$out[] = '';
$out[] = '';
$out[] = '';
$out[] = '';
$out[] = '';
$out[] = ''.n;
if (!defined('no_autosize')) {
$out[] = ''.n;
}
return join(n, $out);
}
function header()
{
$out[] = ''.n;
global $txp_user;
$default_event = get_pref('default_event');
$homelink = span('Textpattern');
if (!empty($default_event) && has_privs($default_event)) {
$homelink = href($homelink, array('event' => $default_event));
}
$out[] = hed($homelink, 1);
if ($txp_user) {
$out[] = '';
$out[] = '';
if (get_pref('sitename')) {
$out[] = graf(
span(href(htmlspecialchars(get_pref('sitename')), hu, array(
'rel' => 'noopener',
'target' => '_blank',
'title' => gTxt('tab_view_site'),
'aria-label' => gTxt('tab_view_site'),
)), array('class' => 'txp-view-site-name'))
, array('class' => 'txp-view-site'));
} else {
$out[] = graf(
span(href(gTxt('tab_view_site'), hu, array(
'rel' => 'noopener',
'target' => '_blank',
)), array('class' => 'txp-view-site-name'))
, array('class' => 'txp-view-site'));
}
$out[] = graf(
href(span(gTxt('lightswitch'), array('class' => 'ui-icon ui-icon-lightbulb')), '#', array(
'id' => 'lightswitch',
'title' => gTxt('lightswitch'),
'aria-label' => gTxt('lightswitch'),
)), array('class' => 'txp-lightswitch'));
$out[] = graf(
href(gTxt('logout'), 'index.php?logout=1', ' onclick="return verify(\''.gTxt('are_you_sure').'\')"'), array('class' => 'txp-logout'));
}
return join(n, $out);
}
function footer()
{
$out[] = graf(
href('Textpattern CMS'.sp.span(gTxt('opens_external_link'), array('class' => 'ui-icon ui-icon-extlink')), 'https://textpattern.com/', array(
'rel' => 'external noopener',
'target' => '_blank',
)).
' (v'.txp_version.')', array('class' => 'mothership'));
$out[] = graf(href(gTxt('back_to_top'), '#'), array('class' => 'pagejump'));
return join(n, $out);
}
}