Forums | Mahara Community

Developers /
altering menu items


anonymous profile picture
Deleted user
Posts: 19

13 September 2011, 7:12 AM

I would like to move the Files item from Profile under to Views.
So i changed the /local/lib.php file adding the following:

functon local_main_naw_update(&$menu) {

  /**  
   * Adding new files menu item
   */
  $menu['myportfolio/files'] = Array (
       'path' => "myportfolio/files",
       'url' => "artefact/file/",
       'title' => get_string('Files', 'artefact.file'),
       'weight' => "30",
  );

  /** 
   * Remove original files menu item 
   */ 
  unset($menu['content/files']);

}

My problem is, when I use the Views>Files menu item the page is shows correctly, but the menu change to the original Profile item without active submenu item.

Is there any way to control that behaviour?

anonymous profile picture
Deleted user
Posts: 808

13 September 2011, 5:04 PM

You'd also have to change the define('MENUITEM',... line in htdocs/artefact/file/index.php

anonymous profile picture
Deleted user
Posts: 19

14 September 2011, 6:47 AM

I changed it to:

define('MENUITEM', 'myportfolio/files');  

...and it works fine

Thank you Richard!

3 results