You can subscribe to this list here.
| 2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
| 2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
| 2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
| 2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
| 2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <be...@us...> - 2013-09-25 01:50:14
|
Revision: 12093
http://sourceforge.net/p/xoops/svn/12093
Author: beckmi
Date: 2013-09-25 01:50:08 +0000 (Wed, 25 Sep 2013)
Log Message:
-----------
Making the buttons slightly lighter
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html 2013-09-24 21:27:49 UTC (rev 12092)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html 2013-09-25 01:50:08 UTC (rev 12093)
@@ -1,37 +1,41 @@
<style type="text/css">
.button_green {
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5cc52) );
- background:-moz-linear-gradient( center top, #b8e356 5%, #a5cc52 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5cc52');
- background-color:#b8e356;
- -webkit-border-radius:2px;
- -moz-border-radius:2px;
- border-radius:2px;
- text-indent:0;
- border:1px solid #83c41a;
- display:inline-block;
- color:inherit;
- font-family:inherit;
- font-size:12px;
- font-weight:bold;
- font-style:normal;
- height:20px;
- line-height:20px;
- width:20px;
- text-decoration:none;
- text-align:center;
- text-shadow:1px 1px 0px #86ae47;
- margin: 2px;
+ -moz-box-shadow:inset 0px 1px 0px 0px #d9fbbe;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #d9fbbe;
+ box-shadow:inset 0px 1px 0px 0px #d9fbbe;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #d9fbbe), color-stop(1, #d9fbbe) );
+ background:-moz-linear-gradient( center top, #a5cc52 5%, #d9fbbe 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d9fbbe', endColorstr='#b8e356');
+ background-color:#d9fbbe;
+ -webkit-border-radius:2px;
+ -moz-border-radius:2px;
+ border-radius:2px;
+ text-indent:0;
+ border:1px solid #83c41a;
+ display:inline-block;
+ color:inherit;
+ font-family:inherit;
+ font-size:12px;
+ font-weight:bold;
+ font-style:normal;
+ height:20px;
+ line-height:20px;
+ width:18px;
+ text-decoration:none;
+ text-align:center;
+ text-shadow:1px 1px 0px #d9fbbe;
+ margin: 2px 0px;
}
.button_green:hover {
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #a5cc52), color-stop(1, #b8e356) );
- background:-moz-linear-gradient( center top, #a5cc52 5%, #b8e356 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5cc52', endColorstr='#b8e356');
- background-color:#a5cc52;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5cc52) );
+ background:-moz-linear-gradient( center top, #b8e356 5%, #a5cc52 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5cc52');
+ background-color:#86ae47;
}.button_green:active {
position:relative;
top:1px;
}
+
.button_grey {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
@@ -50,11 +54,11 @@
font-style:normal;
height:20px;
line-height:20px;
- width:20px;
+ width:18px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #ffffff;
- margin: 2px;
+ margin: 2px 0px;
}
.button_grey:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
|
|
From: <luc...@us...> - 2013-09-24 21:27:52
|
Revision: 12092
http://sourceforge.net/p/xoops/svn/12092
Author: luciorota
Date: 2013-09-24 21:27:49 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
letterschoice css styled without images
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html 2013-09-24 17:49:00 UTC (rev 12091)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html 2013-09-24 21:27:49 UTC (rev 12092)
@@ -1,36 +1,70 @@
<style type="text/css">
-button {
+.button_green {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5cc52) );
+ background:-moz-linear-gradient( center top, #b8e356 5%, #a5cc52 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5cc52');
+ background-color:#b8e356;
+ -webkit-border-radius:2px;
-moz-border-radius:2px;
- -webkit-border-radius:2px;
- -moz-box-shadow:2px 2px 2px rgba(0,0,0,0.4);
- -webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.4);
-
- border:1px solid;
-
- background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(255,255,255,1)),to(rgba(185,185,185,1)));
- background:-moz-linear-gradient(top,rgba(255,255,255,1),rgba(185,185,185,1));
-
- padding:2px 4px;
- marging: 2px 2px;
+ border-radius:2px;
+ text-indent:0;
+ border:1px solid #83c41a;
+ display:inline-block;
+ color:inherit;
+ font-family:inherit;
+ font-size:12px;
+ font-weight:bold;
+ font-style:normal;
+ height:20px;
+ line-height:20px;
+ width:20px;
+ text-decoration:none;
+ text-align:center;
+ text-shadow:1px 1px 0px #86ae47;
+ margin: 2px;
}
-button.green {
- background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(93,169,17,1)),to(rgba(202,246,160,1)));
- background:-moz-linear-gradient(top,rgba(93,169,17,1),rgba(202,246,160,1));
+.button_green:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #a5cc52), color-stop(1, #b8e356) );
+ background:-moz-linear-gradient( center top, #a5cc52 5%, #b8e356 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5cc52', endColorstr='#b8e356');
+ background-color:#a5cc52;
+}.button_green:active {
+ position:relative;
+ top:1px;
}
-
-button:hover {
- background:rgba(240,240,240,1);
+.button_grey {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
+ background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
+ background-color:#ededed;
+ -webkit-border-radius:2px;
+ -moz-border-radius:2px;
+ border-radius:2px;
+ text-indent:0;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:inherit;
+ font-family:inherit;
+ font-size:12px;
+ font-weight:bold;
+ font-style:normal;
+ height:20px;
+ line-height:20px;
+ width:20px;
+ text-decoration:none;
+ text-align:center;
+ text-shadow:1px 1px 0px #ffffff;
+ margin: 2px;
}
-
-button:active, button:focus {
- background:-webkit-gradient(linear,0% 100%,0% 0%,from(rgba(255,255,255,1)),to(rgba(185,185,185,1)));
- background:-moz-linear-gradient(bottom,rgba(255,255,255,1),rgba(185,185,185,1));
+.button_grey:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
+ background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
+ background-color:#dfdfdf;
+}.button_grey:active {
+ position:relative;
+ top:1px;
}
-
-button:disabled {
- color:rgba(0,0,0,0.4);
- background:rgba(220,220,220,1);
-}
</style>
<{$smarty.const._MD_WFDOWNLOADS_BROWSETOTOPIC}>
<br />
@@ -38,10 +72,10 @@
<{assign var="alphabetcount" value=$alphabet|@count}>
<{foreach name=letters item=letter from=$alphabet}>
<{if ($letter.count > 0)}>
-<button class='button green' type='button' style='cursor:pointer' onclick='window.location="<{$letter.url}>"' title='<{$letter.count}>'><{$letter.letter}></button>
+<a class='button_green' href='<{$letter.url}>' title='<{$letter.count}>'><{$letter.letter}></a>
<{else}>
-<button class='button' type='button' disabled='disabled'><{$letter.letter}></button>
+<span class='button_grey'><{$letter.letter}></span>
<{/if}>
-<{if ($smarty.foreach.letters.iteration == (round($alphabetcount/2))+1)}></div><div><{else}> <{/if}>
+<{if ($smarty.foreach.letters.iteration == (round($alphabetcount/2))+1)}></div><div><{else}><{/if}>
<{/foreach}>
</div>
|
|
From: <luc...@us...> - 2013-09-24 17:49:03
|
Revision: 12091
http://sourceforge.net/p/xoops/svn/12091
Author: luciorota
Date: 2013-09-24 17:49:00 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
- templatized letterschoice
- fixed errors (mamba/luciorota)
- added some directories checks
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/trunk/wfdownloads/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -21,6 +21,11 @@
$currentFile = basename(__FILE__);
include_once dirname(__FILE__) . '/admin_header.php';
+if (!is_dir($wfdownloads->getConfig('uploaddir'))) {
+ redirect_header('index.php', 4, _AM_WFDOWNLOADS_ERROR_UPLOADDIRNOTEXISTS);
+ exit();
+}
+
$op = WfdownloadsRequest::getString('op', 'downloads.list');
switch ($op) {
case "download.edit" :
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -21,6 +21,19 @@
$currentFile = basename(__FILE__);
include_once dirname(__FILE__) . '/admin_header.php';
+if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('mainimagedir'))) {
+ redirect_header('index.php', 4, _AM_WFDOWNLOADS_ERROR_MAINIMAGEDIRNOTEXISTS);
+ exit();
+}
+if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('screenshots'))) {
+ redirect_header('index.php', 4, _AM_WFDOWNLOADS_ERROR_SCREENSHOTSDIRNOTEXISTS);
+ exit();
+}
+if (!is_dir(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage'))) {
+ redirect_header('index.php', 4, _AM_WFDOWNLOADS_ERROR_CATIMAGEDIRNOTEXISTS);
+ exit();
+}
+
$op = WfdownloadsRequest::getString('op', 'images.list');
switch ($op) {
case "image.upload" :
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -193,8 +193,8 @@
//---------------------------
- echo $indexAdmin->addNavigation('index.php');
- echo $indexAdmin->renderIndex();
- echo wfdownloads_serverStats();
+echo $indexAdmin->addNavigation('index.php');
+echo $indexAdmin->renderIndex();
+echo wfdownloads_serverStats();
include 'admin_footer.php';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-24 17:49:00 UTC (rev 12091)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-22)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-24)</u></b>
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -327,29 +327,35 @@
$criteria = $wfdownloads->getHandler('download')->getActiveCriteria();
$criteria->setGroupby('UPPER(LEFT(title,1))');
$countsByLetters = $wfdownloads->getHandler('download')->getCounts($criteria);
-
- $letterChoice = _MD_WFDOWNLOADS_BROWSETOTOPIC . "<br />";
- $letterChoice .= "[ ";
- //$alphabet = array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
+ // Fill alphabet array
$alphabet = wfdownloads_alphabet();
- $num = count($alphabet) - 1;
- $counter = 0;
-
+ $alphabet_array = array();
foreach($alphabet as $letter) {
+ $letter_array = array();
if(isset($countsByLetters[$letter])) {
- $letterChoice .= "<a href='" . XOOPS_URL . "/modules/wfdownloads/viewcat.php?list=$letter' title='" . $countsByLetters[$letter] . "'>$letter</a>";
+ $letter_array['letter'] = $letter;
+ $letter_array['count'] = $countsByLetters[$letter];
+ $letter_array['url'] = "" . XOOPS_URL . "/modules/wfdownloads/viewcat.php?list={$letter}";
} else {
- $letterChoice .= "$letter";
+ $letter_array['letter'] = $letter;
+ $letter_array['count'] = 0;
+ $letter_array['url'] = "";
}
- if ($counter == round($num / 2))
- $letterChoice .= " ]<br />[ ";
- elseif ($counter != $num)
- $letterChoice .= " | ";
- $counter++;
+ $alphabet_array[$letter] = $letter_array;
+ unset($letter_array);
}
-
- $letterChoice .= " ]";
- return $letterChoice;
+ // Render output
+ if ( !isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme']) ) {
+ include_once $GLOBALS['xoops']->path( "/class/theme.php" );
+ $GLOBALS['xoTheme'] = new xos_opal_Theme();
+ }
+ require_once $GLOBALS['xoops']->path('class/template.php');
+ $letterschoiceTpl = new XoopsTpl();
+ $letterschoiceTpl->caching = false; // Disable cache
+ $letterschoiceTpl->assign('alphabet', $alphabet_array);
+ $html = $letterschoiceTpl->fetch("db:" . $wfdownloads->getModule()->dirname() . "_common_letterschoice.html");
+ unset($letterschoiceTpl);
+ return $html;
}
@@ -891,13 +897,12 @@
/**
- * getTotalItems()
+ * wfdownloads_getTotalDownloads()
*
- * @param integer $sel_id
- * @param integer $get_child
+ * @param integer OR array of integer $cids
* @return the total number of items in items table that are accociated with a given table $table id
**/
-function wfdownloads_getTotalDownloads($cid = 0, $cids = array())
+function wfdownloads_getTotalDownloads($cids = 0)
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
@@ -907,12 +912,13 @@
$expiredCriteria = new CriteriaCompo(new Criteria('expired', 0));
$expiredCriteria->add(new Criteria('expired', time(), '>='), 'OR');
$criteria->add($expiredCriteria);
- if ($cid > 0) {
+ if (is_array($cids) && count($cids) > 0) {
+ $criteria->add(new Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'));
+ } elseif ($cid > 0) {
$criteria->add(new Criteria('cid', (int)$cid));
+ } else {
+ return false;
}
- if (count($cids) > 0) {
- $criteria->add(new Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'));
- }
$criteria->setGroupby('cid');
$info['published'] = $wfdownloads->getHandler('download')->getMaxPublishdate($criteria);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -31,7 +31,7 @@
}
function xoops_module_install_wfdownloads(&$xoopsModule) {
// NOP
-}
+ return true;}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/search.inc.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/search.inc.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/search.inc.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -170,6 +170,7 @@
unset($queryCriteria);
// Make an array of the downloads based on the lid, and a separate list of all the lids found (the separate list is used in the case of an AND operator to derive an intersection of the hits across all search terms -- and it is used to determine the start and limit points of the main results array for an OR query)
+ $downloads_lids = array();
foreach($tempDownloads as $tempDownload) {
$downloads[(int)$tempDownload->getVar('lid')] = $tempDownload;
$downloads_lids[] = (int)$tempDownload->getVar('lid');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/index.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/index.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -86,7 +86,7 @@
$chcount = 0;
$countin = 0;
-$listings = wfdownloads_getTotalDownloads(0, $allowedDownCategoriesIds);
+$listings = wfdownloads_getTotalDownloads($allowedDownCategoriesIds);
// Get total amount of categories
$total_cat = count($allowedDownCategoriesIds);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -640,6 +640,10 @@
define('_AM_WFDOWNLOADS_DIRNOTCREATED','The directory can not be created');
define('_AM_WFDOWNLOADS_PERMSET','The permission has been set');
define('_AM_WFDOWNLOADS_PERMNOTSET','The permission can not be set');
+define('_AM_WFDOWNLOADS_ERROR_UPLOADDIRNOTEXISTS',"Warning: the upload directory does not exists");
+define('_AM_WFDOWNLOADS_ERROR_MAINIMAGEDIRNOTEXISTS',"Warning: the main images directory does not exists");
+define('_AM_WFDOWNLOADS_ERROR_SCREENSHOTSDIRNOTEXISTS',"Warning: the categories images upload directory does not exists");
+define('_AM_WFDOWNLOADS_ERROR_CATIMAGEDIRNOTEXISTS',"Warning: the upload directory does not exists");
// admin/downloads.php
define('_AM_WFDOWNLOADS_SEARCH','Search');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -153,7 +153,7 @@
define('_MI_WFDOWNLOADS_PLATFORM','Enter platforms');
define('_MI_WFDOWNLOADS_SUBCATS','Subcategories');
define('_MI_WFDOWNLOADS_VERSIONTYPES','Version status');
-define('_MI_WFDOWNLOADS_LICENSE','Enter license');
+define('_MI_WFDOWNLOADS_LICENSE','Enter licenses');
define('_MI_WFDOWNLOADS_LIMITS','Enter file limitations');
define('_MI_WFDOWNLOADS_MAXSHOTS','[screenshots] Select max number of screenshots');
define('_MI_WFDOWNLOADS_MAXSHOTSDSC','Sets the maximum number of allowed screenshot uploads.');
@@ -182,7 +182,7 @@
// Description of each config items
define('_MI_WFDOWNLOADS_PLATFORMDSC','List of platforms to enter.<br />Separate with |<br />IMPORTANT: Do not change this once the site is live, add new to the end of the list!');
define('_MI_WFDOWNLOADS_SUBCATSDSC','Select "' . _YES . '" to display subcategories. Selecting "' . _NO . '" will hide sub-categories from the listings.');
-define('_MI_WFDOWNLOADS_LICENSEDSC','List of platforms to enter.<br />Separate with |');
+define('_MI_WFDOWNLOADS_LICENSEDSC','List of licenses to enter.<br />Separate with |<br />IMPORTANT: Do not change this once the site is live, add new to the end of the list!');
// Text for notifications
define('_MI_WFDOWNLOADS_GLOBAL_NOTIFY','Global');
@@ -353,14 +353,14 @@
define("_MI_WFDOWNLOADS_MAINIMGDIRDSC","Path relative to Xoops root path: "" . XOOPS_ROOT_PATH . "/".<br />No trailing slash.");
define("_MI_WFDOWNLOADS_CATEGORYIMGDSC","Path relative to Xoops root path: "" . XOOPS_ROOT_PATH . "/".<br />No trailing slash.");
-define("_MI_WFDOWNLOADS_SHOWDISCLAIMERDSC","// in progress");
+define("_MI_WFDOWNLOADS_SHOWDISCLAIMERDSC","");
define("_MI_WFDOWNLOADS_DISCLAIMERDSC","HTML tags, smiley icons, XOOPS codes, images are enabled.");
-define("_MI_WFDOWNLOADS_SHOWDOWNDISCLDSC","// in progress");
+define("_MI_WFDOWNLOADS_SHOWDOWNDISCLDSC","");
define("_MI_WFDOWNLOADS_DOWNDISCLAIMERDSC","HTML tags, smiley icons, XOOPS codes, images are enabled.");
-define("_MI_WFDOWNLOADS_LIMITSDSC","// in progress");
-define("_MI_WFDOWNLOADS_VERSIONTYPESDSC","// in progress");
+define("_MI_WFDOWNLOADS_LIMITSDSC","List of limits to enter.<br />Separate with |<br />IMPORTANT: Do not change this once the site is live, add new to the end of the list!");
+define("_MI_WFDOWNLOADS_VERSIONTYPESDSC","List of version types to enter.<br />Separate with |<br />IMPORTANT: Do not change this once the site is live, add new to the end of the list!");
define("_MI_WFDOWNLOADS_REVIEW_ENABLE","[reviews] Enable Reviews system");
define("_MI_WFDOWNLOADS_REVIEW_ENABLEDSC","If enabled, Reviews system (submit and show reviews) is enabled in backend.");
@@ -370,3 +370,18 @@
define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLE","[broken reports] Enable Broken reports system");
define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLEDSC","If enabled, Broken reports system is enabled in backend.");
+
+define("_MI_WFDOWNLOADS_SUBMISSIONS_CONFIGS","File submission generals permissions");
+define("_MI_WFDOWNLOADS_SUBMISSIONS_CONFIGSDSC","");
+
+define("_MI_WFDOWNLOADS_SCREENSHOTS_CONFIGS","Screenshots preferences");
+define("_MI_WFDOWNLOADS_SCREENSHOTS_CONFIGSDSC","");
+
+define("_MI_WFDOWNLOADS_FILESUPLOADS_CONFIGS","Files preferences");
+define("_MI_WFDOWNLOADS_FILESUPLOADS_CONFIGSDSC","");
+
+define("_MI_WFDOWNLOADS_SCREENSHOTS_ESTRASYSTEMS","Extra systems preferences");
+define("_MI_WFDOWNLOADS_SCREENSHOTS_ESTRASYSTEMSDSC","");
+
+define("_MI_WFDOWNLOADS_VARIOUS_CONFIGS","Various preferences");
+define("_MI_WFDOWNLOADS_VARIOUS_CONFIGSDSC","");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -239,7 +239,7 @@
// Copyright
if ($wfdownloads->getConfig('copyright') == true) {
- $xoopsTpl->assign('lang_copyright', $download->getVar('title') . ' © ' . _MD_WFDOWNLOADS_COPYRIGHT . ' ' . date('Y'));
+ $xoopsTpl->assign('lang_copyright', $download->getVar('title') . ' © ' . _MD_WFDOWNLOADS_COPYRIGHT . ' ' . formatTimestamp(time(),'Y'));
}
$xoopsTpl->assign('down', $downloadInfo); // this definition is not removed for compatibility issues
$xoopsTpl->assign('download', $downloadInfo);
Added: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_letterschoice.html 2013-09-24 17:49:00 UTC (rev 12091)
@@ -0,0 +1,47 @@
+<style type="text/css">
+button {
+ -moz-border-radius:2px;
+ -webkit-border-radius:2px;
+ -moz-box-shadow:2px 2px 2px rgba(0,0,0,0.4);
+ -webkit-box-shadow:2px 2px 2px rgba(0,0,0,0.4);
+
+ border:1px solid;
+
+ background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(255,255,255,1)),to(rgba(185,185,185,1)));
+ background:-moz-linear-gradient(top,rgba(255,255,255,1),rgba(185,185,185,1));
+
+ padding:2px 4px;
+ marging: 2px 2px;
+}
+button.green {
+ background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(93,169,17,1)),to(rgba(202,246,160,1)));
+ background:-moz-linear-gradient(top,rgba(93,169,17,1),rgba(202,246,160,1));
+}
+
+button:hover {
+ background:rgba(240,240,240,1);
+}
+
+button:active, button:focus {
+ background:-webkit-gradient(linear,0% 100%,0% 0%,from(rgba(255,255,255,1)),to(rgba(185,185,185,1)));
+ background:-moz-linear-gradient(bottom,rgba(255,255,255,1),rgba(185,185,185,1));
+}
+
+button:disabled {
+ color:rgba(0,0,0,0.4);
+ background:rgba(220,220,220,1);
+}
+</style>
+<{$smarty.const._MD_WFDOWNLOADS_BROWSETOTOPIC}>
+<br />
+<div>
+<{assign var="alphabetcount" value=$alphabet|@count}>
+<{foreach name=letters item=letter from=$alphabet}>
+<{if ($letter.count > 0)}>
+<button class='button green' type='button' style='cursor:pointer' onclick='window.location="<{$letter.url}>"' title='<{$letter.count}>'><{$letter.letter}></button>
+<{else}>
+<button class='button' type='button' disabled='disabled'><{$letter.letter}></button>
+<{/if}>
+<{if ($smarty.foreach.letters.iteration == (round($alphabetcount/2))+1)}></div><div><{else}> <{/if}>
+<{/foreach}>
+</div>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -21,8 +21,9 @@
$currentFile = basename(__FILE__);
include 'header.php';
-$cid = WfdownloadsRequest::getInt('cid', 0, 'GET');
-$start = WfdownloadsRequest::getInt('start', 0, 'GET');
+$cid = WfdownloadsRequest::getInt('cid', 0);
+$start = WfdownloadsRequest::getInt('start', 0);
+//$list = WfdownloadsRequest::getString('list', null);
$orderby = isset($_GET['orderby']) ? convertorderbyin($_GET['orderby']) : $wfdownloads->getConfig('filexorder');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
@@ -113,16 +114,23 @@
foreach(array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
$breadcrumb->addLink($parentCategory->getVar('title'), 'viewcat.php?cid=' . $parentCategory->getVar('cid'));
}
-$breadcrumb->addLink($category->getVar('title'), '');
+if ($category->getVar('title') != '') {
+ $breadcrumb->addLink($category->getVar('title'), '');
+}
+if (isset($_GET['list'])) {
+ $breadcrumb->addLink($_GET['list'], '');
+}
$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
// Display Subcategories for selected Category
$allSubcategories = $categoriesTree->getFirstChild($cid);
+
if (is_array($allSubcategories) > 0 && !isset($_GET['list']) && !isset($_GET['selectdate'])) {
- $listings = wfdownloads_getTotalDownloads(0, $allowedDownCategoriesIds);
+ $listings = wfdownloads_getTotalDownloads($allowedDownCategoriesIds);
$scount = 1;
foreach($allSubcategories as $subcategory) {
+ $download_count = 0;
// Check if subcategory is allowed
if (!in_array($subcategory->getVar('cid'), $allowedDownCategoriesIds)) {
continue;
@@ -147,13 +155,13 @@
// ----- end subcat images -----
if (count($subsubCategories) > 0) {
- foreach (array_keys($subsubCategories) as $k) {
- if (in_array($subsubCategories[$k]->getVar('cid'), $allowedDownCategoriesIds)) {
- $download_count += isset($listings['count'][$subsubCategories[$k]->getVar('cid')]) ? $listings['count'][$subsubCategories[$k]->getVar('cid')] : 0;
+ foreach ($subsubCategories as $subsubCategory) {
+ if (in_array($subsubCategory->getVar('cid'), $allowedDownCategoriesIds)) {
+ $download_count += isset($listings['count'][$subsubCategory->getVar('cid')]) ? $listings['count'][$subsubCategory->getVar('cid')] : 0;
$infercategories[] = array(
- 'cid' => $subsubCategories[$k]->getVar('cid'),
- 'id' => $subsubCategories[$k]->getVar('cid'), // this definition is not removed for compatibility issues
- 'title' => $subsubCategories[$k]->getVar('title'),
+ 'cid' => $subsubCategory->getVar('cid'),
+ 'id' => $subsubCategory->getVar('cid'), // this definition is not removed for compatibility issues
+ 'title' => $subsubCategory->getVar('title'),
'image' => $imageURL,
'image_URL' => $imageURL,
'count' => $download_count, // this definition is not removed for compatibility issues
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-24 14:11:46 UTC (rev 12090)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-24 17:49:00 UTC (rev 12091)
@@ -47,9 +47,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-09-21';
-$modversion['release_date'] = '2013/09/21';
-$modversion['releasedate'] = '2013-09-21';
+$modversion['date'] = '2013-09-24';
+$modversion['release_date'] = '2013/09/24';
+$modversion['releasedate'] = '2013-09-24';
$modversion['status'] = 'BETA 1';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
@@ -318,6 +318,9 @@
$i++;
$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_common_breadcrumb.html';
$modversion['templates'][$i]['description'] = '';
+$i++;
+$modversion['templates'][$i]['file'] = $modversion['dirname'] . '_common_letterschoice.html';
+$modversion['templates'][$i]['description'] = '';
//Module config setting
@@ -381,8 +384,8 @@
$modversion['config'][] = array(
'name' => 'submissions_configs',
- 'title' => '',
- 'description' => '',
+ 'title' => '_MI_WFDOWNLOADS_SUBMISSIONS_CONFIGS',
+ 'description' => '_MI_WFDOWNLOADS_SUBMISSIONS_CONFIGSDSC',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'head');
@@ -452,8 +455,8 @@
$modversion['config'][] = array(
'name' => 'screenshots_configs',
- 'title' => '',
- 'description' => '',
+ 'title' => '_MI_WFDOWNLOADS_SCREENSHOTS_CONFIGS',
+ 'description' => '_MI_WFDOWNLOADS_SCREENSHOTS_CONFIGSDSC',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'head');
@@ -533,8 +536,8 @@
$modversion['config'][] = array(
'name' => 'filesuploads_configs',
- 'title' => '',
- 'description' => '',
+ 'title' => '_MI_WFDOWNLOADS_FILESUPLOADS_CONFIGS',
+ 'description' => '_MI_WFDOWNLOADS_FILESUPLOADS_CONFIGSDSC',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'head');
@@ -605,8 +608,8 @@
$modversion['config'][] = array(
'name' => 'extrasystems_configs',
- 'title' => '',
- 'description' => '',
+ 'title' => '_MI_WFDOWNLOADS_SCREENSHOTS_ESTRASYSTEMS',
+ 'description' => '_MI_WFDOWNLOADS_SCREENSHOTS_ESTRASYSTEMSDSC',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'head');
@@ -676,9 +679,9 @@
'default' => true);
$modversion['config'][] = array(
- 'name' => 'permissions_configs',
- 'title' => '',
- 'description' => '',
+ 'name' => 'various_configs',
+ 'title' => '_MI_WFDOWNLOADS_VARIOUS_CONFIGS',
+ 'description' => '_MI_WFDOWNLOADS_VARIOUS_CONFIGSDSC',
'formtype' => 'line_break',
'valuetype' => 'textbox',
'default' => 'head');
|
|
From: <rgr...@us...> - 2013-09-24 14:11:49
|
Revision: 12090
http://sourceforge.net/p/xoops/svn/12090
Author: rgriffith
Date: 2013-09-24 14:11:46 +0000 (Tue, 24 Sep 2013)
Log Message:
-----------
Code cleanup
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-23 14:04:50 UTC (rev 12089)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-24 14:11:46 UTC (rev 12090)
@@ -10,47 +10,68 @@
*/
/**
- * Backport of Xmf\FilterInput, using Daniel Morris's original
- * PHP INPUT FILTER for php4
+ * XoopsFilterInput is a class for filtering input from any data source
+ *
+ * Forked from the php input filter library by Daniel Morris
*
- * @class: XoopsFilterInput (PHP4 & PHP5, with comments)
- * @project: PHP Input Filter
- * @date: 10-05-2005
- * @version: 1.2.2_php4/php5
- * @author: Daniel Morris
- * @contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
- * @author Louis Landry <lou...@jo...>
- * @author Grégory Mage (Aka Mage)
- * @author trabis <lus...@gm...>
- * @author Richard Griffith <ri...@ge...>
- * @copyright: Daniel Morris
- * @email: da...@ro...
- * @license: GNU General Public License (GPL)
+ * Original Contributors: Gianpaolo Racca, Ghislain Picard,
+ * Marco Wandschneider, Chris Tobin and Andrew Eddie.
+ *
+ * @category XoopsFilterInput
+ * @package Xoops
+ * @author Daniel Morris <da...@ro...>
+ * @author Louis Landry <lou...@jo...>
+ * @author Grégory Mage (Aka Mage)
+ * @author trabis <lus...@gm...>
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright 2005 Daniel Morris
+ * @copyright 2005 - 2013 Open Source Matters, Inc. All rights reserved.
+ * @copyright 2011-2013 The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @version Release: 1.0
+ * @link http://xoops.org
+ * @since 2.5.7
*/
-class XoopsFilterInput {
- var $tagsArray; // default = empty array
- var $attrArray; // default = empty array
+class XoopsFilterInput
+{
+ protected $tagsArray; // default = empty array
+ protected $attrArray; // default = empty array
- var $tagsMethod; // default = 0
- var $attrMethod; // default = 0
+ protected $tagsMethod; // default = 0
+ protected $attrMethod; // default = 0
- var $xssAuto; // default = 1
- var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');
- var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
-
- /**
- * Constructor for XoopsFilterInput class. Only first parameter is required.
- * @access constructor
- * @param Array $tagsArray - list of user-defined tags
- * @param Array $attrArray - list of user-defined attributes
- * @param int $tagsMethod - 0= allow just user-defined, 1= allow all but user-defined
- * @param int $attrMethod - 0= allow just user-defined, 1= allow all but user-defined
- * @param int $xssAuto - 0= only auto clean essentials, 1= allow clean blacklisted tags/attr
+ protected $xssAuto; // default = 1
+ protected $tagBlacklist = array(
+ 'applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame',
+ 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer',
+ 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml'
+ );
+ // also will strip ALL event handlers
+ protected $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc');
+
+ /**
+ * Constructor
+ *
+ * @param Array $tagsArray - list of user-defined tags
+ * @param Array $attrArray - list of user-defined attributes
+ * @param int $tagsMethod - 0 = allow just user-defined, 1 = allow all but user-defined
+ * @param int $attrMethod - 0 = allow just user-defined, 1 = allow all but user-defined
+ * @param int $xssAuto - 0 = only auto clean essentials, 1 = allow clean blacklisted tags/attr
*/
- function XoopsFilterInput($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) {
+ public function __construct(
+ $tagsArray = array(),
+ $attrArray = array(),
+ $tagsMethod = 0,
+ $attrMethod = 0,
+ $xssAuto = 1
+ ) {
// make sure user defined arrays are in lowercase
- for ($i = 0; $i < count($tagsArray); $i++) $tagsArray[$i] = strtolower($tagsArray[$i]);
- for ($i = 0; $i < count($attrArray); $i++) $attrArray[$i] = strtolower($attrArray[$i]);
+ for ($i = 0; $i < count($tagsArray); $i++) {
+ $tagsArray[$i] = strtolower($tagsArray[$i]);
+ }
+ for ($i = 0; $i < count($attrArray); $i++) {
+ $attrArray[$i] = strtolower($attrArray[$i]);
+ }
// assign to member vars
$this->tagsArray = (array) $tagsArray;
$this->attrArray = (array) $attrArray;
@@ -58,25 +79,25 @@
$this->attrMethod = $attrMethod;
$this->xssAuto = $xssAuto;
}
-
+
/**
* Returns a reference to an input filter object, only creating it if it doesn't already exist.
*
* This method must be invoked as:
- * <pre> $filter = & XoopsFilterInput::getInstance();</pre>
+ * $filter = & XoopsFilterInput::getInstance();
*
* @param array $tagsArray list of user-defined tags
* @param array $attrArray list of user-defined attributes
* @param int $tagsMethod WhiteList method = 0, BlackList method = 1
* @param int $attrMethod WhiteList method = 0, BlackList method = 1
- * @param int $xssAuto Only auto clean essentials = 0,
- * Allow clean blacklisted tags/attr = 1
- *
+ * @param int $xssAuto Only auto clean essentials = 0,
+ * Allow clean blacklisted tags/attr = 1
+ *
* @return XoopsFilterInput object.
* @since 1.5
* @static
*/
- static function getInstance(
+ public static function getInstance(
$tagsArray = array(),
$attrArray = array(),
$tagsMethod = 0,
@@ -92,31 +113,39 @@
}
if (empty ($instances[$sig])) {
- $instances[$sig] = new XoopsFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
+ $classname = __CLASS__ ;
+ $instances[$sig] = new $classname ($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
}
return $instances[$sig];
}
- /**
- * Method to be called by another php script. Processes for XSS and specified bad code.
- * @access public
+ /**
+ * Method to be called by another php script. Processes for XSS and
+ * any specified bad code.
+ *
* @param Mixed $source - input string/array-of-string to be 'cleaned'
+ *
* @return String $source - 'cleaned' version of input parameter
*/
- function process($source) {
- // clean all elements in this array
+ public function process($source)
+ {
if (is_array($source)) {
- foreach($source as $key => $value)
+ // clean all elements in this array
+ foreach ($source as $key => $value) {
// filter element for XSS and other 'bad' code etc.
- if (is_string($value)) $source[$key] = $this->remove($this->decode($value));
+ if (is_string($value)) {
+ $source[$key] = $this->remove($this->decode($value));
+ }
+ }
return $source;
- // clean this string
- } else if (is_string($source)) {
- // filter source for XSS and other 'bad' code etc.
+ } elseif (is_string($source)) {
+ // clean this string
return $this->remove($this->decode($source));
- // return parameter as given
- } else return $source;
+ } else {
+ // return parameter as given
+ return $source;
+ }
}
/**
@@ -127,12 +156,25 @@
* @param string $type Return type for the variable (INT, FLOAT,
* BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING,
* ARRAY, PATH, NONE)
- *
+ *
* @return mixed 'Cleaned' version of input parameter
* @static
*/
- static function clean($source, $type = 'string')
+ public static function clean($source, $type = 'string')
{
+ static $filter = null;
+
+ // need an instance for methods, since this is supposed to be static
+ // we must instantiate the class - this will take defaults
+ if (!is_object($filter)) {
+ if (isset($this) && is_a($this, __CLASS__)) {
+ $filter =& $this;
+ } else {
+ $classname = __CLASS__ ;
+ $filter = $classname::getInstance();
+ }
+ }
+
// Handle the type constraint
switch (strtoupper($type)) {
case 'INT':
@@ -172,22 +214,10 @@
break;
case 'STRING':
- // Check for static usage and assign $filter the proper variable
- if (isset($this) && is_a($this, 'XoopsFilterInput')) {
- $filter =& $this;
- } else {
- $filter = XoopsFilterInput::getInstance();
- }
$result = (string) $filter->process($source);
break;
case 'ARRAY':
- // Check for static usage and assign $filter the proper variable
- if (isset($this) && is_a($this, 'XoopsFilterInput')) {
- $filter =& $this;
- } else {
- $filter = XoopsFilterInput::getInstance();
- }
$result = (array) $filter->process($source);
break;
@@ -202,12 +232,6 @@
break;
case 'WEBURL':
- // Check for static usage and assign $filter the proper variable
- if (isset($this) && is_a($this, 'XoopsFilterInput')) {
- $filter =& $this;
- } else {
- $filter = XoopsFilterInput::getInstance();
- }
$result = (string) $filter->process($source);
// allow only relative, http or https
$urlparts=parse_url($result);
@@ -223,12 +247,6 @@
break;
default:
- // Check for static usage and assign $filter the proper variable
- if (isset($this) && is_a($this, 'XoopsFilterInput')) {
- $filter =& $this;
- } else {
- $filter = XoopsFilterInput::getInstance();
- }
$result = $filter->process($source);
break;
}
@@ -236,44 +254,50 @@
return $result;
}
-
- /**
+ /**
* Internal method to iteratively remove all unwanted tags and attributes
- * @access protected
+ *
* @param String $source - input string to be 'cleaned'
+ *
* @return String $source - 'cleaned' version of input parameter
*/
- function remove($source) {
+ protected function remove($source)
+ {
$loopCounter=0;
// provides nested-tag protection
- while($source != $this->filterTags($source)) {
+ while ($source != $this->filterTags($source)) {
$source = $this->filterTags($source);
$loopCounter++;
}
+
return $source;
- }
-
- /**
+ }
+
+ /**
* Internal method to strip a string of certain tags
- * @access protected
+ *
* @param String $source - input string to be 'cleaned'
+ *
* @return String $source - 'cleaned' version of input parameter
*/
- function filterTags($source) {
+ protected function filterTags($source)
+ {
// filter pass setup
- $preTag = NULL;
+ $preTag = null;
$postTag = $source;
// find initial tag's position
$tagOpen_start = strpos($source, '<');
// interate through string until no tags left
- while($tagOpen_start !== FALSE) {
+ while ($tagOpen_start !== false) {
// process tag interatively
$preTag .= substr($postTag, 0, $tagOpen_start);
$postTag = substr($postTag, $tagOpen_start);
$fromTagOpen = substr($postTag, 1);
// end of tag
$tagOpen_end = strpos($fromTagOpen, '>');
- if ($tagOpen_end === false) break;
+ if ($tagOpen_end === false) {
+ break;
+ }
// next start of tag (for nested tag assessment)
$tagOpen_nested = strpos($fromTagOpen, '<');
if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {
@@ -281,52 +305,65 @@
$postTag = substr($postTag, ($tagOpen_nested+1));
$tagOpen_start = strpos($postTag, '<');
continue;
- }
+ }
$tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1);
$currentTag = substr($fromTagOpen, 0, $tagOpen_end);
$tagLength = strlen($currentTag);
if (!$tagOpen_end) {
$preTag .= $postTag;
- $tagOpen_start = strpos($postTag, '<');
+ $tagOpen_start = strpos($postTag, '<');
}
// iterate through tag finding attribute pairs - setup
$tagLeft = $currentTag;
$attrSet = array();
$currentSpace = strpos($tagLeft, ' ');
- // is end tag
if (substr($currentTag, 0, 1) == "/") {
- $isCloseTag = TRUE;
+ // is end tag
+ $isCloseTag = true;
list($tagName) = explode(' ', $currentTag);
$tagName = substr($tagName, 1);
- // is start tag
} else {
- $isCloseTag = FALSE;
+ // is start tag
+ $isCloseTag = false;
list($tagName) = explode(' ', $currentTag);
- }
+ }
// excludes all "non-regular" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted
- if ((!preg_match("/^[a-z][a-z0-9]*$/i",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) {
+ if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName))
+ || (!$tagName)
+ || ((in_array(strtolower($tagName), $this->tagBlacklist))
+ && ($this->xssAuto))
+ ) {
$postTag = substr($postTag, ($tagLength + 2));
$tagOpen_start = strpos($postTag, '<');
// don't append this tag
continue;
}
// this while is needed to support attribute values with spaces in!
- while ($currentSpace !== FALSE) {
+ while ($currentSpace !== false) {
$fromSpace = substr($tagLeft, ($currentSpace+1));
$nextSpace = strpos($fromSpace, ' ');
$openQuotes = strpos($fromSpace, '"');
$closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '"') + $openQuotes + 1;
// another equals exists
- if (strpos($fromSpace, '=') !== FALSE) {
+ if (strpos($fromSpace, '=') !== false) {
// opening and closing quotes exists
- if (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '"') !== FALSE))
+ if (($openQuotes !== false)
+ && (strpos(substr($fromSpace, ($openQuotes+1)), '"') !== false)
+ ) {
$attr = substr($fromSpace, 0, ($closeQuotes+1));
+ } else {
+ $attr = substr($fromSpace, 0, $nextSpace);
+ }
// one or neither exist
- else $attr = substr($fromSpace, 0, $nextSpace);
- // no more equals exist
- } else $attr = substr($fromSpace, 0, $nextSpace);
+
+ } else {
+ // no more equals exist
+ $attr = substr($fromSpace, 0, $nextSpace);
+ }
// last attr pair
- if (!$attr) $attr = $fromSpace;
+ if (!$attr) {
+ $attr = $fromSpace;
+ }
// add to attribute pairs array
$attrSet[] = $attr;
// next inc
@@ -334,48 +371,64 @@
$currentSpace = strpos($tagLeft, ' ');
}
// appears in array specified by user
- $tagFound = in_array(strtolower($tagName), $this->tagsArray);
+ $tagFound = in_array(strtolower($tagName), $this->tagsArray);
// remove this tag on condition
if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {
// reconstruct tag with allowed attributes
if (!$isCloseTag) {
$attrSet = $this->filterAttr($attrSet);
$preTag .= '<' . $tagName;
- for ($i = 0; $i < count($attrSet); $i++)
+ for ($i = 0; $i < count($attrSet); $i++) {
$preTag .= ' ' . $attrSet[$i];
+ }
// reformat single tags to XHTML
- if (strpos($fromTagOpen, "</" . $tagName)) $preTag .= '>';
- else $preTag .= ' />';
- // just the tagname
- } else $preTag .= '</' . $tagName . '>';
+ if (strpos($fromTagOpen, "</" . $tagName)) {
+ $preTag .= '>';
+ } else {
+ $preTag .= ' />';
+ }
+ } else {
+ // just the tagname
+ $preTag .= '</' . $tagName . '>';
+ }
}
// find next tag's start
$postTag = substr($postTag, ($tagLength + 2));
- $tagOpen_start = strpos($postTag, '<');
+ $tagOpen_start = strpos($postTag, '<');
}
// append any code after end of tags
$preTag .= $postTag;
+
return $preTag;
}
- /**
+ /**
* Internal method to strip a tag of certain attributes
- * @access protected
- * @param Array $attrSet
- * @return Array $newSet
+ *
+ * @param array $attrSet attributes
+ *
+ * @return Array $newSet stripped attributes
*/
- function filterAttr($attrSet) {
+ protected function filterAttr($attrSet)
+ {
$newSet = array();
// process attributes
for ($i = 0; $i <count($attrSet); $i++) {
// skip blank spaces in tag
- if (!$attrSet[$i]) continue;
+ if (!$attrSet[$i]) {
+ continue;
+ }
// split into attr name and value
$attrSubSet = explode('=', trim($attrSet[$i]));
list($attrSubSet[0]) = explode(' ', $attrSubSet[0]);
// removes all "non-regular" attr names AND also attr blacklisted
- if ((!eregi("^[a-z]*$",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
+ if ((!preg_match('/[a-z]*$/i', $attrSubSet[0]))
+ || (($this->xssAuto)
+ && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist))
+ || (substr($attrSubSet[0], 0, 2) == 'on')))
+ ) {
continue;
+ }
// xss attr value filtering
if ($attrSubSet[1]) {
// strips unicode, hex, etc
@@ -384,43 +437,57 @@
$attrSubSet[1] = preg_replace('/\s+/', '', $attrSubSet[1]);
// strip double quotes
$attrSubSet[1] = str_replace('"', '', $attrSubSet[1]);
- // [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)
- if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'"))
+ // [requested feature] convert single quotes from either side to doubles
+ // (Single quotes shouldn't be used to pad attr value)
+ if ((substr($attrSubSet[1], 0, 1) == "'")
+ && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")
+ ) {
$attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));
+ }
// strip slashes
$attrSubSet[1] = stripslashes($attrSubSet[1]);
}
// auto strip attr's with "javascript:
- if ( ((strpos(strtolower($attrSubSet[1]), 'expression') !== false) && (strtolower($attrSubSet[0]) == 'style')) ||
- (strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||
- (strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||
- (strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||
- (strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||
- (strpos(strtolower($attrSubSet[1]), 'livescript:') !== false)
- ) continue;
+ if (((strpos(strtolower($attrSubSet[1]), 'expression') !== false)
+ && (strtolower($attrSubSet[0]) == 'style')) ||
+ (strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'livescript:') !== false)
+ ) {
+ continue;
+ }
// if matches user defined array
$attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);
// keep this attr on condition
if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {
- // attr has value
- if ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"';
- // attr has decimal zero as value
- else if ($attrSubSet[1] == "0") $newSet[] = $attrSubSet[0] . '="0"';
- // reformat single attributes to XHTML
- else $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"';
- }
+ if ($attrSubSet[1]) {
+ // attr has value
+ $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"';
+ } elseif ($attrSubSet[1] == "0") {
+ // attr has decimal zero as value
+ $newSet[] = $attrSubSet[0] . '="0"';
+ } else {
+ // reformat single attributes to XHTML
+ $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"';
+ }
+ }
}
+
return $newSet;
}
-
- /**
+
+ /**
* Try to convert to plaintext
- * @access protected
- * @param String $source
- * @return String $source
+ *
+ * @param String $source string to decode
+ *
+ * @return String $source decoded
*/
- function decode($source) {
+ protected function decode($source)
+ {
// url decode
$charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
$source = html_entity_decode($source, ENT_QUOTES, $charset);
@@ -436,6 +503,7 @@
create_function('$matches', "return chr('0x'.\$matches[1]);"),
$source
); // hex notation
+
return $source;
}
}
|
|
From: <rgr...@us...> - 2013-09-23 14:04:53
|
Revision: 12089
http://sourceforge.net/p/xoops/svn/12089
Author: rgriffith
Date: 2013-09-23 14:04:50 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Add missing control character check
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-23 06:37:26 UTC (rev 12088)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-23 14:04:50 UTC (rev 12089)
@@ -216,8 +216,8 @@
) {
$result='';
}
- // do not allow quotes or tag brackets
- if (!preg_match('#^[^"<>]+$#', $result)) {
+ // do not allow quotes, tag brackets or controls
+ if (!preg_match('#^[^"<>\x00-\x1F]+$#', $result)) {
$result='';
}
break;
|
|
From: <be...@us...> - 2013-09-23 06:37:30
|
Revision: 12088
http://sourceforge.net/p/xoops/svn/12088
Author: beckmi
Date: 2013-09-23 06:37:26 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Adding PHP 5.5.x implementation for preg_replace_callback
Modified Paths:
--------------
XoopsModules/userlog/trunk/userlog/class/request.php
Modified: XoopsModules/userlog/trunk/userlog/class/request.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/class/request.php 2013-09-23 04:19:03 UTC (rev 12087)
+++ XoopsModules/userlog/trunk/userlog/class/request.php 2013-09-23 06:37:26 UTC (rev 12088)
@@ -1,940 +1,959 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * Userlog class
- *
- * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
- * @license GNU/GPL, see LICENSE.php
- * Joomla! is free software. This version may have been modified pursuant
- * to the GNU General Public License, and as distributed it includes or
- * is derivative of works licensed under the GNU General Public License or
- * other free or open source software licenses.
- * See COPYRIGHT.php for copyright notices and details.
- * @package Userlog
- * @since 1.0
- * @author trabis <lus...@gm...>
- * @version $Id: request.php 10374 2012-12-12 23:39:48Z trabis $
- */
-
-/**
- * Set the available masks for cleaning variables
- */
-define('Userlog_REQUEST_NOTRIM', 1);
-define('Userlog_REQUEST_ALLOWRAW', 2);
-define('Userlog_REQUEST_ALLOWHTML', 4);
-
-/**
- * UserlogRequest Class
- * This class serves to provide a common interface to access
- * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables
- * can be passed through an input filter to avoid injection or returned raw.
- */
-class UserlogRequest
-{
-
- /**
- * Gets the request method
- *
- * @return string
- */
- static function getOptions()
- {
- $method = strtoupper($_SERVER['REQUEST_METHOD']);
- return $method;
- }
-
- /**
- * Fetches and returns a given variable.
- * The default behaviour is fetching variables depending on the
- * current request method: GET and HEAD will result in returning
- * an entry from $_GET, POST and PUT will result in returning an
- * entry from $_POST.
- * You can force the source by setting the $hash parameter:
- * post $_POST
- * get $_GET
- * files $_FILES
- * cookie $_COOKIE
- * env $_ENV
- * server $_SERVER
- * method via current $_SERVER['REQUEST_METHOD']
- * default $_REQUEST
- *
- * @static
- *
- * @param string $name Variable name
- * @param string $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()}
- * @param int $mask Filter mask for the variable
- *
- * @return mixed Requested variable
- */
- static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
- {
- // Ensure hash and type are uppercase
- $hash = strtoupper($hash);
- if ($hash === 'METHOD') {
- $hash = strtoupper($_SERVER['REQUEST_METHOD']);
- }
- $type = strtoupper($type);
- // Get the input hash
- switch ($hash) {
- case 'GET' :
- $input = & $_GET;
- break;
- case 'POST' :
- $input = & $_POST;
- break;
- case 'FILES' :
- $input = & $_FILES;
- break;
- case 'COOKIE' :
- $input = & $_COOKIE;
- break;
- case 'ENV' :
- $input = & $_ENV;
- break;
- case 'SERVER' :
- $input = & $_SERVER;
- break;
- default:
- $input = & $_REQUEST;
- $hash = 'REQUEST';
- break;
- }
- if (isset($input[$name]) && $input[$name] !== null) {
- // Get the variable from the input hash and clean it
- $var = UserlogRequest::_cleanVar($input[$name], $mask, $type);
- // Handle magic quotes compatability
- if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) {
- $var = UserlogRequest::_stripSlashesRecursive($var);
- }
- } else if ($default !== null) {
- // Clean the default value
- $var = UserlogRequest::_cleanVar($default, $mask, $type);
- } else {
- $var = $default;
- }
- return $var;
- }
-
- /**
- * Fetches and returns a given filtered variable. The integer
- * filter will allow only digits to be returned. This is currently
- * only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param int $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- *
- * @return integer Requested variable
- */
- static function getInt($name, $default = 0, $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'int');
- }
-
- /**
- * Fetches and returns a given filtered variable. The float
- * filter only allows digits and periods. This is currently
- * only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param float $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- *
- * @return float Requested variable
- */
- static function getFloat($name, $default = 0.0, $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'float');
- }
-
- /**
- * Fetches and returns a given filtered variable. The bool
- * filter will only return true/false bool values. This is
- * currently only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param bool $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- *
- * @return bool Requested variable
- */
- static function getBool($name, $default = false, $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'bool');
- }
-
- /**
- * Fetches and returns a given filtered variable. The word
- * filter only allows the characters [A-Za-z_]. This is currently
- * only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param string $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- *
- * @return string Requested variable
- */
- static function getWord($name, $default = '', $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'word');
- }
-
- /**
- * Fetches and returns a given filtered variable. The cmd
- * filter only allows the characters [A-Za-z0-9.-_]. This is
- * currently only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param string $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- *
- * @return string Requested variable
- */
- static function getCmd($name, $default = '', $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'cmd');
- }
-
- /**
- * Fetches and returns a given filtered variable. The string
- * filter deletes 'bad' HTML code, if not overridden by the mask.
- * This is currently only a proxy function for getVar().
- * See getVar() for more in-depth documentation on the parameters.
- *
- * @static
- *
- * @param string $name Variable name
- * @param string $default Default value if the variable does not exist
- * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- * @param int $mask Filter mask for the variable
- *
- * @return string Requested variable
- */
- static function getString($name, $default = '', $hash = 'default', $mask = 0)
- {
- // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask
- return (string)UserlogRequest::getVar($name, $default, $hash, 'string', $mask);
- }
-
- static function getArray($name, $default = array(), $hash = 'default')
- {
- return UserlogRequest::getVar($name, $default, $hash, 'array');
- }
-
- static function getText($name, $default = '', $hash = 'default')
- {
- return (string)UserlogRequest::getVar($name, $default, $hash, 'string', Userlog_REQUEST_ALLOWRAW);
- }
-
- /**
- * Set a variabe in on of the request variables
- *
- * @access public
- *
- * @param string $name Name
- * @param string $value Value
- * @param string $hash Hash
- * @param boolean $overwrite Boolean
- *
- * @return string Previous value
- */
- static function setVar($name, $value = null, $hash = 'method', $overwrite = true)
- {
- //If overwrite is true, makes sure the variable hasn't been set yet
- if (!$overwrite && array_key_exists($name, $_REQUEST)) {
- return $_REQUEST[$name];
- }
- // Get the request hash value
- $hash = strtoupper($hash);
- if ($hash === 'METHOD') {
- $hash = strtoupper($_SERVER['REQUEST_METHOD']);
- }
- $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null;
- switch ($hash) {
- case 'GET' :
- $_GET[$name] = $value;
- $_REQUEST[$name] = $value;
- break;
- case 'POST' :
- $_POST[$name] = $value;
- $_REQUEST[$name] = $value;
- break;
- case 'COOKIE' :
- $_COOKIE[$name] = $value;
- $_REQUEST[$name] = $value;
- break;
- case 'FILES' :
- $_FILES[$name] = $value;
- break;
- case 'ENV' :
- $_ENV['name'] = $value;
- break;
- case 'SERVER' :
- $_SERVER['name'] = $value;
- break;
- }
- return $previous;
- }
-
- /**
- * Fetches and returns a request array.
- * The default behaviour is fetching variables depending on the
- * current request method: GET and HEAD will result in returning
- * $_GET, POST and PUT will result in returning $_POST.
- * You can force the source by setting the $hash parameter:
- * post $_POST
- * get $_GET
- * files $_FILES
- * cookie $_COOKIE
- * env $_ENV
- * server $_SERVER
- * method via current $_SERVER['REQUEST_METHOD']
- * default $_REQUEST
- *
- * @static
- *
- * @param string $hash to get (POST, GET, FILES, METHOD)
- * @param int $mask Filter mask for the variable
- *
- * @return mixed Request hash
- */
- static function get($hash = 'default', $mask = 0)
- {
- $hash = strtoupper($hash);
- if ($hash === 'METHOD') {
- $hash = strtoupper($_SERVER['REQUEST_METHOD']);
- }
- switch ($hash) {
- case 'GET' :
- $input = $_GET;
- break;
- case 'POST' :
- $input = $_POST;
- break;
- case 'FILES' :
- $input = $_FILES;
- break;
- case 'COOKIE' :
- $input = $_COOKIE;
- break;
- case 'ENV' :
- $input = & $_ENV;
- break;
- case 'SERVER' :
- $input = & $_SERVER;
- break;
- default:
- $input = $_REQUEST;
- break;
- }
- $result = UserlogRequest::_cleanVar($input, $mask);
- // Handle magic quotes compatability
- if (get_magic_quotes_gpc() && ($hash != 'FILES')) {
- $result = UserlogRequest::_stripSlashesRecursive($result);
- }
- return $result;
- }
-
- /**
- * Sets a request variable
- *
- * @param array $array An associative array of key-value pairs
- * @param string $hash The request variable to set (POST, GET, FILES, METHOD)
- * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored
- */
- static function set($array, $hash = 'default', $overwrite = true)
- {
- foreach ($array as $key => $value) {
- UserlogRequest::setVar($key, $value, $hash, $overwrite);
- }
- }
-
- /**
- * Cleans the request from script injection.
- *
- * @static
- * @return void
- */
- static function clean()
- {
- UserlogRequest::_cleanArray($_FILES);
- UserlogRequest::_cleanArray($_ENV);
- UserlogRequest::_cleanArray($_GET);
- UserlogRequest::_cleanArray($_POST);
- UserlogRequest::_cleanArray($_COOKIE);
- UserlogRequest::_cleanArray($_SERVER);
- if (isset($_SESSION)) {
- UserlogRequest::_cleanArray($_SESSION);
- }
- $REQUEST = $_REQUEST;
- $GET = $_GET;
- $POST = $_POST;
- $COOKIE = $_COOKIE;
- $FILES = $_FILES;
- $ENV = $_ENV;
- $SERVER = $_SERVER;
- if (isset ($_SESSION)) {
- $SESSION = $_SESSION;
- }
- foreach ($GLOBALS as $key => $value) {
- if ($key != 'GLOBALS') {
- unset($GLOBALS[$key]);
- }
- }
- $_REQUEST = $REQUEST;
- $_GET = $GET;
- $_POST = $POST;
- $_COOKIE = $COOKIE;
- $_FILES = $FILES;
- $_ENV = $ENV;
- $_SERVER = $SERVER;
- if (isset($SESSION)) {
- $_SESSION = $SESSION;
- }
- }
-
- /**
- * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked
- *
- * @access protected
- *
- * @param array $array Array to clean
- * @param boolean $globalise True if the array is to be added to the GLOBALS
- */
- static function _cleanArray(&$array, $globalise = false)
- {
- static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals');
- foreach ($array as $key => $value) {
- // PHP GLOBALS injection bug
- $failed = in_array(strtolower($key), $banned);
- // PHP Zend_Hash_Del_Key_Or_Index bug
- $failed |= is_numeric($key);
- if ($failed) {
- exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.');
- }
- if ($globalise) {
- $GLOBALS[$key] = $value;
- }
- }
- }
-
- /**
- * Clean up an input variable.
- *
- * @param mixed $var The input variable.
- * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the
- * input is a string, the string will have leading and trailing whitespace
- * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits
- * are ignored. 4=allow_html: HTML is allowed, but passed through a safe
- * HTML filter first. If set, no more filtering is performed. If no bits
- * other than the 1 bit is set, a strict filter is applied.
- * @param string $type The variable type {@see JFilterInput::clean()}.
- *
- * @return string
- */
- static function _cleanVar($var, $mask = 0, $type = null)
- {
- // Static input filters for specific settings
- static $noHtmlFilter = null;
- static $safeHtmlFilter = null;
- // If the no trim flag is not set, trim the variable
- if (!($mask & 1) && is_string($var)) {
- $var = trim($var);
- }
- // Now we handle input filtering
- if ($mask & 2) {
- // If the allow raw flag is set, do not modify the variable
- } else if ($mask & 4) {
- // If the allow html flag is set, apply a safe html filter to the variable
- if (is_null($safeHtmlFilter)) {
- $safeHtmlFilter = UserlogFilterInput::getInstance(null, null, 1, 1);
- }
- $var = $safeHtmlFilter->clean($var, $type);
- } else {
- // Since no allow flags were set, we will apply the most strict filter to the variable
- if (is_null($noHtmlFilter)) {
- $noHtmlFilter = UserlogFilterInput::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */);
- }
- $var = $noHtmlFilter->clean($var, $type);
- }
- return $var;
- }
-
- /**
- * Strips slashes recursively on an array
- *
- * @access protected
- *
- * @param array $value Array of (nested arrays of) strings
- *
- * @return array|string The input array with stripshlashes applied to it
- */
- protected function _stripSlashesRecursive($value)
- {
- $value = is_array($value) ? array_map(array('UserlogRequest', '_stripSlashesRecursive'), $value) : stripslashes($value);
- return $value;
- }
-}
-
-/**
- * UserlogInput is a class for filtering input from any data source
- * Forked from the php input filter library by: Daniel Morris <da...@ro...>
- * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
- *
- * @author Louis Landry <lou...@jo...>
- */
-class UserlogFilterInput
-{
- var $tagsArray; // default = empty array
- var $attrArray; // default = empty array
- var $tagsMethod; // default = 0
- var $attrMethod; // default = 0
- var $xssAuto; // default = 1
- var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');
- var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
- /**
- * Constructor for inputFilter class. Only first parameter is required.
- *
- * @access protected
- *
- * @param array $tagsArray list of user-defined tags
- * @param array $attrArray list of user-defined attributes
- * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
- * @param int $attrMethod WhiteList method = 0, BlackList method = 1
- * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
- */
- public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
- {
- // Make sure user defined arrays are in lowercase
- $tagsArray = array_map('strtolower', (array)$tagsArray);
- $attrArray = array_map('strtolower', (array)$attrArray);
- // Assign member variables
- $this->tagsArray = $tagsArray;
- $this->attrArray = $attrArray;
- $this->tagsMethod = $tagsMethod;
- $this->attrMethod = $attrMethod;
- $this->xssAuto = $xssAuto;
- }
-
- /**
- * Returns a reference to an input filter object, only creating it if it doesn't already exist.
- * This method must be invoked as:
- * <pre> $filter = & UserlogFilterInput::getInstance();</pre>
- *
- * @static
- *
- * @param array $tagsArray list of user-defined tags
- * @param array $attrArray list of user-defined attributes
- * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
- * @param int $attrMethod WhiteList method = 0, BlackList method = 1
- * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
- *
- * @return object The UserlogFilterInput object.
- * @since 1.5
- */
- public function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
- {
- static $instances;
- $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto)));
- if (!isset ($instances)) {
- $instances = array();
- }
- if (empty ($instances[$sig])) {
- $instances[$sig] = new UserlogFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
- }
- return $instances[$sig];
- }
-
- /**
- * Method to be called by another php script. Processes for XSS and
- * specified bad code.
- *
- * @access public
- *
- * @param mixed $source Input string/array-of-string to be 'cleaned'
- * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE)
- *
- * @return mixed 'Cleaned' version of input parameter
- * @static
- */
- public function clean($source, $type = 'string')
- {
- // Handle the type constraint
- switch (strtoupper($type)) {
- case 'INT' :
- case 'INTEGER' :
- // Only use the first integer value
- preg_match('/-?[0-9]+/', (string)$source, $matches);
- $result = @ (int)$matches[0];
- break;
- case 'FLOAT' :
- case 'DOUBLE' :
- // Only use the first floating point value
- preg_match('/-?[0-9]+(\.[0-9]+)?/', (string)$source, $matches);
- $result = @ (float)$matches[0];
- break;
- case 'BOOL' :
- case 'BOOLEAN' :
- $result = (bool)$source;
- break;
- case 'WORD' :
- $result = (string)preg_replace('/[^A-Z_]/i', '', $source);
- break;
- case 'ALNUM' :
- $result = (string)preg_replace('/[^A-Z0-9]/i', '', $source);
- break;
- case 'CMD' :
- $result = (string)preg_replace('/[^A-Z0-9_\.-]/i', '', $source);
- $result = ltrim($result, '.');
- break;
- case 'BASE64' :
- $result = (string)preg_replace('/[^A-Z0-9\/+=]/i', '', $source);
- break;
- case 'STRING' :
- // Check for static usage and assign $filter the proper variable
- if (isset($this) && is_a($this, 'UserlogFilterInput')) {
- $filter =& $this;
- } else {
- $filter = UserlogFilterInput::getInstance();
- }
- $result = (string)$filter->_remove($filter->_decode((string)$source));
- break;
- case 'ARRAY' :
- $result = (array)$source;
- break;
- case 'PATH' :
- $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';
- preg_match($pattern, (string)$source, $matches);
- $result = @ (string)$matches[0];
- break;
- case 'USERNAME' :
- $result = (string)preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
- break;
- default :
- // Check for static usage and assign $filter the proper variable
- if (is_object($this) && get_class($this) == 'UserlogFilterInput') {
- $filter =& $this;
- } else {
- $filter = UserlogFilterInput::getInstance();
- }
- // Are we dealing with an array?
- if (is_array($source)) {
- foreach ($source as $key => $value) {
- // filter element for XSS and other 'bad' code etc.
- if (is_string($value)) {
- $source[$key] = $filter->_remove($filter->_decode($value));
- }
- }
- $result = $source;
- } else {
- // Or a string?
- if (is_string($source) && !empty ($source)) {
- // filter source for XSS and other 'bad' code etc.
- $result = $filter->_remove($filter->_decode($source));
- } else {
- // Not an array or string.. return the passed parameter
- $result = $source;
- }
- }
- break;
- }
- return $result;
- }
-
- /**
- * Function to determine if contents of an attribute is safe
- *
- * @static
- *
- * @param array $attrSubSet A 2 element array for attributes name,value
- *
- * @return boolean True if bad code is detected
- */
- public function checkAttribute($attrSubSet)
- {
- $attrSubSet[0] = strtolower($attrSubSet[0]);
- $attrSubSet[1] = strtolower($attrSubSet[1]);
- return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false));
- }
-
- /**
- * Internal method to iteratively remove all unwanted tags and attributes
- *
- * @access protected
- *
- * @param string $source Input string to be 'cleaned'
- *
- * @return string 'Cleaned' version of input parameter
- */
- protected function _remove($source)
- {
- $loopCounter = 0;
- // Iteration provides nested tag protection
- while ($source != $this->_cleanTags($source)) {
- $source = $this->_cleanTags($source);
- $loopCounter++;
- }
- return $source;
- }
-
- /**
- * Internal method to strip a string of certain tags
- *
- * @access protected
- *
- * @param string $source Input string to be 'cleaned'
- *
- * @return string 'Cleaned' version of input parameter
- */
- protected function _cleanTags($source)
- {
- /*
- * In the beginning we don't really have a tag, so everything is
- * postTag
- */
- $preTag = null;
- $postTag = $source;
- // Is there a tag? If so it will certainly start with a '<'
- $tagOpen_start = strpos($source, '<');
- while ($tagOpen_start !== false) {
- // Get some information about the tag we are processing
- $preTag .= substr($postTag, 0, $tagOpen_start);
- $postTag = substr($postTag, $tagOpen_start);
- $fromTagOpen = substr($postTag, 1);
- $tagOpen_end = strpos($fromTagOpen, '>');
- // Let's catch any non-terminated tags and skip over them
- if ($tagOpen_end === false) {
- $postTag = substr($postTag, $tagOpen_start + 1);
- $tagOpen_start = strpos($postTag, '<');
- continue;
- }
- // Do we have a nested tag?
- $tagOpen_nested = strpos($fromTagOpen, '<');
- if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {
- $preTag .= substr($postTag, 0, ($tagOpen_nested + 1));
- $postTag = substr($postTag, ($tagOpen_nested + 1));
- $tagOpen_start = strpos($postTag, '<');
- continue;
- }
- // Lets get some information about our tag and setup attribute pairs
- $currentTag = substr($fromTagOpen, 0, $tagOpen_end);
- $tagLength = strlen($currentTag);
- $tagLeft = $currentTag;
- $attrSet = array();
- $currentSpace = strpos($tagLeft, ' ');
- // Are we an open tag or a close tag?
- if (substr($currentTag, 0, 1) == '/') {
- // Close Tag
- $isCloseTag = true;
- list ($tagName) = explode(' ', $currentTag);
- $tagName = substr($tagName, 1);
- } else {
- // Open Tag
- $isCloseTag = false;
- list ($tagName) = explode(' ', $currentTag);
- }
- /*
- * Exclude all "non-regular" tagnames
- * OR no tagname
- * OR remove if xssauto is on and tag is blacklisted
- */
- if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) {
- $postTag = substr($postTag, ($tagLength + 2));
- $tagOpen_start = strpos($postTag, '<');
- // Strip tag
- continue;
- }
- /*
- * Time to grab any attributes from the tag... need this section in
- * case attributes have spaces in the values.
- */
- while ($currentSpace !== false) {
- $attr = '';
- $fromSpace = substr($tagLeft, ($currentSpace + 1));
- $nextSpace = strpos($fromSpace, ' ');
- $openQuotes = strpos($fromSpace, '"');
- $closeQuotes = strpos(substr($fromSpace, ($openQuotes + 1)), '"') + $openQuotes + 1;
- // Do we have an attribute to process? [check for equal sign]
- if (strpos($fromSpace, '=') !== false) {
- /*
- * If the attribute value is wrapped in quotes we need to
- * grab the substring from the closing quote, otherwise grab
- * till the next space
- */
- if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes + 1)), '"') !== false)) {
- $attr = substr($fromSpace, 0, ($closeQuotes + 1));
- } else {
- $attr = substr($fromSpace, 0, $nextSpace);
- }
- } else {
- /*
- * No more equal signs so add any extra text in the tag into
- * the attribute array [eg. checked]
- */
- if ($fromSpace != '/') {
- $attr = substr($fromSpace, 0, $nextSpace);
- }
- }
- // Last Attribute Pair
- if (!$attr && $fromSpace != '/') {
- $attr = $fromSpace;
- }
- // Add attribute pair to the attribute array
- $attrSet[] = $attr;
- // Move search point and continue iteration
- $tagLeft = substr($fromSpace, strlen($attr));
- $currentSpace = strpos($tagLeft, ' ');
- }
- // Is our tag in the user input array?
- $tagFound = in_array(strtolower($tagName), $this->tagsArray);
- // If the tag is allowed lets append it to the output string
- if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {
- // Reconstruct tag with allowed attributes
- if (!$isCloseTag) {
- // Open or Single tag
- $attrSet = $this->_cleanAttributes($attrSet);
- $preTag .= '<' . $tagName;
- for ($i = 0; $i < count($attrSet); $i++) {
- $preTag .= ' ' . $attrSet[$i];
- }
- // Reformat single tags to XHTML
- if (strpos($fromTagOpen, '</' . $tagName)) {
- $preTag .= '>';
- } else {
- $preTag .= ' />';
- }
- } else {
- // Closing Tag
- $preTag .= '</' . $tagName . '>';
- }
- }
- // Find next tag's start and continue iteration
- $postTag = substr($postTag, ($tagLength + 2));
- $tagOpen_start = strpos($postTag, '<');
- }
- // Append any code after the end of tags and return
- if ($postTag != '<') {
- $preTag .= $postTag;
- }
- return $preTag;
- }
-
- /**
- * Internal method to strip a tag of certain attributes
- *
- * @access protected
- *
- * @param array $attrSet Array of attribute pairs to filter
- *
- * @return array Filtered array of attribute pairs
- */
- protected function _cleanAttributes($attrSet)
- {
- // Initialize variables
- $newSet = array();
- // Iterate through attribute pairs
- for ($i = 0; $i < count($attrSet); $i++) {
- // Skip blank spaces
- if (!$attrSet[$i]) {
- continue;
- }
- // Split into name/value pairs
- $attrSubSet = explode('=', trim($attrSet[$i]), 2);
- list ($attrSubSet[0]) = explode(' ', $attrSubSet[0]);
- /*
- * Remove all "non-regular" attribute names
- * AND blacklisted attributes
- */
- if ((!preg_match('/[a-z]*$/i', $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) {
- continue;
- }
- // XSS attribute value filtering
- if ($attrSubSet[1]) {
- // strips unicode, hex, etc
- $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);
- // strip normal newline within attr value
- $attrSubSet[1] = preg_replace('/[\n\r]/', '', $attrSubSet[1]);
- // strip double quotes
- $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]);
- // convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)
- if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) {
- $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));
- }
- // strip slashes
- $attrSubSet[1] = stripslashes($attrSubSet[1]);
- }
- // Autostrip script tags
- if (UserlogFilterInput::checkAttribute($attrSubSet)) {
- continue;
- }
- // Is our attribute in the user input array?
- $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);
- // If the tag is allowed lets keep it
- if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {
- // Does the attribute have a value?
- if ($attrSubSet[1]) {
- $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"';
- } elseif ($attrSubSet[1] == "0") {
- /*
- * Special Case
- * Is the value 0?
- */
- $newSet[] = $attrSubSet[0] . '="0"';
- } else {
- $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"';
- }
- }
- }
- return $newSet;
- }
-
- /**
- * Try to convert to plaintext
- *
- * @access protected
- *
- * @param string $source
- *
- * @return string Plaintext string
- */
- protected function _decode($source)
- {
- // entity decode
- $trans_tbl = get_html_translation_table(HTML_ENTITIES);
- foreach ($trans_tbl as $k => $v) {
- $ttr[$v] = utf8_encode($k);
- }
- $source = strtr($source, $ttr);
- // convert decimal
- $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
- // convert hex
- $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
- return $source;
- }
-}
\ No newline at end of file
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * Userlog class
+ *
+ * @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ * @license GNU/GPL, see LICENSE.php
+ * Joomla! is free software. This version may have been modified pursuant
+ * to the GNU General Public License, and as distributed it includes or
+ * is derivative of works licensed under the GNU General Public License or
+ * other free or open source software licenses.
+ * See COPYRIGHT.php for copyright notices and details.
+ * @package Userlog
+ * @since 1.0
+ * @author trabis <lus...@gm...>
+ * @version $Id: request.php 10374 2012-12-12 23:39:48Z trabis $
+ */
+
+/**
+ * Set the available masks for cleaning variables
+ */
+define('Userlog_REQUEST_NOTRIM', 1);
+define('Userlog_REQUEST_ALLOWRAW', 2);
+define('Userlog_REQUEST_ALLOWHTML', 4);
+
+/**
+ * UserlogRequest Class
+ * This class serves to provide a common interface to access
+ * request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables
+ * can be passed through an input filter to avoid injection or returned raw.
+ */
+class UserlogRequest
+{
+
+ /**
+ * Gets the request method
+ *
+ * @return string
+ */
+ static function getOptions()
+ {
+ $method = strtoupper($_SERVER['REQUEST_METHOD']);
+
+ return $method;
+ }
+
+ /**
+ * Fetches and returns a given variable.
+ * The default behaviour is fetching variables depending on the
+ * current request method: GET and HEAD will result in returning
+ * an entry from $_GET, POST and PUT will result in returning an
+ * entry from $_POST.
+ * You can force the source by setting the $hash parameter:
+ * post $_POST
+ * get $_GET
+ * files $_FILES
+ * cookie $_COOKIE
+ * env $_ENV
+ * server $_SERVER
+ * method via current $_SERVER['REQUEST_METHOD']
+ * default $_REQUEST
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ * @param string $type Return type for the variable, for valid values see {@link JFilterInput::clean()}
+ * @param int $mask Filter mask for the variable
+ *
+ * @return mixed Requested variable
+ */
+ static function getVar($name, $default = null, $hash = 'default', $type = 'none', $mask = 0)
+ {
+ // Ensure hash and type are uppercase
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ $type = strtoupper($type);
+ // Get the input hash
+ switch ($hash) {
+ case 'GET' :
+ $input = & $_GET;
+ break;
+ case 'POST' :
+ $input = & $_POST;
+ break;
+ case 'FILES' :
+ $input = & $_FILES;
+ break;
+ case 'COOKIE' :
+ $input = & $_COOKIE;
+ break;
+ case 'ENV' :
+ $input = & $_ENV;
+ break;
+ case 'SERVER' :
+ $input = & $_SERVER;
+ break;
+ default:
+ $input = & $_REQUEST;
+ $hash = 'REQUEST';
+ break;
+ }
+ if (isset($input[$name]) && $input[$name] !== null) {
+ // Get the variable from the input hash and clean it
+ $var = UserlogRequest::_cleanVar($input[$name], $mask, $type);
+ // Handle magic quotes compatability
+ if (get_magic_quotes_gpc() && ($var != $default) && ($hash != 'FILES')) {
+ $var = UserlogRequest::_stripSlashesRecursive($var);
+ }
+ } elseif ($default !== null) {
+ // Clean the default value
+ $var = UserlogRequest::_cleanVar($default, $mask, $type);
+ } else {
+ $var = $default;
+ }
+
+ return $var;
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The integer
+ * filter will allow only digits to be returned. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param int $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return integer Requested variable
+ */
+ static function getInt($name, $default = 0, $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'int');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The float
+ * filter only allows digits and periods. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param float $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return float Requested variable
+ */
+ static function getFloat($name, $default = 0.0, $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'float');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The bool
+ * filter will only return true/false bool values. This is
+ * currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param bool $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return bool Requested variable
+ */
+ static function getBool($name, $default = false, $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'bool');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The word
+ * filter only allows the characters [A-Za-z_]. This is currently
+ * only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return string Requested variable
+ */
+ static function getWord($name, $default = '', $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'word');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The cmd
+ * filter only allows the characters [A-Za-z0-9.-_]. This is
+ * currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ *
+ * @return string Requested variable
+ */
+ static function getCmd($name, $default = '', $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'cmd');
+ }
+
+ /**
+ * Fetches and returns a given filtered variable. The string
+ * filter deletes 'bad' HTML code, if not overridden by the mask.
+ * This is currently only a proxy function for getVar().
+ * See getVar() for more in-depth documentation on the parameters.
+ *
+ * @static
+ *
+ * @param string $name Variable name
+ * @param string $default Default value if the variable does not exist
+ * @param string $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
+ * @param int $mask Filter mask for the variable
+ *
+ * @return string Requested variable
+ */
+ static function getString($name, $default = '', $hash = 'default', $mask = 0)
+ {
+ // Cast to string, in case JREQUEST_ALLOWRAW was specified for mask
+ return (string) UserlogRequest::getVar($name, $default, $hash, 'string', $mask);
+ }
+
+ static function getArray($name, $default = array(), $hash = 'default')
+ {
+ return UserlogRequest::getVar($name, $default, $hash, 'array');
+ }
+
+ static function getText($name, $default = '', $hash = 'default')
+ {
+ return (string) UserlogRequest::getVar($name, $default, $hash, 'string', Userlog_REQUEST_ALLOWRAW);
+ }
+
+ /**
+ * Set a variabe in on of the request variables
+ *
+ * @access public
+ *
+ * @param string $name Name
+ * @param string $value Value
+ * @param string $hash Hash
+ * @param boolean $overwrite Boolean
+ *
+ * @return string Previous value
+ */
+ static function setVar($name, $value = null, $hash = 'method', $overwrite = true)
+ {
+ //If overwrite is true, makes sure the variable hasn't been set yet
+ if (!$overwrite && array_key_exists($name, $_REQUEST)) {
+ return $_REQUEST[$name];
+ }
+ // Get the request hash value
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ $previous = array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : null;
+ switch ($hash) {
+ case 'GET' :
+ $_GET[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'POST' :
+ $_POST[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'COOKIE' :
+ $_COOKIE[$name] = $value;
+ $_REQUEST[$name] = $value;
+ break;
+ case 'FILES' :
+ $_FILES[$name] = $value;
+ break;
+ case 'ENV' :
+ $_ENV['name'] = $value;
+ break;
+ case 'SERVER' :
+ $_SERVER['name'] = $value;
+ break;
+ }
+
+ return $previous;
+ }
+
+ /**
+ * Fetches and returns a request array.
+ * The default behaviour is fetching variables depending on the
+ * current request method: GET and HEAD will result in returning
+ * $_GET, POST and PUT will result in returning $_POST.
+ * You can force the source by setting the $hash parameter:
+ * post $_POST
+ * get $_GET
+ * files $_FILES
+ * cookie $_COOKIE
+ * env $_ENV
+ * server $_SERVER
+ * method via current $_SERVER['REQUEST_METHOD']
+ * default $_REQUEST
+ *
+ * @static
+ *
+ * @param string $hash to get (POST, GET, FILES, METHOD)
+ * @param int $mask Filter mask for the variable
+ *
+ * @return mixed Request hash
+ */
+ static function get($hash = 'default', $mask = 0)
+ {
+ $hash = strtoupper($hash);
+ if ($hash === 'METHOD') {
+ $hash = strtoupper($_SERVER['REQUEST_METHOD']);
+ }
+ switch ($hash) {
+ case 'GET' :
+ $input = $_GET;
+ break;
+ case 'POST' :
+ $input = $_POST;
+ break;
+ case 'FILES' :
+ $input = $_FILES;
+ break;
+ case 'COOKIE' :
+ $input = $_COOKIE;
+ break;
+ case 'ENV' :
+ $input = & $_ENV;
+ break;
+ case 'SERVER' :
+ $input = & $_SERVER;
+ break;
+ default:
+ $input = $_REQUEST;
+ break;
+ }
+ $result = UserlogRequest::_cleanVar($input, $mask);
+ // Handle magic quotes compatability
+ if (get_magic_quotes_gpc() && ($hash != 'FILES')) {
+ $result = UserlogRequest::_stripSlashesRecursive($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Sets a request variable
+ *
+ * @param array $array An associative array of key-value pairs
+ * @param string $hash The request variable to set (POST, GET, FILES, METHOD)
+ * @param boolean $overwrite If true and an existing key is found, the value is overwritten, otherwise it is ingored
+ */
+ static function set($array, $hash = 'default', $overwrite = true)
+ {
+ foreach ($array as $key => $value) {
+ UserlogRequest::setVar($key, $value, $hash, $overwrite);
+ }
+ }
+
+ /**
+ * Cleans the request from script injection.
+ *
+ * @static
+ * @return void
+ */
+ static function clean()
+ {
+ UserlogRequest::_cleanArray($_FILES);
+ UserlogRequest::_cleanArray($_ENV);
+ UserlogRequest::_cleanArray($_GET);
+ UserlogRequest::_cleanArray($_POST);
+ UserlogRequest::_cleanArray($_COOKIE);
+ UserlogRequest::_cleanArray($_SERVER);
+ if (isset($_SESSION)) {
+ UserlogRequest::_cleanArray($_SESSION);
+ }
+ $REQUEST = $_REQUEST;
+ $GET = $_GET;
+ $POST = $_POST;
+ $COOKIE = $_COOKIE;
+ $FILES = $_FILES;
+ $ENV = $_ENV;
+ $SERVER = $_SERVER;
+ if (isset ($_SESSION)) {
+ $SESSION = $_SESSION;
+ }
+ foreach ($GLOBALS as $key => $value) {
+ if ($key != 'GLOBALS') {
+ unset($GLOBALS[$key]);
+ }
+ }
+ $_REQUEST = $REQUEST;
+ $_GET = $GET;
+ $_POST = $POST;
+ $_COOKIE = $COOKIE;
+ $_FILES = $FILES;
+ $_ENV = $ENV;
+ $_SERVER = $SERVER;
+ if (isset($SESSION)) {
+ $_SESSION = $SESSION;
+ }
+ }
+
+ /**
+ * Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked
+ *
+ * @access protected
+ *
+ * @param array $array Array to clean
+ * @param boolean $globalise True if the array is to be added to the GLOBALS
+ */
+ static function _cleanArray(&$array, $globalise = false)
+ {
+ static $banned = array('_files', '_env', '_get', '_post', '_cookie', '_server', '_session', 'globals');
+ foreach ($array as $key => $value) {
+ // PHP GLOBALS injection bug
+ $failed = in_array(strtolower($key), $banned);
+ // PHP Zend_Hash_Del_Key_Or_Index bug
+ $failed |= is_numeric($key);
+ if ($failed) {
+ exit('Illegal variable <strong>' . implode('</strong> or <strong>', $banned) . '</strong> passed to script.');
+ }
+ if ($globalise) {
+ $GLOBALS[$key] = $value;
+ }
+ }
+ }
+
+ /**
+ * Clean up an input variable.
+ *
+ * @param mixed $var The input variable.
+ * @param int $mask Filter bit mask. 1=no trim: If this flag is cleared and the
+ * input is a string, the string will have leading and trailing whitespace
+ * trimmed. 2=allow_raw: If set, no more filtering is performed, higher bits
+ * are ignored. 4=allow_html: HTML is allowed, but passed through a safe
+ * HTML filter first. If set, no more filtering is performed. If no bits
+ * other than the 1 bit is set, a strict filter is applied.
+ * @param string $type The variable type {@see JFilterInput::clean()}.
+ *
+ * @return string
+ */
+ static function _cleanVar($var, $mask = 0, $type = null)
+ {
+ // Static input filters for specific settings
+ static $noHtmlFilter = null;
+ static $safeHtmlFilter = null;
+ // If the no trim flag is not set, trim the variable
+ if (!($mask & 1) && is_string($var)) {
+ $var = trim($var);
+ }
+ // Now we handle input filtering
+ if ($mask & 2) {
+ // If the allow raw flag is set, do not modify the variable
+ } elseif ($mask & 4) {
+ // If the allow html flag is set, apply a safe html filter to the variable
+ if (is_null($safeHtmlFilter)) {
+ $safeHtmlFilter = UserlogFilterInput::getInstance(null, null, 1, 1);
+ }
+ $var = $safeHtmlFilter->clean($var, $type);
+ } else {
+ // Since no allow flags were set, we will apply the most strict filter to the variable
+ if (is_null($noHtmlFilter)) {
+ $noHtmlFilter = UserlogFilterInput::getInstance( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */);
+ }
+ $var = $noHtmlFilter->clean($var, $type);
+ }
+
+ return $var;
+ }
+
+ /**
+ * Strips slashes recursively on an array
+ *
+ * @access protected
+ *
+ * @param array $value Array of (nested arrays of) strings
+ *
+ * @return array|string The input array with stripshlashes applied to it
+ */
+ protected function _stripSlashesRecursive($value)
+ {
+ $value = is_array($value) ? array_map(array('UserlogRequest', '_stripSlashesRecursive'), $value) : stripslashes($value);
+
+ return $value;
+ }
+}
+
+/**
+ * UserlogInput is a class for filtering input from any data source
+ * Forked from the php input filter library by: Daniel Morris <da...@ro...>
+ * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
+ *
+ * @author Louis Landry <lou...@jo...>
+ */
+class UserlogFilterInput
+{
+ var $tagsArray; // default = empty array
+ var $attrArray; // default = empty array
+ var $tagsMethod; // default = 0
+ var $attrMethod; // default = 0
+ var $xssAuto; // default = 1
+ var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');
+ var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
+ /**
+ * Constructor for inputFilter class. Only first parameter is required.
+ *
+ * @access protected
+ *
+ * @param array $tagsArray list of user-defined tags
+ * @param array $attrArray list of user-defined attributes
+ * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
+ * @param int $attrMethod WhiteList method = 0, BlackList method = 1
+ * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
+ */
+ public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
+ {
+ // Make sure user defined arrays are in lowercase
+ $tagsArray = array_map('strtolower', (array) $tagsArray);
+ $attrArray = array_map('strtolower', (array) $attrArray);
+ // Assign member variables
+ $this->tagsArray = $tagsArray;
+ $this->attrArray = $attrArray;
+ $this->tagsMethod = $tagsMethod;
+ $this->attrMethod = $attrMethod;
+ $this->xssAuto = $xssAuto;
+ }
+
+ /**
+ * Returns a reference to an input filter object, only creating it if it doesn't already exist.
+ * This method must be invoked as:
+ * <pre> $filter = & UserlogFilterInput::getInstance();</pre>
+ *
+ * @static
+ *
+ * @param array $tagsArray list of user-defined tags
+ * @param array $attrArray list of user-defined attributes
+ * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
+ * @param int $attrMethod WhiteList method = 0, BlackList method = 1
+ * @param int $xssAuto Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
+ *
+ * @return object The UserlogFilterInput object.
+ * @since 1.5
+ */
+ public function & getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
+ {
+ static $instances;
+ $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto)));
+ if (!isset ($instances)) {
+ $instances = array();
+ }
+ if (empty ($instances[$sig])) {
+ $instances[$sig] = new UserlogFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
+ }
+
+ return $instances[$sig];
+ }
+
+ /**
+ * Method to be called by another php script. Processes for XSS and
+ * specified bad code.
+ *
+ * @access public
+ *
+ * @param mixed $source Input string/array-of-string to be 'cleaned'
+ * @param string $type Return type for the variable (INT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE)
+ ...
[truncated message content] |
|
From: <be...@us...> - 2013-09-23 04:19:05
|
Revision: 12087
http://sourceforge.net/p/xoops/svn/12087
Author: beckmi
Date: 2013-09-23 04:19:03 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
added: user links to downloaders/voters (mamba)
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/readme.txt
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-09-23 04:02:14 UTC (rev 12086)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-09-23 04:19:03 UTC (rev 12087)
@@ -52,7 +52,7 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
-
+
$GLOBALS['xoopsTpl']->assign('votes', $votes);
$GLOBALS['xoopsTpl']->assign('ratings_count', $ratings_count);
$GLOBALS['xoopsTpl']->assign('useravgrating', $useravgrating);
@@ -65,6 +65,7 @@
$rating_array = $rating->toArray();
$rating_array['formatted_date'] = formatTimestamp($rating->getVar('ratingtimestamp'), _DATESTRING);
$rating_array['submitter_uname'] = XoopsUser::getUnameFromId($rating->getVar('ratinguser'));
+ $rating_array['submitter_uid'] = $rating->getVar('ratinguser');
$rating_array['download_title'] = $downloads[$rating->getVar('lid')]->getVar('title');
$GLOBALS['xoopsTpl']->append('ratings', $rating_array);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-23 04:02:14 UTC (rev 12086)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-23 04:19:03 UTC (rev 12087)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-21)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-22)</u></b>
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
@@ -25,6 +25,7 @@
- added: folder checker (mamba + luciorota)
- added: file checker (luciorota)
- added: module is clonable, built-in module clone function (trabis/luciorota)
+- added: user links to downloaders/voters (mamba)
- removed: unupgraded languages from repository (luciorota)
- removed: unused templates (luciorota)
- removed: unused images files (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/readme.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/readme.txt 2013-09-23 04:02:14 UTC (rev 12086)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/readme.txt 2013-09-23 04:19:03 UTC (rev 12087)
@@ -9,7 +9,7 @@
What is Wfdownloads ?
======================
-Wfdownloads is an advanced Downloads module for your XOOPS 2.x site. With this powerful module, you can easily set a downloads section on your site and offer unlimited amount of files to your users. The module supports subcategories, has a fully integrated permissions system as well as a complete notifications system.
+Wfdownloads is an advanced Downloads module for your XOOPS Website. With this powerful module, you can easily set a downloads section on your site and offer unlimited amount of files to your users. The module supports subcategories, has a fully integrated permissions system as well as a complete notifications system.
How to install or Update Wfdownloads
@@ -30,4 +30,4 @@
\wfdownloads\docs\lang_diff.txt
-XOOPS Development Team
\ No newline at end of file
+XOOPS Development Team
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html 2013-09-23 04:02:14 UTC (rev 12086)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html 2013-09-23 04:19:03 UTC (rev 12087)
@@ -15,7 +15,7 @@
<tr class="<{cycle values='even, odd'}>">
<td><{$ip_log.ip_address}></td>
<td align='center'><{$ip_log.date_timestamp}></td>
- <td align='center'><{$ip_log.uname}></td>
+ <td align='center'><a href='../../../userinfo.php?uid=<{$ip_log.uid}>'><{$ip_log.uname}></a></td>
</tr>
<{/foreach}>
</table>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html 2013-09-23 04:02:14 UTC (rev 12086)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html 2013-09-23 04:19:03 UTC (rev 12087)
@@ -34,7 +34,7 @@
<{foreach item=rating from=$ratings}>
<tr class="<{cycle values='even, odd'}>">
<td class='head'><{$rating.ratingid}></td>
- <td class='even'><{$rating.submitter_uname}></td>
+ <td class='even'><a href='../../../userinfo.php?uid=<{$rating.submitter_uid}>'><{$rating.submitter_uname}></a></td>
<td class='even'><{$rating.ratinghostname}></td>
<td class='even'><{$rating.download_title}></td>
<td class='even' align='center'><{$rating.rating}></td>
|
|
From: <be...@us...> - 2013-09-23 04:02:33
|
Revision: 12086
http://sourceforge.net/p/xoops/svn/12086
Author: beckmi
Date: 2013-09-23 04:02:14 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
adjusting links for $pathIcon16
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-09-23 02:06:34 UTC (rev 12085)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-09-23 04:02:14 UTC (rev 12086)
@@ -31,8 +31,10 @@
$module_handler =& xoops_gethandler('module');
$xoopsModule =& $module_handler->getByDirname(basename(dirname(dirname(__FILE__))));
-$pathIcon16 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32');
+//$pathIcon16 = XOOPS_URL . $xoopsModule->getInfo('icons16');
+$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
+//$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('icons32');
+$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
include_once dirname(dirname(__FILE__)) . '/include/common.php';
|
|
From: <be...@us...> - 2013-09-23 02:06:39
|
Revision: 12085
http://sourceforge.net/p/xoops/svn/12085
Author: beckmi
Date: 2013-09-23 02:06:34 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Adding PHP 5.2.x implementation for preg_replace_callback
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-09-22 22:51:50 UTC (rev 12084)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/request.php 2013-09-23 02:06:34 UTC (rev 12085)
@@ -933,11 +933,21 @@
$source = strtr($source, $ttr);
// convert decimal
//$source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation
- $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation
+ //TODO swich to this once we have PHP 5.3 as minimum
+// $source = preg_replace_callback('/&#(\d+);/m', function($m) {return chr($m[1]);}, $source); // decimal notation
+ $source = preg_replace_callback('/&#(\d+);/m', create_function('$matches', "return chr(\$matches[1]);"),$source); // decimal notation
// convert hex
//$source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation
- $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) {return chr(hexdec($m[1]));}, $source); // hex notation
+ //TODO swich to this once we have PHP 5.3 as minimum
+// $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m) {return chr(hexdec($m[1]));}, $source); // hex notation
+ $source = preg_replace_callback('/&#x([a-f0-9]+);/mi', create_function('$matches', "return chr('0x'.\$matches[1]);"),$source); // hex notation
+
+
+
+
+
+
return $source;
}
-}
\ No newline at end of file
+}
|
|
From: <rgr...@us...> - 2013-09-22 22:51:53
|
Revision: 12084
http://sourceforge.net/p/xoops/svn/12084
Author: rgriffith
Date: 2013-09-22 22:51:50 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Fix preg_replace issue
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-22 21:44:50 UTC (rev 12083)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-22 22:51:50 UTC (rev 12084)
@@ -425,9 +425,17 @@
$charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
$source = html_entity_decode($source, ENT_QUOTES, $charset);
// convert decimal
- $source = preg_replace('/&#(\d+);/me',"chr(\\1)", $source); // decimal notation
+ $source = preg_replace_callback(
+ '/&#(\d+);/m',
+ create_function('$matches', "return chr(\$matches[1]);"),
+ $source
+ );
// convert hex
- $source = preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)", $source); // hex notation
+ $source = preg_replace_callback(
+ '/&#x([a-f0-9]+);/mi',
+ create_function('$matches', "return chr('0x'.\$matches[1]);"),
+ $source
+ ); // hex notation
return $source;
}
}
|
|
From: <rgr...@us...> - 2013-09-22 21:44:53
|
Revision: 12083
http://sourceforge.net/p/xoops/svn/12083
Author: rgriffith
Date: 2013-09-22 21:44:50 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Fixes for security issues reported by Mehdi Dadkhah
see: http://packetstormsecurity.com/files/123148
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/banners.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsload.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/checklogin.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/register.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/user.php
Added Paths:
-----------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/banners.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/banners.php 2013-09-22 15:55:58 UTC (rev 12082)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/banners.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -325,20 +325,59 @@
exit();
}
+XoopsLoad::load('XoopsFilterInput');
+$myts =& MyTextSanitizer::getInstance();
+
$op = '';
if (!empty($_POST['op'])) {
- $op = $_POST['op'];
-} else if (!empty($_GET['op'])) {
- $op = $_GET['op'];
+ // from $_POST we use keys: op, login, pass, url, pass, bid, cid
+ $op = trim(XoopsFilterInput::clean($_POST['op'], 'STRING'));
+
+ $clean_login='';
+ if (isset($_POST['login'])) {
+ $clean_login = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['login']), 'STRING'));
+ }
+
+ $clean_pass='';
+ if (isset($_POST['pass'])) {
+ $clean_pass = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['pass']), 'STRING'));
+ }
+
+ $clean_url='';
+ if (isset($_POST['url'])) {
+ $clean_url = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['url']), 'WEBURL'));
+ }
+
+ $clean_bid=0;
+ if (isset($_POST['bid'])) {
+ $clean_bid = XoopsFilterInput::clean($_POST['bid'], 'INT');
+ }
+
+ $clean_cid=0;
+ if (isset($_POST['cid'])) {
+ $clean_cid = XoopsFilterInput::clean($_POST['cid'], 'INT');
+ }
+
+} elseif (!empty($_GET['op'])) {
+ // from $_POST we use keys: op, bid, cid
+ $op = trim(XoopsFilterInput::clean($_GET['op'], 'STRING'));
+
+ $clean_bid=0;
+ if (isset($_GET['bid'])) {
+ $clean_bid = XoopsFilterInput::clean($_GET['bid'], 'INT');
+ }
+
+ $clean_cid=0;
+ if (isset($_GET['cid'])) {
+ $clean_cid = XoopsFilterInput::clean($_GET['cid'], 'INT');
+ }
+
}
$myts =& MyTextSanitizer::getInstance();
switch ($op) {
case "click":
- $bid = 0;
- if (!empty($_GET['bid'])) {
- $bid = intval($_GET['bid']);
- }
+ $bid = $clean_bid;
clickbanner($bid);
break;
case "Ok":
@@ -348,8 +387,8 @@
exit();
}
- $_SESSION['banner_login'] = $myts->stripslashesGPC(trim($_POST['login']));
- $_SESSION['banner_pass'] = $myts->stripslashesGPC(trim($_POST['pass']));
+ $_SESSION['banner_login'] = $clean_login;
+ $_SESSION['banner_pass'] = $clean_pass;
}
bannerstats();
break;
@@ -358,26 +397,14 @@
redirect_header("banners.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
exit();
}
- $bid = $cid = 0;
- if (!empty($_POST['url'])) {
- $url = $myts->stripslashesGPC(trim($_POST['url']));
- }
- if (!empty($_POST['bid'])) {
- $bid = intval($_POST['bid']);
- }
- if (!empty($_POST['cid'])) {
- $cid = intval($_POST['cid']);
- }
+ $url = $clean_url;
+ $bid = $clean_bid;
+ $cid = $clean_cid;
change_banner_url_by_client($cid, $bid, $url);
break;
case "EmailStats":
- $bid = $cid = 0;
- if (!empty($_GET['bid'])) {
- $bid = intval($_GET['bid']);
- }
- if (!empty($_GET['cid'])) {
- $cid = intval($_GET['cid']);
- }
+ $bid = $clean_bid;
+ $cid = $clean_cid;
EmailStats($cid, $bid);
break;
case "login":
Added: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php (rev 0)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsfilterinput.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -0,0 +1,433 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/**
+ * Backport of Xmf\FilterInput, using Daniel Morris's original
+ * PHP INPUT FILTER for php4
+ *
+ * @class: XoopsFilterInput (PHP4 & PHP5, with comments)
+ * @project: PHP Input Filter
+ * @date: 10-05-2005
+ * @version: 1.2.2_php4/php5
+ * @author: Daniel Morris
+ * @contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
+ * @author Louis Landry <lou...@jo...>
+ * @author Grégory Mage (Aka Mage)
+ * @author trabis <lus...@gm...>
+ * @author Richard Griffith <ri...@ge...>
+ * @copyright: Daniel Morris
+ * @email: da...@ro...
+ * @license: GNU General Public License (GPL)
+ */
+class XoopsFilterInput {
+ var $tagsArray; // default = empty array
+ var $attrArray; // default = empty array
+
+ var $tagsMethod; // default = 0
+ var $attrMethod; // default = 0
+
+ var $xssAuto; // default = 1
+ var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');
+ var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
+
+ /**
+ * Constructor for XoopsFilterInput class. Only first parameter is required.
+ * @access constructor
+ * @param Array $tagsArray - list of user-defined tags
+ * @param Array $attrArray - list of user-defined attributes
+ * @param int $tagsMethod - 0= allow just user-defined, 1= allow all but user-defined
+ * @param int $attrMethod - 0= allow just user-defined, 1= allow all but user-defined
+ * @param int $xssAuto - 0= only auto clean essentials, 1= allow clean blacklisted tags/attr
+ */
+ function XoopsFilterInput($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) {
+ // make sure user defined arrays are in lowercase
+ for ($i = 0; $i < count($tagsArray); $i++) $tagsArray[$i] = strtolower($tagsArray[$i]);
+ for ($i = 0; $i < count($attrArray); $i++) $attrArray[$i] = strtolower($attrArray[$i]);
+ // assign to member vars
+ $this->tagsArray = (array) $tagsArray;
+ $this->attrArray = (array) $attrArray;
+ $this->tagsMethod = $tagsMethod;
+ $this->attrMethod = $attrMethod;
+ $this->xssAuto = $xssAuto;
+ }
+
+ /**
+ * Returns a reference to an input filter object, only creating it if it doesn't already exist.
+ *
+ * This method must be invoked as:
+ * <pre> $filter = & XoopsFilterInput::getInstance();</pre>
+ *
+ * @param array $tagsArray list of user-defined tags
+ * @param array $attrArray list of user-defined attributes
+ * @param int $tagsMethod WhiteList method = 0, BlackList method = 1
+ * @param int $attrMethod WhiteList method = 0, BlackList method = 1
+ * @param int $xssAuto Only auto clean essentials = 0,
+ * Allow clean blacklisted tags/attr = 1
+ *
+ * @return XoopsFilterInput object.
+ * @since 1.5
+ * @static
+ */
+ static function getInstance(
+ $tagsArray = array(),
+ $attrArray = array(),
+ $tagsMethod = 0,
+ $attrMethod = 0,
+ $xssAuto = 1
+ ) {
+ static $instances;
+
+ $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto)));
+
+ if (!isset ($instances)) {
+ $instances = array();
+ }
+
+ if (empty ($instances[$sig])) {
+ $instances[$sig] = new XoopsFilterInput($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto);
+ }
+
+ return $instances[$sig];
+ }
+
+ /**
+ * Method to be called by another php script. Processes for XSS and specified bad code.
+ * @access public
+ * @param Mixed $source - input string/array-of-string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function process($source) {
+ // clean all elements in this array
+ if (is_array($source)) {
+ foreach($source as $key => $value)
+ // filter element for XSS and other 'bad' code etc.
+ if (is_string($value)) $source[$key] = $this->remove($this->decode($value));
+ return $source;
+ // clean this string
+ } else if (is_string($source)) {
+ // filter source for XSS and other 'bad' code etc.
+ return $this->remove($this->decode($source));
+ // return parameter as given
+ } else return $source;
+ }
+
+ /**
+ * Method to be called by another php script. Processes for XSS and
+ * specified bad code.
+ *
+ * @param mixed $source Input string/array-of-string to be 'cleaned'
+ * @param string $type Return type for the variable (INT, FLOAT,
+ * BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING,
+ * ARRAY, PATH, NONE)
+ *
+ * @return mixed 'Cleaned' version of input parameter
+ * @static
+ */
+ static function clean($source, $type = 'string')
+ {
+ // Handle the type constraint
+ switch (strtoupper($type)) {
+ case 'INT':
+ case 'INTEGER':
+ // Only use the first integer value
+ preg_match('/-?[0-9]+/', (string) $source, $matches);
+ $result = @ (int) $matches[0];
+ break;
+
+ case 'FLOAT':
+ case 'DOUBLE':
+ // Only use the first floating point value
+ preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches);
+ $result = @ (float) $matches[0];
+ break;
+
+ case 'BOOL':
+ case 'BOOLEAN':
+ $result = (bool) $source;
+ break;
+
+ case 'WORD':
+ $result = (string) preg_replace('/[^A-Z_]/i', '', $source);
+ break;
+
+ case 'ALNUM':
+ $result = (string) preg_replace('/[^A-Z0-9]/i', '', $source);
+ break;
+
+ case 'CMD':
+ $result = (string) preg_replace('/[^A-Z0-9_\.-]/i', '', $source);
+ $result = ltrim($result, '.');
+ break;
+
+ case 'BASE64':
+ $result = (string) preg_replace('/[^A-Z0-9\/+=]/i', '', $source);
+ break;
+
+ case 'STRING':
+ // Check for static usage and assign $filter the proper variable
+ if (isset($this) && is_a($this, 'XoopsFilterInput')) {
+ $filter =& $this;
+ } else {
+ $filter = XoopsFilterInput::getInstance();
+ }
+ $result = (string) $filter->process($source);
+ break;
+
+ case 'ARRAY':
+ // Check for static usage and assign $filter the proper variable
+ if (isset($this) && is_a($this, 'XoopsFilterInput')) {
+ $filter =& $this;
+ } else {
+ $filter = XoopsFilterInput::getInstance();
+ }
+ $result = (array) $filter->process($source);
+ break;
+
+ case 'PATH':
+ $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/';
+ preg_match($pattern, (string) $source, $matches);
+ $result = @ (string) $matches[0];
+ break;
+
+ case 'USERNAME':
+ $result = (string) preg_replace('/[\x00-\x1F\x7F<>"\'%&]/', '', $source);
+ break;
+
+ case 'WEBURL':
+ // Check for static usage and assign $filter the proper variable
+ if (isset($this) && is_a($this, 'XoopsFilterInput')) {
+ $filter =& $this;
+ } else {
+ $filter = XoopsFilterInput::getInstance();
+ }
+ $result = (string) $filter->process($source);
+ // allow only relative, http or https
+ $urlparts=parse_url($result);
+ if (!empty($urlparts['scheme'])
+ && !($urlparts['scheme']=='http' || $urlparts['scheme']=='https')
+ ) {
+ $result='';
+ }
+ // do not allow quotes or tag brackets
+ if (!preg_match('#^[^"<>]+$#', $result)) {
+ $result='';
+ }
+ break;
+
+ default:
+ // Check for static usage and assign $filter the proper variable
+ if (isset($this) && is_a($this, 'XoopsFilterInput')) {
+ $filter =& $this;
+ } else {
+ $filter = XoopsFilterInput::getInstance();
+ }
+ $result = $filter->process($source);
+ break;
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Internal method to iteratively remove all unwanted tags and attributes
+ * @access protected
+ * @param String $source - input string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function remove($source) {
+ $loopCounter=0;
+ // provides nested-tag protection
+ while($source != $this->filterTags($source)) {
+ $source = $this->filterTags($source);
+ $loopCounter++;
+ }
+ return $source;
+ }
+
+ /**
+ * Internal method to strip a string of certain tags
+ * @access protected
+ * @param String $source - input string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function filterTags($source) {
+ // filter pass setup
+ $preTag = NULL;
+ $postTag = $source;
+ // find initial tag's position
+ $tagOpen_start = strpos($source, '<');
+ // interate through string until no tags left
+ while($tagOpen_start !== FALSE) {
+ // process tag interatively
+ $preTag .= substr($postTag, 0, $tagOpen_start);
+ $postTag = substr($postTag, $tagOpen_start);
+ $fromTagOpen = substr($postTag, 1);
+ // end of tag
+ $tagOpen_end = strpos($fromTagOpen, '>');
+ if ($tagOpen_end === false) break;
+ // next start of tag (for nested tag assessment)
+ $tagOpen_nested = strpos($fromTagOpen, '<');
+ if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {
+ $preTag .= substr($postTag, 0, ($tagOpen_nested+1));
+ $postTag = substr($postTag, ($tagOpen_nested+1));
+ $tagOpen_start = strpos($postTag, '<');
+ continue;
+ }
+ $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1);
+ $currentTag = substr($fromTagOpen, 0, $tagOpen_end);
+ $tagLength = strlen($currentTag);
+ if (!$tagOpen_end) {
+ $preTag .= $postTag;
+ $tagOpen_start = strpos($postTag, '<');
+ }
+ // iterate through tag finding attribute pairs - setup
+ $tagLeft = $currentTag;
+ $attrSet = array();
+ $currentSpace = strpos($tagLeft, ' ');
+ // is end tag
+ if (substr($currentTag, 0, 1) == "/") {
+ $isCloseTag = TRUE;
+ list($tagName) = explode(' ', $currentTag);
+ $tagName = substr($tagName, 1);
+ // is start tag
+ } else {
+ $isCloseTag = FALSE;
+ list($tagName) = explode(' ', $currentTag);
+ }
+ // excludes all "non-regular" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted
+ if ((!preg_match("/^[a-z][a-z0-9]*$/i",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) {
+ $postTag = substr($postTag, ($tagLength + 2));
+ $tagOpen_start = strpos($postTag, '<');
+ // don't append this tag
+ continue;
+ }
+ // this while is needed to support attribute values with spaces in!
+ while ($currentSpace !== FALSE) {
+ $fromSpace = substr($tagLeft, ($currentSpace+1));
+ $nextSpace = strpos($fromSpace, ' ');
+ $openQuotes = strpos($fromSpace, '"');
+ $closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '"') + $openQuotes + 1;
+ // another equals exists
+ if (strpos($fromSpace, '=') !== FALSE) {
+ // opening and closing quotes exists
+ if (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '"') !== FALSE))
+ $attr = substr($fromSpace, 0, ($closeQuotes+1));
+ // one or neither exist
+ else $attr = substr($fromSpace, 0, $nextSpace);
+ // no more equals exist
+ } else $attr = substr($fromSpace, 0, $nextSpace);
+ // last attr pair
+ if (!$attr) $attr = $fromSpace;
+ // add to attribute pairs array
+ $attrSet[] = $attr;
+ // next inc
+ $tagLeft = substr($fromSpace, strlen($attr));
+ $currentSpace = strpos($tagLeft, ' ');
+ }
+ // appears in array specified by user
+ $tagFound = in_array(strtolower($tagName), $this->tagsArray);
+ // remove this tag on condition
+ if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {
+ // reconstruct tag with allowed attributes
+ if (!$isCloseTag) {
+ $attrSet = $this->filterAttr($attrSet);
+ $preTag .= '<' . $tagName;
+ for ($i = 0; $i < count($attrSet); $i++)
+ $preTag .= ' ' . $attrSet[$i];
+ // reformat single tags to XHTML
+ if (strpos($fromTagOpen, "</" . $tagName)) $preTag .= '>';
+ else $preTag .= ' />';
+ // just the tagname
+ } else $preTag .= '</' . $tagName . '>';
+ }
+ // find next tag's start
+ $postTag = substr($postTag, ($tagLength + 2));
+ $tagOpen_start = strpos($postTag, '<');
+ }
+ // append any code after end of tags
+ $preTag .= $postTag;
+ return $preTag;
+ }
+
+ /**
+ * Internal method to strip a tag of certain attributes
+ * @access protected
+ * @param Array $attrSet
+ * @return Array $newSet
+ */
+ function filterAttr($attrSet) {
+ $newSet = array();
+ // process attributes
+ for ($i = 0; $i <count($attrSet); $i++) {
+ // skip blank spaces in tag
+ if (!$attrSet[$i]) continue;
+ // split into attr name and value
+ $attrSubSet = explode('=', trim($attrSet[$i]));
+ list($attrSubSet[0]) = explode(' ', $attrSubSet[0]);
+ // removes all "non-regular" attr names AND also attr blacklisted
+ if ((!eregi("^[a-z]*$",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
+ continue;
+ // xss attr value filtering
+ if ($attrSubSet[1]) {
+ // strips unicode, hex, etc
+ $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);
+ // strip normal newline within attr value
+ $attrSubSet[1] = preg_replace('/\s+/', '', $attrSubSet[1]);
+ // strip double quotes
+ $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]);
+ // [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)
+ if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'"))
+ $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));
+ // strip slashes
+ $attrSubSet[1] = stripslashes($attrSubSet[1]);
+ }
+ // auto strip attr's with "javascript:
+ if ( ((strpos(strtolower($attrSubSet[1]), 'expression') !== false) && (strtolower($attrSubSet[0]) == 'style')) ||
+ (strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'livescript:') !== false)
+ ) continue;
+
+ // if matches user defined array
+ $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);
+ // keep this attr on condition
+ if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {
+ // attr has value
+ if ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"';
+ // attr has decimal zero as value
+ else if ($attrSubSet[1] == "0") $newSet[] = $attrSubSet[0] . '="0"';
+ // reformat single attributes to XHTML
+ else $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"';
+ }
+ }
+ return $newSet;
+ }
+
+ /**
+ * Try to convert to plaintext
+ * @access protected
+ * @param String $source
+ * @return String $source
+ */
+ function decode($source) {
+ // url decode
+ $charset = defined('_CHARSET') ? constant('_CHARSET') : 'utf-8';
+ $source = html_entity_decode($source, ENT_QUOTES, $charset);
+ // convert decimal
+ $source = preg_replace('/&#(\d+);/me',"chr(\\1)", $source); // decimal notation
+ // convert hex
+ $source = preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)", $source); // hex notation
+ return $source;
+ }
+}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsload.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsload.php 2013-09-22 15:55:58 UTC (rev 12082)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/xoopsload.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -204,6 +204,7 @@
'xoopsformeditor' => XOOPS_ROOT_PATH . '/class/xoopsform/formeditor.php',
'xoopsformselecteditor' => XOOPS_ROOT_PATH . '/class/xoopsform/formselecteditor.php',
'xoopsformcalendar' => XOOPS_ROOT_PATH . '/class/xoopsform/formcalendar.php',
+ 'xoopsfilterinput' => XOOPS_ROOT_PATH . '/class/xoopsfilterinput.php',
);
}
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/checklogin.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/checklogin.php 2013-09-22 15:55:58 UTC (rev 12082)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/checklogin.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -20,8 +20,27 @@
xoops_loadLanguage('user');
-$uname = !isset($_POST['uname']) ? '' : trim($_POST['uname']);
-$pass = !isset($_POST['pass']) ? '' : trim($_POST['pass']);
+// from $_POST we use keys: uname, pass, rememberme, xoops_redirect
+XoopsLoad::load('XoopsFilterInput');
+$clean_uname = '';
+if (isset($_POST['uname'])) {
+ $clean_uname = trim(XoopsFilterInput::clean($_POST['uname'], 'STRING'));
+}
+$clean_pass = '';
+if (isset($_POST['pass'])) {
+ $clean_pass = trim(XoopsFilterInput::clean($_POST['pass'], 'STRING'));
+}
+$clean_rememberme = '';
+if (isset($_POST['rememberme'])) {
+ $clean_rememberme = trim(XoopsFilterInput::clean($_POST['rememberme'], 'STRING'));
+}
+$clean_redirect = '';
+if (isset($_POST['xoops_redirect'])) {
+ $clean_redirect = trim(XoopsFilterInput::clean($_POST['xoops_redirect'], 'WEBURL'));
+}
+
+$uname = $clean_uname;
+$pass = $clean_pass;
if ($uname == '' || $pass == '') {
redirect_header(XOOPS_URL.'/user.php', 1, _US_INCORRECTLOGIN);
exit();
@@ -70,15 +89,15 @@
// Set cookie for rememberme
if (!empty($xoopsConfig['usercookie'])) {
- if (!empty($_POST["rememberme"])) {
+ if (!empty($clean_rememberme)) {
setcookie($xoopsConfig['usercookie'], $_SESSION['xoopsUserId'] . '{-}' . md5($user->getVar('pass') . XOOPS_DB_NAME . XOOPS_DB_PASS . XOOPS_DB_PREFIX), time() + 31536000, '/', XOOPS_COOKIE_DOMAIN, 0);
} else {
setcookie($xoopsConfig['usercookie'], 0, -1, '/', XOOPS_COOKIE_DOMAIN, 0);
}
}
- if (!empty($_POST['xoops_redirect']) && !strpos($_POST['xoops_redirect'], 'register')) {
- $xoops_redirect = trim(rawurldecode($_POST['xoops_redirect']));
+ if (!empty($clean_redirect) && !strpos($clean_redirect, 'register')) {
+ $xoops_redirect = rawurldecode($clean_redirect);
$parsed = parse_url(XOOPS_URL);
$url = isset($parsed['scheme']) ? $parsed['scheme'].'://' : 'http://';
if (isset( $parsed['host'])) {
@@ -90,7 +109,7 @@
$url .= $_SERVER['HTTP_HOST'];
}
if (@$parsed['path']) {
- if (strncmp($parsed['path'], $xoops_redirect, strlen( $parsed['path']))) {
+ if (strncmp($parsed['path'], $xoops_redirect, strlen($parsed['path']))) {
$url .= $parsed['path'];
}
}
@@ -105,9 +124,9 @@
$notification_handler->doLoginMaintenance($user->getVar('uid'));
redirect_header($url, 1, sprintf(_US_LOGGINGU, $user->getVar('uname')), false);
-} else if (empty($_POST['xoops_redirect'])) {
+} else if (empty($clean_redirect)) {
redirect_header(XOOPS_URL . '/user.php', 5, $xoopsAuth->getHtmlErrors());
} else {
- redirect_header(XOOPS_URL . '/user.php?xoops_redirect=' . urlencode(trim($_POST['xoops_redirect'])), 5, $xoopsAuth->getHtmlErrors(), false);
+ redirect_header(XOOPS_URL . '/user.php?xoops_redirect=' . urlencode($clean_redirect), 5, $xoopsAuth->getHtmlErrors(), false);
}
exit();
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/register.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/register.php 2013-09-22 15:55:58 UTC (rev 12082)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/register.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -45,17 +45,72 @@
return XoopsUserUtility::validate($uname, $email, $pass, $vpass);
}
-$op = isset($_POST['op']) ? $_POST['op'] : (isset($_GET["op"]) ? $_GET["op"] : 'register');
-$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
-$email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
-$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
-$pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
-$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
-$timezone_offset = isset($_POST['timezone_offset']) ? (float) $_POST['timezone_offset'] : $xoopsConfig['default_TZ'];
-$user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 1 : 0;
-$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 1 : 0;
-$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 1 : 0;
+XoopsLoad::load('XoopsFilterInput');
+// from $_POST we use keys: op, uname, email, url, pass, vpass, timezone_offset,
+// user_viewemail, user_mailok, agree_disc
+$op='register';
+if (isset($_POST['op'])) {
+ $op = trim(XoopsFilterInput::clean($_POST['op'], 'STRING'));
+}
+$uname='';
+if (isset($_POST['uname'])) {
+ $uname = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['uname']), 'STRING'));
+}
+
+$email='';
+if (isset($_POST['email'])) {
+ $email = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['email']), 'STRING'));
+}
+
+$url='';
+if (isset($_POST['url'])) {
+ $url = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['url']), 'WEBURL'));
+}
+
+$pass='';
+if (isset($_POST['pass'])) {
+ $pass = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['pass']), 'STRING'));
+}
+
+$vpass='';
+if (isset($_POST['vpass'])) {
+ $vpass = trim(XoopsFilterInput::clean($myts->stripSlashesGPC($_POST['vpass']), 'STRING'));
+}
+
+$timezone_offset=$xoopsConfig['default_TZ'];
+if (isset($_POST['timezone_offset'])) {
+ $timezone_offset = XoopsFilterInput::clean($_POST['timezone_offset'], 'FLOAT');
+}
+
+$user_viewemail=false;
+if (isset($_POST['user_viewemail'])) {
+ $user_viewemail = XoopsFilterInput::clean($_POST['user_viewemail'], 'BOOL');
+}
+
+$user_mailok=false;
+if (isset($_POST['user_mailok'])) {
+ $user_mailok = XoopsFilterInput::clean($_POST['user_mailok'], 'BOOL');
+}
+
+$agree_disc=false;
+if (isset($_POST['agree_disc'])) {
+ $agree_disc = XoopsFilterInput::clean($_POST['agree_disc'], 'BOOL');
+}
+
+// from $_GET we may use keys: op, id, actkey
+$clean_id='';
+$clean_actkey='';
+if (!isset($_POST['op']) && isset($_GET['op'])) {
+ $op = XoopsFilterInput::clean($_GET['op'], 'STRING');
+ if (isset($_GET['id'])) {
+ $clean_id = XoopsFilterInput::clean($_GET['id'], 'INT');
+ }
+ if (isset($_GET['actkey'])) {
+ $clean_actkey = XoopsFilterInput::clean($_GET['actkey'], 'STRING');
+ }
+}
+
switch ($op) {
case 'newuser':
$xoopsOption['xoops_pagetitle'] = _US_USERREG;
@@ -214,8 +269,8 @@
case 'actv':
case 'activate':
- $id = intval($_GET['id']);
- $actkey = trim($_GET['actkey']);
+ $id = $clean_id;
+ $actkey = $clean_actkey;
if (empty($id)) {
redirect_header('index.php', 1, '');
exit();
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/user.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/user.php 2013-09-22 15:55:58 UTC (rev 12082)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/user.php 2013-09-22 21:44:50 UTC (rev 12083)
@@ -28,13 +28,32 @@
xoops_loadLanguage('user');
+XoopsLoad::load('XoopsFilterInput');
$op = 'main';
if (isset($_POST['op'])) {
- $op = trim($_POST['op']);
+ // from $_POST we use keys: op, ok
+ $op = trim(XoopsFilterInput::clean($_POST['op']));
+ $clean_ok=false;
+ if (isset($_POST['ok'])) {
+ $clean_ok = XoopsFilterInput::clean($_POST['ok'], 'BOOLEAN');
+ }
} elseif (isset($_GET['op'])) {
- $op = trim($_GET['op']);
+ // from $_GET we may use keys: op, xoops_redirect, id, actkey
+ $op = trim(XoopsFilterInput::clean($_GET['op']));
+ $clean_redirect = '';
+ if (isset($_GET['xoops_redirect'])) {
+ $clean_redirect = XoopsFilterInput::clean($_GET['xoops_redirect'], 'WEBURL');
+ }
+ if (isset($_GET['id'])) {
+ $clean_id = XoopsFilterInput::clean($_GET['id'], 'INT');
+ }
+ if (isset($_GET['actkey'])) {
+ $clean_actkey = XoopsFilterInput::clean($_GET['actkey'], 'STRING');
+ }
}
+
+
if ($op == 'login') {
include_once $GLOBALS['xoops']->path('include/checklogin.php');
exit();
@@ -49,8 +68,8 @@
$xoTheme->addMeta('meta', 'description', _US_LOSTPASSWORD . " " . _US_NOPROBLEM);
$xoopsTpl->assign('lang_login', _LOGIN);
$xoopsTpl->assign('lang_username', _USERNAME);
- if (isset($_GET['xoops_redirect'])) {
- $xoopsTpl->assign('redirect_page', htmlspecialchars(trim($_GET['xoops_redirect']), ENT_QUOTES));
+ if (!empty($clean_redirect)) {
+ $xoopsTpl->assign('redirect_page', htmlspecialchars(trim($clean_redirect), ENT_QUOTES));
}
if ($xoopsConfig['usercookie']) {
$xoopsTpl->assign('lang_rememberme', _US_REMEMBERME);
@@ -65,8 +84,8 @@
include $GLOBALS['xoops']->path('footer.php');
exit();
}
- if (!empty($_GET['xoops_redirect'])) {
- $redirect = trim($_GET['xoops_redirect']);
+ if (!empty($clean_redirect)) {
+ $redirect = trim($clean_redirect);
$isExternal = false;
if ($pos = strpos($redirect, '://')) {
$xoopsLocation = substr(XOOPS_URL, strpos(XOOPS_URL, '://') + 3);
@@ -102,58 +121,10 @@
if ($op == 'actv') {
$GLOBALS['xoopsLogger']->addDeprecated("Deprecated code. The activation is now handled by register.php");
- $id = intval($_GET['id']);
- $actkey = trim($_GET['actkey']);
+ $id = isset($clean_id) ? $clean_id : 0;
+ $actkey = isset($clean_actkey) ? $clean_actkey : '';
redirect_header("register.php?id={$id}&actkey={$actkey}", 1, '');
exit();
-
- if (empty($id)) {
- redirect_header('index.php', 1, '');
-// exit();
- }
- $member_handler =& xoops_gethandler('member');
- $thisuser =& $member_handler->getUser($id);
- if (!is_object($thisuser)) {
- exit();
- }
- if ($thisuser->getVar('actkey') != $actkey) {
- redirect_header('index.php', 5, _US_ACTKEYNOT);
- } else {
- if ($thisuser->getVar('level') > 0) {
- redirect_header('user.php', 5, _US_ACONTACT, false);
- } else {
- if (false != $member_handler->activateUser($thisuser)) {
- $config_handler =& xoops_gethandler('config');
- $xoopsConfigUser = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
- if ($xoopsConfigUser['activation_type'] == 2) {
- $myts =& MyTextSanitizer::getInstance();
- $xoopsMailer =& xoops_getMailer();
- $xoopsMailer->useMail();
- $xoopsMailer->setTemplate('activated.tpl');
- $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
- $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
- $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
- $xoopsMailer->setToUsers($thisuser);
- $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
- $xoopsMailer->setFromName($xoopsConfig['sitename']);
- $xoopsMailer->setSubject(sprintf(_US_YOURACCOUNT, $xoopsConfig['sitename']));
- include $GLOBALS['xoops']->path('header.php');
- if (!$xoopsMailer->send()) {
- printf(_US_ACTVMAILNG, $thisuser->getVar('uname'));
- } else {
- printf(_US_ACTVMAILOK, $thisuser->getVar('uname'));
- }
- include $GLOBALS['xoops']->path('footer.php');
- } else {
- redirect_header('user.php', 5, _US_ACTLOGIN, false);
- }
- } else {
- //TODO remove hardcoded string
- redirect_header('index.php', 5, 'Activation failed!');
- }
- }
- }
- exit();
}
if ($op == 'delete') {
@@ -169,13 +140,13 @@
redirect_header('user.php', 5, _US_ADMINNO);
exit();
}
- $ok = !isset($_POST['ok']) ? 0 : intval($_POST['ok']);
- if ($ok != 1) {
+ if (!$clean_ok) {
include $GLOBALS['xoops']->path('header.php');
xoops_confirm(
array('op' => 'delete', 'ok' => 1),
'user.php',
- _US_SURETODEL . '<br/>' . _US_REMOVEINFO);
+ _US_SURETODEL . '<br/>' . _US_REMOVEINFO
+ );
include $GLOBALS['xoops']->path('footer.php');
} else {
$del_uid = $xoopsUser->getVar("uid");
|
|
From: <txm...@us...> - 2013-09-22 15:56:03
|
Revision: 12082
http://sourceforge.net/p/xoops/svn/12082
Author: txmodxoops
Date: 2013-09-22 15:55:58 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Updated to Beta 2
Now forked on GitHub
https://github.com/txmodxoops/TDMCreate-v1.39-Beta2
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_css_style.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_help_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_install.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_main_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_modinfo_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/My Module_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_helper.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_request.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
echo $adminMenu->addNavigation('about.php');
echo $adminMenu->renderabout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: building.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
if (isset($_REQUEST['mod_name'])) {
@@ -30,6 +30,8 @@
$mod_name = strtolower($modules->getVar('mod_name'));
$mod_author_website_name = $modules->getVar('mod_author_website_name');
$mod_author_website_url = $modules->getVar('mod_author_website_url');
+$mod_user = $modules->getVar('mod_user');
+$mod_notifications = $modules->getVar('mod_notifications');
$mod_permissions = $modules->getVar('mod_permissions');
if (isset($_REQUEST['table_name'])) {
@@ -55,7 +57,7 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
// Debut
- TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_OK, _AM_TDMCREATE_BUILDING_NOTOK);
+ TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED);
/************************************************/
/*Structure*/
/************************************************/
@@ -64,13 +66,13 @@
//Creation of changelog.txt
const_changelog($modules);
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
+ $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
foreach (array_keys($tables_arr) as $i)
{
// Variables
- $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$table_category = $tables_arr[$i]->getVar('table_category');
$table_fields = $tables_arr[$i]->getVar('table_fields');
@@ -86,14 +88,14 @@
$table_waiting = $tables_arr[$i]->getVar('table_waiting');
// Fabrication
- // Copy of images tables
+ // Copy of images tables
$table_image1 = $modPath . '/images/uploads/tables/' . $table_image;
if (file_exists($table_image1)) {
copy($table_image1, $modPath . '/modules/' . $mod_name . '/images/icons/32/' . $table_image);
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $table_permissions, $category);
}
// Creation of pages admin
if ( $table_admin == 1 ) {
@@ -113,7 +115,7 @@
const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of the file mysql.sql
- const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
+ const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
// Creation of blocks
if ( $table_blocks == 1 ) {
@@ -125,8 +127,18 @@
if ( $table_permissions == 1) {
const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
}
- }
- //Creation of architecture of more fields and data
+ }
+ $table_name = isset($table_name) ? $table_name : null;
+ $table_comments = isset($table_comments) ? $table_comments : null;
+ $table_waiting = isset($table_waiting) ? $table_waiting : null;
+ $table_parameters = isset($table_parameters) ? $table_parameters : null;
+ $table_user = isset($table_user) ? $table_user : null;
+ $table_admin = isset($table_admin) ? $table_admin : null;
+ $table_fields = isset($table_fields) ? $table_fields : null;
+ $table_blocks = isset($table_blocks) ? $table_blocks : null;
+ $table_image = isset($table_image) ? $table_image : null;
+ $table_notifications = isset($table_notifications) ? $table_notifications : null;
+ //Creation of architecture of more fields and data
//const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
// Creation of comments
if ( $table_comments == 1 ) {
@@ -137,16 +149,20 @@
// Creation of Waiting Plugin
const_waiting($modules, $tables_arr);
}
+ // Creation of class helper & request
+ if ( $table_name != '' ) {
+ const_class_helper($modules);
+ const_class_request($modules);
+ }
// Creation of xoopsversion.php
- const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $tables_arr);
- if ( $table_user == 1 && $table_name != null ) {
- // Creation of template index
- const_templates_index($modules);
- // Creation of template header
- const_templates_header($modules, $tables_arr);
- // Creation of template footer
- const_templates_footer($modules, $table_comments, $table_notifications);
- }
+ const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $table_image, $tables_arr);
+ // Creation of template index
+ const_templates_index($modules);
+ // Creation of template header
+ const_templates_header($modules, $tables_arr);
+ // Creation of template footer
+ const_templates_footer($modules, $table_comments, $table_notifications);
+
if ( $table_admin == 1 ) {
// Creation of template admin about
const_templates_admin_about($modules);
@@ -163,15 +179,15 @@
const_include_install($modules, $tables_arr);
// Language
///////////////////////////////////////////////////////////////////////
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
//Creation of language main.php
const_main_language($modules, $tables_arr);
}
// Creation of language modinfo.php
- const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $category);
+ const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $mod_notifications);
if ( $table_admin == 1 ) {
// Creation of language admin.php
- const_admin_language($modules, $tables_arr, $category);
+ const_admin_language($modules, $tables_arr, $mod_permissions);
}
if ( $table_blocks == 1 ) {
// Creation of language blocks.php
@@ -186,19 +202,19 @@
/*Admin*/
/************************************************/
// Creation of admin header.php
- const_admin_header($modules, $tables_arr);
+ const_admin_header($modules, $table_name, $tables_arr);
// Creation of admin index.php
- const_admin_index($modules, $table_name, $tables_arr);
+ const_admin_index($modules, $tables_arr);
// Creation of admin footer.php
const_admin_footer($modules);
// Creation of admin menu.php
- const_admin_menu($modules, $tables_arr, $category);
+ const_admin_menu($modules, $tables_arr, $mod_permissions);
// Creation of admin about.php
const_admin_about($modules);
/************************************************/
/*User*/
/************************************************/
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
const_user_header($modules);
const_user_index($modules);
}
@@ -217,8 +233,8 @@
$form->addElement($mod_select, true);
$form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
$form->display();
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -0,0 +1,26 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: footer.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+echo "<div align='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
+ <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+xoops_cp_footer();
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -0,0 +1,54 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: header.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once('../include/functions.php');
+include_once 'includes.php';
+//
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+//
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+
+// Get class handler
+$modulesHandler =& xoops_getModuleHandler('modules', $thisDirname);
+$tablesHandler =& xoops_getModuleHandler('tables', $thisDirname);
+//
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+//
+$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16);
+$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
+//Load languages
+xoops_loadLanguage('admin', $thisDirname);
+xoops_loadLanguage('modinfo', $thisDirname);
+xoops_loadLanguage('main', $thisDirname);
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -39,6 +39,8 @@
include_once $cPath.'/const_blocks.php';
include_once $cPath.'/const_blocks_templates.php';
include_once $cPath.'/const_class.php';
+include_once $cPath.'/const_class_helper.php';
+include_once $cPath.'/const_class_request.php';
include_once $cPath.'/const_admin_header.php';
include_once $cPath.'/const_admin_footer.php';
include_once $cPath.'/const_admin_menu.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -1,33 +1,32 @@
<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
- * ****************************************************************************
- * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * tdmcreate module
*
- * Cette licence, contient des limitations!!!
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @license TDM GPL license
- * @author TDM TEAM DEV MODULE
- *
- * ****************************************************************************
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMMODULES. "</label>", $count_modules, 'Green') ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMTABLES. "</label>", $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
echo $adminMenu->addNavigation('index.php');
echo $adminMenu->renderIndex();
-
-include "admin_footer.php";
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,12 +18,12 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: modules.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'list', 'string' );
echo $adminMenu->addNavigation('modules.php');
switch ($op)
{
- case "save":
+ case 'save':
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
@@ -33,28 +33,30 @@
} else {
$obj =& $modulesHandler->create();
}
- //Image
+ //Image 'gif|jpeg|pjpeg|png' 500000
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/modules/";
- $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null);
+ $uploaddir = XOOPS_ROOT_PATH . '/modules/'.$xoopsModule->dirname().'/images/uploads/modules/';
+ $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes', $thisDirname),
+ xoops_getModuleOption('maxsize', $thisDirname), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']) ;
- $name_img = $_REQUEST['mod_name'].'_slogo.'.$extension;
- $uploader->setTargetFileName($name_img);
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $img_name = $obj->getVar('mod_name').'_slogo.'.$extension;
+ $uploader->setTargetFileName($img_name);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header("javascript:history.go(-1)",3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
$obj->setVar('mod_image', $uploader->getSavedFileName());
}
} else {
$obj->setVar('mod_image', $_POST['mod_image']);
}
- //remove all spaces from the new name
- $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name']));
+
+ $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name'])); //remove all spaces from the new name
$obj->setVar('mod_version', $_POST['mod_version']);
+ $obj->setVar('mod_since', $_POST['mod_since']);
$obj->setVar('mod_min_php', $_POST['mod_min_php']);
$obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
$obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
@@ -93,18 +95,18 @@
}
break;
- case "new":
+ case 'new':
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
echo $adminMenu->renderButton();
$obj =& $modulesHandler->create();
$form = $obj->getForm();
break;
- case "edit":
+ case 'edit':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
break;
- case "delete":
+ case 'delete':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
{
@@ -121,7 +123,7 @@
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
- case "list":
+ case 'list':
default:
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
echo $adminMenu->renderButton();
@@ -181,4 +183,4 @@
}
break;
}
-include_once "admin_footer.php";
\ No newline at end of file
+include_once 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: tables.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
switch ($op) {
@@ -190,7 +190,7 @@
$uploader = new XoopsMediaUploader($uploaddir, 'gif|jpeg|pjpeg|png', 104857600, null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
$name_img = $_REQUEST['table_name'].'.'.$extension;
$uploader->setTargetFileName($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
@@ -247,8 +247,10 @@
break;
case "edit_table":
- $obj =& $tablesHandler->get($_REQUEST['table_id']);
- $form = $obj->getFormTable();
+ $table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0);
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
+ $obj =& $tablesHandler->get($table_id);
+ $form = $obj->getFormTable(false, $table_mid);
break;
case "edit_fields":
@@ -344,13 +346,14 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
-
+
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
$obj =& $tablesHandler->create();
- $form = $obj->getFormTable();
+ $form = $obj->getFormTable(false, $table_mid);
break;
- case "create_category":
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
+ case "create_category":
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
@@ -363,7 +366,7 @@
break;
case "table_list":
- default:
+ default:
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
echo $adminMenu->renderButton();
@@ -474,4 +477,4 @@
}
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -25,11 +25,13 @@
$file = 'about.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include \'header.php\';
-echo $adminMenu->addNavigation(\'about.php\');
-echo $adminMenu->renderabout(\''.$modules->getVar('mod_donations').'\', false);
-include \'footer.php\';';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude 'header.php';
+echo \$adminMenu->addNavigation('about.php');
+echo \$adminMenu->renderAbout('{$modules->getVar('mod_donations')}', false);
+include 'footer.php';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -27,16 +27,15 @@
$file = 'footer.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-echo "<div align=\'center\'><a href=\'http://www.xoops.org\' title=\'Visit XOOPS\' target=\'_blank\'>
- <img src=\'".$pathIcon32."/xoopsmicrobutton.gif\' alt=\'XOOPS\' /></a>
- <a href=\'http://www.txmodxoops.org\' title=\'Visit TXMod Xoops\' rel=\'external\'>
- <img src=\'../images/txmodxoops_logo.png\' alt=\'TXMod Xoops\' /></a></div>";
-echo "<div class=\'center smallsmall italic pad5\'>
- <strong>" . $xoopsModule->getVar(\'name\') . "</strong> ".'.$language.'MAINTAINEDBY."
- <a href=\''.$modules->getVar("mod_support_url").'\' title=\'Visit '.$mod_support_name.'\' class=\'tooltip\' rel=\'external\'>'.$mod_support_name.'</a></div>";
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".\$sysPathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . \$xoopsModule->getVar('name') . "</strong> ".{$language}MAINTAINEDBY."
+ <a href='{$modules->getVar('mod_support_url')}' title='Visit {$mod_support_name}' class='tooltip' rel='external'>{$mod_support_name}</a></div>";
xoops_cp_footer();
-';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -19,25 +19,37 @@
* @version $Id: const_admin_header.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_header($modules, $tables_arr)
+function const_admin_header($modules, $table_name, $tables_arr)
{
$mod_name = $modules->getVar('mod_name');
$file = 'header.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
+ $ucfmod_name = ucfirst($mod_name);
$text = '<?php'.const_header($modules, $file).
<<<EOT
\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
-\$thisPath = basename(dirname(dirname(__FILE__)));
+\$thisPath = dirname(dirname(__FILE__));
include_once \$thisPath.'/include/common.php';
include_once \$thisPath.'/include/functions.php';
+EOT;
+if ( $table_name != '' ) {
+$text .= <<<EOT
+\ninclude_once \$thisPath.'/class/helper.php';
+// Get instance
+\${$ucfmod_name} = {$ucfmod_name}::getInstance();
+EOT;
+}
+$text .= <<<EOT
+\n\n\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
-\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
+\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
+\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
+\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-\$pathIcon16 = '../' . \$xoopsModule->getInfo('icons16');
-\$pathIcon32 = '../' . \$xoopsModule->getInfo('icons32');
-\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//load handlers\n
+\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
+\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');
+
EOT;
foreach (array_keys($tables_arr) as $i)
{
@@ -45,14 +57,18 @@
$text .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
}
$text .=<<<EOT
-\$myts =& MyTextSanitizer::getInstance();
+\n\n\$myts =& MyTextSanitizer::getInstance();
if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
\$xoopsTpl = new XoopsTpl();
}
+// System icons path
+\$xoopsTpl->assign('sysPathIcon16', \$sysPathIcon16);
+\$xoopsTpl->assign('sysPathIcon32', \$sysPathIcon32);
+// Local icons path
+\$xoopsTpl->assign('modPathIcon16', \$modPathIcon16);
+\$xoopsTpl->assign('modPathIcon32', \$modPathIcon32);
-\$xoopsTpl->assign('pathIcon16', \$pathIcon16);
-\$xoopsTpl->assign('pathIcon32', \$pathIcon32);
//Load languages
xoops_loadLanguage('admin', \$thisModule);
xoops_loadLanguage('modinfo', \$thisModule);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -19,16 +19,17 @@
* @version $Id: const_admin_help.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_help($modules, $modules_name)
+function const_admin_help($modules)
{
$file = 'help.php';
- $path_file = TDM_CREATE_MURL.'/'.$modules_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include \'admin_header.php\';
-xoops_loadLanguage(\'help\', $xoopsModule->getVar(\'dirname\', \'e\'));
-$xoopsTpl->display(\'db:admin/\' . $xoopsModule->getVar("dirname") . \'_admin_help.html\');
-include \'footer.php\';
-?>';
+ $path_file = TDM_CREATE_MURL.'/'.$modules->getVar('mod_name').'/admin/'.$file;
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude 'admin_header.php';
+xoops_loadLanguage('help', \$xoopsModule->getVar('dirname', 'e'));
+\$xoopsTpl->display('db:admin/' . \$xoopsModule->getVar("dirname") . '_admin_help.html');
+include 'footer.php';
+EOT;
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -19,74 +19,86 @@
* @version $Id: const_admin_index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_index($modules, $tbl_name, $tables_arr)
+function const_admin_index($modules, $tables_arr)
{
$mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
- $thereare = $language.'_THEREARE_';
+ $thereare = $language.'THEREARE_';
$file = 'index.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include_once \'header.php\';';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude_once 'header.php';
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
- $text .= '
- //count "total '.$table_fieldname.'"
- $count_'.$table_fieldname.' = $'.$table_name.'Handler->getCount();';
+$text .= <<<EOT
+\n//count "total {$table_name}"
+\$total_{$table_name} = \${$table_name}Handler->getCount();
+EOT;
if(isset($_REQUEST['table_status'])) {
- $text .= '
- //count "status"
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("'.$table_fieldname.'_status", 1));
- $'.$table_fieldname.'_status = $'.$table_name.'Handler->getCount($criteria);';
+$text .= <<<EOT
+\n//count "status"
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_status", 1));
+\${$table_fieldname}_status = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
if(isset($_REQUEST['table_online'])) {
- $text .= '
- //count "online"
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("'.$table_fieldname.'_online", 1));
- $'.$table_fieldname.'_online = $'.$table_name.'Handler->getCount($criteria);';
+$text .= <<<EOT
+\n//count "online"
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_online", 1));
+\${$table_fieldname}_online = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $text .= '
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("'.$table_fieldname.'_waiting", 1));
- $'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);
- ';
+$text .= <<<EOT
+\n\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_waiting", 1));
+\${$table_fieldname}_waiting = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
}
- $text .= '
- // InfoBox '.$tbl_name.'
- $adminMenu->addInfoBox('.$language.'STATISTICS);';
+$text .= <<<EOT
+\n// InfoBox Statistics
+\$adminMenu->addInfoBox({$language}STATISTICS);
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
- $text .= '
- // InfoBox '.$table_fieldname.'
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_name).', $count_'.$table_fieldname.'); ';
+ $ta_stu_table_name = $thereare.strtoupper($table_name);
+ $ta_stu_table_fieldname = $thereare.strtoupper($table_fieldname);
+$text .= <<<EOT
+\n// InfoBox {$table_name}
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_name}, \$total_{$table_name});
+EOT;
if(isset($_REQUEST['table_status'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_STATUS, $'.$table_fieldname.'_status);';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_STATUS, \${$table_fieldname}_status);
+EOT;
}
if(isset($_REQUEST['table_online'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_ONLINE, $'.$table_fieldname.'_online);';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_ONLINE, \${$table_fieldname}_online);
+EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_WAITING, $'.$table_fieldname.'_waiting);
-';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_WAITING, \${$table_fieldname}_waiting);
+EOT;
}
}
-$text .= '
- // Render Index
- echo $adminMenu->addNavigation(\'index.php\');
- echo $adminMenu->renderIndex();
-include_once \'footer.php\';';
+$text .= <<<EOT
+\n// Render Index
+echo \$adminMenu->addNavigation('index.php');
+echo \$adminMenu->renderIndex();
+include_once 'footer.php';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -19,59 +19,71 @@
* @version $Id: const_admin_language.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_language($modules, $tables_arr, $category)
+function const_admin_language($modules, $tables_arr, $table_permissions)
{
$mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
$language1 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
$file = 'admin.php';
- $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.$file;
- $root_path = XOOPS_URL.'/modules/'.$mod_name.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-//Menu
-';
-$text .= 'define(\''.$language.'STATISTICS\', "'.ucfirst($mod_name).' statistics");';
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.xoops_getConfigOption('language').'/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/language/'.xoops_getConfigOption('language').'/'.$file;
+ $text = '<?php'.const_header($modules, $file);
+ $ucf_mod_name = ucfirst($mod_name);
+$text .= <<<EOT
+\n//Index
+define('{$language}STATISTICS', "{$ucf_mod_name} statistics");
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
- $table_name_nohs = str_replace('_', ' ', $table_name);
- $text .= '
-define(\''.$language1.strtoupper($table_name).'\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' in the database");';
+ $table_name_nohs = str_replace('_', ' ', ucfirst($table_name));
+ $stu_table_name = strtoupper($table_name);
+ $text .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}', "There are <span class='bold'>%s</span> {$table_name_nohs} in the database");
+EOT;
if(isset($_REQUEST['table_online'])) {
-$text .= '
-define(\''.$language1.strtoupper($table_name).'ONLINE\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' online in the database");'; }
+$text .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}ONLINE', "There are <span class='bold'>%s</span> {$table_name_nohs} online in the database");
+EOT;
+
+}
if(isset($_REQUEST['table_waiting'])) {
-$text .= '
-define(\''.$language1.strtoupper($table_name).'WAITING\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' waiting in the database");
-'; }
+$text .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}WAITING', "There are <span class='bold'>%s</span> {$table_name_nohs} waiting in the database");
+EOT;
+
}
-$text .= '
-//Buttons';
+}
+$text .= <<<EOT
+\n//Buttons
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$table_name_nohs = str_replace('_', ' ', $table_name);
- $table_fieldname_nohs = str_replace('_', ' ', $table_fieldname);
-$text .= '
-define(\''.$language.'ADD_'.strtoupper($table_name).'\', "Add new '.$table_name_nohs.'");
-define(\''.$language.''.strtoupper($table_name).'_LIST\', "List of '.$table_name_nohs.'");';
+ $stu_table_name = strtoupper($table_name);
+$text .= <<<EOT
+\ndefine('{$language}ADD_{$stu_table_name}', "Add new {$table_name_nohs}");
+define('{$language}{$stu_table_name}_LIST', "List of {$table_name_nohs}");
+EOT;
if(isset($_REQUEST['table_waiting']))
{
- $text .= '
-define(\''.$language.''.strtoupper($table_name).'_WAITING\', "Waiting '.$table_name_nohs.'");
-';}
+$text .= <<<EOT
+\ndefine('{$language}{$stu_table_name}_WAITING', "Waiting {$table_name_nohs}");
+EOT;
}
-$text .= '
-//General
-define(\''.$language.'FORMOK\',"Registered successfull");
-define(\''.$language.'FORMDELOK\',"Deleted successfull");
-define(\''.$language.'FORMSUREDEL\', "Are you sure to Delete: <span class=\'bold red\'>%s</span></b>");
-define(\''.$language.'FORMSURERENEW\', "Are you sure to Renew: <span class=\'bold red\'>%s</span></b>");
-define(\''.$language.'FORMUPLOAD\',"Upload");
-define(\''.$language.'FORMIMAGE_PATH\',"File presents in %s");
-define(\''.$language.'FORMACTION\',"Action");
-';
+}
+$text .= <<<EOT
+\n//General
+define('{$language}FORMOK', "Registered successfull");
+define('{$language}FORMDELOK', "Deleted successfull");
+define('{$language}FORMSUREDEL', "Are you sure to Delete: <span class='bold red'>%s</span></b>");
+define('{$language}FORMSURERENEW', "Are you sure to Renew: <span class='bold red'>%s</span></b>");
+define('{$language}FORMUPLOAD', "Upload");
+define('{$language}FORMIMAGE_PATH', "File presents in %s");
+define('{$language}FORMACTION', "Action");
+EOT;
$verif = true;
foreach (array_keys($tables_arr) as $i)
{
@@ -84,53 +96,69 @@
$table_name = str_replace('_', ' ', $tables_arr[$i]->getVar('table_name'));
$UcTable_name = UcFirstAndToLower($table_name);
//Recuperation des noms des tables
- $text .= '// '.$UcTable_name;
+ $text .= <<<EOT
+\n// {$UcTable_name}
+EOT;
for($j=0; $j<$nb_fields; $j++)
{
//Nom des fields
- $fields1 = explode(":", $fields_total[$j]);
+ $fields1 = explode(':', $fields_total[$j]);
$fields[$j] = $fields1[0];
$fields_final[$j] = substr($fields1[0], $nb_caracteres);
-
+ $stl_table_name = strtolower($table_name);
if ( $verif == true )
{
- $text .= '
-define(\''.$lng_prefix.'_ADD\', "Add a '.strtolower($table_name).'");
-define(\''.$lng_prefix.'_EDIT\', "Edit '.strtolower($table_name).'");
-define(\''.$lng_prefix.'_DELETE\', "Delete '.strtolower($table_name).'");
-';
+$text .= <<<EOT
+\ndefine('{$lng_prefix}_ADD', "Add a {$stl_table_name}");
+define('{$lng_prefix}_EDIT', "Edit {$stl_table_name}");
+define('{$lng_prefix}_DELETE', "Delete {$stl_table_name}");
+EOT;
}
$verif = false;
- $text .= '
-define(\''.$lng_prefix.strtoupper($fields_final[$j]).'\', "'.ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j])).'");';
+ $ucf_fields = ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j]));
+ $lng_stu_fields_final = $lng_prefix.strtoupper($fields_final[$j]);
+$text .= <<<EOT
+\ndefine('{$lng_stu_fields_final}', "{$ucf_fields}");
+EOT;
}
$verif = true;
- $text .= '
-';
+ $text .= <<<EOT
+EOT;
}
-$text .= '
-//Blocks.php';
+$text .= <<<EOT
+//Blocks.php
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = str_replace('_', ' ', ucfirst($tables_arr[$i]->getVar('table_name')));
+ $table_fieldname = str_replace('_', ' ', ucfirst($tables_arr[$i]->getVar('table_fieldname')));
$lng_prefix = $language.strtoupper($table_name).'_';
-$text .= '
-define(\''.$lng_prefix.'BLOCK\', "'.ucfirst(str_replace("_", " ", $table_name)).' block");
-';
+$text .= <<<EOT
+\ndefine('{$lng_prefix}BLOCK', "{$table_name} block");
+EOT;
}
-if( $category == 1 ) {
-$text .= '
-//Permissions
-define(\''.$language.'PERMISSIONS_ACCESS\', "Permissions to access");
-define(\''.$language.'PERMISSIONS_VIEW\', "Permissions to view");
-define(\''.$language.'PERMISSIONS_SUBMIT\', "Permissions to submit");
-';
+if( $table_permissions == 1 ) {
+$text .= <<<EOT
+\n//Permissions
+define('{$language}PERMISSIONS_GLOBAL', "Global permissions");
+define('{$language}PERMISSIONS_GLOBAL_DESC', "Only users in the group that you select may global this");
+define('{$language}PERMISSIONS_GLOBAL_4', "Rate from user");
+define('{$language}PERMISSIONS_GLOBAL_8', "Submit from user side");
+define('{$language}PERMISSIONS_GLOBAL_16', "Auto approve");
+define('{$language}PERMISSIONS_APPROVE', "Permissions to approve");
+define('{$language}PERMISSIONS_APPROVE_DESC', "Only users in the group that you select may approve this");
+define('{$language}PERMISSIONS_VIEW', "Permissions to view");
+define('{$language}PERMISSIONS_VIEW_DESC', "Only users in the group that you select may view this");
+define('{$language}PERMISSIONS_SUBMIT', "Permissions to submit");
+define('{$language}PERMISSIONS_SUBMIT_DESC', "Only users in the group that you select may submit this");
+define('{$language}PERMISSIONS_NOPERMSSET', "Permission cannot be set: No {$table_name} created yet! Please create a {$table_fieldname} first.");
+EOT;
}
-$text .= '
-//Error NoFrameworks
-define(\'_AM_ERROR_NOFRAMEWORKS\', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
-define(\''.$language.'MAINTAINEDBY\', "is maintained by the");
-?>';
+$text .= <<<EOT
+\n//Error NoFrameworks
+define('_AM_ERROR_NOFRAMEWORKS', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
+define('{$language}MAINTAINEDBY', "is maintained by the");
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_LANGUAGES,
_AM_TDMCREATE_CONST_NOTOK_LANGUAGES, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -19,7 +19,7 @@
* @version $Id: const_admin_menu.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_menu($modules, $tables_arr, $category)
+function const_admin_menu($modules, $tables_arr, $table_permissions)
{
$mod_name = $modules->getVar('mod_name');
$language = '_MI_'.strtoupper($mod_name).'_ADMENU';
@@ -27,46 +27,53 @@
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
$menu = 1;
- $text = '<?php'.const_header($modules, $file).'
-$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
-$module_handler =& xoops_gethandler(\'module\');
-$xoopsModule =& XoopsModule::getByDirname($dirname);
-$moduleInfo =& $module_handler->get($xoopsModule->getVar(\'mid\'));
-$pathIcon32 = $moduleInfo->getInfo(\'icons32\');
-$adminmenu = array();
-$i = 1;
-$adminmenu[$i][\'title\'] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/index.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/home.png\';
-$i++;'.PHP_EOL;
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\n\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+\$module_handler =& xoops_gethandler('module');
+\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
+\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
+\$pathIcon32 = \$moduleInfo->getInfo('sysicons32');
+\$adminmenu = array();
+\$i = 1;
+\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/index.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/home.png';
+\$i++;
+EOT;
$menu++;
foreach (array_keys($tables_arr) as $i)
{
if ( $tables_arr[$i]->getVar('table_admin') == 1 )
{
- $text .= '$adminmenu[$i][\'title\'] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/'.$tables_arr[$i]->getVar('table_name').'.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/'.$tables_arr[$i]->getVar('table_image').'\';
-$i++;'.PHP_EOL;
+$text .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/{$tables_arr[$i]->getVar('table_name')}.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/{$tables_arr[$i]->getVar('table_image')}';
+\$i++;
+EOT;
$menu++;
}
}
$menu--;
//$menu_id = $menu;
//unset( $menu );
-if( $category == 1 ) {
+if( $table_permissions == 1 ) {
$menu++;
-$text .= '$adminmenu[$i][\'title\'] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/permissions.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/permissions.png\';
-$i++;'.PHP_EOL;
+$text .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/permissions.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/permissions.png';
+\$i++;
+EOT;
}
$menu++;
-$text .= '$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/about.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/about.png\';
-unset( $i );
-?>';
+$text .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/about.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/about.png';
+unset( \$i );
+EOT;
unset( $menu );
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -23,21 +23,26 @@
{
$mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name);
- $language_manager = '_AM_'.strtoupper($mod_name).'_'.strtoupper($table_fieldname);
- $mod_name_minuscule = strtolower($mod_name);
+ $language_manager = $language.'_'.strtoupper($table_fieldname);
+ $stl_mod_name = strtolower($mod_name);
+ $stu_mod_name = strtoupper($mod_name);
+ $stu_table_name = strtoupper($table_name);
$file = $table_name.'.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include_once \'header.php\';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude_once 'header.php';
//It recovered the value of argument op in URL$
-$op = '.$mod_name.'_CleanVars($_REQUEST, \'op\', \'list\', \'string\');';
+\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+EOT;
if(isset($_REQUEST['table_waiting'])) {
-$text .= '
-// the number of loading not validated
-$criteria = new CriteriaCompo();
-$criteria->add(new Criteria(\''.$table_fieldname.'_waiting\', 0));
-$'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);';
+$text .= <<<EOT
+\n// the number of loading not validated
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria('{$table_fieldname}_waiting', 0));
+\${$table_fieldname}_waiting = \${$table_name}Handler->getCount(\$criteria);
+EOT;
}
//fields
$fields_total = explode('|', $table_fields);
@@ -69,229 +74,239 @@
$field_id = $fields[0];
$field_name = $fields[1];
-$text .= '
-echo $adminMenu->addNavigation(\''.$table_name.'.php\');
-switch ($op)
+$text .= <<<EOT
+\n\necho \$adminMenu->addNavigation('{$table_name}.php');
+switch (\$op)
{
- case \'list\':
+ case 'list':
default:
- $adminMenu->addItemButton('.$language.'_ADD_'.strtoupper($table_name).', \''.$table_name.'.php?op=new\', \'add\');
- echo $adminMenu->renderButton();
- $criteria = new CriteriaCompo();
- $criteria->setSort(\''.$field_id.' ASC, '.$fpmf.'\');
- $criteria->setOrder(\'ASC\');
- $numrows = $'.$table_name.'Handler->getCount();
- $'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
- ';
+ \$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ echo \$adminMenu->renderButton();
+ \$criteria = new CriteriaCompo();
+ \$criteria->setSort('{$field_id} ASC, {$fpmf}');
+ \$criteria->setOrder('ASC');
+ \$numrows = \${$table_name}Handler->getCount();
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+EOT;
$fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
if ( $table_category != 1 )
{
- $text .='
- // Table view
- if ($numrows>0)
+$text .= <<<EOT
+ \n\t\t// Table view
+ if (\$numrows>0)
{
- echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
- <tr>';
- $text .= $fcn.'
- <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
+ echo "<table width='100%' cellspacing='1' class='outer'>
+ <tr>
+EOT;
+ $text .= $fcn;
+$text .= <<<EOT
+\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
</tr>";
- $class = "odd";
+ \$class = "odd";
- foreach (array_keys($'.$table_name.'_arr) as $i)
+ foreach (array_keys(\${$table_name}_arr) as \$i)
{
- echo "<tr class=\'".$class."\'>";
- $class = ($class == "even") ? "odd" : "even";
- ';
+ echo "<tr class='".\$class."'>";
+ \$class = (\$class == "even") ? "odd" : "even";\n
+EOT;
$fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
- $text .= $fields_data.'
- echo "<td class=\'center width5\'>
- <a href=\''.$table_name.'.php?op=edit&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a>
- <a href=\''.$table_name.'.php?op=delete&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a>
+ $text .= $fields_data;
+$text .= <<<EOT
+ \n\t\t\t\t\techo "<td class='center width5'>
+ <a href='{$table_name}.php?op=edit&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='{$table_name}.php?op=delete&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>";
echo "</tr>";
}
echo "</table><br /><br />";
} else {
- echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
- <tr>';
- $text .= $fcn.'
- <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
- </tr><tr><td class=\'errorMsg\' colspan=\''.$nb_fields.'\'>There are no '.$table_fieldname.'</td></tr>";
+ echo "<t...
[truncated message content] |
|
From: <be...@us...> - 2013-09-21 22:06:58
|
Revision: 12081
http://sourceforge.net/p/xoops/svn/12081
Author: beckmi
Date: 2013-09-21 22:06:53 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
changing to "kB" (luciorota)
Modified Paths:
--------------
XoopsModules/TDMDownloads/trunk/TDMDownloads/language/english/admin.php
Modified: XoopsModules/TDMDownloads/trunk/TDMDownloads/language/english/admin.php
===================================================================
--- XoopsModules/TDMDownloads/trunk/TDMDownloads/language/english/admin.php 2013-09-21 21:44:33 UTC (rev 12080)
+++ XoopsModules/TDMDownloads/trunk/TDMDownloads/language/english/admin.php 2013-09-21 22:06:53 UTC (rev 12081)
@@ -151,7 +151,7 @@
define('_AM_TDMDOWNLOADS_NOPERMSSET', "Permission cannot be set: No Category created yet! Please create a Category first.");
//Bytes sizes
define('_AM_TDMDOWNLOADS_BYTES', "Bytes");
-define('_AM_TDMDOWNLOADS_KBYTES', "KB");
+define('_AM_TDMDOWNLOADS_KBYTES', "kB");
define('_AM_TDMDOWNLOADS_MBYTES', "MB");
define('_AM_TDMDOWNLOADS_GBYTES', "GB");
define('_AM_TDMDOWNLOADS_TBYTES', "TB");
\ No newline at end of file
|
|
From: <luc...@us...> - 2013-09-21 21:44:40
|
Revision: 12080
http://sourceforge.net/p/xoops/svn/12080
Author: luciorota
Date: 2013-09-21 21:44:33 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
a little more standard than before
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-09-21 18:16:19 UTC (rev 12079)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-09-21 21:44:33 UTC (rev 12080)
@@ -20,8 +20,9 @@
*/
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
-$module_handler = xoops_gethandler('module');
+$module_handler = xoops_gethandler('module');
$module = $module_handler->getByDirname(basename(dirname(dirname(__FILE__))));
+$pathIcon32 = $module->getInfo('icons32');
xoops_loadLanguage('admin', $module->dirname());
@@ -29,47 +30,47 @@
$i=0;
$adminmenu[$i]["title"] = _MI_WFDOWNLOADS_MENU_HOME;
$adminmenu[$i]['link'] = "admin/index.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/home.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/home.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_CATEGORIES;
$adminmenu[$i]['link'] = "admin/categories.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/category.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/category.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_DOWNLOADS;
$adminmenu[$i]['link'] = "admin/downloads.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/download.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/download.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_REVIEWS;
$adminmenu[$i]['link'] = "admin/reviews.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/translations.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/translations.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_RATINGS;
$adminmenu[$i]['link'] = "admin/ratings.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/button_ok.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/button_ok.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_REPORTSMODIFICATIONS;
$adminmenu[$i]['link'] = "admin/reportsmodifications.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/alert.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/alert.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_MIRRORS;
$adminmenu[$i]['link'] = "admin/mirrors.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/list.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/list.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_INDEXPAGE;
$adminmenu[$i]['link'] = "admin/indexpage.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/index.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/index.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_IMAGES;
$adminmenu[$i]['link'] = "admin/images.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/photo.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/photo.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_MIMETYPES;
$adminmenu[$i]['link'] = "admin/mimetypes.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/type.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/type.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_PERMISSIONS;
$adminmenu[$i]['link'] = "admin/permissions.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/permissions.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/permissions.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_IMPORT;
$adminmenu[$i]['link'] = "admin/import.php";
@@ -81,4 +82,4 @@
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_ABOUT;
$adminmenu[$i]['link'] = "admin/about.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/about.png';
+$adminmenu[$i]["icon"] = $pathIcon32 . '/about.png';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-21 18:16:19 UTC (rev 12079)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-21 21:44:33 UTC (rev 12080)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-20)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-21)</u></b>
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-21 18:16:19 UTC (rev 12079)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-21 21:44:33 UTC (rev 12080)
@@ -47,9 +47,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-09-20';
-$modversion['release_date'] = '2013/09/20';
-$modversion['releasedate'] = '2013-09-20';
+$modversion['date'] = '2013-09-21';
+$modversion['release_date'] = '2013/09/21';
+$modversion['releasedate'] = '2013-09-21';
$modversion['status'] = 'BETA 1';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
@@ -65,8 +65,8 @@
'mysqli' => '5.0.7'
);
$modversion['dirmoduleadmin'] = 'Frameworks/moduleclasses';
-$modversion['icons16'] = 'Frameworks/moduleclasses/icons/16';
-$modversion['icons32'] = 'Frameworks/moduleclasses/icons/32';
+$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
+$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32';
//help files
|
|
From: <luc...@us...> - 2013-09-21 18:16:22
|
Revision: 12079
http://sourceforge.net/p/xoops/svn/12079
Author: luciorota
Date: 2013-09-21 18:16:19 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
kiloByte and not Kelvin Byte
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-21 10:59:55 UTC (rev 12078)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-21 18:16:19 UTC (rev 12079)
@@ -157,7 +157,7 @@
define("_MD_WFDOWNLOADS_LEGENDTEXTCATRSS","RSS category feed");
define("_MD_WFDOWNLOADS_BYTES"," B");
-define("_MD_WFDOWNLOADS_KILOBYTES"," KB");
+define("_MD_WFDOWNLOADS_KILOBYTES"," kB");
define("_MD_WFDOWNLOADS_MEGABYTES"," MB");
define("_MD_WFDOWNLOADS_GIGABYTES"," GB");
define("_MD_WFDOWNLOADS_TERRABYTES"," TB");
|
|
From: <be...@us...> - 2013-09-21 10:59:58
|
Revision: 12078
http://sourceforge.net/p/xoops/svn/12078
Author: beckmi
Date: 2013-09-21 10:59:55 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
fixing few English translations
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-21 10:59:55 UTC (rev 12078)
@@ -32,7 +32,7 @@
$adminMenu = new ModuleAdmin();
$adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list');
- $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, "{$currentFile}?op=download.add", 'add');
+// $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, "{$currentFile}?op=download.add", 'add');
echo $adminMenu->renderButton();
$lid = WfdownloadsRequest::getInt('lid', 0);
@@ -552,7 +552,7 @@
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$categories = $wfdownloads->getHandler('category')->getObjects();
-
+
$start_published = WfdownloadsRequest::getInt('start_published', 0);
$start_new = WfdownloadsRequest::getInt('start_new', 0);
$start_autopublished = WfdownloadsRequest::getInt('start_autopublished', 0);
@@ -569,7 +569,7 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
+// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
@@ -633,8 +633,8 @@
$date_select = new XoopsFormDateTime (null, 'filter_date', 15, time(), false);
$GLOBALS['xoopsTpl']->assign('filter_date_select', $date_select->render());
$GLOBALS['xoopsTpl']->assign('filter_date_condition', $filter_date_condition);
-
+
// New Downloads
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('published', 0));
@@ -752,7 +752,7 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
+// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
@@ -775,8 +775,8 @@
$download_array['log_title'] = sprintf(_AM_WFDOWNLOADS_LOG_FOR_LID, $download_array['title']);
$GLOBALS['xoopsTpl']->assign('download', $download_array);
}
-
-
+
+
// Get all logged users
$uidArray = array();
foreach($ip_logs as $ip_log) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-21 10:59:55 UTC (rev 12078)
@@ -2,7 +2,7 @@
- module standardization: header.php, admin/admin_header.php, xoops_version.php
- module standardization: standardize directories/files names/structures
- module standardization: standardize code headers
-- module standardization: use WfdownloadWfdownload object instead of $xoopsModule, $xoopsModuleConfig and xoops_getmodulehandler (luciorota)
+- module standardization: use WfdownloadWfdownload object instead of $xoopsModule, $xoopsModuleConfig and xoops_getmodulehandler (luciorota)
- refactorized admin menu (luciorota)
- fixed: lack of variables in wfdownloads_viewcat.html template (luciorota)
- fixed: update procedure now updates also permissions (luciorota)
@@ -11,6 +11,7 @@
- fixed: deprecated "XoopsTree" (luciorota)
- fixed: html errors in templates (luciorota)
- fixed: deprecated XoopsTree (mamba)
+- fixed: English translations (mamba)
- added: updating to XOOPS 2.5.7 Multi-page help (mamba)
- added: enable/disable reviews system (luciorota)
- added: enable/disable ratings system (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-21 10:59:55 UTC (rev 12078)
@@ -72,8 +72,8 @@
define("_AM_WFDOWNLOADS_MVOTEDATA","Vote data");
// waiting reviews
define("_AM_WFDOWNLOADS_AREVIEWS","Reviews management");
-define("_AM_WFDOWNLOADS_AREVIEWS_WAITING","Reviews waiting validation");
-define("_AM_WFDOWNLOADS_AREVIEWS_INFO","Reviews informations");
+define("_AM_WFDOWNLOADS_AREVIEWS_WAITING","Reviews waiting for validation");
+define("_AM_WFDOWNLOADS_AREVIEWS_INFO","Reviews information");
define("_AM_WFDOWNLOADS_AREVIEWS_APPROVE","Approve new review without validation");
define("_AM_WFDOWNLOADS_AREVIEWS_APPROVED","Review has been approved.");
define("_AM_WFDOWNLOADS_AREVIEWS_EDIT","Edit new review and then approve");
@@ -86,7 +86,7 @@
define("_AM_WFDOWNLOADS_CCATEGORY_MODIFY_TITLE","Category title");
define("_AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILED","Failed moving files: cannot move to this category");
define("_AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILEDT","Failed moving files: cannot find this category");
-define("_AM_WFDOWNLOADS_CCATEGORY_MODIFY_MOVED","Files moved");
+define("_AM_WFDOWNLOADS_CCATEGORY_MODIFY_MOVED","Files moved successfully");
define("_AM_WFDOWNLOADS_CCATEGORY_CREATED","New Category created and database updated successfully");
define("_AM_WFDOWNLOADS_CCATEGORY_MODIFIED","Selected category modified and database updated successfully");
define("_AM_WFDOWNLOADS_CCATEGORY_DELETED","Selected category deleted and database updated successfully");
@@ -103,7 +103,7 @@
// Index page Defines
define("_AM_WFDOWNLOADS_IPAGE_UPDATED","Index page modified and database updated successfully!");
-define("_AM_WFDOWNLOADS_IPAGE_INFORMATION","Index page informations");
+define("_AM_WFDOWNLOADS_IPAGE_INFORMATION","Index page information");
define("_AM_WFDOWNLOADS_IPAGE_MODIFY","Modify index page");
define("_AM_WFDOWNLOADS_IPAGE_CIMAGE","Select index image");
define("_AM_WFDOWNLOADS_IPAGE_CTITLE","Index title");
@@ -117,21 +117,21 @@
// Permissions defines
define("_AM_WFDOWNLOADS_PERM_MANAGEMENT","Permissions management");
-define("_AM_WFDOWNLOADS_PERM_PERMSNOTE","Please be aware that even if you’ve set correct viewing permissions here, a group might not see the articles or blocks if you don’t also grant that group permissions to access the module. To do that, go to <b>System admin > Groups</b>, choose the appropriate group and click the checkboxes to grant its members the access.");
+define("_AM_WFDOWNLOADS_PERM_PERMSNOTE","Please be aware that even if you've set correct viewing permissions here, a group might not see the articles or blocks if you don't also grant that group permissions to access the module. To do that, go to <b>System admin > Groups</b>, choose the appropriate group and click the checkboxes to grant its members the access.");
define("_AM_WFDOWNLOADS_PERM_CPERMISSIONS","Category permissions");
define("_AM_WFDOWNLOADS_PERM_CSELECTPERMISSIONS","Select categories that each group is allowed to view");
-define("_AM_WFDOWNLOADS_PERM_CNOCATEGORY","Cannot set permission's: No Categories have been created yet!");
+define("_AM_WFDOWNLOADS_PERM_CNOCATEGORY","Cannot set permissions: No Categories have been created yet!");
define("_AM_WFDOWNLOADS_PERM_FPERMISSIONS","File permissions");
-define("_AM_WFDOWNLOADS_PERM_FNOFILES","Cannot set permission's: no files have been created yet!");
+define("_AM_WFDOWNLOADS_PERM_FNOFILES","Cannot set permissions: no files have been created yet!");
define("_AM_WFDOWNLOADS_PERM_FSELECTPERMISSIONS","Select the files that each group is allowed to view");
// Upload defines
-define("_AM_WFDOWNLOADS_DOWN_IMAGEUPLOAD","Image successfully uploaded to server destination");
+define("_AM_WFDOWNLOADS_DOWN_IMAGEUPLOAD","Image successfully uploaded to the server");
define("_AM_WFDOWNLOADS_DOWN_NOIMAGEEXIST","Error: No file was selected for uploading. Please try again!");
define("_AM_WFDOWNLOADS_DOWN_IMAGEEXIST","Image already exists in upload area!");
define("_AM_WFDOWNLOADS_DOWN_FILEDELETED","File has been deleted.");
-define("_AM_WFDOWNLOADS_DOWN_FILEERRORDELETE","Error deleting file: file not found on server.");
+define("_AM_WFDOWNLOADS_DOWN_FILEERRORDELETE","Error deleting file: file not found on the server.");
define("_AM_WFDOWNLOADS_DOWN_NOFILEERROR","Error deleting file: No file selected for deleting.");
define("_AM_WFDOWNLOADS_DOWN_DELETEFILE","WARNING: Are you sure you want to delete this image file?");
define("_AM_WFDOWNLOADS_DOWN_IMAGEINFO","Server status");
@@ -186,7 +186,7 @@
// Submitted Files
define("_AM_WFDOWNLOADS_SUB_SUBMITTEDFILES","Submitted files");
define("_AM_WFDOWNLOADS_SUB_FILESWAITINGINFO","Waiting files information");
-define("_AM_WFDOWNLOADS_SUB_FILESWAITINGVALIDATION","Files waiting validation: ");
+define("_AM_WFDOWNLOADS_SUB_FILESWAITINGVALIDATION","Files waiting for validation: ");
define("_AM_WFDOWNLOADS_SUB_APPROVEWAITINGFILE","<b>Approve</b> new file information without validation.");
define("_AM_WFDOWNLOADS_SUB_EDITWAITINGFILE","<b>Edit</b> new file information and then approve.");
define("_AM_WFDOWNLOADS_SUB_DELETEWAITINGFILE","<b>Delete</b> the new file information.");
@@ -205,12 +205,12 @@
define("_AM_WFDOWNLOADS_MIME_EXTF","File extension");
define("_AM_WFDOWNLOADS_MIME_NAMEF","Application type/name");
define("_AM_WFDOWNLOADS_MIME_TYPEF","Mimetypes");
-define("_AM_WFDOWNLOADS_MIME_ADMINF","Allowed admin mimetypes/extesions");
-define("_AM_WFDOWNLOADS_MIME_ADMINFINFO","<b>Mimetypes/extesions that are available for admin uploads</b>");
+define("_AM_WFDOWNLOADS_MIME_ADMINF","Allowed admin mimetypes/extension");
+define("_AM_WFDOWNLOADS_MIME_ADMINFINFO","<b>Mimetypes/extensions that are available for admin uploads</b>");
define("_AM_WFDOWNLOADS_MIME_USERF","Allowed user mimetypes/extensions");
-define("_AM_WFDOWNLOADS_MIME_USERFINFO","<b>Mimetypes/extesions that are available for user uploads</b>");
+define("_AM_WFDOWNLOADS_MIME_USERFINFO","<b>Mimetypes/extensions that are available for user uploads</b>");
define("_AM_WFDOWNLOADS_MIME_NOMIMEINFO","No mimetypes selected");
-define("_AM_WFDOWNLOADS_MIME_FINDMIMETYPE","Find mimetype informations");
+define("_AM_WFDOWNLOADS_MIME_FINDMIMETYPE","Find mimetype information");
define("_AM_WFDOWNLOADS_MIME_EXTFIND","Search file extension");
define("_AM_WFDOWNLOADS_MIME_INFOTEXT","<ul><li>New mimetypes can be created, edited or deleted easily via this form</li>
<li>Search for a new mimetypes via an external website.</li>
@@ -245,7 +245,7 @@
define("_AM_WFDOWNLOADS_VOTE_VOTEDELETED","Vote data deleted.");
define("_AM_WFDOWNLOADS_VOTE_ID","ID");
define("_AM_WFDOWNLOADS_VOTE_FILETITLE","File title");
-define("_AM_WFDOWNLOADS_VOTE_DISPLAYVOTES","Voting data informations");
+define("_AM_WFDOWNLOADS_VOTE_DISPLAYVOTES","Voting data information");
define("_AM_WFDOWNLOADS_VOTE_NOVOTES","No User Votes to display");
define("_AM_WFDOWNLOADS_VOTE_DELETE","No User Votes to display");
define("_AM_WFDOWNLOADS_VOTE_DELETEDSC","<b>Deletes</b> the chosen vote information from the database.");
@@ -268,7 +268,7 @@
*/
define("_AM_WFDOWNLOADS_MOD_TOTMODREQUESTS","Modifications waiting");
define("_AM_WFDOWNLOADS_MOD_MODREQUESTS","Modified files");
-define("_AM_WFDOWNLOADS_MOD_MODREQUESTSINFO","Modifications informations");
+define("_AM_WFDOWNLOADS_MOD_MODREQUESTSINFO","Modifications information");
define("_AM_WFDOWNLOADS_MOD_MODID","ID");
define("_AM_WFDOWNLOADS_MOD_MODTITLE","Title");
define("_AM_WFDOWNLOADS_MOD_MODPOSTER","Original poster: ");
@@ -343,7 +343,7 @@
define("_AM_WFDOWNLOADS_REV_REVIEW_PUBLISHED","Published reviews");
//File management
-define("_AM_WFDOWNLOADS_FILE_SUBMITTERID","Submitter user id: <br /><br />Leave this as it is, unless you want to change who submitted the download");
+define("_AM_WFDOWNLOADS_FILE_SUBMITTERID","Submitter user ID: <br /><br />Leave this as it is, unless you want to change who submitted the download");
define("_AM_WFDOWNLOADS_FILE_ID","File ID");
define("_AM_WFDOWNLOADS_FILE_IP","Uploader's IP address");
define("_AM_WFDOWNLOADS_FILE_ALLOWEDAMIME","<div style='padding-top: 4px; padding-bottom: 4px;'><b>Allowed admin file extensions</b></div>");
@@ -394,8 +394,8 @@
define("_AM_WFDOWNLOADS_FILE_EDITAPPROVE","Approve download:");
define("_AM_WFDOWNLOADS_FILE_NEWFILEUPLOAD","New file created and database updated successfully");
define("_AM_WFDOWNLOADS_FILE_FILEMODIFIEDUPDATE","Selected file modified and database updated successfully");
-define("_AM_WFDOWNLOADS_FILE_REALLYDELETEDTHIS","Really delete the selected file?");
-define("_AM_WFDOWNLOADS_FILE_FILEWASDELETED","File %s successfully removed from the database!");
+define("_AM_WFDOWNLOADS_FILE_REALLYDELETEDTHIS","Are you sure to delete the selected file?");
+define("_AM_WFDOWNLOADS_FILE_FILEWASDELETED","File %s successfully deleted from the database!");
define("_AM_WFDOWNLOADS_FILE_USE_UPLOAD_TITLE"," Use upload filename for file title.");
define("_AM_WFDOWNLOADS_FILE_FILEAPPROVED","File approved and database updated successfully");
define("_AM_WFDOWNLOADS_FILE_CREATENEWSSTORY","<b>Create news story from download</b>");
@@ -409,7 +409,7 @@
define("_AM_WFDOWNLOADS_BROKEN_FILEIGNORED","Broken report ignored and successfully removed from the database!");
define("_AM_WFDOWNLOADS_BROKEN_NOWACK","Acknowledged status changed and database updated!");
define("_AM_WFDOWNLOADS_BROKEN_NOWCON","Confirmed status changed and database updated!");
-define("_AM_WFDOWNLOADS_BROKEN_REPORTINFO","Brokens reports informations");
+define("_AM_WFDOWNLOADS_BROKEN_REPORTINFO","Broken reports information");
define("_AM_WFDOWNLOADS_BROKEN_REPORTSNO","Broken reports waiting");
define("_AM_WFDOWNLOADS_BROKEN_IGNOREDESC","<b>Ignores</b> the report and only deletes the broken file report.");
define("_AM_WFDOWNLOADS_BROKEN_IGNORE_ALT","Ignore and delete the broken file report");
@@ -423,7 +423,7 @@
define("_AM_WFDOWNLOADS_BROKEN_CONFIRM_ALT","Confirm state of broken file report");
define("_AM_WFDOWNLOADS_BROKEN_ID","ID");
-define("_AM_WFDOWNLOADS_BROKEN_TITLE","Dowonload title");
+define("_AM_WFDOWNLOADS_BROKEN_TITLE","Download title");
define("_AM_WFDOWNLOADS_BROKEN_REPORTER","Reporter");
define("_AM_WFDOWNLOADS_BROKEN_FILESUBMITTER","Download submitter");
define("_AM_WFDOWNLOADS_BROKEN_DATESUBMITTED","Report date");
@@ -505,7 +505,7 @@
// waiting mirrors
define("_AM_WFDOWNLOADS_AMIRRORS","Mirrors management");
define("_AM_WFDOWNLOADS_AMIRRORS_WAITING","Mirrors waiting validation");
-define("_AM_WFDOWNLOADS_AMIRRORS_INFO","Mirrors informations");
+define("_AM_WFDOWNLOADS_AMIRRORS_INFO","Mirrors information");
define("_AM_WFDOWNLOADS_AMIRRORS_APPROVE","<b>Approve</b> new mirror without validation.");
define("_AM_WFDOWNLOADS_AMIRRORS_EDIT","<b>Edit</b> new mirror and then approve.");
define("_AM_WFDOWNLOADS_AMIRRORS_DELETE","<b>Delete</b> the new mirror information.");
@@ -589,7 +589,7 @@
define("_AM_WFDOWNLOADS_MIME_MIMETYPES_LIST","Mimetypes list");
define("_AM_WFDOWNLOADS_MIME_NOMIMETYPES","No mimetypes");
define("_AM_WFDOWNLOADS_MINDEX_NEWDOWN","New/waiting downloads");
-define("_AM_WFDOWNLOADS_BROKEN_REPORTS","Brokens reports");
+define("_AM_WFDOWNLOADS_BROKEN_REPORTS","Broken downloads reports");
define("_AM_WFDOWNLOADS_MODIFICATIONS","Modifications");
define("_AM_WFDOWNLOADS_FORMULIZE_AVAILABLE","Formulize Module active. Custom forms are supported.");
@@ -650,10 +650,10 @@
define('_AM_WFDOWNLOADS_SEARCH_CONTAINS','contains');
-define('_AM_WFDOWNLOADS_MIRROR_DISABLED','Warning: mirrors system is disabled in module preferences.');
-define('_AM_WFDOWNLOADS_REVIEW_DISABLED','Warning: reviews system is disabled in module preferences.');
-define('_AM_WFDOWNLOADS_RATING_DISABLED','Warning: ratings system is disabled in module preferences.');
-define('_AM_WFDOWNLOADS_BROKENREPORT_DISABLED','Warning: bokens reports system is disabled in module preferences.');
+define('_AM_WFDOWNLOADS_MIRROR_DISABLED','Warning: Mirrors system is disabled in module preferences.');
+define('_AM_WFDOWNLOADS_REVIEW_DISABLED','Warning: Reviews system is disabled in module preferences.');
+define('_AM_WFDOWNLOADS_RATING_DISABLED','Warning: Ratings system is disabled in module preferences.');
+define('_AM_WFDOWNLOADS_BROKENREPORT_DISABLED','Warning: Broken reports system is disabled in module preferences.');
// admin/clone.php
define("_AM_WFDOWNLOADS_CLONE","Clone module");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-21 10:59:55 UTC (rev 12078)
@@ -1,4 +1,4 @@
-<?php
+<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
@@ -157,10 +157,10 @@
define("_MD_WFDOWNLOADS_LEGENDTEXTCATRSS","RSS category feed");
define("_MD_WFDOWNLOADS_BYTES"," B");
-define("_MD_WFDOWNLOADS_KILOBYTES"," Kb");
-define("_MD_WFDOWNLOADS_MEGABYTES"," Mb");
-define("_MD_WFDOWNLOADS_GIGABYTES"," Gb");
-define("_MD_WFDOWNLOADS_TERRABYTES"," Tb");
+define("_MD_WFDOWNLOADS_KILOBYTES"," KB");
+define("_MD_WFDOWNLOADS_MEGABYTES"," MB");
+define("_MD_WFDOWNLOADS_GIGABYTES"," GB");
+define("_MD_WFDOWNLOADS_TERRABYTES"," TB");
define("_MD_WFDOWNLOADS_FILENOTEXIST","ERROR: file does not exist or file not found!");
define("_MD_WFDOWNLOADS__MD_WFDOWNLOADS_FILENOTOPEN","ERROR: unable to open file!");
@@ -179,9 +179,9 @@
define("_MD_WFDOWNLOADS_REV_SUBMITREV","Submit review");
define("_MD_WFDOWNLOADS_ERROR_CREATEREVIEW","ERROR: unable to create a review");
-define("_MD_WFDOWNLOADS_REV_SNEWMNAMEDESC","
+define("_MD_WFDOWNLOADS_REV_SNEWMNAMEDESC","
Please completely fill out the form below, and we'll add your review as soon as possible.<br /><br />
-Thank you for taking the time to submit your opinion. We want to give our users a possibility to find quality software faster.<br /><br />All reviews will be reviewed by one of our webmasters before they are put up on the web site.
+Thank you for taking the time to submit your opinion. We want to give our users a possibility to find quality software faster.<br /><br />All reviews will be reviewed by one of our webmasters before they are put up on the web site.
");
define("_MD_WFDOWNLOADS_ISNOTAPPROVED","Your submission has to be approved by a moderator first.");
define("_MD_WFDOWNLOADS_LICENCEC","Software licence");
@@ -258,9 +258,9 @@
define("_MD_WFDOWNLOADS_MIRROR_DOWNURL","Download URL");
define("_MD_WFDOWNLOADS_MIRROR_SUBMITMIRROR","Submit mirror");
define("_MD_WFDOWNLOADS_ERROR_CREATEMIRROR","ERROR: unable to create a mirror");
-define("_MD_WFDOWNLOADS_MIRROR_SNEWMNAMEDESC","
+define("_MD_WFDOWNLOADS_MIRROR_SNEWMNAMEDESC","
Please completely fill out the form below, and we'll add your mirror as soon as possible.<br /><br />
-Thank you for your assistance in providing another location to download these files. We want to give our users a possibility to find quality software faster.<br /><br />All mirror submissions will be reviewed by one of our webmasters before they are put up on the web site.
+Thank you for your assistance in providing another location to download these files. We want to give our users a possibility to find quality software faster.<br /><br />All mirror submissions will be reviewed by one of our webmasters before they are put up on the web site.
");
define("_MD_WFDOWNLOADS_MIRROR_HHOST","Host");
define("_MD_WFDOWNLOADS_MIRROR_HLOCATION","Location");
@@ -323,4 +323,4 @@
define("_MD_WFDOWNLOADS_DESCRIPTION_DESC","");
define("_MD_WFDOWNLOADS_SUBCATEGORIESLISTING","Subcategories listing");
-define("_MD_WFDOWNLOADS_DOWNLOADSLISTING","Downloads listing");
\ No newline at end of file
+define("_MD_WFDOWNLOADS_DOWNLOADSLISTING","Downloads listing");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-09-21 10:59:55 UTC (rev 12078)
@@ -220,14 +220,14 @@
define('_MI_WFDOWNLOADS_GLOBAL_NEWFILE_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New file');
define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFY','File Submitted');
-define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYCAP','Notify me when a new file is submitted (awaiting approval) to the current category.');
-define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYDSC','Receive notification when a new file is submitted (awaiting approval) to the current category.');
-define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New file submitted in category');
+define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYCAP','Notify me when a new file is submitted (awaiting approval) to the current category.');
+define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYDSC','Receive notification when a new file is submitted (awaiting approval) to the current category.');
+define('_MI_WFDOWNLOADS_CATEGORY_FILESUBMIT_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New file submitted in category');
define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFY','New File');
-define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYCAP','Notify me when a new file is posted to the current category.');
-define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYDSC','Receive notification when a new file is posted to the current category.');
-define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New file in category');
+define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYCAP','Notify me when a new file is posted to the current category.');
+define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYDSC','Receive notification when a new file is posted to the current category.');
+define('_MI_WFDOWNLOADS_CATEGORY_NEWFILE_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New file in category');
define('_MI_WFDOWNLOADS_FILE_APPROVE_NOTIFY','File Approved');
define('_MI_WFDOWNLOADS_FILE_APPROVE_NOTIFYCAP','Notify me when this file is approved.');
@@ -340,7 +340,7 @@
define("_MI_WFDOWNLOADS_MENU_REVIEWS","Reviews");
define("_MI_WFDOWNLOADS_MENU_MIRRORS","Mirrors");
define("_MI_WFDOWNLOADS_MENU_BROKENS","Brokens");
-define("_MI_WFDOWNLOADS_MENU_REPORTSMODIFICATIONS","Brokens Reports & Modifications");
+define("_MI_WFDOWNLOADS_MENU_REPORTSMODIFICATIONS","Broken Reports & Modifications");
define("_MI_WFDOWNLOADS_MENU_IMAGES","Module images");
define("_MI_WFDOWNLOADS_MENU_MIMETYPES","Mimetypes");
define("_MI_WFDOWNLOADS_MENU_RATINGS","Ratings & Votes");
@@ -362,11 +362,11 @@
define("_MI_WFDOWNLOADS_LIMITSDSC","// in progress");
define("_MI_WFDOWNLOADS_VERSIONTYPESDSC","// in progress");
-define("_MI_WFDOWNLOADS_REVIEW_ENABLE","[reviews] Enable reviews system");
-define("_MI_WFDOWNLOADS_REVIEW_ENABLEDSC","If enabled, reviews system (submit and show reviews) is enabled in backend.");
+define("_MI_WFDOWNLOADS_REVIEW_ENABLE","[reviews] Enable Reviews system");
+define("_MI_WFDOWNLOADS_REVIEW_ENABLEDSC","If enabled, Reviews system (submit and show reviews) is enabled in backend.");
define("_MI_WFDOWNLOADS_RATING_ENABLE","[ratings] Enable ratings system");
-define("_MI_WFDOWNLOADS_RATING_ENABLEDSC","If enabled, ratings system (vote and show ratings) is enabled in backend.");
+define("_MI_WFDOWNLOADS_RATING_ENABLEDSC","If enabled, Ratings system (vote and show ratings) is enabled in backend.");
-define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLE","[brokens reports] Enable brokens reports system");
-define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLEDSC","If enabled, brokens reports system is enabled in backend.");
+define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLE","[broken reports] Enable Broken reports system");
+define("_MI_WFDOWNLOADS_BROKENREPORT_ENABLEDSC","If enabled, Broken reports system is enabled in backend.");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-21 10:31:39 UTC (rev 12077)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-21 10:59:55 UTC (rev 12078)
@@ -24,7 +24,7 @@
$modversion['name'] = _MI_WFDOWNLOADS_NAME;
$modversion['version'] = 3.23;
$modversion['description'] = _MI_WFDOWNLOADS_DESC;
-$modversion['author'] = "The SmartFactory";
+$modversion['author'] = "XOOPS Development Team";
$modversion['credits'] = "This module was originally based on Mydownloads, and refactored by Catzwolf and the WF-Projects team. Then it became a project of The SmartFactory who continued the excellent work started by the WF-Projects team.";
$modversion['help'] = 'page=help';
$modversion['license'] = 'GNU GPL 2.0 or later';
@@ -50,7 +50,7 @@
$modversion['date'] = '2013-09-20';
$modversion['release_date'] = '2013/09/20';
$modversion['releasedate'] = '2013-09-20';
-$modversion['status'] = 'BETA';
+$modversion['status'] = 'BETA 1';
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
//about
|
|
From: <be...@us...> - 2013-09-21 10:31:44
|
Revision: 12077
http://sourceforge.net/p/xoops/svn/12077
Author: beckmi
Date: 2013-09-21 10:31:39 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
updating to standard icons, hiding buttons for current view it categories and downloads
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_index.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-09-21 03:26:06 UTC (rev 12076)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-09-21 10:31:39 UTC (rev 12077)
@@ -198,10 +198,10 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
-
+
$adminMenu = new ModuleAdmin();
$adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
- $adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
+// $adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
if (isset($_REQUEST['cid'])) {
@@ -223,7 +223,7 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
+// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
@@ -238,12 +238,12 @@
}
include 'admin_footer.php';
break;
-
+
case 'categories.reorder' :
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors() ));
}
-
+
if (isset($_POST['new_weights']) && count($_POST['new_weights']) > 0) {
$new_weights = $_POST['new_weights'];
$ids = array();
@@ -259,4 +259,4 @@
exit();
}
break;
-}
\ No newline at end of file
+}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-09-21 03:26:06 UTC (rev 12076)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php 2013-09-21 10:31:39 UTC (rev 12077)
@@ -73,7 +73,7 @@
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_IMPORT;
$adminmenu[$i]['link'] = "admin/import.php";
-$adminmenu[$i]["icon"] = '../../' . $module->getInfo('icons32') . '/add.png';
+$adminmenu[$i]["icon"] = './images/icon32/database_go.png';
$i++;
$adminmenu[$i]['title'] = _MI_WFDOWNLOADS_MENU_CLONE;
$adminmenu[$i]['link'] = "admin/clone.php";
Added: XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png
===================================================================
(Binary files differ)
Index: XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png 2013-09-21 03:26:06 UTC (rev 12076)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png 2013-09-21 10:31:39 UTC (rev 12077)
Property changes on: XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/database_go.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_index.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_index.html 2013-09-21 03:26:06 UTC (rev 12076)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_index.html 2013-09-21 10:31:39 UTC (rev 12077)
@@ -16,7 +16,7 @@
<a href="admin/categories.php?op=category.delete&cid=<{$category.cid}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
<{/if}>
<{if $category.allowed_upload == true}>
- <a href="submit.php?cid=<{$category.cid}>"><img src="<{xoModuleIcons16 up.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
+ <a href="submit.php?cid=<{$category.cid}>"><img src="<{xoModuleIcons16 add.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
<{/if}>
</div>
<div title="<{$smarty.const._MD_WFDOWNLOADS_CSUMMARY}>">
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html 2013-09-21 03:26:06 UTC (rev 12076)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html 2013-09-21 10:31:39 UTC (rev 12077)
@@ -15,9 +15,9 @@
<{if $isAdmin == true}>
<a href="admin/categories.php?op=category.edit&cid=<{$category_cid}>"><img src="<{xoModuleIcons16 edit.png}>" title="<{$smarty.const._EDIT}>" alt="<{$smarty.const._EDIT}>" /></a>
<a href="admin/categories.php?op=category.delete&cid=<{$category_cid}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
- <{/if}>
+ <{/if}>
<{if $category_allowed_upload == true}>
- <a href="submit.php?cid=<{$category_cid}>"><img src="<{xoModuleIcons16 up.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
+ <a href="submit.php?cid=<{$category_cid}>"><img src="<{xoModuleIcons16 add.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
<{/if}>
</h1>
<{/if}>
@@ -42,7 +42,7 @@
<a href="admin/categories.php?op=category.delete&cid=<{$subcategory.cid}>"><img src="<{xoModuleIcons16 delete.png}>" title="<{$smarty.const._DELETE}>" alt="<{$smarty.const._DELETE}>" /></a>
<{/if}>
<{if $subcategory.allowed_upload == true}>
- <a href="submit.php?cid=<{$subcategory.cid}>"><img src="<{xoModuleIcons16 up.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
+ <a href="submit.php?cid=<{$subcategory.cid}>"><img src="<{xoModuleIcons16 add.png}>" title="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" alt="<{$smarty.const._MD_WFDOWNLOADS_SUBMITDOWNLOAD}>" /></a>
<{/if}>
</div>
<div title="<{$smarty.const._MD_WFDOWNLOADS_CSUMMARY}>">
|
|
From: <rgr...@us...> - 2013-09-21 03:26:10
|
Revision: 12076
http://sourceforge.net/p/xoops/svn/12076
Author: rgriffith
Date: 2013-09-21 03:26:06 +0000 (Sat, 21 Sep 2013)
Log Message:
-----------
Fixing Issue 1265 - system module exits on handling 'core.include.functions.redirectheader'
New event 'core.include.functions.redirectheader.start' triggered first that module preloads can listen for.
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php 2013-09-20 23:14:07 UTC (rev 12075)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/include/functions.php 2013-09-21 03:26:06 UTC (rev 12076)
@@ -560,6 +560,8 @@
global $xoopsConfig, $xoopsLogger, $xoopsUserIsAdmin;
$xoopsPreload =& XoopsPreload::getInstance();
+ $xoopsPreload->triggerEvent('core.include.functions.redirectheader.start', array($url, $time, $message, $addredirect, $allowExternalLink));
+ // under normal circumstance this event will exit, so listen for the .start above
$xoopsPreload->triggerEvent('core.include.functions.redirectheader', array($url, $time, $message, $addredirect, $allowExternalLink));
if (preg_match("/[\\0-\\31]|about:|script:/i", $url)) {
|
|
From: <be...@us...> - 2013-09-20 23:14:10
|
Revision: 12075
http://sourceforge.net/p/xoops/svn/12075
Author: beckmi
Date: 2013-09-20 23:14:07 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 6
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/class/garage.php
Added: XoopsModules/xgarage/trunk/xgarage/class/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/garage.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/garage.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -0,0 +1,212 @@
+<?php
+/**
+ * Garage Management
+ * Doc Comments needed, once completed.
+ * @version Stage1
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+/**
+ * Doc Comment Needed.
+ * this is the garage and everything stored in the garage.. the one car garage.
+ */
+class Garage extends XoopsObject
+{
+ var $db;
+ //not done. variable type is not set correctly
+ function Garage()
+ {
+//required and max length need to be set still
+ $this->db =& Database::getInstance();
+ $this->initVar('aa', XOBJ_DTYPE_INT, NULL); //approved
+ $this->initVar('uid', XOBJ_DTYPE_INT, NULL);//uid
+ $this->initVar('cid', XOBJ_DTYPE_INT, NULL);//cid
+ $this->initVar('name', XOBJ_DTYPE_TXTBOX);//name
+ $this->initVar('image', XOBJ_DTYPE_TXTBOX);//image
+ $this->initVar('uploadimage', XOBJ_DTYPE_TXTBOX, NULL);//uploadimage
+ $this->initVar('imagechoice', XOBJ_DTYPE_INT, NULL);//imagechoice
+ $this->initVar('url', XOBJ_DTYPE_INT, NULL);//url
+ $this->initVar('location', XOBJ_DTYPE_TXTBOX, NULL);//location
+ $this->initVar('year', XOBJ_DTYPE_TXTBOX, NULL);//year
+ $this->initVar('make', XOBJ_DTYPE_TXTBOX, NULL);//mark field?...make??? .05fixed
+ $this->initVar('model', XOBJ_DTYPE_TXTBOX, NULL);//model
+ $this->initVar('style', XOBJ_DTYPE_TXTBOX, NULL);//style??? mmissing??? .05fixed
+ $this->initVar('engine', XOBJ_DTYPE_TXTBOX, NULL);//engine
+ $this->initVar('color', XOBJ_DTYPE_TXTBOX, NULL);//color
+ $this->initVar('rt', XOBJ_DTYPE_TXTBOX, NULL);//rt
+ $this->initVar('sixty', XOBJ_DTYPE_TXTBOX, NULL);//sixty
+ $this->initVar('three', XOBJ_DTYPE_TXTBOX, NULL);//three
+ $this->initVar('eigth', XOBJ_DTYPE_TXTBOX, NULL);//eight???? misspelling?
+ $this->initVar('eigthm', XOBJ_DTYPE_TXTBOX, NULL);//misspelling again?
+ $this->initVar('thou', XOBJ_DTYPE_TXTBOX, NULL);//thou
+ $this->initVar('quart', XOBJ_DTYPE_TXTBOX, NULL);//quart
+ $this->initVar('quartm', XOBJ_DTYPE_TXTBOX, NULL);//quartm
+ $this->initVar('list', XOBJ_DTYPE_TXTBOX, NULL);//list
+ $this->initVar('mengine', XOBJ_DTYPE_TXTAREA, NULL);//mengine
+ $this->initVar('mexterior', XOBJ_DTYPE_TXTAREA, NULL);//meterier ?? mexterior .06fixed
+ $this->initVar('minterior',XOBJ_DTYPE_TXTAREA, NULL);//minterior
+ $this->initVar('mrims', XOBJ_DTYPE_TXTAREA, NULL);//mrims
+ $this->initVar('maudio', XOBJ_DTYPE_TXTAREA, NULL);//maudio
+ $this->initVar('mfuture', XOBJ_DTYPE_TXTAREA, NULL);//mfuture
+ $this->initVar('descript2', XOBJ_DTYPE_TXTAREA, NULL);//descript2
+ $this->initVar('linkgarage', XOBJ_DTYPE_INT, NULL);//linkgarage
+ }
+
+}
+
+//to be added.
+
+//xoops_getModuleHandler('garage','garage'); obj. dir
+class GarageGarageHandler extends XoopsObjectHandler
+{
+
+/**
+ * retrieves a garage
+ *
+ * @param int $gid GID of the garage
+ *
+ */
+ //done
+function &getGarage($uid)
+{
+ $garage = false;
+ if (intval($uid) > 0) {
+ //$sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $this->db->prefix('garage') . " WHERE id = '$gid'";
+ $sql = "SELECT * FROM " . $this->db->prefix('garage') . " WHERE id = '".$uid."'";
+ //next version . use criteria
+ if (!$result = $this->db->query($sql)) {
+ exit("$sql > SQL Error in function :: getGarage()");
+ //return $garage; //$garage which would be false
+ }
+
+ $numrows = $this->db->getRowsNum($result);
+ if ($numrows == 1) {
+ $garage = new garage();
+ $garage->assignVars($this->db->fetchArray($result));
+ }
+ }
+ return $garage;
+}
+
+//done
+function doesGarageExist($uid){
+
+ $sql = "SELECT id FROM " . $this->db->prefix("garage") . " WHERE uid = '$uid' LIMIT 1";
+ if ( !$result = $this->db->query($sql) ) {
+ exit("SQL Error in function :: doesGarageExist()");
+ }
+ $xgid = $this->db->fetchRow($result);
+ return $xgid;
+}
+
+//use criteria,
+//didnt change yet
+function &getRoster($cid){
+ $sql = "SELECT id,name FROM " . $this->db->prefix("garage") . " WHERE (approved=1 AND viewable=1 AND disabled=0) AND cid='$cid' ORDER BY name";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ return;
+ //exit("SQL Error in function :: getRoster($cid)");
+ }
+ $names = array();
+ while ( $row = $xoopsDB->fetchArray($result) ) {
+ $names[] = $row;
+ }
+ return $names;
+}
+
+//didnt change yet
+function garage_FieldExists($fieldname,$table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'");
+ return($xoopsDB->getRowsNum($result) > 0);
+}
+//didnt change yet
+function garage_AddField($field, $table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF('ALTER TABLE ' . $table . " ADD $field;");
+ return $result;
+}
+
+//done. we use creategarage and then we do setvar. then we insertGarage
+function creategarage($isNew = true){
+ $garage = new garage();
+ if ($isNew) {
+ $garage->setNew();
+ }
+ return $garage;
+ //use setvar to set it in page that calls this.
+}
+
+//done ish
+function insertGarage(&$garage){
+ if (strtolower(get_class($garage)) != 'garage') {
+ return false;
+ }
+ if (!$garage->isDirty()) {
+ return true;
+ }
+ if (!$garage->cleanVars()) { //clean the vars
+ return false;
+ }
+ foreach ($garage->cleanVars as $k => $v) {
+ ${$k} = $v;
+ }
+
+ //use $garage->isNew() to see if the user is a new one. so we can INSERT or just UPDATE
+ //note. i left the insert and the update garages as separate methods.
+ $sql = "INSERT INTO " . $this->db->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ if ( !$result = $$this->db->query($sql) ) {
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+
+ if (empty($uid)) {
+ $uid = $this->db->getInsertId();
+ }
+
+ $garage->assignVar('uid', $uid);
+ return true;
+}
+
+//or?,
+//didnt change yet
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+}
+//adopt the way user.php does new and old users update.,
+//didnt change yet
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+}
+//didnt change yet
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
+
+ } else {
+ return 1;
+ }
+}
+
+//Delete garage?
+
+}
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/class/garage.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -69,46 +69,51 @@
- if($gid){
- $garage = getGarage($gid);
- if($garage['imagechoice'] == 1) {
+ if($gid = intval($gid) > 0){
+
+ $myGarage = xoops_getModuleHandler('garage','garage');
+ $thegarage = $myGarage->getGarage($gid);
+
+ if($thegarage->getVar('imagechoice') == 1) {
$garage['image'] = "[img align=center]". XOOPS_UPLOAD_URL. "/" . "garage/".$garage['uploadimage']."[/img]";
}
- }
+ }else{
+ redirect_header("index.php",2,'Garage Doesn\'t Exist'); //need a constant for this
+ }
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
- $garage['mengine'] = $myts->displayTarea($garage['mengine'], 1, 1, 1, 1, 1);
- $garage['mexterior'] = $myts->displayTarea($garage['mexterior'], 1, 1, 1, 1, 1);
- $garage['minterior'] = $myts->displayTarea($garage['minterior'], 1, 1, 1, 1, 1);
- $garage['mrims'] = $myts->displayTarea($garage['mrims'], 1, 1, 1, 1, 1);
- $garage['maudio'] = $myts->displayTarea($garage['maudio'], 1, 1, 1, 1, 1);
- $garage['mfuture'] = $myts->displayTarea($garage['mfuture'], 1, 1, 1, 1, 1);
- $garage['descript2'] = $myts->displayTarea($garage['descript2'], 1, 1, 1, 1, 1);
- if($garage['descript2']){
+ $garage['mengine'] = $myts->displayTarea($thegarage->getVar('mengine'), 1, 1, 1, 1, 1);
+ $garage['mexterior'] = $myts->displayTarea($thegarage->getVar('mexterior'), 1, 1, 1, 1, 1);
+ $garage['minterior'] = $myts->displayTarea($thegarage->getVar('minterior'), 1, 1, 1, 1, 1);
+ $garage['mrims'] = $myts->displayTarea($thegarage->getVar('mrims'), 1, 1, 1, 1, 1);
+ $garage['maudio'] = $myts->displayTarea($thegarage->getVar('maudio'), 1, 1, 1, 1, 1);
+ $garage['mfuture'] = $myts->displayTarea($thegarage->getVar('mfuture'), 1, 1, 1, 1, 1);
+ $garage['descript2'] = $myts->displayTarea($thegarage->getVar('descript2'), 1, 1, 1, 1, 1);
+ if($thegarage->getVar('descript2')){
if($subop == "more") $xoopsTpl->assign('showmore', true);
else $xoopsTpl->assign('more', _MD_XG_MORE);
}
- $garage['image'] = $myts->displayTarea($garage['image'], 0, 0, 1, 1, 0);
- $garage['location'] = $myts->displayTarea($garage['location'], 0, 0, 0, 0, 0);
- $garage['year'] = $myts->displayTarea($garage['year'], 0, 0, 0, 0, 0);
- $garage['make'] = $myts->displayTarea($garage['make'], 0, 0, 0, 0, 0);
- $garage['model'] = $myts->displayTarea($garage['model'], 0, 0, 0, 0, 0);
- $garage['style'] = $myts->displayTarea($garage['style'], 0, 0, 0, 0, 0);
- $garage['engine'] = $myts->displayTarea($garage['engine'], 0, 0, 0, 0, 0);
- $garage['color'] = $myts->displayTarea($garage['color'], 0, 0, 0, 0, 0);
- $garage['rt'] = $myts->displayTarea($garage['rt'], 0, 0, 0, 0, 0);
- $garage['sixty'] = $myts->displayTarea($garage['sixty'], 0, 0, 0, 0, 0);
- $garage['three'] = $myts->displayTarea($garage['three'], 0, 0, 0, 0, 0);
- $garage['eigth'] = $myts->displayTarea($garage['eigth'], 0, 0, 0, 0, 0);
- $garage['eigthm'] = $myts->displayTarea($garage['eigthm'], 0, 0, 0, 0, 0);
- $garage['thou'] = $myts->displayTarea($garage['thou'], 0, 0, 0, 0, 0);
- $garage['quart'] = $myts->displayTarea($garage['quart'], 0, 0, 0, 0, 0);
- $garage['quartm'] = $myts->displayTarea($garage['quartm'], 0, 0, 0, 0, 0);
- $garage['list'] = $myts->displayTarea($garage['list'], 0, 0, 0, 0, 0);
+ $garage['image'] = $myts->displayTarea($thegarage->getVar('image'), 0, 0, 1, 1, 0);
+ $garage['location'] = $myts->displayTarea($thegarage->getVar('location'), 0, 0, 0, 0, 0);
+ $garage['year'] = $myts->displayTarea($thegarage->getVar('year'), 0, 0, 0, 0, 0);
+ $garage['make'] = $myts->displayTarea($thegarage->getVar('make'), 0, 0, 0, 0, 0);
+ $garage['model'] = $myts->displayTarea($thegarage->getVar('model'), 0, 0, 0, 0, 0);
+ $garage['style'] = $myts->displayTarea($thegarage->getVar('style'), 0, 0, 0, 0, 0);
+ $garage['engine'] = $myts->displayTarea($thegarage->getVar('engine'), 0, 0, 0, 0, 0);
+ $garage['color'] = $myts->displayTarea($thegarage->getVar('color'), 0, 0, 0, 0, 0);
+ $garage['rt'] = $myts->displayTarea($thegarage->getVar('rt'), 0, 0, 0, 0, 0);
+ $garage['sixty'] = $myts->displayTarea($thegarage->getVar('sixty'), 0, 0, 0, 0, 0);
+ $garage['three'] = $myts->displayTarea($thegarage->getVar('three'), 0, 0, 0, 0, 0);
+ $garage['eigth'] = $myts->displayTarea($thegarage->getVar('eigth'), 0, 0, 0, 0, 0);
+ $garage['eigthm'] = $myts->displayTarea($thegarage->getVar('eigthm'), 0, 0, 0, 0, 0);
+ $garage['thou'] = $myts->displayTarea($thegarage->getVar('thou'), 0, 0, 0, 0, 0);
+ $garage['quart'] = $myts->displayTarea($thegarage->getVar('quart'), 0, 0, 0, 0, 0);
+ $garage['quartm'] = $myts->displayTarea($thegarage->getVar('quartm'), 0, 0, 0, 0, 0);
+ $garage['list'] = $myts->displayTarea($thegarage->getVar('list'), 0, 0, 0, 0, 0);
- if($garage['list']){
+ if($thegarage->getVar('list')){
if($xoopsModuleConfig['listformat']) {
- $garage['list2'] = explode(",",$garage['list']);
+ $garage['list2'] = explode(",",$thegarage->getVar('list'));
foreach($garage['list2'] as $item){
$items[] = trim($item);
}
@@ -118,37 +123,37 @@
$xoopsTpl->assign('listformat', $xoopsModuleConfig['listformat']);
if($userIsAdmin == 0){
- if($garage['approved'] == 0){
+ if($thegarage->getVar('approved') == 0){
redirect_header("index.php",2,_MD_XG_NOTAPPROVEDYET);
exit;
}
- if($garage['viewable'] == 0 && $uid != $garage['uid']){
+ if($thegarage->getVar('viewable') == 0 && $uid != $garage['uid']){
redirect_header("index.php",2,_MD_XG_NOTVIEWABLE);
exit;
}
- if($garage['disabled'] == 1){
+ if($thegarage->getVar('disabled') == 1){
redirect_header("index.php",2,_MD_XG_DISABLED);
exit;
}
}
- $garage['uname'] = xoops_getLinkedUnameFromId($garage['uid']);//added by jlm69
+ $garage['uname'] = xoops_getLinkedUnameFromId($thegarage->getVar('uid'));//added by jlm69
- if(($uid == $garage['uid'] && $xoopsModuleConfig['canuseredit']) || ($xoopsModuleConfig['canadminsedit'] && $userIsAdmin)){
+ if(($uid == $thegarage->getVar('uid') && $xoopsModuleConfig['canuseredit']) || ($xoopsModuleConfig['canadminsedit'] && $userIsAdmin)){
$xoopsTpl->assign('panel', true);
$xoopsTpl->assign('editgarage',_MD_XG_EDITGARAGE);
if($userIsAdmin) {
$xoopsTpl->assign('adminlink',_MD_XG_ADMINLINK);
- if($garage['approved'] == 0){
+ if($thegarage->getVar('approved') == 0){
$xoopsTpl->assign('approvegarage',_MD_XG_APPROVEGARAGE);
}
- if($garage['disabled'] == 0){
+ if($thegarage->getVar('disabled') == 0){
$xoopsTpl->assign('disablegarage',_MD_XG_DISABLEGARAGE);
- } elseif ($garage['disabled']) $xoopsTpl->assign('enablegarage',_MD_XG_ENABLEGARAGE);
+ } elseif ($thegarage->getVar('disabled')) $xoopsTpl->assign('enablegarage',_MD_XG_ENABLEGARAGE);
$xoopsTpl->assign('deletegarage',_MD_XG_DELETEGARAGE);
}
}
- $cid = $garage['cid'];
+ $cid = $thegarage->getVar('cid');
if($xoopsModuleConfig['usecats']){
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
@@ -156,7 +161,8 @@
$xoopsTpl->assign('path',$path);
}
-
+ //why not just use smarty constants in the template?
+ unset($myGarage); //unset .
$xoopsTpl->assign('allowcomments', $xoopsModuleConfig['allowcomments']);
$xoopsTpl->assign('gid', $gid);
$xoopsTpl->assign('gname', _MD_XG_GNAME);
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -1,4 +1,6 @@
<?php
+define("_AM_APPROVESUCCESS","Garage Approved.");
+define("_AM_APPROVEFAILURE","There was an error with approving this garage.");
define("_AM_GARAGES_INDEX", "Index");
define("_AM_GARAGES_OPTS", "Preferences");
define("_AM_GARAGES_GOMOD", "Go to module");
Modified: XoopsModules/xgarage/trunk/xgarage/xoops_version.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -3,7 +3,7 @@
global $xoopsModuleConfig;
$modversion['name'] = _MI_NAME;
-$modversion['version'] = ".05beta";
+$modversion['version'] = ".06beta";
$modversion['description'] = _MI_DESC;
$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com / www.arabxoops.com';
$modversion['author'] = 'Northern, script_fu, jlm69, mowaffak';
|
|
From: <be...@us...> - 2013-09-20 23:13:08
|
Revision: 12074
http://sourceforge.net/p/xoops/svn/12074
Author: beckmi
Date: 2013-09-20 23:13:05 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 5
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/image_uploader.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/readme.txt
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
XoopsModules/xgarage/trunk/xgarage/admin/error_log
XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/docs/
XoopsModules/xgarage/trunk/xgarage/install.txt
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,45 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+echo "
+<h1>Garages Module for XOOPS 2.0 Administration Manual </h1>
+<hr />
+<br /><br />
+<a href=\"docs_credits.php\"><strong>Credits</strong></a> <a href=\"docs_user.php\"><strong>Users</strong></a>
+<br /><br />
+
+<p><b>Setting up the Garage Module</b>
+<ul>
+ <li>Once installed go into the module preferences and set them to your liking.</li>
+ <li>If you set it to use categories in the preferences, the next thing you need to do is add your categories.</li>
+ <li>After you create the categories you must go to the permissions section of the modules admin and set the permissions by group and category.<br /> There are 2 permissions to set for each category in each group, 'view permissions' and 'submit permissions'.</li>
+</ul>
+</p><br />
+
+<p><b>Creating Categories</b><br /><br />
+<ul>
+ <li>Right now there is only one option when creating a category, that is whether or not you want to show the race times in this category. There may be more in the future.</li>
+</ul>
+</p><br />
+
+<p><b>Setting Permissions</b><br /><br />
+<ul>
+ <li>If you are using categories you will see a tab for Permissions, click on it.
+<br />You will see a drop down box that says view permissions and all the categories you created.
+<br />Check the categories you want to have view permissions for each group.</li>
+<li>Next you need to change the drop down box so it reads 'submit permissions'.
+<br />Check the categories you want to have submit permissions for each group.
+</ul>
+</p><br />
+
+
+<p><b>Other admin functions</b><br /><br />
+<ul>
+ <li>Approving New Garages</li><br>
+ <li>Disable Garage</li><br>
+ <li>Enable Garage</li><br>
+</p>";
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,39 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+
+echo "<h1>Garage Module for XOOPS 2.0 Credits </h1>
+<hr />
+
+
+<br /><br /><div>
+<a href=\"docs_admin.php\"><strong>"._AM_XG_ADMIN."</strong></a> <a href=\"docs_user.php\"><strong>"._AM_XG_USERS."</strong></a></div>
+<br /><br />
+
+
+
+
+<p><strong>"._AM_XG_CODEDBY." by Northern / Script_fu / jlm69 / mowaffak</strong><br><a href=\"http://www.calibernation.com/\"><strong>http://www.calibernation.com/</strong></a><a href=\"http://www.xgarage.org/\"><br><strong>http://www.xgarage.org/</strong></a><a href=\"http://www.jlmzone.com/\"><br><strong>http://www.jlmzone.com/</strong></a><a href=\"http://www.arabxoops.com/\"><br><strong>http://www.arabxoops.com/</strong></a></p>
+<p>XOOPS - <a href=\"http://www.xoops.org/\">http://www.xoops.org/ </a></p>
+<p>Script_fu - for his encouragement to get this module done. </p>
+<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
+<p>exbanious - You inspired many to make or ask for a garage module. </p>
+<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
+ Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
+
+<p><br>
+ <strong>"._AM_XG_TRANSLATORS."</strong></p>
+<p>English - Northern <br>
+ German - <br>
+ Japanese - <br>
+Portuguese - <br>
+Greek - <br>
+French - <br>
+Dutch -<br>
+Danish - <br>
+</p>
+<p> </p>";
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,21 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+
+echo "<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
+<hr>
+<br /><br />
+<a href=\"docs_credits.php\"><strong>Credits</strong></a> <a href=\"docs_admin.php\"><strong>Administration</strong></a>
+<br /><br />
+
+<p>Add new garage: </p>
+<p>Name and Description are required.<br>
+ To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
+<p>Edit Garage:</p>
+<p>In some web sites, changes must be requested.</p>
+<p> </p>";
+echo("</div>");
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,9 @@
+[07-Oct-2007 15:21:06] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:21:06] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:21:06] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
+[07-Oct-2007 15:22:30] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:22:30] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:22:30] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
+[07-Oct-2007 15:23:13] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:23:13] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:23:13] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
Modified: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,7 +1,7 @@
<?php
function getCats($gid){
global $xoopsDB;
- $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
+ $sql = "SELECT cid,name,racing FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -23,11 +23,11 @@
return ($name);
}
}
-function addCat($name,$gid){
+function addCat($name,$racing,$gid){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,gid) VALUES ('$name',$gid)";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,racing,gid) VALUES ('$name','$racing',$gid)";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addCat($name,$gid)");
+ exit("$sql > SQL Error in function :: addCat($name,$racing,$gid)");
return 0;
} else {
return 1;
@@ -102,7 +102,7 @@
}
function getActiveGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
+ $sql = ("SELECT id,viewable,name,year,make,model,style FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -135,7 +135,7 @@
function adminMenu ($currentoption = 0, $breadcrumb = '')
{
-
+
/* Nice buttons styles */
echo "
<style type='text/css'>
@@ -157,29 +157,35 @@
";
// global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
- global $xoopsModule, $xoopsConfig;
+ global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
- $tblColors = Array();
- $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = '';
+ $tblColors = array();
+ $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = '';
$tblColors[$currentoption] = 'current';
echo "<div id='buttontop'>";
echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
//echo "<td style=\"width: 45%; 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_SCLIENT_OPTS . "</a> | <a href=\"../index.php\">" . _AM_SCLIENT_GOMOD . "</a> | <a href=\"import.php\">" . _AM_SCLIENT_IMPORT . "</a> | <a href='" . smartclient_getHelpPath() ."' target=\"_blank\">" . _AM_SCLIENT_HELP . "</a> | <a href=\"about.php\">" . _AM_SCLIENT_ABOUT . "</a></td>";
- echo "<td style=\"width: 70%; 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_GARAGES_OPTS . "</a> | <a href=\"../index.php\">" . _AM_GARAGES_GOMOD . "</a> | <a href=\"index.php?op=documentation\">" . _AM_GARAGES_DOCS . "</a> | <a href=\"index.php?op=support\">" . _AM_GARAGES_SUPPORT . "</a> | <a href=\"index.php?op=donations\">" . _AM_GARAGES_DONATIONS . "</a></td>";
+ echo "<td style=\"width: 70%; 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_GARAGES_OPTS . "</a> | <a href=\"../index.php\">" . _AM_GARAGES_GOMOD . "</a> | <a href=\"index.php?op=support\">" . _AM_GARAGES_SUPPORT . "</a> | <a href=\"index.php?op=donations\">" . _AM_GARAGES_DONATIONS . "</a></td>";
echo "<td style=\"width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $myts->displayTarea($xoopsModule->name()) . " " . _AM_GARAGES_MODADMIN . "</b> " . $breadcrumb . "</td>";
echo "</tr></table>";
echo "</div>";
echo "<div id='buttonbar'>";
echo "<ul>";
- echo "<li id='" . $tblColors[0] . "'><a href=\"../garage.php?op=add\"><span>" . _AM_GARAGES_ADDNEWGARAGE . "</span></a></li>";
+ echo "<li id='" . $tblColors[0] . "'><a href=\"index.php?op=documentation\"><span>" . _AM_GARAGES_DOCS . "</span></a></li>";
echo "<li id='" . $tblColors[1] . "'><a href=\"index.php\"><span>" . _AM_GARAGES_INDEX . "</span></a></li>";
echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
+if($xoopsModuleConfig['usecats']){
echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
echo "<li id='" . $tblColors[5] . "'><a href=\"garageperms.php\"><span>" . _AM_GARAGES_PERMISSIONS . "</span></a></li>";
+}
+
echo "</ul></div>";
+
}
+
+
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -90,4 +90,4 @@
unset ($permform);
xoops_cp_footer();
-?>
+?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -120,11 +120,13 @@
//echo("testing123");
//adminMenu(4, _AM_GARAGES_CATEGORIES);
if($_POST['catname']){
- $success = addCat($_POST['catname'],$_POST['gid']);
+ $cid = $_POST['cid'];
+ if(!isset($_POST['racing'])) $_POST['racing'] = 0;
+ $success = addCat($_POST['catname'],$_POST['racing'],$_POST['gid']);
if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDED);
exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
+ } else redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
}
break;
@@ -251,6 +253,7 @@
echo("<form method='post' action='index.php'>");
echo(_AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
$cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<br/>"._AM_XG_RACING."<input type='checkbox' name='racing' value='1'>");
echo("<input type='hidden' name='cid' value='$cid'>");
echo("<input type='hidden' name='op' value='add_cat'>");
echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."'>");
@@ -294,11 +297,16 @@
break;
case "documentation":
xoops_cp_header();
- adminMenu(5, _AM_GARAGES_DOCUMENTATION);
+ adminMenu(0, _AM_XG_DOCUMENTATION);
- echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
+ echo("<div style='text-align:center;'>"._AM_GARAGES_DOCS."<br/><br/><br/>");
+ echo "<h1>"._AM_XG_DOC_HEAD."</h1>";
+echo "<hr>
+<p><a href="."docs_credits.php".">"._AM_XG_CREDITS."</a></p>
+<p><a href="."docs_admin.php".">"._AM_XG_ADMIN_MAN."</a> </p>
+<p><a href="."docs_user.php".">"._AM_XG_USER_MAN."</a></p>
+<p> </p>";
+ echo("<br/><br/><br/><a href='http://www.xgarage.org'>"._AM_XG_DOC_SUPPORT."</a>");
echo("</div>");
@@ -311,7 +319,7 @@
echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
- echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
+ echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>"._AM_XG_DOC_FORUM."</a>");
echo("</div>");
@@ -346,7 +354,7 @@
for($x=0;$x<count($names);$x++){
if($names[$x]['viewable']) $viewable="color:#000000;";
else $viewable="color:#cccccc;";
- echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['year']." - ".$names[$x]['make']." - ".$names[$x]['model']." - ".$names[$x]['style']."</a></div>");
}
else echo("<div>"._AM_NONEACTIVE."</div>");
break;
Added: XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,27 @@
+<?php
+
+include_once '../../../include/cp_header.php';
+xoops_cp_header();
+include_once XOOPS_ROOT_PATH.'/modules/garage/include/functions.php';
+
+
+if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
+ $errors=0;
+
+ // 2.1) Add the new fields to the topic table
+ if (!garage_FieldExists('racing',$xoopsDB->prefix('garage_cats'))) {
+ garage_AddField("racing TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER name",$xoopsDB->prefix('garage_cats'));
+ }
+
+ // At the end, if there was errors, show them or redirect user to the module's upgrade page
+ if($errors) {
+ echo '<H1>' . _AM_XG_UPGRADEFAILED . '</H1>';
+ echo '<br />' . _AM_XG_UPGRADEFAILED0;
+ } else {
+ echo _AM_XG_UPGRADECOMPLETE." - <a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin&op=update&module=garage'>"._AM_XG_UPDATEMODULE."</a>";
+ }
+} else {
+ printf("<h2>%s</h2>\n",_AM_NEWS_UPGR_ACCESS_ERROR);
+}
+xoops_cp_footer();
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,41 +1,47 @@
<?php
-require('header.php');
-global $xoopsModuleConfig, $xoopsUser;
+include("header.php");
-//Group Perms added by jlm69
-if ($xoopsModuleConfig['usecats']) {
+$mydirname = basename( dirname( __FILE__ ) ) ;
+require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
+
+$myts =& MyTextSanitizer::getInstance();
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
-$groups = $xoopsUser->getGroups();
+ $groups = $xoopsUser->getGroups();
} else {
-$groups = XOOPS_GROUP_ANONYMOUS;
+ $groups = XOOPS_GROUP_ANONYMOUS;
}
+
$gperm_handler =& xoops_gethandler('groupperm');
+
if (isset($_POST['item_id'])) {
-$perm_itemid = intval($_POST['item_id']);
+ $perm_itemid = intval($_POST['item_id']);
} else {
-$perm_itemid = 0;
+ $perm_itemid = 0;
}
//If no access
if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
- redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
-exit();
- }
- }
+ redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
+ exit();
+}
+
// End Group Perms
-
require(XOOPS_ROOT_PATH.'/header.php');
include("include/functions.php");
+settype($uid, "string");
+settype($xgid, "string");
settype($cid, "integer");
+settype($cats, "array");
settype($url, "string");
settype($name, "string");
settype($image, "string");
-settype($imagechoice, "string");
+settype($imagechoice, "string");//jlm69
+settype($uploadimage, "string");//jlm69
settype($location, "string");
settype($year, "string");
settype($make, "string");
@@ -63,10 +69,9 @@
settype($notifypub, "string");
settype($nohtml, "string");
settype($nosmiley, "string");
+settype($descript2, "string");//jlm69
+settype($linkgarage, "string");//jlm69
-global $xoopsModuleConfig;
-global $xoopsUser;
-
$userIsAdmin = userIsAdmin($xoopsUser);
if(!$xoopsUser) redirect_header("/user.php",2,_MD_XG_MUSTLOGIN);
$uid = $xoopsUser->uid();
@@ -105,7 +110,7 @@
$cid = $myts->makeTboxData4Save($_POST['cid']);
$name = $myts->makeTboxData4Save($_POST['name']);
$image = $myts->makeTboxData4Save($_POST['image']);
-
+ $imagechoice = $myts->makeTboxData4Save($_POST['imagechoice']);
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
$year = $myts->makeTboxData4Save($_POST['year']);
@@ -129,16 +134,16 @@
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
$mfuture = $myts->makeTareaData4Save($_POST['mfuture']);
- $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
- $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
+ if($xoopsModuleConfig['usedescript2']) $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
+ if($xoopsModuleConfig['linkgarage']) $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
if($url == "http://") $url = "";
if($image) $image = "[img align=right]".$image."[/img]";
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
-
+//jlm69
if($success) {
$notification_handler =& xoops_gethandler('notification');
$id = $xoopsDB->getInsertId();
@@ -160,9 +165,9 @@
$notification_handler->triggerEvent ('listing', $gid, 'new_listing', $tags );
-}
+}//end jlm69
- if($success) redirect_header("index.php",8,_MD_XG_ADDSUCCESS);
+ if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
break;
@@ -179,6 +184,12 @@
$garage = getGarage($gid);
$puid = $garage['uid'];
+ if ($xoopsModuleConfig['usecats'] != 0) {
+ $catopts = getCatOptions($cid);
+ $timetrials = $catopts['racing'];
+ } else {
+ $timetrials = '';
+ }
$ouid = $myts->makeTboxData4Save($_POST['ouid']);
$viewable = $myts->makeTboxData4Save($_POST['viewable']);
$cid = $myts->makeTboxData4Save($_POST['cid']);
@@ -194,6 +205,8 @@
$style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
+
+ if(isset($timetrials)) {
$rt = $myts->makeTboxData4Save($_POST['rt']);
$sixty = $myts->makeTboxData4Save($_POST['sixty']);
$three = $myts->makeTboxData4Save($_POST['three']);
@@ -202,6 +215,18 @@
$thou = $myts->makeTboxData4Save($_POST['thou']);
$quart = $myts->makeTboxData4Save($_POST['quart']);
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
+
+ } else {
+ $rt = '';
+ $sixty = '';
+ $three = '';
+ $eigth = '';
+ $eigthm = '';
+ $thou = '';
+ $quart = '';
+ $quartm = '';
+ }
+
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
$mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
@@ -209,8 +234,8 @@
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
$mfuture = $myts->makeTareaData4Save($_POST['mfuture']);
- $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
- $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
+ if($xoopsModuleConfig['usedescript2']) $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
+ if($xoopsModuleConfig['linkgarage']) $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
if($url == "http://") $url = "";
if($image) $image = "[img align=right]".$image."[/img]";
@@ -242,9 +267,12 @@
redirect_header($redirect_url,2,$redirect_msg);
exit;
}
- if(!$xoopsModuleConfig['multiplegarages'] && !$userIsAdmin){
- if($xgid = doesGarageExist($uid)){
- $redirect_url = "index.php?op=view&gid=$xgid";
+
+ if($xoopsModuleConfig['multiplegarage'] = 1){
+
+
+ if($gid = doesGarageExist($uid)) {
+ $redirect_url = "index.php?op=view&gid=$uid";
$redirect_msg = _MD_XG_CANNOTADDMULTIPLE;
redirect_header($redirect_url,2,$redirect_msg);
exit;
@@ -254,12 +282,15 @@
if(!$url) $url = "http://";
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_MD_XG_ADDGARAGE, "garageform", xoops_getenv('PHP_SELF'));
+ $sform->setExtra("enctype='multipart/form-data'");
$sform->addElement(new XoopsFormHidden('aa',$xoopsModuleConfig['autoapprove']), false);
$sform->addElement(new XoopsFormHidden('op','post'), false);
- if ($xoopsModuleConfig['usecats']) {
+ if ($xoopsModuleConfig['usecats'] != 0) {
+ $catopts = getCatOptions($cid);
+ $timetrials = $catopts['racing'];
+
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
-
//$sform->addElement(new XoopsFormSelect(_MD_XG_CATEGORY, 'cid', $cid, 3), true);
ob_start();
//$sform->addElement(new XoopsFormHidden('cid', 'gid'));
@@ -267,7 +298,7 @@
$sform->addElement(new XoopsFormLabel(_MD_XG_CATEGORY, ob_get_contents()));
ob_end_clean();
} else $sform->addElement(new XoopsFormHidden('cid',0), false);
-
+ $timetrials = '';
$sform->addElement(new XoopsFormText(_MD_XG_NAME, 'name', 50, 50, $name), true);
if($xoopsModuleConfig['addimages']){
$sform->addElement(new XoopsFormText(_MD_XG_IMAGE, 'image', 50, 255, $image), false);
@@ -288,6 +319,8 @@
$sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
+
+ if($timetrials) {
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
$sform->addElement(new XoopsFormText(_MD_XG_SIXTY, 'sixty', 50, 75, $sixty), false);
$sform->addElement(new XoopsFormText(_MD_XG_THREE, 'three', 50, 75, $three), false);
@@ -296,6 +329,22 @@
$sform->addElement(new XoopsFormText(_MD_XG_THOU, 'thou', 50, 75, $thou), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
+
+ } else {
+
+ $sform->addElement(new XoopsFormHidden('rt',$rt), false);
+ $sform->addElement(new XoopsFormHidden('sixty',$sixty), false);
+ $sform->addElement(new XoopsFormHidden('three',$three), false);
+ $sform->addElement(new XoopsFormHidden('eigth',$eigth), false);
+ $sform->addElement(new XoopsFormHidden('eigthm',$eigthm), false);
+ $sform->addElement(new XoopsFormHidden('thou',$thou), false);
+ $sform->addElement(new XoopsFormHidden('quart',$quart), false);
+ $sform->addElement(new XoopsFormHidden('quartm',$quartm), false);
+}
+
+
+
+
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
$sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), false);
$sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), false);
@@ -303,7 +352,8 @@
$sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), false);
$sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), false);
$sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), false);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
+
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -366,7 +416,9 @@
if ($userIsAdmin) $sform->addElement(new XoopsFormText(_MD_XG_OWNERUID, 'ouid', 50, 50, $puid), true);
else $sform->addElement(new XoopsFormHidden('ouid',$puid), true);
$sform->addElement(new XoopsFormRadioYN(_MD_XG_VIEWABLE, 'viewable',$viewable), true);
- if ($xoopsModuleConfig['usecats']) {//$sform->addElement(new XoopsFormSelect(_MD_XG_CATEGORY, 'cid', $cid, 3), true);
+ if ($xoopsModuleConfig['usecats'] != 0) {//$sform->addElement(new XoopsFormSelect(_MD_XG_CATEGORY, 'cid', $cid, 3), true);
+ $catopts = getCatOptions($cid);
+ $timetrials = $catopts['racing'];
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
@@ -377,6 +429,7 @@
$sform->addElement(new XoopsFormLabel(_MD_XG_CATEGORY, ob_get_contents()));
ob_end_clean();
} else $sform->addElement(new XoopsFormHidden('cid',0), false);
+ $timetrials = '';
$sform->addElement(new XoopsFormText(_MD_XG_NAME, 'name', 50, 50, $name), true);
$sform->addElement(new XoopsFormText(_MD_XG_IMAGE, 'image', 50, 255, $image), false);
if ($xoopsModuleConfig['useruploads'] || $userIsAdmin)
@@ -398,6 +451,8 @@
$sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
+
+ if(isset($timetrials)) {
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
$sform->addElement(new XoopsFormText(_MD_XG_SIXTY, 'sixty', 50, 75, $sixty), false);
$sform->addElement(new XoopsFormText(_MD_XG_THREE, 'three', 50, 75, $three), false);
@@ -406,14 +461,16 @@
$sform->addElement(new XoopsFormText(_MD_XG_THOU, 'thou', 50, 75, $thou), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
+ }
+
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), false);
- $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), false);
- $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), false);
- $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), false);
- $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), false);
- $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), false);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), false);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -436,7 +493,7 @@
$redirect_url = "index.php";
$redirect_msg = _MD_XG_CANNOTCHANGE;
}
- redirect_header($redirect_url,8,$redirect_msg);
+ redirect_header($redirect_url,3,$redirect_msg);
exit;
}
}
Modified: XoopsModules/xgarage/trunk/xgarage/image_uploader.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/image_uploader.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/image_uploader.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,8 +1,9 @@
<?php
+ $uploadimage = '';
//image uploader
if($_FILES['uploadimage']['name'] <> ""){
include_once '../../class/uploader.php';
-
+ $date = time();
$upload_path = XOOPS_UPLOAD_PATH . "/" . "garage";
if(!is_dir($upload_path)) mkdir($upload_path);
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
@@ -16,7 +17,7 @@
$errmsg = $uploader->getErrors();
} else {
//echo '<h4>File uploaded successfully!</h4>';
- $msg = '<h4>'._MD_PR_UPLOADSUCCESS.'</h4>';
+ $msg = '<h4>'._MD_XG_UPLOADSUCCESS.'</h4>';
//echo 'Saved as: ' . $uploader->getSavedFileName() . '<br />';
$uploadimage = $uploader->getSavedFileName();
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -2,7 +2,7 @@
function getRoster($cid){
global $xoopsDB;
- $sql = "SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE (approved=1 AND viewable=1 AND disabled=0) AND cid=$cid ORDER BY name";
+ $sql = "SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE (approved=1 AND viewable=1 AND disabled=0) AND cid='$cid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
return;
//exit("SQL Error in function :: getRoster($cid)");
@@ -16,40 +16,40 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = '$gid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
- $Garage = array();
+ $garage = array();
while ( $row = $xoopsDB->fetchArray($result) ) {
- $Garage = $row;
+ $garage = $row;
}
- return $Garage;
+ return $garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
} else {
return 1;
}
}
-function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
} else {
return 1;
}
}
-function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$egine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
@@ -60,7 +60,7 @@
function doesGarageExist($uid){
global $xoopsDB;
- $sql = "SELECT id FROM " . $xoopsDB->prefix("garage") . " WHERE uid=$uid LIMIT 1";
+ $sql = "SELECT id FROM " . $xoopsDB->prefix("garage") . " WHERE uid = '$uid' LIMIT 1";
if ( !$result = $xoopsDB->query($sql) ) {
exit("SQL Error in function :: doesGarageExist()");
}
@@ -68,9 +68,37 @@
return $xgid;
}
+//Added by jlm69
+function getCatOptions($cid){
+ global $xoopsDB;
+ $sql = "SELECT cid,name,racing FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = '$cid' ORDER BY name";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: getCatOptions($cid)");
+ }
+ $cat_racing = array();
+ while ( $row = $xoopsDB->fetchArray($result) ) {
+ $cat_racing = $row;
+ }
+ return $cat_racing;
+
+}
+
+function getCatName($cid){
+ global $xoopsDB;
+ $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid= '$cid'";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ return;
+ //exit("SQL Error in function :: getRoster($cid)");
+ }
+ $category_name = $xoopsDB->fetchArray($result);
+ return $category_name;
+}
+
+//end add
+
function getCats($gid){
global $xoopsDB;
- $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = $gid ORDER BY name";
+ $sql = "SELECT cid,name,racing FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = $gid ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -260,4 +288,18 @@
return $editor;
}
+function garage_FieldExists($fieldname,$table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'");
+ return($xoopsDB->getRowsNum($result) > 0);
+}
+
+function garage_AddField($field, $table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF('ALTER TABLE ' . $table . " ADD $field;");
+ return $result;
+}
+
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,51 +1,55 @@
<?php
//if (!defined('XOOPS_XMLRPC')) define('XOOPS_XMLRPC', 1);
-require('header.php');
+include("header.php");
-global $xoopsModuleConfig, $xoopsUser;
+$mydirname = basename( dirname( __FILE__ ) ) ;
+global $xoopsModuleConfig, $xoopsModule, $xoopsUser;
+require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
-// Group Permissions added by jlm69
-if($xoopsModuleConfig['usecats']){
+if($xoopsModuleConfig['usecats']) {
+$myts =& MyTextSanitizer::getInstance();
+
+
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
-$groups = $xoopsUser->getGroups();
+ $groups = $xoopsUser->getGroups();
} else {
-$groups = XOOPS_GROUP_ANONYMOUS;
+ $groups = XOOPS_GROUP_ANONYMOUS;
}
+
$gperm_handler =& xoops_gethandler('groupperm');
if (isset($_POST['item_id'])) {
-$perm_itemid = intval($_POST['item_id']);
+ $perm_itemid = intval($_POST['item_id']);
} else {
-$perm_itemid = 0;
+ $perm_itemid = 0;
}
+
//If no access
if (!$gperm_handler->checkRight("garage_view", $perm_itemid, $groups, $module_id)) {
-redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
-exit();
- }
-
- }
+ redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
+ exit();
+}
+}
// End Group Permissions
-//require(XOOPS_ROOT_PATH.'/header.php');
-
+require(XOOPS_ROOT_PATH.'/header.php');
include("include/functions.php");
+
settype($op,"string");
+settype($subop,"string");//added by jlm69
settype($uid,"integer");
settype($garage,"array");
+settype($cats,"array");//added by jlm69
settype($itemTotal,"string");
-$self = $_SERVER['PHP_SELF'];
+$self = $_SERVER['PHP_SELF'];//added by jlm69
-global $xoopsModuleConfig;
-global $xoopsUser;
-
$userIsAdmin = userIsAdmin($xoopsUser);
$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
@@ -60,18 +64,18 @@
case "view":
$xoopsOption['template_main'] = "view_garage.html";
include XOOPS_ROOT_PATH."/header.php";
+
+
+
+
+
if($gid){
$garage = getGarage($gid);
- if($garage['imagechoice']) {
-$garage['image'] = "[img align=right]". XOOPS_UPLOAD_URL. "/" . "garage/".$garage['uploadimage']."[/img]";
+ if($garage['imagechoice'] == 1) {
+$garage['image'] = "[img align=center]". XOOPS_UPLOAD_URL. "/" . "garage/".$garage['uploadimage']."[/img]";
}
}
-
-
-
-
-
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
$garage['mengine'] = $myts->displayTarea($garage['mengine'], 1, 1, 1, 1, 1);
$garage['mexterior'] = $myts->displayTarea($garage['mexterior'], 1, 1, 1, 1, 1);
@@ -128,7 +132,7 @@
}
}
- $garage['uname'] = xoops_getLinkedUnameFromId($garage['uid']);
+ $garage['uname'] = xoops_getLinkedUnameFromId($garage['uid']);//added by jlm69
if(($uid == $garage['uid'] && $xoopsModuleConfig['canuseredit']) || ($xoopsModuleConfig['canadminsedit'] && $userIsAdmin)){
$xoopsTpl->assign('panel', true);
@@ -144,19 +148,19 @@
$xoopsTpl->assign('deletegarage',_MD_XG_DELETEGARAGE);
}
}
-
+ $cid = $garage['cid'];
if($xoopsModuleConfig['usecats']){
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
$path = $cattree->getNicePathFromId($cid, "name", $self."?op=default");
$xoopsTpl->assign('path',$path);
- }
+
+ }
-
$xoopsTpl->assign('allowcomments', $xoopsModuleConfig['allowcomments']);
$xoopsTpl->assign('gid', $gid);
$xoopsTpl->assign('gname', _MD_XG_GNAME);
- $xoopsTpl->assign('ownername', _MD_XG_USERNAME);
+ $xoopsTpl->assign('ownername', _MD_XG_USERNAME);//added by jlm69
$xoopsTpl->assign('garage', $garage);
$xoopsTpl->assign('list', $xoopsModuleConfig['listname']);
$xoopsTpl->assign('website', _MD_XG_PWEBSITE);
@@ -183,14 +187,20 @@
$xoopsTpl->assign('mrims',_MD_XG_MRIMS);
$xoopsTpl->assign('maudio',_MD_XG_MAUDIO);
$xoopsTpl->assign('mfuture',_MD_XG_MFUTURE);
- $xoopsTpl->assign('garage_of',_MD_XG_GARAGEOF);
-
+ $xoopsTpl->assign('garage_of',_MD_XG_GARAGEOF);//added by jlm69
+ $xoopsTpl->assign('owner_info',_MD_XG_OWNERINFO);//added by jlm69
+ $xoopsTpl->assign('garage_info',_MD_XG_GARAGE_INFO);//added by jlm69
+ $xoopsTpl->assign('modifications',_MD_XG_MODIFICATIONS);//added by jlm69
+ $xoopsTpl->assign('time_trials',_MD_XG_TIME_TRIALS);//added by jlm69
+ $xoopsTpl->assign('garage_profile',_MD_XG_PROFILE);//added by jlm69
+
if($xoopsModuleConfig['allowcomments']) include XOOPS_ROOT_PATH.'/include/comment_view.php';
break;
case "default":
default:
+
$xoopsOption['template_main'] = "cat_index.html";
include XOOPS_ROOT_PATH."/header.php";
//$xoopsOption['template_main'] = "roster.html";
@@ -217,7 +227,11 @@
$path = $cattree->getNicePathFromId($cid, "name", $self."?op=default");
$xoopsTpl->assign('path',$path);
$xoopsTpl->assign('cid',$cid);
+ if ($cid != 0) {
+ $xoopsTpl->assign('show_add',true);
+ }
$cats = getCats($cid);
+
//$xoopsTpl->assign('cats', $cats);
for($i=0;$i<count($cats);$i++){
//$result = getCount($cats[$i]['cid']);
@@ -229,7 +243,7 @@
$xoopsTpl->append('cats', $cats[$i]);
}
//var_dump($cats);
- }
+ } else $xoopsTpl->assign('show_add',true);
$names = getRoster($cid);
Deleted: XoopsModules/xgarage/trunk/xgarage/install.txt
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/install.txt 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/install.txt 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1 +0,0 @@
-Upload the garage folder inside of modules
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -8,7 +8,7 @@
define("_AM_GARAGES_APPROVE", "Approve");
define("_AM_GARAGES_DISABLED", "Disabled");
define("_AM_GARAGES_CATEGORIES", "Categories");
-define("_AM_GARAGES_DOCUMENTATION", "Documentation");
+
define("_AM_GARAGES_SUPPORT", "Support");
define("_AM_GARAGES_DONATIONS", "Donations");
define("_AM_DOCS","Garages Module Documentation");
@@ -69,8 +69,27 @@
define("_AM_GARAGES_CAT2GROUPDESC" , "Check categories which you allow to access" ) ;
define("_AM_GARAGES_GROUPPERMDESC" , "Select group(s) allowed to submit listings." ) ;
define("MI_GARAGES_GROUPPERM", "Submit Permissions");
+define("_AM_GARAGES_VIEWFORM", "View Permissions");
define("_AM_GARAGES_SUBMITFORM", "Submit Permissions");
+define("_AM_GARAGES_VIEWFORM_DESC", "Select, who can view a category");
define("_AM_GARAGES_SUBMITFORM_DESC", "Select, who can submit a listing");
-define("_AM_GARAGES_VIEWFORM", "View Permissions");
-define("_AM_GARAGES_VIEWFORM_DESC", "Select, who can view listings");
+
+//Changes and additions by jlm69 v .05
+define("_AM_XG_RACING", "Show racing times in this category");
+define("_AM_XG_DOCUMENTATION", "Documentation");
+define("_AM_XG_CREDITS", "Credits");
+define("_AM_XG_ADMIN_MAN", "Administration Manual");
+define("_AM_XG_USER_MAN", "User Manual");
+define("_AM_XG_DOC_SUPPORT", "Live Docs and support at X-Garage");
+define("_AM_XG_DOC_HEAD", "Garages Module for XOOPS 2.0 Documentation");
+define("_AM_XG_DOC_FORUM", "Garages Module for XOOPS Support Forum");
+define("_AM_XG_ADMIN", "Administration");
+define("_AM_XG_USERS", "Users");
+define("_AM_XG_CODEDBY", "Concept, Coded and Maintained");
+define("_AM_XG_TRANSLATORS", "Translators: ");
+define("_AM_XG_UPDATEMODULE", "Update the Module Now");
+define("_AM_XG_UPGR_ACCESS_ERROR", "Error, to use the upgrade script, you must be an admin on this module");
+define("_AM_XG_UPGRADECOMPLETE", "Upgrade Complete");
+define('_AM_XG_UPGRADEFAILED', 'Upgrade Failed');
+define('_AM_XG_UPGRADEFAILED0', "Please note the messages and try to correct the problems with phpMyadmin and the sql definition's file available in the 'sql' folder of the garage module");
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/main.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -27,11 +27,11 @@
define("_MD_XG_MAINLINK","Main");
-define("_MD_XG_NONEYET","There are no garage yet.");
+define("_MD_XG_NONEYET","There are no garages yet.");
-define("_MD_XG_HOWTOADDGARAGE","Follow these intructions to get your garage added to this site.");
+define("_MD_XG_HOWTOADDGARAGE","Follow these instructions to get your garage added to this site.");
define("_MD_XG_USERCANNOTSUBMIT","Contact the webmaster for more information on adding a garage.");
-define("_MD_XG_HOWTOCHANGEGARAGE","Follow these intructions to get your garage changed.");
+define("_MD_XG_HOWTOCHANGEGARAGE","Follow these instructions to get your garage changed.");
define("_MD_XG_USERCANNOTCHANGE","Contact the webmaster for more information on changing your garage.");
define("_MD_XG_ADDGARAGE","Add a New Garage");
@@ -106,8 +106,13 @@
define("_MD_XG_MAUDIO","Audio/Video");
define("_MD_XG_MFUTURE","Future");
+//added by jlm69
define("_MD_XG_USERNAME","Username ");
define("_MD_XG_STYLE","Body Style");
define("_MD_XG_GARAGEOF","The Garage of ::");
-
+define("_MD_XG_OWNERINFO","Owner Info");
+define("_MD_XG_GARAGE_INFO","Garage Info");
+define("_MD_XG_MODIFICATIONS","Modifications");
+define("_MD_XG_TIME_TRIALS","Time Trials");
+define("_MD_XG_PROFILE","XGarage Car Profile");
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/readme.txt
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/readme.txt 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/readme.txt 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,2 +1,27 @@
-Garage Beta #1
-Use at your own risk!
\ No newline at end of file
+Garage .05 Beta
+Use at your own risk!
+
+
+Upgrading to version .05 beta
+
+
+To upgrade from any previous version you will need to run the upgrade.php script.
+
+Point your browser to this URL.
+
+http:www/yoursite/modules/garage/admin/upgrade.php
+
+You will come to a page that reads ' Upgrade Complete - Update the Module Now '
+Click on 'Update the Module Now' to take you to the module update page.
+
+You are finished.
+
+You may need to remove the template files for the garage in the folder templates_c.
+
+
+
+You can remove this file after you upgrade or not.
+
+
+
+jlm69
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:13:05 UTC (rev 12074)
@@ -15,9 +15,10 @@
`imagechoice` tinyint(4) NOT NULL default '0',
`url` varchar(255) NOT NULL default '',
`location` varchar(75) NOT NULL default '',
- `mark` varchar(75) NOT NULL default '',
+ `year` varchar(75) NOT NULL default '',
+ `make` varchar(75) NOT NULL default '',
`model` varchar(75) NOT NULL default '',
- `year` varchar(75) NOT NULL default '',
+ `style` varchar(75) NOT NULL default '',
`engine` varchar(75) NOT NULL default '',
`color` varchar(75) NOT NULL default '',
`rt` varchar(75) NOT NULL default '',
@@ -29,7 +30,7 @@
`quart` varchar(75) NOT NULL default '',
`quartm` varchar(75) NOT NULL default '',
`mengine` text NOT NULL,
- `meterior` text NOT NULL,
+ `mexterior` text NOT NULL,
`minterior` text NOT NULL,
`mrims` text NOT NULL,
`mfuture` text NOT NULL,
@@ -47,6 +48,7 @@
CREATE TABLE `garage_cats` (
`cid` int(11) NOT NULL auto_increment,
`name` varchar(75) NOT NULL default '',
+ `racing` tinyint(1) NOT NULL default '0',
`gid` int(11) NOT NULL default '0',
UNIQUE KEY `ID` (`cid`)
) TYPE=MyISAM COMMENT='garage categories';
Modified: XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,6 +1,9 @@
<div style="font-size:small;">
<a href="index.php"><img src="images/icons/index.png" align="middle" title="[<{$index}>]" alt="[<{$index}>]"></a>
-<{if $addnewgarage}><a href="garage.php?op=add<{if $cid}>&cid=<{$cid}><{/if}>"><img src="images/icons/add.png" align="middle" title="[<{$addnewgarage}>]" alt="[<{$addnewgarage}>]"></a><{/if}>
+
+
+<{if $show_add}>
+<{if $addnewgarage}><a href="garage.php?op=add<{if $cid}>&cid=<{$cid}><{/if}>"><img src="images/icons/add.png" align="middle" title="[<{$addnewgarage}>]" alt="[<{$addnewgarage}>]"></a><{/if}><{/if}>
<{if $panel == true}>
<{if $adminlink}><a href="../../modules/garage/admin/index.php"><img src="images/icons/admin.png" align="middle" title="[<{$adminli...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:12:06
|
Revision: 12073
http://sourceforge.net/p/xoops/svn/12073
Author: beckmi
Date: 2013-09-20 23:12:04 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 4
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -1,8 +1,10 @@
<?php
require('header.php');
+global $xoopsModuleConfig, $xoopsUser;
+//Group Perms added by jlm69
+if ($xoopsModuleConfig['usecats']) {
-//Group Perms added by jlm69
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
@@ -20,7 +22,8 @@
if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
exit();
-}
+ }
+ }
// End Group Perms
@@ -139,6 +142,7 @@
if($success) {
$notification_handler =& xoops_gethandler('notification');
$id = $xoopsDB->getInsertId();
+$cid = $_POST['cid'];
$tags=array();
$tags['YEAR'] = $year;
$tags['MAKE'] = $make;
@@ -158,7 +162,7 @@
}
- if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
+ if($success) redirect_header("index.php",8,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
break;
@@ -293,12 +297,12 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), false);
if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
@@ -403,12 +407,12 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), false);
if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,29 +27,29 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$egine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$egine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -3,8 +3,11 @@
require('header.php');
+global $xoopsModuleConfig, $xoopsUser;
// Group Permissions added by jlm69
+if($xoopsModuleConfig['usecats']){
+
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
@@ -23,7 +26,9 @@
if (!$gperm_handler->checkRight("garage_view", $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
exit();
-}
+ }
+
+ }
// End Group Permissions
@@ -178,8 +183,8 @@
$xoopsTpl->assign('mrims',_MD_XG_MRIMS);
$xoopsTpl->assign('maudio',_MD_XG_MAUDIO);
$xoopsTpl->assign('mfuture',_MD_XG_MFUTURE);
+ $xoopsTpl->assign('garage_of',_MD_XG_GARAGEOF);
-
if($xoopsModuleConfig['allowcomments']) include XOOPS_ROOT_PATH.'/include/comment_view.php';
break;
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/main.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -108,4 +108,6 @@
define("_MD_XG_USERNAME","Username ");
define("_MD_XG_STYLE","Body Style");
+define("_MD_XG_GARAGEOF","The Garage of ::");
+
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:12:04 UTC (rev 12073)
@@ -15,10 +15,9 @@
`imagechoice` tinyint(4) NOT NULL default '0',
`url` varchar(255) NOT NULL default '',
`location` varchar(75) NOT NULL default '',
+ `mark` varchar(75) NOT NULL default '',
+ `model` varchar(75) NOT NULL default '',
`year` varchar(75) NOT NULL default '',
- `make` varchar(75) NOT NULL default '',
- `model` varchar(75) NOT NULL default '',
- `style` varchar(75) NOT NULL default '',
`engine` varchar(75) NOT NULL default '',
`color` varchar(75) NOT NULL default '',
`rt` varchar(75) NOT NULL default '',
@@ -30,7 +29,7 @@
`quart` varchar(75) NOT NULL default '',
`quartm` varchar(75) NOT NULL default '',
`mengine` text NOT NULL,
- `mexterior` text NOT NULL,
+ `meterior` text NOT NULL,
`minterior` text NOT NULL,
`mrims` text NOT NULL,
`mfuture` text NOT NULL,
Modified: XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:12:04 UTC (rev 12073)
@@ -18,7 +18,7 @@
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" summary="" class="forumline">
<tr>
- <th height="25" nowrap colspan="2" class="thHead">The Garage of :: <{$garage.name}></th>
+ <th height="25" nowrap colspan="2" class="thHead"><{$garage_of}> <{$garage.name}></th>
</tr>
<tr>
<td width="50%" height="28" align="center" class="catLeft"><b><span class="gen">Owner Info</span></b></td>
@@ -26,41 +26,41 @@
</tr>
<tr>
<td valign="top" class="row1"><span class="gen"><{if $garage.linkgarage}><a href="../../userinfo.php?uid=<{$garage.uid}>"><{$linkgarage}></a><{/if}>
- <{$ownername}>: <b><{$garage.uname}></b><br />
- <{$location}>: <{$garage.location}><br /></span></td>
+ <b><{$ownername}>:</b> <{$garage.uname}><br />
+ <b><{$location}>:</b> <{$garage.location}><br /></span></td>
<td valign="top" rowspan="3" class="row1"><table width="100%" border="0" cellspacing="1" cellpadding="3">
- <tr>
+ <{if $rt != ''}> <tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$rt}>:</span></td>
<td valign="top" width="100%"><b><span class="gen"><{$garage.rt}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$sixty}>:</span></td>
+ <{if $garage.sixty}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$sixty}>:</span></td>
<td valign="top" width="100%"><b><span class="gen"><{$garage.sixty}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$three}>:</span></td>
+ <{if $garage.three}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$three}>:</span></td>
<td><b><span class="gen"><{$garage.three}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigth}>:</span></td>
+ <{if $garage.eigth}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigth}>:</span></td>
<td><span class="gen"><b><{$garage.eigth}></b></span></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.eigthm}><tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigthm}>:</span></td>
<td><b><span class="gen"><{$garage.eigthm}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.thou}><tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$thou}>:</span></td>
<td> <b><span class="gen"><{$garage.thou}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.quart}> <tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quart}>:</span></td>
<td> <b><span class="gen"><{$garage.quart}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.quartm}><tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quartm}>:</span></td>
<td> <b><span class="gen"><{$garage.quartm}></span></b></td>
- </tr>
+ </tr><{/if}>
</table></td>
</tr>
@@ -100,7 +100,7 @@
<td height="28" align="left" class="catRight"><b><span class="gen"></span></b></td>
</tr>
<tr>
- <td valign="top" class="row1" align="left"><span class="gen"><{$mengine}>:<hr><center><b><{$garage.mengine}><hr></b></center><br /> <{$mexterior}>:<hr><center><b><{$garage.mexterior}></b><hr></center><br /><{$minterior}>: <hr><center><b><{$garage.minterior}></b><hr></center><br /> <{$mrims}>: <hr><center><b><{$garage.mrims}></b><hr></center><br /><{$maudio}>: <hr><center><b><{$garage.maudio}></b><hr></center><br /><{$mfuture}>: <hr><center><b><{$garage.mfuture}></b><hr></center>
+ <td valign="top" class="row1" align="left"><span class="gen"><{if $garage.mengine}><b><{$mengine}>:</b><hr><center><{$garage.mengine}><hr></center><br /><{/if}> <{if $garage.mexterior}><b><{$mexterior}>:</b><hr><center><{$garage.mexterior}><hr></center><br /><{/if}><{if $garage.minterior}><b><{$minterior}>:</b> <hr><center><{$garage.minterior}><hr></center><br /><{/if}> <{if $garage.mrims}><b><{$mrims}>:</b> <hr><center><{$garage.mrims}><hr></center><br /><{/if}><{if $garage.maudio}><b><{$maudio}>:</b> <hr><center><{$garage.maudio}><hr></center><br /><{/if}><{if $garage.mfuture}><b><{$mfuture}>:</b> <hr><center><{$garage.mfuture}><hr></center><{/if}>
</span></td>
<td valign="top" class="row1"><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<!-- BEGIN no_pics -->
Modified: XoopsModules/xgarage/trunk/xgarage/xoops_version.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -3,10 +3,10 @@
global $xoopsModuleConfig;
$modversion['name'] = _MI_NAME;
-$modversion['version'] = .03;
+$modversion['version'] = .04;
$modversion['description'] = _MI_DESC;
-$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com';
-$modversion['author'] = 'Northern, script_fu, jlm69';
+$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com / www.arabxoops.com';
+$modversion['author'] = 'Northern, script_fu, jlm69, mowaffak';
$modversion['help'] = 'docs';
$modversion['license'] = 'GPL';
$modversion['official'] = 0;
|
|
From: <be...@us...> - 2013-09-20 23:11:31
|
Revision: 12072
http://sourceforge.net/p/xoops/svn/12072
Author: beckmi
Date: 2013-09-20 23:11:28 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 3
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/language/english/modinfo.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
XoopsModules/xgarage/trunk/xgarage/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/class/index.html
XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
XoopsModules/xgarage/trunk/xgarage/images/icons/index.html
XoopsModules/xgarage/trunk/xgarage/images/index.html
XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html
XoopsModules/xgarage/trunk/xgarage/include/gtickets.php
XoopsModules/xgarage/trunk/xgarage/include/index.html
XoopsModules/xgarage/trunk/xgarage/include/notification.inc.php
XoopsModules/xgarage/trunk/xgarage/language/english/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/listing_newpost_notify.tpl
XoopsModules/xgarage/trunk/xgarage/language/index.html
XoopsModules/xgarage/trunk/xgarage/notification_update.php
XoopsModules/xgarage/trunk/xgarage/sql/index.html
XoopsModules/xgarage/trunk/xgarage/templates/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/templates/index.html
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/admin/error_log
Added: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,26 @@
+<?php
+include("../../../mainfile.php");
+include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
+include(XOOPS_ROOT_PATH."/include/cp_functions.php");
+
+ $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+ require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
+
+if ( $xoopsUser ) {
+ $xoopsModule = XoopsModule::getByDirname("garage");
+ if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+ }
+} else {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+}
+if ( file_exists("../language/".$xoopsConfig['language']."/admin.php") ) {
+ include("../language/".$xoopsConfig['language']."/admin.php");
+} else {
+ include("../language/english/admin.php");
+}
+$myts =& MyTextSanitizer::getInstance();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,3 +0,0 @@
-[09-Sep-2007 17:21:09] PHP Parse error: syntax error, unexpected ':' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 9
-[09-Sep-2007 17:21:47] PHP Parse error: syntax error, unexpected ';' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 262
-[09-Sep-2007 17:22:26] PHP Parse error: syntax error, unexpected ')' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 265
Modified: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,7 +1,7 @@
<?php
function getCats($gid){
global $xoopsDB;
- $sql = ("SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name");
+ $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -14,7 +14,7 @@
}
function getName($cid){
global $xoopsDB;
- $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = $cid";
+ $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getName($cid)");
} else {
@@ -23,20 +23,21 @@
return ($name);
}
}
-function addCat($name,$gid) {
+function addCat($name,$gid){
global $xoopsDB;
- $sql = $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("garage_cats")." VALUES ('','$name','$gid')");
- if (!$result = $sql) {
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,gid) VALUES ('$name',$gid)";
+ if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: addCat($name,$gid)");
return 0;
- }else{
+ } else {
return 1;
}
+
}
function moveCat($cid,$gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: moveCat($cid,$gid)");
return 0;
@@ -48,7 +49,7 @@
function check4Content($cid){
global $xoopsDB;
- $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = $cid";
+ $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: check4Content($cid)");
return 0;
@@ -61,7 +62,7 @@
function renameCat($cid,$catname){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: renameCat($cid,$catname)");
return 0;
@@ -72,7 +73,7 @@
function approveGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: approveGarage($gid)");
} else {
@@ -82,7 +83,7 @@
function disableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: disableGarage($gid)");
} else {
@@ -92,7 +93,7 @@
function enableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: enableGarage($gid)");
} else {
@@ -101,7 +102,7 @@
}
function getActiveGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=0 AND approved=1 ORDER BY name");
+ $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -112,7 +113,7 @@
function getNewGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved=0 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved='0' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -123,7 +124,7 @@
function getDisabledGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=1 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -177,6 +178,7 @@
echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
+ echo "<li id='" . $tblColors[5] . "'><a href=\"garageperms.php\"><span>" . _AM_GARAGES_PERMISSIONS . "</span></a></li>";
echo "</ul></div>";
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,93 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include_once("admin_header.php");
+include_once("functions.php");
+include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH . "/modules/".$xoopsModule->getVar("dirname")."/class/mygrouppermform.php";
+
+
+xoops_cp_header();
+adminMenu(5, _AM_GARAGES_PERMISSIONS);
+
+
+$permtoset= isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1;
+$selected=array('','','');
+$selected[$permtoset-1]=' selected';
+echo "<br /><br />";
+echo "<form method='post' name='gselperm' action='garageperms.php'><div><select name='permtoset' onChange='javascript: document.gselperm.submit()'><option value='1'".$selected[0].">"._AM_GARAGES_VIEWFORM."</option><option value='2'".$selected[1].">"._AM_GARAGES_SUBMITFORM."</option></select></div></form>";
+$module_id = $xoopsModule->getVar('mid');
+
+switch($permtoset)
+{
+ case 1:
+ $title_of_form = _AM_GARAGES_VIEWFORM;
+ $perm_name = "garage_view";
+ $perm_desc = _AM_GARAGES_VIEWFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+ case 2:
+ $title_of_form = _AM_GARAGES_SUBMITFORM;
+ $perm_name = "garage_submit";
+ $perm_desc = _AM_GARAGES_SUBMITFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+}
+
+echo $permform->render();
+echo "<br /><br /><br /><br />\n";
+unset ($permform);
+
+xoops_cp_footer();
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -3,20 +3,14 @@
include_once("functions.php");
settype($op,"string");
-if(!isset($_POST['op']) && isset($_GET['op']) ) {
- $op = $_GET['op'] ;
-}
-if (!isset($op)) {
- $op = '';
-}
-
+if(isset($_GET['op'])) $op = $_GET['op'];
+if(isset($_POST['op'])) $op = $_POST['op'];
//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
-if(!isset($_POST['cid']) && isset($_GET['cid']) ) {
- $cid = intval($_GET['cid']);
+//$op = isset($_POST['op']) ? $_POST['op'] : '';
+if (!isset($_POST['cid']) && isset($_GET['cid']) ) {
+ $cid = $_GET['cid'];
}
-//$op = isset($_POST['op']) ? $_POST['op'] : '';
//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
-//$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
@@ -24,11 +18,9 @@
$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
$self = $_SERVER['PHP_SELF'];
+global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
+global $xoopsDB;
-
-global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule, $cattree;
-
-
$myts = &MyTextSanitizer::getInstance();
//echo("Hellow World.");
@@ -90,10 +82,10 @@
else {
xoops_cp_header();
adminMenu(1, _AM_GARAGES_INDEX);
- echo "<div style='height:25px;'> </div>";
+ echo("<div style='height:25px;'> </div>");
xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
}
- echo "</p>";
+ echo("</p>");
break;
@@ -108,7 +100,7 @@
for($x=0;$x<count($names);$x++){
echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONENEW."</div>";
+ else echo("<div>"._AM_NONENEW."</div>");
break;
case "view_disabled":
@@ -127,15 +119,14 @@
case "add_cat":
//echo("testing123");
//adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['catname']) {
+ if($_POST['catname']){
$success = addCat($_POST['catname'],$_POST['gid']);
- if ($success) {
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
exit;
- } else {
- redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
- }
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
}
+
break;
case "move_cat":
//echo("testing123");
@@ -236,10 +227,10 @@
xoops_cp_header();
adminMenu(4, _AM_GARAGES_CATEGORIES);
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
-
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- if(!$cid) $cid = '0';
+
+ $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$path = $cattree->getNicePathFromId($cid, "name", $self."?op=cats");
echo "<a href='index.php?op=cats&cid=0'><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
@@ -258,11 +249,11 @@
// add new cat
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
- $cattree->makeMySelBox("name","",$cid, true,"gid");
- echo("<input type='hidden' name='cid' value='$cid' />");
- echo("<input type='hidden' name='op' value='add_cat' />");
- echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."' />");
+ echo(_AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='add_cat'>");
+ echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."'>");
echo("</form>");
echo("</div>");
echo("<br/>");
@@ -270,7 +261,7 @@
if($cid){
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_MOVECAT."<br/>"._AM_PARENT."");
+ echo(_AM_MOVECAT."<br/>"._AM_PARENT);
$cattree->makeMySelBox("name","",$cid,true,"gid");
echo("<input type='hidden' name='cid' value='$cid'>");
echo("<input type='hidden' name='op' value='move_cat'>");
@@ -331,15 +322,15 @@
xoops_cp_header();
adminMenu(6, _AM_GARAGES_DONATIONS);
- echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
+ echo("<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>");
- echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+ echo('<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
">
-</form>';
+</form>');
@@ -355,9 +346,9 @@
for($x=0;$x<count($names);$x++){
if($names[$x]['viewable']) $viewable="color:#000000;";
else $viewable="color:#cccccc;";
- echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
+ echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONEACTIVE."</div>";
+ else echo("<div>"._AM_NONEACTIVE."</div>");
break;
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,70 @@
+<?php
+// $Id$
+
+include '../../../include/cp_header.php';
+$modid = isset($_POST['modid']) ? intval($_POST['modid']) : 0;
+
+// we dont want system module permissions to be changed here
+if ($modid <= 1 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
+ redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+ exit();
+}
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->get($modid);
+if (!is_object($module) || !$module->getVar('isactive')) {
+ redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
+ exit();
+}
+$member_handler =& xoops_gethandler('member');
+$group_list =& $member_handler->getGroupList();
+if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
+ $gperm_handler = xoops_gethandler('groupperm');
+ foreach ($_POST['perms'] as $perm_name => $perm_data) {
+ if (false != $gperm_handler->deleteByModule($modid, $perm_name)) {
+ foreach ($perm_data['groups'] as $group_id => $item_ids) {
+ foreach ($item_ids as $item_id => $selected) {
+ if ($selected == 1) {
+ // make sure that all parent ids are selected as well
+ if ($perm_data['parents'][$item_id] != '') {
+ $parent_ids = explode(':', $perm_data['parents'][$item_id]);
+ foreach ($parent_ids as $pid) {
+ if ($pid != 0 && !in_array($pid, array_keys($item_ids))) {
+ // one of the parent items were not selected, so skip this item
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._AM_GARAGES_PERMADDNGP.')';
+ continue 2;
+ }
+ }
+ }
+ $gperm =& $gperm_handler->create();
+ $gperm->setVar('gperm_groupid', $group_id);
+ $gperm->setVar('gperm_name', $perm_name);
+ $gperm->setVar('gperm_modid', $modid);
+ $gperm->setVar('gperm_itemid', $item_id);
+ if (!$gperm_handler->insert($gperm)) {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ } else {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ }
+ unset($gperm);
+ }
+ }
+ }
+ } else {
++ $msg[] = sprintf(_AM_GARAGES_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
+ }
+ }
+}
+
+$backlink = XOOPS_URL.'/admin.php';
+if ($module->getVar('hasadmin')) {
+ $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex');
+ if ($adminindex) {
+ $backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/garageperms.php';
+ }
+}
+
+$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
+xoops_cp_header();
+xoops_result($msg);
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/blocks/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/blocks/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/blocks/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,323 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000-2003 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+// Author: Kazumi Ono (AKA onokazu) //
+// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
+// Project: The XOOPS Project //
+// ------------------------------------------------------------------------- //
+if (!defined('XOOPS_ROOT_PATH')) {
+ die("XOOPS root path not defined");
+}
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php';
+require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
+
+/**
+ * Renders a form for setting module specific group permissions
+ *
+ * @author Kazumi Ono <on...@my...>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class MyXoopsGroupPermForm extends XoopsForm
+{
+ /**
+ * Module ID
+ *
+ * @var int
+ */
+ var $_modid;
+ /**
+ * Tree structure of items
+ *
+ * @var array
+ */
+ var $_itemTree;
+ /**
+ * Name of permission
+ *
+ * @var string
+ */
+ var $_permName;
+ /**
+ * Description of permission
+ *
+ * @var string
+ */
+ var $_permDesc;
+
+ /**
+ * Constructor
+ */
+ function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc, $url = "")
+ {
+ global $xoopsModule;
+ $this->XoopsForm($title, 'groupperm_form', XOOPS_URL . "/modules/".$xoopsModule->getVar("dirname")."/admin/mygroupperm.php", 'post');
+ $this->_modid = intval($modid);
+ $this->_permName = $permname;
+ $this->_permDesc = $permdesc;
+ $this->addElement(new XoopsFormHidden('modid', $this->_modid));
+ if ($url != "") {
+ $this->addElement(new XoopsFormHidden('redirect_url', $url));
+ }
+ }
+
+ /**
+ * Adds an item to which permission will be assigned
+ *
+ * @param string $itemName
+ * @param int $itemId
+ * @param int $itemParent
+ * @access public
+ */
+ function addItem($itemId, $itemName, $itemParent = 0)
+ {
+ $this->_itemTree[$itemParent]['children'][] = $itemId;
+ $this->_itemTree[$itemId]['parent'] = $itemParent;
+ $this->_itemTree[$itemId]['name'] = $itemName;
+ $this->_itemTree[$itemId]['id'] = $itemId;
+ }
+
+ /**
+ * Loads all child ids for an item to be used in javascript
+ *
+ * @param int $itemId
+ * @param array $childIds
+ * @access private
+ */
+ function _loadAllChildItemIds($itemId, &$childIds)
+ {
+ if (!empty($this->_itemTree[$itemId]['children'])) {
+ $first_child = $this->_itemTree[$itemId]['children'];
+ foreach ($first_child as $fcid) {
+ array_push($childIds, $fcid);
+ if (!empty($this->_itemTree[$fcid]['children'])) {
+ foreach ($this->_itemTree[$fcid]['children'] as $_fcid) {
+ array_push($childIds, $_fcid);
+ $this->_loadAllChildItemIds($_fcid, $childIds);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Renders the form
+ *
+ * @return string
+ * @access public
+ */
+ function render()
+ {
+ // load all child ids for javascript codes
+ foreach (array_keys($this->_itemTree)as $item_id) {
+ $this->_itemTree[$item_id]['allchild'] = array();
+ $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
+ }
+ $gperm_handler =& xoops_gethandler('groupperm');
+ $member_handler =& xoops_gethandler('member');
+ $glist =& $member_handler->getGroupList();
+ foreach (array_keys($glist) as $i) {
+ // get selected item id(s) for each group
+ $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
+ $ele = new XoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
+ $ele->setOptionTree($this->_itemTree);
+ $this->addElement($ele);
+ unset($ele);
+ }
+ $tray = new XoopsFormElementTray('');
+ $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
+ $this->addElement($tray);
+ $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />';
+ $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n";
+ $elements =& $this->getElements();
+ foreach (array_keys($elements) as $i) {
+ if (!is_object($elements[$i])) {
+ $ret .= $elements[$i];
+ } elseif (!$elements[$i]->isHidden()) {
+ $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
+ if ($elements[$i]->getDescription() != '') {
+ $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
+ }
+ $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
+ } else {
+ $ret .= $elements[$i]->render();
+ }
+ }
+ $ret .= '</table></form>';
+ return $ret;
+ }
+}
+
+/**
+ * Renders checkbox options for a group permission form
+ *
+ * @author Kazumi Ono <on...@my...>
+ * @copyright copyright (c) 2000-2003 XOOPS.org
+ * @package kernel
+ * @subpackage form
+ */
+class XoopsGroupFormCheckBox extends XoopsFormElement
+{
+ /**
+ * Pre-selected value(s)
+ *
+ * @var array;
+ */
+ var $_value = array();
+ /**
+ * Group ID
+ *
+ * @var int
+ */
+ var $_groupId;
+ /**
+ * Option tree
+ *
+ * @var array
+ */
+ var $_optionTree;
+
+ /**
+ * Constructor
+ */
+ function XoopsGroupFormCheckBox($caption, $name, $groupId, $values = null)
+ {
+ $this->setCaption($caption);
+ $this->setName($name);
+ if (isset($values)) {
+ $this->setValue($values);
+ }
+ $this->_groupId = $groupId;
+ }
+
+ /**
+ * Sets pre-selected values
+ *
+ * @param mixed $value A group ID or an array of group IDs
+ * @access public
+ */
+ function setValue($value)
+ {
+ if (is_array($value)) {
+ foreach ($value as $v) {
+ $this->setValue($v);
+ }
+ } else {
+ $this->_value[] = $value;
+ }
+ }
+
+ /**
+ * Sets the tree structure of items
+ *
+ * @param array $optionTree
+ * @access public
+ */
+ function setOptionTree(&$optionTree)
+ {
+ $this->_optionTree =& $optionTree;
+ }
+
+ /**
+ * Renders checkbox options for this group
+ *
+ * @return string
+ * @access public
+ */
+ function render()
+ {
+ $ret = '<table class="outer"><tr><td class="odd"><table><tr>';
+ $cols = 1;
+ foreach ($this->_optionTree[0]['children'] as $topitem) {
+ if ($cols > 4) {
+ $ret .= '</tr><tr>';
+ $cols = 1;
+ }
+ $tree = '<td>';
+ $prefix = '';
+ $this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
+ $ret .= $tree.'</td>';
+ $cols++;
+ }
+ $ret .= '</tr></table></td><td class="even">';
+ foreach (array_keys($this->_optionTree) as $id) {
+ if (!empty($id)) {
+ $option_ids[] = "'".$this->getName().'[groups]['.$this->_groupId.']['.$id.']'."'";
+ }
+ }
+ $checkallbtn_id = $this->getName().'[checkallbtn]['.$this->_groupId.']';
+ $option_ids_str = implode(', ', $option_ids);
+ $ret .= _ALL." <input id=\"".$checkallbtn_id."\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(".$option_ids_str."); xoopsCheckAllElements(optionids, '".$checkallbtn_id."');\" />";
+ $ret .= '</td></tr></table>';
+ return $ret;
+ }
+
+ /**
+ * Renders checkbox options for an item tree
+ *
+ * @param string $tree
+ * @param array $option
+ * @param string $prefix
+ * @param array $parentIds
+ * @access private
+ */
+ function _renderOptionTree(&$tree, $option, $prefix, $parentIds = array())
+ {
+ $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" id=\"" . $this->getName() . "[groups][" . $this->_groupId . "][" . $option['id'] . "]\" onclick=\"";
+ // If there are parent elements, add javascript that will
+ // make them selecteded when this element is checked to make
+ // sure permissions to parent items are added as well.
+ foreach ($parentIds as $pid) {
+ $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
+ $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked != true) {ele.checked = this.checked;}";
+ }
+ // If there are child elements, add javascript that will
+ // make them unchecked when this element is unchecked to make
+ // sure permissions to child items are not added when there
+ // is no permission to this item.
+ foreach ($option['allchild'] as $cid) {
+ $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
+ $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked != true) {ele.checked = false;}";
+ }
+ $tree .= '" value="1"';
+ if (in_array($option['id'], $this->_value)) {
+ $tree .= ' checked="checked"';
+ }
+ $tree .= " />" . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . "[parents][" . $option['id'] . "]\" value=\"" . implode(':', $parentIds). "\" /><input type=\"hidden\" name=\"" . $this->getName() . "[itemname][" . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']). "\" /><br />\n";
+ if (isset($option['children'])) {
+ foreach ($option['children'] as $child) {
+ array_push($parentIds, $option['id']);
+ $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds);
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -13,19 +13,19 @@
<p>XOOPS - <a href="http://www.xoops.org/">http://www.xoops.org/ </a></p>
<p>Script_fu - for his encouragement to get this module done. </p>
<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
-<p>exbanious - You inspired many to make or ask for a garage module. </p>
+<p>exbanious - You inspired many to make or ask for a agarage module. </p>
<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
<p><br>
-<strong>Translators:</strong></p>
+ <strong>Translators:</strong></p>
<p>English - Northern <br>
-German - <br>
-Japanese - <br>
+ German - <br>
+ Japanese - <br>
Portuguese - <br>
Greek - <br>
French - <br>
-Dutch - <br>
+Dutch -<br>
Danish - <br>
</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -7,11 +7,11 @@
</head>
<body>
-<h1>Garage Module for XOOPS 2.0 User's Manual </h1>
+<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
<hr>
<p>Add new garage: </p>
<p>Name and Description are required.<br>
- To upload an image, edit your garage afer its added, if site allows image uploads. </p>
+ To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
<p>Edit Garage:</p>
<p>In some web sites, changes must be requested.</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,5 +1,29 @@
<?php
require('header.php');
+
+
+//Group Perms added by jlm69
+$module_id = $xoopsModule->getVar('mid');
+
+if (is_object($xoopsUser)) {
+$groups = $xoopsUser->getGroups();
+} else {
+$groups = XOOPS_GROUP_ANONYMOUS;
+}
+$gperm_handler =& xoops_gethandler('groupperm');
+if (isset($_POST['item_id'])) {
+$perm_itemid = intval($_POST['item_id']);
+} else {
+$perm_itemid = 0;
+}
+//If no access
+if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
+ redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
+exit();
+}
+// End Group Perms
+
+
require(XOOPS_ROOT_PATH.'/header.php');
include("include/functions.php");
@@ -8,10 +32,12 @@
settype($url, "string");
settype($name, "string");
settype($image, "string");
+settype($imagechoice, "string");
settype($location, "string");
+settype($year, "string");
settype($make, "string");
settype($model, "string");
-settype($year, "string");
+settype($style, "string");
settype($engine, "string");
settype($color, "string");
settype($rt, "string");
@@ -79,9 +105,10 @@
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
+ $year = $myts->makeTboxData4Save($_POST['year']);
$make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
- $year = $myts->makeTboxData4Save($_POST['year']);
+ $style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
$rt = $myts->makeTboxData4Save($_POST['rt']);
@@ -106,7 +133,31 @@
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+
+
+if($success) {
+$notification_handler =& xoops_gethandler('notification');
+$id = $xoopsDB->getInsertId();
+$tags=array();
+$tags['YEAR'] = $year;
+$tags['MAKE'] = $make;
+$tags['MODEL'] = $model;
+$tags['LINK_URL'] = XOOPS_URL . '/modules/garage/index.php?op=view&gid=' . addslashes($id);
+$sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid=" . addslashes($_POST['cid']);
+$result2 = $xoopsDB->query($sql);
+$row = $xoopsDB->fetchArray($result2);
+
+$tags['CATEGORY_TITLE'] = $row['name'];
+$tags['CATEGORY_URL'] = XOOPS_URL . '/modules/garage/index.php?cid="' . addslashes($cid);
+$notification_handler =& xoops_gethandler('notification');
+$notification_handler->triggerEvent('global', 0, 'new_listing', $tags);
+$notification_handler->triggerEvent('category', $cid, 'new_listing', $tags);
+$notification_handler->triggerEvent ('listing', $gid, 'new_listing', $tags );
+
+
+}
+
if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
@@ -133,9 +184,10 @@
if(!$imagechoice) $imagechoice = "0";
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
+ $year = $myts->makeTboxData4Save($_POST['year']);
$make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
- $year = $myts->makeTboxData4Save($_POST['year']);
+ $style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
$rt = $myts->makeTboxData4Save($_POST['rt']);
@@ -163,8 +215,8 @@
if($errmsg) $wtime = 15;
else $wtime = 3;
if(($uid == $puid && $xoopsModuleConfig['canuseredit']) || $userIsAdmin){
- if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
- else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATESUCCESS.$errmsg.$msg);
else redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATEFAILURE.$errmsg.$msg);
@@ -195,7 +247,6 @@
}
}
}
-
if(!$url) $url = "http://";
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_MD_XG_ADDGARAGE, "garageform", xoops_getenv('PHP_SELF'));
@@ -227,9 +278,10 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
- $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
@@ -241,13 +293,13 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), true);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -276,9 +328,10 @@
$imagechoice = $garage['imagechoice'];
$url = $garage['url'];
$location = $garage['location'];
+ $year = $garage['year'];
$make = $garage['make'];
$model = $garage['model'];
- $year = $garage['year'];
+ $style = $garage['style'];
$engine = $garage['engine'];
$color = $garage['color'];
$rt = $garage['rt'];
@@ -335,9 +388,10 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
- $sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
@@ -349,13 +403,13 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
- if($xoopsModuleConfig['usedescript2']) $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
+ if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
$linkgarage_choice->addOption(0,_MD_XG_NOLINKTOUSER);
@@ -378,7 +432,7 @@
$redirect_url = "index.php";
$redirect_msg = _MD_XG_CANNOTCHANGE;
}
- redirect_header($redirect_url,2,$redirect_msg);
+ redirect_header($redirect_url,8,$redirect_msg);
exit;
}
}
Added: XoopsModules/xgarage/trunk/xgarage/images/icons/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/icons/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/icons/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/images/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,31 +27,31 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$make','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
} else {
return...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:10:43
|
Revision: 12071
http://sourceforge.net/p/xoops/svn/12071
Author: beckmi
Date: 2013-09-20 23:10:40 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 2
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/install.txt
XoopsModules/xgarage/trunk/xgarage/license.txt
XoopsModules/xgarage/trunk/xgarage/readme.txt
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
Deleted: XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -1,355 +0,0 @@
-<?php
-include_once '../../../include/cp_header.php';
-include_once("functions.php");
-
-settype($op,"string");
-//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
-$op = !isset($_GET['op'])? NULL : $_GET['op'];
-//$op = isset($_POST['op']) ? $_POST['op'] : '';
-//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
-$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
-$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
-$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
-$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
-$ordersel = isset($_POST['ordersel']) ? $_POST['ordersel'] : 'DESC';
-$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
-$self = $_SERVER['PHP_SELF'];
-global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
-
-
-$myts = &MyTextSanitizer::getInstance();
-
-//echo("Hellow World.");
-
-switch($op){
- case "approve":
-
- //if($userIsAdmin) {
- $success = approveGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVESUCCESS);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVEFAILURE);
- //}
-
- break;
-
- case "disable":
- //if($userIsAdmin) {
- $success = disableGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEDISABLED);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_DISBALEFAILURE);
- //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMIND);
- break;
-
- case "enable":
- //if($userIsAdmin) {
- $success = enableGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEENABLED);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_ENBALEFAILURE);
- //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMINE);
- break;
-
- case "delgarage":
-
-
- //verify delete
- if (isset($_GET['gid'])) {
- $gid = $_GET['gid'];
- }
- if (isset($_POST['gid'])) {
- $gid = $_POST['gid'];
- }
- if (isset($_POST['subop'])) {
- $subop = $_POST['subop'];
- }
- if ($subop == "delok") {
-
- $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("garage"), $gid);
-
- if ($xoopsDB->query($sql)) {
- // delete comments for the garage being deleted
- xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
- redirect_header("index.php", 3, _AM_ITEMDELETED);
- //echo "deleted";
- } else {
- redirect_header("index.php", 3, _AM_ITEMNOTDELETED);
- //echo "not deleted";
- }
- } // end if
- else {
- xoops_cp_header();
- adminMenu(1, _AM_GARAGES_INDEX);
- echo "<div style='height:25px;'> </div>";
- xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
- }
- echo "</p>";
- break;
-
-
- case "view_new":
- xoops_cp_header();
- adminMenu(2, _AM_GARAGES_APPROVE);
- //get list of all diabled garage
- $names = getNewGarages();
-
- //print them out with links
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
- }
- else echo "<div>"._AM_NONENEW."</div>";
- break;
-
- case "view_disabled":
- xoops_cp_header();
- adminMenu(3, _AM_GARAGES_DISABLED);
- //get list of all diabled garage
- $names = getDisabledGarages();
-
- //print them out with links
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
- }
- else echo("<div>"._AM_NONEDISABLED."</div>");
- break;
- case "add_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['catname']){
- $success = addCat('',$_POST['catname'],$_POST['gid']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
- exit;
- } else {
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
- }
- }
- break;
- case "move_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['gid'] != $_POST['cid']){
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $children = $cattree->getChildTreeArray($_POST['cid']);
- //var_dump($children);
- foreach($children as $child){
- $cc[] = $child['cid'];
- }
- if(!in_array($_POST['gid'],$cc)){
- $success = moveCat($_POST['cid'],$_POST['gid']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVED);
- exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEERROR);
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEINTO);
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_MOVENO);
-
- break;
- case "rename_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- $success = renameCat($_POST['cid'],$_POST['catname']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMED);
- exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMEERROR);
- break;
-
- case "del_cat":
-
-
- //verify delete
-
- if (isset($_POST['cid'])) {
- $cid = $_POST['cid'];
- }
- if (isset($_POST['subop'])) {
- $subop = $_POST['subop'];
- }
- if (isset($subop) && $subop == "delok") {
- //get all cats
-
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $cats = $cattree->getChildTreeArray($cid,"name");
- $WHERE = "WHERE cid = $cid";
- foreach($cats as $cat){
- $WHERE .= " OR cid=".$cat['cid'];
- }
-
- $sql = sprintf("DELETE FROM %s %s", $xoopsDB->prefix("garage_cats"), $WHERE);
-
- if ($xoopsDB->query($sql)) {
- // delete comments for the garage being deleted
- //xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
- redirect_header("index.php", 3, _AM_CATDELETED);
- //echo "deleted";
- } else {
- redirect_header("index.php", 3, _AM_CATNOTDELETED);
- //echo "not deleted";
- }
- } // end if
- else {
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $cats = $cattree->getChildTreeArray($cid,"name");
- $catlist[] = getName($cid);
- $content = 0;
- $c = check4Content($cid);
- $content = $content + $c;
-
- foreach($cats as $cat){
- $c = check4Content($cat['cid']);
- $content = $content + $c;
- $catlist[] = getName($cat['cid']);
- }
- if($content){
- $msg = sprintf(_AM_CONTENTEXISTS,$content);
- redirect_header("index.php?op=cats&cid=$cid", 5, $msg);
- exit;
- } else {
- xoops_cp_header();
- adminMenu(4, _AM_GARAGES_CATEGORIES);
- echo("<div style='height:25px;'> </div>");
-
- $clist = join($catlist,", ");
- $delmsg = _AM_CONFIRMDELCATS."<br/>".$clist;
- xoops_confirm(array('op' => 'del_cat', 'cid' => $cid, 'subop' => 'delok'), 'index.php', $delmsg);
- }
- }
- break;
-
- case "cats":
- xoops_cp_header();
- adminMenu(4, _AM_GARAGES_CATEGORIES);
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
-
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
-
- //if(!$cid) {$cid = '0';}
- //$cid = isset($_POST['cid']);
- $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
- $path = $cattree->getNicePathFromId($cid, "name", "index.php?op=cats");
- echo "<a href='index.php?op=cats&cid='0''><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
-
- $cats = getCats($cid);
- //echo("<table width='100%' align='center'>");
- //echo("");
- //echo("<form method='post'>");
- for($x=0;$x < count($cats);$x++){
- //echo("<div style='left-margin:50px;'><input type='checkbox' name='cats[]' value='".$cats[$x]['cid']."'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>");
- echo "<div style='left-margin:50px;'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>";
- }
- //echo("<input type='hidden' name='op' value='delcats'>");
- //echo("<input type='submit' value='"._AM_DELETE."'>");
- //echo("</form>");
- //echo("</table>");
- // add new cat
- echo "<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>";
- echo "<form method='post' action='index.php'>";
- echo ""._AM_NEWCATNAME."<input type='text' name='catname' /><br/>"._AM_PARENT."";
- $cattree->makeMySelBox("name","",$cid,true,"gid");
- echo "<input type='hidden' name='cid' value='$cid' />";
- echo "<input type='hidden' name='op' value='add_cat' />";
- echo "<br/><input type='submit' value='"._AM_ADDNEWCAT."' />";
- echo "</form>" ;
- echo "</div>" ;
- echo "<br/>" ;
-
- if($cid){
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_MOVECAT."<br/>"._AM_PARENT);
- $cattree->makeMySelBox("name","",$cid,true,"gid");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='move_cat'>");
- echo("<br/><input type='submit' value='"._AM_MOVECATSUBMIT."'>");
- echo("</form>");
- echo("</div>");
- echo("<br/>");
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_RENAMECAT);
- $catname = getName($cid);
- echo("<input type='text' name='catname' value='$catname'>");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='rename_cat'>");
- echo("<br/><input type='submit' value='"._AM_RENAME."'>");
- echo("</form>");
- echo("</div>");
- echo("<br/>");
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_DELETECAT);
- $catname = getName($cid);
- echo(" $catname");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='del_cat'>");
- echo("<br/><input type='submit' value='"._AM_DELETE."'>");
- echo("</form>");
- echo("</div>");
- }
- break;
- case "documentation":
- xoops_cp_header();
- adminMenu(5, _AM_GARAGES_DOCUMENTATION);
-
- echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
-
-
- echo("</div>");
-
- break;
-
- case "support":
- xoops_cp_header();
- adminMenu(5, _AM_GARAGES_SUPPORT);
-
- echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
-
-
- echo("</div>");
-
- break;
-
- case "donations":
- xoops_cp_header();
- adminMenu(6, _AM_GARAGES_DONATIONS);
-
- echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
-
- echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
-<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
-<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
-">
-</form>';
-
-
-
-
- break;
-
- default:
- xoops_cp_header();
- adminMenu(1, _AM_GARAGES_INDEX);
-
- $names = getActiveGarages();
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- if($names[$x]['viewable']) $viewable="color:#000000;";
- else $viewable="color:#cccccc;";
- echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
- }
- else echo "<div>"._AM_NONEACTIVE."</div>";
- break;
-
-}
-xoops_cp_footer();
-?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -13,19 +13,19 @@
<p>XOOPS - <a href="http://www.xoops.org/">http://www.xoops.org/ </a></p>
<p>Script_fu - for his encouragement to get this module done. </p>
<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
-<p>exbanious - You inspired many to make or ask for a agarage module. </p>
+<p>exbanious - You inspired many to make or ask for a garage module. </p>
<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
<p><br>
- <strong>Translators:</strong></p>
+<strong>Translators:</strong></p>
<p>English - Northern <br>
- German - <br>
- Japanese - <br>
+German - <br>
+Japanese - <br>
Portuguese - <br>
Greek - <br>
French - <br>
-Dutch -<br>
+Dutch - <br>
Danish - <br>
</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -7,11 +7,11 @@
</head>
<body>
-<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
+<h1>Garage Module for XOOPS 2.0 User's Manual </h1>
<hr>
<p>Add new garage: </p>
<p>Name and Description are required.<br>
- To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
+ To upload an image, edit your garage afer its added, if site allows image uploads. </p>
<p>Edit Garage:</p>
<p>In some web sites, changes must be requested.</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -9,7 +9,7 @@
settype($name, "string");
settype($image, "string");
settype($location, "string");
-settype($mark, "string");
+settype($make, "string");
settype($model, "string");
settype($year, "string");
settype($engine, "string");
@@ -24,7 +24,7 @@
settype($quartm, "string");
settype($list, "string");
settype($mengine, "string");
-settype($meterior, "string");
+settype($mexterior, "string");
settype($minterior, "string");
settype($mrims, "string");
settype($maudio, "string");
@@ -79,7 +79,7 @@
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
- $mark = $myts->makeTboxData4Save($_POST['mark']);
+ $make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
$year = $myts->makeTboxData4Save($_POST['year']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
@@ -94,7 +94,7 @@
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
- $meterior = $myts->makeTareaData4Save($_POST['meterior']);
+ $mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
$minterior = $myts->makeTareaData4Save($_POST['minterior']);
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
@@ -106,7 +106,7 @@
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
@@ -133,7 +133,7 @@
if(!$imagechoice) $imagechoice = "0";
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
- $mark = $myts->makeTboxData4Save($_POST['mark']);
+ $make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
$year = $myts->makeTboxData4Save($_POST['year']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
@@ -148,7 +148,7 @@
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
- $meterior = $myts->makeTareaData4Save($_POST['meterior']);
+ $mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
$minterior = $myts->makeTareaData4Save($_POST['minterior']);
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
@@ -163,8 +163,8 @@
if($errmsg) $wtime = 15;
else $wtime = 3;
if(($uid == $puid && $xoopsModuleConfig['canuseredit']) || $userIsAdmin){
- if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
- else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATESUCCESS.$errmsg.$msg);
else redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATEFAILURE.$errmsg.$msg);
@@ -227,7 +227,7 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
- $sform->addElement(new XoopsFormText(_MD_XG_MARK, 'mark', 50, 75, $mark), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
$sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
@@ -242,7 +242,7 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_METERIOR, 'meterior', $meterior, 20, 40), true);
+ $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
@@ -276,7 +276,7 @@
$imagechoice = $garage['imagechoice'];
$url = $garage['url'];
$location = $garage['location'];
- $mark = $garage['mark'];
+ $make = $garage['make'];
$model = $garage['model'];
$year = $garage['year'];
$engine = $garage['engine'];
@@ -291,7 +291,7 @@
$quartm = $garage['quartm'];
$list = $garage['list'];
$mengine = $garage['mengine'];
- $meterior = $garage['meterior'];
+ $mexterior = $garage['mexterior'];
$minterior = $garage['minterior'];
$mrims = $garage['mrims'];
$maudio = $garage['maudio'];
@@ -335,7 +335,7 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
- $sform->addElement(new XoopsFormText(_MD_XG_MARK, 'mark', 50, 75, $mark), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
$sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
@@ -350,7 +350,7 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_METERIOR, 'meterior', $meterior, 20, 40), true);
+ $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,mark,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,meterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,31 +27,31 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,mark,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,meterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$mark','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$meterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$make','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',mark='$mark',model='$model',year='$year',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',meterior='$meterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',make='$make',model='$model',year='$year',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',mark='$mark',model='$model',year='$year',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',meterior='$meterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',make='$make',model='$model',year='$year',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
+ exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
} else {
return 1;
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -33,7 +33,7 @@
}
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
$garage['mengine'] = $myts->displayTarea($garage['mengine'], 0, 1, 1, 1, 1);
- $garage['meterior'] = $myts->displayTarea($garage['meterior'], 0, 1, 1, 1, 1);
+ $garage['mexterior'] = $myts->displayTarea($garage['mexterior'], 0, 1, 1, 1, 1);
$garage['minterior'] = $myts->displayTarea($garage['minterior'], 0, 1, 1, 1, 1);
$garage['mrims'] = $myts->displayTarea($garage['mrims'], 0, 1, 1, 1, 1);
$garage['maudio'] = $myts->displayTarea($garage['maudio'], 0, 1, 1, 1, 1);
@@ -45,7 +45,7 @@
}
$garage['image'] = $myts->displayTarea($garage['image'], 0, 0, 1, 1, 0);
$garage['location'] = $myts->displayTarea($garage['location'], 0, 0, 0, 0, 0);
- $garage['mark'] = $myts->displayTarea($garage['mark'], 0, 0, 0, 0, 0);
+ $garage['make'] = $myts->displayTarea($garage['make'], 0, 0, 0, 0, 0);
$garage['model'] = $myts->displayTarea($garage['model'], 0, 0, 0, 0, 0);
$garage['year'] = $myts->displayTarea($garage['year'], 0, 0, 0, 0, 0);
$garage['engine'] = $myts->displayTarea($garage['engine'], 0, 0, 0, 0, 0);
@@ -115,7 +115,7 @@
$xoopsTpl->assign('list', $xoopsModuleConfig['listname']);
$xoopsTpl->assign('website', _MD_XG_PWEBSITE);
$xoopsTpl->assign('location', _MD_XG_PLOCATION);
- $xoopsTpl->assign('mark', _MD_XG_MARK);
+ $xoopsTpl->assign('make', _MD_XG_MAKE);
$xoopsTpl->assign('model', _MD_XG_MODEL);
$xoopsTpl->assign('year', _MD_XG_YEAR);
$xoopsTpl->assign('engine', _MD_XG_ENGINE);
@@ -131,7 +131,7 @@
$xoopsTpl->assign('linkgarage', _MD_XG_USERGARAGE);
$xoopsTpl->assign('index',_MD_XG_INDEX);
$xoopsTpl->assign('mengine',_MD_XG_MENGINE);
- $xoopsTpl->assign('meterior',_MD_XG_METERIOR);
+ $xoopsTpl->assign('mexterior',_MD_XG_MEXTERIOR);
$xoopsTpl->assign('minterior',_MD_XG_MINTERIOR);
$xoopsTpl->assign('mrims',_MD_XG_MRIMS);
$xoopsTpl->assign('maudio',_MD_XG_MAUDIO);
Added: XoopsModules/xgarage/trunk/xgarage/install.txt
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/install.txt (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/install.txt 2013-09-20 23:10:40 UTC (rev 12071)
@@ -0,0 +1 @@
+Upload the garage folder inside of modules
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/main.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -82,13 +82,13 @@
define("_MD_XG_GNAME","Real Name");
define("_MD_XG_CAR","Vehicle");
-define("_MD_XG_MARK","Car Make");
-define("_MD_XG_MODEL","Car Model");
-define("_MD_XG_YEAR","Car Year");
-define("_MD_XG_ENGINE","Car Engine");
+define("_MD_XG_YEAR","Year");
+define("_MD_XG_MAKE","Make");
+define("_MD_XG_MODEL","Model");
+define("_MD_XG_ENGINE","Engine");
define("_MD_XG_WHEEL","Wheels/Rims");
define("_MD_XG_TRANS","Transmission");
-define("_MD_XG_COLOR","Car Color");
+define("_MD_XG_COLOR","Body Color");
define("_MD_XG_RT","R/T");
define("_MD_XG_SIXTY","60 Foot");
@@ -100,7 +100,7 @@
define("_MD_XG_QUARTM","1/4 MPH");
define("_MD_XG_MENGINE","Engine");
-define("_MD_XG_METERIOR","Exterior");
+define("_MD_XG_MEXTERIOR","Exterior");
define("_MD_XG_MINTERIOR","Interior");
define("_MD_XG_MRIMS","Rims/Tires");
define("_MD_XG_MAUDIO","Audio/Video");
Added: XoopsModules/xgarage/trunk/xgarage/license.txt
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/license.txt (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/license.txt 2013-09-20 23:10:40 UTC (rev 12071)
@@ -0,0 +1,88 @@
+GNU GENERAL PUBLIC LICENSE Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
Added: XoopsModules/xgarage/trunk/xgarage/readme.txt
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/readme.txt (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/readme.txt 2013-09-20 23:10:40 UTC (rev 12071)
@@ -0,0 +1,2 @@
+Garage Beta #1
+Use at your own risk!
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:10:40 UTC (rev 12071)
@@ -15,7 +15,7 @@
`imagechoice` tinyint(4) NOT NULL default '0',
`url` varchar(255) NOT NULL default '',
`location` varchar(75) NOT NULL default '',
- `mark` varchar(75) NOT NULL default '',
+ `make` varchar(75) NOT NULL default '',
`model` varchar(75) NOT NULL default '',
`year` varchar(75) NOT NULL default '',
`engine` varchar(75) NOT NULL default '',
@@ -29,7 +29,7 @@
`quart` varchar(75) NOT NULL default '',
`quartm` varchar(75) NOT NULL default '',
`mengine` text NOT NULL,
- `meterior` text NOT NULL,
+ `mexterior` text NOT NULL,
`minterior` text NOT NULL,
`mrims` text NOT NULL,
`mfuture` text NOT NULL,
Modified: XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:10:40 UTC (rev 12071)
@@ -1,155 +1,155 @@
-<{if $garage}>
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td style="font-size:small;">
- <{if $index}><a href="index.php"><img src="images/icons/index.png" align="middle" title="[<{$index}>]" alt="[<{$index}>]"></a><{/if}>
-
- <{if $panel == true}>
- <{if $editgarage}><a href="garage.php?op=edit&gid=<{$gid}>"><img src="images/icons/edit.png" align="middle" title="[<{$editgarage}>]" alt="[<{$editgarage}>]"></a><{/if}>
- <{if $approvegarage}><a href="admin/index.php?op=approve&gid=<{$gid}>"><img src="images/icons/approve.png" align="middle" title="[<{$approvegarage}>]" alt="[<{$approvegarage}>]"> </a><{/if}>
- <{if $disablegarage}><a href="admin/index.php?op=disable&gid=<{$gid}>"><img src="images/icons/disable.png" align="middle" title="[<{$disablegarage}>]" alt="[<{$disablegarage}>]"></a><{/if}>
- <{if $enablegarage}><a href="admin/index.php?op=enable&gid=<{$gid}>"><img src="images/icons/enable.png" align="middle" title="[<{$enablegarage}>]" alt="[<{$enablegarage}>]"></a><{/if}>
- <{if $deletegarage}><a href="admin/index.php?op=delgarage&gid=<{$gid}>"><img src="images/icons/delete.png" align="middle" title="[<{$deletegarage}>]" alt="[<{$deletegarage}>]"></a><{/if}>
- <{if $adminlink}><a href="../../modules/garage/admin/index.php"><img src="images/icons/admin.png" align="middle" title="[<{$adminlink}>]" alt="[<{$adminlink}>]"></a><{/if}>
-
- <{/if}></td>
- </tr>
-</table>
-
-<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" summary="" class="forumline">
- <tr>
- <th height="25" nowrap colspan="2" class="thHead">The Garage of :: <{$garage.name}></th>
- </tr>
- <tr>
- <td width="40%" height="28" align="center" class="catLeft"><b><span class="gen">Owner Info</span></b></td>
- <td width="60%" align="center" class="catRight"><b><span class="gen">Best quart mile times</span></b></td>
- </tr>
- <tr>
- <td align="center" valign="top" class="row1"><span class="gen"><{if $garage.linkgarage}><br/><a href="../../userinfo.php?uid=<{$garage.uid}>"><{$linkgarage}></a><{/if}><br />
- <{$uname}>: <B><{$uname}></b><br />
- <{$location}>: <{$garage.location}></span></td>
- <td valign="top" rowspan="3" class="row1"><table width="100%" border="0" cellspacing="1" cellpadding="3">
- <tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$rt}>:</span></td>
- <td valign="top" width="100%"><b><span class="gen"><{$garage.rt}></span></b></td>
- </tr>
- <tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$sixty}>:</span></td>
- <td valign="top" width="100%"><b><span class="gen"><{$garage.sixty}></span></b></td>
- </tr>
- <tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$three}>:</span></td>
- <td><b><span class="gen"><{$garage.three}></span></b></td>
- </tr>
- <tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigth}>:</span></td>
- <td><span class="gen"><b><{$garage.eigth}></b></span></td>
- </tr>
- <tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigthm}>:</span></td>
- <td><b><span class="gen"><{$garage.eigthm}></span></b></td>
- </tr>
- <tr>
- <td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$thou}>:</span></td>
- <td> <b><span class="gen"><{$garage.thou}></span></b></td>
- </tr>
- <tr>
- <td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quart}>:</span></td>
- <td> <b><span class="gen"><{$garage.quart}></span></b></td>
- </tr>
- <tr>
- <td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quartm}>:</span></td>
- <td> <b><span class="gen"><{$garage.quartm}></span></b></td>
- </tr>
-
- </table></td>
- </tr>
- ...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:09:45
|
Revision: 12070
http://sourceforge.net/p/xoops/svn/12070
Author: beckmi
Date: 2013-09-20 23:09:39 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
Adding old xGarage module
Modified Paths:
--------------
XoopsModules/tag/trunk/tag/view.tag.php
Added Paths:
-----------
XoopsModules/xgarage/
XoopsModules/xgarage/branches/
XoopsModules/xgarage/releases/
XoopsModules/xgarage/trunk/
XoopsModules/xgarage/trunk/xgarage/
XoopsModules/xgarage/trunk/xgarage/admin/
XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
XoopsModules/xgarage/trunk/xgarage/admin/error_log
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/images/
XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif
XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif
XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/admin/menu.php
XoopsModules/xgarage/trunk/xgarage/blocks/
XoopsModules/xgarage/trunk/xgarage/class/
XoopsModules/xgarage/trunk/xgarage/comment_delete.php
XoopsModules/xgarage/trunk/xgarage/comment_edit.php
XoopsModules/xgarage/trunk/xgarage/comment_new.php
XoopsModules/xgarage/trunk/xgarage/comment_post.php
XoopsModules/xgarage/trunk/xgarage/comment_reply.php
XoopsModules/xgarage/trunk/xgarage/docs/
XoopsModules/xgarage/trunk/xgarage/docs/EN/
XoopsModules/xgarage/trunk/xgarage/docs/EN/admin.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/index.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/docs/index.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/header.php
XoopsModules/xgarage/trunk/xgarage/image_uploader.php
XoopsModules/xgarage/trunk/xgarage/images/
XoopsModules/xgarage/trunk/xgarage/images/garage.png
XoopsModules/xgarage/trunk/xgarage/images/icons/
XoopsModules/xgarage/trunk/xgarage/images/icons/add.png
XoopsModules/xgarage/trunk/xgarage/images/icons/admin.png
XoopsModules/xgarage/trunk/xgarage/images/icons/approve.png
XoopsModules/xgarage/trunk/xgarage/images/icons/delete.png
XoopsModules/xgarage/trunk/xgarage/images/icons/disable.png
XoopsModules/xgarage/trunk/xgarage/images/icons/edit.png
XoopsModules/xgarage/trunk/xgarage/images/icons/enable.png
XoopsModules/xgarage/trunk/xgarage/images/icons/index.png
XoopsModules/xgarage/trunk/xgarage/images/uploads/
XoopsModules/xgarage/trunk/xgarage/images/visible0.jpg
XoopsModules/xgarage/trunk/xgarage/images/visible1.jpg
XoopsModules/xgarage/trunk/xgarage/include/
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/
XoopsModules/xgarage/trunk/xgarage/language/english/
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/language/english/modinfo.php
XoopsModules/xgarage/trunk/xgarage/sql/
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/
XoopsModules/xgarage/trunk/xgarage/templates/blocks/
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/edit_garage.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Modified: XoopsModules/tag/trunk/tag/view.tag.php
===================================================================
--- XoopsModules/tag/trunk/tag/view.tag.php 2013-09-20 19:48:41 UTC (rev 12069)
+++ XoopsModules/tag/trunk/tag/view.tag.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -139,7 +139,7 @@
$items_data[] = $item;
$uids[$item["uid"]] = 1;
}
-xoops_load('xoopsuserutility');
+xoops_load('XoopsUserUtility');
$users = XoopsUserUtility::getUnameFromIds(array_keys($uids));
foreach (array_keys($items_data) as $key) {
Added: XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,355 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+
+settype($op,"string");
+//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
+$op = !isset($_GET['op'])? NULL : $_GET['op'];
+//$op = isset($_POST['op']) ? $_POST['op'] : '';
+//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
+$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
+$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
+$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
+$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
+$ordersel = isset($_POST['ordersel']) ? $_POST['ordersel'] : 'DESC';
+$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
+$self = $_SERVER['PHP_SELF'];
+global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
+
+
+$myts = &MyTextSanitizer::getInstance();
+
+//echo("Hellow World.");
+
+switch($op){
+ case "approve":
+
+ //if($userIsAdmin) {
+ $success = approveGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVESUCCESS);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVEFAILURE);
+ //}
+
+ break;
+
+ case "disable":
+ //if($userIsAdmin) {
+ $success = disableGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEDISABLED);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_DISBALEFAILURE);
+ //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMIND);
+ break;
+
+ case "enable":
+ //if($userIsAdmin) {
+ $success = enableGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEENABLED);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_ENBALEFAILURE);
+ //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMINE);
+ break;
+
+ case "delgarage":
+
+
+ //verify delete
+ if (isset($_GET['gid'])) {
+ $gid = $_GET['gid'];
+ }
+ if (isset($_POST['gid'])) {
+ $gid = $_POST['gid'];
+ }
+ if (isset($_POST['subop'])) {
+ $subop = $_POST['subop'];
+ }
+ if ($subop == "delok") {
+
+ $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("garage"), $gid);
+
+ if ($xoopsDB->query($sql)) {
+ // delete comments for the garage being deleted
+ xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
+ redirect_header("index.php", 3, _AM_ITEMDELETED);
+ //echo "deleted";
+ } else {
+ redirect_header("index.php", 3, _AM_ITEMNOTDELETED);
+ //echo "not deleted";
+ }
+ } // end if
+ else {
+ xoops_cp_header();
+ adminMenu(1, _AM_GARAGES_INDEX);
+ echo "<div style='height:25px;'> </div>";
+ xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
+ }
+ echo "</p>";
+ break;
+
+
+ case "view_new":
+ xoops_cp_header();
+ adminMenu(2, _AM_GARAGES_APPROVE);
+ //get list of all diabled garage
+ $names = getNewGarages();
+
+ //print them out with links
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ }
+ else echo "<div>"._AM_NONENEW."</div>";
+ break;
+
+ case "view_disabled":
+ xoops_cp_header();
+ adminMenu(3, _AM_GARAGES_DISABLED);
+ //get list of all diabled garage
+ $names = getDisabledGarages();
+
+ //print them out with links
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ }
+ else echo("<div>"._AM_NONEDISABLED."</div>");
+ break;
+ case "add_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ if($_POST['catname']){
+ $success = addCat('',$_POST['catname'],$_POST['gid']);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ exit;
+ } else {
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
+ }
+ }
+ break;
+ case "move_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ if($_POST['gid'] != $_POST['cid']){
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $children = $cattree->getChildTreeArray($_POST['cid']);
+ //var_dump($children);
+ foreach($children as $child){
+ $cc[] = $child['cid'];
+ }
+ if(!in_array($_POST['gid'],$cc)){
+ $success = moveCat($_POST['cid'],$_POST['gid']);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVED);
+ exit;
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEERROR);
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEINTO);
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_MOVENO);
+
+ break;
+ case "rename_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ $success = renameCat($_POST['cid'],$_POST['catname']);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMED);
+ exit;
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMEERROR);
+ break;
+
+ case "del_cat":
+
+
+ //verify delete
+
+ if (isset($_POST['cid'])) {
+ $cid = $_POST['cid'];
+ }
+ if (isset($_POST['subop'])) {
+ $subop = $_POST['subop'];
+ }
+ if (isset($subop) && $subop == "delok") {
+ //get all cats
+
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $cats = $cattree->getChildTreeArray($cid,"name");
+ $WHERE = "WHERE cid = $cid";
+ foreach($cats as $cat){
+ $WHERE .= " OR cid=".$cat['cid'];
+ }
+
+ $sql = sprintf("DELETE FROM %s %s", $xoopsDB->prefix("garage_cats"), $WHERE);
+
+ if ($xoopsDB->query($sql)) {
+ // delete comments for the garage being deleted
+ //xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
+ redirect_header("index.php", 3, _AM_CATDELETED);
+ //echo "deleted";
+ } else {
+ redirect_header("index.php", 3, _AM_CATNOTDELETED);
+ //echo "not deleted";
+ }
+ } // end if
+ else {
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $cats = $cattree->getChildTreeArray($cid,"name");
+ $catlist[] = getName($cid);
+ $content = 0;
+ $c = check4Content($cid);
+ $content = $content + $c;
+
+ foreach($cats as $cat){
+ $c = check4Content($cat['cid']);
+ $content = $content + $c;
+ $catlist[] = getName($cat['cid']);
+ }
+ if($content){
+ $msg = sprintf(_AM_CONTENTEXISTS,$content);
+ redirect_header("index.php?op=cats&cid=$cid", 5, $msg);
+ exit;
+ } else {
+ xoops_cp_header();
+ adminMenu(4, _AM_GARAGES_CATEGORIES);
+ echo("<div style='height:25px;'> </div>");
+
+ $clist = join($catlist,", ");
+ $delmsg = _AM_CONFIRMDELCATS."<br/>".$clist;
+ xoops_confirm(array('op' => 'del_cat', 'cid' => $cid, 'subop' => 'delok'), 'index.php', $delmsg);
+ }
+ }
+ break;
+
+ case "cats":
+ xoops_cp_header();
+ adminMenu(4, _AM_GARAGES_CATEGORIES);
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+
+ //if(!$cid) {$cid = '0';}
+ //$cid = isset($_POST['cid']);
+ $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
+ $path = $cattree->getNicePathFromId($cid, "name", "index.php?op=cats");
+ echo "<a href='index.php?op=cats&cid='0''><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
+
+ $cats = getCats($cid);
+ //echo("<table width='100%' align='center'>");
+ //echo("");
+ //echo("<form method='post'>");
+ for($x=0;$x < count($cats);$x++){
+ //echo("<div style='left-margin:50px;'><input type='checkbox' name='cats[]' value='".$cats[$x]['cid']."'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>");
+ echo "<div style='left-margin:50px;'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>";
+ }
+ //echo("<input type='hidden' name='op' value='delcats'>");
+ //echo("<input type='submit' value='"._AM_DELETE."'>");
+ //echo("</form>");
+ //echo("</table>");
+ // add new cat
+ echo "<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>";
+ echo "<form method='post' action='index.php'>";
+ echo ""._AM_NEWCATNAME."<input type='text' name='catname' /><br/>"._AM_PARENT."";
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo "<input type='hidden' name='cid' value='$cid' />";
+ echo "<input type='hidden' name='op' value='add_cat' />";
+ echo "<br/><input type='submit' value='"._AM_ADDNEWCAT."' />";
+ echo "</form>" ;
+ echo "</div>" ;
+ echo "<br/>" ;
+
+ if($cid){
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(_AM_MOVECAT."<br/>"._AM_PARENT);
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='move_cat'>");
+ echo("<br/><input type='submit' value='"._AM_MOVECATSUBMIT."'>");
+ echo("</form>");
+ echo("</div>");
+ echo("<br/>");
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(_AM_RENAMECAT);
+ $catname = getName($cid);
+ echo("<input type='text' name='catname' value='$catname'>");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='rename_cat'>");
+ echo("<br/><input type='submit' value='"._AM_RENAME."'>");
+ echo("</form>");
+ echo("</div>");
+ echo("<br/>");
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(_AM_DELETECAT);
+ $catname = getName($cid);
+ echo(" $catname");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='del_cat'>");
+ echo("<br/><input type='submit' value='"._AM_DELETE."'>");
+ echo("</form>");
+ echo("</div>");
+ }
+ break;
+ case "documentation":
+ xoops_cp_header();
+ adminMenu(5, _AM_GARAGES_DOCUMENTATION);
+
+ echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
+
+ echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
+
+
+ echo("</div>");
+
+ break;
+
+ case "support":
+ xoops_cp_header();
+ adminMenu(5, _AM_GARAGES_SUPPORT);
+
+ echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
+
+ echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
+
+
+ echo("</div>");
+
+ break;
+
+ case "donations":
+ xoops_cp_header();
+ adminMenu(6, _AM_GARAGES_DONATIONS);
+
+ echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
+
+ echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
+<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
+">
+</form>';
+
+
+
+
+ break;
+
+ default:
+ xoops_cp_header();
+ adminMenu(1, _AM_GARAGES_INDEX);
+
+ $names = getActiveGarages();
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ if($names[$x]['viewable']) $viewable="color:#000000;";
+ else $viewable="color:#cccccc;";
+ echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
+ }
+ else echo "<div>"._AM_NONEACTIVE."</div>";
+ break;
+
+}
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,3 @@
+[09-Sep-2007 17:21:09] PHP Parse error: syntax error, unexpected ':' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 9
+[09-Sep-2007 17:21:47] PHP Parse error: syntax error, unexpected ';' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 262
+[09-Sep-2007 17:22:26] PHP Parse error: syntax error, unexpected ')' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 265
Added: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,183 @@
+<?php
+function getCats($gid){
+ global $xoopsDB;
+ $sql = ("SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name");
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: getCats($gid)");
+ } else {
+ $rows = array();
+ while($row = $xoopsDB->fetchArray($result)) {
+ $rows[] = $row;
+ }
+ return ($rows);
+ }
+}
+function getName($cid){
+ global $xoopsDB;
+ $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = $cid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: getName($cid)");
+ } else {
+ $row = $xoopsDB->fetchArray($result);
+ $name = $row['name'];
+ return ($name);
+ }
+}
+function addCat($name,$gid) {
+ global $xoopsDB;
+ $sql = $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("garage_cats")." VALUES ('','$name','$gid')");
+ if (!$result = $sql) {
+ exit("$sql > SQL Error in function :: addCat($name,$gid)");
+ return 0;
+ }else{
+ return 1;
+ }
+}
+
+function moveCat($cid,$gid){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = $cid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: moveCat($cid,$gid)");
+ return 0;
+ } else {
+ return 1;
+ }
+
+}
+
+function check4Content($cid){
+ global $xoopsDB;
+ $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = $cid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: check4Content($cid)");
+ return 0;
+ } else {
+ $row = $xoopsDB->fetchArray($result);
+ return $row['count'];
+ }
+
+}
+
+function renameCat($cid,$catname){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = $cid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: renameCat($cid,$catname)");
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+function approveGarage($gid){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = $gid";
+ if ( !$result = $xoopsDB->queryF($sql) ) {
+ exit("$sql > SQL Error in function :: approveGarage($gid)");
+ } else {
+ return 1;
+ }
+}
+
+function disableGarage($gid){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = $gid";
+ if ( !$result = $xoopsDB->queryF($sql) ) {
+ exit("$sql > SQL Error in function :: disableGarage($gid)");
+ } else {
+ return 1;
+ }
+}
+
+function enableGarage($gid){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = $gid";
+ if ( !$result = $xoopsDB->queryF($sql) ) {
+ exit("$sql > SQL Error in function :: enableGarage($gid)");
+ } else {
+ return 1;
+ }
+}
+function getActiveGarages(){
+ global $xoopsDB;
+ $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=0 AND approved=1 ORDER BY name");
+ $result=$xoopsDB->query($sql);
+ $rows = array();
+ while($row = $xoopsDB->fetchArray($result)) {
+ $rows[] = $row;
+ }
+ return ($rows);
+}
+
+function getNewGarages(){
+ global $xoopsDB;
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved=0 ORDER BY name");
+ $result=$xoopsDB->query($sql);
+ $rows = array();
+ while($row = $xoopsDB->fetchArray($result)) {
+ $rows[] = $row;
+ }
+ return ($rows);
+}
+
+function getDisabledGarages(){
+ global $xoopsDB;
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=1 ORDER BY name");
+ $result=$xoopsDB->query($sql);
+ $rows = array();
+ while($row = $xoopsDB->fetchArray($result)) {
+ $rows[] = $row;
+ }
+ return ($rows);
+}
+
+function adminMenu ($currentoption = 0, $breadcrumb = '')
+{
+
+ /* Nice buttons styles */
+ echo "
+ <style type='text/css'>
+ #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; }
+ #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/garage/admin/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; }
+ #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }
+ #buttonbar li { display:inline; margin:0; padding:0; }
+ #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/garage/admin/images/left_both.gif') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
+ #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/garage/admin/images/right_both.gif') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
+ /* Commented Backslash Hack hides rule from IE5-Mac \*/
+ #buttonbar a span {float:none;}
+ /* End IE5-Mac hack */
+ #buttonbar a:hover span { color:#333; }
+ #buttonbar #current a { background-position:0 -150px; border-width:0; }
+ #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; }
+ #buttonbar a:hover { background-position:0% -150px; }
+ #buttonbar a:hover span { background-position:100% -150px; }
+ </style>
+ ";
+
+ // global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
+ global $xoopsModule, $xoopsConfig;
+
+ $myts =& MyTextSanitizer::getInstance();
+
+ $tblColors = Array();
+ $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = '';
+ $tblColors[$currentoption] = 'current';
+ echo "<div id='buttontop'>";
+ echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
+ //echo "<td style=\"width: 45%; 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_SCLIENT_OPTS . "</a> | <a href=\"../index.php\">" . _AM_SCLIENT_GOMOD . "</a> | <a href=\"import.php\">" . _AM_SCLIENT_IMPORT . "</a> | <a href='" . smartclient_getHelpPath() ."' target=\"_blank\">" . _AM_SCLIENT_HELP . "</a> | <a href=\"about.php\">" . _AM_SCLIENT_ABOUT . "</a></td>";
+ echo "<td style=\"width: 70%; 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_GARAGES_OPTS . "</a> | <a href=\"../index.php\">" . _AM_GARAGES_GOMOD . "</a> | <a href=\"index.php?op=documentation\">" . _AM_GARAGES_DOCS . "</a> | <a href=\"index.php?op=support\">" . _AM_GARAGES_SUPPORT . "</a> | <a href=\"index.php?op=donations\">" . _AM_GARAGES_DONATIONS . "</a></td>";
+ echo "<td style=\"width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $myts->displayTarea($xoopsModule->name()) . " " . _AM_GARAGES_MODADMIN . "</b> " . $breadcrumb . "</td>";
+ echo "</tr></table>";
+ echo "</div>";
+ echo "<div id='buttonbar'>";
+ echo "<ul>";
+ echo "<li id='" . $tblColors[0] . "'><a href=\"../garage.php?op=add\"><span>" . _AM_GARAGES_ADDNEWGARAGE . "</span></a></li>";
+ echo "<li id='" . $tblColors[1] . "'><a href=\"index.php\"><span>" . _AM_GARAGES_INDEX . "</span></a></li>";
+ echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
+ echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
+ echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
+ echo "</ul></div>";
+}
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif 2013-09-20 19:48:41 UTC (rev 12069)
+++ XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif 2013-09-20 23:09:39 UTC (rev 12070)
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/images/bg.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif 2013-09-20 19:48:41 UTC (rev 12069)
+++ XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif 2013-09-20 23:09:39 UTC (rev 12070)
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/images/left_both.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif 2013-09-20 19:48:41 UTC (rev 12069)
+++ XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif 2013-09-20 23:09:39 UTC (rev 12070)
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/images/right_both.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,365 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+
+settype($op,"string");
+if(!isset($_POST['op']) && isset($_GET['op']) ) {
+ $op = $_GET['op'] ;
+}
+if (!isset($op)) {
+ $op = '';
+}
+
+//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
+if(!isset($_POST['cid']) && isset($_GET['cid']) ) {
+ $cid = intval($_GET['cid']);
+}
+//$op = isset($_POST['op']) ? $_POST['op'] : '';
+//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
+//$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
+$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
+$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
+$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
+$ordersel = isset($_POST['ordersel']) ? $_POST['ordersel'] : 'DESC';
+$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
+$self = $_SERVER['PHP_SELF'];
+
+
+
+global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule, $cattree;
+
+
+$myts = &MyTextSanitizer::getInstance();
+
+//echo("Hellow World.");
+
+switch($op){
+ case "approve":
+
+ //if($userIsAdmin) {
+ $success = approveGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVESUCCESS);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVEFAILURE);
+ //}
+
+ break;
+
+ case "disable":
+ //if($userIsAdmin) {
+ $success = disableGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEDISABLED);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_DISBALEFAILURE);
+ //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMIND);
+ break;
+
+ case "enable":
+ //if($userIsAdmin) {
+ $success = enableGarage($gid);
+ if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEENABLED);
+ else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_ENBALEFAILURE);
+ //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMINE);
+ break;
+
+ case "delgarage":
+
+
+ //verify delete
+ if (isset($_GET['gid'])) {
+ $gid = $_GET['gid'];
+ }
+ if (isset($_POST['gid'])) {
+ $gid = $_POST['gid'];
+ }
+ if (isset($_POST['subop'])) {
+ $subop = $_POST['subop'];
+ }
+ if ($subop == "delok") {
+
+ $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("garage"), $gid);
+
+ if ($xoopsDB->query($sql)) {
+ // delete comments for the garage being deleted
+ xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
+ redirect_header("index.php", 3, _AM_ITEMDELETED);
+ //echo "deleted";
+ } else {
+ redirect_header("index.php", 3, _AM_ITEMNOTDELETED);
+ //echo "not deleted";
+ }
+ } // end if
+ else {
+ xoops_cp_header();
+ adminMenu(1, _AM_GARAGES_INDEX);
+ echo "<div style='height:25px;'> </div>";
+ xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
+ }
+ echo "</p>";
+ break;
+
+
+ case "view_new":
+ xoops_cp_header();
+ adminMenu(2, _AM_GARAGES_APPROVE);
+ //get list of all diabled garage
+ $names = getNewGarages();
+
+ //print them out with links
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ }
+ else echo "<div>"._AM_NONENEW."</div>";
+ break;
+
+ case "view_disabled":
+ xoops_cp_header();
+ adminMenu(3, _AM_GARAGES_DISABLED);
+ //get list of all diabled garage
+ $names = getDisabledGarages();
+
+ //print them out with links
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ }
+ else echo("<div>"._AM_NONEDISABLED."</div>");
+ break;
+ case "add_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ if($_POST['catname']) {
+ $success = addCat($_POST['catname'],$_POST['gid']);
+ if ($success) {
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ exit;
+ } else {
+ redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
+ }
+ }
+ break;
+ case "move_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ if($_POST['gid'] != $_POST['cid']){
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $children = $cattree->getChildTreeArray($_POST['cid']);
+ //var_dump($children);
+ foreach($children as $child){
+ $cc[] = $child['cid'];
+ }
+ if(!in_array($_POST['gid'],$cc)){
+ $success = moveCat($_POST['cid'],$_POST['gid']);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVED);
+ exit;
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEERROR);
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEINTO);
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_MOVENO);
+
+ break;
+ case "rename_cat":
+ //echo("testing123");
+ //adminMenu(4, _AM_GARAGES_CATEGORIES);
+ $success = renameCat($_POST['cid'],$_POST['catname']);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMED);
+ exit;
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMEERROR);
+ break;
+
+ case "del_cat":
+
+
+ //verify delete
+
+ if (isset($_POST['cid'])) {
+ $cid = $_POST['cid'];
+ }
+ if (isset($_POST['subop'])) {
+ $subop = $_POST['subop'];
+ }
+ if (isset($subop) && $subop == "delok") {
+ //get all cats
+
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $cats = $cattree->getChildTreeArray($cid,"name");
+ $WHERE = "WHERE cid = $cid";
+ foreach($cats as $cat){
+ $WHERE .= " OR cid=".$cat['cid'];
+ }
+
+ $sql = sprintf("DELETE FROM %s %s", $xoopsDB->prefix("garage_cats"), $WHERE);
+
+ if ($xoopsDB->query($sql)) {
+ // delete comments for the garage being deleted
+ //xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
+ redirect_header("index.php", 3, _AM_CATDELETED);
+ //echo "deleted";
+ } else {
+ redirect_header("index.php", 3, _AM_CATNOTDELETED);
+ //echo "not deleted";
+ }
+ } // end if
+ else {
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+ $cats = $cattree->getChildTreeArray($cid,"name");
+ $catlist[] = getName($cid);
+ $content = 0;
+ $c = check4Content($cid);
+ $content = $content + $c;
+
+ foreach($cats as $cat){
+ $c = check4Content($cat['cid']);
+ $content = $content + $c;
+ $catlist[] = getName($cat['cid']);
+ }
+ if($content){
+ $msg = sprintf(_AM_CONTENTEXISTS,$content);
+ redirect_header("index.php?op=cats&cid=$cid", 5, $msg);
+ exit;
+ } else {
+ xoops_cp_header();
+ adminMenu(4, _AM_GARAGES_CATEGORIES);
+ echo("<div style='height:25px;'> </div>");
+
+ $clist = join($catlist,", ");
+ $delmsg = _AM_CONFIRMDELCATS."<br/>".$clist;
+ xoops_confirm(array('op' => 'del_cat', 'cid' => $cid, 'subop' => 'delok'), 'index.php', $delmsg);
+ }
+ }
+ break;
+
+ case "cats":
+ xoops_cp_header();
+ adminMenu(4, _AM_GARAGES_CATEGORIES);
+ include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
+
+ $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
+
+ if(!$cid) $cid = '0';
+ $path = $cattree->getNicePathFromId($cid, "name", $self."?op=cats");
+ echo "<a href='index.php?op=cats&cid=0'><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
+
+ $cats = getCats($cid);
+ //echo("<table width='100%' align='center'>");
+ //echo("");
+ //echo("<form method='post'>");
+ for($x=0;$x < count($cats);$x++){
+ //echo("<div style='left-margin:50px;'><input type='checkbox' name='cats[]' value='".$cats[$x]['cid']."'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>");
+ echo("<div style='left-margin:50px;'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>");
+ }
+ //echo("<input type='hidden' name='op' value='delcats'>");
+ //echo("<input type='submit' value='"._AM_DELETE."'>");
+ //echo("</form>");
+ //echo("</table>");
+ // add new cat
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(""._AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
+ $cattree->makeMySelBox("name","",$cid, true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid' />");
+ echo("<input type='hidden' name='op' value='add_cat' />");
+ echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."' />");
+ echo("</form>");
+ echo("</div>");
+ echo("<br/>");
+
+ if($cid){
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(""._AM_MOVECAT."<br/>"._AM_PARENT."");
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='move_cat'>");
+ echo("<br/><input type='submit' value='"._AM_MOVECATSUBMIT."'>");
+ echo("</form>");
+ echo("</div>");
+ echo("<br/>");
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(_AM_RENAMECAT);
+ $catname = getName($cid);
+ echo("<input type='text' name='catname' value='$catname'>");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='rename_cat'>");
+ echo("<br/><input type='submit' value='"._AM_RENAME."'>");
+ echo("</form>");
+ echo("</div>");
+ echo("<br/>");
+ echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
+ echo("<form method='post' action='index.php'>");
+ echo(_AM_DELETECAT);
+ $catname = getName($cid);
+ echo(" $catname");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='del_cat'>");
+ echo("<br/><input type='submit' value='"._AM_DELETE."'>");
+ echo("</form>");
+ echo("</div>");
+ }
+ break;
+ case "documentation":
+ xoops_cp_header();
+ adminMenu(5, _AM_GARAGES_DOCUMENTATION);
+
+ echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
+
+ echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
+
+
+ echo("</div>");
+
+ break;
+
+ case "support":
+ xoops_cp_header();
+ adminMenu(5, _AM_GARAGES_SUPPORT);
+
+ echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
+
+ echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
+
+
+ echo("</div>");
+
+ break;
+
+ case "donations":
+ xoops_cp_header();
+ adminMenu(6, _AM_GARAGES_DONATIONS);
+
+ echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
+
+ echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+<input type="hidden" name="cmd" value="_s-xclick">
+<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
+<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
+<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
+">
+</form>';
+
+
+
+
+ break;
+
+ default:
+ xoops_cp_header();
+ adminMenu(1, _AM_GARAGES_INDEX);
+
+ $names = getActiveGarages();
+ if(count($names) > 0)
+ for($x=0;$x<count($names);$x++){
+ if($names[$x]['viewable']) $viewable="color:#000000;";
+ else $viewable="color:#cccccc;";
+ echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
+ }
+ else echo "<div>"._AM_NONEACTIVE."</div>";
+ break;
+
+}
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/index.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/menu.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/menu.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/menu.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,4 @@
+<?php
+$adminmenu[0]['title'] = _MI_GARAGES_ADMINMENU1;
+$adminmenu[0]['link'] = "admin/index.php";
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/menu.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/comment_delete.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/comment_delete.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/comment_delete.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,29 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_delete.php';
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/comment_delete.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/comment_edit.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/comment_edit.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/comment_edit.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,29 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_edit.php';
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/comment_edit.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/comment_new.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/comment_new.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/comment_new.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,38 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+
+include '../../mainfile.php';
+$com_itemid = isset($HTTP_GET_VARS['com_itemid']) ? intval($HTTP_GET_VARS['com_itemid']) : 0;
+if ($com_itemid > 0) {
+ // Get link title
+ $sql = "SELECT title FROM " . $xoopsDB->prefix('mylinks_links') . " WHERE lid=" . $com_itemid . "";
+ $result = $xoopsDB->query($sql);
+ $row = $xoopsDB->fetchArray($result);
+ $com_replytitle = $row['title'];
+ include XOOPS_ROOT_PATH.'/include/comment_new.php';
+}
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/comment_new.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/comment_post.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/comment_post.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/comment_post.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,29 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include '../../mainfile.php';
+include XOOPS_ROOT_PATH.'/include/comment_post.php';
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/comment_post.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/comment_reply.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/comment_reply.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/comment_reply.php 2013-09-20 23:09:39 UTC (rev 12070)
@@ -0,0 +1,29 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// --------------...
[truncated message content] |
|
From: <luc...@us...> - 2013-09-20 19:48:48
|
Revision: 12069
http://sourceforge.net/p/xoops/svn/12069
Author: luciorota
Date: 2013-09-20 19:48:41 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
- added: module is clonable, built-in module clone function
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/about.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_footer.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/menu.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/permissions.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top.php
XoopsModules/wfdownloads/trunk/wfdownloads/blocks/top_by_cat.php
XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/dbupdater.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/img_uploader.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/ip_log.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/mimetype.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/modification.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/object.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/rating.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/report.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/review.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/uploader.php
XoopsModules/wfdownloads/trunk/wfdownloads/comment_delete.php
XoopsModules/wfdownloads/trunk/wfdownloads/comment_edit.php
XoopsModules/wfdownloads/trunk/wfdownloads/comment_new.php
XoopsModules/wfdownloads/trunk/wfdownloads/comment_post.php
XoopsModules/wfdownloads/trunk/wfdownloads/comment_reply.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/credits.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/history.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/lang_diff.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/readme.txt
XoopsModules/wfdownloads/trunk/wfdownloads/footer.php
XoopsModules/wfdownloads/trunk/wfdownloads/header.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/comment_functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/common.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/directorychecker.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/filechecker.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/notification.inc.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/search.inc.php
XoopsModules/wfdownloads/trunk/wfdownloads/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/blocks.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/common.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/directorychecker.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/filechecker.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help2.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help3.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help4.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help5.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help6.html
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/module.css
XoopsModules/wfdownloads/trunk/wfdownloads/newlist.php
XoopsModules/wfdownloads/trunk/wfdownloads/notification_update.php
XoopsModules/wfdownloads/trunk/wfdownloads/ratefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/review.php
XoopsModules/wfdownloads/trunk/wfdownloads/rss.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/sql/mysql.sql
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ip_logslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mimetypeslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_mirrorslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_permissions.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_ratingslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_reportsmodificationslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_reviewslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_brokenfile.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_disclaimer.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_download.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_footer.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_header.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_index.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_mirrors.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_newlistindex.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_ratefile.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_reviews.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_singlefile.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_topten.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
XoopsModules/wfdownloads/trunk/wfdownloads/topten.php
XoopsModules/wfdownloads/trunk/wfdownloads/viewcat.php
XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Added Paths:
-----------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/clone.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads_lists.php
XoopsModules/wfdownloads/trunk/wfdownloads/images/VeraBd.ttf
XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/
XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/editcopy.png
XoopsModules/wfdownloads/trunk/wfdownloads/images/icon32/index.html
XoopsModules/wfdownloads/trunk/wfdownloads/images/module_logo.png
Removed Paths:
-------------
XoopsModules/wfdownloads/trunk/wfdownloads/class/wfd_lists.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/about.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/about.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/about.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_footer.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_footer.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_footer.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@@ -37,22 +37,22 @@
include_once dirname(dirname(__FILE__)) . '/include/common.php';
/*$imagearray = array(
- 'editimg' => "<img src='" . $pathIcon16 . '/edit.png'."' alt='" . _AM_WFD_ICO_EDIT . "' title='" . _AM_WFD_ICO_EDIT . "' align='middle'>",
- 'deleteimg' => "<img src='" . $pathIcon16 . '/delete.png'."' alt='" . _AM_WFD_ICO_DELETE . "' title='" . _AM_WFD_ICO_DELETE . "' align='middle'>",
- 'online' => "<img src='" . $pathIcon16 . '/1.png'."' alt='" . _AM_WFD_ICO_ONLINE . "' title='" . _AM_WFD_ICO_ONLINE . "' align='middle'>",
- 'offline' => "<img src='" . $pathIcon16 . '/0.png'."' alt='" . _AM_WFD_ICO_OFFLINE . "' title='" . _AM_WFD_ICO_OFFLINE . "' align='middle'>",
- 'approved' => "<img src='" . $pathIcon16 . '/on.png'."' alt=''" . _AM_WFD_ICO_APPROVED . "' title=''" . _AM_WFD_ICO_APPROVED . "' align='middle'>",
- 'notapproved' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFD_ICO_NOTAPPROVED . "' title='" . _AM_WFD_ICO_NOTAPPROVED . "' align='middle'>",
- 'relatedfaq' => "<img src='../images/icon/link.png' alt='" . _AM_WFD_ICO_LINK . "' title='" . _AM_WFD_ICO_LINK . "' align='middle'>",
- 'relatedurl' => "<img src='../images/icon/world_link.png' alt='" . _AM_WFD_ICO_URL . "' title='" . _AM_WFD_ICO_URL . "' align='middle'>",
- 'addfaq' => "<img src='" . $pathIcon16 . '/add.png'."' alt='" . _AM_WFD_ICO_ADD . "' title='" . _AM_WFD_ICO_ADD . "' align='middle'>",
- 'approve' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFD_ICO_APPROVE . "' title='" . _AM_WFD_ICO_APPROVE . "' align='middle'>",
- 'statsimg' => "<img src='../images/icon/statistics.png' alt='" . _AM_WFD_ICO_STATS . "' title='" . _AM_WFD_ICO_STATS . "' align='middle'>",
- 'ignore' => "<img src='../images/icon/ignore.png' alt='" . _AM_WFD_ICO_IGNORE . "' title='" . _AM_WFD_ICO_IGNORE . "' align='middle'>",
- 'ack_yes' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFD_ICO_ACK . "' title='" . _AM_WFD_ICO_ACK . "' align='middle'>",
- 'ack_no' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFD_ICO_REPORT . "' title='" . _AM_WFD_ICO_REPORT . "' align='middle'>",
- 'con_yes' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFD_ICO_CONFIRM . "' title='" . _AM_WFD_ICO_CONFIRM . "' align='middle'>",
- 'con_no' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFD_ICO_CONBROKEN . "' title='" . _AM_WFD_ICO_CONBROKEN . "' align='middle'>"
+ 'editimg' => "<img src='" . $pathIcon16 . '/edit.png'."' alt='" . _AM_WFDOWNLOADS_ICO_EDIT . "' title='" . _AM_WFDOWNLOADS_ICO_EDIT . "' align='middle'>",
+ 'deleteimg' => "<img src='" . $pathIcon16 . '/delete.png'."' alt='" . _AM_WFDOWNLOADS_ICO_DELETE . "' title='" . _AM_WFDOWNLOADS_ICO_DELETE . "' align='middle'>",
+ 'online' => "<img src='" . $pathIcon16 . '/1.png'."' alt='" . _AM_WFDOWNLOADS_ICO_ONLINE . "' title='" . _AM_WFDOWNLOADS_ICO_ONLINE . "' align='middle'>",
+ 'offline' => "<img src='" . $pathIcon16 . '/0.png'."' alt='" . _AM_WFDOWNLOADS_ICO_OFFLINE . "' title='" . _AM_WFDOWNLOADS_ICO_OFFLINE . "' align='middle'>",
+ 'approved' => "<img src='" . $pathIcon16 . '/on.png'."' alt=''" . _AM_WFDOWNLOADS_ICO_APPROVED . "' title=''" . _AM_WFDOWNLOADS_ICO_APPROVED . "' align='middle'>",
+ 'notapproved' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFDOWNLOADS_ICO_NOTAPPROVED . "' title='" . _AM_WFDOWNLOADS_ICO_NOTAPPROVED . "' align='middle'>",
+ 'relatedfaq' => "<img src='../images/icon/link.png' alt='" . _AM_WFDOWNLOADS_ICO_LINK . "' title='" . _AM_WFDOWNLOADS_ICO_LINK . "' align='middle'>",
+ 'relatedurl' => "<img src='../images/icon/world_link.png' alt='" . _AM_WFDOWNLOADS_ICO_URL . "' title='" . _AM_WFDOWNLOADS_ICO_URL . "' align='middle'>",
+ 'addfaq' => "<img src='" . $pathIcon16 . '/add.png'."' alt='" . _AM_WFDOWNLOADS_ICO_ADD . "' title='" . _AM_WFDOWNLOADS_ICO_ADD . "' align='middle'>",
+ 'approve' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFDOWNLOADS_ICO_APPROVE . "' title='" . _AM_WFDOWNLOADS_ICO_APPROVE . "' align='middle'>",
+ 'statsimg' => "<img src='../images/icon/statistics.png' alt='" . _AM_WFDOWNLOADS_ICO_STATS . "' title='" . _AM_WFDOWNLOADS_ICO_STATS . "' align='middle'>",
+ 'ignore' => "<img src='../images/icon/ignore.png' alt='" . _AM_WFDOWNLOADS_ICO_IGNORE . "' title='" . _AM_WFDOWNLOADS_ICO_IGNORE . "' align='middle'>",
+ 'ack_yes' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFDOWNLOADS_ICO_ACK . "' title='" . _AM_WFDOWNLOADS_ICO_ACK . "' align='middle'>",
+ 'ack_no' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFDOWNLOADS_ICO_REPORT . "' title='" . _AM_WFDOWNLOADS_ICO_REPORT . "' align='middle'>",
+ 'con_yes' => "<img src='" . $pathIcon16 . '/on.png'."' alt='" . _AM_WFDOWNLOADS_ICO_CONFIRM . "' title='" . _AM_WFDOWNLOADS_ICO_CONFIRM . "' align='middle'>",
+ 'con_no' => "<img src='" . $pathIcon16 . '/off.png'."' alt='" . _AM_WFDOWNLOADS_ICO_CONBROKEN . "' title='" . _AM_WFDOWNLOADS_ICO_CONBROKEN . "' align='middle'>"
);*/
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@@ -32,19 +32,19 @@
wfdownloads_xoops_cp_header();
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
- $sform = new XoopsThemeForm(_AM_WFD_CCATEGORY_MOVE, "move", xoops_getenv('PHP_SELF'));
+ $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_CCATEGORY_MOVE, "move", xoops_getenv('PHP_SELF'));
$categories = $wfdownloads->getHandler('category')->getObjects();
$mytree = new XoopsObjectTree($categories, "cid", "pid");
- $sform->addElement(new XoopsFormLabel(_AM_WFD_BMODIFY, $mytree->makeSelBox('target', 'title')));
+ $sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_BMODIFY, $mytree->makeSelBox('target', 'title')));
$create_tray = new XoopsFormElementTray('', '');
$create_tray -> addElement(new XoopsFormHidden('source', $cid));
$create_tray -> addElement(new XoopsFormHidden('ok', true));
$create_tray -> addElement(new XoopsFormHidden('op', 'category.move'));
- $butt_save = new XoopsFormButton('', '', _AM_WFD_BMOVE, 'submit');
+ $butt_save = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BMOVE, 'submit');
$butt_save -> setExtra('onclick="this.form.elements.op.value=\'category.move\'"');
$create_tray -> addElement($butt_save);
- $butt_cancel = new XoopsFormButton('', '', _AM_WFD_BCANCEL, 'submit');
+ $butt_cancel = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BCANCEL, 'submit');
$butt_cancel -> setExtra('onclick="this.form.elements.op.value=\'cancel\'"');
$create_tray -> addElement($butt_cancel);
$sform -> addElement($create_tray);
@@ -54,17 +54,17 @@
$source = WfdownloadsRequest::getInt('source', 0, 'POST');
$target = WfdownloadsRequest::getInt('target', 0, 'POST');
if ($target == $source) {
- redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFD_CCATEGORY_MODIFY_FAILED);
+ redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILED);
}
if (!$target) {
- redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFD_CCATEGORY_MODIFY_FAILEDT);
+ redirect_header($currentFile . "?op=category.move&ok=0&cid={$source}", 5, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_FAILEDT);
}
$result = $wfdownloads->getHandler('download')->updateAll("cid", $target, new Criteria("cid", $source), true);
if (!$result) {
- $error = _AM_WFD_DBERROR;
+ $error = _AM_WFDOWNLOADS_DBERROR;
trigger_error($error, E_USER_ERROR);
}
- redirect_header($currentFile, 1, _AM_WFD_CCATEGORY_MODIFY_MOVED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_CCATEGORY_MODIFY_MOVED);
exit();
}
break;
@@ -92,7 +92,7 @@
$category = $wfdownloads->getHandler('category')->get($cid);
$childcats = $wfdownloads->getHandler('category')->getChildCats($category);
if ($pid == $cid || in_array($pid, array_keys($childcats))) {
- $category->setErrors(_AM_WFD_CCATEGORY_CHILDASPARENT);
+ $category->setErrors(_AM_WFDOWNLOADS_CCATEGORY_CHILDASPARENT);
}
}
@@ -135,9 +135,9 @@
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $newid;
$notification_handler = & xoops_gethandler('notification');
$notification_handler -> triggerEvent('global', 0, 'new_category', $tags);
- $database_mess = _AM_WFD_CCATEGORY_CREATED;
+ $database_mess = _AM_WFDOWNLOADS_CCATEGORY_CREATED;
} else {
- $database_mess = _AM_WFD_CCATEGORY_MODIFIED;
+ $database_mess = _AM_WFDOWNLOADS_CCATEGORY_MODIFIED;
wfdownloads_savePermissions($down_groups, $cid, 'WFDownCatPerm');
wfdownloads_savePermissions($up_groups, $cid, 'WFUpCatPerm');
}
@@ -176,18 +176,18 @@
// all downloads for each category is deleted, now delete the category data
$wfdownloads->getHandler('category')->deleteAll($criteria);
- $error = _AM_WFD_DBERROR;
+ $error = _AM_WFDOWNLOADS_DBERROR;
foreach ($cids as $cid) {
xoops_groupperm_deletebymoditem ($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid);
xoops_groupperm_deletebymoditem ($wfdownloads->getModule() -> mid(), 'WFUpCatPerm', $cid);
}
- redirect_header($currentFile, 1, _AM_WFD_CCATEGORY_DELETED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_CCATEGORY_DELETED);
exit();
} else {
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'category.delete', 'cid' => $cid, 'ok' => true), $currentFile, _AM_WFD_CCATEGORY_AREUSURE);
+ xoops_confirm(array('op' => 'category.delete', 'cid' => $cid, 'ok' => true), $currentFile, _AM_WFDOWNLOADS_CCATEGORY_AREUSURE);
xoops_cp_footer();
}
break;
@@ -200,8 +200,8 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFD_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
- $adminMenu->addItemButton(_AM_WFD_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
+ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
+ $adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
if (isset($_REQUEST['cid'])) {
@@ -223,8 +223,8 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFD_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
- $adminMenu->addItemButton(_AM_WFD_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
+ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
+ $adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
$totalCategories = wfdownloads_categoriesCount();
@@ -234,7 +234,7 @@
$GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML() );
$GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_categorieslist.html");
} else {
- redirect_header("{$currentFile}?op=category.add", 1, _AM_WFD_CCATEGORY_NOEXISTS);
+ redirect_header("{$currentFile}?op=category.add", 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS);
}
include 'admin_footer.php';
break;
@@ -255,7 +255,7 @@
}
unset($category);
}
- redirect_header($currentFile, 1, _AM_WFD_CATEGORIES_REORDERED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_CATEGORIES_REORDERED);
exit();
}
break;
Added: XoopsModules/wfdownloads/trunk/wfdownloads/admin/clone.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/clone.php (rev 0)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/clone.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -0,0 +1,174 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * Wfdownloads module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package wfdownload
+ * @since 3.23
+ * @author Xoops Development Team
+ * @version svn:$id$
+ */
+$currentFile = basename(__FILE__);
+include_once dirname(__FILE__) . '/admin_header.php';
+
+if (@$_POST['op'] == 'submit') {
+ if (!$GLOBALS['xoopsSecurity']->check()) {
+ redirect_header($currentFile, 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
+ exit();
+ }
+
+ $cloneDirname = $_POST['clonedirname'];
+
+ //check if name is valid
+ if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $cloneDirname)) {
+ redirect_header($currentFile, 3, sprintf(_AM_WFDOWNLOADS_CLONE_INVALIDNAME, $cloneDirname));
+ exit();
+ }
+ // Check wether the cloned module exists or not
+ if ($cloneDirname && is_dir(XOOPS_ROOT_PATH . '/modules/' . $cloneDirname)) {
+ redirect_header($currentFile, 3, sprintf(_AM_WFDOWNLOADS_CLONE_EXISTS, $cloneDirname));
+ }
+
+ $patterns = array(
+ strtolower(WFDOWNLOADS_DIRNAME) => strtolower($cloneDirname),
+ strtoupper(WFDOWNLOADS_DIRNAME) => strtoupper($cloneDirname),
+ ucfirst(strtolower(WFDOWNLOADS_DIRNAME)) => ucfirst(strtolower($cloneDirname))
+ );
+
+ $patKeys = array_keys($patterns);
+ $patValues = array_values($patterns);
+ wfdownloads_cloneFileDir(WFDOWNLOADS_ROOT_PATH);
+ $logocreated = wfdownloads_createLogo(strtolower($cloneDirname));
+
+ $message = "";
+ if (is_dir(XOOPS_ROOT_PATH . '/modules/' . strtolower($cloneDirname))) {
+ $message .= sprintf(_AM_WFDOWNLOADS_CLONE_CONGRAT, "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(strtolower($cloneDirname)) . "</a>") . "<br />\n";
+ if (!$logocreated) {
+ $message .= _AM_WFDOWNLOADS_CLONE_IMAGEFAIL;
+ }
+ } else {
+ $message .= _AM_WFDOWNLOADS_CLONE_FAIL;
+ }
+
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation($currentFile);
+ echo $message;
+ include 'admin_footer.php';
+ exit();
+
+} else {
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation($currentFile);
+ include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ $form = new XoopsThemeForm(sprintf(_AM_WFDOWNLOADS_CLONE_TITLE, $wfdownloads->getModule()->getVar('name', 'E')), 'clone', $currentFile, 'post', true);
+ $cloneDirname_text = new XoopsFormText(_AM_WFDOWNLOADS_CLONE_NAME, 'clonedirname', 20, 20, '');
+ $cloneDirname_text->setDescription(_AM_WFDOWNLOADS_CLONE_NAME_DSC);
+ $form->addElement($cloneDirname_text, true);
+ $form->addElement(new XoopsFormHidden('op', 'submit'));
+ $form->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit'));
+ $form->display();
+ include 'admin_footer.php';
+ exit();
+}
+
+
+
+// work around for PHP < 5.0.x
+if (!function_exists('file_put_contents')) {
+ function file_put_contents($filename, $data, $file_append = false)
+ {
+ if ($fp = fopen($filename, (!$file_append ? 'w+' : 'a+'))) {
+ fputs($fp, $data);
+ fclose($fp);
+ }
+ }
+}
+
+// recursive clonning script
+function wfdownloads_cloneFileDir($path)
+{
+ global $patKeys;
+ global $patValues;
+
+ $newPath = str_replace($patKeys[0], $patValues[0], $path);
+
+ if (is_dir($path)) {
+ // create new dir
+ mkdir($newPath);
+ // check all files in dir, and process it
+ if ($handle = opendir($path)) {
+ while ($file = readdir($handle)) {
+ if ($file != '.' && $file != '..' && $file != '.svn') {
+ wfdownloads_cloneFileDir("{$path}/{$file}");
+ }
+ }
+ closedir($handle);
+ }
+ } else {
+ if (preg_match('/(.jpg|.gif|.png|.zip|.ttf)$/i', $path)) {
+ // image
+ copy($path, $newPath);
+ } else {
+ // file, read it
+ $content = file_get_contents($path);
+ $content = str_replace($patKeys, $patValues, $content);
+ file_put_contents($newPath, $content);
+ }
+ }
+}
+
+function wfdownloads_createLogo($dirname)
+{
+ if (!extension_loaded("gd")) {
+ return false;
+ } else {
+ $required_functions = array(
+ "imagecreatetruecolor",
+ "imagecolorallocate",
+ "imagefilledrectangle",
+ "imagejpeg",
+ "imagedestroy",
+ "imageftbbox"
+ );
+ foreach ($required_functions as $func) {
+ if (!function_exists($func)) {
+ return false;
+ }
+ }
+ }
+
+ if (!file_exists($imageBase = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/module_logo.png") || !file_exists($font = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/VeraBd.ttf")) {
+ return false;
+ }
+
+ $imageModule = imagecreatefrompng($imageBase);
+
+ //Erase old text
+ $grey_color = imagecolorallocate($imageModule, 237, 237, 237);
+ imagefilledrectangle($imageModule, 5, 35, 85, 46, $grey_color);
+
+ // Write text
+ $text_color = imagecolorallocate($imageModule, 0, 0, 0);
+ $space_to_border = (80 - strlen($dirname) * 6.5) / 2;
+ imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($dirname), array());
+
+ // Set transparency color
+ $white = imagecolorallocatealpha($imageModule, 255, 255, 255, 127);
+ imagefill($imageModule, 0, 0, $white);
+ imagecolortransparent($imageModule, $white);
+ imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/module_logo.png");
+ imagedestroy($imageModule);
+ return true;
+}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@@ -31,8 +31,8 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFD_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list');
- $adminMenu->addItemButton(_AM_WFD_FFS_DOWNLOADTITLE, "{$currentFile}?op=download.add", 'add');
+ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list');
+ $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, "{$currentFile}?op=download.add", 'add');
echo $adminMenu->renderButton();
$lid = WfdownloadsRequest::getInt('lid', 0);
@@ -40,7 +40,7 @@
$category_count = $wfdownloads->getHandler('category')->getCount();
if ($category_count) {
// Allowed mimetypes list
- echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_FILE_ALLOWEDAMIME . "</legend>\n";
+ echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_FILE_ALLOWEDAMIME . "</legend>\n";
echo "<div style='padding: 8px;'>\n";
$criteria = new Criteria("mime_admin", true);
$mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
@@ -51,21 +51,21 @@
if ($lid) {
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
- redirect_header($currentFile, 4, _AM_WFD_DOWN_ERROR_FILENOTFOUND);
+ redirect_header($currentFile, 4, _AM_WFDOWNLOADS_DOWN_ERROR_FILENOTFOUND);
exit();
}
$cid = $download->getVar('cid');
if(!$category = $wfdownloads->getHandler('category')->get($cid)) {
- redirect_header($currentFile, 4, _AM_WFD_DOWN_ERROR_CATEGORYNOTFOUND);
+ redirect_header($currentFile, 4, _AM_WFDOWNLOADS_DOWN_ERROR_CATEGORYNOTFOUND);
exit();
}
- $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFD_FFS_EDITDOWNLOADTITLE);
+ $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFDOWNLOADS_FFS_EDITDOWNLOADTITLE);
} else {
$download = $wfdownloads->getHandler('download')->create();
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$category = $wfdownloads->getHandler('category')->get($cid);
$download->setVar('cid', $cid);
- $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFD_FFS_DOWNLOADTITLE);
+ $title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFDOWNLOADS_FFS_DOWNLOADTITLE);
}
// Added Formulize module support (2006/05/04) jpc - start
@@ -98,7 +98,7 @@
$sform->display();
// Added Formulize module support (2006/05/04) jpc - end
} else {
- redirect_header('categories.php', 1, _AM_WFD_CCATEGORY_NOEXISTS);
+ redirect_header('categories.php', 1, _AM_WFDOWNLOADS_CCATEGORY_NOEXISTS);
exit();
}
@@ -119,31 +119,31 @@
$anonymousCriteria->setSort('ratingtimestamp');
$anonymousCriteria->setOrder('DESC');
- echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFD_VOTE_RATINGINFOMATION . "</legend>\n";
- echo "<div style='padding: 8px;'><b>" . _AM_WFD_VOTE_TOTALVOTES . "</b>{$votes_count}<br /><br />\n";
+ echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_WFDOWNLOADS_VOTE_RATINGINFOMATION . "</legend>\n";
+ echo "<div style='padding: 8px;'><b>" . _AM_WFDOWNLOADS_VOTE_TOTALVOTES . "</b>{$votes_count}<br /><br />\n";
- printf(_AM_WFD_VOTE_REGUSERVOTES, $votesreg);
+ printf(_AM_WFDOWNLOADS_VOTE_REGUSERVOTES, $votesreg);
echo "<br />";
- printf(_AM_WFD_VOTE_ANONUSERVOTES, $votesanon);
+ printf(_AM_WFDOWNLOADS_VOTE_ANONUSERVOTES, $votesanon);
echo "
</div>\n
<table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
<tr>\n
- <th>" . _AM_WFD_VOTE_USER . "</td>\n
- <th>" . _AM_WFD_VOTE_IP . "</td>\n
- <th>" . _AM_WFD_VOTE_RATING . "</td>\n
- <th>" . _AM_WFD_VOTE_USERAVG . "</td>\n
- <th>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
- <th>" . _AM_WFD_VOTE_DATE . "</td>\n
- <th>" . _AM_WFD_MINDEX_ACTION . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_USER . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_IP . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_RATING . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_USERAVG . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_TOTALRATE . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_DATE . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_MINDEX_ACTION . "</td>\n
</tr>\n
";
if ($votesreg == 0) {
- echo "<tr><td colspan='7' class='even'><b>" . _AM_WFD_VOTE_NOREGVOTES . "</b></td></tr>";
+ echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOREGVOTES . "</b></td></tr>";
} else {
foreach (array_keys($regvotes) as $i) {
$uids[] = $regvotes[$i]->getVar('ratinguser');
@@ -177,17 +177,17 @@
<br />\n
<table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n
<tr>\n
- <th>" . _AM_WFD_VOTE_USER . "</td>\n
- <th>" . _AM_WFD_VOTE_IP . "</td>\n
- <th>" . _AM_WFD_VOTE_RATING . "</td>\n
- <th>" . _AM_WFD_VOTE_USERAVG . "</td>\n
- <th>" . _AM_WFD_VOTE_TOTALRATE . "</td>\n
- <th>" . _AM_WFD_VOTE_DATE . "</td>\n
- <th>" . _AM_WFD_MINDEX_ACTION . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_USER . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_IP . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_RATING . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_USERAVG . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_TOTALRATE . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_VOTE_DATE . "</td>\n
+ <th>" . _AM_WFDOWNLOADS_MINDEX_ACTION . "</td>\n
</tr>\n
";
if ($votesanon == 0) {
- echo "<tr><td colspan='7' class='even'><b>" . _AM_WFD_VOTE_NOUNREGVOTES . "</b></td></tr>";
+ echo "<tr><td colspan='7' class='even'><b>" . _AM_WFDOWNLOADS_VOTE_NOUNREGVOTES . "</b></td></tr>";
} else {
$criteria = new Criteria('ratinguser', 0);
$userratings = $wfdownloads->getHandler('rating')->getUserAverage($criteria);
@@ -289,7 +289,7 @@
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid='{$cid}";
- if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_BOTH) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFDOWNLOADS_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFDOWNLOADS_AUTOAPPROVE_BOTH) {
// Then this change will be automatically approved, so the notification needs to go out.
$notification_handler->triggerEvent('global', 0, 'filemodified', $tags);
$notification_handler->triggerEvent('category', $cid, 'filemodified', $tags);
@@ -330,7 +330,7 @@
if ($lid > 0 && !empty($dhistoryhistory)) {
$dhistory = $dhistory . "\n\n";
$time = time();
- $dhistory .= _AM_WFD_FILE_HISTORYVERS . $version . _AM_WFD_FILE_HISTORDATE . formatTimestamp($time, _DATESTRING) . "\n\n";
+ $dhistory .= _AM_WFDOWNLOADS_FILE_HISTORYVERS . $version . _AM_WFDOWNLOADS_FILE_HISTORDATE . formatTimestamp($time, _DATESTRING) . "\n\n";
$dhistory .= $dhistoryhistory;
}
$download->setVar('dhistory', $dhistory);
@@ -408,7 +408,7 @@
$ownerGroups =& $member_handler->getGroupsByUser($owner, false);
$uid = !empty($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
$groups = $xoopsUser ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
- $entries = handleSubmission($formulize_mgr, $entries, $uid, $owner, $fid, $ownerGroups, $groups, "new"); // "new" causes xoops token check to be skipped, since WF-downloads should be doing that
+ $entries = handleSubmission($formulize_mgr, $entries, $uid, $owner, $fid, $ownerGroups, $groups, "new"); // "new" causes xoops token check to be skipped, since Wfdownloads should be doing that
if(!$owner) {
$id_req = $entries[$fid][0];
$download->setVar('formulize_idreq', $id_req);
@@ -439,8 +439,8 @@
$notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
$notification_handler->triggerEvent('file', $lid, 'approve', $tags);
}
- $message = (!$lid) ? _AM_WFD_FILE_NEWFILEUPLOAD : _AM_WFD_FILE_FILEMODIFIEDUPDATE ;
- $message = ($lid && !$_POST['was_published'] && $approved) ? _AM_WFD_FILE_FILEAPPROVED : $message;
+ $message = (!$lid) ? _AM_WFDOWNLOADS_FILE_NEWFILEUPLOAD : _AM_WFDOWNLOADS_FILE_FILEMODIFIEDUPDATE ;
+ $message = ($lid && !$_POST['was_published'] && $approved) ? _AM_WFDOWNLOADS_FILE_FILEAPPROVED : $message;
redirect_header($currentFile, 1, $message);
break;
@@ -449,7 +449,7 @@
$lid = WfdownloadsRequest::getInt('lid', 0);
$ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
- redirect_header($currentFile, 4, _AM_WFD_ERROR_DOWNLOADNOTFOUND);
+ redirect_header($currentFile, 4, _AM_WFDOWNLOADS_ERROR_DOWNLOADNOTFOUND);
exit();
}
$title = $download->getVar('title');
@@ -463,13 +463,13 @@
@unlink($file);
}
if ($wfdownloads->getHandler('download')->delete($download)) {
- redirect_header($currentFile, 1, sprintf(_AM_WFD_FILE_FILEWASDELETED, $title));
+ redirect_header($currentFile, 1, sprintf(_AM_WFDOWNLOADS_FILE_FILEWASDELETED, $title));
} else {
echo $download->getHtmlErrors();
}
} else {
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'download.delete', 'lid' => $lid, 'ok' => true, 'title' => $title), $currentFile, _AM_WFD_FILE_REALLYDELETEDTHIS . "<br /><br>" . $title, _DELETE);
+ xoops_confirm(array('op' => 'download.delete', 'lid' => $lid, 'ok' => true, 'title' => $title), $currentFile, _AM_WFDOWNLOADS_FILE_REALLYDELETEDTHIS . "<br /><br>" . $title, _DELETE);
xoops_cp_footer();
}
break;
@@ -480,7 +480,7 @@
if ($wfdownloads->getHandler('rating')->delete($rating, true)) {
wfdownloads_updateRating(intval($rating->getVar('lid')));
}
- redirect_header($currentFile, 1, _AM_WFD_VOTE_VOTEDELETED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_VOTE_VOTEDELETED);
break;
// Added Formulize module support (2006/05/04) jpc - start
@@ -507,7 +507,7 @@
case "approve" :
$lid = WfdownloadsRequest::getInt('lid', 0);
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
- redirect_header($currentFile, 4, _AM_WFD_ERROR_DOWNLOADNOTFOUND);
+ redirect_header($currentFile, 4, _AM_WFDOWNLOADS_ERROR_DOWNLOADNOTFOUND);
exit();
}
// Update the database
@@ -531,7 +531,7 @@
if ($download->getVar('notifypub')) {
$notification_handler->triggerEvent('file', $lid, 'approve', $tags);
}
- redirect_header($currentFile, 1, _AM_WFD_SUB_NEWFILECREATED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_SUB_NEWFILECREATED);
break;
case "downloads.list" :
@@ -569,8 +569,8 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFD_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
- $adminMenu->addItemButton(_AM_WFD_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
+ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
+ $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
if ($totalDownloadsCount > 0) {
@@ -752,8 +752,8 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
- $adminMenu->addItemButton(_MI_WFD_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
- $adminMenu->addItemButton(_AM_WFD_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
+ $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
+ $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
// Get ip logs
@@ -772,7 +772,7 @@
if ($lid != 0) {
$download = $wfdownloads->getHandler('download')->get($lid);
$download_array = $download->toArray();
- $download_array['log_title'] = sprintf(_AM_WFD_LOG_FOR_LID, $download_array['title']);
+ $download_array['log_title'] = sprintf(_AM_WFDOWNLOADS_LOG_FOR_LID, $download_array['title']);
$GLOBALS['xoopsTpl']->assign('download', $download_array);
}
@@ -794,7 +794,7 @@
} else {
foreach($ip_logs as $ip_log){
$ip_log_array = $ip_log->toArray();
- $ip_log_array['uname'] = XoopsUserUtility::getUnameFromId($ip_log_array['uid']);//($ip_log_array['uid'] != 0) ? $userList[$ip_log_array['uid']] : _AM_WFD_ANONYMOUS;
+ $ip_log_array['uname'] = XoopsUserUtility::getUnameFromId($ip_log_array['uid']);//($ip_log_array['uid'] != 0) ? $userList[$ip_log_array['uid']] : _AM_WFDOWNLOADS_ANONYMOUS;
$ip_log_array['date_timestamp'] = formatTimestamp($ip_log_array['date']);
$GLOBALS['xoopsTpl']->append('ip_logs', $ip_log_array);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@@ -26,7 +26,7 @@
case "image.upload" :
if ($_FILES['uploadfile']['name'] != "") {
if (file_exists(XOOPS_ROOT_PATH . '/' . $_POST['uploadpath'] . '/' . $_FILES['uploadfile']['name'])) {
- redirect_header($currentFile, 2, _AM_WFD_DOWN_IMAGEEXIST);
+ redirect_header($currentFile, 2, _AM_WFDOWNLOADS_DOWN_IMAGEEXIST);
}
$allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
$maxFileSize = $wfdownloads->getConfig('maxfilesize');
@@ -39,10 +39,10 @@
include_once WFDOWNLOADS_ROOT_PATH . '/class/img_uploader.php';
$uploader = new XoopsMediaImgUploader($uploadDir . '/', $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
- redirect_header($currentFile, 2 , _AM_WFD_DOWN_IMAGEUPLOAD);
+ redirect_header($currentFile, 2 , _AM_WFDOWNLOADS_DOWN_IMAGEUPLOAD);
exit();
} else {
- redirect_header($currentFile, 2 , _AM_WFD_DOWN_NOIMAGEEXIST);
+ redirect_header($currentFile, 2 , _AM_WFDOWNLOADS_DOWN_NOIMAGEEXIST);
exit();
}
break;
@@ -55,26 +55,26 @@
if (file_exists($fileToDelete)) {
chmod($fileToDelete, 0666);
if (@unlink($fileToDelete)) {
- redirect_header($currentFile, 1, _AM_WFD_DOWN_FILEDELETED);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_DOWN_FILEDELETED);
} else {
- redirect_header($currentFile, 1, _AM_WFD_DOWN_FILEERRORDELETE);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_DOWN_FILEERRORDELETE);
}
}
exit();
} else {
if (empty($_POST['downfile'])) {
- redirect_header($currentFile, 1, _AM_WFD_DOWN_NOFILEERROR);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_DOWN_NOFILEERROR);
exit();
}
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'image.delete', 'uploadpath' => $_POST['uploadpath'], 'downfile' => $_POST['downfile'], 'ok' => true), $currentFile, _AM_WFD_DOWN_DELETEFILE . "<br /><br />" . $_POST['downfile'], _AM_WFD_BDELETE);
+ xoops_confirm(array('op' => 'image.delete', 'uploadpath' => $_POST['uploadpath'], 'downfile' => $_POST['downfile'], 'ok' => true), $currentFile, _AM_WFDOWNLOADS_DOWN_DELETEFILE . "<br /><br />" . $_POST['downfile'], _AM_WFDOWNLOADS_BDELETE);
include 'admin_footer.php';
}
break;
case "images.list" :
default:
- include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
+ include_once WFDOWNLOADS_ROOT_PATH . '/class/wfdownloads_lists.php';
$displayImage = '';
$rootPath = WfdownloadsRequest::getInt('rootpath', 0);
@@ -89,44 +89,44 @@
3 => $wfdownloads->getConfig('mainimagedir')
);
$nameArray = array(
- 1 => _AM_WFD_DOWN_CATIMAGE ,
- 2 => _AM_WFD_DOWN_SCREENSHOTS,
- 3 => _AM_WFD_DOWN_MAINIMAGEDIR
+ 1 => _AM_WFDOWNLOADS_DOWN_CATIMAGE ,
+ 2 => _AM_WFDOWNLOADS_DOWN_SCREENSHOTS,
+ 3 => _AM_WFDOWNLOADS_DOWN_MAINIMAGEDIR
);
$listArray = array(
- 1 => _AM_WFD_DOWN_FCATIMAGE ,
- 2 => _AM_WFD_DOWN_FSCREENSHOTS,
- 3 => _AM_WFD_DOWN_FMAINIMAGEDIR
+ 1 => _AM_WFDOWNLOADS_DOWN_FCATIMAGE ,
+ 2 => _AM_WFDOWNLOADS_DOWN_FSCREENSHOTS,
+ 3 => _AM_WFDOWNLOADS_DOWN_FMAINIMAGEDIR
);
$pathList = (isset($listArray[$rootPath])) ? $nameArray[$rootPath] : '';
$nameList = (isset($listArray[$rootPath])) ? $nameArray[$rootPath] : '';
- $iform = new XoopsThemeForm(_AM_WFD_DOWN_FUPLOADIMAGETO . $pathList, "op", xoops_getenv('PHP_SELF'));
+ $iform = new XoopsThemeForm(_AM_WFDOWNLOADS_DOWN_FUPLOADIMAGETO . $pathList, "op", xoops_getenv('PHP_SELF'));
$iform->setExtra('enctype="multipart/form-data"');
$iform->addElement(new XoopsFormHidden('dir', $rootPath));
ob_start();
echo "<select size='1' name='workd' onchange='location.href=\"{$currentFile}?rootpath=\"+this.options[this.selectedIndex].value'>";
- echo "<option value=''>" . _AM_WFD_DOWN_FOLDERSELECTION . "</option>";
+ echo "<option value=''>" . _AM_WFDOWNLOADS_DOWN_FOLDERSELECTION . "</option>";
foreach($nameArray as $namearray => $workd) {
$opt_selected = ($workd == $nameList) ? 'selected' : '';
echo "<option value='" . htmlspecialchars($namearray, ENT_QUOTES) . "' {$opt_selected}>{$workd}</option>";
}
echo "</select>";
- $iform->addElement(new XoopsFormLabel(_AM_WFD_DOWN_FOLDERSELECTION, ob_get_contents()));
+ $iform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FOLDERSELECTION, ob_get_contents()));
ob_end_clean();
if ($rootPath > 0) {
- $iform->addElement(new XoopsFormLabel(_AM_WFD_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $dirArray[$rootPath]));
- $iform->addElement(new XoopsFormLabel(_AM_WFD_DOWN_FUPLOADURL, XOOPS_URL . '/' . $dirArray[$rootPath]));
+ $iform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $dirArray[$rootPath]));
+ $iform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADURL, XOOPS_URL . '/' . $dirArray[$rootPath]));
$graph_array = WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $dirArray[$rootPath], $type = "images");
$indeximage_select = new XoopsFormSelect('', 'downfile', '');
$indeximage_select->addOptionArray($graph_array);
$indeximage_select->setExtra("onchange='showImgSelected(\"image\", \"downfile\", \"" . $dirArray[$rootPath] . "\", \"\", \"" . XOOPS_URL . "\")'");
- $indeximage_tray = new XoopsFormElementTray(_AM_WFD_DOWN_FSHOWSELECTEDIMAGE, ' ');
+ $indeximage_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_DOWN_FSHOWSELECTEDIMAGE, ' ');
$indeximage_tray->addElement($indeximage_select);
if (!empty($_REQUEST['downfile'])) {
$indeximage_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . '/' . $dirArray[$rootPath] . '/' . $_REQUEST['downfile'] . "' name='image' id='image' alt='' title='image' />"));
@@ -135,17 +135,17 @@
}
$iform->addElement($indeximage_tray);
- $iform->addElement(new XoopsFormFile(_AM_WFD_DOWN_FUPLOADIMAGE, 'uploadfile', 0));
+ $iform->addElement(new XoopsFormFile(_AM_WFDOWNLOADS_DOWN_FUPLOADIMAGE, 'uploadfile', 0));
$iform->addElement(new XoopsFormHidden('uploadpath', $dirArray[$rootPath]));
$iform->addElement(new XoopsFormHidden('rootnumber', $rootPath));
$dup_tray = new XoopsFormElementTray('', '');
$dup_tray->addElement(new XoopsFormHidden('op', 'upload'));
- $butt_dup = new XoopsFormButton('', '', _AM_WFD_BUPLOAD, 'submit');
+ $butt_dup = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BUPLOAD, 'submit');
$butt_dup->setExtra('onclick="this.form.elements.op.value=\'image.upload\'"');
$dup_tray->addElement($butt_dup);
- $butt_dupct = new XoopsFormButton('', '', _AM_WFD_BDELETEIMAGE, 'submit');
+ $butt_dupct = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BDELETEIMAGE, 'submit');
$butt_dupct->setExtra('onclick="this.form.elements.op.value=\'image.delete\'"');
$dup_tray->addElement($butt_dupct);
$iform->addElement($dup_tray);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-09-20 00:06:19 UTC (rev 12068)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-09-20 19:48:41 UTC (rev 12069)
@@ -9,7 +9,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * WF-Downloads module
+ * Wfdownloads module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
@@ -35,11 +35,11 @@
// Import data from MyDownloads
import_mydownloads_to_wfdownloads();
// Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_IMPORT_IMPORT_OK);
exit();
} else {
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.MyDownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_confirm(array('op' => 'import.MyDownloads', 'ok' => true), $currentFile, _AM_WFDOWNLOADS_IMPORT_RUSURE);
xoops_cp_footer();
}
break;
@@ -54,11 +54,11 @@
// Import data from PD-Downloads
import_pddownloads_to_wfdownloads();
// Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_IMPORT_IMPORT_OK);
exit();
} else {
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.PD-Downloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_confirm(array('op' => 'import.PD-Downloads', 'ok' => true), $currentFile, _AM_WFDOWNLOADS_IMPORT_RUSURE);
xoops_cp_footer();
}
break;
@@ -73,15 +73,34 @@
// Import data from wmpownloads
import_wmpdownloads_to_wfdownloads();
// Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_IMPORT_IMPORT_OK);
exit();
} else {
wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.wmpownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_confirm(array('op' => 'import.wmpownloads', 'ok' => true), $currentFile, _AM_WFDOWNLOADS_IMPORT_RUSURE);
xoops_cp_footer();
}
break;
+ case "import.wfd322" :
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
+ if ($ok == true) {
+ // Make sure that nohtml is properly changed to dohtml
+ invert_nohtm_dohtml_values();
+ // Ensure that the proper tables are present
+ update_tables_to_300();
+ // Import data from wmpownloads
+ import_wfd_to_wfdownloads();
+ // Downloads imported
+ redirect_header($currentFile, 1, _AM_WFDOWNLOADS_IMPORT_IMPORT_OK);
+ exit();
+ } else {
+ wfdownloads_xoops_cp_header();
+ xoops_confirm(array('op' => 'import.wfdownloads', 'ok' => true), $currentFile, _AM_WFDOWNLOADS_IMPORT_RUSURE);
+ xoops_cp_footer();
+ }
+ break;
+
case "import.menu" :
default:
wfdownloads_xoops_cp_header();
@@ -91,42 +110,57 @@
//ask what to do
include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
- $form = new XoopsThemeForm(_AM_WFD_IMPORT_BUTTON_IMPORT, "form", $_SERVER['REQUEST_URI']);
+ $form = new XoopsThemeForm(_AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, "form", $_SERVER['REQUEST_URI']);
+ // Avoid module to import form itself
+ //Is wfdownloads installed?
+ if ($wfdownloads->getModule()->dirname() != "wf"."downloads") {
+ $got_options = false;
+ if (wfdownloads_checkModule('wf'.'downloads')) {
+ $moduleVersion = round(wfdownloads_checkModule('wf'.'downloads') / 100, 2);
+ $wfdButton = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_WFD . '<br />' . $moduleVersion, "wmp_button", _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, "submit");
+ $wfdButton->setExtra("onclick='document.forms.form.op.value=\"import.wfd322\"'");
+ $form->addElement($wfdButton);
+ } else {
+ $wfdLabel = new XoopsFormLabel(_AM_WFDOWNLOADS_IMPORT_WFD, _AM_WFDOWNLOADS_IMPORT_WFD_NOTFOUND);
+ $form->addElement($wfdLabel);
+ }
+ }
+
//Is MyDownloads installed?
- $mydownloadsModule = $module_handler->getByDirname("mydownloads");
$got_options = false;
- if (is_object($mydownloadsModule)) {
- $mydownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_MYDOWNLOADS, "myd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
- $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.MyDownloads\"'");
- $form->addElement($mydownloadsButton);
+ if (wfdownloads_checkModule('mydownloads')) {
+ $moduleVersion = round(wfdownloads_checkModule('mydownloads') / 100, 2);
+ $sourceButton = new XoopsFormButton(_AM_WFDOWNLOADS_IMPORT_MYDOWNLOADS . '<br />' . $moduleVersion, "myd_button", _AM_WFDOWNLOADS_IMPORT_BUTTON_IMPORT, "submit");
+ $sourceButton->setExtra("onclick='document.forms.form.op.value=\"import.MyDownloads\"'");
+ $form->addElement($sourceButton);
} else {
- $mydownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_MYDOWNLOADS, _AM_WFD_IMPORT_MYDOWNLOADS_NOTFOUND);
- $form->addElement($mydownloadsLabel);
+ $sourceLabel = new XoopsFormLabel(_AM_WFDOWNLOADS_IMPORT_MYDOWNLOADS, _AM_WFDOWNLOADS_IMPORT_MYDOWNLOADS_NOTFOUND);
+ $form->addElement($sourceLabel);
}
//Is PD-Downloads installed?
- $PDdownloadsModule = $module_handler->getByDirname("PDdownloads");
$got_options = false;
- if (is_object($PDdownloadsModule)) {
- $pddownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_PDDOWNLOADS, "pd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
- $pddownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.PD-Download...
[truncated message content] |