default.html.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. use \lithium\security\Auth;
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <?= $this->html->charset() ?>
  8. <title>OtakuHub<?php $title = $this->title(); if ($title) echo " > $title" ?></title>
  9. <?= $this->html->style(array('style', 'base')) ?>
  10. <?= $this->html->style(array('themes/light')) ?>
  11. <?= $this->html->style(array('prettyPhoto')) ?>
  12. <script type="text/javascript" >
  13. function clearDefault(el) {
  14. if (el.defaultValue == el.value)
  15. el.value = ""
  16. }
  17. function resetValue(el) {
  18. el.value = "Search..."
  19. }
  20. </script>
  21. <link href='http://fonts.googleapis.com/css?family=Cantarell:regular,bold&amp;v1' rel='stylesheet' type='text/css'>
  22. </head>
  23. <header>
  24. <?php
  25. $links = array(
  26. 'Home' => '/',
  27. 'Anime' => '/anime',
  28. 'Manga' => '/manga',
  29. );
  30. $user = Auth::check('default');
  31. if ($user)
  32. {
  33. $links['Feed'] = '/users/feed';
  34. $links['Profile'] = '/users/feed';
  35. $links['Logout'] = '/logout';
  36. }
  37. else
  38. {
  39. $links['Sign up'] = '/users/signup';
  40. $links['Login'] = '/login'; // overwritten with JS
  41. echo '
  42. <div id="login" style="display: none">
  43. <h2>Login</h2>
  44. ';
  45. echo $this->form->create(null, array('url' => '/login'));
  46. echo $this->form->field('username', array('type' => 'text'));
  47. echo $this->form->field('password', array('type' => 'password'));
  48. echo $this->form->submit('Login');
  49. echo $this->form->end();
  50. echo '</div>';
  51. }
  52. echo '
  53. <nav>
  54. <ul>
  55. ';
  56. foreach ($links as $name => $path) {
  57. if ($path == '/')
  58. echo '<li class="current">';
  59. else
  60. echo '<li>';
  61. echo "<a href=\"$path\">$name</a></li>";
  62. }
  63. echo '
  64. </ul>
  65. </nav>
  66. ';
  67. ?>
  68. <?= $this->form->create(null, array('url' => '/search/index/anime', 'class' => 'search', 'method' => 'get')); ?>
  69. <?= $this->form->text('search', array('value' => 'Search...', 'onFocus' => 'clearDefault(this)', 'style' => 'width: 200px')); ?>
  70. <input type="submit" value="Go">
  71. <?= $this->form->end(); ?>
  72. <br class="cl" />
  73. </header>
  74. <div id="page">
  75. <?= $this->content() ?>
  76. </div>
  77. <footer>
  78. <p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
  79. <br class="cl" />
  80. </footer>
  81. <?= $this->html->script("/js/jquery-1.6.1.min.js") ?>
  82. <?= $this->html->script("/js/jquery.anchor.js"); ?>
  83. <?= $this->html->script("/js/jquery.tools.min.js"); ?>
  84. <?= $this->html->script("/js/jquery.form.js"); ?>
  85. <?= $this->html->script("/js/jquery.tipsy.js"); ?>
  86. <?= $this->html->script("/js/functions.js"); ?>
  87. <?= $this->html->script("/js/jquery.prettyPhoto.js"); ?>
  88. <script type="text/javascript">
  89. $(document).ready(function(){
  90. var login = $("a[href='/login']");
  91. login.attr('href', '#login');
  92. login.attr('title', '');
  93. login.prettyPhoto({deeplinking: false, social_tools: false});
  94. });
  95. </script>
  96. <?= $this->scripts(); ?>
  97. <script type="text/javascript">
  98. $(document).ready(function() {
  99. setTimeout(function() {
  100. $(".flash-message").fadeOut("slow", function () {
  101. $(".flash-message").remove();
  102. });
  103. }, 2000);
  104. });
  105. </script>
  106. </body>
  107. </html>