public static function draw() { $url = new UrlParams(); $urlParams = $url->getQueryArray(); if (array_key_exists('pass-builder', $urlParams)) { $passBuilder = $urlParams['pass-builder']; $action = array_key_exists('q', $urlParams) ? $urlParams['q'] : ''; if ($action == '') { switch ($passBuilder) { case 'managment': include dirname(dirname(__FILE__)) . '/templates/pass-management-grid.php'; break; case 'templates': include dirname(dirname(__FILE__)) . '/templates/pass-templates-grid.php'; break; } } else { if ($passBuilder == 'templates' && $action == 'create') { include dirname(dirname(__FILE__)) . '/templates/create-pass-form.php'; } if ('templates' === $passBuilder && 'edit' === $action) { include dirname(dirname(__FILE__)) . '/templates/edit-pass-form.php'; } } } //print_r($urlParams); }
function passbuilder_template($template) { $url = new UrlParams(); $current_role = Helper::getRole(); $urlParams = $url->getQueryArray(); if (array_key_exists('pass-builder', $urlParams)) { if (is_user_logged_in()) { if ($current_role != '') { // form submit handle here if ($_POST['formAction']) { $handler = new FormHandler($_POST['formAction']); $handler->handleSubmit(); } if ($_GET['action']) { $handler = new ActionHandler($_GET['action']); $handler->fireAction(); } return dirname(__FILE__) . '/templates/page-pass-template.php'; } else { return dirname(__FILE__) . '/templates/page-permission-exceptions.php'; } } else { $loginUrl = ICL_LANGUAGE_CODE == 'en' ? get_site_url() . '/log-in/' : get_site_url() . '/da/log-in-2/'; wp_redirect($loginUrl); } } return $template; }
//ini_set("display_errors",1); //error_reporting(E_ALL); // Подключение библиотек ядра include_once './ROOT/functions/includeSistemClasses.php'; includeSistemClasses(); // Инициализация параметров global $_PARAM; $_PARAM = null; // Инициализация конфигурации global $_SITECONFIG; $_SITECONFIG = new SiteConfig(); // Создание помошника базы данных global $_SQL_HELPER; $_SQL_HELPER = new MysqliHelper(); // Поулчение параметров ссылки $urlParams = new UrlParams(); global $_URL_PARAMS; $_URL_PARAMS = $urlParams->getUrlParam(); $urlHelper = new UrlHelper(); // Получение карты сайта global $SITE_MAP; $SITE_MAP = new SiteMap(); // Работа со страницей if (!$_SITECONFIG->getSiteClosed()) { if ($_URL_PARAMS['isRedirect']) { // Перенаправить если необходимо изменить URL header('Location: ' . $urlHelper->createUrlWithHTTP($_URL_PARAMS['page'], $_URL_PARAMS['lang'], $_URL_PARAMS['params'])); } else { // Инициализация локали global $LOCAL; $LOCAL = new Localization();