Ok guys, somehow I managed to solve my problem :D
In case anyone else have the same need that I did, here is the solution:
On Moodle 2.5, open the file course/format/weeks/lib.php, at line 53, find the code:
public function get_section_name($section) {
$section = $this->get_section($section);
if ((string)$section->name !== '') {
// Return the name the user set.
return format_string($section->name, true, array('context' => context_course::instance($this->courseid)));
} else if ($section->section == 0) {
// Return the general section.
return get_string('section0name', 'format_weeks');
} else {
$dates = $this->get_section_dates($section);
// We subtract 24 hours for display purposes.
$dates->end = ($dates->end - 86400);
$dateformat = get_string('strftimedateshort');
$weekday = userdate($dates->start, $dateformat);
$endweekday = userdate($dates->end, $dateformat);
return $weekday.' - '.$endweekday;
}
}
And bring the $dates=$this... to the first IF, and then edit it the way you like. After the customization, my code looks like this:
public function get_section_name($section) {
$section = $this->get_section($section);
if ((string)$section->name !== '') {
// Return the name the user set.
// TESTING TO INCLUDE THE AUTOMATIC DATES WITH THE SECTION NAME
$dates = $this->get_section_dates($section);
// We subtract 24 hours for display purposes.
$dates->end = ($dates->end - 86400);
$dateformat = get_string('strftimedateshort');
$weekday = userdate($dates->start, $dateformat);
$endweekday = userdate($dates->end, $dateformat);
return '<span class="dateSection">'.$weekday.' a '.$endweekday.'</span>'.format_string($section->name, true, array('context' => context_course::instance($this->courseid)));
// END OF TEST
//return format_string($section->name, true, array('context' => context_course::instance($this->courseid)));
} else if ($section->section == 0) {
// Return the general section.
return get_string('section0name', 'format_weeks');
} else {
$dates = $this->get_section_dates($section);
// We subtract 24 hours for display purposes.
$dates->end = ($dates->end - 86400);
$dateformat = get_string('strftimedateshort');
$weekday = userdate($dates->start, $dateformat);
$endweekday = userdate($dates->end, $dateformat);
return $weekday.' - '.$endweekday;
}
}
With this, if you use de Default Name, it will only display the dates, and if you use a Section Name, it will display the Dates + Section Name. See the image attached to see the result (ps: the position and style I changed with CSS).
Thanks for all the posts in the forum, it was with them that I managed to find some tips to my solution.