You are here

function _hosting_get_enabled_platforms in Hosting 7.3

Same name and namespace in other branches
  1. 6.2 platform/hosting_platform.module \_hosting_get_enabled_platforms()
  2. 7.4 platform/hosting_platform.module \_hosting_get_enabled_platforms()

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

Deprecated

_hosting_get_platforms() now has an $enabled_only parameter.

2 calls to _hosting_get_enabled_platforms()
hosting_migrate_platform in migrate/hosting_migrate.batch.inc
Batch migration of sites between platforms.
hosting_platform_hosting_summary in platform/hosting_platform.module
Implements hook_hosting_summary().

File

platform/hosting_platform.module, line 294
Platform node type definition.

Code

function _hosting_get_enabled_platforms() {
  $return = array();
  $result = db_query("SELECT n.nid, n.title\n                      FROM {node} n\n                      LEFT JOIN {hosting_platform} h\n                      ON n.nid = h.nid\n                      WHERE n.type = :n.type\n                      AND n.status = :n.status\n                      AND h.status <> :h.status\n                      ORDER BY n.title\n                     ", array(
    ':n.type' => 'platform',
    ':n.status' => 1,
    //@todo: remove magic number?
    ':h.status' => HOSTING_PLATFORM_LOCKED,
  ));
  while ($platform = $result
    ->fetch()) {
    $return[$platform->nid] = $platform->title;
  }
  return $return;
}