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
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
14
|
|
|
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
15
|
|
|
* @author XOOPS Development Team |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
use Xmf\Module\Admin; |
19
|
|
|
use Xmf\Request; |
20
|
|
|
use Xmf\Yaml; |
21
|
|
|
use XoopsModules\Extgallery\{ |
22
|
|
|
Common, |
23
|
|
|
Common\TestdataButtons, |
24
|
|
|
Helper, |
25
|
|
|
Utility |
26
|
|
|
}; |
27
|
|
|
|
28
|
|
|
/** @var Admin $adminObject */ |
29
|
|
|
/** @var Helper $helper */ |
30
|
|
|
/** @var Utility $utility */ |
31
|
|
|
|
32
|
|
|
require_once __DIR__ . '/admin_header.php'; |
33
|
|
|
// Display Admin header |
34
|
|
|
xoops_cp_header(); |
35
|
|
|
$adminObject = Admin::getInstance(); |
36
|
|
|
|
37
|
|
|
//check or upload folders |
38
|
|
|
$configurator = new Common\Configurator(); |
39
|
|
|
foreach (array_keys($configurator->uploadFolders) as $i) { |
40
|
|
|
$utility::createFolder($configurator->uploadFolders[$i]); |
41
|
|
|
$adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
// DNPROSSI - In PHP 5.3.0 "JPG Support" was renamed to "JPEG Support". |
45
|
|
|
// This leads to the following error: "Undefined index: JPG Support in |
46
|
|
|
// Fixed with version compare |
47
|
|
|
if (PHP_VERSION_ID < 50300) { |
48
|
|
|
$jpegsupport = 'JPG Support'; |
49
|
|
|
} else { |
50
|
|
|
$jpegsupport = 'JPEG Support'; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
$adminObject->addInfoBox(_AM_EXTGALLERY_SERVER_CONF); |
54
|
|
|
if ('gd' === $helper->getConfig('graphic_lib')) { |
55
|
|
|
$gd = gd_info(); |
56
|
|
|
// GD graphic lib |
57
|
|
|
$test1 = ('' == $gd['GD Version']) ? '<span style="color:#FF0000;"><b>KO</b></span>' : $gd['GD Version']; |
58
|
|
|
($gd['GIF Read Support'] && $gd['GIF Create Support']) ? $test2 = '<span style="color:#33CC33;"><b>OK</b></span>' : $test2 = '<span style="color:#FF0000;"><b>KO</b></span>'; |
59
|
|
|
$gd['' . $jpegsupport . ''] ? $test3 = '<span style="color:#33CC33;"><b>OK</b></span>' : $test3 = '<span style="color:#FF0000;"><b>KO</b></span>'; |
60
|
|
|
$gd['PNG Support'] ? $test4 = '<span style="color:#33CC33;"><b>OK</b></span>' : $test4 = '<span style="color:#FF0000;"><b>KO</b></span>'; |
61
|
|
|
|
62
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_GRAPH_GD_LIB_VERSION . ' ' . $test1)); |
63
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_GIF_SUPPORT . ' ' . $test2)); |
64
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_JPEG_SUPPORT . ' ' . $test3)); |
65
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_PNG_SUPPORT . ' ' . $test4)); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
if ('imagick' === $helper->getConfig('graphic_lib')) { |
69
|
|
|
// ImageMagick graphic lib |
70
|
|
|
$cmd = $helper->getConfig('graphic_lib_path') . 'convert -version'; |
71
|
|
|
exec($cmd, $data, $error); |
72
|
|
|
$test = $data[0] ?? '<span style="color:#FF0000;"><b>KO</b></span>'; |
73
|
|
|
$imSupport = imageMagickSupportType(); |
74
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_GRAPH_IM_LIB_VERSION . ' ' . $test)); |
75
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_GIF_SUPPORT . ' ' . $imSupport['GIF Support'])); |
76
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_JPEG_SUPPORT . ' ' . $imSupport['JPG Support'])); |
77
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_PNG_SUPPORT . ' ' . $imSupport['PNG Support'])); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_UPLOAD_MAX_FILESIZE . get_cfg_var('upload_max_filesize'))); |
|
|
|
|
81
|
|
|
$adminObject->addInfoBoxLine(sprintf(_AM_EXTGALLERY_POST_MAX_SIZE . get_cfg_var('post_max_size'))); |
|
|
|
|
82
|
|
|
|
83
|
|
|
$adminObject->displayNavigation(basename(__FILE__)); |
84
|
|
|
|
85
|
|
|
//check for latest release |
86
|
|
|
//$newRelease = $utility::checkVerModule($helper); |
87
|
|
|
//if (!empty($newRelease)) { |
88
|
|
|
// $adminObject->addItemButton($newRelease[0], $newRelease[1], 'download', 'style="color : Red"'); |
89
|
|
|
//} |
90
|
|
|
|
91
|
|
|
//------------- Test Data Buttons ---------------------------- |
92
|
|
|
if ($helper->getConfig('displaySampleButton')) { |
93
|
|
|
TestdataButtons::loadButtonConfig($adminObject); |
94
|
|
|
$adminObject->displayButton('left', ''); |
95
|
|
|
} |
96
|
|
|
$op = Request::getString('op', 0, 'GET'); |
97
|
|
|
switch ($op) { |
98
|
|
|
case 'hide_buttons': |
99
|
|
|
TestdataButtons::hideButtons(); |
100
|
|
|
break; |
101
|
|
|
case 'show_buttons': |
102
|
|
|
TestdataButtons::showButtons(); |
103
|
|
|
break; |
104
|
|
|
} |
105
|
|
|
//------------- End Test Data Buttons ---------------------------- |
106
|
|
|
|
107
|
|
|
|
108
|
|
|
$adminObject->displayIndex(); |
109
|
|
|
echo $utility::getServerStats(); |
110
|
|
|
|
111
|
|
|
//codeDump(__FILE__); |
112
|
|
|
require_once __DIR__ . '/admin_footer.php'; |
113
|
|
|
|