beff29a63c74de8922d7ce27d387ac2dd6c0a881d21868ecc062b757db714249.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. /* partials/javascript-config.html.twig */
  3. class __TwigTemplate_adc113adff8865c15c0c586d212593f56ab76a54e3ecce760b447d3cc890c6a2 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = false;
  9. $this->blocks = array(
  10. );
  11. }
  12. protected function doDisplay(array $context, array $blocks = array())
  13. {
  14. // line 1
  15. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => "admin.login", 1 => "admin.super"))) {
  16. // line 2
  17. $context["notifications"] = ((((($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "widgets", array()), "dashboard-notifications", array(), "array") || $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "notifications", array()), "dashboard", array())) || $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "notifications", array()), "plugins", array())) || $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "notifications", array()), "themes", array()))) ? (1) : (0));
  18. // line 3
  19. echo "<script type=\"text/javascript\">
  20. window.GravAdmin = window.GravAdmin || {};
  21. window.GravAdmin.config = {
  22. current_url: '";
  23. // line 6
  24. echo twig_escape_filter($this->env, $this->getAttribute(($context["uri"] ?? null), "route", array(0 => true), "method"), "html", null, true);
  25. echo "',
  26. base_url_relative: '";
  27. // line 7
  28. echo twig_escape_filter($this->env, ($context["base_url_relative"] ?? null), "html", null, true);
  29. echo "',
  30. base_url_simple: '";
  31. // line 8
  32. echo twig_escape_filter($this->env, ($context["base_url_simple"] ?? null), "html", null, true);
  33. echo "',
  34. route: '";
  35. // line 9
  36. echo twig_escape_filter($this->env, twig_trim_filter($this->getAttribute(($context["admin"] ?? null), "route", array()), "/"), "html", null, true);
  37. echo "',
  38. param_sep: '";
  39. // line 10
  40. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(($context["config"] ?? null), "system", array()), "param_sep", array()), "html", null, true);
  41. echo "',
  42. ";
  43. // line 11
  44. if ($this->env->getExtension('Grav\Common\Twig\TwigExtension')->authorize(array(0 => "admin.maintenance", 1 => "admin.super"))) {
  45. // line 12
  46. echo " enable_auto_updates_check: '";
  47. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "enable_auto_updates_check", array()), "html", null, true);
  48. echo "',
  49. ";
  50. }
  51. // line 14
  52. echo " admin_timeout: '";
  53. echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "session", array()), "timeout", array())) ? ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin", array()), "session", array()), "timeout", array())) : (1800)), "html", null, true);
  54. echo "',
  55. admin_nonce: '";
  56. // line 15
  57. echo twig_escape_filter($this->env, $this->getAttribute(($context["admin"] ?? null), "getNonce", array()), "html", null, true);
  58. echo "',
  59. language: '";
  60. // line 16
  61. echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "user", array(), "any", false, true), "language", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "user", array(), "any", false, true), "language", array()), "en")) : ("en")), "html", null, true);
  62. echo "',
  63. pro_enabled: '";
  64. // line 17
  65. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "plugins", array()), "admin-pro", array(), "array"), "enabled", array()), "html", null, true);
  66. echo "',
  67. notifications: ";
  68. // line 18
  69. echo twig_escape_filter($this->env, ($context["notifications"] ?? null), "html", null, true);
  70. echo ",
  71. local_notifications: '";
  72. // line 19
  73. echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute(($context["config"] ?? null), "system", array(), "any", false, true), "local_notifications", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute(($context["config"] ?? null), "system", array(), "any", false, true), "local_notifications", array()), false)) : (false)), "html", null, true);
  74. echo "',
  75. site: {
  76. delimiter: '";
  77. // line 21
  78. echo twig_escape_filter($this->env, (($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "site", array(), "any", false, true), "summary", array(), "any", false, true), "delimiter", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($this->getAttribute(($context["config"] ?? null), "site", array(), "any", false, true), "summary", array(), "any", false, true), "delimiter", array()), "===")) : ("===")), "html", null, true);
  79. echo "'
  80. }
  81. };
  82. window.GravAdmin.uri_params = {};
  83. ";
  84. // line 26
  85. $context['_parent'] = $context;
  86. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(($context["grav"] ?? null), "uri", array()), "params", array(0 => null, 1 => true), "method"));
  87. foreach ($context['_seq'] as $context["param"] => $context["value"]) {
  88. // line 27
  89. echo " window.GravAdmin.uri_params.";
  90. echo twig_escape_filter($this->env, $context["param"], "html", null, true);
  91. echo " = \"";
  92. echo twig_escape_filter($this->env, twig_replace_filter($context["value"], array("\\" => "/")), "html", null, true);
  93. echo "\";
  94. ";
  95. }
  96. $_parent = $context['_parent'];
  97. unset($context['_seq'], $context['_iterated'], $context['param'], $context['value'], $context['_parent'], $context['loop']);
  98. $context = array_intersect_key($context, $_parent) + $_parent;
  99. // line 29
  100. echo "</script>
  101. ";
  102. }
  103. }
  104. public function getTemplateName()
  105. {
  106. return "partials/javascript-config.html.twig";
  107. }
  108. public function isTraitable()
  109. {
  110. return false;
  111. }
  112. public function getDebugInfo()
  113. {
  114. return array ( 105 => 29, 94 => 27, 90 => 26, 82 => 21, 77 => 19, 73 => 18, 69 => 17, 65 => 16, 61 => 15, 56 => 14, 50 => 12, 48 => 11, 44 => 10, 40 => 9, 36 => 8, 32 => 7, 28 => 6, 23 => 3, 21 => 2, 19 => 1,);
  115. }
  116. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  117. public function getSource()
  118. {
  119. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  120. return $this->getSourceContext()->getCode();
  121. }
  122. public function getSourceContext()
  123. {
  124. return new Twig_Source("{% if authorize(['admin.login', 'admin.super']) %}
  125. {% set notifications = (config.plugins.admin.widgets['dashboard-notifications'] or config.plugins.admin.notifications.dashboard or config.plugins.admin.notifications.plugins or config.plugins.admin.notifications.themes) ? 1 : 0 %}
  126. <script type=\"text/javascript\">
  127. window.GravAdmin = window.GravAdmin || {};
  128. window.GravAdmin.config = {
  129. current_url: '{{ uri.route(true) }}',
  130. base_url_relative: '{{ base_url_relative }}',
  131. base_url_simple: '{{ base_url_simple }}',
  132. route: '{{ admin.route|trim('/') }}',
  133. param_sep: '{{ config.system.param_sep }}',
  134. {% if authorize(['admin.maintenance', 'admin.super']) %}
  135. enable_auto_updates_check: '{{ config.plugins.admin.enable_auto_updates_check }}',
  136. {% endif %}
  137. admin_timeout: '{{ config.plugins.admin.session.timeout ?: 1800 }}',
  138. admin_nonce: '{{ admin.getNonce }}',
  139. language: '{{ grav.user.language|default('en') }}',
  140. pro_enabled: '{{ config.plugins[\"admin-pro\"].enabled }}',
  141. notifications: {{ notifications }},
  142. local_notifications: '{{ config.system.local_notifications|default(false) }}',
  143. site: {
  144. delimiter: '{{ config.site.summary.delimiter|default('===') }}'
  145. }
  146. };
  147. window.GravAdmin.uri_params = {};
  148. {% for param, value in grav.uri.params(null, true) %}
  149. window.GravAdmin.uri_params.{{param}} = \"{{value|replace({'\\\\': '/'})}}\";
  150. {% endfor %}
  151. </script>
  152. {% endif %}
  153. ", "partials/javascript-config.html.twig", "/mnt/data/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/partials/javascript-config.html.twig");
  154. }
  155. }