'not null' => TRUE,
'default' => '0'
),
+ 'description' => array(
+ 'description' => t('Reminder description'),
+ 'type' => 'text',
+ 'length' => 5000,
+ ),
),
'primary key' => array('nid'),
);
)
);
}
+
+/**
+ * Adds description field.
+ */
+function reminder_update_7002(&$sandbox) {
+ db_add_field('reminder', 'description',
+ array(
+ 'description' => t('Reminder description'),
+ 'type' => 'text',
+ 'length' => 5000,
+ )
+ );
+}
);
}
- 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(
* @todo
* Refactor.
* Date, remind and subscribe widgets.
- * Save and update body/description.
*/
function reminder_node_submit($node, $form, &$form_state) {
// No preview available.
}
$node->title = $form_state['values']['title'];
- $node->body = $form_state['values']['body'];
if ($node->nid == NULL) {
global $user;
'admin_url' => $admin_url,
'anonym_name' => $anonym_name,
'anonym_email' => $anonym_email,
+ 'description' => $form_state['values']['description'],
);
$query = db_insert('reminder')->fields($values);