mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Committing icon.gif. This is just a temporary icon. We need to replace it eventually.
Vy-Shane Sin Fat <vyshane@moodle.com>
This commit is contained in:
parent
9e1ae324f9
commit
b4ede3f342
68
mod/data/field/text/\
Normal file
68
mod/data/field/text/\
Normal file
@ -0,0 +1,68 @@
|
||||
<?php ///Class file for textarea field, extends base_field
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// NOTICE OF COPYRIGHT //
|
||||
// //
|
||||
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
||||
// http://moodle.org //
|
||||
// //
|
||||
// Copyright (C) 2005 Martin Dougiamas http://dougiamas.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 //
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Please refer to lib.php for method comments
|
||||
|
||||
class data_field_textarea extends data_field_base {
|
||||
|
||||
var $type = 'textarea';
|
||||
|
||||
function data_field_textarea($fid=0){
|
||||
parent::data_field_base($fid);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
* prints the form element in the add template *
|
||||
***********************************************/
|
||||
function display_add_field($id, $rid=0) {
|
||||
global $CFG;
|
||||
if (!$field = get_record('data_fields', 'id', $id)){
|
||||
notify('That is not a valid field id!');
|
||||
exit;
|
||||
}
|
||||
if ($rid) {
|
||||
$content = get_record('data_content', 'fieldid', $id, 'recordid', $rid);
|
||||
if (isset($content->content)) {
|
||||
$content = $content->content;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$content = '';
|
||||
}
|
||||
$str = '';
|
||||
|
||||
if ($field->description) {
|
||||
$str .= '<img src="'.$CFG->pixpath.'/help.gif" alt="'.$field->description.'" title="'.$field->description.'" /> ';
|
||||
}
|
||||
$str .= '<textarea name="field_' . $field->id . '" id="field_'.$field->id . '"';
|
||||
if (!empty($field->param2) && !empty($field->param3)) {
|
||||
$str .= ' style="width:' . $field->param2. '; height:' . $field->param3 . ';"';
|
||||
}
|
||||
$str .= '>' . $content . '</textarea>';
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user