Dotclear

source: plugins/pacKman/_admin.php @ 3240

Revision 3240, 1.6 KB checked in by JcDenis, 10 years ago (diff)
  • Switch to Dotclear 2.6
Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3#
4# This file is part of pacKman, a plugin for Dotclear 2.
5#
6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
7# contact@jcdenis.fr
8#
9# Licensed under the GPL version 2.0 license.
10# A copy of this license is available in LICENSE file or at
11# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12#
13# -- END LICENSE BLOCK ------------------------------------
14
15if (!defined('DC_CONTEXT_ADMIN')) {
16
17     return null;
18}
19
20$core->blog->settings->addNamespace('pacKman');
21
22$core->addBehavior(
23     'adminDashboardFavorites',
24     array('packmanBehaviors', 'adminDashboardFavorites')
25);
26
27$_menu['Plugins']->addItem(
28     __('Packages repository'),
29     'plugin.php?p=pacKman#packman-repository-repository',
30     'index.php?pf=pacKman/icon.png',
31     preg_match(
32          '/plugin.php\?p=pacKman(&.*)?$/',
33          $_SERVER['REQUEST_URI']
34     ),
35     $core->auth->isSuperAdmin()
36);
37
38class packmanBehaviors
39{
40     public static function adminDashboardFavorites($core, $favs)
41     {
42          $favs->register('pacKman', array(
43               'title'        => __('Packages repository'),
44               'url'          => 'plugin.php?p=pacKman#packman-repository-repository',
45               'small-icon'   => 'index.php?pf=pacKman/icon.png',
46               'large-icon'   => 'index.php?pf=pacKman/icon-big.png',
47               'permissions'  => $core->auth->isSuperAdmin(),
48               'active_cb'    => array(
49                    'packmanBehaviors', 
50                    'adminDashboardFavoritesActive'
51               )
52          ));
53     }
54
55     public static function adminDashboardFavoritesActive($request, $params)
56     {
57          return $request == 'plugin.php' 
58               && isset($params['p']) 
59               && $params['p'] == 'pacKman';
60     }
61}
Note: See TracBrowser for help on using the repository browser.

Sites map