| | 317 | function resolve_path_title($object_id, $title) |
|---|
| | 318 | { |
|---|
| | 319 | $result = ''; |
|---|
| | 320 | $nav = new midcom_helper_nav(); |
|---|
| | 321 | |
|---|
| | 322 | $bc_data = $nav->get_breadcrumb_data($object_id); |
|---|
| | 323 | reset($bc_data); |
|---|
| | 324 | |
|---|
| | 325 | // Detect real starting Node |
|---|
| | 326 | if ($skip_levels > 0) |
|---|
| | 327 | { |
|---|
| | 328 | if ($skip_levels >= count($bc_data)) |
|---|
| | 329 | { |
|---|
| | 330 | debug_add('We were asked to skip all (or even more) breadcrumb elements then there were present. Returning an empty breadcrumb line therefore.', MIDCOM_LOG_INFO); |
|---|
| | 331 | debug_pop(); |
|---|
| | 332 | return $title; |
|---|
| | 333 | } |
|---|
| | 334 | for ($i = 0; $i < $skip_levels; $i++) |
|---|
| | 335 | { |
|---|
| | 336 | next($bc_data); |
|---|
| | 337 | } |
|---|
| | 338 | } |
|---|
| | 339 | |
|---|
| | 340 | while(current($bc_data) !== false) |
|---|
| | 341 | { |
|---|
| | 342 | $data = current($bc_data); |
|---|
| | 343 | $data[MIDCOM_NAV_NAME] = htmlspecialchars($data[MIDCOM_NAV_NAME]); |
|---|
| | 344 | |
|---|
| | 345 | // Add the next element sensitive to the fact wether we are at the end or not. |
|---|
| | 346 | if (next($bc_data) === false) |
|---|
| | 347 | { |
|---|
| | 348 | $result .= $data[MIDCOM_NAV_NAME]; |
|---|
| | 349 | } |
|---|
| | 350 | else |
|---|
| | 351 | { |
|---|
| | 352 | $result .= "{$data[MIDCOM_NAV_NAME]} > "; |
|---|
| | 353 | } |
|---|
| | 354 | } |
|---|
| | 355 | |
|---|
| | 356 | if (empty($result)) |
|---|
| | 357 | { |
|---|
| | 358 | return $title; |
|---|
| | 359 | } |
|---|
| | 360 | |
|---|
| | 361 | return $result; |
|---|
| | 362 | } |
|---|
| | 363 | |
|---|