當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CAdminList::addGroupError方法代碼示例

本文整理匯總了PHP中CAdminList::addGroupError方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAdminList::addGroupError方法的具體用法?PHP CAdminList::addGroupError怎麽用?PHP CAdminList::addGroupError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CAdminList的用法示例。


在下文中一共展示了CAdminList::addGroupError方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

         $arActiveTests[$abtest['SITE_ID']][] = $abtest['ID'];
     }
 }
 foreach ($arID as $ID) {
     $ID = intval($ID);
     if ($ID <= 0) {
         continue;
     }
     $abtest = Bitrix\ABTest\ABTestTable::getById($ID)->fetch();
     if (empty($abtest)) {
         continue;
     }
     switch ($_REQUEST['action']) {
         case 'delete':
             if (!Bitrix\ABTest\Helper::deleteTest($ID)) {
                 $lAdmin->addGroupError(getMessage('ABTEST_DELETE_ERROR'));
             }
             break;
         case 'start':
             if (!empty($arActiveTests[$abtest['SITE_ID']])) {
                 if (in_array($ID, $arActiveTests[$abtest['SITE_ID']])) {
                     $lAdmin->addGroupError(getMessage('ABTEST_START_ERROR'));
                 } else {
                     $lAdmin->addGroupError(getMessage('ABTEST_ONLYONE_WARNING'));
                 }
             } else {
                 if ($abtest['ENABLED'] != 'Y') {
                     $lAdmin->addGroupError(getMessage('ABTEST_START_ERROR'));
                 } else {
                     if (!Bitrix\ABTest\Helper::startTest($ID)) {
                         $lAdmin->addGroupError(getMessage('ABTEST_START_ERROR'));
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:abtest_admin.php

示例2: buildList


//.........這裏部分代碼省略.........
         $visibleColumns = array_values($visibleColumns);
         $visibleColumns = array_merge($visibleColumns, array_keys($this->tableColumnsMap));
     }
     $className = static::getModel();
     $visibleColumns[] = static::pk();
     $sectionsVisibleColumns[] = static::sectionPk();
     $raw = array('SELECT' => $visibleColumns, 'FILTER' => $this->arFilter, 'SORT' => $sort);
     foreach ($this->fields as $name => $settings) {
         if (isset($settings['VIRTUAL']) and $settings['VIRTUAL'] == true) {
             $key = array_search($name, $visibleColumns);
             unset($visibleColumns[$key]);
             unset($this->arFilter[$name]);
             unset($sort[$name]);
         }
         if (isset($settings['FORCE_SELECT']) and $settings['FORCE_SELECT'] == true) {
             $visibleColumns[] = $name;
         }
     }
     $visibleColumns = array_unique($visibleColumns);
     $sectionsVisibleColumns = array_unique($sectionsVisibleColumns);
     // Поля для селекта (перевернутый массив)
     $listSelect = array_flip($visibleColumns);
     foreach ($this->fields as $code => $settings) {
         $widget = $this->createWidgetForField($code);
         $widget->changeGetListOptions($this->arFilter, $visibleColumns, $sort, $raw);
         // Множественные поля не должны быть в селекте
         if (!empty($settings['MULTIPLE'])) {
             unset($listSelect[$code]);
         }
     }
     // Поля для селекта (множественные поля отфильтрованы)
     $listSelect = array_flip($listSelect);
     if ($sectionEditHelper) {
         $mixedData = $this->getMixedData($sectionsVisibleColumns, $visibleColumns, $sort, $raw);
         $res = new \CDbResult();
         $res->InitFromArray($mixedData);
         $res = new \CAdminResult($res, $this->getListTableID());
         $res->nSelectedCount = $this->totalRowsCount;
         // используем кастомный NavStart что бы определить правильное количество страниц и элементов в списке
         $this->customNavStart($res);
         $this->list->NavText($res->GetNavPrint(Loc::getMessage("PAGES")));
         while ($data = $res->NavNext(false)) {
             $this->modifyRowData($data);
             if ($data['IS_SECTION']) {
                 list($link, $name) = $this->getRow($data, $this->getHelperClass(AdminSectionEditHelper::className()));
                 $row = $this->list->AddRow('s' . $data[$this->pk()], $data, $link, $name);
                 foreach ($this->sectionFields as $code => $settings) {
                     if (in_array($code, $sectionsVisibleColumns)) {
                         $this->addRowSectionCell($row, $code, $data);
                     }
                 }
                 $row->AddActions($this->getRowActions($data, true));
             } else {
                 $this->modifyRowData($data);
                 list($link, $name) = $this->getRow($data);
                 // объединение полей элемента с полями раздела
                 foreach ($this->tableColumnsMap as $elementCode => $sectionCode) {
                     if (isset($data[$elementCode])) {
                         $data[$sectionCode] = $data[$elementCode];
                     }
                 }
                 $row = $this->list->AddRow($data[$this->pk()], $data, $link, $name);
                 foreach ($this->fields as $code => $settings) {
                     $this->addRowCell($row, $code, $data, isset($this->tableColumnsMap[$code]) ? $this->tableColumnsMap[$code] : false);
                 }
                 $row->AddActions($this->getRowActions($data));
             }
         }
     } else {
         $res = $this->getData($className, $this->arFilter, $listSelect, $sort, $raw);
         $res = new \CAdminResult($res, $this->getListTableID());
         $res->NavStart();
         $this->list->NavText($res->GetNavPrint(Loc::getMessage("PAGES")));
         while ($data = $res->NavNext(false)) {
             $this->modifyRowData($data);
             list($link, $name) = $this->getRow($data);
             $row = $this->list->AddRow($data[$this->pk()], $data, $link, $name);
             foreach ($this->fields as $code => $settings) {
                 $this->addRowCell($row, $code, $data);
             }
             $row->AddActions($this->getRowActions($data));
         }
     }
     $this->list->AddFooter($this->getFooter($res));
     $this->list->AddGroupActionTable($this->getGroupActions(), $this->groupActionsParams);
     $this->list->AddAdminContextMenu($this->getContextMenu());
     $this->list->BeginPrologContent();
     echo $this->prologHtml;
     $this->list->EndPrologContent();
     $this->list->BeginEpilogContent();
     echo $this->epilogHtml;
     $this->list->EndEpilogContent();
     // добавляем ошибки в CAdminList для режимов list и frame
     if (in_array($_GET['mode'], array('list', 'frame')) && is_array($this->getErrors())) {
         foreach ($this->getErrors() as $error) {
             $this->list->addGroupError($error);
         }
     }
     $this->list->CheckListMode();
 }
開發者ID:vadim-ontech,項目名稱:digitalwand.admin_helper,代碼行數:101,代碼來源:AdminListHelper.php


注:本文中的CAdminList::addGroupError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。