* @return mixed array filter data or false when filter not set
*/
function check_data($formdata) {
+ $profile_fields = $this->get_profile_fields();
+
+ if (empty($profile_fields)) {
+ return false;
+ }
+
$field = $this->_name;
$operator = $field.'_op';
$profile = $field.'_fld';
function get_sql_filter($data) {
global $CFG;
+ $profile_fields = $this->get_profile_fields();
+ if (empty($profile_fields)) {
+ return '';
+ }
+
$profile = $data['profile'];
$operator = $data['operator'];
$value = addslashes($data['value']);
+ if (!array_key_exists($profile, $profile_fields)) {
+ return '';
+ }
+
$where = "";
$op = " IN ";
$ilike = sql_ilike();
* @return string active filter label
*/
function get_label($data) {
- $operators = $this->get_operators();
- $profilefields = $this->get_profile_fields();
+ $operators = $this->get_operators();
+ $profile_fields = $this->get_profile_fields();
+
+ if (empty($profile_fields)) {
+ return '';
+ }
$profile = $data['profile'];
$operator = $data['operator'];
$value = $data['value'];
+ if (!array_key_exists($profile, $profile_fields)) {
+ return '';
+ }
+
$a = new object();
$a->label = $this->_label;
$a->value = $value;
- $a->profile = $profilefields[$profile];
+ $a->profile = $profile_fields[$profile];
$a->operator = $operators[$operator];
switch($operator) {