From 168f9feebfac547ac832cdc2561a85158f9bed2d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 9 Nov 2006 21:47:43 +0100 Subject: revert plugin added This plugin allows an admin to mass revert a lot of edits at once. It's in a very rough state and needs to be improved. darcs-hash:20061109204743-7ad00-3abf02ec466215ad694ac726c803e1a656b0286b.gz --- lib/plugins/revert/admin.php | 150 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 lib/plugins/revert/admin.php (limited to 'lib/plugins/revert/admin.php') diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php new file mode 100644 index 000000000..9e2a290dc --- /dev/null +++ b/lib/plugins/revert/admin.php @@ -0,0 +1,150 @@ +setupLocale(); + } + + /** + * return some info + */ + function getInfo(){ + return array( + 'author' => 'Andreas Gohr', + 'email' => 'andi@splitbrain.org', + 'date' => '2005-09-04', + 'name' => 'Revert Manager', + 'desc' => 'Allows you to mass revert recent edits', + 'url' => 'http://wiki.splitbrain.org/plugin:revert', + ); + } + + /** + * return sort order for position in admin menu + */ + function getMenuSort() { + return 40; + } + + /** + * handle user request + */ + function handle() { + } + + /** + * output appropriate html + */ + function html() { + print $this->plugin_locale_xhtml('intro'); + + if(is_array($_REQUEST['revert'])) $this->_revert($_REQUEST['revert']); + + + echo '
'; + echo ''; + echo ''; + echo '
'; + + $this->_list($_REQUEST['filter']); + } + + function _revert($revert){ + global $conf; + echo '
'; + foreach($revert as $id){ + global $REV; + $old = getRevisions($id, 0, 1); + $REV = $old[0]; + if($REV){ + saveWikiText($id,rawWiki($id,$REV),'old revision restored',false); + echo "$id reverted to $REV
"; + }else{ + saveWikiText($id,'','',false); + echo "$id removed
"; + } + @set_time_limit(10); + flush(); + } + echo '

'; + } + + function _list($filter){ + global $conf; + echo '
'; + + $recents = getRecents(0,800); + print ''; + + echo ''; + echo '
'; + } + +} +//Setup VIM: ex: et ts=4 enc=utf-8 : -- cgit v1.2.3