You are here

function panels_page_edit_form in Panels 5.2

Same name and namespace in other branches
  1. 6.2 panels_page/panels_page.admin.inc \panels_page_edit_form()

The form to edit the page portion of a panel.

4 string references to 'panels_page_edit_form'
panels_page_add_page in panels_page/panels_page.admin.inc
Handle the add panel-page page.
panels_page_edit in panels_page/panels_page.admin.inc
Edit a panel page.
panels_page_import_form_submit in panels_page/panels_page.admin.inc
Handle the submit button on importing a panel page.
panels_page_import_page in panels_page/panels_page.admin.inc
Page callback to import a panel page from PHP code.

File

panels_page/panels_page.admin.inc, line 226
panels_page.admin.inc

Code

function panels_page_edit_form($panel_page, $next = NULL) {
  panels_load_include('common');
  drupal_add_css(panels_get_path('css/panels_admin.css'));
  $layout = panels_get_layout($panel_page->display->layout);
  $form['pid'] = array(
    '#type' => 'value',
    '#value' => $panel_page->pid,
  );
  $form['panel_page'] = array(
    '#type' => 'value',
    '#value' => $panel_page,
  );
  $form['right'] = array(
    '#prefix' => '<div class="layout-container">',
    '#suffix' => '</div>',
  );
  $form['left'] = array(
    '#prefix' => '<div class="panel-page-info-container">',
    '#suffix' => '</div>',
  );
  $form['left']['info'] = array(
    '#type' => 'fieldset',
    '#title' => t('Page settings'),
  );
  $form['right']['layout'] = array(
    '#type' => 'fieldset',
    '#title' => t('Layout'),
  );
  $form['right']['layout']['layout-icon'] = array(
    '#value' => panels_print_layout_icon($panel_page->display->layout, $layout),
  );
  $form['right']['layout']['layout-display'] = array(
    '#value' => check_plain($layout['title']),
  );
  $panel_page->context = $panel_page->display->context = panels_context_load_contexts($panel_page);
  $form['right']['layout']['layout-content'] = array(
    '#value' => theme('panels_common_content_list', $panel_page->display),
  );
  $contexts = theme('panels_common_context_list', $panel_page);
  if ($contexts) {
    $form['right']['context'] = array(
      '#type' => 'fieldset',
      '#title' => t('Contexts'),
    );
    $form['right']['context']['context'] = array(
      '#value' => $contexts,
    );
  }
  $form['left']['info']['name'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $panel_page->name,
    '#title' => t('Panel name'),
    '#description' => t('A unique name used to identify this panel page internally. It must be only be alpha characters and underscores. No spaces, numbers or uppercase characters.'),
    '#required' => TRUE,
  );
  $form['left']['info']['title'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $panel_page->title,
    '#title' => t('Page title'),
    '#description' => t("The page title for this panels layout. It will be used as the main title on this panel page, unless it is overriden later."),
  );
  $form['left']['info']['css_id'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $panel_page->css_id,
    '#title' => t('CSS ID'),
    '#description' => t('The CSS ID to apply to this page'),
  );
  $form['left']['info']['path'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $panel_page->path,
    '#title' => t('Path'),
    '#description' => t('The URL path to give this page, i.e, path/to/page. You may use "%" as an argument placeholder: i.e, node/%/panel'),
    '#required' => TRUE,
  );
  $label = $panel_page->pid == 'new' ? t('Save and proceed') : t('Save');
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => $label,
  );
  return $form;
}