diff --git a/admin-dev/themes/template/logs/content.tpl b/admin-dev/themes/template/logs/content.tpl new file mode 100644 index 000000000..6a1c6294a --- /dev/null +++ b/admin-dev/themes/template/logs/content.tpl @@ -0,0 +1,44 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $list} +
+ {l s='Severity levels'} +

{l s='Meaning of severity levels:'}

+
    +
  1. {l s='Informative only'}
  2. +
  3. {l s='Warning'}
  4. +
  5. {l s='Error'}
  6. +
  7. {l s='Major issue (crash)'}
  8. +
+
+{/if} + +{$list} +
+

{l s='Logs by e-mail'}

+ +{$options} diff --git a/classes/AdminController.php b/classes/AdminController.php index 57561e77e..4ffbc26f7 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -659,8 +659,8 @@ class AdminControllerCore extends Controller */ public function displayForm($firstCall = true) { - $this->initForm(); $content = ''; + $content .= $this->initForm(); $allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; if ($allow_employee_form_lang && !$this->context->cookie->employee_form_lang) @@ -781,7 +781,6 @@ class AdminControllerCore extends Controller { $this->context->smarty->assign('display_header',$this->display_header); $this->context->smarty->assign('display_footer',$this->display_footer); - $this->context->smarty->assign('content', $this->content); $this->context->smarty->assign('meta_title', $this->meta_title); // Template override @@ -1030,17 +1029,18 @@ class AdminControllerCore extends Controller { if (!($this->object = $this->loadObject(true))) return; - $this->initForm(); + $content .= $this->initForm(); } else if ($this->display != 'view') { - $this->initList(); - $this->initOptions(); + $content .= $this->initList(); + $content .= $this->initOptions(); } $this->context->smarty->assign(array( 'table' => $this->table, 'current' => self::$currentIndex, 'token' => $this->token, + 'content', $this->content )); } @@ -1073,7 +1073,8 @@ class AdminControllerCore extends Controller return false; $this->getList($this->context->language->id); - if (!($this->_list && is_array($this->_list))) + // Empty list is ok + if (!is_array($this->_list)) return false; $helper = new HelperList(); @@ -1110,7 +1111,7 @@ class AdminControllerCore extends Controller // For each action, try to add the corresponding skip elements list $helper->list_skip_actions = $this->list_skip_actions; - $this->content .= $helper->generateList($this->_list, $this->fieldsDisplay); + return $helper->generateList($this->_list, $this->fieldsDisplay); } /** @@ -1142,11 +1143,8 @@ class AdminControllerCore extends Controller $this->context->smarty->assign('back', Tools::safeOutput(Tools::getValue(self::$currentIndex.'&token='.$this->token))); } - $this->content .= $helper->generateForm($this->fields_form); + return $helper->generateForm($this->fields_form); } - // TODO delete when all forms use the helper -// else -// $this->content .= $this->displayForm(); } /** @@ -1164,7 +1162,7 @@ class AdminControllerCore extends Controller $helper->token = $this->token; $helper->table = $this->table; $helper->currentIndex = self::$currentIndex; - $this->content .= $helper->generateOptions($this->options); + return $helper->generateOptions($this->options); } } @@ -1792,7 +1790,7 @@ class AdminControllerCore extends Controller /** * Returns an array with selected shops and type (group or boutique shop) - * + * * @param string $table * @param int $id_object */ @@ -2197,10 +2195,10 @@ EOF; * @param string $ids Multilingual div ids in form * @param string $id Current div id] * @param boolean $use_vars_instead_of_ids use an js vars instead of ids seperate by "ยค" - * + * * @todo : delete return params : * @param return define the return way : false for a display, true for a return - * + * * @return string */ public function getTranslationsFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false) diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 42cdd2bf5..94552b2f9 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -72,7 +72,7 @@ class AdminAddressesControllerCore extends AdminController foreach ($countries AS $country) $this->countriesArray[$country['id_country']] = $country['name']; - parent::initList(); + return parent::initList(); } public function initForm() @@ -272,7 +272,7 @@ class AdminAddressesControllerCore extends AdminController // merge address format with the rest of the form array_splice($this->fields_form['input'], 3, 0, $temp_fields); - parent::initForm(); + return parent::initForm(); } public function postProcess() diff --git a/controllers/admin/AdminAliasesController.php b/controllers/admin/AdminAliasesController.php index 3ef743cad..3faaa26c7 100644 --- a/controllers/admin/AdminAliasesController.php +++ b/controllers/admin/AdminAliasesController.php @@ -89,7 +89,7 @@ class AdminAliasesControllerCore extends AdminController $this->fields_value = array('alias' => $this->object->getAliases()); - parent::initForm(); + return parent::initForm(); } public function postProcess() diff --git a/controllers/admin/AdminCarriersController.php b/controllers/admin/AdminCarriersController.php index f821fbdce..b61a7226c 100644 --- a/controllers/admin/AdminCarriersController.php +++ b/controllers/admin/AdminCarriersController.php @@ -136,7 +136,7 @@ class AdminCarriersControllerCore extends AdminController $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'; $this->_where = 'AND b.id_lang = '.$this->context->language->id; - parent::initList(); + return parent::initList(); } public function initForm() @@ -357,7 +357,7 @@ class AdminCarriersControllerCore extends AdminController 'class' => 'button' ); - parent::initForm(); + return parent::initForm(); } public function postProcess() diff --git a/controllers/admin/AdminContactsController.php b/controllers/admin/AdminContactsController.php index 3b70abd29..867bc7074 100644 --- a/controllers/admin/AdminContactsController.php +++ b/controllers/admin/AdminContactsController.php @@ -111,7 +111,7 @@ class AdminContactsControllerCore extends AdminController ) ); - parent::initForm(); + return parent::initForm(); } } diff --git a/controllers/admin/AdminCountriesController.php b/controllers/admin/AdminCountriesController.php index 83eb4aad4..5674800cc 100644 --- a/controllers/admin/AdminCountriesController.php +++ b/controllers/admin/AdminCountriesController.php @@ -116,7 +116,7 @@ class AdminCountriesControllerCore extends AdminController $this->_select = 'z.`name` AS zone'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; - parent::initList(); + return parent::initList(); } public function initForm() @@ -353,7 +353,7 @@ class AdminCountriesControllerCore extends AdminController 'class' => 'button' ); - parent::initForm(); + return parent::initForm(); } public function postProcess() diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 831170ec5..73ebd0b92 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -102,7 +102,7 @@ class AdminEmployeesControllerCore extends AdminController $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$this->context->language->id.')'; - parent::initList(); + return parent::initList(); } public function initForm() @@ -293,7 +293,7 @@ class AdminEmployeesControllerCore extends AdminController $this->fields_value['shop'][$row['id_shop']][] = $row[$this->identifier]; } - parent::initForm(); + return parent::initForm(); } protected function _childValidation() diff --git a/controllers/admin/AdminGendersController.php b/controllers/admin/AdminGendersController.php index 58efa9a06..7fdd9247c 100644 --- a/controllers/admin/AdminGendersController.php +++ b/controllers/admin/AdminGendersController.php @@ -167,7 +167,7 @@ class AdminGendersController extends AdminController 'image' => $obj->getImage() ); - parent::initForm(); + return parent::initForm(); } public function displayGenderType($value, $tr) diff --git a/controllers/admin/AdminGroupShopController.php b/controllers/admin/AdminGroupShopController.php index 50b00c189..4c79021fe 100644 --- a/controllers/admin/AdminGroupShopController.php +++ b/controllers/admin/AdminGroupShopController.php @@ -172,7 +172,7 @@ class AdminGroupShopControllerCore extends AdminController 'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID() )); - parent::initForm(); + return parent::initForm(); $import_data = array( 'attribute_group' => $this->l('Attribute groups'), diff --git a/admin-dev/tabs/AdminLogs.php b/controllers/admin/AdminLogsController.php similarity index 50% rename from admin-dev/tabs/AdminLogs.php rename to controllers/admin/AdminLogsController.php index 86bdfe9bc..9de2210a9 100644 --- a/admin-dev/tabs/AdminLogs.php +++ b/controllers/admin/AdminLogsController.php @@ -1,6 +1,6 @@ table = 'log'; $this->className = 'Logger'; $this->lang = false; - $this->edit = false; - $this->delete = true; $this->noLink = true; - $this->view = false; - - $this->fieldsDisplay = array( - 'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50), - 'message' => array('title' => $this->l('Message'), 'width' => 377), - 'object_type' => array('title' => $this->l('Object type'), 'width' => 75), - 'object_id' => array('title' => $this->l('Object ID'), 'width' => 50), - 'error_code' => array('title' => $this->l('Error code'), 'width' => 75, 'prefix' => '0x'), - 'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime')); - $this->optionsList = array( + $this->addRowAction('delete'); + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + + $this->fieldsDisplay = array( + 'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50), + 'message' => array('title' => $this->l('Message'), 'width' => 377), + 'object_type' => array('title' => $this->l('Object type'), 'width' => 75), + 'object_id' => array('title' => $this->l('Object ID'), 'width' => 50), + 'error_code' => array('title' => $this->l('Error code'), 'width' => 75, 'prefix' => '0x'), + 'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime') + ); + + $this->options = array( 'general' => array( 'title' => $this->l('Logs by e-mail'), 'fields' => array( 'PS_LOGS_BY_EMAIL' => array( - 'title' => $this->l('Minimum severity level:'), - 'desc' => $this->l('Put "5" if you don\'t want to receive any emails.').'
'.$this->l('Emails will be sent to the shop owner.'), - 'cast' => 'intval', - 'type' => 'text', + 'title' => $this->l('Minimum severity level:'), + 'desc' => $this->l('Put "5" if you don\'t want to receive any emails.').'
'.$this->l('Emails will be sent to the shop owner.'), + 'cast' => 'intval', + 'type' => 'text', 'size' => 5 ), ), + 'submit' => array() ), ); - + parent::__construct(); } - - public function displayListHeader($token = NULL) - { - echo ' -
- '.$this->l('Severity levels').' -

'.$this->l('Here\'s the meaning of severity levels:').'

-
    -
  1. '.$this->l('Informative only').'
  2. -
  3. '.$this->l('Warning').'
  4. -
  5. '.$this->l('Error').'
  6. -
  7. '.$this->l('Major issue (crash)').'
  8. -
-
'; - - parent::displayListHeader(); + + /** + * Assign smarty variables for all default views, list and form, then call other init functions + */ + public function initContent() + { + $this->context->smarty->assign(array( + 'table' => $this->table, + 'current' => self::$currentIndex, + 'token' => $this->token, + 'list' => $this->initList(), + 'options' => $this->initOptions() + )); } + } ?> diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 35661738d..79b8ded86 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -189,7 +189,7 @@ class AdminProductsController extends AdminController if (Tools::isSubmit('submitAddproduct') || Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddProductAndPreview')) { $id_product = Tools::getValue('id_product'); - if (($id_product && $this->tabAccess['edit'] === '1') + if (($id_product && $this->tabAccess['edit'] === '1') || ($this->tabAccess['add'] == 1 && Tools::isSubmit('submitAddproduct') && !$id_product) ) $this->submitAddproduct($token); @@ -1370,50 +1370,50 @@ if (false) { $this->_errors[] = $this->l('the field').' '.$this->l('expiration date').' '.$this->l('is not valid'); return false; - } + } } } - + // The oos behavior MUST be "Deny orders" for virtual products if (Tools::getValue('out_of_stock') != 0) { $this->_errors[] = $this->l('The "when out of stock" behavior selection must be "deny order" for virtual products'); return false; } - - // Trick's + + // Trick's if ($edit == 1) { $id_product_download_attibute = ProductDownload::getIdFromIdAttribute((int) $product->id, $id_product_attribute); $id_product_download = ($id_product_download_attibute) ? (int) $id_product_download_attibute : (int) Tools::getValue('virtual_product_id'); } - + $is_shareable = Tools::getValue('virtual_product_is_shareable'); $virtual_product_name = Tools::getValue('virtual_product_name'); $virtual_product_filename = Tools::getValue('virtual_product_filename'); $virtual_product_nb_days = Tools::getValue('virtual_product_nb_days'); $virtual_product_nb_downloable = Tools::getValue('virtual_product_nb_downloable'); $virtual_product_expiration_date = Tools::getValue('virtual_product_expiration_date'); - + $is_shareable_attribute = Tools::getValue('virtual_product_is_shareable_attribute'); $virtual_product_name_attribute = Tools::getValue('virtual_product_name_attribute'); $virtual_product_filename_attribute = Tools::getValue('virtual_product_filename_attribute'); $virtual_product_nb_days_attribute = Tools::getValue('virtual_product_nb_days_attribute'); $virtual_product_nb_downloable_attribute = Tools::getValue('virtual_product_nb_downloable_attribute'); $virtual_product_expiration_date_attribute = Tools::getValue('virtual_product_expiration_date_attribute'); - + if (!empty($is_shareable_attribute)) $is_shareable = $is_shareable_attribute; - + if (!empty($virtual_product_name_attribute)) $virtual_product_name = $virtual_product_name_attribute; - + if (!empty($virtual_product_nb_days_attribute)) $virtual_product_nb_days = $virtual_product_nb_days_attribute; - + if (!empty($virtual_product_nb_downloable_attribute)) - $virtual_product_nb_downloable = $virtual_product_nb_downloable_attribute; - + $virtual_product_nb_downloable = $virtual_product_nb_downloable_attribute; + if (!empty($virtual_product_expiration_date_attribute)) $virtual_product_expiration_date = $virtual_product_expiration_date_attribute; @@ -1423,7 +1423,7 @@ if (false) $filename = $virtual_product_filename; else $filename = ProductDownload::getNewFilename(); - + $download = new ProductDownload($id_product_download); $download->id_product = (int) $product->id; $download->id_product_attribute = (int) $id_product_attribute; @@ -1435,7 +1435,7 @@ if (false) $download->nb_downloadable = (int) $virtual_product_nb_downloable; $download->active = 1; $download->is_shareable = (int) $is_shareable; - + if ($download->save()) return true; } @@ -1449,7 +1449,7 @@ if (false) } else $id_product_download = ProductDownload::getIdFromIdProduct($product->id); - + if (!empty($id_product_download)) { $productDownload = new ProductDownload($id_product_download); @@ -1460,7 +1460,7 @@ if (false) } return false; } - + public function deleteDownloadProduct($id_product_attribute = NULL) { if (!empty($id_product_attribute)) @@ -1472,7 +1472,7 @@ if (false) } return false; } - + /** * Update product accessories * @@ -1527,7 +1527,7 @@ if (false) $languages = Language::getLanguages(false); $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); $product = new Product((int)(Tools::getValue('id_product'))); - $this->initForm(); + $content .= $this->initForm(); return $this->{'initForm'.$this->action}($product, $languages, $defaultLanguage); } } @@ -1557,7 +1557,7 @@ if (false) { // $all_cats[$categ['id_parent']] $categ = new Category($categ['id_category'],$this->context->language->id); - $select_child .= ''; @@ -1581,7 +1581,7 @@ if (false) } parent::initContent(); } - + public function ajaxProcessProductManufacturers() { $manufacturers = Manufacturer::getManufacturers(); @@ -1707,7 +1707,6 @@ if (false) public function initForm() { - parent::initForm(); $this->addJqueryUI('ui.datepicker'); $this->context->smarty->assign('pos_select', (($tab = Tools::getValue('tabs')) ? $tab : '0')); $this->context->smarty->assign('token',$this->token); @@ -1719,6 +1718,7 @@ if (false) if (!($obj = $this->loadObject(true))) throw new Exception('object not loaded'); $this->_displayDraftWarning($obj->active); + return parent::initForm(); } public function displayForm($isMainTab = true) @@ -1747,14 +1747,14 @@ if (false) $currency = Tools::setCurrency($this->context->cookie); // if ($obj->id) // self::$currentIndex .= '&id_product='.$obj->id; - + // $this->addJqueryPlugin('tabpane'); $action = $this->action; if (empty($action) || !method_exists($this,'initForm'.$action)) $action = 'informations'; - $this->initForm(); + $content .= $this->initForm(); $this->{'initForm'.$action}($obj, null); /* Tabs */ /* @@ -1767,13 +1767,13 @@ switch ($this->action) */ if (Combination::isFeatureActive()) $smarty->assign('countAttributes', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attribute WHERE id_product = '.(int)$obj->id)); - + $smarty->assign('countAttachments', Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'product_attachment WHERE id_product = '.(int)$obj->id)); if (Tools::getValue('id_category') > 1) { $productIndex = preg_replace('/(&id_product=[0-9]*)/', '', self::$currentIndex); -/** @TODO +/** @TODO $this->content .= '

@@ -2206,7 +2206,7 @@ switch ($this->action) $content .= parent::displayForm(); $has_attribute = $obj->hasAttributes(); - // @FIXME Stock, need to use StockManagerFactory + // @FIXME Stock, need to use StockManagerFactory $qty = 0; $cover = Product::getCover($obj->id); $this->_applyTaxToEcotax($obj); @@ -2222,18 +2222,18 @@ switch ($this->action) $this->displayInitInformationAndAttachment(); if(!$productDownload->id || !$productDownload->active) $hidden = 'style="display:none;"'; - + $cache_default_attribute = (int) $this->getFieldValue($obj, 'cache_default_attribute'); $is_virtual = (int) $this->getFieldValue($obj, 'is_virtual'); - if($is_virtual && $productDownload->active) + if($is_virtual && $productDownload->active) $check = 'checked="checked"'; - - if($is_virtual) + + if($is_virtual) $virtual = 1; else $virtual = 0; - + $preview_url = ''; if (isset($obj->id)) { @@ -2440,7 +2440,7 @@ switch ($this->action) } $content .= ''. $this->l('Yes').' - '.$this->l('No').'

'; + '.$this->l('No').'

'; if (!file_exists($exists_file) && !empty($productDownload->display_filename) && empty($cache_default_attribute)) { @@ -2500,7 +2500,7 @@ switch ($this->action) '; - if (!$productDownload->id || !$productDownload->active) + if (!$productDownload->id || !$productDownload->active) $hidden = 'display:none;'; $nb_downloadable = ($productDownload->id > 0) ? $productDownload->nb_downloadable : htmlentities(Tools::getValue('virtual_product_nb_downloable'), ENT_COMPAT, 'UTF-8'); @@ -2681,8 +2681,8 @@ switch ($this->action) '.($currency->format % 2 != 0 ? ' '.$currency->sign : '').' '.($currency->format % 2 == 0 ? ' '.$currency->sign : '').' '; - } - else + } + else $content .= ''; $content .= ' @@ -2795,7 +2795,7 @@ switch ($this->action) '; } - + $content .= '
@@ -3672,7 +3672,7 @@ switch ($this->action) return; } $content = ''; - + $attributeJs = array(); $attributes = Attribute::getAttributes($this->context->language->id, true); foreach ($attributes as $k => $attribute) @@ -3680,12 +3680,12 @@ switch ($this->action) $currency = $this->context->currency; $attributes_groups = AttributeGroup::getAttributesGroups($this->context->language->id); $default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT')); - + $productDownload = new ProductDownload(); $id_product_download = (int) $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id')); if (!empty($id_product_download)) - $productDownload = new ProductDownload($id_product_download); - + $productDownload = new ProductDownload($id_product_download); + $images = Image::getImages($this->context->language->id, $obj->id); if ($obj->id) { @@ -3696,7 +3696,7 @@ switch ($this->action) updateMvtStatus($(this).val()); }); updateMvtStatus($(this).val()); - + if ( $("input[name=is_virtual_file]:checked").val() == 1) { $("#virtual_good_attributes").show(); @@ -3707,7 +3707,7 @@ switch ($this->action) $("#virtual_good_attributes").hide(); $("#is_virtual_file_product").hide(); } - + $("input[name=is_virtual_file]").live("change", function() { if($(this).val() == "1") { @@ -3720,7 +3720,7 @@ switch ($this->action) $("#is_virtual_file_product").hide(); } }); - }); + }); @@ -3759,7 +3759,7 @@ switch ($this->action) - + @@ -3781,7 +3781,7 @@ switch ($this->action)

'.$this->l('Reference:').'

- '; - + if ($id_product_download && !empty($productDownload->display_filename)) { $content .= ' @@ -3978,7 +3978,7 @@ switch ($this->action) '; } - + $content .= ''; if ($obj->id) @@ -4035,12 +4035,12 @@ switch ($this->action) $id_product_download = $productDownload->getIdFromIdAttribute((int) $obj->id, (int) $id_product_attribute); if ($id_product_download) $productDownload = new ProductDownload($id_product_download); - + $available_date_attribute = substr($productDownload->date_expiration, 0, -9); - + if ($available_date_attribute == '0000-00-00') - $available_date_attribute = ''; - + $available_date_attribute = ''; + if ($productDownload->is_shareable == 1) $is_shareable = $this->l('Yes'); else @@ -4055,7 +4055,7 @@ switch ($this->action) '; - + if ($id_product_download && !empty($productDownload->display_filename)) { $content .= ' @@ -4063,19 +4063,19 @@ switch ($this->action) '; } - + $exists_file = realpath(_PS_DOWNLOAD_DIR_).'/'.$productDownload->filename; - + if ($productDownload->id && file_exists($exists_file)) $filename = $productDownload->filename; else $filename = ''; - + $content .= '