1.12.x block.class.inc Block::getAdminConditionsPreview()
1.10.x block.class.inc Block::getAdminConditionsPreview()
1.11.x block.class.inc Block::getAdminConditionsPreview()
1.7.x block.class.inc Block::getAdminConditionsPreview()
1.8.x block.class.inc Block::getAdminConditionsPreview()
1.9.x block.class.inc Block::getAdminConditionsPreview()

Return a fieldset listing any visibility conditions set for this block.

File

modules/layout/includes/block.class.inc, line 187
A class that wraps around a block to store settings information.

Class

Block
@file A class that wraps around a block to store settings information.

Code

function getAdminConditionsPreview() {
  $preview = '';

  if (!empty($this->conditions)) {
    $condition_list = array();
    foreach ($this->conditions as $condition) {
      $condition_list[] = $condition->summary();
    }
    $conditions = theme('item_list', array('items' => $condition_list, 'attributes' => array('class' => array('block-conditions'))));
    $fieldset = array(
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#title' => t('Conditions'),
      '#children' => $conditions,
      '#parents' => array(),
    );
    $form_state = array();
    form_process_fieldset($fieldset, $form_state);

    $preview = backdrop_render($fieldset);
  }
  return $preview;
}