From: stronk7 Date: Thu, 22 Feb 2007 18:27:10 +0000 (+0000) Subject: All flexible tables will have the "flexible" class. Point 3.1 of MDL-8419 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d1b523b7d080181dcaf5de92db32908458d85191;p=moodle.git All flexible tables will have the "flexible" class. Point 3.1 of MDL-8419 Merged from MOODLE_18_STABLE --- diff --git a/lib/tablelib.php b/lib/tablelib.php index 46a3ab36ba..80f7fca988 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -288,6 +288,19 @@ class flexible_table { $this->currpage = optional_param($this->request[TABLE_VAR_PAGE], 0); $this->setup = true; + + /// Always introduce the "flexible" class for the table if not specified + /// No attributes, add flexible class + if (empty($this->attributes)) { + $this->attributes['class'] = 'flexible'; + /// No classes, add flexible class + } else if (!isset($this->attributes['class'])) { + $this->attributes['class'] = 'flexible'; + /// No flexible class in passed classes, add flexible class + } else if (!in_array('flexible', explode(' ', $this->attributes['class']))) { + $this->attributes['class'] = trim('flexible ' . $this->attributes['class']); + } + } function get_sql_sort($uniqueid = NULL) {