From 7ad5a6272760c81c0b07138a477ca499eded7b9a Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 25 Jul 2010 13:56:54 +0000 Subject: [PATCH] MDL-21249 improved php docs and adding direct access prevention in editors --- .../textarea/lang/en/editor_textarea.php | 7 +-- lib/editor/textarea/lib.php | 5 +- lib/editor/textarea/version.php | 7 ++- lib/editor/tinymce/extra/strings.php | 3 +- .../tinymce/extra/tools/update_lang_files.php | 4 +- lib/editor/tinymce/lang/en/editor_tinymce.php | 3 +- lib/editor/tinymce/lib.php | 5 +- lib/editor/tinymce/settings.php | 3 +- lib/editor/tinymce/version.php | 5 +- lib/grade/constants.php | 6 ++- lib/grade/grade_category.php | 7 ++- lib/grade/grade_grade.php | 46 ++++++++++--------- lib/grade/grade_item.php | 45 +++++++++--------- lib/grade/grade_object.php | 45 +++++++++--------- lib/grade/grade_outcome.php | 46 ++++++++++--------- lib/grade/grade_scale.php | 46 ++++++++++--------- 16 files changed, 156 insertions(+), 127 deletions(-) diff --git a/lib/editor/textarea/lang/en/editor_textarea.php b/lib/editor/textarea/lang/en/editor_textarea.php index 0d6382095bb93..a3aa32f9f19b7 100644 --- a/lib/editor/textarea/lang/en/editor_textarea.php +++ b/lib/editor/textarea/lang/en/editor_textarea.php @@ -18,9 +18,10 @@ /** * Strings for component 'editor_textarea', language 'en', branch 'MOODLE_20_STABLE' * - * @package editor_textarea - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @package editor + * @subpackage textarea + * @copyright 2009 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['pluginname'] = 'Plain text area'; diff --git a/lib/editor/textarea/lib.php b/lib/editor/textarea/lib.php index 936de29fb3eaf..9c8bc31215cfa 100644 --- a/lib/editor/textarea/lib.php +++ b/lib/editor/textarea/lib.php @@ -18,11 +18,14 @@ /** * Failsafe textarea editor support. * - * @package editor_textarea + * @package editor + * @subpackage textarea * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + class textarea_texteditor extends texteditor { public function supported_by_browser() { return true; diff --git a/lib/editor/textarea/version.php b/lib/editor/textarea/version.php index 6ead9bafda0a5..064c32fed0b5e 100644 --- a/lib/editor/textarea/version.php +++ b/lib/editor/textarea/version.php @@ -16,12 +16,15 @@ // along with Moodle. If not, see . /** - * Failsafe textare editor support version file. + * Failsafe textarea editor support version file. * - * @package editor_textarea + * @package editor + * @subpackage textarea * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + $plugin->version = 2009051400; $plugin->requires = 2009051200; diff --git a/lib/editor/tinymce/extra/strings.php b/lib/editor/tinymce/extra/strings.php index 6a398321f9cb4..74c09f3c0b383 100644 --- a/lib/editor/tinymce/extra/strings.php +++ b/lib/editor/tinymce/extra/strings.php @@ -18,7 +18,8 @@ /** * On-the-fly conversion of Moodle lang strings to TinyMCE expected JS format. * - * @package editor_tinymce + * @package editor + * @subpackage tinymce * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/editor/tinymce/extra/tools/update_lang_files.php b/lib/editor/tinymce/extra/tools/update_lang_files.php index 538c4d896b8ca..4381781cf5a4d 100644 --- a/lib/editor/tinymce/extra/tools/update_lang_files.php +++ b/lib/editor/tinymce/extra/tools/update_lang_files.php @@ -18,8 +18,8 @@ /** * This script imports TinyMCE lang strings into Moodle lang packs. * - * @package moodlecore - * @subpackage editor + * @package editor + * @subpackage tinymce * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/editor/tinymce/lang/en/editor_tinymce.php b/lib/editor/tinymce/lang/en/editor_tinymce.php index 7066f6e3cc50b..4ad9bdfef1823 100644 --- a/lib/editor/tinymce/lang/en/editor_tinymce.php +++ b/lib/editor/tinymce/lang/en/editor_tinymce.php @@ -18,7 +18,8 @@ /** * Strings for component 'editor_tinymce', language 'en', branch 'MOODLE_20_STABLE' * - * @package editor_tinymce + * @package editor + * @subpackage tinymce * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/editor/tinymce/lib.php b/lib/editor/tinymce/lib.php index e144d3470e73b..b6b2ab0944937 100644 --- a/lib/editor/tinymce/lib.php +++ b/lib/editor/tinymce/lib.php @@ -18,11 +18,14 @@ /** * TinyMCE text editor integration. * - * @package editor_tinymce + * @package editor + * @subpackage tinymce * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + class tinymce_texteditor extends texteditor { /** @var string active version - directory name */ public $version = '3.3.8'; diff --git a/lib/editor/tinymce/settings.php b/lib/editor/tinymce/settings.php index 451ea43e360ca..9f406d6f3aec6 100644 --- a/lib/editor/tinymce/settings.php +++ b/lib/editor/tinymce/settings.php @@ -18,7 +18,8 @@ /** * TinyMCE admin settings * - * @package editor_tinymce + * @package editor + * @subpackage tinymce * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/lib/editor/tinymce/version.php b/lib/editor/tinymce/version.php index d3849f074aeff..c576615c76560 100644 --- a/lib/editor/tinymce/version.php +++ b/lib/editor/tinymce/version.php @@ -18,11 +18,14 @@ /** * TinyMCE text editor integration version file. * - * @package editor_tinymce + * @package editor + * @subpackage tinymce * @copyright 2009 Petr Skoda (http://skodak.org) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + $plugin->version = 2010070400; $plugin->requires = 2010070300; $plugin->release = '3.3.8'; \ No newline at end of file diff --git a/lib/grade/constants.php b/lib/grade/constants.php index c8583f31a6596..f26390ced4e05 100644 --- a/lib/grade/constants.php +++ b/lib/grade/constants.php @@ -17,12 +17,14 @@ /** * Definitions of constants for gradebook * - * @package moodlecore + * @package core * @subpackage grade * @copyright 2007 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - + +defined('MOODLE_INTERNAL') || die(); + // category aggregation types define('GRADE_AGGREGATE_MEAN', 0); define('GRADE_AGGREGATE_MEDIAN', 2); diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index 6ca0608f4a856..1b2baac45ba20 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -17,11 +17,14 @@ /** * Definitions of constants for gradebook * - * @package moodlecore + * @package core * @subpackage grade * @copyright 2006 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ + +defined('MOODLE_INTERNAL') || die(); + require_once('grade_object.php'); /** @@ -1513,7 +1516,7 @@ public static function set_properties(&$instance, $params) { //Flip from the default of 0 to 1 (or vice versa) if ALL items in the category are still set to the old default. if ($params->aggregation==GRADE_AGGREGATE_WEIGHTED_MEAN || $params->aggregation==GRADE_AGGREGATE_EXTRACREDIT_MEAN) { $sql = $defaultaggregationcoef = null; - + if ($params->aggregation==GRADE_AGGREGATE_WEIGHTED_MEAN) { //if all items in this category have aggregation coefficient of 0 we can change it to 1 ie evenly weighted $sql = "select count(id) from {grade_items} where categoryid=:categoryid and aggregationcoef!=0"; diff --git a/lib/grade/grade_grade.php b/lib/grade/grade_grade.php index 35c2e7346fc42..4bbc427b2dc51 100644 --- a/lib/grade/grade_grade.php +++ b/lib/grade/grade_grade.php @@ -1,27 +1,29 @@ . +/** + * Definitions of grade grade class + * + * @package core + * @subpackage grade + * @copyright 2006 Nicolas Connault + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); require_once('grade_object.php'); diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 6ef41d8cc6c95..0c5d031399b5e 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -1,28 +1,29 @@ . +/** + * Definitions of grade item class + * + * @package core + * @subpackage grade + * @copyright 2006 Nicolas Connault + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +defined('MOODLE_INTERNAL') || die(); require_once('grade_object.php'); /** diff --git a/lib/grade/grade_object.php b/lib/grade/grade_object.php index 3c21b00700aad..72a86e2ab6a02 100644 --- a/lib/grade/grade_object.php +++ b/lib/grade/grade_object.php @@ -1,28 +1,29 @@ . +/** + * Definitions of grade object class + * + * @package core + * @subpackage grade + * @copyright 2006 Nicolas Connault + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +defined('MOODLE_INTERNAL') || die(); /** * An abstract object that holds methods and attributes common to all grade_* objects defined here. * @abstract diff --git a/lib/grade/grade_outcome.php b/lib/grade/grade_outcome.php index 37cec7fe92db0..a165a2b7825f0 100644 --- a/lib/grade/grade_outcome.php +++ b/lib/grade/grade_outcome.php @@ -1,27 +1,29 @@ . +/** + * Definitions of grade outcome class + * + * @package core + * @subpackage grade + * @copyright 2006 Nicolas Connault + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); require_once('grade_object.php'); diff --git a/lib/grade/grade_scale.php b/lib/grade/grade_scale.php index ed524e1ea8179..5a43f596c43be 100644 --- a/lib/grade/grade_scale.php +++ b/lib/grade/grade_scale.php @@ -1,27 +1,29 @@ . +/** + * Definitions of grade scale class + * + * @package core + * @subpackage grade + * @copyright 2006 Nicolas Connault + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); require_once('grade_object.php');