You are here

function ds_revert_form in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 includes/ds.tools.inc \ds_revert_form()
  2. 6 includes/ds.tools.inc \ds_revert_form()

Revert form.

Parameters

string $module The name of the module.:

string $object_type The object type name.:

string $build_mode The build mode.:

1 string reference to 'ds_revert_form'
_ds_ui_menu in includes/ds.registry.inc
Return menu items and import default settings.

File

includes/ds.tools.inc, line 325
Tools for Display suite like export & import.

Code

function ds_revert_form($form_state, $module = '', $type = '', $build_mode = '') {
  $display_settings = ds_get_settings($module, $type, $build_mode);
  if (!empty($display_settings) && isset($display_settings['status']) && $display_settings['status'] == DS_SETTINGS_OVERRIDDEN) {
    $question = t('Are you sure you want to revert the display settings for %module, %type and %build_mode. This will bring back the default settings and any changes you have done will be lost.', array(
      '%module' => $module,
      '%type' => $type,
      '%build_mode' => $build_mode,
    ));
    $path = DS_PATH_LAYOUT;
    $form['#module'] = $module;
    $form['#object_type'] = $type;
    $form['#build_mode'] = $build_mode;
    $form['#path'] = $path;
    return confirm_form($form, $question, $path);
  }
  else {
    drupal_set_message(t('Variables not found.'));
    drupal_goto(DS_PATH_BASE);
  }
}