function onlyone_menu in Allow a content type only once (Only One) 7
Implements hook_menu().
File
- ./
onlyone.module, line 72 - Allows to define if a content type must have more than one node in the site.
Code
function onlyone_menu() {
$items['admin/config/content/onlyone'] = array(
'title' => 'Only One',
'description' => 'Configure the content types to allow for Only One node per language.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'config_content_types',
),
'access arguments' => array(
'administer onlyone',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'onlyone.admin.inc',
);
$items['admin/config/content/onlyone/default'] = array(
'title' => 'Only One',
'description' => 'Configure the content types to allow for Only One node per language.',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 2,
);
$items['admin/config/content/onlyone/settings'] = array(
'title' => 'Settings',
'description' => 'Only One Settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'onlyone_admin_settings',
),
'access arguments' => array(
'administer onlyone',
),
'type' => MENU_LOCAL_TASK,
'file' => 'onlyone.admin.inc',
'weight' => 2,
);
if (variable_get('onlyone_new_menu_entry')) {
$items['onlyone/add'] = array(
'title' => 'Add content (Only One)',
'page callback' => 'onlyone_add_page',
'access callback' => '_node_add_access',
'file' => 'onlyone.pages.inc',
'menu_name' => 'management',
'type' => MENU_NORMAL_ITEM,
'weight' => -1,
);
}
return $items;
}