|
From: <luc...@us...> - 2013-09-10 21:05:15
|
Revision: 12024
http://sourceforge.net/p/xoops/svn/12024
Author: luciorota
Date: 2013-09-10 21:05:12 +0000 (Tue, 10 Sep 2013)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-10 20:26:14 UTC (rev 12023)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-09-10 21:05:12 UTC (rev 12024)
@@ -140,8 +140,8 @@
$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', '<');
+ $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';
@@ -193,9 +193,14 @@
$criteria->add(new Criteria('cid', '(' . implode(',', $cids) . ')', 'IN'));
}
}
+ // Evaluate poster criteria
if (!is_null($filter_poster)) {
$criteria->add(new Criteria('poster', '(' . implode(',', $filter_poster) . ')', 'IN'));
}
+ // Evaluate date criteria
+ if (!empty($filter_date)) {
+ // IN PROGRESS
+ }
}
$criteria->setSort('published');
@@ -221,11 +226,11 @@
$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);
+ $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);
+ $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
@@ -535,6 +540,9 @@
global $xoopsUser, $currentFile;
$wfdownloads = WfdownloadsWfdownloads::getInstance();
+ $member_handler = xoops_gethandler('member');
+ $notification_handler = xoops_gethandler('notification');
+
$lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
$status = WfdownloadsRequest::getInt('status', 2, 'POST');
@@ -733,7 +741,7 @@
}
// Added Formulize module support (2006/05/04) jpc - end
$wfdownloads->getHandler('download')->insert($download);
- $newid = intval($download->getVar('lid'));
+ $newid = (int)$download->getVar('lid');
/**
* Send notifications
*/
@@ -743,8 +751,8 @@
$tags['FILE_URL'] = WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$newid}";
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . "/viewcat.php?cid={$cid}";
- $notification_handler -> triggerEvent('global', 0, 'new_file', $tags);
- $notification_handler -> triggerEvent('category', $cid, 'new_file', $tags);
+ $notification_handler->triggerEvent('global', 0, 'new_file', $tags);
+ $notification_handler->triggerEvent('category', $cid, 'new_file', $tags);
}
if ($lid && $approved && $notifypub) {
$tags = array();
@@ -753,9 +761,9 @@
$category = $wfdownloads->getHandler('category')->get($cid);
$tags['CATEGORY_NAME'] = $category->getVar('title');
$tags['CATEGORY_URL'] = WFDOWNLOADS_URL . '/viewcat.php?cid=' . $cid;
- $notification_handler -> triggerEvent('global', 0, 'new_file', $tags);
- $notification_handler -> triggerEvent('category', $cid, 'new_file', $tags);
- $notification_handler -> triggerEvent('file', $lid, 'approve', $tags);
+ $notification_handler->triggerEvent('global', 0, 'new_file', $tags);
+ $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;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-10 20:26:14 UTC (rev 12023)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-09-10 21:05:12 UTC (rev 12024)
@@ -1162,7 +1162,7 @@
}
$mimetypes = $wfdownloads->getHandler('mimetype')->getObjects($criteria);
$mimetype = $mimetypes[0];
- $ret = explode(' ', $mimetypeObject->getVar('mime_types'));
+ $ret = explode(' ', $mimetype->getVar('mime_types'));
return $ret;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html 2013-09-10 20:26:14 UTC (rev 12023)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_categorieslist.html 2013-09-10 21:05:12 UTC (rev 12024)
@@ -11,7 +11,8 @@
<{foreach item=sorted_category from=$sorted_categories}>
<tr class="<{cycle values='even, odd'}>">
<td>
- <{section name=indent loop=$sorted_category.level-1 step=1}}>-<{/section}><{$sorted_category.category.title}>
+ <{section name=indent loop=$sorted_category.level-1 step=1}}>-<{/section}>
+ <a href='../viewcat.php?cid=<{$sorted_category.category.cid}>'><{$sorted_category.category.title}></a>
</td>
<td>
<input type="text" name="new_weights[<{$sorted_category.category.cid}>]" size="5" maxlength="5" value="<{$sorted_category.category.weight}>" />
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2013-09-10 20:26:14 UTC (rev 12023)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/templates/admin/wfdownloads_admin_downloadslist.html 2013-09-10 21:05:12 UTC (rev 12024)
@@ -58,8 +58,12 @@
<{foreach item=download from=$published_downloads}>
<tr class="<{cycle values='even, odd'}>">
<td align='center'><{$download.lid}></td>
- <td><a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a></td>
- <td><{$download.category_title}></td>
+ <td>
+ <a href='../singlefile.php?cid=<{$download.cid}>&lid=<{$download.lid}>'><{$download.title}></a>
+ </td>
+ <td>
+ <a href='../viewcat.php?cid=<{$download.cid}>'><{$download.category_title}></a>
+ </td>
<td><{$download.submitter_uname}></td>
<td><{$download.published_timestamp}></td>
<td align='center'>
|