You are here

function uc_addresses_install in Ubercart Addresses 6.2

Same name and namespace in other branches
  1. 5.2 uc_addresses.install \uc_addresses_install()
  2. 5 uc_addresses.install \uc_addresses_install()
  3. 6 uc_addresses.install \uc_addresses_install()
  4. 7 uc_addresses.install \uc_addresses_install()

Implementation of hook_install().

Return value

void

File

./uc_addresses.install, line 143
Install file for Ubercart Addresses.

Code

function uc_addresses_install() {
  drupal_install_schema('uc_addresses');
  $t = get_t();

  // Setup default permissions.
  // If the module 'permissions_api' is enabled, the authencated user will
  // automatically be granted with the permissions 'view own addresses' and
  // 'add/edit own addresses'.
  if (module_exists('permissions_api')) {
    permissions_grant_permissions('authenticated user', array(
      'view own addresses',
      'add/edit own addresses',
      'delete own addresses',
    ));
    drupal_set_message($t("Ubercart Addresses is installed. Since you had the module 'Permissions API' enabled, the authenticated user automatically was granted the permissions %view_own, %edit_own and %delete_own.", array(
      '%view_own' => $t('view own addresses'),
      '%edit_own' => $t('add/edit own addresses'),
      '%delete_own' => $t('delete own addresses'),
    )), 'status');
  }
  else {
    drupal_set_message($t("Ubercart Addresses is installed. Now set up !permissions_link so users will be able to view, edit and delete addresses.", array(
      '!permissions_link' => l($t('permissions'), 'admin/user/permissions', array(
        'fragment' => 'module-uc_addresses',
      )),
    )), 'warning');
  }
}