6e2b4f6ad25cdff6a0326eb019d85dc7d7a8ea03b9c2473ceffe49bd98a749d0.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <?php
  2. /* config.html.twig */
  3. class __TwigTemplate_374d7279513f5959ba8104826926dde9159dcda7e10cf54bf20305a863e06152 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("partials/base.html.twig", "config.html.twig", 1);
  10. $this->blocks = array(
  11. 'stylesheets' => array($this, 'block_stylesheets'),
  12. 'javascripts' => array($this, 'block_javascripts'),
  13. 'titlebar' => array($this, 'block_titlebar'),
  14. 'content_top' => array($this, 'block_content_top'),
  15. 'content' => array($this, 'block_content'),
  16. );
  17. }
  18. protected function doGetParent(array $context)
  19. {
  20. return "partials/base.html.twig";
  21. }
  22. protected function doDisplay(array $context, array $blocks = array())
  23. {
  24. // line 3
  25. $context["config_slug"] = twig_escape_filter($this->env, $this->getAttribute(($context["uri"] ?? null), "basename", array()));
  26. // line 4
  27. $context["isInfo"] = (($context["config_slug"] ?? null) == "info");
  28. // line 6
  29. $context["tab_title_string"] = ("PLUGIN_ADMIN." . twig_upper_filter($this->env, ($context["config_slug"] ?? null)));
  30. // line 7
  31. $context["tab_title"] = ((($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(($context["tab_title_string"] ?? null)) == ($context["tab_title_string"] ?? null))) ? (twig_capitalize_string_filter($this->env, ($context["config_slug"] ?? null))) : ($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(($context["tab_title_string"] ?? null))));
  32. // line 8
  33. $context["title"] = (($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.CONFIGURATION") . ": ") . ($context["tab_title"] ?? null));
  34. // line 10
  35. if ( !($context["isInfo"] ?? null)) {
  36. // line 11
  37. $context["data"] = $this->getAttribute(($context["admin"] ?? null), "data", array(0 => ("config/" . ($context["config_slug"] ?? null))), "method");
  38. }
  39. // line 1
  40. $this->parent->display($context, array_merge($this->blocks, $blocks));
  41. }
  42. // line 14
  43. public function block_stylesheets($context, array $blocks = array())
  44. {
  45. // line 15
  46. echo " ";
  47. $this->getAttribute(($context["assets"] ?? null), "addCss", array(0 => (($context["theme_url"] ?? null) . "/css/codemirror/codemirror.css")), "method");
  48. // line 16
  49. echo " ";
  50. $this->displayParentBlock("stylesheets", $context, $blocks);
  51. echo "
  52. ";
  53. }
  54. // line 19
  55. public function block_javascripts($context, array $blocks = array())
  56. {
  57. // line 20
  58. echo " ";
  59. $this->displayParentBlock("javascripts", $context, $blocks);
  60. echo "
  61. ";
  62. }
  63. // line 23
  64. public function block_titlebar($context, array $blocks = array())
  65. {
  66. // line 24
  67. echo " <div class=\"button-bar\">
  68. <a class=\"button\" href=\"";
  69. // line 25
  70. echo twig_escape_filter($this->env, ($context["base_url"] ?? null), "html", null, true);
  71. echo "\"><i class=\"fa fa-reply\"></i> ";
  72. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.BACK"), "html", null, true);
  73. echo "</a>
  74. ";
  75. // line 26
  76. if ($this->getAttribute($this->getAttribute(($context["data"] ?? null), "file", array()), "filename", array())) {
  77. // line 27
  78. echo " <button class=\"button\" type=\"submit\" name=\"task\" value=\"save\" form=\"blueprints\"><i class=\"fa fa-check\"></i> ";
  79. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.SAVE"), "html", null, true);
  80. echo "</button>
  81. ";
  82. }
  83. // line 29
  84. echo " </div>
  85. <h1><i class=\"fa fa-fw fa-wrench\"></i> ";
  86. // line 30
  87. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.CONFIGURATION"), "html", null, true);
  88. echo " - ";
  89. echo twig_escape_filter($this->env, ($context["tab_title"] ?? null), "html", null, true);
  90. echo "</h1>
  91. ";
  92. }
  93. // line 33
  94. public function block_content_top($context, array $blocks = array())
  95. {
  96. // line 34
  97. echo " ";
  98. if ($this->getAttribute($this->getAttribute(($context["data"] ?? null), "file", array()), "filename", array())) {
  99. // line 35
  100. echo " <div class=\"alert notice\">";
  101. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.SAVE_LOCATION"), "html", null, true);
  102. echo ": <b>";
  103. echo twig_escape_filter($this->env, twig_replace_filter($this->getAttribute($this->getAttribute(($context["data"] ?? null), "file", array()), "filename", array()), array(($context["base_path"] ?? null) => "")), "html", null, true);
  104. echo "</b></div>
  105. ";
  106. }
  107. // line 37
  108. echo "
  109. <div class=\"form-tabs\">
  110. <div class=\"tabs-nav\">
  111. ";
  112. // line 41
  113. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => "admin.configuration_system", 1 => "admin.super"))) {
  114. // line 42
  115. echo " <a ";
  116. if ((($context["config_slug"] ?? null) == "system")) {
  117. echo "class=\"active\"";
  118. }
  119. echo " href=\"";
  120. echo twig_escape_filter($this->env, ($context["base_url_relative"] ?? null), "html", null, true);
  121. echo "/config/system\">
  122. <span>";
  123. // line 43
  124. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.SYSTEM"), "html", null, true);
  125. echo "</span>
  126. </a>
  127. ";
  128. }
  129. // line 46
  130. echo "
  131. ";
  132. // line 47
  133. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => "admin.configuration_site", 1 => "admin.super"))) {
  134. // line 48
  135. echo " <a ";
  136. if ((($context["config_slug"] ?? null) == "site")) {
  137. echo "class=\"active\"";
  138. }
  139. echo " href=\"";
  140. echo twig_escape_filter($this->env, ($context["base_url_relative"] ?? null), "html", null, true);
  141. echo "/config/site\">
  142. <span>";
  143. // line 49
  144. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.SITE"), "html", null, true);
  145. echo "</span>
  146. </a>
  147. ";
  148. }
  149. // line 52
  150. echo "
  151. ";
  152. // line 53
  153. $context['_parent'] = $context;
  154. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["admin"] ?? null), "configurations", array()));
  155. foreach ($context['_seq'] as $context["_key"] => $context["configuration"]) {
  156. // line 54
  157. echo " ";
  158. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => ("admin.configuration_" . $context["configuration"]), 1 => "admin.super"))) {
  159. // line 55
  160. echo " ";
  161. $context["current_blueprints"] = $this->getAttribute($this->getAttribute($this->getAttribute(($context["admin"] ?? null), "data", array(0 => ("config/" . $context["configuration"])), "method"), "blueprints", array()), "toArray", array(), "method");
  162. // line 56
  163. echo " ";
  164. if ((((($context["configuration"] != "system") && ($context["configuration"] != "site")) && !$this->getAttribute($this->getAttribute(($context["current_blueprints"] ?? null), "form", array()), "hidden", array())) && ( !twig_test_empty($this->getAttribute($this->getAttribute(($context["current_blueprints"] ?? null), "form", array()), "fields", array())) || !twig_test_empty($this->getAttribute($this->getAttribute(($context["current_blueprints"] ?? null), "form", array()), "field", array()))))) {
  165. // line 57
  166. echo " <a ";
  167. if ((($context["config_slug"] ?? null) == $context["configuration"])) {
  168. echo "class=\"active\"";
  169. }
  170. echo " href=\"";
  171. echo twig_escape_filter($this->env, ($context["base_url_relative"] ?? null), "html", null, true);
  172. echo "/config/";
  173. echo twig_escape_filter($this->env, $context["configuration"], "html", null, true);
  174. echo "\">
  175. ";
  176. // line 58
  177. $context["configuration_string"] = ("PLUGIN_ADMIN." . twig_upper_filter($this->env, $context["configuration"]));
  178. // line 59
  179. echo " <span>";
  180. echo twig_escape_filter($this->env, ((($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(($context["configuration_string"] ?? null)) == ($context["configuration_string"] ?? null))) ? (twig_capitalize_string_filter($this->env, $context["configuration"])) : ($this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter(($context["configuration_string"] ?? null)))), "html", null, true);
  181. echo "</span>
  182. </a>
  183. ";
  184. }
  185. // line 62
  186. echo " ";
  187. }
  188. // line 63
  189. echo " ";
  190. }
  191. $_parent = $context['_parent'];
  192. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['configuration'], $context['_parent'], $context['loop']);
  193. $context = array_intersect_key($context, $_parent) + $_parent;
  194. // line 64
  195. echo "
  196. ";
  197. // line 65
  198. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => "admin.configuration_info", 1 => "admin.super"))) {
  199. // line 66
  200. echo " <a ";
  201. if ((($context["config_slug"] ?? null) == "info")) {
  202. echo "class=\"active\"";
  203. }
  204. echo " href=\"";
  205. echo twig_escape_filter($this->env, ($context["base_url_relative"] ?? null), "html", null, true);
  206. echo "/config/info\">
  207. <span>";
  208. // line 67
  209. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.INFO"), "html", null, true);
  210. echo "</span>
  211. </a>
  212. ";
  213. }
  214. // line 70
  215. echo "
  216. </div>
  217. </div>
  218. ";
  219. }
  220. // line 75
  221. public function block_content($context, array $blocks = array())
  222. {
  223. // line 76
  224. echo " ";
  225. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => ("admin.configuration_" . ($context["config_slug"] ?? null)), 1 => "admin.super"))) {
  226. // line 77
  227. echo " ";
  228. if (($context["isInfo"] ?? null)) {
  229. // line 78
  230. echo " <div id=\"phpinfo\">
  231. ";
  232. // line 79
  233. echo $this->getAttribute(($context["admin"] ?? null), "phpinfo", array());
  234. echo "
  235. </div>
  236. ";
  237. } else {
  238. // line 82
  239. echo " ";
  240. $this->loadTemplate("partials/blueprints.html.twig", "config.html.twig", 82)->display(array_merge($context, array("blueprints" => $this->getAttribute(($context["data"] ?? null), "blueprints", array()), "data" => ($context["data"] ?? null))));
  241. // line 83
  242. echo " ";
  243. }
  244. // line 84
  245. echo " ";
  246. }
  247. // line 85
  248. echo " ";
  249. $this->loadTemplate("partials/modal-changes-detected.html.twig", "config.html.twig", 85)->display($context);
  250. }
  251. public function getTemplateName()
  252. {
  253. return "config.html.twig";
  254. }
  255. public function isTraitable()
  256. {
  257. return false;
  258. }
  259. public function getDebugInfo()
  260. {
  261. return array ( 258 => 85, 255 => 84, 252 => 83, 249 => 82, 243 => 79, 240 => 78, 237 => 77, 234 => 76, 231 => 75, 224 => 70, 218 => 67, 209 => 66, 207 => 65, 204 => 64, 198 => 63, 195 => 62, 188 => 59, 186 => 58, 175 => 57, 172 => 56, 169 => 55, 166 => 54, 162 => 53, 159 => 52, 153 => 49, 144 => 48, 142 => 47, 139 => 46, 133 => 43, 124 => 42, 122 => 41, 116 => 37, 108 => 35, 105 => 34, 102 => 33, 94 => 30, 91 => 29, 85 => 27, 83 => 26, 77 => 25, 74 => 24, 71 => 23, 64 => 20, 61 => 19, 54 => 16, 51 => 15, 48 => 14, 44 => 1, 41 => 11, 39 => 10, 37 => 8, 35 => 7, 33 => 6, 31 => 4, 29 => 3, 11 => 1,);
  262. }
  263. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  264. public function getSource()
  265. {
  266. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  267. return $this->getSourceContext()->getCode();
  268. }
  269. public function getSourceContext()
  270. {
  271. return new Twig_Source("{% extends 'partials/base.html.twig' %}
  272. {% set config_slug = uri.basename|e %}
  273. {% set isInfo = (config_slug == 'info') %}
  274. {% set tab_title_string = \"PLUGIN_ADMIN.\" ~ config_slug|upper %}
  275. {% set tab_title = (tab_title_string|tu == tab_title_string ? config_slug|capitalize : tab_title_string|tu) %}
  276. {% set title = \"PLUGIN_ADMIN.CONFIGURATION\"|tu ~ \": \" ~ tab_title %}
  277. {% if not isInfo %}
  278. {% set data = admin.data('config/' ~ config_slug) %}
  279. {% endif %}
  280. {% block stylesheets %}
  281. {% do assets.addCss(theme_url ~ '/css/codemirror/codemirror.css') %}
  282. {{ parent() }}
  283. {% endblock %}
  284. {% block javascripts %}
  285. {{ parent() }}
  286. {% endblock %}
  287. {% block titlebar %}
  288. <div class=\"button-bar\">
  289. <a class=\"button\" href=\"{{ base_url }}\"><i class=\"fa fa-reply\"></i> {{ \"PLUGIN_ADMIN.BACK\"|tu }}</a>
  290. {% if data.file.filename %}
  291. <button class=\"button\" type=\"submit\" name=\"task\" value=\"save\" form=\"blueprints\"><i class=\"fa fa-check\"></i> {{ \"PLUGIN_ADMIN.SAVE\"|tu }}</button>
  292. {% endif %}
  293. </div>
  294. <h1><i class=\"fa fa-fw fa-wrench\"></i> {{ \"PLUGIN_ADMIN.CONFIGURATION\"|tu }} - {{ tab_title }}</h1>
  295. {% endblock %}
  296. {% block content_top %}
  297. {% if data.file.filename %}
  298. <div class=\"alert notice\">{{ \"PLUGIN_ADMIN.SAVE_LOCATION\"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
  299. {% endif %}
  300. <div class=\"form-tabs\">
  301. <div class=\"tabs-nav\">
  302. {% if authorize(['admin.configuration_system', 'admin.super']) %}
  303. <a {% if config_slug == 'system' %}class=\"active\"{% endif %} href=\"{{ base_url_relative }}/config/system\">
  304. <span>{{ \"PLUGIN_ADMIN.SYSTEM\"|tu }}</span>
  305. </a>
  306. {% endif %}
  307. {% if authorize(['admin.configuration_site', 'admin.super']) %}
  308. <a {% if config_slug == 'site' %}class=\"active\"{% endif %} href=\"{{ base_url_relative }}/config/site\">
  309. <span>{{ \"PLUGIN_ADMIN.SITE\"|tu }}</span>
  310. </a>
  311. {% endif %}
  312. {% for configuration in admin.configurations %}
  313. {% if authorize(['admin.configuration_' ~ configuration, 'admin.super']) %}
  314. {% set current_blueprints = admin.data('config/' ~ configuration).blueprints.toArray() %}
  315. {% if configuration != 'system' and configuration != 'site' and not current_blueprints.form.hidden and (current_blueprints.form.fields is not empty or current_blueprints.form.field is not empty) %}
  316. <a {% if config_slug == configuration %}class=\"active\"{% endif %} href=\"{{ base_url_relative }}/config/{{configuration}}\">
  317. {% set configuration_string = \"PLUGIN_ADMIN.\" ~ configuration|upper %}
  318. <span>{{ (configuration_string|tu == configuration_string ? configuration|capitalize : configuration_string|tu) }}</span>
  319. </a>
  320. {% endif %}
  321. {% endif %}
  322. {% endfor %}
  323. {% if authorize(['admin.configuration_info', 'admin.super']) %}
  324. <a {% if config_slug == 'info' %}class=\"active\"{% endif %} href=\"{{ base_url_relative }}/config/info\">
  325. <span>{{ \"PLUGIN_ADMIN.INFO\"|tu }}</span>
  326. </a>
  327. {% endif %}
  328. </div>
  329. </div>
  330. {% endblock %}
  331. {% block content %}
  332. {% if authorize(['admin.configuration_' ~ config_slug, 'admin.super']) %}
  333. {% if isInfo %}
  334. <div id=\"phpinfo\">
  335. {{ admin.phpinfo|raw }}
  336. </div>
  337. {% else %}
  338. {% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
  339. {% endif %}
  340. {% endif %}
  341. {% include 'partials/modal-changes-detected.html.twig' %}
  342. {% endblock %}
  343. ", "config.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/config.html.twig");
  344. }
  345. }