This is the code I'm using in the constructor (I'll only post this section of code since I'm sure the rest of the code is working properly):
Code: Select all
function __construct($id = NULL)
{
global $mainframe, $option;
dump($mainframe, 'mainframe');
dump($option, 'option');
parent::__construct();
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', 2/*$mainframe->getCfg('list_limit')*/, 'int');
///////////////////////////////////////////////////////////////////////////////////////////
//
// CODE NOT WORKING PROPERLY:
// $limit_start = $mainframe->getUserStateFromRequest("$option.limitstart", 'limitstart', 0, 'int');
//
//////////////////////////////////////////////////////////////////////////////////////////
$limit_start = JRequest::getVar('limitstart', 0, 'int'); // <-- Meanwhile Workaround
dump($limit, 'limit');
$limit_start = ($limit != 0 ? (floor($limit_start / $limit) * $limit) : 0);
dump($limit_start, 'limit_start');
$this->setState('limit', $limit);
$this->setState('limitstart', $limit_start);
if($id == NULL)
{
$cid = JRequest::getVar('cid', false, 'DEFAULT', 'array');
if($cid)
{
$id = $cid[0];
}else{
$id = JRequest::getInt('id', 1);
}
}
$this->setId($id);
dump($this);
}