You are here

function restful_token_auth_menu_alter in RESTful 7

Implements hook_menu_alter().

File

modules/restful_token_auth/restful_token_auth.module, line 28
RESTful token authentication.

Code

function restful_token_auth_menu_alter(&$items) {
  $access_token_plugins = array();
  foreach (restful_get_restful_plugins() as $plugin) {
    if ($plugin['entity_type'] == 'restful_token_auth') {
      $access_token_plugins[] = $plugin;
    }
  }
  if (empty($access_token_plugins)) {
    return;
  }
  foreach ($access_token_plugins as $access_token_plugin) {
    if (!empty($items[$access_token_plugin['menu_item']])) {
      $items[$access_token_plugin['menu_item']]['delivery callback'] = 'restful_unprepared_delivery';
    }
  }
}