]> git.mjollnir.org Git - moodle.git/commitdiff
forum MDL-21086 cleaned up boilderplates and php doc packages
authorSam Hemelryk <sam@moodle.com>
Thu, 10 Dec 2009 03:11:18 +0000 (03:11 +0000)
committerSam Hemelryk <sam@moodle.com>
Thu, 10 Dec 2009 03:11:18 +0000 (03:11 +0000)
29 files changed:
mod/forum/backuplib.php
mod/forum/db/access.php
mod/forum/db/install.php
mod/forum/db/messages.php
mod/forum/db/upgrade.php
mod/forum/discuss.php
mod/forum/index.php
mod/forum/lib.php
mod/forum/markposts.php
mod/forum/mod_form.php
mod/forum/post.php
mod/forum/post_form.php
mod/forum/rate.php
mod/forum/rate_ajax.php
mod/forum/renderer.php
mod/forum/report.php
mod/forum/restorelib.php
mod/forum/rsslib.php
mod/forum/search.php
mod/forum/settings.php
mod/forum/settracking.php
mod/forum/simpletest/test_forum_portfolio_callers.php
mod/forum/simpletest/testmodforumlib.php
mod/forum/subscribe.php
mod/forum/subscribers.php
mod/forum/unsubscribeall.php
mod/forum/user.php
mod/forum/version.php
mod/forum/view.php

index f8bbe2d571d7f312a426ac7f8d37b7cd78c21e90..b7921cfac0afcd7d9695ff561acf570a306b8f0e 100644 (file)
@@ -1,6 +1,27 @@
 <?php
-    //This php script contains all the stuff to backup/restore
-    //forum mods
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This php script contains all the stuff to backup/restore forum mods
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
     //This is the "graphical" structure of the forum mod:
     //
index fd144f1e35cdc7b9068e37aba73ad10bf3e8fbd6..3523b8c19d705a75e6eb0b828434a07cb1bd9fe2 100644 (file)
@@ -1,32 +1,51 @@
 <?php
+
+// This file is part of Moodle - http://moodle.org/
 //
-// Capability definitions for the forum module.
-//
-// The capabilities are loaded into the database table when the module is
-// installed or updated. Whenever the capability definitions are updated,
-// the module version number should be bumped up.
-//
-// The system has four possible values for a capability:
-// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
-//
-//
-// CAPABILITY NAMING CONVENTION
-//
-// It is important that capability names are unique. The naming convention
-// for capabilities that are specific to modules and blocks is as follows:
-//   [mod/block]/<plugin_name>:<capabilityname>
-//
-// component_name should be the same as the directory name of the mod or block.
-//
-// Core moodle capabilities are defined thus:
-//    moodle/<capabilityclass>:<capabilityname>
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 //
-// Examples: mod/forum:viewpost
-//           block/recent_activity:view
-//           moodle/site:deleteuser
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
 //
-// The variable name for the capability definitions array is $capabilities
-
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Capability definitions for the forum module.
+ * 
+ * The capabilities are loaded into the database table when the module is
+ * installed or updated. Whenever the capability definitions are updated,
+ * the module version number should be bumped up.
+ *
+ * The system has four possible values for a capability:
+ * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
+ *
+ * CAPABILITY NAMING CONVENTION
+ *
+ * It is important that capability names are unique. The naming convention
+ * for capabilities that are specific to modules and blocks is as follows:
+ *   [mod/block]/<plugin_name>:<capabilityname>
+ *
+ * component_name should be the same as the directory name of the mod or block.
+ *
+ * Core moodle capabilities are defined thus:
+ *    moodle/<capabilityclass>:<capabilityname>
+ *
+ * Examples: mod/forum:viewpost
+ *           block/recent_activity:view
+ *           moodle/site:deleteuser
+ *
+ * The variable name for the capability definitions array is $capabilities
+ *
+ * @package mod-forum
+ * @copyright 2006 vyshane
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 $capabilities = array(
 
index c17fa21b6a8be6f4661239f4c2396e5d53c8e54d..d171d397a0b921fb29e070808355fd694687aba8 100644 (file)
@@ -1,9 +1,30 @@
 <?php
 
-// This file replaces:
-//   * STATEMENTS section in db/install.xml
-//   * lib.php/modulename_install() post installation hook
-//   * partially defaults.php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file replaces:
+ *  - STATEMENTS section in db/install.xml
+ *  - lib.php/modulename_install() post installation hook
+ *  - partially defaults.php
+ *
+ * @package mod-forum
+ * @copyright  2009 Petr Skoda (http://skodak.org)
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 function xmldb_forum_install() {
     global $DB;
index 154d977cef4626838fc18839de3531b7631c1fa1..420dc0edfca63ab02a5d12e2fbd33490c5047720 100644 (file)
@@ -1,30 +1,27 @@
 <?php
 
-///////////////////////////////////////////////////////////////////////////
-// Defines message providers (types of messages being sent)              //
-///////////////////////////////////////////////////////////////////////////
-//                                                                       //
-// NOTICE OF COPYRIGHT                                                   //
-//                                                                       //
-// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
-//          http://moodle.org                                            //
-//                                                                       //
-// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
-//                                                                       //
-// This program is free software; you can redistribute it and/or modify  //
-// it under the terms of the GNU General Public License as published by  //
-// the Free Software Foundation; either version 2 of the License, or     //
-// (at your option) any later version.                                   //
-//                                                                       //
-// This program is distributed in the hope that it will be useful,       //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
-// GNU General Public License for more details:                          //
-//                                                                       //
-//          http://www.gnu.org/copyleft/gpl.html                         //
-//                                                                       //
-///////////////////////////////////////////////////////////////////////////
-
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Defines message providers (types of messages being sent)
+ *
+ * @package mod-forum
+ * @copyright  1999 onwards  Martin Dougiamas  http://moodle.com
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 $messageproviders = array (
 
index 39480eb6f06588ee59b7a05b0ba1e3f405f40537..283ba240b2d21483eaac2bcf17a9e4dd4afa85b0 100644 (file)
@@ -1,24 +1,45 @@
 <?php
 
-// This file keeps track of upgrades to
-// the forum module
+// This file is part of Moodle - http://moodle.org/
 //
-// Sometimes, changes between versions involve
-// alterations to database structures and other
-// major things that may break installations.
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
 //
-// The upgrade function in this file will attempt
-// to perform all the necessary actions to upgrade
-// your older installtion to the current version.
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
 //
-// If there's something it cannot do itself, it
-// will tell you what you need to do.
-//
-// The commands in here will all be database-neutral,
-// using the methods of database_manager class
-//
-// Please do not forget to use upgrade_set_timeout()
-// before any action that may take longer time to finish.
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file keeps track of upgrades to
+ * the forum module
+ *
+ * Sometimes, changes between versions involve
+ * alterations to database structures and other
+ * major things that may break installations.
+ *
+ * The upgrade function in this file will attempt
+ * to perform all the necessary actions to upgrade
+ * your older installtion to the current version.
+ *
+ * If there's something it cannot do itself, it
+ * will tell you what you need to do.
+ *
+ * The commands in here will all be database-neutral,
+ * using the methods of database_manager class
+ *
+ * Please do not forget to use upgrade_set_timeout()
+ * before any action that may take longer time to finish.
+ *
+ * @package mod-forum
+ * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 function xmldb_forum_upgrade($oldversion) {
     global $CFG, $DB, $OUTPUT;
index ed1a9adf35aa03f121aa575d838db3dce8113b90..4bb2956d799816db31f0fd592bef8df4b5c59750 100644 (file)
@@ -1,7 +1,28 @@
 <?php
 
-//  Displays a post, and all the posts below it.
-//  If no post is given, displays all posts in a discussion
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Displays a post, and all the posts below it.
+ * If no post is given, displays all posts in a discussion
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
     require_once('../../config.php');
 
index 702d76ecfd4f9ab0078750472b95ed26cfcdf937..447269e238216aa77b6a23be99e32fd19667176f 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once(dirname(__FILE__) . '/../../config.php');
 require_once($CFG->dirroot . '/course/lib.php');
 require_once($CFG->dirroot . '/mod/forum/lib.php');
index 4406e729bcf29324d15e83ac48d688b6cf543e66..d2af1a2d9ce2a8a41f35ad9fc5316f8e92144a6c 100644 (file)
@@ -16,7 +16,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * @package   forum
+ * @package mod-forum
  * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -7965,7 +7965,7 @@ function forum_get_extra_capabilities() {
 }
 
 /**
- * @package   forum
+ * @package mod-forum
  * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -8501,12 +8501,35 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
     return $forumkey;
 }
 
+/**
+ * Abstract class used by forum subscriber selection controls
+ * @package mod-forum
+ * @copyright 2009 Sam Hemelryk
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 abstract class forum_subscriber_selector_base extends user_selector_base {
 
+    /**
+     * The id of the forum this selector is being used for
+     * @var int
+     */
     protected $forumid = null;
+    /**
+     * The context of the forum this selector is being used for
+     * @var object
+     */
     protected $context = null;
+    /**
+     * The id of the current group
+     * @var int
+     */
     protected $currentgroup = null;
 
+    /**
+     * Constructor method
+     * @param string $name
+     * @param array $options
+     */
     public function __construct($name, $options) {
         parent::__construct($name, $options);
         if (isset($options['context'])) {
@@ -8520,6 +8543,11 @@ abstract class forum_subscriber_selector_base extends user_selector_base {
         }
     }
 
+    /**
+     * Returns an array of options to seralise and store for searches
+     *
+     * @return array
+     */
     protected function get_options() {
         global $CFG;
         $options = parent::get_options();
@@ -8532,11 +8560,30 @@ abstract class forum_subscriber_selector_base extends user_selector_base {
 
 }
 
+/**
+ * A user selector control for potential subscribers to the selected forum
+ * @package mod-forum
+ * @copyright 2009 Sam Hemelryk
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 class forum_potential_subscriber_selector extends forum_subscriber_selector_base {
 
+    /**
+     * If set to true EVERYONE in this course is force subscribed to this forum
+     * @var bool
+     */
     protected $forcesubscribed = false;
+    /**
+     * Can be used to store existing subscribers so that they can be removed from
+     * the potential subscribers list
+     */
     protected $existingsubscribers = array();
 
+    /**
+     * Constructor method
+     * @param string $name
+     * @param array $options
+     */
     public function  __construct($name, $options) {
         parent::__construct($name, $options);
         if (isset($options['forcesubscribed'])) {
@@ -8544,6 +8591,10 @@ class forum_potential_subscriber_selector extends forum_subscriber_selector_base
         }
     }
 
+    /**
+     * Returns an arary of options for this control
+     * @return array
+     */
     protected function get_options() {
         $options = parent::get_options();
         if ($this->forcesubscribed===true) {
@@ -8552,6 +8603,15 @@ class forum_potential_subscriber_selector extends forum_subscriber_selector_base
         return $options;
     }
 
+    /**
+     * Finds all potential users
+     *
+     * Potential users are determined by checking for users with a capability
+     * determined in {@see forum_get_potential_subscribers()}
+     *
+     * @param string $search
+     * @return array
+     */
     public function find_users($search) {
         global $DB;
 
@@ -8586,17 +8646,36 @@ class forum_potential_subscriber_selector extends forum_subscriber_selector_base
         }
     }
 
+    /**
+     * Sets the existing subscribers
+     * @param array $users
+     */
     public function set_existing_subscribers(array $users) {
         $this->existingsubscribers = $users;
     }
 
+    /**
+     * Sets this forum as force subscribed or not
+     */
     public function set_force_subscribed($setting=true) {
         $this->forcesubscribed = true;
     }
 }
 
+/**
+ * User selector control for removing subscribed users
+ * @package mod-forum
+ * @copyright 2009 Sam Hemelryk
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 class forum_existing_subscriber_selector extends forum_subscriber_selector_base {
 
+    /**
+     * Finds all subscribed users
+     *
+     * @param string $search
+     * @return array
+     */
     public function find_users($search) {
         global $DB;
         list($wherecondition, $params) = $this->search_sql($search, 'u');
index a9b151ccf872f3b499a2380e382c3fa93755f91b..0fcef34594af15956471a4387756bb67daa160f4 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-  //  Set tracking option for the forum.
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Set tracking option for the forum.
+ * 
+ * @package mod-forum
+ * @copyright 2005 mchurch
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require_once("../../config.php");
 require_once("lib.php");
index efcd79937cd9bae0c3f32a5fd3460ee37a50b0c9..aa9b2ea6f1964d4fc80176acfd553a831733a231 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright Jamie Pratt <me@jamiep.org>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once ($CFG->dirroot.'/course/moodleform_mod.php');
 
 class mod_forum_mod_form extends moodleform_mod {
index 9f2f1da12bc14fdb3b06e4ec02e7a8c19a69cd3c..aad4bf2ec8bdb207a6b4aaded79c36251a61e4c7 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-//  Edit and save a new post to a discussion
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Edit and save a new post to a discussion
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */ 
 
 require_once('../../config.php');
 require_once('lib.php');
index 200e8bdcbd6fdf7b53b5a1660989ff7d0751e609..746421b9fe905ee00d722ab1a7bdea5b7a60d919 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright Jamie Pratt <me@jamiep.org>
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once($CFG->libdir.'/formslib.php');
 
 class mod_forum_post_form extends moodleform {
index 85a506ae26b99cf146ffe858742f5f9872154ab7..1f2228b3029174c464ea5472da8cc6a3eb8e010d 100644 (file)
@@ -1,8 +1,29 @@
 <?php
 
-//  Collect ratings, store them, then return to where we came from
-
-/// TODO: Centralise duplicate code in rate.php and rate_ajax.php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Collect ratings, store them, then return to where we came from
+ *
+ * TODO: Centralise duplicate code in rate.php and rate_ajax.php
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require_once('../../config.php');
 require_once('lib.php');
@@ -23,7 +44,7 @@ if (!$cm = get_coursemodule_from_instance('forum', $forum->id)) {
     print_error('invalidcoursemodule');
 } else {
     $forum->cmidnumber = $cm->id; //MDL-12961
-    }
+}
 
 require_login($course, false, $cm);
 
index 21b41e822becdb0276bdcfbd7ae8aacd03ed4506..2c52446e03acca7dd0b89a6b69c3f38aecd8dc67 100644 (file)
@@ -1,32 +1,30 @@
 <?php
 
-///////////////////////////////////////////////////////////////////////////
-//                                                                       //
-// NOTICE OF COPYRIGHT                                                   //
-//                                                                       //
-// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
-//          http://moodle.org                                            //
-//                                                                       //
-// Copyright (C) 1999 onwards Martin Dougiamas  http://dougiamas.com     //
-//           (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com  //
-//                                                                       //
-// This program is free software; you can redistribute it and/or modify  //
-// it under the terms of the GNU General Public License as published by  //
-// the Free Software Foundation; either version 2 of the License, or     //
-// (at your option) any later version.                                   //
-//                                                                       //
-// This program is distributed in the hope that it will be useful,       //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
-// GNU General Public License for more details:                          //
-//                                                                       //
-//          http://www.gnu.org/copyleft/gpl.html                         //
-//                                                                       //
-///////////////////////////////////////////////////////////////////////////
-
-/// Accept, process and reply to ajax calls to rate forums
-
-/// TODO: Centralise duplicate code in rate.php and rate_ajax.php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Accept, process and reply to ajax calls to rate forums
+ *
+ * TODO: Centralise duplicate code in rate.php and rate_ajax.php
+ *
+ * @package mod-forum
+ * @copyright 2001 Eloy Lafuente (stronk7) http://contiento.com
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require_once('../../config.php');
 require_once($CFG->dirroot . '/mod/forum/lib.php');
index c1f4ade4e6f040fa15bde19f8355847710574a65..7407aed09858b13f9d4bf0d331e5c48a8d9ae451 100644 (file)
@@ -18,7 +18,7 @@
 /**
  * This file contains a custom renderer class used by the forum module.
  *
- * @package   forum
+ * @package mod-forum
  * @copyright 2009 Sam Hemelryk
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
@@ -27,7 +27,7 @@
  * A custom renderer class that extends the moodle_renderer_base and
  * is used by the forum module.
  * 
- * @package   forum
+ * @package mod-forum
  * @copyright 2009 Sam Hemelryk
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  **/
index 1b576f5321a74278feb1b521e5ce4ef43c08de66..9b715371c92d10f28b260e9ee665e15632606f92 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-//  For a given post, shows a report of all the ratings it has
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * For a given post, shows a report of all the ratings it has
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */ 
 
 require_once("../../config.php");
 require_once("lib.php");
index 06f0778a9e486d78b54051940010078431204b21..fe4f8142e877a4705071059fee7f1a3f74f74cb2 100644 (file)
@@ -1,6 +1,27 @@
 <?php
-    //This php script contains all the stuff to backup/restore
-    //forum mods
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This php script contains all the stuff to backup/restore forum mods
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
     //This is the "graphical" structure of the forum mod:
     //
index 69034265faa0cd9ab9a20702c40e6fdd2a818eb4..ecc5276290931514528ed8c1bdeb05d7f40bf579 100644 (file)
@@ -1,9 +1,32 @@
 <?php
-    //This file adds support to rss feeds generation
 
-    //This function is the main entry point to forum
-    //rss feeds generation. Foreach site forum with rss enabled
-    //build one XML rss structure.
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file adds support to rss feeds generation
+ *
+ * @package mod-forum
+ * @copyright 2001 Eloy Lafuente (stronk7) http://contiento.com
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+    /**
+     * This function is the main entry point to forum rss feeds generation.
+     * Foreach site forum with rss enabled build one XML rss structure.
+     */
     function forum_rss_feeds() {
 
         global $CFG, $DB;
     }
 
 
-    // Given a forum object, deletes the RSS file
+    /**
+     * Given a forum object, deletes the RSS file
+     *
+     * @param 0object $forum
+     * @return bool
+     */
     function forum_rss_delete_file($forum) {
         global $CFG;
         $rssfile = rss_file_name('forum', $forum);
     }
 
 
+    /**
+     * If there is new stuff in the forum since $time then this returns
+     * true.  Otherwise it returns false.
+     *
+     * @param object $forum
+     * @param int $time
+     * @return bool
+     */
     function forum_rss_newstuff($forum, $time) {
-    // If there is new stuff in the forum since $time then this returns
-    // true.  Otherwise it returns false.
         if ($forum->rsstype == 1) {
             $items = forum_rss_feed_discussions($forum, $time);
         } else {
         return (!empty($items));
     }
 
-    //This function return the XML rss contents about the forum record passed as parameter
-    //It returns false if something is wrong
+    /**
+     * This function return the XML rss contents about the forum record passed as parameter
+     * It returns false if something is wrong
+     *
+     * @param object $forum
+     * @param bool
+     */
     function forum_rss_feed($forum) {
 
         global $CFG;
         return $status;
     }
 
-    //This function returns "items" record array to be used to build the rss feed
-    //for a Type=discussions forum
+    /**
+     * This function returns "items" record array to be used to build the rss feed
+     * for a Type=discussions forum
+     *
+     * @param object $forum
+     * @param int $newsince
+     */
     function forum_rss_feed_discussions($forum, $newsince=0) {
 
         global $CFG, $DB;
         return $items;
     }
 
-    //This function returns "items" record array to be used to build the rss feed
-    //for a Type=posts forum
+    /**
+     * This function returns "items" record array to be used to build the rss feed
+     * for a Type=posts forum
+     * 
+     * @param object $forum
+     * @param int $newsince
+     */
     function forum_rss_feed_posts($forum, $newsince=0) {
 
         global $CFG, $DB;
             }
         }
         return $items;
-    }
-
+    }
\ No newline at end of file
index b61e0184cd9c5a64d17f20a6d0eb9e555fd7884a..96a6fc45ac278f43b97404b0cb6520944a1bad31 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once('../../config.php');
 require_once('lib.php');
 
index 2e44c7c8c07532b0da7bde8cbbb84512ccf293d4..6a8b00754d2215e8ba5580d791e5addf63c8c7d4 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright  2009 Petr Skoda (http://skodak.org)
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once($CFG->dirroot.'/mod/forum/lib.php');
 
 $settings->add(new admin_setting_configselect('forum_displaymode', get_string('displaymode', 'forum'),
index 0542e657649aae868a545e080a1ed48afa868c8b..30189a55741db92f5fe750c25ce58803411a2918 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-//  Set tracking option for the forum.
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Set tracking option for the forum.
+ *
+ * @package mod-forum
+ * @copyright 2005 mchurch
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */ 
 
 require_once("../../config.php");
 require_once("lib.php");
index 88eb9617cf83eb01c5bc873361ab23f301ff73f3..dea8d5d99dd6b7989540145d5a63df3003c42243 100644 (file)
@@ -1,4 +1,29 @@
 <?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Code fragment to define the module version etc.
+ * This fragment is called by /admin/index.php
+ *
+ * @package mod-forum
+ * @copyright 2008 Nicolas Connault
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once("$CFG->libdir/simpletest/portfolio_testclass.php");
 require_once("$CFG->dirroot/mod/forum/lib.php");
 require_once("$CFG->dirroot/$CFG->admin/generator.php");
index 4e71e4f211cfc15525ae788cf700e7c408185eaf..b42ff68aca558cec51d14bd1c8c1eb87c4e6ed51 100644 (file)
@@ -30,7 +30,7 @@
  * @author T.J.Hunt@open.ac.uk
  * @author nicolas@moodle.com
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
- * @package mod/forum
+ * @package mod-forum
  */
 
 if (!defined('MOODLE_INTERNAL')) {
index 9624fbfd8a6091417c37e2f16c56e96b29dafe13..0c75669a74cd5f892ffb175e6075a5d713fc088a 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-//  Subscribe to or unsubscribe from a forum.
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Subscribe to or unsubscribe from a forum.
+ * 
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require_once("../../config.php");
 require_once("lib.php");
index 477c4db004cce1675c4218acf5127fa889535878..597a8546c6478b3760fc1578c39c8a8cf516bb96 100644 (file)
@@ -18,7 +18,7 @@
 /**
  * This file is used to display and organise forum subscribers
  *
- * @package   forum
+ * @package mod-forum
  * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
index c19b8e71484dc7176e079de34f95fa5b637b21fb..c06c634f5d16e61bb88bcd5eb099a2adf184bb11 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright  2008 Petr Skoda (http://skodak.org)
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
 require_once("../../config.php");
 require_once("lib.php");
 
index a29996d3b91afe7efa7d982affaa1b48eb85fed2..1abe683fa4720ff5998c1666d18f28189b06dac6 100644 (file)
@@ -1,6 +1,27 @@
 <?php
 
-// Display user activity reports for a course
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Display user activity reports for a course
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 require_once('../../config.php');
 require_once('lib.php');
index a75b9412caf9789f34659e8fa819ec6d42bbd5d1..90e2a6cb7114278faea719d5cf5648e31d350199 100644 (file)
@@ -1,9 +1,28 @@
 <?php
 
-////////////////////////////////////////////////////////////////////////////////
-//  Code fragment to define the module version etc.
-//  This fragment is called by /admin/index.php
-////////////////////////////////////////////////////////////////////////////////
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Code fragment to define the module version etc.
+ * This fragment is called by /admin/index.php
+ *
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
 
 $module->version  = 2009050400;
 $module->requires = 2009041700;  // Requires this Moodle version
index c0bf59937682e6cceedc27573244d9d61d6e4b94..4a569b7466a8baf88252510f234ebc5e28016be8 100644 (file)
@@ -1,5 +1,26 @@
 <?php
 
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * @package mod-forum
+ * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
+ * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
     require_once('../../config.php');
     require_once('lib.php');
     require_once("$CFG->libdir/rsslib.php");