当前位置: 首页>>代码示例>>PHP>>正文


PHP CAdminList::GroupAction方法代码示例

本文整理汇总了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()) {
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:culture_admin.php

示例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();
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:message_admin.php

示例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);
                        }
                    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:perfmon_index_complete.php

示例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)) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:security_iprule_list.php

示例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);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:seo_search_yandex_direct.php

示例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);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:template_admin.php

示例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);
开发者ID:ASDAFF,项目名称:seo-sitemap-pro,代码行数:31,代码来源:seo_sitemap_pro.php

示例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();
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:group.php

示例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"];
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:fileman_admin.php

示例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) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:perfmon_tables.php

示例11: foreach

             if (!empty($res['errors'])) {
                 foreach ($res['errors'] as &$error) {
                     $error = '&nbsp;&nbsp;' . $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']));
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:location_external_service_list.php

示例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();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:learn_test_admin.php

示例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);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:search_customrank_admin.php

示例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'];
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:discount_coupons.php

示例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"]++;
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:perfmon_index_list.php


注:本文中的CAdminList::GroupAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。