function theme_features_components in Features 7.2
Same name and namespace in other branches
- 6 theme/theme.inc \theme_features_components()
- 7 theme/theme.inc \theme_features_components()
Theme a set of features export components.
Parameters
array $vars: Variables for this theme hook.
Return value
string Rendered HTML.
Throws
\Exception Exceptions can be thrown in theme(), if called pre-boot.
File
- theme/
theme.inc, line 350 - Theme functions and (pre)processors for 'features' module.
Code
function theme_features_components($vars) {
$info = $vars['info'];
$sources = $vars['sources'];
$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', array(
'components' => $feature_items,
'source' => $source_items,
)),
'class' => 'component',
),
);
}
}
$output .= theme('table', array(
'header' => array(),
'rows' => $rows,
));
$output .= theme('features_component_key', array());
}
return $output;
}