You are here

function panels_admin_edit_block in Panels 6.2

Same name and namespace in other branches
  1. 5.2 content_types/block.inc \panels_admin_edit_block()

Returns an edit form for a block.

1 call to panels_admin_edit_block()
panels_admin_add_block in content_types/block.inc
Returns the form for a new block.
1 string reference to 'panels_admin_edit_block'
panels_block_panels_content_types in content_types/block.inc
Callback function to supply a list of content types.

File

content_types/block.inc, line 132

Code

function panels_admin_edit_block($id, $parents, $conf) {
  $form['module'] = array(
    '#type' => 'value',
    '#value' => $conf['module'],
  );
  $form['delta'] = array(
    '#type' => 'value',
    '#value' => $conf['delta'],
  );
  if (user_access('administer advanced pane settings')) {
    $form['block_visibility'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use block visibility settings (see block config)'),
      '#default_value' => !empty($conf['block_visibility']),
      '#description' => t('If checked, the block visibility settings for this block will apply to this block.'),
    );

    // Module-specific block configurations.
    if ($settings = module_invoke($conf['module'], 'block', 'configure', $conf['delta'])) {

      // Specifically modify a couple of core block forms.
      if ($conf['module'] == 'block') {
        unset($settings['submit']);
        $settings['info']['#type'] = 'value';
        $settings['info']['#value'] = $settings['info']['#default_value'];
      }
      panels_admin_fix_block_tree($settings);
      $form['block_settings'] = array(
        '#type' => 'fieldset',
        '#title' => t('Block settings'),
        '#description' => t('Settings in this section are global and are for all blocks of this type, anywhere in the system.'),
        '#tree' => FALSE,
      );
      $form['block_settings'] += $settings;
    }
  }
  return $form;
}