You are here

function _hosting_get_enabled_platforms in Hostmaster (Aegir) 6

Small helper function to get platforms that haven't been deleted or locked.

1 call to _hosting_get_enabled_platforms()
hosting_platform_hosting_summary in modules/hosting/platform/hosting_platform.module
Implementation of hook_hosting_summary().

File

modules/hosting/platform/hosting_platform.module, line 138
Platform node type definition.

Code

function _hosting_get_enabled_platforms() {
  $return = array();
  $result = db_query("SELECT n.nid, n.title FROM {node} n LEFT JOIN {hosting_platform} h ON n.nid = h.nid \n                      WHERE n.type='platform' AND n.status=1 AND h.status <> %d ORDER BY n.title", HOSTING_PLATFORM_LOCKED);
  while ($server = db_fetch_object($result)) {
    $return[$server->nid] = $server->title;
  }
  return $return;
}