function _tableofcontents_convert_number in Table of Contents 7
Same name and namespace in other branches
- 6.3 tableofcontents.pages.inc \_tableofcontents_convert_number()
- 7.2 tableofcontents.themes.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.pages.inc - Theme the output of a multi-level number.
File
- ./
tableofcontents.pages.inc, line 1085 - 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);
}
}