You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
6.0 KiB

  1. <?php
  2. // Project: Web Reference Database (refbase) <http://www.refbase.net>
  3. // Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
  4. // original author(s).
  5. //
  6. // This code is distributed in the hope that it will be useful,
  7. // but WITHOUT ANY WARRANTY. Please see the GNU General Public
  8. // License for more details.
  9. //
  10. // File: ./contrib/skins/mediawiki-monobook/header.inc.php
  11. // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/contrib/skins/mediawiki-monobook/header.inc.php $
  12. // Author(s): Richard Karnesky <mailto:karnesky@gmail.com>
  13. //
  14. // Created: 31-Oct-06, 00:28
  15. // Modified: $Date: 2012-02-27 20:25:30 +0000 (Mon, 27 Feb 2012) $
  16. // $Author: msteffens $
  17. // $Revision: 1337 $
  18. // This is the header include file.
  19. // It contains functions that provide the HTML header
  20. // as well as the visible header that gets displayed on every page.
  21. // --------------------------------------------------------------------
  22. // Inserts the HTML <head>...</head> block as well as the initial <body> tag:
  23. //
  24. // TODO: include OpenSearch elements in HTML header
  25. // (see examples at <http://www.opensearch.org/Specifications/OpenSearch/1.1#Response_metadata_in_HTML.2FXHTML>)
  26. function displayHTMLhead($pageTitle, $metaRobots, $metaDescription, $additionalMeta, $includeJavaScript, $includeJavaScriptFile, $viewType, $rssURLArray)
  27. {
  28. global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
  29. global $contentTypeCharset;
  30. global $defaultStyleSheet;
  31. global $printStyleSheet;
  32. global $mobileStyleSheet;
  33. global $useVisualEffects;
  34. global $databaseBaseURL;
  35. global $databaseKeywords;
  36. global $defaultFeedFormat;
  37. ?>
  38. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  39. "http://www.w3.org/TR/html4/loose.dtd">
  40. <html>
  41. <head profile="http://a9.com/-/spec/opensearch/1.1/">
  42. <title><?php echo $pageTitle; ?></title>
  43. <meta name="date" content="<?php echo date('d-M-y'); ?>">
  44. <meta name="robots" content="<?php echo $metaRobots; ?>">
  45. <meta name="description" lang="en" content="<?php echo $metaDescription; ?>">
  46. <meta name="keywords" lang="en" content="<?php echo $databaseKeywords; ?>"><?php
  47. if (!empty($additionalMeta))
  48. echo $additionalMeta;
  49. ?>
  50. <meta http-equiv="content-language" content="<?php echo getUserLanguage(); ?>">
  51. <meta http-equiv="content-type" content="text/html; charset=<?php echo $contentTypeCharset; ?>">
  52. <meta http-equiv="Content-Style-Type" content="text/css"><?php
  53. if (preg_match("/^Print$/i", $viewType))
  54. {
  55. ?>
  56. <link rel="stylesheet" href="<?php echo $printStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
  57. }
  58. elseif (preg_match("/^Mobile$/i", $viewType))
  59. {
  60. ?>
  61. <link rel="stylesheet" href="<?php echo $mobileStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
  62. }
  63. else
  64. {
  65. ?>
  66. <link rel="stylesheet" href="<?php echo $defaultStyleSheet; ?>" type="text/css" title="CSS Definition"><?php
  67. }
  68. if (!empty($rssURLArray) AND isset($_SESSION['user_permissions']) AND preg_match("/allow_rss_feeds/", $_SESSION['user_permissions'])) // if some RSS URLs were specified AND the 'user_permissions' session variable contains 'allow_rss_feeds'...
  69. {
  70. foreach ($rssURLArray as $rssURL)
  71. {
  72. if ($defaultFeedFormat == "Atom XML")
  73. $feedContentType = "application/atom+xml";
  74. else // RSS XML
  75. $feedContentType = "application/rss+xml";
  76. // ...include a link tag pointing to a dynamic RSS feed for the current query:
  77. ?>
  78. <link rel="alternate" type="<?php echo $feedContentType; ?>" href="<?php echo $databaseBaseURL . $rssURL['href']; ?>" title="<?php echo $rssURL['title']; ?>"><?php
  79. }
  80. }
  81. ?>
  82. <link rel="unapi-server" type="application/xml" title="unAPI" href="<?php echo $databaseBaseURL; ?>unapi.php">
  83. <link rel="search" type="application/opensearchdescription+xml" title="<?php echo encodeHTML($officialDatabaseName); ?>" href="<?php echo $databaseBaseURL; ?>opensearch.php?operation=explain"><?php
  84. if ($includeJavaScript OR (isset($_SESSION['userAutoCompletions']) AND ($_SESSION['userAutoCompletions'] == "yes")) OR ($useVisualEffects == "yes"))
  85. {
  86. // ...include common refbase JavaScript functions:
  87. ?>
  88. <script language="JavaScript" type="text/javascript" src="javascript/common.js"></script><?php
  89. }
  90. if ((isset($_SESSION['userAutoCompletions']) AND ($_SESSION['userAutoCompletions'] == "yes")) OR ($useVisualEffects == "yes"))
  91. {
  92. // ...include the Prototype & script.aculo.us JavaScript frameworks:
  93. ?>
  94. <script language="JavaScript" type="text/javascript" src="javascript/prototype.js"></script>
  95. <script language="JavaScript" type="text/javascript" src="javascript/scriptaculous.js?load=effects,controls"></script><?php
  96. }
  97. if (!empty($includeJavaScriptFile))
  98. {
  99. // ...include additional JavaScript functions:
  100. ?>
  101. <script language="JavaScript" type="text/javascript" src="<?php echo $includeJavaScriptFile; ?>"></script><?php
  102. }
  103. ?>
  104. </head>
  105. <body><?php
  106. }
  107. // --------------------------------------------------------------------
  108. // Displays the visible header:
  109. function showPageHeader($HeaderString)
  110. {
  111. global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
  112. global $hostInstitutionAbbrevName;
  113. global $hostInstitutionName;
  114. global $hostInstitutionURL;
  115. global $helpResourcesURL;
  116. global $loginWelcomeMsg; // these variables are globally defined in function 'showLogin()' in 'include.inc.php'
  117. global $loginStatus;
  118. global $loginLinks;
  119. global $loc; // '$loc' is made globally available in 'core.php'
  120. ?>
  121. <div id="globalWrapper">
  122. <div id="column-content">
  123. <div id="content">
  124. <a name="top" id="contentTop"></a>
  125. <h1 class="firstHeading"><? echo encodeHTML($officialDatabaseName); ?></h1>
  126. <div id="bodyContent">
  127. <h3 id="siteSub">From NUCAPT</h3>
  128. <div id="contentSub"></div>
  129. <!-- start content -->
  130. <h2><? echo $HeaderString; ?></h2>
  131. <?php
  132. }
  133. // --------------------------------------------------------------------
  134. ?>