| Línea 53... |
Línea 53... |
| 53 |
protected $displayoptions;
|
53 |
protected $displayoptions;
|
| Línea 54... |
Línea 54... |
| 54 |
|
54 |
|
| 55 |
/** @var string the item output class name */
|
55 |
/** @var string the item output class name */
|
| Línea -... |
Línea 56... |
| - |
|
56 |
protected $itemclass;
|
| 56 |
protected $itemclass;
|
57 |
|
| 57 |
|
58 |
// TODO remove movehereclass as part of MDL-83530.
|
| Línea 58... |
Línea 59... |
| 58 |
/** @var optional move here output class */
|
59 |
/** @var optional move here output class */
|
| 59 |
protected $movehereclass;
|
60 |
protected $movehereclass;
|
| Línea 90... |
Línea 91... |
| 90 |
$user = $USER;
|
91 |
$user = $USER;
|
| Línea 91... |
Línea 92... |
| 91 |
|
92 |
|
| 92 |
$data = new stdClass();
|
93 |
$data = new stdClass();
|
| Línea 93... |
Línea -... |
| 93 |
$data->cms = [];
|
- |
|
| 94 |
|
94 |
$data->cms = [];
|
| 95 |
// By default, non-ajax controls are disabled but in some places like the frontpage
|
- |
|
| 96 |
// it is necessary to display them. This is a temporal solution while JS is still
|
95 |
|
| 97 |
// optional for course editing.
|
- |
|
| 98 |
$showmovehere = ismoving($course->id);
|
96 |
// TODO remove showmovehere and the if clause as part of MDL-83530.
|
| - |
|
97 |
$showmovehere = ismoving($course->id);
|
| - |
|
98 |
if ($showmovehere) {
|
| - |
|
99 |
// By default, non-ajax controls are disabled but in some places like the frontpage
|
| 99 |
|
100 |
// it is necessary to display them. This is a temporal solution while JS is still
|
| 100 |
if ($showmovehere) {
|
101 |
// optional for course editing.
|
| 101 |
$data->hascms = true;
|
102 |
$data->hascms = true;
|
| 102 |
$data->showmovehere = true;
|
103 |
$data->showmovehere = true;
|
| 103 |
$data->strmovefull = strip_tags(get_string("movefull", "", "'$user->activitycopyname'"));
|
104 |
$data->strmovefull = strip_tags(get_string("movefull", "", "'$user->activitycopyname'"));
|
| Línea 110... |
Línea 111... |
| 110 |
return $data;
|
111 |
return $data;
|
| 111 |
}
|
112 |
}
|
| Línea 112... |
Línea 113... |
| 112 |
|
113 |
|
| 113 |
foreach ($modinfo->sections[$section->section] as $modnumber) {
|
114 |
foreach ($modinfo->sections[$section->section] as $modnumber) {
|
| 114 |
$mod = $modinfo->cms[$modnumber];
|
115 |
$mod = $modinfo->cms[$modnumber];
|
| 115 |
// If the old non-ajax move is necessary, we do not print the selected cm.
|
116 |
// TODO remove this if as part of MDL-83530.
|
| - |
|
117 |
if ($showmovehere && $USER->activitycopy == $mod->id) {
|
| 116 |
if ($showmovehere && $USER->activitycopy == $mod->id) {
|
118 |
// If the old non-ajax move is necessary, we do not print the selected cm.
|
| 117 |
continue;
|
119 |
continue;
|
| 118 |
}
|
120 |
}
|
| 119 |
if ($mod->is_visible_on_course_page()) {
|
121 |
if ($mod->is_visible_on_course_page() && $mod->is_of_type_that_can_display()) {
|
| 120 |
$item = new $this->itemclass($format, $section, $mod, $this->displayoptions);
|
122 |
$item = new $this->itemclass($format, $section, $mod, $this->displayoptions);
|
| 121 |
$data->cms[] = (object)[
|
123 |
$data->cms[] = (object)[
|
| 122 |
'cmitem' => $item->export_for_template($output),
|
124 |
'cmitem' => $item->export_for_template($output),
|
| 123 |
'moveurl' => new moodle_url('/course/mod.php', array('moveto' => $modnumber, 'sesskey' => sesskey())),
|
125 |
'moveurl' => new moodle_url('/course/mod.php', array('moveto' => $modnumber, 'sesskey' => sesskey())),
|