public static function renderHeader($headers = array(), $tag = '', $imageMeta = '')
{
$app = Factory::getApplication();
//$menus = $app->getMenu();
//$menu = $menus->getActive();
$p = $app->getParams();
$showPageHeading = $p->get('show_page_heading');
$pageHeading = $p->get('page_heading');
$displayHeader = $p->get('display_header_type', 'h1');
//$hideHeader = $p->get('hide_header_view', array());
if ($displayHeader == '-1') {
return '';
}
//$view = $app->input->get('view', '', 'string');
/*if (!empty($hideHeader) && $view != '') {
if (in_array($view, $hideHeader)) {
return '';
}
}*/
if ($tag == '') {
$tag = $displayHeader;
}
$h = array();
if ($showPageHeading && $pageHeading != '') {
$h[] = htmlspecialchars($pageHeading);
}
if (!empty($headers)) {
foreach ($headers as $k => $v) {
if ($v != '') {
$h[] = htmlspecialchars($v);
break;
// in array there are stored OR items (if empty try next, if not empty use this and do not try next)
// PAGE HEADING AND NEXT ITEM OR NEXT NEXT ITEM
}
}
}
$imgMetaAttr = '';
if ($imageMeta != '') {
$imgMetaAttr = 'data-image-meta="' . $imageMeta . '"';
}
if (!empty($h)) {
return '<' . strip_tags($tag) . ' class="ph-header" ' . $imgMetaAttr . '>' . implode(" - ", $h) . '</' . strip_tags($tag) . '>';
} else {
if ($imgMetaAttr != '') {
return '<div style="display:none;" ' . $imgMetaAttr . '></div>';
// use hidden tag for open graph info
}
}
return false;
}