-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_install.php
More file actions
47 lines (39 loc) · 1.4 KB
/
_install.php
File metadata and controls
47 lines (39 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of Menu, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Benoît Grelier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) { return; }
$version = $core->plugins->moduleInfo('menu','version');
if (version_compare($core->getVersion('menu'),$version,'>=')) {
return;
}
/* Database schema
-------------------------------------------------------- */
$s = new dbStruct($core->con,$core->prefix);
$s->menu
->link_id ('bigint', 0, false)
->blog_id ('varchar', 32, false)
->link_href ('varchar', 255, false)
->link_title ('varchar', 255, false)
->link_desc ('varchar', 255, true)
->link_lang ('varchar', 5, true)
->link_class ('varchar', 32, true)
->link_position ('integer', 0, false, 0)
->link_level ('smallint', 0, false, 0)
->link_auto ('smallint', 0, false, 0)
->link_limit ('smallint', 0, false, 0)
->primary('pk_menu','link_id')
;
$s->menu->index('idx_menu_blog_id','btree','blog_id');
$s->menu->reference('fk_menu_blog','blog_id','blog','blog_id','cascade','cascade');
# Schema installation
$si = new dbStruct($core->con,$core->prefix);
$changes = $si->synchronize($s);
$core->setVersion('menu',$version);
return true;