function display($tpl = null) { $app = JFactory::getApplication(); $params = clone $app->getParams('com_rsmembership'); $this->params = $params; $this->item = $this->get('Item'); if (empty($this->item->id) || !$this->item->published) { JError::raiseWarning(500, JText::_('COM_RSMEMBERSHIP_MEMBERSHIP_NOT_EXIST')); $app->redirect(JRoute::_(RSMembershipRoute::Memberships())); } $currency = RSMembershipHelper::getConfig('currency'); // {price} placeholder $price = RSMembershipHelper::getPriceFormat($this->item->price); // {extras} placeholder $viewclass = RSMembershipHelper::isJ3() ? 'JViewLegacy' : 'JView'; if ($viewclass == 'JView') { jimport('joomla.application.component.view'); } $view = new $viewclass(array('name' => 'extras', 'base_path' => JPATH_SITE . '/components/com_rsmembership')); $view->model = JModelLegacy::getInstance('Extras', 'RSMembershipModel'); $view->extras = $view->model->getItems(); $view->item = $this->item; $view->show_subscribe_btn = $this->item->stock == -1 ? false : true; $this->extras = $view->loadTemplate(); $placeholders = array('{price}' => $price, '{buy}' => '', '{extras}' => '', '{stock}' => $this->item->stock > -1 ? $this->item->stock == 0 ? JText::_('COM_RSMEMBERSHIP_UNLIMITED') : $this->item->stock : JText::_('COM_RSMEMBERSHIP_OUT_OF_STOCK_PLACEHOLDER'), '<hr id="system-readmore" />' => ''); $replace = array_keys($placeholders); $with = array_values($placeholders); $this->item->description = str_replace($replace, $with, $this->item->description); // prepare the Pathway $pathway = $app->getPathway(); $this->Itemid = JFactory::getApplication()->input->get('Itemid', 0, 'int'); $layout = JFactory::getApplication()->input->get('layout', '', 'cmd'); if ($this->item->category_id) { $pathway->addItem($this->item->category_name, JRoute::_(RSMembershipRoute::Memberships($this->item->category_id, $this->Itemid, $layout))); } $pathway->addItem($this->item->name, ''); // Title if (!$params->get('page_title')) { $this->document->setTitle($this->item->name); } else { $this->document->setTitle($params->get('page_title') . ' - ' . $this->item->name); } // Description if ($params->get('menu-meta_description')) { $this->document->setDescription($params->get('menu-meta_description')); } // Keywords if ($params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $params->get('menu-meta_keywords')); } // Robots if ($params->get('robots')) { $this->document->setMetadata('robots', $params->get('robots')); } parent::display(); }
function getTerms() { $app = JFactory::getApplication(); $cid = $app->input->get('cid', 0, 'int'); $row = JTable::getInstance('Term', 'RSMembershipTable'); $row->load($cid); if (!$row->published) { JError::raiseWarning(500, JText::_('COM_RSMEMBERSHIP_NO_TERM')); $app->redirect(JRoute::_(RSMembershipRoute::Memberships(), false)); } return $row; }
<?php $k = 1; ?> <?php foreach ($this->items as $i => $item) { ?> <tr class="sectiontableentry<?php echo $k . $this->escape($this->params->get('pageclass_sfx')); ?> " > <td align="right"><?php echo $this->pagination->getRowOffset($i); ?> </td> <td><a href="<?php echo JRoute::_(RSMembershipRoute::Memberships($item->id, $this->Itemid, 'list')); ?> "><?php echo $this->escape($item->name); ?> </a><?php if ($this->params->get('show_memberships', 0)) { ?> (<?php echo $item->memberships; ?> )<?php } ?> </td> </tr>
<div class="item-page"> <?php if ($this->params->get('show_page_heading', 1)) { ?> <div class="page-header"> <h1><?php echo $this->escape($this->params->get('page_heading')); ?> </h1> </div> <?php } ?> <form action="<?php echo JRoute::_(RSMembershipRoute::Memberships(JFactory::getApplication()->input->get('catid', 0, 'int'), $this->Itemid, 'list')); ?> " method="post" name="adminForm" id="rsm_rsmembership_form_list"> <table width="99%" class="table<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> table-stripped table-bordered table-hover"> <?php if ($this->params->get('show_headings', 1)) { ?> <tr> <th class="sectiontableheader<?php echo $this->escape($this->params->get('pageclass_sfx')); ?> " align="right" width="5%"><?php echo JText::_('#');