]> git.mjollnir.org Git - moodle.git/commitdiff
All flexible tables will have the "flexible" class. Point 3.1 of MDL-8419
authorstronk7 <stronk7>
Thu, 22 Feb 2007 18:27:10 +0000 (18:27 +0000)
committerstronk7 <stronk7>
Thu, 22 Feb 2007 18:27:10 +0000 (18:27 +0000)
Merged from MOODLE_18_STABLE

lib/tablelib.php

index 46a3ab36ba1a6a5b72c41d55a27b7db53396dd86..80f7fca98852f55c2e710584caf651412b16e9f4 100644 (file)
@@ -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) {