Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/burlakastudio.realcommenter/ |
Upload File : |
<?php use Bitrix\Main\Application; use Bitrix\Main\Config\Option; use Bitrix\Main\Loader; use Bitrix\Main\Localization\Loc; use Bitrix\Main\Page\Asset; use Burlakastudio\Realcommenter\OPTIONS; if (!$USER->isAdmin()) { $APPLICATION->authForm(''); } Loc::loadLanguageFile( Application::getInstance()->getContext()->getServer()->getDocumentRoot() . '/bitrix/modules/main/options.php' ); Loc::loadLanguageFile(__FILE__); $adminModuleName = 'burlakastudio.realcommenter'; if (!Loader::includeModule($adminModuleName)) { ShowMessage([ 'MESSAGE' => Loc::getMessage('MODULE_NOT_FOUND'), 'TYPE' => 'ERROR', ]); exit; } $request = Application::getInstance()->getContext()->getRequest(); if (check_bitrix_sessid()) { if (!empty($restore) && check_bitrix_sessid()) { OPTIONS::set_module_options_to_default(); (new CAdminMessage([ 'MESSAGE' => Loc::getMessage('REFERENCES_OPTIONS_RESTORED'), 'TYPE' => 'OK', ]))->Show(); } else if (!empty($save) && $request->isPost()) { OPTIONS::saveModuleOptions(); } } $tab_tree = OPTIONS::getModuleOptions(); $tab_controls_list = []; foreach ($tab_tree as $tab_id => $tab_struct) { $tab_label = $tab_struct['INFO']['TAB'] ?: Loc::getMessage($tab_id . '_LABEL'); $tab_title = $tab_struct['INFO']['TITLE'] ?: Loc::getMessage($tab_id . '_TITLE'); $tab_controls_list[] = [ 'DIV' => $tab_id, 'TAB' => $tab_label, 'TITLE' => $tab_title, ]; } $tabControl = new CAdminTabControl('tabControl', $tab_controls_list); $css = '/bitrix/modules/burlakastudio.realcommenter/css/options.css'; $css_mtime = filemtime($_SERVER['DOCUMENT_ROOT'] . $css); Asset::getInstance()->addString( sprintf('<link rel="stylesheet" type="text/css" href="%s?x=%s">', $css, $css_mtime) ); ?> <div class='adm-info-message' style='margin-top: 0; max-width: 800px;'> <?= Loc::getMessage('ITAPE_WELCOME_TO_REALCOMMENTER_LOG') ?> </div><?php $tabControl->begin(); ?> <form method="post" class="burlakastudio_realcommenter" action="<?= sprintf( '%s?mid=%s&lang=%s', $request->getRequestedPage(), urlencode($mid), LANGUAGE_ID ) ?>"> <?= bitrix_sessid_post() ?><?php // ��������� tab-� foreach ($tab_tree as $tab_id => $tab_struct) { $tabControl->beginNextTab(); if ($tab_struct['FOREWORD']) { ?><?= $tab_struct['FOREWORD'] ?> <hr><?php } if (empty($tab_struct['LIST'])) { continue; } foreach ($tab_struct['LIST'] as $option_key => $option_info) { $option_value = Option::get($adminModuleName, $option_key, $option_info['DEFAULT']); ?> <tr> <td width="40%"> <label for="<?= $option_key ?>"><?= Loc::getMessage($option_key) ?> :</label> </td> <td width="60%"> <?php switch ($option_info['TYPE']) { case 'text' : ?> <textarea type="text" name="<?= $option_key ?>" rows="5"><?= $option_value ?></textarea> <?php break; case 'checkbox' : ?> <input type="checkbox" name="<?= $option_key ?>" <?= $option_value ? 'checked="checked"' : '' ?>" value= '1'> <?php break; case 'list' : ?> <select name="<?= $option_key ?>"> <?php foreach ($option_info['LIST'] as $list_id => $list_option) { ?> <option value="<?= $list_id ?>" <?php if ($list_option['DISABLED']) { ?> disabled<?php } ?> <?php if ($option_value == $list_id) { ?> selected<?php } ?> > <?= $list_option['LABEL'] ?> </option> <?php } ?> </select> <?php break; default: ?> <input type="text" name="<?= $option_key ?>" value="<?= $option_value ?>"> <?php } ?> </td> </tr> <?php } } $tabControl->buttons(); ?> <input type="submit" name="save" value="<?= Loc::getMessage('MAIN_SAVE') ?>" title="<?= Loc::getMessage('MAIN_OPT_SAVE_TITLE') ?>" class="adm-btn-save" /> <input type="submit" name="restore" title="<?= Loc::getMessage('MAIN_HINT_RESTORE_DEFAULTS') ?>" onclick="return confirm('<?= AddSlashes(GetMessage('MAIN_HINT_RESTORE_DEFAULTS_WARNING')) ?>')" value="<?= Loc::getMessage('MAIN_RESTORE_DEFAULTS') ?>" /> <?php $tabControl->end(); ?> </form>