Skip to content
Snippets Groups Projects
Unverified Commit 421cc45b authored by Justus Dieckmann's avatar Justus Dieckmann Committed by GitHub
Browse files

Update for Moodle 4.3 (#190)


* CI: Update for Moodle 4.3

* Prevent dynamic property access on classes for PHP 8.2

* phpcbf for styles etc.

---------

Co-authored-by: default avatarJustus Dieckmann <justusdieckmann@wwu.de>
Co-authored-by: default avatarNinaHerrmann <nina.herrmann@uni-muenster.de>
parent 38d6dc78
No related branches found
No related tags found
No related merge requests found
Showing
with 110 additions and 107 deletions
......@@ -8,8 +8,8 @@ jobs:
strategy:
matrix:
php: ['8.1']
moodle-branch: ['MOODLE_402_STABLE']
php: ['8.2']
moodle-branch: ['MOODLE_403_STABLE']
database: ['pgsql']
steps:
......@@ -107,9 +107,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
php: ['8.0', '8.1', '8.2']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE']
database: ['mariadb', 'pgsql']
exclude:
- php: '8.2'
moodle-branch: 'MOODLE_401_STABLE'
include:
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
......
......@@ -56,7 +56,7 @@ echo $renderer->render_from_template('tool_lifecycle/search_input', [
'inputname' => 'search',
'extraclasses' => 'mb-3',
'inform' => false,
'searchstring' => 'Search for courses'
'searchstring' => 'Search for courses',
]);
echo $OUTPUT->heading(get_string('active_automatic_workflows_heading', 'tool_lifecycle'));
......
......@@ -53,15 +53,15 @@ class process_proceeded extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
$data = array(
$data = [
'context' => \context_system::instance(),
'other' => array(
'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
'stepindex' => $process->stepindex,
'courseid' => $process->courseid
)
);
'courseid' => $process->courseid,
],
];
return self::create($data);
}
......
......@@ -53,15 +53,15 @@ class process_rollback extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
$data = array(
$data = [
'context' => \context_system::instance(),
'other' => array(
'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
'stepindex' => $process->stepindex,
'courseid' => $process->courseid
)
);
'courseid' => $process->courseid,
],
];
return self::create($data);
}
......
......@@ -52,14 +52,14 @@ class process_triggered extends \core\event\base {
* @throws \dml_exception
*/
public static function event_from_process($process) {
$data = array(
$data = [
'context' => \context_system::instance(),
'other' => array(
'other' => [
'processid' => $process->id,
'workflowid' => $process->workflowid,
'courseid' => $process->courseid
)
);
'courseid' => $process->courseid,
],
];
return self::create($data);
}
......
......@@ -53,11 +53,11 @@ class form_courses_filter extends \moodleform {
$mform->setType('fullname', PARAM_TEXT);
// Edited from $this->add_action_buttons to allow custom cancel text.
$buttonarray = array();
$buttonarray = [];
$buttonarray[] = &$mform->createElement('submit', 'submitbutton',
get_string('apply', 'tool_lifecycle'));
$buttonarray[] = &$mform->createElement('cancel', 'cancel', get_string('reset'));
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
......
......@@ -48,7 +48,7 @@ class form_delays_filter extends \moodleform {
$activeworkflows = workflow_manager::get_active_workflows();
$workflowoptions = [
'' => get_string('all_delays', 'tool_lifecycle'),
'global' => get_string('globally', 'tool_lifecycle')
'global' => get_string('globally', 'tool_lifecycle'),
];
foreach ($activeworkflows as $activeworkflow) {
// Only show non-static workflows.
......
......@@ -139,9 +139,9 @@ class form_step_instance extends \moodleform {
$mform =& $this->_form;
// Add a group 'buttonar' to allow excluding it from freezing.
$buttonarray = array();
$buttonarray = [];
$buttonarray[] = &$mform->createElement('cancel');
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
......
......@@ -144,9 +144,9 @@ class form_trigger_instance extends \moodleform {
private function add_cancel_button() {
$mform =& $this->_form;
$buttonarray = array();
$buttonarray = [];
$buttonarray[] = &$mform->createElement('cancel');
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->closeHeaderBefore('buttonar');
}
......
......@@ -42,7 +42,7 @@ class form_upload_workflow extends \moodleform {
$mform = $this->_form;
$mform->addElement('filepicker', 'backupfile', get_string('file'), null,
array('accepted_types' => 'xml'));
['accepted_types' => 'xml']);
$this->add_action_buttons('true', get_string('upload'));
}
......
......@@ -102,7 +102,7 @@ class backup_manager {
*/
public static function restore_course_backup($backupid) {
global $DB, $CFG;
$backuprecord = $DB->get_record('tool_lifecycle_backups', array('id' => $backupid));
$backuprecord = $DB->get_record('tool_lifecycle_backups', ['id' => $backupid]);
// Check if backup tmp dir exists.
$backuptmpdir = $CFG->tempdir . DIRECTORY_SEPARATOR . 'backup';
......@@ -125,10 +125,10 @@ class backup_manager {
$context = \context_system::instance();
$restoreurl = new \moodle_url('/backup/restore.php',
array(
[
'contextid' => $context->id,
'filename' => $targetfilename,
)
]
);
redirect($restoreurl);
......
......@@ -60,7 +60,7 @@ class delayed_courses_manager {
} else {
$delayeduntil = time() + $duration;
$record = $DB->get_record('tool_lifecycle_delayed_workf',
array('courseid' => $courseid, 'workflowid' => $workflow->id));
['courseid' => $courseid, 'workflowid' => $workflow->id]);
if (!$record) {
$record = new \stdClass();
$record->courseid = $courseid;
......@@ -86,7 +86,7 @@ class delayed_courses_manager {
public static function get_delayed_courses_for_workflow($workflowid) {
global $DB;
$sql = 'SELECT courseid FROM {tool_lifecycle_delayed_workf} WHERE delayeduntil > :now AND workflowid = :workflowid';
return $DB->get_fieldset_sql($sql, array('now' => time(), 'workflowid' => $workflowid));
return $DB->get_fieldset_sql($sql, ['now' => time(), 'workflowid' => $workflowid]);
}
/**
......@@ -98,7 +98,7 @@ class delayed_courses_manager {
public static function set_course_delayed($courseid, $duration) {
global $DB;
$delayeduntil = time() + $duration;
$record = $DB->get_record('tool_lifecycle_delayed', array('courseid' => $courseid));
$record = $DB->get_record('tool_lifecycle_delayed', ['courseid' => $courseid]);
if (!$record) {
$record = new \stdClass();
$record->courseid = $courseid;
......@@ -120,7 +120,7 @@ class delayed_courses_manager {
*/
public static function get_course_delayed($courseid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_delayed', array('courseid' => $courseid));
$record = $DB->get_record('tool_lifecycle_delayed', ['courseid' => $courseid]);
if ($record) {
return $record->delayeduntil;
} else {
......@@ -134,8 +134,8 @@ class delayed_courses_manager {
*/
public static function get_course_delayed_wheresql() {
$where = "{course}.id IN (SELECT courseid FROM {tool_lifecycle_delayed} WHERE delayeduntil > :now)";
$params = array("now" => time());
return array($where, $params);
$params = ["now" => time()];
return [$where, $params];
}
/**
......@@ -146,7 +146,7 @@ class delayed_courses_manager {
public static function get_globally_delayed_courses() {
global $DB;
$sql = 'SELECT courseid FROM {tool_lifecycle_delayed} WHERE delayeduntil > :now';
return $DB->get_fieldset_sql($sql, array('now' => time()));
return $DB->get_fieldset_sql($sql, ['now' => time()]);
}
/**
......@@ -156,6 +156,6 @@ class delayed_courses_manager {
*/
public static function remove_delay_entry($courseid) {
global $DB;
$DB->delete_records('tool_lifecycle_delayed', array('courseid' => $courseid));
$DB->delete_records('tool_lifecycle_delayed', ['courseid' => $courseid]);
}
}
......@@ -53,10 +53,10 @@ class process_data_manager {
*/
public static function get_process_data($processid, $stepid, $key) {
global $DB;
$params = array(
$params = [
'processid' => $processid,
'keyname' => $key,
);
];
if (step_manager::is_process_data_instance_dependent($stepid)) {
$params['stepid'] = $stepid;
} else {
......@@ -78,10 +78,10 @@ class process_data_manager {
*/
public static function set_process_data($processid, $stepid, $key, $value) {
global $DB;
$entry = array(
$entry = [
'processid' => $processid,
'keyname' => $key,
);
];
if (step_manager::is_process_data_instance_dependent($stepid)) {
$entry['stepid'] = $stepid;
} else {
......
......@@ -88,7 +88,7 @@ class process_manager {
public static function get_processes() {
global $DB;
$records = $DB->get_records('tool_lifecycle_process');
$processes = array();
$processes = [];
foreach ($records as $record) {
$processes[] = process::from_record($record);
}
......@@ -103,7 +103,7 @@ class process_manager {
*/
public static function get_process_by_id($processid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_process', array('id' => $processid));
$record = $DB->get_record('tool_lifecycle_process', ['id' => $processid]);
if ($record) {
return process::from_record($record);
} else {
......@@ -119,7 +119,7 @@ class process_manager {
*/
public static function count_processes_by_workflow($workflowid) {
global $DB;
return $DB->count_records('tool_lifecycle_process', array('workflowid' => $workflowid));
return $DB->count_records('tool_lifecycle_process', ['workflowid' => $workflowid]);
}
/**
......@@ -130,8 +130,8 @@ class process_manager {
*/
public static function get_processes_by_workflow($workflowid) {
global $DB;
$records = $DB->get_records('tool_lifecycle_process', array('workflowid' => $workflowid));
$processes = array();
$records = $DB->get_records('tool_lifecycle_process', ['workflowid' => $workflowid]);
$processes = [];
foreach ($records as $record) {
$processes[] = process::from_record($record);
}
......@@ -201,7 +201,7 @@ class process_manager {
*/
private static function remove_process($process) {
global $DB;
$DB->delete_records('tool_lifecycle_procdata', array('processid' => $process->id));
$DB->delete_records('tool_lifecycle_procdata', ['processid' => $process->id]);
$DB->delete_records('tool_lifecycle_process', (array) $process);
}
......@@ -213,7 +213,7 @@ class process_manager {
*/
public static function get_process_by_course_id($courseid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_process', array('courseid' => $courseid));
$record = $DB->get_record('tool_lifecycle_process', ['courseid' => $courseid]);
if ($record) {
return process::from_record($record);
} else {
......
......@@ -109,10 +109,10 @@ class settings_manager {
$cleanedvalue = clean_param($value, $setting->paramtype);
}
$record = $DB->get_record('tool_lifecycle_settings',
array(
[
'instanceid' => $instanceid,
'type' => $type,
'name' => $setting->name)
'name' => $setting->name, ]
);
if ($record) {
if ($record->value != $cleanedvalue) {
......@@ -164,11 +164,11 @@ class settings_manager {
$lib = lib_manager::get_step_lib($instance->subpluginname);
}
$settingsvalues = array();
$settingsvalues = [];
foreach ($lib->instance_settings() as $setting) {
$record = $DB->get_record('tool_lifecycle_settings', array('instanceid' => $instanceid,
$record = $DB->get_record('tool_lifecycle_settings', ['instanceid' => $instanceid,
'type' => $type,
'name' => $setting->name));
'name' => $setting->name, ]);
if ($record) {
$value = clean_param($record->value, $setting->paramtype);
$settingsvalues[$setting->name] = $value;
......@@ -189,8 +189,8 @@ class settings_manager {
self::validate_type($type);
$DB->delete_records('tool_lifecycle_settings',
array('instanceid' => $instanceid,
'type' => $type));
['instanceid' => $instanceid,
'type' => $type, ]);
}
/**
......
......@@ -44,7 +44,7 @@ class step_manager extends subplugin_manager {
*/
public static function get_step_instance($stepinstanceid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_step', array('id' => $stepinstanceid));
$record = $DB->get_record('tool_lifecycle_step', ['id' => $stepinstanceid]);
if ($record) {
$subplugin = step_subplugin::from_record($record);
return $subplugin;
......@@ -63,9 +63,9 @@ class step_manager extends subplugin_manager {
public static function get_step_instance_by_workflow_index($workflowid, $sortindex) {
global $DB;
$record = $DB->get_record('tool_lifecycle_step',
array(
[
'workflowid' => $workflowid,
'sortindex' => $sortindex)
'sortindex' => $sortindex, ]
);
if ($record) {
$subplugin = step_subplugin::from_record($record);
......@@ -118,7 +118,7 @@ class step_manager extends subplugin_manager {
private static function remove($stepinstanceid) {
global $DB;
$transaction = $DB->start_delegated_transaction();
if ($record = $DB->get_record('tool_lifecycle_step', array('id' => $stepinstanceid))) {
if ($record = $DB->get_record('tool_lifecycle_step', ['id' => $stepinstanceid])) {
$step = step_subplugin::from_record($record);
self::remove_from_sortindex($step);
settings_manager::remove_settings($step->id, settings_type::STEP);
......@@ -138,7 +138,7 @@ class step_manager extends subplugin_manager {
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_step',
"sortindex > $toberemoved->sortindex",
array('workflowid' => $toberemoved->workflowid));
['workflowid' => $toberemoved->workflowid]);
foreach ($subplugins as $record) {
$subplugin = step_subplugin::from_record($record);
$subplugin->sortindex--;
......@@ -174,9 +174,9 @@ class step_manager extends subplugin_manager {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_step',
array(
[
'sortindex' => $otherindex,
'workflowid' => $step->workflowid)
'workflowid' => $step->workflowid, ]
);
$otherstep = step_subplugin::from_record($otherrecord);
......@@ -196,10 +196,10 @@ class step_manager extends subplugin_manager {
*/
public static function get_step_instances($workflowid) {
global $DB;
$records = $DB->get_records('tool_lifecycle_step', array(
'workflowid' => $workflowid
), 'sortindex');
$steps = array();
$records = $DB->get_records('tool_lifecycle_step', [
'workflowid' => $workflowid,
], 'sortindex');
$steps = [];
foreach ($records as $id => $record) {
$steps[$id] = step_subplugin::from_record($record);
}
......@@ -214,8 +214,8 @@ class step_manager extends subplugin_manager {
*/
public static function get_step_instances_by_subpluginname($subpluginname) {
global $DB;
$records = $DB->get_records('tool_lifecycle_step', array('subpluginname' => $subpluginname));
$steps = array();
$records = $DB->get_records('tool_lifecycle_step', ['subpluginname' => $subpluginname]);
$steps = [];
foreach ($records as $id => $record) {
$steps[$id] = step_subplugin::from_record($record);
}
......@@ -229,7 +229,7 @@ class step_manager extends subplugin_manager {
*/
public static function get_step_types() {
$subplugins = \core_component::get_plugin_list('lifecyclestep');
$result = array();
$result = [];
foreach (array_keys($subplugins) as $plugin) {
$result[$plugin] = get_string('pluginname', 'lifecyclestep_' . $plugin);
}
......@@ -291,7 +291,7 @@ class step_manager extends subplugin_manager {
public static function count_steps_of_workflow($workflowid) {
global $DB;
return $DB->count_records('tool_lifecycle_step',
array('workflowid' => $workflowid)
['workflowid' => $workflowid]
);
}
......@@ -307,7 +307,7 @@ class step_manager extends subplugin_manager {
foreach ($instances as $instance) {
settings_manager::remove_settings($instance->id, settings_type::STEP);
}
$DB->delete_records('tool_lifecycle_step', array('workflowid' => $workflowid));
$DB->delete_records('tool_lifecycle_step', ['workflowid' => $workflowid]);
}
/**
......
......@@ -74,8 +74,8 @@ class trigger_manager extends subplugin_manager {
*/
public static function get_instances($subpluginname) {
global $DB;
$result = array();
$records = $DB->get_records('tool_lifecycle_trigger', array('subpluginname' => $subpluginname));
$result = [];
$records = $DB->get_records('tool_lifecycle_trigger', ['subpluginname' => $subpluginname]);
foreach ($records as $record) {
$subplugin = trigger_subplugin::from_record($record);
$result[] = $subplugin;
......@@ -91,7 +91,7 @@ class trigger_manager extends subplugin_manager {
*/
private static function get_subplugin_by_id($subpluginid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_trigger', array('id' => $subpluginid));
$record = $DB->get_record('tool_lifecycle_trigger', ['id' => $subpluginid]);
if ($record) {
$subplugin = trigger_subplugin::from_record($record);
return $subplugin;
......@@ -142,7 +142,7 @@ class trigger_manager extends subplugin_manager {
private static function remove($triggerinstanceid) {
global $DB;
$transaction = $DB->start_delegated_transaction();
if ($record = $DB->get_record('tool_lifecycle_trigger', array('id' => $triggerinstanceid))) {
if ($record = $DB->get_record('tool_lifecycle_trigger', ['id' => $triggerinstanceid])) {
$trigger = trigger_subplugin::from_record($record);
self::remove_from_sortindex($trigger);
settings_manager::remove_settings($trigger->id, settings_type::TRIGGER);
......@@ -160,8 +160,8 @@ class trigger_manager extends subplugin_manager {
*/
public static function get_triggers_for_workflow($workflowid) {
global $DB;
$records = $DB->get_records('tool_lifecycle_trigger', array('workflowid' => $workflowid), 'sortindex');
$output = array();
$records = $DB->get_records('tool_lifecycle_trigger', ['workflowid' => $workflowid], 'sortindex');
$output = [];
foreach ($records as $record) {
$subplugin = trigger_subplugin::from_record($record);
$output[] = $subplugin;
......@@ -180,7 +180,7 @@ class trigger_manager extends subplugin_manager {
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_trigger',
"sortindex > $toberemoved->sortindex",
array('workflowid' => $toberemoved->workflowid));
['workflowid' => $toberemoved->workflowid]);
foreach ($subplugins as $record) {
$subplugin = trigger_subplugin::from_record($record);
$subplugin->sortindex--;
......@@ -216,9 +216,9 @@ class trigger_manager extends subplugin_manager {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_trigger',
array(
[
'sortindex' => $otherindex,
'workflowid' => $trigger->workflowid)
'workflowid' => $trigger->workflowid, ]
);
$othertrigger = trigger_subplugin::from_record($otherrecord);
......@@ -237,7 +237,7 @@ class trigger_manager extends subplugin_manager {
*/
public static function get_trigger_types() {
$subplugins = \core_component::get_plugin_list('lifecycletrigger');
$result = array();
$result = [];
foreach (array_keys($subplugins) as $plugin) {
$result[$plugin] = get_string('pluginname', 'lifecycletrigger_' . $plugin);
}
......@@ -251,7 +251,7 @@ class trigger_manager extends subplugin_manager {
*/
public static function get_chooseable_trigger_types() {
$triggers = self::get_trigger_types();
$result = array();
$result = [];
foreach ($triggers as $id => $trigger) {
$lib = lib_manager::get_trigger_lib($id);
if ($lib->has_multiple_instances()) {
......@@ -300,7 +300,7 @@ class trigger_manager extends subplugin_manager {
public static function count_triggers_of_workflow($workflowid) {
global $DB;
return $DB->count_records('tool_lifecycle_trigger',
array('workflowid' => $workflowid)
['workflowid' => $workflowid]
);
}
......@@ -316,7 +316,7 @@ class trigger_manager extends subplugin_manager {
foreach ($instances as $instance) {
settings_manager::remove_settings($instance->id, settings_type::TRIGGER);
}
$DB->delete_records('tool_lifecycle_trigger', array('workflowid' => $workflowid));
$DB->delete_records('tool_lifecycle_trigger', ['workflowid' => $workflowid]);
}
/**
......
......@@ -70,7 +70,7 @@ class workflow_manager {
if ($hard || self::is_removable($workflowid)) {
trigger_manager::remove_instances_of_workflow($workflowid);
step_manager::remove_instances_of_workflow($workflowid);
$DB->delete_records('tool_lifecycle_workflow', array('id' => $workflowid));
$DB->delete_records('tool_lifecycle_workflow', ['id' => $workflowid]);
}
}
......@@ -114,7 +114,7 @@ class workflow_manager {
*/
public static function get_workflow($workflowid) {
global $DB;
$record = $DB->get_record('tool_lifecycle_workflow', array('id' => $workflowid));
$record = $DB->get_record('tool_lifecycle_workflow', ['id' => $workflowid]);
if ($record) {
$workflow = workflow::from_record($record);
return $workflow;
......@@ -131,7 +131,7 @@ class workflow_manager {
*/
public static function get_workflows() {
global $DB;
$result = array();
$result = [];
$records = $DB->get_records('tool_lifecycle_workflow');
foreach ($records as $record) {
$result[] = workflow::from_record($record);
......@@ -150,7 +150,7 @@ class workflow_manager {
$records = $DB->get_records_sql(
'SELECT * FROM {tool_lifecycle_workflow}
WHERE timeactive IS NOT NULL ORDER BY sortindex');
$result = array();
$result = [];
foreach ($records as $record) {
$result[] = workflow::from_record($record);
}
......@@ -168,8 +168,8 @@ class workflow_manager {
$records = $DB->get_records_sql(
'SELECT * FROM {tool_lifecycle_workflow}
WHERE timeactive IS NOT NULL AND
manual = ? ORDER BY sortindex', array(false));
$result = array();
manual = ? ORDER BY sortindex', [false]);
$result = [];
foreach ($records as $record) {
$result[] = workflow::from_record($record);
}
......@@ -186,8 +186,8 @@ class workflow_manager {
global $DB;
$sql = 'SELECT t.* FROM {tool_lifecycle_workflow} w JOIN {tool_lifecycle_trigger} t ON t.workflowid = w.id' .
' WHERE w.timeactive IS NOT NULL AND w.manual = ?';
$records = $DB->get_records_sql($sql, array(true));
$result = array();
$records = $DB->get_records_sql($sql, [true]);
$result = [];
foreach ($records as $record) {
$result[] = trigger_subplugin::from_record($record);
}
......@@ -204,7 +204,7 @@ class workflow_manager {
*/
public static function get_manual_trigger_tools_for_active_workflows() {
$triggers = self::get_active_manual_workflow_triggers();
$tools = array();
$tools = [];
foreach ($triggers as $trigger) {
$settings = settings_manager::get_settings($trigger->id, settings_type::TRIGGER);
$tools[] = new manual_trigger_tool($trigger->id, $settings['icon'], $settings['displayname'], $settings['capability']);
......@@ -325,8 +325,8 @@ class workflow_manager {
$transaction = $DB->start_delegated_transaction();
$otherrecord = $DB->get_record('tool_lifecycle_workflow',
array(
'sortindex' => $otherindex)
[
'sortindex' => $otherindex, ]
);
$otherworkflow = workflow::from_record($otherrecord);
......
......@@ -89,7 +89,7 @@ class active_processes_table extends \table_sql {
get_string('fullnamecourse'),
get_string('workflow', 'tool_lifecycle'),
get_string('step', 'tool_lifecycle'),
get_string('tools', 'tool_lifecycle')]);
get_string('tools', 'tool_lifecycle'), ]);
$this->column_nosort = ['tools'];
}
......
......@@ -56,9 +56,9 @@ abstract class active_workflows_table extends workflow_table {
$alt = get_string('viewsteps', 'tool_lifecycle');
$icon = 't/viewdetails';
$overviewurl = new \moodle_url(urls::WORKFLOW_DETAILS,
array('wf' => $row->id));
$output .= $OUTPUT->action_icon($overviewurl, new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
null, array('title' => $alt));
['wf' => $row->id]);
$output .= $OUTPUT->action_icon($overviewurl, new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
null, ['title' => $alt]);
if (workflow_manager::is_disableable($row->id)) {
$action = action::WORKFLOW_BACKUP;
......@@ -69,22 +69,22 @@ abstract class active_workflows_table extends workflow_table {
$alt = get_string('disableworkflow', 'tool_lifecycle');
$icon = 't/disable';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
array('workflowid' => $row->id, 'action' => action::WORKFLOW_DISABLE, 'sesskey' => sesskey()));
['workflowid' => $row->id, 'action' => action::WORKFLOW_DISABLE, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('disableworkflow_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
new \pix_icon($icon, $alt, 'tool_lifecycle', array('title' => $alt)),
new \pix_icon($icon, $alt, 'tool_lifecycle', ['title' => $alt]),
$confirmaction,
array('title' => $alt));
['title' => $alt]);
$alt = get_string('abortdisableworkflow', 'tool_lifecycle');
$icon = 't/stop';
$url = new \moodle_url(urls::DEACTIVATED_WORKFLOWS,
array('workflowid' => $row->id, 'action' => action::WORKFLOW_ABORTDISABLE, 'sesskey' => sesskey()));
['workflowid' => $row->id, 'action' => action::WORKFLOW_ABORTDISABLE, 'sesskey' => sesskey()]);
$confirmaction = new \confirm_action(get_string('abortdisableworkflow_confirm', 'tool_lifecycle'));
$output .= $OUTPUT->action_icon($url,
new \pix_icon($icon, $alt, 'moodle', array('title' => $alt)),
new \pix_icon($icon, $alt, 'moodle', ['title' => $alt]),
$confirmaction,
array('title' => $alt)
['title' => $alt]
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment