You are here

function libraries_admin_instructions_undetected in Libraries API 7.2

Returns instructions for dealing with an undetected library.

Parameters

array $library: A library information array.

Return value

array A renderable array containing the instructions.

1 call to libraries_admin_instructions_undetected()
libraries_admin_library_status_form in ./libraries.admin.inc
Form generation callback for the status overview for a single library.

File

./libraries.admin.inc, line 307
Provides administrative page and form callbacks for Libraries module.

Code

function libraries_admin_instructions_undetected($library) {
  $build = array();

  // Re-check location.
  // @todo Avoid usage of <br> elements.
  $build['instruction']['#markup'] = t('Check that the whole library is located at %library-path.', array(
    '%library-path' => $library['library path'],
  )) . '<br>';

  // If the library has variant-independent files, give the user the
  // exact location of the files to check against.
  // @todo It should be possible to display even variant-specific files
  //   in case the variant is installed, but libraries_detect() does not
  //   detect variants if the library version cannot be detected.
  if ($directory_layout = libraries_admin_directory_layout($library)) {
    $build['directory_layout'] = $directory_layout;
    $build['directory_layout']['#prefix'] = t('The following files and directories should be contained in that directory:');
  }

  // If the library is placed correctly the library information is
  // incorrect.
  // This switch could be avoided by using $library['info type'], but that would
  // hinder properly translating these strings.
  $build['reload']['#markup'] = t('If you have moved any files, <a href="">reload</a> the page. If successful, you should see status information about this library.') . '<br>';
  $build['notice']['#markup'] = t('If the files are placed correctly and the version can still not be detected, the library information is incorrect.') . '<br>';
  $provider = libraries_admin_get_provider($library);
  switch ($library['info type']) {
    case 'module':
      $build['contact']['#markup'] = t('Contact the maintainer of the %module module to correct this.', array(
        '%module' => $provider,
      )) . '<br>';
      break;
    case 'theme':
      $build['contact']['#markup'] = t('Contact the maintainer of the %theme theme to correct this.', array(
        '%theme' => $provider,
      )) . '<br>';
      break;
    case 'info file':
      $build['contact']['#markup'] = t('Contact the maintainer of the %info-file info file to correct this.', array(
        '%info-file' => $provider,
      )) . '<br>';
      break;
  }
  return $build;
}