You are here

function panels_everywhere_page_manager_variant_operations_alter in Panels Everywhere 7

Same name and namespace in other branches
  1. 6 panels_everywhere.module \panels_everywhere_page_manager_variant_operations_alter()

Alter the panel context settings form

File

./panels_everywhere.module, line 297
panels_everywhere.module

Code

function panels_everywhere_page_manager_variant_operations_alter(&$operations, $handler) {

  // Do not add this to variants on the site template, as templates cannot
  // select templates.
  if ($handler->task == 'site_template') {
    return;
  }

  // Use this obnoxious construct to safely insert our item.
  reset($operations['children']);
  $new = array();
  foreach ($operations['children'] as $key => $value) {
    $new[$key] = $value;
    if ($key == 'summary') {
      $new['panels_everywhere'] = array(
        'title' => t('Template'),
        'description' => t('Choose which site template to use for this page.'),
        'form' => 'panels_everywhere_variant_template',
      );
    }
  }
  $operations['children'] = $new;
}