Course menu with xtree ( used to be structured format )

Course menu with xtree ( used to be structured format )

by Alexis Maldonado -
Number of replies: 32
Ok..
Here is the first release..
Hope to put this in CVS soon but wanted you guys/gals to try it out first..

To install just extract in your moodle directory.
Average of ratings: -
In reply to Alexis Maldonado

More Pics..

by Alexis Maldonado -
Here is a pic with all Weeks grouped into one folder.
Attachment snapshot4.png
In reply to Alexis Maldonado

Re: More Pics..

by Genner Cerna -

But one thing when copying the files to the said directory, the javascript file overrides the exsiting javascript in the lib this should not be the case. Renaming the javascript is a good idea than overidding the existing file.

Hope, Martin will include this on the patch release of moodle 1.3 or even in the CVS.

In reply to Alexis Maldonado

Re: More Pics..

by Mark Davies -

Hi Alexis,

This xtree menu is exactly what I am looking for, where can I download or access the latest version of this?

Regards,

Mark

In reply to Alexis Maldonado

Re: Course menu with xtree (suggestions for improvements)

by Gustav W Delius -

Alexis, this is great approve.

I have tried it out and it works out of the box, except that one does have to increase the version number in blocks/version.php by hand so that the new block actually gets installed automatically.

I have a few comments (one big and several small ones):

1) How do you decide which menu items are expanded? When I tested it this seemed to depend on what the last user who requested the page had chosen. So there was absolutely no way to predict what the menu would look like on the next visit to the course page because someone else might have visited it in the meantime and changed the look of the menu. I am afraid you will have to save this on a per-user basis.

2) There is then no need for the block setting that decides whether the sections are grouped together in a folder. They can always be grouped in a folder and people who like can simply always keep the folder expanded.

3) You have taken some of the links that used to be in the "Administration" block and split them into two groups. One group you placed inside a folder called "Controls" because they indeed all control something. I like that. (However, shouldn't the "Files" link be in that group as well?) The other links you have simply placed at the top level. I would prefer them to be inside a folder as well. Again people can simply always keep this folder open if they want to see all these links. Perhaps that folder, which contains "Grades, Logs, Files, Teacher Forum" could be called "Information". But it really doesn't matter what it is called because users will open it anyways and see what is inside.

4) Student users also have top level links "Change password" and "Unenrol me". These should go into the "Control" folder.

5) Moodle provides two ways to view the course page: with all sections visible and with only the current section visible. The section links in the menu currently always change the view to the one where only the current section is visible. I think the section links should keep the format as it is. If the user is using the expanded view then the section link should simply jump to that section inside the current expanded page. In fact, the section links should behave the same as those in the "Section links" block do (or at least would if the code for the later wasn't broken, as I just discovered. I will fix it later).

6) Could you make the current section appear bold in the menu?

7) Could you make it so that clicking on folder names like "Activities" opens that folder? Currently those links do nothing.

8) In the theme I am using (the standard theme), links show up as blue and turn to underlined red when I hover over them. The links in the menu on the other hand are black and turn underlined blue when I hover over them. Are you using a different style sheet? I think you should use the style sheet from the current theme.

That's it for now. I have only made so many comments because I think you have done a wonderful job which inspires me to be a perfectionist.

It would be good if someone could test how much of a performance loss one gets when the menu block is enabled. If this is not too bad then I predict that most users will love this block.

Alexis, many thanks for your work!

In reply to Gustav W Delius

Re: Course menu with xtree (suggestions for improvements)

by Gustav W Delius -

Alexis, some more suggestions for the tree menu:

9) why not include the other courses a student is enroled in as well, i.e., subsume the "My courses" block into your menu block as well. Clicking on the folder for one of the other courses should link to that course.

10) give the new icons a transparent background.

11) You have a "User" folder that contains the links from the "People" block. Why this change of name?

Please put your new block into CVS as soon as you can.

In reply to Gustav W Delius

Re: Course menu with xtree (suggestions for improvements)

by Alexis Maldonado -

9) why not include the other courses a student is enroled in as well, i.e., subsume the "My courses" block into your menu block as well. Clicking on the folder for one of the other courses should link to that course.

Yes this is something i tried and failed.. you can see on xtree.php that i have a function at the end that is not yet implemented.. thats what its supposed to do.. I will keep trying ...

10) give the new icons a transparent background.

They already do.. but they might display improperly in IE since they are png files. I might have to convert them to gif?

11) You have a "User" folder that contains the links from the "People" block. Why this change of name?

I dont have a real reson except i like users better than people.. hehe.. but i can switch that back though..? anyone object?

In reply to Gustav W Delius

Re: Course menu with xtree (suggestions for improvements)

by Alexis Maldonado -
1) How do you decide which menu items are expanded? When I tested it this seemed to depend on what the last user who requested the page had chosen. So there was absolutely no way to predict what the menu would look like on the next visit to the course page because someone else might have visited it in the meantime and changed the look of the menu. I am afraid you will have to save this on a per-user basis.

The default value for any folder that has items in it is cosed. it is possible to control wich folders are opened/closed by default but that would be down at the script level unless we somehow create a config tool for that.. Its not a per-user basis its a per-browser basis. When you close the browser the tree will reset to its original state. Two different users on two different machines will see their own menu until they close their browsers.

2) There is then no need for the block setting that decides whether the sections are grouped together in a folder. They can always be grouped in a folder and people who like can simply always keep the folder expanded.

The reason i added this option is because some users might just want to build their own custom tree and if I only group sections into Weeks/Topics then they won't be able to rename Weeks/Topics to whatever they want. Without grouping them you can have say.. one folder with one name. Maybe if i add an option to rename Weeks/Topics ect.. For now I could set the default to be grouped ? any votes?

3) You have taken some of the links that used to be in the "Administration" block and split them into two groups. One group you placed inside a folder called "Controls" because they indeed all control something. I like that. (However, shouldn't the "Files" link be in that group as well?) The other links you have simply placed at the top level. I would prefer them to be inside a folder as well. Again people can simply always keep this folder open if they want to see all these links. Perhaps that folder, which contains "Grades, Logs, Files, Teacher Forum" could be called "Information". But it really doesn't matter what it is called because users will open it anyways and see what is inside.

The reason i left gradebook etc.. on the top level was because in my experience those where the tools that the instructor/student would like to find fast. I would be more than happy to create another folder for those.. but we have to first decide what name etc.. Mybe in the future i can write some tool to customize the look & feel of the tree.. its possible..

4) Student users also have top level links "Change password" and "Unenrol me". These should go into the "Control" folder.

Hmn.. will do.. but shouldnt this go under the Users folder since its user related stuff? Plus i dont think controls should even show up as a student.

5) Moodle provides two ways to view the course page: with all sections visible and with only the current section visible. The section links in the menu currently always change the view to the one where only the current section is visible. I think the section links should keep the format as it is. If the user is using the expanded view then the section link should simply jump to that section inside the current expanded page. In fact, the section links should behave the same as those in the "Section links" block do (or at least would if the code for the later wasn't broken, as I just discovered. I will fix it later).

Ok.. will do..

6) Could you make the current section appear bold in the menu?

If its possible i will do..

7) Could you make it so that clicking on folder names like "Activities" opens that folder? Currently those links do nothing.

Double clicking on a folder actually opens the folder. Single click on the + opens the folder. I think i could make it so that single click does it and add a config option for that.

8) In the theme I am using (the standard theme), links show up as blue and turn to underlined red when I hover over them. The links in the menu on the other hand are black and turn underlined blue when I hover over them. Are you using a different style sheet? I think you should use the style sheet from the current theme.

The xtree has its own style sheet.  Its located at lib/xtree/xtree.css.
To use your current stylesheet just go to:  /lib/javascript.php and comment out:
<link rel="stylesheet" type="text/css" rel="stylesheet" href="<?php echo "$CFG->wwwroot/lib/xtree" ?>/xtree.css" />
i think that should work..


Thanks for your input smile

Alexis...


In reply to Alexis Maldonado

Re: Course menu with xtree (suggestions for improvements)

by Simon Reynolds -

Alexis

My course writer asked me if the course files could be shown in a tree like structure. I went away and found your contribution! I went back to my writer and said I had sorted it out for her and took all the credit of course smile

Just one small detail. In the topic tree, the text was pushing out the side of the box. I commented out the line in javascript.php which has corrected the problem. However, I prefered the font as it was before. Now, the box is the same width as the others, but the text carries on on to a second line as in the illustration below.

Have you any ideas how I can fix this. If you have an answer, I promise I will tell her it was all your work!

Thanks for the great contribution.

Simon

Attachment coursemenu.gif
Average of ratings: Useful (1)
In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Jean-Pierre Pawlak -

I like it, Alexis, and we'll certainly use it.

I found out however there is a little problem (bug?): when I add a ressource logo's the xtree disappears, leaving an empty block. Logo's is a ressource name and not a directory or filename. In Dutch we need the 's to form the plural of certain nouns...

Firefox Javascript console gives the following error:

Error: missing ) after argument list
Source File:
http://www.***.net/moodle/course/view.php?id=12
Line: 160, Column: 37
Source Code:
var mod154 = new WebFXTreeItem('logo's','http://www.***.net/moodle/mod/resource/view.php?id=154','','http://www.***.net/moodle/mod/resource/icon.gif','');
 

In reply to Jean-Pierre Pawlak

Re: Course menu with xtree ( used to be structured format )

by Alexis Maldonado -
Hmn.. thought i fixed this..
will fix..
In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Alexis Maldonado -
Put everything in CVS under contrib.
The folder is: tree

In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Michael Penney -

I just updated this for 1.5, do you mind if I put it in CVS/contrib?

I was thinking in CVS/contrib/tree/Moodle_15/tree?

In reply to Michael Penney

Re: Course menu with xtree ( used to be structured format )

by Ger Tielemans -
After migrating to 1.4.4 course menu does no longer show the tree, any idea?
In reply to Ger Tielemans

Re: Course menu with xtree ( used to be structured format )

by Michael Penney -
Hmm, something lost in the upgrade perhaps?

Is there still an xtree directory in your lib directory? Did you re-replace lib/javascript.php with the one from the xtree install or put the calls for the xtree js files in your javascript.php (I'm not sure the old javascript.php would work with the 1.4.4?)
In reply to Michael Penney

Re: Course menu with xtree ( used to be structured format )

by seaghan moriarty -

I have search for xtree and Course Menu (as keywords) and read all the forums about this fantastic feature. However, I could not find where to get this feature (I saw the screenshots and tried my Administration > Configuration > Blocks but could not find any entry there called 'Course Menu'). I need a little help

Could anyone tell me how to get/install the Course Menu block (I am using Moolde 1.52). A step-by-step would be hugely helpful smile

In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by L. Vandijck -
If you're familiar with CVS, you can download it there.
If not, try the website of the developing team at http://cdc.humboldt.edu/moodle/
Installing it is pretty straightforward: unzip the package and copy the folder course_menu to the blocks folder in your Moodle site. Visit the admin page and the block will self install, and from then on be available in the list of blocks you can add.
Regards,
Leo
In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by Jeff Graham -
Seaghan,

The latest code is available via CVS if you have a command line version you can get it using the following command.

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle co contrib/block_course_menu

The code is not available on our website mentioned by L. Vandijck, Michael Penney maintains this site, but our latest code is usually available via CVS first.

regards,
Jeff
In reply to Jeff Graham

Re: Course menu with xtree ( used to be structured format )

by seaghan moriarty -

Thanks for your help smile

1. As I'm not familiar with CVS, this is beyond my current capabilities.

2. I had earlier looked at, and downloaded the file "block_course_menu.zip" from the website mentioned above. I will give this a try - just to see if I can get it to work / play around with it.

PS I personally think that the need for a left hand 'touchstone' navigation for usability outweighs the various accessibility arguments.

In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by L. Vandijck -
If it's okay with you and Jeff I'm willing to send you the latest version straight from CVS by email, as a ZIP package. Just let me know
Regards,
Leo
In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by Jamie Pratt -
Hi,

It seems that this is available, as are most of the daily builds from CVS, as a downloadable zip. It is here :

http://download.moodle.org/download.php/modules/block_course_menu.zip

This is the latest version of the code, the zip file is generated from the contents of the CVS repository everyday.

Jamie
In reply to Jamie Pratt

Re: Course menu with xtree ( used to be structured format )

by seaghan moriarty -
Fantastic - I am very thankful for your collegial support smile
In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by seaghan moriarty -

It is working - thanks again everyone!!

Can I ask 1 more question (probably one of those 'stupid' questions). I know how to move the 'blocks' on the 'homepage' but I do not know how to include the Course Menu Block to stay at the left hand side of ALL my course. Once I leave the main page of the course, the left hand block(s) are gone and the 'turn editing on' is not available.

Can anyone tell me how to have a block(s) persist throughout the whole course - so, for example, I can have that fantastic menu along the left, all the time?

In reply to seaghan moriarty

Re: Course menu with xtree ( used to be structured format )

by seaghan moriarty -

FYI

I just found out (on another thread) that it is not possible to have the Course Menu block available as a left-hand navigation/menu in most of the content areas. It will work in the main areas, but will NOT work on any specific activity page (forums, resources, etc.).

This is a big pity and could have been a great help to navigation throughout the course ...  Ah well ...

In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Abigail Barzilai -

HI,

I am working with the 1.5.2 version and I can'nt find

the Course menu with xtree .

Please help.

Abigail

In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Hemant B -

Hello,

Great menu! Is it possible to have a background behind the title text maybe like

title i          
In reply to Alexis Maldonado

Re: Course menu with xtree ( used to be structured format )

by Mike Green -

Thanks for this block - it gives a very professional interface to Moodle.

I have a small problem. Course Menu give a link to the trouble_ticket block, if it is installed. We haven't installed trouble_ticket, but a link to it is appearing in the course menu. The link text is title, and it's a broken link. The icon for the link also fails to appear.

Any suggestions for a fix?

In reply to Mike Green

Re: Course menu with xtree ( used to be structured format )

by Laudelino Lima -
Hello To all !

1 - My Course Menu Block, stay with wrong name blockname - Im put the lang files in the lan/pt_br dir and lang_us dir !

2 - I wish put my Category Course (Categoria de Cursos) in Treeview, How I do this ?

I'm dont have problem to edit PHP, im not expert but not donkey smile



..


In PHP CODE Block_Course_menu.php, see the bold phrase:

 //start the tree
        ob_start();

        //include the xtree javascript files
        print '<script type="text/javascript" src="'.$CFG->wwwroot.'/blocks/course_menu/xtree/xtree.js">';
        print '<script type="text/javascript" src="'.$CFG->wwwroot.'/blocks/course_menu/xtree/xmlextras.js">';
        print '<script type="text/javascript" src="'.$CFG->wwwroot.'/blocks/course_menu/xtree/xloadtree.js"></script>';

            print_xtree_start( "</a>" .$this->course->shortname);

        //print sections

        if (!isguest()) {
            // control panel
            print_xtree_item('tree','controlpanel',get_string('controlpanel','block_course_menu'),"$CFG->wwwroot/blocks/cou
rse_menu/controls/controls.php?id=" .$this->course->id,'',"$CFG->wwwroot/blocks/course_menu/icons/configure.gif");
        }

        if (isteacher($this->course->id)) {
            if (isediting($this->course->id)) {
                print_xtree_item('tree','edit',get_string('turneditingoff'),"view.php?id=". $this->course->id . "&edit=off"
,'',"$CFG->pixpath/i/edit.gif", 'alt="alt"'); //add edit item
            }
            else {
                print_xtree_item('tree','edit',get_string('turneditingon'),"view.php?id=" . $this->course->id . "&edit=on",
'',"$CFG->pixpath/i/edit.gif"); //add edit item
            }



what mean ADD EDIT ITEM ?

What I can do here ?

In reply to Mike Green

Re: Course menu with xtree ( used to be structured format )

by Greg de Vitry -
You will need to edit

blocks/course_menu/block_course_menu.php

on line 102 (or about there) comment out
//trouble ticket link
print_xtree_item('tree','troubleticket',get_string('title', 'block_trouble_ticket'),"{$CFG->wwwroot}/blocks/trouble_ticket/form.php?id={$this->course->id}", '', "$CFG->wwwroot/blocks/trouble_ticket/icons/bug.gif");

so add '//'  before the print_xtree_item
>>resulting code
        //trouble ticket link
     //  print_xtree_item('tree','troubleticket',get_string('title', 'block_trouble_ticket'),"{$CFG->wwwroot}/blocks/trouble_ticket/form.php?id={$this->course->id}", '', "$CFG->wwwroot/blocks/trouble_ticket/icons/bug.gif");
This should be a config itme?