Skip to content

Commit c464111

Browse files
committed
Merge tag '4.5.0-4.5' from kaltura/moodle_plugin into UCSFCLE_405_STABLE
2 parents e0dbbc1 + f7dcabd commit c464111

File tree

196 files changed

+58831
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+58831
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
defined('MOODLE_INTERNAL') || die();
4+
5+
class block_kalturamediagallery extends block_base {
6+
function init() {
7+
$this->title = get_string('pluginname', 'local_kalturamediagallery');
8+
}
9+
10+
function get_content() {
11+
if(!is_null($this->content)) {
12+
return $this->content;
13+
}
14+
15+
$this->content = new stdClass();
16+
$this->content->text = '';
17+
$this->content->footer = '';
18+
19+
if($context = $this->getCourseContext()) {
20+
$this->content->text = $this->getKalturaMediaGalleryLink($context->instanceid);
21+
}
22+
23+
return $this->content;
24+
}
25+
26+
function applicable_formats()
27+
{
28+
return array(
29+
'course-view' => true
30+
);
31+
}
32+
33+
private function getKalturaMediaGalleryLink($courseId) {
34+
$mediaGalleryUrl = new moodle_url('/local/kalturamediagallery/index.php', array(
35+
'courseid' => $courseId
36+
));
37+
38+
$link = html_writer::tag('a', get_string('nav_mediagallery', 'local_kalturamediagallery'), array(
39+
'href' => $mediaGalleryUrl->out(false)
40+
));
41+
42+
return $link;
43+
}
44+
45+
private function getCourseContext() {
46+
// Check the current page context. If the context is not of a course or module then return false.
47+
$context = context::instance_by_id($this->page->context->id);
48+
$isCourseContext = $context instanceof context_course;
49+
if (!$isCourseContext) {
50+
return false;
51+
}
52+
53+
// If the context if a module then get the parent context.
54+
$courseContext = ($context instanceof context_module) ? $context->get_course_context() : $context;
55+
56+
return $courseContext;
57+
}
58+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace block_kalturamediagallery\privacy;
4+
5+
use \core_privacy\local\metadata\null_provider;
6+
7+
defined('MOODLE_INTERNAL') || die();
8+
9+
class provider implements null_provider {
10+
11+
/**
12+
* Get the language string identifier with the component's language
13+
* file to explain why this plugin stores no data.
14+
*
15+
* @return string
16+
*/
17+
public static function get_reason() : string {
18+
return 'privacy:metadata';
19+
}
20+
}
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
defined('MOODLE_INTERNAL') || die();
18+
19+
$capabilities = array(
20+
'block/kalturamediagallery:myaddinstance' => array(
21+
'captype' => 'write',
22+
'contextlevel' => CONTEXT_SYSTEM,
23+
'archetypes' => array(
24+
'user' => CAP_PROHIBIT
25+
),
26+
27+
'clonepermissionsfrom' => 'moodle/my:manageblocks'
28+
),
29+
30+
'block/kalturamediagallery:addinstance' => array(
31+
'riskbitmask' => RISK_SPAM | RISK_XSS,
32+
'captype' => 'write',
33+
'contextlevel' => CONTEXT_BLOCK,
34+
'archetypes' => array(
35+
'editingteacher' => CAP_ALLOW,
36+
'manager' => CAP_ALLOW
37+
),
38+
39+
'clonepermissionsfrom' => 'moodle/site:manageblocks'
40+
),
41+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
$string['pluginname'] = 'Kaltura Media Gallery';
18+
$string['kalturamediagallery:addinstance'] = 'Add a new Kaltura Media Gallery block';
19+
$string['kalturamediagallery:myaddinstance'] = 'Add a new Kaltura Media Gallery block to Dashboard';
20+
$string['privacy:metadata'] = 'The Kaltura Media Gallery block only displays a link to Kaltura Media Gallery local plugin';
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
// Moodle is free software: you can redistribute it and/or modify
3+
// it under the terms of the GNU General Public License as published by
4+
// the Free Software Foundation, either version 3 of the License, or
5+
// (at your option) any later version.
6+
//
7+
// Moodle is distributed in the hope that it will be useful,
8+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
// GNU General Public License for more details.
11+
//
12+
// You should have received a copy of the GNU General Public License
13+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
14+
15+
defined('MOODLE_INTERNAL') || die();
16+
17+
$plugin->version = 2024100700;
18+
$plugin->release = 'Kaltura release 4.5.0';
19+
$plugin->requires = 2024042200;
20+
$plugin->component = 'block_kalturamediagallery';
21+
$plugin->dependencies = array(
22+
'local_kaltura' => 2024100700,
23+
'local_kalturamediagallery' => 2024100700
24+
);

createPackage.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
BRANCH=`git branch | grep '*' |awk -F _ '{print $2}'`
4+
VER=`cat local/kaltura/version.php |grep '>version' | awk '{print $3}' | awk -F ";" '{print $1}'`
5+
6+
echo "Generating package for Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip\n"
7+
8+
FILENAME="Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip"
9+
10+
zip -r $FILENAME lib filter mod local blocks
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace filter_kaltura\privacy;
4+
5+
use \core_privacy\local\metadata\null_provider;
6+
7+
defined('MOODLE_INTERNAL') || die();
8+
9+
class provider implements null_provider {
10+
11+
/**
12+
* Get the language string identifier with the component's language
13+
* file to explain why this plugin stores no data.
14+
*
15+
* @return string
16+
*/
17+
public static function get_reason() : string {
18+
return 'privacy:metadata';
19+
}
20+
}

filter/kaltura/db/install.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
* Filter post install hook
19+
*
20+
* @package filter_kaltura
21+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22+
*/
23+
24+
function xmldb_filter_kaltura_install() {
25+
global $CFG;
26+
require_once("$CFG->libdir/filterlib.php");
27+
28+
filter_set_global_state('kaltura', TEXTFILTER_ON);
29+
}

0 commit comments

Comments
 (0)