function social_content_global_overview in Social Content 7.2
Callback for hook_menu.
Build the overview page for all the registered globals.
1 string reference to 'social_content_global_overview'
- social_content_menu in ./
social_content.module - Implements hook_menu().
File
- ./
social_content.admin.inc, line 13 - Social Content administration area. Provides menu callbacks for the Social Content administration area.
Code
function social_content_global_overview() {
$classes = social_content_get_classes();
$header = array(
t('Name'),
t('Instances'),
t('Settings'),
);
$rows = array();
$destination = drupal_get_destination();
foreach ($classes as $class) {
$class = new $class();
$machine_name = $class
->getMachineName();
$instances_link = l(t('Instances'), 'admin/config/services/social-content/global/' . $machine_name . '/instances');
$edit_link = l(t('Edit template'), 'admin/config/services/social-content/global/' . $machine_name . '/edit', array(
'query' => $destination,
));
$rows[] = array(
$class
->getLabel(),
$instances_link,
$edit_link,
);
}
$build['node_table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => t('No Social Content submodules are enabled. You must enable at least one.'),
);
return $build;
}