PageRenderTime 66ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/3.0/themes/pear4gallery3/views/page.html.php

https://github.com/talmdal/gallery3-contrib
PHP | 239 lines | 223 code | 15 blank | 1 comment | 37 complexity | 3f1f02f45d386864bbd5731e42e54d28 MD5 | raw file
  1. <?php defined("SYSPATH") or die("No direct script access.") ?>
  2. <?
  3. if (isset($_GET['ajax'])) {
  4. if ($theme->page_subtype == "search") {
  5. $v = new View("thumbs.html");
  6. $v->children = $content->items;
  7. print $v;
  8. die(0);
  9. }
  10. echo new View("thumbs.html");
  11. die(0);
  12. }
  13. ?>
  14. <? if ($theme->page_subtype == "photo"):
  15. foreach (end($parents)->viewable()->children() as $i => $child)
  16. if(!($child->is_album() || $child->is_movie()))
  17. if($child->url() == $_SERVER['REQUEST_URI']) {
  18. ?>
  19. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  20. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en">
  22. <head>
  23. <title>Photo page</title>
  24. <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  25. <meta http-equiv="refresh" content="1;url=<?=end($parents)->url()?>#img=<?=$i?>&amp;viewMode=detail&amp;redirected=true" />
  26. <?= $theme->head() ?>
  27. </head>
  28. <body>Page moved <a href="<?=end($parents)->url()?>#img=<?=$i?>&amp;viewMode=detail&amp;redirected=true">here</a>.</body>
  29. </html>
  30. <?
  31. die(0);
  32. }?>
  33. <? endif ?>
  34. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  35. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  36. <html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en">
  37. <head>
  38. <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  39. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  40. <? $theme->start_combining("script,css") ?>
  41. <title>
  42. <? if ($page_title): ?>
  43. <?= $page_title ?>
  44. <? else: ?>
  45. <? if ($theme->item()): ?>
  46. <?= $theme->item()->title ?>
  47. <? elseif ($theme->tag()): ?>
  48. <?= t("Photos tagged with %tag_title", array("tag_title" => $theme->tag()->name)) ?>
  49. <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
  50. <?= item::root()->title ?>
  51. <? endif ?>
  52. <? endif ?>
  53. </title>
  54. <link rel="shortcut icon"
  55. href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
  56. type="image/x-icon" />
  57. <? if ($theme->page_type == "collection"): ?>
  58. <? if ($thumb_proportion != 1): ?>
  59. <? $new_width = round($thumb_proportion * 213) ?>
  60. <? $new_height = round($thumb_proportion * 240) ?>
  61. <style type="text/css">
  62. .g-view #g-content #g-album-grid .g-item {
  63. width: <?= $new_width ?>px;
  64. height: <?= $new_height ?>px;
  65. /* <?= $thumb_proportion ?> */
  66. }
  67. </style>
  68. <? endif ?>
  69. <? endif ?>
  70. <?= $theme->script("json2-min.js") ?>
  71. <?= $theme->script("jquery-1.7.1.min.js") ?>
  72. <?= $theme->script("jquery.form.js") ?>
  73. <?= $theme->script("jquery-ui-1.8.17.custom.min.js") ?>
  74. <?= $theme->script("jquery.endless-scroll.js") ?>
  75. <?= $theme->script("jquery.getscrollbarwidth.js") ?>
  76. <?= $theme->script("gallery.common.js") ?>
  77. <? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
  78. <script type="text/javascript">
  79. var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
  80. </script>
  81. <?= $theme->script("gallery.ajax.js") ?>
  82. <?= $theme->script("gallery.dialog.js") ?>
  83. <?= $theme->script("superfish/js/superfish.js") ?>
  84. <?= $theme->script("jquery.localscroll.js") ?>
  85. <? /* These are page specific but they get combined */ ?>
  86. <? if ($theme->page_subtype == "photo"): ?>
  87. <?= $theme->script("jquery.scrollTo.js") ?>
  88. <?= $theme->script("gallery.show_full_size.js") ?>
  89. <? elseif ($theme->page_subtype == "movie"): ?>
  90. <?= $theme->script("flowplayer.js") ?>
  91. <? endif ?>
  92. <?= $theme->head() ?>
  93. <? /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
  94. <?= $theme->script("ui.init.js") ?>
  95. <?= $theme->script("jquery.parsequery.js") ?>
  96. <?= $theme->script("imageflow.packed.js") ?>
  97. <?= $theme->css("yui/reset-fonts-grids.css") ?>
  98. <?= $theme->css("superfish/css/superfish.css") ?>
  99. <?= $theme->css("ui-pear-theme/jquery-ui-1.8.17.custom.css") ?>
  100. <?= $theme->css("screen.css") ?>
  101. <?= $theme->css("imageflow.packed.css") ?>
  102. <?= $theme->css("pear.css") ?>
  103. <!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
  104. <?= $theme->get_combined("script") ?>
  105. <!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
  106. <?= $theme->get_combined("css") ?>
  107. <!--[if lte IE 8]>
  108. <link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"/>
  109. <![endif]-->
  110. <script type="text/javascript" src="<?= $theme->url("js/pear.js"); ?>"></script>
  111. <!-- Google analytics code -->
  112. <script type="text/javascript">
  113. var _gaq = _gaq || [];
  114. _gaq.push(['_setAccount', '<? $account = module::get_var("th_pear4gallery3", "ga_code"); if ((!isset($account)) or ($account == "")) print "UA-23621420-1"; else print $account;?>']);
  115. _gaq.push(['_setDomainName', 'none']);
  116. _gaq.push(['_setAllowLinker', true]);
  117. _gaq.push(['_trackPageview']);
  118. (function() {
  119. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  120. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  121. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  122. })();
  123. </script>
  124. </head>
  125. <body <?= $theme->body_attributes() ?>>
  126. <?= new View("hoverView.html") ?>
  127. <?= $theme->page_top() ?>
  128. <?= $theme->site_status() ?>
  129. <? if (($theme->page_subtype == "login") or ($theme->page_subtype == "reauthenticate")): ?>
  130. <?= $content ?>
  131. <? else: /*not login | reauthenticate */ ?>
  132. <div id="gsNavBar" class="gcBorder1">
  133. <div class="lNavBar">
  134. <? if(!empty($parents)): ?>
  135. <? foreach ($parents as $parent): ?>
  136. <? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) $parent = end($parents); ?>
  137. <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onclick="window.location='<?= $parent->url() ?>' + getAlbumHash(0);"> <span class="ui-button-text"><?= html::purify(text::limit_chars($parent->title, module::get_var("gallery", "visible_title_length"))) ?></span> </button>
  138. <? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) break; ?>
  139. <? endforeach ?>
  140. <? elseif (!($theme->item() && $theme->item()->id == item::root()->id)): ?>
  141. <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onclick="window.location='<?= item::root()->url() ?>' + getAlbumHash(0);"> <span class="ui-button-text"><?= html::purify(text::limit_chars(item::root()->title, module::get_var("gallery", "visible_title_length"))) ?></span> </button>
  142. <? endif ?>
  143. </div>
  144. <? if ($theme->item()): ?>
  145. <div class="pearTitle" title="<?= $theme->item()->description ?>"> <?= html::purify(text::limit_chars($theme->item()->title, 40)) ?> &nbsp;
  146. <? if (!module::get_var("th_pear4gallery3", "hide_item_count")): ?>
  147. <span class="count">(<?= count($theme->item()->children()) ?>)</span>
  148. <? endif ?>
  149. </div>
  150. <? else: ?>
  151. <div class="pearTitle">
  152. <? if ($page_title): ?>
  153. <?= html::purify(text::limit_chars($page_title, 40)) ?> &nbsp;
  154. <? else: ?>
  155. <? if ($theme->tag()): ?>
  156. <?= t("Photos tagged with %tag_title", array("tag_title" => $theme->tag()->name)) ?>
  157. <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
  158. <?= html::purify(text::limit_chars(item::root()->title, 40)) ?> &nbsp;
  159. <? endif ?>
  160. <? endif ?>
  161. </div>
  162. <? endif ?>
  163. <div class="rNavBar">
  164. <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onclick="$('#g-header').slideToggle('normal', function(){$('#g-header').is(':hidden') ? $('#sidebarButton').text('Show Options') : $('#sidebarButton').text('Hide Options')});"> <span class="ui-button-text">Show Options</span> </button>
  165. </div>
  166. </div>
  167. <div id="g-header" class="ui-helper-clearfix" style="display: none;">
  168. <div id="g-banner">
  169. <?= $theme->user_menu() ?>
  170. <?= $theme->header_top() ?>
  171. <!-- hide the menu until after the page has loaded, to minimize menu flicker -->
  172. <div id="g-site-menu" style="visibility: hidden">
  173. <?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
  174. </div>
  175. <script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
  176. <?= $theme->header_bottom() ?>
  177. </div>
  178. </div>
  179. <?= $theme->messages() ?>
  180. <?= $content ?>
  181. <div id="footerWrapper">
  182. <div title="Change size of photos" id="sliderView" class="sliderView">
  183. <div title="View at smallest photo size" class="smaller" onclick="$('#imgSlider').slider('value', 0);"></div>
  184. <div title="View at largest photo size" class="larger" onclick="$('#imgSlider').slider('value', 250);"></div>
  185. <div id="imgSlider" class="track">
  186. </div>
  187. </div>
  188. <div style="" class="" id="colorPicker">
  189. <div class="label">Color:</div>
  190. <div title="View this album with a black background" id="black" class="swatch" onclick="swatchSkin('black');return false;"> </div>
  191. <div title="View this album with a dark gray background" id="dkgrey" class="swatch" onclick="swatchSkin('dkgrey');return false;"> </div>
  192. <div title="View this album with a light gray background" id="ltgrey" class="swatch" onclick="swatchSkin('ltgrey');return false;"> </div>
  193. <div title="View this album with a white background" id="white" class="swatch" onclick="swatchSkin('white');return false;"> </div>
  194. </div>
  195. <div class="" style="" id="viewControls">
  196. <? if ($theme->page_subtype != "movie"): ?>
  197. <div title="Display this album in a grid view" id="grid" class="grid viewSwitcher sel sel-with-viewSwitcher viewSwitcher-icon">
  198. <span class="vs-icon vs-icon-grid"></span>Grid
  199. </div>
  200. <div title="Display this album in a mosaic view" id="mosaic" class="viewSwitcher mosaic">
  201. <span class="vs-icon vs-icon-mosaic"></span>Mosaic
  202. </div>
  203. <div title="Display this album in a carousel view" id="carousel" class="carousel viewSwitcher">
  204. <span class="vs-icon vs-icon-carousel"></span>Carousel
  205. </div>
  206. <div title="Play a slideshow of this album" id="slideshow" class="viewSwitcher slideshow slideshow-with-viewSwitcher">
  207. <span class="vs-icon vs-icon-slideshow"></span>Slideshow
  208. </div>
  209. <div class="clear"></div>
  210. <? endif ?>
  211. </div>
  212. <? if (!module::get_var("th_pear4gallery3", "hide_logo")): ?>
  213. <? if (module::get_var("gallery", "logo_path")) {
  214. $logo_url = url::file(module::get_var("th_pear4gallery3", "logo_path"));
  215. } else {
  216. $logo_url = $theme->url("icons/pear_logo_sml.png");
  217. } ?>
  218. <button id="logoButton" style="background-image: url('<?= $logo_url ?>') !important"></button>
  219. <? endif ?>
  220. </div>
  221. <? endif ?>
  222. </body>
  223. </html>