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


PHP FieldList::getFieldsByType方法代码示例

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


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

示例1: getusertabledataTask

 public function getusertabledataTask()
 {
     $op = Get::req('op', DOTY_MIXED, false);
     switch ($op) {
         case "selectall":
             $this->_selectAllUsers();
             return;
             break;
     }
     $idOrg = 0;
     //Get::req('id_org', DOTY_INT, 0);
     $descendants = false;
     //(Get::req('descendants', DOTY_INT, 0) > 0 ? true : false);
     $startIndex = Get::req('startIndex', DOTY_INT, 0);
     $results = Get::req('results', DOTY_INT, Get::sett('visuItem', 25));
     $rowsPerPage = Get::req('rowsPerPage', DOTY_INT, $results);
     $sort = Get::req('sort', DOTY_STRING, "");
     $dir = Get::req('dir', DOTY_STRING, "asc");
     $learning_filter = Get::req('learning_filter', DOTY_STRING, 'none');
     $var_fields = Get::req('_dyn_field', DOTY_MIXED, array());
     if (stristr($sort, '_dyn_field_') !== false) {
         $index = str_replace('_dyn_field_', '', $sort);
         $sort = $var_fields[(int) $index];
     }
     $filter_text = Get::req('filter_text', DOTY_STRING, '');
     $searchFilter = array('text' => $filter_text, 'suspended' => Get::req('suspended', DOTY_INT, 1) > 0 ? true : false);
     $dyn_filter = $this->_getDynamicFilter(Get::req('dyn_filter', DOTY_STRING, ''));
     if ($dyn_filter !== false) {
         $searchFilter['dyn_filter'] = $dyn_filter;
     }
     $total = $this->user_model->getTotalUsers($idOrg, $descendants, $searchFilter, true, $learning_filter);
     if ($startIndex >= $total) {
         if ($total < $results) {
             $startIndex = 0;
         } else {
             $startIndex = $total - $results;
         }
     }
     $pagination = array('startIndex' => $startIndex, 'results' => $results, 'sort' => $sort, 'dir' => $dir);
     $list = $this->user_model->getUsersList($idOrg, $descendants, $pagination, $searchFilter, true, $learning_filter);
     //prepare the data for sending
     require_once _adm_ . '/lib/lib.field.php';
     $fman = new FieldList();
     $date_fields = $fman->getFieldsByType("date");
     $acl_man = Docebo::user()->getAclManager();
     $idst_org = $acl_man->getGroupST('/oc_' . (int) $idOrg);
     $output_results = array();
     if (is_array($list) && count($list) > 0) {
         foreach ($list as $idst => $record) {
             $record_row = array('id' => (int) $record['idst'], 'userid' => Layout::highlight($acl_man->relativeId($record['userid']), $filter_text), 'firstname' => Layout::highlight($record['firstname'], $filter_text), 'lastname' => Layout::highlight($record['lastname'], $filter_text), 'email' => Layout::highlight($record['email'], $filter_text), 'register_date' => Format::date($record['register_date'], "datetime"), 'lastenter' => Format::date($record['lastenter'], "datetime"), 'unassoc' => $idOrg > 0 ? $record['is_descendant'] ? 0 : 1 : -1, 'valid' => $record['valid'], 'mod' => 'ajax.adm_server.php?r=adm/usermanagement/moduser&id=' . (int) $idst, 'del' => 'ajax.adm_server.php?r=adm/usermanagement/deluser&id=' . (int) $idst);
             foreach ($var_fields as $i => $value) {
                 if (is_numeric($value)) {
                     $name = '_custom_' . $value;
                 } else {
                     $name = $value;
                 }
                 //check if we must perform some post-format on retrieved field values
                 $content = isset($record[$name]) ? $record[$name] : '';
                 if ($name == 'register_date') {
                     $content = Format::date($content, 'datetime');
                 }
                 if ($name == 'lastenter') {
                     $content = Format::date($content, 'datetime');
                 }
                 if ($name == 'level' && $content != '') {
                     $content = Lang::t('_DIRECTORY_' . $content, 'admin_directory');
                 }
                 if (!empty($date_fields) && in_array($value, $date_fields)) {
                     $content = Format::date(substr($content, 0, 10), 'date');
                 }
                 $record_row['_dyn_field_' . $i] = $content;
             }
             $output_results[] = $record_row;
         }
     }
     $output = array('totalRecords' => $total, 'startIndex' => $startIndex, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $rowsPerPage, 'results' => count($output_results), 'records' => $output_results);
     echo $this->json->encode($output);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:78,代码来源:UserselectorWidgetController.php

示例2: multimodTask

 public function multimodTask()
 {
     if (!$this->permissions['mod_user']) {
         $output = array('success' => false, 'message' => $this->_getErrorMessage('no permission'));
         echo $this->json->encode($output);
         return;
     }
     $title = Lang::t('_MOD', 'admin_directory');
     $users_count = Get::req('users_count', DOTY_INT, 0);
     if ($users_count <= 0) {
         $output = array('success' => true, 'header' => $title, 'body' => Lang::t('_EMPTY_SELECTION', 'admin_directory'));
         echo $this->json->encode($output);
         return;
     }
     $acl_man = Docebo::user()->getAclManager();
     $level = ADMIN_GROUP_USER;
     $arr_levels = $acl_man->getAdminLevels();
     //index = idst; value = groupid;
     $levels = array();
     foreach ($arr_levels as $groupid_level => $idst_level) {
         $levels[$groupid_level] = Lang::t('_DIRECTORY_' . $groupid_level, 'admin_directory');
     }
     $info = array('firstname' => '', 'lastname' => '', 'email' => '', 'level' => '', 'facebook_id' => '', 'twitter_id' => '', 'linkedin_id' => '', 'google_id' => '');
     $language = getDefaultLanguage();
     $languages = Docebo::langManager()->getAllLanguages();
     require_once _base_ . '/lib/lib.platform.php';
     $pman =& PlatformManager::createInstance();
     // = new PlatformManager();
     $platforms = $pman->getPlatformList();
     require_once _adm_ . '/lib/lib.field.php';
     $fman = new FieldList();
     $field_list = $fman->getFlatAllFields(array_keys($platforms));
     $fields_to_exclude = $fman->getFieldsByType('upload');
     $preference = new UserPreferences(0);
     $modify_mask = $preference->getModifyMask('ui.', true, true);
     $fields_mask = $fman->playFieldsForUser(-1, false, false, true, false, true);
     //build edit mask
     $this->render('multimod', array('users_count' => $users_count, 'title' => $title, 'levels' => $levels, 'modify_mask' => $modify_mask, 'fields_mask' => $fields_mask, 'fields_to_exclude' => is_array($fields_to_exclude) ? $fields_to_exclude : array(), 'info' => $info, 'json' => $this->json));
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:39,代码来源:UsermanagementAdmController.php


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