Skip to content

Commit

Permalink
Merge branch 'wip-mdl-29244' of git://github.com/rajeshtaneja/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Aparup Banerjee committed Oct 3, 2011
2 parents 1bbe222 + 542cde9 commit c1b723e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions user/filters/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* moodlelib.php - Moodle main library
* Generic checkbox filter.
*
* Main library file of miscellaneous general-purpose Moodle functions.
* Other main libraries:
* - weblib.php - functions that produce web output
* - datalib.php - functions that access the database
* This will create generic filter with checkbox option and can be used for
* disabling other elements for specific condition.
*
* @package user
* @copyright 2011 Rajesh Taneja
Expand Down Expand Up @@ -48,7 +46,9 @@ class user_filter_checkbox extends user_filter_type {
protected $field;

/**
* Constructor
* Constructor, initalize user_filter_type and sets $disableelements array
* with list of elements to be diabled by checkbox.
*
* @param string $name the name of the filter instance
* @param string $label the label of the filter instance
* @param boolean $advanced advanced form element flag
Expand All @@ -69,6 +69,7 @@ public function __construct($name, $label, $advanced, $field, $disableelements=n

/**
* Adds controls specific to this filter in the form.
*
* @param moodleform $mform a MoodleQuickForm object in which element will be added
*/
public function setupForm(MoodleQuickForm &$mform) {
Expand All @@ -90,6 +91,7 @@ public function setupForm(MoodleQuickForm &$mform) {

/**
* Retrieves data from the form data
*
* @param object $formdata data submited with the form
* @return mixed array filter data or false when filter not set
*/
Expand All @@ -111,6 +113,7 @@ public function check_data($formdata) {

/**
* Returns the condition to be used with SQL where
*
* @param array $data filter settings
* @return array sql string and $params
*/
Expand All @@ -126,6 +129,7 @@ public function get_sql_filter($data) {

/**
* Returns a human friendly description of the filter used as label.
*
* @param array $data filter settings
* @return string active filter label
*/
Expand Down

0 comments on commit c1b723e

Please sign in to comment.