You are here

function apps_preprocess_apps_app_teaser in Apps 7

Implements hook_preprocess_apps_app_teaser().

2 calls to apps_preprocess_apps_app_teaser()
apps_preprocess_apps_app_featured in theme/apps.theme.inc
Implements hook_preprocess_apps_app_featured().
apps_preprocess_apps_app_page in theme/apps.theme.inc
Implements hook_preprocess_apps_app_page().

File

theme/apps.theme.inc, line 72
Provides theme functions for apps module.

Code

function apps_preprocess_apps_app_teaser(&$vars) {
  apps_include('pages');
  $link = apps_app_page_path($vars['app']);
  $vars['name'] = l($vars['app']['name'], $link);
  if (!empty($vars['app']['logo'])) {
    $vars['app']['logo']['style_name'] = 'apps_logo';
    $vars['logo'] = l(theme('image_style', $vars['app']['logo']), $link, array(
      'html' => TRUE,
    ));
  }
  else {
    $vars['logo'] = FALSE;
  }
  $status = $vars['app']['status'];
  $vars['status'] = $status === APPS_ENABLED ? 'enabled' : ($status === APPS_DISABLED ? 'disabled' : ($status === APPS_INCOMPATIBLE ? 'incompatible' : 'available'));

  //add rating information for theming
  $vars['app']['teaser'] = TRUE;
  if (variable_get('apps_allow_voting', FALSE)) {
    $vars['rating'] = theme('apps_voting_widget', $vars['app']);
  }

  //action link
  $vars['config'] = apps_app_access($vars['app'], 'configure') ? l(t('Config'), apps_app_page_path($vars['app'], 'configure')) : '';
  $vars['action'] = l(t('Details'), $link);
  $vars['update'] = apps_app_access($vars['app'], 'update') ? l(t('Update'), apps_app_page_path($vars['app'], 'update')) : '';
  if ($vars['app']['installed_version'] && $vars['app']['version'] != $vars['app']['installed_version']) {
    $vars['classes_array'][] = ' apps-update-needed-teaser';
  }
}