Dotclear

source: plugins/shareOn/_install.php @ 1941

Revision 1941, 2.0 KB checked in by JcDenis, 14 years ago (diff)

shareOn 0.1:

  • First lab release (closes #260)
Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3# This file is part of shareOn, a plugin for Dotclear 2.
4#
5# Copyright (c) 2009 JC Denis and contributors
6# jcdenis@gdwd.com
7#
8# Licensed under the GPL version 2.0 license.
9# A copy of this license is available in LICENSE file or at
10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11# -- END LICENSE BLOCK ------------------------------------
12
13if (!defined('DC_CONTEXT_ADMIN')){return;}
14
15$new_version = $core->plugins->moduleInfo('shareOn','version');
16$old_version = $core->getVersion('shareOn');
17
18if (version_compare($old_version,$new_version,'>=')) return;
19
20try {
21     # Is DC 2.1.5 ?
22     if (!version_compare(DC_VERSION,'2.1.6','>=')) {
23
24          throw new Exception('shareOn requires Dotclear 2.1.6');
25     }
26
27     # Setting
28     $css = 
29     ".shareonentry ul { list-style: none; margin: 4px; padding: 0; } \n".
30     ".shareonentry ul li { display: inline; margin: 4px; padding: 0; } \n".
31     "#sidebar .shareonwidget ul { list-style: none; margin: 4px; padding: 0; border: none; } \n".
32     "#sidebar .shareonwidget ul li { margin: 4px; padding: 0; border: none; } \n";
33
34     $s =& $core->blog->settings;
35     $s->setNameSpace('shareOn');
36
37     $s->put('shareOn_active',false,'boolean','Enable shareOn',false,true);
38     $s->put('shareOn_style',$css,'string','Special ShareOn css',false,true);
39     $s->put('shareOn_title','','string','Title of buttons bar',false,true);
40     $s->put('shareOn_home_place','after','string','Where to place ShareOn bar on home page',false,true);
41     $s->put('shareOn_cat_place','after','string','Where to place ShareOn bar on category page',false,true);
42     $s->put('shareOn_tag_place','after','string','Where to place ShareOn bar on tag page',false,true);
43     $s->put('shareOn_post_place','after','string','Where to place ShareOn bar on post page',false,true);
44
45     $s->setNameSpace('system');
46
47     # Version
48     $core->setVersion('shareOn',$new_version);
49
50     return true;
51}
52catch (Exception $e) {
53     $core->error->add($e->getMessage());
54}
55return false;
56?>
Note: See TracBrowser for help on using the repository browser.

Sites map