This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
forked from brum1975/moodle-filter_oembed
-
Notifications
You must be signed in to change notification settings - Fork 13
/
settings.php
71 lines (65 loc) · 3.73 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// This file is part of Moodle-oembed-Filter
//
// Moodle-oembed-Filter is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle-oembed-Filter is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle-oembed-Filter. If not, see <http://www.gnu.org/licenses/>.
/**
* Filter for component 'filter_oembed'
*
* @package filter_oembed
* @copyright 2012 Matthew Cannings, Sandwell College; modified 2015 by Microsoft, Inc.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* code based on the following filters...
* Screencast (Mark Schall)
* Soundcloud (Troy Williams)
*/
defined('MOODLE_INTERNAL') || die;
require_once(__DIR__.'/filter.php');
if ($ADMIN->fulltree) {
$torf = array('1' => new lang_string('yes'), '0' => new lang_string('no'));
$item = new admin_setting_configselect('filter_oembed/youtube', new lang_string('youtube', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/vimeo', new lang_string('vimeo', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/ted', new lang_string('ted', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/slideshare', new lang_string('slideshare', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/officemix', new lang_string('officemix', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/issuu', new lang_string('issuu', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/soundcloud', new lang_string('soundcloud', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/pollev', new lang_string('pollev', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/o365video', new lang_string('o365video', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
$item = new admin_setting_configselect('filter_oembed/sway', new lang_string('sway', 'filter_oembed'), '', 1, $torf);
$settings->add($item);
// New provider method.
$providers = \filter_oembed::get_supported_providers();
foreach ($providers as $provider) {
$enabledkey = 'provider_'.$provider.'_enabled';
$name = new lang_string('provider_'.$provider, 'filter_oembed');
$item = new \admin_setting_configselect('filter_oembed/'.$enabledkey, $name, '', 1, $torf);
$settings->add($item);
}
$item = new admin_setting_configcheckbox('filter_oembed/lazyload', new lang_string('lazyload', 'filter_oembed'), '', 0);
$settings->add($item);
$retrylist = array('0' => new lang_string('none'), '1' => new lang_string('once', 'filter_oembed'),
'2' => new lang_string('times', 'filter_oembed', '2'),
'3' => new lang_string('times', 'filter_oembed', '3'));
$item = new admin_setting_configselect('filter_oembed/retrylimit', new lang_string('retrylimit', 'filter_oembed'), '', '1', $retrylist);
$settings->add($item);
}