[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[1179] | 6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
[0] | 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 ----------------------------------------- |
---|
[3730] | 12 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
---|
[0] | 13 | |
---|
[3730] | 14 | $core->addBehavior('adminDashboardIcons', 'blogroll_dashboard'); |
---|
| 15 | $core->addBehavior('adminDashboardFavorites', 'blogroll_dashboard_favorites'); |
---|
| 16 | $core->addBehavior('adminUsersActionsHeaders', 'blogroll_users_actions_headers'); |
---|
[1502] | 17 | |
---|
[3730] | 18 | function blogroll_dashboard($core, $icons) |
---|
[0] | 19 | { |
---|
[3730] | 20 | $icons['blogroll'] = new ArrayObject(array( |
---|
| 21 | __('Blogroll'), |
---|
| 22 | $core->adminurl->get('admin.plugin.blogroll'), |
---|
| 23 | dcPage::getPF('blogroll/icon.png') |
---|
| 24 | )); |
---|
[0] | 25 | } |
---|
[3730] | 26 | function blogroll_dashboard_favorites($core, $favs) |
---|
[3] | 27 | { |
---|
[3730] | 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 | )); |
---|
[3] | 35 | } |
---|
[1502] | 36 | function blogroll_users_actions_headers() |
---|
| 37 | { |
---|
[3730] | 38 | global $core; |
---|
[2824] | 39 | |
---|
[3730] | 40 | return dcPage::jsLoad(dcPage::getPF('blogroll/js/_users_actions.js')); |
---|
[1502] | 41 | } |
---|
[0] | 42 | |
---|
[2824] | 43 | $_menu['Blog']->addItem(__('Blogroll'), |
---|
[3730] | 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)); |
---|
[0] | 48 | |
---|
[3730] | 49 | $core->auth->setPermissionType('blogroll', __('manage blogroll')); |
---|
[0] | 50 | |
---|
[3730] | 51 | require dirname(__FILE__) . '/_widgets.php'; |
---|