|
From: <luc...@us...> - 2013-08-16 18:28:22
|
Revision: 11930
http://sourceforge.net/p/xoops/svn/11930
Author: luciorota
Date: 2013-08-16 18:28:16 +0000 (Fri, 16 Aug 2013)
Log Message:
-----------
admin side: change $xoopsModule with $wfdownloads->getModule()
admin side: use WfdownloadsRequest class (in_progress)
remove unused files
Modified Paths:
--------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/ip_logs.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/permissions.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
Removed Paths:
-------------
XoopsModules/wfdownloads/trunk/wfdownloads/admin/cookies.js
XoopsModules/wfdownloads/trunk/wfdownloads/admin/funcs.js
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/categories.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,18 +19,12 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
-include_once XOOPS_ROOT_PATH . '/class/tree.php';
-
-include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
-
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'categories.list', 'string');
-
+$op = WfdownloadsRequest::getString('op', 'categories.list');
switch ($op) {
- case "category.move" :
- case "move" :
+ case "category.move":
+ case "move":
$ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if ($ok == false) {
$cid = wfdownloads_CleanVars($_REQUEST, 'cid', 0, 'int');
@@ -174,7 +168,7 @@
$wfdownloads->getHandler('report')->deleteAll($download_criteria);
$wfdownloads->getHandler('download')->deleteAll($download_criteria);
foreach (array_keys($downloads) as $lid) {
- xoops_comment_delete($xoopsModule->mid(), (int)$lid);
+ xoops_comment_delete($wfdownloads->getModule()->mid(), (int)$lid);
}
// all downloads for each category is deleted, now delete the category data
@@ -182,8 +176,8 @@
$error = _AM_WFD_DBERROR;
foreach ($cids as $cid) {
- xoops_groupperm_deletebymoditem ($xoopsModule->mid(), 'WFDownCatPerm', $cid);
- xoops_groupperm_deletebymoditem ($xoopsModule -> mid(), 'WFUpCatPerm', $cid);
+ xoops_groupperm_deletebymoditem ($wfdownloads->getModule()->mid(), 'WFDownCatPerm', $cid);
+ xoops_groupperm_deletebymoditem ($wfdownloads->getModule() -> mid(), 'WFUpCatPerm', $cid);
}
redirect_header($currentFile, 1, _AM_WFD_CCATEGORY_DELETED);
@@ -235,7 +229,7 @@
$sorted_categories = wfd_sortCategories();
$GLOBALS['xoopsTpl']->assign('sorted_categories', $sorted_categories);
$GLOBALS['xoopsTpl']->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML() );
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_categorieslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_categorieslist.html");
} else {
redirect_header("{$currentFile}?op=category.add", 1, _AM_WFD_CCATEGORY_NOEXISTS);
}
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/cookies.js
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/cookies.js 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/cookies.js 2013-08-16 18:28:16 UTC (rev 11930)
@@ -1,93 +0,0 @@
-/*
- 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$
- */
-
-/**
- * Read the JavaScript cookies tutorial at:
- * http://www.netspade.com/articles/javascript/cookies.xml
- */
-
-/**
- * Sets a Cookie with the given name and value.
- *
- * name Name of the cookie
- * value Value of the cookie
- * [expires] Expiration date of the cookie (default: end of current session)
- * [path] Path where the cookie is valid (default: path of calling document)
- * [domain] Domain where the cookie is valid
- * (default: domain of calling document)
- * [secure] Boolean value indicating if the cookie transmission requires a
- * secure transmission
- */
-function setCookie(name, value, expires, path, domain, secure)
-{
- document.cookie= name + "=" + escape(value) +
- ((expires) ? "; expires=" + expires.toGMTString() : "") +
- ((path) ? "; path=" + path : "") +
- ((domain) ? "; domain=" + domain : "") +
- ((secure) ? "; secure" : "");
-}
-
-/**
- * Gets the value of the specified cookie.
- *
- * name Name of the desired cookie.
- *
- * Returns a string containing value of specified cookie,
- * or null if cookie does not exist.
- */
-function getCookie(name)
-{
- var dc = document.cookie;
- var prefix = name + "=";
- var begin = dc.indexOf("; " + prefix);
- if (begin == -1)
- {
- begin = dc.indexOf(prefix);
- if (begin != 0) return null;
- }
- else
- {
- begin += 2;
- }
- var end = document.cookie.indexOf(";", begin);
- if (end == -1)
- {
- end = dc.length;
- }
- return unescape(dc.substring(begin + prefix.length, end));
-}
-
-/**
- * Deletes the specified cookie.
- *
- * name name of the cookie
- * [path] path of the cookie (must be same as path used to create cookie)
- * [domain] domain of the cookie (must be same as domain used to create cookie)
- */
-function deleteCookie(name, path, domain)
-{
- if (getCookie(name))
- {
- document.cookie = name + "=" +
- ((path) ? "; path=" + path : "") +
- ((domain) ? "; domain=" + domain : "") +
- "; expires=Thu, 01-Jan-70 00:00:01 GMT";
- }
-}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/downloads.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,20 +19,13 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
-include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
-
-include_once WFDOWNLOADS_ROOT_PATH . '"/class/xoopstree.php';
-//include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
-
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'downloads.list', 'string');
-
+$op = WfdownloadsRequest::getString('op', 'downloads.list');
switch ($op) {
- case "download.edit" :
- case "download.add" :
- case "Download" :
+ case "download.edit":
+ case "download.add":
+ case "Download":
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -45,12 +38,12 @@
include 'admin_footer.php';
break;
- case "download.save" :
- case "addDownload" :
+ case "download.save":
+ case "addDownload":
saveDownload();
break;
- case "download.delete" :
+ case "download.delete":
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
$ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
@@ -79,8 +72,8 @@
}
break;
- case "vote.delete" :
- case "delVote" :
+ case "vote.delete":
+ case "delVote":
$rating = $wfdownloads->getHandler('rating')->get($_GET['rid']);
if ($wfdownloads->getHandler('rating')->delete($rating, true)) {
wfd_updaterating(intval($rating->getVar('lid')));
@@ -89,7 +82,7 @@
break;
// added - start - March 4 2006 - jpc
- case "patch_formulize" :
+ case "patch_formulize":
if(!isset($_POST['patch_formulize'])) {
print "<form action=\"{$currentFile}?op=patch_formulize\" method=post>";
print "<input type = submit name=patch_formulize value=\"Apply Patch for Formulize\">";
@@ -106,7 +99,7 @@
break;
// added - end - March 4 2006 - jpc
- case "newdownload.approve" :
+ case "newdownload.approve":
case "approve":
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
if (!$download = $wfdownloads->getHandler('download')->get($lid)) {
@@ -137,7 +130,7 @@
redirect_header($currentFile, 1, _AM_WFD_SUB_NEWFILECREATED);
break;
- case "downloads.list" :
+ case "downloads.list":
default :
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
@@ -293,7 +286,7 @@
} else {
// NOP
}
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_downloadslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_downloadslist.html");
include 'admin_footer.php';
break;
Deleted: XoopsModules/wfdownloads/trunk/wfdownloads/admin/funcs.js
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/funcs.js 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/funcs.js 2013-08-16 18:28:16 UTC (rev 11930)
@@ -1,165 +0,0 @@
-/*
- 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$
- */
-
-function smartsectionPageWrap(id, page) {
- var revisedMessage;
- var textareaDom = xoopsGetElementById(id);
- xoopsInsertText(textareaDom, page);
- textareaDom.focus();
- return;
-}
-
-function addSelectedItemsToParent() {
- self.opener.addToParentList(window.document.forms[0].destList);
- window.close();
-}
-
-// Fill the selcted item list with the items already present in parent.
-function fillInitialDestList() {
- var destList = window.document.forms[0].destList;
- var srcList = self.opener.window.document.forms[0].elements['moderators[]'];
- for (var count = destList.options.length - 1; count >= 0; count--) {
- destList.options[count] = null;
- }
- for(var i = 0; i < srcList.options.length; i++) {
- if (srcList.options[i] != null)
- destList.options[i] = new Option(srcList.options[i].text);
- }
-}
-
-// Add the selected items from the source to destination list
-function addSrcToDestList() {
- destList = window.document.forms[0].destList;
- srcList = window.document.forms[0].srcList;
- var len = destList.length;
- for(var i = 0; i < srcList.length; i++) {
- if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
- //Check if this value already exist in the destList or not
- //if not then add it otherwise do not add it.
- var found = false;
- for(var count = 0; count < len; count++) {
- if (destList.options[count] != null) {
- if (srcList.options[i].text == destList.options[count].text) {
- found = true;
- break;
- }
- }
- }
- if (found != true) {
- destList.options[len] = new Option(srcList.options[i].text);
- len++;
- }
- }
- }
-}
-
-// Deletes from the destination list.
-function deleteFromDestList() {
- var destList = window.document.forms[0].destList;
- var len = destList.options.length;
- for(var i = (len-1); i >= 0; i--) {
- if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
- destList.options[i] = null;
- }
- }
-}
-
-function small_window(myurl, w, h) {
- // La ventana se llama "Add_from_Src_to_Dest"
- var newWindow;
- LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
- TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
- newWindow = window.open(myurl, "Add_from_Src_to_Dest", 'left='+LeftPosition+',top='+TopPosition+',width='+w+', height='+h+',scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no');
-}
-
-// Adds the list of selected items selected in the child
-// window to its list. It is called by child window to do so.
-function addToParentList(sourceList) {
- destinationList = window.document.forms[0].elements['moderators[]'];
- for(var count = destinationList.options.length - 1; count >= 0; count--) {
- destinationList.options[count] = null;
- }
- for(var i = 0; i < sourceList.options.length; i++) {
- if (sourceList.options[i] != null)
- destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value );
- }
-}
-
-// Marks all the items as selected for the submit button.
-function selectList(sourceList) {
- sourceList = window.document.forms[0].elements['moderators[]'];
- for(var i = 0; i < sourceList.options.length; i++) {
- if (sourceList.options[i] != null)
- sourceList.options[i].selected = true;
- }
- return true;
-}
-
-// Deletes the selected items of supplied list.
-function deleteSelectedItemsFromList(sourceList) {
- var maxCnt = sourceList.options.length;
- for(var i = maxCnt - 1; i >= 0; i--) {
- if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) {
- sourceList.options[i] = null;
- }
- }
-}
-
-function goto_URL(object)
-{
- window.location.href = object.options[object.selectedIndex].value;
-}
-
-function toggle(id)
-{
- if (document.getElementById) { obj = document.getElementById(id); }
- if (document.all) { obj = document.all[id]; }
- if (document.layers) { obj = document.layers[id]; }
- if (obj) {
- if (obj.style.display == "none") {
- obj.style.display = "";
- } else {
- obj.style.display = "none";
- }
- }
-
- var expDays = 365;
- var exp = new Date();
- exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
-
- setCookie(window.location.pathname+"_wfdownloads_collaps_" + obj.id , obj.style.display, exp);
-
- return false;
-}
-
-var iconClose = new Image();
-iconClose.src = '../images/icon/close12.gif';
-var iconOpen = new Image();
-iconOpen.src = '../images/icon/open12.gif';
-
-function toggleIcon ( iconName )
-{
- if ( document.images[iconName].src == window.iconOpen.src ) {
- document.images[iconName].src = window.iconClose.src;
- } else if ( document.images[iconName].src == window.iconClose.src ) {
- document.images[iconName].src = window.iconOpen.src;
- }
- return;
-}
\ No newline at end of file
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/images.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,11 +19,9 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'images.list', 'string');
-$rootPath = wfdownloads_CleanVars($_GET, 'rootpath', 0, 'int');
-
+$op = WfdownloadsRequest::getString('op', 'images.list');
switch ($op) {
case "image.upload" :
if ($_FILES['uploadfile']['name'] != "") {
@@ -79,6 +77,8 @@
include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
$displayImage = '';
+ $rootPath = WfdownloadsRequest::getInt('rootpath', 0);
+
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -103,7 +103,7 @@
$iform->addElement(new XoopsFormLabel(_AM_WFD_DOWN_FUPLOADPATH, XOOPS_ROOT_PATH . "/" . $dirArray[$rootPath]));
$iform->addElement(new XoopsFormLabel(_AM_WFD_DOWN_FUPLOADURL, XOOPS_URL . "/" . $dirArray[$rootPath]));
- $graph_array = &WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . "/" . $dirArray[$rootPath], $type = "images");
+ $graph_array = WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . "/" . $dirArray[$rootPath], $type = "images");
$indeximage_select = new XoopsFormSelect('', 'downfile', '');
$indeximage_select->addOptionArray($graph_array);
$indeximage_select->setExtra("onchange='showImgSelected(\"image\", \"downfile\", \"" . $dirArray[$rootPath] . "\", \"\", \"" . XOOPS_URL . "\")'");
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/import.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -18,7 +18,126 @@
* @author Xoops Development Team
* @version svn:$id$
*/
+$currentFile = basename(__FILE__);
+include_once dirname(__FILE__) . '/admin_header.php';
+include_once(WFDOWNLOADS_ROOT_PATH . "/include/module.php");
+
+$op = WfdownloadsRequest::getString('op', 'import.menu');
+switch ($op) {
+ case "import.MyDownloads" :
+ $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ if ($ok == true) {
+ // Make sure that nohtml is properly changed to dohtml
+ invert_nohtm_dohtml_values();
+ // Ensure that the proper tables are present
+ update_tables_to_300();
+ // Import data from MyDownloads
+ import_mydownloads_to_wfdownloads();
+ // Downloads imported
+ redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ exit();
+ } else {
+ wfdownloads_xoops_cp_header();
+ xoops_confirm(array('op' => 'import.MyDownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_cp_footer();
+ }
+ break;
+
+ case "import.PD-Downloads" :
+ $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ if ($ok == true) {
+ // Make sure that nohtml is properly changed to dohtml
+ invert_nohtm_dohtml_values();
+ // Ensure that the proper tables are present
+ update_tables_to_300();
+ // Import data from PD-Downloads
+ import_pddownloads_to_wfdownloads();
+ // Downloads imported
+ redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ exit();
+ } else {
+ wfdownloads_xoops_cp_header();
+ xoops_confirm(array('op' => 'import.PD-Downloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_cp_footer();
+ }
+ break;
+
+ case "import.wmpownloads" :
+ $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
+ if ($ok == true) {
+ // Make sure that nohtml is properly changed to dohtml
+ invert_nohtm_dohtml_values();
+ // Ensure that the proper tables are present
+ update_tables_to_300();
+ // Import data from wmpownloads
+ import_wmpdownloads_to_wfdownloads();
+ // Downloads imported
+ redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
+ exit();
+ } else {
+ wfdownloads_xoops_cp_header();
+ xoops_confirm(array('op' => 'import.wmpownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
+ xoops_cp_footer();
+ }
+ break;
+
+ case "import.menu" :
+ default:
+ wfdownloads_xoops_cp_header();
+ $indexAdmin = new ModuleAdmin();
+ echo $indexAdmin->addNavigation($currentFile);
+
+ //ask what to do
+ include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
+
+ $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)) {
+ $mydownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_MYDOWNLOADS, "myd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
+ $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.MyDownloads\"'");
+ $form->addElement($mydownloadsButton);
+ } else {
+ $mydownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_MYDOWNLOADS, _AM_WFD_IMPORT_MYDOWNLOADS_NOTFOUND);
+ $form->addElement($mydownloadsLabel);
+ }
+
+ //Is PD-Downloads installed?
+ $module_handler = xoops_gethandler('module');
+ $PDdownloadsModule = $module_handler->getByDirname("PDdownloads");
+ $got_options = false;
+ if (is_object($PDdownloadsModule)) {
+ $pddownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_PDDOWNLOADS, "pd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
+ $pddownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.PD-Downloads\"'");
+ $form->addElement($pddownloadsButton);
+ } else {
+ $pddownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_PDDOWNLOADS, _AM_WFD_IMPORT_PDDOWNLOADS_NOTFOUND);
+ $form->addElement($pddownloadsLabel);
+ }
+
+ //Is wmpownloads installed?
+ $module_handler = xoops_gethandler('module');
+ $wmpdownloadsModule = $module_handler->getByDirname("wmpdownloads");
+ $got_options = false;
+ if (is_object($wmpdownloadsModule)) {
+ $wmpdownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_WMPOWNLOADS, "wmp_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
+ $wmpdownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.wmpownloads\"'");
+ $form->addElement($wmpdownloadsButton);
+ } else {
+ $wmpdownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_WMPOWNLOADS, _AM_WFD_IMPORT_WMPOWNLOADS_NOTFOUND);
+ $form->addElement($wmpdownloadsLabel);
+ }
+
+ $form->addElement(new XoopsFormHidden('op', 0));
+ $form->display();
+ include 'admin_footer.php';
+ break;
+}
+
// ========================================================
// Conversion file for any version before wf-downloads 3
// ========================================================
@@ -48,11 +167,6 @@
// function is doing. It needs to be run before "convert_tables_2x_to_300"
// since it is based on the old fieldnamessince
-$currentFile = basename(__FILE__);
-include 'admin_header.php';
-
-include_once(WFDOWNLOADS_ROOT_PATH . "/include/module.php");
-
// =========================================================================================
// This function imports data from mydownloads into wf-downloads
// =========================================================================================
@@ -324,117 +438,3 @@
}
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'import.menu', 'string');
-switch ($op) {
- case "import.MyDownloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
- if ($ok == true) {
- // Make sure that nohtml is properly changed to dohtml
- invert_nohtm_dohtml_values();
- // Ensure that the proper tables are present
- update_tables_to_300();
- // Import data from MyDownloads
- import_mydownloads_to_wfdownloads();
- // Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
- exit();
- } else {
- wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.MyDownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
- xoops_cp_footer();
- }
- break;
-
- case "import.PD-Downloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
- if ($ok == true) {
- // Make sure that nohtml is properly changed to dohtml
- invert_nohtm_dohtml_values();
- // Ensure that the proper tables are present
- update_tables_to_300();
- // Import data from PD-Downloads
- import_pddownloads_to_wfdownloads();
- // Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
- exit();
- } else {
- wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.PD-Downloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
- xoops_cp_footer();
- }
- break;
-
- case "import.wmpownloads" :
- $ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
- if ($ok == true) {
- // Make sure that nohtml is properly changed to dohtml
- invert_nohtm_dohtml_values();
- // Ensure that the proper tables are present
- update_tables_to_300();
- // Import data from wmpownloads
- import_wmpdownloads_to_wfdownloads();
- // Downloads imported
- redirect_header($currentFile, 1, _AM_WFD_IMPORT_IMPORT_OK);
- exit();
- } else {
- wfdownloads_xoops_cp_header();
- xoops_confirm(array('op' => 'import.wmpownloads', 'ok' => true), $currentFile, _AM_WFD_IMPORT_RUSURE);
- xoops_cp_footer();
- }
- break;
-
- case "import.menu" :
- default:
- wfdownloads_xoops_cp_header();
- $indexAdmin = new ModuleAdmin();
- echo $indexAdmin->addNavigation($currentFile);
-
- //ask what to do
- include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
-
- $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)) {
- $mydownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_MYDOWNLOADS, "myd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
- $mydownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.MyDownloads\"'");
- $form->addElement($mydownloadsButton);
- } else {
- $mydownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_MYDOWNLOADS, _AM_WFD_IMPORT_MYDOWNLOADS_NOTFOUND);
- $form->addElement($mydownloadsLabel);
- }
-
- //Is PD-Downloads installed?
- $module_handler = xoops_gethandler('module');
- $PDdownloadsModule = $module_handler->getByDirname("PDdownloads");
- $got_options = false;
- if (is_object($PDdownloadsModule)) {
- $pddownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_PDDOWNLOADS, "pd_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
- $pddownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.PD-Downloads\"'");
- $form->addElement($pddownloadsButton);
- } else {
- $pddownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_PDDOWNLOADS, _AM_WFD_IMPORT_PDDOWNLOADS_NOTFOUND);
- $form->addElement($pddownloadsLabel);
- }
-
- //Is wmpownloads installed?
- $module_handler = xoops_gethandler('module');
- $wmpdownloadsModule = $module_handler->getByDirname("wmpdownloads");
- $got_options = false;
- if (is_object($wmpdownloadsModule)) {
- $wmpdownloadsButton = new XoopsFormButton(_AM_WFD_IMPORT_WMPOWNLOADS, "wmp_button", _AM_WFD_IMPORT_BUTTON_IMPORT, "submit");
- $wmpdownloadsButton->setExtra("onclick='document.forms.form.op.value=\"import.wmpownloads\"'");
- $form->addElement($wmpdownloadsButton);
- } else {
- $wmpdownloadsLabel = new XoopsFormLabel(_AM_WFD_IMPORT_WMPOWNLOADS, _AM_WFD_IMPORT_WMPOWNLOADS_NOTFOUND);
- $form->addElement($wmpdownloadsLabel);
- }
-
- $form->addElement(new XoopsFormHidden('op', 0));
- $form->display();
- include 'admin_footer.php';
- break;
-}
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/index.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -18,7 +18,7 @@
* @author Xoops Development Team
* @version svn:$id$
*/
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+$currentFile = basename(__FILE__);
include_once dirname(__FILE__) . '/admin_header.php';
include_once dirname(dirname(__FILE__)) . '/include/directorychecker.php';
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/indexpage.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -18,12 +18,12 @@
* @author Xoops Development Team
* @version svn:$id$
*/
-include 'admin_header.php';
+$currentFile = basename(__FILE__);
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = isset($_REQUEST['op']) ?$_REQUEST['op'] : "default";
-
+$op = WfdownloadsRequest::getString('op', 'indexpage.form');
switch ($op) {
- case "save":
+ case "indexpage.save":
$indexheading = $myts->addslashes($_POST['indexheading']);
$indexheader = $myts->addslashes($_POST['indexheader']);
$indexfooter = $myts->addslashes($_POST['indexfooter']);
@@ -42,6 +42,7 @@
break;
+ case "indexpage.form":
default:
include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
@@ -59,7 +60,7 @@
$sform = new XoopsThemeForm(_AM_WFD_IPAGE_MODIFY, "op", xoops_getenv('PHP_SELF'));
$sform->addElement(new XoopsFormText(_AM_WFD_IPAGE_CTITLE, 'indexheading', 60, 60, $indexheading), false);
- $graph_array = &WfsLists::getListTypeAsArray(XOOPS_ROOT_PATH . "/" . $wfdownloads->getConfig('mainimagedir'), $type = "images");
+ $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 . "\")'");
@@ -105,7 +106,7 @@
$sform->addElement($options_tray);
$button_tray = new XoopsFormElementTray('', '');
- $hidden = new XoopsFormHidden('op', 'save');
+ $hidden = new XoopsFormHidden('op', 'indexpage.save');
$button_tray->addElement($hidden);
$button_tray->addElement(new XoopsFormButton('', 'post', _AM_WFD_BSAVE, 'submit'));
$sform->addElement($button_tray);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/ip_logs.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/ip_logs.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/ip_logs.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,7 +19,7 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
$lid = isset($_GET['lid']) && $_GET['lid'] != '' ? $_GET['lid'] : 0;
if(!$lid) {
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mimetypes.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,10 +19,9 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', '', 'string');
-
+$op = WfdownloadsRequest::getString('op', 'mimetypes.list');
switch ($op) {
/*
case 'openurl':
@@ -35,8 +34,8 @@
}
break;
*/
- case "mimetype.edit" :
- case "mimetype.add" :
+ case "mimetype.edit":
+ case "mimetype.add":
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
echo $indexAdmin->addNavigation($currentFile);
@@ -76,7 +75,7 @@
xoops_cp_footer();
break;
- case 'mimetype.save':
+ case "mimetype.save":
$mime_id = wfdownloads_CleanVars($_POST, 'mime_id', 0, 'int');
if (!$mimetype = $wfdownloads->getHandler('mimetype')->get($mime_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIMETYPENOTFOUND);
@@ -96,7 +95,7 @@
redirect_header($currentFile, 1, $dbupted);
break;
- case 'mimetype.update';
+ case "mimetype.update":
$mime_id = wfdownloads_CleanVars($_REQUEST, 'mime_id', 0, 'int');
if (!$mimetype = $wfdownloads->getHandler('mimetype')->get($mime_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIMETYPENOTFOUND);
@@ -123,7 +122,7 @@
redirect_header("{$currentFile}?start=" . intval($_GET['start']) . "", 0, _AM_WFD_MIME_MODIFIED);
break;
- case 'mimetypes.update':
+ case "mimetypes.update":
$mime_admin = (isset($_GET['admin']) && $_GET['admin'] == true ) ? $_GET['admin'] : false;
$mime_user = (isset($_GET['user']) && $_GET['user'] == true) ? $_GET['user'] : false;
$type_all = intval($_GET['type_all']);
@@ -168,7 +167,7 @@
}
break;
- case 'mimetypes.list':
+ case "mimetypes.list":
default:
$start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
@@ -212,7 +211,7 @@
$GLOBALS['xoopsTpl']->assign('mimetypes_pagenav', $pagenav -> renderNav());
}
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_mimetypeslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_mimetypeslist.html");
include_once "admin_footer.php";
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/mirrors.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,13 +19,11 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'mirrors.list', 'string');
-$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
-
+$op = WfdownloadsRequest::getString('op', 'mirrors.list');
switch ($op) {
- case "mirror.delete" :
+ case "mirror.delete":
$mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
$ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
@@ -50,7 +48,7 @@
}
break;
- case "mirror.approve" :
+ case "mirror.approve":
$mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
$ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
@@ -69,7 +67,7 @@
}
break;
- case "mirror.edit" :
+ case "mirror.edit":
$mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
@@ -81,7 +79,7 @@
xoops_cp_footer();
break;
- case "mirror.save" :
+ case "mirror.save":
$mirror_id = wfdownloads_CleanVars($_REQUEST, 'mirror_id', 0, 'int');
if (!$mirror = $wfdownloads->getHandler('mirror')->get($mirror_id)) {
redirect_header($currentFile, 4, _AM_WFD_ERROR_MIRRORNOTFOUND);
@@ -98,7 +96,7 @@
exit();
break;
- case "mirrors.list" :
+ case "mirrors.list":
default:
wfdownloads_xoops_cp_header();
$indexAdmin = new ModuleAdmin();
@@ -166,7 +164,7 @@
$GLOBALS['xoopsTpl']->assign('mirrors_published_pagenav', $pagenav_published -> renderNav());
}
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_mirrorslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_mirrorslist.html");
include_once "admin_footer.php";
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/permissions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/permissions.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/permissions.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,7 +19,7 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
@@ -29,8 +29,8 @@
}
$categories = $wfdownloads->getHandler('category')->getObjects();
-$down_cat_form = new XoopsGroupPermForm(_AM_WFD_FCATEGORY_GROUPPROMPT, $xoopsModule->mid(), 'WFDownCatPerm', _AM_WFD_PERM_CSELECTPERMISSIONS, "admin/{$currentFile}", true);
-$up_cat_form = new XoopsGroupPermForm(_AM_WFD_FCATEGORY_GROUPPROMPT_UP, $xoopsModule->mid(), 'WFUpCatPerm', _AM_WFD_PERM_CSELECTPERMISSIONS_UP, "admin/{$currentFile}", true);
+$down_cat_form = new XoopsGroupPermForm(_AM_WFD_FCATEGORY_GROUPPROMPT, $wfdownloads->getModule()->mid(), 'WFDownCatPerm', _AM_WFD_PERM_CSELECTPERMISSIONS, "admin/{$currentFile}", true);
+$up_cat_form = new XoopsGroupPermForm(_AM_WFD_FCATEGORY_GROUPPROMPT_UP, $wfdownloads->getModule()->mid(), 'WFUpCatPerm', _AM_WFD_PERM_CSELECTPERMISSIONS_UP, "admin/{$currentFile}", true);
foreach ($categories as $category) {
$down_cat_form->addItem($category->getVar('cid'), $category->getVar('title'), $category->getVar('pid'));
$up_cat_form->addItem($category->getVar('cid'), $category->getVar('title'), $category->getVar('pid'));
@@ -43,6 +43,6 @@
$GLOBALS['xoopsTpl']->assign('down_cat_form', $down_cat_form->render());
$GLOBALS['xoopsTpl']->assign('up_cat_form', $up_cat_form->render());
-$GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_permissions.html");
+$GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_permissions.html");
include_once "admin_footer.php";
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/ratings.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,12 +19,11 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'votes.list', 'string');
-
+$op = WfdownloadsRequest::getString('op', 'votes.list');
switch ($op) {
- case 'vote.delete' :
+ case "vote.delete":
$rid = wfdownloads_CleanVars($_GET, 'rid', null, 'int');
$lid = wfdownloads_CleanVars($_GET, 'lid', null, 'int');
$wfdownloads->getHandler('rating')->deleteAll(new Criteria("ratingid", $rid), true);
@@ -32,7 +31,7 @@
redirect_header($currentFile, 1, _AM_WFD_VOTEDELETED);
break;
- case 'votes.list' :
+ case "votes.list":
default:
$start = wfdownloads_CleanVars($_GET, 'start', 0, 'int');
$useravgrating = '0';
@@ -75,7 +74,7 @@
$ratings_pagenav = new XoopsPageNav($ratings_count, $wfdownloads->getConfig('admin_perpage'), $start, 'start');
$GLOBALS['xoopsTpl']->assign('ratings_pagenav', $ratings_pagenav->renderNav());
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_ratingslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_ratingslist.html");
include 'admin_footer.php';
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reportsmodifications.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,10 +19,9 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'reports.modifications.list', 'string');
-
+$op = WfdownloadsRequest::getString('op', 'reports.modifications.list');
switch ($op) {
case "reports.update":
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
@@ -40,7 +39,7 @@
redirect_header($currentFile, 1, $update_mess);
break;
- case "report.delete" :
+ case "report.delete":
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
@@ -52,7 +51,7 @@
redirect_header($currentFile, 1, _AM_WFD_BROKENFILEDELETED);
break;
- case "report.ignore" :
+ case "report.ignore":
$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
$criteria = new Criteria('lid', $lid);
$report = $wfdownloads->getHandler('report')->getObjects($criteria);
@@ -62,7 +61,7 @@
redirect_header($currentFile, 1, _AM_WFD_BROKEN_FILEIGNORED);
break;
- case "modification.show" :
+ case "modification.show":
wfdownloads_xoops_cp_header();
$requestid = intval($_GET['requestid']);
@@ -273,7 +272,7 @@
redirect_header(WFDOWNLOADS_URL . '/admin/index.php', 1, _AM_WFD_MOD_REQDELETED);
break;
- case "reports.modifications.list" :
+ case "reports.modifications.list":
default:
$start_report = wfdownloads_CleanVars($_GET, 'start_report', 0, 'int');
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/admin/reviews.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -19,13 +19,11 @@
* @version svn:$id$
*/
$currentFile = basename(__FILE__);
-include 'admin_header.php';
+include_once dirname(__FILE__) . '/admin_header.php';
-$op = wfdownloads_CleanVars($_REQUEST, 'op', 'reviews.list', 'string');
-$lid = wfdownloads_CleanVars($_REQUEST, 'lid', 0, 'int');
-
+$op = WfdownloadsRequest::getString('op', 'reviews.list');
switch ($op) {
- case "review.delete" :
+ case "review.delete":
$review_id = wfdownloads_CleanVars($_REQUEST, 'review_id', 0, 'int');
$ok = wfdownloads_CleanVars($_POST, 'ok', false, 'boolean');
if (!$review = $wfdownloads->getHandler('review')->get($review_id)) {
@@ -166,7 +164,7 @@
$GLOBALS['xoopsTpl']->assign('reviews_published_pagenav', $pagenav_published -> renderNav());
}
- $GLOBALS['xoopsTpl']->display("db:" . $xoopsModule->dirname() . "_admin_reviewslist.html");
+ $GLOBALS['xoopsTpl']->display("db:" . $wfdownloads->getModule()->dirname() . "_admin_reviewslist.html");
include_once "admin_footer.php";
break;
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/category.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -53,7 +53,8 @@
}
$title = $this->isNew() ? _AM_WFD_CCATEGORY_CREATENEW : _AM_WFD_CCATEGORY_MODIFY;
- include_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
+ include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
$form = new XoopsThemeForm($title, 'form_error', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
@@ -92,24 +93,26 @@
}
$form -> addElement($indeximage_tray);
- $form -> addElement(new XoopsFormDhtmlTextArea(_AM_WFD_FCATEGORY_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60), true);
+ $description_textarea = new XoopsFormDhtmlTextArea(_AM_WFD_FCATEGORY_DESCRIPTION, 'description', $this->getVar('description', 'e'), 15, 60);
+ $form -> addElement($description_textarea, true);
- $form -> addElement(new XoopsFormTextArea(_AM_WFD_FCATEGORY_SUMMARY, 'summary', $this->getVar('summary'), 10, 60));
+ $summary_textarea = new XoopsFormTextArea(_AM_WFD_FCATEGORY_SUMMARY, 'summary', $this->getVar('summary'), 10, 60);
+ $form -> addElement($summary_textarea);
$options_tray = new XoopsFormElementTray(_AM_WFD_TEXTOPTIONS, '<br />');
- $html_checkbox = new XoopsFormCheckBox('', 'dohtml', intval($this->getVar('dohtml')));
+ $html_checkbox = new XoopsFormCheckBox('', 'dohtml', $this->getVar('dohtml'));
$html_checkbox -> addOption(1, _AM_WFD_ALLOWHTML);
$options_tray -> addElement($html_checkbox);
- $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', intval($this->getVar('dosmiley')));
+ $smiley_checkbox = new XoopsFormCheckBox('', 'dosmiley', $this->getVar('dosmiley'));
$smiley_checkbox -> addOption(1, _AM_WFD_ALLOWSMILEY);
$options_tray -> addElement($smiley_checkbox);
- $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', intval($this->getVar('doxcode')));
+ $xcodes_checkbox = new XoopsFormCheckBox('', 'doxcode', $this->getVar('doxcode'));
$xcodes_checkbox -> addOption(1, _AM_WFD_ALLOWXCODE);
$options_tray -> addElement($xcodes_checkbox);
- $noimages_checkbox = new XoopsFormCheckBox('', 'doimage', intval($this->getVar('doimage')));
+ $noimages_checkbox = new XoopsFormCheckBox('', 'doimage', $this->getVar('doimage'));
$noimages_checkbox -> addOption(1, _AM_WFD_ALLOWIMAGES);
$options_tray -> addElement($noimages_checkbox);
- $breaks_checkbox = new XoopsFormCheckBox('', 'dobr', intval($this->getVar('dobr')));
+ $breaks_checkbox = new XoopsFormCheckBox('', 'dobr', $this->getVar('dobr'));
$breaks_checkbox -> addOption(1, _AM_WFD_ALLOWBREAK);
$options_tray -> addElement($breaks_checkbox);
$form -> addElement($options_tray);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/class/download.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -403,6 +403,9 @@
function getAdminForm($title, $customArray=array()) { // $custom array added April 22, 2006 by jwe
global $xoopsUser, $wfdownloads;
+ include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
+ include_once WFDOWNLOADS_ROOT_PATH . '/class/wfd_lists.php';
+
$use_mirrors = $wfdownloads->getConfig('enable_mirrors');
$sform = new XoopsThemeForm($title, "storyform", $_SERVER['REQUEST_URI']);
Modified: XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php
===================================================================
--- XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-16 03:06:22 UTC (rev 11929)
+++ XoopsModules/wfdownloads/trunk/wfdownloads/include/functions.php 2013-08-16 18:28:16 UTC (rev 11930)
@@ -340,11 +340,6 @@
function wfdownloads_xoops_cp_header()
{
xoops_cp_header();
- ?>
- <script type='text/javascript' src='funcs.js'></script>
- <script type='text/javascript' src='cookies.js'></script>
- <?php
-
}
|