Esempio n. 1
0
 /**
  * Overwrite template directory path if Smarty is used by a module 
  */
 public function __construct($module = '')
 {
     if ($module != '') {
         $this->template_dir = 'modules/' . $module . '/templates';
     }
     parent::Smarty();
 }
 function bBlog()
 {
     // connect to database
     $this->_adb = NewADOConnection('mysql://' . DB_USERNAME . ':' . DB_PASSWORD . '@' . DB_HOST . '/' . DB_DATABASE . '?persist');
     //$this->_db = new db(DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_HOST);
     $this->num_rows =& $this->_db->num_rows;
     $this->insert_id =& $this->_db->insert_id;
     //Load the config
     $config =& new configHandler($this->_adb);
     $config->loadConfig();
     $this->assign('blogname', C_BLOGNAME);
     $this->assign('blogdescription', C_BLOG_DESCRIPTION);
     $this->assign('blogurl', BLOGURL);
     $this->assign('bblogurl', BBLOGURL);
     $this->assign('metakeywords', C_META_KEYWORDS);
     $this->assign('metadescription', C_META_DESCRIPTION);
     $this->assign('charset', C_CHARSET);
     $this->assign('direction', C_DIRECTION);
     $this->assign('C_CAPTCHA_ENABLE', C_CAPTCHA_ENABLE);
     // initial time from config table, based on last updated stuff.
     // this is just the initial value.
     //$this->lastmodified = C_LAST_MODIFIED;
     //$this->register_postfilter("update_when_compiled");
     // load up the sections
     $this->get_sections();
     //start the session that we need so much ;)
     if (!session_id()) {
         session_start();
     }
     $this->_ph =& new postHandler(&$this->_adb);
     Smarty::Smarty();
 }
Esempio n. 3
0
 function XSmarty()
 {
     $this->compile_dir = URLLOCAL . 'classes_ext/smarty/templates_c';
     $this->cache_dir = URLLOCAL . 'classes_ext/smarty/cache';
     $this->config_dir = URLLOCAL . 'classes_ext/smarty/config_smarty';
     Smarty::Smarty();
 }
 /**
  * Constructor
  * initialize the smarty template engine
  * 
  * @param string template
  */
 function TemplateEngine($template, $p_theme = THEME_DEFAULT)
 {
     if (!defined('THEME')) {
         //define('THEME', THEME_DEFAULT);
         define('THEME', $p_theme);
     }
     $templateSet = THEME;
     parent::Smarty();
     $this->template_dir = array(INCLUDE_PATH . '/themes/' . $templateSet . '/', INCLUDE_PATH . '/themes/' . THEME_DEFAULT . '/', PLUGINS_PATH);
     $this->compile_dir = INCLUDE_PATH . '/datas/tpl_compiled/';
     $this->cache_dir = INCLUDE_PATH . '/datas/cache_smarty/';
     $this->config_dir = INCLUDE_PATH . '/themes/' . $templateSet . '/smarty_config/';
     $this->plugins_dir = array(INCLUDE_PATH . '/libs/smarty/plugins', INCLUDE_PATH . '/core/include/smarty_plugins');
     $this->cache_lifetime = CACHE_SMARTY;
     $this->compile_id = $templateSet . PHPMV_VERSION . INTERNAL_STATS;
     if (defined('SMARTY_DEBUG') && SMARTY_DEBUG) {
         $this->caching = 0;
         $this->force_compile = 1;
         $this->compile_check = 1;
     } else {
         $this->caching = 1;
         $this->force_compile = 0;
         $this->compile_check = 0;
         $this->load_filter('output', 'trimwhitespace');
     }
     $this->clear_all_cache(CACHE_SMARTY);
     if (mt_rand(0, 5000) === 0) {
         $this->clear_all_cache();
     }
     $this->setTemplate($template);
 }
 function CI_Smarty()
 {
     parent::Smarty();
     $this->compile_dir = APPPATH . "cache/templates_c";
     $this->template_dir = APPPATH . "views/templates";
     $this->assign('APPPATH', APPPATH);
     $this->assign('BASEPATH', BASEPATH);
 }
Esempio n. 6
0
 function CI_Smarty()
 {
     parent::Smarty();
     $this->compile_dir = APPPATH . "views/templates_c";
     $this->template_dir = APPPATH . "views/templates";
     $this->assign('APPPATH', APPPATH);
     $this->assign('BASEPATH', BASEPATH);
     log_message('debug', "Smarty Class Initialized");
 }
Esempio n. 7
0
 /**
  * class constructor
  *
  * @access	public
  */
 function __construct()
 {
     // call parent class
     parent::Smarty();
     // use application cache folder
     $this->cache_dir = APPDIR . 'cache/';
     // use application view folder
     $this->template_dir = APPDIR . 'views/';
 }
Esempio n. 8
0
 public function __construct($name, $panelName = '')
 {
     Smarty::Smarty();
     $this->name = $name;
     $this->panelName = $panelName;
     $this->default_resource_type = 'template';
     $this->security = true;
     Gpf_Plugins_Engine::extensionPoint('Core.initSmarty', $this);
 }
 function __construct()
 {
     parent::Smarty();
     $this->compile_dir = $this->smartydir . "templates_c/";
     $this->config_dir = $this->smartydir . "configs/";
     $this->cache_dir = $this->smartydir . "cache/";
     $this->caching = true;
     $this->force_compile = false;
     $this->template_dir = APP_TMVC_DIR . "/myapp/views/";
 }
Esempio n. 10
0
 function Smarty_parser($config = array())
 {
     parent::Smarty();
     if (count($config) > 0) {
         $this->initialize($config);
     }
     // register Smarty resource named "ci"
     $this->register_resource("ci", array($this, "ci_get_template", "ci_get_timestamp", "ci_get_secure", "ci_get_trusted"));
     log_message('debug', "Smarty_parser Class Initialized");
 }
Esempio n. 11
0
 public function __construct()
 {
     // Вызов конструктораSmarty
     parent::Smarty();
     // Меняем папки шаблонов по умолчанию
     $this->template_dir = TEMPLATE_DIR;
     $this->compile_dir = COMPILE_DIR;
     $this->config_dir = CONFIG_DIR;
     $this->plugins_dir[0] = SMARTY_DIR . 'plugins';
     $this->plugins_dir[1] = PRESENTATION_DIR . 'smarty_plugins';
 }
 /**
  * Performs basic setup and then calls __init
  *
  * Note that all data received via $_POST have magic quotes removed.
  */
 function installbase()
 {
     stringHandler::removeMagicQuotes($_POST);
     Smarty::Smarty();
     $this->_steps = array('prescan', 'install', 'postscan', 'upgrade');
     $this->assign('version', LOQ_CUR_VERSION);
     $this->template_dir = LOQ_INSTALLER . '/templates';
     $this->setCompileDir();
     $this->loadconfiguration();
     $this->__init();
 }
Esempio n. 13
0
 function CI_Smarty()
 {
     parent::Smarty();
     $this->template_dir = APPPATH . "views/";
     $this->compile_dir = "saemc://smartycompiled/";
     $this->cache_dir = "saemc://smartycache/";
     $this->compile_locking = false;
     $this->assign('APPPATH', APPPATH);
     $this->assign('BASEPATH', BASEPATH);
     log_message('debug', "Smarty Class Initialized");
 }
Esempio n. 14
0
 public function __construct()
 {
     //Call Smarty's constructor
     parent::Smarty();
     //Change the default template directories
     $this->template_dir = TEMPLATE_DIR;
     $this->compile_dir = COMPILE_DIR;
     $this->config_dir = CONFIG_DIR;
     $this->plugins_dir[0] = SMARTY_DIR . 'plugins';
     $this->plugins_dir[1] = PRESENTATION_DIR . 'smarty_plugins';
 }
Esempio n. 15
0
 /**
  * The class constructor.
  */
 function __construct()
 {
     parent::Smarty();
     if (file_exists(SMARTY_DIR . $this->compiler_file)) {
         require_once SMARTY_DIR . $this->compiler_file;
     } else {
         // use include_path
         require_once $this->compiler_file;
     }
     $this->compiler_file = "Smarty_CompilerExt.class.php";
     $this->compiler_class = "Smarty_CompilerExt";
 }
Esempio n. 16
0
 /**
  * Override Smarty::__construct
  * 
  * @return void
  */
 public function __construct()
 {
     parent::Smarty();
     /**
      * Config some params
      */
     $viewConfig = Vi_Registry::getConfig('viewConfig');
     $viewConfig['template_dir'] = '';
     foreach ($viewConfig as $key => $value) {
         $this->{$key} = $value;
     }
 }
Esempio n. 17
0
 public function __construct()
 {
     parent::Smarty();
     $this->left_delimiter = '{';
     $this->right_delimiter = '}';
     $this->template_dir = 'application/templates/admin';
     $this->compile_dir = 'application/templates_c/admin/';
     $this->config_dir = 'configs/';
     $this->cache_dir = 'cache/';
     $this->assign('THEME', '/' . $this->template_dir);
     $this->output = new CI_Output();
 }
Esempio n. 18
0
 function Legacy_HelpSmarty()
 {
     parent::Smarty();
     $this->compile_id = null;
     $this->_canUpdateFromFile = true;
     $this->compile_check = true;
     $this->compile_dir = XOOPS_COMPILE_PATH;
     $this->left_delimiter = "<{";
     $this->right_delimiter = "}>";
     $this->force_compile = true;
     $this->register_modifier("helpurl", "Legacy_modifier_helpurl");
     $this->register_modifier("helpimage", "Legacy_modifier_helpimage");
 }
Esempio n. 19
0
 public function __construct()
 {
     global $cfg;
     parent::Smarty();
     $this->template_dir = 'template/' . $cfg['style'] . '/templates/';
     $this->compile_dir = 'template/' . $cfg['style'] . '/templates_c/';
     $this->config_dir = 'template/' . $cfg['style'] . '/configs/';
     $this->cache_dir = 'template/' . $cfg['style'] . '/cache/';
     $this->register_block('dynamic', 'smarty_block_dynamic', false);
     $this->setDebug($cfg['debug']);
     // использование поддиректорий для хранения файлов смарти
     //$this->use_sub_dirs = true;
 }
Esempio n. 20
0
 /**
  * 构造函数
  *
  * @return View_Smarty
  */
 public function __construct()
 {
     parent::Smarty();
     $viewConfig = Config::get('viewConfig');
     if (is_array($viewConfig)) {
         foreach ($viewConfig as $key => $value) {
             if (isset($this->{$key})) {
                 $this->{$key} = $value;
             }
         }
     }
     new View_SmartyHelper($this);
 }
Esempio n. 21
0
 /**
  * 构造函数
  *
  * @return FLEA_View_Smarty
  */
 function FLEA_View_Smarty()
 {
     parent::Smarty();
     $viewConfig = FLEA::getAppInf('viewConfig');
     if (is_array($viewConfig)) {
         foreach ($viewConfig as $key => $value) {
             if (isset($this->{$key})) {
                 $this->{$key} = $value;
             }
         }
     }
     FLEA::loadClass('FLEA_View_SmartyHelper');
     new FLEA_View_SmartyHelper($this);
 }
 function Templater()
 {
     global $app_main_dir;
     $this->strict_resources = array();
     $this->request_use_auto_globals = true;
     array_unshift($this->plugins_dir, $app_main_dir . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'templater' . DIRECTORY_SEPARATOR . 'plugins');
     $this->force_compile = false;
     $this->compiler_file = "templater.php";
     $this->compiler_class = "TemplateCompiler";
     $this->compile_check_md5 = false;
     $this->security = true;
     $this->security_settings = array('PHP_HANDLING' => false, 'IF_FUNCS' => array('array', 'list', 'isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'true', 'false', 'null', 'constant'), 'INCLUDE_ANY' => false, 'PHP_TAGS' => false, 'MODIFIER_FUNCS' => array('count', 'capitalize', 'cat', 'count_characters', 'count_paragraphs', 'count_sentences', 'count_words', 'date_format', 'default', 'escape', 'indent', 'lower', 'nl2br', 'regex_replace', 'replace', 'spacify', 'string_format', 'strip', 'strip_tags', 'truncate', 'upper', 'wordwrap', 'abs_value', 'amp', 'comma_format', 'formatnumeric', 'formatprice', 'id', 'substitute', 'substitute', 'stripslashes', 'date', 'round', 'strval', 'md5', 'strtolower'), 'ALLOW_CONSTANTS' => true, 'ALLOW_SUPER_GLOBALS' => true);
     return parent::Smarty();
 }
Esempio n. 23
0
 function Controller()
 {
     parent::Smarty();
     $this->template_mod = "general";
     $this->_current_action = "";
     $this->_state = true;
     $this->compile_dir = $GLOBALS['fileroot'] . "/interface/main/calendar/modules/PostCalendar/pntemplates/compiled";
     $this->compile_check = true;
     $this->assign("PROCESS", "true");
     $this->assign("HEADER", "<html><head>\n<?php html_header_show();?></head><body>");
     $this->assign("FOOTER", "</body></html>");
     $this->assign("CONTROLLER", "controller.php?");
     $this->assign("CONTROLLER_THIS", "controller.php?" . $_SERVER['QUERY_STRING']);
     $this->assign("WEBROOT", $GLOBALS['webroot']);
 }
Esempio n. 24
0
 public function __construct($name)
 {
     parent::Smarty();
     $this->app =& SA_Registry::get('__SA_APPLICATION__');
     $this->assign_by_ref('app', $this->app);
     $this->setName($name);
     $this->setTemplate("{$name}.tpl");
     $appHome = $this->app->getApplicationDirectory();
     $this->plugins_dir = array('plugins', SA_CORE_DIR . 'sa_smarty_plugins');
     $this->setLayoutDir("{$appHome}/layouts");
     $this->setTemplateDir("{$appHome}/templates");
     $this->setCompileDir("{$appHome}/templates_c");
     $this->use_sub_dirs = true;
     $this->headers = array('Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT', 'Cache-Control' => 'no-store, no-cache, must-revalidate', 'Pragma' => 'no-cache');
 }
Esempio n. 25
0
 /**
  * The default constructor which must be called explicitely by each subclass
  */
 function __construct(SApplication &$app, $name)
 {
     SALog::log("in page {$name} constructor", SA_LOG_NOTICE);
     parent::Smarty();
     $this->app =& $app;
     $this->assign_by_ref('app', $app);
     $this->name = $name;
     $this->template = "{$name}.tpl";
     $appHome = $app->getHomeDirectory();
     $this->plugins_dir = array('plugins', SA_CORE_DIR . 'sa_smarty_plugins');
     $this->layoutDir = "{$appHome}/Layouts";
     $this->template_dir = "{$appHome}/Templates";
     $this->compile_dir = "{$appHome}/Templates_c";
     $this->use_sub_dirs = true;
     $this->headers = array('Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT', 'Last-Modified' => gmdate('D, d M Y H:i:s') . ' GMT', 'Cache-Control' => 'no-store, no-cache, must-revalidate', 'Pragma' => 'no-cache');
 }
Esempio n. 26
0
 private function __construct()
 {
     parent::Smarty();
     $this->caching = false;
     $this->debugging = false;
     $this->force_compile = true;
     $this->compile_check = false;
     $this->use_sub_dirs = false;
     $this->left_delimiter = '{{';
     $this->right_delimiter = '}}';
     $this->cache_dir = CS_PATH_SITE . DIR_SEP . 'cache';
     $this->config_dir = CS_PATH_SMARTY . DIR_SEP . 'configs';
     $this->plugins_dir = array_merge($this->plugins_dir, array(CS_PATH_SMARTY . DIR_SEP . 'campsite_plugins'));
     $this->template_dir = array(CS_INSTALL_DIR . DIR_SEP . 'templates', CS_PATH_SITE . '/themes/', CS_PATH_SITE . '/themes/unassigned/system_templates/');
     $this->compile_dir = dirname(__FILE__) . '/../../cache';
 }
Esempio n. 27
0
 public function __construct($conf)
 {
     parent::Smarty();
     if (isset($conf['nagibaka_debugger']) && $conf['nagibaka_debugger'] == 0) {
         $this->nagibaka_debudder = 0;
     }
     $this->caching = 0;
     $this->left_delimiter = '{';
     $this->right_delimiter = '}';
     $this->template_dir = 'application/templates/default';
     $this->compile_dir = 'application/templates_c/';
     $this->config_dir = 'configs/';
     $this->cache_dir = 'cache/';
     $this->assign('THEME', '/' . $this->template_dir);
     $this->output = new CI_Output();
 }
Esempio n. 28
0
 function __construct()
 {
     parent::Smarty();
     $this->template = NULL;
     // by default, no template!
     // smarty stuff
     // runtime directories
     $this->compile_dir = WFWebApplication::appDirPath(WFWebApplication::DIR_RUNTIME) . '/smarty/templates_c/';
     $this->cache_dir = WFWebApplication::appDirPath(WFWebApplication::DIR_RUNTIME) . '/smarty/cache/';
     // default directories
     $this->template_dir = WFWebApplication::appDirPath(WFWebApplication::DIR_SMARTY) . '/templates/';
     $this->config_dir = WFWebApplication::appDirPath(WFWebApplication::DIR_SMARTY) . '/configs/';
     // add a local plugins dir
     array_push($this->plugins_dir, FRAMEWORK_DIR . '/smarty/plugins/');
     // GLOBAL variables for all smarty templates
     $this->assign('WWW_ROOT', WWW_ROOT);
 }
Esempio n. 29
0
    private function __construct()
    {
        parent::Smarty();

        $config = CampSite::GetConfigInstance();

        $this->debugging = $config->getSetting('smarty.debugging');
        $this->force_compile = $config->getSetting('smarty.force_compile');
        $this->compile_check = $config->getSetting('smarty.compile_check');
        $this->use_sub_dirs = $config->getSetting('smarty.use_subdirs');

        // cache settings
        $cacheHandler = SystemPref::Get('TemplateCacheHandler');
        if ($cacheHandler) {
            $this->caching = 1;
            $this->cache_handler_func = "TemplateCacheHandler_$cacheHandler::handler";
            require_once CS_PATH_SITE.DIR_SEP.'classes'.DIR_SEP.'cache'.DIR_SEP."TemplateCacheHandler_$cacheHandler.php";
        } else {
            $this->caching = 0;
        }

        // define dynamic uncached block
        require_once CS_PATH_SMARTY.DIR_SEP.'campsite_plugins/block.dynamic.php';
        $this->register_block('dynamic', 'smarty_block_dynamic', false);

        // define render function
        require_once CS_PATH_SMARTY.DIR_SEP.'campsite_plugins/function.render.php';
        $this->register_function('render', 'smarty_function_render', false);

        $this->left_delimiter = $config->getSetting('smarty.left_delimeter');
        $this->right_delimiter = $config->getSetting('smarty.right_delimeter');

        $this->cache_dir = CS_PATH_SITE.DIR_SEP.'cache';
        $this->config_dir = CS_PATH_SMARTY.DIR_SEP.'configs';

        $plugin_smarty_camp_plugin_paths = array();
        foreach (CampPlugin::GetEnabled() as $CampPlugin) {
            $plugin_smarty_camp_plugin_paths[] = CS_PATH_SITE.DIR_SEP.$CampPlugin->getBasePath().DIR_SEP.'smarty_camp_plugins';
        }

        $this->plugins_dir = array_merge(array(CS_PATH_SMARTY.DIR_SEP.'campsite_plugins',
                                               CS_PATH_SMARTY.DIR_SEP.'plugins'),
                                         $plugin_smarty_camp_plugin_paths);
        $this->template_dir = CS_PATH_TEMPLATES;
        $this->compile_dir = CS_PATH_SITE.DIR_SEP.'templates_cache';
    } // fn __constructor
 function Legacy_AdminSmarty()
 {
     parent::Smarty();
     $this->compile_id = XOOPS_URL;
     $this->_canUpdateFromFile = true;
     $this->compile_check = true;
     $this->compile_dir = XOOPS_COMPILE_PATH;
     $this->left_delimiter = '<{';
     $this->right_delimiter = '}>';
     $this->plugins_dir = array(SMARTY_DIR . 'plugins', XOOPS_ROOT_PATH . '/class/smarty/plugins');
     //
     // [TODO]
     //	If we don't set true to the following flag, a user can not recover
     // with deleting additional theme. But, a user should to select true or
     // false by site_custom.ini.php.
     //
     $this->force_compile = false;
 }