function variable_realm_admin_realm_overview in Variable 7
Lists available realms.
1 string reference to 'variable_realm_admin_realm_overview'
- variable_realm_admin_menu in variable_realm_admin/
variable_realm_admin.module - Implements hook_menu().
File
- variable_realm_admin/
variable_realm_admin.pages.inc, line 10 - Realm Admin - Pages and forms.
Code
function variable_realm_admin_realm_overview($form, $form_state) {
$header = array(
t('Realm name'),
t('Weight'),
t('Options'),
);
$realms = array();
foreach (variable_realm_info() as $realm => $info) {
$options = array();
// Add list of configured variables + configuration link
if (!empty($info['select'])) {
$options[] = l(t('Configure'), 'admin/config/system/variable/realm/' . $realm . '/configure');
$options[] = l(t('Edit'), 'admin/config/system/variable/realm/' . $realm . '/edit');
}
// Get weight from realm controller.
$controller = variable_realm_controller($realm);
$realms[] = array(
l($info['title'], 'admin/config/system/variable/realm/' . $realm),
$controller['weight'],
implode(' | ', $options),
);
}
$form['realms'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $realms,
'#empty' => t('No realms available.'),
);
return $form;
}