You are here

function socialfield_add_service in Social field 7

Form for adding a new service.

1 string reference to 'socialfield_add_service'
socialfield_menu in ./socialfield.module
Implements hook_menu().

File

./socialfield.module, line 109
Provides a field for adding social services links.

Code

function socialfield_add_service($form, $form_state) {
  $form['service'] = array(
    '#type' => 'textfield',
    '#title' => t('Service machine name'),
  );
  $form['service_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Service name'),
  );
  $form['service_icon'] = array(
    '#type' => 'textfield',
    '#description' => t('Example: icon-facebook'),
    '#title' => t('Service icon class'),
  );
  $form['service_validation_pattern'] = array(
    '#type' => 'textarea',
    '#description' => t('Enter the list of allowed urls separated by new line.<br />Leave empty to allow user input any urls.<br />The "*" character is a wildcard.<br />Example: *facebook.com/* for any page on Facebook site.'),
    '#title' => t('Url validation pattern'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  return $form;
}