Lines Matching refs:opts

48                 $opts['oldpage'] = cleanID($_REQUEST['oldpage']);
49 $opts['newpage'] = cleanID($_REQUEST['newpage']);
50 $opts['summary'] = $_REQUEST['summary'];
51 $opts['rp_nr'] = $_REQUEST['rp_nr'];
52 $opts['confirm'] = $_REQUEST['rp_confirm'];
53 $this->_rename_page($opts);
56 $opts['oldpage'] = cleanID($_REQUEST['oldpage']);
57 $opts['summary'] = $_REQUEST['summary'];
58 $opts['purge'] = $_REQUEST['dp_purge'];
59 $opts['confirm'] = $_REQUEST['dp_confirm'];
60 $this->_delete_page($opts);
130 function _locate_filepairs(&$opts, $dir, $regex ){ argument
132 $oldpath = $conf[$dir].'/'.str_replace(':','/',$opts['oldns']);
133 $newpath = $conf[$dir].'/'.str_replace(':','/',$opts['newns']);
134 if (!$opts['oldfiles']) $opts['oldfiles'] = array();
135 if (!$opts['newfiles']) $opts['newfiles'] = array();
142 $opts['oldfiles'][] = $oldfile;
143 if ($opts['move']) {
144 $newfilebase = str_replace($opts['oldname'], $opts['newname'], $file);
147 …ntf( $this->getLang('rp_msg_file_conflict'), '<a href="'. wl($opts['newpage']) . '">'.$opts['newpa…
150 $opts['newfiles'][] = $newfile;
160 function _apply_moves(&$opts) { argument
161 foreach ($opts['oldfiles'] as $i => $oldfile) {
162 $newfile = $opts['newfiles'][$i];
169 function _apply_deletes(&$opts) { argument
170 foreach ($opts['oldfiles'] as $oldfile) {
189 $opts['oldname'] = $this->_FN(noNS($id));
190 $opts['oldns'] = $this->_FN(getNS($id));
191 if ($opts['oldns']) $opts['oldns'] .= '/';
192 $this->_locate_filepairs( $opts, 'metadir', '/^'.$opts['oldname'].'\.(?!mlist)\w*?$/' );
193 … $this->_locate_filepairs( $opts, 'olddir', '/^'.$opts['oldname'].'\.\d{10}\.txt(\.gz|\.bz2)?$/' );
194 $this->_apply_deletes($opts);
216 function _rename_page(&$opts) { argument
218 if (!$opts['confirm']) {
222 if (!$opts['oldpage']) {
224 } else if (!page_exists($opts['oldpage'])) {
225 $this->errors[] = sprintf( $this->getLang('rp_msg_old_noexist'), $opts['oldpage'] );
226 } else if (!$this->_auth_can_rename($opts['oldpage'])) {
227 $this->errors[] = sprintf( $this->getLang('rp_msg_auth'), $opts['oldpage'] );
228 } else if (checklock($opts['oldpage'])) {
229 $this->errors[] = sprintf( $this->getLang('rp_msg_locked'), $opts['oldpage'] );
232 if ($opts['rp_nr'] && !$this->_auth_can_rename_nr($opts['oldpage']))
235 if (!$opts['newpage']) {
237 } else if (page_exists($opts['newpage'])) {
238 …sprintf( $this->getLang('rp_msg_new_exist'), '<a href="'. wl($opts['newpage']) . '">'.$opts['newpa…
239 } else if (!$this->_auth_can_rename($opts['newpage'])) {
240 $this->errors[] = sprintf( $this->getLang('rp_msg_auth'), $opts['newpage'] );
241 } else if (checklock($opts['newpage'])) {
242 $this->errors[] = sprintf( $this->getLang('rp_msg_locked'), $opts['newpage'] );
246 $opts['move'] = true;
247 $opts['oldname'] = $this->_FN(noNS($opts['oldpage']));
248 $opts['newname'] = $this->_FN(noNS($opts['newpage']));
249 $opts['oldns'] = $this->_FN(getNS($opts['oldpage']));
250 $opts['newns'] = $this->_FN(getNS($opts['newpage']));
251 if ($opts['oldns']) $opts['oldns'] .= '/';
252 if ($opts['newns']) $opts['newns'] .= '/';
253 …$this->_locate_filepairs( $opts, 'metadir', '/^'.$opts['oldname'].'\.(?!mlist|meta|indexed)\w*?$/'…
254 … $this->_locate_filepairs( $opts, 'olddir', '/^'.$opts['oldname'].'\.\d{10}\.txt(\.gz|\.bz2)?$/' );
259 $this->_apply_moves($opts);
261 $text = rawWiki($opts['oldpage']);
262 if ($opts['summary'])
263 …$summary = sprintf( $this->getLang('rp_newsummaryx'), $opts['oldpage'], $opts['newpage'], $opts['s…
265 … $summary = sprintf( $this->getLang('rp_newsummary'), $opts['oldpage'], $opts['newpage'] );
266 saveWikiText($opts['newpage'],$text,$summary);
268 $summary = $opts['summary'] ?
269 …sprintf( $this->getLang('rp_oldsummaryx'), $opts['oldpage'], $opts['newpage'], $opts['summary'] ) :
270 sprintf( $this->getLang('rp_oldsummary'), $opts['oldpage'], $opts['newpage'] );
271 if ($opts['rp_nr']) {
272 $this->_custom_delete_page( $opts['oldpage'], $summary );
274 …addLogEntry( null, $opts['oldpage'], DOKU_CHANGE_TYPE_DELETE, $summary ); // also writes to global…
275 unlink(metaFN($opts['oldpage'],'.changes')); // purge page changes
280 $text = str_replace( '@ID@', $opts['newpage'], $text );
281 @unlink(wikiFN($opts['oldpage'])); // remove old page file so no additional history
282 saveWikiText($opts['oldpage'],$text,$summary);
290 … sprintf( $this->getLang('rp_msg_success'), $opts['oldpage'], '<a href="'. wl($opts['newpage']) . …
294 …$data = array( rp_newpage => $opts['newpage'], rp_summary => $opts['summary'], rp_nr => $opts['rp_…
298 function _delete_page(&$opts) { argument
300 if (!$opts['confirm']) {
304 if (!$opts['oldpage']) {
306 } else if (!$this->_auth_can_delete($opts['oldpage'])) {
307 $this->errors[] = sprintf( $this->getLang('dp_msg_auth'), $opts['oldpage'] );
311 $summary = $opts['summary'] ?
312 sprintf( $this->getLang('dp_oldsummaryx'), $opts['summary'] ) :
314 $this->_custom_delete_page( $opts['oldpage'], $summary );
316 …addLogEntry( null, $opts['oldpage'], DOKU_CHANGE_TYPE_DELETE, $summary ); // also writes to global…
317 if ($opts['purge']) unlink(metaFN($opts['oldpage'],'.changes')); // purge page changes
324 $msg = sprintf( $this->getLang('dp_msg_success'), $opts['oldpage'] );
328 $data = array( dp_purge => $opts['purge'], dp_summary => $opts['summary'] );