| Conditions | 4 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public static function resolveLink($inner, $curId) { |
||
| 40 | $params = ''; |
||
| 41 | $parts = explode('?', $inner, 2); |
||
| 42 | $resolvedPageId = $parts[0]; |
||
| 43 | if (count($parts) === 2) { |
||
| 44 | $params = $parts[1]; |
||
| 45 | } |
||
| 46 | $ns = getNS($curId); |
||
|
1 ignored issue
–
show
|
|||
| 47 | $xhtml_renderer = p_get_renderer('xhtml'); |
||
|
1 ignored issue
–
show
|
|||
| 48 | $default = $xhtml_renderer->_simpleTitle($parts[0]); |
||
| 49 | resolve_pageid($ns, $resolvedPageId, $exists); |
||
|
1 ignored issue
–
show
|
|||
| 50 | |||
| 51 | if (useHeading('content')) { |
||
|
1 ignored issue
–
show
|
|||
| 52 | $heading = p_get_first_heading($resolvedPageId); |
||
|
1 ignored issue
–
show
|
|||
| 53 | } |
||
| 54 | if (empty($heading)) { |
||
| 55 | $heading = $default; |
||
| 56 | } |
||
| 57 | |||
| 58 | $url = wl($resolvedPageId, $params); |
||
|
1 ignored issue
–
show
|
|||
| 59 | |||
| 60 | return [ |
||
| 61 | 'id' => $resolvedPageId, |
||
| 62 | 'exists' => $exists, |
||
| 63 | 'heading' => $heading, |
||
| 64 | 'url' => $url, |
||
| 65 | ]; |
||
| 82 |