mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
MDL-32094 fix E_STRICT issues in lesson API
It is not possible to change method signatures in PHP...
This commit is contained in:
parent
072db71c90
commit
0ed6f71232
7 changed files with 17 additions and 15 deletions
|
@ -830,7 +830,7 @@ abstract class lesson_add_page_form_base extends moodleform {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function construction_override() {
|
||||
public function construction_override($pageid, lesson $lesson) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1620,14 +1620,16 @@ abstract class lesson_base {
|
|||
return !empty($this->properties->{$key});
|
||||
}
|
||||
|
||||
//NOTE: E_STRICT does not allow to change function signature!
|
||||
|
||||
/**
|
||||
* If overridden should create a new instance, save it in the DB and return it
|
||||
* If implemented should create a new instance, save it in the DB and return it
|
||||
*/
|
||||
public static function create() {}
|
||||
//public static function create() {}
|
||||
/**
|
||||
* If overridden should load an instance from the DB and return it
|
||||
* If implemented should load an instance from the DB and return it
|
||||
*/
|
||||
public static function load() {}
|
||||
//public static function load() {}
|
||||
/**
|
||||
* Fetches all of the properties of the object
|
||||
* @return stdClass
|
||||
|
|
|
@ -72,7 +72,7 @@ class lesson_page_type_branchtable extends lesson_page {
|
|||
return $jumps;
|
||||
}
|
||||
|
||||
public static function get_jumptooptions($firstpage, $lesson) {
|
||||
public static function get_jumptooptions($firstpage, lesson $lesson) {
|
||||
global $DB, $PAGE;
|
||||
$jump = array();
|
||||
$jump[0] = get_string("thispage", "lesson");
|
||||
|
@ -199,7 +199,7 @@ class lesson_page_type_branchtable extends lesson_page {
|
|||
redirect(new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id,'pageid'=>$newpageid)));
|
||||
}
|
||||
|
||||
public function display_answers($table) {
|
||||
public function display_answers(html_table $table) {
|
||||
$answers = $this->get_answers();
|
||||
$options = new stdClass;
|
||||
$options->noclean = true;
|
||||
|
@ -243,7 +243,7 @@ class lesson_page_type_branchtable extends lesson_page {
|
|||
return $answerpage;
|
||||
}
|
||||
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
if (empty($properties->display)) {
|
||||
$properties->display = '0';
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class lesson_page_type_endofbranch extends lesson_page {
|
|||
public function get_grayout() {
|
||||
return 1;
|
||||
}
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
global $DB, $PAGE;
|
||||
|
||||
$properties->id = $this->properties->id;
|
||||
|
@ -178,7 +178,7 @@ class lesson_add_page_form_endofbranch extends lesson_add_page_form_base {
|
|||
$this->add_jumpto(0);
|
||||
}
|
||||
|
||||
public function construction_override($pageid, $lesson) {
|
||||
public function construction_override($pageid, lesson $lesson) {
|
||||
global $DB, $CFG, $PAGE;
|
||||
require_sesskey();
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class lesson_page_type_endofcluster extends lesson_page {
|
|||
public function get_grayout() {
|
||||
return 1;
|
||||
}
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
global $DB, $PAGE;
|
||||
|
||||
$properties->id = $this->properties->id;
|
||||
|
@ -160,7 +160,7 @@ class lesson_add_page_form_endofcluster extends lesson_add_page_form_base {
|
|||
$this->add_jumpto(0);
|
||||
}
|
||||
|
||||
public function construction_override($pageid, $lesson) {
|
||||
public function construction_override($pageid, lesson $lesson) {
|
||||
global $CFG, $PAGE, $DB;
|
||||
require_sesskey();
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class lesson_page_type_essay extends lesson_page {
|
|||
$result->studentanswer = s($studentanswer);
|
||||
return $result;
|
||||
}
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
global $DB, $PAGE;
|
||||
$answers = $this->get_answers();
|
||||
$properties->id = $this->properties->id;
|
||||
|
|
|
@ -293,7 +293,7 @@ class lesson_page_type_matching extends lesson_page {
|
|||
* @param stdClass $properties
|
||||
* @return bool
|
||||
*/
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
global $DB, $PAGE;
|
||||
$answers = $this->get_answers();
|
||||
$properties->id = $this->properties->id;
|
||||
|
|
|
@ -153,7 +153,7 @@ class lesson_page_type_truefalse extends lesson_page {
|
|||
* @param stdClass $properties
|
||||
* @return bool
|
||||
*/
|
||||
public function update($properties) {
|
||||
public function update($properties, $context = null, $maxbytes = null) {
|
||||
global $DB, $PAGE;
|
||||
$answers = $this->get_answers();
|
||||
$properties->id = $this->properties->id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue