aboutsummaryrefslogtreecommitdiff
path: root/reminder.module
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-09-03 12:57:14 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-09-03 12:57:14 -0300
commit79cb3a8bde3a0c2699750a4cc36c3cab1ae6917a (patch)
treed84ebf82c91151eb5ce92469a5d93657daaf5d01 /reminder.module
parent339f9673536a3282109a3e1cf8d86cfe1ee1562c (diff)
downloadreminder-79cb3a8bde3a0c2699750a4cc36c3cab1ae6917a.tar.gz
reminder-79cb3a8bde3a0c2699750a4cc36c3cab1ae6917a.tar.bz2
Adding description field
Diffstat (limited to 'reminder.module')
-rw-r--r--reminder.module11
1 files changed, 4 insertions, 7 deletions
diff --git a/reminder.module b/reminder.module
index cea6cd4..d96743b 100644
--- a/reminder.module
+++ b/reminder.module
@@ -147,14 +147,12 @@ function reminder_form(&$node) {
);
}
- if ($type->has_body) {
- $form['body'] = array(
+ $form['description'] = array(
'#type' => 'textarea',
'#title' => t('Add some description'),
- '#default_value' => isset($node->body) ? $node->body : '',
+ '#default_value' => isset($reminder['description']) ? $reminder['description']: '',
'#rows' => 5
- );
- }
+ );
if ((isset($node->nid) && $node->uid == 0) || $user->uid == 0) {
$form['anonym'] = array(
@@ -257,7 +255,6 @@ function reminder_validate($node, $form, &$form_state) {
* @todo
* Refactor.
* Date, remind and subscribe widgets.
- * Save and update body/description.
*/
function reminder_node_submit($node, $form, &$form_state) {
// No preview available.
@@ -275,7 +272,6 @@ function reminder_node_submit($node, $form, &$form_state) {
}
$node->title = $form_state['values']['title'];
- $node->body = $form_state['values']['body'];
if ($node->nid == NULL) {
global $user;
@@ -298,6 +294,7 @@ function reminder_node_submit($node, $form, &$form_state) {
'admin_url' => $admin_url,
'anonym_name' => $anonym_name,
'anonym_email' => $anonym_email,
+ 'description' => $form_state['values']['description'],
);
$query = db_insert('reminder')->fields($values);