| @@ -14,12 +14,48 @@ | ||
| 14 | 14 | public $_timestamps = TRUE; |
| 15 | 15 | protected $_primary_filter = 'intval'; |
| 16 | 16 | public $form_admin = array(); |
| 17 | 17 | public $fields_list = NULL; |
| 18 | + public $allowedOrderBy = array( | |
| 19 | + 'idlocation', | |
| 20 | + 'parent_id', | |
| 21 | + 'page_id', | |
| 22 | + 'lang_code', | |
| 23 | + 'date', | |
| 24 | + 'parent_path', | |
| 25 | + 'order_index', | |
| 26 | + 'level', | |
| 27 | + 'icon_id', | |
| 28 | + 'image_id', | |
| 29 | + 'font_icon_code', | |
| 30 | + 'code', | |
| 31 | + 'hubspot_id', | |
| 32 | + 'location_title', | |
| 33 | + 'marker_image_id', | |
| 34 | + 'level_0_id', | |
| 35 | + 'icon_path', | |
| 36 | + 'image_path', | |
| 37 | + 'marker_image_path', | |
| 38 | + 'location_color', | |
| 39 | + 'titles_for_search' | |
| 40 | + ); | |
| 18 | 41 | |
| 19 | 42 | public function __construct(){ |
| 20 | 43 | parent::__construct(); |
| 44 | + | |
| 45 | + // Add allowedOrderBy with table + prefix format | |
| 46 | + $table_prefix = $this->db->prefix . $this->_table_name . '.'; | |
| 47 | + $updatedAllowedOrderBy = array(); | |
| 48 | + foreach ($this->allowedOrderBy as $col) { | |
| 49 | + $updatedAllowedOrderBy[] = $col; | |
| 50 | + $updatedAllowedOrderBy[] = $table_prefix . $col; | |
| 51 | + } | |
| 52 | + $this->allowedOrderBy = array_unique($updatedAllowedOrderBy); | |
| 21 | 53 | } |
| 54 | + | |
| 55 | + public function getAllowedOrderBy() { | |
| 56 | + return $this->allowedOrderBy; | |
| 57 | + } | |
| 22 | 58 | |
| 23 | 59 | /* [START] For dynamic data table */ |
| 24 | 60 | |
| 25 | 61 | public function get_available_fields() |