You are here

function ac_update_form2 in Availability Calendars 7.2

Retrieve form callback for the admin/config/content/availability-calendars/update/2 page.

Return value

array The form

1 string reference to 'ac_update_form2'
ac_update_menu in ac_update/ac_update.module

File

ac_update/ac_update.module, line 179
Availability Calendars update: admin update code

Code

function ac_update_form2($form) {
  $state = ac_update_current_step_state();
  $form['intro'] = array(
    '#type' => 'markup',
    '#markup' => <<<LITERAL
<h2>Availability Calendars update</h2>
<p>
This module will update Availability Calendars to the new field based storage.
It will do so in a number of steps and checks.
</p>
<ol class="acu_list">
<li class="acu_ok">Check prerequisites.</li>
<li class="{<span class="php-variable">$state</span>}">Clean split day states.</li>
<li class="acu_inactive">Copy data.</li>
</ol>
LITERAL
,
  );
  $form['next'] = array(
    '#type' => 'markup',
    '#markup' => <<<LITERAL
<h2>Next step: Clean split day states</h2>
<p>
The fields based version does not store split day states, though it does allow
to show availability split over 2 days: a state for a given day will be shown on
the pm part of that day and on the am part of the next day.
Part of the update is to clean up split states in the database.
All days having a split state will get the pm state of that day.
</p>
<p>
Even when your current setting is to not show split day states, they may still be
present in the database. This because changing the setting did not clean the
database.
When you have never used this setting, this step just checks for unknown states
in the database.
</p>
<p>
Note: it will not be checked whether the pm and am states of two subsequent days
are equal. If the am state differs, that information will get lost!
</p>
LITERAL
,
  );

  // Add form submit button.
  $form['actions'] = array(
    '#type' => 'actions',
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Execute next step ...'),
    ),
  );
  $form['#attached']['css'] = array(
    drupal_get_path('module', 'ac_update') . '/ac_update.css',
  );
  $form['#method'] = 'POST';
  $form['#submit'] = array(
    'ac_update_form_submit',
  );
  $form['#submit-callback'] = 'ac_update_remove_split_states';
  $form['#submit-redirect'] = 'admin/config/content/availability-calendars/update/3';
  return $form;
}