catalog.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Catalog view.
  4. *
  5. * Contains the view layout and some code to present the data
  6. *
  7. * @category View
  8. * @property_read Catalog_Page $page The page model
  9. * @property_read int $UID Player ID
  10. */
  11. ?>
  12. <!DOCTYPE html>
  13. <html lang='en'>
  14. <head>
  15. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  16. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  17. <title><?=$page->title?></title>
  18. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  19. <!-- CSS files -->
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>catalog.css'/>
  22. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>filters.css'/>
  23. <!-- Meta tags -->
  24. <link rel='canonical' href='<?=$page->canonical?>'/>
  25. <link rel='author' href='<?=$page->author?>'/>
  26. <link rel='publisher' href='<?=$page->author?>'/>
  27. <meta name='description' content='<?=$page->description?>'/>
  28. <meta property='og:title' content='<?=$page->title?>'/>
  29. <meta property='og:url' content='<?=$page->canonical?>'/>
  30. <meta property='og:description' content='<?=$page->description?>'/>
  31. <meta property='og:image' content='<?=$page->icon?>'/>
  32. <meta property='og:site_name' content='<?=$page->name?>'/>
  33. <meta property='og:type' content='website'/>
  34. <meta property='og:locale' content='en'/>
  35. <meta name='twitter:card' content='summary'/>
  36. <meta name='twitter:title' content='<?=$page->title?>'/>
  37. <meta name='twitter:description' content='<?=$page->description?>'/>
  38. <meta name='twitter:image' content='<?=$page->icon?>'/>
  39. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  40. <meta name='robots' content='index follow'/>
  41. <script>
  42. /**
  43. * Shows or hiddes the filters panel.
  44. */
  45. function toggleFilters(){
  46. var content = document.getElementById('filters_content');
  47. var slid = document.getElementById('filters_slid');
  48. if (content.style.maxHeight != '30em'){
  49. content.style.maxHeight = '30em';
  50. slid.style.transform = 'rotate(90deg)';
  51. }
  52. else{
  53. content.style.maxHeight = '0px';
  54. slid.style.transform = 'rotate(0deg)';
  55. }
  56. };
  57. </script>
  58. </head>
  59. <body>
  60. <?php
  61. include __DIR__ . "/inc/header.php";
  62. ?>
  63. <section class='filters'>
  64. <h2 id='filters_title' onClick='toggleFilters();'>
  65. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=URL::IMG["ICON"]?>slid.png'/>
  66. Catalog filters
  67. </h2>
  68. <article id='filters_content'>
  69. <?php
  70. $filters = $page->filters;
  71. $custom_filters = $page->custom_filters;
  72. include __DIR__ . "/inc/filter_catalog.php";
  73. ?>
  74. </article>
  75. </section> <!-- #filters -->
  76. <section class='list'>
  77. <h2>
  78. Catalog
  79. </h2>
  80. <article>
  81. <?php
  82. $element = "";
  83. foreach ($page->units as $mon){
  84. if ($mon->element != $element){
  85. if ($element != ""){
  86. ?>
  87. </article>
  88. <article>
  89. <?php
  90. }
  91. $element = $mon->element;
  92. }
  93. ?>
  94. <div class='monster'>
  95. <a href='/<?=$UID?>/catalog/<?=$mon->id?>'>
  96. <div class='monster_panel'>
  97. <?=HTML::unit_panel($mon)?>
  98. </div>
  99. </a>
  100. </div>
  101. <?php
  102. }
  103. ?>
  104. </article>
  105. </section> <!-- #catalog -->
  106. <?php
  107. include __DIR__ . "/inc/footer.php";
  108. ?>
  109. </body>
  110. </html>