Skip to content

Commit

Permalink
Merge branch 'UCSFCLE_404_STABLE' into UCSFCLE_404-Add_danmarsden/moo…
Browse files Browse the repository at this point in the history
…dle-block_attendance_to_blocks/attendance_as_a_git_submodule
  • Loading branch information
stopfstedt authored Sep 26, 2024
2 parents 4b3fa5a + 1722792 commit 669fd69
Show file tree
Hide file tree
Showing 200 changed files with 58,544 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@
path = blocks/attendance
url = https://github.com/danmarsden/moodle-block_attendance
branch = main
[submodule "blocks/course_recent"]
path = blocks/course_recent
url = https://github.com/ucsf-education/moodle-block-course_recent
branch = MOODLE_404_STABLE
[submodule "filter/ucsfezproxy"]
path = filter/ucsfezproxy
url = https://github.com/ucsf-education/moodle-filter_ucsfezproxy
branch = MOODLE_404_STABLE
[submodule "local/navbarhelpmenu"]
path = local/navbarhelpmenu
url = https://github.com/ucsf-education/moodle-local_navbarhelpmenu
2 changes: 1 addition & 1 deletion admin/tool/externaltaskmonitor
1 change: 1 addition & 0 deletions blocks/course_recent
Submodule course_recent added at d66498
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 669fd69

Please sign in to comment.