How i can customize left menu in Module builder?

i just create new module and i want to add fields in the left menu,
so after searching i found this file modtest.class.php (test is name of module).
when i put this code Nothing changes.

			$this->menu[$r++]=array(
			'fk_menu'=>'fk_mainmenu=test',      // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
			'type'=>'left',                          // This is a Top menu entry
			'titre'=>'MyObject',
			'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
			'mainmenu'=>'test',
			'leftmenu'=>'myobject',
			'url'=>'/test/testindex.php',
			'langs'=>'test@test',	        // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
			'position'=>1000+$r,
			'enabled'=>'$conf->test->enabled',  // Define condition to show or hide menu entry. Use '$conf->test->enabled' if entry must be visible if module is enabled.
			'perms'=>'$user->rights->test->myobject->read',			                // Use 'perms'=>'$user->rights->test->level1->level2' if you want your menu with a permission rules
			'target'=>'',
			'user'=>2,				                // 0=Menu for internal users, 1=external users, 2=both
		);

Untitled

The solution is that you need to disable and enable your module, then result will updated

1 Like