| 1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Atto text editor integration version file.
|
|
|
19 |
*
|
|
|
20 |
* @package atto_media
|
|
|
21 |
* @copyright 2013 Damyon Wiese <damyon@moodle.com>
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* Initialise the js strings required for this plugin
|
|
|
27 |
*/
|
|
|
28 |
function atto_media_strings_for_js() {
|
|
|
29 |
global $PAGE;
|
|
|
30 |
|
|
|
31 |
$PAGE->requires->strings_for_js(array('add',
|
|
|
32 |
'addcaptionstrack',
|
|
|
33 |
'addchapterstrack',
|
|
|
34 |
'adddescriptionstrack',
|
|
|
35 |
'addmetadatatrack',
|
|
|
36 |
'addsource',
|
|
|
37 |
'addsubtitlestrack',
|
|
|
38 |
'addtrack',
|
|
|
39 |
'advancedsettings',
|
|
|
40 |
'audio',
|
|
|
41 |
'audiosourcelabel',
|
|
|
42 |
'autoplay',
|
|
|
43 |
'browserepositories',
|
|
|
44 |
'browserepositories',
|
|
|
45 |
'captions',
|
|
|
46 |
'captionssourcelabel',
|
|
|
47 |
'chapters',
|
|
|
48 |
'chapterssourcelabel',
|
|
|
49 |
'controls',
|
|
|
50 |
'createmedia',
|
|
|
51 |
'default',
|
|
|
52 |
'descriptions',
|
|
|
53 |
'descriptionssourcelabel',
|
|
|
54 |
'displayoptions',
|
|
|
55 |
'entername',
|
|
|
56 |
'entertitle',
|
|
|
57 |
'entersource',
|
|
|
58 |
'enterurl',
|
|
|
59 |
'height',
|
|
|
60 |
'kind',
|
|
|
61 |
'label',
|
|
|
62 |
'languagesavailable',
|
|
|
63 |
'languagesinstalled',
|
|
|
64 |
'link',
|
|
|
65 |
'loop',
|
|
|
66 |
'metadata',
|
|
|
67 |
'metadatasourcelabel',
|
|
|
68 |
'mute',
|
|
|
69 |
'poster',
|
|
|
70 |
'remove',
|
|
|
71 |
'size',
|
|
|
72 |
'srclang',
|
|
|
73 |
'subtitles',
|
|
|
74 |
'subtitlessourcelabel',
|
|
|
75 |
'track',
|
|
|
76 |
'tracks',
|
|
|
77 |
'video',
|
|
|
78 |
'videoheight',
|
|
|
79 |
'videosourcelabel',
|
|
|
80 |
'videowidth',
|
|
|
81 |
'width'),
|
|
|
82 |
'atto_media');
|
|
|
83 |
$PAGE->requires->strings_for_js(array('expand', 'collapse'), 'moodle');
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* Sends the parameters to the JS module.
|
|
|
88 |
*
|
|
|
89 |
* @return array
|
|
|
90 |
*/
|
|
|
91 |
function atto_media_params_for_js() {
|
|
|
92 |
global $OUTPUT;
|
|
|
93 |
global $PAGE;
|
|
|
94 |
$currentlang = current_language();
|
|
|
95 |
$langsinstalled = get_string_manager()->get_list_of_translations(true);
|
|
|
96 |
$langsavailable = get_string_manager()->get_list_of_languages();
|
|
|
97 |
$params = [
|
|
|
98 |
'langs' => ['installed' => [], 'available' => []],
|
|
|
99 |
'help' => []
|
|
|
100 |
];
|
|
|
101 |
|
|
|
102 |
foreach ($langsinstalled as $code => $name) {
|
|
|
103 |
$params['langs']['installed'][] = [
|
|
|
104 |
'lang' => $name,
|
|
|
105 |
'code' => $code,
|
|
|
106 |
'default' => $currentlang == $code
|
|
|
107 |
];
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
foreach ($langsavailable as $code => $name) {
|
|
|
111 |
// See MDL-50829 for an explanation of this lrm thing.
|
|
|
112 |
$lrm = json_decode('"\u200E"');
|
|
|
113 |
$params['langs']['available'][] = [
|
|
|
114 |
'lang' => $name . ' ' . $lrm . '(' . $code . ')' . $lrm, 'code' => $code];
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
$params['help'] = [
|
|
|
118 |
'addsource' => $OUTPUT->help_icon('addsource', 'atto_media'),
|
|
|
119 |
'tracks' => $OUTPUT->help_icon('tracks', 'atto_media'),
|
|
|
120 |
'subtitles' => $OUTPUT->help_icon('subtitles', 'atto_media'),
|
|
|
121 |
'captions' => $OUTPUT->help_icon('captions', 'atto_media'),
|
|
|
122 |
'descriptions' => $OUTPUT->help_icon('descriptions', 'atto_media'),
|
|
|
123 |
'chapters' => $OUTPUT->help_icon('chapters', 'atto_media'),
|
|
|
124 |
'metadata' => $OUTPUT->help_icon('metadata', 'atto_media')
|
|
|
125 |
];
|
|
|
126 |
|
|
|
127 |
return $params;
|
|
|
128 |
}
|