protected function can_be_reset() {

        // Loop through preferences and make sure they are empty or set to the default value.
        foreach ($this->prefs as $prefname => $prefval) {

            if ($prefname === 'sortby' and !empty($this->sort_default_column)) {
                // Check if the actual sorting differs from the default one.
                if (empty($prefval) or $prefval !== array($this->sort_default_column => $this->sort_default_order)) {
                    return true;
                }

            } else if ($prefname === 'collapse' and !empty($prefval)) {
                // Check if there are some collapsed columns (all are expanded by default).
                foreach ($prefval as $columnname => $iscollapsed) {
                    if ($iscollapsed) {
                        return true;
                    }
                }

            } else if (!empty($prefval)) {
                // For all other cases, we just check if some preference is set.
                return true;
            }
        }

        return false;
    }
protected function can_be_reset() {

        // Loop through preferences and make sure they are empty or set to the default value.
        foreach ($this->prefs as $prefname => $prefval) {

            if ($prefname === 'sortby' and !empty($this->sort_default_column)) {
                // Check if the actual sorting differs from the default one.
                if (empty($prefval) or $prefval !== array($this->sort_default_column => $this->sort_default_order)) {
                    return true;
                }

            } else if ($prefname === 'collapse' and !empty($prefval)) {
                // Check if there are some collapsed columns (all are expanded by default).
                foreach ($prefval as $columnname => $iscollapsed) {
                    if ($iscollapsed) {
                        return true;
                    }
                }

            } else if (!empty($prefval)) {
                // For all other cases, we just check if some preference is set.
                return true;
            }
        }

        return false;
    }
protected function can_be_reset ( ) { // Loop through preferences and make sure they are empty or set to the default value. foreach ( $ this -> prefs as $ prefname => $ prefval ) { if ( $ prefname === 'sortby' and ! empty ( $ this -> sort_default_column ) ) { // Check if the actual sorting differs from the default one. if ( empty ( $ prefval ) or $ prefval !== array ( $ this -> sort_default_column => $ this -> sort_default_order ) ) { return true ; } } else if ( $ prefname === 'collapse' and ! empty ( $ prefval ) ) { // Check if there are some collapsed columns (all are expanded by default). foreach ( $ prefval as $ columnname => $ iscollapsed ) { if ( $ iscollapsed ) { return true ; } } } else if ( ! empty ( $ prefval ) ) { // For all other cases, we just check if some preference is set. return true ; } } return false ; }
Are there some table preferences that can be reset?

If true, then the "reset table preferences" widget should be displayed.

@return bool
Are there some table preferences that can be reset?