From 16e2b71a54755347262262902ab9daef310284e2 Mon Sep 17 00:00:00 2001 From: scyrma Date: Fri, 27 Jun 2008 03:00:29 +0000 Subject: [PATCH] MDL-11113: Next moodle version requires PHP5: removing php4 compatibility code. --- lib/editor/tinymce/tinymce.class.php | 15 ++------------- lib/editorlib.php | 22 +++++----------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/lib/editor/tinymce/tinymce.class.php b/lib/editor/tinymce/tinymce.class.php index e710c36514..bf56dc6df5 100644 --- a/lib/editor/tinymce/tinymce.class.php +++ b/lib/editor/tinymce/tinymce.class.php @@ -72,11 +72,11 @@ class tinymce extends editorObject { var $printdialogs = false; /** - * PHP4 style class constructor. + * PHP5 style class constructor. * * @param int $courseid */ - function tinymce ($courseid) { + function __construct($courseid) { parent::editorObject(); $this->courseid = clean_param($courseid, PARAM_INT); @@ -115,15 +115,6 @@ class tinymce extends editorObject { $this->printdialogs = has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid)) ? true : false; } - /** - * PHP5 style class constructor. - * - * @param int $courseid - */ - function __construct($courseid) { - $this->tinymce($courseid); - } - /** * Checks configuration key validity. * @param string $key Configuration key to check. @@ -155,7 +146,6 @@ class tinymce extends editorObject { } } return false; - } /** @@ -304,7 +294,6 @@ class tinymce extends editorObject { if ( !empty($this->cfg->editorsrc) ) { unset($this->cfg->editorsrc); } - } /** diff --git a/lib/editorlib.php b/lib/editorlib.php index e5ad3f570d..6ca03e0a0b 100644 --- a/lib/editorlib.php +++ b/lib/editorlib.php @@ -3,7 +3,7 @@ /** * Editor class for Moodle. * - * This library is made to make easier to intergrate + * This library is made to make easier to integrate * WYSIWYG editors into Moodle. * * @author Janne Mikkonen @@ -32,24 +32,14 @@ class editorObject { var $cfg; /** - * PHP4 style class constructor. - * - * @uses $CFG, $USER + * Constructor */ - function editorObject () { + function __construct() { global $CFG, $USER; $this->cfg = &$CFG; $this->user = &$USER; $this->courseid = NULL; - } - - /** - * PHP5 style class constructor. - * - */ - function __construct() { - $this->editorObject(); - } + } /** * Method to load necessary editor codes to @@ -106,9 +96,7 @@ class editorObject { return (new tinymce($courseid)); break; } - } - } /** @@ -123,6 +111,6 @@ class editorObject { echo ''; exit; } - } + ?> -- 2.39.5