/**
  * 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);
 }
 /**
  *	Fetch Add-Ons for Instllation
  *	This caches parent lists
  *
  *	@access		public
  *	@return		null
  */
 public function fetch_addons()
 {
     //no res
     if (count($this->modules) > 0 && count($this->plugins) > 0) {
         return;
     }
     if (isset(self::$global_cache['fetch_modules']) && isset(self::$global_cache['fetch_plugins'])) {
         $this->modules = self::$global_cache['fetch_modules'];
         $this->plugins = self::$global_cache['fetch_plugins'];
         return;
     }
     parent::fetch_addons();
     self::$global_cache['fetch_modules'] = array_unique($this->modules);
     self::$global_cache['fetch_plugins'] = array_unique($this->plugins);
 }
 public function parse_variables_row($tagdata, $variables, $solo = TRUE)
 {
     $this->variables = $variables;
     return parent::parse_variables_row($tagdata, $variables, $solo);
 }