function remove_urls() { global $tpl, $mysql, $twig; $ULIB = new urlLibrary(); $ULIB->loadConfig(); $ULIB->removeCommand('eshop', ''); $ULIB->removeCommand('eshop', 'show'); $ULIB->removeCommand('eshop', 'search'); $ULIB->removeCommand('eshop', 'stocks'); $ULIB->removeCommand('eshop', 'compare'); $ULIB->removeCommand('eshop', 'currency'); $ULIB->removeCommand('eshop', 'yml_export'); $ULIB->removeCommand('eshop', 'ebasket_list'); $ULIB->removeCommand('eshop', 'order'); $ULIB->removeCommand('eshop', 'payment'); $ULIB->saveConfig(); $UHANDLER = new urlHandler(); $UHANDLER->loadConfig(); $UHANDLER->removePluginHandlers('eshop', ''); $UHANDLER->removePluginHandlers('eshop', 'show'); $UHANDLER->removePluginHandlers('eshop', 'search'); $UHANDLER->removePluginHandlers('eshop', 'stocks'); $UHANDLER->removePluginHandlers('eshop', 'compare'); $UHANDLER->removePluginHandlers('eshop', 'currency'); $UHANDLER->removePluginHandlers('eshop', 'yml_export'); $UHANDLER->removePluginHandlers('eshop', 'ebasket_list'); $UHANDLER->removePluginHandlers('eshop', 'order'); $UHANDLER->removePluginHandlers('eshop', 'payment'); $UHANDLER->saveConfig(); }
function remove_gsmg_urls() { $ULIB = new urlLibrary(); $ULIB->loadConfig(); $ULIB->removeCommand('gsmg', ''); $ULIB->saveConfig(); $UHANDLER = new urlHandler(); $UHANDLER->loadConfig(); $UHANDLER->removePluginHandlers('gsmg', ''); $UHANDLER->saveConfig(); }
function show_options() { global $tpl, $mysql, $lang, $twig; $tpath = locatePluginTemplates(array('config/main', 'config/settings'), 'guestbook', 1); if (isset($_REQUEST['submit'])) { pluginSetVariable('guestbook', 'usmilies', secure_html($_REQUEST['usmilies'])); pluginSetVariable('guestbook', 'ubbcodes', secure_html($_REQUEST['ubbcodes'])); pluginSetVariable('guestbook', 'minlength', intval($_REQUEST['minlength'])); pluginSetVariable('guestbook', 'maxlength', intval($_REQUEST['maxlength'])); pluginSetVariable('guestbook', 'guests', secure_html($_REQUEST['guests'])); pluginSetVariable('guestbook', 'ecaptcha', secure_html($_REQUEST['ecaptcha'])); pluginSetVariable('guestbook', 'public_key', secure_html($_REQUEST['public_key'])); pluginSetVariable('guestbook', 'private_key', secure_html($_REQUEST['private_key'])); pluginSetVariable('guestbook', 'perpage', intval($_REQUEST['perpage'])); pluginSetVariable('guestbook', 'order', secure_html($_REQUEST['order'])); pluginSetVariable('guestbook', 'date', secure_html($_REQUEST['date'])); pluginSetVariable('guestbook', 'send_email', secure_html($_REQUEST['send_email'])); pluginSetVariable('guestbook', 'approve_msg', secure_html($_REQUEST['approve_msg'])); pluginSetVariable('guestbook', 'admin_count', intval($_REQUEST['admin_count'])); if (isset($_REQUEST['url']) && intval($_REQUEST['url']) == 1) { $ULIB = new urlLibrary(); $ULIB->loadConfig(); $ULIB->registerCommand('guestbook', '', array('vars' => array('page' => array('matchRegex' => '\\d{1,4}', 'descr' => array('russian' => 'Страница')), 'act' => array('matchRegex' => '.+?', 'descr' => array('russian' => 'action'))), 'descr' => array('russian' => 'Гостевая книга'))); $ULIB->registerCommand('guestbook', 'edit', array('vars' => array('id' => array('matchRegex' => '\\d+', 'descr' => array('russian' => 'ID записи'))), 'descr' => array('russian' => 'Редактирование'))); $ULIB->saveConfig(); } else { $ULIB = new urlLibrary(); $ULIB->loadConfig(); $ULIB->removeCommand('guestbook', ''); $ULIB->removeCommand('guestbook', 'edit'); $ULIB->saveConfig(); } pluginSetVariable('guestbook', 'url', intval($_REQUEST['url'])); pluginsSaveConfig(); msg(array("text" => $lang['gbconfig']['msgo_settings_saved'])); } $usmilies = pluginGetVariable('guestbook', 'usmilies'); $ubbcodes = pluginGetVariable('guestbook', 'ubbcodes'); $minlength = pluginGetVariable('guestbook', 'minlength'); $maxlength = pluginGetVariable('guestbook', 'maxlength'); $guests = pluginGetVariable('guestbook', 'guests'); $ecaptcha = pluginGetVariable('guestbook', 'ecaptcha'); $public_key = pluginGetVariable('guestbook', 'public_key'); $private_key = pluginGetVariable('guestbook', 'private_key'); $perpage = pluginGetVariable('guestbook', 'perpage'); $order = pluginGetVariable('guestbook', 'order'); $date = pluginGetVariable('guestbook', 'date'); $send_email = pluginGetVariable('guestbook', 'send_email'); $approve_msg = pluginGetVariable('guestbook', 'approve_msg'); $admin_count = pluginGetVariable('guestbook', 'admin_count'); $url = pluginGetVariable('guestbook', 'url'); $xt = $twig->loadTemplate($tpath['config/settings'] . 'config/settings.tpl'); $tVars = array('skins_url' => skins_url, 'home' => home, 'tpl_home' => admin_url, 'usmilies' => $usmilies, 'ubbcodes' => $ubbcodes, 'minlength' => $minlength, 'maxlength' => $maxlength, 'guests' => $guests, 'ecaptcha' => $ecaptcha, 'public_key' => $public_key, 'private_key' => $private_key, 'perpage' => $perpage, 'order' => $order, 'url' => $url, 'date' => $date, 'send_email' => $send_email, 'approve_msg' => $approve_msg, 'admin_count' => $admin_count); $xg = $twig->loadTemplate($tpath['config/main'] . 'config/main.tpl'); $tVars = array('entries' => $xt->render($tVars)); print $xg->render($tVars); }