| @@ 1378-1404 (lines=27) @@ | ||
| 1375 | $str = trim($str, '()"\''); |
|
| 1376 | $docid = $this->getIdFromAlias($str); |
|
| 1377 | break; |
|
| 1378 | case 'prev': |
|
| 1379 | if (!$option) { |
|
| 1380 | $option = 'menuindex,ASC'; |
|
| 1381 | } elseif (strpos($option, ',') === false) { |
|
| 1382 | $option .= ',ASC'; |
|
| 1383 | } |
|
| 1384 | list($by, $dir) = explode(',', $option, 2); |
|
| 1385 | $children = $this->getActiveChildren($parent, $by, $dir); |
|
| 1386 | $find = false; |
|
| 1387 | $prev = false; |
|
| 1388 | foreach ($children as $row) { |
|
| 1389 | if ($row['id'] == $this->documentIdentifier) { |
|
| 1390 | $find = true; |
|
| 1391 | break; |
|
| 1392 | } |
|
| 1393 | $prev = $row; |
|
| 1394 | } |
|
| 1395 | if ($find) { |
|
| 1396 | if (isset($prev[$key])) { |
|
| 1397 | return $prev[$key]; |
|
| 1398 | } else { |
|
| 1399 | $docid = $prev['id']; |
|
| 1400 | } |
|
| 1401 | } else { |
|
| 1402 | $docid = ''; |
|
| 1403 | } |
|
| 1404 | break; |
|
| 1405 | case 'next': |
|
| 1406 | if (!$option) { |
|
| 1407 | $option = 'menuindex,ASC'; |
|
| @@ 1405-1433 (lines=29) @@ | ||
| 1402 | $docid = ''; |
|
| 1403 | } |
|
| 1404 | break; |
|
| 1405 | case 'next': |
|
| 1406 | if (!$option) { |
|
| 1407 | $option = 'menuindex,ASC'; |
|
| 1408 | } elseif (strpos($option, ',') === false) { |
|
| 1409 | $option .= ',ASC'; |
|
| 1410 | } |
|
| 1411 | list($by, $dir) = explode(',', $option, 2); |
|
| 1412 | $children = $this->getActiveChildren($parent, $by, $dir); |
|
| 1413 | $find = false; |
|
| 1414 | $next = false; |
|
| 1415 | foreach ($children as $row) { |
|
| 1416 | if ($find) { |
|
| 1417 | $next = $row; |
|
| 1418 | break; |
|
| 1419 | } |
|
| 1420 | if ($row['id'] == $this->documentIdentifier) { |
|
| 1421 | $find = true; |
|
| 1422 | } |
|
| 1423 | } |
|
| 1424 | if ($find) { |
|
| 1425 | if (isset($next[$key])) { |
|
| 1426 | return $next[$key]; |
|
| 1427 | } else { |
|
| 1428 | $docid = $next['id']; |
|
| 1429 | } |
|
| 1430 | } else { |
|
| 1431 | $docid = ''; |
|
| 1432 | } |
|
| 1433 | break; |
|
| 1434 | default: |
|
| 1435 | $docid = $str; |
|
| 1436 | } |
|