function views_handler::case_transform

cis7 handlers.inc views_handler::case_transform($string, $option)
cle7 handlers.inc views_handler::case_transform($string, $option)
elmsmedia7 handlers.inc views_handler::case_transform($string, $option)
icor7 handlers.inc views_handler::case_transform($string, $option)
meedjum_blog7 handlers.inc views_handler::case_transform($string, $option)
mooc7 handlers.inc views_handler::case_transform($string, $option)

Transform a string by a certain method.

Parameters

$string: The input you want to transform.

$option: How do you want to transform it, possible values:

  • upper: Uppercase the string.
  • lower: lowercase the string.
  • ucfirst: Make the first char uppercase.
  • ucwords: Make each word in the string uppercase.

Return value

string The transformed string.

5 calls to views_handler::case_transform()
views_handler_argument_field_list_string::summary_name in sites/all/modules/ulmus/views/modules/field/views_handler_argument_field_list_string.inc
Provides the name to use for the summary. By default this is just the name field.
views_handler_argument_string::summary_argument in sites/all/modules/ulmus/views/handlers/views_handler_argument_string.inc
Provide the argument to use to link from the summary to the next level; this will be called once per row of a summary, and used as part of $view->get_url().
views_handler_argument_string::summary_name in sites/all/modules/ulmus/views/handlers/views_handler_argument_string.inc
Provides the name to use for the summary. By default this is just the name field.
views_handler_argument_string::title in sites/all/modules/ulmus/views/handlers/views_handler_argument_string.inc
Get the title this argument will assign the view, given the argument.
views_handler_field::render_as_link in sites/all/modules/ulmus/views/handlers/views_handler_field.inc
Render this field as a link, with the info from a fieldset set by the user.

File

sites/all/modules/ulmus/views/includes/handlers.inc, line 355
Defines the various handler objects to help build and display views.

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function case_transform($string, $option) {
  global $multibyte;

  switch ($option) {
    default:
      return $string;
    case 'upper':
      return drupal_strtoupper($string);
    case 'lower':
      return drupal_strtolower($string);
    case 'ucfirst':
      return drupal_strtoupper(drupal_substr($string, 0, 1)) . drupal_substr($string, 1);
    case 'ucwords':
      if ($multibyte == UNICODE_MULTIBYTE) {
        return mb_convert_case($string, MB_CASE_TITLE);
      }
      else {
        return ucwords($string);
      }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.