summaryrefslogtreecommitdiff
path: root/src/views/pages/plugins/index.html.php
blob: b182288784911166b09c709af84999ec03457e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php global $VARS;
require_once('Database.class.php');
$t = $VARS['template'];
$plugins = $VARS['plugins'];
$db = Database::getInstance();

$t->header('Administrator Plugin Management');
$t->openTag('form',array('method'=>'post','action'=>$t->url('plugins')));

foreach ($plugins as $plugin) {
	$t->setRet(true);
	$props = array('type'=>'checkbox',
	               'name'=>'plugins[]',
	               'id'=>'plugins_'.$plugin['name'],
	               'value'=>$plugin['name']);
	if ($plugin['active']==true) {
		$props['checked'] = 'checked';
	}
	$box = $t->tag('input', $props);
	$t->setRet(false);
	$t->openFieldset($plugin['name'].$box);
	
	$t->inputP($plugin['description']);
	foreach ($plugin['config'] as $param => $type) {
		$name = $plugin['key'].'['.$param.']';
		$value = $db->getPluginConf($plugin['name'], $param);
		$hint = "Type: $type";
		switch ($type) {
		case 'text':
		case 'int':
			$t->inputText(    $name, $param, $hint, $value); break;
		case 'password':
			$t->inputPassword($name, $param, $hint, $value); break;
		}
	}
	$t->closeFieldset();
}

$t->tag('input', array('type'=>'submit',
                       'value'=>'Save/Update'));
$t->closeTag('form');
$t->footer();