You are here

function ac_update_form3 in Availability Calendars 7.2

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

Return value

array The form

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

File

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

Code

function ac_update_form3($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="acu_ok">Clean split day states.</li>
<li class="{<span class="php-variable">$state</span>}">Copy data.</li>
</ol>
LITERAL
,
  );
  $form['next'] = array(
    '#type' => 'markup',
    '#markup' => <<<LITERAL
<h2>Next step: Copy data</h2>
<p>The following data will be copied or created:</p>
<dl>
<dt>States</dt>
<dd>
The fields based version also stores 1 global set of states.
Each field can define a subset of this set as the set of allowed states for that field.
The global set of states is extended with the current set of states.
</dd>
<dt>Calendars</dt>
<dd>
For each calendar a record will be created that keeps track of the created and last updated time.
The conversion will fetch these timestamps from the main node referring to the calendar.
</dd>
<dt>Availability</dt>
<dd>The availability data wll be copied to the new calendar tables.</dd>
<dt>Field and field instances</dt>
<dd>
For each supported content type an Availability Calendar field and instance will be created.
</dd>
<dt>Field data</dt>
<dd>
Field data will be created to set up the links between the nodes and the created calendars.
</dd>
</dl>
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_copy_data';
  $form['#submit-redirect'] = 'admin/config/content/availability-calendars/update/4';
  return $form;
}