Issue Details (XML | Word | Printable)

Key: CONTRIB-1462
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Anthony Borrow
Reporter: Abrar Ullah
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

A Vertical automated Flyout Menu of course topics and manual urls

Created: 03/Aug/09 05:51 PM   Updated: 04/Aug/09 01:46 AM
Return to search
Component/s: Add a project here
Affects Version/s: 1.9
Fix Version/s: None

File Attachments: 1. Zip Archive menu_editor.zip (20 kB)
2. Zip Archive menu_flyout.zip (23 kB)


Database: MySQL
URL: http://www.elearning.school.nz/course/view.php?id=77
Participants: Abrar Ullah and Anthony Borrow
Security Level: None
Affected Branches: MOODLE_19_STABLE


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Anthony Borrow added a comment - 03/Aug/09 06:49 PM
Abrary - Thanks for taking the time to create an issue in the tracker and for uploading the code for the flyout menu editor block. In looking at the things, here are a few comments, questions, etc. for your consideration. Please know that all my comments are intended to be constructive to help improve the actual implementation of your code by other users.

1) I wonder if we might benefit from renaming your block flyout_menus. The reason I think that might be a better name is that it is both more specific but also as menus grow in popularity there may be multiple menu editing blocks and renaming may help to avoid some confusion.

2) I noticed when I created a new instance of the menu_editor block on the frontpage that I received the following PHP Notice:

Notice: Undefined variable: menumembersoptions in /home/arborrow/Moodle/code/19stable/blocks/menu_editor/block_menu_editor.php on line 111

and similarly,

Notice: Undefined variable: menumembersoptions in /home/arborrow/Moodle/code/19stable/blocks/menu_editor/block_menu_editor.php on line 152

For testing purposes, I recommend setting Moodle debugging to show all reasonable PHP notices and errors (not developer mode). These types of notices are usually pretty easy to fix by either initializing the variable or checking for a value.

For example for line 111 you could use:

if (!empty($menumembersoptions )) { $menumembersoptions =str_replace('<ul></ul>','',$menumembersoptions); }

I have a slight preference for initializing the variable because then you can take care of any and all with a single line and you save a little performance by not having a bunch of extra if statements. I will continue to test and comment here but if you could let me know what you think about the renaming let me know. Hopefully it is pretty easy to do but if you need help to get it done quickly or have reasons why you would rather not rename it just let me know.

Peace - Anthony


Anthony Borrow added a comment - 03/Aug/09 06:52 PM
Abrary - One other thought that I had was that folks frequently use the chronological course format rather than the topic format. I think ideally since Moodle's underlying section management is the same that we might be able to make this work for all course formats. I'll have to look more closely at the code to see what it is doing but I think one feature request I would have might be to have the block work with all course formats. Does that sound reasonable or feasible? I am just waking up so it is totally possible that I am overlooking some thing really obvious. Peace - Anthony

Abrar Ullah added a comment - 03/Aug/09 08:46 PM
Hi Anthony,
1) We take it step by step, the first one to go for is to change the block name to flyout_menus , I have no problem doing that, I would wonder whether that has to be just the name in language file or we need to change the folder name and database table name as well?
2) About the variable declaration, I reckon that has to be done and I will do that. Can you please advise me on how to perform changes on the version uploaded to CVS server, do I need to change on my local machine and upload it later or it has to be done on the server, sorry If am not being helpful, but I am trying find time during my office hours.
3) About multiple course format, that is still a problem and has to be addressed. I have used topic_id and courseid as fields in the database table to store the section information. and use them as parameters in the menu links. If you think there is a way to making it flexiable for all courses, please advise me on that and i follow the line.
Many thanks for your time.

Abrar


Abrar Ullah added a comment - 03/Aug/09 11:06 PM
I have changed the name and sorted out the variable declaration.

Anthony Borrow added a comment - 04/Aug/09 01:46 AM
Abrar - I am not sure why I was adding a "y" to the end of your name. I can only guess that my eyes saw the initial capital and just assumed I was writing Anthony. In any case, thanks for the updated files and for the prompt response. You sound like most of the rest of us that are involved with Moodle. We all have other things we are working on but enjoy doing what we can with Moodle. We all do our best and that is enough.

1) I think that in renaming we would do best to rename tables, language files, etc. That way it is consistent and we do not have to think about it.
2) As for working with CVS once you setup a directory for CVS access you can then use CVS commands. If you are using an IDE like Eclipse or Netbeans it is automated in that you can use the IDE to update CVS (get the latest version from the CVS server) and then make changes on your local machine and upload those changes (commit them) to the CVS server. Do not be shy if you have questions with this process as I am happy to be of assistance.
3) Once we get the code uploaded to CVS then I will take a closer look to see what might be done to make things more flexible for the other course formats.

Again, please do not hesitate to let me know how I can support your efforts. Peace - Anthony