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,402 @@
<?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/>.
/**
* Class for converting files between different file formats using unoconv.
*
* @package fileconverter_unoconv
* @copyright 2017 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace fileconverter_unoconv;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/filelib.php');
use stored_file;
use \core_files\conversion;
/**
* Class for converting files between different formats using unoconv.
*
* @package fileconverter_unoconv
* @copyright 2017 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class converter implements \core_files\converter_interface {
/** No errors */
const UNOCONVPATH_OK = 'ok';
/** Not set */
const UNOCONVPATH_EMPTY = 'empty';
/** Does not exist */
const UNOCONVPATH_DOESNOTEXIST = 'doesnotexist';
/** Is a dir */
const UNOCONVPATH_ISDIR = 'isdir';
/** Not executable */
const UNOCONVPATH_NOTEXECUTABLE = 'notexecutable';
/** Test file missing */
const UNOCONVPATH_NOTESTFILE = 'notestfile';
/** Version not supported */
const UNOCONVPATH_VERSIONNOTSUPPORTED = 'versionnotsupported';
/** Any other error */
const UNOCONVPATH_ERROR = 'error';
/**
* @var bool $requirementsmet Whether requirements have been met.
*/
protected static $requirementsmet = null;
/**
* @var array $formats The list of formats supported by unoconv.
*/
protected static $formats;
/**
* Convert a document to a new format and return a conversion object relating to the conversion in progress.
*
* @param conversion $conversion The file to be converted
* @return $this
*/
public function start_document_conversion(\core_files\conversion $conversion) {
global $CFG;
if (!self::are_requirements_met()) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion failed to verify the configuraton meets the minimum requirements. " .
"Please check the unoconv installation configuration."
);
return $this;
}
$file = $conversion->get_sourcefile();
$filepath = $file->get_filepath();
// Sanity check that the conversion is supported.
$fromformat = pathinfo($file->get_filename(), PATHINFO_EXTENSION);
if (!self::is_format_supported($fromformat)) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion for '" . $filepath . "' found input '" . $fromformat . "' " .
"file extension to convert from is not supported."
);
return $this;
}
$format = $conversion->get('targetformat');
if (!self::is_format_supported($format)) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion for '" . $filepath . "' found output '" . $format . "' " .
"file extension to convert to is not supported."
);
return $this;
}
// Copy the file to the tmp dir.
$uniqdir = make_unique_writable_directory(make_temp_directory('core_file/conversions'));
\core_shutdown_manager::register_function('remove_dir', array($uniqdir));
$localfilename = $file->get_id() . '.' . $fromformat;
$filename = $uniqdir . '/' . $localfilename;
try {
// This function can either return false, or throw an exception so we need to handle both.
if ($file->copy_content_to($filename) === false) {
throw new \file_exception('storedfileproblem', 'Could not copy file contents to temp file.');
}
} catch (\file_exception $fe) {
error_log(
"Unoconv conversion for '" . $filepath . "' encountered disk permission error when copying " .
"submitted file contents to unique temp file: '" . $filename . "'."
);
throw $fe;
}
// The temporary file to copy into.
$newtmpfile = pathinfo($filename, PATHINFO_FILENAME) . '.' . $format;
$newtmpfile = $uniqdir . '/' . clean_param($newtmpfile, PARAM_FILE);
$cmd = escapeshellcmd(trim($CFG->pathtounoconv)) . ' ' .
escapeshellarg('-f') . ' ' .
escapeshellarg($format) . ' ' .
escapeshellarg('-o') . ' ' .
escapeshellarg($newtmpfile) . ' ' .
escapeshellarg($filename);
$output = null;
$currentdir = getcwd();
chdir($uniqdir);
$result = exec($cmd, $output, $returncode);
chdir($currentdir);
touch($newtmpfile);
if ($returncode != 0) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion for '" . $filepath . "' from '" . $fromformat . "' to '" . $format . "' " .
"was unsuccessful; returned with exit status code (" . $returncode . "). Please check the unoconv " .
"configuration and conversion file content / format."
);
return $this;
}
if (!file_exists($newtmpfile)) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion for '" . $filepath . "' from '" . $fromformat . "' to '" . $format . "' " .
"was unsuccessful; the output file was not found in '" . $newtmpfile . "'. Please check the disk " .
"permissions."
);
return $this;
}
if (filesize($newtmpfile) === 0) {
$conversion->set('status', conversion::STATUS_FAILED);
error_log(
"Unoconv conversion for '" . $filepath . "' from '" . $fromformat . "' to '" . $format . "' " .
"was unsuccessful; the output file size has 0 bytes in '" . $newtmpfile . "'. Please check the " .
"conversion file content / format with the command: [ " . $cmd . " ]"
);
return $this;
}
$conversion
->store_destfile_from_path($newtmpfile)
->set('status', conversion::STATUS_COMPLETE)
->update();
return $this;
}
/**
* Poll an existing conversion for status update.
*
* @param conversion $conversion The file to be converted
* @return $this
*/
public function poll_conversion_status(conversion $conversion) {
// Unoconv does not support asynchronous conversion.
return $this;
}
/**
* Generate and serve the test document.
*
* @return void
*/
public function serve_test_document() {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
$format = 'pdf';
$filerecord = [
'contextid' => \context_system::instance()->id,
'component' => 'test',
'filearea' => 'fileconverter_unoconv',
'itemid' => 0,
'filepath' => '/',
'filename' => 'unoconv_test.docx'
];
// Get the fixture doc file content and generate and stored_file object.
$fs = get_file_storage();
$testdocx = $fs->get_file($filerecord['contextid'], $filerecord['component'], $filerecord['filearea'],
$filerecord['itemid'], $filerecord['filepath'], $filerecord['filename']);
if (!$testdocx) {
$fixturefile = dirname(__DIR__) . '/tests/fixtures/unoconv-source.docx';
$testdocx = $fs->create_file_from_pathname($filerecord, $fixturefile);
}
$conversions = conversion::get_conversions_for_file($testdocx, $format);
foreach ($conversions as $conversion) {
if ($conversion->get('id')) {
$conversion->delete();
}
}
$conversion = new conversion(0, (object) [
'sourcefileid' => $testdocx->get_id(),
'targetformat' => $format,
]);
$conversion->create();
// Convert the doc file to the target format and send it direct to the browser.
$this->start_document_conversion($conversion);
do {
sleep(1);
$this->poll_conversion_status($conversion);
$status = $conversion->get('status');
} while ($status !== conversion::STATUS_COMPLETE && $status !== conversion::STATUS_FAILED);
readfile_accel($conversion->get_destfile(), 'application/pdf', true);
}
/**
* Whether the plugin is configured and requirements are met.
*
* @return bool
*/
public static function are_requirements_met() {
if (self::$requirementsmet === null) {
$requirementsmet = self::test_unoconv_path()->status === self::UNOCONVPATH_OK;
$requirementsmet = $requirementsmet && self::is_minimum_version_met();
self::$requirementsmet = $requirementsmet;
}
return self::$requirementsmet;
}
/**
* Whether the minimum version of unoconv has been met.
*
* @return bool
*/
protected static function is_minimum_version_met() {
global $CFG;
$currentversion = 0;
$supportedversion = 0.7;
$unoconvbin = \escapeshellarg($CFG->pathtounoconv);
$command = "$unoconvbin --version";
exec($command, $output);
// If the command execution returned some output, then get the unoconv version.
if ($output) {
foreach ($output as $response) {
if (preg_match('/unoconv (\\d+\\.\\d+)/', $response, $matches)) {
$currentversion = (float) $matches[1];
}
}
if ($currentversion < $supportedversion) {
return false;
} else {
return true;
}
}
return false;
}
/**
* Whether the plugin is fully configured.
*
* @return \stdClass
*/
public static function test_unoconv_path() {
global $CFG;
$unoconvpath = $CFG->pathtounoconv;
$ret = new \stdClass();
$ret->status = self::UNOCONVPATH_OK;
$ret->message = null;
if (empty($unoconvpath)) {
$ret->status = self::UNOCONVPATH_EMPTY;
return $ret;
}
if (!file_exists($unoconvpath)) {
$ret->status = self::UNOCONVPATH_DOESNOTEXIST;
return $ret;
}
if (is_dir($unoconvpath)) {
$ret->status = self::UNOCONVPATH_ISDIR;
return $ret;
}
if (!\file_is_executable($unoconvpath)) {
$ret->status = self::UNOCONVPATH_NOTEXECUTABLE;
return $ret;
}
if (!self::is_minimum_version_met()) {
$ret->status = self::UNOCONVPATH_VERSIONNOTSUPPORTED;
return $ret;
}
return $ret;
}
/**
* Whether a file conversion can be completed using this converter.
*
* @param string $from The source type
* @param string $to The destination type
* @return bool
*/
public static function supports($from, $to) {
return self::is_format_supported($from) && self::is_format_supported($to);
}
/**
* Whether the specified file format is supported.
*
* @param string $format Whether conversions between this format and another are supported
* @return bool
*/
protected static function is_format_supported($format) {
$formats = self::fetch_supported_formats();
$format = trim(\core_text::strtolower($format));
return in_array($format, $formats);
}
/**
* Fetch the list of supported file formats.
*
* @return array
*/
protected static function fetch_supported_formats() {
global $CFG;
if (!isset(self::$formats)) {
// Ask unoconv for it's list of supported document formats.
$cmd = escapeshellcmd(trim($CFG->pathtounoconv)) . ' --show';
$pipes = array();
$pipesspec = array(2 => array('pipe', 'w'));
$proc = proc_open($cmd, $pipesspec, $pipes);
$programoutput = stream_get_contents($pipes[2]);
fclose($pipes[2]);
proc_close($proc);
$matches = array();
preg_match_all('/\[\.(.*)\]/', $programoutput, $matches);
$formats = $matches[1];
self::$formats = array_unique($formats);
}
return self::$formats;
}
/**
* A list of the supported conversions.
*
* @return string
*/
public function get_supported_conversions() {
return implode(', ', self::fetch_supported_formats());
}
}
@@ -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 provider implementation for fileconverter_unoconv.
*
* @package fileconverter_unoconv
* @copyright 2018 Mihail Geshoski <mihail@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace fileconverter_unoconv\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy provider implementation for fileconverter_unoconv.
*
* @copyright 2018 Mihail Geshoski <mihail@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/>.
defined('MOODLE_INTERNAL') || die();
/**
* Installation for unoconv.
*
* @package fileconverter_unoconv
* @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function xmldb_fileconverter_unoconv_install() {
global $CFG;
$unoconvpresent = !empty($CFG->pathtounoconv);
$unoconvpresent = $unoconvpresent && file_exists($CFG->pathtounoconv);
$unoconvpresent = $unoconvpresent && !is_dir($CFG->pathtounoconv);
$unoconvpresent = $unoconvpresent && file_is_executable($CFG->pathtounoconv);
if ($unoconvpresent) {
// Unoconv is currently configured correctly.
// Enable it.
$plugins = \core_plugin_manager::instance()->get_plugins_of_type('fileconverter');
$plugins['unoconv']->set_enabled(true);
}
}
@@ -0,0 +1,39 @@
<?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 plugin 'fileconverter_unoconv'
*
* @package fileconverter_unoconv
* @copyright 2017 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['pathtounoconv'] = 'Path to unoconv document converter';
$string['pathtounoconv_help'] = 'Path to unoconv document converter. This is an executable that is capable of converting between document formats supported by LibreOffice. This is optional, but if specified, Moodle will use it to automatically convert between document formats. This is used to support a wider range of input files for the assignment annotate PDF feature.';
$string['pluginname'] = 'Unoconv';
$string['privacy:metadata'] = 'The Unoconv document converter plugin does not store any personal data.';
$string['test_unoconv'] = 'Test unoconv path';
$string['test_unoconvdoesnotexist'] = 'The unoconv path does not point to the unoconv program. Please review your path settings.';
$string['test_unoconvdownload'] = 'Download the converted pdf test file.';
$string['test_unoconvempty'] = 'The unoconv path is not set. Please review your path settings.';
$string['test_unoconvisdir'] = 'The unoconv path points to a folder, please include the unoconv program in the path you specify';
$string['test_unoconvnotestfile'] = 'The test document to be converted to PDF is missing.';
$string['test_unoconvnotexecutable'] = 'The unoconv path points to a file that is not executable';
$string['test_unoconvok'] = 'The unoconv path appears to be properly configured.';
$string['test_unoconvversionnotsupported'] = 'The version of unoconv you have installed is not supported.';
+36
View File
@@ -0,0 +1,36 @@
<?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/>.
/**
* Settings for unoconv.
*
* @package fileconverter_unoconv
* @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Unoconv setting.
$settings->add(new admin_setting_configexecutable('pathtounoconv',
new lang_string('pathtounoconv', 'fileconverter_unoconv'),
new lang_string('pathtounoconv_help', 'fileconverter_unoconv'),
'/usr/bin/unoconv')
);
$url = new moodle_url('/files/converter/unoconv/testunoconv.php');
$link = html_writer::link($url, get_string('test_unoconv', 'fileconverter_unoconv'));
$settings->add(new admin_setting_heading('test_unoconv', '', $link));
@@ -0,0 +1,133 @@
<?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/>.
namespace fileconverter_unoconv;
/**
* A set of tests for some of the unoconv functionality within Moodle.
*
* @package fileconverter_unoconv
* @copyright 2016 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class converter_test extends \advanced_testcase {
/**
* Helper to skip tests which _require_ unoconv.
*/
protected function require_unoconv() {
global $CFG;
if (empty($CFG->pathtounoconv) || !file_is_executable(trim($CFG->pathtounoconv))) {
// No conversions are possible, sorry.
$this->markTestSkipped();
}
}
/**
* Get a testable mock of the fileconverter_unoconv class.
*
* @param array $mockedmethods A list of methods you intend to override
* If no methods are specified, only abstract functions are mocked.
* @return \fileconverter_unoconv\converter
*/
protected function get_testable_mock($mockedmethods = []) {
$converter = $this->getMockBuilder(\fileconverter_unoconv\converter::class)
->onlyMethods($mockedmethods)
->getMock();
return $converter;
}
/**
* Tests for the start_document_conversion function.
*/
public function test_start_document_conversion(): void {
$this->resetAfterTest();
$this->require_unoconv();
// Mock the file to be converted.
$filerecord = [
'contextid' => \context_system::instance()->id,
'component' => 'test',
'filearea' => 'unittest',
'itemid' => 0,
'filepath' => '/',
'filename' => 'test.docx',
];
$fs = get_file_storage();
$source = __DIR__ . DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR . 'unoconv-source.docx';
$testfile = $fs->create_file_from_pathname($filerecord, $source);
$converter = $this->get_testable_mock();
$conversion = new \core_files\conversion(0, (object) [
'targetformat' => 'pdf',
]);
$conversion->set_sourcefile($testfile);
$conversion->create();
// Convert the document.
$converter->start_document_conversion($conversion);
$result = $conversion->get_destfile();
$this->assertNotFalse($result);
$this->assertSame('application/pdf', $result->get_mimetype());
$this->assertGreaterThan(0, $result->get_filesize());
}
/**
* Tests for the test_unoconv_path function.
*
* @dataProvider provider_test_unoconv_path
* @param string $path The path to test
* @param int $status The expected status
*/
public function test_test_unoconv_path($path, $status): void {
global $CFG;
$this->resetAfterTest();
// Set the current path.
$CFG->pathtounoconv = $path;
// Run the tests.
$result = \fileconverter_unoconv\converter::test_unoconv_path();
$this->assertEquals($status, $result->status);
}
/**
* Provider for test_unoconv_path.
*
* @return array
*/
public function provider_test_unoconv_path() {
return [
'Empty path' => [
'path' => null,
'status' => \fileconverter_unoconv\converter::UNOCONVPATH_EMPTY,
],
'Invalid file' => [
'path' => '/path/to/nonexistent/file',
'status' => \fileconverter_unoconv\converter::UNOCONVPATH_DOESNOTEXIST,
],
'Directory' => [
'path' => __DIR__,
'status' => \fileconverter_unoconv\converter::UNOCONVPATH_ISDIR,
],
];
}
}
Binary file not shown.
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
+73
View File
@@ -0,0 +1,73 @@
<?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/>.
/**
* Test that unoconv is configured correctly
*
* @package fileconverter_unoconv
* @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/filelib.php');
$sendpdf = optional_param('sendpdf', 0, PARAM_BOOL);
$PAGE->set_url(new moodle_url('/files/converter/unoconv/testunoconv.php'));
$PAGE->set_context(context_system::instance());
require_login();
require_capability('moodle/site:config', context_system::instance());
$strheading = get_string('test_unoconv', 'fileconverter_unoconv');
$PAGE->navbar->add(get_string('administrationsite'));
$PAGE->navbar->add(get_string('plugins', 'admin'));
$PAGE->navbar->add(get_string('assignmentplugins', 'mod_assign'));
$PAGE->navbar->add(get_string('feedbackplugins', 'mod_assign'));
$PAGE->navbar->add(get_string('pluginname', 'fileconverter_unoconv'),
new moodle_url('/admin/settings.php', array('section' => 'fileconverterunoconv')));
$PAGE->navbar->add($strheading);
$PAGE->set_heading($strheading);
$PAGE->set_title($strheading);
$converter = new \fileconverter_unoconv\converter();
if ($sendpdf) {
require_sesskey();
$converter->serve_test_document();
die();
}
$result = \fileconverter_unoconv\converter::test_unoconv_path();
switch ($result->status) {
case \fileconverter_unoconv\converter::UNOCONVPATH_OK:
$msg = $OUTPUT->notification(get_string('test_unoconvok', 'fileconverter_unoconv'), 'success');
$pdflink = new moodle_url($PAGE->url, array('sendpdf' => 1, 'sesskey' => sesskey()));
$msg .= html_writer::link($pdflink, get_string('test_unoconvdownload', 'fileconverter_unoconv'));
$msg .= html_writer::empty_tag('br');
break;
default:
$msg = $OUTPUT->notification(get_string("test_unoconv{$result->status}", 'fileconverter_unoconv'), 'warning');
break;
}
$returl = new moodle_url('/admin/settings.php', array('section' => 'fileconverterunoconv'));
$msg .= $OUTPUT->continue_button($returl);
echo $OUTPUT->header();
echo $OUTPUT->box($msg, 'generalbox');
echo $OUTPUT->footer();
+29
View File
@@ -0,0 +1,29 @@
<?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 fileconverter_unoconv
* @copyright 2017 Damyon Wiese
* @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 = 'fileconverter_unoconv'; // Full name of the plugin (used for diagnostics).