<head>
<?php if (ENABLE_XHTML_XML and strstr($request->get('HTTP_ACCEPT'),'application/xhtml+xml')) { ?>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<?php } else { ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php } ?>
<?php $ROBOTS_CONTENT = isset($ROBOTS_META) ? $ROBOTS_META : "noindex,nofollow"; ?>
<meta name="robots" content="<?php echo $ROBOTS_CONTENT ?>" />
<?php if (!empty($PAGE_DESCRIPTION)) { ?>
<meta name="description" content="<?php echo $PAGE_DESCRIPTION?>" />
<?php } ?>
<?php if (!empty($PAGE_KEYWORDS)) { ?>
<meta name="keywords" content="<?php echo $PAGE_KEYWORDS?>" />
<?php } ?>
<meta name="generator" content="PhpWiki" />
<base href="<?php echo PHPWIKI_BASE_URL?>" />
<link rel="shortcut icon" href="<?php echo $WikiTheme->getImageURL('favicon.ico')?>" />
<link rel="stylesheet" type="text/css" href="<?php echo DATA_PATH ?>/highlight.js/styles/github.css"/>
<?php /* The next few lines are wrapped in an odd manner to allow gettext string extraction: cd locale;make */ ?>
<link rel="home" title="<?php echo HOME_PAGE?>" href="<?php echo WikiURL(HOME_PAGE)?>" />
<link rel="help" title="<?php echo 
_("HowToUseWiki")?>" href="<?php echo WikiURL(
_("HowToUseWiki"))?>" />
<link rel="copyright" title="<?php echo COPYRIGHTPAGE_TITLE?>" href="<?php echo COPYRIGHTPAGE_URL?>" />
<link rel="author" title="<?php echo AUTHORPAGE_TITLE?>" href="<?php echo AUTHORPAGE_URL?>" />
<link rel="search" title="<?php echo 
_("FindPage")?>" href="<?php echo WikiURL(
_("FindPage"))?>" />
<?php /**
       * Provide alternate variations of the page content:
       * 'viewsource' and 'browse'.
       * Translated pages could go here too.
       */
      if (!empty($revision)) {
          $args = $request->getArgs();
          $action = empty($args['action']) ? 'browse' : $args['action'];
          if (!($action == "viewsource")) {
            $alternatelinkTitle = fmt("%s: %s", _("View Source"), $page->getName());
            $alternatelinkUrl = WikiURL($revision, array('action' => 'viewsource'));
          }
          if (!($action == "browse")) {
            $alternatelinkTitle = $page->getName();
            $alternatelinkUrl = WikiURL($revision, array('action' => 'browse'));
          } ?>
<link rel="alternate" title="<?php echo $alternatelinkTitle ?>" href="<?php echo $alternatelinkUrl ?>" />
<?php }
      /**
       * Link tag for RSS auto-discovery.  See
       * http://diveintomark.org/archives/2002/05/30.html#rss_autodiscovery
       * http://www.oreillynet.com/cs/weblog/view/wlg/1475
       */
?>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo WikiURL(
_("RecentChanges"), array('format' => 'rss'))?>" />
<link rel="alternate" type="application/atom+xml" title="ATOM" href="<?php echo WikiURL(
_("RecentChanges"), array('format' => 'atom'))?>" />
<?php /**
       * Add some user-specific links.
       */ ?>
<?php if (!$user->isSignedIn()) {
      /* For users not signed in */ ?>
<?php } ?>
<link rel="alternate" type="application/x-wiki" title="Edit this page!" href="<?php echo WikiURL($page,array('action'=>'edit')) ?>" />
<?php if ($user->isAdmin()) {
      /* Only for the Administrator */ ?>
<?php } ?>
<?php if ($user->isSignedIn()) {
      /* For signed-in users */ ?>
<?php /* User's calendar page
       */
      $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR ._("Calendar");
      $UserCalPageUrl = WikiURL($UserCalPageTitle);
      ?>
<?php /* Today's calendar page for the user if it exists
       */
      $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); //FIXME
      $dbi = $request->getDbh();
      if ($dbi->isWikiPage($UserCalPageTodayTitle)) {
          $UserCalPageTodayUrl = WikiURL($UserCalPageTodayTitle);
          ?>
<?php } ?>
<?php } //end of links for signed-in user ?>
<?php echo $WikiTheme->getCSS() ?><?php
  // avoid redundant bookmark title for custom home page
  if ($page->getName() == WIKI_NAME && HOME_PAGE == WIKI_NAME)
      $pagetitle = "";
  else
      $pagetitle = " - ". AsString($TITLE);
?>
<title><?php echo WIKI_NAME.$pagetitle ?></title>
<?php if (ENABLE_OPEN_GRAPH) { ?>
<meta property="og:title" content="<?php echo strip_tags($TITLE) ?>"/>
<meta property="og:site_name" content="<?php echo WIKI_NAME ?>"/>
<?php } ?>
<?php echo $WikiTheme->getMoreHeaders() ?>
</head>
