You are here

function uc_roles_store_status in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_roles/uc_roles.module \uc_roles_store_status()

Implementation of hook_store_status().

File

uc_roles/uc_roles.module, line 376
Grants roles upon accepted payment of products

Code

function uc_roles_store_status() {
  $message = array();
  $role_choices = _get_role_choices();
  if (empty($role_choices)) {
    $message[] = array(
      'status' => 'warning',
      'title' => t('Roles'),
      'desc' => t('There are no product role(s) that can be assigned upon product purchase. Set product roles in the <a href="!url">product feature settings</a> under the role assignment settings fieldset.', array(
        '!url' => url('admin/store/settings/products/edit/features'),
      )),
    );
  }
  else {
    $message[] = array(
      'status' => 'ok',
      'title' => t('Roles'),
      'desc' => t('The role(s) %roles are set to be used with the Role Assignment product feature.', array(
        '%roles' => implode(', ', $role_choices),
      )),
    );
  }
  return $message;
}