Lines Matching +full:insert +full:- +full:user -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

42         $this->preference['showIntro'] = true;
43 $this->preference['difftype'] = 'sidebyside'; // diff view type: inline or sidebyside
51 $this->changelog = new PageChangeLog($this->id);
65 $this->text = $text;
66 $changelog =& $this->changelog;
69 $info = $changelog->getCurrentRevisionInfo();
70 $this->RevInfo1 = new RevisionInfo($info);
71 $this->RevInfo1->append([
73 'text' => rawWiki($this->id),
77 $this->RevInfo2 = new RevisionInfo();
78 $this->RevInfo2->append([
82 'id' => $this->id,
83 //'user' => '',
86 //'sizechange' => strlen($this->text) - io_getSizeFile(wikiFN($this->id)),
88 'text' => cleanText($this->text),
104 if (!isset($this->RevInfo1, $this->RevInfo2)) {
110 if ($INPUT->has('difftype')) {
111 $mode = $INPUT->str('difftype');
117 $this->preference['difftype'] = $mode;
120 if (!$INPUT->has('rev') && !$INPUT->has('rev2')) {
122 if ($this->id == $INFO['id']) {
123 $REV = $this->rev1; // store revision back in $REV
135 $changelog =& $this->changelog;
141 $changelogRev1 = $changelog->getRevisionInfo($this->rev1);
142 $changelogRev2 = $changelog->getRevisionInfo($this->rev2);
144 $this->RevInfo1 = new RevisionInfo($changelogRev1);
145 $this->RevInfo2 = new RevisionInfo($changelogRev2);
147 foreach ([$this->RevInfo1, $this->RevInfo2] as $RevInfo) {
148 $isCurrent = $changelog->isCurrentRevision($RevInfo->val('date'));
149 $RevInfo->isCurrent($isCurrent);
151 if ($RevInfo->val('type') == DOKU_CHANGE_TYPE_DELETE || empty($RevInfo->val('type'))) {
154 $rev = $isCurrent ? '' : $RevInfo->val('date');
155 $text = rawWiki($this->id, $rev);
157 $RevInfo->append(['text' => $text]);
161 if ($this->rev2 === false) {
164 $this->id,
165 wl($this->id, ['do' => 'edit']),
166 $this->id
167 ), -1);
168 } elseif (!$this->rev1 || $this->rev1 == $this->rev2) {
169 msg('no way to compare when less than two revisions', -1);
186 if (!isset($this->RevInfo1, $this->RevInfo2)) {
188 $this->handle();
190 $this->preProcess();
194 $rev1Title = trim($this->RevInfo1->showRevisionTitle() . ' ' . $this->RevInfo1->showCurrentIndicator());
195 $rev1Summary = ($this->RevInfo1->val('date'))
196 ? $this->RevInfo1->showEditSummary() . ' ' . $this->RevInfo1->showEditor()
199 if ($this->RevInfo2->val('extra') == 'compareWith') {
203 $rev2Title = trim($this->RevInfo2->showRevisionTitle() . ' ' . $this->RevInfo2->showCurrentIndicator());
204 $rev2Summary = ($this->RevInfo2->val('date'))
205 ? $this->RevInfo2->showEditSummary() . ' ' . $this->RevInfo2->showEditor()
211 explode("\n", $this->RevInfo1->val('text')),
212 explode("\n", $this->RevInfo2->val('text'))
216 [$rev1Navi, $rev2Navi] = $this->buildRevisionsNavigation();
219 if ($this->preference['showIntro']) echo p_locale_xhtml('diff');
222 $this->showDiffViewSelector();
231 echo '<table class="diff diff_' . hsc($this->preference['difftype']) . '">';
234 switch ($this->preference['difftype']) {
239 if ($this->RevInfo2->val('extra') !== 'compareWith') {
241 . '<td class="diff-lineheader">-</td>'
245 . '<th class="diff-lineheader">-</th>'
246 . '<th' . $classEditType($this->RevInfo1->val('type')) . '>' . $title1 . '</th>'
250 . '<td class="diff-lineheader">+</td>'
254 . '<th class="diff-lineheader">+</th>'
255 . '<th' . $classEditType($this->RevInfo2->val('type')) . '>' . $title2 . '</th>'
266 if ($this->RevInfo2->val('extra') !== 'compareWith') {
273 . '<th colspan="2"' . $classEditType($this->RevInfo1->val('type')) . '>' . $title1 . '</th>'
274 . '<th colspan="2"' . $classEditType($this->RevInfo2->val('type')) . '>' . $title2 . '</th>'
282 echo $this->insertSoftbreaks($DiffFormatter->format($Difference));
296 if ($this->RevInfo2->val('extra') == 'compareWith') return;
299 [$rev1, $rev2] = [(int)$this->RevInfo1->val('date'), (int)$this->RevInfo2->val('date')];
305 $form->setHiddenField('id', $this->id);
306 $form->setHiddenField('rev2[0]', $rev1);
307 $form->setHiddenField('rev2[1]', $rev2);
308 $form->setHiddenField('do', 'diff');
311 $input = $form->addDropdown('difftype', $options, $lang['diff_type'])
312 ->val($this->preference['difftype'])
313 ->addClass('quickselect');
314 $input->useInput(false); // inhibit prefillInput() during toHTML() process
315 $form->addButton('do[diff]', 'Go')->attr('type', 'submit');
316 echo $form->toHTML();
322 $viewUrl = $this->diffViewlink('difflink', $rev1, $rev2);
340 $changelog =& $this->changelog;
342 if ($this->RevInfo2->val('extra') == 'compareWith') {
348 [$rev1, $rev2] = [(int)$this->RevInfo1->val('date'), (int)$this->RevInfo2->val('date')];
351 [$revs1, $revs2] = $changelog->getRevisionsAround(
352 ($rev1 ?: $changelog->currentRevision()),
353 ($rev2 ?: $changelog->currentRevision())
357 $rev1Options = $this->buildRevisionOptions('older', $revs1);
358 $rev2Options = $this->buildRevisionOptions('newer', $revs2);
364 $rev1Next = ($index > 0) ? $revs1[$index - 1] : false;
371 $rev2Next = ($index > 0) ? $revs2[$index - 1] : false;
380 $rev1Navi .= $this->diffViewlink('diffbothprevrev', $rev1Prev, $rev2Prev);
384 $rev1Navi .= $this->diffViewlink('diffprevrev', $rev1Prev, $rev2);
387 $rev1Navi .= $this->buildDropdownSelector('older', $rev1Options);
390 $rev1Navi .= $this->diffViewlink('diffnextrev', $rev1Next, $rev2);
399 $rev2Navi .= $this->diffViewlink('diffprevrev', $rev1, $rev2Prev);
402 $rev2Navi .= $this->buildDropdownSelector('newer', $rev2Options);
405 if ($changelog->isCurrentRevision($rev2Next)) {
406 $rev2Navi .= $this->diffViewlink('difflastrev', $rev1, $rev2Next);
408 $rev2Navi .= $this->diffViewlink('diffnextrev', $rev1, $rev2Next);
413 $rev2Navi .= $this->diffViewlink('diffbothnextrev', $rev1Next, $rev2Next);
429 [$rev1, $rev2] = [(int)$this->RevInfo1->val('date'), (int)$this->RevInfo2->val('date')];
431 $changelog =& $this->changelog;
435 $info = $changelog->getRevisionInfo($rev);
441 $date = preg_replace('/[0-9a-zA-Z]/', '_', $date);
446 editorinfo($info['user'], true),
471 [$rev1, $rev2] = [(int)$this->RevInfo1->val('date'), (int)$this->RevInfo2->val('date')];
473 $form = new Form(['action' => wl($this->id)]);
474 $form->setHiddenField('id', $this->id);
475 $form->setHiddenField('do', 'diff');
476 $form->setHiddenField('difftype', $this->preference['difftype']);
480 $form->setHiddenField('rev2[1]', $rev2);
481 $input = $form->addDropdown('rev2[0]', $options)
482 ->val($rev1)->addClass('quickselect');
483 $input->useInput(false);
486 $form->setHiddenField('rev2[0]', $rev1);
487 $input = $form->addDropdown('rev2[1]', $options)
488 ->val($rev2)->addClass('quickselect');
489 $input->useInput(false);
491 $form->addButton('do[diff]', 'Go')->attr('type', 'submit');
492 return $form->toHTML();
512 'difftype' => $this->preference['difftype']
519 'difftype' => $this->preference['difftype']
524 'href' => wl($this->id, $urlparam, true, '&'),
532 * Insert soft breaks in diff html
540 // - html tags, so these can be ignored
541 // - long strings of characters without breaking characters
550 &\#?\\w{1,6};) # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
551 &\#?\\w{1,6}; # yes pattern - a quicker match for the html entity, since we know we have one
553 [?/,&\#;:] # no pattern - any other group of 'special' characters to insert a breaking character after