Last active
January 12, 2022 09:55
-
-
Save BekNaji/ff26f75567b4fcdc1c0499ea7215e6df to your computer and use it in GitHub Desktop.
Simple options.php file for bitrix module || Простой файл options.php для модуля bitrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Author: Bekzod Najmiddinov | |
* Email: bekturk333@gmail.com | |
*/ | |
$moduleId = "module_id"; | |
$siteId = ""; | |
$aTabs = | |
[ | |
[ | |
'DIV' => 'sms_integration', | |
'TAB' =>"Интегратця SMS", | |
'OPTIONS' => | |
[ | |
"Playmobile.uz", | |
['play_mobile_url',"URL",null, | |
['text',50] | |
], | |
['play_mobile_login',"Логин",null, | |
['text',50] | |
], | |
['play_mobile_password',"Парол",null, | |
['text',50] | |
], | |
"Opersms.uz", | |
['oper_sms_url',"URL",null, | |
['text',50] | |
], | |
['oper_sms_login',"Логин",null, | |
['text',50] | |
], | |
['oper_sms_password',"Парол",null, | |
['text',50] | |
], | |
], | |
], | |
[ | |
'DIV' => 'inn_integration', | |
'TAB' =>"Интегратця ИНН", | |
'OPTIONS' => | |
[ | |
"ИНН", | |
['inn_url',"URL",null, | |
['text',50] | |
], | |
['inn_login',"Логин",null, | |
['text',50] | |
], | |
['inn_password',"Парол",null, | |
['text',50] | |
], | |
], | |
], | |
]; | |
if ($_SERVER['REQUEST_METHOD'] == 'POST' && strlen($_REQUEST['save']) > 0 && check_bitrix_sessid()) | |
{ | |
foreach ($aTabs as $aTab) | |
{ | |
__AdmSettingsSaveOptions($moduleId, $aTab['OPTIONS']); | |
} | |
LocalRedirect($APPLICATION->GetCurPage() . '?lang=' . LANGUAGE_ID . '&mid_menu=1&mid=' . urlencode($moduleId) . | |
'&tabControl_active_tab=' . urlencode($_REQUEST['tabControl_active_tab']) . '&sid=' . urlencode($siteId)); | |
} | |
$tabControl = new CAdminTabControl('tabControl', $aTabs); | |
?> | |
<form method='post' action='<? echo $APPLICATION->GetCurPage() ?>?mid=<?=htmlspecialcharsbx($request['mid'])?>&lang=<?=$request['lang']?>' name='bootstrap'> | |
<? $tabControl->Begin(); | |
foreach ($aTabs as $aTab) | |
{ | |
$tabControl->BeginNextTab(); | |
__AdmSettingsDrawList($moduleId, $aTab['OPTIONS']); | |
} | |
$tabControl->Buttons(array('btnApply' => false, 'btnCancel' => false, 'btnSaveAndAdd' => false)); ?> | |
<?= bitrix_sessid_post(); ?> | |
<? $tabControl->End(); ?> | |
</form> | |
<? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment