default.html.php 2.5 KB

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