Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Incomplete
-
Affects Version/s: 1.9.1
-
Fix Version/s: None
-
Component/s: Block: {none of the above}
-
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.
Attachments
-
$i18n.getText("admin.common.words.hide")
- celabmenu_v_0_1.zip
- 07/Aug/08 8:49 PM
- 5 kB
- Cristiano Leoni
-
- celabmenu/block_celabmenu.php 5 kB
- celabmenu/config_global.html 0.4 kB
- celabmenu/config_instance.html 0.7 kB
- celabmenu/en/block_celabmenu.php 0.1 kB
- celabmenu/folder.gif 0.9 kB
- celabmenu/folderopen.gif 0.8 kB
- celabmenu/Thumbs.db 6 kB
- celabmenu/tr.gif 0.4 kB
-
$i18n.getText("admin.common.words.hide")
- celabmenu_v0_2.zip
- 25/Aug/08 8:46 PM
- 6 kB
- Cristiano Leoni
-
- celabmenu/block_celabmenu.php 6 kB
- celabmenu/config_global.html 0.4 kB
- celabmenu/config_instance.html 0.7 kB
- celabmenu/dots.gif 0.8 kB
- celabmenu/en/block_celabmenu.php 0.1 kB
- celabmenu/folder.gif 0.9 kB
- celabmenu/folderopen.gif 0.8 kB
- celabmenu/Thumbs.db 7 kB
- celabmenu/tr.gif 0.4 kB
-
$i18n.getText("admin.common.words.hide")
- celabmenu_v0_3.zip
- 26/Aug/08 9:37 PM
- 11 kB
- Cristiano Leoni
-
- celabmenu/block_celabmenu.php 6 kB
- celabmenu/config_global.html 0.4 kB
- celabmenu/config_instance.html 0.7 kB
- celabmenu/dots.gif 0.8 kB
- celabmenu/en/block_celabmenu.php 0.1 kB
- celabmenu/example.txt 0.3 kB
- celabmenu/folderopen.gif 0.8 kB
- celabmenu/screenshot.gif 3 kB
- celabmenu/styles.php 0.9 kB
- celabmenu/Thumbs.db 9 kB
- celabmenu/tr.gif 0.4 kB
-
$i18n.getText("admin.common.words.hide")
- celabmenu_v0_3a.zip
- 27/Aug/08 9:14 PM
- 11 kB
- Cristiano Leoni
-
- celabmenu/block_celabmenu.php 6 kB
- celabmenu/config_global.html 0.4 kB
- celabmenu/config_instance.html 0.7 kB
- celabmenu/dots.gif 0.8 kB
- celabmenu/en/block_celabmenu.php 0.1 kB
- celabmenu/example.txt 0.3 kB
- celabmenu/folderopen.gif 0.8 kB
- celabmenu/screenshot.gif 3 kB
- celabmenu/styles.php 0.9 kB
- celabmenu/Thumbs.db 9 kB
- celabmenu/tr.gif 0.4 kB
$i18n.getText("admin.common.words.show")- celabmenu_v0_3a.zip
- 27/Aug/08 9:14 PM
- 11 kB
- Cristiano Leoni
-
$i18n.getText("admin.common.words.hide")
- celabmenu_v0_4.zip
- 03/Sep/08 5:09 PM
- 11 kB
- Cristiano Leoni
-
- celabmenu/block_celabmenu.php 7 kB
- celabmenu/config_global.html 0.4 kB
- celabmenu/config_instance.html 0.7 kB
- celabmenu/dots.gif 0.8 kB
- celabmenu/en_utf8/block_celabmenu.php 0.1 kB
- celabmenu/example.txt 0.3 kB
- celabmenu/folderopen.gif 0.8 kB
- celabmenu/screenshot.gif 3 kB
- celabmenu/styles.php 0.9 kB
- celabmenu/Thumbs.db 9 kB
- celabmenu/tr.gif 0.4 kB
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
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.
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")
- 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")
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
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;
}
}
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';
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
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
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' ;
Thank you very much, I will check out all the changes and get back here soon!
Cristiano - Take your time, I will not be back until February as I am leaving today for Nepal. Peace - Anthony
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
New version with some fixes