You are here

function template_preprocess_panels_ipe_add_pane_button in Panels 7.3

File

panels_ipe/panels_ipe.module, line 183

Code

function template_preprocess_panels_ipe_add_pane_button(&$vars) {
  $region_id = $vars['region_id'];
  $display = $vars['display'];
  $renderer = $vars['renderer'];
  $vars['links'] = array();

  // Add option to configure style in IPE.
  if (user_access('administer panels region styles')) {
    $vars['links']['style'] = array(
      'title' => '<span>' . t('Region style') . '</span>',
      'href' => $renderer
        ->get_url('style-type', 'region', $region_id),
      'html' => TRUE,
      'attributes' => array(
        'class' => array(
          'ctools-use-modal',
          'panels-ipe-hide-bar',
          'style',
        ),
        'title' => t('Region style'),
      ),
    );
  }

  // Add option to add items in the IPE.
  $vars['links']['add-pane'] = array(
    'title' => '<span>' . t('Add new pane') . '</span>',
    'href' => $renderer
      ->get_url('select-content', $region_id),
    'attributes' => array(
      'class' => array(
        'ctools-use-modal',
        'add',
        'panels-ipe-hide-bar',
      ),
      'title' => t('Add new pane'),
    ),
    'html' => TRUE,
  );
  $context = array(
    'region_id' => $region_id,
    'display' => $display,
    'renderer' => $renderer,
  );
  drupal_alter('panels_ipe_region_links', $vars['links'], $context);
}