The blocks available are great: so far I'm using the Login/Logout block, View Certificates block and My Courses block. These are all very cool sticky block plugins that one can add in easily. See the modules & plugins page for the details. Thank you to to the folks who contributed those!
What has been hard for me to figure out is how to add things like "Date course last accessed" and a progress bar or at least a "Grade/Status" listing. Of course this info lives in other places in Moodle, I just need to know how I can aggregate the data into the My Moodle course list and also format the list a bit.
See my mock-up below.
Looking forward to any info you can provide. Thanks Moodlers.

The key function that prints your course listings in the myMoodle page is called print_overview and you'll find it in course/lib.php. There are hooks for blocks and modules to send this function information automatically to be included.
I'm not aware of a hook for grades, or for course last accessed ($course->lastaccessed). These you might need to add for yourself.
The Certificate module I don't think supports myMoodle yet either - it could do by adding a print_overview function in mod/certificate/lib.php. This would need to control whether the current user has access to their certificate or not yet, and output appropriate text in the right format (I've done it for other modules and just copied from existing print_overview functions!!)

I was sure it would be some coding but I really had no clue where to start. You have given me the info I needed.
Re: My Moodle: Formatting course details in My Moodle
Not very orthodox but it works
Edit /course/lib.php
In print_overview function ($courses) locate these lines: | And replace it with this: |
foreach ($ courses as $ course) ( print_simple_box_start ( 'center', '100% ','', 5, "coursebox"); $ linkcss =''; if (empty ($ course-> visible)) ( $ linkcss = 'class = "dimmed"'; ) print_heading ('...'); |
foreach ($courses as $course) ( print_heading('<a title="'. format_string($category->name).'" href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a> <a title="'. format_string($course->fullname).'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a><br>'.format_time(time() - $course->lastaccess).' ('.userdate($course->lastaccess, get_string('strftimerecentfull')).')'); /font>/font>if (array_key_exists ($ course-> id, $ htmlarray)) ( |
Before showing the latest from the forums or tasks, will show in my courses (and therefore in my moodle) Category, Course, Date of last access and how long ago the last access.
/span>
Re: My Moodle: Formatting course details in My Moodle
// Get course categories
$category = get_record("course_categories", "id", $course->category);
// Get course grade_item
require_once $CFG->dirroot.'/grade/report/overview/lib.php';
$grade_item = grade_item::fetch_course_item($course->id);
// Get the grade
$grade = new grade_grade(array('itemid'=>$grade_item->id, 'userid'=>$USER->id));
$grade->grade_item =& $grade_item;
$display_final_grade = grade_format_gradevalue($grade->finalgrade, $grade_item, true);
$display_final_grade = ' - '.$display_final_grade;
print_heading('<a title="'. format_string($course->fullname).'" '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a><br><a title="Categoría: '. format_string($category->name).'" href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a><br> '.userdate($course->lastaccess, get_string('strftimerecentfull')).'<br>'.format_time(time() - $course->lastaccess).'<br>'. format_string($display_final_grade).'');

Re: My Moodle: Formatting course details in My Moodle
Re: My Moodle: Formatting course details in My Moodle
Hi all,
Did anybody achived this in 2.2?
Re: My Moodle: Formatting course details in My Moodle
but always as blocks ...