You are here

function _tableofcontents_convert_number in Table of Contents 7.2

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

Transform a decimal number in one of:

decimal number Roman number letters

Parameters

$mode The type of number to transform into:

$number The number to transform:

Return value

The result

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

File

./tableofcontents.themes.inc, line 200
Table of Contents - Versatile system for generating Tables of Contents for fields - themes.

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);
  }
}