Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-16304

add a GUI to manage horizontal Moodle front page custom menu



    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Affected Branches:


      To support the feature request MDL-16244 I add what I had in mind (without courage to post before MDL-16244).

      Last objective: give to admins the possibility to manage horizontal custom menu of the Moodle front page shown in each theme only if requested by the admin.

      Final result: the final result is to have menus in the Moodle front page like the one that you can see in: http://vle.newbury-college.ac.uk/ or in http://www.25sorrisi.it/moodle/index.php

      Starting idea: all start by the consideration that the work done by Newbury College development team seems to be really a good work. Menus are nice, well working, cross platform, cross browser, compliant with xhtml strict and easily customizable.

      Ingredients: in order to add these menus to a theme MAY BE needed:
      1) file menubar.php (that is available, for instance, inside the theme "Alternatives (Newbury College Theme Set) v3.10 - Default" in http://moodle.org/mod/data/view.php?d=26&rid=1531)

      2) the menubar.css (that is available, for instance, inside the theme "Alternatives (Newbury College Theme Set) v3.10 - Default" in http://moodle.org/mod/data/view.php?d=26&rid=1531)

      3) <?php include('menubar.php') ?>
      in the header OF EACH THEME. It should be better, in order to check how new is the theme and how updated is Moodle:
      if (exist('admin/menugui') && exist('menubar.php')) { //<- moodle was updated && theme was updated (this second check is useless... because if header.php was updated... the file menubar.php was added too!!)
      if (($showfrontpagemenus))

      { //<- $showfrontpagemenus is the variable of the moodle preferences, like allowuserthemes or allowcoursethemes and so forth. include('menubar.php') }


      4) menubar.css added into the array $THEME->sheets of the theme config. (only to have all in the right place and well ordered)

      5) Missing (and requested) tool: a GUI (the one checked with if (exist('admin/menugui') in the previous example) to manage/customize menus to give to admins the opportunity to store inside ONLY ONE db table ("menu_items") all the information regarding: "parent" (the parent menubar of the current menuitem), "position" (the position of the item inside the menu) and menuitemlink (the link of the web page pointed by the menu).

      a rough schema of the "menu_items" table may be

      The manu_bar label and the menu_item label don't need to be stored inside the table "menu_items", because the name of the k-th item of n-th menu will always equal to munuitemname<<n>><<k>> (name of the item k of the menu n) and its translation in each requested language will be saved inside lang files through the current usual standard interface.

      Once all the information ae stored inside the table, the file manubar.php that today looks like the one that you can get from the "Alternatives (Newbury College Theme Set) v3.10 - Default" in http://moodle.org/mod/data/view.php?d=26&rid=1531 should be changed to the one attached in the file menubar_example.php

      That's all. Any feedback is welcome. Ciao.


          Issue Links



              • Assignee:
                daniss Daniele Cordella
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                2 Vote for this issue
                1 Start watching this issue


                • Created: