Hi
I want to define a new field type, identical to the text field but simply smaller in text size, height and width.
Can anyone help me with this?
Here's what I have so far in field.class.php. The input side works fine, but I can't get it to display in view single or view list. My OOP is fairly limited and I'm struggling to get any further.
class data_field_smalltext extends data_field_base {
var $type = 'smalltext';
function data_field_smalltext($field=0, $data=0) {
parent::data_field_base($field, $data);
}
function display_add_field($recordid=0){
$str = '<input style="width:200px; height:10px; font-size:10px" type="text">';
return $str;
}
function display_search_field($value = '') {
return '<input type="text" size="16" name="f_'.$this->field->id.'" value="'.$value.'" />';
}
function parse_search_field() {
return optional_param('f_'.$this->field->id, '', PARAM_NOTAGS);
}
function generate_sql($tablealias, $value) {
return " ({$tablealias}.fieldid = {$this->field->id} AND {$tablealias}.content LIKE '%{$value}%') ";
}
}
Cheers Stu