? sms_blast.module.patch
Index: sms_blast.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/smsframework/modules/sms_blast/sms_blast.module,v
retrieving revision 1.2
diff -u -p -r1.2 sms_blast.module
--- sms_blast.module	30 Jul 2008 19:42:56 -0000	1.2
+++ sms_blast.module	6 Oct 2008 14:34:12 -0000
@@ -7,32 +7,29 @@
  */
 
 /**
- * Implementation of hook_menu().
+ * Implementation of hook_perm().
  */
-function sms_blast_menu($may_cache) {
-  $items = array();
-
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'sms_blast',
-      'title' => t('SMS Blast'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('sms_blast_form'),
-      'access' => user_access('send sms blasts'),
-      'type' => MENU_NORMAL_ITEM,
-    );  
-  }
-  
-  return $items;
+function sms_blast_perm() {
+  return array('send sms blasts');
 }
 
 /**
- * Implementation of hook_perm().
+ * Implementation of hook_menu().
  */
-function sms_blast_perm() {
-  return array('send sms blasts');
+function sms_blast_menu() {
+  $items['sms_blast'] = array(
+    'title'            => 'SMS Blast',
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('sms_blast_form'),
+    'access arguments' => array('send sms blasts'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  return $items;
 }
 
+/**
+ * Display the sms blast form
+ */
 function sms_blast_form() {
   $form['message'] = array(
     '#type' => 'textarea',
@@ -40,25 +37,28 @@ function sms_blast_form() {
     '#cols' => 60,
     '#rows' => 5,
   );
-  
+
   $form['submit'] = array(
-    '#type' => 'submit', 
+    '#type' => 'submit',
     '#value' => t('Send'),
   );
-  
+
   return $form;
 }
 
-function sms_blast_form_submit($form_id, $form_values) {
+/**
+ * Submit handler for the sms blast form
+ */
+function sms_blast_form_submit(&$form, $form_state) {
   $result = db_query("SELECT uid FROM {users} WHERE uid <> 0");
   while ($row = db_fetch_array($result)) {
     $users[] = $row;
   }
-  
+
   foreach ($users as $user) {
     $this_user = user_load(array('uid' => $user['uid']));
     if ($this_user->sms_user[0]['status'] == 2) {
-      sms_send($this_user->sms_user[0]['number'], $form_values['message'], $this_user->sms_user[0]['gateway']);
+      sms_send($this_user->sms_user[0]['number'], $form_state['values']['message'], $this_user->sms_user[0]['gateway']);
     }
   }
-}
\ No newline at end of file
+}
