You are here

function theme_popup_ui_form_formatters in Popup 6.x

Same name and namespace in other branches
  1. 7.x modules/popup_ui/includes/popup_ui.theme.inc \theme_popup_ui_form_formatters()

Implementation of theme_popup_ui_form_formatters Themes the formats settings form

File

modules/popup_ui/popup_ui.module, line 219

Code

function theme_popup_ui_form_formatters($form) {
  $rows = array();
  $header = array(
    t('Administrative label'),
    array(
      'data' => '<div>' . t('Display') . '</div>' . t('Origin at'),
      'class' => 'section',
    ),
    t('Expand to'),
    t('Effect'),
    t('Style'),
    t('Opacity'),
    t('Width'),
    array(
      'data' => '<div>' . t('Behavior') . '</div>' . t('Activate'),
      'class' => 'section',
    ),
    t('Close'),
    t('AJAX'),
    array(
      'data' => '<div>' . t('Node') . '</div>' . t('Teaser'),
      'class' => 'section',
    ),
    t('Page'),
    t('Links'),
    t('Panel'),
    array(
      'data' => '<div>' . t('Menu') . '</div>' . t('Inline'),
      'class' => 'section',
    ),
    t('Flat'),
    array(
      'data' => '<div>' . t('Submenus') . '</div>' . t('Origin'),
      'class' => 'section',
    ),
    t('Expand'),
    array(
      'data' => '',
      'class' => 'section',
    ),
  );
  foreach ($form['rows'] as $row_id => $row) {
    if (substr($row_id, 0, 1) != '#') {
      foreach ($row as $field_id => $field) {
        if (substr($field_id, 0, 1) != '#') {
          if ($field_id == 'origin' || $field_id == 'teaser' || $field_id == 'activate' || $field_id == 'inline' || $field_id == 'submenu-origin' || $field_id == 'ops') {
            $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('Popup formats') . ':</label>' . theme('table', $header, $table_rows, array(
      'id' => 'format-table',
      'class' => "popup-settings-table",
    )) . '</div>',
  );
  $output .= drupal_render($form);
  return $output;
}