155 global $USER, $APPLICATION;
157 if ($USER->canDoOperation(
'view_other_settings'))
161 $baseUri = \CHTTP::urlDeleteParams($APPLICATION->getCurPage(), array(
'abtest_mode'));
163 $groupAUri = \CHTTP::urlAddParams($baseUri, array(
'abtest_mode' => intval($context[
'abtest']).
'|A'));
164 $groupBUri = \CHTTP::urlAddParams($baseUri, array(
'abtest_mode' => intval($context[
'abtest']).
'|B'));
165 $resetUri = \CHTTP::urlAddParams($baseUri, array(
'abtest_mode' =>
'reset'));
167 $APPLICATION->addPanelButton(array(
168 'ID' =>
'abtest_options',
169 'SRC' => $context[
'section'] ==
'B' ?
'/bitrix/images/abtest/ab-icon-b.png' :
'/bitrix/images/abtest/ab-icon-a.png',
170 'TEXT' => str_replace(
'#ID#', intval($context[
'abtest']), Localization\
Loc::getMessage(
'ABTEST_PANEL_MENU_BTN')),
176 'ACTION' =>
"jsUtils.Redirect([], '".\CUtil::jsEscape($groupAUri).
"'); ",
178 'CHECKED' => $context[
'section'] ==
'A' ?
true :
false,
181 'ACTION' =>
"jsUtils.Redirect([], '".\CUtil::jsEscape($groupBUri).
"'); ",
182 'TEXT' => Localization\Loc::getMessage(
'ABTEST_PANEL_MENU_MODE_B'),
183 'CHECKED' => $context[
'section'] ==
'B' ? true :
false,
186 'ACTION' =>
"jsUtils.Redirect([], '".\CUtil::jsEscape($resetUri).
"'); ",
187 'TEXT' => Localization\Loc::getMessage(
'ABTEST_PANEL_MENU_RESET'),