MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / mod / data / field / text / field.class.php
blobba13558a5f514049b3ff509c525392eff6b9d064
1 <?php // $Id$
2 ///////////////////////////////////////////////////////////////////////////
3 // //
4 // NOTICE OF COPYRIGHT //
5 // //
6 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
7 // http://moodle.org //
8 // //
9 // Copyright (C) 1999-onwards Moodle Pty Ltd http://moodle.com //
10 // //
11 // This program is free software; you can redistribute it and/or modify //
12 // it under the terms of the GNU General Public License as published by //
13 // the Free Software Foundation; either version 2 of the License, or //
14 // (at your option) any later version. //
15 // //
16 // This program is distributed in the hope that it will be useful, //
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
19 // GNU General Public License for more details: //
20 // //
21 // http://www.gnu.org/copyleft/gpl.html //
22 // //
23 ///////////////////////////////////////////////////////////////////////////
25 class data_field_text extends data_field_base {
27 var $type = 'text';
29 function data_field_text($field=0, $data=0) {
30 parent::data_field_base($field, $data);
33 function display_search_field($value = '') {
34 return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
37 function parse_search_field() {
38 return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
41 function generate_sql($tablealias, $value) {
42 return " ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content LIKE '%{$value}%') ";