View source
<?php
define('KEY_MENU_PATH', 'admin/config/system/keys');
function key_ui_menu() {
$items = array();
$items[KEY_MENU_PATH] = array(
'title' => 'Keys',
'description' => 'Manage keys.',
'page callback' => 'key_ui_key_configs_list',
'access arguments' => array(
'administer keys',
),
'file' => 'includes/key_ui.admin.inc',
'type' => MENU_NORMAL_ITEM,
);
$items[KEY_MENU_PATH . '/list'] = array(
'title' => 'List keys',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[KEY_MENU_PATH . '/add'] = array(
'title' => 'Add key',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'key_ui_key_config_form',
),
'access arguments' => array(
'administer keys',
),
'file' => 'includes/key_ui.admin.inc',
'type' => MENU_LOCAL_ACTION,
);
$items[KEY_MENU_PATH . '/edit/%key_ui_config'] = array(
'title' => 'Edit key',
'title callback' => 'key_ui_config_edit_title',
'title arguments' => array(
5,
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'key_ui_key_config_form',
5,
),
'access arguments' => array(
'administer keys',
),
'file' => 'includes/key_ui.admin.inc',
);
$items[KEY_MENU_PATH . '/delete/%key_ui_config'] = array(
'title' => 'Delete key',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'key_ui_key_config_delete_confirm',
5,
),
'access arguments' => array(
'administer keys',
),
'file' => 'includes/key_ui.admin.inc',
);
$items[KEY_MENU_PATH . '/integration'] = array(
'title' => 'Integration',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'key_ui_key_integration_form',
),
'access arguments' => array(
'administer keys',
),
'file' => 'includes/key_ui.admin.inc',
'type' => MENU_LOCAL_TASK,
);
return $items;
}
function key_ui_theme() {
return array(
'key_ui_key_configs_list_description' => array(
'variables' => array(
'label' => NULL,
'name' => NULL,
'description' => NULL,
),
'file' => 'includes/key_ui.admin.inc',
),
'key_ui_key_integrations_fieldset' => array(
'render element' => 'form',
'file' => 'includes/key_ui.admin.inc',
),
);
}
function key_ui_key_config_edit_title($config_name) {
return $config['label'];
}
function key_ui_config_load($name) {
return key_get_config(strtr($name, array(
'-' => '_',
)));
}