/** * Constructor * * For php4 compatability we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ function plgTiendaReport_prepayments(&$subject, $config) { parent::__construct($subject, $config); $language = JFactory::getLanguage(); $language->load('plg_tienda_' . $this->_element, JPATH_ADMINISTRATOR, 'en-GB', true); $language->load('plg_tienda_' . $this->_element, JPATH_ADMINISTRATOR, null, true); }
/** * Override parent::_getState() to do the filtering * * @return object */ function _getState() { $app = JFactory::getApplication(); $model = $this->_getModel('carts'); $ns = $this->_getNamespace(); $state = parent::_getState(); // get the basic state values from the parent method $state['filter_name'] = $app->getUserStateFromRequest($ns . 'name', 'filter_name', '', ''); $state = $this->_handleRangePresets($state); foreach (@$state as $key => $value) { $model->setState($key, $value); } return $state; }
/** * Override parent::_getState() to do the filtering * * @return object */ function _getState() { $app = JFactory::getApplication(); $model = $this->_getModel($this->get('default_model')); $ns = $this->_getNamespace(); $state = parent::_getState(); // get the basic state values from the parent method // then add your own custom ones just for this report // $state['filter_name'] = $app->getUserStateFromRequest($ns.'name', 'filter_name', '', ''); //$state['filter_product_id'] = $app->getUserStateFromRequest($ns.'product_id', 'filter_product_id', '', ''); $state['filter_product_name'] = $app->getUserStateFromRequest($ns . 'product_name', 'filter_product_name', '', ''); $state['filter_manufacturer_id'] = $app->getUserStateFromRequest($ns . 'manufacturer_id', 'filter_manufacturer_id', '', ''); // then apply the states to the model foreach (@$state as $key => $value) { $model->setState($key, $value); } return $state; }
/** * Override parent::_getState() to do the filtering * * @return object */ function _getState() { $app = JFactory::getApplication(); $model = $this->_getModel($this->get('default_model')); $ns = $this->_getNamespace(); $state = parent::_getState(); $state['filter_name'] = $app->getUserStateFromRequest($ns . 'name', 'filter_name', '', ''); $state['filter_quantity_from'] = $app->getUserStateFromRequest($ns . 'quantity_from', 'filter_quantity_from', '', ''); $state['filter_quantity_to'] = $app->getUserStateFromRequest($ns . 'quantity_to', 'filter_quantity_to', '', ''); $state['filter_product_name'] = $app->getUserStateFromRequest($ns . 'filter_product_name', 'filter_product_name', '', ''); $state['filter_product_name'] = $app->getUserStateFromRequest($ns . 'filter_product_name', 'filter_product_name', '', ''); $state['filter_product_name'] = $app->getUserStateFromRequest($ns . 'filter_product_name', 'filter_product_name', '', ''); $state = $this->_handleRangePresets($state); foreach (@$state as $key => $value) { $model->setState($key, $value); } return $state; }
/** * Constructor * * For php4 compatability we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.5 */ function plgTiendaReport_dailysales(&$subject, $config) { parent::__construct($subject, $config); $this->loadLanguage('', JPATH_ADMINISTRATOR); }