diff --git a/context_ui/context_ui.admin.inc b/context_ui/context_ui.admin.inc
index 0779b711fc8d1532f82e27590e40d7b65c1274a7..4d6ad2e201c62dcef8a8bd54c6b1d47eb574e345 100644
--- a/context_ui/context_ui.admin.inc
+++ b/context_ui/context_ui.admin.inc
@@ -108,7 +108,7 @@ function context_ui_form(&$form_state, $op, $context = NULL) {
'#required' => TRUE,
'#maxlength' => 255,
'#default_value' => isset($context->name) ? $context->name : '',
- '#description' => t('Example: blog_section
') .'
'. t('A system name for this context. May only contain lowercase letters, underscores, and numbers.'),
+ '#description' => t('Example: blog_section
') .'
'. t('A system name for this context. May only contain lowercase letters, dashes, underscores, and numbers.'),
'#element_validate' => ($op === 'edit') ? array() : array('context_ui_form_name_validate'),
);
if ($op === 'edit') {
@@ -344,8 +344,8 @@ function context_ui_export(&$form_state, $context) {
*/
function context_ui_form_name_validate($element, &$form_state) {
// Check for string identifier sanity
- if (!preg_match('!^[a-z0-9_]+$!', $element['#value'])) {
- form_set_error('name', t('The context name can only consist of lowercase letters, underscores, and numbers.'));
+ if (!preg_match('!^[a-z0-9_-]+$!', $element['#value'])) {
+ form_set_error('name', t('The context name can only consist of lowercase letters, dashes, underscores, and numbers.'));
}
// Check for name collision
else if ($exists = context_load($element['#value'])) {
@@ -410,7 +410,7 @@ function context_ui_form_submit($form, &$form_state) {
// Send user to delete confirmation page
case 'edit-delete':
if (isset($form_state['values']['context']->name)) {
- $form_state['redirect'] = "admin/build/context/{$form_state['values']['context']->name}/delete";
+ $form_state['redirect'] = "admin/build/context/list/{$form_state['values']['context']->name}/delete";
}
return;
// Process form values and save and/or update the context in the db
diff --git a/context_ui/context_ui.module b/context_ui/context_ui.module
index efcb0d11544ab9bcd7dc0f0e03c6a8c6c6d4b1f6..296db806e49953b6d319f28401b19a670a76795e 100644
--- a/context_ui/context_ui.module
+++ b/context_ui/context_ui.module
@@ -102,60 +102,60 @@ function context_ui_menu() {
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
- $items['admin/build/context/%context'] = array(
+ $items['admin/build/context/list/%context'] = array(
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_form', 'edit', 3),
+ 'page arguments' => array('context_ui_form', 'edit', 4),
'type' => MENU_CALLBACK,
);
- $items['admin/build/context/%context/edit'] = array(
+ $items['admin/build/context/list/%context/edit'] = array(
'title' => 'Edit',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_form', 'edit', 3),
+ 'page arguments' => array('context_ui_form', 'edit', 4),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -1,
);
- $items['admin/build/context/%context/clone'] = array(
+ $items['admin/build/context/list/%context/clone'] = array(
'title' => 'Clone',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_form', 'clone', 3),
+ 'page arguments' => array('context_ui_form', 'clone', 4),
'type' => MENU_LOCAL_TASK,
);
- $items['admin/build/context/%context/export'] = array(
+ $items['admin/build/context/list/%context/export'] = array(
'title' => 'Export',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_export', 3),
+ 'page arguments' => array('context_ui_export', 4),
'type' => MENU_LOCAL_TASK,
);
- $items['admin/build/context/%context/revert'] = array(
+ $items['admin/build/context/list/%context/revert'] = array(
'title' => 'Revert',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_confirm', 'revert', 3),
+ 'page arguments' => array('context_ui_confirm', 'revert', 4),
'access callback' => 'context_ui_task_access',
- 'access arguments' => array(3, 'revert'),
+ 'access arguments' => array(4, 'revert'),
'type' => MENU_LOCAL_TASK,
);
- $items['admin/build/context/%context/delete'] = array(
+ $items['admin/build/context/list/%context/delete'] = array(
'title' => 'Delete',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_confirm', 'delete', 3),
+ 'page arguments' => array('context_ui_confirm', 'delete', 4),
'access callback' => 'context_ui_task_access',
- 'access arguments' => array(3, 'delete'),
+ 'access arguments' => array(4, 'delete'),
'type' => MENU_LOCAL_TASK,
);
- $items['admin/build/context/%context/disable'] = array(
+ $items['admin/build/context/list/%context/disable'] = array(
'title' => 'Disable',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_confirm', 'disable', 3),
+ 'page arguments' => array('context_ui_confirm', 'disable', 4),
'access callback' => 'context_ui_task_access',
- 'access arguments' => array(3, 'disable'),
+ 'access arguments' => array(4, 'disable'),
'type' => MENU_LOCAL_TASK,
);
- $items['admin/build/context/%context/enable'] = array(
+ $items['admin/build/context/list/%context/enable'] = array(
'title' => 'Enable',
'page callback' => 'drupal_get_form',
- 'page arguments' => array('context_ui_confirm', 'enable', 3),
+ 'page arguments' => array('context_ui_confirm', 'enable', 4),
'access callback' => 'context_ui_task_access',
- 'access arguments' => array(3, 'enable'),
+ 'access arguments' => array(4, 'enable'),
'type' => MENU_LOCAL_TASK,
);
diff --git a/context_ui/theme/theme.inc b/context_ui/theme/theme.inc
index ebfcbc848e558b0e2e3e0692f29ca8c40057bb44..7d1b0e30ee18033bf32e620a1d42e764d5ffddc5 100644
--- a/context_ui/theme/theme.inc
+++ b/context_ui/theme/theme.inc
@@ -89,13 +89,13 @@ function theme_context_ui_admin($form) {
// Context actions
$links = array(
- 'edit' => l(t('Edit'), "admin/build/context/{$context->name}"),
- 'delete' => l(t('Delete'), "admin/build/context/{$context->name}/delete"),
- 'revert' => l(t('Revert'), "admin/build/context/{$context->name}/revert"),
- 'export' => l(t('Export'), "admin/build/context/{$context->name}/export"),
- 'clone' => l(t('Clone'), "admin/build/context/{$context->name}/clone"),
- 'disable' => l(t('Disable'), "admin/build/context/{$context->name}/disable"),
- 'enable' => l(t('Enable'), "admin/build/context/{$context->name}/enable"),
+ 'edit' => l(t('Edit'), "admin/build/context/list/{$context->name}"),
+ 'delete' => l(t('Delete'), "admin/build/context/list/{$context->name}/delete"),
+ 'revert' => l(t('Revert'), "admin/build/context/list/{$context->name}/revert"),
+ 'export' => l(t('Export'), "admin/build/context/list/{$context->name}/export"),
+ 'clone' => l(t('Clone'), "admin/build/context/list/{$context->name}/clone"),
+ 'disable' => l(t('Disable'), "admin/build/context/list/{$context->name}/disable"),
+ 'enable' => l(t('Enable'), "admin/build/context/list/{$context->name}/enable"),
);
foreach (array_keys($links) as $key) {
if (!context_ui_task_access($context, $key)) {