You are here

function shorten_cs_shorten_service in Shorten URLs 6

Same name and namespace in other branches
  1. 8.2 modules/shorten_cs/shorten_cs.module \shorten_cs_shorten_service()
  2. 8 modules/shorten_cs/shorten_cs.module \shorten_cs_shorten_service()
  3. 7.2 shorten_cs.module \shorten_cs_shorten_service()
  4. 7 shorten_cs.module \shorten_cs_shorten_service()

Implementation of hook_shorten_service().

File

./shorten_cs.module, line 43
Allows users to specify custom services for the Shorten URLs module.

Code

function shorten_cs_shorten_service() {
  $result = db_query("SELECT * FROM {shorten_cs}");
  $services = array();
  while ($service = db_fetch_object($result)) {
    $services[$service->name] = array(
      'custom' => $service->type == 'text' ? FALSE : $service->type,
      'url' => $service->url,
    );
    if ($service->type == 'xml') {
      $services[$service->name]['tag'] = $service->tag;
    }
    elseif ($service->type == 'json') {
      $services[$service->name]['json'] = $service->tag;
    }
  }
  return $services;
}