|
From: <luc...@us...> - 2013-10-01 22:49:53
|
Revision: 12117
http://sourceforge.net/p/xoops/svn/12117
Author: luciorota
Date: 2013-10-01 22:49:50 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
fixed autosummary error in multilanguage (using xlanguages module) contests, i hope ;-)
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-01 20:23:34 UTC (rev 12116)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-01 22:49:50 UTC (rev 12117)
@@ -242,7 +242,15 @@
($this->wfdownloads->getConfig('autosummary') == _WFDOWNLOADS_AUTOSUMMARY_IFBLANK && empty($summary))) {
// generate autosummary
$maxSummaryLength = (int)$this->wfdownloads->getConfig('autosumlength');
- $download['summary'] = $this->getVar('description');
+
+ if (wfdownloads_checkModule('xlanguage')) {
+ global $xlanguage;
+ include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php');
+ include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php');
+ $download['summary'] = xlanguage_ml($this->getVar('description'));
+ } else {
+ $download['summary'] = $this->getVar('description');
+ }
if (strlen($download['summary']) > $maxSummaryLength) {
$download['summary'] = wfdownloads_truncateHtml($download['summary'], $maxSummaryLength, '...', false, true);
} else {
@@ -255,11 +263,11 @@
$download['description'] = $this->getVar('description'); //no html
$download['price'] = ($this->getVar('price') != 0) ? $this->getVar('price') : _MD_WFDOWNLOADS_PRICEFREE;
$limitationsArray = $this->wfdownloads->getConfig('limitations');
- $download['limitations'] = ($this->getVar('limitations') == "") ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($limitationsArray[$this->getVar('limitations')]));
+ $download['limitations'] = ($this->getVar('limitations') == '') ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($limitationsArray[$this->getVar('limitations')]));
$versiontypesArray = $this->wfdownloads->getConfig('versiontypes');
- $download['versiontypes'] = ($this->getVar('versiontypes') == "") ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($versiontypesArray[$this->getVar('versiontypes')]));
+ $download['versiontypes'] = ($this->getVar('versionypes') == '') ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($versiontypesArray[$this->getVar('versiontypes')]));
$licenseArray = $this->wfdownloads->getConfig('license');
- $download['license'] = ($this->getVar('license')=="") ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($licenseArray[$this->getVar('license')]));
+ $download['license'] = ($this->getVar('license') == '') ? _MD_WFDOWNLOADS_NOTSPECIFIED : $myts->htmlSpecialChars(trim($licenseArray[$this->getVar('license')]));
$download['submitter'] = XoopsUserUtility::getUnameFromId($this->getVar('submitter'));
$publisher = $this->getVar('publisher');
if (!empty($publisher)) {
|