You are here

function readmorecontrol_menu in Read More Control 7

Implements hook_menu().

File

./readmorecontrol.module, line 40
Defines options to control how the Read more link is displayed on teasers.

Code

function readmorecontrol_menu() {
  $items['admin/config/content/read-more-control'] = array(
    'title' => 'Read more settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'readmorecontrol_admin_settings_form',
      'node',
    ),
    'description' => 'Configure the Read more link settings.',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'readmorecontrol.admin.inc',
  );
  $entity_info = entity_get_info();
  foreach ($entity_info as $entity_type => $info) {
    if (readmorecontrol_supported_entity($entity_type, $info)) {
      if ($entity_type == 'node') {
        $items['admin/config/content/read-more-control/' . $entity_type] = array(
          'title' => $info['label'],
          'type' => MENU_DEFAULT_LOCAL_TASK,
          'weight' => -10,
        );
      }
      else {
        $items['admin/config/content/read-more-control/' . $entity_type] = array(
          'title' => $info['label'],
          'page callback' => 'drupal_get_form',
          'page arguments' => array(
            'readmorecontrol_admin_settings_form',
            $entity_type,
          ),
          'description' => 'Configure the Read more link settings.',
          'access arguments' => array(
            'administer site configuration',
          ),
          'file' => 'readmorecontrol.admin.inc',
          'type' => MENU_LOCAL_TASK,
        );
      }
    }
  }
  return $items;
}