本文整理汇总了PHP中CAdminList::GroupAction方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::GroupAction方法的具体用法?PHP CAdminList::GroupAction怎么用?PHP CAdminList::GroupAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::GroupAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CAdminSorting
$sorting = new CAdminSorting($tableID, "name", "asc");
$adminList = new CAdminList($tableID, $sorting);
/** @var $request Main\HttpRequest */
$request = Main\Context::getCurrent()->getRequest();
if ($adminList->EditAction() && $isAdmin) {
foreach ($request["FIELDS"] as $ID => $arFields) {
if (!$adminList->IsUpdated($ID)) {
continue;
}
$result = CultureTable::update($ID, $arFields);
if (!$result->isSuccess()) {
$adminList->AddUpdateError("(ID=" . $ID . ") " . implode("<br>", $result->getErrorMessages()), $ID);
}
}
}
if (($arID = $adminList->GroupAction()) && $isAdmin) {
if ($request['action_target'] == 'selected') {
$arID = array();
$data = CultureTable::getList();
while ($culture = $data->fetch()) {
$arID[] = $culture['ID'];
}
}
foreach ($arID as $ID) {
if (intval($ID) <= 0) {
continue;
}
switch ($request['action_button']) {
case "delete":
$result = CultureTable::delete($ID);
if (!$result->isSuccess()) {
示例2: foreach
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
$DB->StartTransaction();
$ID = intval($ID);
$em = new CEventMessage();
if (!$em->Update($ID, $arFields)) {
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $em->LAST_ERROR, $ID);
$DB->Rollback();
}
$DB->Commit();
}
}
// Actions
if (($arID = $lAdmin->GroupAction()) && $isAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CEventMessage::GetList($by, $order, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
$emessage = new CEventMessage();
switch ($_REQUEST['action']) {
case "delete":
$DB->StartTransaction();
示例3: CAdminList
define("PERFMON_STOP", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
/** @global CMain $APPLICATION */
/** @global CDatabase $DB */
/** @global CUser $USER */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/prolog.php";
IncludeModuleLangFile(__FILE__);
$RIGHT = $APPLICATION->GetGroupRight("perfmon");
if ($RIGHT == "D" || $DB->type !== "MYSQL") {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$isAdmin = $USER->CanDoOperation('edit_php');
$sTableID = "tbl_perfmon_index_complete";
$lAdmin = new CAdminList($sTableID, $oSort);
if (($arID = $lAdmin->GroupAction()) && $RIGHT >= "W") {
switch ($_REQUEST['action']) {
case "delete_ban":
foreach ($arID as $ID) {
CPerfomanceIndexComplete::Delete($ID);
}
break;
case "delete_index":
if ($isAdmin) {
foreach ($arID as $ID) {
$rs = CPerfomanceIndexComplete::GetList(array("=ID" => $ID));
while ($ar = $rs->Fetch()) {
if ($DB->Query("ALTER TABLE " . $ar["TABLE_NAME"] . " DROP INDEX " . $ar["INDEX_NAME"])) {
CPerfomanceIndexComplete::Delete($ID);
}
}
示例4: unset
if (!$value) {
unset($arFilter[$key]);
}
}
if ($lAdmin->EditAction() && $RIGHT_W) {
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
$cData = new CSecurityIPRule();
if (!$cData->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("SEC_IP_LIST_UPDATE_ERROR") . " " . $cData->LAST_ERROR, $ID);
}
}
}
if (($arID = $lAdmin->GroupAction()) && $RIGHT_W) {
if ($_REQUEST['action_target'] == 'selected') {
$cData = new CSecurityIPRule();
$rsData = $cData->GetList(array('ID'), $arFilter, array());
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
switch ($_REQUEST['action']) {
case "delete":
if (!CSecurityIPRule::Delete($ID)) {
示例5: ShowError
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
if (!Main\Loader::includeModule('socialservices')) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE_SOCSERV"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
$engine = new Engine\YandexDirect();
$currentUser = $engine->getCurrentUser();
$bNeedAuth = !is_array($currentUser);
$request = Main\Context::getCurrent()->getRequest();
$archive = isset($request['archive']) && $request['archive'] == 1;
$tableID = "tbl_yandex_direct_campaign";
$oSort = new \CAdminSorting($tableID, "ID", "desc");
$adminList = new \CAdminList($tableID, $oSort);
if (!$bNeedAuth && ($campaignIDs = $adminList->GroupAction())) {
// we have no group actions here
$campaignId = intval($campaignIDs[0]);
if ($campaignId > 0) {
if ($_REQUEST['action'] == 'delete') {
try {
$result = Adv\YandexCampaignTable::delete($campaignId);
if (!$result->isSuccess()) {
$errorsList = $result->getErrorMessages();
foreach ($errorsList as $errorMessage) {
$adminList->AddGroupError($errorMessage, $campaignId);
}
}
} catch (Engine\YandexDirectException $e) {
// if we got an error from yandex - kill only local mirror
Adv\YandexCampaignTable::setSkipRemoteUpdate(true);
示例6: CAdminList
$lAdmin = new CAdminList($sTableID, $oSort);
if ($_REQUEST['mode'] == 'list' || $_REQUEST['mode'] == 'frame') {
CFile::DisableJSFunction(true);
}
if ($lAdmin->EditAction() && $edit_php) {
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
$ob = new CSiteTemplate();
if (!$ob->Update($ID, $arFields)) {
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $ob->LAST_ERROR, $ID);
}
}
}
if (($arID = $lAdmin->GroupAction()) && $edit_php) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$rsData = CSiteTemplate::GetList($by, $order, array());
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if ($ID == '') {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
if (!CSiteTemplate::Delete($ID)) {
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
示例7: ShowError
use Bitrix\Seo\SitemapTable;
use Bitrix\Seo\SitemapRuntime;
use Bitrix\Seo\SitemapRuntimeTable;
Loc::loadMessages(dirname(__FILE__) . '/seo_sitemap_pro.php');
if (!$USER->CanDoOperation('seo_tools')) {
$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
if (!Main\Loader::includeModule('seo')) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
$tableID = "tbl_sitemap";
$oSort = new CAdminSorting($tableID, "ID", "desc");
$adminList = new CAdminList($tableID, $oSort);
if ($arID = $adminList->GroupAction()) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$rsData = SitemapTable::getList(array("select" => array("ID")));
while ($arRes = $rsData->fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
$ID = intval($ID);
if ($ID <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
SitemapRuntimeTable::clearByPid($ID);
示例8: array
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError($ex->GetString(), $ID);
} else {
$lAdmin->AddUpdateError(GetMessage("SONET_ERROR_UPDATE"), $ID);
}
}
}
}
if ($bError) {
$DB->Rollback();
}
}
$DB->Commit();
}
}
if (($arID = $lAdmin->GroupAction()) && $socialnetworkModulePermissions >= "W") {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$dbResultList = CSocNetGroup::GetList(array($by => $order), $arFilter, false, false, array("ID"));
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
示例9: array
}
if ($bSearch) {
// Rename item in search result DB
CFilemanSearch::RenameInSearchResult($searchSess, $pathFrom, $pathTo);
}
$APPLICATION->CopyFileAccessPermission($arPath_i, array($site, $pathTo));
$APPLICATION->RemoveFileAccessPermission($arPath_i);
}
}
}
}
}
$handle_action = false;
}
// Handling actions: group and single
if (($arID = $lAdmin->GroupAction()) && ($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_admin_folders')) && $handle_action) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
if ($bSearch) {
$searchRes = CFilemanSearch::GetSearchResult($searchSess);
for ($i = 0, $l = count($searchRes); $i < $l; $i++) {
$arID[] = $searchRes[$i]['path'];
}
} elseif (!CSite::IsDistinctDocRoots() || strlen($site) > 0 || strlen($path) > 0) {
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$path = $io->CombinePath("/", $path);
$arParsedPath = CFileMan::ParsePath(array($site, $path));
$abs_path = $DOC_ROOT . $path;
CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, $arFilter, array($by => $order), "DF", false, true);
foreach ($arDirs as $Dir) {
$arID[] = $Dir["NAME"];
示例10: array
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
/** @global CMain $APPLICATION */
/** @global CDatabase $DB */
/** @global CUser $USER */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/prolog.php";
IncludeModuleLangFile(__FILE__);
$RIGHT = $APPLICATION->GetGroupRight("perfmon");
if ($RIGHT == "D") {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$arEngines = array("MYISAM" => array("NAME" => "MyISAM"), "INNODB" => array("NAME" => "InnoDB"));
$sTableID = "t_perfmon_all_tables";
$oSort = new CAdminSorting($sTableID, "TABLE_NAME", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
if (($arTABLES = $lAdmin->GroupAction()) && $RIGHT >= "W") {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CPerfomanceTableList::GetList();
while ($ar = $rsData->Fetch()) {
$arTABLES[] = $ar["TABLE_NAME"];
}
}
foreach ($arEngines as $id => $ar) {
if ($_REQUEST['action'] == "convert_to_" . $id) {
$_REQUEST["action"] = "convert";
$_REQUEST["to"] = $id;
break;
}
}
$to = strtoupper($_REQUEST["to"]);
foreach ($arTABLES as $table_name) {
示例11: foreach
if (!empty($res['errors'])) {
foreach ($res['errors'] as &$error) {
$error = ' ' . $error;
}
unset($error);
throw new Main\SystemException(implode(',<br />', $res['errors']));
}
} catch (Main\SystemException $e) {
// todo: do smth
$lAdmin->AddUpdateError(Loc::getMessage('SALE_LOCATION_L_ITEM_SAVE_ERROR', array('#ITEM#' => $id)) . ": <br />" . $e->getMessage() . '<br />', $id);
$DB->Rollback();
}
$DB->Commit();
}
}
if (($ids = $lAdmin->GroupAction()) && $userIsAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
// get all ids if they were not specified (user choice was "for all")
$ids = Helper::getIdsByFilter($listParams['filter']);
}
@set_time_limit(0);
foreach ($ids as $id) {
if (!($id = intval($id))) {
continue;
}
if ($_REQUEST['action'] == 'delete') {
$DB->StartTransaction();
try {
$res = Helper::delete($id);
if (!$res['success']) {
throw new Main\SystemException(Loc::getMessage('SALE_LOCATION_L_ITEM') . ' ' . $id . ' : ' . implode('<br />', $res['errors']));
示例12: CTest
continue;
}
$DB->StartTransaction();
$ob = new CTest();
if (!$ob->Update($ID, $arFields)) {
if ($e = $APPLICATION->GetException()) {
$e = $APPLICATION->GetException();
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $e->GetString(), $ID);
$DB->Rollback();
}
}
$DB->Commit();
}
}
// group and single actions processing
if (!$isReadOnly && ($arID = $lAdmin->GroupAction())) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CTest::GetList(array($by => $order), $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
示例13: foreach
if (($rsData = $cData->GetByID($ID)) && ($arData = $rsData->Fetch())) {
foreach ($arFields as $key => $value) {
$arData[$key] = $value;
}
if (!$cData->Update($ID, $arData)) {
$lAdmin->AddGroupError(GetMessage("customrank_edit_error") . $cData->LAST_ERROR, $ID);
$DB->Rollback();
}
} else {
$lAdmin->AddGroupError(GetMessage("customrank_edit_error") . " " . GetMessage("customrank_no_rule"), $ID);
$DB->Rollback();
}
$DB->Commit();
}
}
if (($arID = $lAdmin->GroupAction()) && $SEARCH_RIGHT == "W") {
if ($_REQUEST['action_target'] == 'selected') {
$cData = new CSearchCustomRank();
$rsData = $cData->GetList(array($by => $order), $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
示例14: array
{
$conn->commitTransaction();
}
else
{
$conn->rollbackTransaction();
$adminList->AddUpdateError(implode('<br>', $result->getErrorMessages()), $couponID);
}
unset($result);
}
unset($fields, $couponID);
Internals\DiscountCouponTable::enableCheckCouponsUse();
}
}
if (!$readOnly && ($listID = $adminList->GroupAction()))
{
$checkUseCoupons = ($_REQUEST['action'] == 'delete');
$discountList = array();
Internals\DiscountCouponTable::clearDiscountCheckList();
if ($_REQUEST['action_target'] == 'selected')
{
$listID = array();
$couponIterator = Internals\DiscountCouponTable::getList(array(
'select' => array('ID', 'DISCOUNT_ID'),
'filter' => $filter
));
while ($coupon = $couponIterator->fetch())
{
$listID[] = $coupon['ID'];
示例15: CAdminSorting
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
/** @global CMain $APPLICATION */
/** @global CDatabase $DB */
/** @global CUser $USER */
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/perfmon/prolog.php";
IncludeModuleLangFile(__FILE__);
$RIGHT = $APPLICATION->GetGroupRight("perfmon");
if ($RIGHT == "D" || $DB->type !== "MYSQL") {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$sTableID = "tbl_perfmon_index_list";
$oSort = new CAdminSorting($sTableID, "TABLE_NAME", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
$go = false;
if ($lAdmin->GroupAction()) {
switch ($_REQUEST['action']) {
case "analyze_start":
CPerfomanceIndexSuggest::Clear();
$last_id = 0;
$go = true;
$_SESSION["queries"] = 0;
break;
case "analyze_cont":
$etime = time() + 5;
$last_id = intval($_REQUEST["last_id"]);
$sql_cache = array();
while (time() < $etime) {
$rsSQL = CPerfomanceSQL::GetList(array("ID", "SQL_TEXT", "QUERY_TIME"), array(">ID" => $last_id), array("ID" => "ASC"), false, array("nTopCount" => 100));
while ($arSQL = $rsSQL->Fetch()) {
$_SESSION["queries"]++;