Non-core contributed modules

Expandable / Collapsable menu block

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Incomplete
  • Affects Version/s: 1.9.1
  • Fix Version/s: None
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_19_STABLE

Description

This block is capable of letting the site admin to create a collapsable/expandable menu.

Once you create a number of web pages in your moodle site, you edit the block config, and create the tree using nested bulleted lists. Link the various items to pages by using the ordinary hyperlink tool.

As soon as the block config isa saved, you have your navigable menu.

Note: The pages you add should have the "Allow left and right columns" checkobx enabled to make the menu block to appear.

Activity

Hide
Cristiano Leoni added a comment -

New version with some fixes

Show
Cristiano Leoni added a comment - New version with some fixes
Hide
Cristiano Leoni added a comment -

This version uses only CSS for the indentation, hence it is more elegant and accessible solution.

Updated instructions

This one works also with relative URLs, includes an example and screenshot.

Show
Cristiano Leoni added a comment - This version uses only CSS for the indentation, hence it is more elegant and accessible solution. Updated instructions This one works also with relative URLs, includes an example and screenshot.
Hide
Cristiano Leoni added a comment -

Fixes for make it working even with relative URLS

Show
Cristiano Leoni added a comment - Fixes for make it working even with relative URLS
Hide
Cristiano Leoni added a comment -

Version 0.4 contains the following fixes:

  • fixes to make it work on both Moodle 2.0 and 1.9.2
  • changed some strings from Italian to English (name from "CELAB Menu ad albero" to "Collapsable Menu")
Show
Cristiano Leoni added a comment - Version 0.4 contains the following fixes:
  • fixes to make it work on both Moodle 2.0 and 1.9.2
  • changed some strings from Italian to English (name from "CELAB Menu ad albero" to "Collapsable Menu")
Hide
Anthony Borrow added a comment -

Cristiano - Thanks for the celabmenu block. I am just now getting a chance to take a look at it. One thing I noticed was that you did not seem to initialize the $level variable at some point I would expect to see an initial declaration of $level=0; or something like that. I also moved the en_utf8 folder to a lang folder so that you have /blocks/celabmenu/lang/en_utf8 which is the proper place for that. I suspect you had it there but the zip file (version 0.4) did not have a lang folder. I'll continue to make comments as I work through the code. Peace - Anthony

Show
Anthony Borrow added a comment - Cristiano - Thanks for the celabmenu block. I am just now getting a chance to take a look at it. One thing I noticed was that you did not seem to initialize the $level variable at some point I would expect to see an initial declaration of $level=0; or something like that. I also moved the en_utf8 folder to a lang folder so that you have /blocks/celabmenu/lang/en_utf8 which is the proper place for that. I suspect you had it there but the zip file (version 0.4) did not have a lang folder. I'll continue to make comments as I work through the code. Peace - Anthony
Hide
Anthony Borrow added a comment -

Cristiano - I recommend turning debugging on to show all PHP notices and warnings (not developer mode). That will help you catch things like:

Notice: Undefined index: Home in /home/arborrow/Moodle/code/19stable/blocks/celabmenu/block_celabmenu.php on line 176

To prevent it I usually do something like:

if (!empty($nodes[$father])) {
foreach ($nodes[$father] as $n) {
$m = false;
$children .= print_tree($nodes,$n,$url,$level+1,$m);
if (!$matched && $m) { $show_children = 'true'; }
$matched = $matched || $m;
}
}

Show
Anthony Borrow added a comment - Cristiano - I recommend turning debugging on to show all PHP notices and warnings (not developer mode). That will help you catch things like: Notice: Undefined index: Home in /home/arborrow/Moodle/code/19stable/blocks/celabmenu/block_celabmenu.php on line 176 To prevent it I usually do something like: if (!empty($nodes[$father])) { foreach ($nodes[$father] as $n) { $m = false; $children .= print_tree($nodes,$n,$url,$level+1,$m); if (!$matched && $m) { $show_children = 'true'; } $matched = $matched || $m; } }
Hide
Anthony Borrow added a comment - - edited

Here are a couple of missing language strings which were used in config_instance.html:

[[configtitle]] and [[configcontent]]

something like the following lines should be added to /blocks/celabmenu/lang/en_utf8/block_celabmenu.php

$string['configtitle'] = 'Config title';
$string['configcontent'] = 'Config content';

Show
Anthony Borrow added a comment - - edited Here are a couple of missing language strings which were used in config_instance.html: [[configtitle]] and [[configcontent]] something like the following lines should be added to /blocks/celabmenu/lang/en_utf8/block_celabmenu.php $string['configtitle'] = 'Config title'; $string['configcontent'] = 'Config content';
Hide
Anthony Borrow added a comment -

I would create a README.txt file to describe installation and usage. I think that will be helpful to the users as it is not immediately apparent to me how to develop the menu. Peace - Anthony

Show
Anthony Borrow added a comment - I would create a README.txt file to describe installation and usage. I think that will be helpful to the users as it is not immediately apparent to me how to develop the menu. Peace - Anthony
Hide
Anthony Borrow added a comment -

Cristiano - In terms of functionality, could you describe for me what this block does that the HTML block does not. Both seem to provide a Title and Content section for displaying a custom menu. Thanks for helping me to understand your block a little better. Peace - Anthony

Show
Anthony Borrow added a comment - Cristiano - In terms of functionality, could you describe for me what this block does that the HTML block does not. Both seem to provide a Title and Content section for displaying a custom menu. Thanks for helping me to understand your block a little better. Peace - Anthony
Hide
Anthony Borrow added a comment -

Another missing language string in config_global.html:

[[donotallowhtml]]

something like the following lines should be added to /blocks/celabmenu/lang/en_utf8/block_celabmenu.php

$string['donotallowhtml'] = 'Do not allow HTML' ;

Show
Anthony Borrow added a comment - Another missing language string in config_global.html: [[donotallowhtml]] something like the following lines should be added to /blocks/celabmenu/lang/en_utf8/block_celabmenu.php $string['donotallowhtml'] = 'Do not allow HTML' ;
Hide
Cristiano Leoni added a comment -

Thank you very much, I will check out all the changes and get back here soon!

Show
Cristiano Leoni added a comment - Thank you very much, I will check out all the changes and get back here soon!
Hide
Anthony Borrow added a comment -

Cristiano - Take your time, I will not be back until February as I am leaving today for Nepal. Peace - Anthony

Show
Anthony Borrow added a comment - Cristiano - Take your time, I will not be back until February as I am leaving today for Nepal. Peace - Anthony
Hide
Anthony Borrow added a comment -

I am resolving as incomplete. I had requested some feedback and was expecting a revised version from Cristiano. It looks like after I went to Nepal that nothing happened with this. I am going to resolve as incomplete in an attempt to get a better handle on my active to do list; however, if we need to re-open the issue just let me know. Sorry if I may have dropped the ball on my end. Peace - Anthony

Show
Anthony Borrow added a comment - I am resolving as incomplete. I had requested some feedback and was expecting a revised version from Cristiano. It looks like after I went to Nepal that nothing happened with this. I am going to resolve as incomplete in an attempt to get a better handle on my active to do list; however, if we need to re-open the issue just let me know. Sorry if I may have dropped the ball on my end. Peace - Anthony

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: