Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 'youAreHere':
- $path = $this->option['page'];
- $nextSeparatorIndex = strpos($path, $prefs['namespace_separator']);
- if ($prefs['namespace_enabled'] == 'n' || $nextSeparatorIndex == false) {
- // namespace disabled or no namespace in title
- $value = $path;
- break;
- } else {
- $value = "";
- $currentPageName = "";
- $currentPageLink = "";
- $pathLen = strlen($path);
- $separatorLen = strlen($prefs['namespace_separator']);
- while($pathLen != 0 && $pathLen != $separatorLen) {
- // Exit condition: path has been parsed or it contains separator only
- if ($nextSeparatorIndex == 0) {
- // Path starts with namespace separator: we move it from path to currentPageLink
- // and we update nextSeparatorIndex
- $path = substr($path, $separatorLen);
- $currentPageLink .= $prefs['namespace_separator'];
- $nextSeparatorIndex = strpos($path, $prefs['namespace_separator']);
- }
- $currentPageName = ($nextSeparatorIndex != false)? substr($path, 0, $nextSeparatorIndex) : $path;
- $currentPageLink .= $currentPageName;
- $path = substr($path, strlen($currentPageName));
- $pathLen = strlen($path);
- $nextSeparatorIndex = strpos($path, $prefs['namespace_separator']);
- if ($path != "") {
- $value .= "((".$currentPageLink."|".$currentPageName.")) > ";
- } else {
- // Last element of the path, after last namespace separator
- $value .= "((".$currentPageLink."|".$currentPageName."))";
- }
- }
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement