You are here

function uc_product_uc_store_status in Ubercart 7.3

Same name and namespace in other branches
  1. 8.4 uc_product/uc_product.module \uc_product_uc_store_status()

Implements hook_uc_store_status().

Displays the status of the product image handlers.

See also

uc_product_image_defaults()

File

uc_product/uc_product.module, line 1010
The product module for Ubercart.

Code

function uc_product_uc_store_status() {

  // Check for filefields on products.
  if ($field = variable_get('uc_image_product', '')) {
    $instances = field_info_instances('node', 'product');
    $field_check = (bool) count($instances[$field]);
  }
  else {
    $field_check = FALSE;
  }
  if ($field_check) {
    $status = 'ok';
    $description = t('Product image support has been automatically configured by Ubercart.');
  }
  else {
    $status = 'warning';
    $description = t('<a href="!url">Click here</a> to automatically configure the following items for core image support:', array(
      '!url' => url('admin/store/settings/products/defaults'),
    ));
    $items[] = t('The Image file field has not been created for products.');
    $description .= theme('item_list', array(
      'items' => $items,
    )) . t('(This action is not required and should not be taken if you do not need images or have implemented your own image support.)');
  }
  return array(
    array(
      'status' => $status,
      'title' => t('Images'),
      'desc' => $description,
    ),
  );
}