1<?php 2 3namespace dokuwiki\Action; 4 5use dokuwiki\Ui; 6 7/** 8 * Class Conflict 9 * 10 * Show the conflict resolution screen 11 * 12 * @package dokuwiki\Action 13 */ 14class Conflict extends AbstractAction 15{ 16 /** @inheritdoc */ 17 public function minimumPermission() 18 { 19 global $INFO; 20 if ($INFO['exists']) { 21 return AUTH_EDIT; 22 } else { 23 return AUTH_CREATE; 24 } 25 } 26 27 /** @inheritdoc */ 28 public function tplContent() 29 { 30 global $PRE; 31 global $TEXT; 32 global $SUF; 33 global $SUM; 34 35 $this->showBanner(); 36 $text = con($PRE, $TEXT, $SUF); 37 (new Ui\ConflictForm($text, $SUM))->show(); 38 (new Ui\Diff($text, false))->show(); 39 } 40 41 /** 42 * Show warning on conflict detection 43 * 44 * @author Andreas Gohr <andi@splitbrain.org> 45 * 46 * @return void 47 */ 48 protected function showBanner() 49 { 50 // print intro 51 print p_locale_xhtml('conflict'); 52 } 53 54 55} 56