You are here

function views_handler_argument_string::case_transform in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 handlers/views_handler_argument_string.inc \views_handler_argument_string::case_transform()
3 calls to views_handler_argument_string::case_transform()
views_handler_argument_string::summary_argument in 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 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 handlers/views_handler_argument_string.inc
Get the title this argument will assign the view, given the argument.

File

handlers/views_handler_argument_string.inc, line 233

Class

views_handler_argument_string
Basic argument handler to implement string arguments that may have length limits.

Code

function case_transform($string, $option) {
  global $multibyte;
  switch ($this->options[$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);
      }
  }
}