You are here

function patterns_list_patterns_2 in Patterns 7.2

Same name and namespace in other branches
  1. 7 theme/common.inc \patterns_list_patterns_2()

File

theme/common.inc, line 8
Theme functions.

Code

function patterns_list_patterns_2($patterns, $form = array(), $options = array()) {
  foreach ($patterns as $pid => $pattern) {
    $category = $pattern->info['category'] ? $pattern->info['category'] : t('Other');
    $form['patterns'][$category][] = _patterns_pattern_build_row($pid, $pattern);
    $form['patterns'][$category] += array(
      '#type' => 'fieldset',
      '#title' => $category,
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
      '#theme' => 'patterns_patterns_fieldset',
      '#header' => array(
        array(
          'data' => t('Enabled'),
          'class' => array(
            'checkbox',
          ),
        ),
        t('Format'),
        t('Name'),
        t('Title'),
        t('Version'),
        t('Description'),
        array(
          'data' => t('Operations'),
          'colspan' => 7,
        ),
      ),
    );
  }
}