Revert: The display empty conditions added in the non required controllers, also updated the condition for better understanding

This commit is contained in:
vishalsingh.qlo325
2024-10-03 11:23:37 +05:30
parent a94f6eb30f
commit 29056a2521
41 changed files with 42 additions and 42 deletions

View File

@@ -99,7 +99,7 @@ class AdminAddressesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_address'] = array(
'href' => self::$currentIndex.'&addaddress&token='.$this->token,
'desc' => $this->l('Add new address', null, null, false),

View File

@@ -96,7 +96,7 @@ class AdminAttachmentsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_attachment'] = array(
'href' => self::$currentIndex.'&addattachment&token='.$this->token,
'desc' => $this->l('Add new attachment', null, null, false),

View File

@@ -506,7 +506,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_attribute_group'] = array(
'href' => self::$currentIndex.'&addattribute_group&token='.$this->token,
'desc' => $this->l('Add new attribute', null, null, false),

View File

@@ -260,7 +260,7 @@ class AdminCartRulesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_cart_rule'] = array(
'href' => self::$currentIndex.'&addcart_rule&token='.$this->token,
'desc' => $this->l('Add new cart rule', null, null, false),

View File

@@ -168,7 +168,7 @@ class AdminCartsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['export_cart'] = array(
'href' => self::$currentIndex.'&exportcart&token='.$this->token,
'desc' => $this->l('Export carts', null, null, false),

View File

@@ -278,7 +278,7 @@ class AdminCategoriesControllerCore extends AdminController
public function initToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
'desc' => $this->l('Add New')
@@ -317,7 +317,7 @@ class AdminCategoriesControllerCore extends AdminController
unset($this->toolbar_btn['new']);
}
// after adding a category
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$id_category = (Tools::isSubmit('id_category')) ? '&id_parent='.(int)Tools::getValue('id_category') : '';
$this->toolbar_btn['new'] = array(
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token.$id_category,

View File

@@ -139,7 +139,7 @@ class AdminContactsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
$this->initToolbar();
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_contact'] = array(
'href' => self::$currentIndex.'&addcontact&token='.$this->token,
'desc' => $this->l('Add new contact', null, null, false),

View File

@@ -120,7 +120,7 @@ class AdminCountriesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_country'] = array(
'href' => self::$currentIndex.'&addcountry&token='.$this->token,
'desc' => $this->l('Add new country', null, null, false),

View File

@@ -361,7 +361,7 @@ class AdminCurrenciesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_currency'] = array(
'href' => self::$currentIndex.'&addcurrency&token='.$this->token,
'desc' => $this->l('Add new currency', null, null, false),

View File

@@ -177,7 +177,7 @@ class AdminEmployeesControllerCore extends AdminController
{
parent::initPageHeaderToolbar();
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_employee'] = array(
'href' => self::$currentIndex.'&addemployee&token='.$this->token,
'desc' => $this->l('Add new employee', null, null, false),

View File

@@ -231,7 +231,7 @@ class AdminFeaturesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_feature'] = array(
'href' => self::$currentIndex.'&addfeature&token='.$this->token,
'desc' => $this->l('Add new room feature', null, null, false),

View File

@@ -97,7 +97,7 @@ class AdminGendersControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_gender'] = array(
'href' => self::$currentIndex.'&addgender&token='.$this->token,
'desc' => $this->l('Add new title', null, null, false),

View File

@@ -823,7 +823,7 @@ class AdminImagesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_image_type'] = array(
'href' => self::$currentIndex.'&addimage_type&token='.$this->token,
'desc' => $this->l('Add new image type', null, null, false),

View File

@@ -107,7 +107,7 @@ class AdminLanguagesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_language'] = array(
'href' => self::$currentIndex.'&addlang&token='.$this->token,
'desc' => $this->l('Add new language', null, null, false),

View File

@@ -109,7 +109,7 @@ class AdminManufacturersControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_manufacturer'] = array(
'href' => self::$currentIndex.'&addmanufacturer&token='.$this->token,
'desc' => $this->l('Add new manufacturer', null, null, false),

View File

@@ -229,7 +229,7 @@ class AdminMetaControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_meta'] = array(
'href' => self::$currentIndex.'&addmeta&token='.$this->token,
'desc' => $this->l('Add a new page', null, null, false),

View File

@@ -2610,7 +2610,7 @@ class AdminNormalProductsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_product'] = array(
'href' => self::$currentIndex.'&addproduct&token='.$this->token,
// 'desc' => $this->l('Add new room type', null, null, false),

View File

@@ -108,7 +108,7 @@ class AdminOrderMessageControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_order_message'] = array(
'href' => self::$currentIndex.'&addorder_message&token='.$this->token,
'desc' => $this->l('Add new order message'),

View File

@@ -360,7 +360,7 @@ class AdminOrdersControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_order'] = array(
'href' => self::$currentIndex.'&addorder&token='.$this->token,
'desc' => $this->l('Add new order', null, null, false),

View File

@@ -2649,7 +2649,7 @@ class AdminProductsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_product'] = array(
'href' => self::$currentIndex.'&addproduct&token='.$this->token,
// 'desc' => $this->l('Add new room type', null, null, false),

View File

@@ -114,7 +114,7 @@ class AdminProfilesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_profile'] = array(
'href' => self::$currentIndex.'&addprofile&token='.$this->token,
'desc' => $this->l('Add new profile', null, null, false),

View File

@@ -135,7 +135,7 @@ class AdminQuickAccessesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_quick_access'] = array(
'href' => self::$currentIndex.'&addquick_access&token='.$this->token,
'desc' => $this->l('Add new quick access', null, null, false),

View File

@@ -168,7 +168,7 @@ class AdminReferrersControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_referrer'] = array(
'href' => self::$currentIndex.'&addreferrer&token='.$this->token,
'desc' => $this->l('Add new referrer', null, null, false),

View File

@@ -310,7 +310,7 @@ class AdminRequestSqlControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_request'] = array(
'href' => self::$currentIndex.'&addrequest_sql&token='.$this->token,
'desc' => $this->l('Add new SQL query', null, null, false),

View File

@@ -120,7 +120,7 @@ class AdminScenesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_scene'] = array(
'href' => self::$currentIndex.'&addscene&token='.$this->token,
'desc' => $this->l('Add new image map', null, null, false),

View File

@@ -242,7 +242,7 @@ class AdminSearchConfControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_alias'] = array(
'href' => self::$currentIndex.'&addalias&token='.$this->token,
'desc' => $this->l('Add new alias', null, null, false),

View File

@@ -92,7 +92,7 @@ class AdminSearchEnginesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_search_engine'] = array(
'href' => self::$currentIndex.'&addsearch_engine&token='.$this->token,
'desc' => $this->l('Add new search engine', null, null, false),

View File

@@ -130,7 +130,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_specific_price_rule'] = array(
'href' => self::$currentIndex.'&addspecific_price_rule&token='.$this->token,
'desc' => $this->l('Add new catalog price rule', null, null, false),

View File

@@ -114,7 +114,7 @@ class AdminStatesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_state'] = array(
'href' => self::$currentIndex.'&addstate&token='.$this->token,
'desc' => $this->l('Add new state', null, null, false),

View File

@@ -242,7 +242,7 @@ class AdminStatusesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_order_state'] = array(
'href' => self::$currentIndex.'&addorder_state&token='.$this->token,
'desc' => $this->l('Add new order status', null, null, false),

View File

@@ -139,7 +139,7 @@ class AdminStoresControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_store'] = array(
'href' => self::$currentIndex.'&addstore&token='.$this->token,
'desc' => $this->l('Add new store', null, null, false),

View File

@@ -78,7 +78,7 @@ class AdminSuppliersControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_supplier'] = array(
'href' => self::$currentIndex.'&addsupplier&token='.$this->token,
'desc' => $this->l('Add new supplier', null, null, false),

View File

@@ -161,7 +161,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
'desc' => $this->l('Back to list', null, null, false),
'icon' => 'process-icon-back'
);
} elseif ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
} elseif (empty($this->display)) {
$this->page_header_toolbar_btn['new_supply_order'] = array(
'href' => self::$currentIndex.'&addsupply_order&token='.$this->token,
'desc' => $this->l('Add new supply order', null, null, false),

View File

@@ -96,7 +96,7 @@ class AdminTabsControllerCore extends AdminController
'desc' => $this->l('Back to list', null, null, false),
'icon' => 'process-icon-back'
);
} elseif ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
} elseif (empty($this->display)) {
$this->page_header_toolbar_btn['new_menu'] = array(
'href' => self::$currentIndex.'&addtab&token='.$this->token,
'desc' => $this->l('Add new menu', null, null, false),

View File

@@ -71,7 +71,7 @@ class AdminTagsControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_tag'] = array(
'href' => self::$currentIndex.'&addtag&token='.$this->token,
'desc' => $this->l('Add new tag', null, null, false),

View File

@@ -77,7 +77,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_tax_rules_group'] = array(
'href' => self::$currentIndex.'&addtax_rules_group&token='.$this->token,
'desc' => $this->l('Add new tax rules group', null, null, false),

View File

@@ -117,7 +117,7 @@ class AdminTaxesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_tax'] = array(
'href' => self::$currentIndex.'&addtax&token='.$this->token,
'desc' => $this->l('Add new tax', null, null, false),

View File

@@ -734,7 +734,7 @@ class AdminThemesControllerCore extends AdminController
{
parent::initPageHeaderToolbar();
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['import_theme'] = array(
'href' => self::$currentIndex.'&action=importtheme&token='.$this->token,
'desc' => $this->l('Add new theme', null, null, false),

View File

@@ -85,7 +85,7 @@ class AdminWarehousesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_warehouse'] = array(
'href' => self::$currentIndex.'&addwarehouse&token='.$this->token,
'desc' => $this->l('Add new warehouse', null, null, false),

View File

@@ -102,7 +102,7 @@ class AdminWebserviceControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_webservice'] = array(
'href' => self::$currentIndex.'&addwebservice_account&token='.$this->token,
'desc' => $this->l('Add new webservice key', null, null, false),

View File

@@ -69,7 +69,7 @@ class AdminZonesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
if ($this->display != 'edit' && $this->display != 'add' && $this->display !='view') {
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_zone'] = array(
'href' => self::$currentIndex.'&addzone&token='.$this->token,
'desc' => $this->l('Add new zone', null, null, false),