コード例 #1
0
ファイル: paypal.php プロジェクト: nicolasjeol/hec-ecommerce
 public static function display($file, $template, $cacheId = NULL, $compileId = NULL)
 {
     if (substr(_PS_VERSION_, 0, 3) != '1.3') {
         return parent::display($file, $template);
     }
     global $smarty;
     $previousTemplate = $smarty->currentTemplate;
     $smarty->currentTemplate = substr(basename($template), 0, -4);
     $smarty->assign('module_dir', __PS_BASE_URI__ . 'modules/' . basename($file, '.php') . '/');
     if (Tools::file_exists_cache(_PS_THEME_DIR_ . 'modules/' . basename($file, '.php') . '/' . $template)) {
         $smarty->assign('module_template_dir', _THEME_DIR_ . 'modules/' . basename($file, '.php') . '/');
         $result = $smarty->fetch(_PS_THEME_DIR_ . 'modules/' . basename($file, '.php') . '/' . $template);
     } elseif (Tools::file_exists_cache(dirname(__FILE__) . '/' . $template)) {
         $smarty->assign('module_template_dir', __PS_BASE_URI__ . 'modules/' . basename($file, '.php') . '/');
         $result = $smarty->fetch(dirname(__FILE__) . '/' . $template);
     } else {
         $result = Tools::displayError('No template found');
     }
     $smarty->currentTemplate = $previousTemplate;
     return $result;
 }