diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index fc70249..1b322ac 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -4,11 +4,11 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 services: postgres: - image: postgres:12.7 + image: postgres:13 env: POSTGRES_USER: 'postgres' POSTGRES_HOST_AUTH_METHOD: 'trust' @@ -16,7 +16,7 @@ jobs: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 mariadb: - image: mariadb:10.5 + image: mariadb:10.6.7 env: MYSQL_USER: 'root' MYSQL_ALLOW_EMPTY_PASSWORD: "true" @@ -28,36 +28,33 @@ jobs: fail-fast: false matrix: include: - - php: '8.0' + - php: '8.2' moodle-branch: 'master' database: 'pgsql' - - php: '8.0' + - php: '8.3' moodle-branch: 'master' database: 'mariadb' + - php: '8.2' + moodle-branch: 'MOODLE_405_STABLE' + database: 'mariabd' + - php: '8.2' + moodle-branch: 'MOODLE_405_STABLE' + database: 'pgsql' + - php: '8.2' + moodle-branch: 'MOODLE_404_STABLE' + database: 'mariadb' + - php: '8.1' + moodle-branch: 'MOODLE_403_STABLE' + database: 'pgsql' - php: '8.0' - moodle-branch: 'MOODLE_401_STABLE' + moodle-branch: 'MOODLE_402_STABLE' database: 'pgsql' - php: '8.0' - moodle-branch: 'MOODLE_400_STABLE' + moodle-branch: 'MOODLE_402_STABLE' database: 'mariadb' - php: '8.0' - moodle-branch: 'MOODLE_311_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_310_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_39_STABLE' - database: 'pgsql' - - php: '7.3' - moodle-branch: 'MOODLE_38_STABLE' - database: 'pgsql' - - php: '7.2' - moodle-branch: 'MOODLE_37_STABLE' + moodle-branch: 'MOODLE_401_STABLE' database: 'pgsql' - - php: '7.0' - moodle-branch: 'MOODLE_35_STABLE' - database: 'mariadb' steps: - name: Check out repository code diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 137a348..5610ee5 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -31,7 +31,6 @@ * @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. diff --git a/lib.php b/lib.php index 2d87ade..c77590c 100644 --- a/lib.php +++ b/lib.php @@ -35,10 +35,9 @@ function atto_preview_params_for_js($elementid, $options, $fpoptions) { if (!$context) { $context = context_system::instance(); } - return array('contextid' => $context->id, + return ['contextid' => $context->id, 'previewurl' => $CFG->wwwroot . '/lib/editor/atto/plugins/preview/preview.php', - 'sesskey' => sesskey()); - + 'sesskey' => sesskey()]; } /** @@ -47,6 +46,5 @@ function atto_preview_params_for_js($elementid, $options, $fpoptions) { function atto_preview_strings_for_js() { global $PAGE; - $PAGE->requires->strings_for_js(array('pluginname'), 'atto_preview'); + $PAGE->requires->strings_for_js(['pluginname'], 'atto_preview'); } - diff --git a/preview.php b/preview.php index a5237f5..3227e5b 100644 --- a/preview.php +++ b/preview.php @@ -29,7 +29,7 @@ $PAGE->set_url('/lib/editor/atto/plugins/preview/preview.php'); -list($context, $course, $cm) = get_context_info_array($contextid); +[$context, $course, $cm] = get_context_info_array($contextid); $PAGE->set_context($context); require_login($course, false, $cm); @@ -42,12 +42,12 @@ // Print dialog link a la book print tool. $printtext = get_string('printcontent', 'atto_preview'); -$printicon = $OUTPUT->pix_icon('book', $printtext, 'booktool_print', array('class' => 'icon')); -$printlinkatt = array('onclick' => 'window.print();return false;', 'class' => 'hidden-print'); -$printbutton = html_writer::link('#', $printicon.$printtext, $printlinkatt); +$printicon = $OUTPUT->pix_icon('book', $printtext, 'booktool_print', ['class' => 'icon']); +$printlinkatt = ['onclick' => 'window.print();return false;', 'class' => 'hidden-print']; +$printbutton = html_writer::link('#', $printicon . $printtext, $printlinkatt); // Output filtered content. -$content = format_text($content, FORMAT_HTML, array('context' => $contextid)); +$content = format_text($content, FORMAT_HTML, ['context' => $contextid]); $content = preg_replace('/brokenfile.php#/', 'draftfile.php', $content); print $printbutton . $OUTPUT->container($content, 'atto-preview-content'); diff --git a/settings.php b/settings.php index 7d55ac7..d3c9ae1 100644 --- a/settings.php +++ b/settings.php @@ -31,15 +31,17 @@ // Create a list of page layouts to be available. $name = new lang_string('layout', 'atto_preview'); $desc = new lang_string('layout_desc', 'atto_preview'); - $options = array ('embedded' => 'embedded', + $options = ['embedded' => 'embedded', 'popup' => 'popup', - 'print' => 'print'); + 'print' => 'print']; $default = 'print'; - $setting = new admin_setting_configselect('atto_preview/layout', - $name, - $desc, - $default, - $options); + $setting = new admin_setting_configselect( + 'atto_preview/layout', + $name, + $desc, + $default, + $options + ); $settings->add($setting); } diff --git a/version.php b/version.php index 5b5ff46..1018c79 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2016021505; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2016021506; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2018051700; // Requires this Moodle version. $plugin->component = 'atto_preview'; // Full name of the plugin (used for diagnostics). $plugin->maturity = MATURITY_STABLE; // Maturity level.