/** * Call the classes for each section in the order determined by the $subclasses property * and put sections together into final overall jQuery code */ public function setCode() { foreach ($this->subclasses as $key => $val) { if (empty($val)) { $instance = Table_Factory::build($key, parent::$s, 'code'); $instance::$level1 = $key; $instance::$level2 = null; $instance->setCode(); } elseif (is_array($val)) { foreach ($val as $key2 => $val2) { if (empty($val2)) { $instance = Table_Factory::build($key2, parent::$s, 'code'); $instance::$level1 = $key; $instance::$level2 = $key2; $instance->setCode(); } } } } //put sections together into final overall code self::$code['main'] = $this->iterate(self::$code['main'], $this->nt . '$(\'' . self::$tid . '\').tablesorter({', $this->nt . '})', '', ''); if (empty(self::$code['pager'])) { self::$code['main'] .= ';'; } $parts = ''; foreach (self::$code as $section) { $parts .= $section; } //unhide div holding the table $parts .= $this->nt . '$(\'div#' . self::$id . '\').css(\'visibility\', \'visible\');'; self::$code = $parts; }
/** * Adds code to header */ private function addToHeader() { if (!empty(Table_Code_Manager::$code)) { $headerlib = TikiLib::lib('header'); $headerlib->add_jq_onready(Table_Code_Manager::$code); //need to empty static $code in case there are multiple tables on a page Table_Code_Manager::$code = ''; } }
/** * Adds code to header */ public function addToHeader() { if (!empty(Table_Code_Manager::$code)) { global $headerlib; $headerlib->add_jq_onready(Table_Code_Manager::$code); //need to empty static $code in case there are multiple tables on a page Table_Code_Manager::$code = ''; } }