1<?php 2 3namespace dokuwiki\Ui; 4 5use dokuwiki\ChangeLog\MediaChangeLog; 6use dokuwiki\Extension\Event; 7use dokuwiki\Form\Form; 8 9/** 10 * DokuWiki MediaDiff Interface 11 * 12 * @package dokuwiki\Ui 13 */ 14class MediaDiff extends Diff 15{ 16 /* @var string */ 17 protected $id; 18 19 /** 20 * MediaDiff Ui constructor 21 * 22 * @param string $id media id 23 */ 24 public function __construct($id) 25 { 26 $this->id = $id; 27 28 $this->preference['fromAjax'] = false; // see doluwiki\Ajax::callMediadiff() 29 $this->preference['showIntro'] = false; 30 $this->preference['difftype'] = null; // both, opacity or portions. see lib/scripts/media.js 31 } 32 33 /** 34 * Shows difference between two revisions of media 35 */ 36 public function show() 37 { 38 $ns = getNS($this->id); 39 $auth = auth_quickaclcheck("$ns:*"); 40 media_diff($this->id, $ns, $auth, $this->preference['fromAjax']); 41 } 42 43} 44