public static function getInstance(&$query = null) { defined('DS') or define('DS', DIRECTORY_SEPARATOR); if (!class_exists('VmConfig')) { require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; } VmConfig::loadConfig(); if (!self::$_instance) { self::$_instance = new vmrouterHelper($query); if (self::$limit === null) { $mainframe = Jfactory::getApplication(); $view = 'virtuemart'; if (isset($query['view'])) { $view = $query['view']; } self::$limit = $mainframe->getUserStateFromRequest('com_virtuemart.' . $view . '.limit', VmConfig::get('list_limit', 20), 'int'); } } self::$_instance->query = $query; return self::$_instance; }
public static function getInstance(&$query = null) { if (!class_exists('VmConfig')) { require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'; } VmConfig::loadConfig(); if (!self::$_instance) { self::$_instance = new vmrouterHelper($query); if (self::$limit === null) { $mainframe = Jfactory::getApplication(); $view = 'virtuemart'; if (isset($query['view'])) { $view = $query['view']; } self::$limit = $mainframe->getUserStateFromRequest('com_virtuemart.' . $view . '.limit', VmConfig::get('list_limit', 20), 'int'); // self::$limit= $mainframe->getUserStateFromRequest('global.list.limit', 'limit', VmConfig::get('list_limit', 20), 'int'); } } return self::$_instance; }