Moodle

Support for a drop-down menu bar

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Themes
  • Labels:
    None
  • Environment:
    Patches for Moodle 1.9.0
    Demonstration at http://www.thss.ca/

Description

Drop-down menus are a useful way to present a number of links to students and teachers in an easily accessible fashion.

This patch adds a database table (mdl_menu);
a lib.php file to /themes/;
an editor for the menu items (/themes/menu.php);
the necessary JavaScript for menus (menu.js);
an example of implementation in a theme header (header.html)

  1. droplist.patch
    19/Jul/10 9:19 AM
    13 kB
    Dan Marsden
  2. header.html
    28/Aug/08 2:30 PM
    2 kB
    Darryl Pogue
  3. lib.php
    28/Aug/08 2:25 PM
    3 kB
    Darryl Pogue
  4. menu_xmldb.xml
    28/Aug/08 2:25 PM
    0.8 kB
    Darryl Pogue
  5. menu.css
    28/Aug/08 2:32 PM
    1 kB
    Darryl Pogue
  6. menu.js
    28/Aug/08 2:25 PM
    2 kB
    Darryl Pogue
  7. menu.php
    28/Aug/08 2:25 PM
    9 kB
    Darryl Pogue

Issue Links

Activity

Hide
Darryl Pogue added a comment -

JavaScript file needed for menus to work properly.

Show
Darryl Pogue added a comment - JavaScript file needed for menus to work properly.
Hide
Wen Hao Chuang added a comment -

Have anyone tried or evaluated this? How accessible it is? Thanks!

Show
Wen Hao Chuang added a comment - Have anyone tried or evaluated this? How accessible it is? Thanks!
Hide
Bhavin Doshi added a comment -

can anyone make it clear where to put the menu.js file? also, it seems that in config.php, an attribute called 'javascript' is supposed to be defined for the menu.js to be included as script in <head> section. what value is to be provided there?

Show
Bhavin Doshi added a comment - can anyone make it clear where to put the menu.js file? also, it seems that in config.php, an attribute called 'javascript' is supposed to be defined for the menu.js to be included as script in <head> section. what value is to be provided there?
Hide
Bhavin Doshi added a comment -

and also, i tried it with the inline javascript in header.html, but didnt work. i think the only thing i m missing from the setup is the location and trick for inclusion of menu.js file. please help me over this.

Show
Bhavin Doshi added a comment - and also, i tried it with the inline javascript in header.html, but didnt work. i think the only thing i m missing from the setup is the location and trick for inclusion of menu.js file. please help me over this.
Hide
Dan Marsden added a comment -

I've just had a play around with this patch - nice idea.

I've rewritten the menu.php page and changed the way that the menu is built - it now saves a file called "droplist.htm" into the dataroot - then the theme just includes this droplist.htm file like this:

<?php require($CFG->dataroot.'/droplist.htm'); ?>

I've also used local/db/upgrade.php to install the db table required (renamed to theme_menu as menu was a bit too generic)

attached is a patch that might help someone. Note: this patch doesn't include the JS required to turn the list generated in droplist.htm into a formatted droplist - I might upload what we use at some point if it's useful for others.

Show
Dan Marsden added a comment - I've just had a play around with this patch - nice idea. I've rewritten the menu.php page and changed the way that the menu is built - it now saves a file called "droplist.htm" into the dataroot - then the theme just includes this droplist.htm file like this:
<?php require($CFG->dataroot.'/droplist.htm'); ?>
I've also used local/db/upgrade.php to install the db table required (renamed to theme_menu as menu was a bit too generic) attached is a patch that might help someone. Note: this patch doesn't include the JS required to turn the list generated in droplist.htm into a formatted droplist - I might upload what we use at some point if it's useful for others.

People

Vote (3)
Watch (5)

Dates

  • Created:
    Updated: