You are here

function birthdays_sync_form in Birthdays 5

Same name and namespace in other branches
  1. 6 birthdays.admin.inc \birthdays_sync_form()
  2. 6 birthdays.sync.inc \birthdays_sync_form()

Implementation of hook_form().

1 string reference to 'birthdays_sync_form'
birthdays_menu in ./birthdays.module
Implementation of hook_menu().

File

./birthdays.module, line 205
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an e-mail on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_sync_form() {
  global $_birthdays_field;
  if (!isset($_birthdays_field)) {
    drupal_set_message(t('No date field has been selected as birthdays field. Please visit the <a href="@birthdays-settings">birthdays settings page</a>.', array(
      '@birthdays-settings' => url('admin/settings/birthdays'),
    )), 'warning');
    return array();
  }
  $form['profile_fieldset'] = array(
    '#type' => 'fieldset',
  );
  $form['profile_fieldset']['description'] = array(
    '#type' => 'item',
    '#title' => t('Profile to Birthdays'),
    '#value' => t('Fill the Birthdays module\'s table with data from the Profile module\'s table. This is needed when you (re-)installed the Birthdays module, but already collected birthdays with the Profile module (e.g. for age verification).'),
  );
  $form['profile_fieldset']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Copy Profile data to Birthdays module'),
  );
  $form['birthdays_fieldset'] = array(
    '#type' => 'fieldset',
  );
  $form['birthdays_fieldset']['description'] = array(
    '#type' => 'item',
    '#title' => t('Birthdays to Profile'),
    '#value' => t('Fill the Profile module\'s table with data from the Birthdays module\'s table. You can use this to copy the old data collected by a previous version of the Birthdays module after an update. It is only necessary when updating from a version of the Birthdays module which didn\'t use the Profile module.'),
  );
  $form['birthdays_fieldset']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Copy Birthdays data to Profile module'),
  );
  return $form;
}