3 /* Reminder: always indent with 4 spaces (no tabs). */
4 // +---------------------------------------------------------------------------+
5 // | Static Pages Plugin 1.6 |
6 // +---------------------------------------------------------------------------+
8 // +---------------------------------------------------------------------------+
9 // | Copyright (C) 2009 by the following authors: |
11 // | Authors: Tom Homer - websitemaster AT cogeco DOT net |
12 // +---------------------------------------------------------------------------+
14 // | This program is licensed under the terms of the GNU General Public License|
15 // | as published by the Free Software Foundation; either version 2 |
16 // | of the License, or (at your option) any later version. |
18 // | This program is distributed in the hope that it will be useful, |
19 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 // | See the GNU General Public License for more details. |
23 // | You should have received a copy of the GNU General Public License |
24 // | along with this program; if not, write to the Free Software Foundation, |
25 // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
27 // +---------------------------------------------------------------------------+
32 * @package StaticPages
38 "ALTER TABLE {$_TABLES['staticpage']} ADD meta_description TEXT NULL AFTER commentcode",
39 "ALTER TABLE {$_TABLES['staticpage']} ADD meta_keywords TEXT NULL AFTER meta_description"
45 * Handle update to plugin version 1.6.0: introduce meta tags option
48 function update_ConfValues_1_6_0()
50 global $_CONF, $_TABLES, $_SP_DEFAULT;
52 require_once $_CONF['path_system'] . 'classes/config.class.php';
54 $c = config::get_instance();
56 require_once $_CONF['path'] . 'plugins/staticpages/install_defaults.php';
58 // meta tag config options.
59 $c->add('meta_tags', $_SP_DEFAULT['meta_tags'], 'select', 0, 0, 0, 120, true, 'staticpages');
61 // check for wrong Admin group name
62 $wrong_id = DB_getItem($_TABLES['groups'], 'grp_id',
63 "grp_name = 'Static Pages Admin'"); // wrong name
64 if (! empty($wrong_id)) {
65 $grp_id = DB_getItem($_TABLES['groups'], 'grp_id',
66 "grp_name = 'Static Page Admin'"); // correct name
68 // correct name not found - probably a fresh install: rename
69 DB_query("UPDATE {$_TABLES['groups']} SET grp_name = 'Static Page Admin' WHERE grp_name = 'Static Pages Admin'");
71 // both names exist: delete wrong group & assignments
72 DB_delete($_TABLES['access'], 'acc_grp_id', $wrong_id);
73 DB_delete($_TABLES['group_assignments'], 'ug_grp_id', $wrong_id);
74 DB_delete($_TABLES['group_assignments'], 'ug_main_grp_id', $wrong_id);
75 DB_delete($_TABLES['groups'], 'grp_name', 'Static Pages Admin');
79 // move Default Permissions fieldset
80 DB_query("UPDATE {$_TABLES['conf_values']} SET fieldset = 3 WHERE (group_name = 'staticpages') AND (fieldset = 1)");
83 $c->add('fs_whatsnew', NULL, 'fieldset', 0, 1, NULL, 0, true, 'staticpages');
84 $c->add('newstaticpagesinterval',$_SP_DEFAULT['new_staticpages_interval'],'text', 0, 1, NULL, 10, TRUE, 'staticpages');
85 $c->add('hidenewstaticpages',$_SP_DEFAULT['hide_new_staticpages'],'select', 0, 1, 0, 20, TRUE, 'staticpages');
86 $c->add('title_trim_length',$_SP_DEFAULT['title_trim_length'],'text', 0, 1, NULL, 30, TRUE, 'staticpages');
87 $c->add('includecenterblocks',$_SP_DEFAULT['include_centerblocks'],'select', 0, 1, 0, 40, TRUE, 'staticpages');
88 $c->add('includephp',$_SP_DEFAULT['include_PHP'],'select', 0, 1, 0, 50, TRUE, 'staticpages');
91 $c->add('fs_search', NULL, 'fieldset', 0, 2, NULL, 0, true, 'staticpages');
92 $c->add('includesearch', $_SP_DEFAULT['include_search'], 'select', 0, 2, 0, 10, true, 'staticpages');
93 $c->add('includesearchcenterblocks',$_SP_DEFAULT['include_search_centerblocks'],'select', 0, 2, 0, 20, TRUE, 'staticpages');
94 $c->add('includesearchphp',$_SP_DEFAULT['include_search_PHP'],'select', 0, 2, 0, 30, TRUE, 'staticpages');