You are here

function autosave_preprocess_autosave_restore_popup in Autosave 7.2

Theme preprocess function.

File

./autosave.theme.inc, line 34

Code

function autosave_preprocess_autosave_restore_popup(&$vars) {
  $options = array(
    'external' => TRUE,
    // Needed for an empty anchor without a beginning slash.
    'fragment' => FALSE,
    // Needed for an empty anchor
    'attributes' => array(
      'class' => array(
        'ignore-link',
      ),
      'title' => t('Ignore/Delete saved form'),
    ),
  );
  $vars['ignore_link'] = l(t('Ignore'), NULL, $options);
  $options = array(
    'attributes' => array(
      'class' => array(
        'use-ajax',
        'restore-link',
      ),
      'title' => t('Restore saved form'),
    ),
  );
  $callback_path = 'autosave/restore/' . $vars['autosave']['form_id'] . '/' . $vars['autosave']['savedTimestamp'] . '/' . $vars['autosave']['form_token'] . '/' . $vars['autosave']['theme'];
  $vars['restore_link'] = l(t('Restore'), $callback_path, $options);
}