runes.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. ?>
  11. <!DOCTYPE html>
  12. <html lang='en'>
  13. <head>
  14. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  15. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  16. <title><?=$page->title?></title>
  17. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  18. <!-- CSS files -->
  19. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>runes.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>filters.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. <script>
  41. /**
  42. * Shows or hiddes the filters panel.
  43. */
  44. function toggleFilters(){
  45. var content = document.getElementById('filters_content');
  46. var slid = document.getElementById('filters_slid');
  47. if (content.style.maxHeight != '55em'){
  48. content.style.maxHeight = '55em';
  49. slid.style.transform = 'rotate(90deg)';
  50. }
  51. else{
  52. content.style.maxHeight = '0px';
  53. slid.style.transform = 'rotate(0deg)';
  54. }
  55. };
  56. </script>
  57. </head>
  58. <body>
  59. <?php
  60. include __DIR__ . "/inc/header.php";
  61. ?>
  62. <section class='filters'>
  63. <h2 id='filters_title' onClick='toggleFilters();'>
  64. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=URL::IMG["ICON"]?>slid.png'/>
  65. Rune filters
  66. </h2>
  67. <article id='filters_content'>
  68. <?php
  69. $filters = $page->filters;
  70. $custom_filters = $page->custom_filters;
  71. include __DIR__ . "/inc/filter_runes.php";
  72. ?>
  73. </article>
  74. </section> <!-- #filters -->
  75. <?php
  76. $prev_group = "";
  77. $group = "";
  78. $group_title = "";
  79. $group_image = "";
  80. foreach ($page->runes as $rune){
  81. switch ($page->filters["GROUP"]){
  82. case 1: // "TYPE":
  83. $group = $rune->type->name;
  84. $group_title = $rune->type->name;
  85. $group_image = URL::IMG["RUNE"] . str_pad($rune->type->id, 2, '0', STR_PAD_LEFT) . ".png";
  86. break;
  87. default:
  88. $group = $rune->slot;
  89. $group_title = "Slot " . $rune->slot;
  90. $group_image = URL::IMG["RUNE"] . "base.png";
  91. }
  92. if ($prev_group != $group){
  93. if ($prev_group == ""){
  94. ?>
  95. <section class='list'>
  96. <?php
  97. }
  98. else{
  99. ?>
  100. </article>
  101. </section>
  102. <section class='list'>
  103. <?php
  104. }
  105. $prev_group = $group;
  106. ?>
  107. <h2>
  108. <img class='group_image_<?=$group?>' alt='<?=$group_title?>' src='<?=$group_image?>'>
  109. <span>
  110. <?=$group_title?>
  111. </span>
  112. </h2>
  113. <article>
  114. <?php
  115. }
  116. ?>
  117. <?=HTML::rune_table($rune, $rune->assigned_to)?>
  118. <?php
  119. }
  120. ?>
  121. </article> <!-- Close last group -->
  122. </section>
  123. <?php
  124. include __DIR__ . "/inc/footer.php";
  125. ?>
  126. </body>
  127. </html>