aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-04-23 23:26:46 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-04-23 23:26:46 -0300
commit3602af7832edc2c89fd227671b4a45046401b3b0 (patch)
treec925cf516f6929122c7915d431cd579214b5fa28
parentbad1954caba469166a15e534e82bf7739f932fe7 (diff)
downloadreminder-3602af7832edc2c89fd227671b4a45046401b3b0.tar.gz
reminder-3602af7832edc2c89fd227671b4a45046401b3b0.tar.bz2
Oops
-rw-r--r--reminder.module67
1 files changed, 34 insertions, 33 deletions
diff --git a/reminder.module b/reminder.module
index a32390e..024aa30 100644
--- a/reminder.module
+++ b/reminder.module
@@ -333,39 +333,40 @@ function reminder_node_submit($node, $form, &$form_state) {
}
}
- else {
-
- // reminder head
- $node_id = db_query("SELECT nid FROM {reminder_reminder_heads} WHERE admin_url = :admin_url", array(':admin_url' => $form_state['values']['reminder_admin_url']))->fetchField();
- $node = node_load($node_id);
-
- // save node options
- $node->title = $form_state['values']['title'];
- $node->body = $form_state['values']['body'];
- node_save($node);
-
- // save reminder options
- db_update('reminder_reminder_heads')->fields(array(
- 'anonym_name' => $form_state['values']['anonym']['user_name'],
- 'anonym_email' => $form_state['values']['anonym']['user_email'],
- 'secure' => $form_state['values']['reminder_options']['secure'],
- ))->condition('nid', $node_id)->execute();
-
- // days and options
-
- // collect the ids of the days which are already in the db
- // insert and update days and options datas
- // if there is some unused id in $days_ids, that's mean we deleted them
-
- foreach (reminder_parse_subscribers($node->reminder_subscriptions) as $subscriber) {
- $unsubscribe_url = reminder_generate_url('unsubscribe_url', 30);
- $values = array(
- 'email' => $subscriber,
- 'reminder_id' => $node->nid,
- 'unsubscribe_url' => $unsubscribe_url,
- );
- }
- $query = db_insert('reminder_subscriptions')->fields($values);
+ }
+ else {
+
+ // reminder head
+ $node_id = db_query("SELECT nid FROM {reminder_reminder_heads} WHERE admin_url = :admin_url", array(':admin_url' => $form_state['values']['reminder_admin_url']))->fetchField();
+ $node = node_load($node_id);
+
+ // save node options
+ $node->title = $form_state['values']['title'];
+ $node->body = $form_state['values']['body'];
+ node_save($node);
+
+ // save reminder options
+ db_update('reminder_reminder_heads')->fields(array(
+ 'anonym_name' => $form_state['values']['anonym']['user_name'],
+ 'anonym_email' => $form_state['values']['anonym']['user_email'],
+ 'secure' => $form_state['values']['reminder_options']['secure'],
+ ))->condition('nid', $node_id)->execute();
+
+ // days and options
+
+ // collect the ids of the days which are already in the db
+ // insert and update days and options datas
+ // if there is some unused id in $days_ids, that's mean we deleted them
+
+ foreach (reminder_parse_subscribers($node->reminder_subscriptions) as $subscriber) {
+ $unsubscribe_url = reminder_generate_url('unsubscribe_url', 30);
+ $values = array(
+ 'email' => $subscriber,
+ 'reminder_id' => $node->nid,
+ 'unsubscribe_url' => $unsubscribe_url,
+ );
+ }
+ $query = db_insert('reminder_subscriptions')->fields($values);
}
// TODO