Jump to content

Add admin tabs to Backpanel


Recommended Posts

Hello,

I am trying to install multiple tabs to the Backoffice of Prestashop. The main tab with the id_parent = 0 appears in the database. The other tabs aren't even installed.

Here is my code:

In install() method of the module:

// Install admin tab
if (!$this->installTab('AdminKonfiguratorTab', 'Konfigurator', null, true) && 
	!$this->installTab('AdminKonfiguratorTabOverview', 'Konfigurator Overview', 'AdminKonfiguratorTab') && 
	!$this->installTab('AdminKonfiguratorTabOrders', 'Konfigurator Orders', 'AdminKonfiguratorTab'))
return false;

 

the installTab() function:

public function installTab($class_name, $name, $parent, $parent_tab_isZero = false)
{
  // Create new admin tab
  $tab = new Tab();
  if($parent_tab_isZero) {
  	$tab->id_parent = 0;
  } else {
  	$tab->id_parent = (int)Tab::getIdFromClassName($parent);
  }
  $tab->name = array();
  foreach (Language::getLanguages(true) as $lang)
  $tab->name[$lang['id_lang']] = $name;
  $tab->class_name = $class_name;
  $tab->module = $this->name;
  $tab->active = 1;
  return $tab->add();
}

 

Link to comment
Share on other sites

  • 2 months later...

Hi

Should I change the AdminModules controller? Can I use this function?

function __construct(){

...

$this->tab = 'my_fancy_tab';

...

}

Cause it seems to me all modules are in Other tabs all the time appearing. There's also an Autoupgrade module  writemyessayfast source.

 

Thanks.

 

Lumusislight Projects

Edited by lumusislight
added function (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...