You are here

function theme_spaces_features_labels in Spaces 5

Form theme for spaces_features_labels()

File

./spaces_admin.inc, line 260

Code

function theme_spaces_features_labels($form) {
  $output .= drupal_render($form['help']);
  $rows = array();
  foreach (spaces_features($form['nid']['#value']) as $feature => $dummy) {
    $feature_label = false;
    if (is_array($form[$feature])) {
      foreach ($form[$feature] as $path => $item) {
        $row = array();
        if (is_array($item) && isset($item['label'])) {
          $path = $item['label']['#description'];
          unset($form[$feature][$path]['label']['#description']);
          $rows[] = array(
            !$feature_label ? "<strong>" . $form[$feature]['#title'] . "</strong>" : '',
            $path,
            drupal_render($form[$feature][$path]['label']),
            drupal_render($form[$feature][$path]['weight']),
          );
          $feature_label = true;
        }
      }
    }
  }
  $output .= theme('table', array(
    t('Feature'),
    t('Path'),
    t('Label'),
    t('Weight'),
  ), $rows);
  $output .= "<div class='buttons'>" . drupal_render($form['save']) . drupal_render($form['reset']) . "</div>";
  $output .= drupal_render($form);
  return $output;
}