first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,46 @@
<?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/>.
/**
* Privacy Subsystem implementation for repository_coursefiles.
*
* @package repository_coursefiles
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace repository_coursefiles\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for repository_coursefiles implementing null_provider.
*
* @copyright 2018 Zig Tan <zig@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\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';
}
}
+40
View File
@@ -0,0 +1,40 @@
<?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/>.
/**
* Plugin capabilities.
*
* @package repository_coursefiles
* @copyright 2010 Dongsheng Cai
* @author Dongsheng Cai <dongsheng@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
'repository/coursefiles:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
)
);
@@ -0,0 +1,33 @@
<?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/>.
/**
* Strings for component 'repository_coursefiles', language 'en', branch 'MOODLE_20_STABLE'
*
* @package repository_coursefiles
* @copyright 2010 Dongsheng Cai <dongsheng@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['configplugin'] = 'Configuration for legacy course files repository';
$string['emptyfilelist'] = 'There are no files to show';
$string['notitle'] = 'notitle';
$string['remember'] = 'Remember me';
$string['pluginname_help'] = 'Legacy course files';
$string['pluginname'] = 'Legacy course files';
$string['coursefiles:view'] = 'Use course files repository plugin';
$string['privacy:metadata'] = 'The Legacy course files repository plugin does not store or transmit any personal data.';
+222
View File
@@ -0,0 +1,222 @@
<?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/>.
/**
* This plugin is used to access coursefiles repository
*
* @since Moodle 2.0
* @package repository_coursefiles
* @copyright 2010 Dongsheng Cai {@link http://dongsheng.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/repository/lib.php');
/**
* repository_coursefiles class is used to browse course files
*
* @since Moodle 2.0
* @package repository_coursefiles
* @copyright 2010 Dongsheng Cai {@link http://dongsheng.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class repository_coursefiles extends repository {
/**
* coursefiles plugin doesn't require login, so list all files
*
* @return mixed
*/
public function print_login() {
return $this->get_listing();
}
/**
* Get file listing
*
* @param string $encodedpath
* @return mixed
*/
public function get_listing($encodedpath = '', $page = '') {
global $CFG, $USER, $OUTPUT;
$ret = array();
$ret['dynload'] = true;
$ret['nosearch'] = true;
$ret['nologin'] = true;
$list = array();
$component = 'course';
$filearea = 'legacy';
$itemid = 0;
$browser = get_file_browser();
if (!empty($encodedpath)) {
$params = json_decode(base64_decode($encodedpath), true);
if (is_array($params)) {
$filepath = is_null($params['filepath']) ? NULL : clean_param($params['filepath'], PARAM_PATH);
$filename = is_null($params['filename']) ? NULL : clean_param($params['filename'], PARAM_FILE);
$context = context::instance_by_id(clean_param($params['contextid'], PARAM_INT));
}
} else {
$filename = null;
$filepath = null;
list($context, $course, $cm) = get_context_info_array($this->context->id);
$courseid = is_object($course) ? $course->id : SITEID;
$context = context_course::instance($courseid);
}
if ($fileinfo = $browser->get_file_info($context, $component, $filearea, $itemid, $filepath, $filename)) {
// build path navigation
$pathnodes = array();
$encodedpath = base64_encode(json_encode($fileinfo->get_params()));
$pathnodes[] = array('name'=>$fileinfo->get_visible_name(), 'path'=>$encodedpath);
$level = $fileinfo->get_parent();
while ($level) {
$params = $level->get_params();
$encodedpath = base64_encode(json_encode($params));
if ($params['contextid'] != $context->id) {
break;
}
$pathnodes[] = array('name'=>$level->get_visible_name(), 'path'=>$encodedpath);
$level = $level->get_parent();
}
if (!empty($pathnodes) && is_array($pathnodes)) {
$pathnodes = array_reverse($pathnodes);
$ret['path'] = $pathnodes;
}
// build file tree
$children = $fileinfo->get_children();
foreach ($children as $child) {
if ($child->is_directory()) {
$params = $child->get_params();
$subdir_children = $child->get_children();
$encodedpath = base64_encode(json_encode($params));
$node = array(
'title' => $child->get_visible_name(),
'datemodified' => $child->get_timemodified(),
'datecreated' => $child->get_timecreated(),
'path' => $encodedpath,
'children'=>array(),
'thumbnail' => $OUTPUT->image_url(file_folder_icon())->out(false)
);
$list[] = $node;
} else {
$encodedpath = base64_encode(json_encode($child->get_params()));
$node = array(
'title' => $child->get_visible_name(),
'size' => $child->get_filesize(),
'author' => $child->get_author(),
'license' => $child->get_license(),
'datemodified' => $child->get_timemodified(),
'datecreated' => $child->get_timecreated(),
'source'=> $encodedpath,
'isref' => $child->is_external_file(),
'thumbnail' => $OUTPUT->image_url(file_file_icon($child))->out(false)
);
if ($child->get_status() == 666) {
$node['originalmissing'] = true;
}
if ($imageinfo = $child->get_imageinfo()) {
$fileurl = new moodle_url($child->get_url());
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $child->get_timemodified()));
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon', 'oid' => $child->get_timemodified()));
$node['image_width'] = $imageinfo['width'];
$node['image_height'] = $imageinfo['height'];
}
$list[] = $node;
}
}
} else {
$list = array();
}
$ret['list'] = array_filter($list, array($this, 'filter'));
return $ret;
}
public function get_link($encoded) {
$info = array();
$browser = get_file_browser();
// the final file
$params = unserialize(base64_decode($encoded));
$contextid = clean_param($params['contextid'], PARAM_INT);
$fileitemid = clean_param($params['itemid'], PARAM_INT);
$filename = clean_param($params['filename'], PARAM_FILE);
$filepath = clean_param($params['filepath'], PARAM_PATH);
$filearea = clean_param($params['filearea'], PARAM_AREA);
$component = clean_param($params['component'], PARAM_COMPONENT);
$context = context::instance_by_id($contextid);
$file_info = $browser->get_file_info($context, $component, $filearea, $fileitemid, $filepath, $filename);
return $file_info->get_url();
}
/**
* Return is the instance is visible
* (is the type visible ? is the context enable ?)
*
* @return boolean
*/
public function is_visible() {
global $COURSE; //TODO: this is deprecated (skodak)
if ($COURSE->legacyfiles != 2) {
// do not show repo if legacy files disabled in this course...
return false;
}
return parent::is_visible();
}
/**
* Return the repository name.
*
* @return string
*/
public function get_name() {
$context = $this->context->get_course_context(false);
if ($context) {
return get_string('courselegacyfilesofcourse', 'moodle', $context->get_context_name(false, true));
} else {
return get_string('courselegacyfiles');
}
}
public function supported_returntypes() {
return (FILE_INTERNAL | FILE_REFERENCE);
}
public static function get_type_option_names() {
return array();
}
/**
* Does this repository used to browse moodle files?
*
* @return boolean
*/
public function has_moodle_files() {
return true;
}
/**
* Is this repository accessing private data?
*
* @return bool
*/
public function contains_private_data() {
return false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

+75
View File
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="74px" height="51px" viewBox="-0.535 -0.774 74 51"
style="overflow:visible;enable-background:new -0.535 -0.774 74 51;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<defs>
</defs>
<radialGradient id="SVGID_1_" cx="137.084" cy="32.2324" r="123.3346" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#FAAF40"/>
<stop offset="0.0432" style="stop-color:#F9A538"/>
<stop offset="0.1116" style="stop-color:#F89D31"/>
<stop offset="0.2269" style="stop-color:#F89A2F"/>
<stop offset="0.5276" style="stop-color:#F7922D"/>
<stop offset="1" style="stop-color:#F37B28"/>
<a:midPointStop offset="0" style="stop-color:#FAAF40"/>
<a:midPointStop offset="0.1982" style="stop-color:#FAAF40"/>
<a:midPointStop offset="0.2269" style="stop-color:#F89A2F"/>
<a:midPointStop offset="0.6064" style="stop-color:#F89A2F"/>
<a:midPointStop offset="1" style="stop-color:#F37B28"/>
</radialGradient>
<path style="fill:url(#SVGID_1_);" d="M61.192,49.375V26.558c0-4.771-1.972-7.156-5.911-7.156c-3.942,0-5.912,2.386-5.912,7.156
v22.817H37.754V26.558c0-4.771-1.938-7.156-5.811-7.156c-3.94,0-5.91,2.386-5.91,7.156v22.817H14.417V25.211
c0-4.979,1.728-8.747,5.185-11.304c3.043-2.282,7.158-3.425,12.343-3.425c5.255,0,9.127,1.349,11.617,4.045
c2.142-2.696,6.049-4.045,11.72-4.045c5.186,0,9.298,1.143,12.341,3.425c3.457,2.557,5.186,6.325,5.186,11.304v24.164H61.192z"/>
<path style="fill:#58595B;" d="M15.499,16.321c-0.394,1.999-0.788,3.999-1.181,5.997c10.983,3.72,21.4,0.111,26.883-9.489
C33.184,7.282,25.601,12.914,15.499,16.321"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="14.4287" y1="16.0166" x2="40.6895" y2="16.0166">
<stop offset="0" style="stop-color:#929497"/>
<stop offset="0.1245" style="stop-color:#757578"/>
<stop offset="0.2792" style="stop-color:#575658"/>
<stop offset="0.4403" style="stop-color:#403E3F"/>
<stop offset="0.6085" style="stop-color:#302D2E"/>
<stop offset="0.7884" style="stop-color:#262223"/>
<stop offset="1" style="stop-color:#231F20"/>
<a:midPointStop offset="0" style="stop-color:#929497"/>
<a:midPointStop offset="0.2606" style="stop-color:#929497"/>
<a:midPointStop offset="1" style="stop-color:#231F20"/>
</linearGradient>
<path style="fill:url(#SVGID_2_);" d="M15.499,14.889c-0.356,2.259-0.714,4.518-1.07,6.776c10.527,3.567,20.84,0.503,26.261-8.944
C33.708,4.677,25.925,11.373,15.499,14.889"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="19.457" y1="7.248" x2="30.3611" y2="22.8207">
<stop offset="0" style="stop-color:#231F20"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
<a:midPointStop offset="0" style="stop-color:#231F20"/>
<a:midPointStop offset="0.5" style="stop-color:#231F20"/>
<a:midPointStop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<path style="fill:url(#SVGID_3_);" d="M27.993,17.575c-4.764-0.997-10.036,1.485-13.564,4.09
C12.103,4.879,22.536,5.222,36.098,9.415c-0.857,4.143-2.387,9.598-5.017,12.903C31.081,20.182,30.052,18.6,27.993,17.575"/>
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="0.0078" y1="7.7275" x2="48.0068" y2="7.7275">
<stop offset="0" style="stop-color:#929497"/>
<stop offset="0.1245" style="stop-color:#757578"/>
<stop offset="0.2792" style="stop-color:#575658"/>
<stop offset="0.4403" style="stop-color:#403E3F"/>
<stop offset="0.6085" style="stop-color:#302D2E"/>
<stop offset="0.7884" style="stop-color:#262223"/>
<stop offset="1" style="stop-color:#231F20"/>
<a:midPointStop offset="0" style="stop-color:#929497"/>
<a:midPointStop offset="0.2606" style="stop-color:#929497"/>
<a:midPointStop offset="1" style="stop-color:#231F20"/>
</linearGradient>
<path style="fill:url(#SVGID_4_);" d="M0.008,14.889C17.625,4.318,27.468,2.282,48.007,0.202
C24.279,18.919,23.64,14.889,0.008,14.889"/>
<line style="fill:#383738;stroke:#4A4A4C;stroke-width:0.5;" x1="48.007" y1="0.202" x2="29.186" y2="13.948"/>
<path style="opacity:0.23;fill:#231F20;" d="M25.506,7.567C25.733,9.723,25.286,5.423,25.506,7.567"/>
<line style="fill:#FFFFFF;stroke:#A8ABAD;stroke-width:0.5;" x1="0.008" y1="14.889" x2="29.186" y2="13.948"/>
<path style="fill:none;stroke:#F16922;stroke-width:0.5;" d="M23.79,7.733c-4.996,1.381-21.387,5.041-21.64,7.086
c-0.483,3.917-0.123,10.143-0.123,10.143"/>
<path style="fill:#F16922;" d="M3.532,39.84C1.697,35.389-0.443,30.363,2.1,24.184C3.794,29.957,3.544,34.362,3.532,39.84"/>
<ellipse transform="matrix(0.942 -0.3356 0.3356 0.942 -1.1544 8.1596)" style="fill:#6D6E70;" cx="23.032" cy="7.42" rx="0.792" ry="0.411"/>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

@@ -0,0 +1,35 @@
<?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/>.
/**
* Course files repository data generator
*
* @package repository_coursefiles
* @category test
* @copyright 2013 Frédéric Massart
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Course files repository data generator class
*
* @package repository_coursefiles
* @category test
* @copyright 2013 Frédéric Massart
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class repository_coursefiles_generator extends testing_repository_generator {
}
+31
View File
@@ -0,0 +1,31 @@
<?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/>.
/**
* Version details
*
* @package repository
* @subpackage coursefiles
* @copyright 2010 Dongsheng Cai
* @author Dongsheng Cai <dongsheng@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024042200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2024041600; // Requires this Moodle version.
$plugin->component = 'repository_coursefiles'; // Full name of the plugin (used for diagnostics)