From 35bcb325f6eeb2f3e8064d8a67271d7c5acc3fa4 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 20 Jan 2006 02:38:11 +0000 Subject: [PATCH] Added textarea field type. Committed by Vy-Shane --- mod/data/field/textarea/field.class.php | 103 ++++++++++++++++++++++++ mod/data/field/textarea/icon.gif | Bin 0 -> 159 bytes mod/data/field/textarea/mod.html | 40 +++++++++ 3 files changed, 143 insertions(+) create mode 100755 mod/data/field/textarea/field.class.php create mode 100755 mod/data/field/textarea/icon.gif create mode 100755 mod/data/field/textarea/mod.html diff --git a/mod/data/field/textarea/field.class.php b/mod/data/field/textarea/field.class.php new file mode 100755 index 00000000000..80b3fa216f8 --- /dev/null +++ b/mod/data/field/textarea/field.class.php @@ -0,0 +1,103 @@ +dataid = $dataid; + $newfield->type = $type; + $newfield->name = $name; + $newfield->description = $desc; + $newfield->param1 = $autolink; + $newfield->param2 = $width; + $newfield->param3 = $height; + + if (!insert_record('data_fields', $newfield)) { + notify('Insertion of new field failed!'); + } + } + + + /*********************************************** + * 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 .= ''.$field->description.' '; + } + $str .= ''; + return $str; + } + + + function display_edit_field($id, $mode=0) { + parent::display_edit_field($id, $mode); + } + + + function update($fieldobject) { + $fieldobject->param1 = trim($fieldobject->param1); + $fieldobject->param2 = trim($fieldobject->param2); + + if (!update_record('data_fields',$fieldobject)){ + notify ('upate failed'); + } + } +} +?> diff --git a/mod/data/field/textarea/icon.gif b/mod/data/field/textarea/icon.gif new file mode 100755 index 0000000000000000000000000000000000000000..e75b283b47ceeb92d5b688a6a70ac6c040d0bb05 GIT binary patch literal 159 zcmZ?wbhEHb6krfw*v!B%b0))?Gim?-&;0-Y%>Oep|DQSY|Nnmm28II%4gg6^p!k!8 zk%57OK?fuSGJ}D|N8qIA>b(}>2Y#MxFyv`ss1XxblXIa|$l%-;4VL*a@Af!6;D|l% u&cfBsGJoO`Z>xOEw8=lZ-*N48+!Vl@wKBvh{HoUGfc7m_d)-_Z7_0$8usFs5 literal 0 HcmV?d00001 diff --git a/mod/data/field/textarea/mod.html b/mod/data/field/textarea/mod.html new file mode 100755 index 00000000000..c241f479865 --- /dev/null +++ b/mod/data/field/textarea/mod.html @@ -0,0 +1,40 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + name()); ?> +
Name:
Description:
Allow Autolink:param1) {echo 'checked="checked"';} ?> value="1" />
Width: px
Height: px
  + + +
+