cosmetic
[diogenes.git] / include / admin / plugins.php
CommitLineData
6855525e
JL
1<?php
2require_once 'diogenes.common.inc.php';
3require_once 'diogenes.admin.inc.php';
4require_once 'Plugin/Editor.php';
5require_once 'Barrel/Page.php';
6
7$page = new DiogenesAdmin;
8
9$bbarrel = $page->barrel;
10
11if (!$bbarrel->hasFlag('plug')) {
12 return;
13}
14
15$page->assign('post',$page->script_self());
16
17$dir = isset($_REQUEST['plug_page']) ? $_REQUEST['plug_page'] : 0;
18
19if ($dir != 0)
20{
21 $bpage = Diogenes_Barrel_Page::fromDb($bbarrel, $dir);
22 $page->assign('greeting',__("Page plugins ") . " - " . ($bpage->props['location'] ? $bpage->props['location'] : __("home")) );
d0b659f7 23 $page->toolbar(__("Page"), $bpage->make_toolbar($page));
6855525e
JL
24 $wperms = $bpage->props['wperms'];
25} else {
26 $page->assign('greeting',__("Available plugins"));
27 $wperms = '';
28}
29
30/* plugin editor */
31$editor = new Diogenes_Plugin_Editor($page->alias, $dir, $wperms);
32if ($dir == 0) {
33 $editor->readonly = 1;
34 $editor->hide_params(1);
35}
36$editor->run($page,'page_content');
37$page->display('');
38?>