1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Adminer Module based on Ghost Module |
4
|
|
|
* |
5
|
|
|
* You may not change or alter any portion of this comment or credits |
6
|
|
|
* of supporting developers from this source code or any supporting source code |
7
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
8
|
|
|
* This program is distributed in the hope that it will be useful, |
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
* |
12
|
|
|
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ |
13
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
14
|
|
|
* @package Adminer Module |
15
|
|
|
* @since 2.3.0 |
16
|
|
|
* @author Kris <http://www.xoofoo.org> |
17
|
|
|
* @version $Id $ |
18
|
|
|
**/ |
19
|
|
|
// connect xoops database |
20
|
|
|
include_once __DIR__ . '/admin_header.php'; |
21
|
|
|
|
22
|
|
View Code Duplication |
if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
23
|
|
|
exit(_NOPERM); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @return AdminerCustomization |
28
|
|
|
*/ |
29
|
|
|
function adminer_object() |
|
|
|
|
30
|
|
|
{ |
31
|
|
|
// required to run any plugin |
32
|
|
|
include_once dirname(__DIR__) . '/include/plugins/plugin.php'; |
33
|
|
|
// include_once dirname(__DIR__) . "/include/plugins/plugin.php"; |
34
|
|
|
include_once dirname(__DIR__) . '/include/plugins/frames.php'; |
35
|
|
|
|
36
|
|
|
// autoloader |
37
|
|
|
// foreach (glob("plugins/*.php") as $filename) { |
38
|
|
|
// include_once "./$filename"; |
39
|
|
|
// } |
40
|
|
|
|
41
|
|
|
$plugins = array( |
42
|
|
|
// specify enabled plugins here |
43
|
|
|
// new AdminerDumpXml, |
44
|
|
|
// new AdminerTinymce, |
45
|
|
|
// new AdminerFileUpload("data/"), |
46
|
|
|
// new AdminerSlugify, |
47
|
|
|
// new AdminerTranslation, |
48
|
|
|
// new AdminerForeignSystem, |
49
|
|
|
new AdminerFrames |
50
|
|
|
); |
51
|
|
|
|
52
|
|
|
// It is possible to combine customization and plugins: |
53
|
|
|
/** |
54
|
|
|
* Class AdminerCustomization |
55
|
|
|
*/ |
56
|
|
|
class AdminerCustomization extends AdminerPlugin |
|
|
|
|
57
|
|
|
{ |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
return new AdminerCustomization($plugins); |
61
|
|
|
|
62
|
|
|
// return new AdminerPlugin($plugins); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
// include original Adminer or Adminer Editor |
66
|
|
|
include_once dirname(__DIR__) . '/include/adminer.php'; |
67
|
|
|
|
This check looks for functions that have already been defined in other files.
Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the
@ignore
annotation.See also the PhpDoc documentation for @ignore.