1<?php
2
3/**
4 * How dokuwiki\Action\Changes would look like if it existed in Dokuwiki release Igor.
5 * This class is mostly a wrapper around dokuwiki\Action\Preview.
6 *
7 * NB: This class is currently unused.
8 */
9class helper_plugin_diffpreview_changes extends Dokuwiki_Plugin {
10    protected $actionname = 'changes';
11    protected $preview;
12
13    public function __construct() {
14        $this->preview = new dokuwiki\Action\Preview;
15    }
16
17    public function minimumPermission() {
18        return $this->preview->minimumPermission();
19    }
20
21    public function checkPreconditions() {
22        return $this->preview->checkPreconditions();
23    }
24
25    public function preProcess() {
26        // This will save a draft
27        return $this->preview->preProcess();
28    }
29
30    public function tplContent() {
31        global $PRE, $TEXT, $SUF;
32
33        (new dokuwiki\Ui\Editor)->show();
34        echo '<br id="scroll__here" />';
35        ((new dokuwiki\Ui\PageDiff($INFO['id']))
36            ->compareWith(con($PRE,$TEXT,$SUF))
37            ->preference(['showIntro' => true, 'difftype' => 'sidebyside'])
38        )->show();
39    }
40
41    public function getActionName() {
42        return $this->actionname;
43    }
44}
45