Projet

Général

Profil

Révision e7101f36

Ajouté par Julien Enselme il y a environ 9 ans

Update uuid 1.0-alpha5 1.0-alpha6

Voir les différences:

drupal7/sites/all/modules/uuid/uuid_services/uuid_services.module
1 1
<?php
2 2

  
3
/**
4
 * Implementation of hook_menu().
5
 */
6
function uuid_services_menu() {
7
  $items['admin/config/services/uuid-services'] = array(
8
    'title' => 'UUID Services',
9
    'description' => 'Configure settings for Module Filter.',
10
    'access arguments' => array('administer services'),
11
    'page callback' => 'drupal_get_form',
12
    'page arguments' => array('uuid_services_settings'),
13
    'file' => 'uuid_services.admin.inc'
14
  );
15
  return $items;
16
}
17

  
3 18
/**
4 19
 * Implements hook_services_resources_alter().
5 20
 *
......
14 29
 */
15 30
function uuid_services_services_resources_alter(&$resources, &$endpoint) {
16 31
  foreach (entity_get_info() as $entity_type => $entity_info) {
17
    if (isset($entity_info['uuid']) && $entity_info['uuid'] == TRUE && isset($resources[$entity_type])) {
32
    if (isset($entity_info['uuid']) && $entity_info['uuid'] == TRUE && (isset($resources[$entity_type]) || variable_get('uuid_services_support_all_entity_types', FALSE))) {
18 33
      unset($resources[$entity_type]['operations']['create']);
19 34

  
20 35
      // Alter 'retrieve' method to use UUID enabled functions and arguments.
......
126 141
    else {
127 142
      $entity = (object) $entity;
128 143
    }
144
    $entity->uuid_services = TRUE;
129 145
    entity_uuid_save($entity_type, $entity);
130 146
    return $entity;
131 147
  }

Formats disponibles : Unified diff