? .DS_Store
? coder.patch
Index: flexifilter.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.admin.inc,v
retrieving revision 1.5
diff -u -p -r1.5 flexifilter.admin.inc
--- flexifilter.admin.inc	21 Jan 2008 15:50:39 -0000	1.5
+++ flexifilter.admin.inc	21 Jan 2008 15:57:56 -0000
@@ -1,6 +1,7 @@
 <?php
 // $Id: flexifilter.admin.inc,v 1.5 2008/01/21 15:50:39 cwgordon7 Exp $
 
+
 /**
  * Generates the form for the admin overview page
  */
@@ -8,37 +9,38 @@ function flexifilter_filter_list_form() 
   drupal_set_title("Flexifilters overview");
   $path = drupal_get_path('module', 'flexifilter') .'/flexifilter.css';
   drupal_add_css($path, 'module', 'all', FALSE);
-
+  
   $form = array();
   $form['enabled_header'] = array(
     '#value' => '<h3>'. t('Enabled Flexifilters') .'</h3>',
     '#suffix' => t('If a flexifilter is enabled, then it can be used within input formats, however there can only be 128 enabled at any one time.') .'<br/>',
   );
   $form['enabled'] = flexifilter_filter_list_form_table(TRUE);
-
+  
   $form['disabled_header'] = array(
     '#value' => '<h3>'. t('Disabled Flexifilters') .'</h3>',
     '#suffix' => t('If a flexifilter is disabled, then it cannot be used within input formats, although it can be used within other flexifilters.') .'<br/>',
   );
   $form['disabled'] = flexifilter_filter_list_form_table(FALSE);
-
+  
   return $form;
 }
 
 /**
  * Helper function for flexifilter_filter_list_form. Returns the table for the overview page.
+ *
  * @param $enabled
  *   Is TRUE if we're theming the currently enabled filters.s
  */
 function flexifilter_filter_list_form_table($enabled) {
   $show_disable_link = $enabled;
-  $show_enable_link = !$enabled && flexifilter_get_number_enabled_filters() < FLEXIFILTER_MAX_FILTERS;
-  $header = array(t('Label'), t('Description'), t('Edit'), t('Delete'), t($enabled ? 'Disable' : 'Enable'));
-  $rows = array();
-  $filters = flexifilter_get_filters();
+  $show_enable_link  = !$enabled && flexifilter_get_number_enabled_filters() < FLEXIFILTER_MAX_FILTERS;
+  $header            = array(t('Label'), t('Description'), t('Edit'), t('Delete'), t($enabled ? 'Disable' : 'Enable'));
+  $rows              = array();
+  $filters           = flexifilter_get_filters();
   foreach ($filters as $id => $filter) {
     if ($filter['enabled'] == $enabled) {
-      $row = array($filter['label'], $filter['description']);
+      $row   = array($filter['label'], $filter['description']);
       $row[] = l(t('Edit'), 'admin/build/flexifilters/'. $id .'/edit', array(), drupal_get_destination());
       $row[] = l(t('Delete'), 'admin/build/flexifilters/'. $id .'/delete', array(), drupal_get_destination());
       if ($show_disable_link) {
@@ -69,7 +71,9 @@ function flexifilter_filter_list_form_ta
  * not at the top level, so we have to undo the automatic naming of submit
  * fields.
  * This function is a brutal rip of code from _form_builder_handle_input_element
+ *
  * @param $form A form element to reset to the normal name.
+ *
  * @return The updated form element
  */
 function flexifilter_undo_submit_default_name($form) {
@@ -157,8 +161,8 @@ function flexifilter_filter_edit_compone
  */
 function flexifilter_filter_edit_form_new_component_data($component_class) {
   $components = flexifilter_get_component_list();
-  $component = $components[$component_class];
-  $data = array(
+  $component  = $components[$component_class];
+  $data       = array(
     'class' => $component_class,
     'weight' => 10000,
     'is_new' => true,
@@ -184,8 +188,8 @@ function flexifilter_filter_edit_form_ne
  */
 function flexifilter_filter_edit_form_new_condition_data($condition_class) {
   $conditions = flexifilter_get_condition_list();
-  $condition = $conditions[$condition_class];
-  $data = array(
+  $condition  = $conditions[$condition_class];
+  $data       = array(
     'class' => $condition_class,
     'is_new' => TRUE,
     'weight' => 10000,
@@ -210,10 +214,10 @@ function flexifilter_filter_edit_form_co
     $form['class'] = array('#type' => 'hidden', '#value' => '');
     return $form;
   }
-
+  
   $conditions = flexifilter_get_condition_list();
-  $condition = $conditions[$data['class']];
-  $form = array(
+  $condition  = $conditions[$data['class']];
+  $form       = array(
     '#type' => 'fieldset',
     '#collapsible' => TRUE,
     '#collapsed' => (isset($data['op']) || isset($data['is_new'])) ? FALSE : TRUE,
@@ -237,7 +241,7 @@ function flexifilter_filter_edit_form_co
   if ($condition['is_container']) {
     if ($condition['contains_conditions']) {
       $conditions = flexifilter_get_condition_list();
-
+      
       $condition_max_id = 0;
       foreach ($data as $key => $sub_condition) {
         if (strncmp($key, 'condition_', 10) == 0) {
@@ -253,7 +257,7 @@ function flexifilter_filter_edit_form_co
       if (isset($data['op_c'])) {
         $form['condition_'. $condition_max_id] = flexifilter_filter_edit_form_condition(flexifilter_filter_edit_form_new_condition_data($data['add_condition']), $show_advanced);
       }
-
+      
       $form['add_condition'] = array(
         '#type' => 'select',
         '#title' => t('Add condition'),
@@ -275,7 +279,7 @@ function flexifilter_filter_edit_form_co
     '#value' => t('Remove condition'),
     '#process' => array('flexifilter_undo_submit_default_name', 'form_expand_ahah'),
   );
-
+  
   return $form;
 }
 
@@ -285,8 +289,8 @@ function flexifilter_filter_edit_form_co
  */
 function flexifilter_filter_edit_form_component($data, $new_weight, $is_first, $is_last, &$data_base, $show_advanced) {
   $components = flexifilter_get_component_list();
-  $component = $components[$data['class']];
-  $form = array(
+  $component  = $components[$data['class']];
+  $form       = array(
     '#type' => 'fieldset',
     '#collapsible' => TRUE,
     '#collapsed' => (isset($data['op']) || isset($data['op_c']) || isset($data['is_new'])) ? FALSE : TRUE,
@@ -391,7 +395,7 @@ function flexifilter_filter_edit_form_co
     '#value' => t('Re/move'),
     '#process' => array('flexifilter_undo_submit_default_name', 'form_expand_ahah'),
   );
-
+  
   return $form;
 }
 
@@ -435,22 +439,23 @@ function flexifilter_filter_edit_form_co
           values ('top', 'up', 'down', 'bottom', 'remove'), which are always valid (even
           if they have no effect). Other values are silently ignored.
         */
+        
         case 'top':
           $components[$key]['weight'] = -1000;
           break;
-
+        
         case 'up':
           $components[$key]['weight'] = $component['weight'] - 1.5;
           break;
-
+        
         case 'down':
           $components[$key]['weight'] = $component['weight'] + 1.5;
           break;
-
+        
         case 'bottom':
           $components[$key]['weight'] = 10001;
           break;
-
+        
         case 'remove':
           unset($components[$key]);
           break;
@@ -732,7 +737,7 @@ function flexifilter_filter_edit_form_su
 function flexifilter_filter_delete_form($form_state, $flexifilter) {
   $form = array();
   $form['fid'] = array('#type' => 'hidden', '#value' => $flexifilter['id']);
-
+  
   return confirm_form($form, t('Are you sure you want to delete the flexifilter "%flexifilter"?', array('%flexifilter' => $flexifilter['label'])), 'admin/build/flexifilters', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
 }
 
@@ -742,9 +747,9 @@ function flexifilter_remove_from_filters
 }
 
 function flexifilter_filter_delete_form_submit($form, &$form_state) {
-  $fid = $form_state['values']['fid'];
+  $fid     = $form_state['values']['fid'];
   $filters = flexifilter_get_filters();
-  $filter = $filters[$fid];
+  $filter  = $filters[$fid];
   if ($filter['enabled']) {
     flexifilter_remove_from_filters($filter['delta']);
   }
@@ -757,14 +762,14 @@ function flexifilter_filter_delete_form_
 function flexifilter_filter_disable_form($form_state, $flexifilter) {
   $form = array();
   $form['fid'] = array('#type' => 'hidden', '#value' => $flexifilter['id']);
-
+  
   return confirm_form($form, t('Are you sure you want to disable the flexifilter "%flexifilter"?', array('%flexifilter' => $flexifilter['label'])), 'admin/build/flexifilters', t('If you disable the flexifilter, then it cannot be used in any Input Formats.'), t('Disable'), t('Cancel'));
 }
 
 function flexifilter_filter_disable_form_submit($form, &$form_state) {
-  $fid = $form_state['values']['fid'];
+  $fid     = $form_state['values']['fid'];
   $filters = flexifilter_get_filters();
-  $filter = $filters[$fid];
+  $filter  = $filters[$fid];
   if ($filter['enabled']) {
     flexifilter_remove_from_filters($filter['delta']);
     db_query('UPDATE {flexifilters} SET enabled = 0 WHERE fid = %d', $fid);
@@ -776,14 +781,14 @@ function flexifilter_filter_disable_form
 function flexifilter_filter_enable_form($form_state, $flexifilter) {
   $form = array();
   $form['fid'] = array('#type' => 'hidden', '#value' => $flexifilter['id']);
-
+  
   return confirm_form($form, t('Are you sure you want to enable the flexifilter "%flexifilter"?', array('%flexifilter' => $flexifilter['label'])), 'admin/build/flexifilters', t(''), t('Enable'), t('Cancel'));
 }
 
 function flexifilter_filter_enable_form_submit($form, &$form_state) {
-  $fid = $form_state['values']['fid'];
+  $fid     = $form_state['values']['fid'];
   $filters = flexifilter_get_filters();
-  $filter = $filters[$fid];
+  $filter  = $filters[$fid];
   if (!$filter['enabled'] && flexifilter_get_number_enabled_filters() < FLEXIFILTER_MAX_FILTERS) {
     db_query('UPDATE {flexifilters} SET enabled = 1, delta = %d WHERE fid = %d', flexifilter_get_unused_delta(), $fid);
     drupal_set_message(t('Flexifilter enabled.'));
@@ -848,4 +853,5 @@ function flexifilter_filter_input_form($
 
 function flexifilter_filter_input_form_submit($form, &$form_state) {
   drupal_goto('admin/build/flexifilters/'. flexifilter_save_filter(unserialize($form_state['values']['flexifilter'])) .'/edit');
-}
\ No newline at end of file
+}
+
Index: flexifilter.components.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.components.inc,v
retrieving revision 1.9
diff -u -p -r1.9 flexifilter.components.inc
--- flexifilter.components.inc	21 Jan 2008 15:50:39 -0000	1.9
+++ flexifilter.components.inc	21 Jan 2008 15:57:56 -0000
@@ -1,6 +1,7 @@
 <?php
 // $Id: flexifilter.components.inc,v 1.9 2008/01/21 15:50:39 cwgordon7 Exp $
 
+
 /**
  * Implementation of hook_flexifilter_components()
  *
@@ -38,7 +39,7 @@ function flexifilter_flexifilter_compone
     'group' => t('Control Structures'),
     'step' => 'both',
   );
-
+  
   // Simple text operations
   $components['flexifilter_text_replace'] = array(
     'label' => t('Simple Text Replace'),
@@ -118,7 +119,7 @@ function flexifilter_flexifilter_compone
     'contains_components' => TRUE,
     'step' => 'either',
   );
-
+  
   // Allow existing filters to be used as components
   foreach (module_list() as $module) {
     if ($module !== 'flexifilter') {
@@ -137,7 +138,7 @@ function flexifilter_flexifilter_compone
       }
     }
   }
-
+  
   // Allow existing flexifilters to be used as components
   foreach (flexifilter_get_filters(FALSE) as $fid => $filter) {
     $components['flexifilter_existing_flexifilter__'. $fid] = array(
@@ -149,7 +150,7 @@ function flexifilter_flexifilter_compone
       'step' => 'both',
     );
   }
-
+  
   return $components;
 }
 
@@ -174,7 +175,7 @@ function flexifilter_component_text_simp
         '#required' => FALSE,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       return str_replace($settings['find'], isset($settings['replace']) ? $settings['replace'] : '', $text);
@@ -205,7 +206,7 @@ function flexifilter_component_text_rege
         '#required' => FALSE,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       return preg_replace('~'. str_replace('~', '\~', $settings['find']) .'~', isset($settings['replace']) ? $settings['replace'] : '', $text);
@@ -222,13 +223,12 @@ function flexifilter_component_if($op, $
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       if (flexifilter_invoke_condition($settings['condition'], $op, $text) == TRUE) {
         $text = flexifilter_invoke_components($settings['components'], $op, $text);
       }
-
     default:
       return $text;
   }
@@ -254,7 +254,7 @@ function flexifilter_component_while($op
         $form['limit']['#value'] = $form['limit']['#default_value'];
       }
       return $form;
-
+    
     case 'prepare':
     case 'process':
       // Optimization case; the loop is skipped if none of the components do anything
@@ -274,7 +274,6 @@ function flexifilter_component_while($op
           }
         }
       }
-
     default:
       return $text;
   }
@@ -283,6 +282,7 @@ function flexifilter_component_while($op
 /**
  * Helper function for flexifilter_existing_filter_as_component.
  * Modifies the global configuration and returns a backup of the old configuration.
+ *
  * @param $settings
  *   The settings to set the global configuration to.
  * @see _flexifilter_pop_conf
@@ -299,6 +299,7 @@ function _flexifilter_push_conf($setting
 /**
  * Helper function for flexifilter_existing_filter_as_component.
  * Sets the global configuration back to the backup.
+ *
  * @param $old
  *   The old settings to revert back to.
  * @see _flexifilter_push_conf
@@ -311,6 +312,7 @@ function _flexifilter_pop_conf($old) {
 /**
  * Flexifilter component callback.
  * Handles the usage of another filter as a component.
+ *
  * @param $module
  *   The module whose filter is being called.
  * @param $delta
@@ -320,8 +322,8 @@ function flexifilter_existing_filter_as_
   global $conf;
   switch ($op) {
     case 'settings':
-      $form = array();
-      $oldconf = _flexifilter_push_conf($settings);
+      $form     = array();
+      $oldconf  = _flexifilter_push_conf($settings);
       $settings = module_invoke($module, 'filter', 'settings', $delta, 1, $text);
       _flexifilter_pop_conf($oldconf);
       if (is_array($settings) && count($settings) > 0) {
@@ -335,7 +337,7 @@ function flexifilter_existing_filter_as_
         }
       }
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $oldconf = _flexifilter_push_conf($settings);
@@ -348,6 +350,7 @@ function flexifilter_existing_filter_as_
 /**
  * Flexifilter component callback.
  * Handles the usage of another flexifilter as a component.
+ *
  * @param $fid
  *   The flexifilter id of the flexifilter being used as a component.
  */
@@ -355,7 +358,7 @@ function flexifilter_existing_flexifilte
   switch ($op) {
     case 'settings':
       return array();
-
+    
     case 'prepare':
     case 'process':
       $filters = flexifilter_get_filters();
@@ -371,8 +374,8 @@ function flexifilter_existing_flexifilte
 function flexifilter_component_text_pattern_replace($op, $settings, $text) {
   switch ($op) {
     case 'settings':
-      $form = array();
-      $max = isset($settings['number']) ? $settings['number'] : '2';
+      $form         = array();
+      $max          = isset($settings['number']) ? $settings['number'] : '2';
       $form['find'] = array(
         '#type' => 'textfield',
         '#title' => t('Text to find'),
@@ -388,14 +391,14 @@ function flexifilter_component_text_patt
         '#required' => TRUE,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
-      $find = $settings['find'];
-      $i = 0;
-      $count = 1;
+      $find    = $settings['find'];
+      $i       = 0;
+      $count   = 1;
       $replace = explode("\n", $settings['replace']);
-      $max = count($replace);
+      $max     = count($replace);
       foreach ($replace as $key => $value) {
         $replace[$key] = trim($value);
       }
@@ -461,19 +464,19 @@ function flexifilter_component_chunk_gra
         '#default_value' => isset($settings['include_rest']) ? $settings['include_rest'] : TRUE,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
-      $start = $settings['starts'];
-      $end = $settings['ends'];
-      $pass_limits = $settings['pass_limits'];
+      $start          = $settings['starts'];
+      $end            = $settings['ends'];
+      $pass_limits    = $settings['pass_limits'];
       $case_sensitive = $settings['case_sensitive'];
-      $include_rest = $settings['include_rest'];
-      $chunk = '';
-      $pos = 0;
-      $endpos = 0;
-      $tmp = '';
-      $tmp2 = '';
+      $include_rest   = $settings['include_rest'];
+      $chunk          = '';
+      $pos            = 0;
+      $endpos         = 0;
+      $tmp            = '';
+      $tmp2           = '';
       while ($pos !== FALSE && $endpos !== FALSE) {
         $pos = $case_sensitive ? strpos($text, $start) : stripos($text, $start);
         if ($include_rest) {
@@ -517,7 +520,7 @@ function flexifilter_component_text_appe
         '#default_value' => isset($settings['text']) ? $settings['text'] : '',
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $append = isset($settings['text']) ? $settings['text'] : '';
@@ -540,7 +543,7 @@ function flexifilter_component_text_prep
         '#default_value' => isset($settings['text']) ? $settings['text'] : '',
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $prepend = isset($settings['text']) ? $settings['text'] : '';
@@ -569,7 +572,7 @@ function flexifilter_component_text_subs
         '#default_value' => isset($settings['substr_length']) ? $settings['substr_length'] : '',
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $substr_start = isset($settings['substr_start']) ? $settings['substr_start'] : '0';
@@ -596,7 +599,7 @@ function flexifilter_component_advanced_
         '#default_value' => isset($settings['code']) ? $settings['code'] : 'return $text;',
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $code = isset($settings['code']) ? $settings['code'] : 'return $text;';
@@ -613,7 +616,7 @@ function flexifilter_component_advanced_
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $append = flexifilter_invoke_components($settings['components'], $op, $text);
@@ -630,10 +633,11 @@ function flexifilter_component_advanced_
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $prepend = flexifilter_invoke_components($settings['components'], $op, $text);
       return $prepend . $text;
   }
-}
\ No newline at end of file
+}
+
Index: flexifilter.conditions.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.conditions.inc,v
retrieving revision 1.3
diff -u -p -r1.3 flexifilter.conditions.inc
--- flexifilter.conditions.inc	11 Jan 2008 06:11:21 -0000	1.3
+++ flexifilter.conditions.inc	21 Jan 2008 15:57:56 -0000
@@ -1,6 +1,7 @@
 <?php
 // $Id: flexifilter.conditions.inc,v 1.3 2008/01/11 06:11:21 cwgordon7 Exp $
 
+
 /**
  * Implementation of hook_flexifilter_conditions()
  */
@@ -67,7 +68,7 @@ function flexifilter_flexifilter_conditi
     'group' => t('Filtering Steps'),
     'is_advanced' => TRUE,
   );
-    // Advanced.
+  // Advanced.
   $conditions['flexifilter_advanced_php'] = array(
     'label' => t('PHP code'),
     'description' => t('Uses php code to evaluate a condition.'),
@@ -100,7 +101,7 @@ function flexifilter_condition_text_sear
         '#default_value' => isset($settings['is_regex']) ? $settings['is_regex'] : 0,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       if (isset($settings['is_regex']) && $settings['is_regex'] == 1) {
@@ -141,24 +142,28 @@ function flexifilter_condition_text_leng
         '#required' => TRUE,
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
-      $length = strlen($text);
+      $length   = strlen($text);
       $operator = isset($settings['operator']) ? $settings['operator'] : 0;
-      $num = isset($settings['num']) ? $settings['num'] : variable_get('teaser_length', 600);;
+      $num      = isset($settings['num']) ? $settings['num'] : variable_get('teaser_length', 600);;
       switch ($operator) {
-        case 0:
-          return ($length < $num);
-        case 1:
-          return ($length <= $num);
-        case 2:
-          return ($length == $num);
-        case 3:
-          return ($length >= $num);
-        case 4:
-          return ($length > $num);
-      }
+      case 0:
+        return ($length < $num);
+      
+      case 1:
+        return ($length <= $num);
+      
+      case 2:
+        return ($length == $num);
+      
+      case 3:
+        return ($length >= $num);
+      
+      case 4:
+        return ($length > $num);
+    }
   }
 }
 
@@ -171,7 +176,7 @@ function flexifilter_condition_group_and
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       foreach ($settings['conditions'] as $condition) {
@@ -192,7 +197,7 @@ function flexifilter_condition_group_or(
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       foreach ($settings['conditions'] as $condition) {
@@ -213,7 +218,7 @@ function flexifilter_condition_group_not
     case 'settings':
       $form = array();
       return $form;
-
+    
     case 'prepare':
     case 'process':
       foreach ($settings['conditions'] as $condition) {
@@ -228,6 +233,7 @@ function flexifilter_condition_group_not
 /**
  * Flexifilter condition callback.
  * Returns $constant.
+ *
  * @param $constant
  *   The constant to return, either TRUE or FALSE.
  */
@@ -235,7 +241,7 @@ function flexifilter_condition_constant(
   switch ($op) {
     case 'settings':
       return array();
-
+    
     case 'prepare':
     case 'process':
       return $constant;
@@ -245,6 +251,7 @@ function flexifilter_condition_constant(
 /**
  * Flexifilter condition callback.
  * Returns TRUE if the current step matches $step.
+ *
  * @param $step
  *   The step to match, either 'prepare' or 'process'.
  */
@@ -252,7 +259,7 @@ function flexifilter_condition_step($ste
   switch ($op) {
     case 'settings':
       return array();
-
+    
     case 'prepare':
     case 'process':
       return $step == $op;
@@ -275,10 +282,11 @@ function flexifilter_condition_advanced_
         '#default_value' => isset($settings['code']) ? $settings['code'] : 'return TRUE;',
       );
       return $form;
-
+    
     case 'prepare':
     case 'process':
       $code = isset($settings['code']) ? $settings['code'] : 'return TRUE;';
       return eval($code);
   }
-}
\ No newline at end of file
+}
+
Index: flexifilter.flexifilters.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.flexifilters.inc,v
retrieving revision 1.1
diff -u -p -r1.1 flexifilter.flexifilters.inc
--- flexifilter.flexifilters.inc	21 Jan 2008 15:50:39 -0000	1.1
+++ flexifilter.flexifilters.inc	21 Jan 2008 15:57:56 -0000
@@ -1,9 +1,12 @@
 <?php
+// $Id$
+
 
 /**
  * Implementation of hook_flexifilters.
  */
 function flexifilter_flexifilters() {
   return array(
-  );
-}
\ No newline at end of file
+    );
+}
+
Index: flexifilter.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.install,v
retrieving revision 1.2
diff -u -p -r1.2 flexifilter.install
--- flexifilter.install	21 Jan 2008 15:50:39 -0000	1.2
+++ flexifilter.install	21 Jan 2008 15:57:57 -0000
@@ -1,12 +1,13 @@
 <?php
 // $Id: flexifilter.install,v 1.2 2008/01/21 15:50:39 cwgordon7 Exp $
 
+
 /**
  * Implementation of hook_install().
  */
 function flexifilter_install() {
   drupal_install_schema('flexifilter');
-  include_once(drupal_get_path('module', 'flexifilter') .'/flexifilter.module');
+  include_once (drupal_get_path('module', 'flexifilter') .'/flexifilter.module');
   flexifilter_install_flexifilters('flexifilter');
 }
 
@@ -29,7 +30,7 @@ function flexifilter_schema() {
         'type' => 'serial',
         'unsigned' => TRUE,
         'not null' => TRUE
-      ),
+        ),
       'label' => array(
         'type' => 'varchar',
         'length' => 127,
@@ -50,7 +51,7 @@ function flexifilter_schema() {
         'default' => 0,
         'description' => t('1 if the flexifilter is enabled, 0 otherwise'),
         'disp-width' => '3'
-      ),
+        ),
       'delta' => array(
         'type' => 'int',
         'size' => 'tiny',
@@ -127,8 +128,9 @@ function flexifilter_schema() {
     'primary key' => array('pid'),
     'indexes' => array(
       'fid' => array('fid')
-    ),
+      ),
   );
-
+  
   return $schema;
-}
\ No newline at end of file
+}
+
Index: flexifilter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flexifilter/flexifilter.module,v
retrieving revision 1.8
diff -u -p -r1.8 flexifilter.module
--- flexifilter.module	21 Jan 2008 15:50:39 -0000	1.8
+++ flexifilter.module	21 Jan 2008 15:57:57 -0000
@@ -1,9 +1,10 @@
 <?php
 // $Id: flexifilter.module,v 1.8 2008/01/21 15:50:39 cwgordon7 Exp $
+
 $path = drupal_get_path('module', 'flexifilter');
-include_once($path .'/flexifilter.components.inc');
-include_once($path .'/flexifilter.conditions.inc');
-include_once($path .'/flexifilter.flexifilters.inc');
+include_once ($path .'/flexifilter.components.inc');
+include_once ($path .'/flexifilter.conditions.inc');
+include_once ($path .'/flexifilter.flexifilters.inc');
 
 define('FLEXIFILTER_PART_TYPE_COMPONENT', 0);
 define('FLEXIFILTER_PART_TYPE_CONDITION', 1);
@@ -94,12 +95,12 @@ function flexifilter_help($path, $arg) {
       $output = '<p>'. t('Flexifilters are flexible filters that can be used by <a href="@input_formats">Input Formats</a> to filter created content.', array('@input_formats' => url('admin/settings/filters'))) .'</p>';
       //$output .= '<p>'. t('For more information, see the online handbook entry for <a href="@flexifilter">Flexifilter module</a>.', array('@flexifilter' => 'http://drupal.org/handbook/modules/flexifilter/')) .'</p>';
       return $output;
-
+    
     case 'admin/build/flexifilters':
       return '<p>'. t('Flexifilters are flexible filters that can be used by <a href="@input_formats">Input Formats</a> to filter created content.', array('@input_formats' => url('admin/settings/filters'))) .'</p>';
-
+    
     case 'admin/build/flexifilters/%/edit':
-      $output  = '<p>'. t('Flexifilters are defined in terms of components. A component can range from something simple like "regex replacement" to "invoke other filter" or "while loop". By combining these components, you can create a filter to do what you want. Use the "Add component" dropdown to add a new component to the end of your filter, and then use the "Re/move" dropdown within the component to remove the component, or to move it up/down within the list of components.') .'</p>';
+      $output = '<p>'. t('Flexifilters are defined in terms of components. A component can range from something simple like "regex replacement" to "invoke other filter" or "while loop". By combining these components, you can create a filter to do what you want. Use the "Add component" dropdown to add a new component to the end of your filter, and then use the "Re/move" dropdown within the component to remove the component, or to move it up/down within the list of components.') .'</p>';
       $output .= '<p>'. t('Some components (for example, the if/while loops) can have components and conditions within them. In this case, the if/while has a list of components, just like the filter itself has a list of components. The if/while will also have a condition, which controls when the list of components happen.');
       return $output;
   }
@@ -109,6 +110,7 @@ function flexifilter_help($path, $arg) {
  * An API function that gets a list of all the flexifilter components present.
  *
  * @param $reset Set to TRUE to clear the cache (cache is per-page-request)
+ *
  * @return An array containing the components. Each component will be a key/value pair in
  * this array. The key is a unique identifer of the component, also called the component
  * class. The values are associative arrays containing the following keys:
@@ -192,7 +194,6 @@ function flexifilter_get_condition_list(
   return $cache[$include_advanced_items];
 }
 
-
 /**
  * Causes a component to run
  *
@@ -200,6 +201,7 @@ function flexifilter_get_condition_list(
  * @param $op The operation to run on the component. "settings", "prepare" and "process" are valid operations.
  * @param $settings The values from the component's settings form (can be an empty array for "settings" operation)
  * @param $text The text to run the component over (ignored for "settings" operation)
+ *
  * @return "prepare" and "process" operations return the new text, "settings" returns an FAPI table. For any
  * operations that the component doesn't support, it will return $text.
  */
@@ -215,6 +217,7 @@ function flexifilter_invoke_component($c
  *  - settings : Array of settings to pass to the component
  * @param $op The operation to run on the condition. "settings", "prepare" and "process" are valid operations.
  * @param $text The text to run the condition over (ignored for "settings" operation)
+ *
  * @return "prepare" and "process" operations return either TRUE or FALSE, "settings" returns an FAPI table
  */
 function flexifilter_invoke_condition($data, $op, $text = '') {
@@ -227,19 +230,21 @@ function flexifilter_invoke_condition($d
       return FALSE;
     }
   }
-
+  
   // Anything else is a proper condition, so dispatch it
-  $conditions = flexifilter_get_condition_list();
-  $condition = $conditions[$data['class']];
-  $settings = $data['settings'];
+  $conditions   = flexifilter_get_condition_list();
+  $condition    = $conditions[$data['class']];
+  $settings     = $data['settings'];
   $return_value = call_user_func_array($condition['callback'], array_merge($condition['callback_arguments'], array($op, $settings, $text)));
-
+  
   switch ($op) {
     // For settings, return the value as-is
+    
     case 'settings':
       return $return_value;
-
+    
     // For prepare and process, force the return value to TRUE or FALSE
+    
     case 'prepare':
     case 'process':
       if ($return_value) {
@@ -260,6 +265,7 @@ function flexifilter_invoke_condition($d
  *  - settings : An array of settings for the component, suitable for passing to flexifilter_invoke_component()
  * @param $op The operation to perform on the components. Should be "prepare" or "process".
  * @param $text The text to prepare or process
+ *
  * @return The new text, after preparation / processing
  */
 function flexifilter_invoke_components($components, $op, $text) {
@@ -277,6 +283,7 @@ function flexifilter_invoke_components($
 
 /**
  * API function that returns TRUE if the components are involved in the step.
+ *
  * @param $components
  *   An array of components to check for involvement.
  * @param $step
@@ -309,11 +316,12 @@ function flexifilter_components_involve_
  *
  * @param $elements An array of elements. Each key/value pair is an element, with the
  * value being an associative array containing at least label and group.
+ *
  * @return An array of groups, such that: $returned['element_group']['element_key'] = 'element_label'.
  */
 function flexifilter_get_grouped_labels($elements) {
   $grouped = array();
-
+  
   foreach ($elements as $name => $element) {
     $grouped[$element['group']][$name] = $element['label'];
   }
@@ -341,16 +349,16 @@ function flexifilter_filter($op, $delta 
         }
       }
       return $filters;
-
+    
     case 'description':
       $filter = flexifilter_get_filter_by_delta($delta);
       return $filter['description'];
-
+    
     case 'prepare':
     case 'process':
       $filter = flexifilter_get_filter_by_delta($delta);
       return flexifilter_invoke_components($filter['components'], $op, $text);
-
+    
     default:
       return $text;
   }
@@ -375,6 +383,7 @@ function flexifilter_load($fid) {
  *
  * @param $include_components If TRUE, then the filter's components are not retrieved. This saves on alot of work, so set it to FALSE if you only require the flexifilter names and other simple details.
  * @param $reset May be set to true to clear the cache.
+ *
  * @return An array of flexifilters. For each key/value pair, the key is the flexifilter ID and the value
  * is an array containing the following fields:
  *  - label : A human readable name for the flexifilter
@@ -405,19 +414,20 @@ function flexifilter_get_filters($includ
  * (e.g. an array containing the label,description,id,enabled,advanced,delta and components fields), although id can be
  * set to 'new' to create a new flexifilter rather than update an existing one (in which case, delta is ignored). Do
  * not use
+ *
  * @return The fid.
  */
 function flexifilter_save_filter($filter) {
-  $fid = $filter['fid'];
-  $label = $filter['label'];
+  $fid         = $filter['fid'];
+  $label       = $filter['label'];
   $description = $filter['description'];
-  $advanced = $filter['advanced'];
+  $advanced    = $filter['advanced'];
   if ($fid === 'new') {
     db_query("INSERT INTO {flexifilters} (label, description, enabled, delta, pid_root, advanced) VALUES ('%s', '%s', 0, 0, 0, %d)",
       $label, $description, $advanced);
-    $fid = db_last_insert_id('flexifilters', 'fid');
+    $fid           = db_last_insert_id('flexifilters', 'fid');
     $pids_to_reuse = array();
-    $pid_root = _flexifilter_save_filter_components($filter['components'], $fid, $pids_to_reuse);
+    $pid_root      = _flexifilter_save_filter_components($filter['components'], $fid, $pids_to_reuse);
     db_query('UPDATE {flexifilters} SET pid_root = %d WHERE fid = %d', $pid_root, $fid);
   }
   else {
@@ -437,7 +447,7 @@ function flexifilter_save_filter($filter
   
   $existing_filters = flexifilter_get_filters(FALSE, TRUE);
   if (isset($existing_filters[$fid]['enabled']) && isset($filter['enabled'])) {
-    if($existing_filters[$fid]['enabled'] != $filter['enabled']) {
+    if ($existing_filters[$fid]['enabled'] != $filter['enabled']) {
       if ($filter['enabled']) {
         if (flexifilter_get_number_enabled_filters() < FLEXIFILTER_MAX_FILTERS) {
           $delta = flexifilter_get_unused_delta();
@@ -552,13 +562,13 @@ function _flexifilter_filter_from_db_row
     'delta' => $row->delta,
   );
   $pid_root = $row->pid_root;
-
+  
   if ($include_components) {
     // Fetch all the parts of the filter and store them in a flat array
-    $result = db_query('SELECT * FROM {flexifilters_parts} WHERE fid = %d', $row->fid);
-    $components_flat = array();
+    $result             = db_query('SELECT * FROM {flexifilters_parts} WHERE fid = %d', $row->fid);
+    $components_flat    = array();
     $component_children = array();
-    $id_next = 0;
+    $id_next            = 0;
     while ($row = db_fetch_object($result)) {
       $components_flat[$row->pid] = array(
         'class' => $row->class_name,
@@ -665,6 +675,7 @@ function flexifilter_get_number_enabled_
 
 /**
  * API function: installs flexifilters.
+ *
  * @param $module - The name of the module whose flexifilters should be installed.
  */
 function flexifilter_install_flexilters($module) {
@@ -672,4 +683,5 @@ function flexifilter_install_flexilters(
   foreach ($flexifilters as $flexifilter) {
     flexifilter_save_filter($flexifilter);
   }
-}
\ No newline at end of file
+}
+
