|
From: <luc...@us...> - 2013-08-29 20:58:54
|
Revision: 11991
http://sourceforge.net/p/xoops/svn/11991
Author: luciorota
Date: 2013-08-29 20:58:50 +0000 (Thu, 29 Aug 2013)
Log Message:
-----------
fixed errors (thanks Christelle and Mamba)
code standardization (in progress)
added breadcrumb (in progress)
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/mirror.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
XoopsModules/wfdownloads/trunk/wfdownloads/docs/english/__about.html
XoopsModules/wfdownloads/trunk/wfdownloads/header.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
XoopsModules/wfdownloads/trunk/wfdownloads/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/common.php
XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help.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/ratefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/review.php
XoopsModules/wfdownloads/trunk/wfdownloads/rss.php
XoopsModules/wfdownloads/trunk/wfdownloads/singlefile.php
XoopsModules/wfdownloads/trunk/wfdownloads/submit.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_brokenfile.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_common_breadcrumb.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_download.html
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_mirrors.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/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -296,6 +296,9 @@
global $xoopsUser, $imagearray, $currentFile;
$wfdownloads = WfdownloadsWfdownloads::getInstance();
+ $member_handler = xoops_gethandler('member');
+ $notification_handler = xoops_gethandler('notification');
+
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
$numrows = $wfdownloads->getHandler('category')->getCount();
@@ -347,7 +350,6 @@
$owner = getEntryOwner($entry);
else
$owner = getEntryOwner($entry, $fid);
- $member_handler = xoops_gethandler('member');
$owner_groups = $member_handler->getGroupsByUser($owner, false);
$customArray['owner_groups'] = $owner_groups;
}
@@ -487,9 +489,9 @@
global $xoopsUser, $currentFile;
$wfdownloads = WfdownloadsWfdownloads::getInstance();
- $lid = !empty($_POST['lid']) ? (int)$_POST['lid'] : 0;
- $cid = !empty($_POST['cid']) ? (int)$_POST['cid'] : 0;
- $status = !empty($_POST['status']) ? (int)$_POST['status'] : 2;
+ $lid = WfdownloadsRequest::getInt('lid', 0, 'POST');
+ $cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ $status = WfdownloadsRequest::getInt('status', 2, 'POST');
if ($lid > 0) {
$thisIsANewRecord = false; /* Added by Lankford on 2007/3/21 */
@@ -647,12 +649,12 @@
$download->setVar('ipaddress', $_SERVER['REMOTE_ADDR']);
}
+ $category = $wfdownloads->getHandler('category')->get($cid);
+
// Added Formulize module support (2006/05/04) jpc - start
if (wfdownload_checkModule('formulize')) {
- $category = $wfdownloads->getHandler('category')->get($cid);
$fid = $category->getVar('formulize_fid');
if($fid) {
- global $xoopsUser;
include_once XOOPS_ROOT_PATH . "/modules/formulize/include/formread.php";
include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
$formulize_mgr =& xoops_getmodulehandler('elements', 'formulize');
@@ -695,7 +697,6 @@
$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 = & xoops_gethandler('notification');
$notification_handler -> triggerEvent('global', 0, 'new_file', $tags);
$notification_handler -> triggerEvent('category', $cid, 'new_file', $tags);
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -94,7 +94,6 @@
$form = new XoopsThemeForm(_AM_WFD_IMPORT_BUTTON_IMPORT, "form", $_SERVER['REQUEST_URI']);
//Is MyDownloads installed?
- $module_handler = xoops_gethandler('module');
$mydownloadsModule = $module_handler->getByDirname("mydownloads");
$got_options = false;
if (is_object($mydownloadsModule)) {
@@ -107,7 +106,6 @@
}
//Is PD-Downloads installed?
- $module_handler = xoops_gethandler('module');
$PDdownloadsModule = $module_handler->getByDirname("PDdownloads");
$got_options = false;
if (is_object($PDdownloadsModule)) {
@@ -120,7 +118,6 @@
}
//Is wmpownloads installed?
- $module_handler = xoops_gethandler('module');
$wmpdownloadsModule = $module_handler->getByDirname("wmpdownloads");
$got_options = false;
if (is_object($wmpdownloadsModule)) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/brokenfile.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -1,156 +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.
- */
-/**
- * WF-Downloads 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 'header.php';
-
-$lid = WfdownloadsRequest::getInt('lid', 0);
-$download = $wfdownloads->getHandler('download')->get($lid);
-$cid = WfdownloadsRequest::getInt('cid', $download->getVar('cid'));
-$category = $wfdownloads->getHandler('category')->get($cid);
-
-// Download not published, expired or taken offline - redirect
-if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true || ($download->getVar('expired') == true && $download->getVar('expired') < time()) || $download->getVar('status') == 0) {
- redirect_header('index.php', 3, _MD_WFD_NODOWNLOAD);
-}
-
-// Breadcrumb
-include_once XOOPS_ROOT_PATH . "/class/tree.php";
-$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
-$breadcrumb = new WfdownloadsBreadcrumb();
-$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
-foreach(array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
- $breadcrumb->addLink($parentCategory->getVar('title'), "viewcat.php?cid=" . $parentCategory->getVar('cid'));
-}
-$breadcrumb->addLink($category->getVar('title'), "viewcat.php?cid={$cid}");
-$breadcrumb->addLink($download->getVar('title'), "singlefile.php?lid={$lid}");
-
-
-
-$op = WfdownloadsRequest::getCmd('op', 'report.add');
-switch ($op) {
- case "report.add" :
- default :
- // Get report sender 'uid'
- $senderUid = is_object($xoopsUser) ? (int)$xoopsUser->getVar('uid') : 0;
- $senderIp = getenv('REMOTE_ADDR');
-
- if (!empty($_POST['submit'])) {
- // Check if REG user is trying to report twice
- $criteria = new Criteria('lid', $lid);
- $reportsCount = $wfdownloads->getHandler('report')->getCount($criteria);
- if ($reportsCount > 0) {
- redirect_header('index.php', 2, _MD_WFD_ALREADYREPORTED);
- } else {
-
- $report = $wfdownloads->getHandler('report')->create();
- $report->setVar('lid', $lid);
- $report->setVar('sender', $senderUid);
- $report->setVar('ip', $senderIp);
- $report->setVar('date', time());
- $report->setVar('confirmed', 0);
- $report->setVar('acknowledged', 0);
- if ($wfdownloads->getHandler('report')->insert($report)) {
- // All is well.
- // Send notification.
- $tags = array();
- $tags['BROKENREPORTS_URL'] = WFDOWNLOADS_URL . '/admin/reportsmodifications.php?op=reports.modifications.list';
- $notification_handler->triggerEvent('global', 0, 'file_broken', $tags);
-
- // Send email to the owner of the download stating that it is broken
- $user = $member_handler->getUser($download->getVar('submitter'));
- $subdate = formatTimestamp($download->getVar('published'), $wfdownloads->getConfig('dateformat'));
- $cid = $download->getVar('cid');
- $title = $download->getVar('title');
- $subject = _MD_WFD_BROKENREPORTED;
-
- $xoopsMailer = &getMailer();
- $xoopsMailer->useMail();
- $template_dir = WFDOWNLOADS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/mail_template";
-
- $xoopsMailer->setTemplateDir($template_dir);
- $xoopsMailer->setTemplate('filebroken_notify.tpl');
- $xoopsMailer->setToEmails($user->email());
- $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
- $xoopsMailer->setFromName($xoopsConfig['sitename']);
- $xoopsMailer->assign("X_UNAME", $user->uname());
- $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
- $xoopsMailer->assign("X_ADMINMAIL", $xoopsConfig['adminmail']);
- $xoopsMailer->assign('X_SITEURL', XOOPS_URL . '/');
- $xoopsMailer->assign("X_TITLE", $title);
- $xoopsMailer->assign("X_SUB_DATE", $subdate);
- $xoopsMailer->assign('X_DOWNLOAD', WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}");
- $xoopsMailer->setSubject($subject);
- $xoopsMailer->send();
- redirect_header('index.php', 2, _MD_WFD_BROKENREPORTED);
- exit();
- } else {
- echo $report->getHtmlErrors();
- }
- }
- } else {
- $xoopsOption['template_main'] = 'wfdownloads_brokenfile.html';
- include XOOPS_ROOT_PATH . '/header.php';
-
- // Begin Main page Heading etc
- $catarray['imageheader'] = wfd_imageheader();
- $xoopsTpl->assign('catarray', $catarray);
-
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/module.css');
- $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/thickbox.css');
- $xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
- // Breadcrumb
- $breadcrumb->addLink(_MD_WFD_REPORTBROKEN, '');
- $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
-
- xoops_load('XoopsUserUtility');
- $report = $wfdownloads->getHandler('report')->getObjects(new Criteria('lid', $lid));
- if (isset($report[0])) {
- $report_obj = $report[0];
-
- $broken['title'] = trim($download->getVar('title'));
- $broken['id'] = $report_obj->getVar('reportid');
- $broken['reporter'] = XoopsUserUtility::getUnameFromId((int)$report_obj->getVar('sender'));
- $broken['date'] = formatTimestamp($report_obj->getVar('published'), $wfdownloads->getConfig('dateformat'));
- $broken['acknowledged'] = ($report_obj->getVar('acknowledged') == 1) ? _YES : _NO ;
- $broken['confirmed'] = ($report_obj->getVar('confirmed') == 1) ? _YES : _NO ;
-
- $xoopsTpl->assign('broken', $broken);
- $xoopsTpl->assign('brokenreport', true);
- } else {
- // file info
- $down['title'] = trim($download->getVar('title'));
- $down['homepage'] = $myts->makeClickable(formatURL(trim($download->getVar('homepage'))));
- $time = ($download->getVar('updated') != false) ? $download->getVar('updated') : $download->getVar('published');
- $down['updated'] = formatTimestamp($time, $wfdownloads->getConfig('dateformat'));
- $is_updated = ($download->getVar('updated') != false) ? _MD_WFD_UPDATEDON : _MD_WFD_SUBMITDATE;
- $down['publisher'] = XoopsUserUtility::getUnameFromId((int)$download->getVar('submitter'));
-
- $xoopsTpl->assign('file_id', $lid);
- $xoopsTpl->assign('lang_subdate' , $is_updated);
- $xoopsTpl->assign('is_updated', $download->getVar('updated'));
- $xoopsTpl->assign('lid', $lid);
- $xoopsTpl->assign('down', $down);
- include 'footer.php';
- }
- }
- break;
+<?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.
+ */
+/**
+ * WF-Downloads 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 'header.php';
+
+$lid = WfdownloadsRequest::getInt('lid', 0);
+$download = $wfdownloads->getHandler('download')->get($lid);
+$cid = WfdownloadsRequest::getInt('cid', $download->getVar('cid'));
+$category = $wfdownloads->getHandler('category')->get($cid);
+
+// Download not published, expired or taken offline - redirect
+if ($download->getVar('published') == 0 || $download->getVar('published') > time() || $download->getVar('offline') == true || ($download->getVar('expired') == true && $download->getVar('expired') < time()) || $download->getVar('status') == 0) {
+ redirect_header('index.php', 3, _MD_WFD_NODOWNLOAD);
+}
+
+// Breadcrumb
+include_once XOOPS_ROOT_PATH . "/class/tree.php";
+$categoriesTree = new XoopsObjectTree($wfdownloads->getHandler('category')->getObjects(), 'cid', 'pid');
+$breadcrumb = new WfdownloadsBreadcrumb();
+$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
+foreach(array_reverse($categoriesTree->getAllParent($cid)) as $parentCategory) {
+ $breadcrumb->addLink($parentCategory->getVar('title'), "viewcat.php?cid=" . $parentCategory->getVar('cid'));
+}
+$breadcrumb->addLink($category->getVar('title'), "viewcat.php?cid={$cid}");
+$breadcrumb->addLink($download->getVar('title'), "singlefile.php?lid={$lid}");
+
+
+
+$op = WfdownloadsRequest::getString('op', 'report.add');
+switch ($op) {
+ case "report.add" :
+ default :
+ // Get report sender 'uid'
+ $senderUid = is_object($xoopsUser) ? (int)$xoopsUser->getVar('uid') : 0;
+ $senderIp = getenv('REMOTE_ADDR');
+
+ if (!empty($_POST['submit'])) {
+ // Check if REG user is trying to report twice
+ $criteria = new Criteria('lid', $lid);
+ $reportsCount = $wfdownloads->getHandler('report')->getCount($criteria);
+ if ($reportsCount > 0) {
+ redirect_header('index.php', 2, _MD_WFD_ALREADYREPORTED);
+ } else {
+ $report = $wfdownloads->getHandler('report')->create();
+ $report->setVar('lid', $lid);
+ $report->setVar('sender', $senderUid);
+ $report->setVar('ip', $senderIp);
+ $report->setVar('date', time());
+ $report->setVar('confirmed', 0);
+ $report->setVar('acknowledged', 0);
+ if ($wfdownloads->getHandler('report')->insert($report)) {
+ // All is well
+ // Send notification
+ $tags = array();
+ $tags['BROKENREPORTS_URL'] = WFDOWNLOADS_URL . '/admin/reportsmodifications.php?op=reports.modifications.list';
+ $notification_handler->triggerEvent('global', 0, 'file_broken', $tags);
+
+ // Send email to the owner of the download stating that it is broken
+ $user = $member_handler->getUser($download->getVar('submitter'));
+ $subdate = formatTimestamp($download->getVar('published'), $wfdownloads->getConfig('dateformat'));
+ $cid = $download->getVar('cid');
+ $title = $download->getVar('title');
+ $subject = _MD_WFD_BROKENREPORTED;
+
+ $xoopsMailer = &getMailer();
+ $xoopsMailer->useMail();
+ $template_dir = WFDOWNLOADS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/mail_template";
+
+ $xoopsMailer->setTemplateDir($template_dir);
+ $xoopsMailer->setTemplate('filebroken_notify.tpl');
+ $xoopsMailer->setToEmails($user->email());
+ $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
+ $xoopsMailer->setFromName($xoopsConfig['sitename']);
+ $xoopsMailer->assign("X_UNAME", $user->uname());
+ $xoopsMailer->assign("SITENAME", $xoopsConfig['sitename']);
+ $xoopsMailer->assign("X_ADMINMAIL", $xoopsConfig['adminmail']);
+ $xoopsMailer->assign('X_SITEURL', XOOPS_URL . '/');
+ $xoopsMailer->assign("X_TITLE", $title);
+ $xoopsMailer->assign("X_SUB_DATE", $subdate);
+ $xoopsMailer->assign('X_DOWNLOAD', WFDOWNLOADS_URL . "/singlefile.php?cid={$cid}&lid={$lid}");
+ $xoopsMailer->setSubject($subject);
+ $xoopsMailer->send();
+ redirect_header('index.php', 2, _MD_WFD_BROKENREPORTED);
+ exit();
+ } else {
+ echo $report->getHtmlErrors();
+ }
+ }
+ } else {
+ $xoopsOption['template_main'] = 'wfdownloads_brokenfile.html';
+ include XOOPS_ROOT_PATH . '/header.php';
+
+ // Begin Main page Heading etc
+ $catarray['imageheader'] = wfd_imageheader();
+ $xoopsTpl->assign('catarray', $catarray);
+
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/module.css');
+ $xoTheme->addStylesheet(WFDOWNLOADS_URL . '/thickbox.css');
+ $xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
+
+ // Breadcrumb
+ $breadcrumb->addLink(_MD_WFD_REPORTBROKEN, '');
+ $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
+ // Generate form
+ include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ $sform = new XoopsThemeForm(_MD_WFD_RATETHISFILE, 'reportform', xoops_getenv('PHP_SELF'));
+ $sform->addElement(new XoopsFormHidden('lid', $lid));
+ $sform->addElement(new XoopsFormHidden('cid', $cid));
+ $sform->addElement(new XoopsFormHidden('uid', $senderUid));
+ $button_tray = new XoopsFormElementTray('', '');
+ $submit_button = new XoopsFormButton('', 'submit', _MD_WFD_SUBMITBROKEN, 'submit');
+ $button_tray->addElement($submit_button);
+ $cancel_button = new XoopsFormButton('', '', _CANCEL, 'button');
+ $cancel_button -> setExtra('onclick="history.go(-1)"');
+ $button_tray->addElement($cancel_button);
+ $sform->addElement($button_tray);
+ $xoopsTpl->assign('reportform', $sform->render());
+ $xoopsTpl->assign('download', array('lid' => $lid, 'cid' => $cid, 'title' => $download->getVar('title'), 'description' => $download->getVar('description')));
+
+ $criteria = new Criteria('lid', $lid);
+ $reports = $wfdownloads->getHandler('report')->getObjects($criteria);
+ //print_r($reports);
+ if (count($reports) > 0) {
+ $report = $reports[0];
+
+ $broken['title'] = trim($download->getVar('title'));
+ $broken['id'] = $report->getVar('reportid');
+ $broken['reporter'] = XoopsUserUtility::getUnameFromId((int)$report->getVar('sender'));
+ $broken['date'] = formatTimestamp($report->getVar('published'), $wfdownloads->getConfig('dateformat'));
+ $broken['acknowledged'] = ($report->getVar('acknowledged') == 1) ? _YES : _NO ;
+ $broken['confirmed'] = ($report->getVar('confirmed') == 1) ? _YES : _NO ;
+
+ $xoopsTpl->assign('brokenreportexists', true);
+ $xoopsTpl->assign('broken', $broken);
+ $xoopsTpl->assign('brokenreport', true); // this definition is not removed for compatibility issues
+ } else {
+ // file info
+ $down['title'] = trim($download->getVar('title'));
+ $down['homepage'] = $myts->makeClickable(formatURL(trim($download->getVar('homepage'))));
+ $time = ($download->getVar('updated') != false) ? $download->getVar('updated') : $download->getVar('published');
+ $down['updated'] = formatTimestamp($time, $wfdownloads->getConfig('dateformat'));
+ $is_updated = ($download->getVar('updated') != false) ? _MD_WFD_UPDATEDON : _MD_WFD_SUBMITDATE;
+ $down['publisher'] = XoopsUserUtility::getUnameFromId((int)$download->getVar('submitter'));
+
+ $xoopsTpl->assign('brokenreportexists', false);
+ $xoopsTpl->assign('file_id', $lid);
+ $xoopsTpl->assign('lang_subdate' , $is_updated);
+ $xoopsTpl->assign('is_updated', $download->getVar('updated'));
+ $xoopsTpl->assign('lid', $lid);
+ $xoopsTpl->assign('down', $down);
+ }
+ include 'footer.php';
+ }
+ break;
}
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -47,6 +47,7 @@
function getForm($action = false)
{
global $xoopsDB, $xoopsModule, $wfdownloads;
+ $gperm_handler = xoops_gethandler('groupperm');
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
@@ -70,7 +71,6 @@
$form -> addElement(new XoopsFormText(_AM_WFD_FCATEGORY_WEIGHT, 'weight', 10, 80, $this->getVar('weight')), false);
- $gperm_handler = & xoops_gethandler('groupperm');
$groups = $gperm_handler -> getGroupIds('WFDownCatPerm', $this->getVar('cid'), $xoopsModule->mid());
$groups_down_select = new XoopsFormSelectGroup(_AM_WFD_FCATEGORY_GROUPPROMPT, "groups", true, $groups, 5, true);
$groups_down_select->setDescription(_AM_WFD_FCATEGORY_GROUPPROMPT_DESC);
@@ -197,8 +197,8 @@
*/
function getUserCategories($id_as_key = false, $as_object = true) {
global $xoopsUser, $xoopsModule;
+ $gperm_handler = xoops_gethandler('groupperm');
- $gperm_handler = xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
$categoryids = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $xoopsModule->mid());
return $this->getObjects(new Criteria('cid', "(" . implode(',', $categoryids) . ")", "IN"), $id_as_key, $as_object);
@@ -213,8 +213,8 @@
*/
function getUserDownCategories($id_as_key = false, $as_object = true) {
global $xoopsUser, $xoopsModule;
+ $gperm_handler = xoops_gethandler('groupperm');
- $gperm_handler = xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
$categoryids = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $xoopsModule->mid());
return $this->getObjects(new Criteria('cid', "(" . implode(',', $categoryids) . ")", "IN"), $id_as_key, $as_object);
@@ -222,8 +222,8 @@
function getUserUpCategories($id_as_key = false, $as_object = true) {
global $xoopsUser, $xoopsModule;
+ $gperm_handler = xoops_gethandler('groupperm');
- $gperm_handler = xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$categoryids = $gperm_handler->getItemIds('WFUpCatPerm', $groups, $xoopsModule->mid());
return $this->getObjects(new Criteria('cid', "(" . implode(',', $categoryids) . ")", "IN"), $id_as_key, $as_object);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -797,6 +797,7 @@
*/
function getActiveCriteria() {
global $xoopsUser, $wfdownloads;
+ $gperm_handler = xoops_gethandler('groupperm');
$criteria = new CriteriaCompo(new Criteria('offline', 0));
$criteria->add(new Criteria('published', 0, '>'));
@@ -805,7 +806,6 @@
$expired_criteria->add(new Criteria('expired', time(), '>='), 'OR');
$criteria->add($expired_criteria);
// add criteria for categories that the user has permissions for
- $gperm_handler = xoops_gethandler('groupperm');
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
$categoryids = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
$criteria->add(new Criteria('cid', '(' . implode(',', $categoryids) . ')', 'IN'));
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/mirror.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/mirror.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -56,41 +56,37 @@
$sform -> addElement(new XoopsFormText(_AM_WFD_MIRROR_DOWNURL, 'downurl', 50, 255, $this->getVar('downurl', 'e')), true);
$approved = ($this->getVar('submit') == 0) ? 0 : 1;
- $approve_checkbox = new XoopsFormCheckBox(_AM_WFD_MIRROR_FAPPROVE, "approve", $approved);
+ $approve_checkbox = new XoopsFormCheckBox(_AM_WFD_MIRROR_FAPPROVE, 'approve', $approved);
$approve_checkbox -> addOption(1, " ");
$sform -> addElement($approve_checkbox);
- $sform -> addElement(new XoopsFormHidden("lid", (int)($this->getVar('lid'))));
- $sform -> addElement(new XoopsFormHidden("mirror_id", (int)($this->getVar('mirror_id'))));
- $sform -> addElement(new XoopsFormHidden("uid", $uid));
- $sform -> addElement(new XoopsFormHidden("confirm", 1));
+ $sform -> addElement(new XoopsFormHidden('lid', (int)($this->getVar('lid'))));
+ $sform -> addElement(new XoopsFormHidden('mirror_id', (int)($this->getVar('mirror_id'))));
+ $sform -> addElement(new XoopsFormHidden('uid', $uid));
+ $sform -> addElement(new XoopsFormHidden('confirm', 1));
$button_tray = new XoopsFormElementTray('', '');
$hidden = new XoopsFormHidden('op', '');
$button_tray -> addElement($hidden);
if ($this->isNew()) {
- $butt_create = new XoopsFormButton('', '', _AM_WFD_BSAVE, 'submit');
- $butt_create -> setExtra('onclick="this.form.elements.op.value=\'mirror.save\'"');
- $button_tray -> addElement($butt_create);
-
- $butt_clear = new XoopsFormButton('', '', _AM_WFD_BRESET, 'reset');
- $button_tray -> addElement($butt_clear);
-
- $butt_cancel = new XoopsFormButton('', '', _AM_WFD_BCANCEL, 'button');
- $butt_cancel -> setExtra('onclick="history.go(-1)"');
- $button_tray -> addElement($butt_cancel);
+ $create_button = new XoopsFormButton('', '', _AM_WFD_BSAVE, 'submit');
+ $create_button -> setExtra('onclick="this.form.elements.op.value=\'mirror.save\'"');
+ $button_tray -> addElement($create_button);
+ $clear_button = new XoopsFormButton('', '', _RESET, 'reset');
+ $button_tray -> addElement($clear_button);
+ $cancel_button = new XoopsFormButton('', '', _CANCEL, 'button');
+ $cancel_button -> setExtra('onclick="history.go(-1)"');
+ $button_tray -> addElement($cancel_button);
} else {
- $butt_create = new XoopsFormButton('', '', _AM_WFD_BSAVE, 'submit');
- $butt_create -> setExtra('onclick="this.form.elements.op.value=\'mirror.save\'"');
- $button_tray -> addElement($butt_create);
-
- $butt_delete = new XoopsFormButton('', '', _AM_WFD_BDELETE, 'submit');
- $butt_delete -> setExtra('onclick="this.form.elements.op.value=\'mirror.delete\'"');
- $button_tray -> addElement($butt_delete);
-
- $butt_cancel = new XoopsFormButton('', '', _AM_WFD_BCANCEL, 'button');
- $butt_cancel -> setExtra('onclick="history.go(-1)"');
- $button_tray -> addElement($butt_cancel);
+ $create_button = new XoopsFormButton('', '', _AM_WFD_BSAVE, 'submit');
+ $create_button -> setExtra('onclick="this.form.elements.op.value=\'mirror.save\'"');
+ $button_tray -> addElement($create_button);
+ $button_delete = new XoopsFormButton('', '', _DELETE, 'submit');
+ $button_delete -> setExtra('onclick="this.form.elements.op.value=\'mirror.delete\'"');
+ $button_tray -> addElement($button_delete);
+ $cancel_button = new XoopsFormButton('', '', _CANCEL, 'button');
+ $cancel_button -> setExtra('onclick="history.go(-1)"');
+ $button_tray -> addElement($cancel_button);
}
$sform -> addElement($button_tray);
return $sform;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -69,7 +69,7 @@
$this->addLog("ERROR :: CONFIG '{$name}' does not exist");
return null;
}
- $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ $this->addLog("Getting config '{$name}' : " . print_r($this->config[$name], true));
return $this->config[$name];
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-08-29 20:58:50 UTC (rev 11991)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-08-10)</u></b>
+<b><u>=> Version 3.23 Beta (2013-08-29)</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/docs/english/__about.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/english/__about.html 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/english/__about.html 2013-08-29 20:58:50 UTC (rev 11991)
@@ -12,7 +12,7 @@
<FONT FACE="Arial" SIZE="-1">
<p>WF-Downloads is a download module for Xoops (2.0.10.x / 2.2.x or higher) that offers more features than the original mydownloads module.
-You can create a download section with multiple categories and sub-categories. You decide which groups are allowed to upload which type of files separately. <p>
+You can create a download section with multiple categories and subcategories. You decide which groups are allowed to upload which type of files separately. <p>
Here is a short selection of features offered:<p>
<span style="font-size: x-small;"><ul>
<li>create multiple categories and subcategories for your downloads
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/header.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/header.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/header.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -36,6 +36,7 @@
//define('PROTECTOR_SKIP_FILESCHECKER', true);
// Load Xoops handlers
+$module_handler = xoops_gethandler('module');
$member_handler = xoops_gethandler('member');
$notification_handler = &xoops_gethandler('notification');
$gperm_handler = xoops_gethandler('groupperm');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -613,7 +613,7 @@
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
- $id = intval($id);
+ $id = (int)$id;
$result = true;
$mid = $wfdownloads->getModule()->mid();
$gperm_handler = xoops_gethandler('groupperm');
@@ -1079,7 +1079,7 @@
} elseif ($published >= $threeDays && $published < $oneDay) {
$indicator['image'] = "images/icon/download2.gif";
$indicator['alttext'] = _MD_WFD_THREE;
- } elseif ($published >= $oneday) {
+ } elseif ($published >= $oneDay) {
$indicator['image'] = "images/icon/download1.gif";
$indicator['alttext'] = _MD_WFD_TODAY;
} else {
@@ -1213,7 +1213,6 @@
$uploader->noAdminSizeCheck(1);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- error_log("testtesttest");
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
unlink($uploadDirectory . $uploader->savedFileName);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/module.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -120,7 +120,7 @@
// add 'WFUpCatPerm' permission where is set 'WFDownCatPerm' permission
// =========================================================================================
function update_permissions_to_323($module) {
- $gperm_handler = & xoops_gethandler('groupperm');
+ $gperm_handler = xoops_gethandler('groupperm');
$category_handler = xoops_getmodulehandler('category', $module->dirname());
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/index.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/index.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -28,7 +28,7 @@
$xoTheme->addStylesheet(WFDOWNLOADS_URL . '/thickbox.css');
$xoopsTpl->assign('wfdownloads_url', WFDOWNLOADS_URL . '/');
-
+// Breadcrumb
$breadcrumb = new WfdownloadsBreadcrumb();
$breadcrumb->addLink($wfdownloads->getModule()->getVar('name'), WFDOWNLOADS_URL);
@@ -42,22 +42,19 @@
-$mytree = new XoopsObjectTree($categories, "cid", "pid");
+$categoriesTree = new XoopsObjectTree($categories, "cid", "pid");
-// Begin Main page Heading etc
+// Generate content header
$sql = "SELECT * FROM " . $xoopsDB->prefix('wfdownloads_indexpage') . " ";
$head_arr = $xoopsDB->fetchArray($xoopsDB->query($sql));
$catarray['imageheader'] = wfd_imageheader();
-//$catarray['indexheading'] = $myts->displayTarea($head_arr['indexheading']);
$catarray['indexheaderalign'] = $head_arr['indexheaderalign'];
$catarray['indexfooteralign'] = $head_arr['indexfooteralign'];
-
$html = ($head_arr['nohtml']) ? 1 : 0;
$smiley = ($head_arr['nosmiley']) ? 1 : 0;
$xcodes = ($head_arr['noxcodes']) ? 1 : 0;
$images = ($head_arr['noimages']) ? 1 : 0;
$breaks = ($head_arr['nobreak']) ? 1 : 0;
-
$catarray['indexheader'] = $myts->displayTarea($head_arr['indexheader'], $html, $smiley, $xcodes, $images, $breaks);
$catarray['indexfooter'] = $myts->displayTarea($head_arr['indexfooter'], $html, $smiley, $xcodes, $images, $breaks);
$catarray['letters'] = wfdownloads_lettersChoice();
@@ -68,15 +65,15 @@
$chcount = 0;
$countin = 0;
-$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
+$userGroups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0=>XOOPS_GROUP_ANONYMOUS);
-$allowedCategoriesIds = $gperm_handler->getItemIds('WFDownCatPerm', $groups, $wfdownloads->getModule()->mid());
+$allowedCategoriesIds = $gperm_handler->getItemIds('WFDownCatPerm', $userGroups, $wfdownloads->getModule()->mid());
$listings = wfd_getTotalItems(0, $allowedCategoriesIds);
// Get total amount of categories
$total_cat = count($allowedCategoriesIds);
// Get all main categories
-$mainCategories = $mytree->getFirstChild(0);
+$mainCategories = $categoriesTree->getFirstChild(0);
$count = 0;
// Comparison functions for uasort()
@@ -97,7 +94,7 @@
if (in_array($mainCategories[$i]->getVar('cid'), $allowedCategoriesIds)) {
// Get this category image
// Get this category subcategories
- $allSubCategories = $mytree->getAllChild($mainCategories[$i]->getVar('cid'));
+ $allSubCategories = $categoriesTree->getAllChild($mainCategories[$i]->getVar('cid'));
// Sort subcategories by: cid or title or weight
switch($wfdownloads->getConfig('subcatssortby')) {
@@ -142,7 +139,7 @@
$download_count = isset($listings['count'][$mainCategories[$i]->getVar('cid')]) ? $listings['count'][$mainCategories[$i]->getVar('cid')] : 0;
// modified July 5 2006 by Freeform Solutions (jwe)
// make download count recursive, to include all sub categories that the user has permission to view
- //$allSubCategories = $mytree->getAllChild($mainCategories[$i]->getVar('cid'));
+ //$allSubCategories = $categoriesTree->getAllChild($mainCategories[$i]->getVar('cid'));
if (count($allSubCategories) > 0) {
foreach (array_keys($allSubCategories) as $k) {
if (in_array($allSubCategories[$k]->getVar('cid'), $allowedCategoriesIds)) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/admin.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -84,7 +84,7 @@
define("_AM_WFD_FCATEGORY_GROUPPROMPT","Category access permissions");
define("_AM_WFD_FCATEGORY_TITLE","Category title");
define("_AM_WFD_FCATEGORY_WEIGHT","Category weight");
-define("_AM_WFD_FCATEGORY_SUBCATEGORY","As sub-category of");
+define("_AM_WFD_FCATEGORY_SUBCATEGORY","As subcategory of");
define("_AM_WFD_FCATEGORY_CIMAGE","Category image");
define("_AM_WFD_FCATEGORY_DESCRIPTION","Category description");
define("_AM_WFD_FCATEGORY_SUMMARY","Category summary");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/common.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/common.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/common.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -1,124 +1,13 @@
<?php
+define("_CO_WFD_MIRROR","Mirror");
+define("_CO_WFD_MIRRORS","Mirrors");
+define("_CO_WFD_MIRRORS_LIST","Mirrors list");
-/**
- * $Id:$
- * Module: WFD
- * Author: The SmartFactory <www.smartfactory.ca>
- * Licence: GNU
- */
-/*
-define("_CO_WFD_MESSAGE_FILE_ERROR", "Error: Unable to store uploaded file for the following reasons:<br />%s");
-define("_CO_WFD_MESSAGE_WRONG_MIMETYPE", "Error: filetype is not allowed. Please re-submit.");
+define("_CO_WFD_REVIEW","Review");
+define("_CO_WFD_REVIEWS","Reviews");
+define("_CO_WFD_REVIEWS_LIST","Reviews list");
-define("_CO_WFD_ALLOWCOMMENTS", "Can article be commented?");
-
-define("_CO_WFD_AUTHOR_ALIAS", "Author alias");
-define("_CO_WFD_AUTHOR_ALIAS_DSC", "Select the alias name of the poster, this will be used instead of 'anonymous' and will set the owner id of the article to 0");
-define("_CO_WFD_AVAILABLE_PAGE_WRAP", "Available pages to wrap");
-define("_CO_WFD_AVAILABLE_PAGE_WRAP_DSC", "Here are the pages available for wrapping in the body. Click on the page(s) you would like to wrap. Works with XOOPS editor only for the moment. Add manually if you are on another editor.");
-define("_CO_WFD_DATESUB", "Published date");
-define("_CO_WFD_DATESUB_DSC", "Select the date of publication");
-define("_CO_WFD_ITEM_META_DESCRIPTION", "Meta Description");
-define("_CO_WFD_ITEM_META_DESCRIPTION_DSC", "In order to help Search Engines, you can customize the meta description you would like to use for this article. if you leave this field empty when creating a category, it will automatically be populated with the Summary field of this article.");
-define("_CO_WFD_ITEM_META_KEYWORDS", "Meta Keywords");
-define("_CO_WFD_ITEM_META_KEYWORDS_DSC", "In order to help Search Engines, you can customize the keywords you would like to use for this article. if you leave this field empty when creating an article, it will automatically be populated with words from the Summary field of this article.");
-define("_CO_WFD_ITEM_SHORT_URL", "Short URL");
-define("_CO_WFD_ITEM_SHORT_URL_DSC", "When using the SEO features of this module, you can specify a Short URL for this article. This field is optional.");
-define("_CO_WFD_OFFLINE", "Offline");
-define("_CO_WFD_PERMISSIONS_ITEM", "Permissions");
-define("_CO_WFD_PERMISSIONS_ITEM_DSC", "Groups that will have permissions to see this item.");
-define("_CO_WFD_PUBLISHED", "Published");
-define("_CO_WFD_REJECTED", "Rejected");
-define("_CO_WFD_STATUS", "Status");
-define("_CO_WFD_STATUS_DSC", "Select the status of this article");
-define("_CO_WFD_SUBMITTED", "Submitted");
-define("_CO_WFD_UID", "Poster name");
-define("_CO_WFD_UID_DSC", "Select the name of the poster");
-define("_CO_WFD_WEIGHT", "Weight");
-
-define("_CO_WFD_ITEM_UPLOAD_FILE", "File upload");
-define("_CO_WFD_ITEM_UPLOAD_FILE_DSC", "Select a file from your computer to attach it to this article. You will be able to add more files once the article has been created. Simply edit the article and scroll at the bottom of the page to see the Add file button.<br /><br /> For example, you could add a Word document or an Excel document. You can even upload a Flash file and it will be directly embeded into your article ! ");
-//define("_CO_WFD_OPTIONS", "Options");
-define("_CO_WFD_DISPLAY_SUMMARY", "Display summary on the item page ?");
-define("_CO_WFD_DOHTML", "Enable HTML tags");
-define("_CO_WFD_DOIMAGE", "Enable images");
-define("_CO_WFD_DOLINEBREAK", "Enable linebreak");
-define("_CO_WFD_DOSMILEY", "Enable smiley icons");
-define("_CO_WFD_DOXCODE", "Enable XOOPS codes");
-
-define("_CO_WFD_EDIT", "Edit article");
-define("_CO_WFD_CLONE", "Duplicate article");
-define("_CO_WFD_ADD_FILE", "Add a file");
-define("_CO_WFD_DELETE", "Delete article");
-define("_CO_WFD_PDF", "View this article in PDF format");
-define("_CO_WFD_PRINT", "Print article");
-define("_CO_WFD_MAIL", "Send article");
-define("_CO_WFD_INTITEM", "Have a look at this article at %s");
-define("_CO_WFD_INTITEMFOUND", "Here is an interesting article I have found at %s");
-define("_CO_WFD_POSTEDBY", "Published by %s on %s");
-define("_CO_WFD_BODY", "Body");
-define("_CO_WFD_BODY_DSC", "Article's body");
-
-define("_CO_WFD_CATEGORY", "Category");
-define("_CO_WFD_CATEGORY_DSC", "Article's category.");
-define("_CO_WFD_IMAGE_ITEM", "Article featured image");
-define("_CO_WFD_IMAGE_ITEM_DSC", "Image representing the article");
-define("_CO_WFD_IMAGE_UPLOAD", "Image upload");
-//define("_CO_WFD_IMAGE_UPLOAD_ITEM_DSC", "Select an image on your computer. <br />This image will be uploaded to the site <br />and set as the article image.");
-define("_CO_WFD_SUBCATEGORIES_INFO", "Subcategories within <em>%s</em> :");
-
-define("_CO_WFD_SUMMARY", "Block summary");
-define("_CO_WFD_SUMMARY_DSC", "This summary is used for blocks, index and category pages. It does not display inside article.");
-
-define("_CO_WFD_TITLE", "Title");
-define("_CO_WFD_SUBTITLE", "Sub title");
-
-define("_CO_WFD_ERROR", "Sorry, some error occurred!");
-define("_CO_WFD_SORTBY", "Sort by");
-
-define("_CO_WFD_ADD", "Add");
-define("_CO_WFD_REMOVE", "Remove");
-define("_CO_WFD_PREVIEW", "Preview");
-
-define("_CO_WFD_CREATE", "Create");
-define("_CO_WFD_CLEAR", "Clear");
-define("_CO_WFD_CANCEL", "Cancel");
-
-define("_CO_WFD_IMAGE_ITEMS", "Article images");
-define("_CO_WFD_IMAGE_ITEMS_DSC", "Please choose the images related to this article");
-define("_CO_WFD_IMAGE_PREVIEW", "Image preview");
-define("_CO_WFD_NOTIFY", "Notify on publish?");
-
-define("_CO_WFD_FILEUPLOAD_ERROR", "An error occured while uploading the file.");
-define("_CO_WFD_FILEUPLOAD_SUCCESS", "The file was successfully uploaded.");
-define("_CO_WFD_NEW_FEATURE", "New feature !!!");
-
-define("_CO_WFD_TAB_MAIN", "Main");
-define("_CO_WFD_TAB_IMAGES", "Images");
-define("_CO_WFD_TAB_OTHERS", "Others");
-define("_CO_WFD_TAB_META", "Meta data");
-define("_CO_WFD_TAB_PERMISSIONS", "Permissions");
-
-define("_CO_WFD_IMAGE_UPLOAD_NEW", "Upload new image");
-//define("_CO_WFD_IMAGE_UPLOADING", "Uploading");
-define("_CO_WFD_IMAGE_NICENAME", "Enter image name");
-define("_CO_WFD_IMAGE_CAT_NONE", "No image category found");
-define("_CO_WFD_IMAGE_CAT_NOPERM", "You have no permissions to use this image category");
-
-define("_CO_WFD_TAB_FILES", "Files");
-
-define("_CO_WFD_FILE", "Files");
-define("_CO_WFD_FILE_DESCRIPTION", "Description");
-define("_CO_WFD_FILE_DESCRIPTION_DSC", "Description of the file to be uploaded.");
-define("_CO_WFD_FILE_NAME_DSC", "Name that will be used to identify the file.");
-define("_CO_WFD_FILE_STATUS", "File visible ?");
-define("_CO_WFD_FILE_STATUS_DSC", "if you select no, the file will not be visible from the user side.");
-define("_CO_WFD_FILE_TO_UPLOAD", "File to upload :");
-define("_CO_WFD_FILE_TYPE", "File type");
-define("_CO_WFD_FILE_UPLOAD_ANOTHER", "Upload again");
-define("_CO_WFD_FILENAME", "File name");
-define("_CO_WFD_FILES_LINKED", "Files linked to this article");
-
-define("_CO_WFD_EDITFILE", "Edit file");
-define("_CO_WFD_DELETEFILE", "Delete file");
-*/
+define("_CO_WFD_DATE","Date");
+define("_CO_WFD_STATUS","Status");
+define("_CO_WFD_ACTIONS","Actions");
+define("_CO_WFD_LEGEND","Legend");
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help.html
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help.html 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/help/help.html 2013-08-29 20:58:50 UTC (rev 11991)
@@ -7,7 +7,7 @@
<h4 class="odd">Description</h4>
<p class="even">
- WF-Downloads is a download module for XOOPS. You can create a download section with multiple categories and sub-categories. You decide which groups are allowed to upload which type of files separately. <br /> <br />
+ WF-Downloads is a download module for XOOPS. You can create a download section with multiple categories and subcategories. You decide which groups are allowed to upload which type of files separately. <br /> <br />
</p>
<h4 class="odd">Install/uninstall</h4>
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/main.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -50,7 +50,7 @@
define("_MD_WFD_NUMVOTES","%s Votes");
define("_MD_WFD_RATETHISFILE","Rate resource");
define("_MD_WFD_REVIEWTHISFILE","Review resource");
-define("_MD_WFD_REVIEWS","Reviews:");
+define("_MD_WFD_REVIEWS","Reviews");
define("_MD_WFD_DOWNLOADHITS","Downloads");
define("_MD_WFD_MODIFY","Modify");
define("_MD_WFD_REPORTBROKEN","Report broken");
@@ -162,9 +162,9 @@
define("_MD_WFD_BROKENFILE","Broken file");
define("_MD_WFD_PLEASEREPORT","Please report this broken file to the webmaster, ");
// Reviews
-define("_MD_WFD_REV_TITLE","Review title:");
-define("_MD_WFD_REV_RATING","Review rating:");
-define("_MD_WFD_REV_DESCRIPTION","Review:");
+define("_MD_WFD_REV_TITLE","Review title");
+define("_MD_WFD_REV_RATING","Review rating");
+define("_MD_WFD_REV_DESCRIPTION","Review");
define("_MD_WFD_REV_SUBMITREV","Submit review");
define("_MD_WFD_ERROR_CREATEREVIEW","Error when creating a review");
@@ -215,7 +215,7 @@
//reviews.php
define("_MD_WFD_ERROR_CREATCHANNEL","Create channel first");
-define("_MD_WFD_REVIEW_CATPATH","Category path:");
+define("_MD_WFD_REVIEW_CATPATH","Category path");
define("_MD_WFD_ADDREVIEW","Add review");
//
@@ -226,25 +226,25 @@
define("_MD_WFD_NO_FILES","No files yet");
//mirrors.php
-define("_MD_WFD_MIRROR_AVAILABLE","Mirrors available:");
-define("_MD_WFD_MIRROR_CATPATH","Category path:");
-define("_MD_WFD_MIRROR_FILENAME","Filename:");
+define("_MD_WFD_MIRROR_AVAILABLE","Mirrors available");
+define("_MD_WFD_MIRROR_CATPATH","Category path");
+define("_MD_WFD_MIRROR_FILENAME","Filename");
define("_MD_WFD_DOWNLOADMIRRORS","Download mirrors");
define("_MD_WFD_MIRROR_NOTALLOWESTOSUBMIT","You are not allowed to submit mirrors");
-define("_MD_WFD_MIRRORS","Download mirrors:");
+define("_MD_WFD_MIRRORS","Download mirrors");
define("_MD_WFD_USERMIRRORSTITLE","Available download mirrors");
define("_MD_WFD_USERMIRRORS","View Available download mirrors on %s");
define("_MD_WFD_NOUSERMIRRORS","Add a new download mirror on %s.");
-define("_MD_WFD_TOTALMIRRORS","Total mirrors:");
+define("_MD_WFD_TOTALMIRRORS","Total mirrors");
define("_MD_WFD_ADDMIRROR","Add mirror");
-define("_MD_WFD_MIRROR_TOTAL","<b>Total mirrors:</b> %s");
-define("_MD_WFD_MIRROR_HOMEURLTITLE","Homepage title:");
-define("_MD_WFD_MIRROR_HOMEURL","Homepage URL:<br /><br />Enter your homepage URL.");
-define("_MD_WFD_MIRROR_UPLOADMIRRORIMAGE","Upload site logo:<br /><br />A small logo representing your website.");
-define("_MD_WFD_MIRROR_MIRRORIMAGE","Site logo:");
-define("_MD_WFD_MIRROR_CONTINENT","Continent:");
-define("_MD_WFD_MIRROR_LOCATION","Location:<br /><br />Example: London, UK");
-define("_MD_WFD_MIRROR_DOWNURL","Download URL:<br /><br />Enter the URL to the file.");
+define("_MD_WFD_MIRROR_TOTAL","<b>Total mirrors</b> %s");
+define("_MD_WFD_MIRROR_HOMEURLTITLE","Homepage title");
+define("_MD_WFD_MIRROR_HOMEURL","Homepage URL");
+define("_MD_WFD_MIRROR_UPLOADMIRRORIMAGE","Upload site logo");
+define("_MD_WFD_MIRROR_MIRRORIMAGE","Site logo");
+define("_MD_WFD_MIRROR_CONTINENT","Continent");
+define("_MD_WFD_MIRROR_LOCATION","Location");
+define("_MD_WFD_MIRROR_DOWNURL","Download URL");
define("_MD_WFD_MIRROR_SUBMITMIRROR","Submit mirror");
define("_MD_WFD_ERROR_CREATEMIRROR","Error when creating mirror");
define("_MD_WFD_MIRROR_SNEWMNAMEDESC","
@@ -288,4 +288,10 @@
function wfdownloads_alphabet() {
$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');
return $alphabet;
-}
\ No newline at end of file
+}
+
+define("_MD_WFD_MIRROR_HOMEURLTITLE_DESC","");
+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
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/language/english/modinfo.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -140,7 +140,7 @@
define('_MI_WFD_DISCLAIMER','[disclaimer] Submission disclaimer text');
define('_MI_WFD_DOWNDISCLAIMER','[disclaimer] Download disclaimer text');
define('_MI_WFD_PLATFORM','Enter platforms');
-define('_MI_WFD_SUBCATS','Sub-Categories');
+define('_MI_WFD_SUBCATS','Subcategories');
define('_MI_WFD_VERSIONTYPES','Version status');
define('_MI_WFD_LICENSE','Enter license');
define('_MI_WFD_LIMITS','Enter file limitations');
@@ -170,7 +170,7 @@
// Description of each config items
define('_MI_WFD_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_WFD_SUBCATSDSC','Select "' . _YES . '" to display sub-categories. Selecting "' . _NO . '" will hide sub-categories from the listings.');
+define('_MI_WFD_SUBCATSDSC','Select "' . _YES . '" to display subcategories. Selecting "' . _NO . '" will hide sub-categories from the listings.');
define('_MI_WFD_LICENSEDSC','List of platforms to enter.<br />Separate with |');
// Text for notifications
@@ -315,7 +315,7 @@
define("_MI_WFD_EDITORCHOICE","Editor for File Summary and Download fields");
// 3.23
-define("_MI_WFD_SUBCATSSORTBY","Sort sub-categories by");
+define("_MI_WFD_SUBCATSSORTBY","Sort subcategories by");
define("_MI_WFD_SUBCATSSORTBYDSC","");
define("_MI_WFD_SUBCATSSORTBYCID","Category id");
define("_MI_WFD_SUBCATSSORTBYTITLE","Category title");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-08-28 13:23:21 UTC (rev 11990)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/mirror.php 2013-08-29 20:58:50 UTC (rev 11991)
@@ -35,8 +35,8 @@
if ($wfdownloads->getConfig('enable_mirrors') == false && ((is_object($xoopsUser) && !$xoopsUser->isAdmin()) || !is_object($xoopsUser))) {
redirect_header('index.php', 3, _NOPERM);
}
-$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
-if (!$gperm_handler->checkRight('WFDownCatPerm', $cid, $groups, $wfdownloads->getModule()->mid())) {
+$userGroups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(0 => XOOPS_GROUP_ANONYMOUS);
+if (!$gperm_handler->checkRight('WFDownCatPerm', $cid, $userGroups, $wfdownloads->getModule()->mid())) {
redirect_header('index.php', 3, _NOPERM);
}
@@ -56,6 +56,7 @@
$op = WfdownloadsRequest::getString('op', 'mirror.add');
switch ($op) {
case "mirrors.list" :
+ case "list" : // this case is not removed for compatibility issues
$start = WfdownloadsRequest::getInt('start', 0);
$xoopsOption['template_main'] = 'wfdownloads_mirrors.html';
@@ -69,12 +70,14 @@
$sql = "SELECT * FROM " . $xoopsDB->prefix('wfdownloads_indexpage') . " ";
$head_arr = $xoopsDB->fetchArray($xoopsDB->query($sql));
$catarray['imageheader'] = wfd_imageheader();
- $catarray['letters'] = wfdownloads_lettersChoice();
- $catarray['toolbar'] = wfd_toolbar();
$xoopsTpl->assign('catarray', $catarray);
$xoopsTpl->assign('category_path', $wfdownloads->getHandler('category')->getNicePath($cid));
$xoopsTpl->assign('category_id', $cid);
+ // Breadcrumb
+ $breadcrumb->addLink(_CO_WFD_MIRRORS_LIST, '');
+ $xoopsTpl->assign('wfdownloads_breadcrumb', $breadcrumb->render());
+
// Count mirrors
$criteria = new CriteriaCompo(new Criteria("lid", $lid));
$criteria->add(new Criteria("submit", 1)); // true
@@ -179,25 +182,37 @@
// Generate form
include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$sform = new XoopsThemeForm(_MD_WFD_MIRROR_SUBMITMIRROR, 'mirrorform', xoops_getenv('PHP_SELF'));
- $sform->addElement(new XoopsFormText(_MD_WFD_MIRROR_HOMEURLTITLE, 'title', 50, 255), true);
- $sform->addElement(new XoopsFormText(_MD_WFD_MIRROR_HOMEURL, 'homeurl', 50, 255), true);
- $sform->addElement(new XoopsFormText(_MD_WFD_MIRROR_LOCATION, 'location', 50, 255), true);
- $continent_select = new XoopsFormSelect(_MD_WFD_MIRROR_CONTINENT, 'continent');
- $continent_select->addOptionArray(array(
- _MD_WFD_CONT1 => _MD_WFD_CONT1,
- _MD_WFD_CONT2 => _MD_WFD_CONT2,
- _MD_WFD_CONT3 => _MD_WFD_CONT3,
- _MD_WFD_CONT4 => _MD_WFD_CONT4,
- _MD_WFD_CONT5 => _MD_W...
[truncated message content] |