Page callback: Presents a list of layouts.
array An array as expected by drupal_render().
function layout_page_list() {
// Get list of layouts defined by enabled modules and themes.
$layouts = layout_manager()
->getDefinitions();
$rows = array();
$header = array(
t('Name'),
t('Source'),
);
foreach ($layouts as $name => $layout) {
$provider_info = system_get_info($layout['provider']['type'], $layout['provider']['provider']);
// Build table columns for this row.
$row = array();
$row['name'] = l($layout['title'], 'admin/structure/templates/manage/' . $name);
// Type can either be 'module' or 'theme'.
$row['provider'] = t('@name @type', array(
'@name' => $provider_info['name'],
'@type' => t($layout['provider']['type']),
));
$rows[] = $row;
}
$build = array();
$build['table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
);
return $build;
// Ensure the provider types are translatable. These do not need to run,
// just inform the static code parser of these source strings.
t('module');
t('theme');
}