Jump to content

[SOLVED] New tab in back office by module


muirch

Recommended Posts

Copy one of the files in the admin/tabs directory and create your tab based on that. Once you've done that, go to Tools > Tabs, create a new tab, enter the tab text under "Name", enter the class name under "Class" (for example, AdminYourTab), then choose "Customer" as the parent category.

Link to comment
Share on other sites

  • 2 weeks later...

I spend some time and now I will show complete solution - what we need to do to use back office tab, created by our module.
1. In instalation process we must eval this:

$tab = new Tab();
foreach (Language::getLanguages() as $language) {
     $tab->name[$language['id_lang']] = 'Tab Name';
}
$tab->class_name = 'AdminModuleName'; // you need to write tab code in AdminModuleName.php in module folder
$tab->module = 'modulename'; // module name and folder
$tab->id_parent = 2; / / parent tab ID
$r = $tab->save(); // saving your tab
Configuration::updateValue('MODULENAME_TAB_ID', $tab->id); // saving tab ID to remove it when uninstall 


2. When uninstall module :

$tab = new Tab(Configuration::get('MYMESSAGE_TAB_ID'));
$tab->delete();



Hope this information be usefull.

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...