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