Jump to content

Edit History

soundhar

soundhar

Hi everyone,

I am trying to create a custom module admin menu. 
I need one parent and multiple child menus.

  • Inspiraiton
    • Wall Background
    • Frames
    • Frames Images
    • Menu4
    • etc.,

 

I have used tabs registration. that works for 1 parent and 1 child.

Module name : inspiration

The following code generate

  • Inspiraiton
    • Wall Background

But I am expecting the 

  • Inspiraiton
    • Wall Background
    • Frames

Please tell me how to fix this.

 

Thanks to all :)

$lang = Language::getLanguages();
$tab = new Tab();
$tab->class_name = 'AdminExample';
$tab->module = 'inspiration';
$tab->id_parent = 2;
$tab->position = 6;
$tab->icon = 'photo_size_select_actual';
$tab->parent_class_name = 'AdminExample';
foreach ($lang as $l) {
$tab->name[$l['id_lang']] = $this->l('Inspiration');
}
$tab->add();

$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminExample';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = "Wall Background";
}
$tab->id_parent = (int)Tab::getIdFromClassName('AdminExample');
$tab->module = $this->name;
$tab->add();

$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminFrames';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = "Frames";
}
$tab->id_parent = (int)Tab::getIdFromClassName('AdminFrames');
$tab->module = $this->name;
$tab->add();

 

soundhar

soundhar

Hi everyone,

I am trying to create a custom module admin menu. 
I need one parent and multiple child menus.

  • Inspiraiton
    • Wall Background
    • Frames
    • Frames Images
    • Menu4
    • etc.,

 

I have used tabs registration. that works for 1 parent and 1 child.

Module name : inspiration

$lang = Language::getLanguages();
$tab = new Tab();
$tab->class_name = 'AdminExample';
$tab->module = 'inspiration';
$tab->id_parent = 2;
$tab->position = 6;
$tab->icon = 'photo_size_select_actual';
$tab->parent_class_name = 'AdminExample';
foreach ($lang as $l) {
$tab->name[$l['id_lang']] = $this->l('Inspiration');
}
$tab->add();

$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminExample';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = "Wall Background";
}
$tab->id_parent = (int)Tab::getIdFromClassName('AdminExample');
$tab->module = $this->name;
$tab->add();

$tab = new Tab();
$tab->active = 1;
$tab->class_name = 'AdminFrames';
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = "Frames";
}
$tab->id_parent = (int)Tab::getIdFromClassName('AdminFrames');
$tab->module = $this->name;
$tab->add();

 

×
×
  • Create New...