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 The XOOPS Project http://sourceforge.net/projects/xoops/ |
16
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
17
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com/) |
18
|
|
|
* @version $Id: functions.php 12290 2014-02-07 11:05:17Z beckmi $ |
19
|
|
|
*/ |
20
|
|
|
function oledrion_adminMenu($currentoption = 0, $breadcrumb = '') |
|
|
|
|
21
|
|
|
{ |
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
|
|
|
/** |
37
|
|
|
* Internal function |
38
|
|
|
*/ |
39
|
|
|
function oledrion_get_config_handler() |
40
|
|
|
{ |
41
|
|
|
$config_handler = null; |
|
|
|
|
42
|
|
|
$config_handler = xoops_gethandler('config'); |
43
|
|
|
if (!is_object($config_handler)) { |
44
|
|
|
trigger_error("Error, unable to get and handler on the Config object"); |
45
|
|
|
exit; |
|
|
|
|
46
|
|
|
} else { |
47
|
|
|
return $config_handler; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Returns a module option |
54
|
|
|
* |
55
|
|
|
* @param string $option_name The module's option |
|
|
|
|
56
|
|
|
* @return object The requested module's option |
57
|
|
|
*/ |
58
|
|
|
function oledrion_get_module_option($optionName = '') |
59
|
|
|
{ |
60
|
|
|
$ret = null; |
61
|
|
|
$tbl_options = array(); |
|
|
|
|
62
|
|
|
$mid = oledrion_get_mid(); |
63
|
|
|
$config_handler = oledrion_get_config_handler(); |
64
|
|
|
$critere = new CriteriaCompo(); |
65
|
|
|
$critere->add(new Criteria('conf_modid', $mid, '=')); |
66
|
|
|
$critere->add(new Criteria('conf_name', $optionName, '=')); |
67
|
|
|
$tbl_options = $config_handler->getConfigs($critere, false, false); |
68
|
|
|
if (count($tbl_options) > 0) { |
69
|
|
|
$option = $tbl_options[0]; |
70
|
|
|
$ret = $option; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
return $ret; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Set a module's option |
78
|
|
|
*/ |
79
|
|
|
function oledrion_set_module_option($optionName = '', $optionValue = '') |
|
|
|
|
80
|
|
|
{ |
81
|
|
|
$config_handler = oledrion_get_config_handler(); |
82
|
|
|
$option = oledrion_get_module_option($optionName, true); |
|
|
|
|
83
|
|
|
$option->setVar('conf_value', $optionValue); |
84
|
|
|
$retval = $config_handler->insertConfig($option, true); |
85
|
|
|
|
86
|
|
|
return $retval; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Affichage du pied de page de l'administration |
91
|
|
|
* |
92
|
|
|
* @return string La chaine à afficher |
|
|
|
|
93
|
|
|
*/ |
94
|
|
|
function show_footer() |
95
|
|
|
{ |
96
|
|
|
// echo "<br /><br /><div align='center'><a href='http://www.herve-thouzard.com/' target='_blank'><img src='../assets/images/instantzero.gif'></a></div>"; |
97
|
|
|
} |
98
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.