Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 127... Línea 127...
127
    public function get_config_for_external() {
127
    public function get_config_for_external() {
128
        // Return everything (nothing to hide).
128
        // Return everything (nothing to hide).
129
        return $this->get_format_options();
129
        return $this->get_format_options();
130
    }
130
    }
Línea 131... Línea -...
131
 
-
 
132
    /**
-
 
133
     * Returns the information about the ajax support in the given source format.
-
 
134
     *
-
 
135
     * The returned object's property (boolean)capable indicates that
-
 
136
     * the course format supports Moodle course ajax features.
-
 
137
     *
131
 
138
     * @return stdClass
-
 
139
     */
132
    #[\Override]
-
 
133
    public function supports_ajax() {
-
 
134
        // All home page is rendered in the backend, we only need an ajax editor components in edit mode.
-
 
135
        // This will also prevent redirectng to the login page when a guest tries to access the site,
140
    public function supports_ajax() {
136
        // and will make the home page loading faster.
141
        $ajaxsupport = new stdClass();
137
        $ajaxsupport = new stdClass();
142
        $ajaxsupport->capable = true;
138
        $ajaxsupport->capable = $this->show_editor();
143
        return $ajaxsupport;
139
        return $ajaxsupport;
Línea -... Línea 140...
-
 
140
    }
-
 
141
 
-
 
142
    #[\Override]
-
 
143
    public function supports_components() {
-
 
144
        return true;
-
 
145
    }
-
 
146
 
-
 
147
    #[\Override]
-
 
148
    public function uses_sections() {
-
 
149
        return true;
-
 
150
    }
-
 
151
 
-
 
152
    #[\Override]
-
 
153
    public function get_section_name($section) {
-
 
154
        $section = $this->get_section($section);
-
 
155
        if ($section->is_delegated()) {
-
 
156
            return $section->name;
-
 
157
        }
-
 
158
        // Social format only uses one section inside the social activities block.
-
 
159
        return get_string('socialactivities', 'format_social');
-
 
160
    }
-
 
161
 
-
 
162
    /**
-
 
163
     * Social format uses only section 0.
-
 
164
     *
-
 
165
     * @return int
-
 
166
     */
-
 
167
    #[\Override]
-
 
168
    public function get_sectionnum(): int {
-
 
169
        return 0;
-
 
170
    }
-
 
171
 
-
 
172
    /**
-
 
173
     * Returns if a specific section is visible to the current user.
-
 
174
     *
-
 
175
     * Formats can override this method to implement any special section logic.
-
 
176
     * Social format does not use any other sections than section 0 and
-
 
177
     * used this method to hide all other sections from the Move section activity.
-
 
178
     *
-
 
179
     * @param section_info $section the section modinfo
-
 
180
     * @return bool;
-
 
181
     */
-
 
182
    #[\Override]
-
 
183
    public function is_section_visible(section_info $section): bool {
-
 
184
        $visible = parent::is_section_visible($section);
-
 
185
        // Social format does only use section 0 as a normal section.
-
 
186
        // Any other included section should be a delegated one (subsections).
144
    }
187
        return $visible && ($section->sectionnum == 0 || $section->is_delegated());