default.html.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. use \lithium\security\Auth;
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <?= $this->html->charset() ?>
  8. <title>OtakuHub > <?= $this->title() ?></title>
  9. <?= $this->html->style(array('style', 'base')) ?>
  10. <?= $this->html->style(array('themes/light')) ?>
  11. <?= $this->html->style(array('prettyPhoto')) ?>
  12. <script src="/js/jquery-1.6.1.min.js" type="text/javascript"></script>
  13. <?= $this->html->style(array('jquery.tagsinput')) ?>
  14. <?= $this->html->script("/js/jquery.tagsinput.min.js") ?>
  15. <script type="text/javascript" >
  16. function clearDefault(el) {
  17. if (el.defaultValue == el.value)
  18. el.value = ""
  19. }
  20. function resetValue(el) {
  21. el.value = "Search..."
  22. }
  23. </script>
  24. <?= $this->html->link('Icon', null, array('type' => 'icon')) ?>
  25. </head>
  26. <header>
  27. <?php
  28. $links = array(
  29. 'Home' => '/',
  30. 'Anime' => '/anime',
  31. 'Manga' => '/manga',
  32. );
  33. $user = Auth::check('default');
  34. if ($user)
  35. {
  36. $links['Feed'] = '/users/feed';
  37. $links['Profile'] = '/users/feed';
  38. $links['Logout'] = '/logout';
  39. }
  40. else
  41. {
  42. $links['Sign up'] = '/users/signup';
  43. $links['Login'] = '/login'; // overwritten with JS
  44. echo '
  45. <div id="login" style="display: none">
  46. <h2>Login</h2>
  47. ';
  48. echo $this->form->create(null, array('url' => '/login', 'id' => 'login'));
  49. echo $this->form->field('username', array('type' => 'textbox'));
  50. echo $this->form->field('password', array('type' => 'password'));
  51. echo $this->form->submit('Login');
  52. echo $this->form->end();
  53. echo '</div>';
  54. }
  55. echo '
  56. <nav>
  57. <ul>
  58. ';
  59. foreach ($links as $name => $path) {
  60. if ($path == '/')
  61. echo '<li class="current">';
  62. else
  63. echo '<li>';
  64. echo "<a href=\"$path\">$name</a></li>";
  65. }
  66. echo '
  67. </ul>
  68. </nav>
  69. ';
  70. ?>
  71. <?= $this->form->create(null, array('url' => '/search/index/anime', 'class' => 'search', 'method' => 'get')); ?>
  72. <?= $this->form->text('search', array('value' => 'Search...', 'onFocus' => 'clearDefault(this)', 'style' => 'width: 200px')); ?>
  73. <input type="submit" value="Go">
  74. <?= $this->form->end(); ?>
  75. <br class="cl" />
  76. </header>
  77. <div id="page">
  78. <?= $this->content() ?>
  79. </div>
  80. <footer>
  81. <p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
  82. <br class="cl" />
  83. </footer>
  84. <script src="/js/jquery.tools.min.js" type="text/javascript"></script>
  85. <script src="/js/jquery.form.js" type="text/javascript"></script>
  86. <script src="/js/jquery.tipsy.js" type="text/javascript"></script>
  87. <script src="/js/functions.js" type="text/javascript"></script>
  88. <?= $this->html->script("/js/jquery.anchor.js"); ?>
  89. <?= $this->html->script("/js/jquery.prettyPhoto.js"); ?>
  90. <script type="text/javascript" charset="utf-8">
  91. $(document).ready(function(){
  92. var login = $("a[href='/login']");
  93. login.attr('href', '#login');
  94. login.attr('title', '');
  95. login.prettyPhoto({deeplinking: false, social_tools: false});
  96. });
  97. </script>
  98. <?= $this->scripts(); ?>
  99. <script type="text/javascript">
  100. $(document).ready(function() {
  101. setTimeout(function() {
  102. $(".flash-message").fadeOut("slow", function () {
  103. $(".flash-message").remove();
  104. });
  105. }, 2000);
  106. });
  107. </script>
  108. </body>
  109. </html>