You are here

function apps_apps in Apps 7

Retrieve apps from the server manifest.

Parameters

string $server: A server object return from apps_servers

arrray $condition: An array of key/values to filter the apps

bool $add_theme: If TRUE apps_apps_add_theme will be called when done getting apps

Return value

array An array of app info arrays

14 calls to apps_apps()
apps_apps_all in ./apps.manifest.inc
Retrieve apps from all servers.
apps_app_find_conflicts in ./apps.module
Find the apps that this app is in conflict with.
apps_app_load in ./apps.module
Path object loader for an App.
apps_catalog_page in ./apps.pages.inc
Callpage for apps catelog page, an .md formatted app listing.
apps_install_page in ./apps.pages.inc
Callback list off all apps

... See full list

File

./apps.manifest.inc, line 120
Handles pulling and processing of app data from the server

Code

function apps_apps($server, $condition = array(), $add_theme = FALSE) {
  if (!is_array($server)) {
    $server = apps_servers($server);
  }
  $manifest = apps_manifest($server);
  if (isset($manifest['error'])) {
    $e = new Exception($manifest['error']);
    $e->request = $manifest['request'];
    throw $e;
  }
  $apps = $manifest['apps'];
  foreach ($apps as $id => $app) {
    $intersect = array_intersect_assoc($app, $condition);
    if ($intersect !== $condition) {
      unset($apps[$id]);
    }
  }
  if (!empty($apps) && $add_theme) {
    apps_apps_add_theme($apps);
  }
  return $apps;
}