You are here

entity_share_server.module in Entity Share 7

Entity Share Server .module file.

File

modules/entity_share_server/entity_share_server.module
View source
<?php

/**
 * @file
 * Entity Share Server .module file.
 */

/**
 * Implements hook_menu().
 */
function entity_share_server_menu() {
  $items = array();

  // Usage example: /entity_share/rest_api/node.
  $items['entity_share/rest_api'] = array(
    'title' => 'Entity Share Rest API',
    'description' => 'Entity share REST API',
    'page callback' => '_entity_share_server_proxy_router',
    // We must be able to reach the server in anonymous for login.
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

/**
 * Implements hook_permission().
 */
function entity_share_server_permission() {
  return array(
    'access entityshare server' => array(
      'title' => t('Access EntityShare Server'),
      'description' => t('Allows a user to send data to the EntityShare server.'),
    ),
  );
}

/**
 * Route callback to start the entity share server.
 */
function _entity_share_server_proxy_router() {
  $rest_server = new EntityShareServerRest();
  $rest_server
    ->handle();
}

Functions

Namesort descending Description
entity_share_server_menu Implements hook_menu().
entity_share_server_permission Implements hook_permission().
_entity_share_server_proxy_router Route callback to start the entity share server.