1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # |
---|
4 | # This file is part of Carnaval a plugin for Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2008-2010 Osku and contributors |
---|
7 | # Licensed under the GPL version 2.0 license. |
---|
8 | # A copy of this license is available in LICENSE file or at |
---|
9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
10 | # |
---|
11 | # -- END LICENSE BLOCK ------------------------------------ |
---|
12 | if (!defined('DC_CONTEXT_ADMIN')) { exit; } |
---|
13 | |
---|
14 | $new_version = $core->plugins->moduleInfo('carnaval','version'); |
---|
15 | |
---|
16 | $current_version = $core->getVersion('carnaval'); |
---|
17 | |
---|
18 | if (version_compare($current_version,$new_version,'>=')) { |
---|
19 | return; |
---|
20 | } |
---|
21 | |
---|
22 | $s = new dbStruct($core->con,$core->prefix); |
---|
23 | |
---|
24 | $s->carnaval |
---|
25 | ->class_id('integer',0,false) |
---|
26 | ->blog_id('varchar',32, false) |
---|
27 | ->comment_author('varchar',255,false) |
---|
28 | ->comment_author_mail('varchar',255,false) |
---|
29 | ->comment_class('varchar',255,false) |
---|
30 | ->comment_text_color('varchar',7,false) |
---|
31 | ->comment_background_color('varchar',7,false) |
---|
32 | |
---|
33 | ->primary('pk_carnaval','class_id') |
---|
34 | ->index('idx_class_blog_id','btree','blog_id') |
---|
35 | ; |
---|
36 | |
---|
37 | $si = new dbStruct($core->con,$core->prefix); |
---|
38 | $changes = $si->synchronize($s); |
---|
39 | |
---|
40 | $s =& $core->blog->settings->carnaval; |
---|
41 | $s->put('carnaval_active',false,'boolean','Carnaval activation flag',true,true); |
---|
42 | $s->put('carnaval_colors',false,'boolean','Use colors defined with Carnaval plugin',true,true); |
---|
43 | |
---|
44 | $core->setVersion('carnaval',$new_version); |
---|
45 | return true; |
---|
46 | ?> |
---|