You are here

function theme_popup_breadcrumb_settings in Popup 6.x

Implementation of theme_popup_breadcrumb_settings Themes the popup breadcrumb settings form

File

modules/popup_breadcrumb/popup_breadcrumb.module, line 139

Code

function theme_popup_breadcrumb_settings($form) {
  $table_rows = array();
  $header = array(
    '',
    'Name',
    array(
      'data' => '<div>' . t('View') . '</div>&nbsp;',
      'class' => 'section',
    ),
    'Display',
    'Arguments',
    array(
      'data' => '<div>' . t('Title') . '</div>Derive from',
      'class' => 'section',
    ),
    'Argument',
    'Weight',
    array(
      'data' => '',
      'class' => 'section',
    ),
  );
  foreach ($form['rows'] as $row_id => $row) {
    if (substr($row_id, 0, 1) != '#') {
      $table_rows[$row_id] = array(
        'class' => 'draggable',
        'data' => array(
          '',
        ),
      );
      foreach ($row as $field_id => $field) {
        if (substr($field_id, 0, 1) != '#') {
          if ($field_id == 'view' || $field_id == 'title_type') {
            $table_rows[$row_id]['data'][] = array(
              'data' => drupal_render($form['rows'][$row_id][$field_id]),
              'class' => 'section',
            );
          }
          else {
            $table_rows[$row_id]['data'][] = drupal_render($form['rows'][$row_id][$field_id]);
          }
        }
      }
    }
  }
  $form['table'] = array(
    '#value' => '<div class="form-item"><label>' . t('Breadcrumb levels') . ':</label>' . theme('table', $header, $table_rows, array(
      'id' => 'breadcrumb-table',
      'class' => "popup-settings-table",
    )) . '</div>',
    '#weight' => -1,
  );
  $output .= drupal_render($form);
  drupal_add_tabledrag('breadcrumb-table', 'order', 'sibling', 'row-weight');
  return $output;
}