You are here

function libraries_admin_get_provider_with_type in Libraries API 7.2

Returns the library's provider and provider type.

The provider type is either 'module', 'theme', or 'info file'.

Parameters

array $library: A library information array.

Return value

string The provider and provider type.

2 calls to libraries_admin_get_provider_with_type()
libraries_admin_overview in ./libraries.admin.inc
Form generation callback for the libraries overview table.
libraries_admin_status_table in ./libraries.admin.inc
Displays a table of status information about a library.

File

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

Code

function libraries_admin_get_provider_with_type($library) {
  $provider = libraries_admin_get_provider($library);
  $provider_with_type = '';

  // This switch could be avoided by using $library['info type'], but that would
  // hinder properly translating these strings.
  switch ($library['info type']) {
    case 'module':
      $provider_with_type = t('%module module', array(
        '%module' => $provider,
      ));
      break;
    case 'theme':
      $provider_with_type = t('%theme theme', array(
        '%theme' => $provider,
      ));
      break;
    case 'info file':
      $provider_with_type = t('%info-file info file', array(
        '%info-file' => $provider,
      ));
      break;
  }
  return $provider_with_type;
}