function _potx_find_end_of_function in Translation template extractor 6
Same name and namespace in other branches
- 8 potx.inc \_potx_find_end_of_function()
- 5.2 potx.inc \_potx_find_end_of_function()
- 5 potx.inc \_potx_find_end_of_function()
- 6.3 potx.inc \_potx_find_end_of_function()
- 6.2 potx.inc \_potx_find_end_of_function()
- 7.3 potx.inc \_potx_find_end_of_function()
- 7 potx.inc \_potx_find_end_of_function()
- 7.2 potx.inc \_potx_find_end_of_function()
Helper function to look up the token closing the current function.
Parameters
$here: The token at the function name
2 calls to _potx_find_end_of_function()
- _potx_find_language_names in ./
potx.inc - Get languages names from Drupal's locale.inc.
- _potx_find_menu_hook in ./
potx.inc - List of menu item titles. Only for Drupal 6.
File
- ./
potx.inc, line 781 - Extraction API used by the web and command line interface.
Code
function _potx_find_end_of_function($here) {
global $_potx_tokens;
// Seek to open brace.
while (is_array($_potx_tokens[$here]) || $_potx_tokens[$here] != '{') {
$here++;
}
$nesting = 1;
while ($nesting > 0) {
$here++;
if (!is_array($_potx_tokens[$here])) {
if ($_potx_tokens[$here] == '}') {
$nesting--;
}
if ($_potx_tokens[$here] == '{') {
$nesting++;
}
}
}
return $here;
}