HSU's block course menu and Moodle 1.6

HSU's block course menu and Moodle 1.6

by andrzej marczewski -
Number of replies: 23
Has anyone got the HSU's block course menu working well with 1.6?
I get lots of bits like this blockname on my menu!!
Average of ratings: -
In reply to andrzej marczewski

Re: HSU's block course menu and Moodle 1.6

by Owen Stephens -
First guess would be that you are missing the relevant language files. What language are you working in?
In reply to Owen Stephens

Re: HSU's block course menu and Moodle 1.6

by andrzej marczewski -
English
Could it be to do with the utf8 encoding thing in 1.6?
In reply to andrzej marczewski

Re: HSU's block course menu and Moodle 1.6

by Neil S -
I have the block displaying correctly by placing the block_course_menu.php lang file in the lang/en_utf8 directory.

But I have a different issue.

When I go to the control panel portion of the block and select a different tab such as 'backup and restore' the URL changes to reflect my clicking the link but the block still displays the 'Main Control Panel' view -- No matter what tab I select I always see the opening 'Main Control Panel'. I haven't been able to figure out why I'm seeing this (mis)behavior. The code seems easy enough to understand - and it should be pretty easy to add in the 1.6 functionality under the control panel but so far no dicesmile Any help is appreciated. I'm running CentOS4 Linux and PHP5 with MySql 4.1

Cheers
ns
In reply to Neil S

Re: HSU's block course menu and Moodle 1.6

by James Ballard -
I have the same error with the tabs in the Control Panel view.

Likewise I can display the block correctly - it sounds like a language string is missing; try redownloading an copying the language files if it isn't fixed. I did notice there was an empty language string for the bug tracker module, but we do not use this so I commented that line out from the menu and it is fine. It appeared under "Show all sections".


Yours
James
In reply to James Ballard

Re: HSU's block course menu and Moodle 1.6

by Neil S -
Figured out a fix for the tabs issue -- I don't know if it's 'moodlesque' or not -- but it does work this way smile

Seems like there is probably a function to collect Get/Post vars that I didn't see in my brief digging through the dev docs.

In .....blocks/course_menu/controls/controls.php

Change:
optional_variable($action, 'mcp');

To:
$action = $_GET['action'];
optional_variable($action, 'mcp');

That should make the tabs work correctly.

I'm also planning to work on the 'included' files that comprise each tab's content to incorporate some of the new Moodle functionality found (for example) in the 'administration' block of 1.6

Cheers,
ns
In reply to andrzej marczewski

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: HSU's block course menu and Moodle 1.6

by Francis Brouns -
Hi,

the HSU course menu is a block. After installing it, it should be listed in the admin page for blocks.

You have to add it to a course. Turn editing on. In the 'Add a block' block, choose 'Course menu'. The Course menu is then added and you can move it to the position you like.

We have it running on several Moodle sites on a Windows 2003 server, both Moodle 1.5+ and Moodle 1.6. On the Moodle 1.6 site we made some minor modifications to remove the control panel and gradebook, because we are only interested in the tree menu for the sections.

Francis
In reply to Francis Brouns

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: HSU's block course menu and Moodle 1.6

by Francis Brouns -
Hello,

in your previous message you refered to course menu as a new module you installed. In which directory did you add the files? You should place the course_menu directory in moodle/blocks, not moodle/modules.

You should have a directory structure like
moodle
blocks
course_menu
block_course_menu.php
...

And then visit http://yourserver/moodle/admin. This should make the course_menu block.

You should also check whether the files are owned by the Apache user.

Francis


In reply to Francis Brouns

Re: HSU's block course menu and Moodle 1.6

by James Ballard -
Hi

I have this working fine in 1.6 using Neil's changes and have edited the control panel to include the new Administration functions (Reset, Questions, and Reports). Students also changes to Child courses in the user panel when the course is a meta course.

I have taken out the change password option as we use ldap authentication and do not allow updates this way, so do not overwrite your files if you need this option.

I have included the files I changed - it involved adding a new row to tables so it should be easy to copy and paste to your own files. There were also some description strings to add to the language file which I have also included.

Yours
James
In reply to James Ballard

Re: HSU's block course menu and Moodle 1.6

by Jamie Chandler -
Everytime I hit turn editing on through the menu I get....

'A required parameter (sesskey) was missing'

Any thoughts?
In reply to Jamie Chandler

Re: HSU's block course menu and Moodle 1.6

by A. T. Wyatt -
This is now happening to us also.  We are going to back it out and reinstall the block.  I changed quite a few things--adding all the latest suggested tweaks, and such.  I might have corrupted something!

atw
In reply to A. T. Wyatt

Re: HSU's block course menu and Moodle 1.6

by A. T. Wyatt -
After further digging, I have decided that because the editing link in this block does not include sesskey information, it does not work properly in 1.6.

I have commented out the offending lines of code until an update is available.  Since the "turn editing on" button is still at the top of the screen, teachers are not losing functionality.

atw
In reply to A. T. Wyatt

Re: HSU's block course menu and Moodle 1.6

by James Ballard -
Hi

Been away for a week; I hadn't used the turn editing on or off command from this block but I have the same problem. The session key is missing from the original block rather than the additions.

In block_course_menu.php replace:

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
}
}

with:

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&sesskey=".sesskey()."",'',"$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&sesskey=".sesskey()."",'',"$CFG->pixpath/i/edit.gif"); //add edit item
            }
        }

should solve this, although I only quickly tested it, but it seemed fine.

Yours
James
In reply to James Ballard

Re: HSU's block course menu and Moodle 1.6

by Tony Ruggiero -
James:

Great work on this block. I would love to use the expandable folders to access courses and activities. Any ideas how to do this?

Tony
In reply to James Ballard

Re: HSU's block course menu and Moodle 1.6

by Francis Brouns -
Just added your corrections. This solved the sessionkey problems. However the option 'turn editing on' is also shown to teachers without the editing permissions. Clicking this option has no effect. How do I hide this option for non-editing teachers?

Thanks for any feedback,

Francis
In reply to Francis Brouns

Re: HSU's block course menu and Moodle 1.6

by James Ballard -
Hi

On line 78 of block_course_menu.php relace:

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&sesskey=".sesskey()."",'',"$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&sesskey=".sesskey()."",'',"$CFG->pixpath/i/edit.gif"); //add edit item
}
}

with:

if (isteacheredit($this->course->id)) {
if (isediting($this->course->id)) { print_xtree_item('tree','edit',get_string('turneditingoff'),"view.php?id=". $this->course->id . "&edit=off&sesskey=".sesskey()."",'',"$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&sesskey=".sesskey()."",'',"$CFG->pixpath/i/edit.gif"); //add edit item
}
}

I think that should do it.

Yours
James
In reply to James Ballard

Re: HSU's block course menu and Moodle 1.6

by A. T. Wyatt -
Greetings, James!

I just installed this.  Thank you for your hard work!

I found two strings missing from the language file--

$string['questionsdesc'] = 'Question pools';
$string['resetdesc'] = 'Reset course';

Any ideas why some of the icons are showing up and some not?  I am missing question, reset, and report.  The rest are present and visible!  That is a little weird.  Oh well, I am working on it!

atw
-----
Edited:  The reason the images were not showing up was because of my theme!
In reply to A. T. Wyatt

Re: HSU's block course menu and Moodle 1.8

by Andrea Rappa -
hello,
i looking for use this block but i can't look icons and i can't understand if this block works.
please if someone can help me.

andrea
In reply to andrzej marczewski

Re: HSU's block course menu and Moodle 1.6

by Darrin Jackson -
Hey Peoples!

Not a major issue,but when I click on "logs" in the control panel, the link doesnt work. It looks for " /moodle/course/log.php".

Did I loose this file or is it not included int the 1.6 package?
In reply to Darrin Jackson

Re: HSU's block course menu and Moodle 1.6

by James Ballard -
Hi

The page is called report.php in 1.6; you need to update the control panel pages to change the link. I included the files I changed in an earlier post so that the control panel includes the new administration functions from 1.6.

Yours
James