Skip to content

Commit

Permalink
Update for 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Thies committed Oct 11, 2024
1 parent 1179242 commit ad73e09
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 42 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ 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'
ports:
- 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"
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 3 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
}

/**
Expand All @@ -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');
}

10 changes: 5 additions & 5 deletions preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');

Expand Down
16 changes: 9 additions & 7 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ad73e09

Please sign in to comment.