You are here

function commerce_file_license_status_get_title in Commerce File 7

Returns the human readable title of any or all statuses.

Parameters

$name: Optional parameter specifying the name of the status whose title to return.

Return value

Either an array of all status titles keyed by the status_id or a string containing the human readable title for the specified status. If a status is specified that does not exist, this function returns FALSE.

2 calls to commerce_file_license_status_get_title()
commerce_file_handler_field_license_status::render in views/handlers/commerce_file_handler_field_license_status.inc
Render the field.
commerce_file_license_status_options_list in includes/commerce_file.entities.inc
Wraps commerce_file_license_status_get_title() for use by the Entity module.

File

includes/commerce_file.entities.inc, line 554
Handles file licenses and file license logs

Code

function commerce_file_license_status_get_title($name = NULL) {
  $statuses = commerce_file_license_statuses();

  // Return a status title if specified and it exists.
  if (!empty($name)) {
    if (isset($statuses[$name])) {
      return $statuses[$name]['title'];
    }
    else {

      // Return FALSE if it does not exist.
      return FALSE;
    }
  }

  // Otherwise turn the array values into the status title only.
  foreach ($statuses as $key => $value) {
    $statuses[$key] = $value['title'];
  }
  return $statuses;
}