Пример #1
0
 /**
  * Set some shortened properties
  *
  * @param $settings
  */
 public function __construct($settings)
 {
     $class = get_class($this);
     if ($class == 'Table_Code_Manager') {
         self::$s = $settings;
         self::$id = $settings['id'];
         self::$tid = 'table#' . $settings['id'] . '_table';
         //overall sort on unless sort type set to false
         self::$sort = isset($settings['sort']['type']) && $settings['sort']['type'] === false ? false : true;
         //filter, group, pager and ajax off unless type is set and is not false
         self::$filters = empty($settings['filters']['type']) ? false : true;
         self::$pager = empty($settings['pager']['type']) ? false : true;
         global $prefs;
         self::$ajax = $settings['ajax']['type'] === true && $prefs['feature_ajax'] === 'y' ? true : false;
         //TODO allow for use of group headers with ajax when tablesorter bug 437 is fixed
         self::$group = self::$sort && !self::$ajax && isset($settings['sort']['group']) && $settings['sort']['group'] === true ? true : false;
     }
 }
Пример #2
0
 /**
  * Set some shortened properties
  *
  * @param $settings
  */
 public function __construct($settings)
 {
     $class = get_class($this);
     if ($class == 'Table_Code_Manager') {
         self::$s = $settings;
         self::$id = $settings['id'] . '-div';
         self::$tid = 'table#' . $settings['id'];
         //overall sort on unless sort type set to false
         self::$sorts = isset($settings['sorts']['type']) && $settings['sorts']['type'] === false ? false : true;
         self::$sortcol = isset(self::$s['columns']) && count(array_column(self::$s['columns'], 'sort')) > 0;
         //filter, group, pager and ajax off unless type is set and is not false
         self::$filters = empty($settings['filters']['type']) ? false : true;
         self::$filtercol = isset(self::$s['columns']) && count(array_column(self::$s['columns'], 'filter')) > 0;
         self::$math = empty($settings['math']) ? false : true;
         //whether to use array index to identify columns or a selector (id, class, etc.)
         //generally index used for plugins where columns are set by user and selectors are used with tables with
         //smarty templates to keep from recreating tpl logic that determines which columns are shown
         self::$usecolselector = !isset(self::$s['usecolselector']) || self::$s['usecolselector'] !== false;
         self::$pager = empty($settings['pager']['type']) ? false : true;
         global $prefs;
         self::$ajax = $settings['ajax']['type'] === true && $prefs['feature_ajax'] === 'y';
         self::$group = self::$sorts && isset($settings['sorts']['group']) && $settings['sorts']['group'] === true;
     }
 }