You are here

function demo_reset_block_form in Demonstration site (Sandbox / Snapshot) 7

Same name and namespace in other branches
  1. 6 demo_reset.module \demo_reset_block_form()

Form builder to reset site to configured snapshot.

No access permission check or any condition here. By design.

1 string reference to 'demo_reset_block_form'
demo_reset_block_view in demo_reset/demo_reset.module
Implements hook_block_view().

File

demo_reset/demo_reset.module, line 145
Demonstration site reset module.

Code

function demo_reset_block_form($form, &$form_state) {
  $form['redirect'] = array(
    '#type' => 'value',
    '#value' => $_GET['q'],
  );
  $filename = variable_get('demo_dump_cron', '');
  $form['filename'] = array(
    '#type' => 'value',
    '#value' => $filename,
  );
  $form['snapshot'] = array(
    '#markup' => t('Active snapshot: @snapshot', array(
      '@snapshot' => $filename,
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Reset now'),
  );
  return $form;
}