You are here

function _drupalgap_resource_system_connect in DrupalGap 6

Same name and namespace in other branches
  1. 7.2 drupalgap.resource.inc \_drupalgap_resource_system_connect()
  2. 7 drupalgap.resource.inc \_drupalgap_resource_system_connect()

Performs service calls to various resources and bundles them all up so the mobile device gets results, settings and permissions in one request.

Parameters

$created: Integer The time at which the last system connect call took place. This is used to determine what, if any, content/comments/etc have been updated since the last call took place from the mobile app.

Return value

array Array of service resources, settings and permissions.

3 calls to _drupalgap_resource_system_connect()
_drupalgap_resource_user_login in ./drupalgap.resource.inc
Performs a user login service resource call and bundles up the drupalgap system connect resource results as well.
_drupalgap_resource_user_logout in ./drupalgap.resource.inc
Performs a user logout service resource call and bundles up the drupalgap system connect resource results as well.
_drupalgap_resource_user_register in ./drupalgap.resource.inc
Performs a user registration service resource call and bundles up the drupalgap system connect resource results as well.
1 string reference to '_drupalgap_resource_system_connect'
drupalgap_services_resources in ./drupalgap.services.inc
Defines function signatures for resources available to services.

File

./drupalgap.resource.inc, line 356
This file implements the DrupalGap service resource call back functions.

Code

function _drupalgap_resource_system_connect($created = null) {
  global $user;
  $results = array();

  // Make a call to the system connect resource.
  module_load_include('inc', 'services', 'resources/system_resource');
  $results['system_connect'] = _system_resource_connect();

  // Make calls to various DrupalGap resources.
  $results['site_settings'] = _drupalgap_resource_system_site_settings();
  $results['user_permissions'] = _drupalgap_resource_user_permissions(array(
    'uid' => $user->uid,
  ));
  $results['content_types_list'] = _drupalgap_resource_content_types_list();
  $results['content_types_user_permissions'] = _drupalgap_resource_content_types_user_permissions();

  // Add the time at which this call occurred to the result.
  $results['created'] = "" . time();

  // Add the last time at which this call occurred, if ever, to the result.
  if ($created != null) {

    //$results['last_created'] = date("Y-m-d h:i:s", $created);
    $results['last_created'] = $created;
  }
  return $results;
}