muirch Posted August 26, 2010 Posted August 26, 2010 I am creating a module, which need some user-content administration.Is it possible to make a new tab with administration functional in back office under "Clients"?How I can make a module, which do that? Share this post Link to post Share on other sites More sharing options...
Yann - Prestaplugins Posted August 26, 2010 Posted August 26, 2010 $tab = new Tab(); foreach (Language::getLanguages() as $language) { $tab->name[$language['id_lang']] = 'Your label here'; } $tab->class_name = 'your tab classname here'; $tab->module = 'your module name here'; $tab->id_parent = 2; $tab->save(); Share this post Link to post Share on other sites More sharing options...
muirch Posted August 26, 2010 Posted August 26, 2010 Where I must put this code? Share this post Link to post Share on other sites More sharing options...
rocky Posted August 26, 2010 Posted August 26, 2010 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. Share this post Link to post Share on other sites More sharing options...
muirch Posted August 26, 2010 Posted August 26, 2010 Thanks to Patanock and rocky.Also, we can leave tab file in module folder, its not neccesary to put it to admin/tabs Share this post Link to post Share on other sites More sharing options...
muirch Posted September 4, 2010 Posted September 4, 2010 Now I have another one question: how to remove module tab during module uninstall process? Share this post Link to post Share on other sites More sharing options...
muirch Posted September 4, 2010 Posted September 4, 2010 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. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now