示例#1
0
 /**
  * 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');
     }
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 public function template($file, $tVars = array())
 {
     $name = $this->getName();
     $tVars['lang'] = $this->lang;
     $tVars['module'] = $this;
     return GWF_Template::templateMain("module/{$name}/{$file}", $tVars);
 }
示例#4
0
文件: GWF_Box.php 项目: sinfocol/gwf3
 /**
  * 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));
 }
示例#5
0
 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);
 }
示例#6
0
 public static function getHTMLbody_foot($tVars = NULL)
 {
     return GWF_Template::templateMain('html_foot.tpl', $tVars);
 }
示例#7
0
 public static function getCodeBar($key)
 {
     $tVars = array('key' => $key);
     return GWF_Template::templateMain('bb_codebar.tpl', $tVars);
 }
示例#8
0
 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']));
 }
示例#9
0
 /**
  * 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);
 }
示例#10
0
 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));
 }