Example #1
0
 /**
  * Fetches and returns raw text
  *
  * @param string $name    Variable name
  * @param string $default Default value if the variable does not exist
  * @param string $hash    Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
  *
  * @return string Requested variable
  */
 public static function getText($name, $default = '', $hash = 'default')
 {
     return (string) XoopsRequest::getVar($name, $default, $hash, 'string', XoopsRequest::ALLOWRAW);
 }
// Check user rights
if (is_object($xoopsUser)) {
    $admintest = 0;
    $xoopsModule =& XoopsModule::getByDirname(basename(__DIR__));
    if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
        redirect_header(XOOPS_URL, 3, _NOPERM);
        exit;
    }
    $admintest = 1;
} else {
    redirect_header(XOOPS_URL, 3, _NOPERM);
    exit;
}
// XOOPS Class
include_once $GLOBALS['xoops']->path('/class/pagenav.php');
include_once $GLOBALS['xoops']->path('/class/template.php');
include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php');
include_once $GLOBALS['xoops']->path('/class/xoopslists.php');
include_once $GLOBALS['xoops']->path('/class/xoopsrequest.php');
if (!isset($GLOBALS['xoopsTpl']) || !is_object($GLOBALS['xoopsTpl'])) {
    $GLOBALS['xoopsTpl'] = new XoopsTpl();
}
// System Presets
xoops_loadLanguage('admin', basename(__DIR__));
include_once $GLOBALS['xoops']->path('/modules/' . basename(__DIR__) . '/common.php');
include_once $GLOBALS['xoops']->path('/modules/' . basename(__DIR__) . '/constants.php');
// Get request variable
$op = XoopsRequest::getVar('op', 'dashboard', 'GET');
$fct = XoopsRequest::getVar('fct', 'confirm', 'GET');
$key = XoopsRequest::getVar('key', md5(NULL), 'GET');
$myts =& MyTextSanitizer::getInstance();