本文整理汇总了PHP中CAdminList::addAdminContextMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::addAdminContextMenu方法的具体用法?PHP CAdminList::addAdminContextMenu怎么用?PHP CAdminList::addAdminContextMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::addAdminContextMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CAdminSorting
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
IncludeModuleLangFile(__FILE__);
Bitrix\Main\Loader::includeModule('abtest');
$arLang = $APPLICATION->getLang();
if (!$USER->canDoOperation('view_other_settings')) {
$APPLICATION->authForm(getMessage('ACCESS_DENIED'));
}
$isAdmin = $USER->canDoOperation('edit_php');
$sTableID = "t_abtest_admin";
$oSort = new CAdminSorting($sTableID, 'id', 'asc');
$lAdmin = new CAdminList($sTableID, $oSort);
$aContext = array(array("ICON" => "btn_new", "TEXT" => getMessage('ABTEST_BTN_NEW'), "LINK" => "abtest_edit.php?lang=" . LANGUAGE_ID, "TITLE" => getMessage('ABTEST_BTN_NEW')));
$lAdmin->addAdminContextMenu($aContext);
if ($isAdmin && ($arID = $lAdmin->groupAction())) {
if ($_REQUEST['action'] == 'start') {
$arActiveTests = array();
$result = Bitrix\ABTest\ABTestTable::getList(array('filter' => array('ACTIVE' => 'Y'), 'select' => array('ID', 'SITE_ID')));
while ($abtest = $result->fetch()) {
if (!isset($arActiveTests[$abtest['SITE_ID']])) {
$arActiveTests[$abtest['SITE_ID']] = array();
}
$arActiveTests[$abtest['SITE_ID']][] = $abtest['ID'];
}
}
foreach ($arID as $ID) {
$ID = intval($ID);
if ($ID <= 0) {
continue;
}