default.html.php 2.4 KB

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