<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* server/privileges/privileges_summary.twig */
class __TwigTemplate_9ec36a572a1e829d56cd453f78f4fe20 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 1
yield "<form class=\"submenu-item\" action=\"";
yield PhpMyAdmin\Url::getFromRoute("/server/privileges");
yield "\" id=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["form_id"] ?? null), "html", null, true);
yield "\" method=\"post\">
";
// line 2
yield PhpMyAdmin\Url::getHiddenInputs();
yield "
<input type=\"hidden\" name=\"username\" value=\"";
// line 3
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["username"] ?? null), "html", null, true);
yield "\">
<input type=\"hidden\" name=\"hostname\" value=\"";
// line 4
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["hostname"] ?? null), "html", null, true);
yield "\">
<fieldset class=\"pma-fieldset\">
<legend data-submenu-label=\"";
// line 7
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["sub_menu_label"] ?? null), "html", null, true);
yield "\">
";
// line 8
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["legend"] ?? null), "html", null, true);
yield "
</legend>
<table class=\"table table-striped table-hover w-auto\">
<thead>
<tr>
<th scope=\"col\">";
// line 14
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["type_label"] ?? null), "html", null, true);
yield "</th>
<th scope=\"col\">";
yield _gettext("Privileges");
// line 15
yield "</th>
<th scope=\"col\">";
yield _gettext("Grant");
// line 16
yield "</th>
";
// line 17
if ((($context["type"] ?? null) == "database")) {
// line 18
yield " <th scope=\"col\">";
yield _gettext("Table-specific privileges");
yield "</th>
";
} elseif (( // line 19
($context["type"] ?? null) == "table")) {
// line 20
yield " <th scope=\"col\">";
yield _gettext("Column-specific privileges");
yield "</th>
";
}
// line 22
yield " <th scope=\"col\" colspan=\"2\">";
yield _gettext("Action");
yield "</th>
</tr>
</thead>
<tbody>
";
// line 27
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["privileges"] ?? null)) == 0)) {
// line 28
yield " ";
$context["colspan"] = (((($context["type"] ?? null) == "database")) ? (7) : ((((($context["type"] ?? null) == "table")) ? (6) : (5))));
// line 29
yield " <tr>
<td class=\"text-center\" colspan=\"";
// line 30
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["colspan"] ?? null), "html", null, true);
yield "\"><em>";
yield _gettext("None");
yield "</em></td>
</tr>
";
} else {
// line 33
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["privileges"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["privilege"]) {
// line 34
yield " <tr>
<td>";
// line 35
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v0 = $context["privilege"]) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["name"] ?? null) : null), "html", null, true);
yield "</td>
<td><code>";
// line 36
yield (($_v1 = $context["privilege"]) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["privileges"] ?? null) : null);
yield "</code></td>
<td>";
// line 37
yield (((($_v2 = $context["privilege"]) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["grant"] ?? null) : null)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("Yes"), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("No"), "html", null, true)));
yield "</td>
";
// line 39
if ((($context["type"] ?? null) == "database")) {
// line 40
yield " <td>";
yield (((($_v3 = $context["privilege"]) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["table_privs"] ?? null) : null)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("Yes"), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("No"), "html", null, true)));
yield "</td>
";
} elseif (( // line 41
($context["type"] ?? null) == "table")) {
// line 42
yield " <td>";
yield (((($_v4 = $context["privilege"]) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["column_privs"] ?? null) : null)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("Yes"), "html", null, true)) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_gettext("No"), "html", null, true)));
yield "</td>
";
}
// line 44
yield "
<td>";
// line 45
yield (($_v5 = $context["privilege"]) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["edit_link"] ?? null) : null);
yield "</td>
<td>";
// line 46
yield (($_v6 = $context["privilege"]) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["revoke_link"] ?? null) : null);
yield "</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['privilege'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 49
yield " ";
}
// line 50
yield " </tbody>
</table>
";
// line 53
if ((($context["type"] ?? null) == "database")) {
// line 54
yield " <label for=\"text_dbname\">";
yield _gettext("Add privileges on the following database(s):");
yield "</label>";
// line 56
if ( !Twig\Extension\CoreExtension::testEmpty(($context["databases"] ?? null))) {
// line 57
yield " <select class=\"resize-vertical\" name=\"pred_dbname[]\" multiple=\"multiple\">
";
// line 58
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["databases"] ?? null));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["database"]) {
// line 59
yield " <option value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v7 = ($context["escaped_databases"] ?? null)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7[CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 59)] ?? null) : null), "html", null, true);
yield "\">
";
// line 60
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["database"], "html", null, true);
yield "
</option>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['database'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 63
yield " </select>
";
}
// line 66
yield "<input type=\"text\" id=\"text_dbname\" name=\"dbname\">
";
// line 67
yield PhpMyAdmin\Html\Generator::showHint(_gettext("Wildcards % and _ should be escaped with a \\ to use them literally."));
yield "
";
} elseif (( // line 68
($context["type"] ?? null) == "table")) {
// line 69
yield " <input type=\"hidden\" name=\"dbname\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(PhpMyAdmin\Util::escapeMysqlWildcards(($context["database"] ?? null)), "html", null, true);
yield "\">
<label for=\"text_tablename\">";
yield _gettext("Add privileges on the following table:");
// line 71
yield "</label>";
// line 73
if ( !Twig\Extension\CoreExtension::testEmpty(($context["tables"] ?? null))) {
// line 74
yield " <select name=\"pred_tablename\" class=\"autosubmit\">
<option value=\"\" selected=\"selected\">";
yield _gettext("Use text field");
// line 75
yield ":</option>
";
// line 76
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["tables"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["table"]) {
// line 77
yield " <option value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["table"], "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["table"], "html", null, true);
yield "</option>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['table'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 79
yield " </select>
";
}
// line 82
yield "<input type=\"text\" id=\"text_tablename\" name=\"tablename\">
";
} else {
// line 84
yield " <input type=\"hidden\" name=\"dbname\" value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(PhpMyAdmin\Util::escapeMysqlWildcards(($context["database"] ?? null)), "html", null, true);
yield "\">
<label for=\"text_routinename\">";
yield _gettext("Add privileges on the following routine:");
// line 86
yield "</label>";
// line 88
if ( !Twig\Extension\CoreExtension::testEmpty(($context["routines"] ?? null))) {
// line 89
yield " <select name=\"pred_routinename\" class=\"autosubmit\">
<option value=\"\" selected=\"selected\">";
yield _gettext("Use text field");
// line 90
yield ":</option>
";
// line 91
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(($context["routines"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["routine"]) {
// line 92
yield " <option value=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["routine"], "html", null, true);
yield "\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["routine"], "html", null, true);
yield "</option>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['routine'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 94
yield " </select>
";
}
// line 97
yield "<input type=\"text\" id=\"text_routinename\" name=\"routinename\">
";
}
// line 99
yield " </fieldset>
<fieldset class=\"pma-fieldset tblFooters\">
<input class=\"btn btn-primary\" type=\"submit\" value=\"";
yield _gettext("Go");
// line 102
yield "\">
</fieldset>
</form>
";
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "server/privileges/privileges_summary.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 339 => 102, 333 => 99, 329 => 97, 325 => 94, 314 => 92, 310 => 91, 307 => 90, 303 => 89, 301 => 88, 299 => 86, 292 => 84, 288 => 82, 284 => 79, 273 => 77, 269 => 76, 266 => 75, 262 => 74, 260 => 73, 258 => 71, 251 => 69, 249 => 68, 245 => 67, 242 => 66, 238 => 63, 221 => 60, 216 => 59, 199 => 58, 196 => 57, 194 => 56, 190 => 54, 188 => 53, 183 => 50, 180 => 49, 171 => 46, 167 => 45, 164 => 44, 158 => 42, 156 => 41, 151 => 40, 149 => 39, 144 => 37, 140 => 36, 136 => 35, 133 => 34, 128 => 33, 120 => 30, 117 => 29, 114 => 28, 112 => 27, 103 => 22, 97 => 20, 95 => 19, 90 => 18, 88 => 17, 85 => 16, 81 => 15, 76 => 14, 67 => 8, 63 => 7, 57 => 4, 53 => 3, 49 => 2, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("", "server/privileges/privileges_summary.twig", "/usr/share/phpmyadmin/templates/server/privileges/privileges_summary.twig");
}
}