function exportItems() { $app = JFactory::getApplication(); $id = $app->input->getInt('id'); F0FModel::addIncludePath(JPATH_SITE . '/plugins/j2store/report_itemised/report_itemised/models'); $model = F0FModel::getTmpInstance('ReportItemised', 'J2StoreModel'); $data = $model->getData(); $filename = $model->export($data); die; $app->close(); }
/** * constructor */ function __construct() { $app = JFactory::getApplication(); $values = $app->input->getArray($_POST); parent::__construct(); F0FModel::addIncludePath(JPATH_SITE . '/plugins/j2store/' . $this->_element . '/' . $this->_element . '/models'); F0FModel::addTablePath(JPATH_SITE . '/plugins/j2store/' . $this->_element . '/' . $this->_element . '/tables'); JFactory::getLanguage()->load('plg_j2store_' . $this->_element, JPATH_ADMINISTRATOR); $this->registerTask('newMethod', 'newMethod'); $this->registerTask('apply', 'save'); }
/** * Adds to the stack of model paths in LIFO order. * * @param mixed $path The directory (string) , or list of directories (array) to add. * @param string $prefix A prefix for models * * @return void */ public static function addModelPath($path, $prefix = '') { F0FModel::addIncludePath($path, $prefix); }
protected function includeCustomModels() { // Include the custom table F0FModel::addIncludePath(JPATH_SITE . '/plugins/j2store/' . $this->_element . '/' . $this->_element . '/models'); JFactory::getApplication()->triggerEvent('includeCustomModels', array()); }
/** * Include a particular J2Store Model * @param $name the name of the mode (ex: products) */ protected function includeJ2StoreModel($name, $admin = true) { if ($admin) { $base_path = JPATH_ADMINISTRATOR; } else { $base_path = JPATH_SITE; } F0FModel::addIncludePath($base_path . '/components/com_j2store/models/' . strtolower($name)); }
/** * Generates a selectlist for shipping methods * * @param unknown_type $selected * @param unknown_type $name * @param unknown_type $attribs * @param unknown_type $idtag * @return unknown_type */ public static function shippingmethod($selected, $name = 'filter_shipping_method', $attribs = array('class' => 'inputbox'), $idtag = null) { $list = array(); F0FModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_j2store/models'); //JModelLegacy::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_j2store/models' ); $model = F0FModel::getAnInstance('Shippingmethods', 'J2StoreModel'); $model->setState('filter_enabled', true); $items = $model->getList(); foreach (@$items as $item) { $list[] = self::option($item->shipping_method_id, JText::_($item->shipping_method_name)); } return JHTML::_('select.radiolist', $list, $name, $attribs, 'value', 'text', $selected, $idtag); }