You are here

function template_preprocess_page_manager_edit_page in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 page_manager/theme/page_manager.theme.inc \template_preprocess_page_manager_edit_page()

Preprocess the page manager edit page.

File

page_manager/theme/page_manager.theme.inc, line 11
Preprocess functions for page manager editing templates.

Code

function template_preprocess_page_manager_edit_page(&$vars) {
  ctools_include('ajax');
  ctools_include('modal');
  ctools_modal_add_js();
  ctools_add_js('dependent');
  ctools_add_css('page-manager', 'page_manager');
  ctools_add_css('wizard');
  $task = $vars['page']->task;
  $page =& $vars['page'];
  $vars['locked'] = '';
  $vars['changed'] = '';
  if (!empty($page->locked)) {
    $vars['locked'] = theme('page_manager_lock', array(
      'page' => $page,
    ));
    $vars['changed'] = theme('page_manager_changed', array(
      'text' => t('Locked'),
      'description' => t('This page is being edited by another user and you cannot make changes to it.'),
    ));
  }
  elseif (!empty($page->new)) {
    $vars['changed'] = theme('page_manager_changed', array(
      'text' => t('New'),
      'description' => t('This page is newly created and has not yet been saved to the database. It will not be available until you save it.'),
    ));
  }
  elseif (!empty($page->changed)) {
    $vars['changed'] = theme('page_manager_changed', array(
      'text' => t('Changed'),
      'description' => t('This page has been modified, but these modifications are not yet live. While modifying this page, it is locked from modification by other users.'),
    ));
  }
  $form_state = array(
    'page' => &$vars['page'],
  );
  $active = $vars['content']['active'];
  if ($active[0] == 'handlers' && isset($vars['operations'][$active[1]])) {
    $vars['operations']['secondary'] = $vars['operations'][$active[1]];
  }
}