Lines Matching defs:id
16 public function resolveId($id, $rev = '', $isDateAt = false)
19 $id = (string) $id;
22 if (strpos($id, '#') !== false) {
23 [$id, $hash] = sexplode('#', $id, 2);
29 if ($id !== '') {
30 $id = parent::resolveId($id, $rev, $isDateAt);
31 $id = $this->resolveStartPage($id, $rev, $isDateAt);
33 $id = $this->resolveAutoPlural($id, $rev, $isDateAt);
36 $id = $this->contextID;
39 $id = cleanID($id); // FIXME always? or support parameter
41 if ($hash !== '') $id .= "#$hash";
42 return $id;
48 * @param string $id
53 protected function resolveStartPage($id, $rev, $isDateAt)
57 if ($id === '' || $id[-1] !== ':') return $id;
59 if (page_exists($id . $conf['start'], $rev, true, $isDateAt)) {
61 return $id . $conf['start'];
62 } elseif (page_exists($id . noNS(cleanID($id)), $rev, true, $isDateAt)) {
64 return $id . noNS(cleanID($id));
65 } elseif (page_exists(substr($id, 0, -1), $rev, true, $isDateAt)) {
67 return substr($id, 0, -1);
71 return $id . $conf['start'];
77 * @param string $id
82 protected function resolveAutoPlural($id, $rev, $isDateAt)
84 if (page_exists($id, $rev, $isDateAt)) return $id;
86 if ($id[-1] === 's') {
87 $try = substr($id, 0, -1);
89 $try = $id . 's';
95 return $id;