/** * Add a menu on the sidebar of page */ protected function addSidebar() { JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName()); jimport("crowdfunding.filters"); $filters = new CrowdFundingFilters(JFactory::getDbo()); $types = $filters->getLogTypes(); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $types, 'value', 'text', $this->state->get('filter.type'), true)); $this->sidebar = JHtmlSidebar::render(); }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { // Initialize variables. $options = array(); // Get types $filters = new CrowdFundingFilters(JFactory::getDbo()); $typesOptions = $filters->getProjectsTypes(); // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options, $typesOptions); return $options; }
/** * Create an object. * * <code> * $filters = CrowdFundingFilters::getInstance(JFactory::getDbo()); * </code> * * @param JDatabaseDriver $db * * @return null|CrowdFundingFilters */ public static function getInstance(JDatabaseDriver $db) { if (is_null(self::$instance)) { self::$instance = new CrowdFundingFilters($db); } return self::$instance; }
/** * Add a menu on the sidebar of page */ protected function addSidebar() { // Create object Filters and load some filters options. jimport("crowdfunding.filters"); $filters = new CrowdFundingFilters(JFactory::getDbo()); // Get payment services. $paymentServices = $filters->getPaymentServices(); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_PAYMENT_SERVICES'), 'filter_payment_service', JHtml::_('select.options', $paymentServices, 'value', 'text', $this->state->get('filter.payment_service'), true)); // Get payment statuses. $paymentStatuses = $filters->getPaymentStatuses(); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_PAYMENT_STATUS'), 'filter_payment_status', JHtml::_('select.options', $paymentStatuses, 'value', 'text', $this->state->get('filter.payment_status'), true)); // Get reward states. $rewardDistributionStatuses = $filters->getRewardDistributionStatuses(); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_REWARD_STATUS'), 'filter_reward_state', JHtml::_('select.options', $rewardDistributionStatuses, 'value', 'text', $this->state->get('filter.reward_state'), true)); $this->sidebar = JHtmlSidebar::render(); }
/** * Add a menu on the sidebar of page */ protected function addSidebar() { JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName()); // Prepare options $approvedOptions = array(JHtml::_("select.option", 1, JText::_("COM_CROWDFUNDING_APPROVED")), JHtml::_("select.option", 0, JText::_("COM_CROWDFUNDING_DISAPPROVED"))); $featuredOptions = array(JHtml::_("select.option", 1, JText::_("COM_CROWDFUNDING_FEATURED")), JHtml::_("select.option", 0, JText::_("COM_CROWDFUNDING_NOT_FEATURED"))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_APPROVED_STATUS'), 'filter_approved', JHtml::_('select.options', $approvedOptions, 'value', 'text', $this->state->get('filter.approved'), true)); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_FEATURED_STATUS'), 'filter_featured', JHtml::_('select.options', $featuredOptions, 'value', 'text', $this->state->get('filter.featured'), true)); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_crowdfunding'), 'value', 'text', $this->state->get('filter.category_id'))); jimport("crowdfunding.filters"); $filters = new CrowdFundingFilters(JFactory::getDbo()); $typesOptions = $filters->getProjectsTypes(); JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_TYPE'), 'filter_type_id', JHtml::_('select.options', $typesOptions, 'value', 'text', $this->state->get('filter.type_id'))); $this->sidebar = JHtmlSidebar::render(); }