コード例 #1
0
 public function addPlugins(\Enlight_Template_Manager $template_Manager)
 {
     if (!$this->hasPlugins) {
         $template_Manager->registerPlugin('modifier', 'convertMemory', [$this, 'convertMemory']);
         $template_Manager->registerPlugin('modifier', 'dump', [$this, 'dump']);
         $template_Manager->registerPlugin('modifier', 'sqlFormat', [$this, 'sqlFormat']);
         $this->hasPlugins = true;
     }
 }
コード例 #2
0
ファイル: sExport.php プロジェクト: ClaudioThomas/shopware-4
 public function sInitSmarty()
 {
     $this->sSYSTEM->sSMARTY->compile_id = "export_" . $this->sFeedID;
     $this->sSYSTEM->sSMARTY->cache_lifetime = 0;
     $this->sSYSTEM->sSMARTY->debugging = 0;
     $this->sSYSTEM->sSMARTY->caching = 0;
     $this->sSmarty->registerPlugin('modifier', 'format', array(&$this, 'sFormatString'));
     $this->sSmarty->registerPlugin('modifier', 'escape', array(&$this, 'sEscapeString'));
     $this->sSmarty->registerPlugin('modifier', 'category', array(&$this, 'sGetArticleCategoryPath'));
     $this->sSmarty->registerPlugin('modifier', 'link', array(&$this, 'sGetArticleLink'));
     $this->sSmarty->registerPlugin('modifier', 'image', array(&$this, 'sGetImageLink'));
     $this->sSmarty->registerPlugin('modifier', 'articleImages', array(&$this, 'sGetArticleImageLinks'));
     $this->sSmarty->registerPlugin('modifier', 'shippingcost', array(&$this, 'sGetArticleShippingcost'));
     $this->sSmarty->registerPlugin('modifier', 'property', array(&$this, 'sGetArticleProperties'));
     $this->sSmarty->assign("sConfig", $this->sSYSTEM->sCONFIG);
     $this->sSmarty->assign("sLanguage", $this->sLanguage);
     $this->sSmarty->assign("sMultishop", $this->sMultishop);
     $this->sSmarty->assign("sCurrency", $this->sCurrency);
     $this->sSmarty->assign("sCustomergroup", $this->sCustomergroup);
     $this->sSmarty->assign("sSettings", $this->sSettings);
     $this->sSmarty->config_vars["F"] = $this->sSettings["fieldmark"];
     $this->sSmarty->config_vars["EF"] = $this->sSettings["escaped_separator"];
     $this->sSmarty->config_vars["S"] = $this->sSettings["separator"];
     $this->sSmarty->config_vars["ES"] = $this->sSettings["escaped_fieldmark"];
     $this->sSmarty->config_vars["L"] = $this->sSettings["line_separator"];
     $this->sSmarty->config_vars["EL"] = $this->sSettings["escaped_line_separator"];
     if ($this->sSettings['encoding'] == 'UTF-8') {
         $this->sSmarty->config_vars['BOM'] = "";
     } else {
         $this->sSmarty->config_vars['BOM'] = '';
     }
     $this->sSmarty->config_vars['EN'] = $this->sSettings['encoding'];
 }
コード例 #3
0
ファイル: sRewriteTable.php プロジェクト: GerDner/luck-docker
 /**
  * Sets up the environment for seo url calculation
  */
 public function baseSetup()
 {
     MemoryLimit::setMinimumMemoryLimit(1024 * 1024 * 512);
     @set_time_limit(0);
     $keys = array_keys($this->template->registered_plugins['function']);
     if (!in_array('sCategoryPath', $keys)) {
         $this->template->registerPlugin(Smarty::PLUGIN_FUNCTION, 'sCategoryPath', array($this, 'sSmartyCategoryPath'));
     }
     if (!in_array('createSupplierPath', $keys)) {
         $this->template->registerPlugin(Smarty::PLUGIN_FUNCTION, 'createSupplierPath', array($this, 'createSupplierPath'));
     }
     $this->data = $this->template->createData();
     $this->data->assign('sConfig', $this->config);
     $this->data->assign('sRouter', $this);
     $this->data->assign('sCategoryStart', Shopware()->Shop()->getCategory()->getId());
 }
コード例 #4
0
 /**
  * @param \Enlight_Template_Manager $smarty
  * @author Martin Schindler
  */
 public function register(\Enlight_Template_Manager $smarty)
 {
     $smarty->registerPlugin('function', 'form_start', array($this, 'formStart'));
     $smarty->registerPlugin('function', 'form_errors', array($this, 'formErrors'));
     $smarty->registerPlugin('function', 'form_row', array($this, 'formRow'));
     $smarty->registerPlugin('function', 'form_label', array($this, 'formLabel'));
     $smarty->registerPlugin('function', 'form_widget', array($this, 'formWidget'));
     $smarty->registerPlugin('function', 'form_rest', array($this, 'formRest'));
     $smarty->registerPlugin('function', 'form_end', array($this, 'formEnd'));
 }