Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 161... Línea 161...
161
     * @param core $core The \core_h5p\core object
161
     * @param core $core The \core_h5p\core object
162
     * @param int $displayint integer value representing display options
162
     * @param int $displayint integer value representing display options
163
     *
163
     *
164
     * @return int The representation of display options as int
164
     * @return int The representation of display options as int
165
     */
165
     */
166
    public static function decode_display_options(core $core, int $displayint = null): \stdClass {
166
    public static function decode_display_options(core $core, ?int $displayint = null): \stdClass {
167
        $config = new \stdClass();
167
        $config = new \stdClass();
168
        if ($displayint === null) {
168
        if ($displayint === null) {
169
            $displayint = self::get_display_options($core, $config);
169
            $displayint = self::get_display_options($core, $config);
170
        }
170
        }
171
        $displayarray = $core->getDisplayOptionsForEdit($displayint);
171
        $displayarray = $core->getDisplayOptionsForEdit($displayint);
Línea 230... Línea 230...
230
     * @param  int   $userid  The author of the file
230
     * @param  int   $userid  The author of the file
231
     * @param  \context $context The context where the file will be created
231
     * @param  \context $context The context where the file will be created
232
     * @return \stored_file The file created
232
     * @return \stored_file The file created
233
     */
233
     */
234
    public static function create_fake_stored_file_from_path(string $filepath, int $userid = 0,
234
    public static function create_fake_stored_file_from_path(string $filepath, int $userid = 0,
235
            \context $context = null): \stored_file {
235
            ?\context $context = null): \stored_file {
236
        if (is_null($context)) {
236
        if (is_null($context)) {
237
            $context = context_system::instance();
237
            $context = context_system::instance();
238
        }
238
        }
239
        $filerecord = [
239
        $filerecord = [
240
            'contextid' => $context->id,
240
            'contextid' => $context->id,
Línea 259... Línea 259...
259
     */
259
     */
260
    public static function get_h5p_tools_info(): array {
260
    public static function get_h5p_tools_info(): array {
261
        $tools = array();
261
        $tools = array();
Línea 262... Línea 262...
262
 
262
 
263
        // Getting information from available H5P tools one by one because their enabled/disabled options are totally different.
-
 
264
        // Check the atto button status.
-
 
265
        $link = \editor_atto\plugininfo\atto::get_manage_url();
-
 
266
        $status = strpos(get_config('editor_atto', 'toolbar'), 'h5p') > -1;
-
 
267
        $tools[] = self::convert_info_into_array('atto_h5p', $link, $status);
-
 
268
 
263
        // Getting information from available H5P tools one by one because their enabled/disabled options are totally different.
269
        // Check the Display H5P filter status.
264
        // Check the Display H5P filter status.
270
        $link = \core\plugininfo\filter::get_manage_url();
265
        $link = \core\plugininfo\filter::get_manage_url();
271
        $status = filter_get_active_state('displayh5p', context_system::instance()->id);
266
        $status = filter_get_active_state('displayh5p', context_system::instance()->id);
Línea 474... Línea 469...
474
     * @param  string $exportfilename The H5P export filename (with slug).
469
     * @param  string $exportfilename The H5P export filename (with slug).
475
     * @param  \moodle_url $url The URL of the exported file.
470
     * @param  \moodle_url $url The URL of the exported file.
476
     * @param  factory $factory The \core_h5p\factory object
471
     * @param  factory $factory The \core_h5p\factory object
477
     * @return array|null The information export file otherwise null.
472
     * @return array|null The information export file otherwise null.
478
     */
473
     */
479
    public static function get_export_info(string $exportfilename, \moodle_url $url = null, ?factory $factory = null): ?array {
474
    public static function get_export_info(string $exportfilename, ?\moodle_url $url = null, ?factory $factory = null): ?array {
Línea 480... Línea 475...
480
 
475
 
481
        if (!$factory) {
476
        if (!$factory) {
482
            $factory = new factory();
477
            $factory = new factory();
483
        }
478
        }