Lines Matching refs:src

28      * @param $src
32 public function checkPage($src, $dst) {
34 if(!page_exists($src)) {
35 msg(sprintf($this->getLang('notexist'), $src), -1);
38 if(auth_quickaclcheck($src) < AUTH_EDIT) {
39 msg(sprintf($this->getLang('norights'), $src), -1);
47 if(checklock($src) !== false || @file_exists(wikiLockFN($src))) {
48 msg(sprintf($this->getLang('filelocked'), $src), -1);
53 if($src == $dst) {
54 msg(sprintf($this->getLang('notchanged'), $src), -1);
60 msg(sprintf($this->getLang('exists'), $src, $dst), -1);
76 * @param $src
80 public function checkMedia($src, $dst) {
82 if(!file_exists(mediaFN($src))) {
83 msg(sprintf($this->getLang('medianotexist'), $src), -1);
86 if(auth_quickaclcheck($src) < AUTH_DELETE) {
87 msg(sprintf($this->getLang('nomediarights'), $src), -1);
92 if($src == $dst) {
93 msg(sprintf($this->getLang('medianotchanged'), $src), -1);
99 msg(sprintf($this->getLang('mediaexists'), $src, $dst), -1);
110 if (pathinfo(mediaFN($src), PATHINFO_EXTENSION) !== pathinfo(mediaFN($dst), PATHINFO_EXTENSION)) {
121 * @param string $src original ID
125 public function movePage($src, $dst) {
126 if(!$this->checkPage($src, $dst)) return false;
135 $Rewriter->setSelfMoveMeta($src);
138 $affected_pages = idx_get_indexer()->lookupKey('relation_references', $src);
142 $src_ns = getNS($src);
143 $src_name = noNS($src);
157 'src_id' => $src,
166 lock($src);
173 if(($idx_msg = $Indexer->renamePage($src, $dst)) !== true
174 || ($idx_msg = $Indexer->renameMetaValue('relation_references', $src, $dst)) !== true
180 msg(sprintf($this->getLang('metamoveerror'), $src), -1);
192 $summary = $this->symbol . ' ' . sprintf($this->getLang($lang_key), $src, $dst);
195 $oldRev = filemtime(wikiFN($src));
199 $text = rawWiki($src);
204 saveWikiText($src, '', $summary);
210 msg(sprintf($this->getLang('atticmoveerror'), $src ), -1);
215 $Rewriter->setMoveMeta($id, $src, $dst, 'pages');
218 unlock($src);
234 * @param string $src original ID
238 public function moveMedia($src, $dst) {
239 if(!$this->checkMedia($src, $dst)) return false;
242 $affected_pages = idx_get_indexer()->lookupKey('relation_media', $src);
244 $src_ns = getNS($src);
245 $src_name = noNS($src);
259 'src_id' => $src,
275 if(($idx_msg = $Indexer->renameMetaValue('relation_media', $src, $dst)) !== true) {
280 msg(sprintf($this->getLang('mediametamoveerror'), $src), -1);
288 if(!io_rename(mediaFN($src), mediaFN($dst))) {
289 msg(sprintf($this->getLang('mediamoveerror'), $src), -1);
294 io_sweepNS($src, 'mediadir');
299 msg(sprintf($this->getLang('mediaatticmoveerror'), $src), -1);
304 $Rewriter->setMoveMeta($id, $src, $dst, 'media');