|
From: <luc...@us...> - 2013-09-10 16:09:14
|
Revision: 12019
http://sourceforge.net/p/xoops/svn/12019
Author: luciorota
Date: 2013-09-10 16:09:10 +0000 (Tue, 10 Sep 2013)
Log Message:
-----------
bugfix: late night typing errors
refactoring: removed unused functions, rename functions
added: adminside, filter in downloads list
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
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/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/visit.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-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -23,9 +23,9 @@
$op = WfdownloadsRequest::getString('op', 'downloads.list');
switch ($op) {
- case "download.edit":
- case "download.add":
- case "Download":
+ case "download.edit" :
+ case "download.add" :
+ case "Download" :
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -38,12 +38,12 @@
include 'admin_footer.php';
break;
- case "download.save":
- case "addDownload":
+ case "download.save" :
+ case "addDownload" :
saveDownload();
break;
- case "download.delete":
+ case "download.delete" :
$lid = WfdownloadsRequest::getInt('lid', 0);
$ok = WfdownloadsRequest::getBool('ok', false, 'POST');
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
@@ -72,8 +72,8 @@
}
break;
- case "vote.delete":
- case "delVote":
+ case "vote.delete" :
+ case "delVote" :
$rating = $wfdownloads->getHandler('rating')->get($_GET['rid']);
if ($wfdownloads->getHandler('rating')->delete($rating, true)) {
wfdownloads_updateRating(intval($rating->getVar('lid')));
@@ -82,7 +82,7 @@
break;
// Added Formulize module support (2006/05/04) jpc - start
- case "patch_formulize":
+ case "patch_formulize" :
if (wfdownloads_checkModule('formulize')) {
if(!isset($_POST['patch_formulize'])) {
print "<form action=\"{$currentFile}?op=patch_formulize\" method=post>";
@@ -101,8 +101,8 @@
break;
// Added Formulize module support (2006/05/04) jpc - end
- case "newdownload.approve":
- case "approve":
+ case "newdownload.approve" :
+ case "approve" :
$lid = WfdownloadsRequest::getInt('lid', 0);
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_DOWNLOADNOTFOUND);
@@ -132,8 +132,21 @@
redirect_header($currentFile, 1, _AM_WFD_SUB_NEWFILECREATED);
break;
- case "downloads.list":
+ case "downloads.list" :
+ case "downloads.filter" :
default :
+ $filter_title_condition = WfdownloadsRequest::getString('filter_title_condition', '=');
+ $filter_title = WfdownloadsRequest::getString('filter_title', '');
+ $filter_category_title_condition = WfdownloadsRequest::getString('filter_category_title_condition', '=');
+ $filter_category_title = WfdownloadsRequest::getString('filter_category_title', '');
+ $filter_poster = WfdownloadsRequest::getArray('filter_poster', null);
+ //$filter_date = WfdownloadsRequest::getArray('filter_date', null);
+ //$filter_date_condition = WfdownloadsRequest::getString('filter_date_condition', '<');
+
+ if ($op == 'downloads.filter') {
+ if ($filter_title == '' && $filter_category_title == '' && is_null($filter_poster)) $op = 'downloads.list';
+ }
+
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$categories = $wfdownloads->getHandler('category')->getObjects();
@@ -161,6 +174,30 @@
if ($totalDownloadsCount > 0) {
// Published Downloads
$criteria = new CriteriaCompo();
+ if ($op == 'downloads.filter') {
+ // Evaluate title criteria
+ if ($filter_title != '') {
+ if ($filter_title_condition == 'LIKE') {
+ $criteria->add(new Criteria('title', "%{$filter_title}%", 'LIKE'));
+ } else {
+ $criteria->add(new Criteria('title', $filter_title, '='));
+ }
+ }
+ // Evaluate cid criteria
+ if ($filter_category_title != '') {
+ if ($filter_category_title_condition == 'LIKE') {
+ $cids = $wfdownloads->getHandler('category')->getIds(new Criteria('title', "%{$filter_category_title}%", 'LIKE'));
+ $criteria->add(new Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'));
+ } else {
+ $cids = $wfdownloads->getHandler('category')->getIds(new Criteria('title', $filter_category_title, '='));
+ $criteria->add(new Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'));
+ }
+ }
+ if (!is_null($filter_poster)) {
+ $criteria->add(new Criteria('poster', '(' . implode(',', $filter_poster) . ')', 'IN'));
+ }
+ }
+
$criteria->setSort('published');
$criteria->setOrder('DESC');
$criteria->setStart($start_published);
@@ -180,7 +217,16 @@
}
$pagenav = new XoopsPageNav($publishedDownloadsCount, $wfdownloads->getConfig('admin_perpage'), $start_published, 'start_published');
- $GLOBALS['xoopsTpl']->assign('published_downloads_pagenav', $pagenav->renderNav());
+ $GLOBALS['xoopsTpl']->assign('filter_title', $filter_title);
+ $GLOBALS['xoopsTpl']->assign('filter_title_condition', $filter_title_condition);
+ $GLOBALS['xoopsTpl']->assign('filter_category_title', $filter_category_title);
+ $GLOBALS['xoopsTpl']->assign('filter_category_title_condition', $filter_category_title_condition);
+ $poster_select = new XoopsFormSelectUser(null, 'filter_poster', true, $filter_poster, 2, true);
+ $GLOBALS['xoopsTpl']->assign('filter_poster_select', $poster_select->render());
+ //$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();
@@ -235,10 +281,10 @@
// Expired downloads
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria("expired", time(), "<"), 'AND');
- $criteria->add(new Criteria("expired", 0, "<>"), 'AND');
- $criteria->setSort("expired");
- $criteria->setOrder("ASC");
+ $criteria->add(new Criteria('expired', time(), '<'), 'AND');
+ $criteria->add(new Criteria('expired', 0, '<>'), 'AND');
+ $criteria->setSort('expired');
+ $criteria->setOrder('ASC');
$criteria->setStart($start_expired);
$criteria->setLimit($wfdownloads->getConfig('admin_perpage'));
$expired_downloads = $wfdownloads->getHandler('download')->getObjects($criteria);
@@ -260,7 +306,7 @@
// Offline downloads
$criteria = new Criteria("offline", 1);
$criteria->setSort('published');
- $criteria->setOrder("ASC");
+ $criteria->setOrder('ASC');
$criteria->setStart($start_offline);
$criteria->setLimit($wfdownloads->getConfig('admin_perpage'));
$offlineDownloadsCount = $wfdownloads->getHandler('download')->getCount($criteria);
@@ -516,7 +562,7 @@
$download->setVar('filename', $filename);
$download->setVar('filetype', $filetype);
} else {
- $down = wfd_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, 0);
+ $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', $currentFile, 0, false, true);
$url = ($_POST['url'] != "http://") ? $_POST["url"] : '';
$size = $down['size'];
$title = $_FILES['userfile']['name'];
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -34,7 +34,7 @@
$maxImgHeight = $wfdownloads->getConfig('maximgheight');
$uploadDir = XOOPS_ROOT_PATH . "/" . $_POST['uploadpath'];
$screenShot = strtolower($_FILES['uploadfile']['name']);
- wfd_uploading($screenShot, XOOPS_ROOT_PATH . "/" . $_POST['uploadpath'], $allowedMimetypes, "images.php", 1, 0, true);
+ wfdownloads_uploading($screenShot, XOOPS_ROOT_PATH . "/" . $_POST['uploadpath'], $allowedMimetypes, $currentFile, 1, false, true);
include_once WFDOWNLOADS_ROOT_PATH . '/class/img_uploader.php';
$uploader = new XoopsMediaImgUploader($uploadDir . "/", $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
@@ -83,9 +83,21 @@
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
- $dirArray = array(1 => $wfdownloads->getConfig('catimage'), 2 => $wfdownloads->getConfig('screenshots'), 3 => $wfdownloads->getConfig('mainimagedir'));
- $nameArray = array(1 => _AM_WFD_DOWN_CATIMAGE , 2 => _AM_WFD_DOWN_SCREENSHOTS, 3 => _AM_WFD_DOWN_MAINIMAGEDIR);
- $listArray = array(1 => _AM_WFD_DOWN_FCATIMAGE , 2 => _AM_WFD_DOWN_FSCREENSHOTS, 3 => _AM_WFD_DOWN_FMAINIMAGEDIR);
+ $dirArray = array(
+ 1 => $wfdownloads->getConfig('catimage'),
+ 2 => $wfdownloads->getConfig('screenshots'),
+ 3 => $wfdownloads->getConfig('mainimagedir')
+ );
+ $nameArray = array(
+ 1 => _AM_WFD_DOWN_CATIMAGE ,
+ 2 => _AM_WFD_DOWN_SCREENSHOTS,
+ 3 => _AM_WFD_DOWN_MAINIMAGEDIR
+ );
+ $listArray = array(
+ 1 => _AM_WFD_DOWN_FCATIMAGE ,
+ 2 => _AM_WFD_DOWN_FSCREENSHOTS,
+ 3 => _AM_WFD_DOWN_FMAINIMAGEDIR
+ );
$pathList = (isset($listArray[$rootPath])) ? $nameArray[$rootPath] : '';
$nameList = (isset($listArray[$rootPath])) ? $nameArray[$rootPath] : '';
@@ -93,9 +105,16 @@
$iform = new XoopsThemeForm(_AM_WFD_DOWN_FUPLOADIMAGETO . $pathList, "op", xoops_getenv('PHP_SELF'));
$iform->setExtra('enctype="multipart/form-data"');
+ $iform->addElement(new XoopsFormHidden('dir', $rootPath));
ob_start();
- $iform->addElement(new XoopsFormHidden('dir', $rootPath));
- wfd_getDirSelectOption($nameList, $dirArray, $nameArray);
+
+ echo "<select size='1' name='workd' onchange='location.href=\"{$currentFile}?rootpath=\"+this.options[this.selectedIndex].value'>";
+ echo "<option value=''>" . _AM_WFD_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()));
ob_end_clean();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -353,8 +353,8 @@
$criteria = new Criteria('mime_user', true);
}
$mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
- $allowMimetypes = implode(' | ', $mimetypes);
- $userfile_file->setDescription(sprintf(_MD_WFD_UPLOAD_FILEC_DESC, $maxFileSize, $this->wfdownloads->getConfig('maximgwidth'), $this->wfdownloads->getConfig('maximgheight'), $allowMimetypes));
+ $allowedExtensions = implode(' | ', $mimetypes);
+ $userfile_file->setDescription(sprintf(_MD_WFD_UPLOAD_FILEC_DESC, $maxFileSize, $this->wfdownloads->getConfig('maximgwidth'), $this->wfdownloads->getConfig('maximgheight'), $allowedExtensions, substr($allowedExtensions, 0, 40) . '...'));
$sform->addElement($userfile_file, false);
}
if ($use_mirrors !== true) {
@@ -519,10 +519,10 @@
$userfile_file = new XoopsFormFile(_MD_WFD_UPLOAD_FILEC, 'userfile', 0);
$maxFileSize = wfdownloads_bytesToSize1024($this->wfdownloads->getConfig('maxfilesize'));
- $criteria = new Criteria("mime_admin", true);
+ $criteria = new Criteria('mime_admin', true);
$mimetypes = $this->wfdownloads->getHandler('mimetype')->getList($criteria);
- $allowMimetypes = implode(' | ', $mimetypes);
- $userfile_file->setDescription(sprintf(_MD_WFD_UPLOAD_FILEC_DESC, $maxFileSize, $this->wfdownloads->getConfig('maximgwidth'), $this->wfdownloads->getConfig('maximgheight'), $allowMimetypes));
+ $allowedExtensions = implode(' | ', $mimetypes);
+ $userfile_file->setDescription(sprintf(_MD_WFD_UPLOAD_FILEC_DESC, $maxFileSize, $this->wfdownloads->getConfig('maximgwidth'), $this->wfdownloads->getConfig('maximgheight'), $allowedExtensions, substr($allowedExtensions, 0, 40) . '...'));
$sform->addElement($userfile_file, false);
// changed - start - March 4 2006 - jpc
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-09-10 16:09:10 UTC (rev 12019)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-09-09)</u></b>
+<b><u>=> Version 3.23 Beta (2013-09-10)</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
@@ -11,6 +11,7 @@
- fixed: deprecated "XoopsTree" (luciorota)
- fixed: html errors in templates (luciorota)
- fixed: deprecated XoopsTree (mamba)
+- added: admin side downloads filter (luciorota)
- added: breadcrumb class (luciorota)
- added: html tags compatible autosummary generator (luciorota)
- added: sort subcategories by cid or title or weight (luciorota)
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -943,7 +943,7 @@
$showImage = "<a href='{$href}'>";
}
// checks to see if the file is valid else displays default blank image
- if (!is_dir(XOOPS_ROOT_PATH . '/'' . $imgSource . '/'' . $image) && file_exists(XOOPS_ROOT_PATH . "/" . $imgSource . "/" . $image)) {
+ if (!is_dir(XOOPS_ROOT_PATH . "/{$imgSource}/{$image}") && file_exists(XOOPS_ROOT_PATH . "/{$imgSource}/{$image}")) {
$showImage .= "<img src='" . XOOPS_URL . "/{$imgSource}/{$image}' border='0' alt='{$altText}' />";
} else {
if ($xoopsUser && $xoopsUser->isAdmin($wfdownloads->getModule()->mid())) {
@@ -1149,50 +1149,46 @@
-function wfd_retmime($fileName, $userType = 1)
+function wfdownloads_allowedMimetypes($fileName, $isAdmin = true)
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
$ext = ltrim(strrchr($fileName, '.'), '.');
$criteria = new CriteriaCompo(new Criteria('mime_ext', strtolower($ext)));
- if ($userType == 1) {
- $criteria->add(new Criteria('mime_admin', '1'));
+ if ($isAdmin == true) {
+ $criteria->add(new Criteria('mime_admin', true));
} else {
- $criteria->add(new Criteria('mime_user', '1'));
+ $criteria->add(new Criteria('mime_user', true));
}
- $mimetypeObjects = $wfdownloads->getHandler('mimetype')->getObjects($criteria);
- $mimetypeObject = $mimetypeObjects[0];
- $mimetypes = explode(' ', $mimetypeObject->getVar('mime_types'));
- return $mimetypes;
+ $mimetypes = $wfdownloads->getHandler('mimetype')->getObjects($criteria);
+ $mimetype = $mimetypes[0];
+ $ret = explode(' ', $mimetypeObject->getVar('mime_types'));
+ return $ret;
}
-function wfd_getDirSelectOption($selected, $dirarray, $namearray)
+/**
+ * wfdownloads_uploading()
+ *
+ * @param string $filename
+ * @param string $uploadDirectory
+ * @param array $allowedMimetypes
+ * @param string $redirectURL
+ * @param integer $num
+ * @param bool $redirect
+ * @param bool $isAdmin
+ * @param bool $onlyImages
+ * @return array
+ **/
+function wfdownloads_uploading($filename, $uploadDirectory = 'uploads', $allowedMimetypes = array(), $redirectURL = 'index.php', $num = 0, $redirect = false, $isAdmin = true, $onlyImages = false)
{
- echo "<select size='1' name='workd' onchange='location.href=\"images.php?rootpath=\"+this.options[this.selectedIndex].value'>";
- echo "<option value=''>--------------------------------------</option>";
- foreach($namearray as $namearray => $workd) {
- if ($workd === $selected) {
- $opt_selected = 'selected';
- } else {
- $opt_selected = '';
- }
- echo "<option value='" . htmlspecialchars($namearray, ENT_QUOTES) . "' {$opt_selected}>{$workd}</option>";
- }
- echo "</select>";
-}
-
-
-
-function wfd_uploading($filename, $uploadDirectory = 'uploads', $allowedMimetypes = '', $redirectURL = 'index.php', $num = 0, $redirect = false, $userType = 1, $onlyImages = false)
-{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
$file = array();
if (empty($allowedMimetypes)) {
- $allowedMimetypes = wfd_retmime($_FILES['userfile']['name'], $userType);
+ $allowedMimetypes = wfdownloads_allowedMimetypes($_FILES['userfile']['name'], $isAdmin);
}
$uploadDirectory = $uploadDirectory . '/';
$file_name = $_FILES['userfile']['name'];
@@ -1202,10 +1198,10 @@
$maxImageHeight = $wfdownloads->getConfig('maximgheight');
if ($onlyImages) {
- include_once XOOPS_ROOT_PATH . "/modules/wfdownloads/class/img_uploader.php";
+ include_once XOOPS_ROOT_PATH . '/modules/wfdownloads/class/img_uploader.php';
$uploader = new XoopsMediaImgUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImageWidth, $maxImageHeight);
} else {
- include_once XOOPS_ROOT_PATH . "/modules/wfdownloads/class/uploader.php";
+ include_once XOOPS_ROOT_PATH . '/modules/wfdownloads/class/uploader.php';
$uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImageWidth, $maxImageHeight);
}
$uploader->noAdminSizeCheck(1);
@@ -1237,23 +1233,23 @@
-function wfd_download($filePath, $isBinary = true, $retBytes = true)
+function wfdownloads_download($filePath, $isBinary = true, $retBytes = true)
{
$chunkSize = 1*(1024*1024); // how many bytes per chunk
$buffer = '';
- $cnt =0;
+ $cnt = 0;
if ($isBinary == true) {
- $handle = fopen($filePath, 'rb');
+ $handler = fopen($filePath, 'rb');
} else {
- $handle = fopen($filePath, 'r');
+ $handler = fopen($filePath, 'r');
}
- if ($handle === false) {
+ if ($handler === false) {
return false;
}
- while (!feof($handle)) {
- $buffer = fread($handle, $chunkSize);
+ while (!feof($handler)) {
+ $buffer = fread($handler, $chunkSize);
echo $buffer;
ob_flush();
flush();
@@ -1261,7 +1257,7 @@
$cnt += strlen($buffer);
}
}
- $status = fclose($handle);
+ $status = fclose($handler);
if ($retBytes && $status) {
return $cnt; // return num. bytes delivered like readfile() does.
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -633,3 +633,11 @@
define('_AM_WFD_DIRNOTCREATED','The directory can not be created');
define('_AM_WFD_PERMSET','The permission has been set');
define('_AM_WFD_PERMNOTSET','The permission can not be set');
+
+// admin/downloads.php
+define('_AM_WFD_SEARCH','Search');
+define('_AM_WFD_FILTER','Filter');
+define('_AM_WFD_SEARCH_EQUAL','=');
+define('_AM_WFD_SEARCH_GREATERTHAN','>');
+define('_AM_WFD_SEARCH_LESSTHAN','<');
+define('_AM_WFD_SEARCH_CONTAINS','contains');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -303,7 +303,7 @@
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 extensions: %s");
+define("_MD_WFD_UPLOAD_FILEC_DESC","Max file size: %s<br />Max image width: %dpx<br />Max image height: %dpx<br /><span title='%s'>Allowed extensions:<br />%s</span>");
define("_MD_WFD_SUMMARY_DESC","You can leave this blank<br />A summary will be autocreated if empty.");
define("_MD_WFD_SUMMARY_DESC_AUTOSUMMARY_ON","Warning: summary field is disabled.<br />The "Download autosummary" module preference is enabled.<br />A summary will be autocreated using "Description" field content.");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/submit.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -74,12 +74,9 @@
$size = ((empty($_POST['size']) || !is_numeric($_POST['size']))) ? 0 : (int)$_POST['size'];
$title = trim($_POST['title']);
} else {
- $userType = 0;
- if (is_object($xoopsUser) && $xoopsUser->isAdmin()) {
- $userType = 1;
- }
+ $isAdmin = wfdownloads_userIsAdmin();
- $down = wfd_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', '', 0, 0, $userType);
+ $down = wfdownloads_uploading($_FILES, $wfdownloads->getConfig('uploaddir'), '', '', 0, false, $isAdmin);
$url = ($_POST['url'] != "http://") ? $_POST['url'] : '';
$size = $down['size'];
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2013-09-10 16:09:10 UTC (rev 12019)
@@ -16,6 +16,45 @@
<th><{$smarty.const._AM_WFD_MINDEX_LOG}></th>
<th><{$smarty.const._AM_WFD_MINDEX_ACTION}></th>
</tr>
+
+ <form id='form_filter' enctype='multipart/form-data' method='post' action='' name='form_filter'>
+ <tr>
+ <td> </td>
+ <td>
+ <select id='filter_title_condition' title='<{$smarty.const._AM_WFD_SEARCH}>' name='filter_title_condition' size='1'>
+ <option value='=' <{if $filter_title_condition == '='}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_EQUAL}></option>
+ <option value='LIKE' <{if $filter_title_condition == 'LIKE'}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_CONTAINS}></option>
+ </select>
+ <input id='filter_title' type='text' value='<{$filter_title}>' maxlength='100' size='15' title='' name='filter_title'>
+ </td>
+ <td>
+ <select id='filter_category_title_condition' title='<{$smarty.const._AM_WFD_SEARCH}>' name='filter_category_title_condition' size='1'>
+ <option value='=' <{if $filter_category_title_condition == '='}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_EQUAL}></option>
+ <option value='LIKE' <{if $filter_category_title_condition == 'LIKE'}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_CONTAINS}></option>
+ </select>
+ <input id='filter_category_title' type='text' value='<{$filter_category_title}>' maxlength='100' size='15' title='' name='filter_category_title'>
+ </td>
+ <td><{$filter_poster_select}></td>
+ <td>
+ <{*
+ <select id='filter_date_condition' title='<{$smarty.const._AM_WFD_SEARCH}>' name='filter_date_condition' size='1'>
+ <option value='=' <{if $filter_date_condition == '='}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_EQUAL}></option>
+ <option value='>' <{if $filter_date_condition == '>'}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_GREATERTHAN}></option>
+ <option value='<' <{if $filter_date_condition == '<'}>selected='selected'<{/if}>><{$smarty.const._AM_WFD_SEARCH_LESSTHAN}></option>
+ </select>
+ <{$filter_date_select}>
+ *}>
+ </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td align='center'>
+ <input id='submit' class='formButton' type='submit' title='<{$smarty.const._AM_WFD_SEARCH}>' value='<{$smarty.const._AM_WFD_SEARCH}>' name='submit'>
+ </td>
+ </tr>
+ <input id='op' type='hidden' value='downloads.filter' name='op'>
+ </form>
+
<{foreach item=download from=$published_downloads}>
<tr class="<{cycle values='even, odd'}>">
<td align='center'><{$download.lid}></td>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/visit.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/visit.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -167,9 +167,9 @@
header("Content-Disposition: attachment; filename=" . $header_file);
if(isset($mimeType) && strstr($mimeType, "text/")) {
- wfd_download($filePath, false, true);
+ wfdownloads_download($filePath, false, true);
} else {
- wfd_download($filePath, true, true);
+ wfdownloads_download($filePath, true, true);
}
exit();
} else {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-10 15:16:57 UTC (rev 12018)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php 2013-09-10 16:09:10 UTC (rev 12019)
@@ -47,9 +47,9 @@
$modversion['onUpdate'] = 'include/module.php';
$modversion['onUninstall'] = 'include/module.php';
-$modversion['date'] = '2013-09-09';
-$modversion['release_date'] = '2013/09/09';
-$modversion['releasedate'] = "2013-09-09";
+$modversion['date'] = '2013-09-10';
+$modversion['release_date'] = '2013/09/10';
+$modversion['releasedate'] = "2013-09-10";
$modversion['status'] = "BETA";
$modversion['teammembers'] = "Bender, David, FrankBlack, Xpider, M0nty, Mithrandir, Marcan, felix[fx2024], Sudhaker, Jegelstaff";
|