default.html.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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->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
  33. echo '
  34. <div id="login" style="display: none">
  35. <h2>Login</h2>
  36. ';
  37. echo $this->form->create(null, array('url' => '/login'));
  38. echo $this->form->field('username', array('type' => 'text'));
  39. echo $this->form->field('password', array('type' => 'password'));
  40. echo $this->form->submit('Login');
  41. echo $this->form->end();
  42. echo '</div>';
  43. }
  44. echo '
  45. <nav>
  46. <ul>
  47. ';
  48. foreach ($links as $name => $path) {
  49. if ($path == '/')
  50. echo '<li class="current">';
  51. else
  52. echo '<li>';
  53. echo "<a href=\"$path\">$name</a></li>";
  54. }
  55. echo '
  56. </ul>
  57. </nav>
  58. ';
  59. ?>
  60. <?= $this->form->create(null, array('url' => '/search/index/anime', 'class' => 'search', 'method' => 'get')); ?>
  61. <?= $this->form->text('search', array('placeholder' => 'Search...')); ?>
  62. <input type="submit" value="Go">
  63. <?= $this->form->end(); ?>
  64. <br class="cl" />
  65. </header>
  66. <div id="page">
  67. <?php echo $this->content() ?>
  68. </div>
  69. <footer>
  70. <p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
  71. <br class="cl" />
  72. </footer>
  73. <?= $this->html->script("http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"); ?>
  74. <?= $this->html->script("/js/jquery.anchor.js"); ?>
  75. <?= $this->html->script("/js/jquery.tools.min.js"); ?>
  76. <?= $this->html->script("/js/jquery.form.js"); ?>
  77. <?= $this->html->script("/js/jquery.tipsy.js"); ?>
  78. <?= $this->html->script("/js/jquery.prettyPhoto.js"); ?>
  79. <?= $this->html->script("/js/functions.js"); ?>
  80. <?= $this->scripts(); ?>
  81. </body>
  82. </html>