$THEME->layouts = 'messages' ??

$THEME->layouts = 'messages' ??

by Stuart Lamour -
Number of replies: 7
Picture of Plugin developers

Can you actually do this ?

'messages' => array(
'file' => 'messages.php',
'regions' => array(),
)

http://docs.moodle.org/dev/Themes_overview says no.

Oddley messages seem to be inheriting from

// Main course page.
'course' => array

But messages are obviously not a course.

Anyone know how to fix this?

 

 

 

 

Average of ratings: -
In reply to Stuart Lamour

Re: $THEME->layouts = 'messages' ??

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Not at the moment as 'messages' is not listed on http://docs.moodle.org/dev/Themes_overview#The_different_layouts_as_of_21st_April_2013.

However, should be conceptually possible to add a new one in the PHP that generates the page with:

$PAGE->set_pagelayout('messages');

And that I assume sparks it all off to the $THEME->layouts array you have in 'config.php' etc.

In reply to Gareth J Barnard

Re: $THEME->layouts = 'messages' ??

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

'/message/index.php' has this:

if (substr($viewing, 0, 7) == MESSAGE_VIEW_COURSE) {
    $courseid = intval(substr($viewing, 7));
    require_login($courseid);
    require_capability('moodle/course:viewparticipants', context_course::instance($courseid));
    $PAGE->set_pagelayout('incourse');
} else {
    $PAGE->set_pagelayout('course');
    $PAGE->set_context(context_user::instance($user1->id));
}

So I assume that's the ball park to play in.

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: $THEME->layouts = 'messages' ??

by Stuart Lamour -
Picture of Plugin developers

wow, its actually setting it to course.

mind boggles...

In reply to Stuart Lamour

Re: $THEME->layouts = 'messages' ??

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Not exactly, what it means is that you can create a course.php and customise it, so that when it is used as a message page it will display as you want it to.

You would then change the $THEME->layouts = array() for 'course in the config.php to use course.php instead of general.php or columns3.php or whatever name of the file is currenly being set in your theme...

//Example only

    'course' => array(
        'file' => 'myhumptydumptycoursepage.php',
        'regions' => array('side-jack', 'side-jill'),
        'defaultregion' => 'side-jill',
        'options' => array('langmenu'=>true),
    ),

Anything goes in Moodle smile

In reply to Mary Evans

Re: $THEME->layouts = 'messages' ??

by Stuart Lamour -
Picture of Plugin developers

thanks mary - i have a myhumptydumptycoursepage.php smile

its a layout file for courses.

Its not a layout file for messages though...

for that i wanted to use myhumptydumptymessagepage.php

naming convention of kings smile

 

 

In reply to Stuart Lamour

Re: $THEME->layouts = 'messages' ??

by Stuart Lamour -
Picture of Plugin developers

also forgot how old fashion and un-user friendly the moodle messaging system is.

anyone know if there are plans to update it?