You are here

function brilliant_gallery_requirements in Brilliant Gallery 7.2

Implements hook_requirements().

File

./brilliant_gallery.install, line 169
Install, update and uninstall functions for the brilliant_gallery module.

Code

function brilliant_gallery_requirements($phase) {
  $requirements = array();
  $t = get_t();

  // Verify that the user has defined the root albums folder.
  // If not, display a warning on the status page.
  if ($phase == 'runtime') {
    $rootalbumsdefined = FALSE;

    // It's a weak test but better than none.
    if (variable_get('brilliant_gallery_folder') != '') {
      $rootalbumsdefined = TRUE;
    }
    if (!$rootalbumsdefined) {
      $requirements['brilliant_gallery_authentication']['title'] = $t('Brilliant Gallery requirements');
      $requirements['brilliant_gallery_authentication']['description'] = $t('You can set Brilliant Gallery root gallery folder <a href="/admin/config/brilliant_gallery">here</a>.');
      $requirements['brilliant_gallery_authentication']['severity'] = REQUIREMENT_ERROR;
      $requirements['brilliant_gallery_authentication']['value'] = $t('Brilliant Gallery root gallery folder has NOT been defined yet');
    }
    else {
      $params = array(
        '%brilliant_gallery_folder' => variable_get('brilliant_gallery_folder', 0),
      );
      $requirements['brilliant_gallery_folder'] = array(
        'title' => $t('Brilliant Gallery'),
        'description' => $t('The root gallery folder under files/ has been defined as: %brilliant_gallery_folder. If ever needed, you can change it <a href="/admin/config/brilliant_gallery">here</a>.', $params),
        'severity' => REQUIREMENT_OK,
        'value' => $t('Brilliant Gallery root gallery folder has been defined'),
      );
    }
  }
  return $requirements;
}