Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/modules/esolutions.exportexcel/ |
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/modules/esolutions.exportexcel/options.php |
<? use Bitrix\Main\Localization\Loc; $module_id = 'esolutions.exportexcel'; if($USER->IsAdmin()) { Loc::loadMessages(__FILE__); $aTabs = array( array("DIV" => "edit1", "TAB" => Loc::getMessage("MAIN_TAB_RIGHTS"), "ICON" => "form_settings", "TITLE" => Loc::getMessage("MAIN_TAB_TITLE_RIGHTS")), ); $tabControl = new CAdminTabControl("kdaExportexcelTabControl", $aTabs, true, true); if ($_SERVER['REQUEST_METHOD'] == "GET" && isset($_GET['RestoreDefaults']) && !empty($_GET['RestoreDefaults']) && check_bitrix_sessid()) { COption::RemoveOption($module_id); $arGROUPS = array(); $z = CGroup::GetList($v1, $v2, array("ACTIVE" => "Y", "ADMIN" => "N")); while($zr = $z->Fetch()) { $ar = array(); $ar["ID"] = intval($zr["ID"]); $ar["NAME"] = htmlspecialcharsbx($zr["NAME"])." [<a title=\"".GetMessage("MAIN_USER_GROUP_TITLE")."\" href=\"/bitrix/admin/group_edit.php?ID=".intval($zr["ID"])."&lang=".LANGUAGE_ID."\">".intval($zr["ID"])."</a>]"; $groups[$zr["ID"]] = "[".$zr["ID"]."] ".$zr["NAME"]; $arGROUPS[] = $ar; } reset($arGROUPS); while (list(,$value) = each($arGROUPS)) $APPLICATION->DelGroupRight($module_id, array($value["ID"])); LocalRedirect($APPLICATION->GetCurPage().'?lang='.LANGUAGE_ID.'&mid_menu=1&mid='.$module_id); } if ($_SERVER['REQUEST_METHOD'] == 'POST' && check_bitrix_sessid()) { if(isset($_POST['Update']) && $_POST['Update'] === 'Y' && is_array($_POST['SETTINGS'])) { foreach($_POST['SETTINGS'] as $k=>$v) { COption::SetOptionString($module_id, $k, $v); } //LocalRedirect($APPLICATION->GetCurPage().'?lang='.LANGUAGE_ID.'&mid_menu=1&mid='.$module_id.'&'.$tabControl->ActiveTabParam()); } } $tabControl->Begin(); ?> <form method="POST" action="<?echo $APPLICATION->GetCurPage()?>?lang=<?echo LANGUAGE_ID?>&mid_menu=1&mid=<?=$module_id?>" name="kda_importexacel_settings"> <? echo bitrix_sessid_post();?> <?$tabControl->BeginNextTab();?> <?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_rights.php");?> <? $tabControl->Buttons();?> <script type="text/javascript"> function RestoreDefaults() { if (confirm('<? echo CUtil::JSEscape(Loc::getMessage("KDA_EE_OPTIONS_BTN_HINT_RESTORE_DEFAULT_WARNING")); ?>')) window.location = "<?echo $APPLICATION->GetCurPage()?>?lang=<? echo LANGUAGE_ID; ?>&mid_menu=1&mid=<? echo $module_id; ?>&RestoreDefaults=Y&<?=bitrix_sessid_get()?>"; } </script> <input type="submit" name="Update" value="<?echo Loc::getMessage("KDA_EE_OPTIONS_BTN_SAVE")?>"> <input type="hidden" name="Update" value="Y"> <input type="reset" name="reset" value="<?echo Loc::getMessage("KDA_EE_OPTIONS_BTN_RESET")?>"> <input type="button" title="<?echo Loc::getMessage("KDA_EE_OPTIONS_BTN_HINT_RESTORE_DEFAULT")?>" onclick="RestoreDefaults();" value="<?echo Loc::getMessage("KDA_EE_OPTIONS_BTN_RESTORE_DEFAULT")?>"> <?$tabControl->End();?> </form> <? } ?>