catalog.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * Catalog view.
  4. *
  5. * Contains the view layout and some code to present the data
  6. *
  7. * @category View
  8. * @var Catalog_Page $page The page model
  9. * @var 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. <!-- Meta tags -->
  23. <link rel='canonical' href='<?=$page->canonical?>'/>
  24. <link rel='author' href='<?=$page->author?>'/>
  25. <link rel='publisher' href='<?=$page->author?>'/>
  26. <meta name='description' content='<?=$page->description?>'/>
  27. <meta property='og:title' content='<?=$page->title?>'/>
  28. <meta property='og:url' content='<?=$page->canonical?>'/>
  29. <meta property='og:description' content='<?=$page->description?>'/>
  30. <meta property='og:image' content='<?=$page->icon?>'/>
  31. <meta property='og:site_name' content='<?=$page->name?>'/>
  32. <meta property='og:type' content='website'/>
  33. <meta property='og:locale' content='en'/>
  34. <meta name='twitter:card' content='summary'/>
  35. <meta name='twitter:title' content='<?=$page->title?>'/>
  36. <meta name='twitter:description' content='<?=$page->description?>'/>
  37. <meta name='twitter:image' content='<?=$page->icon?>'/>
  38. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  39. <meta name='robots' content='index follow'/>
  40. </head>
  41. <body>
  42. <?php
  43. include __DIR__ . "/inc/header.php";
  44. ?>
  45. <aside id='filters' class='content filters'>
  46. <h2 id='filters_title'>
  47. Catalog
  48. </h2>
  49. <p>
  50. A list with every monster in the game.
  51. </p>
  52. <form action='/<?=$UID?>/catalog/' method='get' id='filter_catalog' class='filter'>
  53. <table>
  54. <tr>
  55. <td class='label'>
  56. Element:
  57. </td>
  58. <td>
  59. <?php
  60. $selected = Array("", "", "", "", "");
  61. $selected[$page->filters["ELEMENT"] - 1] = "selected";
  62. ?>
  63. <select name='element'>
  64. <option value='0'>All</option>
  65. <option value='<?=ELEMENT_ID::WATER?>' <?=$selected[0]?>>Water</option>
  66. <option value='<?=ELEMENT_ID::FIRE?>' <?=$selected[1]?>>Fire</option>
  67. <option value='<?=ELEMENT_ID::WIND?>' <?=$selected[2]?>>Wind</option>
  68. <option value='<?=ELEMENT_ID::LIGHT?>' <?=$selected[3]?>>Light</option>
  69. <option value='<?=ELEMENT_ID::DARK?>' <?=$selected[4]?>>Dark</option>
  70. </select>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td class='label' id='filter_stars'>
  75. Stars:
  76. </td>
  77. <td>
  78. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='5' value='<?=$page->filters["MIN_STARS"]?>'/>
  79. -
  80. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='5' value='<?=$page->filters["MAX_STARS"]?>'/>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td class='label'>
  85. Name:
  86. </td>
  87. <td>
  88. <input type='text' name='name' id='filter_name' value='<?=$page->filters["NAME"]?>'/>
  89. </td>
  90. </tr>
  91. </table>
  92. <input type='submit' value='Apply'/>
  93. </form>
  94. </aside> <!-- #filters -->
  95. <main>
  96. <section id='list' class='list'>
  97. <h2>
  98. Catalog
  99. </h2>
  100. <article>
  101. <?php
  102. $element = "";
  103. foreach ($page->units as $mon){
  104. if ($mon->element != $element){
  105. if ($element != ""){
  106. ?>
  107. </article>
  108. <article>
  109. <?php
  110. }
  111. $element = $mon->element;
  112. }
  113. if (!in_array($mon->id, $page->units_open)){
  114. $closed = "closed";
  115. }
  116. else{
  117. $closed = "";
  118. }
  119. ?>
  120. <div class='monster <?=$closed?>'>
  121. <a href='/<?=$UID?>/catalog/<?=$mon->id?>'>
  122. <div class='monster_panel'>
  123. <?=HTML::unit_panel($mon)?>
  124. </div>
  125. </a>
  126. </div>
  127. <?php
  128. }
  129. ?>
  130. </article>
  131. </section> <!-- #catalog -->
  132. </main>
  133. <?php
  134. include __DIR__ . "/inc/footer.php";
  135. ?>
  136. </body>
  137. </html>