You are here

function clients_flickr_clients_setparams in Web Service Clients 6

Same name and namespace in other branches
  1. 7 backends/clients_flickr/clients_flickr.module \clients_flickr_clients_setparams()

Implementation of hook_clients_setparams

File

backends/clients_flickr/clients_flickr.module, line 330
Flickr plugin for Clients module @author Django Beatty - adub

Code

function clients_flickr_clients_setparams(&$resource, $arg) {
  $connection = clients_connection_load((int) $resource->cid);

  // need to make static?
  if ($connection->type == variable_get('clients_flickr_type', 'Flickr')) {
    foreach ($arg as $key => $value) {
      if ($key == 'argument') {
        $resource->configuration['options']['text'] = str_replace(' ', '+', $value);
      }
      elseif ($key == 'limit') {
        $resource->configuration['options']['per_page'] = $value;
      }
      elseif ($key == 'offset') {
        $resource->configuration['options']['page'] = $value;
      }
      else {
        $resource->configuration['options'][$key] = str_replace(' ', '+', $value);
      }
    }
  }
}