|
From: <luc...@us...> - 2013-06-03 19:17:18
|
Revision: 11617
http://sourceforge.net/p/xoops/svn/11617
Author: luciorota
Date: 2013-06-03 19:17:16 +0000 (Mon, 03 Jun 2013)
Log Message:
-----------
deleted unused files
Removed Paths:
-------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header2.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/newstory.php
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header2.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header2.php 2013-06-03 17:23:26 UTC (rev 11616)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/admin_header2.php 2013-06-03 19:17:16 UTC (rev 11617)
@@ -1,46 +0,0 @@
-<?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$
- */
-include '../../../include/cp_header.php';
-include_once(XOOPS_ROOT_PATH . '/modules/wfdownloads/include/functions.php');
-include_once(XOOPS_ROOT_PATH . '/modules/wfdownloads/include/common.php');
-
-include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
-
-$myts = &MyTextSanitizer::getInstance();
-
-$imagearray = array(
- 'editimg' => "<img src='../images/icon/edit.gif' alt='" . _AM_WFD_ICO_EDIT . "' title='" . _AM_WFD_ICO_EDIT . "' align='middle'>",
- 'deleteimg' => "<img src='../images/icon/delete.gif' alt='" . _AM_WFD_ICO_DELETE . "' title='" . _AM_WFD_ICO_DELETE . "' align='middle'>",
- 'online' => "<img src='../images/icon/on.gif' alt='" . _AM_WFD_ICO_ONLINE . "' title='" . _AM_WFD_ICO_ONLINE . "' align='middle'>",
- 'offline' => "<img src='../images/icon/off.gif' alt='" . _AM_WFD_ICO_OFFLINE . "' title='" . _AM_WFD_ICO_OFFLINE . "' align='middle'>",
- 'approved' => "<img src='../images/icon/on.gif' alt=''" . _AM_WFD_ICO_APPROVED . "' title=''" . _AM_WFD_ICO_APPROVED . "' align='middle'>",
- 'notapproved' => "<img src='../images/icon/off.gif' alt='" . _AM_WFD_ICO_NOTAPPROVED . "' title='" . _AM_WFD_ICO_NOTAPPROVED . "' align='middle'>",
- 'relatedfaq' => "<img src='../images/icon/link.gif' alt='" . _AM_WFD_ICO_LINK . "' title='" . _AM_WFD_ICO_LINK . "' align='middle'>",
- 'relatedurl' => "<img src='../images/icon/urllink.gif' alt='" . _AM_WFD_ICO_URL . "' title='" . _AM_WFD_ICO_URL . "' align='middle'>",
- 'addfaq' => "<img src='../images/icon/add.gif' alt='" . _AM_WFD_ICO_ADD . "' title='" . _AM_WFD_ICO_ADD . "' align='middle'>",
- 'approve' => "<img src='../images/icon/approve.gif' alt='" . _AM_WFD_ICO_APPROVE . "' title='" . _AM_WFD_ICO_APPROVE . "' align='middle'>",
- 'statsimg' => "<img src='../images/icon/stats.gif' alt='" . _AM_WFD_ICO_STATS . "' title='" . _AM_WFD_ICO_STATS . "' align='middle'>",
- 'ignore' => "<img src='../images/icon/ignore.gif' alt='" . _AM_WFD_ICO_IGNORE . "' title='" . _AM_WFD_ICO_IGNORE . "' align='middle'>",
- 'ack_yes' => "<img src='../images/icon/on.gif' alt='" . _AM_WFD_ICO_ACK . "' title='" . _AM_WFD_ICO_ACK . "' align='middle'>",
- 'ack_no' => "<img src='../images/icon/off.gif' alt='" . _AM_WFD_ICO_REPORT . "' title='" . _AM_WFD_ICO_REPORT . "' align='middle'>",
- 'con_yes' => "<img src='../images/icon/on.gif' alt='" . _AM_WFD_ICO_CONFIRM . "' title='" . _AM_WFD_ICO_CONFIRM . "' align='middle'>",
- 'con_no' => "<img src='../images/icon/off.gif' alt='" . _AM_WFD_ICO_CONBROKEN . "' title='" . _AM_WFD_ICO_CONBROKEN . "' align='middle'>"
- );
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/newstory.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/newstory.php 2013-06-03 17:23:26 UTC (rev 11616)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/newstory.php 2013-06-03 19:17:16 UTC (rev 11617)
@@ -1,57 +0,0 @@
-<?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$
- */
-include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
-
-$story = new NewsStory();
-$story -> setUid($xoopsUser -> uid());
-$story -> setPublished(time());
-$story -> setExpired(0);
-$story -> setType("admin");
-$story -> setHostname(getenv("REMOTE_ADDR"));
-$story -> setApproved(1);
-$topicid = $_POST["newstopicid"];
-$story -> setTopicId($topicid);
-$story -> setTitle($title);
-
-$_fileid = (isset($lid) && $lid > 0) ? $lid : $newid;
-$_link = $_POST["description"] . "<br /><div><a href=" . XOOPS_URL . "/modules/wfdownloads/singlefile.php?cid=" . $cid . "&lid=" . $_fileid . ">" . $title . "</a></div>";
-
-$description = $myts->addslashes(trim($_link));
-$story -> setHometext($description);
-$story -> setBodytext('');
-$nohtml = (empty($nohtml)) ? 0 : 1;
-$nosmiley = (empty($nosmiley)) ? 0 : 1;
-$story -> setNohtml($nohtml);
-$story -> setNosmiley($nosmiley);
-$story -> store();
-$notification_handler = & xoops_gethandler('notification');
-$tags = array();
-$tags['STORY_NAME'] = $story -> title();
-
-$modhandler = & xoops_gethandler('module');
-$newsModule = & $modhandler -> getByDirname("news");
-
-$tags['STORY_URL'] = XOOPS_URL . '/modules/news/article.php?storyid=' . $story -> storyid();
-if (!empty($isnew)) {
- $notification_handler -> triggerEvent('story', $story -> storyid(), 'approve', $tags);
-}
-$notification_handler -> triggerEvent('global', 0, 'new_story', $tags);
-unset($xoopsModule);
|
|
From: <luc...@us...> - 2013-07-17 18:17:34
|
Revision: 11835
http://sourceforge.net/p/xoops/svn/11835
Author: luciorota
Date: 2013-07-17 18:17:28 +0000 (Wed, 17 Jul 2013)
Log Message:
-----------
FIXED ERRORS
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-07-17 11:48:20 UTC (rev 11834)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-07-17 18:17:28 UTC (rev 11835)
@@ -59,7 +59,6 @@
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation('indexpage.php');
- //wfdownloads_adminMenu(1, _AM_WFD_INDEXPAGE);
echo "<fieldset><legend>" . _AM_WFD_IPAGE_INFORMATION . "</legend>\n";
echo "<div>" . _AM_WFD_MINDEX_PAGEINFOTXT . "</div>\n";
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-07-17 11:48:20 UTC (rev 11834)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-07-17 18:17:28 UTC (rev 11835)
@@ -71,27 +71,31 @@
case "mirror.edit" :
$mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$mirror = $mirror_handler->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
}
- if ($ok == true) {
- $mirror->setVar('title', trim($_POST['title']));
- $mirror->setVar('homeurl', formatURL(trim($_POST['homeurl'])));
- $mirror->setVar('location', trim($_POST['location']));
- $mirror->setVar('continent', trim($_POST['continent']));
- $mirror->setVar('downurl', formatURL(trim($_POST['downurl'])));
- $mirror->setVar('submit', intval($_POST['approve']));
- $mirror_handler->insert($mirror);
- redirect_header($currentFile, 1, _AM_WFD_MIRROR_MIRROR_UPDATED);
+ wfdownloads_xoops_cp_header();
+ $sform = $mirror->getForm();
+ $sform -> display();
+ xoops_cp_footer();
+ break;
+
+ case "mirror.save" :
+ $mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
+ if (!$mirror = $mirror_handler->get($mirror_id)) {
+ redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
exit();
- } else {
- wfdownloads_xoops_cp_header();
- $sform = $mirror->getForm();
- $sform -> display();
- xoops_cp_footer();
}
+ $mirror->setVar('title', trim($_POST['title']));
+ $mirror->setVar('homeurl', formatURL(trim($_POST['homeurl'])));
+ $mirror->setVar('location', trim($_POST['location']));
+ $mirror->setVar('continent', trim($_POST['continent']));
+ $mirror->setVar('downurl', formatURL(trim($_POST['downurl'])));
+ $mirror->setVar('submit', (int)($_POST['approve']));
+ $mirror_handler->insert($mirror);
+ redirect_header($currentFile, 1, _AM_WFD_MIRROR_MIRROR_UPDATED);
+ exit();
break;
case "mirrors.list" :
@@ -103,7 +107,7 @@
$start_waiting = wfdownloads_CleanVars($_GET, 'start_waiting', 0, 'int');
$start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
- $criteria_waiting = new Criteria("submit", false);
+ $criteria_waiting = new Criteria("submit", 0); // false
$waiting_count = $mirror_handler->getCount($criteria_waiting);
$criteria_waiting->setSort("date");
$criteria_waiting->setOrder("DESC");
@@ -111,7 +115,7 @@
$criteria_waiting->setStart($start_waiting);
$mirrors_waiting = $mirror_handler->getObjects($criteria_waiting);
- $criteria_published = new Criteria("submit", true);
+ $criteria_published = new Criteria("submit", 1); // true
$published_count = $mirror_handler->getCount($criteria_published);
$criteria_published->setSort("date");
$criteria_published->setOrder("DESC");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-07-17 11:48:20 UTC (rev 11834)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-07-17 18:17:28 UTC (rev 11835)
@@ -58,7 +58,7 @@
exit();
}
if ($ok == true) {
- $review->setVar('submit', 1);
+ $review->setVar('submit', 1); // true
$review_handler->insert($review);
redirect_header($currentFile, 1, sprintf( _AM_WFD_REV_REVIEW_UPDATED, $review->getVar('title')));
exit();
@@ -71,27 +71,31 @@
case "review.edit":
$review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$review = $review_handler->get($review_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
}
- if ($ok == true) {
- $review->setVar('title', trim($_POST['title']));
- $review->setVar('review', trim($_POST['review']));
- $review->setVar('rated', (int)$_POST['rated']);
- $review->setVar('submit', (int)$_POST['approve']);
- $review_handler->insert($review);
- redirect_header($currentFile, 1, _AM_WFD_REV_REVIEW_UPDATED);
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation($currentFile);
+ $sform = $review->getForm();
+ $sform -> display();
+ xoops_cp_footer();
+ break;
+
+ case "review.save":
+ $review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
+ if (!$review = $review_handler->get($review_id)) {
+ redirect_header($currentFile, 4, _AM_WFD_ERROR_REVIEWNOTFOUND);
exit();
- } else {
- wfdownloads_xoops_cp_header();
- $indexAdmin = new ModuleAdmin();
- echo $indexAdmin->addNavigation($currentFile);
- $sform = $review->getForm();
- $sform -> display();
- xoops_cp_footer();
}
+ $review->setVar('title', trim($_POST['title']));
+ $review->setVar('review', trim($_POST['review']));
+ $review->setVar('rated', (int)$_POST['rated']);
+ $review->setVar('submit', (int)$_POST['approve']);
+ $review_handler->insert($review);
+ redirect_header($currentFile, 1, _AM_WFD_REV_REVIEW_UPDATED);
+ exit();
break;
case "reviews.list":
@@ -99,7 +103,7 @@
$start_waiting = wfdownloads_CleanVars($_GET, 'start_waiting', 0, 'int');
$start_published = wfdownloads_CleanVars($_GET, 'start_published', 0, 'int');
- $criteria_waiting = new Criteria("submit", false);
+ $criteria_waiting = new Criteria("submit", 0); // false
$waiting_count = $review_handler->getCount();
$criteria_waiting->setSort("date");
$criteria_waiting->setOrder("DESC");
@@ -107,7 +111,7 @@
$criteria_waiting->setStart($start_waiting);
$reviews_waiting = $review_handler->getObjects($criteria_waiting);
- $criteria_published = new Criteria("submit", true);
+ $criteria_published = new Criteria("submit", 1); // true
$published_count = $review_handler->getCount();
$criteria_published->setSort("date");
$criteria_published->setOrder("DESC");
|
|
From: <luc...@us...> - 2013-10-15 22:20:15
|
Revision: 12177
http://sourceforge.net/p/xoops/svn/12177
Author: luciorota
Date: 2013-10-15 22:20:13 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
small improvements in categories and indexpage forms
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-10-15 21:25:44 UTC (rev 12176)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-10-15 22:20:13 UTC (rev 12177)
@@ -88,7 +88,6 @@
$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();
@@ -97,7 +96,7 @@
$imgurl = $uploader->getSavedFileName();
}
} else {
- $imgurl = ($_POST["imgurl"] && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
+ $imgurl = (isset($_POST["imgurl"]) && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
}
// Formulize module support (2006/05/04) jpc
if (wfdownloads_checkModule('formulize') < 300) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-10-15 21:25:44 UTC (rev 12176)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-10-15 22:20:13 UTC (rev 12177)
@@ -24,10 +24,29 @@
$op = WfdownloadsRequest::getString('op', 'indexpage.form');
switch ($op) {
case "indexpage.save":
+ // Get post parameters
$indexheading = $myts->addslashes($_POST['indexheading']);
$indexheader = $myts->addslashes($_POST['indexheader']);
$indexfooter = $myts->addslashes($_POST['indexfooter']);
- $indeximage = $myts->addslashes($_POST['indeximage']);
+ 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('mainimagedir');
+ $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->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header("javascript:history.go(-1)",3, $errors);
+ } else {
+ $indeximage = $uploader->getSavedFileName();
+ }
+ } else {
+ $indeximage = (isset($_POST["indeximage"]) && $_POST["indeximage"] != "blank.png") ? $myts->addslashes($_POST['indeximage']) : "";
+ }
$nohtml = isset($_POST['nohtml']);
$nosmiley = isset($_POST['nosmiley']);
$noxcodes = isset($_POST['noxcodes']);
@@ -35,12 +54,20 @@
$nobreak = isset($_POST['nobreak']);
$indexheaderalign = $_POST['indexheaderalign'];
$indexfooteralign = $_POST['indexfooteralign'];
-
- $xoopsDB->query(
- "update " . $xoopsDB->prefix("wfdownloads_indexpage") . " set indexheading='$indexheading', indexheader='$indexheader', indexfooter='$indexfooter', indeximage='$indeximage', indexheaderalign='$indexheaderalign', indexfooteralign='$indexfooteralign', nohtml='"
- . intval($nohtml) . "', nosmiley='" . intval($nosmiley) . "', noxcodes='" . intval($noxcodes) . "', noimages='" . intval($noimages)
- . "', nobreak='" . intval($nobreak) . "' "
- );
+ // Update db
+ $sql = "update {$xoopsDB->prefix("wfdownloads_indexpage")} set";
+ $sql.= " indexheading='{$indexheading}',";
+ $sql.= " indexheader='{$indexheader}',";
+ $sql.= " indexfooter='{$indexfooter}',";
+ $sql.= " indeximage='{$indeximage}',";
+ $sql.= " indexheaderalign='{$indexheaderalign}',";
+ $sql.= " indexfooteralign='{$indexfooteralign}',";
+ $sql.= " nohtml='{$nohtml}',";
+ $sql.= " nosmiley='{$nosmiley}',";
+ $sql.= " noxcodes='{$noxcodes}',";
+ $sql.= " noimages='{$noimages}',";
+ $sql.= " nobreak='{$nobreak}' ";
+ $xoopsDB->query($sql);
redirect_header(WFDOWNLOADS_URL . '/admin/indexpage.php', 1, _AM_WFDOWNLOADS_IPAGE_UPDATED);
exit();
@@ -51,10 +78,9 @@
include_once WFDOWNLOADS_ROOT_PATH . '/class/wfdownloads_lists.php';
include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
- $result = $xoopsDB->query(
- "SELECT indeximage, indexheading, indexheader, indexfooter, nohtml, nosmiley, noxcodes, noimages, nobreak, indexheaderalign, indexfooteralign FROM "
- . $xoopsDB->prefix('wfdownloads_indexpage') . " "
- );
+ $sql = "SELECT indeximage, indexheading, indexheader, indexfooter, nohtml, nosmiley, noxcodes, noimages, nobreak, indexheaderalign, indexfooteralign";
+ $sql.= " FROM {$xoopsDB->prefix('wfdownloads_indexpage')} ";
+ $result = $xoopsDB->query($sql);
list($indeximage, $indexheading, $indexheader, $indexfooter, $nohtml, $nosmiley, $noxcodes, $noimages, $nobreak, $indexheaderalign,
$indexfooteralign)
= $xoopsDB->fetchrow($result);
@@ -68,63 +94,59 @@
echo "</fieldset>\n";
$sform = new XoopsThemeForm(_AM_WFDOWNLOADS_IPAGE_MODIFY, "op", xoops_getenv('PHP_SELF'));
+ $sform->setExtra('enctype="multipart/form-data"');
+ // indexpage: indexheading
$sform->addElement(new XoopsFormText(_AM_WFDOWNLOADS_IPAGE_CTITLE, 'indexheading', 60, 60, $indexheading), false);
- $graph_array = WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('mainimagedir'), $type = "images");
- $indeximage_select = new XoopsFormSelect('', 'indeximage', $indeximage);
- $indeximage_select->addOptionArray($graph_array);
- $indeximage_select->setExtra(
- "onchange='showImgSelected(\"image\", \"indeximage\", \"" . $wfdownloads->getConfig('mainimagedir') . "\", \"\", \"" . XOOPS_URL . "\")'"
- );
- $indeximage_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_IPAGE_CIMAGE, ' ');
- $indeximage_tray->addElement($indeximage_select);
- if (!empty($indeximage)) {
- $indeximage_tray->addElement(
- new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . '/' . $wfdownloads->getConfig('mainimagedir') . '/' . $indeximage
- . "' 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' />")
- );
- }
+ // indexpage: indeximage
+ $indeximage_path = $indeximage ? $wfdownloads->getConfig('mainimagedir') . '/' . $indeximage : WFDOWNLOADS_IMAGES_URL . '/blank.gif';
+ $indeximage_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_IPAGE_CIMAGE, '<br />');
+ $indeximage_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('mainimagedir')));
+ $indeximage_tray->addElement(new XoopsFormLabel(_AM_WFDOWNLOADS_DOWN_FUPLOADURL, XOOPS_URL . '/' . $wfdownloads->getConfig('mainimagedir')));
+ $graph_array = & WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $wfdownloads->getConfig('mainimagedir'), $type = "images");
+ $indeximage_select = new XoopsFormSelect('', 'indeximage', $indeximage);
+ $indeximage_select->addOptionArray($graph_array);
+ $indeximage_select->setExtra(
+ "onchange='showImgSelected(\"image\", \"indeximage\", \"" . $wfdownloads->getConfig('mainimagedir') . "\", \"\", \"" . XOOPS_URL . "\")'"
+ );
+ $indeximage_tray->addElement($indeximage_select, false);
+ $indeximage_tray->addElement( new XoopsFormLabel( '', "<img src='" . XOOPS_URL . "/" . $indeximage_path . "' name='image' id='image' alt='' />" ) );
+ $indeximage_tray->addElement(new XoopsFormFile(_AM_WFDOWNLOADS_BUPLOAD , 'uploadfile', 0), false);
$sform->addElement($indeximage_tray);
-
+ // indexpage: indexheader
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_WFDOWNLOADS_IPAGE_CHEADING, 'indexheader', $indexheader, 15, 60));
+ // indexpage: indexheaderalign
$headeralign_select = new XoopsFormSelect(_AM_WFDOWNLOADS_IPAGE_CHEADINGA, "indexheaderalign", $indexheaderalign);
$headeralign_select->addOptionArray(
array("left" => _AM_WFDOWNLOADS_IPAGE_CLEFT, "right" => _AM_WFDOWNLOADS_IPAGE_CRIGHT, "center" => _AM_WFDOWNLOADS_IPAGE_CCENTER)
);
$sform->addElement($headeralign_select);
+ // indexpage: indexfooter
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_WFDOWNLOADS_IPAGE_CFOOTER, 'indexfooter', $indexfooter, 15, 60));
+ // indexpage: indexfooteralign
$footeralign_select = new XoopsFormSelect(_AM_WFDOWNLOADS_IPAGE_CFOOTERA, "indexfooteralign", $indexfooteralign);
$footeralign_select->addOptionArray(
array("left" => _AM_WFDOWNLOADS_IPAGE_CLEFT, "right" => _AM_WFDOWNLOADS_IPAGE_CRIGHT, "center" => _AM_WFDOWNLOADS_IPAGE_CCENTER)
);
$sform->addElement($footeralign_select);
-
+ // indexpage: nohtml, nosmailey, noxcodes, noimages, nobreak
$options_tray = new XoopsFormElementTray(_AM_WFDOWNLOADS_TEXTOPTIONS, '<br />');
-
$html_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml);
$html_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWHTML);
$options_tray->addElement($html_checkbox);
-
$smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley);
$smiley_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWSMILEY);
$options_tray->addElement($smiley_checkbox);
-
$xcodes_checkbox = new XoopsFormCheckBox('', 'noxcodes', $noxcodes);
$xcodes_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWXCODE);
$options_tray->addElement($xcodes_checkbox);
-
$noimages_checkbox = new XoopsFormCheckBox('', 'noimages', $noimages);
$noimages_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWIMAGES);
$options_tray->addElement($noimages_checkbox);
-
$breaks_checkbox = new XoopsFormCheckBox('', 'nobreak', $nobreak);
$breaks_checkbox->addOption(1, _AM_WFDOWNLOADS_ALLOWBREAK);
$options_tray->addElement($breaks_checkbox);
$sform->addElement($options_tray);
-
+ // form: button try
$button_tray = new XoopsFormElementTray('', '');
$hidden = new XoopsFormHidden('op', 'indexpage.save');
$button_tray->addElement($hidden);
|
|
From: <luc...@us...> - 2013-12-09 20:59:47
|
Revision: 12236
http://sourceforge.net/p/xoops/svn/12236
Author: luciorota
Date: 2013-12-09 20:59:44 +0000 (Mon, 09 Dec 2013)
Log Message:
-----------
code aesthetical
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-12-07 22:43:32 UTC (rev 12235)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-12-09 20:59:44 UTC (rev 12236)
@@ -98,7 +98,7 @@
} else {
$imgurl = (isset($_POST["imgurl"]) && $_POST["imgurl"] != "blank.png") ? $myts -> addslashes($_POST["imgurl"]) : "";
}
- // Formulize module support (2006/05/04) jpc
+ // Formulize module support (2006/05/04) jpc
if (wfdownloads_checkModule('formulize') < 300) {
$formulize_fid = (isset($_POST["formulize_fid"])) ? (int)$_POST["formulize_fid"] : 0;
}
@@ -124,7 +124,7 @@
$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
+ // Formulize module support (2006/05/04) jpc
if (wfdownloads_checkModule('formulize')) {
$category->setVar('formulize_fid', $formulize_fid);
}
@@ -212,16 +212,15 @@
$adminMenu = new ModuleAdmin();
$adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
-// $adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
if (isset($_REQUEST['cid'])) {
$category = $wfdownloads->getHandler('category')->get($_REQUEST['cid']);
} else {
$category = $wfdownloads->getHandler('category')->create();
- }
- $form = $category->getForm();
- $form -> display();
+ }
+ $form = $category->getForm();
+ $form -> display();
include 'admin_footer.php';
break;
@@ -234,7 +233,6 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
-// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_CATEGORIES, "{$currentFile}?op=categories.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_CCATEGORY_CREATENEW, "{$currentFile}?op=category.add", 'add');
echo $adminMenu->renderButton();
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-12-07 22:43:32 UTC (rev 12235)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-12-09 20:59:44 UTC (rev 12236)
@@ -37,7 +37,6 @@
$adminMenu = new ModuleAdmin();
$adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, "{$currentFile}?op=downloads.list", 'list');
-// $adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, "{$currentFile}?op=download.add", 'add');
echo $adminMenu->renderButton();
$lid = WfdownloadsRequest::getInt('lid', 0);
@@ -608,7 +607,6 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
-// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
@@ -793,7 +791,6 @@
echo $indexAdmin->addNavigation($currentFile);
$adminMenu = new ModuleAdmin();
-// $adminMenu->addItemButton(_MI_WFDOWNLOADS_MENU_DOWNLOADS, $currentFile . "?op=downloads.list", 'list');
$adminMenu->addItemButton(_AM_WFDOWNLOADS_FFS_DOWNLOADTITLE, $currentFile . "?op=download.add", 'add');
echo $adminMenu->renderButton();
@@ -837,7 +834,8 @@
$ip_log_array = $ip_log->toArray();
$ip_log_array['uname'] = XoopsUserUtility::getUnameFromId(
$ip_log_array['uid']
- ); //($ip_log_array['uid'] != 0) ? $userList[$ip_log_array['uid']] : _AM_WFDOWNLOADS_ANONYMOUS;
+ );
+ //($ip_log_array['uid'] != 0) ? $userList[$ip_log_array['uid']] : _AM_WFDOWNLOADS_ANONYMOUS;
$ip_log_array['date_timestamp'] = formatTimestamp($ip_log_array['date']);
$GLOBALS['xoopsTpl']->append('ip_logs', $ip_log_array);
}
|