Ejemplo n.º 1
0
     }
     $result = Database::select('*', "{$obj->table} ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
     $new_result = array();
     foreach ($result as $item) {
         $new_result[] = $item;
     }
     $result = $new_result;
     break;
 case 'get_usergroups':
     $columns = array('name', 'users', 'courses', 'sessions', 'group_type', 'actions');
     $result = $obj->getUsergroupsPagination($sidx, $sord, $start, $limit);
     break;
 case 'get_extra_fields':
     $obj = new ExtraField($type);
     $columns = array('display_text', 'variable', 'field_type', 'changeable', 'visible', 'filter', 'field_order');
     $result = $obj->getAllGrid($sidx, $sord, $start, $limit);
     /*$result = Database::select(
           '*',
           $obj->table,
           array('order' => "$sidx $sord", 'LIMIT' => "$start , $limit")
       );*/
     $new_result = array();
     if (!empty($result)) {
         foreach ($result as $item) {
             $item['display_text'] = $item['displayText'];
             $item['field_type'] = $obj->get_field_type_by_id($item['fieldType']);
             $item['changeable'] = $item['changeable'] ? Display::return_icon('check-circle.png', get_lang('Invisible')) : Display::return_icon('closed-circle.png', get_lang('Visible'), null, ICON_SIZE_SMALL);
             $item['visible'] = $item['visible'] ? Display::return_icon('check-circle.png', get_lang('Invisible')) : Display::return_icon('closed-circle.png', get_lang('Visible'), null, ICON_SIZE_SMALL);
             $item['filter'] = $item['filter'] ? Display::return_icon('check-circle.png', get_lang('Invisible')) : Display::return_icon('closed-circle.png', get_lang('Visible'), null, ICON_SIZE_SMALL);
             $new_result[] = $item;
         }