function display($tpl = null) { global $mainframe; // Check if registration is allowed $usersConfig =& JComponentHelper::getParams('com_users'); if (!$usersConfig->get('allowUserRegistration')) { JError::raiseError(403, JText::_('Access Forbidden')); return; } $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $params =& $mainframe->getParams(); // Page Title $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('Registration')); } } else { $params->set('page_title', JText::_('Registration')); } $document->setTitle($params->get('page_title')); $pathway->addItem(JText::_('New')); // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); }
public function getItemid() { $Itemid = 0; if (!$this->embedded) { $active = $this->app->getMenu()->getActive(); $Itemid = $active ? (int) $active->id : 0; } return $Itemid; }
function display($tpl = null) { global $mainframe; $user =& JFactory::getUser(); $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $model =& $this->getModel(); // GET THE PARAMETERS OF THE ACTIVE MENU ITEM $menus =& JSite::getMenu(); $menu = $menus->getActive(); $pparams =& $mainframe->getParams('com_flippingbook'); $bookId = intval(JRequest::getVar('id', 0, 'get', 'int')); $options['id'] = $bookId; $book = $model->getBook($options); $total_pages = $model->countPages($options); $document->setTitle($book->title); //SET BREADCRUMBS if (isset($menu) && isset($menu->query['view']) && $menu->query['view'] == 'book') { $pathway->addItem($book->title, ''); } //$book->params = new JParameter($book->params); $this->assignRef('book', $book); $this->assignRef('params', $pparams); $this->assignRef('total_pages', $total_pages); echo $this->showBook($bookId, 'component'); }
/** * Display function * * @since 1.5 */ function display($tpl = null) { jimport('joomla.html.html'); $mainframe =& JFactory::getApplication(); // Get the page/component configuration $params =& $mainframe->getParams(); $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME')); } } else { $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME')); } $document =& JFactory::getDocument(); $document->setTitle($params->get('page_title')); // Load the form validation behavior JHTML::_('behavior.formvalidation'); // Add the tooltip behavior JHTML::_('behavior.tooltip'); $this->assignRef('params', $params); parent::display($tpl); }
function display($tpl = null) { global $mainframe, $option; jimport('joomla.utilities.simplexml'); $showCaseID = JRequest::getInt('showcase_id', 0); if ($showCaseID == 0) { $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $showcase_id = $params->get('showcase_id', 0); } else { $showcase_id = $showCaseID; } $objUtils = JSNISFactory::getObj('classes.jsn_is_utils'); $URL = $objUtils->overrideURL(); $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase'); $row = $objJSNShowcase->getShowCaseByID($showcase_id); if (count($row) <= 0) { header("HTTP/1.0 404 Not Found"); exit; } $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json'); $dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL); echo $objJSNJSON->encode($dataObj); jexit(); }
function _findItem($needles) { static $items; if (!$items) { $component =& JComponentHelper::getComponent('com_weblinks'); $menu =& JSite::getMenu(); $items = $menu->getItems('componentid', $component->id); } if (!is_array($items)) { return null; } $match = null; foreach ($needles as $needle => $id) { foreach ($items as $item) { if (@$item->query['view'] == $needle && @$item->query['id'] == $id) { $match = $item->id; break; } } if (isset($match)) { break; } } return $match; }
public function getParameters() { $menu = JSite::getMenu(); $active = $menu->getActive(); $parameters = $active ? $menu->getParams($active->id) : $parameters = $menu->getParams(null); $parameters->def('show_page_title', 1); if(!$parameters->get('page_title')) { $parameters->set('page_title', JText::_('Login')); } if(!$active) { $parameters->def('header_login', ''); } $parameters->def('pageclass_sfx', ''); $parameters->def('login', 'index.php'); $parameters->def('description_login', 1); $parameters->def('description_login_text', JText::_('LOGIN_DESCRIPTION')); $parameters->def('image_login', 'key.jpg'); $parameters->def('image_login_align', 'right'); $parameters->def('registration', JComponentHelper::getParams('com_users')->get('allowUserRegistration')); return $parameters; }
function display() { global $mainframe, $option; $document =& JFactory::getDocument(); $menus =& JSite::getMenu(); $menu = $menus->getActive(); // Get the page/component configuration $params =& $mainframe->getParams(); //set page title $document->setTitle($menu->name); $url = $params->def('url', ''); $row = new stdClass(); if ($params->def('add_scheme', 1)) { // adds 'http://' if none is set if (substr($url, 0, 1) == '/') { // relative url in component. use server http_host. $row->url = 'http://' . $_SERVER['HTTP_HOST'] . $url; } elseif (!strstr($url, 'http') && !strstr($url, 'https')) { $row->url = 'http://' . $url; } else { $row->url = $url; } } else { $row->url = $url; } require_once JPATH_COMPONENT . DS . 'views' . DS . 'wrapper' . DS . 'view.php'; $view = new WrapperViewWrapper(); $view->assignRef('params', $params); $view->assignRef('wrapper', $row); $view->display(); }
function search() { $post['searchword'] = JRequest::getString('searchword', null, 'post'); $post['ordering'] = JRequest::getWord('ordering', null, 'post'); $post['searchphrase'] = JRequest::getWord('searchphrase', 'all', 'post'); $post['limit'] = JRequest::getInt('limit', null, 'post'); if ($post['limit'] === null) { unset($post['limit']); } $areas = JRequest::getVar('areas', null, 'post', 'array'); if ($areas) { foreach ($areas as $area) { $post['areas'][] = JFilterInput::clean($area, 'cmd'); } } // set Itemid id for links $menu =& JSite::getMenu(); $items = $menu->getItems('link', 'index.php?option=com_search_lucene&view=search'); if (isset($items[0])) { $post['Itemid'] = $items[0]->id; } unset($post['task']); unset($post['submit']); $uri = JURI::getInstance(); $uri->setQuery($post); $uri->setVar('option', 'com_search_lucene'); $this->setRedirect(JRoute::_('index.php' . $uri->toString(array('query', 'fragment')), false)); }
function modChrome_submenu($module, &$params, &$attribs) { if (!empty($module->content) && strlen($module->content) > 40) { $parent_menu = JSite::getMenu()->getActive()->tree[0]; ?> <div class="<?php echo $params->get('moduleclass_sfx'); ?> rokmodtools-<?php echo $module->id; ?> "> <div class="side-mod"> <div class="module-header"><div class="module-header2"> <h3 class="side"> <?php echo JSite::getMenu()->getItem($parent_menu)->title; ?> Menu </h3> </div></div> <div class="module"> <?php echo $module->content; ?> </div> </div> </div> <?php } }
function DuukaParseRoute($segments) { $vars = array(); //Get the active menu item $menu = JSite::getMenu(); $item = $menu->getActive(); $count = count($segments); if ($segments[$count - 2] == 'item') { $uri = JFactory::getURI(); $uri->setPath(str_replace('/item/', '/', $uri->getPath())); $app = JFactory::getApplication(); $app->redirect($uri->toString()); } if ($segments[$count - 2] == 'product') { $uri = JFactory::getURI(); $uri->setPath(str_replace('/product/', '/', $uri->getPath())); $app = JFactory::getApplication(); $app->redirect($uri->toString()); } //Handle View and Identifier switch ($item->query['view']) { case 'items': $vars['id'] = $segments[$count - 1]; $vars['view'] = 'item'; break; } return $vars; }
public function display($tpl = null) { $menu = JSite::getMenu(); $params = $menu->getParams($menu->getActive()->id); $url = KFactory::tmp('lib.koowa.filter.url')->sanitize($params->get('url')); KFactory::get('lib.joomla.application')->redirect($url); }
public function getParameters() { $menu = JSite::getMenu(); $active = $menu->getActive(); $parameters = $active ? $menu->getParams($active->id) : $parameters = $menu->getParams(null); $parameters->def('show_page_title', 1); if(!$parameters->get('page_title')) { $parameters->set('page_title', JText::_('Logout')); } if(!$active) { $parameters->def('header_logout', ''); } $parameters->def('pageclass_sfx', ''); $parameters->def('logout', 'index.php'); $parameters->def('description_logout', 1); $parameters->def('description_logout_text', JText::_('LOGOUT_DESCRIPTION')); $parameters->def('image_logout', 'key.jpg'); $parameters->def('image_logout_align', 'right'); return $parameters; }
function modChrome_submenu($module, &$params, &$attribs) { global $Itemid; $start = $params->get('startLevel'); $tabmenu =& JSite::getMenu(); $item = $tabmenu->getItem($Itemid); while ($item->parent != 0) { if ($item->sublevel == $start - 1) { break; } $item = $tabmenu->getItem($item->parent); } if (!empty($module->content) && strlen($module->content) > 40) { ?> <div class="moduletable<?php echo $params->get('moduleclass_sfx'); ?> "><div> <h3><?php echo $item->name; ?> Menu</h3> <?php echo $module->content; ?> </div> <?php } }
public function getCampaigns() { $params = JComponentHelper::getParams('com_joomailermailchimpintegration'); $menuitemid = JRequest::getInt('Itemid', 0); if ($menuitemid) { $jSite = new JSite(); $menu = $jSite->getMenu(); $menuparams = $menu->getParams($menuitemid); $params->merge($menuparams); } $filters = array('status' => 'sent'); $page = 0; $limit = $params->get('limit', 10); $cacheGroup = 'joomlamailerReports'; $cacheID = 'Campaigns_' . implode('_', $filters) . '_' . $page . '_' . $limit; if (!$this->cache($cacheGroup)->get($cacheID, $cacheGroup)) { $campaigns = $this->getMcObject()->campaigns($filters, $page, $limit); $Jconfig = JFactory::getConfig(); $tzoffset = $Jconfig->get('offset'); if ($tzoffset != 'UTC') { foreach ($campaigns as $index => $campaign) { date_default_timezone_set('Europe/London'); $datetime = new DateTime($campaign['send_time']); $timeZone = new DateTimeZone($tzoffset); $datetime->setTimezone($timeZone); $campaigns[$index]['send_time'] = $datetime->format('Y-m-d H:i:s'); } } $this->cache($cacheGroup)->store(json_encode($campaigns), $cacheID, $cacheGroup); } return json_decode($this->cache($cacheGroup)->get($cacheID, $cacheGroup), true); }
function __construct() { parent::__construct(); global $mainframe, $option; $component = JComponentHelper::getComponent('com_properties'); $params = new JParameter($component->params); $this->Mostrar = $params->get('cantidad_productos'); if (!JRequest::getVar('limitstart')) { $this->setState('limit', $this->Mostrar); $this->setState('limitstart', 0); } else { $limit = $this->Mostrar; $this->setState('limit', $this->Mostrar); $limitstart = JRequest::getVar('limitstart'); $this->setState('limitstart', $limitstart); $start = JRequest::getVar('start'); $this->setState('start', $start); } $ShowOrderByDefault = $params->get('ShowOrderByDefault'); $ShowOrderDefault = $params->get('ShowOrderDefault'); $this->filter_order = $mainframe->getUserStateFromRequest("{$option}.filter_order", 'filter_order', $ShowOrderByDefault, 'cmd'); $this->filter_order_Dir = $mainframe->getUserStateFromRequest("{$option}.filter_order_Dir", 'filter_order_Dir', $ShowOrderDefault, 'word'); $menus =& JSite::getMenu(); $menu = $menus->getActive(); $menu_params = new JParameter($menu->params); $DetailsMarket = $menu_params->get('DetailsMarket'); $this->DetailsMarket = $DetailsMarket; $this->pathway(); }
function display($tpl = null) { global $mainframe, $option; $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $options['limit'] = $limit; $options['limitstart'] = $limitstart; $user =& JFactory::getUser(); $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $model =& $this->getModel(); // Get the parameters of the active menu item $menus =& JSite::getMenu(); $menu = $menus->getActive(); // Push a model into the view $model =& $this->getModel(); $jobType = JRequest::getVar('jobType'); $options['jobType'] = $jobType; $order = Jrequest::getVar('orderby'); $options['order'] = $order; $catsone = $model->getCatsone($options); $total = count($catsone); // Set the document page title $document->setTitle(JText::_("Catsone module")); jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $this->assignRef('catsone', $catsone); $this->assignRef('jobType', $jobType); $this->assignRef('pagination', $pagination); //JHTML::_('behavior.formvalidation'); parent::display($tpl); }
/** * Displays the form * * @param bool $cachable - Is it cachable * @param bool $urlparams - The url params * * @return JControllerLegacy|void */ public function display($cachable = false, $urlparams = false) { MatukioHelperUtilsBasic::loginUser(); $document = JFactory::getDocument(); $viewName = JFactory::getApplication()->input->get('view', 'event'); $viewType = $document->getType(); $view = $this->getView($viewName, $viewType); $model = $this->getModel('Event', 'MatukioModel'); $view->setModel($model, true); $tmpl = MatukioHelperSettings::getSettings("event_template", "default"); $params = JComponentHelper::getParams('com_matukio'); $menuitemid = JFactory::getApplication()->input->getInt('Itemid'); if ($menuitemid) { $site = new JSite(); $menu = $site->getMenu(); $menuparams = $menu->getParams($menuitemid); $params->merge($menuparams); } $ptmpl = $params->get('event_template', ''); if (!empty($ptmpl)) { $tmpl = $ptmpl; } $view->setLayout($tmpl); $view->display(); }
function modChrome_submenu($module, &$params, &$attribs) { global $Itemid; $start = $params->get('startLevel'); $tabmenu =& JSite::getMenu(); $item = $tabmenu->getItem($Itemid); if (isset($item)) { $tparent = $tabmenu->getItem($item->parent); $menuname = ""; while ($tparent != null) { $item = $tabmenu->getItem($item->parent); if ($tparent->parent == $start - 1) { break; } $tparent = $tabmenu->getItem($item->parent); } if (!empty($module->content) && strlen($module->content) > 40) { ?> <div class="side-mod"> <div class="moduletable"> <h3 class="module-title"><?php echo $item->name; ?> Menu</h3> <?php echo $module->content; ?> </div> </div> <?php } } }
function prepareMenuItem(&$node,&$params) { $link_query = parse_url( $node->link ); parse_str( html_entity_decode($link_query['query']), $link_vars); $id = intval(xmap_com_eventlist::getParam($link_vars,'id',0)); $view = xmap_com_eventlist::getParam($link_vars,'view',0); if ( !$id ) { $menu =& JSite::getMenu(); $params = $menu->getParams($node->id); $id = $params->get('id',0); } if ( $id ) { if ( $view == 'details' ) { $node->uid = 'com_eventliste'.$id; $node->expandible = false; } elseif ( $view == 'categoryevents' ) { $node->expandible = true; $node->uid = 'com_eventlistc'.$id; } elseif ( $view == 'venueevents' ) { $node->expandible = true; $node->uid = 'com_eventlistv'.$id; } } else { $node->expandible = true; } }
function _displayForm($tpl = null) { global $mainframe; // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $params =& $mainframe->getParams(); // check to see if Frontend User Params have been enabled $usersConfig =& JComponentHelper::getParams('com_users'); $check = $usersConfig->get('frontend_userparams'); if ($check == '1' || $check == 1 || $check == NULL) { if ($user->authorize('com_user', 'edit')) { $params = $user->getParameters(true); } } $params->merge($params); $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('Edit Your Details')); } } else { $params->set('page_title', JText::_('Edit Your Details')); } $document =& JFactory::getDocument(); $document->setTitle($params->get('page_title')); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); }
/** * Displays the form * * @param string $tpl - The templates * * @return mixed|void */ public function display($tpl = null) { $uuid = JFactory::getApplication()->input->get('uuid', 0); $model = $this->getModel(); $params = JComponentHelper::getParams('com_matukio'); $menuitemid = JFactory::getApplication()->input->get('Itemid'); if ($menuitemid) { $site = new JSite(); $menu = $site->getMenu(); $menuparams = $menu->getParams($menuitemid); $params->merge($menuparams); } // Raise error if (empty($uuid)) { throw new Exception(JText::_("COM_MATUKIO_NO_ID"), 404); } $booking = $model->getBooking($uuid); if (empty($booking)) { throw new Exception(JText::_("COM_MATUKIO_NO_BOOKING_FOUND"), 404); } $model = JModelLegacy::getInstance('Event', 'MatukioModel'); $event = $model->getItem($booking->semid); $this->booking = $booking; $this->title = JText::_("COM_MATUKIO_BOOKING_DETAILS"); $title = JFactory::getDocument()->getTitle(); JFactory::getDocument()->setTitle($title . " - " . $this->title); $this->event = $event; $this->user = JFactory::getUser(); parent::display($tpl); }
function display($tpl = null) { $this->mainframe = JFactory::getApplication(); $this->option = JRequest::getCmd('option'); $filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order', 'filter_order', 'm.title', 'string'); $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.polls.filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $this->mainframe->getUserStateFromRequest($this->option . '.polls.search', 'search', '', 'string'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['search'] = $search; JHTML::_('behavior.tooltip'); if (MijopollsHelper::is15()) { $params = $this->mainframe->getParams(); } else { $menu = JSite::getMenu()->getActive(); $menu_params = new JRegistry($menu->params); $params = clone $this->mainframe->getParams(); $params->merge($menu_params); } $this->lists = $lists; $this->params = $params; $this->items = $this->get('Data'); $this->pagination = $this->get('Pagination'); if (MijopollsHelper::is30()) { $tpl = '30'; } parent::display($tpl); }
function PhocaguestbookParseRoute($segments) { $vars = array(); //Get the active menu item $menu =& JSite::getMenu(); $item =& $menu->getActive(); if (is_object($item)) { if (isset($item->query['view']) && $item->query['view'] == 'phocaguestbook' && isset($segments[0])) { $vars['view'] = 'phocaguestbook'; $vars['id'] = $segments[0]; } } else { // Count route segments $count = count($segments); // Check if there are any route segments to handle. if ($count) { if (count($segments[0]) == 1) { $vars['view'] = 'phocaguestbook'; $vars['id'] = $segments[$count - 1]; } else { $vars['view'] = 'phocaguestbook'; $vars['id'] = $segments[$count - 1]; } } } return $vars; }
/** * Prepares the document */ protected function _prepareDocument() { $app =& JFactory::getApplication(); $pathway =& $app->getPathway(); $menus =& JSite::getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself if ($menu = $menus->getActive()) { if (isset($menu->query['view']) && $menu->query['view'] == 'form') { $menuParams = new JParameter($menu->params); $title = $menuParams->get('page_title'); } } if (empty($title)) { $title = JText::_('Content_Form_Edit_Article'); } $this->document->setTitle($title); $this->params->set('page_title', $title); $pathway =& $app->getPathWay(); $pathway->addItem($title, ''); // If there is a pagebreak heading or title, add it to the page title if (!empty($this->item->page_title)) { $article->title = $article->title . ' - ' . $article->page_title; $this->document->setTitle($article->page_title . ' - ' . JText::sprintf('Page %s', $this->state->get('page.offset') + 1)); } }
function display($tpl = null) { // redirect guests to login page $mainframe =& JFactory::getApplication(); $user =& JFactory::getUser(); if ($user->id != 0) { $Lists = $this->get('Lists'); $this->assignRef('lists', $Lists); //--Creating a link to the edit form $this->assignRef('editlink', JRoute::_('index.php?option=com_joomailermailchimpintegration&view=subscriptions&task=edit')); // retrieve page title from the menuitem $menus =& JSite::getMenu(); $menu = $menus->getActive(); $menu_params = new JParameter($menu->params); $this->assignRef('page_title', $menu_params->get('page_title')); parent::display($tpl); } else { // Redirect to login $uri = JFactory::getURI(); $return = $uri->toString(); if (version_compare(JVERSION, '1.6.0', 'ge')) { $url = 'index.php?option=com_users&view=login'; } else { $url = 'index.php?option=com_user&view=login'; } $url .= '&return=' . base64_encode($return); $mainframe->redirect($url, JText::_('JM_ONLY_LOGGED_IN_USERS_CAN_VIEW_SUBSCRIPTIONS')); } }
public function onAfterDispatch() { $app = JFactory::getApplication(); if (!$app->isSite()) { return; } $params = $this->params; $document = JFactory::getDocument(); $menu = JSite::getMenu(); $is_frontpage = $menu->getActive() == $menu->getDefault(); $sitename = $params->get('sitename') ? $params->get('sitename') : $app->getCfg('sitename'); if ($is_frontpage) { if ($params->get('frontpage_sitename')) { $sitename = $params->get('frontpage_sitename'); } if ($params->get('frontpage') == '1') { return $document->setTitle($sitename); } } // {s} is used to protect the leading and trailing spaces $separator = str_replace('{s}', ' ', $params->get('separator')); $current = $document->getTitle(); // Joomla 1.6 already sets title to the site name if there is no active menu item if ($current === $sitename) { return; } if ($params->get('position') == 'after') { $title = $current . $separator . $sitename; } else { $title = $sitename . $separator . $current; } $document->setTitle($title); }
/** * Prepares the document */ protected function _prepareDocument() { $app =& JFactory::getApplication(); $menus =& JSite::getMenu(); $pathway =& $app->getPathway(); // Because the application sets a default page title, // we need to get it from the menu item itself if ($menu = $menus->getActive()) { $menuParams = new JParameter($menu->params); if ($title = $menuParams->get('page_title')) { $this->document->setTitle($title); } else { $this->document->setTitle(JText::_('WEB_LINKS')); } // Set breadcrumbs. if ($menu->query['view'] != 'category') { $pathway->addItem($this->category->title, ''); } } else { $this->document->setTitle(JText::_('WEB_LINKS')); } // Add alternate feed link if ($this->params->get('show_feed_link', 1) == 1) { $link = '&view=category&id=' . $this->category->slug . '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } }
/** * Class constructor */ function __construct($options = array()) { //Initialise the array $this->_pathway = array(); $menu =& JSite::getMenu(); if ($item = $menu->getActive()) { $menus = $menu->getMenu(); $home = $menu->getDefault(); if (is_object($home) && $item->id != $home->id) { foreach ($item->tree as $menupath) { $url = ''; $link = $menu->getItem($menupath); switch ($link->type) { case 'menulink': case 'url': $url = $link->link; break; case 'separator': $url = null; break; default: $url = 'index.php?Itemid=' . $link->id; } $this->addItem($menus[$menupath]->name, $url); } // end foreach } } // end if getActive }
/** * Method to get the Venues * * @access public * @return array */ function &getData() { $mainframe =& JFactory::getApplication(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $elsettings =& redEVENTHelper::config(); // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); // Get a reference to the global cache object. $cache =& JFactory::getCache('redevent'); $this->_data = $cache->call(array('RedeventModelCountriesmap', '_getResultList'), $query); $countrycoords = redEVENTHelperCountries::getCountrycoordArray(); $k = 0; for ($i = 0; $i < count($this->_data); $i++) { $country =& $this->_data[$i]; $country->flag = REOutput::getFlag($country->iso2); $country->flagurl = REOutput::getFlagUrl($country->iso2); $country->latitude = $countrycoords[$country->iso2][0]; $country->longitude = $countrycoords[$country->iso2][1]; //create target link $country->targetlink = JRoute::_(JURI::base() . 'index.php?option=com_redevent&view=countryevents&filter_country=' . $country->iso2); $k = 1 - $k; } } return $this->_data; }