MDL-42190 workshop: Fix the coding style of the patch
authorDavid Mudrák <david@moodle.com>
Thu, 21 Jan 2016 11:14:42 +0000 (12:14 +0100)
committerDavid Mudrák <david@moodle.com>
Mon, 25 Jan 2016 14:17:44 +0000 (15:17 +0100)
mod/workshop/classes/event/submission_deleted.php
mod/workshop/submission.php

index f8af1e2..69affe6 100644 (file)
@@ -71,6 +71,7 @@ class submission_deleted extends \core\event\base {
 
     /**
      * Returns relevant URL.
 
     /**
      * Returns relevant URL.
+     *
      * @return \moodle_url
      */
     public function get_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.
      */
      *
      * @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);
     }
 
             $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');
     }
 
     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;
     public static function get_other_mapping() {
         // Nothing to map.
         return false;
index d161c83..47c57c2 100644 (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');
 
 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
-
-$cm         = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
-$course     = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
+$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);
 
 require_login($course, false, $cm);
 if (isguestuser()) {
 
 require_login($course, false, $cm);
 if (isguestuser()) {