-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_admin.php
More file actions
76 lines (63 loc) · 2.09 KB
/
_admin.php
File metadata and controls
76 lines (63 loc) · 2.09 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of Menu, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Benoît Grelier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) { return; }
$core->addBehavior('adminDashboardFavorites','menuDashboardFavorites');
function menuDashboardFavorites($core,$favs)
{
$favs->register('menu', array(
'title' => __('Menu'),
'url' => 'plugin.php?p=menu',
'small-icon' => 'index.php?pf=menu/icon.png',
'large-icon' => 'index.php?pf=menu/icon-big.png',
'permissions' => 'usage,contentadmin'
));
}
$_menu['Blog']->addItem(__('Menu'),'plugin.php?p=menu','index.php?pf=menu/icon.png',
preg_match('/plugin.php\?p=menu(&.*)?$/',$_SERVER['REQUEST_URI']),
$core->auth->check('usage,contentadmin',$core->blog->id));
$core->auth->setPermissionType('menu',__('manage menu'));
require dirname(__FILE__).'/_widgets.php';
# Import-export :
/*
$core->addBehavior('exportFull',array('menuBehaviors','exportFull'));
$core->addBehavior('exportSingle',array('menuBehaviors','exportSingle'));
$core->addBehavior('importInit',array('menuBehaviors','importInit'));
$core->addBehavior('importSingle',array('menuBehaviors','importSingle'));
$core->addBehavior('importFull',array('menuBehaviors','importFull'));
class menuBehaviors
{
public static function exportFull($core,$exp)
{
$exp->exportTable('menu');
}
public static function exportSingle($core,$exp,$blog_id)
{
$exp->export('menu',
'SELECT * FROM '.$this->core->prefix.'menu '.
"WHERE blog_id = '".$blog_id."'"
);
}
public static function importInit($bk,$core)
{
$bk->cur_menu = $core->con->openCursor($core->prefix.'menu');
$bk->menu = new dcBlogMenu($core);
}
public static function importFull($line,$bk,$core)
{
}
public static function importSingle($line,$bk,$core)
{
if ($line->__name == menu) {
$menu->blog_id = $bk->blog_id;
}
}
}
//*/