PageRenderTime 39ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/header.php

http://showslow.googlecode.com/
PHP | 280 lines | 229 code | 31 blank | 20 comment | 20 complexity | d35332bfaf3988c52140952066f1a291 MD5 | raw file
  1. <?php require_once(dirname(__FILE__).'/users/users.php');
  2. if (!isset($TITLE)) {
  3. $TITLE = null;
  4. }
  5. if (!isset($SECTION)) {
  6. $SECTION = null;
  7. }
  8. if (!isset($current_user)) {
  9. $current_user = User::get();
  10. }
  11. ?><!DOCTYPE HTML>
  12. <html version="HTML+RDFa 1.1" lang="en"
  13. xmlns:og="http://opengraphprotocol.org/schema/"
  14. xmlns:fb="http://developers.facebook.com/schema/"
  15. >
  16. <head>
  17. <title><?php if (isset($TITLE)) { echo htmlentities($TITLE).' | '; } ?>Show Slow</title>
  18. <?php if ($homePageMetaTags && $SECTION == 'home') { echo $homePageMetaTags; } ?>
  19. <link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo assetURL('favicon.ico')?>">
  20. <link rel="apple-touch-icon" href="<?php echo assetURL('showslow_iphone_icon.png')?>" />
  21. <style type="text/css">
  22. /*
  23. Copyright (c) 2010, Yahoo! Inc. All rights reserved.
  24. Code licensed under the BSD License:
  25. http://developer.yahoo.com/yui/license.html
  26. version: 2.8.1
  27. */
  28. body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
  29. body {
  30. margin:0;
  31. background-color: #98993D;
  32. }
  33. #header {
  34. padding: 1px;
  35. height: 60px;
  36. border-bottom: 2px solid black;
  37. margin: 0;
  38. }
  39. #header a {
  40. color: #403300;
  41. }
  42. #menu {
  43. background-color: #261F00;
  44. border-bottom: 2px solid black;
  45. }
  46. #menu a {
  47. color: #FFDE4C;
  48. padding: 0.6em;
  49. text-decoration: none;
  50. font-weight: bold;
  51. white-space: nowrap;
  52. }
  53. #menu a:hover {
  54. background-color: #7F6F26;
  55. color: black;
  56. }
  57. #menu a.current {
  58. background-color: #7F6F26;
  59. color: white;
  60. }
  61. #menu td {
  62. padding: 0.1em 0.1em;
  63. }
  64. #footer {
  65. border-top: 2px solid black;
  66. padding: 5px;
  67. font-size: smaller;
  68. }
  69. #title {
  70. color: black;
  71. text-decoration: none;
  72. padding: 0 0.5em;
  73. }
  74. #main {
  75. padding: 1px 1em 1em 1em;
  76. background: white;
  77. }
  78. #poweredby {
  79. float: right;
  80. }
  81. #navbox {
  82. float: right;
  83. margin-right: 1em;
  84. }
  85. td, th { white-space: nowrap; }
  86. .score {
  87. text-align: right;
  88. padding: 0 10px 0 10px;
  89. }
  90. .gbox {
  91. background-color: #EFEFEF;
  92. background: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#CFCFCF));
  93. background: -moz-linear-gradient(top, #EFEFEF, #CFCFCF);
  94. width: 101px;
  95. }
  96. .moreinfo {
  97. width: 14px;
  98. height: 14px;
  99. background-image: url('<?php echo assetURL('info.png')?>');
  100. }
  101. .ccol {
  102. background-image: url('<?php echo assetURL('collecting.gif')?>')
  103. }
  104. .url {
  105. padding-left:10px;
  106. }
  107. .bar {
  108. height: 15px;
  109. }
  110. <?php for($i=1; $i<=count($colorSteps); $i++) {?>
  111. .c<?php echo $i; ?> {
  112. background: #<?php echo $colorSteps[$i-1]; ?>;
  113. background: -webkit-gradient(linear, left top, left bottom, from(#<?php echo $colorSteps[$i-1]; ?>), to(#<?php echo $colorStepShades[$i-1]; ?>));
  114. background: -moz-linear-gradient(top, #<?php echo $colorSteps[$i-1]; ?>, #<?php echo $colorStepShades[$i-1]; ?>);
  115. }
  116. <?php } ?>
  117. </style>
  118. <?php
  119. if (isset($STYLES)) {
  120. foreach ($STYLES as $_style) {
  121. ?><link rel="stylesheet" type="text/css" href="<?php echo $_style; ?>"/><?php
  122. }
  123. }
  124. if (isset($SCRIPTS)) {
  125. foreach ($SCRIPTS as $_script) {
  126. ?><script type="text/javascript" src="<?php echo $_script; ?>"></script><?php
  127. }
  128. }
  129. if ($kissMetricsKey) {
  130. ?><script type="text/javascript">
  131. var _kmq = _kmq || [];
  132. function _kms(u){
  133. setTimeout(function(){
  134. var s = document.createElement('script'); var f = document.getElementsByTagName('script')[0]; s.type = 'text/javascript'; s.async = true;
  135. s.src = u; f.parentNode.insertBefore(s, f);
  136. }, 1);
  137. }
  138. _kms('//i.kissmetrics.com/i.js');_kms('//doug1izaerwt3.cloudfront.net/<?php echo $kissMetricsKey ?>.1.js');
  139. </script>
  140. <?php
  141. }
  142. if ($showFeedbackButton) {?>
  143. <script type="text/javascript">
  144. var uservoiceOptions = {
  145. /* required */
  146. key: 'showslow',
  147. host: 'showslow.uservoice.com',
  148. forum: '18807',
  149. showTab: true,
  150. /* optional */
  151. alignment: 'right',
  152. background_color:'#f00',
  153. text_color: 'white',
  154. hover_color: '#06C',
  155. lang: 'en'
  156. };
  157. function _loadUserVoice() {
  158. var s = document.createElement('script');
  159. s.setAttribute('type', 'text/javascript');
  160. s.setAttribute('src', ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.uservoice.com/javascripts/widgets/tab.js");
  161. document.getElementsByTagName('head')[0].appendChild(s);
  162. }
  163. _loadSuper = window.onload;
  164. window.onload = (typeof window.onload != 'function') ? _loadUserVoice : function() { _loadSuper(); _loadUserVoice(); };
  165. </script>
  166. <?php } ?>
  167. <?php if ($googleAnalyticsProfile) {?>
  168. <script type="text/javascript">
  169. var _gaq = _gaq || [];
  170. _gaq.push(['_setAccount', '<?php echo $googleAnalyticsProfile ?>']);
  171. _gaq.push(['_setCustomVar', 1, 'User Type', <?php if (is_null($current_user)) { ?>'Anonymous'<?php }else{ ?>'Member'<?php } ?>, 2]);
  172. _gaq.push(['_trackPageview']);
  173. (function() {
  174. var ga = document.createElement('script');
  175. ga.src = ('https:' == document.location.protocol ?
  176. 'https://ssl' : 'http://www') +
  177. '.google-analytics.com/ga.js';
  178. ga.setAttribute('async', 'true');
  179. document.documentElement.firstChild.appendChild(ga);
  180. })();
  181. </script>
  182. <?php }?>
  183. </head>
  184. <body class="yui-skin-sam">
  185. <div id="header">
  186. <a href="<?php echo $showslow_base ?>"><img src="<?php echo assetURL('showslow_icon.png')?>" style="float: right; padding: 0.2em; margin-left: 1em; border: 0"/></a>
  187. <div id="poweredby">powered by <a href="http://www.showslow.org/">showslow</a></div>
  188. <div id="navbox">
  189. <?php
  190. if (!is_null($current_user))
  191. {?>
  192. <span id="username"><a href="<?php echo $showslow_base ?>users/edit.php" title="<?php echo htmlentities($current_user->getName())?>'s user information"><?php echo htmlentities($current_user->getName()) ?></a></span> |
  193. <span id="logout"><a href="<?php echo $showslow_base ?>users/logout.php">logout</a></span>
  194. <?php }
  195. else
  196. { ?>
  197. <span id="signup"><a href="<?php echo $showslow_base ?>users/register.php">Sign Up Now!</a></span> |
  198. <span id="login"><a href="<?php echo $showslow_base ?>users/login.php">log in</a></span>
  199. <?php }?>
  200. </div>
  201. <h1><a id="title" href="<?php echo $showslow_base ?>">Show Slow</a></h1>
  202. <div style="clear: both"></div>
  203. </div>
  204. <div id="menu">
  205. <table><tr>
  206. <?php if ($enableMyURLs) { ?><td><a <?php if ($SECTION == 'my') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>my.php">+ add URL</a></td><?php } ?>
  207. <td><a <?php if ($SECTION == 'home') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>">Last measurements</td>
  208. <td><a <?php if ($SECTION == 'all') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>all.php">URLs measured</a></td>
  209. <?php
  210. $compareParams = '';
  211. if (is_array($defaultURLsToCompare)) {
  212. $compareParams = '?';
  213. if ($defaultRankerToCompare == 'pagespeed') {
  214. $compareParams .= 'ranker=pagespeed&';
  215. }
  216. $first = true;
  217. foreach ($defaultURLsToCompare as $_url) {
  218. if ($first) {
  219. $first = false;
  220. }
  221. else {
  222. $compareParams.= '&';
  223. }
  224. $compareParams.='url[]='.urlencode($_url);
  225. }
  226. }
  227. ?>
  228. <td><a <?php if ($SECTION == 'compare') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>details/compare.php<?php echo $compareParams?>">Compare rankings</a></td>
  229. <?php
  230. foreach ($customLists as $list_id => $list) {
  231. if (array_key_exists('hidden', $list) && $list['hidden']) {
  232. continue;
  233. }
  234. ?><td><a <?php if ($SECTION == 'custom_list_'.$list_id) {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>list.php?id=<?php echo $list_id; ?>"><?php echo $list['title'] ?></td><?php
  235. }
  236. foreach ($additionalMenuItems as $menu_item) {
  237. ?><td><a href="<?php echo htmlentities($menu_item['url']) ?>"><?php echo htmlentities($menu_item['title']) ?></td><?php
  238. }
  239. ?>
  240. <td><a <?php if ($SECTION == 'configure') {?>class="current" <?php } ?>href="<?php echo $showslow_base ?>configure.php">Configuring ranking tools</a></td>
  241. <td><a href="http://code.google.com/p/showslow/downloads/list">Download ShowSlow</a></td>
  242. </tr></table>
  243. </div>
  244. <div id="main">