--- /c/projects/drupal/cvs-head/contributions/modules/eventrepeat/eventrepeat.module	2006-07-31 00:48:11.546875000 -0400
+++ modules/eventrepeat/eventrepeat.module	2006-07-31 02:29:30.281250000 -0400
@@ -343,16 +343,16 @@ function eventrepeat_form_alter($form_id
     if ($node->eventrepeat_rid) {
 
       //create the option array
-      $options = array('this' => t('This occurance only'),
-      'future' => t('This occurance and all future occurances'),
-      'all' => t('All occurances')
+      $options = array('this' => t('This occurrence only'),
+      'future' => t('This occurrence and all future occurrences'),
+      'all' => t('All occurrences')
       );
 
       //construct the radio buttons.  NOTE: in order to prevent name collisions in the admin
       //delete process for multiple nodes, these form elements are named in array fashion, with nid to distinguish
       //the elements of the array
       $form['eventrepeat_delete_type']['#tree'] = TRUE;
-      $form['eventrepeat_delete_type'][$node->nid] = array('#type' => 'radios', '#title' => t('Repeat event--delete the following'), '#default_value' => 'this', '#options' => $options, '#description' => t('\'This occurance and all future occurances\' will delete repeat events from the date of the selected node forward, \'All occurances\' will delete repeat events after today\'s date.'));
+      $form['eventrepeat_delete_type'][$node->nid] = array('#type' => 'radios', '#title' => t('Repeat event--delete the following'), '#default_value' => 'this', '#options' => $options, '#description' => t('\'This occurrence and all future occurrences\' will delete repeat events from the date of the selected node forward, \'All occurrences\' will delete repeat events after today\'s date.'));
     }
 
   //inject node type settings checkbox for repeat events
@@ -362,7 +362,7 @@ function eventrepeat_form_alter($form_id
       '#type' => 'checkbox',
       '#title' => t('Allow repeat events'),
       '#default_value' => variable_get("eventrepeat_nodeapi_$type", FALSE) == 1,
-      '#description' => t('if selected, users will be allowed to add repeating events for this node type'),
+      '#description' => t('If selected, users will be allowed to add repeating events for this node type'),
     );
 
   //inject the appropriate repeat data into the node form if the node type is repeat enabled
@@ -500,7 +500,7 @@ function eventrepeat_nodeapi(&$node, $op
       } 
 
       //validate the repeat end date
-      _eventrepeat_validate_form_date('eventrepeat_end', 'Repeat end', $node);
+      _eventrepeat_validate_form_date('eventrepeat_end', t('Repeat end'), $node);
 
       // TODO: this would cause an odd error if the person wanted
       // to remove the repeating sequence so I removed it for now.
@@ -572,16 +572,16 @@ function eventrepeat_nodeapi(&$node, $op
         (variable_get('eventrepeat_nodeapi_'. $node->type, 0) == 1) && $node->eventrepeat_rid) {
 
         //create the option array
-        $options = array('this' => t('This occurance only'),
-        'future' => t('This occurance and all future occurances'),
-        'all' => t('All occurances')
+        $options = array('this' => t('This occurrence only'),
+        'future' => t('This occurrence and all future occurrences'),
+        'all' => t('All occurrences')
         );
 
         //construct the radio buttons.  NOTE: in order to prevent name collisions in the admin
         //delete process for multiple nodes, these form elements are named in array fashion, with nid to distinguish
         //the elements of the array
         $data_to_inject['eventrepeat_delete_type']['#tree'] = TRUE;
-        $data_to_inject['eventrepeat_delete_type'][$node->nid] = array('#type' => 'radios', '#title' => t('Repeat event--delete the following'), '#default_value' => 'this', '#options' => $options, '#description' => t('\'This occurance and all future occurances\' will delete repeat events from the date of the selected node forward, \'All occurances\' will delete repeat events after today\'s date.'));
+        $data_to_inject['eventrepeat_delete_type'][$node->nid] = array('#type' => 'radios', '#title' => t('Repeat event--delete the following'), '#default_value' => 'this', '#options' => $options, '#description' => t('\'This occurrence and all future occurrences\' will delete repeat events from the date of the selected node forward, \'All occurrences\' will delete repeat events after today\'s date.'));
         return $data_to_inject;
       }
       break;*/
@@ -827,7 +827,7 @@ function _eventrepeat_day_correction($st
  * @ingroup eventrepeat_support
  * @param $master_day The day of the week of the first day of the month.
  * @param $days_in_month The number of days in the month.
- * @return An array in the same order as the days of the week (Sun-Sat), with values of 0 for days of the week with 4 occurances, and 1 for days of the week with 5 occurances.
+ * @return An array in the same order as the days of the week (Sun-Sat), with values of 0 for days of the week with 4 occurrences, and 1 for days of the week with 5 occurrences.
  */
 function _eventrepeat_day_in_month_incrementer($master_day, $days_in_month) {
 
@@ -922,16 +922,16 @@ function theme_eventrepeat_form($node) {
   if ($node->eventrepeat_rid) {
     $form['eventrepeat_rid'] = array('#type' => 'hidden', '#value' => $node->eventrepeat_rid);
     $options = array(
-      'this' => t('This occurance only'),
-      'future' => t('This occurance and all future occurances'),
-      'all' => t('All occurances')
+      'this' => t('This occurrence only'),
+      'future' => t('This occurrence and all future occurrences'),
+      'all' => t('All occurrences')
     );
     $form['eventrepeat_edit_type'] = array(
       '#type' => 'radios', 
       '#title' => t('Apply edit(s) to'), 
       '#default_value' => 'future', 
       '#options' => $options, 
-      '#description' => t('\'This occurance and all future occurances\' will edit repeat events from the date of the selected node forward, \'All occurances\' will edit repeat events after today\'s date. <br>Note: editing a single occurance will remove it from the repeat sequence.'), 
+      '#description' => t('\'This occurrence and all future occurrences\' will edit repeat events from the date of the selected node forward, \'All occurrences\' will edit repeat events after today\'s date. <br>Note: editing a single occurrence will remove it from the repeat sequence.'), 
       '#weight' => -12
     );
   }
@@ -997,7 +997,7 @@ function theme_eventrepeat_form($node) {
 
   // TODO: if editing based on count is unsupported, can we just use end date after the initial render?
   //COUNT param select box
-  $options = array (0 => '--'.t('Select'.'--'));
+  $options = array (0 => '--'. t('Select') .'--');
   for ($i = 2; $i <= 100; $i++) {
     $options[$i] = $i;
   }
@@ -1043,7 +1043,7 @@ function theme_eventrepeat_form_advanced
   );
 
   //link to user help for repeat patterns
-  $form['eventrepeat_advanced']['help'] = array('#type' => 'markup', '#value' => '<div>'. t('Need help creating a repeat pattern? Click ') . l(t('here'), 'repeat/help') . t('<br>NOTE: Editing an existing repeat pattern maps previously created events to the new pattern, in sequential order, on all dates from the date where the edit is performed.') .'</div>');
+  $form['eventrepeat_advanced']['help'] = array('#type' => 'markup', '#value' => '<div>'. t('Need help creating a repeat pattern? Click ') . l(t('here'), 'repeat/help') .'<br />'. t('NOTE: Editing an existing repeat pattern maps previously created events to the new pattern, in sequential order, on all dates from the date where the edit is performed.') .'</div>');
 
   //INTERVAL param select box
   if($show_advanced['eventrepeat_INTERVAL']){
@@ -1283,7 +1283,7 @@ function _eventrepeat_form_date($element
 
   //months array
   $months = array(
-  	'--'.t('Select').'--',
+    '--'.t('Select').'--',
     t('January'),
     t('February'),
     t('March'),
@@ -1301,7 +1301,7 @@ function _eventrepeat_form_date($element
   //days array
   $days = array(0 => '--'.t('Select').'--');
   for ($i = 1; $i <= 31; $i++) {
-  	$days[$i] = $i;
+    $days[$i] = $i;
   }
 
   //compose the select boxes, and add the exception editor button if necessary
@@ -1341,7 +1341,7 @@ function _eventrepeat_form_add_exception
 
     // validate the new exception date via the new
     // year, month and day and turn it into a timestamp
-    _eventrepeat_validate_form_date('eventrepeat_EXDATE_edit', 'Exception', $node);
+    _eventrepeat_validate_form_date('eventrepeat_EXDATE_edit', t('Exception'), $node);
   
     // only proceed if a valid date was supplied
     if($node->eventrepeat_EXDATE_edit){  
@@ -1588,23 +1588,21 @@ function _eventrepeat_form_validate($for
   }
 
   //validate the repeat end date
-  _eventrepeat_validate_form_date('eventrepeat_end', 'Repeat end', $node);
+  _eventrepeat_validate_form_date('eventrepeat_end', t('Repeat end'), $node);
 
   //validate exception dates if submitted
   if ($op == t('Add/Delete Exception')) {
-    _eventrepeat_validate_form_date('eventrepeat_EXDATE_edit', 'Exception', $node); //NEED TO ADD CHECK FOR 0 HERE
+    _eventrepeat_validate_form_date('eventrepeat_EXDATE_edit', t('Exception'), $node); //NEED TO ADD CHECK FOR 0 HERE
   }
 
   //warn if user entered values for both repeat end and COUNT
   if ($form_values['eventrepeat_end'] && $form_values['eventrepeat_COUNT']) {
-    form_set_error('eventrepeat_end', t('\'Repeat end date\' and \'Count\' cannot both be set--select only one to
-      provide a valid end point for the sequence'));
+    form_set_error('eventrepeat_end', t('\'Repeat end date\' and \'Count\' cannot both be set--select only one to provide a valid end point for the sequence'));
   }
 
   //warn if user tries to edit a sequence based on COUNT--this is currently not supported
   if ($node->eventrepeat_rid && $form_values['eventrepeat_COUNT']) {
-    form_set_error('eventrepeat_COUNT', t('Editing a sequence which uses the  \'Count\' parameter is not supported.
-      Delete the sequence and recreate it with the new parameters.'));
+    form_set_error('eventrepeat_COUNT', t('Editing a sequence which uses the  \'Count\' parameter is not supported. Delete the sequence and recreate it with the new parameters.'));
   }
 }
 
@@ -2150,7 +2148,7 @@ function _eventrepeat_validate_form_date
     //because of the way end dates are handled in the rendering code.  also here we're going to validate
     //that the end date doesn't occur on or before the start date of the selected event
 
-    if ($type != 'Exception') {
+    if ($type != t('Exception')) {
       $offset = event_get_offset($node->timezone, gmmktime(23, 59, 59, $node->$prefix_month, $node->$prefix_day,
       $node->$prefix.'year'));
       $event_start = $node->event_start + $offset;
@@ -2161,12 +2159,10 @@ function _eventrepeat_validate_form_date
 
     //if the date is after the beginning of the node in question, 
     // or an exception date, then validate otherwise warn
-    if (($node->$prefix > $event_start) || $type == 'Exception') {
+    if (($node->$prefix > $event_start) || $type == t('Exception')) {
       return TRUE;
     } else {
-      form_set_error('eventrepeat_endmonth', t('You have selected a date that is before or the same as the start of the selected event,
-       which is not allowed--check your repeat pattern settings and try again. <br> Note: If you are trying to shorten
-       the end date of a repeat cycle, perform that operation from an event date before the new end date.'));
+      form_set_error('eventrepeat_endmonth', t('You have selected a date that is before or the same as the start of the selected event, which is not allowed--check your repeat pattern settings and try again. <br /> Note: If you are trying to shorten the end date of a repeat cycle, perform that operation from an event date before the new end date.'));
       return FALSE;
     }
 
@@ -2177,11 +2173,11 @@ function _eventrepeat_validate_form_date
 
   //date data missing, so warn user
   } elseif ($node->$prefix_month == 0) {
-  	form_set_error($prefix_month, t($type) . ' ' . t('date \'month\' value not selected'));
+    form_set_error($prefix_month, t('%type date \'month\' value not selected', array('%type' => $type)));
   } elseif ($node->$prefix_day == 0) {
-  	form_set_error($prefix_day, t($type) . ' ' . t('date \'day\' value not selected'));
+    form_set_error($prefix_day, t('%type date \'day\' value not selected', array('%type' => $type)));
   } elseif ($node->$prefix_year == 0) {
-  	form_set_error($prefix_year, t($type) . ' ' . t('date \'year\' value not selected'));
+    form_set_error($prefix_year, t('%type date \'year\' value not selected', array('%type' => $type)));
   }
 }
 
