Skip to content

Commit

Permalink
Xmf\Request
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Oct 2, 2016
1 parent 5ea37db commit ce95bad
Show file tree
Hide file tree
Showing 39 changed files with 366 additions and 291 deletions.
49 changes: 25 additions & 24 deletions add.php
Expand Up @@ -19,6 +19,7 @@
Licence Type : GPL
-------------------------------------------------------------------------
*/
use Xmf\Request;

include_once __DIR__ . '/header.php';
$myts = MyTextSanitizer::getInstance();// MyTextSanitizer object
Expand All @@ -31,7 +32,7 @@
$groups = ($GLOBALS['xoopsUser'] instanceof XoopsUser) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
/** @var XoopsGroupPermHandler $gpermHandler */
$gpermHandler = xoops_getHandler('groupperm');
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
$perm_itemid = Request::getInt('item_id', 0, 'POST');

if (!$gpermHandler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
Expand All @@ -48,7 +49,7 @@
redirect_header(XOOPS_URL . '/user.php', 2, _MA_ADSLIGHT_MUSTREGFIRST);
}

if ('' != XoopsRequest::getString('submit', '', 'POST')) {
if (Request::hasVar('submit', 'POST')) {
$howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong'];

if (!$xoopsGTicket->check(true, 'token')) {
Expand All @@ -60,37 +61,37 @@
// if ( !$xoopsCaptcha->verify() ) {
// redirect_header( XOOPS_URL . "/modules/adslight/index.php", 2, $xoopsCaptcha->getMessage() );
// }
if ('' == XoopsRequest::getString('title', '', 'POST')) {
if (Request::hasVar('submit', 'POST')) {
$modHandler = xoops_getModuleHandler('module');
$myModule = $modHandler->getByDirname('adslight');
$myModule->setErrors('Could not connect to the database.');
}

$cid = XoopsRequest::getInt('cid', 0, 'POST');
$cid = Request::getInt('cid', 0, 'POST');
$cat_perms = AdslightUtilities::getMyItemIds('adslight_submit');
if (!in_array($cid, $cat_perms)) {
redirect_header(XOOPS_URL, 2, _NOPERM);
}

$title = XoopsRequest::getString('title', '', 'POST');
$title = Request::getString('title', '', 'POST');
// $status = $myts->addSlashes($_POST["status"]);
$status = (int)$status;
$expire = XoopsRequest::getString('expire', '', 'POST');
$type = XoopsRequest::getString('type', '', 'POST');
$desctext = XoopsRequest::getText('desctext', '', 'POST'); // $myts->displayTarea($_POST['desctext'], 1, 1, 1);
$tel = XoopsRequest::getString('tel', '', 'POST');
$price = str_replace(array(' '), '', XoopsRequest::getFloat('price', 0, 'POST'));
$typeprice = XoopsRequest::getString('typeprice', '', 'POST');
$typeusure = XoopsRequest::getString('typeusure', '', 'POST');
$date = XoopsRequest::getInt('date', 0, 'POST');
$email = XoopsRequest::getString('email', '', 'POST');
$submitter = XoopsRequest::getString('submitter', '', 'POST');
$usid = XoopsRequest::getString('usid', '', 'POST');
$town = XoopsRequest::getString('town', '', 'POST');
$country = XoopsRequest::getString('country', 0, 'POST');
$contactby = XoopsRequest::getString('contactby', '', 'POST');
$premium = XoopsRequest::getString('premium', '', 'POST');
$valid = XoopsRequest::getString('valid', '', 'POST');
$expire = Request::getString('expire', '', 'POST');
$type = Request::getString('type', '', 'POST');
$desctext = Request::getText('desctext', '', 'POST'); // $myts->displayTarea($_POST['desctext'], 1, 1, 1);
$tel = Request::getString('tel', '', 'POST');
$price = str_replace(array(' '), '', Request::getFloat('price', 0, 'POST'));
$typeprice = Request::getString('typeprice', '', 'POST');
$typeusure = Request::getString('typeusure', '', 'POST');
$date = Request::getInt('date', 0, 'POST');
$email = Request::getString('email', '', 'POST');
$submitter = Request::getString('submitter', '', 'POST');
$usid = Request::getString('usid', '', 'POST');
$town = Request::getString('town', '', 'POST');
$country = Request::getString('country', 0, 'POST');
$contactby = Request::getString('contactby', '', 'POST');
$premium = Request::getString('premium', '', 'POST');
$valid = Request::getString('valid', '', 'POST');
$date = time();
$newid = $xoopsDB->genId($xoopsDB->prefix('adslight_listing') . '_lid_seq');

Expand Down Expand Up @@ -165,7 +166,7 @@
echo $mail->getErrors();
}

$addphotonow = XoopsRequest::getInt('addphotonow', 0, 'POST');
$addphotonow = Request::getInt('addphotonow', 0, 'POST');
if ($addphotonow) {
//$lid = $xoopsDB->getInsertId();
redirect_header("view_photos.php?lid=$lid&uid=$usid", 3, _ADSLIGHT_ADSADDED);
Expand All @@ -177,8 +178,8 @@
include XOOPS_ROOT_PATH . '/header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

$cid = XoopsRequest::getInt('cide', 0, 'GET');
$cat_moderate = XoopsRequest::getInt('cat_moderate', 0, 'POST');
$cid = Request::getInt('cide', 0, 'GET');
$cat_moderate = Request::getInt('cat_moderate', 0, 'POST');
$howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong'];
$member_usid = $GLOBALS['xoopsUser']->getVar('uid', 'E');
$member_email = $GLOBALS['xoopsUser']->getVar('email', 'E');
Expand Down
7 changes: 4 additions & 3 deletions add_photo.php
Expand Up @@ -19,6 +19,7 @@
Licence Type : GPL
-------------------------------------------------------------------------
*/
use Xmf\Request;

$moduleDirName = basename(dirname(__DIR__));
$main_lang = '_' . strtoupper($moduleDirName);
Expand All @@ -43,8 +44,8 @@
/**
* Getting the title
*/
$title = XoopsRequest::getString('caption', '', 'POST');
$lid = XoopsRequest::getInt('lid', 0, 'POST');
$title = Request::getString('caption', '', 'POST');
$lid = Request::getInt('lid', 0, 'POST');
/**
* Getting parameters defined in admin side
*/
Expand All @@ -61,7 +62,7 @@
/**
* If we are receiving a file
*/
if ($_POST['xoops_upload_file'][0] === 'sel_photo') {
if ('sel_photo' === Request::getArray('xoops_upload_file', '', 'POST')[0]) {

/**
* Check if using Xoops or XoopsCube (by jlm69)
Expand Down
55 changes: 29 additions & 26 deletions addlisting.php
Expand Up @@ -19,6 +19,9 @@
Licence Type : GPL
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once __DIR__ . '/header.php';
$myts = MyTextSanitizer::getInstance();// MyTextSanitizer object
require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php';
Expand All @@ -36,7 +39,7 @@
}
/** @var XoopsGroupPermHandler $gpermHandler */
$gpermHandler = xoops_getHandler('groupperm');
$perm_itemid = XoopsRequest::getInt('item_id', 0, 'POST');
$perm_itemid = Request::getInt('item_id', 0, 'POST');
if (!$gpermHandler->checkRight('adslight_submit', $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
}
Expand All @@ -55,44 +58,44 @@
redirect_header(XOOPS_URL . '/user.php', 2, _MA_ADSLIGHT_MUSTREGFIRST);
}

if ('' != XoopsRequest::getString('submit', '', 'POST')) {
if (Request::hasVar('submit', 'POST')) {
$howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong'];

if (!$xoopsGTicket->check(true, 'token')) {
redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
}

if (XoopsRequest::getString('title', '', 'POST') == '') {
if (Request::getString('title', '', 'POST') == '') {
// $erh->show('1001'); //'0001' => 'Could not connect to the forums database.',
$modHandler = xoops_getModuleHandler('module');
$myModule = $modHandler->getByDirname('adslight');
$myModule->setErrors('Could not connect to the database.');
}
$cid = XoopsRequest::getInt('cid', 0, 'POST');
$cid = Request::getInt('cid', 0, 'POST');

$cat_perms = AdslightUtilities::getMyItemIds('adslight_submit');
if (!in_array($cid, $cat_perms)) {
redirect_header(XOOPS_URL, 2, _NOPERM);
}

$title = XoopsRequest::getString('title', '', 'POST');
$status = XoopsRequest::getInt('status', 0, 'POST');
$expire = XoopsRequest::getString('expire', '', 'POST');
$type = XoopsRequest::getString('type', '', 'POST');
$desctext = XoopsRequest::getText('desctext', '', 'POST'); // $myts->displayTarea($_POST['desctext'], 1, 1, 1);
$tel = XoopsRequest::getString('tel', '', 'POST');
$price = str_replace(array(' '), '', XoopsRequest::getFloat('price', 0, 'POST'));
$typeprice = XoopsRequest::getString('typeprice', '', 'POST');
$typeusure = XoopsRequest::getString('typeusure', '', 'POST');
$date = XoopsRequest::getInt('date', 0, 'POST');
$email = XoopsRequest::getString('email', '', 'POST');
$submitter = XoopsRequest::getString('submitter', '', 'POST');
$usid = XoopsRequest::getString('usid', '', 'POST');
$town = XoopsRequest::getString('town', '', 'POST');
$country = XoopsRequest::getString('country', 0, 'POST');
$contactby = XoopsRequest::getString('contactby', '', 'POST');
$premium = XoopsRequest::getString('premium', '', 'POST');
$valid = XoopsRequest::getString('valid', '', 'POST');
$title = Request::getString('title', '', 'POST');
$status = Request::getInt('status', 0, 'POST');
$expire = Request::getString('expire', '', 'POST');
$type = Request::getString('type', '', 'POST');
$desctext = Request::getText('desctext', '', 'POST'); // $myts->displayTarea($_POST['desctext'], 1, 1, 1);
$tel = Request::getString('tel', '', 'POST');
$price = str_replace(array(' '), '', Request::getFloat('price', 0, 'POST'));
$typeprice = Request::getString('typeprice', '', 'POST');
$typeusure = Request::getString('typeusure', '', 'POST');
$date = Request::getInt('date', 0, 'POST');
$email = Request::getString('email', '', 'POST');
$submitter = Request::getString('submitter', '', 'POST');
$usid = Request::getString('usid', '', 'POST');
$town = Request::getString('town', '', 'POST');
$country = Request::getString('country', 0, 'POST');
$contactby = Request::getString('contactby', '', 'POST');
$premium = Request::getString('premium', '', 'POST');
$valid = Request::getString('valid', '', 'POST');

$date = time();
$newid = $xoopsDB->genId($xoopsDB->prefix('adslight_listing') . '_lid_seq');
Expand Down Expand Up @@ -168,7 +171,7 @@
echo $mail->getErrors();
}

$addphotonow = XoopsRequest::getInt('addphotonow', 0, 'POST');
$addphotonow = Request::getInt('addphotonow', 0, 'POST');


if ($addphotonow) {
Expand All @@ -182,9 +185,9 @@
include XOOPS_ROOT_PATH . '/header.php';
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';

$cid = XoopsRequest::getInt('cid', 0, 'POST');
$cid = Request::getInt('cid', 0, 'POST');

$cat_moderate = XoopsRequest::getInt('cat_moderate', 0, 'POST');
$cat_moderate = Request::getInt('cat_moderate', 0, 'POST');

$howlong = $GLOBALS['xoopsModuleConfig']['adslight_howlong'];
$member_usid = $GLOBALS['xoopsUser']->getVar('uid', 'E');
Expand Down Expand Up @@ -235,7 +238,7 @@
}
$form->addElement(new XoopsFormText(_ADSLIGHT_TEL, 'tel', 50, 50, ''), false);

$cat_id = XoopsRequest::getInt('cid', 0, 'GET');
$cat_id = Request::getInt('cid', 0, 'GET');
$cid = addslashes($cat_id);
$cat_perms = AdslightUtilities::getMyItemIds('adslight_submit');
if (is_array($cat_perms) && count($cat_perms) > 0) {
Expand Down
4 changes: 2 additions & 2 deletions admin/admin_header.php
Expand Up @@ -27,7 +27,7 @@
include_once $roothpath . '/class/xoopsformloader.php';
require __DIR__ . '/../class/utilities.php';

xoops_load('XoopsRequest');


global $xoopsModule;
$moduleDirName = $xoopsModule->getVar('dirname');
Expand Down Expand Up @@ -63,5 +63,5 @@
redirect_header(XOOPS_URL . '/', 3, _NOPERM);
}

$myts = MyTextSanitizer::getInstance();
$myts = MyTextSanitizer::getInstance();
$adminObject = new ModuleAdmin();
16 changes: 9 additions & 7 deletions admin/category.php
Expand Up @@ -20,10 +20,12 @@
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once __DIR__ . '/admin_header.php';
xoops_cp_header();

$op = XoopsRequest::getString('op', 'liste');
$op = Request::getString('op', 'liste');

# function adsNewCat
#####################################################
Expand All @@ -48,7 +50,7 @@ function adsNewCat($cat)
<tr>
<td class=\"even\">" . _AM_ADSLIGHT_CATNAME . " </td><td class=\"odd\" colspan=2><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\">&nbsp; " . _AM_ADSLIGHT_IN . ' &nbsp;';

$cid = XoopsRequest::getInt('cid', 0, 'GET');
$cid = Request::getInt('cid', 0, 'GET');

$result = $xoopsDB->query('SELECT cid, pid, title, cat_desc, cat_keywords, img, ordre, affprice, cat_moderate, moderate_subcat FROM '
. $xoopsDB->prefix('adslight_categories')
Expand Down Expand Up @@ -155,7 +157,7 @@ function adsModCat($cid)

$mytree = new ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');

// include_once __DIR__ . '/admin_header.php';
// include_once __DIR__ . '/admin_header.php';

// loadModuleAdminMenu(1, "");
echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_ADSLIGHT_MODIFCAT . '</legend>';
Expand Down Expand Up @@ -370,7 +372,7 @@ function adsDelCat($cid, $ok = 0)

redirect_header('map.php', 1, _AM_ADSLIGHT_CATDEL);
} else {
// include_once __DIR__ . '/admin_header.php';
// include_once __DIR__ . '/admin_header.php';
// loadModuleAdminMenu(1, "");

OpenTable();
Expand All @@ -387,9 +389,9 @@ function adsDelCat($cid, $ok = 0)
${$k} = $v;
}

$ok = XoopsRequest::getString('ok', '', 'GET');
$cid = XoopsRequest::getInt('cid', 0);
$op = XoopsRequest::getString('op', '');
$ok = Request::getString('ok', '', 'GET');
$cid = Request::getInt('cid', 0);
$op = Request::getString('op', '');

switch ($op) {

Expand Down
6 changes: 4 additions & 2 deletions admin/groupperms.php
Expand Up @@ -20,10 +20,12 @@
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once __DIR__ . '/admin_header.php';
//include_once XOOPS_ROOT_PATH."/modules/adslight/class/classifiedstree.php";

$op = XoopsRequest::getString('op', 'liste');
$op = Request::getString('op', 'liste');
xoops_cp_header();
//loadModuleAdminMenu(3, "");
echo $adminObject->addNavigation(basename(__FILE__));
Expand All @@ -36,7 +38,7 @@
echo '' . _MI_ADSLIGHT_MUST_ADD_CAT . '';
} else {
//$permtoset= isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1;
$permtoset = XoopsRequest::getInt('permtoset', 1, 'POST');
$permtoset = Request::getInt('permtoset', 1, 'POST');
$selected = array('', '', '');
$selected[$permtoset - 1] = ' selected';
echo "<form method='post' name='jselperm' action='groupperms.php'><table border=0><tr><td><select name='permtoset' onChange='document.jselperm.submit()'><option value='1'"
Expand Down
6 changes: 4 additions & 2 deletions admin/install.php
Expand Up @@ -20,6 +20,8 @@
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
Expand All @@ -31,9 +33,9 @@
// loadModuleAdminMenu (6, "");
//}

$action = XoopsRequest::getString('action', '', 'POST');
$action = Request::getString('action', '', 'POST');
if (!empty($action)) {
$file = XoopsRequest::getString('file', '', 'POST');
$file = Request::getString('file', '', 'POST');
}
/*
$action = '';
Expand Down
10 changes: 6 additions & 4 deletions admin/main.php
Expand Up @@ -20,9 +20,11 @@
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once __DIR__ . '/admin_header.php';

$op = XoopsRequest::getString('op', 'liste');
$op = Request::getString('op', 'liste');

# function Index
#####################################################
Expand Down Expand Up @@ -306,9 +308,9 @@ function copyXml()
${$k} = $v;
}

$pa = XoopsRequest::getString('pa', '', 'GET');
$lid = XoopsRequest::getInt('lid', 0);
$op = XoopsRequest::getString('op', '');
$pa = Request::getString('pa', '', 'GET');
$lid = Request::getInt('lid', 0);
$op = Request::getString('op', '');

switch ($op) {
case 'CopyXml':
Expand Down
5 changes: 4 additions & 1 deletion admin/map.php
Expand Up @@ -19,9 +19,12 @@
Licence Type : GPL
-------------------------------------------------------------------------
*/

use Xmf\Request;

include_once __DIR__ . '/admin_header.php';

$op = XoopsRequest::getString('op', 'liste');
$op = Request::getString('op', 'liste');

$mytree = new ClassifiedsTree($xoopsDB->prefix('adslight_categories'), 'cid', 'pid');

Expand Down

0 comments on commit ce95bad

Please sign in to comment.