You are here

function theme_page_manager_page_form_argument_table in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 page_manager/plugins/tasks/page.admin.inc \theme_page_manager_page_form_argument_table()

Theme the table for this form.

1 theme call to theme_page_manager_page_form_argument_table()
page_manager_page_form_argument in page_manager/plugins/tasks/page.admin.inc
Form to handle assigning argument handlers to named arguments.

File

page_manager/plugins/tasks/page.admin.inc, line 931
Administrative functions for the page subtasks.

Code

function theme_page_manager_page_form_argument_table($form) {
  $header = array(
    array(
      'data' => t('Argument'),
      'class' => 'page-manager-argument',
    ),
    array(
      'data' => t('Position in path'),
      'class' => 'page-manager-position',
    ),
    array(
      'data' => t('Context assigned'),
      'class' => 'page-manager-context',
    ),
    array(
      'data' => t('Operations'),
      'class' => 'page-manager-operations',
    ),
  );
  $rows = array();
  ctools_include('modal');
  ctools_modal_add_js();
  foreach (element_children($form['argument']) as $key) {
    $row = array();
    $row[] = '%' . check_plain($form['argument'][$key]['#keyword']);
    $row[] = check_plain($form['argument'][$key]['#position']);
    $row[] = $form['argument'][$key]['#context'] . '   ' . drupal_render($form['argument'][$key]['change']);
    $row[] = drupal_render($form['argument'][$key]['settings']) . drupal_render($form['argument'][$key]);
    $rows[] = array(
      'data' => $row,
    );
  }
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('The path %path has no arguments to configure.', array(
          '%path' => $form['#page-manager-path'],
        )),
        'colspan' => 4,
      ),
    );
  }
  $attributes = array(
    'id' => 'page-manager-argument-table',
  );
  $output = theme('table', $header, $rows, $attributes);
  return $output;
}