|
From: <luc...@us...> - 2013-08-31 22:17:34
|
Revision: 11993
http://sourceforge.net/p/xoops/svn/11993
Author: luciorota
Date: 2013-08-31 22:17:30 +0000 (Sat, 31 Aug 2013)
Log Message:
-----------
Modified Paths:
--------------
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/mimetypes.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.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/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/newlist.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/topten.php
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -25,9 +25,9 @@
switch ($op) {
case "category.move":
case "move":
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if ($ok == false) {
- $cid = wfdownloads_CleanVars($_REQUEST, 'cid', 0, 'int');
+ $cid = WfdownloadsRequest::getInt('cid', 0);
wfdownloads_xoops_cp_header();
@@ -51,8 +51,8 @@
$sform -> display();
xoops_cp_footer();
} else {
- $source = wfdownloads_CleanVars($_POST, 'source', 0, 'int');
- $target = wfdownloads_CleanVars($_POST, 'target', 0, 'int');
+ $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);
}
@@ -71,7 +71,7 @@
case "category.save" :
case "addCat" :
- $cid = wfdownloads_CleanVars($_POST, 'cid', 0, 'int');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
$up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
$pid = (isset($_POST["pid"])) ? (int)$_POST["pid"] : 0;
@@ -148,8 +148,8 @@
case "category.delete" :
case "del" :
- $cid = wfdownloads_CleanVars($_REQUEST, 'cid', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $cid = WfdownloadsRequest::getInt('cid', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
$categories = $wfdownloads->getHandler('category')->getObjects();
$mytree = new XoopsObjectTree($categories, "cid", "pid");
if ($ok == true) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -44,8 +44,8 @@
break;
case "download.delete":
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $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);
exit();
@@ -103,7 +103,7 @@
case "newdownload.approve":
case "approve":
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $lid = WfdownloadsRequest::getInt('lid', 0);
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_DOWNLOADNOTFOUND);
exit();
@@ -138,11 +138,11 @@
$categories = $wfdownloads->getHandler('category')->getObjects();
- $start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
- $start_new = wfdownloads_CleanVars($_GET, 'start_new', 0, 'int');
- $start_autopublished = wfdownloads_CleanVars($_GET, 'start_autopublished', 0, 'int');
- $start_expired = wfdownloads_CleanVars($_GET, 'start_expired', 0, 'int');
- $start_offline = wfdownloads_CleanVars($_GET, 'start_offline', 0, 'int');
+ $start_published = WfdownloadsRequest::getInt('start_published', 0);
+ $start_new = WfdownloadsRequest::getInt('start_new', 0);
+ $start_autopublished = WfdownloadsRequest::getInt('start_autopublished', 0);
+ $start_expired = WfdownloadsRequest::getInt('start_expired', 0);
+ $start_offline = WfdownloadsRequest::getInt('start_offline', 0);
$totalcats = wfd_totalcategory();
$categories = $wfdownloads->getHandler('category')->getObjects(null, true, false);
@@ -299,10 +299,10 @@
$member_handler = xoops_gethandler('member');
$notification_handler = xoops_gethandler('notification');
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $lid = WfdownloadsRequest::getInt('lid', 0);
- $numrows = $wfdownloads->getHandler('category')->getCount();
- if ($numrows) {
+ $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 "<div style='padding: 8px;'>\n";
@@ -326,14 +326,16 @@
$title = preg_replace("/{category}/", $category->getVar('title'), _AM_WFD_FFS_EDITDOWNLOADTITLE);
} else {
$download = $wfdownloads->getHandler('download')->create();
- $cid = wfdownloads_CleanVars($_POST, 'cid', 0, 'int');
+ $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);
}
// Added Formulize module support (2006/05/04) jpc - start
- if ((isset($_POST['submit_category']) && !empty($_POST['submit_category'])) || $lid) {
+ if (!wfdownload_checkModule('formulize')) {
+ $sform = $download->getAdminForm($title);
+ } elseif ((isset($_POST['submit_category']) && !empty($_POST['submit_category'])) || $lid) {
$fid = $category->getVar('formulize_fid');
$customArray = array();
if($fid) {
@@ -354,11 +356,9 @@
$customArray['owner_groups'] = $owner_groups;
}
$sform = $download->getAdminForm($title, $customArray);
- } elseif(file_exists(XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php")) {
+ } else {
$sform = $download->getCategoryForm();
- } else {
- $sform = $download->getAdminForm($title);
- }
+ }
$sform->display();
// Added Formulize module support (2006/05/04) jpc - end
} else {
@@ -557,7 +557,7 @@
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid='{$cid}";
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_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);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -48,7 +48,7 @@
break;
case "image.delete" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if ($ok == true) {
$fileToDelete = XOOPS_ROOT_PATH . "/" . $_POST['uploadpath'] . "/" . $_POST['downfile'];
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -26,7 +26,7 @@
$op = WfdownloadsRequest::getString('op', 'import.menu');
switch ($op) {
case "import.MyDownloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if ($ok == true) {
// Make sure that nohtml is properly changed to dohtml
invert_nohtm_dohtml_values();
@@ -45,7 +45,7 @@
break;
case "import.PD-Downloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if ($ok == true) {
// Make sure that nohtml is properly changed to dohtml
invert_nohtm_dohtml_values();
@@ -64,7 +64,7 @@
break;
case "import.wmpownloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if ($ok == true) {
// Make sure that nohtml is properly changed to dohtml
invert_nohtm_dohtml_values();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -76,7 +76,7 @@
break;
case "mimetype.save":
- $mime_id = wfdownloads_CleanVars($_POST, 'mime_id', 0, 'int');
+ $mime_id = WfdownloadsRequest::getInt('mime_id', 0, 'POST');
if (!$mimetype = $wfdownloads->getHandler('mimetype')->get($mime_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIMETYPENOTFOUND);
exit();
@@ -96,7 +96,7 @@
break;
case "mimetype.update":
- $mime_id = wfdownloads_CleanVars($_REQUEST, 'mime_id', 0, 'int');
+ $mime_id = WfdownloadsRequest::getInt('mime_id', 0);
if (!$mimetype = $wfdownloads->getHandler('mimetype')->get($mime_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIMETYPENOTFOUND);
exit();
@@ -143,8 +143,8 @@
break;
case "mimetype.delete":
- $mime_id = wfdownloads_CleanVars($_REQUEST, 'mime_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $mime_id = WfdownloadsRequest::getInt('mime_id', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$mimetype = $wfdownloads->getHandler('mimetype')->get($mime_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIMETYPENOTFOUND);
exit();
@@ -169,7 +169,7 @@
case "mimetypes.list":
default:
- $start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
+ $start = WfdownloadsRequest::getInt('start', 0);
$criteria = new CriteriaCompo();
$criteria->setSort("mime_name");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -24,8 +24,8 @@
$op = WfdownloadsRequest::getString('op', 'mirrors.list');
switch ($op) {
case "mirror.delete":
- $mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $mirror_id = WfdownloadsRequest::getInt('mirror_id', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
@@ -49,8 +49,8 @@
break;
case "mirror.approve":
- $mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $mirror_id = WfdownloadsRequest::getInt('mirror_id', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
@@ -68,7 +68,7 @@
break;
case "mirror.edit":
- $mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
+ $mirror_id = WfdownloadsRequest::getInt('mirror_id', 0);
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
@@ -80,7 +80,7 @@
break;
case "mirror.save":
- $mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
+ $mirror_id = WfdownloadsRequest::getInt('mirror_id', 0);
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
@@ -102,8 +102,8 @@
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
- $start_waiting = wfdownloads_CleanVars($_GET, 'start_waiting', 0, 'int');
- $start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
+ $start_waiting = WfdownloadsRequest::getInt('start_waiting', 0);
+ $start_published = WfdownloadsRequest::getInt('start_published', 0);
$criteria_waiting = new Criteria("submit", 0); // false
$waiting_count = $wfdownloads->getHandler('mirror')->getCount($criteria_waiting);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -24,8 +24,8 @@
$op = WfdownloadsRequest::getString('op', 'votes.list');
switch ($op) {
case "vote.delete":
- $rid = wfdownloads_CleanVars($_GET, 'rid', null, 'int');
- $lid = wfdownloads_CleanVars($_GET, 'lid', null, 'int');
+ $rid = WfdownloadsRequest::getInt('rid', 0);
+ $lid = WfdownloadsRequest::getInt('lid', 0);
$wfdownloads->getHandler('rating')->deleteAll(new Criteria("ratingid", $rid), true);
wfd_updaterating($lid);
redirect_header($currentFile, 1, _AM_WFD_VOTEDELETED);
@@ -33,7 +33,7 @@
case "votes.list":
default:
- $start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
+ $start = WfdownloadsRequest::getInt('start', 0);
$useravgrating = '0';
$uservotes = '0';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -24,7 +24,7 @@
$op = WfdownloadsRequest::getString('op', 'reports.modifications.list');
switch ($op) {
case "reports.update":
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
if (isset($_GET['ack'])) {
$acknowledged = (isset($_GET['ack']) && $_GET['ack'] == 0) ? 1 : 0;
@@ -40,7 +40,7 @@
break;
case "report.delete":
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
if (isset($report[0])) {
@@ -52,7 +52,7 @@
break;
case "report.ignore":
- $lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
+ $lid = WfdownloadsRequest::getInt('lid', 0);
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
if (isset($report[0])) {
@@ -274,7 +274,7 @@
case "reports.modifications.list":
default:
- $start_report = wfdownloads_CleanVars($_GET, 'start_report', 0, 'int');
+ $start_report = WfdownloadsRequest::getInt('start_report', 0);
$criteria = new CriteriaCompo();
$reports_count = $wfdownloads->getHandler('report')->getCount();
@@ -330,7 +330,7 @@
$GLOBALS['xoopsTpl']->assign('reports_pagenav', $pagenav_report -> renderNav());
}
- $start_modification = wfdownloads_CleanVars($_GET, 'start_modification', 0, 'int');
+ $start_modification = WfdownloadsRequest::getInt('start_modification', 0);
$modifications_count = $wfdownloads->getHandler('modification')->getCount();
$criteria = new CriteriaCompo();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -24,8 +24,8 @@
$op = WfdownloadsRequest::getString('op', 'reviews.list');
switch ($op) {
case "review.delete":
- $review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $review_id = WfdownloadsRequest::getInt('review_id', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$review = $wfdownloads->getHandler('review')->get($review_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
@@ -49,8 +49,8 @@
break;
case "review.approve":
- $review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ $review_id = WfdownloadsRequest::getInt('review_id', 0);
+ $ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$review = $wfdownloads->getHandler('review')->get($review_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
@@ -68,7 +68,7 @@
break;
case "review.edit":
- $review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
+ $review_id = WfdownloadsRequest::getInt('review_id', 0);
if (!$review = $wfdownloads->getHandler('review')->get($review_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
@@ -82,7 +82,7 @@
break;
case "review.save":
- $review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
+ $review_id = WfdownloadsRequest::getInt('review_id', 0);
if (!$review = $wfdownloads->getHandler('review')->get($review_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
@@ -98,8 +98,8 @@
case "reviews.list":
default:
- $start_waiting = wfdownloads_CleanVars($_GET, 'start_waiting', 0, 'int');
- $start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
+ $start_waiting = WfdownloadsRequest::getInt('start_waiting', 0);
+ $start_published = WfdownloadsRequest::getInt('start_published', 0);
$criteria_waiting = new Criteria("submit", 0); // false
$waiting_count = $wfdownloads->getHandler('review')->getCount();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -90,9 +90,9 @@
$use_mirrors = $wfdownloads->getConfig('enable_mirrors');
$add_mirror = 0;
- if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == 3 || $wfdownloads->getConfig('anonpost') == 4) && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4) && $use_mirrors == 1) {
+ if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_MIRROR || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH) && $use_mirrors == true) {
$add_mirror = 1;
- } elseif (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4 || $xoopsUser->isAdmin()) && $use_mirrors == 1) {
+ } elseif (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || $xoopsUser->isAdmin()) && $use_mirrors == true) {
$add_mirror = 1;
}
$down['add_mirror'] = $add_mirror;
@@ -166,7 +166,7 @@
} else {
$down['homepage'] = '';
}
- if ($use_mirrors !== 1) {
+ if ($use_mirrors !== true) {
$down['mirror'] = ($this->getVar('mirror') == "http://") ? '' : trim($this->getVar('mirror'));
if ($down['mirror'] && !empty($down['mirror'])) {
$down['mirror'] = "<a href='" . $down['mirror'] . "' target='_blank'>" . _MD_WFD_MIRRORSITE . "</a>";
@@ -312,9 +312,19 @@
$sform->addElement(new XoopsFormHidden('filetype', $this->getVar('filetype', 'e')));
}
if (($wfdownloads->getConfig('useruploads') && array_intersect($wfdownloads->getConfig('useruploadsgroup'), $groups)) || (is_object($xoopsUser) && $xoopsUser->isAdmin()) ) {
- $sform->addElement(new XoopsFormFile(_MD_WFD_UPLOAD_FILEC, 'userfile', 0), false);
+ $userfile_file = new XoopsFormFile(_MD_WFD_UPLOAD_FILEC, 'userfile', 0);
+ $maxFileSize = wfdownloads_bytesToSize1024($wfdownloads->getConfig('maxfilesize'));
+ if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
+ $criteria = new Criteria("mime_admin", true);
+ } else {
+ $criteria = new Criteria("mime_user", true);
+ }
+ $mimetypes = $wfdownloads->getHandler('mimetype')->getList($criteria);
+ $allowMimetypes = implode(' | ', $mimetypes);
+ $userfile_file->setDescription(sprintf(_MD_WFD_UPLOAD_FILEC_DESC, $maxFileSize, $wfdownloads->getConfig('maximgwidth'), $wfdownloads->getConfig('maximgheight'), $allowMimetypes));
+ $sform->addElement($userfile_file, false);
}
- if ($use_mirrors !== 1) {
+ if ($use_mirrors !== true) {
$sform->addElement(new XoopsFormText(_MD_WFD_MIRROR, 'mirror', 50, 255, $this->getVar('mirror', 'e')), false);
}
@@ -323,8 +333,8 @@
$sform->addElement(new XoopsFormHidden('cid', $this->getVar('cid', 'e')));
} else {
$categories = $wfdownloads->getHandler('category')->getUserUpCategories();
- $mytree = new XoopsObjectTree($categories, "cid", "pid");
- $sform->addElement(new XoopsFormLabel(_MD_WFD_CATEGORYC, $mytree->makeSelBox('cid', 'title', "-", $this->getVar('cid', 'e'))));
+ $categoriesTree = new XoopsObjectTree($categories, "cid", "pid");
+ $sform->addElement(new XoopsFormLabel(_MD_WFD_CATEGORYC, $categoriesTree->makeSelBox('cid', 'title', "-", $this->getVar('cid', 'e'))));
}
// changed - end - March 4 2006 - jpc
@@ -359,8 +369,12 @@
$sform->addElement(new XoopsFormText(_MD_WFD_PRICEC, 'price', 10, 20, $this->getVar('price', 'e')), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_WFD_SUMMARY, 'summary', $this->getVar('summary', 'e'), 10, 60, 'smartHiddenSummary'), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_WFD_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60, 'smartHiddenDescription'), true);
- $sform->addElement(new XoopsFormTextArea(_MD_WFD_KEYFEATURESC, 'features', $this->getVar('features', 'e'), 7, 60), false);
- $sform->addElement(new XoopsFormTextArea(_MD_WFD_REQUIREMENTSC, 'requirements', $this->getVar('requirements', 'e'), 7, 60), false);
+ $features_textarea = new XoopsFormTextArea(_MD_WFD_KEYFEATURESC, 'features', $this->getVar('features', 'e'), 7, 60);
+ $features_textarea->setDescription(_MD_WFD_KEYFEATURESC_DESC);
+ $sform->addElement($features_textarea, false);
+ $requirements_textarea = new XoopsFormTextArea(_MD_WFD_REQUIREMENTSC, 'requirements', $this->getVar('requirements', 'e'), 7, 60);
+ $requirements_textarea->setDescription(_MD_WFD_REQUIREMENTSC_DESC);
+ $sform->addElement($requirements_textarea, false);
} else { // if we are using a custom form, then add in the form's elements here
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_WFD_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60, 'smartHiddenDescription'), true);
$sform -> addElement(new XoopsFormHidden('size', $this->getVar('size', 'e')));
@@ -370,7 +384,9 @@
$sform->addElement(new XoopsFormTextArea(_MD_WFD_HISTORYC, 'dhistory', $this->getVar('dhistory', 'e'), 7, 60), false);
if (!$this->isNew() && $this->getVar('dhistory', 'n') != "") {
- $sform->addElement(new XoopsFormTextArea(_MD_WFD_HISTORYD, 'dhistoryaddedd', "", 7, 60), false);
+ $dhistoryaddedd_textarea = new XoopsFormTextArea(_MD_WFD_HISTORYD, 'dhistoryaddedd', "", 7, 60);
+ $dhistoryaddedd_textarea->setDescription(_MD_WFD_HISTORYD_DESC);
+ $sform->addElement($dhistoryaddedd_textarea, false);
}
if (($wfdownloads->getConfig('useruploads') && array_intersect($wfdownloads->getConfig('useruploadsgroup'), $groups)) || (is_object($xoopsUser) && $xoopsUser->isAdmin()) ) {
$sform->addElement(new XoopsFormFile(_MD_WFD_DUPLOADSCRSHOT, 'screenshot', 0), false);
@@ -450,7 +466,7 @@
$sform -> addElement($filename_tray, false);
*/
$sform -> addElement(new XoopsFormText(_AM_WFD_FILE_FILETYPE, 'filetype', 50, 100, $this->getVar('filetype', 'e')), false);
- if ($use_mirrors !== 1) {
+ if ($use_mirrors !== true) {
$sform -> addElement(new XoopsFormText(_AM_WFD_FILE_MIRRORURL, 'mirror', 50, 255, $this->getVar('mirror', 'e')), false);
}
$sform -> addElement(new XoopsFormFile(_AM_WFD_FILE_DUPLOAD, 'userfile', 0), false);
@@ -461,8 +477,8 @@
// $sform->addElement(new XoopsFormHidden('cid', $this->getVar('cid', 'e')));
// } else {
$categories = $wfdownloads->getHandler('category')->getObjects();
- $mytree = new XoopsObjectTree($categories, "cid", "pid");
- $sform->addElement(new XoopsFormLabel(_AM_WFD_FILE_CATEGORY, $mytree->makeSelBox('cid', 'title', "-", $this->getVar('cid', 'e'))));
+ $categoriesTree = new XoopsObjectTree($categories, "cid", "pid");
+ $sform->addElement(new XoopsFormLabel(_AM_WFD_FILE_CATEGORY, $categoriesTree->makeSelBox('cid', 'title', "-", $this->getVar('cid', 'e'))));
// }
// changed - end - March 4 2006 - jpc
@@ -716,8 +732,8 @@
$sform->setExtra('enctype="multipart/form-data"');
$categories = $wfdownloads->getHandler('category')->getUserUpCategories();
- $mytree = new XoopsObjectTree($categories, 'cid', 'pid');
- $sform->addElement(new XoopsFormLabel(_MD_WFD_CATEGORYC, $mytree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e'))));
+ $categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
+ $sform->addElement(new XoopsFormLabel(_MD_WFD_CATEGORYC, $categoriesTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e'))));
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormButton('', 'submit_category', _SUBMIT, 'submit'));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/constants.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -18,3 +18,25 @@
* @author Xoops Development Team
* @version svn:$id$
*/
+// CONFIG displayicons
+define("_WFD_DISPLAYICONS_ICON", 1);
+define("_WFD_DISPLAYICONS_TEXT", 2);
+define("_WFD_DISPLAYICONS_NO", 3);
+
+// CONFIG submissions
+define("_WFD_SUBMISSIONS_NONE", 1);
+define("_WFD_SUBMISSIONS_DOWNLOAD", 2);
+define("_WFD_SUBMISSIONS_MIRROR", 3);
+define("_WFD_SUBMISSIONS_BOTH", 4);
+
+// CONFIG anonpost
+define("_WFD_ANONPOST_NONE", 1);
+define("_WFD_ANONPOST_DOWNLOAD", 2);
+define("_WFD_ANONPOST_MIRROR", 3);
+define("_WFD_ANONPOST_BOTH", 4);
+
+// CONFIG autoapprove
+define("_WFD_AUTOAPPROVE_NONE", 1);
+define("_WFD_AUTOAPPROVE_DOWNLOAD", 2);
+define("_WFD_AUTOAPPROVE_MIRROR", 3);
+define("_WFD_AUTOAPPROVE_BOTH", 4);
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -642,18 +642,18 @@
$wfdownloads = WfdownloadsWfdownloads::getInstance();
$submissions = 0;
- if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == 2 || $wfdownloads->getConfig('submissions') == 4)) {
+ if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_DOWNLOAD || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH)) {
$groups = $xoopsUser->getGroups();
if (array_intersect($wfdownloads->getConfig('submitarts'), $groups)) {
$submissions = 1;
}
- } elseif (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == 2 || $wfdownloads->getConfig('anonpost') == 4)) {
+ } elseif (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_DOWNLOAD || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH)) {
$submissions = 1;
}
$toolbar = "[ ";
if ($submissions == 1) {
- $category_suffix = (!empty($_GET['cid']))? "?cid=" . (int)($_GET['cid']): ""; //Added by Lankford
+ $category_suffix = !empty($_GET['cid']) ? "?cid=" . (int)$_GET['cid']: ""; //Added by Lankford
$toolbar .= "<a href='submit.php$category_suffix'>" . _MD_WFD_SUBMITDOWNLOAD . "</a> | ";
}
$toolbar .= "<a href='newlist.php'>" . _MD_WFD_LATESTLIST . "</a> | <a href='topten.php?list=hit'>" . _MD_WFD_POPULARITY . "</a> | <a href='topten.php?list=rate'>" . _MD_WFD_TOPRATED . "</a> ]";
@@ -734,26 +734,26 @@
$newdate = (time() - (86400 * $wfdownloads->getConfig('daysnew')));
$popdate = (time() - (86400 * $wfdownloads->getConfig('daysupdated'))) ;
- if ($wfdownloads->getConfig('displayicons') != 3) {
+ if ($wfdownloads->getConfig('displayicons') != _WFD_DISPLAYICONS_NO) {
if ($newdate < $time) {
if (intval($status) > 1) {
- if ($wfdownloads->getConfig('displayicons') == 1)
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_ICON)
$new = " <img src=" . XOOPS_URL . "/modules/wfdownloads/images/icon/update.gif alt='' align ='absmiddle'/>";
- if ($wfdownloads->getConfig('displayicons') == 2)
- $new = "<i>Updated!</i>";
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_TEXT)
+ $new = "<i>" . _WFD_MD_UPDATED . "</i>";
} else {
- if ($wfdownloads->getConfig('displayicons') == 1)
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_ICON)
$new = " <img src=" . XOOPS_URL . "/modules/wfdownloads/images/icon/newred.gif alt='' align ='absmiddle'/>";
- if ($wfdownloads->getConfig('displayicons') == 2)
- $new = "<i>New!</i>";
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_TEXT)
+ $new = "<i>" . _WFD_MD_NEW. "</i>";
}
}
if ($popdate < $time) {
if ($counter >= $wfdownloads->getConfig('popular')) {
- if ($wfdownloads->getConfig('displayicons') == 1)
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_ICON)
$pop = " <img src =" . XOOPS_URL . "/modules/wfdownloads/images/icon/pop.gif alt='' align ='absmiddle'/>";
- if ($wfdownloads->getConfig('displayicons') == 2)
- $pop = "<i>Popular</i>";
+ if ($wfdownloads->getConfig('displayicons') == _WFD_DISPLAYICONS_TEXT)
+ $pop = "<i>" . _WFD_MD_POPULAR . "</i>";
}
}
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -266,31 +266,31 @@
define("_AM_WFD_MOD_MODPOSTER","Original poster: ");
define("_AM_WFD_MOD_DATE","Submitted");
define("_AM_WFD_MOD_NOMODREQUEST","There are no requests that match this criteria");
-define("_AM_WFD_MOD_TITLE","Download title: ");
-define("_AM_WFD_MOD_LID","Download ID: ");
-define("_AM_WFD_MOD_CID","Category: ");
-define("_AM_WFD_MOD_URL","Remote Url: ");
-define("_AM_WFD_MOD_MIRROR","Download mirror: ");
-define("_AM_WFD_MOD_SIZE","Download size: ");
-define("_AM_WFD_MOD_PUBLISHER","Publisher: ");
-define("_AM_WFD_MOD_LICENSE","Software licence: ");
-define("_AM_WFD_MOD_FEATURES","Key features: ");
-define("_AM_WFD_MOD_FORUMID","Forum: ");
-define("_AM_WFD_MOD_LIMITATIONS","Software limitations: ");
-define("_AM_WFD_MOD_VERSIONTYPES","Release status: ");
-define("_AM_WFD_MOD_DHISTORY","Download history: ");
-define("_AM_WFD_MOD_SCREENSHOT","Screenshot image: ");
-define("_AM_WFD_MOD_HOMEPAGE","Home Page: ");
-define("_AM_WFD_MOD_HOMEPAGETITLE","Home page title: ");
-define("_AM_WFD_MOD_VERSION","Version: ");
-define("_AM_WFD_MOD_SHOTIMAGE","Screenshot image: ");
-define("_AM_WFD_MOD_FILESIZE","File size: ");
-define("_AM_WFD_MOD_PLATFORM","Software platform: ");
-define("_AM_WFD_MOD_PRICE","Price: ");
-define("_AM_WFD_MOD_LICENCE","Software licence: ");
-define("_AM_WFD_MOD_DESCRIPTION","Description: ");
-define("_AM_WFD_MOD_REQUIREMENTS","Requirements: ");
-define("_AM_WFD_MOD_MODIFYSUBMITTER","Submitter: ");
+define("_AM_WFD_MOD_TITLE","Download title");
+define("_AM_WFD_MOD_LID","Download ID");
+define("_AM_WFD_MOD_CID","Category");
+define("_AM_WFD_MOD_URL","Remote Url");
+define("_AM_WFD_MOD_MIRROR","Download mirror");
+define("_AM_WFD_MOD_SIZE","Download size");
+define("_AM_WFD_MOD_PUBLISHER","Publisher");
+define("_AM_WFD_MOD_LICENSE","Software licence");
+define("_AM_WFD_MOD_FEATURES","Key features");
+define("_AM_WFD_MOD_FORUMID","Forum");
+define("_AM_WFD_MOD_LIMITATIONS","Software limitations");
+define("_AM_WFD_MOD_VERSIONTYPES","Release status");
+define("_AM_WFD_MOD_DHISTORY","Download history");
+define("_AM_WFD_MOD_SCREENSHOT","Screenshot image");
+define("_AM_WFD_MOD_HOMEPAGE","Home Page");
+define("_AM_WFD_MOD_HOMEPAGETITLE","Home page title");
+define("_AM_WFD_MOD_VERSION","Version");
+define("_AM_WFD_MOD_SHOTIMAGE","Screenshot image");
+define("_AM_WFD_MOD_FILESIZE","File size");
+define("_AM_WFD_MOD_PLATFORM","Software platform");
+define("_AM_WFD_MOD_PRICE","Price");
+define("_AM_WFD_MOD_LICENCE","Software licence");
+define("_AM_WFD_MOD_DESCRIPTION","Description");
+define("_AM_WFD_MOD_REQUIREMENTS","Requirements");
+define("_AM_WFD_MOD_MODIFYSUBMITTER","Submitter");
define("_AM_WFD_MOD_MODIFYSUBMIT","Submitter");
define("_AM_WFD_MOD_PROPOSED","Proposed download details");
define("_AM_WFD_MOD_ORIGINAL","Original download details");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -37,15 +37,15 @@
define("_MD_WFD_RATINGLTOH","Rating (lowest to highest score)");
define("_MD_WFD_RATINGHTOL","Rating (highest to lowest score)");
define("_MD_WFD_DESCRIPTIONC","Description: ");
-define("_MD_WFD_CATEGORYC","Category: ");
+define("_MD_WFD_CATEGORYC","Category");
define("_MD_WFD_VERSION","Version");
define("_MD_WFD_SUBMITDATE","Released");
define("_MD_WFD_DLTIMES","Downloaded %s times");
define("_MD_WFD_FILESIZE","File size");
define("_MD_WFD_SUPPORTEDPLAT","Platform");
define("_MD_WFD_HOMEPAGE","Home page");
-define("_MD_WFD_PUBLISHERC","Publisher: ");
-define("_MD_WFD_RATINGC","Rating: ");
+define("_MD_WFD_PUBLISHERC","Publisher");
+define("_MD_WFD_RATINGC","Rating");
define("_MD_WFD_ONEVOTE","1 Vote");
define("_MD_WFD_NUMVOTES","%s Votes");
define("_MD_WFD_RATETHISFILE","Rate resource");
@@ -62,17 +62,17 @@
define("_MD_WFD_THEREARE","There are <b>%s</b> <i>Categories</i> and <b>%s</b> <i>Downloads</i> listed");
define("_MD_WFD_THEREIS","There is <b>%s</b> <i>Category</i> and <b>%s</b> <i>Downloads</i> listed");
define("_MD_WFD_LATESTLIST","Latest listings");
-define("_MD_WFD_FILETITLE","Download title: ");
-define("_MD_WFD_DLURL","Remote URL: ");
-define("_MD_WFD_UPLOAD_FILENAME","Local Filename: ");
-define("_MD_WFD_UPLOAD_FILETYPE","File Type: ");
+define("_MD_WFD_FILETITLE","Download title");
+define("_MD_WFD_DLURL","Remote URL");
+define("_MD_WFD_UPLOAD_FILENAME","Local Filename");
+define("_MD_WFD_UPLOAD_FILETYPE","File Type");
-define("_MD_WFD_HOMEPAGEC","Home page: ");
-define("_MD_WFD_UPLOAD_FILEC","Upload file: ");
-define("_MD_WFD_VERSIONC","Version: ");
-define("_MD_WFD_FILESIZEC","File size: ");
+define("_MD_WFD_HOMEPAGEC","Home page");
+define("_MD_WFD_UPLOAD_FILEC","Upload file");
+define("_MD_WFD_VERSIONC","Version");
+define("_MD_WFD_FILESIZEC","File size");
define("_MD_WFD_NUMBYTES","%s bytes");
-define("_MD_WFD_PLATFORMC","Platform: ");
+define("_MD_WFD_PLATFORMC","Platform");
define("_MD_WFD_PRICE","Price");
define("_MD_WFD_LIMITS","Limitations");
define("_MD_WFD_VERSIONTYPES","Release status");
@@ -173,17 +173,17 @@
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_WFD_ISNOTAPPROVED","Your submission has to be approved by a moderator first.");
-define("_MD_WFD_LICENCEC","Software licence: ");
-define("_MD_WFD_LIMITATIONS","Software limitations: ");
-define("_MD_WFD_KEYFEATURESC","Key features:<br /><br /><span style='font-weight: normal;'>Separate each key feature with a |</span>");
-define("_MD_WFD_REQUIREMENTSC","System requirements:<br /><br /><span style='font-weight: normal;'>Separate each requirement with |</span>");
-define("_MD_WFD_HISTORYC","Download history:");
-define("_MD_WFD_HISTORYD","Add new download history:<br /><br /><span style='font-weight: normal;'>The submit date will automatically be added to this.</span>");
+define("_MD_WFD_LICENCEC","Software licence");
+define("_MD_WFD_LIMITATIONS","Software limitations");
+define("_MD_WFD_KEYFEATURESC","Key features");
+define("_MD_WFD_REQUIREMENTSC","System requirements");
+define("_MD_WFD_HISTORYC","Download history");
+define("_MD_WFD_HISTORYD","Add new download history");
define("_MD_WFD_HOMEPAGETITLEC","Home page title");
define("_MD_WFD_REQUIREMENTS","System requirements");
define("_MD_WFD_FEATURES","Features");
define("_MD_WFD_HISTORY","Download history");
-define("_MD_WFD_PRICEC","Price:");
+define("_MD_WFD_PRICEC","Price");
define("_MD_WFD_SCREENSHOT","Screenshot 1");
define("_MD_WFD_SCREENSHOT2","Screenshot 2");
define("_MD_WFD_SCREENSHOT3","Screenshot 3");
@@ -294,4 +294,13 @@
define("_MD_WFD_MIRROR_HOMEURL_DESC","Enter your homepage URL.");
define("_MD_WFD_MIRROR_UPLOADMIRRORIMAGE_DESC","A small logo representing your website.");
define("_MD_WFD_MIRROR_LOCATION_DESC","Example: London, UK");
-define("_MD_WFD_MIRROR_DOWNURL_DESC","Enter the URL to the file.");
\ No newline at end of file
+define("_MD_WFD_MIRROR_DOWNURL_DESC","Enter the URL to the file.");
+
+define("_WFD_MD_UPDATED","Updated!");
+define("_WFD_MD_NEW","New!");
+define("_WFD_MD_POPULAR","Popular");
+
+define("_MD_WFD_KEYFEATURESC_DESC","Separate each key feature with a |");
+define("_MD_WFD_REQUIREMENTSC_DESC","Separate each requirement with |");
+define("_MD_WFD_HISTORYD_DESC","The submit date will automatically be added to this.");
+define("_MD_WFD_UPLOAD_FILEC_DESC","Max file size: %s<br />Max image width: %dpx<br />Max image height: %dpx<br />Allowed mimetypes: %s");
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -93,9 +93,9 @@
$xoopsTpl->assign('down_arr', $download_array);
$add_mirror = false;
- if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == 3 || $wfdownloads->getConfig('anonpost') == 4) && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4)) {
+ if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_MIRROR || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH)) {
$add_mirror = true;
- } elseif (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4 || $xoopsUser->isAdmin())) {
+ } elseif (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || $xoopsUser->isAdmin())) {
$add_mirror = true;
}
@@ -128,12 +128,12 @@
case "mirror.add" :
default :
// Check if ANONYMOUS user can post mirrors
- if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == 1 || $wfdownloads->getConfig('anonpost') == 2)) {
+ if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_NONE || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_DOWNLOAD)) {
redirect_header(XOOPS_URL . '/user.php', 1, _MD_WFD_MUSTREGFIRST);
exit();
}
// Check if user can submit mirrors
- if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == 1 || $wfdownloads->getConfig('submissions') == 2) && !$xoopsUser->isAdmin()) {
+ if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_NONE || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_DOWNLOAD) && !$xoopsUser->isAdmin()) {
redirect_header('index.php', 1, _MD_WFD_MIRROR_NOTALLOWESTOSUBMIT);
exit();
}
@@ -151,7 +151,7 @@
$mirror->setVar('lid', (int)$_POST['lid']);
$mirror->setVar('uid', $mirroruserUid);
$mirror->setVar('date', time());
- if (($wfdownloads->getConfig('autoapprove') == 1 || $wfdownloads->getConfig('autoapprove') == 2) && !$wfdownloads_isAdmin) {
+ if (($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_NONE || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD) && !$wfdownloads_isAdmin) {
$approve = false;
} else {
$approve = true;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/newlist.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/newlist.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/newlist.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -35,6 +35,10 @@
$catArray['toolbar'] = wfd_toolbar();
$xoopsTpl->assign('catarray', $catArray);
+// Breadcrumb
+$breadcrumb = new WfdownloadsBreadcrumb();
+$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
+
// Get number of downloads...
$allowedCategories = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
// ... in the last week
@@ -51,7 +55,7 @@
// Get latest downloads
$criteria = new CriteriaCompo(new Criteria("offline", 0));
if(isset($_GET['newdownloadshowdays'])) {
- $days = intval($_GET['newdownloadshowdays']);
+ $days = (int)$_GET['newdownloadshowdays'];
$days_limit = array(7, 14, 30);
if(in_array($days, $days_limit)) {
$xoopsTpl->assign('newdownloadshowdays', $days);
@@ -71,9 +75,7 @@
$xoopsTpl->append('file', $down);
}
-/**
- * Screenshots display
- */
+// Screenshots display
$xoopsTpl->assign('show_screenshot', false);
if ($wfdownloads->getConfig('screenshot') == 1) {
$xoopsTpl->assign('shots_dir', $wfdownloads->getConfig('screenshots'));
@@ -83,10 +85,17 @@
$xoopsTpl->assign('viewcat', true);
}
if (isset($days)) {
- $which_new_downloads = " > " . sprintf(_MD_WFD_NEWDOWNLOADS_INTHELAST, intval($days));
+ $which_new_downloads = " > " . sprintf(_MD_WFD_NEWDOWNLOADS_INTHELAST, (int)$days);
$xoopsTpl->assign('categoryPath', '<a href="' . WFDOWNLOADS_URL . '/newlist.php">' . _MD_WFD_NEWDOWNLOADS . '</a>' . $which_new_downloads);
+ $breadcrumb->addLink(_MD_WFD_LATESTLIST, $currentFile);
+ $breadcrumb->addLink(sprintf(_MD_WFD_NEWDOWNLOADS_INTHELAST, (int)$days), '');
} else {
$xoopsTpl->assign('categoryPath', _MD_WFD_NEWDOWNLOADS);
+ $breadcrumb->addLink(_MD_WFD_LATESTLIST, '');
}
+
+// Breadcrumb
+$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
$xoopsTpl->assign('module_home', wfdownloads_module_home(true));
include 'footer.php';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -151,9 +151,9 @@
$use_mirrors = $wfdownloads->getConfig('enable_mirrors');
$add_mirror = 0;
-if (!is_object($xoopsUser) && $use_mirrors == 1 && ($wfdownloads->getConfig('anonpost') == 3 || $wfdownloads->getConfig('anonpost') == 4) && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4)) {
+if (!is_object($xoopsUser) && $use_mirrors == true && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_MIRROR || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH)) {
$add_mirror = 1;
-} elseif (is_object($xoopsUser) && $use_mirrors == 1 && ($wfdownloads->getConfig('submissions') == 3 || $wfdownloads->getConfig('submissions') == 4 || $xoopsUser->isAdmin())) {
+} elseif (is_object($xoopsUser) && $use_mirrors == true && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_MIRROR || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH || $xoopsUser->isAdmin())) {
$add_mirror = 1;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -25,7 +25,7 @@
// Check if submissions are allowed
$submissionsAllowed = false;
-if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == 2 || $wfdownloads->getConfig('submissions') == 4)) {
+if (is_object($xoopsUser) && ($wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_DOWNLOAD || $wfdownloads->getConfig('submissions') == _WFD_SUBMISSIONS_BOTH)) {
// if user is a registered user
$groups = $xoopsUser->getGroups();
if (array_intersect($wfdownloads->getConfig('submitarts'), $groups)) {
@@ -33,7 +33,7 @@
}
} else {
// if user is ANONYMOUS
- if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == 2 || $wfdownloads->getConfig('anonpost') == 4)) {
+ if (!is_object($xoopsUser) && ($wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_DOWNLOAD || $wfdownloads->getConfig('anonpost') == _WFD_ANONPOST_BOTH)) {
$submissionsAllowed = true;
} else {
redirect_header(XOOPS_URL . '/user.php', 5, _MD_WFD_MUSTREGFIRST);
@@ -56,7 +56,7 @@
}
if (!empty($_POST['submit'])) {
- $notify = !empty($_POST['notify']) ? 1 : 0;
+ $notify = !empty($_POST['notify']) ? true : false;
$lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
@@ -180,7 +180,7 @@
if ($lid > 0) {
$thisIsANewRecord = false;
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_BOTH) {
$download = $wfdownloads->getHandler('download')->get($lid);
} else {
$download = $wfdownloads->getHandler('modification')->create();
@@ -189,7 +189,7 @@
} else {
$thisIsANewRecord = true;
$download = $wfdownloads->getHandler('download')->create();
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_BOTH) {
$download->setVar('published', time());
$download->setVar('status', 1);
} else {
@@ -262,7 +262,7 @@
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}";
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_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);
@@ -331,7 +331,7 @@
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}";
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_BOTH) {
$notification_handler->triggerEvent('global', 0, 'new_file', $tags);
$notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
redirect_header('index.php', 2, _MD_WFD_ISAPPROVED . "");
@@ -347,7 +347,7 @@
}
exit();
} else {
- if ($wfdownloads->getConfig('autoapprove') == 2 || $wfdownloads->getConfig('autoapprove') == 4) {
+ if ($wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_DOWNLOAD || $wfdownloads->getConfig('autoapprove') == _WFD_AUTOAPPROVE_BOTH) {
$notifypub = (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) ? 1 : 0;
$download->setVar('notifypub', $notifypub);
$download->setVar('ipaddress', $_SERVER['REMOTE_ADDR']);
@@ -380,12 +380,20 @@
if ($wfdownloads->getConfig('showdisclaimer') && !isset($_GET['agree'])) {
// Show disclaimers
$xoopsOption['template_main'] = 'wfdownloads_disclaimer.html';
-
include XOOPS_ROOT_PATH . '/header.php';
+
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/module.css');
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/thickbox.css');
$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
+
$catarray['imageheader'] = wfd_imageheader();
+
+ // Breadcrumb
+ $breadcrumb = new WfdownloadsBreadcrumb();
+ $breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
+ $breadcrumb->addLink(_MD_WFD_SUBMITDOWNLOAD, '');
+ $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
$xoopsTpl -> assign('catarray', $catarray);
$xoopsTpl->assign('categoryPath', _MD_WFD_DISCLAIMERAGREEMENT);
$xoopsTpl->assign('module_home', wfdownloads_module_home(true));
@@ -451,13 +459,20 @@
}
$xoopsOption['template_main'] = 'wfdownloads_submit.html';
-
include XOOPS_ROOT_PATH . '/header.php';
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/module.css');
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/thickbox.css');
$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
+
$catarray['imageheader'] = wfd_imageheader();
+
+ // Breadcrumb
+ $breadcrumb = new WfdownloadsBreadcrumb();
+ $breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
+ $breadcrumb->addLink(_MD_WFD_SUBMITDOWNLOAD, '');
+ $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
$xoopsTpl -> assign('catarray', $catarray);
$xoopsTpl->assign('categoryPath', _MD_WFD_SUBMITDOWNLOAD);
$xoopsTpl->assign('module_home', wfdownloads_module_home(true));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/topten.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/topten.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/topten.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -48,16 +48,16 @@
$categories = $wfdownloads->getHandler('category')->getObjects();
-$mytree = new XoopsObjectTree($categories, 'cid', 'pid');
-$mainCategories = $mytree->getFirstChild(0);
+$categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
+$mainCategories = $categoriesTree->getFirstChild(0);
$allowedCategoriesIds = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
$e = 0;
$rankings = array();
-foreach (array_keys($mainCategories) as $i) {
- $cid = (int)$mainCategories[$i]->getVar('cid');
+foreach ($mainCategories as $mainCategory) {
+ $cid = (int)$mainCategory->getVar('cid');
if (in_array($cid, $allowedCategoriesIds)) {
- $allSubCategories = $mytree->getAllChild($cid);
+ $allSubCategories = $categoriesTree->getAllChild($cid);
$cids = array(); //initialise array
if (count($allSubCategories) > 0) {
foreach (array_keys($allSubCategories) as $k) {
@@ -74,18 +74,18 @@
$filecount = count($downloads);
if ($filecount > 0) {
- $rankings[$e]['title'] = $mainCategories[$i]->getVar('title');
+ $rankings[$e]['title'] = $mainCategory->getVar('title');
$rank = 1;
foreach (array_keys($downloads) as $k) {
$parent_cat_titles = array();
- $cats = $mytree->getAllParent($downloads[$k]->getVar('cid'));
+ $cats = $categoriesTree->getAllParent($downloads[$k]->getVar('cid'));
if (count($cats) > 0) {
foreach (array_keys($cats) as $j) {
$parent_cat_titles[] = $cats[$j]->getVar('title');
}
}
- $thiscat = $mytree->getByKey($downloads[$k]->getVar('cid'));
+ $thiscat = $categoriesTree->getByKey($downloads[$k]->getVar('cid'));
$parent_cat_titles[] = $thiscat->getVar('title');
$catpath = implode('/', $parent_cat_titles);
@@ -106,9 +106,15 @@
}
}
-$xoopsTpl -> assign('lang_sortby' , $lang_array[$thisselected]);
-$xoopsTpl -> assign('rankings', $rankings);
+$xoopsTpl->assign('lang_sortby' , $lang_array[$thisselected]);
+$xoopsTpl->assign('rankings', $rankings);
+// Breadcrumb
+$breadcrumb = new WfdownloadsBreadcrumb();
+$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
+$breadcrumb->addLink($lang_array[$thisselected], '');
+$xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
if ($_GET['list'] == 'rate') {
$xoopsTpl->assign('categoryPath', _MD_WFD_DOWNLOAD_MOST_RATED);
} else {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-08-31 18:06:22 UTC (rev 11992)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-08-31 22:17:30 UTC (rev 11993)
@@ -32,6 +32,8 @@
$modversion['official'] = 0;
$modversion['dirname'] = basename(dirname(__FILE__));
+include_once XOOPS_ROOT_PATH . "/modules/" ....
[truncated message content] |