0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
giga
/
cache
/
46
/
[
Home
]
File: 46b964cdd9280a1735213985cd47db9240750ebf9e8fbeb5f9a52cf935261f8a.php
<?php use Twig\Environment; use Twig\Error\LoaderError; use Twig\Error\RuntimeError; 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; /* user-page.twig */ class __TwigTemplate_79345a44e86037fbe2cfc4393b906c257478fadd386eee3542b40cdf0b3f3f1e extends Template { private $source; private $macros = []; public function __construct(Environment $env) { parent::__construct($env); $this->source = $this->getSourceContext(); $this->blocks = [ 'title' => [$this, 'block_title'], 'actionMenu' => [$this, 'block_actionMenu'], 'pageContent' => [$this, 'block_pageContent'], 'javaScript' => [$this, 'block_javaScript'], ]; } protected function doGetParent(array $context) { // line 23 return "authed.twig"; } protected function doDisplay(array $context, array $blocks = []) { $macros = $this->macros; // line 24 $macros["inline"] = $this->macros["inline"] = $this->loadTemplate("inline.twig", "user-page.twig", 24)->unwrap(); // line 23 $this->parent = $this->loadTemplate("authed.twig", "user-page.twig", 23); $this->parent->display($context, array_merge($this->blocks, $blocks)); } // line 26 public function block_title($context, array $blocks = []) { $macros = $this->macros; echo twig_escape_filter($this->env, __("Users"), "html", null, true); echo " | "; } // line 28 public function block_actionMenu($context, array $blocks = []) { $macros = $this->macros; // line 29 echo " <div class=\"widget-action-menu pull-right\"> "; // line 30 if ((twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "isSuperAdmin", [], "method", false, false, false, 30) || (twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "isGroupAdmin", [], "method", false, false, false, 30) && twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "featureEnabled", [0 => "users.add"], "method", false, false, false, 30)))) { // line 31 echo " "; if (twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "getOptionValue", [0 => "isAlwaysUseManualAddUserForm", 1 => 0], "method", false, false, false, 31)) { // line 32 echo " "; $context["addUserFormUrl"] = $this->env->getRuntime('Slim\Views\TwigRuntimeExtension')->urlFor("user.add.form"); // line 33 echo " "; } else { // line 34 echo " "; $context["addUserFormUrl"] = $this->env->getRuntime('Slim\Views\TwigRuntimeExtension')->urlFor("user.onboarding.form"); // line 35 echo " "; } // line 36 echo " <button id=\"user-add-button\" class=\"btn btn-success XiboFormButton\" title=\""; echo __("Add a new User"); echo "\" href=\""; echo twig_escape_filter($this->env, ($context["addUserFormUrl"] ?? null), "html", null, true); echo "\"><i class=\"fa fa-user-plus\" aria-hidden=\"true\"></i> "; echo __("Add User"); echo "</button> "; } // line 38 echo " <button class=\"btn btn-primary refresh-grid\" title=\""; echo __("Refresh the Table"); echo "\" href=\"#\"><i class=\"fa fa-refresh\" aria-hidden=\"true\"></i> "; echo __("Refresh"); echo "</button> </div> "; } // line 42 public function block_pageContent($context, array $blocks = []) { $macros = $this->macros; // line 43 echo " <div class=\"widget\"> <div class=\"widget-title\">"; // line 44 echo __("Users"); echo "</div> <div class=\"widget-body\"> <div class=\"XiboGrid\" id=\""; // line 46 echo twig_escape_filter($this->env, twig_random($this->env), "html", null, true); echo "\" data-grid-name=\"usersView\"> <div class=\"XiboFilter card mb-3 bg-light\"> <div class=\"FilterDiv card-body\" id=\"Filter\"> <form class=\"form-inline\"> <div class=\"form-group mr-1 mb-1\"> <label class=\"control-label mr-1\" title=\"\" for=\"userName\" accesskey=\"\">"; // line 52 echo __("Name"); echo "</label> <div> <div class=\"input-group\"> <input class=\"form-control\" name=\"userName\" type=\"text\" id=\"userName\" value=\"\"> <div class=\"input-group-append input-group-addon\"> <div class=\"input-group-text\"> <input title=\""; // line 58 echo __("Use Regex?"); echo "\" type=\"checkbox\" id=\"useRegexForName\" name=\"useRegexForName\"> </div> </div> </div> </div> </div> "; // line 65 ob_start(function () { return ''; }); echo __("User Type"); $context["title"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset()); // line 66 echo " "; echo twig_call_macro($macros["inline"], "macro_dropdown", ["userTypeId", "single", ($context["title"] ?? null), "", twig_array_merge([0 => ["userTypeId" => null, "userType" => ""]], ($context["userTypes"] ?? null)), "userTypeId", "userType"], 66, $context, $this->getSourceContext()); echo " "; // line 68 ob_start(function () { return ''; }); echo __("Retired"); $context["title"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset()); // line 69 echo " "; $context["values"] = [0 => ["id" => 1, "value" => "Yes"], 1 => ["id" => 0, "value" => "No"]]; // line 70 echo " "; echo twig_call_macro($macros["inline"], "macro_dropdown", ["retired", "single", ($context["title"] ?? null), 0, ($context["values"] ?? null), "id", "value"], 70, $context, $this->getSourceContext()); echo " </form> </div> </div> <div class=\"XiboData card pt-3\"> <table id=\"users\" class=\"table table-striped\" data-state-preference-name=\"userGrid\"> <thead> <tr> <th>"; // line 78 echo __("Name"); echo "</th> <th>"; // line 79 echo __("Homepage"); echo "</th> <th>"; // line 80 echo __("Email"); echo "</th> <th>"; // line 81 echo __("Library Quota"); echo "</th> <th>"; // line 82 echo __("Last Login"); echo "</th> <th>"; // line 83 echo __("Logged In?"); echo "</th> <th>"; // line 84 echo __("Retired?"); echo "</th> <th>"; // line 85 echo __("Two Factor"); echo "</th> <th>"; // line 86 echo __("First Name"); echo "</th> <th>"; // line 87 echo __("Last Name"); echo "</th> <th>"; // line 88 echo __("Phone"); echo "</th> <th>"; // line 89 echo __("Ref 1"); echo "</th> <th>"; // line 90 echo __("Ref 2"); echo "</th> <th>"; // line 91 echo __("Ref 3"); echo "</th> <th>"; // line 92 echo __("Ref 4"); echo "</th> <th>"; // line 93 echo __("Ref 5"); echo "</th> <th class=\"rowMenu\">"; // line 94 echo __("Row Menu"); echo "</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> "; } // line 107 public function block_javaScript($context, array $blocks = []) { $macros = $this->macros; // line 108 echo " <script type=\"text/javascript\"> \$(document).ready(function() { var table = \$(\"#users\").DataTable({ \"language\": dataTablesLanguage, dom: dataTablesTemplate, serverSide: true, stateSave: true, responsive: true, stateDuration: 0, stateLoadCallback: dataTableStateLoadCallback, stateSaveCallback: dataTableStateSaveCallback, searchDelay: 3000, \"order\": [[0, \"asc\"]], \"filter\": false, ajax: { url: \""; // line 124 echo twig_escape_filter($this->env, $this->env->getRuntime('Slim\Views\TwigRuntimeExtension')->urlFor("user.search"), "html", null, true); echo "\", \"data\": function (d) { \$.extend(d, \$(\"#users\").closest(\".XiboGrid\").find(\".FilterDiv form\").serializeObject()); } }, \"columns\": [ {\"data\": \"userName\", responsivePriority: 2}, { \"data\": \"homePage\", \"sortable\": false, responsivePriority: 3 }, {\"data\": \"email\", responsivePriority: 3}, { \"name\": \"libraryQuota\", responsivePriority: 3, \"data\": null, \"render\": {\"_\": \"libraryQuota\", \"display\": \"libraryQuotaFormatted\", \"sort\": \"libraryQuota\"} }, {\"data\": \"lastAccessed\", \"visible\": false, responsivePriority: 4}, { \"data\": \"loggedIn\", responsivePriority: 3, \"render\": dataTableTickCrossColumn, \"visible\": false, \"sortable\": false }, { \"data\": \"retired\", responsivePriority: 3, \"render\": dataTableTickCrossColumn }, { \"data\": \"twoFactorTypeId\", responsivePriority: 5, \"visible\": false, \"render\": function (data, type, row) { if (type != \"display\") return data; var icon = \"\"; if (data == 1) icon = \"fa-envelope\"; else if (data == 2) icon = \"fa-google\"; else icon = \"fa-times\"; return '<span class=\"fa ' + icon + '\" title=\"' + (row.twoFactorDescription) + '\"></span>'; } }, {\"data\": \"firstName\", \"visible\": false, responsivePriority: 5}, {\"data\": \"lastName\", \"visible\": false, responsivePriority: 5}, {\"data\": \"phone\", \"visible\": false, responsivePriority: 5}, {\"data\": \"ref1\", \"visible\": false, responsivePriority: 5}, {\"data\": \"ref2\", \"visible\": false, responsivePriority: 5}, {\"data\": \"ref3\", \"visible\": false, responsivePriority: 5}, {\"data\": \"ref4\", \"visible\": false, responsivePriority: 5}, {\"data\": \"ref5\", \"visible\": false, responsivePriority: 5}, { \"orderable\": false, responsivePriority: 1, \"data\": dataTableButtonsColumn } ] }); table.on('draw', dataTableDraw); table.on('processing.dt', dataTableProcessing) dataTableAddButtons(table, \$('#users_wrapper').find('.dataTables_buttons')); \$(\".refresh-grid\").click(function() { table.ajax.reload(); }); }); function userFormOpen(dialog) { // Make a select2 from the home page select var \$userForm = \$(dialog).find(\"form.UserForm\"); var \$groupId = \$(dialog).find(\"select[name=groupId]\"); var \$userTypeId = \$(dialog).find(\"select[name=userTypeId]\"); var \$select = \$(dialog).find(\".homepage-select\"); \$select.select2({ minimumResultsForSearch: Infinity, ajax: { url: \$select.data(\"searchUrl\"), dataType: \"json\", data: function (params) { return { q: params.term, // search term page: params.page, userId: \$userForm.data().userId, groupId: \$groupId.val(), userTypeId: \$userTypeId.val(), }; }, processResults: function (data) { var results = []; \$.each(data.data, function(index, el) { results.push({ \"id\": el.homepage, \"text\": el.title, \"content\": el.description }); }); return { results: results }; } }, templateResult: function(state) { if (!state.content) return state.text; return \$(\"<span>\" + state.content + \"</span>\"); } }); // Bind to the add form submit \$(\".UserForm\").validate({ submitHandler: function (form) { // Grab and alter the value in the library quota field var libraryQuotaField = \$(form).find(\"input[name=libraryQuota]\"); var libraryQuotaUnitsField = \$(form).find(\"select[name=libraryQuotaUnits]\"); var libraryQuota = libraryQuotaField.val(); if (libraryQuotaUnitsField.val() === 'mb') { libraryQuota = libraryQuota * 1024; } else if (libraryQuotaUnitsField.val() === 'gb') { libraryQuota = libraryQuota * 1024 * 1024; } // Set the field libraryQuotaField.prop('value', libraryQuota); XiboFormSubmit(form); }, errorElement: \"span\", highlight: function(element) { \$(element).closest('.form-group').removeClass('has-success').addClass('has-error'); }, success: function(element) { \$(element).closest('.form-group').removeClass('has-error').addClass('has-success'); }, invalidHandler: function(event, validator) { // Remove the spinner \$(this).closest(\".modal-dialog\").find(\".saving\").remove(); // https://github.com/xibosignage/xibo/issues/1589 \$(this).closest(\".modal-dialog\").find(\".save-button\").removeClass(\"disabled\"); } }); } /** * Callback when the onboarding form is opened. */ function onboardingFormOpen(dialog) { \$(dialog).find('[data-toggle=\"popover\"]').popover(); // Init the folder panel "; // line 284 if (twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "featureEnabled", [0 => "folder.view"], "method", false, false, false, 284)) { // line 285 echo " initFolderPanel(dialog); "; } // line 287 echo " var navListItems = \$(dialog).find('div.setup-panel div a'), allWells = \$(dialog).find('.setup-content'), stepWizard = \$(dialog).find('.stepwizard'); navListItems.click(function (e) { e.preventDefault(); var \$target = \$(\$(this).attr('href')), \$item = \$(this); if (!\$item.attr('disabled')) { // Set all step links to inactive navListItems .removeClass('btn-success') .addClass('btn-default'); // Activate this specific one \$item.addClass('btn-success'); // Hide all the panels and show this specific one allWells.hide(); \$target.show(); \$target.find('input:eq(0)').focus(); // Set the active panel on the links stepWizard.data(\"active\", \$target.prop(\"id\")) // Is the next action to finish? if (\$target.data(\"next\") === \"finished\") { \$(dialog).find(\"#onboarding-steper-next-button\").html(\""; // line 316 echo twig_escape_filter($this->env, __("Save"), "html", null, true); echo "\"); } else { \$(dialog).find(\"#onboarding-steper-next-button\").html(\""; // line 318 echo twig_escape_filter($this->env, __("Next"), "html", null, true); echo "\") } } }); // Add some buttons. \$(dialog).find(\".modal-footer\") .append(\$('<a class=\"btn btn-default\">').html(\""; // line 325 echo twig_escape_filter($this->env, __("Close"), "html", null, true); echo "\") .click(function(e) { e.preventDefault(); XiboDialogClose(); })) .append(\$('<a id=\"onboarding-steper-next-button\" class=\"btn\">').html(\""; // line 330 echo twig_escape_filter($this->env, __("Next"), "html", null, true); echo "\") .addClass(\"btn-primary\") .click(function(e) { e.preventDefault(); var steps = \$(dialog).find(\".stepwizard\"), curStep = \$(dialog).find(\"#\" + steps.data(\"active\")), curInputs = curStep.find(\"input[type='text'],input[type='url']\"), isValid = true; // What is the next step? if (curStep.data(\"next\") === \"finished\") { // Keep the form open var \$form = \$(dialog).find(\"#userOnboardingForm\"); \$form.data(\"apply\", true); // Submit the form thereby creating the user XiboFormSubmit(\$form, e, function(xhr) { // Callback if (xhr.success && xhr.id) { "; // line 348 if (twig_get_attribute($this->env, $this->source, ($context["currentUser"] ?? null), "featureEnabled", [0 => "folder.view"], "method", false, false, false, 348)) { // line 349 echo " // Submit the folder ownerships var selected = \$(dialog).find(\"#container-folder-tree\").jstree(\"get_selected\"); var groupIds = {}; groupIds[xhr.data.groupId] = { \"view\": 1, \"edit\": 1 }; \$.ajax(permissionsUrl.replace(\":entity\", \"Folder\"), { \"method\": \"POST\", \"data\": { \"ids\": selected.join(\",\"), \"groupIds\": groupIds }, \"error\": function() { toastr.error(\""; // line 363 echo "Problem saving folder sharing, please check the User created."; echo "\"); } }); "; } // line 367 echo " XiboDialogClose(); } }); } else if (curStep.data(\"next\") === \"onboarding-step-2\" && \$(\"input[name='groupId']:checked\").val() === \"manual\") { // Load the user add form. XiboDialogClose(); XiboFormRender(\""; // line 374 echo twig_escape_filter($this->env, $this->env->getRuntime('Slim\Views\TwigRuntimeExtension')->urlFor("user.add.form"), "html", null, true); echo "\"); } else { var nextStepWizard = steps.find(\"a[href='#\" + curStep.data(\"next\") + \"']\"); \$(dialog).find(\".form-group\").removeClass(\"has-error\"); for (var i = 0; i < curInputs.length; i++) { if (!curInputs[i].validity.valid) { isValid = false; \$(curInputs[i]).closest(\".form-group\").addClass(\"has-error\"); } } // Set the defaults. if (curStep.data(\"next\") === \"onboarding-step-2\") { var \$userGroupSelected = \$(\"input[name='groupId']:checked\"); \$(dialog).find(\"input[name=homePageId]\").val(\$userGroupSelected.data(\"defaultHomepageId\")); } if (isValid) { nextStepWizard.removeAttr('disabled').trigger('click'); } } })); } function initFolderPanel(dialog) { var \$container = \$(dialog).find(\"#container-folder-tree\"); \$container.jstree({ \"plugins\": [\"checkbox\", \"sort\"], \"themes\" : { \"responsive\" : true }, \"core\": { \"data\": { \"url\": foldersUrl } }, \"checkbox\" : { \"three_state\" : false }, }).on(\"ready.jstree\", function(e, data) { \$(this).jstree().disable_checkbox(1); \$(this).jstree().disable_node(1); \$(this).jstree(\"open_all\"); }); } </script> "; } public function getTemplateName() { return "user-page.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 553 => 374, 544 => 367, 537 => 363, 521 => 349, 519 => 348, 498 => 330, 490 => 325, 480 => 318, 475 => 316, 444 => 287, 440 => 285, 438 => 284, 275 => 124, 257 => 108, 253 => 107, 237 => 94, 233 => 93, 229 => 92, 225 => 91, 221 => 90, 217 => 89, 213 => 88, 209 => 87, 205 => 86, 201 => 85, 197 => 84, 193 => 83, 189 => 82, 185 => 81, 181 => 80, 177 => 79, 173 => 78, 161 => 70, 158 => 69, 154 => 68, 148 => 66, 144 => 65, 134 => 58, 125 => 52, 116 => 46, 111 => 44, 108 => 43, 104 => 42, 94 => 38, 84 => 36, 81 => 35, 78 => 34, 75 => 33, 72 => 32, 69 => 31, 67 => 30, 64 => 29, 60 => 28, 52 => 26, 47 => 23, 45 => 24, 38 => 23,); } public function getSourceContext() { return new Source("", "user-page.twig", "/home/mgatv524/public_html/cms311/views/user-page.twig"); } }