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