default.html.php 2.7 KB

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