|
1 | 1 | <?php |
2 | | -/** |
3 | | - * CAPTCHA antispam plugin - Image generator |
4 | | - * |
5 | | - * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) |
6 | | - * @author Andreas Gohr <gohr@cosmocode.de> |
7 | | - */ |
8 | 2 |
|
9 | | -if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/'); |
10 | | -require_once(DOKU_INC.'inc/init.php'); |
11 | | -require_once(DOKU_INC.'inc/auth.php'); |
12 | | -session_write_close(); |
13 | | -require_once(DOKU_INC.'inc/template.php'); |
14 | | -require_once(DOKU_INC.'inc/DifferenceEngine.php'); |
15 | | -require_once(dirname(__FILE__).'/admin.php'); |
| 3 | +use dokuwiki\plugin\sync\ProfileManager; |
16 | 4 |
|
| 5 | +if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__) . '/../../../') . '/'); |
| 6 | +require_once(DOKU_INC . 'inc/init.php'); |
| 7 | +session_write_close(); |
17 | 8 | if(!auth_isadmin()) die('not you my friend!'); |
18 | 9 |
|
19 | | -$id = cleanID($_REQUEST['id']); |
20 | | -$plugin = new admin_plugin_sync(); |
| 10 | +global $INPUT; |
| 11 | +global $conf; |
| 12 | +global $lang; |
| 13 | + |
| 14 | +$id = $INPUT->filter('cleanid')->str('id'); |
| 15 | +$profno = $INPUT->int('no'); |
| 16 | +$prmanager = new ProfileManager(); |
| 17 | +$profile = $prmanager->getProfile($profno); |
| 18 | +$plugin = plugin_load('admin', 'sync'); |
| 19 | + |
21 | 20 | header('Content-Type: text/html; charset=utf-8'); |
22 | 21 | ?> |
23 | 22 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
24 | | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
25 | | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>" |
26 | | - lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction']?>"> |
| 23 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 24 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>" |
| 25 | + lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>"> |
27 | 26 | <head> |
28 | | - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
29 | | - <title><?php echo $plugin->getLang('diff')?></title> |
30 | | - <?php tpl_metaheaders()?> |
| 27 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| 28 | + <title><?php echo $plugin->getLang('diff') ?></title> |
| 29 | + <?php tpl_metaheaders() ?> |
31 | 30 | </head> |
32 | 31 | <body> |
33 | | - <div class="dokuwiki"> |
34 | | - <?php $plugin->_diff($id);?> |
35 | | - </div> |
| 32 | +<div class="dokuwiki"> |
| 33 | + <?php |
| 34 | + $df = $profile->diffPage($id); |
| 35 | + $tdf = new TableDiffFormatter(); |
| 36 | + echo '<table class="diff" id="plugin__sync_diff">'; |
| 37 | + echo '<tr>'; |
| 38 | + echo '<th colspan="2">' . $plugin->getLang('local') . '</th>'; |
| 39 | + echo '<th colspan="2">' . $plugin->getLang('remote') . '</th>'; |
| 40 | + echo '</tr>'; |
| 41 | + echo $tdf->format($df); |
| 42 | + echo '</table>'; |
| 43 | + ?> |
| 44 | +</div> |
36 | 45 | </body> |
37 | 46 |
|
0 commit comments