You are here

function theme_features_components in Features 6

Same name and namespace in other branches
  1. 7.2 theme/theme.inc \theme_features_components()
  2. 7 theme/theme.inc \theme_features_components()

Theme a set of features export components.

2 theme calls to theme_features_components()
features_export_build_form_populate in ./features.admin.inc
AHAH handler for features_export_form_build().
features_export_form in ./features.admin.inc
Form callback for features export form. Acts as a router based on the form_state.

File

theme/theme.inc, line 276

Code

function theme_features_components($info, $sources = array()) {
  $output = '';
  $rows = array();
  $components = features_get_components();
  if (!empty($info['features']) || !empty($info['dependencies']) || !empty($sources)) {
    $export = array_unique(array_merge(array_keys($info['features']), array_keys($sources), array(
      'dependencies',
    )));
    foreach ($export as $component) {
      if ($component === 'dependencies') {
        $feature_items = isset($info[$component]) ? $info[$component] : array();
      }
      else {
        $feature_items = isset($info['features'][$component]) ? $info['features'][$component] : array();
      }
      $source_items = isset($sources[$component]) ? $sources[$component] : array();
      if (!empty($feature_items) || !empty($source_items)) {
        $rows[] = array(
          array(
            'data' => isset($components[$component]['name']) ? $components[$component]['name'] : $component,
            'header' => TRUE,
          ),
        );
        $rows[] = array(
          array(
            'data' => theme('features_component_list', $feature_items, $source_items),
            'class' => 'component',
          ),
        );
      }
    }
    $output .= theme('table', array(), $rows);
    $output .= theme('features_component_key');
  }
  return $output;
}