|
From: <luc...@us...> - 2013-10-15 21:25:48
|
Revision: 12176
http://sourceforge.net/p/xoops/svn/12176
Author: luciorota
Date: 2013-10-15 21:25:44 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
fixed: thumbnails generator error
change options order in preferences menu
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.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/modinfo.php
XoopsModules/wfdownloads/trunk/wfdownloads/templates/wfdownloads_viewcat.html
XoopsModules/wfdownloads/trunk/wfdownloads/xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -72,19 +72,37 @@
case "category.save" :
case "addCat" :
$cid = WfdownloadsRequest::getInt('cid', 0, 'POST');
+ $pid = WfdownloadsRequest::getInt('pid', 0, 'POST');
+ $weight = (isset($_POST["weight"]) && $_POST["weight"] > 0) ? (int)$_POST["weight"] : 0;
$down_groups = isset($_POST['groups']) ? $_POST['groups'] : array();
$up_groups = isset($_POST['up_groups']) ? $_POST['up_groups'] : array();
- $pid = (isset($_POST["pid"])) ? (int)$_POST["pid"] : 0;
- $weight = (isset($_POST["weight"]) && $_POST["weight"] > 0) ? (int)$_POST["weight"] : 0;
$spotlighthis = (isset($_POST["lid"])) ? (int)$_POST["lid"] : 0;
$spotlighttop = (isset($_POST["spotlighttop"]) && ($_POST["spotlighttop"] == 1)) ? 1 : 0;
- $imgurl = ($_POST["imgurl"] && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
- $dohtml = isset($_POST['dohtml']);
- $dosmiley = isset($_POST['dosmiley']);
- $doxcode = isset($_POST['doxcode']);
- $doimage = isset($_POST['doimage']);
- $dobr = isset($_POST['dobr']);
+ include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ $allowedMimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');
+ $maxFileSize = $wfdownloads->getConfig('maxfilesize');
+ $maxImgWidth = $wfdownloads->getConfig('maximgwidth');
+ $maxImgHeight = $wfdownloads->getConfig('maximgheight');
+ $uploadDirectory = XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('catimage');
+ $uploader = new XoopsMediaUploader($uploadDirectory, $allowedMimetypes, $maxFileSize, $maxImgWidth, $maxImgHeight);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ $uploader->setTargetFileName('wfdownloads_' . uniqid(time()) . '--' . strtolower($_FILES['uploadfile']['name']));
+ //$uploader->setPrefix('wfdownloads_' . uniqid(time()) . '--');
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header("javascript:history.go(-1)",3, $errors);
+ } else {
+ $imgurl = $uploader->getSavedFileName();
+ }
+ } else {
+ $imgurl = ($_POST["imgurl"] && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
+ }
+ // Formulize module support (2006/05/04) jpc
+ if (wfdownloads_checkModule('formulize') < 300) {
+ $formulize_fid = (isset($_POST["formulize_fid"])) ? (int)$_POST["formulize_fid"] : 0;
+ }
if (!$cid) {
$category = $wfdownloads->getHandler('category')->create();
@@ -96,31 +114,25 @@
}
}
- // Added Formulize module support (2006/05/04) jpc - start
- if (wfdownloads_checkModule('formulize') < 300) {
- $formulize_fid = (isset($_POST["formulize_fid"])) ? (int)$_POST["formulize_fid"] : 0;
- }
- // Added Formulize module support (2006/05/04) jpc - end
$category->setVar('title', $_POST["title"]);
- $category->setVar('description', $_POST["description"]);
- $category->setVar('summary', $_POST["summary"]);
- $category->setVar('dohtml', $dohtml);
- $category->setVar('dosmiley', $dosmiley);
- $category->setVar('doxcode', $doxcode);
- $category->setVar('dobr', $dobr);
- $category->setVar('doimage', $doimage);
$category->setVar('pid', $pid);
$category->setVar('weight', $weight);
- $category->setVar('spotlighthis', $spotlighthis);
- $category->setVar('spotlighttop', $spotlighttop);
$category->setVar('imgurl', $imgurl);
- // Added Formulize module support (2006/05/04) jpc - start
+ $category->setVar('description', $_POST["description"]);
+ $category->setVar('summary', $_POST["summary"]);
+ $category->setVar('dohtml', isset($_POST['dohtml']));
+ $category->setVar('dosmiley', isset($_POST['dosmiley']));
+ $category->setVar('doxcode', isset($_POST['doxcode']));
+ $category->setVar('doimage', isset($_POST['doimage']));
+ $category->setVar('dobr', isset($_POST['dobr']));
+ // Formulize module support (2006/05/04) jpc
if (wfdownloads_checkModule('formulize')) {
$category->setVar('formulize_fid', $formulize_fid);
}
- // Added Formulize module support (2006/05/04) jpc - end
- $result = $wfdownloads->getHandler('category')->insert($category);
- if (!$result) {
+ $category->setVar('spotlighthis', $spotlighthis);
+ $category->setVar('spotlighttop', $spotlighttop);
+
+ if (!$wfdownloads->getHandler('category')->insert($category)) {
echo $category->getHtmlErrors();
}
if (!$cid) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -640,7 +640,7 @@
}
// Evaluate date criteria
if (!empty($filter_date)) {
- // IN PROGRESS
+ // TODO: IN PROGRESS
}
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -64,175 +64,24 @@
case "modification.show":
$requestid = WfdownloadsRequest::getInt('requestid', 0);
- $modification = $wfdownloads->getHandler('modification')->get($requestid);
- $modify_user = new XoopsUser($modification->getVar('modifysubmitter'));
- $modifyname = XoopsUserUtility::getUnameFromId((int)$modify_user->getVar('uid'));
- $modifyemail = $modify_user->getVar('email');
+ $modification = $wfdownloads->getHandler('modification')->get($requestid);
+ $modify_user = new XoopsUser($modification->getVar('modifysubmitter'));
+ $modifyname = XoopsUserUtility::getUnameFromId((int)$modify_user->getVar('uid'));
+ $modifyemail = $modify_user->getVar('email');
- $download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
+ $download = $wfdownloads->getHandler('download')->get($modification->getVar('lid'));
$orig_user = new XoopsUser($download->getVar('submitter'));
$submittername = XoopsUserUtility::getUnameFromId($download->getVar('submitter')); // $orig_user->getvar("uname");
$submitteremail = $orig_user->getVar('email');
+ $categories = $wfdownloads->getHandler('category')->getObjects();
+ $categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
wfdownloads_xoops_cp_header();
- echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODPOSTER . "</b> $submittername</div>";
- $not_allowed = array('lid', 'submitter', 'requestid', 'modifysubmitter');
// IN PROGRESS
// IN PROGRESS
// IN PROGRESS
-// IN PROGRESS ORG FROM HERE
- $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_MOD_ORIGINAL, 'storyform', 'index.php');
-
- $keys = $download->getVars();
- foreach (array_keys($keys) as $key) {
- if (in_array($key, $not_allowed)) {
- continue;
- }
- $lang_def = constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key));
-
- $content = $download->getVar($key, 'e');
- switch ($key) {
- case "platform":
- case "license":
- case "limitations":
- case "versiontypes":
- $tempArray = $wfdownloads->getConfig($key);
- $content = isset($tempArray[$download->getVar($key)]) ? $tempArray[$download->getVar($key)] : '';
- break;
- case "cid":
- $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $download->getVar($key)));
- if (!isset($category_list[0])) {
- continue;
- }
- $content = $category_list[0]->getVar('title', 'e');
- break;
- case "screenshot":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot2":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot3":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot4":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "features":
- case "requirements":
- if ($content != '') {
- $downrequirements = explode('|', trim($content));
- foreach ($downrequirements as $bi) {
- $content = "<li>" . $bi;
- }
- }
- break;
- case "dhistory":
- $content = $myts->displayTarea($content, true, false, false, false, true);
- break;
- }
- $sform->addElement(new XoopsFormLabel($lang_def, $content));
- }
- $sform->display();
-
- echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODIFYSUBMITTER . "</b> $modifyname</div>";
- $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_MOD_PROPOSED, 'storyform', 'reportsmodifications.php');
- $keys = $modification->getVars();
- foreach (array_keys($keys) as $key) {
- if (in_array($key, $not_allowed)) {
- continue;
- }
- $lang_def = constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key));
-
- $content = $modification->getVar($key, 'e');
- switch ($key) {
- case "platform":
- case "license":
- case "limitations":
- case "versiontypes":
- $tempArray = $wfdownloads->getConfig($key);
- $content = isset($tempArray[$modification->getVar($key)]) ? $tempArray[$modification->getVar($key)] : '';
- break;
- case "cid":
- $category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria('cid', $modification->getVar($key)));
- if (!isset($category_list[0])) {
- continue;
- }
- $content = $category_list[0]->getVar('title', 'e');
- break;
- case "screenshot":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot2":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot3":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "screenshot4":
- if ($content != '') {
- $content = "<img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('screenshots') . '/' . $content . "' width='"
- . $wfdownloads->getConfig('shotwidth') . "' alt='' title='' />";
- }
- break;
- case "features":
- case "requirements":
- if ($content != '') {
- $downrequirements = explode('|', trim($content));
- foreach ($downrequirements as $bi) {
- $content = "<li>" . $bi;
- }
- }
- break;
- case "dhistory":
- $content = $myts->displayTarea($content, true, false, false, false, true);
- break;
- }
- $sform->addElement(new XoopsFormLabel($lang_def, $content));
- }
-
- $button_tray = new XoopsFormElementTray('', '');
- $button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
- $button_tray->addElement(new XoopsFormHidden('lid', (int)$modification->getVar('lid')));
- $hidden = new XoopsFormHidden('op', 'modification.change');
- $button_tray->addElement($hidden);
- if (!$modification->isNew()) {
- $approve_button = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BAPPROVE, 'submit');
- $approve_button->setExtra('onclick="this.form.elements.op.value=\'modification.change\'"');
- $button_tray->addElement($approve_button);
- }
- $ignore_button = new XoopsFormButton('', '', _AM_WFDOWNLOADS_BIGNORE, 'submit');
- $ignore_button->setExtra('onclick="this.form.elements.op.value=\'modification.ignore\'"');
- $button_tray->addElement($ignore_button);
- $sform->addElement($button_tray);
- $sform->display();
-
-// IN PROGRESS
-// IN PROGRESS
-// IN PROGRESS
// IN PROGRESS NEW FROM HERE
echo "<div><b>" . _AM_WFDOWNLOADS_MOD_MODPOSTER . "</b> $submittername</div>";
@@ -249,12 +98,13 @@
// Get common keys
$commonKeys = array_intersect($downloadKeys, $modificationKeys);
// Set not allowed keys
-$notAllowedKeys = array('lid', 'submitter', 'requestid', 'modifysubmitter');
+$notAllowedKeys = array('lid', 'submitter', 'publisher', 'requestid', 'forumid', 'modifysubmitter', 'screenshots', 'paypalemail');
$i = 0;
-//$mcform->addElement(' ', false, 0, 0);
-//$mcform->addElement(_AM_WFDOWNLOADS_MOD_ORIGINAL, false, 0, 1);
-//$mcform->addElement(_AM_WFDOWNLOADS_MOD_PROPOSED, false, 0, 2);
+$mcform->addElement('', false, 0, 0);
+$mcform->addElement(_AM_WFDOWNLOADS_MOD_ORIGINAL, false, 0, 1);
+$mcform->addElement(_AM_WFDOWNLOADS_MOD_PROPOSED, false, 0, 2);
+$mcform->addElement(_EDIT, false, 0, 3);
$i = 1;
foreach ($commonKeys as $key) {
if (in_array($key, $notAllowedKeys)) {
@@ -263,8 +113,28 @@
$caption = constant("_AM_WFDOWNLOADS_MOD_" . strtoupper($key));
$downloadContent = $download->getVar($key, 'e');
$modificationContent = $modification->getVar($key, 'e');
+ $editContent = '';
// Extra jobs for some keys
switch ($key) {
+ case "title" :
+ $editContent = new XoopsFormText('', 'title', 50, 255, $downloadContent);
+ break;
+ case "url" :
+ $editContent = new XoopsFormText('', 'url', 50, 255, $downloadContent);
+ break;
+ case "size" :
+ $downloadContent = wfdownloads_bytesToSize1024($downloadContent);
+ //
+ $modificationContent = wfdownloads_bytesToSize1024($modificationContent);
+ break;
+ case "date" :
+ case "published" :
+ case "expired" :
+ case "updated" :
+ $downloadContent = ($downloadContent != false) ? formatTimestamp($downloadContent, _DATESTRING) : _NO;
+ //
+ $modificationContent = ($modificationContent != false) ? formatTimestamp($modificationContent, _DATESTRING) : _NO;
+ break;
case "platform":
case "license":
case "limitations":
@@ -282,6 +152,8 @@
$category_list = $wfdownloads->getHandler('category')->getObjects(new Criteria("cid", $modification->getVar($key)));
if (!isset($category_list[0])) continue;
$modificationContent = $category_list[0]->getVar('title', 'e');
+ //
+ $editContent = $categoriesTree->makeSelBox('cid', 'title', '-', $downloadContent);
break;
case "screenshot":
case "screenshot2":
@@ -291,6 +163,11 @@
//
if ($modificationContent != '') $modificationContent = "<img src='" . XOOPS_URL . "/{$wfdownloads->getConfig('screenshots')}/{$modificationContent}' width='{$wfdownloads->getConfig('shotwidth')}' alt='' title='' />";
break;
+ case "publisher" :
+ $downloadContent = XoopsUserUtility::getUnameFromId($downloadContent);
+ //
+ $modificationContent = XoopsUserUtility::getUnameFromId($modificationContent);
+ break;
case "features":
case "requirements":
if ($downloadContent != '') {
@@ -312,29 +189,26 @@
//
$modificationContent = $myts->displayTarea($modificationContent, true, false, false, false, true);
break;
+ case "offline":
+ $downloadContent = $downloadContent ? _YES : _NO;
+ //
+ $modificationContent = $modificationContent ? _YES : _NO;
+
}
$mcform->addElement($caption, false, $i, 0);
$mcform->addElement(new XoopsFormLabel('', $downloadContent), false, $i, 1);
$mcform->addElement(new XoopsFormLabel('', $modificationContent), false, $i, 2);
+ $mcform->addElement($editContent, false, $i, 3);
$i++;
}
-$mcform->addElement(' ', false, 0, 0);
-$mcform->addElement(_AM_WFDOWNLOADS_MOD_ORIGINAL, false, 0, 1);
-$mcform->addElement(_AM_WFDOWNLOADS_MOD_PROPOSED, false, 0, 2);
$mcform->display();
+// IN PROGRESS
+// IN PROGRESS
+// IN PROGRESS
+// IN PROGRESS ORG FROM HERE
+ $sform = new XoopsThemeForm(_AM_WFDOWNLOADS_MOD_PROPOSED, 'storyform', 'reportsmodifications.php');
-
-
-
-
-
-
-
-
-
-
-/*
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
$button_tray->addElement(new XoopsFormHidden('lid', (int)$modification->getVar('lid')));
@@ -350,10 +224,7 @@
$button_tray->addElement($ignore_button);
$sform->addElement($button_tray);
$sform->display();
-*/
-
-
xoops_cp_footer();
exit();
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -82,11 +82,10 @@
$form = new XoopsThemeForm($title, 'form_error', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
+ // category: title
$form->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FCATEGORY_TITLE, 'title', 50, 255, $this->getVar('title', 'e')), true);
-
- $totalcats = wfdownloads_categoriesCount();
- if ($totalcats > 0) {
+ // category: pid
+ if (wfdownloads_categoriesCount() > 0) {
$categories = $this->wfdownloads->getHandler('category')->getObjects();
$categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
$form->addElement(
@@ -99,48 +98,43 @@
))
);
}
-
+ // category: weight
$form->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FCATEGORY_WEIGHT, 'weight', 10, 80, $this->getVar('weight')), false);
-
+ // permission: WFDownCatPerm
$groups = $gperm_handler->getGroupIds('WFDownCatPerm', $this->getVar('cid'), $this->wfdownloads->getModule()->mid());
$groups_down_select = new XoopsFormSelectGroup(_AM_WFDOWNLOADS_FCATEGORY_GROUPPROMPT, "groups", true, $groups, 5, true);
$groups_down_select->setDescription(_AM_WFDOWNLOADS_FCATEGORY_GROUPPROMPT_DESC);
$form->addElement($groups_down_select);
+ // permission: WFUpCatPerm
$up_groups = $gperm_handler->getGroupIds('WFUpCatPerm', $this->getVar('cid'), $this->wfdownloads->getModule()->mid());
$groups_up_select = new XoopsFormSelectGroup(_AM_WFDOWNLOADS_FCATEGORY_GROUPPROMPT_UP, "up_groups", true, $up_groups, 5, true);
$groups_up_select->setDescription(_AM_WFDOWNLOADS_FCATEGORY_GROUPPROMPT_UP_DESC);
$form->addElement($groups_up_select);
-
- $graph_array = & WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage'), $type = "images");
- $indeximage_select = new XoopsFormSelect('', 'imgurl', $this->getVar('imgurl'));
- $indeximage_select->addOptionArray($graph_array);
- $indeximage_select->setExtra(
- "onchange='showImgSelected(\"image\", \"imgurl\", \"" . $this->wfdownloads->getConfig('catimage') . "\", \"\", \"" . XOOPS_URL . "\")'"
- );
- $indeximage_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FCATEGORY_CIMAGE, ' ');
- $indeximage_tray->addElement($indeximage_select);
- if ($this->getVar('imgurl') != "") {
- $indeximage_tray->addElement(
- new XoopsFormLabel('',
- "<br /><br /><img src='" . XOOPS_URL . '/' . $this->wfdownloads->getConfig('catimage') . '/' . $this->getVar('imgurl')
- . "' name='image' id='image' alt='' title='image' />")
- );
- } else {
- $indeximage_tray->addElement(
- new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/uploads/blank.gif' name='image' id='image' alt='' title='image' />")
- );
- }
- $form->addElement($indeximage_tray);
-
+ // category: imgurl
+ $imgurl_path = $this->getVar('imgurl') ? $this->wfdownloads->getConfig('catimage') . '/' . $this->getVar('imgurl') : WFDOWNLOADS_IMAGES_URL . '/blank.gif';
+ $imgurl_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FCATEGORY_CIMAGE, '<br />');
+ $imgurl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage')));
+ $imgurl_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADURL, XOOPS_URL . '/' . $this->wfdownloads->getConfig('catimage')));
+ $graph_array = & WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('catimage'), $type = "images");
+ $imgurl_select = new XoopsFormSelect('', 'imgurl', $this->getVar('imgurl'));
+ $imgurl_select->addOptionArray($graph_array);
+ $imgurl_select->setExtra(
+ "onchange='showImgSelected(\"image\", \"imgurl\", \"" . $this->wfdownloads->getConfig('catimage') . "\", \"\", \"" . XOOPS_URL . "\")'"
+ );
+ $imgurl_tray->addElement($imgurl_select, false);
+ $imgurl_tray->addElement( new XoopsFormLabel( '', "<img src='" . XOOPS_URL . "/" . $imgurl_path . "' name='image' id='image' alt='' />" ) );
+ $imgurl_tray->addElement(new XoopsFormFile(_AM_WFDOWNLOADS_BUPLOAD , 'uploadfile', 0), false);
+ $form->addElement($imgurl_tray);
+ // category: description
$description_textarea = new XoopsFormDhtmlTextArea(_AM_WFDOWNLOADS_FCATEGORY_DESCRIPTION, 'description', $this->getVar(
'description',
'e'
), 15, 60);
$form->addElement($description_textarea, true);
-
+ // category: summary
$summary_textarea = new XoopsFormTextArea(_AM_WFDOWNLOADS_FCATEGORY_SUMMARY, 'summary', $this->getVar('summary'), 10, 60);
$form->addElement($summary_textarea);
-
+ // category: dohtml, dosmiley, doxcode, doimage, dobr
$options_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_TEXTOPTIONS, '<br />');
$html_checkbox = new XoopsFormCheckBox('', 'dohtml', $this->getVar('dohtml'));
$html_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWHTML);
@@ -158,8 +152,8 @@
$breaks_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWBREAK);
$options_tray->addElement($breaks_checkbox);
$form->addElement($options_tray);
-
- // Added Formulize module support (2006/05/04) jpc - start
+ // Formulize module support (2006/05/04) jpc
+ // category: formulize_fid
if (wfdownloads_checkModule('formulize')) {
if (file_exists(XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php")) {
include_once XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php";
@@ -175,8 +169,7 @@
$form->addElement($formulize_forms);
}
}
- // Added Formulize module support (2006/05/04) jpc - end
-
+ // form: button tray
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('op', 'save'));
if ($this->isNew()) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -89,7 +89,7 @@
$this->initVar('doimage', XOBJ_DTYPE_INT, 1, false); // boolean
$this->initVar('dobr', XOBJ_DTYPE_INT, 1, false); // boolean
- // Added Formulize module support (2006/05/04) jpc - start
+ // Added Formulize module support (2006/05/04) jpc
$this->initVar('formulize_idreq', XOBJ_DTYPE_INT, 0);
// Added 3.23
@@ -453,13 +453,17 @@
$sform = new XoopsThemeForm(_MD_WFDOWNLOADS_SUBMITCATHEAD, 'storyform', $_SERVER['REQUEST_URI']);
$sform->setExtra('enctype="multipart/form-data"');
-
+ // download: title
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_FILETITLE, 'title', 50, 255, $this->getVar('title', 'e')), true);
+ // download: url
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_DLURL, 'url', 50, 255, $this->getVar('url', 'e')), false);
if (!$this->isNew()) {
+ // download: filename
$sform->addElement(new XoopsFormHidden('filename', $this->getVar('filename', 'e')));
+ // download: filetype
$sform->addElement(new XoopsFormHidden('filetype', $this->getVar('filetype', 'e')));
}
+ // download: userfile
if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups))
|| (wfdownloads_userIsAdmin())
) {
@@ -484,11 +488,12 @@
);
$sform->addElement($userfile_file, false);
}
+ // download: mirror
if ($use_mirrors !== true) {
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_MIRROR, 'mirror', 50, 255, $this->getVar('mirror', 'e')), false);
}
-
- // changed - start - March 4 2006 - jpc
+ // download: cid
+ // Formulize module support (2006/05/04) jpc
if (wfdownloads_checkModule('formulize')) {
$sform->addElement(new XoopsFormHidden('cid', $this->getVar('cid', 'e')));
} else {
@@ -498,52 +503,44 @@
new XoopsFormLabel(_MD_WFDOWNLOADS_CATEGORYC, $categoriesTree->makeSelBox('cid', 'title', "-", $this->getVar('cid', 'e')))
);
}
- // changed - end - March 4 2006 - jpc
- // Changed - start - April 22, 2006 - jwe
if (count($customArray) == 0) {
+ // download: homepagetitle
$sform->addElement(
new XoopsFormText(_MD_WFDOWNLOADS_HOMEPAGETITLEC, 'homepagetitle', 50, 255, $this->getVar('homepagetitle', 'e')),
false
);
+ // download: homepage
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_HOMEPAGEC, 'homepage', 50, 255, $this->getVar('homepage', 'e')), false);
+ // download: version
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_VERSIONC, 'version', 10, 20, $this->getVar('version', 'e')), false);
+ // download: publisher
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_PUBLISHERC, 'publisher', 50, 255, $this->getVar('publisher', 'e')), false);
+ // download: size
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_FILESIZEC, 'size', 10, 20, $this->getVar('size', 'e')), false);
-
+ // download: platform
$platform_array = $this->wfdownloads->getConfig('platform');
$platform_select = new XoopsFormSelect(_MD_WFDOWNLOADS_PLATFORMC, 'platform', $this->getVar('platform', 'e'));
$platform_select->addOptionArray($platform_array);
$sform->addElement($platform_select);
-
+ // download: license
$license_array = $this->wfdownloads->getConfig('license');
$license_select = new XoopsFormSelect(_MD_WFDOWNLOADS_LICENCEC, 'license', $this->getVar('license', 'e'));
$license_select->addOptionArray($license_array);
$sform->addElement($license_select);
-
+ // download: limitations
$limitations_array = $this->wfdownloads->getConfig('limitations');
$limitations_select = new XoopsFormSelect(_MD_WFDOWNLOADS_LIMITATIONS, 'limitations', $this->getVar('limitations', 'e'));
$limitations_select->addOptionArray($limitations_array);
$sform->addElement($limitations_select);
-
+ // download: versiontype
$versiontypes_array = $this->wfdownloads->getConfig('versiontypes');
$versiontypes_select = new XoopsFormSelect(_MD_WFDOWNLOADS_VERSIONTYPES, 'versiontypes', $this->getVar('versiontypes', 'e'));
$versiontypes_select->addOptionArray($versiontypes_array);
$sform->addElement($versiontypes_select);
-
+ // download: price
$sform->addElement(new XoopsFormText(_MD_WFDOWNLOADS_PRICEC, 'price', 10, 20, $this->getVar('price', 'e')), false);
- /*
- if ($this->wfdownloads->getConfig('autosummary') == true) {
- $summary_dhtmltextarea = new XoopsFormDhtmlTextArea(_MD_WFDOWNLOADS_SUMMARY, 'summary', $this->getVar('summary', 'e'), 10, 60, 'smartHiddenSummary');
- $summary_dhtmltextarea->setDescription(_MD_WFDOWNLOADS_SUMMARY_DESC_AUTOSUMMARY_ON);
- $summary_dhtmltextarea->setExtra('disabled', 'disabled');
- $sform->addElement($summary_dhtmltextarea, false);
- } else {
- $summary_dhtmltextarea = new XoopsFormDhtmlTextArea(_MD_WFDOWNLOADS_SUMMARY, 'summary', $this->getVar('summary', 'e'), 10, 60, 'smartHiddenSummary');
- $summary_dhtmltextarea->setDescription(_MD_WFDOWNLOADS_SUMMARY_DESC_AUTOSUMMARY_OFF);
- $sform->addElement($summary_dhtmltextarea, false);
- }
- */
+ // download: summary
switch ($this->wfdownloads->getConfig('autosummary')) {
case _WFDOWNLOADS_AUTOSUMMARY_YES :
$summary_dhtmltextarea = new XoopsFormDhtmlTextArea(_MD_WFDOWNLOADS_SUMMARY, 'summary', $this->getVar(
@@ -572,7 +569,7 @@
$sform->addElement($summary_dhtmltextarea, false);
break;
}
-
+ // download: description
$description_dhtmltextarea = new XoopsFormDhtmlTextArea(_MD_WFDOWNLOADS_DESCRIPTION, 'description', $this->getVar(
'description',
'e'
@@ -610,14 +607,14 @@
$customArray['groups']
);
}
- // Changed - end - April 22, 2006 - jwe
-
+ // download: dhistory
$sform->addElement(new XoopsFormTextArea(_MD_WFDOWNLOADS_HISTORYC, 'dhistory', $this->getVar('dhistory', 'e'), 7, 60), false);
if (!$this->isNew() && $this->getVar('dhistory', 'n') != "") {
$dhistoryaddedd_textarea = new XoopsFormTextArea(_MD_WFDOWNLOADS_HISTORYD, 'dhistoryaddedd', '', 7, 60);
$dhistoryaddedd_textarea->setDescription(_MD_WFDOWNLOADS_HISTORYD_DESC);
$sform->addElement($dhistoryaddedd_textarea, false);
}
+ // download: screenshot, screenshot2, screenshot3, screenshot4
if (($this->wfdownloads->getConfig('useruploads') && array_intersect($this->wfdownloads->getConfig('useruploadsgroup'), $groups))
|| wfdownloads_userIsAdmin()
) {
@@ -632,12 +629,13 @@
$sform->addElement(new XoopsFormFile(_MD_WFDOWNLOADS_DUPLOADSCRSHOT, 'screenshot4', 0), false);
}
}
+ // download: notifypub
$option_tray = new XoopsFormElementTray(_MD_WFDOWNLOADS_OPTIONS, '<br />');
$notify_checkbox = new XoopsFormCheckBox('', 'notifypub');
$notify_checkbox->addOption(1, _MD_WFDOWNLOADS_NOTIFYAPPROVE);
$option_tray->addElement($notify_checkbox);
$sform->addElement($option_tray);
- // button tray
+ // form: button tray
$button_tray = new XoopsFormElementTray('', '');
if ($this->isNew()) {
$button_tray->addElement(new XoopsFormHidden('op', 'download.save'));
@@ -673,13 +671,15 @@
$sform = new XoopsThemeForm($title, "storyform", $_SERVER['REQUEST_URI']);
$sform->setExtra('enctype="multipart/form-data"');
+ // download: lid
if (!$this->isNew()) {
$sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_FILE_ID, (int)$this->getVar('lid')));
}
+ // download: ipaddress
if ($this->getVar('ipaddress') != "") {
$sform->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_FILE_IP, $this->getVar('ipaddress')));
}
-
+ // download: title
$titles_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_TITLE, '<br />');
$titles = new XoopsFormText('', 'title', 50, 255, $this->getVar('title', 'e'));
$titles_tray->addElement($titles);
@@ -687,7 +687,7 @@
$titles_checkbox->addOption(1, _AM_WFDOWNLOADS_FILE_USE_UPLOAD_TITLE);
$titles_tray->addElement($titles_checkbox);
$sform->addElement($titles_tray);
-
+ // download: submitter
if (!$this->isNew()) {
//$sform -> addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_SUBMITTERID, 'submitter', 10, 10, $this->getVar('submitter', 'e')), true);
$submitter_select = new XoopsFormSelectUser (_AM_WFDOWNLOADS_FILE_SUBMITTER, 'submitter', false, $this->getVar(
@@ -699,20 +699,17 @@
} else {
$sform->addElement(new XoopsFormHidden('submitter', $xoopsUser->getVar('uid', 'e')));
}
-
+ // download: url
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_DLURL, 'url', 50, 255, $this->getVar('url', 'e')), false);
+ // download: filename
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_FILENAME, 'filename', 50, 255, $this->getVar('filename', 'e')), false);
- /*
- $filename_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_FILENAME);
- $filename_tray->addElement(new XoopsFormLabel($this->getVar('filename')));
- $filename_tray->addElement(new XoopsFormHidden("filename", $this->getVar('filename', 'e')));
- $sform->addElement($filename_tray, false);
- */
+ // download: filetype
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_FILETYPE, 'filetype', 50, 100, $this->getVar('filetype', 'e')), false);
+ // download: mirror
if ($use_mirrors !== true) {
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_MIRRORURL, 'mirror', 50, 255, $this->getVar('mirror', 'e')), false);
}
-
+ // download: userfile
$userfile_file = new XoopsFormFile(_MD_WFDOWNLOADS_UPLOAD_FILEC, 'userfile', 0);
$maxFileSize = wfdownloads_bytesToSize1024($this->wfdownloads->getConfig('maxfilesize'));
$criteria = new Criteria('mime_admin', true);
@@ -729,61 +726,58 @@
)
);
$sform->addElement($userfile_file, false);
-
- // changed - start - March 4 2006 - jpc
-// if (file_exists(XOOPS_ROOT_PATH . "/modules/formulize/include/functions.php")) {
-// $sform->addElement(new XoopsFormHidden('cid', $this->getVar('cid', 'e')));
-// } else {
+ // download: cid
$categories = $this->wfdownloads->getHandler('category')->getObjects();
$categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
$sform->addElement(
new XoopsFormLabel(_AM_WFDOWNLOADS_FILE_CATEGORY, $categoriesTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e')))
);
-// }
- // changed - end - March 4 2006 - jpc
- // changed and added - start - April 22, 2006 - jwe
if (count($customArray) == 0) {
+ // download: homepagetitle
$sform->addElement(
new XoopsFormText(_AM_WFDOWNLOADS_FILE_HOMEPAGETITLE, 'homepagetitle', 50, 255, $this->getVar('homepagetitle', 'e')),
false
);
+ // download: homepage
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_HOMEPAGE, 'homepage', 50, 255, $this->getVar('homepage', 'e')), false);
+ // download: version
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_VERSION, 'version', 10, 20, $this->getVar('version', 'e')), false);
+ // download: publisher
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_PUBLISHER, 'publisher', 50, 255, $this->getVar('publisher', 'e')), false);
-
+ // download: size
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_SIZE, 'size', 10, 20, $this->getVar('size', 'e')), false);
-
+ // download: platform
$platform_array = $this->wfdownloads->getConfig('platform');
$platform_select = new XoopsFormSelect('', 'platform', $this->getVar('platform', 'e'), '', '', 0);
$platform_select->addOptionArray($platform_array);
$platform_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_PLATFORM, ' ');
$platform_tray->addElement($platform_select);
$sform->addElement($platform_tray);
-
+ // download: license
$license_array = $this->wfdownloads->getConfig('license');
$license_select = new XoopsFormSelect('', 'license', $this->getVar('license', 'e'), '', '', 0);
$license_select->addOptionArray($license_array);
$license_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_LICENCE, ' ');
$license_tray->addElement($license_select);
$sform->addElement($license_tray);
-
+ // download: limitations
$limitations_array = $this->wfdownloads->getConfig('limitations');
$limitations_select = new XoopsFormSelect('', 'limitations', $this->getVar('limitations', 'e'), '', '', 0);
$limitations_select->addOptionArray($limitations_array);
$limitations_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_LIMITATIONS, ' ');
$limitations_tray->addElement($limitations_select);
$sform->addElement($limitations_tray);
-
+ // download: versiontypes
$versiontypes_array = $this->wfdownloads->getConfig('versiontypes');
$versiontypes_select = new XoopsFormSelect('', 'versiontypes', $this->getVar('versiontypes', 'e'), '', '', 0);
$versiontypes_select->addOptionArray($versiontypes_array);
$versiontypes_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_VERSIONTYPES, ' ');
$versiontypes_tray->addElement($versiontypes_select);
$sform->addElement($versiontypes_tray);
-
+ // download: versiontypes
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_FILE_PRICE, 'price', 10, 20, $this->getVar('price', 'e')), false);
-
+ // download: summary
$mode = 'html';
$summary_tray = new XoopsFormElementTray(_MD_WFDOWNLOADS_SUMMARY, '<br />');
$options['name'] = 'summary';
@@ -796,13 +790,6 @@
$summary_editor = new XoopsFormEditor('', $this->wfdownloads->getConfig('editor_options'), $options, $nohtml = false,
$onfailure = 'textarea');
$summary_tray->addElement($summary_editor);
- /*
- if ($this->wfdownloads->getConfig('autosummary') == true) {
- $summary_tray->setDescription(_MD_WFDOWNLOADS_SUMMARY_DESC_AUTOSUMMARY_ON);
- } else {
- $summary_tray->setDescription(_MD_WFDOWNLOADS_SUMMARY_DESC_AUTOSUMMARY_OFF);
- }
- */
switch ($this->wfdownloads->getConfig('autosummary')) {
case _WFDOWNLOADS_AUTOSUMMARY_YES :
$summary_tray->setDescription(_MD_WFDOWNLOADS_SUMMARY_DESC_AUTOSUMMARY_YES);
@@ -816,7 +803,7 @@
break;
}
$sform->addElement($summary_tray);
-
+ // download: decription
$description_tray = new XoopsFormElementTray(_MD_WFDOWNLOADS_DESCRIPTION, '<br />');
$options['name'] = 'description';
$options['value'] = $this->getVar('description', 'e');
@@ -829,9 +816,9 @@
$description_tray->addElement($description_editor, true);
$description_tray->setDescription(_MD_WFDOWNLOADS_DESCRIPTION_DESC);
$sform->addElement($description_tray);
-
-
+ // download: features
$sform->addElement(new XoopsFormTextArea(_AM_WFDOWNLOADS_FILE_KEYFEATURES, 'features', $this->getVar('features', 'e'), 7, 60), false);
+ // download: requirements
$sform->addElement(
new XoopsFormTextArea(_AM_WFDOWNLOADS_FILE_REQUIREMENTS, 'requirements', $this->getVar('requirements', 'e'), 7, 60),
false
@@ -839,7 +826,7 @@
} else {
// if we are using a custom form, then add in the form's elements here
- // $sform -> addElement(new XoopsFormDhtmlTextArea(_AM_WFDOWNLOADS_FILE_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60, "smartHiddenDescription"), true);
+ // download: description
$description_tray = new XoopsFormElementTray(_MD_WFDOWNLOADS_DESCRIPTION, '<br />');
$options['name'] = 'description';
$options['value'] = $this->getVar('description', 'e');
@@ -852,7 +839,7 @@
$description_tray->addElement($description_editor, true);
$description_tray->setDescription(_MD_WFDOWNLOADS_DESCRIPTION_DESC);
$sform->addElement($description_tray);
-
+ // download: size
$sform->addElement(new XoopsFormHidden('size', $this->getVar('size', 'e')));
$sform = compileElements(
$customArray['fid'],
@@ -866,13 +853,12 @@
$customArray['groups']
);
}
- // Changed and added - end - April 22, 2006 - jwe
-
+ // download: dhistory
$sform->addElement(new XoopsFormTextArea(_AM_WFDOWNLOADS_FILE_HISTORY, 'dhistory', $this->getVar('dhistory', 'e'), 7, 60), false);
-
if (!$this->isNew() && $this->getVar('dhistory') != "") {
$sform->addElement(new XoopsFormTextArea(_AM_WFDOWNLOADS_FILE_HISTORYD, 'dhistoryaddedd', '', 7, 60), false);
}
+ // download: screenshot
$graph_array = & WfsLists :: getListTypeAsArray(
XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots'),
$type = "images"
@@ -899,7 +885,7 @@
);
}
$sform->addElement($indeximage_tray);
-
+ // download: screenshot2
$graph_array2 = & WfsLists :: getListTypeAsArray(
XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots'),
$type = "images"
@@ -926,7 +912,7 @@
);
}
$sform->addElement($indeximage_tray2);
-
+ // download: screenshot3
$graph_array3 = & WfsLists :: getListTypeAsArray(
XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots'),
$type = "images"
@@ -953,7 +939,7 @@
);
}
$sform->addElement($indeximage_tray3);
-
+ // download: screenshot4
$graph_array4 = & WfsLists :: getListTypeAsArray(
XOOPS_ROOT_PATH . '/' . $this->wfdownloads->getConfig('screenshots'),
$type = "images"
@@ -980,9 +966,8 @@
);
}
$sform->addElement($indeximage_tray4);
-
$sform->insertBreak(sprintf(_AM_WFDOWNLOADS_FILE_MUSTBEVALID, "<b>" . $this->wfdownloads->getConfig('screenshots') . "</b>"), "even");
-
+ // download: published
$publishtext = ($this->isNew() || $this->getVar('published') == 0) ? _AM_WFDOWNLOADS_FILE_SETPUBLISHDATE
: _AM_WFDOWNLOADS_FILE_SETNEWPUBLISHDATE;
if ($this->getVar('published') > time()) {
@@ -994,18 +979,16 @@
: _AM_WFDOWNLOADS_FILE_SETDATETIMEPUBLISH;
$publishdate_checkbox = new XoopsFormCheckBox('', 'publishdateactivate', $ispublished);
$publishdate_checkbox->addOption(1, $publishdates . '<br />');
-
if (!$this->isNew()) {
$sform->addElement(new XoopsFormHidden('was_published', $this->getVar('published', 'e')));
$sform->addElement(new XoopsFormHidden('was_expired', $this->getVar('expired', 'e')));
}
-
$publishdate_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_PUBLISHDATE, '');
$publishdate_tray->addElement($publishdate_checkbox);
$publishdate_tray->addElement(new XoopsFormDateTime($publishtext, 'published', 15, $this->getVar('published', 'e')));
$publishdate_tray->addElement(new XoopsFormRadioYN(_AM_WFDOWNLOADS_FILE_CLEARPUBLISHDATE, 'clearpublish', 0));
$sform->addElement($publishdate_tray);
-
+ // download: expired
$isexpired = ($this->getVar('expired', 'e') > time()) ? true : false;
$expiredates = ($this->getVar('expired', 'e') > time()) ?
_AM_WFDOWNLOADS_FILE_EXPIREDATESET . formatTimestamp($this->getVar('expired'), 'Y-m-d H:s') : _AM_WFDOWNLOADS_FILE_SETDATETIMEEXPIRE;
@@ -1013,26 +996,25 @@
? _AM_WFDOWNLOADS_FILE_EXPIREWARNING : '';
$expiredate_checkbox = new XoopsFormCheckBox('', 'expiredateactivate', $isexpired);
$expiredate_checkbox->addOption(1, $expiredates . '<br />');
-
$expiredate_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_FILE_EXPIREDATE . $warning, '');
$expiredate_tray->addElement($expiredate_checkbox);
$expiredate_tray->addElement(new XoopsFormDateTime(_AM_WFDOWNLOADS_FILE_SETEXPIREDATE, 'expired', 15, $this->getVar('expired')));
$expiredate_tray->addElement(new XoopsFormRadioYN(_AM_WFDOWNLOADS_FILE_CLEAREXPIREDATE, 'clearexpire', 0));
$sform->addElement($expiredate_tray);
-
+ // download: offline
$filestatus_radio = new XoopsFormRadioYN(_AM_WFDOWNLOADS_FILE_FILESSTATUS, 'offline', $this->getVar('offline', 'e'));
$sform->addElement($filestatus_radio);
-
+ // download: up_dated
$file_updated_radio = new XoopsFormRadioYN(_AM_WFDOWNLOADS_FILE_SETASUPDATED, 'up_dated', ($this->getVar('updated', 'e') == true));
$sform->addElement($file_updated_radio);
-
+ // download: approved
if (!$this->isNew() && $this->getVar('published') == 0) {
$approved = ($this->getVar('published') == 0) ? false : true;
$approve_checkbox = new XoopsFormCheckBox(_AM_WFDOWNLOADS_FILE_EDITAPPROVE, 'approved', true);
$approve_checkbox->addOption(1, " ");
$sform->addElement($approve_checkbox);
}
-
+ // form: button tray
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('op', 'download.save'));
if ($this->isNew()) {
@@ -1061,20 +1043,20 @@
return $sform;
}
- // Added Formulize module support (2006/05/04) jpc - start
+ // Added Formulize module support (2006/05/04) jpc
function getCategoryForm()
{
include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once(XOOPS_ROOT_PATH . '/class/tree.php');
$sform = new XoopsThemeForm(_MD_WFDOWNLOADS_FFS_SUBMITCATEGORYHEAD, 'storyform', $_SERVER['REQUEST_URI']);
$sform->setExtra('enctype="multipart/form-data"');
-
+ // download: cid
$categories = $this->wfdownloads->getHandler('category')->getUserUpCategories();
$categoriesTree = new XoopsObjectTree($categories, 'cid', 'pid');
$sform->addElement(
new XoopsFormLabel(_MD_WFDOWNLOADS_CATEGORYC, $categoriesTree->makeSelBox('cid', 'title', '-', $this->getVar('cid', 'e')))
);
-
+ // form: button tray
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormButton('', 'submit_category', _SUBMIT, 'submit'));
if (!$this->isNew()) {
@@ -1085,8 +1067,6 @@
return $sform;
}
- // Added Formulize module support (2006/05/04) jpc - end
-
/**
* Returns an array representation of the object
*
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/multicolumnsthemeform.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -149,10 +149,10 @@
function render()
{
$ele_name = $this->getName();
- $ret = '';
- $ret .= '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>' . NWLINE;
- $ret .= '<table width="100%" class="outer" cellspacing="1">' . NWLINE;
- $ret .= '<tr><th colspan="' . $this->_columns . '">' . $this->getTitle() . '</th></tr>' . NWLINE;
+ $ret = "";
+ $ret .= "<form name='{$ele_name}' id='{$ele_name}' action='{$this->getAction()}' method='{$this->getMethod()}' onsubmit='return xoopsFormValidate_{$ele_name}();' {$this->getExtra()} >" . NWLINE;
+ $ret .= "<table width='100%' class='outer' cellspacing='1'>" . NWLINE;
+ $ret .= "<tr><th colspan='{$this->_columns}'>{$this->getTitle()}</th></tr>" . NWLINE;
$hidden = '';
$class = 'even';
for ($row = 0; $row < $this->_rows; $row++) {
@@ -170,13 +170,13 @@
if (!$ele->getNocolspan()) {
//$ret .= '<tr valign="top" align="left"><td class="head">';
if (($caption = $ele->getCaption()) != '') {
- $ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
- $ret .= '<span class="caption-text">' . $caption . '</span>';
- $ret .= '<span class="caption-marker">*</span>';
- $ret .= '</div>';
+ $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>";
+ $ret .= "<span class='caption-text'>{$caption}</span>";
+ $ret .= "<span class='caption-marker'>*</span>";
+ $ret .= "</div>";
}
if (($desc = $ele->getDescription()) != '') {
- $ret .= '<div class="xoops-form-element-help">' . $desc . '</div>';
+ $ret .= "<div class='xoops-form-element-help'>{$desc}</div>";
}
//$ret .= '</td><td class="' . $class . '">';
$ret .= $ele->render();
@@ -184,10 +184,10 @@
} else {
//$ret .= '<tr valign="top" align="left"><td class="head" colspan="2">';
if (($caption = $ele->getCaption()) != '') {
- $ret .= '<div class="xoops-form-element-caption' . ($ele->isRequired() ? '-required' : '') . '">';
- $ret .= '<span class="caption-text">' . $caption . '</span>';
- $ret .= '<span class="caption-marker">*</span>';
- $ret .= '</div>';
+ $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>";
+ $ret .= "<span class='caption-text'>{$caption}</span>";
+ $ret .= "<span class='caption-marker'>*</span>";
+ $ret .= "</div>";
}
//$ret .= '</td></tr>' . NWLINE;
//$ret .= '<tr valign="top" align="left"><td class="' . $class . '" colspan="' . $this->_columns . '">';
@@ -201,9 +201,9 @@
}
$ret .= "</tr>";
}
- $ret .= '</table>' . NWLINE;
- $ret .= ' ' . $hidden . NWLINE;
- $ret .= '</form>' . NWLINE;
+ $ret .= "</table>" . NWLINE;
+ $ret .= "{$hidden}" . NWLINE;
+ $ret .= "</form>" . NWLINE;
$ret .= $this->renderValidationJS(true);
return $ret;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/wfdownloads.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -42,6 +42,9 @@
if (!$instance) {
$instance = new self($debug);
}
+//error_log("istance: [" . print_r($istance,true) . "]");
+//phpinfo();
+//debug_print_backtrace ();
return $instance;
}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/docs/changelog.txt 2013-10-15 21:25:44 UTC (rev 12176)
@@ -1,4 +1,4 @@
-<b><u>=> Version 3.23 Beta (2013-10-10)</u></b>
+<b><u>=> Version 3.23 Beta (2013-10-15)</u></b>
- standardization of English language files (cesag)
- fixed: typos in english folder (cesag)
- module standardization: header.php, admin/admin_header.php, xoops_version.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-10-15 17:41:43 UTC (rev 12175)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-10-15 21:25:44 UTC (rev 12176)
@@ -975,27 +975,24 @@
*
* @return
**/
-function wfdownloads_createThumb($imgName, $imgPath, $imgSavePath, $width = 100, $height = 100, $quality = 100, $update = 0, $aspect = 1)
+function wfdownloads_createThumb($imgName, $imgPath, $imgSavePath, $width = 100, $height = 100, $quality = 100, $update = false, $aspect = 1)
{
$wfdownloads = WfdownloadsWfdownloads::getInstance();
- // paths
- if ($wfdownloads->getConfig('usethumbs') == 0) {
- $imagePath = XOOPS_URL . "/{$imgPath}/{$imgName}";
-
- return $imagePath;
+ // Paths
+ if ($wfdownloads->getConfig('usethumbs') == false) {
+ $imageURL = XOOPS_URL . "/{$imgPath}/{$imgName}";
+ return $imageURL;
}
- $imagePath = XOOPS_ROOT_PATH . "/{$img_path}/{$imgName}";
-
+ $imagePath = XOOPS_ROOT_PATH . "/{$imgPath}/{$imgName}";
$saveFile = "{$imgPath}/{$imgSavePath}/{$width}x{$height}_{$imgName}";
- $savePath = XOOPS_ROOT_PATH . '/' . $savefile;
+ $savePath = XOOPS_ROOT_PATH . '/' . $saveFile;
// Return the image if no update and image exists
- if ($update == 0 && file_exists($savePath)) {
+ if ($update == false && file_exists($savePath)) {
return XOOPS_URL . '/' . $saveFile;
}
-
+ // Original image info
list($origWidth, $origHeight, $type, $attr) = getimagesize($imagePath, $info);
-
switch ($type) {
case 1:
# GIF image
@@ -1014,12 +1011,13 @@
$img = @imageCreateFromPNG($imagePath);
break;
default...
[truncated message content] |