1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
7 | # Licensed under the GPL version 2.0 license. |
---|
8 | # See LICENSE file or |
---|
9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
10 | # |
---|
11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
12 | if (!defined('DC_CONTEXT_ADMIN')) { return; } |
---|
13 | |
---|
14 | $core->addBehavior('adminDashboardIcons','blogroll_dashboard'); |
---|
15 | $core->addBehavior('adminDashboardFavorites','blogroll_dashboard_favorites'); |
---|
16 | $core->addBehavior('adminUsersActionsHeaders','blogroll_users_actions_headers'); |
---|
17 | |
---|
18 | function blogroll_dashboard($core,$icons) |
---|
19 | { |
---|
20 | $icons['blogroll'] = new ArrayObject(array( |
---|
21 | __('Blogroll'), |
---|
22 | $core->adminurl->get('admin.plugin.blogroll'), |
---|
23 | dcPage::getPF('blogroll/icon.png') |
---|
24 | )); |
---|
25 | } |
---|
26 | function blogroll_dashboard_favorites($core,$favs) |
---|
27 | { |
---|
28 | $favs->register('blogroll', array( |
---|
29 | 'title' => __('Blogroll'), |
---|
30 | 'url' => $core->adminurl->get('admin.plugin.blogroll'), |
---|
31 | 'small-icon' => dcPage::getPF('blogroll/icon-small.png'), |
---|
32 | 'large-icon' => dcPage::getPF('blogroll/icon.png'), |
---|
33 | 'permissions' => 'usage,contentadmin' |
---|
34 | )); |
---|
35 | } |
---|
36 | function blogroll_users_actions_headers() |
---|
37 | { |
---|
38 | global $core; |
---|
39 | |
---|
40 | return dcPage::jsLoad(dcPage::getPF('blogroll/_users_actions.js')); |
---|
41 | } |
---|
42 | |
---|
43 | $_menu['Blog']->addItem(__('Blogroll'), |
---|
44 | $core->adminurl->get('admin.plugin.blogroll'), |
---|
45 | dcPage::getPF('blogroll/icon-small.png'), |
---|
46 | preg_match('/'.preg_quote($core->adminurl->get('admin.plugin.blogroll')).'(&.*)?$/',$_SERVER['REQUEST_URI']), |
---|
47 | $core->auth->check('usage,contentadmin',$core->blog->id)); |
---|
48 | |
---|
49 | $core->auth->setPermissionType('blogroll',__('manage blogroll')); |
---|
50 | |
---|
51 | require dirname(__FILE__).'/_widgets.php'; |
---|