/** * Preload button template. */ public static function init() { if (self::$templateButtons === true) { self::$templateButtons = GWF_Template::templateMain('buttons.tpl'); self::$templateTooltip = GWF_Template::templateMain('tooltip.tpl'); } }
/** * Display a multisort header. These rarely make sense, only on overlapping values. (School notes would be an example) * @param array $headers * @param string $sortURL The URL template * @param string $default orderby * @param string $defdir orderdir * @param string $by custom $_GET['by'] name * @param string $dir custom $_GET['dir'] name * @param unknown_type $raw * @return string 'html' */ public static function displayHeaders2(array $headers, $sortURL = NULL, $default = '', $defdir = 'ASC', $by = 'by', $dir = 'dir', $raw = '') { $tVars = array('headers' => self::getHeaders2($headers, $sortURL, $by, $dir), 'raw' => $raw); return GWF_Template::templateMain('thead.tpl', $tVars); }
public function template($file, $tVars = array()) { $name = $this->getName(); $tVars['lang'] = $this->lang; $tVars['module'] = $this; return GWF_Template::templateMain("module/{$name}/{$file}", $tVars); }
/** * Box with no title. * @param string $content * @return string the html box */ private static function boxNT($content) { return GWF_Template::templateMain('box_nt.tpl', array('content' => $content)); }
public function nestedHTMLBody() { if (!class_exists('GWF_Template')) { return nl2br($this->body); } $tVars = array('content' => nl2br($this->body)); return GWF_Template::templateMain('mail.tpl', $tVars); }
public static function getHTMLbody_foot($tVars = NULL) { return GWF_Template::templateMain('html_foot.tpl', $tVars); }
public static function getCodeBar($key) { $tVars = array('key' => $key); return GWF_Template::templateMain('bb_codebar.tpl', $tVars); }
public static function displayMessages($messages) { if (count($messages) === 0) { return ''; } if (Common::getGet('ajax') !== false) { $output = ''; foreach ($messages['messages'] as $m) { $m2 = GWF_Debug::shortpath(self::decode($m)); $output .= sprintf('1:%d:%s', strlen($m2), $m2) . PHP_EOL; } return $output; // return GWF_Website::addDefaultOutput($output); } return GWF_Template::templateMain('message.tpl', array('title' => $messages['title'], 'messages' => $messages['messages'])); }
/** * Show a Latin Alphabet menu. A-Z, All, Num. Default is All * @param $letter * @param $href * @return unknown_type */ public static function displayLetterMenu($letter, $href, $default = 'All') { $href = (string) $href; static $whitelist = array('All', 'Num', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); if (!in_array($letter, $whitelist, true)) { $letter = $default; } $back = ''; foreach ($whitelist as $l) { if ($l === $letter) { $href2 = ''; } else { $href2 = ' href="' . $href . '"'; } $back[$l] = self::replaceLetterHREF($href2, $l); } $tVars = array('letters' => $back, 'selected' => $letter); return GWF_Template::templateMain('letter_menu.tpl', $tVars); }
public function getAll() { foreach ($this->all as $k => $subject) { if (true === empty($subject)) { unset($this->all[$k]); } } if (true === isset($_GET['ajax'])) { $back = ''; foreach ($this->all as $subject) { $back .= self::displayAjax($subject); } return $back; } return GWF_Template::templateMain('errors.tpl', array('messages' => $this->all)); }