function __construct(&$items, $url)
 {
     $columns = array('_selection' => '', 'idnumber' => get_string('idnumber', 'block_curr_admin'), 'name' => get_string('name', 'block_curr_admin'), 'country' => get_string('country', 'block_curr_admin'), 'language' => get_string('user_language', 'block_curr_admin'), 'timecreated' => get_string('registered_date', 'block_curr_admin'));
     $formatters = array();
     $formatters['name'] = $formatters['idnumber'] = new recordlinkformatter(new usermanagementpage(), 'uid');
     parent::__construct($items, $columns, $url, $formatters);
 }
Beispiel #2
0
 function __construct(&$items, $url)
 {
     $columns = array('_selection' => array('header' => get_string('select'), 'sortable' => false), 'idnumber' => array('header' => get_string('id', 'local_elisprogram')), 'name' => array('header' => get_string('name', 'local_elisprogram')), 'country' => array('header' => get_string('country', 'local_elisprogram')), 'timecreated' => array('header' => get_string('registered_date', 'local_elisprogram')));
     $sort = optional_param('sort', 'name', PARAM_ALPHA);
     $dir = optional_param('dir', 'ASC', PARAM_ALPHA);
     if ($dir !== 'DESC') {
         $dir = 'ASC';
     }
     if (isset($columns[$sort])) {
         $columns[$sort]['sortable'] = $dir;
     } else {
         $sort = 'name';
         $columns[$sort]['sortable'] = $dir;
     }
     parent::__construct($items, $columns, $url);
     $this->display_date = new display_date_item(get_string('pm_date_format', 'local_elisprogram'));
 }
 function __construct(&$items, $url)
 {
     $columns = array('_selection' => '', 'idnumber' => get_string('id', 'block_curr_admin'), 'name' => get_string('name', 'block_curr_admin'), 'country' => get_string('country', 'block_curr_admin'));
     parent::__construct($items, $columns, $url);
 }
Beispiel #4
0
 function __construct(&$items, $url)
 {
     $url->remove_params(array('mode'));
     // TBD
     $url->params(array('id' => required_param('id', PARAM_INT)));
     $columns = array('_selection' => array('header' => ''), 'idnumber' => array('header' => get_string('idnumber', 'local_elisprogram')), 'name' => array('header' => array('firstname' => array('header' => get_string('firstname')), 'lastname' => array('header' => get_string('lastname'))), 'display_function' => array('display_table', 'display_user_fullname_item')), 'country' => array('header' => get_string('country')));
     $sort = optional_param('sort', 'lastname', PARAM_ALPHA);
     $dir = optional_param('dir', 'ASC', PARAM_ALPHA);
     // set sorting
     if ($dir !== 'DESC') {
         $dir = 'ASC';
     }
     if (isset($columns[$sort])) {
         $columns[$sort]['sortable'] = $dir;
     } elseif (isset($columns['name']['header'][$sort])) {
         $columns['name']['header'][$sort]['sortable'] = $dir;
     } else {
         $sort = 'lastname';
         $columns['name']['header']['lastname']['sortable'] = $dir;
     }
     parent::__construct($items, $columns, $url);
 }
Beispiel #5
0
 function __construct(&$items, $url)
 {
     $sort = optional_param('sort', 'timecreated', PARAM_CLEAN);
     $dir = optional_param('dir', 'ASC', PARAM_CLEAN);
     $columns = array('_selection' => array('header' => get_string('select'), 'sortable' => false, 'display_function' => array(&$this, 'get_item_display__selection')), 'idnumber' => array('header' => get_string('idnumber', self::LANG_FILE)), 'name' => array('header' => get_string('name', self::LANG_FILE)), 'country' => array('header' => get_string('country', self::LANG_FILE)), 'language' => array('header' => get_string('user_language', self::LANG_FILE)), 'timecreated' => array('header' => get_string('registered_date', self::LANG_FILE), 'display_function' => array(&$this, 'get_item_display_timecreated')));
     // set sorting
     if ($dir !== 'DESC') {
         $dir = 'ASC';
     }
     if (isset($columns[$sort])) {
         $columns[$sort]['sortable'] = $dir;
     } else {
         $sort = 'timecreated';
         $columns['name']['sortable'] = $dir;
     }
     // foreach($items as $item) $item->_selection = '';
     //$formatters = array();
     // TBD: class recordlinkformatter ???
     //$formatters['name'] = $formatters['idnumber'] = new recordlinkformatter(new usermanagementpage(), 'uid');
     parent::__construct($items, $columns, $url);
 }
 function get_item_display__selection($column, $item)
 {
     $userid = isset($item->userid) ? $item->userid : $item->id;
     if (isset($this->allowed_clusters)) {
         if (empty($this->allowed_clusters) || !$CURMAN->db->record_exists_select(CLSTUSERTABLE, "userid = {$userid} AND clusterid IN (" . implode(',', $this->allowed_clusters) . ')')) {
             return '';
         }
     }
     return parent::get_item_display__selection($column, $item);
 }