/**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function __construct()
 {
     parent::__construct();
     $this->EE =& get_instance();
     $this->aob = new Addon_builder_freeform();
     // -------------------------------------
     //	global cache
     // -------------------------------------
     if (!isset(self::$global_cache)) {
         if (!isset(ee()->session->cache['modules']['morsel']['template'])) {
             ee()->session->cache['modules']['morsel']['template'] = array();
         }
         self::$global_cache =& ee()->session->cache['modules']['morsel']['template'];
     }
     // --------------------------------------------
     //  ExpressionEngine only loads snippets
     //  on PAGE and ACTION requests
     // --------------------------------------------
     $this->load_snippets();
     //Fix for template stuff starting in EE 2.8.0+
     //We cant count on them not adding this later as
     //public/private/protected so adding it here manually so we don't get
     //variable access mismatch errors.
     if (!isset($this->layout_conditionals)) {
         $this->layout_conditionals = array();
     }
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     // Store a local reference to the "real" TMPL object, so it can be restored on __destruct
     $this->TMPL =& ee()->TMPL;
     // Override the "real" TMPL object
     ee()->TMPL =& $this;
 }
示例#3
0
 /**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function __construct()
 {
     parent::__construct();
     $this->EE =& get_instance();
     $this->aob = new Addon_builder_freeform();
     // --------------------------------------------
     //  Solves the problem of redirect links (?URL=)
     //  being added by Typography in a CP request
     // --------------------------------------------
     if (REQ == 'CP') {
         $this->old_get = isset($_GET['M']) ? $_GET['M'] : '';
         $_GET['M'] = 'send_email';
     }
     // --------------------------------------------
     //  ExpressionEngine only loads snippets
     //  on PAGE and ACTION requests
     // --------------------------------------------
     // load up any Snippets
     ee()->db->select('snippet_name, snippet_contents');
     ee()->db->where('(site_id = ' . ee()->config->item('site_id') . ' OR site_id = 0)');
     $fresh = ee()->db->get('snippets');
     if ($fresh->num_rows() > 0) {
         $snippets = array();
         foreach ($fresh->result() as $var) {
             $snippets[$var->snippet_name] = $var->snippet_contents;
         }
         $var_keys = array();
         foreach (ee()->config->_global_vars as $k => $v) {
             $var_keys[] = LD . $k . RD;
         }
         foreach ($snippets as $name => $content) {
             $snippets[$name] = str_replace($var_keys, array_values(ee()->config->_global_vars), $content);
         }
         ee()->config->_global_vars = array_merge(ee()->config->_global_vars, $snippets);
     }
     unset($snippets);
     unset($fresh);
 }