コード例 #1
0
ファイル: Smarty.php プロジェクト: Killerfun/galette
 /**
  * Main constructor
  *
  * @param plugins     $plugins     Galette's plugins
  * @param I18n        $i18n        Galette's I18n
  * @param Preferences $preferences Galette's preferences
  * @param Logo        $logo        Galette's logo
  * @param Login       $login       Galette's login
  * @param array       $session     Galette's session
  */
 function __construct($plugins, $i18n, $preferences, $logo, $login, $session)
 {
     parent::__construct();
     //paths configuration
     $this->setTemplateDir(GALETTE_ROOT . GALETTE_TPL_SUBDIR);
     $this->setCompileDir(GALETTE_COMPILE_DIR);
     $this->setConfigDir(GALETTE_CONFIG_PATH);
     $this->setCacheDir(GALETTE_CACHE_DIR);
     /*if ( GALETTE_MODE !== 'DEV' ) {
           //enable caching
           $this->caching = \Smarty::CACHING_LIFETIME_CURRENT;
           $this->setCompileCheck(false);
       }*/
     $this->addPluginsDir(GALETTE_ROOT . 'includes/smarty_plugins');
     $this->assign('login', $login);
     $this->assign('logo', $logo);
     $this->assign('template_subdir', GALETTE_BASE_PATH . GALETTE_TPL_SUBDIR);
     foreach ($plugins->getTplAssignments() as $k => $v) {
         $this->assign($k, $v);
     }
     $this->assign('tpl', $this);
     $this->assign('headers', $plugins->getTplHeaders());
     $this->assign('plugin_actions', $plugins->getTplAdhActions());
     $this->assign('plugin_batch_actions', $plugins->getTplAdhBatchActions());
     $this->assign('plugin_detailled_actions', $plugins->getTplAdhDetailledActions());
     $this->assign('jquery_dir', GALETTE_BASE_PATH . 'includes/jquery/');
     $this->assign('jquery_version', JQUERY_VERSION);
     $this->assign('jquery_migrate_version', JQUERY_MIGRATE_VERSION);
     $this->assign('jquery_ui_version', JQUERY_UI_VERSION);
     $this->assign('jquery_markitup_version', JQUERY_MARKITUP_VERSION);
     $this->assign('jquery_jqplot_version', JQUERY_JQPLOT_VERSION);
     $this->assign('scripts_dir', GALETTE_BASE_PATH . 'includes/');
     $this->assign('PAGENAME', basename($_SERVER['SCRIPT_NAME']));
     $this->assign('galette_base_path', GALETTE_BASE_PATH);
     $this->assign('GALETTE_VERSION', GALETTE_VERSION);
     $this->assign('GALETTE_MODE', GALETTE_MODE);
     /** galette_lang should be removed and languages used instead */
     $this->assign('galette_lang', $i18n->getAbbrev());
     $this->assign('languages', $i18n->getList());
     $this->assign('plugins', $plugins);
     $this->assign('preferences', $preferences);
     $this->assign('pref_slogan', $preferences->pref_slogan);
     $this->assign('pref_theme', $preferences->pref_theme);
     $this->assign('pref_editor_enabled', $preferences->pref_editor_enabled);
     $this->assign('pref_mail_method', $preferences->pref_mail_method);
     $this->assign('existing_mailing', isset($session['mailing']));
     $this->assign('require_tabs', null);
     $this->assign('require_cookie', null);
     $this->assign('contentcls', null);
     $this->assign('require_tabs', null);
     $this->assign('require_cookie', false);
     $this->assign('additionnal_html_class', null);
     $this->assign('require_calendar', null);
     $this->assign('head_redirect', null);
     $this->assign('error_detected', null);
     $this->assign('warning_detected', null);
     $this->assign('success_detected', null);
     $this->assign('color_picker', null);
     $this->assign('require_sorter', null);
     $this->assign('require_dialog', null);
     $this->assign('require_tree', null);
     $this->assign('html_editor', null);
     $this->assign('require_charts', null);
 }