// Rename AdminController methods initForm() initList() etc. to renderForm() renderList()

This commit is contained in:
tDidierjean
2011-11-30 11:06:38 +00:00
parent ef2c7480ec
commit aefa581603
70 changed files with 328 additions and 327 deletions
+12 -12
View File
@@ -1292,19 +1292,19 @@ class AdminControllerCore extends Controller
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
} }
else if ($this->display == 'view') else if ($this->display == 'view')
{ {
// Some controllers use the view action without an object // Some controllers use the view action without an object
if ($this->className) if ($this->className)
$this->loadObject(true); $this->loadObject(true);
$this->content .= $this->initView(); $this->content .= $this->renderView();
} }
else if (!$this->ajax) else if (!$this->ajax)
{ {
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
} }
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -1344,9 +1344,9 @@ class AdminControllerCore extends Controller
} }
/** /**
* Function used to initialise the list to display for this controller * Function used to render the list to display for this controller
*/ */
public function initList() public function renderList()
{ {
if (!($this->fieldsDisplay && is_array($this->fieldsDisplay))) if (!($this->fieldsDisplay && is_array($this->fieldsDisplay)))
return false; return false;
@@ -1376,9 +1376,9 @@ class AdminControllerCore extends Controller
} }
/** /**
* Override to init display of the view page * Override to render the view page
*/ */
public function initView() public function renderView()
{ {
$helper = new HelperView($this); $helper = new HelperView($this);
$this->setHelperDisplay($helper); $this->setHelperDisplay($helper);
@@ -1391,9 +1391,9 @@ class AdminControllerCore extends Controller
} }
/** /**
* Function used to initialise the form to display for this controller * Function used to render the form for this controller
*/ */
public function initForm() public function renderForm()
{ {
if (Tools::getValue('submitFormAjax')) if (Tools::getValue('submitFormAjax'))
$this->content .= $this->context->smarty->fetch($this->context->smarty->template_dir[0].'form_submit_ajax.tpl'); $this->content .= $this->context->smarty->fetch($this->context->smarty->template_dir[0].'form_submit_ajax.tpl');
@@ -1422,9 +1422,9 @@ class AdminControllerCore extends Controller
} }
/** /**
* Function used to initialise the options to display for this controller * Function used to render the options for this controller
*/ */
public function initOptions() public function renderOptions()
{ {
if ($this->options && is_array($this->options)) if ($this->options && is_array($this->options))
{ {
+5 -5
View File
@@ -41,10 +41,10 @@ class AdminAccessController extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
$current_profile = (int)$this->getCurrentProfileId(); $current_profile = (int)$this->getCurrentProfileId();
$profiles = Profile::getProfiles($this->context->language->id); $profiles = Profile::getProfiles($this->context->language->id);
@@ -83,7 +83,7 @@ class AdminAccessController extends AdminController
'link' => $this->context->link 'link' => $this->context->link
); );
return parent::initForm(); return parent::renderForm();
} }
/** /**
@@ -101,7 +101,7 @@ class AdminAccessController extends AdminController
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -58,7 +58,7 @@ class AdminAddressesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->_select = 'cl.`name` as country'; $this->_select = 'cl.`name` as country';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON
@@ -69,10 +69,10 @@ class AdminAddressesControllerCore extends AdminController
foreach ($countries AS $country) foreach ($countries AS $country)
$this->countriesArray[$country['id_country']] = $country['name']; $this->countriesArray[$country['id_country']] = $country['name'];
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -273,7 +273,7 @@ class AdminAddressesControllerCore extends AdminController
// merge address format with the rest of the form // merge address format with the rest of the form
array_splice($this->fields_form['input'], 3, 0, $temp_fields); array_splice($this->fields_form['input'], 3, 0, $temp_fields);
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
+2 -2
View File
@@ -53,7 +53,7 @@ class AdminAliasesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -89,7 +89,7 @@ class AdminAliasesControllerCore extends AdminController
$this->fields_value = array('alias' => $this->object->getAliases()); $this->fields_value = array('alias' => $this->object->getAliases());
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -56,7 +56,7 @@ class AdminAttachmentsControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -93,7 +93,7 @@ class AdminAttachmentsControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
@@ -57,10 +57,10 @@ class AdminAttributesGroupsControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -68,7 +68,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -154,10 +154,10 @@ class AdminAttributesGroupsControllerCore extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
$group_type = array( $group_type = array(
array( array(
@@ -232,7 +232,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
return parent::initForm(); return parent::renderForm();
} }
public function initFormAttributes() public function initFormAttributes()
@@ -341,7 +341,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
'imageTextureUrl' => Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage=1' 'imageTextureUrl' => Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage=1'
); );
return parent::initForm(); return parent::renderForm();
} }
/** /**
@@ -377,7 +377,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
{ {
if (!($this->object = $this->loadObject(true))) if (!($this->object = $this->loadObject(true)))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
} }
else if ($this->display == 'editAttributes') else if ($this->display == 'editAttributes')
{ {
@@ -388,8 +388,8 @@ class AdminAttributesGroupsControllerCore extends AdminController
} }
else if ($this->display != 'view' && !$this->ajax) else if ($this->display != 'view' && !$this->ajax)
{ {
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
} }
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
+8 -8
View File
@@ -69,16 +69,16 @@ class AdminBackupControllerCore extends AdminController
); );
} }
public function initList() public function renderList()
{ {
$this->addRowAction('view'); $this->addRowAction('view');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
return parent::initList(); return parent::renderList();
} }
public function initView() public function renderView()
{ {
if (!($object = $this->loadObject())) if (!($object = $this->loadObject()))
$this->_errors[] = Tools::displayError('The object could not be loaded.'); $this->_errors[] = Tools::displayError('The object could not be loaded.');
@@ -88,14 +88,14 @@ class AdminBackupControllerCore extends AdminController
else if ($object->error) else if ($object->error)
$this->_errors[] = $object->error; $this->_errors[] = $object->error;
return parent::initView(); return parent::renderView();
} }
public function initViewDownload() public function initViewDownload()
{ {
$this->tpl_folder = $this->tpl_folder.'download/'; $this->tpl_folder = $this->tpl_folder.'download/';
return parent::initView(); return parent::renderView();
} }
public function initToolbar() public function initToolbar()
@@ -129,12 +129,12 @@ class AdminBackupControllerCore extends AdminController
// Some controllers use the view action without an object // Some controllers use the view action without an object
if ($this->className) if ($this->className)
$this->loadObject(true); $this->loadObject(true);
$this->content .= $this->initView(); $this->content .= $this->renderView();
} }
else if (!$this->ajax) else if (!$this->ajax)
{ {
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
} }
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -147,7 +147,7 @@ class AdminCarriersControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->displayInformation( $this->displayInformation(
'&nbsp;<b>'.$this->l('How to create a new carrier?').'</b> '&nbsp;<b>'.$this->l('How to create a new carrier?').'</b>
@@ -178,10 +178,10 @@ class AdminCarriersControllerCore extends AdminController
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'; $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; $this->_where = 'AND b.id_lang = '.$this->context->language->id;
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -442,7 +442,7 @@ class AdminCarriersControllerCore extends AdminController
$this->getFieldsValues($obj); $this->getFieldsValues($obj);
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -268,7 +268,7 @@ class AdminCartRulesControllerCore extends AdminController
return $productRulesArray; return $productRulesArray;
} }
public function initForm() public function renderForm()
{ {
$back = Tools::safeOutput(Tools::getValue('back', '')); $back = Tools::safeOutput(Tools::getValue('back', ''));
if (empty($back)) if (empty($back))
@@ -339,7 +339,7 @@ class AdminCartRulesControllerCore extends AdminController
$this->content .= Context::getContext()->smarty->fetch('cart_rules/form.tpl'); $this->content .= Context::getContext()->smarty->fetch('cart_rules/form.tpl');
$this->addJqueryUI('ui.datepicker'); $this->addJqueryUI('ui.datepicker');
return parent::initForm(); return parent::renderForm();
} }
public function displayAjaxSearchCartRuleVouchers() public function displayAjaxSearchCartRuleVouchers()
+2 -2
View File
@@ -99,7 +99,7 @@ class AdminCartsController extends AdminController
parent::__construct(); parent::__construct();
} }
public function initView() public function renderView()
{ {
if (!($cart = $this->loadObject(true))) if (!($cart = $this->loadObject(true)))
return; return;
@@ -178,7 +178,7 @@ class AdminCartsController extends AdminController
'customized_datas' => $customized_datas 'customized_datas' => $customized_datas
); );
return parent::initView(); return parent::renderView();
} }
public function ajaxPreProcess() public function ajaxPreProcess()
@@ -95,7 +95,7 @@ class AdminCategoriesControllerCore extends AdminController
$this->addJqueryPlugin('tagify'); $this->addJqueryPlugin('tagify');
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -113,7 +113,7 @@ class AdminCategoriesControllerCore extends AdminController
$this->tpl_list_vars['categories_tree'] = $categories_tree; $this->tpl_list_vars['categories_tree'] = $categories_tree;
$this->tpl_list_vars['categories_name'] = $categories_name; $this->tpl_list_vars['categories_name'] = $categories_name;
return parent::initList(); return parent::renderList();
} }
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
@@ -131,10 +131,10 @@ class AdminCategoriesControllerCore extends AdminController
} }
} }
public function initView() public function renderView()
{ {
$this->initToolbar(); $this->initToolbar();
return $this->initList(); return $this->renderList();
} }
public function initToolbar() public function initToolbar()
@@ -166,7 +166,7 @@ class AdminCategoriesControllerCore extends AdminController
parent::initToolbar(); parent::initToolbar();
} }
public function initForm() public function renderForm()
{ {
$this->initToolbar(); $this->initToolbar();
$obj = $this->loadObject(true); $obj = $this->loadObject(true);
@@ -315,7 +315,7 @@ class AdminCategoriesControllerCore extends AdminController
foreach ($groups as $group) foreach ($groups as $group)
$this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $carrier_groups_ids))); $this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $carrier_groups_ids)));
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -54,10 +54,10 @@ class AdminCmsCategoriesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->initToolbar(); $this->initToolbar();
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -174,7 +174,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
parent::postProcess(true); parent::postProcess(true);
} }
public function initForm() public function renderForm()
{ {
$this->display = 'edit'; $this->display = 'edit';
$this->initToolbar(); $this->initToolbar();
@@ -273,6 +273,6 @@ class AdminCmsCategoriesControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
} }
@@ -75,9 +75,9 @@ class AdminCmsContentControllerCore extends AdminController
$this->adminCMS->token = $this->token; $this->adminCMS->token = $this->token;
if ($this->display == 'edit_category') if ($this->display == 'edit_category')
$this->content .= $this->adminCMSCategories->initForm(); $this->content .= $this->adminCMSCategories->renderForm();
elseif ($this->display == 'edit_page') elseif ($this->display == 'edit_page')
$this->content .= $this->adminCMS->initForm(); $this->content .= $this->adminCMS->renderForm();
elseif ($this->display == 'view_page'){} elseif ($this->display == 'view_page'){}
else else
{ {
@@ -93,9 +93,9 @@ class AdminCmsContentControllerCore extends AdminController
if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway')) if (Tools::getValue($tab.'Orderby') && Tools::getValue($tab.'Orderway'))
$catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', self::$currentIndex); $catBarIndex = preg_replace('/&'.$tab.'Orderby=([a-z _]*)&'.$tab.'Orderway=([a-z]*)/i', '', self::$currentIndex);
$this->content .= $this->adminCMSCategories->initList(); $this->content .= $this->adminCMSCategories->renderList();
$this->adminCMS->id_cms_category = $id_cms_category; $this->adminCMS->id_cms_category = $id_cms_category;
$this->content .= $this->adminCMS->initList(); $this->content .= $this->adminCMS->renderList();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'cms_breadcrumb' => getPath($catBarIndex, $id_cms_category,'','','cms'), 'cms_breadcrumb' => getPath($catBarIndex, $id_cms_category,'','','cms'),
)); ));
+4 -4
View File
@@ -58,7 +58,7 @@ class AdminCmsControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->display = 'edit'; $this->display = 'edit';
$this->toolbar_btn['save-and-preview'] = array( $this->toolbar_btn['save-and-preview'] = array(
@@ -170,10 +170,10 @@ class AdminCmsControllerCore extends AdminController
'active' => $this->object->active 'active' => $this->object->active
); );
return parent::initForm(); return parent::renderForm();
} }
public function initList() public function renderList()
{ {
$this->toolbar_title = $this->l('Pages in this category'); $this->toolbar_title = $this->l('Pages in this category');
$this->toolbar_btn['new'] = array( $this->toolbar_btn['new'] = array(
@@ -181,7 +181,7 @@ class AdminCmsControllerCore extends AdminController
'desc' => $this->l('Add new') 'desc' => $this->l('Add new')
); );
return parent::initList(); return parent::renderList();
} }
public function displayList($token = NULL) public function displayList($token = NULL)
@@ -46,7 +46,7 @@ class AdminContactsControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -109,7 +109,7 @@ class AdminContactsControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
} }
@@ -122,15 +122,15 @@ class AdminCountriesControllerCore extends AdminController
$this->addJqueryPlugin('fieldselection'); $this->addJqueryPlugin('fieldselection');
} }
public function initList() public function renderList()
{ {
$this->_select = 'z.`name` AS zone'; $this->_select = 'z.`name` AS zone';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -352,7 +352,7 @@ class AdminCountriesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -82,7 +82,7 @@ class AdminCurrenciesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -90,10 +90,10 @@ class AdminCurrenciesControllerCore extends AdminController
$this->_where = 'AND a.`deleted` = 0'; $this->_where = 'AND a.`deleted` = 0';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -247,7 +247,7 @@ class AdminCurrenciesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -418,7 +418,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
return $output; return $output;
} }
public function initView() public function renderView()
{ {
$content = ''; $content = '';
$this->toolbar_title = $this->l('Customer Threads'); $this->toolbar_title = $this->l('Customer Threads');
@@ -613,7 +613,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$content .= '</div><div class="clear">&nbsp;</div>'; $content .= '</div><div class="clear">&nbsp;</div>';
$this->content = $content; $this->content = $content;
return parent::initView(); return parent::renderView();
} }
private function displayButton($content) private function displayButton($content)
@@ -627,7 +627,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
} }
public function initOptions() public function renderOptions()
{ {
if (Configuration::get('PS_SAV_IMAP_URL') if (Configuration::get('PS_SAV_IMAP_URL')
&& Configuration::get('PS_SAV_IMAP_PORT') && Configuration::get('PS_SAV_IMAP_PORT')
@@ -637,7 +637,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
else else
$this->tpl_option_vars['use_sync'] = false; $this->tpl_option_vars['use_sync'] = false;
return parent::initOptions(); return parent::renderOptions();
} }
@@ -182,7 +182,7 @@ class AdminCustomersControllerCore extends AdminController
$this->action = 'select_delete'; $this->action = 'select_delete';
} }
public function initList() public function renderList()
{ {
$this->_select = '(YEAR(CURRENT_DATE)-YEAR(`birthday`)) - (RIGHT(CURRENT_DATE, 5) < RIGHT(birthday, 5)) AS `age`, ( $this->_select = '(YEAR(CURRENT_DATE)-YEAR(`birthday`)) - (RIGHT(CURRENT_DATE, 5) < RIGHT(birthday, 5)) AS `age`, (
SELECT c.date_add FROM '._DB_PREFIX_.'guest g SELECT c.date_add FROM '._DB_PREFIX_.'guest g
@@ -192,10 +192,10 @@ class AdminCustomersControllerCore extends AdminController
LIMIT 1 LIMIT 1
) as connect'; ) as connect';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -395,10 +395,10 @@ class AdminCustomersControllerCore extends AdminController
foreach ($groups as $group) foreach ($groups as $group)
$this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], in_array($group['id_group'], $customer_groups_ids)); $this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], in_array($group['id_group'], $customer_groups_ids));
return parent::initForm(); return parent::renderForm();
} }
public function initView() public function renderView()
{ {
if (!($customer = $this->loadObject())) if (!($customer = $this->loadObject()))
return; return;
@@ -577,7 +577,7 @@ class AdminCustomersControllerCore extends AdminController
'show_toolbar' => true 'show_toolbar' => true
); );
return parent::initView(); return parent::renderView();
} }
public function processDelete($token) public function processDelete($token)
+5 -5
View File
@@ -106,8 +106,8 @@ class AdminDbControllerCore extends AdminController
$this->display = 'options'; $this->display = 'options';
$this->initToolbar(); $this->initToolbar();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -115,7 +115,7 @@ class AdminDbControllerCore extends AdminController
)); ));
} }
public function initForm() public function renderForm()
{ {
$engines = array(); $engines = array();
$tab_engines = $this->getEngines(); $tab_engines = $this->getEngines();
@@ -158,7 +158,7 @@ class AdminDbControllerCore extends AdminController
$this->show_toolbar = false; $this->show_toolbar = false;
return parent::initForm(); return parent::renderForm();
} }
/* /*
@@ -168,7 +168,7 @@ class AdminDbControllerCore extends AdminController
For all issues, check the config/settings.inc.php file.'); For all issues, check the config/settings.inc.php file.');
$this->initToolbar(); $this->initToolbar();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
$table_status = $this->getTablesStatus(); $table_status = $this->getTablesStatus();
foreach ($table_status as $key => $table) foreach ($table_status as $key => $table)
@@ -57,7 +57,7 @@ class AdminDeliverySlipControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -95,7 +95,7 @@ class AdminDeliverySlipControllerCore extends AdminController
'date_to' => date('Y-m-d') 'date_to' => date('Y-m-d')
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -121,9 +121,9 @@ class AdminDeliverySlipControllerCore extends AdminController
public function initContent() public function initContent()
{ {
$this->content .= $this->initForm().'<br />'; $this->content .= $this->renderForm().'<br />';
$this->show_toolbar = false; $this->show_toolbar = false;
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -96,16 +96,16 @@ class AdminEmployeesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->_select = 'pl.`name` AS profile'; $this->_select = 'pl.`name` AS profile';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile` $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.')'; LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$this->context->language->id.')';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -262,7 +262,7 @@ class AdminEmployeesControllerCore extends AdminController
$this->fields_value['passwd'] = false; $this->fields_value['passwd'] = false;
return parent::initForm(); return parent::renderForm();
} }
protected function _childValidation() protected function _childValidation()
+14 -14
View File
@@ -62,10 +62,10 @@ class AdminFeaturesControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -84,7 +84,7 @@ class AdminFeaturesControllerCore extends AdminController
'desc' => $this->l('Add new feature') 'desc' => $this->l('Add new feature')
); );
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -151,10 +151,10 @@ class AdminFeaturesControllerCore extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
$this->toolbar_title = $this->l('Add a new feature'); $this->toolbar_title = $this->l('Add a new feature');
$this->fields_form = array( $this->fields_form = array(
@@ -190,7 +190,7 @@ class AdminFeaturesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
return parent::initForm(); return parent::renderForm();
} }
/** /**
@@ -224,8 +224,8 @@ class AdminFeaturesControllerCore extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initFormFeatureValue() public function initFormFeatureValue()
{ {
@@ -314,14 +314,14 @@ class AdminFeaturesControllerCore extends AdminController
{ {
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
} }
else if ($this->display == 'view') else if ($this->display == 'view')
{ {
// Some controllers use the view action without an object // Some controllers use the view action without an object
if ($this->className) if ($this->className)
$this->loadObject(true); $this->loadObject(true);
$this->content .= $this->initView(); $this->content .= $this->renderView();
} }
else if ($this->display == 'editFeatureValue') else if ($this->display == 'editFeatureValue')
{ {
@@ -332,8 +332,8 @@ class AdminFeaturesControllerCore extends AdminController
} }
else if (!$this->ajax) else if (!$this->ajax)
{ {
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
} }
} }
else else
+2 -2
View File
@@ -89,7 +89,7 @@ class AdminGendersController extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -166,7 +166,7 @@ class AdminGendersController extends AdminController
'image' => $obj->getImage() 'image' => $obj->getImage()
); );
return parent::initForm(); return parent::renderForm();
} }
public function displayGenderType($value, $tr) public function displayGenderType($value, $tr)
@@ -129,11 +129,11 @@ class AdminGeolocationControllerCore extends AdminController
return parent::postProcess(); return parent::postProcess();
} }
public function initOptions() public function renderOptions()
{ {
$this->tpl_option_vars = array('allowed_countries' => explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))); $this->tpl_option_vars = array('allowed_countries' => explode(';', Configuration::get('PS_ALLOWED_COUNTRIES')));
return parent::initOptions(); return parent::renderOptions();
} }
public function initContent() public function initContent()
@@ -66,7 +66,7 @@ class AdminGroupShopControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -207,7 +207,7 @@ class AdminGroupShopControllerCore extends AdminController
if (isset($this->fields_import_form)) if (isset($this->fields_import_form))
$this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form)); $this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form));
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
+4 -4
View File
@@ -68,7 +68,7 @@ class AdminGroupsController extends AdminController
$this->addJqueryUi('ui.sortable'); $this->addJqueryUi('ui.sortable');
} }
public function initView() public function renderView()
{ {
$this->context = Context::getContext(); $this->context = Context::getContext();
if (!($group = $this->loadObject(true))) if (!($group = $this->loadObject(true)))
@@ -80,7 +80,7 @@ class AdminGroupsController extends AdminController
'categorieReductions' => $this->formatCategoryDiscountList($group->id) 'categorieReductions' => $this->formatCategoryDiscountList($group->id)
); );
return parent::initView(); return parent::renderView();
} }
protected function initCustomersList($group) protected function initCustomersList($group)
@@ -116,7 +116,7 @@ class AdminGroupsController extends AdminController
return $helper->generateList($customer_list, $customer_fields_display); return $helper->generateList($customer_list, $customer_fields_display);
} }
public function initForm() public function renderForm()
{ {
if (!($group = $this->loadObject(true))) if (!($group = $this->loadObject(true)))
return; return;
@@ -194,7 +194,7 @@ class AdminGroupsController extends AdminController
); );
$this->tpl_form_vars['categoryTreeView'] = Helper::renderAdminCategorieTree($trads, array(), 'id_category', true); $this->tpl_form_vars['categoryTreeView'] = Helper::renderAdminCategorieTree($trads, array(), 'id_category', true);
return parent::initForm(); return parent::renderForm();
} }
+6 -6
View File
@@ -343,7 +343,7 @@ class AdminImportController extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
if (!is_writable(_PS_ADMIN_DIR_.'/import/')) if (!is_writable(_PS_ADMIN_DIR_.'/import/'))
$this->displayWarning($this->l('directory import on admin directory must be writable (CHMOD 755 / 777)')); $this->displayWarning($this->l('directory import on admin directory must be writable (CHMOD 755 / 777)'));
@@ -380,10 +380,10 @@ class AdminImportController extends AdminController
'available_fields' => $this->getAvailableFields() 'available_fields' => $this->getAvailableFields()
); );
return parent::initForm(); return parent::renderForm();
} }
public function initView() public function renderView()
{ {
$this->addJS(_PS_JS_DIR_.'adminImport.js'); $this->addJS(_PS_JS_DIR_.'adminImport.js');
@@ -421,7 +421,7 @@ class AdminImportController extends AdminController
'data' => $data 'data' => $data
); );
return parent::initView(); return parent::renderView();
} }
public function initToolbar() public function initToolbar()
@@ -500,9 +500,9 @@ class AdminImportController extends AdminController
// toolbar (save, cancel, new, ..) // toolbar (save, cancel, new, ..)
$this->initToolbar(); $this->initToolbar();
if ($this->display == 'import') if ($this->display == 'import')
$this->content .= $this->initView(); $this->content .= $this->renderView();
else else
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -33,7 +33,7 @@ class AdminInformationControllerCore extends AdminController
parent::initContent(); parent::initContent();
} }
public function initView() public function renderView()
{ {
$this->tpl_view_vars = array( $this->tpl_view_vars = array(
'version' => array( 'version' => array(
@@ -62,7 +62,7 @@ class AdminInformationControllerCore extends AdminController
$this->toolbar_title = $this->l('Tools : Informations'); $this->toolbar_title = $this->l('Tools : Informations');
unset($this->toolbar_btn['cancel']); unset($this->toolbar_btn['cancel']);
return parent::initView(); return parent::renderView();
} }
/** /**
@@ -113,7 +113,7 @@ class AdminInvoicesControllerCore extends AdminController
$this->tpl_form_vars = array('style' => 'float:left;'); $this->tpl_form_vars = array('style' => 'float:left;');
$this->table = 'invoice_date'; $this->table = 'invoice_date';
$this->toolbar_title = $this->l('Print PDF invoices'); $this->toolbar_title = $this->l('Print PDF invoices');
return parent::initForm(); return parent::renderForm();
} }
public function initFormByStatus() public function initFormByStatus()
@@ -167,7 +167,7 @@ class AdminInvoicesControllerCore extends AdminController
$this->table = 'invoice_status'; $this->table = 'invoice_status';
$this->show_toolbar = false; $this->show_toolbar = false;
return parent::initForm(); return parent::renderForm();
} }
public function initContent() public function initContent()
@@ -177,7 +177,7 @@ class AdminInvoicesControllerCore extends AdminController
$this->content .= $this->initFormByDate(); $this->content .= $this->initFormByDate();
$this->content .= $this->initFormByStatus(); $this->content .= $this->initFormByStatus();
$this->table = 'invoice'; $this->table = 'invoice';
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -110,7 +110,7 @@ class AdminLanguagesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -119,10 +119,10 @@ class AdminLanguagesControllerCore extends AdminController
$this->specificConfirmDelete = $this->l('When you delete a language, ALL RELATED TRANSLATIONS IN THE DATABASE WILL BE DELETED, are you sure you want to delete this language?', __CLASS__, true, false); $this->specificConfirmDelete = $this->l('When you delete a language, ALL RELATED TRANSLATIONS IN THE DATABASE WILL BE DELETED, are you sure you want to delete this language?', __CLASS__, true, false);
$this->displayWarning($this->l('When you delete a language, all related translations in the database will be deleted.')); $this->displayWarning($this->l('When you delete a language, all related translations in the database will be deleted.'));
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -290,7 +290,7 @@ class AdminLanguagesControllerCore extends AdminController
$this->addJS(_PS_JS_DIR_.'checkLangPack.js'); $this->addJS(_PS_JS_DIR_.'checkLangPack.js');
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -123,10 +123,10 @@ class AdminLocalizationControllerCore extends AdminController
parent::postProcess(); parent::postProcess();
} }
public function initForm() public function renderForm()
{ {
$localizations_pack = false; $localizations_pack = false;
$this->tpl_option_vars['options_content'] = $this->initOptions(); $this->tpl_option_vars['options_content'] = $this->renderOptions();
$xml_localization = Tools::simplexml_load_file('http://api.prestashop.com/rss/localization.xml'); $xml_localization = Tools::simplexml_load_file('http://api.prestashop.com/rss/localization.xml');
if (!$xml_localization) if (!$xml_localization)
@@ -216,19 +216,19 @@ class AdminLocalizationControllerCore extends AdminController
); );
$this->show_toolbar = false; $this->show_toolbar = false;
return parent::initForm(); return parent::renderForm();
} }
public function initContent() public function initContent()
{ {
// toolbar (save, cancel, new, ..) // toolbar (save, cancel, new, ..)
$this->initToolbar(); $this->initToolbar();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -115,7 +115,7 @@ class AdminManufacturersControllerCore extends AdminController
$this->context->smarty->assign('title_list', $this->l('List of manufacturers:')); $this->context->smarty->assign('title_list', $this->l('List of manufacturers:'));
$this->content .= parent::initList(); $this->content .= parent::renderList();
} }
public function initListManufacturerAddresses() public function initListManufacturerAddresses()
@@ -200,11 +200,11 @@ class AdminManufacturersControllerCore extends AdminController
$this->postProcess(); $this->postProcess();
$this->initToolbar(); $this->initToolbar();
$this->content .= parent::initList(); $this->content .= parent::renderList();
} }
public function initList() public function renderList()
{ {
$this->initListManufacturer(); $this->initListManufacturer();
$this->initListManufacturerAddresses(); $this->initListManufacturerAddresses();
@@ -231,7 +231,7 @@ class AdminManufacturersControllerCore extends AdminController
return $this->context->smarty->fetch('helper/list/list_action_edit.tpl'); return $this->context->smarty->fetch('helper/list/list_action_edit.tpl');
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'tinymce' => true, 'tinymce' => true,
@@ -359,7 +359,7 @@ class AdminManufacturersControllerCore extends AdminController
)), ENT_COMPAT, 'UTF-8'); )), ENT_COMPAT, 'UTF-8');
} }
return parent::initForm(); return parent::renderForm();
} }
public function initFormAddress() public function initFormAddress()
@@ -562,7 +562,7 @@ class AdminManufacturersControllerCore extends AdminController
} }
} }
public function initView() public function renderView()
{ {
if (!($manufacturer = $this->loadObject())) if (!($manufacturer = $this->loadObject()))
return; return;
@@ -610,7 +610,7 @@ class AdminManufacturersControllerCore extends AdminController
'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'), 'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'),
); );
return parent::initView(); return parent::renderView();
} }
public function initContent() public function initContent()
@@ -623,19 +623,19 @@ class AdminManufacturersControllerCore extends AdminController
{ {
if (!$this->loadObject(true)) if (!$this->loadObject(true))
return; return;
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
} }
else if ($this->display == 'view') else if ($this->display == 'view')
{ {
// Some controllers use the view action without an object // Some controllers use the view action without an object
if ($this->className) if ($this->className)
$this->loadObject(true); $this->loadObject(true);
$this->content .= $this->initView(); $this->content .= $this->renderView();
} }
else if (!$this->ajax) else if (!$this->ajax)
{ {
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initOptions(); $this->content .= $this->renderOptions();
} }
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
+2 -2
View File
@@ -100,7 +100,7 @@ class AdminMetaControllerCore extends AdminController
); );
} }
public function initForm() public function renderForm()
{ {
$files = Meta::getPages(true, ($this->object->page ? $this->object->page : false)); $files = Meta::getPages(true, ($this->object->page ? $this->object->page : false));
$pages = array(); $pages = array();
@@ -172,7 +172,7 @@ class AdminMetaControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -219,7 +219,7 @@ class AdminModulesPositionsControllerCore extends AdminController
if (array_key_exists('addToHook', $_GET) OR array_key_exists('editGraft', $_GET) OR (Tools::isSubmit('submitAddToHook') AND $this->_errors)) if (array_key_exists('addToHook', $_GET) OR array_key_exists('editGraft', $_GET) OR (Tools::isSubmit('submitAddToHook') AND $this->_errors))
{ {
$this->display = 'edit'; $this->display = 'edit';
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
} }
else else
$this->content .= $this->initMain(); $this->content .= $this->initMain();
@@ -287,7 +287,7 @@ class AdminModulesPositionsControllerCore extends AdminController
return $this->context->smarty->fetch('modules_positions/list_modules.tpl'); return $this->context->smarty->fetch('modules_positions/list_modules.tpl');
} }
public function initForm() public function renderForm()
{ {
// Init toolbar // Init toolbar
$this->initToolbarTitle(); $this->initToolbarTitle();
+4 -4
View File
@@ -83,9 +83,9 @@ class AdminOrdersControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
parent::initForm(); parent::renderForm();
$this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch')); $this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch'));
$cart = new Cart((int)Tools::getValue('id_cart')); $cart = new Cart((int)Tools::getValue('id_cart'));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -679,7 +679,7 @@ class AdminOrdersControllerCore extends AdminController
parent::postProcess(); parent::postProcess();
} }
public function initView() public function renderView()
{ {
$order = new Order(Tools::getValue('id_order')); $order = new Order(Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
@@ -759,7 +759,7 @@ class AdminOrdersControllerCore extends AdminController
'HOOK_ADMIN_ORDER' => Hook::exec('adminOrder', array('id_order' => $order->id)) 'HOOK_ADMIN_ORDER' => Hook::exec('adminOrder', array('id_order' => $order->id))
); );
return parent::initView(); return parent::renderView();
} }
public function ajaxProcessSearchCustomers() public function ajaxProcessSearchCustomers()
+2 -2
View File
@@ -116,7 +116,7 @@ class AdminPaymentControllerCore extends AdminController
return parent::initContent(); return parent::initContent();
} }
public function initView() public function renderView()
{ {
// link to modules page // link to modules page
if (isset($this->payment_modules[0])) if (isset($this->payment_modules[0]))
@@ -192,7 +192,7 @@ class AdminPaymentControllerCore extends AdminController
$this->toolbar_title = $this->l('Paiement'); $this->toolbar_title = $this->l('Paiement');
unset($this->toolbar_btn['cancel']); unset($this->toolbar_btn['cancel']);
return parent::initView(); return parent::renderView();
} }
} }
@@ -444,7 +444,7 @@ class AdminPerformanceController extends AdminController
$this->tpl_form_vars['servers'] = CacheMemcache::getMemcachedServers(); $this->tpl_form_vars['servers'] = CacheMemcache::getMemcachedServers();
} }
public function initForm() public function renderForm()
{ {
// Initialize fieldset for a form // Initialize fieldset for a form
$this->initFieldsetSmarty(); $this->initFieldsetSmarty();
@@ -457,7 +457,7 @@ class AdminPerformanceController extends AdminController
// Activate multiple fieldset // Activate multiple fieldset
$this->multiple_fieldsets = true; $this->multiple_fieldsets = true;
return parent::initForm(); return parent::renderForm();
} }
public function initContent() public function initContent()
@@ -477,7 +477,7 @@ class AdminPerformanceController extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->display = ''; $this->display = '';
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
@@ -1708,11 +1708,11 @@ class AdminProductsControllerCore extends AdminController
parent::initContent(); parent::initContent();
} }
public function initList() public function renderList()
{ {
if (!Tools::getValue('id_category')) if (!Tools::getValue('id_category'))
unset($this->fieldsDisplay['position']); unset($this->fieldsDisplay['position']);
return parent::initList(); return parent::renderList();
} }
public function ajaxProcessProductManufacturers() public function ajaxProcessProductManufacturers()
@@ -1865,7 +1865,7 @@ class AdminProductsControllerCore extends AdminController
* *
* @return void * @return void
*/ */
public function initForm() public function renderForm()
{ {
if(!method_exists($this, 'initForm'.$this->action)) if(!method_exists($this, 'initForm'.$this->action))
return ""; return "";
@@ -1905,7 +1905,7 @@ class AdminProductsControllerCore extends AdminController
else else
return $this->tpl_form_vars['custom_form']; return $this->tpl_form_vars['custom_form'];
} }
return parent::initForm(); return parent::renderForm();
} }
public function getPreviewUrl(Product $product) public function getPreviewUrl(Product $product)
@@ -50,7 +50,7 @@ class AdminRangePriceControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$currency = $this->context->currency; $currency = $this->context->currency;
$carriers = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); $carriers = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
@@ -103,7 +103,7 @@ class AdminRangePriceControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
@@ -50,7 +50,7 @@ class AdminRangeWeightControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$carriers = Carrier::getCarriers($this->context->language->id, true , false, false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); $carriers = Carrier::getCarriers($this->context->language->id, true , false, false, NULL, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
foreach ($carriers AS $key => $carrier) foreach ($carriers AS $key => $carrier)
@@ -101,7 +101,7 @@ class AdminRangeWeightControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
@@ -141,7 +141,7 @@ class AdminReferrersControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
// Display list Referrers: // Display list Referrers:
$this->addRowAction('view'); $this->addRowAction('view');
@@ -166,10 +166,10 @@ class AdminReferrersControllerCore extends AdminController
'settings_form' => $this->displaySettings() 'settings_form' => $this->displaySettings()
); );
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$uri = Tools::getHttpHost(true, true).__PS_BASE_URI__; $uri = Tools::getHttpHost(true, true).__PS_BASE_URI__;
@@ -342,7 +342,7 @@ class AdminReferrersControllerCore extends AdminController
$this->tpl_form_vars = array('uri' => $uri); $this->tpl_form_vars = array('uri' => $uri);
return parent::initForm(); return parent::renderForm();
} }
public function displayCalendar($action = null, $table = null, $identifier = null, $id = null) public function displayCalendar($action = null, $table = null, $identifier = null, $id = null)
@@ -397,7 +397,7 @@ class AdminReferrersControllerCore extends AdminController
return parent::postProcess(); return parent::postProcess();
} }
public function initView() public function renderView()
{ {
$referrer = new Referrer((int)Tools::getValue('id_referrer')); $referrer = new Referrer((int)Tools::getValue('id_referrer'));
@@ -424,7 +424,7 @@ class AdminReferrersControllerCore extends AdminController
'id_lang' => (int)$this->context->language->id 'id_lang' => (int)$this->context->language->id
); );
return parent::initView(); return parent::renderView();
} }
} }
@@ -46,7 +46,7 @@ class AdminRequestSqlControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->displayWarning($this->l('When saving the query, only the request type "SELECT" are allowed.')); $this->displayWarning($this->l('When saving the query, only the request type "SELECT" are allowed.'));
$this->displayInformation(' $this->displayInformation('
@@ -73,10 +73,10 @@ class AdminRequestSqlControllerCore extends AdminController
) )
); );
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -105,10 +105,10 @@ class AdminRequestSqlControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function initView() public function renderView()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -133,7 +133,7 @@ class AdminRequestSqlControllerCore extends AdminController
$this->tpl_view_vars = array( $this->tpl_view_vars = array(
'view' => $view 'view' => $view
); );
return parent::initView(); return parent::renderView();
} }
public function _childValidation() public function _childValidation()
+2 -2
View File
@@ -57,7 +57,7 @@ class AdminReturnControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -151,7 +151,7 @@ class AdminReturnControllerCore extends AdminController
'quantityDisplayed' => $quantityDisplayed, 'quantityDisplayed' => $quantityDisplayed,
'id_order_return' => $this->object->id, 'id_order_return' => $this->object->id,
); );
return parent::initForm(); return parent::renderForm();
} }
public function initToolbar() public function initToolbar()
+2 -2
View File
@@ -99,7 +99,7 @@ class AdminScenesControllerCore extends AdminController
return true; return true;
} }
public function initForm() public function renderForm()
{ {
$this->initFieldsForm(); $this->initFieldsForm();
$content = ''; $content = '';
@@ -113,7 +113,7 @@ class AdminScenesControllerCore extends AdminController
$products = $obj->getProducts(true, $this->context->language->id, false, $this->context); $products = $obj->getProducts(true, $this->context->language->id, false, $this->context);
$this->tpl_form_vars['products'] = $obj->getProducts(true, $this->context->language->id, false, $this->context); $this->tpl_form_vars['products'] = $obj->getProducts(true, $this->context->language->id, false, $this->context);
return parent::initForm(); return parent::renderForm();
} }
public function initFieldsForm() public function initFieldsForm()
+3 -3
View File
@@ -225,13 +225,13 @@ class AdminSearchControllerCore extends AdminController
$this->toolbar_title = $this->l('Search results'); $this->toolbar_title = $this->l('Search results');
} }
public function initView() public function renderView()
{ {
$this->tpl_view_vars['query'] = $this->query; $this->tpl_view_vars['query'] = $this->query;
$this->tpl_view_vars['show_toolbar'] = true; $this->tpl_view_vars['show_toolbar'] = true;
if (sizeof($this->_errors)) if (sizeof($this->_errors))
return parent::initView(); return parent::renderView();
else else
{ {
$helper = new HelperList(); $helper = new HelperList();
@@ -274,7 +274,7 @@ class AdminSearchControllerCore extends AdminController
} }
$this->tpl_view_vars['customers'] = $view; $this->tpl_view_vars['customers'] = $view;
} }
return parent::initView(); return parent::renderView();
} }
} }
} }
+4 -4
View File
@@ -97,7 +97,7 @@ class AdminShopControllerCore extends AdminController
parent::initContent(); parent::initContent();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -112,7 +112,7 @@ class AdminShopControllerCore extends AdminController
ON (a.id_category = cl.id_category AND cl.id_lang='.(int)$this->context->language->id.')'; ON (a.id_category = cl.id_category AND cl.id_lang='.(int)$this->context->language->id.')';
$this->_group = 'GROUP BY a.id_shop'; $this->_group = 'GROUP BY a.id_shop';
return parent::initList(); return parent::renderList();
} }
public function postProcess() public function postProcess()
@@ -159,7 +159,7 @@ class AdminShopControllerCore extends AdminController
$this->addRowActionSkipList('delete', $shop_delete_list); $this->addRowActionSkipList('delete', $shop_delete_list);
} }
public function initForm() public function renderForm()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -329,6 +329,6 @@ class AdminShopControllerCore extends AdminController
if (isset($this->fields_import_form)) if (isset($this->fields_import_form))
$this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form)); $this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form));
return parent::initForm(); return parent::renderForm();
} }
} }
+4 -4
View File
@@ -87,7 +87,7 @@ class AdminShopUrlControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->addRowActionSkipList('delete', array(1)); $this->addRowActionSkipList('delete', array(1));
@@ -98,10 +98,10 @@ class AdminShopUrlControllerCore extends AdminController
$this->_select = 's.name AS shop_name, CONCAT(a.physical_uri, a.virtual_uri) AS uri'; $this->_select = 's.name AS shop_name, CONCAT(a.physical_uri, a.virtual_uri) AS uri';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'shop` s ON (s.id_shop = a.id_shop)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'shop` s ON (s.id_shop = a.id_shop)';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -232,7 +232,7 @@ class AdminShopUrlControllerCore extends AdminController
'physical_uri' => Validate::isLoadedObject($obj) ? $this->getFieldValue($obj, 'physical_uri') : $current_shop->physical_uri 'physical_uri' => Validate::isLoadedObject($obj) ? $this->getFieldValue($obj, 'physical_uri') : $current_shop->physical_uri
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
+6 -6
View File
@@ -56,16 +56,16 @@ class AdminSlipControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -105,7 +105,7 @@ class AdminSlipControllerCore extends AdminController
); );
$this->show_toolbar = false; $this->show_toolbar = false;
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -132,8 +132,8 @@ class AdminSlipControllerCore extends AdminController
public function initContent() public function initContent()
{ {
$this->initToolbar(); $this->initToolbar();
$this->content .= $this->initList(); $this->content .= $this->renderList();
$this->content .= $this->initForm(); $this->content .= $this->renderForm();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'content' => $this->content, 'content' => $this->content,
+4 -4
View File
@@ -79,15 +79,15 @@ class AdminStatesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->_select = 'z.`name` AS zone'; $this->_select = 'z.`name` AS zone';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -168,7 +168,7 @@ class AdminStatesControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -43,7 +43,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
// Some controllers use the view action without an object // Some controllers use the view action without an object
if ($this->className) if ($this->className)
$this->loadObject(true); $this->loadObject(true);
$this->content .= $this->initView(); $this->content .= $this->renderView();
} }
$this->content .= $this->displayMenu(); $this->content .= $this->displayMenu();
@@ -99,14 +99,14 @@ class AdminStatusesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$list_orders_status = parent::initList(); $list_orders_status = parent::renderList();
// Added new list // Added new list
@@ -150,7 +150,7 @@ class AdminStatusesControllerCore extends AdminController
$this->postProcess(); $this->postProcess();
$this->toolbar_title = $this->l('Return statuses'); $this->toolbar_title = $this->l('Return statuses');
$list_orders_returns_status = parent::initList(); $list_orders_returns_status = parent::renderList();
return $list_orders_status.$list_orders_returns_status; return $list_orders_status.$list_orders_returns_status;
} }
@@ -176,7 +176,7 @@ class AdminStatusesControllerCore extends AdminController
return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/manufacturers/list_action_edit_adresses.tpl'); return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/manufacturers/list_action_edit_adresses.tpl');
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'tinymce' => true, 'tinymce' => true,
@@ -314,7 +314,7 @@ class AdminStatusesControllerCore extends AdminController
'shipped_on' => $this->getFieldValue($obj, 'shipped') 'shipped_on' => $this->getFieldValue($obj, 'shipped')
); );
return parent::initForm(); return parent::renderForm();
} }
public function initFormStatus() public function initFormStatus()
@@ -139,10 +139,10 @@ class AdminStockConfigurationController extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
// if we are managing StockMvtReason // if we are managing StockMvtReason
if (Tools::isSubmit('addstock_mvt_reason') || Tools::isSubmit('updatestock_mvt_reason')) if (Tools::isSubmit('addstock_mvt_reason') || Tools::isSubmit('updatestock_mvt_reason'))
@@ -366,14 +366,14 @@ class AdminStockConfigurationController extends AdminController
} }
} }
return parent::initForm(); return parent::renderForm();
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
/** /**
* General messages displayed for all lists * General messages displayed for all lists
@@ -397,7 +397,7 @@ class AdminStockConfigurationController extends AdminController
$this->_where = ' AND a.deleted = 0'; $this->_where = ' AND a.deleted = 0';
$this->toolbar_title = $this->l('Stock : Stock movements labels'); $this->toolbar_title = $this->l('Stock : Stock movements labels');
$first_list = parent::initList(); $first_list = parent::renderList();
/** /**
* Second list * Second list
@@ -418,8 +418,8 @@ class AdminStockConfigurationController extends AdminController
} }
/* /*
* Help function for AdminStockConfigurationController::initList() * Help function for AdminStockConfigurationController::renderList()
* @see AdminStockConfigurationController::initList() * @see AdminStockConfigurationController::renderList()
*/ */
public function initSupplyOrderStatusList() public function initSupplyOrderStatusList()
{ {
@@ -495,7 +495,7 @@ class AdminStockConfigurationController extends AdminController
), ),
); );
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -144,10 +144,10 @@ class AdminStockCoverControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->addRowAction('details'); $this->addRowAction('details');
@@ -172,7 +172,7 @@ class AdminStockCoverControllerCore extends AdminController
$this->displayInformation($this->l('Considering the coverage period choosen and the quantity of products/combinations that you sold, $this->displayInformation($this->l('Considering the coverage period choosen and the quantity of products/combinations that you sold,
this interface gives you an idea of when one product will run out of stock.')); this interface gives you an idea of when one product will run out of stock.'));
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -98,10 +98,10 @@ class AdminStockInstantStateControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
// query // query
$this->_select = ' $this->_select = '
@@ -130,7 +130,7 @@ class AdminStockInstantStateControllerCore extends AdminController
// displays help information // displays help information
$this->displayInformation($this->l('This interface allows you to display detailed informations on your stock, per warehouse.')); $this->displayInformation($this->l('This interface allows you to display detailed informations on your stock, per warehouse.'));
return parent::initList(); return parent::renderList();
} }
/** /**
@@ -79,10 +79,10 @@ class AdminStockManagementControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->addRowAction('details'); $this->addRowAction('details');
$this->addRowAction('addstock'); $this->addRowAction('addstock');
@@ -103,14 +103,14 @@ class AdminStockManagementControllerCore extends AdminController
$this->displayInformation($this->l('Through this interface, you can add and delete products for a given warehouse.')); $this->displayInformation($this->l('Through this interface, you can add and delete products for a given warehouse.'));
$this->displayInformation($this->l('Also, you can transfer products between warehouses, or within one warehouse.')); $this->displayInformation($this->l('Also, you can transfer products between warehouses, or within one warehouse.'));
return parent::initList(); return parent::renderList();
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
$id_product = (int)Tools::getValue('id_product'); $id_product = (int)Tools::getValue('id_product');
$id_product_attribute = (int)Tools::getValue('id_product_attribute'); $id_product_attribute = (int)Tools::getValue('id_product_attribute');
@@ -967,7 +967,7 @@ class AdminStockManagementControllerCore extends AdminController
if ($product_is_valid === true && $is_pack == false && $is_virtual == false) if ($product_is_valid === true && $is_pack == false && $is_virtual == false)
{ {
// init form // init form
$this->initForm(); $this->renderForm();
$this->getlanguages(); $this->getlanguages();
$helper = new HelperForm(); $helper = new HelperForm();
@@ -112,10 +112,10 @@ class AdminStockMvtControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
// removes toolbar btn // removes toolbar btn
$this->toolbar_btn = array(); $this->toolbar_btn = array();
@@ -162,7 +162,7 @@ class AdminStockMvtControllerCore extends AdminController
array_unshift($warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses'))); array_unshift($warehouses, array('id_warehouse' => -1, 'name' => $this->l('All Warehouses')));
$this->tpl_list_vars['list_warehouses'] = $warehouses; $this->tpl_list_vars['list_warehouses'] = $warehouses;
return parent::initList(); return parent::renderList();
} }
/** /**
+4 -4
View File
@@ -112,7 +112,7 @@ class AdminStoresControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -127,10 +127,10 @@ class AdminStoresControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'state` st LEFT JOIN `'._DB_PREFIX_.'state` st
ON (st.`id_state` = a.`id_state`)'; ON (st.`id_state` = a.`id_state`)';
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -292,7 +292,7 @@ class AdminStoresControllerCore extends AdminController
'hours' => isset($hours_unserialized) ? $hours_unserialized : false 'hours' => isset($hours_unserialized) ? $hours_unserialized : false
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -64,10 +64,10 @@ class AdminSubDomainsControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->warnings[] = $this->l('Cookies are different on each subdomain of your Website. If you want to use the same cookie, please add here the subdomains used by your shop. The most common is "www".'); $this->warnings[] = $this->l('Cookies are different on each subdomain of your Website. If you want to use the same cookie, please add here the subdomains used by your shop. The most common is "www".');
return parent::initList(); return parent::renderList();
} }
@@ -61,7 +61,7 @@ class AdminSuppliersControllerCore extends AdminController
$this->addJqueryPlugin('tagify'); $this->addJqueryPlugin('tagify');
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -158,10 +158,10 @@ class AdminSuppliersControllerCore extends AdminController
'size' => $image ? filesize(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg') / 1000 : false 'size' => $image ? filesize(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg') / 1000 : false
); );
return parent::initForm(); return parent::renderForm();
} }
public function initView() public function renderView()
{ {
$products = $this->object->getProductsLite($this->context->language->id); $products = $this->object->getProductsLite($this->context->language->id);
$total_product = count($products); $total_product = count($products);
@@ -203,7 +203,7 @@ class AdminSuppliersControllerCore extends AdminController
'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'), 'stock_management' => Configuration::get('PS_STOCK_MANAGEMENT'),
); );
return parent::initView(); return parent::renderView();
} }
public function afterImageUpload() public function afterImageUpload()
@@ -153,10 +153,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
if (Tools::isSubmit('addsupply_order') || if (Tools::isSubmit('addsupply_order') ||
Tools::isSubmit('updatesupply_order') || Tools::isSubmit('updatesupply_order') ||
@@ -295,7 +295,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
//specific discount display //specific discount display
$this->object->discount_rate = Tools::ps_round($this->object->discount_rate, 4); $this->object->discount_rate = Tools::ps_round($this->object->discount_rate, 4);
return parent::initForm(); return parent::renderForm();
} }
} }
@@ -327,10 +327,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->displayInformation($this->l('This interface allows you to manage supply orders.').'<br />'); $this->displayInformation($this->l('This interface allows you to manage supply orders.').'<br />');
$this->displayInformation($this->l('Also, you can create templates that you can later use to generate actual orders.').'<br />'); $this->displayInformation($this->l('Also, you can create templates that you can later use to generate actual orders.').'<br />');
@@ -368,11 +368,12 @@ class AdminSupplyOrdersControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'warehouse` w ON (w.id_warehouse = a.id_warehouse)'; LEFT JOIN `'._DB_PREFIX_.'warehouse` w ON (w.id_warehouse = a.id_warehouse)';
$this->_where = ' AND a.is_template = 0'; $this->_where = ' AND a.is_template = 0';
if ($this->getCurrentWarehouse() != -1) if ($this->getCurrentWarehouse() != -1)
$this->_where .= ' AND a.id_warehouse = '.$this->getCurrentWarehouse(); $this->_where .= ' AND a.id_warehouse = '.$this->getCurrentWarehouse();
if ($this->getFilterStatus() != 0) if ($this->getFilterStatus() != 0)
$this->_where .= ' AND st.enclosed != 1'; $this->_where .= ' AND st.enclosed != 1';
$first_list = parent::initList(); $first_list = parent::renderList();
// second list : templates // second list : templates
$second_list = null; $second_list = null;
@@ -403,7 +404,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
'desc' => $this->l('Add new template') 'desc' => $this->l('Add new template')
); );
// inits list // inits list
$second_list = parent::initList(); $second_list = parent::renderList();
return $first_list.$second_list; return $first_list.$second_list;
} }
@@ -1396,9 +1397,9 @@ class AdminSupplyOrdersControllerCore extends AdminController
} }
/** /**
* @see AdminController::initView() * @see AdminController::renderView()
*/ */
public function initView() public function renderView()
{ {
$this->show_toolbar = true; $this->show_toolbar = true;
$this->toolbar_fix = false; $this->toolbar_fix = false;
@@ -1609,7 +1610,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
); );
} }
return parent::initView(); return parent::renderView();
} }
/** /**
+8 -8
View File
@@ -72,10 +72,10 @@ class AdminTabsControllerCore extends AdminController
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
$tabs = Tab::getTabs($this->context->language->id, 0); $tabs = Tab::getTabs($this->context->language->id, 0);
@@ -144,14 +144,14 @@ class AdminTabsControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -160,7 +160,7 @@ class AdminTabsControllerCore extends AdminController
$this->_where = 'AND a.`id_parent` = 0'; $this->_where = 'AND a.`id_parent` = 0';
$this->_orderBy = 'position'; $this->_orderBy = 'position';
return parent::initList(); return parent::renderList();
} }
/** /**
+4 -4
View File
@@ -58,7 +58,7 @@ class AdminTagsControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
@@ -76,7 +76,7 @@ class AdminTagsControllerCore extends AdminController
ON (l.`id_lang` = a.`id_lang`)'; ON (l.`id_lang` = a.`id_lang`)';
$this->_group = 'GROUP BY a.name, a.id_lang'; $this->_group = 'GROUP BY a.name, a.id_lang';
return parent::initList(); return parent::renderList();
} }
public function postProcess() public function postProcess()
@@ -87,7 +87,7 @@ class AdminTagsControllerCore extends AdminController
return parent::postProcess(); return parent::postProcess();
} }
public function initForm() public function renderForm()
{ {
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
return; return;
@@ -125,7 +125,7 @@ class AdminTagsControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
} }
@@ -62,14 +62,14 @@ class AdminTaxRulesGroupControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
return parent::initList(); return parent::renderList();
} }
public function initRulesList($id_group) public function initRulesList($id_group)
@@ -130,10 +130,10 @@ class AdminTaxRulesGroupControllerCore extends AdminController
$this->show_toolbar = false; $this->show_toolbar = false;
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -182,7 +182,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController
if (!isset($obj->id)) if (!isset($obj->id))
{ {
$this->no_back = false; $this->no_back = false;
$content = parent::initForm(); $content = parent::renderForm();
} }
else else
{ {
@@ -191,7 +191,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController
'href' => '#', 'href' => '#',
'desc' => $this->l('Add new tax rule') 'desc' => $this->l('Add new tax rule')
); );
$content = parent::initForm(); $content = parent::renderForm();
$this->tpl_folder = 'tax_rules/'; $this->tpl_folder = 'tax_rules/';
$content .= $this->initRuleForm(); $content .= $this->initRuleForm();
+2 -2
View File
@@ -115,7 +115,7 @@ class AdminTaxesControllerCore extends AdminController
return $tpl_enable->fetch(); return $tpl_enable->fetch();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -180,7 +180,7 @@ class AdminTaxesControllerCore extends AdminController
) )
); );
return parent::initForm(); return parent::renderForm();
} }
public function postProcess() public function postProcess()
@@ -92,7 +92,7 @@ class AdminTrackingController extends AdminController
$this->tpl_list_vars = array('sub_title' => $this->l('List of empty categories:')); $this->tpl_list_vars = array('sub_title' => $this->l('List of empty categories:'));
return parent::initList(); return parent::renderList();
} }
public function getCustomListProductsAttributesNoStock() public function getCustomListProductsAttributesNoStock()
@@ -130,7 +130,7 @@ class AdminTrackingController extends AdminController
$this->tpl_list_vars = array('sub_title' => $this->l('List of products with attributes and without available quantities for sale:')); $this->tpl_list_vars = array('sub_title' => $this->l('List of products with attributes and without available quantities for sale:'));
return parent::initList(); return parent::renderList();
} }
public function getCustomListProductsNoStock() public function getCustomListProductsNoStock()
@@ -168,7 +168,7 @@ class AdminTrackingController extends AdminController
$this->tpl_list_vars = array('sub_title' => $this->l('List of products without attributes and without available quantities for sale:')); $this->tpl_list_vars = array('sub_title' => $this->l('List of products without attributes and without available quantities for sale:'));
return parent::initList(); return parent::renderList();
} }
public function getCustomListProductsDisabled() public function getCustomListProductsDisabled()
@@ -195,7 +195,7 @@ class AdminTrackingController extends AdminController
'name' => array('title' => $this->l('Name')) 'name' => array('title' => $this->l('Name'))
); );
return parent::initList(); return parent::renderList();
} }
public function clearListOptions() public function clearListOptions()
@@ -117,7 +117,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->toolbar_fix = false; $this->toolbar_fix = false;
$this->base_tpl_view = 'main.tpl'; $this->base_tpl_view = 'main.tpl';
return parent::initView(); return parent::renderView();
} }
/** /**
@@ -895,7 +895,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_form.tpl'; $this->base_tpl_view = 'translation_form.tpl';
return parent::initView(); return parent::renderView();
} }
public function initFormBack($lang) public function initFormBack($lang)
@@ -1049,7 +1049,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_form.tpl'; $this->base_tpl_view = 'translation_form.tpl';
return parent::initView(); return parent::renderView();
} }
public function initFormErrors($lang) public function initFormErrors($lang)
@@ -1105,7 +1105,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_errors.tpl'; $this->base_tpl_view = 'translation_errors.tpl';
return parent::initView(); return parent::renderView();
} }
public function initFormFields($lang) public function initFormFields($lang)
@@ -1170,7 +1170,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_form.tpl'; $this->base_tpl_view = 'translation_form.tpl';
return parent::initView(); return parent::renderView();
} }
/** /**
@@ -1520,7 +1520,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_mails.tpl'; $this->base_tpl_view = 'translation_mails.tpl';
return parent::initView(); return parent::renderView();
} }
protected static function getSubjectMail($directory, $subject_mail) protected static function getSubjectMail($directory, $subject_mail)
@@ -1706,7 +1706,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_modules.tpl'; $this->base_tpl_view = 'translation_modules.tpl';
return parent::initView(); return parent::renderView();
} }
} }
@@ -1806,7 +1806,7 @@ class AdminTranslationsControllerCore extends AdminController
$this->initToolbar(); $this->initToolbar();
$this->base_tpl_view = 'translation_form.tpl'; $this->base_tpl_view = 'translation_form.tpl';
return parent::initView(); return parent::renderView();
} }
/** /**
+12 -12
View File
@@ -76,10 +76,10 @@ class AdminWarehousesControllerCore extends AdminController
} }
/** /**
* AdminController::initList() override * AdminController::renderList() override
* @see AdminController::initList() * @see AdminController::renderList()
*/ */
public function initList() public function renderList()
{ {
// Checks access // Checks access
if (!($this->tabAccess['add'] === '1')) if (!($this->tabAccess['add'] === '1'))
@@ -117,14 +117,14 @@ class AdminWarehousesControllerCore extends AdminController
$this->displayInformation($this->l('Finally, you can see detailed informations on your stock per warehouse, such as its valuation, $this->displayInformation($this->l('Finally, you can see detailed informations on your stock per warehouse, such as its valuation,
the number of products and quantities stored.')); the number of products and quantities stored.'));
return parent::initList(); return parent::renderList();
} }
/** /**
* AdminController::initForm() override * AdminController::renderForm() override
* @see AdminController::initForm() * @see AdminController::renderForm()
*/ */
public function initForm() public function renderForm()
{ {
// loads current warehouse // loads current warehouse
if (!($obj = $this->loadObject(true))) if (!($obj = $this->loadObject(true)))
@@ -361,7 +361,7 @@ class AdminWarehousesControllerCore extends AdminController
$this->fields_value['ids_shops[]'] = $ids_shop; $this->fields_value['ids_shops[]'] = $ids_shop;
$this->fields_value['ids_carriers[]'] = $carriers; $this->fields_value['ids_carriers[]'] = $carriers;
return parent::initForm(); return parent::renderForm();
} }
/** /**
@@ -444,9 +444,9 @@ class AdminWarehousesControllerCore extends AdminController
} }
/** /**
* @see AdminController::initView() * @see AdminController::renderView()
*/ */
public function initView() public function renderView()
{ {
$this->displayInformation($this->l('This interface allows you to display detailed informations on your warehouse.').'<br />'); $this->displayInformation($this->l('This interface allows you to display detailed informations on your warehouse.').'<br />');
@@ -460,7 +460,7 @@ class AdminWarehousesControllerCore extends AdminController
if (!Validate::isLoadedObject($warehouse) || if (!Validate::isLoadedObject($warehouse) ||
!Validate::isLoadedObject($employee) || !Validate::isLoadedObject($employee) ||
!Validate::isLoadedObject($currency)) !Validate::isLoadedObject($currency))
return parent::initView(); return parent::renderView();
$this->tpl_view_vars = array( $this->tpl_view_vars = array(
'warehouse' => $warehouse, 'warehouse' => $warehouse,
@@ -473,6 +473,6 @@ class AdminWarehousesControllerCore extends AdminController
'warehouse_quantities' => $warehouse->getQuantitiesofProducts(), 'warehouse_quantities' => $warehouse->getQuantitiesofProducts(),
); );
return parent::initView(); return parent::renderView();
} }
} }
@@ -79,7 +79,7 @@ class AdminWebserviceControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -158,7 +158,7 @@ class AdminWebserviceControllerCore extends AdminController
'permissions' => $permissions 'permissions' => $permissions
); );
return parent::initForm(); return parent::renderForm();
} }
public function initContent() public function initContent()
@@ -220,7 +220,7 @@ class AdminWebserviceControllerCore extends AdminController
!$instance->useNormalPermissionBehaviour()) !$instance->useNormalPermissionBehaviour())
unset($this->_list[$k]); unset($this->_list[$k]);
$this->initList(); $this->renderList();
} }
} }
+4 -4
View File
@@ -58,17 +58,17 @@ class AdminZonesControllerCore extends AdminController
parent::__construct(); parent::__construct();
} }
public function initList() public function renderList()
{ {
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
return parent::initList(); return parent::renderList();
} }
public function initForm() public function renderForm()
{ {
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
@@ -123,7 +123,7 @@ class AdminZonesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
); );
return parent::initForm(); return parent::renderForm();
} }
} }