tiki-plugins.php 1.71 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project
6
//
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9
// $Id$
changi67's avatar
changi67 committed
10

11 12 13
require_once 'tiki-setup.php';
$access->check_feature('wiki_validate_plugin');
$access->check_permission('tiki_p_plugin_approve');
14 15
$parserlib = TikiLib::lib('parser');

16
if (isset($_POST['submit_mult']) && ($_POST['submit_mult'] == 'clear') && is_array($_POST['clear'])) {
17
	foreach ($_POST['clear'] as $fp) {
18
		$parserlib->plugin_clear_fingerprint($fp);
sylvieg's avatar
sylvieg committed
19
	}
20
}
21

22
if (isset($_POST['submit_mult']) && ($_POST['submit_mult'] == 'approve') && is_array($_POST['clear'])) {
23
	foreach ($_POST['clear'] as $fp) {
24
		$parserlib->approve_selected_pending_plugings($fp);
25 26 27
	}
}

28
if (isset($_REQUEST['approveone'])) {
29
	$parserlib->approve_selected_pending_plugings($_REQUEST['approveone']);
30 31 32
}

if (isset($_REQUEST['clearone'])) {
33
	$parserlib->plugin_clear_fingerprint($_REQUEST['clearone']);
34 35
}

36 37
if (isset($_REQUEST['refresh'])) {
	$pages = $tikilib->list_pages();
38 39 40

	$temp = serialize($headerlib);	// cache headerlib so we can remove all js etc added by plugins

41 42
	foreach ($pages['data'] as $apage) {
		$page = $apage['pageName'];
43 44 45 46 47 48
		$parserlib->setOptions(
			array(
				'page' => $page,
				'is_html' => $apage['is_html'],
			)
		);
49
		$parserlib->parse_first($apage['data'], $pre, $no);
50
	}
51 52 53

	$headerlib = unserialize($temp);
	unset($temp);
54 55
}

56
if (isset($_POST['approveall'])) {
57
	$parserlib->approve_all_pending_plugins();
58
}
59

60
$smarty->assign('plugin_list', $parserlib->list_plugins_pending_approval());
changi67's avatar
changi67 committed
61
$smarty->assign('mid', 'tiki-plugins.tpl');
62
$smarty->display("tiki.tpl");