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 | $_menu['Plugins']->addItem(__('Pings'),'plugin.php?p=pings','index.php?pf=pings/icon.png', |
---|
15 | preg_match('/plugin.php\?p=pings/',$_SERVER['REQUEST_URI']), |
---|
16 | $core->auth->isSuperAdmin()); |
---|
17 | |
---|
18 | $__autoload['pingsAPI'] = dirname(__FILE__).'/lib.pings.php'; |
---|
19 | $__autoload['pingsBehaviors'] = dirname(__FILE__).'/lib.pings.php'; |
---|
20 | |
---|
21 | # Create settings if they don't exist |
---|
22 | if (!array_key_exists('pings',$core->blog->settings->dumpNamespaces())) |
---|
23 | { |
---|
24 | $default_pings_uris = array( |
---|
25 | 'Ping-o-Matic!' => 'http://rpc.pingomatic.com/', |
---|
26 | 'Google Blog Search' => 'http://blogsearch.google.com/ping/RPC2' |
---|
27 | ); |
---|
28 | |
---|
29 | $core->blog->settings->addNamespace('pings'); |
---|
30 | $core->blog->settings->pings->put('pings_active',1,'boolean','Activate pings plugin',true,true); |
---|
31 | $core->blog->settings->pings->put('pings_uris',serialize($default_pings_uris),'string','Pings services URIs',true,true); |
---|
32 | } |
---|
33 | |
---|
34 | $core->addBehavior('adminPostHeaders',array('pingsBehaviors','pingJS')); |
---|
35 | $core->addBehavior('adminPostFormSidebar',array('pingsBehaviors','pingsForm')); |
---|
36 | $core->addBehavior('adminAfterPostCreate',array('pingsBehaviors','doPings')); |
---|
37 | $core->addBehavior('adminAfterPostUpdate',array('pingsBehaviors','doPings')); |
---|
38 | |
---|
39 | $core->addBehavior('adminDashboardFavs','pingDashboardFavs'); |
---|
40 | |
---|
41 | function pingDashboardFavs($core,$favs) |
---|
42 | { |
---|
43 | $favs['pings'] = new ArrayObject(array('pings','Pings','plugin.php?p=pings', |
---|
44 | 'index.php?pf=pings/icon.png','index.php?pf=pings/icon-big.png', |
---|
45 | null,null,null)); |
---|
46 | } |
---|
47 | ?> |
---|