You are here

function onlyone_drush_command in Allow a content type only once (Only One) 8

Same name and namespace in other branches
  1. 7 onlyone.drush.inc \onlyone_drush_command()

Implements hook_drush_command().

File

./onlyone.drush.inc, line 14
Drush commands related to the Only One module.

Code

function onlyone_drush_command() {
  $items['onlyone-list'] = [
    'description' => dt("Shows a content types list according to the selected status."),
    'aliases' => [
      'ol',
    ],
    'arguments' => [
      'status' => dt('Content type status (configured, available, notavailable or summary)'),
    ],
    'examples' => [
      'drush onlyone-list configured' => dt("Lists the content types already configured in 'Only One content' mode."),
      'drush onlyone-list available' => dt("Lists the content types which can be configured in 'Only One content' mode."),
      'drush onlyone-list notavailable' => dt("Lists the content types which cannot be configured in 'Only One content' mode."),
      'drush onlyone-list summary' => dt("Lists the summary for all the content types."),
    ],
  ];
  $items['onlyone-enable'] = [
    'description' => dt("Enables the 'Only One content' mode on content types."),
    'arguments' => [
      'content_type' => dt('List of content types machine names.'),
    ],
    'aliases' => [
      'oen',
    ],
    'examples' => [
      'drush onlyone-enable article' => dt("Enables the 'Only One content' mode for 'Article' content type."),
      'drush onlyone-enable article page' => dt("Enables the 'Only One content' mode for 'Article' and 'Basic page' content types."),
    ],
  ];
  $items['onlyone-disable'] = [
    'description' => dt("Disables the 'Only One content' mode on content types."),
    'arguments' => [
      'content_type' => dt('List of content types machine names.'),
    ],
    'aliases' => [
      'odis',
    ],
    'examples' => [
      'drush onlyone-enable article' => dt("Disables the 'Only One content' mode for 'Article' content type."),
      'drush onlyone-enable article page' => dt("Disables the 'Only One content' mode for 'Article' and 'Basic page' content types."),
    ],
  ];
  $items['onlyone-new-menu-entry'] = [
    'description' => dt('Configures if the configured content types will be shown in a new menu entry.'),
    'arguments' => [
      'status' => dt('The status option (on, off).'),
    ],
    'examples' => [
      'onlyone-new-menu-entry' => dt('Shows if configured content types will be shown in a new menu entry or not.'),
      'onlyone-new-menu-entry on' => dt('Create a new menu entry for the configured content types.'),
      'onlyone-new-menu-entry off' => dt('Delete the menu entry for the configured content types.'),
    ],
    'aliases' => [
      'onme',
    ],
  ];
  return $items;
}