function key_configs_list in Key 7.2
Same name and namespace in other branches
- 7.3 includes/key.admin.inc \key_configs_list()
Menu callback; displays the list of key configurations.
1 string reference to 'key_configs_list'
- key_menu in ./
key.module - Implements hook_menu().
File
- includes/
key.admin.inc, line 11 - Administrative functionality for managing key configurations.
Code
function key_configs_list() {
$configs = key_get_configs();
$header = array(
t('Name'),
t('Provider'),
array(
'data' => t('Operations'),
'colspan' => '2',
),
);
$rows = array();
foreach ($configs as $name => $config) {
$label = $config['label'];
$name = $config['name'];
$description = $config['description'];
$provider = key_get_provider($config['provider']);
$config_url_string = str_replace('_', '-', $name);
$variables = array(
'label' => $label,
'name' => $name,
'description' => $description,
);
// Set the name column.
$row = array(
theme('key_configs_list_description', $variables),
);
// Set the key provider column.
$row[] = array(
'data' => $provider['title'],
);
// Set the edit column.
$row[] = array(
'data' => l(t('edit'), KEY_MENU_PATH . '/manage/' . $config_url_string),
);
// Set the delete column.
$row[] = array(
'data' => l(t('delete'), KEY_MENU_PATH . '/manage/' . $config_url_string . '/delete'),
);
$rows[] = $row;
}
$build['key_configs_list_table'] = array(
'#theme' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => t('No keys are available. <a href="@link">Add a key</a>.', array(
'@link' => url(KEY_MENU_PATH . '/add'),
)),
);
return $build;
}