Пример #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
 public function export()
 {
     header("Content-Type: application/xml; charset=UTF-8");
     $rss_date = self::displayDate($this->guessRSSDate());
     $tVars = array('items' => $this->items, 'title_link' => $this->feedURL, 'feed_title' => $this->title, 'feed_description' => $this->descr, 'language' => GWF_Language::getCurrentISO(), 'image_url' => Common::getAbsoluteURL('/favicon.ico', false), 'image_link' => $this->webURL, 'image_width' => '32', 'image_height' => '32', 'pub_date' => $rss_date, 'build_date' => $rss_date);
     return GWF_Template::templatePHPMain('rss2.php', $tVars);
 }
Пример #3
0
 /**
  * Get the Smarty instance and create if not exists
  * @return Smarty
  */
 public static function getSmarty()
 {
     if (self::$_smarty === NULL) {
         # Setup smarty config
         require_once GWF_SMARTY_PATH;
         $smarty = new Smarty();
         $smarty->setTemplateDir(GWF_WWW_PATH . 'tpl/');
         $dir = rtrim(GWF_SMARTY_DIRS, '/') . '/';
         $smarty->setCompileDir($dir . 'tplc');
         $smarty->setCacheDir($dir . 'cache');
         $smarty->setConfigDir($dir . 'cfg');
         $smarty->addPluginsDir(GWF_CORE_PATH . 'inc/smartyplugins');
         # Assign common template vars
         //			$smarty->assign('db', gdo_db());
         $smarty->assign('gwff', GWF_SmartyFile::instance());
         $smarty->assign('gwmm', GWF_SmartyModuleMethod::instance());
         $smarty->assign('root', GWF_WEB_ROOT);
         $smarty->assign('core', GWF_CORE_PATH);
         $smarty->assign('iconset', GWF_ICON_SET);
         $smarty->assign('design', self::getDesign());
         self::$_smarty = $smarty;
     }
     return self::$_smarty;
 }
Пример #4
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);
 }
Пример #5
0
<?php

### This is wechall html_foot!
if (defined('WC_HTML_HEAD__DEFINED') || isset($_GET['ajax'])) {
    return;
}
define('WC_HTML_HEAD__DEFINED', true);
//GWF_Session::commit();
echo '</div></div>';
echo GWF_Template::template('tpl/wc4/chall_foot.tpl', array('wcfooter' => WC_HTML::displayFooter()));
#echo SF::getHTMLfoot();
Пример #6
0
 public function templatePHP($file, $tVars = array())
 {
     $name = $this->getName();
     $tVars['lang'] = $this->lang;
     $tVars['module'] = $this;
     return GWF_Template::templatePHPMain("module/{$name}/{$file}", $tVars);
 }
Пример #7
0
 public static function displayMobileFooter()
 {
     $tVars = array();
     return GWF_Template::templatePHPMain('mobile_footer.php', $tVars);
 }
Пример #8
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);
 }
Пример #9
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));
 }
Пример #10
0
 public static function getHTMLbody_foot($tVars = NULL)
 {
     return GWF_Template::templateMain('html_foot.tpl', $tVars);
 }
Пример #11
0
 public static function getCodeBar($key)
 {
     $tVars = array('key' => $key);
     return GWF_Template::templateMain('bb_codebar.tpl', $tVars);
 }
Пример #12
0
define('GWF_LOGGING_PATH', getcwd() . '/protected/installog');
$gwf = new GWF3(getcwd(), array('website_init' => false, 'autoload_modules' => false, 'load_module' => false, 'load_config' => false, 'start_debug' => true, 'get_user' => false, 'do_logging' => true, 'log_request' => true, 'blocking' => false, 'no_session' => true, 'store_last_url' => false, 'ignore_user_abort' => true));
GWF_Debug::setDieOnError(false);
# Website init
GWF_InstallWizardLanguage::init();
GWF_HTML::init();
# Set install language
$il = new GWF_LangTrans(GWF_CORE_PATH . 'lang/install/install');
GWF_InstallWizard::setGWFIL($il);
# Design init
GWF3::setDesign('install');
GWF_Website::addCSS(GWF_WEB_ROOT . 'tpl/install/css/install.css');
GWF_Website::addCSS(GWF_WEB_ROOT . 'tpl/install/css/design.css');
GWF_Website::setPageTitle('GWF Install Wizard');
$tVars = array('gwfpath' => GWF_PATH, 'gwfwebpath' => GWF_WWW_PATH, 'step' => GWF_STEP, 'il' => $il, 'steps' => 11, 'timings' => GWF_DebugInfo::getTimings());
GWF_Template::addMainTvars($tVars);
if (false !== Common::getPost('create_admin')) {
    $page = GWF_InstallWizard::wizard_9_1();
} elseif (false !== Common::getPost('test_db')) {
    $page = GWF_InstallWizard::wizard_1a();
} elseif (false !== Common::getPost('write_config')) {
    $page = GWF_InstallWizard::wizard_1b();
} elseif (false !== Common::getPost('install_modules')) {
    $page = GWF_InstallWizard::wizard_6_1();
} else {
    switch (GWF_STEP) {
        case '1':
            $page = GWF_InstallWizard::wizard_1();
            break;
            # Create Config
        # Create Config
Пример #13
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']));
 }
Пример #14
0
 public static function display2(array $headers, array $data, $sortURL = '', $raw_head = '', $raw_body = '')
 {
     $tVars = array('headers' => $headers, 'data' => $data, 'raw_head' => $raw_head, 'raw_body' => $raw_body);
     return GWF_Template::templatePHPMain('table2.php', $tVars);
 }
Пример #15
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);
 }
Пример #16
0
 /**
  * Initialize by ConfigOptions
  * @return GWF3 
  */
 public function init()
 {
     $config =& self::$CONFIG;
     if (true === $config['start_debug']) {
         GWF_Debug::enableErrorHandler();
         GWF_Debug::setMailOnError((GWF_DEBUG_EMAIL & 2) > 0);
     }
     if (true === $config['kick_banned_ip']) {
         $this->onKickBannedIP();
     }
     if (true === defined('GWF_WEBSITE_DOWN')) {
         $this->setConfig('load_module', false);
         $this->setConfig('autoload_modules', false);
         $this->setConfig('no_session', true);
     }
     // 		$db = gdo_db();
     if (false === $config['no_session']) {
         $this->onStartSession($config['blocking']);
     }
     if (true === $config['website_init']) {
         $db = gdo_db();
         GWF_Website::init();
     }
     if (true === $config['do_logging']) {
         $this->onStartLogging($config['no_session']);
     }
     if (true === $config['autoload_modules']) {
         $this->onAutoloadModules();
     }
     if (true === $config['get_user']) {
         GWF_Template::addMainTvars(array('user' => self::$user = GWF_User::getStaticOrGuest()));
     }
     if (true === $config['load_module']) {
         $this->onLoadModule();
     }
     if (true === defined('GWF_WEBSITE_DOWN')) {
         die($this->onDisplayPage(GWF_WEBSITE_DOWN));
     }
     return $this;
 }
Пример #17
0
 private function getPageContentSmarty(GWF_Page $page)
 {
     $smarty = GWF_Template::getSmarty();
     //		$smarty->assign('user', GWF_User::getStaticOrGuest());
     return $smarty->fetch('db:' . $page->getID());
 }
Пример #18
0
 /**
  * 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));
 }