Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 47... Línea 47...
47
 
47
 
48
    /** @var course_format the course format */
48
    /** @var course_format the course format */
Línea 49... Línea 49...
49
    protected $format;
49
    protected $format;
50
 
50
 
Línea 51... Línea 51...
51
    /** @var section_info the section object */
51
    /** @var section_info the section object */
52
    private $section;
52
    protected $section;
Línea 53... Línea 53...
53
 
53
 
Línea 121... Línea 121...
121
            'textclasses' => $displayoptions['textclasses'],
121
            'textclasses' => $displayoptions['textclasses'],
122
            'classlist' => [],
122
            'classlist' => [],
123
            'cmid' => $mod->id,
123
            'cmid' => $mod->id,
124
            'editing' => $PAGE->user_is_editing(),
124
            'editing' => $PAGE->user_is_editing(),
125
            'sectionnum' => $this->section->section,
125
            'sectionnum' => $this->section->section,
-
 
126
            'cmbulk' => !$mod->get_delegated_section_info(),
126
        ];
127
        ];
Línea 127... Línea 128...
127
 
128
 
128
        // Add partial data segments.
129
        // Add partial data segments.
129
        $haspartials = [];
130
        $haspartials = [];
Línea 133... Línea 134...
133
        $haspartials['completion'] = $this->add_completion_data($data, $output);
134
        $haspartials['completion'] = $this->add_completion_data($data, $output);
134
        $haspartials['dates'] = $this->add_dates_data($data, $output);
135
        $haspartials['dates'] = $this->add_dates_data($data, $output);
135
        $haspartials['editor'] = $this->add_editor_data($data, $output);
136
        $haspartials['editor'] = $this->add_editor_data($data, $output);
136
        $haspartials['groupmode'] = $this->add_groupmode_data($data, $output);
137
        $haspartials['groupmode'] = $this->add_groupmode_data($data, $output);
137
        $haspartials['visibility'] = $this->add_visibility_data($data, $output);
138
        $haspartials['visibility'] = $this->add_visibility_data($data, $output);
-
 
139
        $this->add_actvitychooserbutton_data($data, $output);
138
        $this->add_format_data($data, $haspartials, $output);
140
        $this->add_format_data($data, $haspartials, $output);
Línea 139... Línea 141...
139
 
141
 
140
        // Calculated fields.
142
        // Calculated fields.
141
        if (!empty($data->url)) {
143
        if (!empty($data->url)) {
Línea 183... Línea 185...
183
            $this->section,
185
            $this->section,
184
            $this->mod,
186
            $this->mod,
185
            $this->displayoptions
187
            $this->displayoptions
186
        );
188
        );
187
        $modavailability = $availability->export_for_template($output);
189
        $modavailability = $availability->export_for_template($output);
188
        $data->modavailability = $modavailability;
190
        $data->modavailability = $modavailability ?? false;
189
        return $availability->has_availability($output);
191
        return $availability->has_availability($output);
190
    }
192
    }
Línea 191... Línea 193...
191
 
193
 
192
    /**
194
    /**
Línea 317... Línea 319...
317
            $this->format,
319
            $this->format,
318
            $this->section,
320
            $this->section,
319
            $this->mod,
321
            $this->mod,
320
            $this->displayoptions
322
            $this->displayoptions
321
        );
323
        );
322
        $data->controlmenu = $controlmenu->export_for_template($output);
324
        $data->controlmenu = $controlmenu->export_for_template($output) ?? false;
-
 
325
 
323
        if (!$this->format->supports_components()) {
326
        if (!$this->format->supports_components()) {
324
            // Add the legacy YUI move link.
327
            // Add the legacy YUI move link.
325
            $data->moveicon = course_get_cm_move($this->mod, $returnsection);
328
            $data->moveicon = course_get_cm_move($this->mod, $returnsection);
326
        }
329
        }
327
        return true;
330
        return true;
Línea 348... Línea 351...
348
     * @return bool if the cm has visibility data
351
     * @return bool if the cm has visibility data
349
     */
352
     */
350
    protected function add_visibility_data(stdClass &$data, renderer_base $output): bool {
353
    protected function add_visibility_data(stdClass &$data, renderer_base $output): bool {
351
        $visibility = new $this->visibilityclass($this->format, $this->section, $this->mod);
354
        $visibility = new $this->visibilityclass($this->format, $this->section, $this->mod);
352
        $templatedata = $visibility->export_for_template($output);
355
        $templatedata = $visibility->export_for_template($output);
-
 
356
        $data->visibility = $templatedata ?? false;
353
        if ($templatedata) {
357
        if ($templatedata) {
354
            $data->visibility = $templatedata;
-
 
355
            return true;
358
            return true;
356
        }
359
        }
357
        return false;
360
        return false;
358
    }
361
    }
Línea 359... Línea 362...
359
 
362
 
-
 
363
    /**
-
 
364
     * Add the activity chooser button data to the data structure.
-
 
365
     *
-
 
366
     * @param stdClass $data the current cm data reference
-
 
367
     * @param renderer_base $output typically, the renderer that's calling this function
-
 
368
     */
-
 
369
    protected function add_actvitychooserbutton_data(stdClass &$data, renderer_base $output): void {
-
 
370
        $activitychooserbutton = new \core_course\output\activitychooserbutton($this->section, $this->mod);
-
 
371
        $data->activitychooserbutton = $activitychooserbutton->export_for_template($output);
-
 
372
    }
-
 
373
 
360
    /**
374
    /**
361
     * Returns the CSS classes for the activity name/content
375
     * Returns the CSS classes for the activity name/content
362
     *
376
     *
363
     */
377
     */
364
    protected function load_classes() {
378
    protected function load_classes() {