You are here

function _drupalgap_resource_system_site_settings in DrupalGap 6

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

Returns a collection of variables from the current Drupal site.

Return value

array Array of variables from the variable table.

1 call to _drupalgap_resource_system_site_settings()
_drupalgap_resource_system_connect in ./drupalgap.resource.inc
Performs service calls to various resources and bundles them all up so the mobile device gets results, settings and permissions in one request.
1 string reference to '_drupalgap_resource_system_site_settings'
drupalgap_services_resources in ./drupalgap.services.inc
Defines function signatures for resources available to services.

File

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

Code

function _drupalgap_resource_system_site_settings() {

  // Grab column names from the variable table.
  $names = array(
    'admin_theme',
    'clean_url',
    'date_default_timezone',
    'site_name',
    'theme_default',
    'user_register',
  );
  $sql = " SELECT * FROM {variable} ";
  $sql .= " WHERE name IN (" . db_placeholders($names, 'text') . ")";
  $settings = new stdClass();
  $result = db_query($sql, $names);
  if ($result) {
    $settings->variable = new stdClass();
    while ($variable = db_fetch_object($result)) {
      $name = $variable->name;
      $value = unserialize($variable->value);
      $settings->variable->{$name} = $value;
    }
  }

  // Add Drupal core verion into settings.
  $settings->variable->drupal_core = "6";
  return $settings;
}