A layout editor for 1.5 (also 1.6)

A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Number of replies: 71
This version shows headings for all sections. Moving a section will
will update the heading as well as the content.
Screenshot
Attachment layout.png
Average of ratings: -
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
The code (attached)

I place these files in course/format/weeks
and add a link to layout.php in course/format/weeks/format.php
that shows up when editing.
Something like below (line 67 or there about)

Change:
/// Start main column
    echo '<td id="middle-column">';

    print_heading_block(get_string('weeklyoutline'), 'outline');


To:
/// Start main column
    echo '<td id="middle-column">'

    $extra = '';
 
if (isediting($course->id)) {
        $extra = ' &nbsp; <a title="Rearange layout"
        href="layout.php?id='.$course->id.'">Layout</a>';
    }


    print_heading_block(get_string('weeklyoutline').$extra, 'outline');

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -
having some issues with paths. Where is the localib file you are linking to?
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
I forgot to include a lib in the zip black eye
Place this file in the same directory as layout.php

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -

A small error in code of layout.php

On line 556 it should read:

print ' <form name="myform" id="myform" method=post action="'.$CFG->wwwroot.'/course/format/weeks/layout.php?id='.$id.'">

There are also two images missing (trash and calender). Can you post these images as well?

Lastly, it would be a good idea to seperate the CSS into a seperate file to allow for users to customize their own styles relevant to their sites.

Thanks

In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Thanks, I will post a new zip tomorrow.
In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -

I have repackaged the file created by Audun Hauge to make installation a little easier. I hope I have not offended Audun by doing so as he is onto a great idea here.

Installation instructions are included as well as a couple of small code fixes. The CSS has also been extracted to allow for modification by those wishing to do so.

The editor has now been packaged in such a way that it now sits independant of any particular course format allowing for application to one or multiple formats as dictated by the need of the moodle installation. 

A demonstration of this function has been placed in the Playpen. You can login as teacher:teacher to see this in action.

In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Very nicebig grin
I've let this thing slip a bit, and just posted the code as is with no review. It has been working nicely for my teachers so the motivation for improving it has been lacking.
I see that quite a few things could be improved ... the list of external recources placed below unused blocks gets pushed too far down the screen (at least when you have as many sideblocks installed as Julian).
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

Hi Julian,

Your Playpen was great.

Can you advise where I can dounload the  Kubrick Theme.

I love the way the blocks appear.

Thanks

Garry

In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Hey Julian! Nice changes in the appearance of your Playpen! Is that a variation of the Kubrick theme? It looks VERY nice!

By the way, I haven't been able to figure out how to test Audun's layout editor. I got in your Playpen and I turned editing on but I didn't see any obvious way to test this new functionality.

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -

Firstly, yes it is a Kubrick theme variation.

Secondly, I have set up a course to edit in Course Layouts>>Course Layout Editor.

Once in log in as a teacher and turn editing on. Up the top you will now have a text link called "Rearrange Layout". Clicking on this will activate the feature.

Suggestions
A couple of suggestions to make the function a little easier to use would include:

  • Breaking the screen up into a table to visualy create different editing spaces. Especialy on the right side. A breakdown of blocks and activities into two distinct sections would make things easier
  • Having activities list their name when sitting on the right hand staging area.
  • The text link is lost in the layout. Creating a graphical button for this would make it stand out a little more.
In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Darren Smith -
This is a great update and thanks Julian for providing the testing area.

When I hit save changes I am taken to a page not found on your college site. Is it just me?
In reply to Darren Smith

Re: A layout editor for 1.5 (also 1.6)

by Jan Dierckx -

No I was also taken to a non existing page.

And yes, I would also like to express my gratitude for a nice block and a very good looking testing area.

In reply to Darren Smith

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -
Thanks for the feedback. This bug has been fixed. Let testing resume smile
In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by James Robertson -

Julian,

Thanks for the link to your Playground.  Looks great, and a great place to try some modules I've downloaded but haven't unzipped and added yet (and some I have).  So, a few questions:

  1. When I tried your copy of the layout editor I could only drop a selected activity to the bottom of the list in the topic, no matter where I placed it.  Is that correct, or should I be able to drop it between two activities?  How close it it to being usable on a (small) production site?
  2. Where do I get the version with the bug fixed?  Or was that a site implementation error rather than a bug in the code?
  3. You have Zig's Exam/Homework module.  Is it fairly robust?  I have not seen anything since the initial "Don't use on a production site" version.  But my school is mostly off-line activities, so I would be interested to know if anyone has tested it further and feels it's ready to use for real.
  4. I had thought checked boxes (in front) in Activity Locking only mark previous viewing or completion with required grade.  It hasn't appeared to me that you are prevented from entering the activity again, did I miss a setting somewhere?

Thanks for setting up such a great try-it-and-see site!  And thanks Audun for a "must have" addition to Moodle!

Jim.

P.S. I kind of miss Mike W, but I guess it's just as well -- I've come to associate the character with the Moodler and I expect Julian would rather I didn't begin imagining he supports his Moodle habit by acting on the side for Pixar.

In reply to James Robertson

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
You can reorder the list of activities in a section by clicking on an item. The clicked item will drop to the bottom of the list. You can achieve any order by judicious clicking (not the most user-friendly - but it works).
I'm using it for my school, teachers use it to update and rearange section order when
importing old courses. Seems stable - but then this is on the site where I developed it.
80 teachers with around 300 courses.
In reply to Julian Ridden

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Thanks. Now I got it. Cool! Well, now I can say THANK YOU Audun, this is a really great feature. It will really save a lot of time and will make working with Moodle even more of a pleasure.

I have a question, is it possible or could it be possible with little additional work to make copies of activities, resources and labels besides moving them around?

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Change the sql below:

$sql = 'SELECT r.id,r.name,c.shortname
FROM '.$CFG->prefix. $thismod->name . ' r
,'.$CFG->prefix.'course c
WHERE r.course = c.id and r.course != '.$course->id.'
AND ( INSTR(r.name,"[PUBLIC_COPY]")
OR r.course IN ('.$mycourseidlist.') ) ORDER BY c.shortname';

Remove the text in red.
Then mods/resources from the course you are editing will show
up in the list of external resources.
If you instead change != to = you will only get resources from the course you are editing.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Audun,

Sorry if I sound like an ignorant (which is what I am in this domain), but was your message an answer to my question? I mean, making the changes you suggest would allow one to copy labels and resources in addition to moving them?

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Well, yes.
Without these changes you can copy in resources/mods from other courses.
With the changes - the list of resources/mods you can copy from will
include resources/mods found in the course you are editing.

This could of course be achieved by using the standard ctrl+drag for copying
that users are accustomed to from other GUIs, but this would be a bit more code ...
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Fawaz Shareef -

Hello Audun,

I installed the layout editor and when I clicked on the layout link I get a set of error messages as follows:

Notice: Use of undefined constant gregoriantojd - assumed 'gregoriantojd' in C:\websites\moodle\course\layout\locallib.php on line 6

Notice: Undefined variable: nodragmoduledivs in C:\websites\moodle\course\layout\layout.php on line 364

Warning: array_merge() [function.array-merge]: Argument #4 is not an array in C:\websites\moodle\course\layout\layout.php on line 364

Warning: implode() [function.implode]: Bad arguments. in C:\websites\moodle\course\layout\layout.php on line 365

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 366

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 366

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 366

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 367

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 367

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 367

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 367

Any idea!!

Fawaz

In reply to Fawaz Shareef

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
You have debug set to ON in your moodle (near the end of variables).
The messages you see are warnings about possibly unsafe code.
In my code I test if 'gregoriantojd' is defined. If it is not defined I
include a definition (some sites haven't got this function loaded).

These warning messages can be turned off if you insert a @ before expressions
that cause them. Edit locallib.php and change line 6 from
    if (!function_exists(gregoriantojd)) {
to
    if (@!function_exists(gregoriantojd)) {

Edit layout.php and change line ~367 from
    $leftlist = implode(',',$leftlist);
    $rightlist = implode(',',$rightlist);
    $modlist = implode(',',$moduledivs);
to
    $leftlist = @implode(',',$leftlist);
    $rightlist = @implode(',',$rightlist);
    $modlist = @implode(',',$moduledivs);

This should remove the warnings

audun
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by John Papaioannou -
Code that emits notices could be good code. Code that does not emit notices is most likely very good code, because the developer has taken the time to ensure that everything goes according to the book always. So it would be preferable if those notices are fixed. smile

Notice: Use of undefined constant gregoriantojd - assumed 'gregoriantojd' in C:\websites\moodle\course\layout\locallib.php on line 6

This happens because the string "gregoriantojd" is not in quotes. Put single quotes around it and the warning goes.

Notice: Undefined variable: nodragmoduledivs in
C:\websites\moodle\course\layout\layout.php on line 364

I haven't looked at the code, but this sounds like a variable being used before being initialized. Solution: initialize the variable, e.g. if it's a string $nodragmoduledivs = '';

Warning: array_merge() [function.array-merge]: Argument #4 is not an array in C:\websites\moodle\course\layout\layout.php on line 364

This sounds more serious, as it is not a notice but a warning.

Warning: implode() [function.implode]: Bad arguments. in C:\websites\moodle\course\layout\layout.php on line 365

Same as above.

Notice: Object of class stdClass to string conversion in C:\websites\moodle\course\layout\layout.php on line 366

This sounds like it will cause a problem. PHP does not complain when it implicitly converts e.g. strings to integers or the reverse, but the string representation of an object is IIRC "Object", which has no meaning at all. Therefore if this happens it indicates either a bug or an operation which is not needed, and that's why PHP brings it to our attention.
In reply to John Papaioannou

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Bitten by a python (I'm used to isfunction(object) ) ...

The errors on line 364 where as you say caused by nodragmoduledivs being uninitialized.  Being unset it was also not an array -- yah.
(hadn't tested on course with no summary for any section).

The next errors are caused by me not checking for changes in block-lib black eye,
a function that used to return array of string, now returns array of objects.
The code was deadwood anyway, should have been removed ...
(the result of merging the objects as strings was never used)

I think I'll keep debug on from now on smile
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
A new version allows duplication of mods in a course by Shift+Click.
Decided against Ctrl + Click as this brings up a context menu on mac.
Shift+Click a mod and a copy is added to the section. The copy can
be moved (or deleted) as original mods.

I'm not sure that sections should have the same behaviour, does anyone need to duplicate a whole section with all mods ?
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by James Robertson -

I see your original zip file and Julian's repackaging of it, but where do I look for this updated version (with various bug fixes)?

Thanks, Jim.

In reply to James Robertson

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Work in progress ...
Fixing bugs and adding shift+click copying (mods and sections).
I`ll post a new zip (bugfixes + new features + separate css) this weekend.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)--REVISIT

by Bhupinder Singh -

Hi Audun,

Yhe module is great.

I am confused where the change in th Ssql ....

is to be done shall be grateful for your help.

Thanks once again

Garry

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Ger Tielemans -

Audun, can you please explain what these icons are on the bottom right and how to handle these?

In reply to Ger Tielemans

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
They give you access to external resources (mods from other courses).
The select is like this:
$sql = 'SELECT r.id,r.name,c.shortname
FROM '.$CFG->prefix. $thismod->name . ' r
,'.$CFG->prefix.'course c
WHERE r.course = c.id and r.course != '.$course->id.'
AND ( INSTR(r.name,"[PUBLIC_COPY]")
OR r.course IN ('.$mycourseidlist.') ) ORDER BY c.shortname';

Thus any course where you are a teacher or any course with [PUBLIC_COPY] in
the name will yield a list of modules.
Each icon contains a list of external resources. To avoid a too heavy
javascript load on loading the page I only show four (max) draggable
divs for each mod-type.
The rest are available thru the drop down list. Selecting an item from the list will
take over the topmost draggable div and update it with the selected item.
This means you'll have to reload the page to copy in more than four items of
the same type (like 5 forums). This doesn't seem unreasonable ....

The icons have the following behavior:
Click once --> move to the left and expand list of available mods
Click again --> collapse and move back to orig pos.
( the code allows you to open more than one on top of each other ... mixed)
You can drag a mod from a list and drop onto a section.
A shallow copy will be made (only top level tabel, no files etc).
  --- exception ---
    lesson is copied in full

You can delete a mod by dropping it on the thrash can.
You can update startdate/starttime by moving a mod to a week and
clicking on the calendar. Click on day/h/m as needed. Click on any timed
mod and they should go all pink (mouseover will show new time).
While in calendar mode you can not move mods/sections.
Click on calendar again to revert to normal mode.

The date is taken from the week you place the mod in + calendar selection.

All of this is a hack that needs some reworking. Espesially the interface
could do with some usability reworking. I just haven't had time ...

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)--REVISIT

by Bhupinder Singh -

A great module Audun.

Can you advise wher the above changes are to be made??

Garry

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Hiroto Kagotani -
Thanks for this great layout editor!

When I use this editor for my UTF-8 course (I'm using ja_utf8), I see all module names are (maybe) urlendode'd like the attached screenshot.  Section titles don't have such a problem.  How can I fix this problem?

Thanks.
Hiroto
Attachment image.PNG
In reply to Hiroto Kagotani

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
This can be fixed if you edit layout.php and change ( line ~380 )
                $modname = substr($m->name,0,10);
to
                $modname = urldecode($m->name);
                $modname = format_string($modname, true,  $course->id);

This is the same code as used in course/lib.php
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
New version with helpfile ready.
This version allows duplication of mods (activities) by Shift+Click.
Also you can choose to show unused sideblocks or available resources for copying. (less cluttered display). You can now insert new sections by Shift+Clicking on a section. Bug in copying of lessons fixed.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

Hi Auden,

I may have missed out.

Can you advise where are the installation /readme file for installation.

I had a look in the folder that you have uploaded I was not there.

Thanks

Garry

In reply to Bhupinder Singh

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
New version with README.
This version expects to be installed into a course/format/xxx directory.
Install into format/weeks or a copy of this directory.
Unzip the layout.zip - the README will tell you the rest.

The animations for sections that drop to the end or float up to the
top are improved. I think these animations are neccessary as the user
needs some feedback telling what happens when a section is dropped
on the left or right side. Without animation the section just disappears and
the user might not notice that it has moved to the top/bottom.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

I was unable to run the application after placing the file / folder.

I must be doing something terribly wrong??

Any suggestions

Garry

In reply to Bhupinder Singh

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Does the link for Rearange Layout show up when you turn editing on?
If you followed the instructions you should be able to choose a new format for the course, unless you made the change to weeks format.
Anyway, check that you have chosen the new format and turn on editing.
You should now see a new link named Rearange Layout (go over to julians playpen to see how it looks, see link above).
If the link shows, check the adress - it should be something like
http://playpen.monte.nsw.edu.au/course/xxx/layout.php?id=23
where xxx is the format you made the changes to, or weeks if you edited that.

If you have checked all the above -
do you get an error when clicking the link?

Give some feedback on this and I think we should be able to get this thing afloat.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Audun,

I went back to Julian's playpen and I saw the label you had created ('This is a label (by audun)'). As you might notice, I was able to move it (now it is in the first block). That is, I was able to visualize it and move it by clicking the link 'rearange layout' without any problem (great!).

However, I'm still unable to visualize the label I created, the one that says 'This is a label'. You can check that yourself and probably find out that you cannot visualize it, either. What I'm noticing, though, is that I introduced some little "extra" formatting to the label I created (I centered it or indented it). Perhaps this is what's causing the problem, the reason why it is not visible in the 'rearange layout' mode?

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
This is the same bug that Hiroto discovered. I was sending the raw text from the table straight to screen. The latest version now uses urldecode and format_strings in the same manner as the moodle code for displaying the course.
The version in Julians playpen hasn't been updated ....
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Julian Ridden -
code has now been updated. Sorry I was a little slow guys smile
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

Hi Audun,

I have been able to get it going.

One small point the movement of items are in an up and down manner. Is is possible to move them between blocks that is in the weekl format.

Is there any way to move a block. It  moves between the outer two columns and does not move into the central  column. The BLOCKS also move up and down in the column in which they are placed..

Garry

In reply to Bhupinder Singh

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Items in a section (activities like quiz,lesson etc) can be dragged and dropped onto any other section. They will end up at the bottom of the pile of items in a section. You can rearange this pile by clicking on any item. The clicked item will drop to the bottom.

Sideblocks can not be placed on the central column. The central column is only for activities. Sideblocks must be either on the right or on the left. There is an extra pile of unused sideblocks at the far right. These can be dragged and dropped on either the left or right side. Sideblocks can be arranged by dragging a block to the desired position and letting go. The other blocks will shift out of the way.

At the top (above the save changes button) there is a drop-down where you can select to show either unused sideblocks (default) or external resources.
The list of external resources is taken from courses where you are a teacher.
The icon used shows the type. Clicking on this icon (perhaps twice the first time) will expand a list of elements that can be copied into your course.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

Hi Audun,

I am not getting the layout editor Any suggestions.

Garry

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Bhupinder Singh -

Hi Audun,

What does the link for layout Editor  look like.

When I turn editing on I get no additional link.

Can you guide me.

Garry 

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Great! Being able to duplicate activities is very useful.

Now, I wonder whether it would be possible to be able to duplicate 'labels' as well as activities. I find myself having to create multiple labels (for instance 'Exercises for Week 1', 'Exercises for Week 2'... up to 10 weeks). Doing this in the way you have to do it now is a bit of a pain. It would be nice if you could just copy and paste labels as well as activities. Is this technically very difficult to implement? I would have thought that copying activities would be much more of a problem.

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
A label created with 'Insert a label' can be copied as any other mod.
Section summaries can't be copied or dragged.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Josep M. Fontana -
Thanks for your answr, Audun,

I tried this in Julian's playpen and the labels don't appear in the layout editor. 

I created a label that says "This is a label" in the 25 September - 1 October week block and when you click the "rearange layout" link it doesn't appear among the activities listed there.

Josep M.
In reply to Josep M. Fontana

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
I tried the same, label added to week 36, moved to 37.
Worked OK. Not sure why it didn´t work for you.
Can you move other mods?

Julians version doesn´t have the code for duplicating mods - it´s really neat smile
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -

Superb. Thank you very much indeed Audun, 

Some very minor niggles...
1) On line 24 of the help file there is
    To:
    /// Start main column
        echo '(td id="middle-column")';
which is missing the semi-colon in red. I have replaced the greater than and less than with brackets.

2) my utf-ja and the playpen are being shown (in IE) bunched up at the top
with the drop down menu overlapping the return to course link.

3) In ja_utf8 I have to reset the encoding to utf8 before it works. Perhaps other moodle pages put a meta tag into themselves to remind the browser of the encoding. Hence perhaps it would be better to include the header in the layout page? That should take care of it.

4) Stuff put in the trash can overlaps the list of blocks on both sides.

5) Often I want to move things beyond the end of the screen. This does not seem to be possible. It would be nice if the wheel of the mouse worked even when dragging.


I very much look forward to the time when this comes as standard.

Timothy

In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -

With regard to (2) above I think that the problem was that my stylesheet (which seems to be being called) was adding a margin at the top, so that the "return to course" and drop down menu and help button were being pushed down to overlap with the blocks and save button.

If the "return to course" drop down menu, and help button are put in a div with an absolute setting then this pushes them to the top of the screen again so they do not overlap.

I think that this div and the div for the submit button should go in the stylesheet, which is where I have put them.

I also think that the main layout area should be put in a div wrapper with a top margin rather than usig top$ = 40; or top$ =70; in layout.php

The version that I have going is attached.

In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
Thanks for nailing those bugs.
You can move the trash before dropping stuff into it. Clicking on the can will also minimize the contents.
You should be able to drag things beyond the screen. All mods and sections have the property SCROLL set. If you drag a mod towards the edge of the screen the window should scroll automagically.
I'll have a look at including the header (think I did once, but took it away as it added a bit more stuff than I wanted).
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -

Thank you Audun,

Yes, sorry, I realise now that while the scroll wheel does not work, putting things near the edge of the screen gets it to scroll dow.
I did not know that the trash can can be moved.

I am not sure about the header. I added it but I would have to have moved
everything down the page, and it takes up a lot of real estate. I wonder if there is a way of just including the character set meta tag. Anyway this is only a problem for a minority of users, and changing the encoding manually worked.

This is going to save me hours. I paid moodle trust a mere $100 in gratitude for this but if I have some more money I will contribute again. Honestly this is a godsend.

Tim

In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by John Ryan -
Audun,

This is brilliant and solves many problems that I have at the moment.

I found a small bug when I installed it on my test server (runnning the latest 1.5.2+ downloaded earlier tonight).

One of the resources I had was a word document called "AS_Comp_test_xmas_2004_Mark_Scheme" and when I selected "Rearrange layout" everything appeared as expected except for this one resource.  The icon appeared for the resource but the name was blank.  When I renamed it without the underscores it worked correctly. When I put the underscores back the problem reoccured.  This was the only resource in which underscores appeared in teh name.

The file was .  Strangely when I left only the underscore between AS and Comp it didn't mind.

Thanks

John Ryan
In reply to John Ryan

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
If you edit layout.css and add
white-space:nowrap;
to div.module

/* course content */
    div.module {
        white-space:nowrap;
        border:1px solid #000099;
        height:16px;
        left:187px;
        background:#aaaa30;
        layer-background-color:#aaaa30;
    }

The label was '&nbsp;  asd_wer_wer_wer_wer_ertert_werwer'
The div was set to have overflow hidden, the browser breaks the label on the space before the label ==> no visible label text.
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Petr Kalis -
Hi
Wonderful stuff, im little bit confused about how to use it, but making some tests already. Does anybody made some help, some tutorial how to use this editor?
Its there any possibility to copy whole topic from one of my courses at once? Or i have to place one resource after another?
Anyway, great work, thx Audunbig grin
Petr
In reply to Petr Kalis

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -
You can move sections aroudn within a course, but I don't think that there is a way of moving a secont/topic from another course.

It would be nice to be able to move several activities at once too.

I use this all the time and with a lot of activities (see image)!

lots of activities in Audun's trash can
In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Audun Hauge -
You can use the trashcan for moving lots of activities.
Place them into trash, drag the can along, pull them out of the can and drop on the new destination. Also the list in trash can be made smaller by clicking on the trash icon ( seems you´ve done this in the snapshot).
Are  you really about to trash all those activities? wide eyes
In reply to Audun Hauge

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -
Sorry I did not reply. Thanks for the tip about using the trash can to move things. Yes I was about to trash all the things in the trash can above. I can't remember why now.

I am posting to say thanks again because now at the beginning of a new term, this block once again saved me a lot of time. Thank you. I hope that the layout editor continues.

Tim
In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -

And just to confirm that it does work in 1.6. I have just installed in 1.6 and it worked like a dream (when i used the version attached to my post above "layout2.zip")

Tim

In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Timothy Takemoto -

I can't seem to find where I posted layout2.zip so I have posted it here.

Tim

In reply to Timothy Takemoto

Re: A layout editor for 1.5 (also 1.6)

by Bruno Vernier -
thank you very much, Timothy

I was able to use it to create a more formal package and store it in a more standard location

http://moodle.org/mod/data/view.php?d=13&rid=491

p.s. I made tiny changes to allow easier installation:
the code is stored into course/layout and so i changed the URLs calling up config.php and layout.php in a couple of places
In reply to Bruno Vernier

Re: A layout editor for 1.5 (also 1.6)

by Miroslav Fikar -
Hi Bruno,
you may consider to put meta tag about charset to layout.php, so it works also with non-english pages. It helped to me to add to line 496 something like:

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
In reply to Miroslav Fikar

Re: A layout editor for 1.5 (also 1.6)

by Bruno Vernier -
thanks for the patch, Miroslav

I included it and uploaded it to the modules and plugins area (and credited you in the README) smile
In reply to Bruno Vernier

Re: A layout editor for 1.5 (also 1.6)

by Ruth Cheesley -
Any news on if this is going to be available for 2.x?