You are here

function sms_sendtophone_form_alter in SMS Framework 5

Same name and namespace in other branches
  1. 8 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()
  2. 6.2 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()
  3. 6 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()
  4. 7 modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()
  5. 2.x modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()
  6. 2.1.x modules/sms_sendtophone/sms_sendtophone.module \sms_sendtophone_form_alter()

File

modules/sms_sendtophone/sms_sendtophone.module, line 417

Code

function sms_sendtophone_form_alter($form_id, &$form) {
  if ($form_id == sms_sendtophone_inline_form || $form_id == sms_sendtophone_node_form || $form_id == sms_sendtophone_cck_form) {
    if (!user_access('send to any number')) {

      // Makes number field plain text
      $form['sms']['number']['#type'] = 'item';
      $form['sms']['number']['#value'] = $form['sms']['number']['#default_value'];
    }
  }
}