1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* **************************************************************************** |
4
|
|
|
* marquee - MODULE FOR XOOPS |
5
|
|
|
* Copyright (c) Hervé Thouzard (http://www.herve-thouzard.com) |
6
|
|
|
* |
7
|
|
|
* You may not change or alter any portion of this comment or credits |
8
|
|
|
* of supporting developers from this source code or any supporting source code |
9
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
10
|
|
|
* This program is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
13
|
|
|
* |
14
|
|
|
* @copyright Hervé Thouzard (http://www.herve-thouzard.com) |
15
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
16
|
|
|
* @package marquee |
17
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com) |
18
|
|
|
* |
19
|
|
|
* Version : $Id: |
20
|
|
|
* **************************************************************************** |
21
|
|
|
* |
22
|
|
|
* @param int $currentoption |
23
|
|
|
* @param string $breadcrumb |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
|
|
|
|
27
|
|
|
|
28
|
|
|
function marquee_adminmenu($currentoption = 0, $breadcrumb = '') |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
///* include_once XOOPS_ROOT_PATH.'/modules/marquee/include/functions.php'; |
|
|
|
|
31
|
|
|
// |
32
|
|
|
// /* Nice buttons styles */ |
33
|
|
|
// echo " |
34
|
|
|
// <style type='text/css'> |
35
|
|
|
// #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; } |
36
|
|
|
// #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/marquee/assets/images/bg.png') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; } |
37
|
|
|
// #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; } |
38
|
|
|
// #buttonbar li { display:inline; margin:0; padding:0; } |
39
|
|
|
// #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/marquee/assets/images/left_both.png') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; } |
40
|
|
|
// #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/marquee/assets/images/right_both.png') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; } |
41
|
|
|
// /* Commented Backslash Hack hides rule from IE5-Mac \*/ |
42
|
|
|
// #buttonbar a span {float:none;} |
43
|
|
|
// /* End IE5-Mac hack */ |
44
|
|
|
// #buttonbar a:hover span { color:#333; } |
45
|
|
|
// #buttonbar #current a { background-position:0 -150px; border-width:0; } |
46
|
|
|
// #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; } |
47
|
|
|
// #buttonbar a:hover { background-position:0% -150px; } |
48
|
|
|
// #buttonbar a:hover span { background-position:100% -150px; } |
49
|
|
|
// </style> |
50
|
|
|
// "; |
51
|
|
|
// global $xoopsModule, $xoopsConfig; |
|
|
|
|
52
|
|
|
// |
53
|
|
|
// $tblColors = array('','','','',''); |
|
|
|
|
54
|
|
|
// if ($currentoption >= 0) { |
|
|
|
|
55
|
|
|
// $tblColors[$currentoption] = 'current'; |
|
|
|
|
56
|
|
|
// } |
57
|
|
|
// |
58
|
|
|
// if (file_exists(XOOPS_ROOT_PATH . '/modules/marquee/language/' . $xoopsConfig['language'] . '/modinfo.php')) { |
|
|
|
|
59
|
|
|
// include_once XOOPS_ROOT_PATH. '/modules/marquee/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
|
|
|
|
60
|
|
|
// } else { |
|
|
|
|
61
|
|
|
// include_once XOOPS_ROOT_PATH . '/modules/marquee/language/english/modinfo.php'; |
62
|
|
|
// } |
63
|
|
|
// |
64
|
|
|
// echo "<div id='buttontop'>"; |
65
|
|
|
// echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>"; |
|
|
|
|
66
|
|
|
// echo "<td style=\"width: 60%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&op=showmod&mod=".$xoopsModule->getVar('mid')."\">" . _AM_MARQUEE_GENERALSET . "</a></td>"; |
67
|
|
|
// echo "<td style=\"width: 40%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $xoopsModule->name() . " " . _AM_MARQUEE_MODULEADMIN . "</b> " . $breadcrumb . "</td>"; |
68
|
|
|
// echo "</tr></table>"; |
69
|
|
|
// echo "</div>"; |
70
|
|
|
// |
71
|
|
|
// echo "<div id='buttonbar'>"; |
72
|
|
|
// echo "<ul>"; |
73
|
|
|
// echo "<li id='" . $tblColors[0] . "'><a href=\"index.php\"\"><span>"._MI_MARQUEE_MENU_01 ."</span></a></li>\n"; |
74
|
|
|
// echo "</ul></div>"; |
75
|
|
|
// echo "<br /><br /><pre> </pre><pre> </pre><br />";*/ |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Returns the files in a folder according to a pattern |
80
|
|
|
* |
81
|
|
|
* Some hosts have disabled the Php glob() function, that's why this function exists |
82
|
|
|
* |
83
|
|
|
* @package Marquee |
84
|
|
|
* @author Hervé Thouzard (http://www.herve-thouzard.com) |
85
|
|
|
* @copyright (c) Hervé Thouzard |
86
|
|
|
* |
87
|
|
|
* @param string $folder Folder where you want to grab files from (terminated with a slash) |
88
|
|
|
* @param string $pattern Pattern used to filter files |
89
|
|
|
* |
90
|
|
|
* @return array Files that match the pattern in the selected folder |
|
|
|
|
91
|
|
|
*/ |
92
|
|
|
function myglob($folder = '', $pattern = 'php') |
93
|
|
|
{ |
94
|
|
|
$result = array(); |
95
|
|
|
try { |
96
|
|
|
if (!($dir = @opendir($folder))) { |
97
|
|
|
throw new \RuntimeException('Error, impossible to open the folder ' . $folder); |
98
|
|
|
} |
99
|
|
|
while (($file = readdir($dir)) !== false) { |
100
|
|
|
if (!is_dir($file)) { |
101
|
|
|
$ext = basename($file); |
102
|
|
|
$ext = explode('.', $ext); |
103
|
|
|
$extension = strtolower($ext[count($ext) - 1]); |
104
|
|
|
if ($extension === $pattern) { |
105
|
|
|
$result[] = $file; |
106
|
|
|
} |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
closedir($dir); |
110
|
|
|
return $result; |
111
|
|
|
} catch (Exception $e) { |
112
|
|
|
echo 'Caught exception: ', $e->getMessage(), "\n", '<br/>'; |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.