Lines Matching +full:fetch +full:- +full:depth
19 $this->_profileLoad();
20 $this->profno = preg_replace('/[^0-9]+/','',$_REQUEST['no']);
24 if(!is_null($this->client)) return true;
26 if ( isset($this->profiles[$this->profno]['timeout']) ){
27 $timeout = (int) $this->profiles[$this->profno]['timeout'];
29 $timeout = $this->defaultTimeout;
33 … $this->client = new IXR_Client($this->profiles[$this->profno]['server'], false, 80, $timeout);
36 … $this->client = new dokuwiki\Remote\IXR\Client($this->profiles[$this->profno]['server']);
37 $this->client->timeout = $timeout;
41 if($this->profiles[$this->profno]['user']){
42 $ok = $this->client->query('dokuwiki.login',
43 $this->profiles[$this->profno]['user'],
44 $this->profiles[$this->profno]['pass']
47 msg($this->getLang('xmlerr').' '.hsc($this->client->getErrorMessage()),-1);
48 $this->client = null;
51 if(!$this->client->getResponse()){
52 msg($this->getLang('loginerr'),-1);
53 $this->client = null;
58 $ok = $this->client->query('dokuwiki.getXMLRPCAPIVersion');
60 msg($this->getLang('xmlerr').' '.hsc($this->client->getErrorMessage()),-1);
61 $this->client = null;
64 $this->apiversion = (int) $this->client->getResponse();
65 if($this->apiversion < 1){
66 msg($this->getLang('versionerr'),-1);
67 $this->client = null;
86 if(isset($_REQUEST['sync__delete']) && $this->profno !== ''){
88 unset($this->profiles[$this->profno]);
89 $this->profiles = array_values($this->profiles); //reindex
90 $this->profno = '';
93 if($this->profno === '') $this->profno = count($this->profiles);
95 $_REQUEST['prf']['timeout'] = $this->defaultTimeout;
97 $this->profiles[$this->profno] = $_REQUEST['prf'];
99 $this->_profileSave();
102 $this->client = null;
110 if(($_POST['sync_pages'] || $_POST['sync_media']) && $this->profno!==''){
112 echo $this->locale_xhtml('sync');
116 echo '<script type="text/javascript" charset="utf-8"><!--//--><![CDATA[//><!--'.NL;
118 echo '//--><!]]></script>'.NL;
126 $this->_sync($_POST['sync_pages'],'pages');
129 $this->_sync($_POST['sync_media'],'media');
131 $this->_saveSyncTimes((int) $_POST['lnow'],
137 echo '<script type="text/javascript" charset="utf-8"><!--//--><![CDATA[//><!--'.NL;
139 echo '//--><!]]></script>'.NL;
144 echo '<p>'.$this->getLang('syncdone').'</p>';
145 }elseif($_REQUEST['startsync'] && $this->profno!==''){
147 list($lnow,$rnow) = $this->_getTimes();
151 if($this->profiles[$this->profno]['type'] == 0 ||
152 $this->profiles[$this->profno]['type'] == 1){
153 $pages = $this->_getSyncList('pages');
155 if(($this->profiles[$this->profno]['type'] == 0 ||
156 $this->profiles[$this->profno]['type'] == 2)
158 $media = $this->_getSyncList('media');
167 $this->_directionFormStart($lnow,$rnow);
169 $this->_directionForm('pages',$pages);
171 $this->_directionForm('media',$media);
173 $this->_directionFormEnd();
175 echo $this->locale_xhtml('nochange');
178 echo $this->locale_xhtml('intro');
181 $this->_profilelist($this->profno);
182 if($this->profno !=='' ){
184 $this->_profileView($this->profno);
188 $this->_profileform($this->profno);
200 $this->profiles = unserialize(io_readFile($profiles,false));
210 io_saveFile($profiles,serialize($this->profiles));
217 if(!$this->_connect()) return false;
220 $no = $this->profno;
222 $ok = $this->client->query('dokuwiki.getVersion');
224 if($ok) $version = $this->client->getResponse();
228 echo '<fieldset><legend>'.$this->getLang('syncstart').'</legend>';
230 echo '<p>'.$this->getLang('remotever').' '.hsc($version).'</p>';
231 if($this->profiles[$no]['ltime']){
232 …echo '<p>'.$this->getLang('lastsync').' '.strftime($conf['dformat'],$this->profiles[$no]['ltime'])…
234 echo '<p>'.$this->getLang('neversync').'</p>';
236 …echo '<input name="startsync" type="submit" value="'.$this->getLang('syncstart').'" class="button"…
238 …echo '<p class="error">'.$this->getLang('noconnect').'<br />'.hsc($this->client->getErrorMessage()…
249 echo '<fieldset><legend>'.$this->getLang('profile').'</legend>';
251 echo ' <option value="">'.$this->getLang('newprofile').'</option>';
252 foreach($this->profiles as $pno => $opts){
263 echo '<input type="submit" value="'.$this->getLang('select').'" class="button" />';
275 echo $this->getLang('edit');
277 echo $this->getLang('create');
283 echo '<label for="sync__server">'.$this->getLang('server').'</label> ';
284 …="text" name="prf[server]" id="sync__server" class="edit" value="'.hsc($this->profiles[$no]['serve…
287 echo '<label for="sync__ns">'.$this->getLang('ns').'</label> ';
288 …echo '<input type="text" name="prf[ns]" id="sync__ns" class="edit" value="'.hsc($this->profiles[$n…
290 echo '<label for="sync__depth">'.$this->getLang('depth').'</label> ';
291 echo '<select name="prf[depth]" id="sync__depth" class="edit">';
292 …echo '<option value="0" '.(($this->profiles[$no]['depth']==0)?'selected="selected"':'').'>'.$this-…
293 …echo '<option value="1" '.(($this->profiles[$no]['depth']==1)?'selected="selected"':'').'>'.$this-…
294 …echo '<option value="2" '.(($this->profiles[$no]['depth']==2)?'selected="selected"':'').'>'.$this-…
295 …echo '<option value="3" '.(($this->profiles[$no]['depth']==3)?'selected="selected"':'').'>'.$this-…
299 echo '<label for="sync__user">'.$this->getLang('user').'</label> ';
300 …echo '<input type="text" name="prf[user]" id="sync__user" class="edit" value="'.hsc($this->profile…
302 echo '<label for="sync__pass">'.$this->getLang('pass').'</label> ';
303 …="password" name="prf[pass]" id="sync__pass" class="edit" value="'.hsc($this->profiles[$no]['pass'…
305 echo '<label for="sync__timeout">'.$this->getLang('timeout').'</label>';
306 …mber" name="prf[timeout]" id="sync__timeout" class="edit" value="'.hsc($this->profiles[$no]['timeo…
308 echo '<span>'.$this->getLang('type').'</span>';
311 …echo '<input type="radio" name="prf[type]" id="sync__type0" value="0" '.(($this->profiles[$no]['ty…
312 echo '<label for="sync__type0">'.$this->getLang('type0').'</label> ';
314 …echo '<input type="radio" name="prf[type]" id="sync__type1" value="1" '.(($this->profiles[$no]['ty…
315 echo '<label for="sync__type1">'.$this->getLang('type1').'</label> ';
317 …echo '<input type="radio" name="prf[type]" id="sync__type2" value="2" '.(($this->profiles[$no]['ty…
318 echo '<label for="sync__type2">'.$this->getLang('type2').'</label> ';
323 echo '<input type="submit" value="'.$this->getLang('save').'" class="button" />';
324 if($no !== '' && $this->profiles[$no]['ltime']){
325 echo '<small>'.$this->getLang('changewarn').'</small>';
330 …echo '<input name="sync__delete" type="submit" value="'.$this->getLang('delete').'" class="button"…
345 if(!$this->_connect()) return array();
351 $this->_listOut($this->getLang('lockfail').' '.hsc($id),'error');
359 $ok = $this->client->query('dokuwiki.setLocks',array('lock'=>$lock,'unlock'=>array()));
361 $this->_listOut('failed RPC communication');
365 $data = $this->client->getResponse();
367 $this->_listOut($this->getLang('lockfail').' '.hsc($id),'error');
389 if(!$this->_connect()) return false;
390 $no = $this->profno;
394 $lock = $this->_lockfiles($synclist);
400 $this->_listOut($this->getLang('skipped').' '.$id,'skipped');
403 if($dir == -2){
407 $this->_listOut($this->getLang('localdelok').' '.$id,'del_okay');
410 $this->_listOut($this->getLang('localdelok').' '.$id,'del_okay');
412 $this->_listOut($this->getLang('localdelfail').' '.$id,'del_fail');
417 if($dir == -1){
420 $ok = $this->client->query('wiki.getPage',$id);
422 $ok = $this->client->query('wiki.getAttachment',$id);
425 $this->_listOut($this->getLang('pullfail').' '.$id.' '.
426 $this->client->getErrorMessage(),'pull_fail');
429 $data = $this->client->getResponse();
434 if($this->apiversion < 7){
439 $this->_listOut($this->getLang('pullok').' '.$id,'pull_okay');
446 $ok = $this->client->query('wiki.putPage',$id,$data,array('sum'=>$sum));
449 if($this->apiversion < 6){
454 $ok = $this->client->query('wiki.putAttachment',$id,$data,array('ow'=>true));
457 $this->_listOut($this->getLang('pushfail').' '.$id.' '.
458 $this->client->getErrorMessage(),'push_fail');
461 $this->_listOut($this->getLang('pushok').' '.$id,'push_okay');
467 $ok = $this->client->query('wiki.putPage',$id,'',array('sum'=>$sum));
469 $ok = $this->client->query('wiki.deleteAttachment',$id);
472 $this->_listOut($this->getLang('remotedelfail').' '.$id.' '.
473 $this->client->getErrorMessage(),'del_fail');
476 $this->_listOut($this->getLang('remotedelok').' '.$id,'del_okay');
486 $this->client->query('dokuwiki.setLocks',array('lock'=>array(),'unlock'=>$lock));
496 $no = $this->profno;
497 list($letime,$retime) = $this->_getTimes();
498 $this->profiles[$no]['ltime'] = $ltime;
499 $this->profiles[$no]['rtime'] = $rtime;
500 $this->profiles[$no]['letime'] = $letime;
501 $this->profiles[$no]['retime'] = $retime;
502 $this->_profileSave();
509 $no = $this->profno;
510 echo $this->locale_xhtml('list');
517 <th class="sync__file">'.$this->getLang('file').'</th>
518 <th class="sync__local">'.$this->getLang('local').'</th>
522 <th class="sync__remote">'.$this->getLang('remote').'</th>
523 <th class="sync__diff">'.$this->getLang('diff').'</th>
535 echo '<input type="submit" value="'.$this->getLang('syncstart').'" class="button" />';
547 $no = $this->profno;
549 $ltime = (int) $this->profiles[$no]['ltime'];
550 $rtime = (int) $this->profiles[$no]['rtime'];
551 $letime = (int) $this->profiles[$no]['letime'];
552 $retime = (int) $this->profiles[$no]['retime'];
560 $dir = -1;
568 $dir = -1;
589 …ame="sync_'.$type.'['.hsc($id).']" value="2" class="syncpush" title="'.$this->getLang('pushdel').'…
591 …ame="sync_'.$type.'['.hsc($id).']" value="1" class="syncpush" title="'.$this->getLang('push').'" '…
595 …ame="sync_'.$type.'['.hsc($id).']" value="0" class="syncskip" title="'.$this->getLang('keep').'" '…
599 …e="sync_'.$type.'['.hsc($id).']" value="-2" class="syncpull" title="'.$this->getLang('pulldel').'"…
601 …ame="sync_'.$type.'['.hsc($id).']" value="-1" class="syncpull" title="'.$this->getLang('pull').'" …
616 …ff.php?id='.$id.'&no='.$no.'" target="_blank" class="sync_popup">'.$this->getLang('diff').'</a…
628 if(!$this->_connect()) return false;
630 $ok = $this->client->query('dokuwiki.getTime');
632 msg('Failed to fetch remote time. '.
633 $this->client->getErrorMessage(),-1);
636 $rtime = $this->client->getResponse();
645 if(!$this->_connect()) return array();
647 $no = $this->profno;
649 $ns = $this->profiles[$no]['ns'];
653 $ok = $this->client->query('dokuwiki.getPagelist',$ns,
654 array('depth' => (int) $this->profiles[$no]['depth'],
657 $ok = $this->client->query('wiki.getAttachments',$ns,
658 array('depth' => (int) $this->profiles[$no]['depth'],
662 msg('Failed to fetch remote file list. '.
663 $this->client->getErrorMessage(),-1);
666 $remote = $this->client->getResponse();
680 array('depth' => (int) $this->profiles[$no]['depth'],
684 array('depth' => (int) $this->profiles[$no]['depth'],
709 if(!$this->_connect()) return false;
710 $no = $this->profno;
712 $ok = $this->client->query('wiki.getPage',$id);
714 echo $this->getLang('pullfail').' '.hsc($id).' ';
715 echo hsc($this->client->getErrorMessage());
718 $remote = $this->client->getResponse();
727 echo '<th colspan="2">'.$this->getLang('local').'</th>';
728 echo '<th colspan="2">'.$this->getLang('remote').'</th>';
730 echo $tdf->format($df);
734 //Setup VIM: ex: et ts=4 enc=utf-8 :