File: plugins.php

package info (click to toggle)
diogenes 0.9.20-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,976 kB
  • ctags: 3,271
  • sloc: php: 12,285; sh: 828; perl: 258; makefile: 137; sql: 85
file content (38 lines) | stat: -rw-r--r-- 968 bytes parent folder | download | duplicates (2)
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
<?php
require_once 'diogenes.common.inc.php';
require_once 'diogenes.admin.inc.php';
require_once 'Plugin/Editor.php';
require_once 'Barrel/Page.php';

$page = new DiogenesAdmin;

$bbarrel = $page->barrel;

if (!$bbarrel->hasFlag('plug')) {
  return;
}

$page->assign('post',$page->script_self());

$dir = isset($_REQUEST['plug_page']) ? $_REQUEST['plug_page'] : 0;

if ($dir != 0)
{
  $bpage = Diogenes_Barrel_Page::fromDb($bbarrel, $dir);
  $page->assign('greeting',__("Page plugins ") . " - " . ($bpage->props['location'] ? $bpage->props['location'] : __("home")) );    
  $page->toolbar(__("Page"), $bpage->make_toolbar($page));
  $wperms = $bpage->props['wperms'];
} else {
  $page->assign('greeting',__("Available plugins"));
  $wperms = '';
}

/* plugin editor */
$editor = new Diogenes_Plugin_Editor($page->alias, $dir, $wperms);
if ($dir == 0) {
  $editor->readonly = 1;
  $editor->hide_params(1);
}
$editor->run($page,'page_content');
$page->display('');
?>