Skip to content

Commit 44139b4

Browse files
committed
cosmetics
1 parent 8258c19 commit 44139b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4855
-4401
lines changed

gwiki/admin/about.php

+28-30
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
11
<?php
22
/**
3-
* admin/about.php
4-
*
5-
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
6-
* @license gwiki/docs/license.txt GNU General Public License (GPL)
7-
* @since 1.0
8-
* @author Richard Griffith <[email protected]>
9-
* @package gwiki
10-
* @version $Id$
11-
*/
3+
* admin/about.php
4+
*
5+
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
6+
* @license gwiki/docs/license.txt GNU General Public License (GPL)
7+
* @since 1.0
8+
* @author Richard Griffith <[email protected]>
9+
* @package gwiki
10+
* @version $Id$
11+
*/
1212

13-
include 'header.php';
13+
include __DIR__ . '/header.php';
1414
if ($xoop25plus) {
1515
echo $moduleAdmin->addNavigation('about.php');
16-
echo $moduleAdmin->renderabout('',false);
17-
}
18-
else { // !$xoop25plus
19-
$module_handler =& xoops_gethandler('module');
20-
$module_info =& $module_handler->get($xoopsModule->getVar("mid"));
21-
22-
adminmenu(2);
16+
echo $moduleAdmin->renderabout('', false);
17+
} else { // !$xoop25plus
18+
$module_handler =& xoops_gethandler('module');
19+
$module_info =& $module_handler->get($xoopsModule->getVar("mid"));
2320

24-
adminTableStart(_AD_GW_ABOUT_ABOUT,1);
25-
echo '<tr><td width="100%" ><center>';
26-
echo '<br /><b>'. $module_info->getInfo('name') . ''.$module_info->getInfo('version').' '.$module_info->getInfo('module_status').'</b>';
27-
echo '<br />'.$module_info->getInfo('description');
28-
echo '<br /><br /><b>'. _AD_GW_ABOUT_AUTHOR . '</b>';
29-
echo '<br />'. $module_info->getInfo('author');
30-
echo '<br /><br /><b>'. _AD_GW_ABOUT_CREDITS . '</b>';
31-
echo '<br />'. $module_info->getInfo('credits');
32-
echo '<br /><br /><b>'. _AD_GW_ABOUT_LICENSE .' </b><a href="http://'.$module_info->getInfo('license_url').'">'.$module_info->getInfo('license').'</a>';
33-
echo '<br /><br /><center>Brought to you by <a href="http://'.$module_info->getInfo('module_website_url').'" target="_blank">'.$module_info->getInfo('module_website_name').'</a>';
34-
echo '<br /><br /></center></td></tr>';
35-
adminTableEnd(NULL);
21+
adminmenu(2);
3622

23+
adminTableStart(_AD_GW_ABOUT_ABOUT, 1);
24+
echo '<tr><td width="100%" ><div style="text-align: center;">';
25+
echo '<br /><b>' . $module_info->getInfo('name') . '' . $module_info->getInfo('version') . ' ' . $module_info->getInfo('module_status') . '</b></div>';
26+
echo '<br />' . $module_info->getInfo('description');
27+
echo '<br /><br /><b>' . _AD_GW_ABOUT_AUTHOR . '</b>';
28+
echo '<br />' . $module_info->getInfo('author');
29+
echo '<br /><br /><b>' . _AD_GW_ABOUT_CREDITS . '</b>';
30+
echo '<br />' . $module_info->getInfo('credits');
31+
echo '<br /><br /><b>' . _AD_GW_ABOUT_LICENSE . ' </b><a href="http://' . $module_info->getInfo('license_url') . '">' . $module_info->getInfo('license') . '</a>';
32+
echo '<br /><br /><div style="text-align: center;">Brought to you by <a href="http://' . $module_info->getInfo('module_website_url') . '" target="_blank">' . $module_info->getInfo('module_website_name') . '</a>';
33+
echo '<br /><br /></div></td></tr>';
34+
adminTableEnd(null);
3735
}
3836

39-
include 'footer.php';
37+
include __DIR__ . '/footer.php';

gwiki/admin/attachments.php

+137-127
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,180 @@
11
<?php
22
/**
3-
* admin/attachments.php - file attachment review tool
4-
*
5-
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
6-
* @license gwiki/docs/license.txt GNU General Public License (GPL)
7-
* @since 1.0
8-
* @author Richard Griffith <[email protected]>
9-
* @package gwiki
10-
* @version $Id$
11-
*/
12-
include 'header.php';
13-
//include_once '../include/functions.php';
14-
15-
if(!$xoop25plus) adminmenu(6);
16-
else echo $moduleAdmin->addNavigation('attachments.php');
3+
* admin/attachments.php - file attachment review tool
4+
*
5+
* @copyright Copyright © 2013 geekwright, LLC. All rights reserved.
6+
* @license gwiki/docs/license.txt GNU General Public License (GPL)
7+
* @since 1.0
8+
* @author Richard Griffith <[email protected]>
9+
* @package gwiki
10+
* @version $Id$
11+
*/
12+
include __DIR__ . '/header.php';
13+
//include_once dirname(__DIR__) . '/include/functions.php';
14+
15+
if (!$xoop25plus) {
16+
adminmenu(6);
17+
} else {
18+
echo $moduleAdmin->addNavigation('attachments.php');
19+
}
1720

1821
/**
1922
* @param $string
2023
* @param bool $trim
2124
*
2225
* @return string
2326
*/
24-
function cleaner($string,$trim=true) {
25-
// $string=stripcslashes($string);
26-
$string=html_entity_decode($string);
27-
$string=strip_tags($string);
28-
if($trim) $string=trim($string);
29-
$string=stripslashes($string);
27+
function cleaner($string, $trim = true)
28+
{
29+
// $string=stripcslashes($string);
30+
$string = html_entity_decode($string);
31+
$string = strip_tags($string);
32+
if ($trim) {
33+
$string = trim($string);
34+
}
35+
$string = stripslashes($string);
3036

3137
return $string;
3238
}
3339

3440
function showAttachments()
3541
{
36-
global $xoopsDB, $wikiPage;
37-
$dir = basename( dirname ( dirname( __FILE__ ) ) ) ;
38-
/*
39-
gwiki_page_files
40-
file_id int(10) NOT NULL AUTO_INCREMENT,
41-
keyword varchar(128) NOT NULL DEFAULT '',
42-
file_name varchar(128) NOT NULL DEFAULT '',
43-
file_path varchar(255) NOT NULL DEFAULT '',
44-
file_type varchar(128) NOT NULL DEFAULT '',
45-
file_icon varchar(64) NOT NULL DEFAULT '',
46-
file_size int(10) NOT NULL DEFAULT '0',
47-
file_upload_date int(10) NOT NULL DEFAULT '0',
48-
file_description text,
49-
file_uid int(10) NOT NULL DEFAULT '0',
50-
*/
51-
$kw='';$fn='';$ty='';$ds='';
52-
if(!empty($_GET['kw'])) $kw=cleaner($_GET['kw']);
53-
if(!empty($_GET['fn'])) $fn=cleaner($_GET['fn']);
54-
if(!empty($_GET['ty'])) $ty=cleaner($_GET['ty']);
55-
if(!empty($_GET['ds'])) $ds=cleaner($_GET['ds']);
56-
57-
$q_kw='%'.$wikiPage->escapeForDB($kw).'%';
58-
$q_fn='%'.$wikiPage->escapeForDB($fn).'%';
59-
$q_ty='%'.$wikiPage->escapeForDB($ty).'%';
60-
$q_ds='%'.$wikiPage->escapeForDB($ds).'%';
61-
62-
$likeclause='';
63-
if(!empty($kw)) $likeclause .= (empty($likeclause)?'':' and ') . " keyword like '{$q_kw}' ";
64-
if(!empty($fn)) $likeclause .= (empty($likeclause)?'':' and ') . " file_name like '{$q_fn}' ";
65-
if(!empty($ty)) $likeclause .= (empty($likeclause)?'':' and ') . " file_type like '{$q_ty}' ";
66-
if(!empty($ds)) $likeclause .= (empty($likeclause)?'':' and ') . " file_description like '{$q_ds}' ";
67-
//$whereclause=(empty($likeclause)?'':' where '.$likeclause);
68-
$whereclause=(empty($likeclause)?'':" where {$likeclause}");
69-
70-
echo <<<EOT
42+
global $xoopsDB, $wikiPage;
43+
$dir = basename(dirname(__DIR__));
44+
/*
45+
gwiki_page_files
46+
file_id int(10) NOT NULL AUTO_INCREMENT,
47+
keyword varchar(128) NOT NULL DEFAULT '',
48+
file_name varchar(128) NOT NULL DEFAULT '',
49+
file_path varchar(255) NOT NULL DEFAULT '',
50+
file_type varchar(128) NOT NULL DEFAULT '',
51+
file_icon varchar(64) NOT NULL DEFAULT '',
52+
file_size int(10) NOT NULL DEFAULT '0',
53+
file_upload_date int(10) NOT NULL DEFAULT '0',
54+
file_description text,
55+
file_uid int(10) NOT NULL DEFAULT '0',
56+
*/
57+
$kw = '';
58+
$fn = '';
59+
$ty = '';
60+
$ds = '';
61+
if (!empty($_GET['kw'])) {
62+
$kw = cleaner($_GET['kw']);
63+
}
64+
if (!empty($_GET['fn'])) {
65+
$fn = cleaner($_GET['fn']);
66+
}
67+
if (!empty($_GET['ty'])) {
68+
$ty = cleaner($_GET['ty']);
69+
}
70+
if (!empty($_GET['ds'])) {
71+
$ds = cleaner($_GET['ds']);
72+
}
73+
74+
$q_kw = '%' . $wikiPage->escapeForDB($kw) . '%';
75+
$q_fn = '%' . $wikiPage->escapeForDB($fn) . '%';
76+
$q_ty = '%' . $wikiPage->escapeForDB($ty) . '%';
77+
$q_ds = '%' . $wikiPage->escapeForDB($ds) . '%';
78+
79+
$likeclause = '';
80+
if (!empty($kw)) {
81+
$likeclause .= (empty($likeclause) ? '' : ' and ') . " keyword like '{$q_kw}' ";
82+
}
83+
if (!empty($fn)) {
84+
$likeclause .= (empty($likeclause) ? '' : ' and ') . " file_name like '{$q_fn}' ";
85+
}
86+
if (!empty($ty)) {
87+
$likeclause .= (empty($likeclause) ? '' : ' and ') . " file_type like '{$q_ty}' ";
88+
}
89+
if (!empty($ds)) {
90+
$likeclause .= (empty($likeclause) ? '' : ' and ') . " file_description like '{$q_ds}' ";
91+
}
92+
//$whereclause=(empty($likeclause)?'':' where '.$likeclause);
93+
$whereclause = (empty($likeclause) ? '' : " where {$likeclause}");
94+
95+
echo <<<EOT
7196
<style>
7297
div.pagination.default {display:inline;}
7398
form {display:inline;}
7499
</style>
75100
EOT;
76-
$total=0;
77-
$limit=10;
78-
$start=0;
79-
if(!empty($_GET['start'])) $start=intval($_GET['start']);
101+
$total = 0;
102+
$limit = 10;
103+
$start = 0;
104+
if (!empty($_GET['start'])) {
105+
$start = (int)($_GET['start']);
106+
}
80107

81-
$sql="SELECT count(*) FROM ".$xoopsDB->prefix('gwiki_page_files') . $whereclause;
108+
$sql = "SELECT count(*) FROM " . $xoopsDB->prefix('gwiki_page_files') . $whereclause;
82109
$result = $xoopsDB->query($sql);
83110
if ($result) {
84-
$myrow=$xoopsDB->fetchRow($result);
85-
$total=$myrow[0];
111+
$myrow = $xoopsDB->fetchRow($result);
112+
$total = $myrow[0];
86113
}
87114

88-
adminTableStart(_AD_GWIKI_FILES_LIST,9);
89-
echo '<tr><form method="get">'.
90-
'<td><input type="text" name="kw" size="10" value="'.$kw.'"></td>'.
91-
'<td><input type="text" name="fn" size="10" value="'.$fn.'"></td>'.
92-
'<td>&nbsp;</td>'.
93-
'<td><input type="text" name="ty" size="10" value="'.$ty.'"></td>'.
94-
'<td>&nbsp;</td>'.
95-
'<td>&nbsp;</td>'.
96-
'<td>&nbsp;</td>'.
97-
'<td><input type="text" name="ds" size="10" value="'.$ds.'"></td>'.
98-
'<td><input type="submit" value="'._AD_GWIKI_FILES_FILTER.'"></td>'.
99-
'</form></tr>';
100-
echo '<tr class="head">'.
101-
'<th>'._AD_GWIKI_FILES_KEYWORD.'</th>'.
102-
'<th>'._AD_GWIKI_FILES_NAME.'</th>'.
103-
'<th>'._AD_GWIKI_FILES_PATH.'</th>'.
104-
'<th>'._AD_GWIKI_FILES_TYPE.'</th>'.
105-
'<th>'._AD_GWIKI_FILES_ICON.'</th>'.
106-
'<th>'._AD_GWIKI_FILES_SIZE.'</th>'.
107-
'<th>'._AD_GWIKI_FILES_DATE.'</th>'.
108-
'<th>'._AD_GWIKI_FILES_DESC.'</th>'.
109-
'<th>'._AD_GWIKI_FILES_UID.'</th>'.
110-
'</tr>';
111-
112-
$sql = 'SELECT * FROM '.$xoopsDB->prefix('gwiki_page_files');
115+
adminTableStart(_AD_GWIKI_FILES_LIST, 9);
116+
echo '<tr><form method="get">' . '<td><input type="text" name="kw" size="10" value="' . $kw . '"></td>' . '<td><input type="text" name="fn" size="10" value="' . $fn . '"></td>' . '<td>&nbsp;</td>' . '<td><input type="text" name="ty" size="10" value="' . $ty . '"></td>' . '<td>&nbsp;</td>' . '<td>&nbsp;</td>' . '<td>&nbsp;</td>' . '<td><input type="text" name="ds" size="10" value="' . $ds . '"></td>' . '<td><input type="submit" value="' . _AD_GWIKI_FILES_FILTER . '"></td>' . '</form></tr>';
117+
echo '<tr class="head">' . '<th>' . _AD_GWIKI_FILES_KEYWORD . '</th>' . '<th>' . _AD_GWIKI_FILES_NAME . '</th>' . '<th>' . _AD_GWIKI_FILES_PATH . '</th>' . '<th>' . _AD_GWIKI_FILES_TYPE . '</th>' . '<th>' . _AD_GWIKI_FILES_ICON . '</th>' . '<th>' . _AD_GWIKI_FILES_SIZE . '</th>' . '<th>' . _AD_GWIKI_FILES_DATE . '</th>' . '<th>' . _AD_GWIKI_FILES_DESC . '</th>' . '<th>' . _AD_GWIKI_FILES_UID . '</th>' . '</tr>';
118+
119+
$sql = 'SELECT * FROM ' . $xoopsDB->prefix('gwiki_page_files');
113120
$sql .= $whereclause;
114121
$sql .= ' ORDER BY file_upload_date DESC ';
115122

116123
$result = $xoopsDB->query($sql, $limit, $start);
117124

118-
for ($i = 0; $i < $xoopsDB->getRowsNum($result); $i++) {
125+
for ($i = 0; $i < $xoopsDB->getRowsNum($result); ++$i) {
119126
$row = $xoopsDB->fetchArray($result);
120-
/*
121-
gwiki_page_files
122-
file_id int(10) NOT NULL AUTO_INCREMENT,
123-
keyword varchar(128) NOT NULL DEFAULT '',
124-
file_name varchar(128) NOT NULL DEFAULT '',
125-
file_path varchar(255) NOT NULL DEFAULT '',
126-
file_type varchar(128) NOT NULL DEFAULT '',
127-
file_icon varchar(64) NOT NULL DEFAULT '',
128-
file_size int(10) NOT NULL DEFAULT '0',
129-
file_upload_date int(10) NOT NULL DEFAULT '0',
130-
file_description text,
131-
file_uid int(10) NOT NULL DEFAULT '0',
132-
*/
133-
echo '<tr class="'.(($i % 2)?"even":"odd").'"><td><a href="../edit.php?page='.$row['keyword'].'">'.htmlspecialchars($row['keyword'], ENT_QUOTES).'</a></td>' .
134-
'<td>'.htmlspecialchars($row['file_name'], ENT_QUOTES).'</td>'.
135-
'<td><a href="'.XOOPS_URL.'/uploads/'.$dir.'/'.$row['file_path'].'">'.htmlspecialchars($row['file_path'], ENT_QUOTES).'</a></td>'.
136-
'<td>'.htmlspecialchars($row['file_type'], ENT_QUOTES).'</td>'.
137-
'<td><img src="'.XOOPS_URL.'/modules/'.$dir.'/assets/icons/16px/'.$row['file_icon'].'.png" alt="'.$row['file_icon'].'" title="'.$row['file_icon'].'" /></td>'.
138-
'<td>'.htmlspecialchars($row['file_size'], ENT_QUOTES).'</td>'.
139-
'<td>'.date('Y-m-d',$row['file_upload_date']).'</td>'.
140-
'<td>'.htmlspecialchars($row['file_description'], ENT_QUOTES).'</td>'.
141-
'<td>'.$wikiPage->getUserName($row['file_uid']).'</td>'.
142-
'</tr>';
127+
/*
128+
gwiki_page_files
129+
file_id int(10) NOT NULL AUTO_INCREMENT,
130+
keyword varchar(128) NOT NULL DEFAULT '',
131+
file_name varchar(128) NOT NULL DEFAULT '',
132+
file_path varchar(255) NOT NULL DEFAULT '',
133+
file_type varchar(128) NOT NULL DEFAULT '',
134+
file_icon varchar(64) NOT NULL DEFAULT '',
135+
file_size int(10) NOT NULL DEFAULT '0',
136+
file_upload_date int(10) NOT NULL DEFAULT '0',
137+
file_description text,
138+
file_uid int(10) NOT NULL DEFAULT '0',
139+
*/
140+
echo '<tr class="' . (($i % 2) ? "even" : "odd") . '"><td><a href="../edit.php?page=' . $row['keyword'] . '">' . htmlspecialchars($row['keyword'], ENT_QUOTES) . '</a></td>' . '<td>' . htmlspecialchars($row['file_name'], ENT_QUOTES) . '</td>' . '<td><a href="' . XOOPS_URL . '/uploads/' . $dir . '/' . $row['file_path'] . '">' . htmlspecialchars($row['file_path'], ENT_QUOTES) . '</a></td>' . '<td>' . htmlspecialchars($row['file_type'], ENT_QUOTES) . '</td>' . '<td><img src="' . XOOPS_URL . '/modules/' . $dir . '/assets/icons/16px/' . $row['file_icon'] . '.png" alt="' . $row['file_icon'] . '" title="' . $row['file_icon'] . '" /></td>' . '<td>' . htmlspecialchars($row['file_size'], ENT_QUOTES) . '</td>' . '<td>' . date('Y-m-d', $row['file_upload_date']) . '</td>' . '<td>' . htmlspecialchars($row['file_description'], ENT_QUOTES) . '</td>' . '<td>' . $wikiPage->getUserName($row['file_uid']) . '</td>' . '</tr>';
143141
}
144-
if ($i == 0) {
145-
echo '<tr class="odd"><td colspan="9">'._AD_GWIKI_FILES_EMPTY.'</td></tr>';
142+
if ($i === 0) {
143+
echo '<tr class="odd"><td colspan="9">' . _AD_GWIKI_FILES_EMPTY . '</td></tr>';
146144
}
147145

148146
// set up pagenav
149-
$endarray=array();
150-
$pager='';
147+
$endarray = array();
148+
$pager = '';
151149
if ($total > $limit) {
152-
include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
153-
$likenav='';
154-
if(!empty($kw)) $likenav .= (empty($likenav)?'':'&') . "kw={$kw}";
155-
if(!empty($fn)) $likenav .= (empty($likenav)?'':'&') . "fn={$fn}";
156-
if(!empty($ty)) $likenav .= (empty($likenav)?'':'&') . "ty={$ty}";
157-
if(!empty($ds)) $likenav .= (empty($likenav)?'':'&') . "ds={$ds}";
158-
$nav = new xoopsPageNav($total,$limit,$start,'start',$likenav);
159-
if(intval($total/$limit) < 5) $pager=$nav->renderNav();
160-
else $pager= _AD_GWIKI_PAGENAV . $nav->renderSelect(false);
150+
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
151+
$likenav = '';
152+
if (!empty($kw)) {
153+
$likenav .= (empty($likenav) ? '' : '&') . "kw={$kw}";
154+
}
155+
if (!empty($fn)) {
156+
$likenav .= (empty($likenav) ? '' : '&') . "fn={$fn}";
157+
}
158+
if (!empty($ty)) {
159+
$likenav .= (empty($likenav) ? '' : '&') . "ty={$ty}";
160+
}
161+
if (!empty($ds)) {
162+
$likenav .= (empty($likenav) ? '' : '&') . "ds={$ds}";
163+
}
164+
$nav = new xoopsPageNav($total, $limit, $start, 'start', $likenav);
165+
if ((int)($total / $limit) < 5) {
166+
$pager = $nav->renderNav();
167+
} else {
168+
$pager = _AD_GWIKI_PAGENAV . $nav->renderSelect(false);
169+
}
170+
}
171+
if (!empty($pager)) {
172+
$endarray['!PREFORMATTED!'] = $pager;
161173
}
162-
if(!empty($pager)) $endarray['!PREFORMATTED!']=$pager;
163174

164175
adminTableEnd($endarray);
165-
166176
}
167177

168178
showAttachments();
169179

170-
include 'footer.php';
180+
include __DIR__ . '/footer.php';

0 commit comments

Comments
 (0)