runes.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /**
  3. * Runes view.
  4. *
  5. * Contains the view layout and ome code to present the data.
  6. *
  7. * @category View
  8. * @property_read Runes_Page $page The page model.
  9. */
  10. namespace swdb;
  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?>runes.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. Rune 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_runes.php";
  73. ?>
  74. </article>
  75. </section> <!-- #filters -->
  76. <?php
  77. $prev_group = "";
  78. $group = "";
  79. $group_title = "";
  80. $group_image = "";
  81. foreach ($page->runes as $rune){
  82. switch ($page->filters["group"]){
  83. case 1: // "TYPE":
  84. $group = $rune->type->name;
  85. $group_title = $rune->type->name;
  86. $group_image = URL::IMG["RUNE"] . str_pad($rune->type->id, 2, '0', STR_PAD_LEFT) . ".png";
  87. break;
  88. default:
  89. $group = $rune->slot;
  90. $group_title = "Slot " . $rune->slot;
  91. $group_image = URL::IMG["RUNE"] . "base.png";
  92. }
  93. if ($prev_group != $group){
  94. if ($prev_group == ""){
  95. ?>
  96. <section class='list'>
  97. <?php
  98. }
  99. else{
  100. ?>
  101. </article>
  102. </section>
  103. <section class='list'>
  104. <?php
  105. }
  106. $prev_group = $group;
  107. ?>
  108. <h2>
  109. <img class='group_image_<?=$group?>' alt='<?=$group_title?>' src='<?=$group_image?>'>
  110. <span>
  111. <?=$group_title?>
  112. </span>
  113. </h2>
  114. <article>
  115. <?php
  116. }
  117. ?>
  118. <?=HTML::rune_table($rune, $rune->assigned_to)?>
  119. <?php
  120. }
  121. ?>
  122. </article> <!-- Close last group -->
  123. </section>
  124. <?php
  125. include __DIR__ . "/inc/footer.php";
  126. ?>
  127. </body>
  128. </html>