You are here

function ds_emergency in Display Suite 7

Same name and namespace in other branches
  1. 7.2 includes/ds.displays.inc \ds_emergency()

Emergency page

1 string reference to 'ds_emergency'
ds_menu in ./ds.module
Implements hook_menu().

File

./ds.layout.inc, line 63
Shows the overview screen with all links to entities.

Code

function ds_emergency() {
  $form['ds_fields_error'] = array(
    '#type' => 'fieldset',
    '#title' => t('Fields error'),
  );
  $form['ds_fields_error']['ds_disable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable attaching fields via Display suite'),
    '#description' => t('In case you get an error after configuring a layout printing a message like "Fatal error: Unsupported operand types", you can temporarily disable adding fields from DS by toggling this checkbox. You probably are trying to render an node inside a node, for instance through a view, which is simply not possible. See <a href="http://drupal.org/node/1264386">http://drupal.org/node/1264386</a>.'),
    '#default_value' => variable_get('ds_disable', FALSE),
    '#weight' => 0,
  );
  $form['ds_fields_error']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Disable/enable field attach'),
    '#submit' => array(
      'ds_emergency_fields_attach',
    ),
    '#weight' => 1,
  );
  if (module_exists('ds_extras')) {
    $region_blocks = variable_get('ds_extras_region_blocks', array());
    if (!empty($region_blocks)) {
      $region_blocks_options = array();
      foreach ($region_blocks as $key => $info) {
        $region_blocks_options[$key] = $info['title'];
      }
      $form['region_to_block'] = array(
        '#type' => 'fieldset',
        '#title' => t('Block regions'),
      );
      $form['region_to_block']['remove_block_region'] = array(
        '#type' => 'checkboxes',
        '#options' => $region_blocks_options,
        '#description' => t('In case you renamed a content type, you will not see the configured block regions anymore, however the block on the block settings page is still available. On this screen you can remove orphaned block regions.'),
      );
      $form['region_to_block']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Update block regions'),
        '#submit' => array(
          'ds_emergency_region_to_block_submit',
        ),
        '#weight' => 1,
      );
    }
  }
  return $form;
}