Skip to content

Commit

Permalink
Merge pull request #69 from ctam/Add_Kaltura_Moodle_plugins_4.4.9-4.4…
Browse files Browse the repository at this point in the history
…_through_git_merge_on_its_UCSFCLE_404_STABLE_branch

Add 'ucsf-education/kaltura-moodle_plugin' version 4.4.9-4.4 from its UCSFCLE_404_STABLE branch through `git merge`.
  • Loading branch information
ctam authored Sep 24, 2024
2 parents e77656f + 50b440e commit 1722792
Show file tree
Hide file tree
Showing 195 changed files with 58,529 additions and 0 deletions.
58 changes: 58 additions & 0 deletions blocks/kalturamediagallery/block_kalturamediagallery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

defined('MOODLE_INTERNAL') || die();

class block_kalturamediagallery extends block_base {
function init() {
$this->title = get_string('pluginname', 'local_kalturamediagallery');
}

function get_content() {
if(!is_null($this->content)) {
return $this->content;
}

$this->content = new stdClass();
$this->content->text = '';
$this->content->footer = '';

if($context = $this->getCourseContext()) {
$this->content->text = $this->getKalturaMediaGalleryLink($context->instanceid);
}

return $this->content;
}

function applicable_formats()
{
return array(
'course-view' => true
);
}

private function getKalturaMediaGalleryLink($courseId) {
$mediaGalleryUrl = new moodle_url('/local/kalturamediagallery/index.php', array(
'courseid' => $courseId
));

$link = html_writer::tag('a', get_string('nav_mediagallery', 'local_kalturamediagallery'), array(
'href' => $mediaGalleryUrl->out(false)
));

return $link;
}

private function getCourseContext() {
// Check the current page context. If the context is not of a course or module then return false.
$context = context::instance_by_id($this->page->context->id);
$isCourseContext = $context instanceof context_course;
if (!$isCourseContext) {
return false;
}

// If the context if a module then get the parent context.
$courseContext = ($context instanceof context_module) ? $context->get_course_context() : $context;

return $courseContext;
}
}
20 changes: 20 additions & 0 deletions blocks/kalturamediagallery/classes/privacy/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace block_kalturamediagallery\privacy;

use \core_privacy\local\metadata\null_provider;

defined('MOODLE_INTERNAL') || die();

class provider implements null_provider {

/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
41 changes: 41 additions & 0 deletions blocks/kalturamediagallery/db/access.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 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. If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$capabilities = array(
'block/kalturamediagallery:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_PROHIBIT
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/kalturamediagallery:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
);
20 changes: 20 additions & 0 deletions blocks/kalturamediagallery/lang/en/block_kalturamediagallery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 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. If not, see <http://www.gnu.org/licenses/>.

$string['pluginname'] = 'Kaltura Media Gallery';
$string['kalturamediagallery:addinstance'] = 'Add a new Kaltura Media Gallery block';
$string['kalturamediagallery:myaddinstance'] = 'Add a new Kaltura Media Gallery block to Dashboard';
$string['privacy:metadata'] = 'The Kaltura Media Gallery block only displays a link to Kaltura Media Gallery local plugin';
24 changes: 24 additions & 0 deletions blocks/kalturamediagallery/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
// Moodle 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 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. If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024042201;
$plugin->release = 'Kaltura release 4.4.9';
$plugin->requires = 2024042200;
$plugin->component = 'block_kalturamediagallery';
$plugin->dependencies = array(
'local_kaltura' => 2024042201,
'local_kalturamediagallery' => 2024042201
);
10 changes: 10 additions & 0 deletions createPackage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

BRANCH=`git branch | grep '*' |awk -F _ '{print $2}'`
VER=`cat local/kaltura/version.php |grep '>version' | awk '{print $3}' | awk -F ";" '{print $1}'`

echo "Generating package for Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip\n"

FILENAME="Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip"

zip -r $FILENAME lib filter mod local blocks
20 changes: 20 additions & 0 deletions filter/kaltura/classes/privacy/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace filter_kaltura\privacy;

use \core_privacy\local\metadata\null_provider;

defined('MOODLE_INTERNAL') || die();

class provider implements null_provider {

/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}
34 changes: 34 additions & 0 deletions filter/kaltura/db/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 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. If not, see <http://www.gnu.org/licenses/>.

/**
* Filter post install hook
*
* @package filter_kaltura
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

function xmldb_filter_kaltura_install() {
global $CFG;
require_once("$CFG->libdir/filterlib.php");

// Do not enable the filter when running unit tests because some core
// tests expect a specific number of filters enabled.
if (!defined('PHPUNIT_TEST') || !PHPUNIT_TEST) {
filter_set_global_state('kaltura', TEXTFILTER_ON);
}

}
Loading

0 comments on commit 1722792

Please sign in to comment.