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


PHP cmsUser::getUPSActual方法代码示例

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


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

示例1: run

 public function run($group_id = false)
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $grid = $this->loadDataGrid('users');
     $users_model = cmsCore::getModel('users');
     $users_model->setPerPage(admin::perpage);
     $filter = array();
     $filter_str = $this->request->get('filter');
     $filter_str = cmsUser::getUPSActual('admin.grid_filter.users', $filter_str);
     if ($filter_str) {
         $content_model = cmsCore::getModel('content')->setTablePrefix('');
         parse_str($filter_str, $filter);
         $users_model->applyGridFilter($grid, $filter);
         if (!empty($filter['advanced_filter'])) {
             parse_str($filter['advanced_filter'], $dataset_filters);
             $users_model->applyDatasetFilters($dataset_filters);
         }
     }
     if ($group_id) {
         $users_model->filterGroup($group_id);
     }
     $total = $users_model->getUsersCount();
     $perpage = isset($filter['perpage']) ? $filter['perpage'] : admin::perpage;
     $pages = ceil($total / $perpage);
     $users = $users_model->getUsers();
     cmsTemplate::getInstance()->renderGridRowsJSON($grid, $users, $total, $pages);
     $this->halt();
 }
开发者ID:roman-burachenko,项目名称:icms2,代码行数:30,代码来源:users_ajax.php

示例2: run

 public function run($ctype_id, $parent_id)
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $content_model = cmsCore::getModel('content');
     $ctype = $content_model->getContentType($ctype_id);
     if (!$ctype) {
         $this->halt();
     }
     $category = $content_model->getCategory($ctype['name'], $parent_id);
     if (!$category) {
         $this->halt();
     }
     $grid = $this->loadDataGrid('content_items', $ctype['name']);
     $filter = array();
     $filter_str = $this->request->get('filter');
     // Для сохранения настроек грида необходимо добавить такую строку со своим ключом
     $filter_str = cmsUser::getUPSActual('admin.filter_str.' . $ctype['name'], $filter_str);
     if ($filter_str) {
         parse_str($filter_str, $filter);
         if (!empty($filter['advanced_filter'])) {
             parse_str($filter['advanced_filter'], $dataset_filters);
             if (!empty($dataset_filters['dataset'])) {
                 $dataset_id = $dataset_filters['dataset'];
                 $dataset = $content_model->getContentDataset($dataset_id);
                 $content_model->applyDatasetFilters($dataset, true);
             }
             $content_model->applyDatasetFilters($dataset_filters);
         }
         $content_model->applyGridFilter($grid, $filter);
         // В случае обновления 'columns' грида для заполнения полей фильтров
         $grid['filter'] = $filter;
     }
     $content_model->filterCategory($ctype['name'], $category, $ctype['is_cats_recursive']);
     $content_model->disableApprovedFilter();
     $content_model->disablePubFilter();
     $total = $content_model->getContentItemsCount($ctype['name']);
     $perpage = isset($filter['perpage']) ? $filter['perpage'] : admin::perpage;
     $pages = ceil($total / $perpage);
     $content_model->setPerPage($perpage);
     $items = $content_model->getContentItems($ctype['name']);
     cmsTemplate::getInstance()->renderGridRowsJSON($grid, $items, $total, $pages);
     $this->halt();
 }
开发者ID:asphix,项目名称:icms2,代码行数:45,代码来源:content_items_ajax.php

示例3: run

 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $grid = $this->loadDataGrid('controllers');
     $this->model->setPerPage(admin::perpage);
     $filter = array();
     $filter_str = $this->request->get('filter', '');
     $filter_str = cmsUser::getUPSActual('admin.grid_filter.controllers', $filter_str);
     if ($filter_str) {
         parse_str($filter_str, $filter);
         $this->model->applyGridFilter($grid, $filter);
     }
     $total = $this->model->getInstalledControllersCount();
     $pages = ceil($total / admin::perpage);
     $controllers = $this->model->getInstalledControllers();
     cmsTemplate::getInstance()->renderGridRowsJSON($grid, $controllers, $total, $pages);
     $this->halt();
 }
开发者ID:roman-burachenko,项目名称:icms2,代码行数:20,代码来源:controllers_ajax.php

示例4: run

 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $grid = $this->loadDataGrid('scheduler');
     $this->model->setPerPage(admin::perpage);
     $filter = array();
     $filter_str = $this->request->get('filter', '');
     $filter_str = cmsUser::getUPSActual('admin.grid_filter.set_scheduler', $filter_str);
     if ($filter_str) {
         parse_str($filter_str, $filter);
         $this->model->applyGridFilter($grid, $filter);
     }
     $total = $this->model->getSchedulerTasksCount();
     $perpage = isset($filter['perpage']) ? $filter['perpage'] : admin::perpage;
     $pages = ceil($total / $perpage);
     $ctypes = $this->model->getSchedulerTasks();
     cmsTemplate::getInstance()->renderGridRowsJSON($grid, $ctypes, $total, $pages);
     $this->halt();
 }
开发者ID:roman-burachenko,项目名称:icms2,代码行数:21,代码来源:settings_scheduler_ajax.php

示例5: run

 public function run($ctype_id, $parent_id)
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $content_model = cmsCore::getModel('content');
     $ctype = $content_model->getContentType($ctype_id);
     if (!$ctype) {
         $this->halt();
     }
     $category = $content_model->getCategory($ctype['name'], $parent_id);
     if (!$category) {
         $this->halt();
     }
     $grid = $this->loadDataGrid('content_items', $ctype['name']);
     $filter = array();
     $filter_str = $this->request->get('filter');
     // Одновременно смениться и тип контента, и настройка diff_order не могут
     $diff_order = cmsUser::getUPS('admin.grid_filter.content.diff_order');
     if ($filter_str && mb_strpos($filter_str, 'ctype_changed=1') !== false && $diff_order) {
         // Изменён тип контента и должна быть сохранена сортировка
         // Проверим, что эта сортировка есть в бд, иначе будет использоваться пришедшая
         $ups_filter_str = cmsUser::getUPS('admin.grid_filter.content.' . $ctype['name']);
         if ($ups_filter_str) {
             $filter_str = $ups_filter_str;
         }
         // Чтобы заполнить поля поиска фильтра
         $grid['options']['load_columns'] = true;
     } else {
         $filter_str = cmsUser::getUPSActual('admin.grid_filter.content.' . $ctype['name'], $filter_str);
     }
     if ($filter_str) {
         parse_str($filter_str, $filter);
         if (!empty($filter['advanced_filter'])) {
             parse_str($filter['advanced_filter'], $dataset_filters);
             if (!empty($dataset_filters['dataset'])) {
                 $dataset_id = $dataset_filters['dataset'];
                 $dataset = $content_model->getContentDataset($dataset_id);
                 $content_model->applyDatasetFilters($dataset, true);
             }
             $content_model->applyDatasetFilters($dataset_filters);
             // Различная сортировка у разных типов контента, сохранение настройки
             $new_diff_order = !empty($dataset_filters['diff_order']) ? '1' : '0';
             if ($new_diff_order !== $diff_order) {
                 cmsUser::setUPS('admin.grid_filter.content.diff_order', $new_diff_order);
             }
         }
         $content_model->applyGridFilter($grid, $filter);
         // В случае обновления 'columns' грида для заполнения полей фильтров
         $grid['filter'] = $filter;
     }
     $content_model->filterCategory($ctype['name'], $category, $ctype['is_cats_recursive']);
     $content_model->disableApprovedFilter();
     $content_model->disablePubFilter();
     $total = $content_model->getContentItemsCount($ctype['name']);
     $perpage = isset($filter['perpage']) ? $filter['perpage'] : admin::perpage;
     $pages = ceil($total / $perpage);
     $content_model->setPerPage($perpage);
     $items = $content_model->getContentItems($ctype['name']);
     cmsTemplate::getInstance()->renderGridRowsJSON($grid, $items, $total, $pages);
     $this->halt();
 }
开发者ID:roman-burachenko,项目名称:icms2,代码行数:62,代码来源:content_items_ajax.php


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