PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/sitemap/frontend/views/default/style.php

https://gitlab.com/makkooz/nikestreetbeat
PHP | 193 lines | 179 code | 4 blank | 10 comment | 0 complexity | 6555ba1a643f56f7ebd0d956b40f773d MD5 | raw file
  1. <?php
  2. /**
  3. * @link http://www.writesdown.com/
  4. * @author Agiel K. Saputra <13nightevil@gmail.com>
  5. * @copyright Copyright (c) 2015 WritesDown
  6. * @license http://www.writesdown.com/license/
  7. */
  8. use common\models\Option;
  9. use yii\helpers\Html;
  10. use yii\helpers\Url;
  11. ?>
  12. <?= '<?xml version="1.0" encoding="UTF-8"?>' ?>
  13. <xsl:stylesheet version="2.0" xmlns:html="http://www.w3.org/TR/REC-html40"
  14. xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
  15. xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
  16. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  17. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  18. <xsl:template match="/">
  19. <html xmlns="http://www.w3.org/1999/xhtml">
  20. <head>
  21. <title><?= Option::get('sitetitle') . ' - ' . Yii::t('writesdown', 'XML Sitemap'); ?></title>
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  23. <style type="text/css">
  24. body {
  25. font-family: Helvetica, Arial, sans-serif;
  26. font-size: 13px;
  27. color: #545353;
  28. }
  29. table {
  30. border: none;
  31. border-collapse: collapse;
  32. width: 100%;
  33. }
  34. #sitemap tr.odd td {
  35. background-color: #eee !important;
  36. }
  37. #sitemap tbody tr:hover td {
  38. background-color: #ccc;
  39. }
  40. #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a {
  41. color: #000;
  42. }
  43. #content {
  44. margin: 0 auto;
  45. width: 1000px;
  46. }
  47. .expl {
  48. margin: 18px 3px;
  49. line-height: 1.2em;
  50. }
  51. .expl a {
  52. color: #da3114;
  53. font-weight: bold;
  54. }
  55. .expl a:visited {
  56. color: #da3114;
  57. }
  58. a {
  59. color: #000;
  60. text-decoration: none;
  61. }
  62. a:visited {
  63. color: #777;
  64. }
  65. a:hover {
  66. text-decoration: underline;
  67. }
  68. td {
  69. font-size: 11px;
  70. }
  71. th {
  72. text-align: left;
  73. padding-right: 30px;
  74. font-size: 11px;
  75. }
  76. thead th {
  77. border-bottom: 1px solid #000;
  78. cursor: pointer;
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div id="content">
  84. <h1>XML Sitemap</h1>
  85. <p class="expl">
  86. <?= Yii::t(
  87. 'writesdown',
  88. 'Generated by {writesDownLink}. More Information about XML Sitemaps on {sitemapLink}', [
  89. 'writesDownLink' => Html::a('WritesDown', 'http://www.writesdown.com'),
  90. 'sitemapLink' => Html::a('sitemaps.org', 'http://sitemaps.org'),
  91. ]
  92. ) ?>
  93. </p>
  94. <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &gt; 0">
  95. <p class="expl">
  96. <?= Yii::t('writesdown', 'This XML Sitemap Index file contains {countSitemap} sitemaps.', [
  97. 'countSitemap' => '<xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/>',
  98. ]) ?>
  99. </p>
  100. <table id="sitemap" cellpadding="3">
  101. <thead>
  102. <tr>
  103. <th width="75%"><?= Yii::t('writesdown', 'Sitemap') ?></th>
  104. <th width="25%"><?= Yii::t('writesdown', 'Last Modified') ?></th>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
  109. <xsl:variable name="sitemapURL">
  110. <xsl:value-of select="sitemap:loc"/>
  111. </xsl:variable>
  112. <tr>
  113. <td>
  114. <a href="{$sitemapURL}">
  115. <xsl:value-of select="sitemap:loc"/>
  116. </a>
  117. </td>
  118. <td>
  119. <xsl:value-of
  120. select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
  121. </td>
  122. </tr>
  123. </xsl:for-each>
  124. </tbody>
  125. </table>
  126. </xsl:if>
  127. <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &lt; 1">
  128. <p class="expl">
  129. <?= Yii::t('writesdown', 'This XML Sitemap contains {countSitemap} URLs', [
  130. 'countSitemap' => '<xsl:value-of select="count(sitemap:urlset/sitemap:url)"/>',
  131. ]) ?>
  132. </p>
  133. <p class="expl"><?= Html::a(Yii::t('writesdown', '&#8593; Sitemap Index'),
  134. Yii::$app->urlManager->hostInfo . Url::to(['index'])) ?></p>
  135. <table id="sitemap" cellpadding="3">
  136. <thead>
  137. <tr>
  138. <th width="75%"><?= Yii::t('writesdown', 'URL') ?></th>
  139. <th title="Index Priority" width="5%"><?= Yii::t('writesdown', 'Prio') ?></th>
  140. <th width="5%"><?= Yii::t('writesdown', 'Images') ?></th>
  141. <th title="Change Frequency" width="5%"><?= Yii::t('writesdown', 'Ch. Freq.') ?></th>
  142. <th title="Last Modification Time" width="10%"><?= Yii::t('writesdown', 'Last Mod.') ?></th>
  143. </tr>
  144. </thead>
  145. <tbody>
  146. <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
  147. <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
  148. <xsl:for-each select="sitemap:urlset/sitemap:url">
  149. <tr>
  150. <td>
  151. <xsl:variable name="itemURL">
  152. <xsl:value-of select="sitemap:loc"/>
  153. </xsl:variable>
  154. <a href="{$itemURL}">
  155. <xsl:value-of select="sitemap:loc"/>
  156. </a>
  157. </td>
  158. <td>
  159. <xsl:value-of select="concat(sitemap:priority*100,'%')"/>
  160. </td>
  161. <td>
  162. <xsl:value-of select="count(image:image)"/>
  163. </td>
  164. <td>
  165. <xsl:value-of
  166. select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/>
  167. </td>
  168. <td>
  169. <xsl:value-of
  170. select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/>
  171. </td>
  172. </tr>
  173. </xsl:for-each>
  174. </tbody>
  175. </table>
  176. </xsl:if>
  177. </div>
  178. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  179. <script type="text/javascript"
  180. src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.21.5/js/jquery.tablesorter.min.js"></script>
  181. <script type="text/javascript"><![CDATA[
  182. $(document).ready(function () {
  183. $("#sitemap").tablesorter({widgets: ['zebra']});
  184. });
  185. ]]></script>
  186. </body>
  187. </html>
  188. </xsl:template>
  189. </xsl:stylesheet>