1
|
|
|
<?php |
2
|
|
|
//------------------------------------------------------------------------- |
3
|
|
|
// OVIDENTIA http://www.ovidentia.org |
4
|
|
|
// Ovidentia is free software; you can redistribute it and/or modify |
5
|
|
|
// it under the terms of the GNU General Public License as published by |
6
|
|
|
// the Free Software Foundation; either version 2, or (at your option) |
7
|
|
|
// any later version. |
8
|
|
|
// |
9
|
|
|
// This program is distributed in the hope that it will be useful, but |
10
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of |
11
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
12
|
|
|
// See the GNU General Public License for more details. |
13
|
|
|
// |
14
|
|
|
// You should have received a copy of the GNU General Public License |
15
|
|
|
// along with this program; if not, write to the Free Software |
16
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
17
|
|
|
// USA. |
18
|
|
|
//------------------------------------------------------------------------- |
19
|
|
|
/** |
20
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL) |
21
|
|
|
* |
22
|
|
|
* @copyright Copyright (c) 2019 by CAPWELTON ({@link http://www.capwelton.com}) |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
use Capwelton\LibOrm\MySql\ORMMySqlBackend; |
|
|
|
|
26
|
|
|
|
27
|
|
|
|
28
|
|
|
require_once dirname(__FILE__). '/functions.php'; |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
function LibApp_upgrade($sVersionBase, $sVersionIni) |
|
|
|
|
32
|
|
|
{ |
33
|
|
|
$addon = bab_getAddonInfosInstance('libapp'); |
34
|
|
|
|
35
|
|
|
$addon->unregisterFunctionality('App'); |
36
|
|
|
$functionnalities = new bab_functionalities(); |
37
|
|
|
$functionnalities->registerNamespace('App',"Capwelton\LibApp\Func_App",$addon->getPhpPath().'Func_App.php'); |
|
|
|
|
38
|
|
|
|
39
|
|
|
$addon->addEventListener('bab_eventBeforePageCreated', 'libapp_onBeforePageCreated', 'init.php', -10); |
40
|
|
|
$App = app_App(); |
41
|
|
|
|
42
|
|
|
$babDB = bab_getDB(); |
43
|
|
|
|
44
|
|
|
bab_functionality::get('LibOrm')->initMysql(); |
|
|
|
|
45
|
|
|
$backend = new ORMMySqlBackend($babDB); |
46
|
|
|
|
47
|
|
|
$sql = $backend->setToSql($App->LinkSet()); |
48
|
|
|
|
49
|
|
|
$sql .= $backend->setToSql($App->LogSet()); |
50
|
|
|
|
51
|
|
|
$sql .= $backend->setToSql($App->NotificationSet()); |
52
|
|
|
|
53
|
|
|
$sql .= $backend->setToSql($App->SSESet()); |
54
|
|
|
|
55
|
|
|
$sql .= $backend->setToSql($App->CustomFieldSet()); |
56
|
|
|
|
57
|
|
|
$sql .= $backend->setToSql($App->CustomSectionSet()); |
58
|
|
|
|
59
|
|
|
$sql .= $backend->setToSql($App->CustomContainerSet()); |
60
|
|
|
|
61
|
|
|
require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
62
|
|
|
$synchronize = new bab_synchronizeSql(); |
63
|
|
|
|
64
|
|
|
$synchronize->fromSqlString($sql); |
65
|
|
|
|
66
|
|
|
// LibApp_InitializePortlets(); |
67
|
|
|
|
68
|
|
|
return true; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
function libApp_onBeforePageCreated(bab_eventBeforePageCreated $event) |
|
|
|
|
72
|
|
|
{ |
73
|
|
|
if (bab_isAjaxRequest()) { |
74
|
|
|
return; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
$idx = bab_rp('idx', null); |
78
|
|
|
if ($idx === 'file.open') { |
79
|
|
|
return; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
$babBody = bab_getBody(); |
83
|
|
|
$addon = bab_getAddonInfosInstance('libapp'); |
84
|
|
|
$babBody->addStyleSheet($addon->getStylePath() . '/styles.css'); |
85
|
|
|
$babBody->addJavascriptFile($addon->getTemplatePath() . 'libapp.js'); |
86
|
|
|
|
87
|
|
|
$App = app_App(); |
88
|
|
|
if($App && $App->isSSEEnabled()){ |
89
|
|
|
$babBody->addJavascriptFile($addon->getTemplatePath() . 'notification.js'); |
90
|
|
|
if(bab_isUserLogged()){ |
91
|
|
|
$babBody->babecho('<script>window.libapp={"sseServerUrl": "'.$App->Controller()->SSE()->server()->url().'"}</script>'); |
|
|
|
|
92
|
|
|
$babBody->addJavascriptFile($addon->getTemplatePath().'sse.js'); |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
|
98
|
|
|
function LibApp_onDeleteAddon() |
99
|
|
|
{ |
100
|
|
|
$addon = bab_getAddonInfosInstance('libapp'); |
101
|
|
|
|
102
|
|
|
$addon->unregisterFunctionality('App'); |
103
|
|
|
|
104
|
|
|
return true; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
function LibApp_InitializePortlets() |
108
|
|
|
{ |
109
|
|
|
@bab_functionality::includefile('PortletBackend'); |
|
|
|
|
110
|
|
|
|
111
|
|
|
if (class_exists('Func_PortletBackend')) { |
112
|
|
|
$addon = bab_getAddonInfosInstance('libapp'); |
113
|
|
|
$addonPhpPath = $addon->getPhpPath(); |
114
|
|
|
|
115
|
|
|
require_once $GLOBALS['babInstallPath'].'utilit/functionalityincl.php'; |
116
|
|
|
require_once dirname(__FILE__) . '/Portlet/Func_PortletBackend_App.php'; |
117
|
|
|
$functionalities = new bab_functionalities(); |
118
|
|
|
$functionalities->registerClass('Func_PortletBackend_App', $addonPhpPath . '/Portlet/Func_PortletBackend_App.php'); |
119
|
|
|
} |
120
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths