<?php
/*
Last change in version: 2.1 Alpha 2
#########################################################################################
# ADbNewsSender 2 #
# Copyright (C) 2010 Florian Grannemann (E-mail: hide@address.com) #
# Website: http://adbnewssender.sf.net #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# any later version. #
# #
# 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. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see http://www.gnu.org/licenses/ #
#########################################################################################
*/
/*
This file defines the request handler for the admin area
*/
//autogenerated request key names:
//general global keys: $keyname
//general moduleeeee specific keys $modulename.$KeyNameSeperator.$keyname
//global nl specific keys: $NLID.$KeyNameSeperator.$keyname
//moduleeee and nl specific keys: $NLID.$KeyNameSeperator.$moduletype.$KeyNameSeperator.$modulenumber.$KeyNameSeperator.$keyname
class ADBNS_RequestHandler{
private $CurrentModuleType="";
private $KeyNameSeperator="";
private $NLID=0;
private $CurrentModuleNumber=0;
function getKeyValue($name)
{
return $_REQUEST[$name];
}
function setCurrentModuleType($currentModule)
{
$this->CurrentModuleType=$currentModule;
}
function setCurrentModuleNumber($currentModuleNumber)
{
$this->CurrentModuleNumber=intval($currentModuleNumber);
}
function getCurrentModuleType()
{
return $this->CurrentModuleType;
}
function getCurrentModuleNumber()
{
return $this->CurrentModuleNumber;
}
function getCurrentModule($seperator="|")
{
return $this->getCurrentModuleType().$seperator.$this->getCurrentModuleNumber();
}
function getModuleKeyValue($name)
{
return $this->getKeyValue($this->getCurrentModule($this->KeyNameSeperator).$this->KeyNameSeperator.$name);
}
function getModuleKeyName($name)
{
return $this->getCurrentModule($this->KeyNameSeperator).$this->KeyNameSeperator.$name;
}
function setNLID($nlID)
{
$this->NLID=intval($nlID);
}
function getNLID()
{
return $this->NLID;
}
function getNLKeyValue($name)
{
return $this->getKeyValue($this->getNLID().$this->KeyNameSeperator.$name);
}
function getNLKeyName($name)
{
return $this->getNLID().$this->KeyNameSeperator.$name;
}
function getNLModuleKeyValue($name)
{
return $this->getNLKeyValue($this->getCurrentModule($this->KeyNameSeperator).$this->KeyNameSeperator.$name);
}
function getNLModuleKeyName($name)
{
return $this->getNLKeyName($this->getCurrentModule($this->KeyNameSeperator).$this->KeyNameSeperator.$name);
}
function issetKey($name){
return isset($_REQUEST[$name]);
}
function issetNLKey($name){
return $this->issetKey($this->getNLKeyName($name));
}
function issetModuleKey($name){
return $this->issetKey($this->getModuleKeyName($name));
}
function issetNLModuleKey($name){
return $this->issetKey($this->getNLModuleKeyName($name));
}
function __construct($keyNameSeperator="_")
{
$this->KeyNameSeperator=$keyNameSeperator;
}
}