public static function loadHeaderTags(&$template) { $page_metatags = null; $theme = Layout::getCurrentTheme(); $key = Key::getCurrent(); if (Key::checkKey($key, false)) { $page_metatags = Layout::getMetaPage($key->id); if (PHPWS_Error::isError($page_metatags)) { PHPWS_Error::log($page_metatags); $page_metatags = null; } } if (!isset($_SESSION['javascript_enabled'])) { $jsHead[] = '<noscript><meta http-equiv="refresh" content="0;url=index.php?nojs=1&ret=' . urlencode(PHPWS_Core::getCurrentUrl()) . '"/></noscript>'; } if (isset($_GET['nojs'])) { $_SESSION['javascript_enabled'] = false; PHPWS_Core::reroute(urldecode($_GET['ret'])); } elseif (!isset($_SESSION['javascript_enabled'])) { $_SESSION['javascript_enabled'] = true; } if (isset($GLOBALS['Layout_JS'])) { foreach ($GLOBALS['Layout_JS'] as $script => $javascript) { $jsHead[] = $javascript['head']; } } if (!empty($jsHead)) { $template['JAVASCRIPT'] = implode("\n", $jsHead); } Layout::importStyleSheets(); Layout::submitHeaders($theme, $template); if (!empty($GLOBALS['Layout_Links'])) { $template['STYLE'] .= "\n" . implode("\n", $GLOBALS['Layout_Links']); } $template['METATAGS'] = Layout::getMetaTags($page_metatags); if ($page_metatags) { $template['PAGE_TITLE'] = $page_metatags['page_title'] . PAGE_TITLE_DIVIDER . $_SESSION['Layout_Settings']->getPageTitle(true); } else { $template['PAGE_TITLE'] = $_SESSION['Layout_Settings']->getPageTitle(); } $template['ONLY_TITLE'] = $_SESSION['Layout_Settings']->getPageTitle(TRUE); // Depricated // The Site's Name, as set in Layout 'Meta Tags' interface. $template['SITE_NAME'] = $_SESSION['Layout_Settings']->getPageTitle(TRUE); $template['BASE'] = Layout::getBase(); $template['HTTP'] = PHPWS_Core::getHttp(); // 'http' or 'https' // Complete URL of the site's home page $template['HOME_URL'] = PHPWS_Core::getHomeHttp(true, true, true); }
public static function getBaseURL() { return PHPWS_Core::getHttp() . $_SERVER['HTTP_HOST'] . preg_replace('/index.*/', '', $_SERVER['PHP_SELF']); }