MDL-42190 workshop: Fix the coding style of the patch

This commit is contained in:
David Mudrák
2016-01-25 15:17:44 +01:00
parent 30c52da9be
commit 3fa22899b6
2 changed files with 20 additions and 9 deletions
@@ -71,6 +71,7 @@ class submission_deleted extends \core\event\base {
/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
@@ -79,7 +80,7 @@ class submission_deleted extends \core\event\base {
}
/**
* replace add_to_log() statement.
* Replace add_to_log() statement.
*
* @return array of parameters to be passed to legacy add_to_log() function.
*/
@@ -89,10 +90,20 @@ class submission_deleted extends \core\event\base {
$this->objectid, $this->contextinstanceid);
}
/**
* Defines mapping of the 'objectid' property when restoring course logs.
*
* @return array
*/
public static function get_objectid_mapping() {
return array('db' => 'workshop_submissions', 'restore' => 'workshop_submission');
}
/**
* Defines mapping of the 'other' property when restoring course logs.
*
* @return array|bool
*/
public static function get_other_mapping() {
// Nothing to map.
return false;
+8 -8
View File
@@ -27,15 +27,15 @@ require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/locallib.php');
require_once($CFG->dirroot . '/repository/lib.php');
$cmid = required_param('cmid', PARAM_INT); // course module id
$id = optional_param('id', 0, PARAM_INT); // submission id
$edit = optional_param('edit', false, PARAM_BOOL); // open for editing?
$assess = optional_param('assess', false, PARAM_BOOL); // instant assessment required
$delete = optional_param('delete', false, PARAM_BOOL); // example removal requested
$confirm = optional_param('confirm', false, PARAM_BOOL); // example removal request confirmed
$cmid = required_param('cmid', PARAM_INT); // Course module id.
$id = optional_param('id', 0, PARAM_INT); // Submission id.
$edit = optional_param('edit', false, PARAM_BOOL); // Open the page for editing?
$assess = optional_param('assess', false, PARAM_BOOL); // Instant assessment required.
$delete = optional_param('delete', false, PARAM_BOOL); // Submission removal requested.
$confirm = optional_param('confirm', false, PARAM_BOOL); // Submission removal request confirmed.
$cm = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
require_login($course, false, $cm);
if (isguestuser()) {