1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
You may not change or alter any portion of this comment or credits |
4
|
|
|
of supporting developers from this source code or any supporting source code |
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* oledrion |
14
|
|
|
* |
15
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
16
|
|
|
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
17
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com/) |
18
|
|
|
* @param int $currentoption |
19
|
|
|
* @param string $breadcrumb |
20
|
|
|
*/ |
21
|
|
|
function oledrion_adminMenu($currentoption = 0, $breadcrumb = '') |
|
|
|
|
22
|
|
|
{ |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Internal function |
27
|
|
|
*/ |
28
|
|
|
function oledrion_get_mid() |
29
|
|
|
{ |
30
|
|
|
global $xoopsModule; |
31
|
|
|
|
32
|
|
|
return $xoopsModule->getVar('mid'); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Internal function |
37
|
|
|
*/ |
38
|
|
|
function oledrion_get_configHandler() |
39
|
|
|
{ |
40
|
|
|
$configHandler = null; |
|
|
|
|
41
|
|
|
$configHandler = xoops_getHandler('config'); |
42
|
|
|
if (!is_object($configHandler)) { |
43
|
|
|
trigger_error('Error, unable to get and handler on the Config object'); |
44
|
|
|
exit; |
|
|
|
|
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
return $configHandler; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Returns a module option |
52
|
|
|
* |
53
|
|
|
* @param string $optionName The module's option |
54
|
|
|
* @return \XoopsConfigOption The requested module's option |
55
|
|
|
*/ |
56
|
|
|
function oledrion_get_module_option($optionName = '') |
57
|
|
|
{ |
58
|
|
|
$ret = null; |
59
|
|
|
$tbl_options = []; |
|
|
|
|
60
|
|
|
$mid = oledrion_get_mid(); |
61
|
|
|
$configHandler = oledrion_get_configHandler(); |
62
|
|
|
$critere = new \CriteriaCompo(); |
63
|
|
|
$critere->add(new \Criteria('conf_modid', $mid, '=')); |
64
|
|
|
$critere->add(new \Criteria('conf_name', $optionName, '=')); |
65
|
|
|
$tbl_options = $configHandler->getConfigs($critere, false, false); |
66
|
|
|
if (count($tbl_options) > 0) { |
67
|
|
|
$option = $tbl_options[0]; |
68
|
|
|
$ret = $option; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
return $ret; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Set a module's option |
76
|
|
|
* @param string $optionName |
77
|
|
|
* @param string $optionValue |
78
|
|
|
* @return bool |
79
|
|
|
*/ |
80
|
|
|
function oledrion_set_module_option($optionName = '', $optionValue = '') |
81
|
|
|
{ |
82
|
|
|
$configHandler = oledrion_get_configHandler(); |
83
|
|
|
$option = oledrion_get_module_option($optionName, true); |
|
|
|
|
84
|
|
|
$option->setVar('conf_value', $optionValue); |
85
|
|
|
$retval = $configHandler->insertConfig($option, true); |
86
|
|
|
|
87
|
|
|
return $retval; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Affichage du pied de page de l'administration |
92
|
|
|
* |
93
|
|
|
* @return string La chaine à afficher |
94
|
|
|
*/ |
95
|
|
|
function show_footer() |
96
|
|
|
{ |
97
|
|
|
// echo "<br><br><div align='center'><a href='http://www.herve-thouzard.com/' target='_blank'><img src='../assets/images/instantzero.gif'></a></div>"; |
98
|
|
|
} |
99
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.