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


PHP CAdminResult::GetNavParams方法代码示例

本文整理汇总了PHP中CAdminResult::GetNavParams方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminResult::GetNavParams方法的具体用法?PHP CAdminResult::GetNavParams怎么用?PHP CAdminResult::GetNavParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAdminResult的用法示例。


在下文中一共展示了CAdminResult::GetNavParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Производится инициализация переменных, обработка запросов на редактирование
  *
  * @param array $fields
  * @param bool $isPopup
  * @throws \Bitrix\Main\ArgumentException
  */
 public function __construct(array $fields, $isPopup = false)
 {
     $this->isPopup = $isPopup;
     if ($this->isPopup) {
         $this->fieldPopupResultName = preg_replace("/[^a-zA-Z0-9_:\\[\\]]/", "", $_REQUEST['n']);
         $this->fieldPopupResultIndex = preg_replace("/[^a-zA-Z0-9_:]/", "", $_REQUEST['k']);
         $this->fieldPopupResultElTitle = $_REQUEST['eltitle'];
     }
     parent::__construct($fields);
     $this->restoreLastGetQuery();
     $this->prepareAdminVariables();
     $className = static::getModel();
     $oSort = new \CAdminSorting($this->getListTableID(), static::pk(), "desc");
     $this->list = new \CAdminList($this->getListTableID(), $oSort);
     $this->list->InitFilter($this->arFilterFields);
     if ($this->list->EditAction() and $this->hasWriteRights()) {
         global $FIELDS;
         foreach ($FIELDS as $id => $fields) {
             if (!$this->list->IsUpdated($id)) {
                 continue;
             }
             $this->editAction($id, $fields);
         }
     }
     if ($IDs = $this->list->GroupAction() and $this->hasWriteRights()) {
         if ($_REQUEST['action_target'] == 'selected') {
             $this->setContext(AdminListHelper::OP_GROUP_ACTION);
             $IDs = array();
             //Текущий фильтр должен быть модифицирован виждтами
             //для соответствия результатов фильтрации тому, что видит пользователь в интерфейсе.
             $raw = array('SELECT' => $this->pk(), 'FILTER' => $this->arFilter, 'SORT' => array());
             foreach ($this->fields as $code => $settings) {
                 $widget = $this->createWidgetForField($code);
                 $widget->changeGetListOptions($this->arFilter, $raw['SELECT'], $raw['SORT'], $raw);
             }
             $res = $className::getList(array('filter' => $this->arFilter, 'select' => array($this->pk())));
             while ($el = $res->Fetch()) {
                 $IDs[] = $el[$this->pk()];
             }
         }
         $filteredIDs = array();
         foreach ($IDs as $id) {
             if (strlen($id) <= 0) {
                 continue;
             }
             $filteredIDs[] = IntVal($id);
         }
         $this->groupActions($IDs, $_REQUEST['action']);
     }
     if (isset($_REQUEST['action']) || isset($_REQUEST['action_button']) && count($this->getErrors()) == 0) {
         $listHelperClass = $this->getHelperClass(AdminListHelper::className());
         $className = $listHelperClass::getModel();
         $id = isset($_GET['ID']) ? $_GET['ID'] : null;
         $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : $_REQUEST['action_button'];
         if ($action != 'edit' && $_REQUEST['cancel'] != 'Y') {
             $params = $_GET;
             unset($params['action']);
             unset($params['action_button']);
             $this->customActions($action, $id);
             $sectionEditHelperClass = $this->getHelperClass(AdminSectionEditHelper::className());
             if ($sectionEditHelperClass) {
                 $element = $className::getById($id)->Fetch();
                 $sectionField = $listHelperClass::getSectionField();
                 if ($element[$sectionField]) {
                     $params['ID'] = $element[$sectionField];
                 }
             }
             LocalRedirect($listHelperClass::getUrl($params));
         }
     }
     if ($this->isPopup()) {
         $this->genPopupActionJS();
     }
     // Получаем параметры навигации
     $navUniqSettings = array('sNavID' => $this->getListTableID());
     $this->navParams = array('nPageSize' => \CAdminResult::GetNavSize($navUniqSettings), 'navParams' => \CAdminResult::GetNavParams($navUniqSettings));
 }
开发者ID:vadim-ontech,项目名称:digitalwand.admin_helper,代码行数:84,代码来源:AdminListHelper.php


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