Skip to content
Snippets Groups Projects
Commit d06a34e8 authored by DELARUELLE Myriam's avatar DELARUELLE Myriam
Browse files

fix moodle44

parent 9c9086df
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class content extends content_base {
*/
public function export_for_template(\renderer_base $output) {
global $CFG, $COURSE, $USER;
$data=parent::export_for_template($output);
//$section_entity = new course_format_iena_sections();
......
......@@ -23,57 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
M.course = M.course || {};
M.course.format = M.course.format || {};
M.course.format.get_config = function() {
return {
container_node: 'ul',
container_class: 'buttons',
section_node: 'li',
section_class: 'section'
};
};
M.course.format.swap_sections = function(Y, node1, node2) {
var CSS = {
COURSECONTENT: 'course-content',
SECTIONADDMENUS: 'section_add_menus'
};
var sectionlist = Y.Node.all('.' + CSS.COURSECONTENT + ' ' + M.course.format.get_section_selector(Y));
// Swap the non-ajax menus, noting these are not always present (depends on theme and user prefs).
if (sectionlist.item(node1).one('.' + CSS.SECTIONADDMENUS)) {
sectionlist.item(node1).one('.' + CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.' + CSS.SECTIONADDMENUS));
}
};
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
var CSS = {
SECTIONNAME: 'sectionname'
},
SELECTORS = {
SECTIONLEFTSIDE: '.left .section-handle img'
};
if (response.action == 'move') {
if (sectionfrom > sectionto) {
var temp = sectionto;
sectionto = sectionfrom;
sectionfrom = temp;
}
var ele, str, stridx, newstr;
for (var i = sectionfrom; i <= sectionto; i++) {
var content = Y.Node.create('<span>' + response.sectiontitles[i] + '</span>');
sectionlist.item(i).all('.' + CSS.SECTIONNAME).setHTML(content);
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx + 1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr);
}
}
};
(function () {
$(".iena-description .description-inner").each(function(index){
......
......@@ -41,29 +41,6 @@ require_once($CFG->libdir . '/completionlib.php');
$PAGE->requires->js('/course/format/iena/js/jquery.min.js');
$PAGE->requires->js('/course/format/iena/format.js');
/*if ($topic = optional_param('topic', 0, PARAM_INT)) {
$url = $PAGE->url;
$url->param('section', $topic);
debugging('Outdated topic param passed to course/view.php', DEBUG_DEVELOPER);
redirect($url);
}
$context = context_course::instance($course->id);
if (($marker >= 0) && has_capability('moodle/course:setcurrentsection', $context) && confirm_sesskey()) {
$course->marker = $marker;
course_set_marker($course->id, $marker);
}
$course = course_get_format($course)->get_course();
course_create_sections_if_missing($course, 0);
$renderer = $PAGE->get_renderer('format_iena');
if (!empty($displaysection)) {
$renderer->print_single_section_page($course, null, null, null, null, $displaysection);
} else {
$renderer->switch_mode($course);
}*/
// Horrible backwards compatible parameter aliasing.
if ($topic = optional_param('topic', 0, PARAM_INT)) {
......@@ -89,8 +66,8 @@ if (($marker >= 0) && has_capability('moodle/course:setcurrentsection', $context
course_create_sections_if_missing($course, 0);
$renderer = $PAGE->get_renderer('format_iena');
if (!empty($displaysection)) {
$format->set_section_number($displaysection);
if (!is_null($displaysection)) {
$format->set_sectionnum($displaysection);
}
$outputclass = $format->get_output_classname('content');
$widget = new $outputclass($format);
......
......@@ -36,6 +36,7 @@ class format_iena extends format_topics {
global $PAGE;
static $courseformatoptions = false;
if ($courseformatoptions === false) {
$courseformatoptions=array();
$courseformatoptions['allmodulesbreadcrum'] = array(
'default' => 0,
'type' => PARAM_INT,
......@@ -341,7 +342,10 @@ class format_iena extends format_topics {
$url->param('section', $sectionno);
} else {
if (empty($CFG->linkcoursesections) && !empty($options['navigation'])) {
return null;
$sectioninfo = $this->get_section($sectionno);
//return new moodle_url('/course/section.php', ['id' => $sectioninfo->id]);
$url->set_anchor('section-' . $sectionno);
return $url;
}
$url->set_anchor('section-' . $sectionno);
}
......
......@@ -21,7 +21,6 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/course/format/topics/renderer.php');
/**
* format_iena_renderer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment