You are here

function _tableofcontents_convert_number in Table of Contents 6.3

Same name and namespace in other branches
  1. 7.2 tableofcontents.themes.inc \_tableofcontents_convert_number()
  2. 7 tableofcontents.pages.inc \_tableofcontents_convert_number()

Transform a decimal number in one of:

@li decimal number @li roman number @li letters

@param[in] $mode The type of number to transform into @param[in] $number The number to transform

Return value

The result

1 call to _tableofcontents_convert_number()
theme_tableofcontents_number in ./tableofcontents.pages.inc
Theme the output of a multi-level number.

File

./tableofcontents.pages.inc, line 1178
Applies the filter functions.

Code

function _tableofcontents_convert_number($mode, $number) {
  switch ($mode) {
    default:

      //case 0:
      return $number;
    case 1:
      return _tableofcontents_roman($number);
    case 2:
      return drupal_strtolower(_tableofcontents_roman($number));
    case 3:
      return _tableofcontents_letter($number);
    case 4:
      return drupal_strtolower(_tableofcontents_letter($number));
    case 5:
      return sprintf("0x%02x", $number);
  }
}