/** * Create a uri based on a full or partial url string * * @param string $url The URI * * @return JUri * * @since 3.2 */ protected function createURI($url) { // Create the URI $uri = parent::createURI($url); // Get the itemid form the URI $itemid = $uri->getVar('Itemid'); if (is_null($itemid)) { if ($option = $uri->getVar('option')) { $item = $this->menu->getItem($this->getVar('Itemid')); if (isset($item) && $item->component == $option) { $uri->setVar('Itemid', $item->id); } } else { if ($option = $this->getVar('option')) { $uri->setVar('option', $option); } if ($itemid = $this->getVar('Itemid')) { $uri->setVar('Itemid', $itemid); } } } else { if (!$uri->getVar('option')) { if ($item = $this->menu->getItem($itemid)) { $uri->setVar('option', $item->component); } } } return $uri; }
public function getItems() { if ($items = parent::getItems()) { $component = JComponentHelper::getComponent('com_tz_portfolio_plus'); $menus = JMenu::getInstance('site'); $menu_assigned = array(); if ($menu_items = $menus->getItems(array('component_id'), $component->id)) { if (count($menu_items)) { foreach ($menu_items as $m) { if (isset($m->params)) { $params = $m->params; if ($tpl_style_id = $params->get('tz_template_style_id')) { if (!isset($menu_assigned[$tpl_style_id])) { $menu_assigned[$tpl_style_id] = 0; } $menu_assigned[$tpl_style_id]++; } } } } } foreach ($items as $i => &$item) { $item->menu_assigned = 0; if (isset($menu_assigned[$item->id])) { $item->menu_assigned = $menu_assigned[$item->id]; } } return $items; } return false; }
function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $cityid = $params->get('cityid', '1'); $cityid = JRequest::getVar('cityid', $cityid); //if($cityid==1) $hotels = $model->getHotelsByCity($cityid); $pagination = $model->getPagination(); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID); } //get controller $mainframe->setPageTitle(JTEXT::_("HOTELS IN") . " " . $hotels[0]->city_Name); //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }
function authorize($id) { if (J1_6) { return $this->authorise($id); } else { $user =& JFactory::getUser(); return parent::authorize($id, $user->get('aid')); } }
function &getMenu() { jimport('joomla.application.menu'); $options = array(); $menu =& JMenu::getInstance('site', $options); if (JError::isError($menu)) { $null = null; return $null; } return $menu; }
/** * Get menu items from the platform. * * @param array $params * @return array List of routes to the pages. */ protected function getItemsFromPlatform($params) { $attributes = ['menutype']; $values = [$params['menu']]; // Items are already filtered by access and language, in admin we need to work around that. if (\JFactory::getApplication()->isAdmin()) { $attributes[] = 'access'; $values[] = null; $attributes[] = 'language'; $values[] = null; } return $this->menu->getItems($attributes, $values); }
function __construct() { $this->alltimepoints = JRequest::getVar("points", 0); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //$menu = &JSite::getMenu(); $show_debug_info = JComponentHelper::getParams('com_joomleague')->get('show_debug_info', 0); if ($show_debug_info) { $this->debug_info = true; } else { $this->debug_info = false; } if ($item->id) { // diddipoeler // menueeintrag vorhanden $registry = new JRegistry(); $registry->loadArray($params); //$newparams = $registry->toString('ini'); $newparams = $registry->toArray(); //echo "<b>menue newparams</b><pre>" . print_r($newparams, true) . "</pre>"; foreach ($newparams['data'] as $key => $value) { $this->_params[$key] = $value; } } else { $strXmlFile = JLG_PATH_SITE . DS . 'settings' . DS . 'default' . DS . 'rankingalltime.xml'; // get the JForm object $form =& JForm::getInstance('jlattform', $strXmlFile); //echo "<b>menue form</b><pre>" . print_r($form, true) . "</pre>"; foreach ($form->getFieldset($fieldset->name) as $field) { // echo ' -> '. $field->name.'<br>'; // echo ' -> '. $field->type.'<br>'; // echo ' -> '. $field->input.'<br>'; $this->_params[$field->name] = $field->value; } /* $registry = new JRegistry(); $registry->loadArray($strXmlFile); //$newparams = $registry->toString('ini'); $newparams = $registry->toArray(); //echo "<b>menue newparams</b><pre>" . print_r($newparams, true) . "</pre>"; foreach ($newparams['data'] as $key => $value ) { $this->_params[$key] = $value; } */ } parent::__construct(); }
/** * * */ public function getParams($pks) { $app = JFactory::getApplication('site'); $siteMenu = JMenu::getInstance('site'); $menuParams = $siteMenu->getItem($pks['Itemid']); if (isset($menuParams->params)) { $params = $menuParams->params; } else { $params = $this->getState()->get('params'); } $JSNConfig = JSNFactory::getConfig(); $JSNConfig->megreGlobalParams($pks['option'], $params); return $params; }
function display($tpl = null) { global $option, $mainframe; //echo $next2day["mday"]; $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $hotelid = $params->get('hotelid', ''); ///echo "o".$hotelid."o"; $model =& $this->getModel(); $hid = JRequest::getVar('hid', $hotelid); //echo JPATH_COMPONENT.DS; $today = getdate(); $next2day = getdate(($today["0"] / (60 * 60 * 24) + 2) * (60 * 60 * 24)); $checkin_date = JRequest::getVar('checkin_date', $today["mday"] . '/' . $today["mon"] . '/' . $today["year"]); $checkout_date = JRequest::getVar('checkout_date', $next2day["mday"] . '/' . $next2day["mon"] . '/' . $next2day["year"]); //echo $checkout_date; //echo $model; $hotel = $model->getHotelDetails($hid); $rates = $model->getRatesAll($hid); $promotions = $model->getPromotions($hid); //echo $rates[0]->room_Name; $tab_selected = JRequest::getVar('stab', '0'); //echo $tab_selected; //get controller $controller = new VnffhotelController(); $mainframe->setPageTitle($hotel->hotel_Name); //echo $hotel->hotel_ID; //echo "huhuhu"; $images->main = $model->getHotelImages($hid, 'm'); if (count($images->main) == 0) { $image->image_Name = "noimage.png"; $images->main[0] = $image; } $images->overview = $model->getHotelImages($hid, 'o'); $images->facility = $model->getHotelImages($hid, 'f'); $images->room = $model->getHotelImages($hid, 'r'); $this->assignRef('hotel', $hotel); $this->assignRef('images', $images); $this->assignRef('promotions', $promotions); $this->assignRef('tab_selected', $tab_selected); $this->assignRef('controller', $controller); $this->assignRef('checkin_date', $checkin_date); $this->assignRef('checkout_date', $checkout_date); if ($hid == '') { echo "<div class='invalid_hotel'>" . JTEXT::_("INVALID HOTEL..!!") . "</div>"; } else { parent::display($tpl); } }
function step1() { global $option, $mainframe; $mainframe->setPageTitle(JTEXT::_("STEP 1")); $model =& $this->getModel(); $hid = JRequest::getVar('hid', ''); if ($hid == '') { echo '<div class="invalid_hotel">' . JTEXT::_("INVALID HOTEL...!") . '</div>'; return; } $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $today = getdate(); $next2day = getdate(($today["0"] / (60 * 60 * 24) + 2) * (60 * 60 * 24)); $checkin_date = JRequest::getVar('checkin_date', $today["mday"] . '/' . $today["mon"] . '/' . $today["year"]); $checkout_date = JRequest::getVar('checkout_date', $next2day["mday"] . '/' . $next2day["mon"] . '/' . $next2day["year"]); $room_id = JRequest::getVar('room_id', ''); $checkin_date_r = explode('/', $checkin_date); $checkout_date_r = explode('/', $checkout_date); //$checkin_date = getdate(mktime(0, 0, 0, $checkin_date_r[1], $checkin_date_r[0], $checkin_date_r[2])); $days_count = round((-mktime(0, 0, 0, $checkin_date_r[1], $checkin_date_r[0], $checkin_date_r[2]) + mktime(0, 0, 0, $checkout_date_r[1], $checkout_date_r[0], $checkout_date_r[2])) / (60 * 60 * 24), 0); if ($days_count < 1) { $checkin_date = $today["mday"] . '/' . $today["mon"] . '/' . $today["year"]; $checkout_date = $next2day["mday"] . '/' . $next2day["mon"] . '/' . $next2day["year"]; $days_count = 2; } //get controller //$controller = new VnffhotelController(); //get rooms types of a hotel $roomTypes = $model->getRoomTypes($hid); if (count($roomTypes) == 0) { echo '<div class="notroom_hotel">' . JTEXT::_("HOTEL NOT YET FOR BOOKING") . '</div>'; return; } $hotel = $model->getHotel($hid); //echo $roomTypes[0]->room_Name; //$cityid = $params->get('cityid', '32'); $this->assignRef('controller', $controller); $this->assignRef('checkin_date', $checkin_date); $this->assignRef('checkout_date', $checkout_date); $this->assignRef('room_id', $room_id); $this->assignRef('roomTypes', $roomTypes); $this->assignRef('hotel', $hotel); $this->assignRef('days_count', $days_count); parent::display("step1"); }
/** * Fills the lookup variable. * * @return null */ private function makeLookup() { $this->lookup = array(); $component = JComponentHelper::getComponent('com_monitor'); $attributes = array('component_id'); $values = array($component->id); $items = $this->menu->getItems($attributes, $values); foreach ($items as $item) { if (isset($item->query)) { switch ($item->query['view']) { case 'projects': $this->addLookup((int) $item->id, 'projects'); break; case 'comments': $this->addLookup((int) $item->id, 'comments'); break; case 'project': if (isset($item->query['id'])) { $this->addLookup((int) $item->id, 'project', $item->query['id']); } break; case 'issues': $id = isset($item->query['project_id']) ? $item->query['project_id'] : '_'; $this->addLookup((int) $item->id, 'issues', $id); break; case 'issue': $layout = isset($item->query['layout']) ? $item->query['layout'] : 'default'; if (isset($item->query['id'])) { $this->addLookup((int) $item->id, 'issue', $item->query['id'], $layout); } elseif ($layout === 'edit' && isset($item->query['project_id'])) { $this->addLookup((int) $item->id, 'issue', $item->query['project_id'], 'new'); } break; case 'comment': if (isset($item->query['id'])) { $this->addLookup((int) $item->id, 'comment', $item->query['id'], 'edit'); } elseif (isset($item->query['issue_id'])) { $this->addLookup((int) $item->id, 'comment', $item->query['id'], 'new'); } break; } } } }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { $app = JFactory::getApplication(); $options = array(); $module_id = $app->input->getInt('id'); $menus = JMenu::getInstance('site'); $menu_id = null; $menuItems = array(); foreach ($menus->getMenu() as $item) { if ($item->type == 'component') { if (isset($item->query['option']) && $item->query['option'] == 'com_j2store') { if (isset($item->query['catid'])) { $options[$item->id] = $item->title; } } } } return JHTML::_('select.genericlist', $options, $this->name, array('class' => "input"), 'value', 'text', $this->value); }
function __construct() { $comp_config =& JComponentHelper::getParams('com_imagebrowser'); $config['root_folder'] = $comp_config->get('root_folder', 'images/stories/imagebrowser'); $config['order_by'] = $comp_config->get('order_by', 'date_modified'); $config['order_direction'] = $comp_config->get('order_direction', 'DESC'); $config['show_comp_description'] = $comp_config->get('show_comp_description', 1); $config['comp_description'] = $comp_config->get('comp_description', ''); $config['language'] = $comp_config->get('language', ''); $config['max_width'] = $comp_config->get('max_width', 800); $config['max_height'] = $comp_config->get('max_height', 600); $config['thumb_width'] = $comp_config->get('thumb_width', 120); $config['thumb_height'] = $comp_config->get('thumb_height', 90); $config['imgcomp'] = $comp_config->get('imgcomp', 0); $config['max_upload_size'] = $comp_config->get('max_upload_size', 2); // The mode is read from menu item (for frontend only) $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); if (is_object($item)) { $params =& $menu->getParams($item->id); $config['mode'] = $params->get('mode', false); $config['page_title'] = $params->get('page_title', ''); $config['show_page_title'] = $params->get('show_page_title', 0); $config['pageclass_sfx'] = $params->get('pageclass_sfx', ''); // Override global component settings with menu item settings $config['root_folder'] = $params->get('root_folder', $config['root_folder']); $config['order_by'] = $params->get('order_by', $config['order_by']); $config['order_direction'] = $params->get('order_direction', $config['order_direction']); $config['show_comp_description'] = $params->get('show_comp_description', $config['show_comp_description']); $config['comp_description'] = $params->get('comp_description', $config['comp_description']); $config['language'] = $params->get('language', $config['language']); $config['max_width'] = $params->get('max_width', $config['max_width']); $config['max_height'] = $params->get('max_height', $config['max_height']); $config['thumb_width'] = $params->get('thumb_width', $config['thumb_width']); $config['thumb_height'] = $params->get('thumb_height', $config['thumb_height']); $config['imgcomp'] = $params->get('imgcomp', $config['imgcomp']); $config['max_upload_size'] = $params->get('max_upload_size', $config['max_upload_size']); } $this->config = $config; }
function __construct() { $this->projectid = JRequest::getInt("p", 0); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $registry = new JRegistry(); $registry->loadArray($params); //$newparams = $registry->toString('ini'); $newparams = $registry->toArray(); //echo "<b>menue newparams</b><pre>" . print_r($newparams, true) . "</pre>"; foreach ($newparams['data'] as $key => $value) { $this->_params[$key] = $value; } // $this->round = JRequest::getInt( "r", $this->current_round); // $this->part = JRequest::getInt( "part", 0); // $this->from = JRequest::getInt( 'from', $this->round ); // $this->to = JRequest::getInt( 'to', $this->round); // $this->type = JRequest::getInt( 'type', 0 ); // $this->last = JRequest::getInt( 'last', 0 ); // $this->selDivision = JRequest::getInt( 'division', 0 ); parent::__construct(); }
protected static function _getItemid($view = 'galleries', $id = 0, $default = 0) { $item = null; $menu = JMenu::getInstance('site'); if ($id && ($items = $menu->getItems('link', 'index.php?option=com_fwgallery&view=' . $view))) { foreach ($items as $menuItem) { if (is_string($menuItem->params) && preg_match('/id\\=' . $id . '\\s/ms', $menuItem->params) || is_object($menuItem->params) && $id == $menuItem->params->get('id')) { $item = $menuItem; break; } } } if ($item === null) { $item = $menu->getItems('link', 'index.php?option=com_fwgallery&view=galleries', true); } if ($item) { return $item->id; } elseif ($default) { return $default; } elseif ($item = $menu->getActive()) { return $item->id; } }
function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $hotel_keywords = JRequest::getVar('hotel_keywords', ''); $destination = JRequest::getVar('destination', '-1'); $stars = JRequest::getVar('stars', '-1'); $prices = JRequest::getVar('prices', '0_9999'); //$cityid = $params->get('cityid', '32'); $hotels = $model->getHotels($hotel_keywords, $destination, $stars, $prices); $pagination = $model->getPagination(); $cities = $model->getCities(); $mainframe->setPageTitle(JTEXT::_("SEARCH")); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID); $hotels[$i]->hotel_Name = str_ireplace($hotel_keywords, '<span id="hightlight" >' . $hotel_keywords . '</span>', $hotels[$i]->hotel_Name); } //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('cities', $cities); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }
/** * Build the SEF route * * @param JRouterSite &$router Router object * @param JUri &$uri URI object to process * * @return void * * @since 4.0 */ public function buildSefRoute(&$router, &$uri) { // Get the route $route = $uri->getPath(); // Get the query data $query = $uri->getQuery(true); if (!isset($query['option'])) { return; } // Build the component route $component = preg_replace('/[^A-Z0-9_\\.-]/i', '', $query['option']); $tmp = ''; $Itemid = isset($query['Itemid']) ? $query['Itemid'] : null; $crouter = $this->getComponentRouter($component); $parts = $crouter->build($query); $tmp = trim(implode('/', $parts)); if (empty($query['Itemid']) && !empty($Itemid)) { $query['Itemid'] = $Itemid; } // Build the application route if (isset($query['Itemid']) && ($item = $this->menu->getItem($query['Itemid']))) { if (is_object($item) && $query['option'] == $item->component) { if (!$item->home) { $tmp = !empty($tmp) ? $item->route . '/' . $tmp : $item->route; } unset($query['Itemid']); } } else { $tmp = 'component/' . substr($query['option'], 4) . '/' . $tmp; } $route .= '/' . $tmp; // Unset unneeded query information unset($query['option']); // Set query again in the URI $uri->setQuery($query); $uri->setPath(trim($route, '/')); }
/** * Gets menu items by attribute * * @param string $attributes The field name * @param string $values The value of the field * @param boolean $firstonly If true, only returns the first item found * * @return array */ public function getItems($attributes, $values, $firstonly = false) { $attributes = (array) $attributes; $values = (array) $values; $app = JApplication::getInstance('site'); if ($app->isSite()) { // Filter by language if not set if (($key = array_search('language', $attributes)) === false) { if ($app->getLanguageFilter()) { $attributes[] = 'language'; $values[] = array(JFactory::getLanguage()->getTag(), '*'); } } elseif ($values[$key] === null) { unset($attributes[$key]); unset($values[$key]); } // Filter by access level if not set if (($key = array_search('access', $attributes)) === false) { $attributes[] = 'access'; $values[] = JFactory::getUser()->getAuthorisedViewLevels(); } elseif ($values[$key] === null) { unset($attributes[$key]); unset($values[$key]); } } return parent::getItems($attributes, $values, $firstonly); }
/** * Returns the application JMenu object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu * * @since 3.2 */ public function getMenu($name = null, $options = array()) { if (!isset($name)) { $name = $this->getName(); } try { $menu = JMenu::getInstance($name, $options); } catch (Exception $e) { return null; } return $menu; }
/** * Gets menu items by attribute * * @param string $attributes The field name * @param string $values The value of the field * @param boolean $firstonly If true, only returns the first item found * * @return array */ public function getItems($attributes, $values, $firstonly = false) { $attributes = (array) $attributes; $values = (array) $values; $app = JFactory::getApplication(); // Filter by language if not set if ($app->isSite() && $app->getLanguageFilter() && !array_key_exists('language',$attributes)) { $attributes[]='language'; $values[]=array(JFactory::getLanguage()->getTag(), '*'); } return parent::getItems($attributes, $values, $firstonly); }
/** * * Get params of menu item * * @param Number $id */ public static function getMenuParams($id) { $menuSite = JMenu::getInstance('site'); $Item = $menuSite->getItem($id); if (isset($Item->params)) { if ($Item->params instanceof JRegistry) { return $Item->params; } } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select("params"); $query->from("#__menu"); $query->where("id = " . $db->quote($id)); $db->setQuery($query); $paramsString = $db->loadResult(); $jParams = new JRegistry(); $jParams->loadObject(json_decode($paramsString)); return $jParams; }
<?php /** * Articles Newsflash Advanced * * @author TemplateMonster http://www.templatemonster.com * @copyright Copyright (C) 2012 - 2013 Jetimpex, Inc. * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 * Parts of this software are based on Articles Newsflash standard module * */ defined('_JEXEC') or die; // Include the syndicate functions only once require_once __DIR__ . '/helper.php'; $menu = JMenu::getInstance('site'); $app = JFactory::getApplication(); $document =& JFactory::getDocument(); $list = modArticlesNewsHelper::getList($params); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $columns = (int) $params->get('columns'); $bootstrap_layout = $params->get('bootstrap_layout'); switch ($bootstrap_layout) { case 0: $row_class = 'row'; break; case 1: $row_class = 'row-fluid'; break; default: $row_class = 'row'; break;
public function createMenu($menu, $submenu) { jimport('joomla.utilities.string'); jimport('joomla.application.component.helper'); $component_id = JComponentHelper::getComponent('com_judirectory')->id; $db = JFactory::getDbo(); $query = "UPDATE #__menu SET component_id=" . $db->quote($component_id) . " WHERE type = 'component' AND link LIKE '%option=com_judirectory%'"; $db->setQuery($query); $db->execute(); if ($db->getErrorNum()) { throw new Exception($db->getErrorMsg(), $db->getErrorNum()); } $table = JTable::getInstance('MenuType'); $data = array('menutype' => 'judirectorymenu', 'title' => 'JU Directory', 'description' => ''); if (!$table->bind($data) || !$table->check()) { return true; } if (!$table->store()) { throw new Exception($table->getError()); } $table = JTable::getInstance('menu'); $table->load(array('menutype' => 'judirectorymenu', 'link' => $menu['link'])); $paramdata = array('menu-anchor_title' => '', 'menu-anchor_css' => '', 'menu_image' => '', 'menu_text' => 1, 'page_title' => '', 'show_page_heading' => 0, 'page_heading' => '', 'pageclass_sfx' => '', 'menu-meta_description' => '', 'menu-meta_keywords' => '', 'robots' => '', 'secure' => 0); $gparams = new JRegistry($paramdata); $params = clone $gparams; $params->loadArray($menu['params']); $data = array('menutype' => 'judirectorymenu', 'title' => $menu['name'], 'alias' => $menu['alias'], 'link' => $menu['link'], 'type' => 'component', 'published' => 1, 'parent_id' => 1, 'component_id' => $component_id, 'access' => $menu['access'], 'params' => (string) $params, 'home' => 0, 'language' => '*', 'client_id' => 0); $table->setLocation(1, 'last-child'); if (!$table->bind($data) || !$table->check() || !$table->store()) { $table->alias = 'joomultra-directory'; if (!$table->check() || !$table->store()) { throw new Exception($table->getError()); } } $parent = $table; foreach ($submenu as $menuitem) { $params = clone $gparams; $params->loadArray($menuitem['params']); $table = JTable::getInstance('menu'); $table->load(array('menutype' => 'judirectorymenu', 'link' => $menuitem['link'])); $data = array('menutype' => 'judirectorymenu', 'title' => $menuitem['name'], 'alias' => $menuitem['alias'], 'link' => $menuitem['link'], 'type' => 'component', 'published' => 1, 'parent_id' => $parent->id, 'component_id' => $component_id, 'access' => $menuitem['access'], 'params' => (string) $params, 'home' => 0, 'language' => '*', 'client_id' => 0); $table->setLocation($parent->id, 'last-child'); if (!$table->bind($data) || !$table->check() || !$table->store()) { throw new Exception($table->getError()); } } $defaultmenu = JMenu::getInstance('site')->getDefault(); if (!$defaultmenu) { return true; } $table = JTable::getInstance('menu'); $table->load(array('menutype' => $defaultmenu->menutype, 'type' => 'alias', 'title' => 'JU Directory')); if (!$table->id) { $data = array('menutype' => $defaultmenu->menutype, 'title' => 'JU Directory', 'alias' => 'judirectory-' . JFactory::getDate()->format('Y-m-d'), 'link' => 'index.php?Itemid=' . $parent->id, 'type' => 'alias', 'published' => 0, 'parent_id' => 1, 'component_id' => 0, 'access' => 1, 'params' => '{"aliasoptions":"' . (int) $parent->id . '","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 'home' => 0, 'language' => '*', 'client_id' => 0); $table->setLocation(1, 'last-child'); } else { $data = array('alias' => 'judirectory-' . JFactory::getDate()->format('Y-m-d'), 'link' => 'index.php?Itemid=' . $parent->id, 'params' => '{"aliasoptions":"' . (int) $parent->id . '","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}'); } if (!$table->bind($data) || !$table->check() || !$table->store()) { throw new Exception($table->getError()); } return true; }
/** * Saves data to the core menu table * * @param string $title * @param string $description * @param string $keywords */ private function saveDataToTableMenu($title, $description, $keywords) { $menu = JMenu::getInstance('site')->getActive(); // Check whether menu entry for the specific item exists - e.g. do not overwrite data of blog entry foreach ($menu->query as $key => $value) { if ($value != $this->request->get($key, 'cmd')) { return; } } $menu_params_array = JMenu::getInstance('site')->getParams($menu->id)->toArray(); $save_data_table_menu = $this->params->get('save_data_table_menu'); $title_array = array(1, 4, 5, 7); $description_array = array(2, 4, 6, 7); $keywords_array = array(3, 5, 6, 7); if (in_array($save_data_table_menu, $title_array)) { $menu_params_array['page_title'] = $title; } if (in_array($save_data_table_menu, $description_array)) { $menu_params_array['menu-meta_description'] = $description; } if (in_array($save_data_table_menu, $keywords_array)) { $menu_params_array['menu-meta_keywords'] = $keywords; } $menu_params = json_encode($menu_params_array); $query = "UPDATE " . $this->db->quoteName('#__menu') . " SET " . $this->db->quoteName('params') . " = " . $this->db->quote($menu_params) . " WHERE " . $this->db->quoteName('id') . " = " . $this->db->quote((int) $this->request->get('Itemid')); $this->db->setQuery($query); $this->db->execute(); }
/** * Get menu items from the platform. * * @param array $params * @return array List of routes to the pages. */ protected function getItemsFromPlatform($params) { // Items are already filtered by ViewLevels and user language. return $this->menu->getItems('menutype', $params['menu'] ?: $this->default->menutype); }
/** * Returns the application JMenu object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu|null * * @since 3.2 */ public function getMenu($name = null, $options = array()) { if (!isset($name)) { $name = $this->getName(); } // Inject this application object into the JMenu tree if one isn't already specified if (!isset($options['app'])) { $options['app'] = $this; } try { $menu = JMenu::getInstance($name, $options); } catch (Exception $e) { return null; } return $menu; }
function createMenuJ25($menu, $submenu) { jimport('joomla.utilities.string'); jimport('joomla.application.component.helper'); $config = KunenaFactory::getConfig(); $component_id = JComponentHelper::getComponent('com_kunena')->id; // First fix all broken menu items $query = "UPDATE #__menu SET component_id={$this->db->quote($component_id)} WHERE type = 'component' AND link LIKE '%option=com_kunena%'"; $this->db->setQuery($query); $this->db->query(); if ($this->db->getErrorNum()) { throw new KunenaInstallerException($this->db->getErrorMsg(), $this->db->getErrorNum()); } $table = JTable::getInstance('menutype'); $data = array('menutype' => 'kunenamenu', 'title' => JText::_('COM_KUNENA_MENU_TITLE'), 'description' => JText::_('COM_KUNENA_MENU_TITLE_DESC')); if (!$table->bind($data) || !$table->check()) { // Menu already exists, do nothing return true; } if (!$table->store()) { throw new KunenaInstallerException($table->getError()); } $table = JTable::getInstance('menu'); $table->load(array('menutype' => 'kunenamenu', 'link' => $menu['link'])); $paramdata = array('menu-anchor_title' => '', 'menu-anchor_css' => '', 'menu_image' => '', 'menu_text' => 1, 'page_title' => '', 'show_page_heading' => 0, 'page_heading' => '', 'pageclass_sfx' => '', 'menu-meta_description' => '', 'menu-meta_keywords' => '', 'robots' => '', 'secure' => 0); $gparams = new JRegistry($paramdata); $params = clone $gparams; $params->loadArray($menu['params']); $data = array('menutype' => 'kunenamenu', 'title' => $menu['name'], 'alias' => $menu['alias'], 'link' => $menu['link'], 'type' => 'component', 'published' => 1, 'parent_id' => 1, 'component_id' => $component_id, 'access' => $menu['access'] + 1, 'params' => (string) $params, 'home' => 0, 'language' => '*', 'client_id' => 0); if (!$table->setLocation(1, 'last-child') || !$table->bind($data) || !$table->check() || !$table->store()) { $table->alias = 'kunena'; if (!$table->check() || !$table->store()) { throw new KunenaInstallerException($table->getError()); } } $parent = $table; $defaultmenu = 0; foreach ($submenu as $menuitem) { $params = clone $gparams; $params->loadArray($menuitem['params']); $table = JTable::getInstance('menu'); $table->load(array('menutype' => 'kunenamenu', 'link' => $menuitem['link'])); $data = array('menutype' => 'kunenamenu', 'title' => $menuitem['name'], 'alias' => $menuitem['alias'], 'link' => $menuitem['link'], 'type' => 'component', 'published' => 1, 'parent_id' => $parent->id, 'component_id' => $component_id, 'access' => $menuitem['access'] + 1, 'params' => (string) $params, 'home' => 0, 'language' => '*', 'client_id' => 0); if (!$table->setLocation($parent->id, 'last-child') || !$table->bind($data) || !$table->check() || !$table->store()) { throw new KunenaInstallerException($table->getError()); } if (!$defaultmenu || isset($menuitem['default']) && $config->defaultpage == $menuitem['default']) { $defaultmenu = $table->id; } } // Update forum menuitem to point into default page $parent->link .= "&defaultmenu={$defaultmenu}"; if (!$parent->check() || !$parent->store()) { throw new KunenaInstallerException($table->getError()); } // Finally create alias $defaultmenu = JMenu::getInstance('site')->getDefault(); if (!$defaultmenu) { return true; } $table = JTable::getInstance('menu'); $table->load(array('menutype' => $defaultmenu->menutype, 'type' => 'alias', 'title' => JText::_('COM_KUNENA_MENU_ITEM_FORUM'))); if (!$table->id) { $data = array('menutype' => $defaultmenu->menutype, 'title' => JText::_('COM_KUNENA_MENU_ITEM_FORUM'), 'alias' => 'kunena-' . JFactory::getDate()->format('Y-m-d'), 'link' => 'index.php?Itemid=' . $parent->id, 'type' => 'alias', 'published' => 0, 'parent_id' => 1, 'component_id' => 0, 'access' => 1, 'params' => '{"aliasoptions":"' . (int) $parent->id . '","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 'home' => 0, 'language' => '*', 'client_id' => 0); if (!$table->setLocation(1, 'last-child')) { throw new KunenaInstallerException($table->getError()); } } else { $data = array('alias' => 'kunena-' . JFactory::getDate()->format('Y-m-d'), 'link' => 'index.php?Itemid=' . $parent->id, 'params' => '{"aliasoptions":"' . (int) $parent->id . '","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}'); } if (!$table->bind($data) || !$table->check() || !$table->store()) { throw new KunenaInstallerException($table->getError()); } }
/** * buildFromViewAndId * * @param string $component * @param string $view * @param array $queries * @param boolean $replace * @param \JMenu $menu */ public static function buildFromViewAndId($component, $view, &$queries, &$replace, \JMenu $menu) { // Get all com_flower menus $menuItems = $menu->getItems('component', $component); // Find matched menu item. foreach ($menuItems as $menuItem) { if (isset($menuItem->query['view']) && $menuItem->query['view'] == $view && isset($menuItem->query['id']) && $menuItem->query['id'] == $queries['id']) { // Replace core route rule. $replace = true; // Only return menu Itemid then Joomla will convert to menu alias $queries = array('Itemid' => $menuItem->id); } } // No menu matched, follows default rule. }
/** * Returns the application JPathway object. * * @param string $name The name of the application/client. * @param array $options An optional associative array of configuration settings. * * @return JMenu JMenu object. * * @since 11.1 */ public function getMenu($name = null, $options = array()) { if (!isset($name)) { $name = $this->_name; } jimport('joomla.application.menu'); $menu = JMenu::getInstance($name, $options); if ($menu instanceof Exception) { return null; } return $menu; }
/** * Control panel display * * @access public * @param string $tpl * @return void */ public function display($tpl = null) { $doc = $this->document; $componentParams = $this->getModel()->getState('cparams'); $base = JUri::root(); $this->loadJQuery($doc); $this->loadBootstrap($doc); $doc->addStylesheet(JURI::root(true) . '/administrator/components/com_jmap/css/cpanel.css'); $doc->addStylesheet(JURI::root(true) . '/administrator/components/com_jmap/css/jquery.fancybox.css'); $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/chart.js'); $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/cpanel.js'); $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/analyzer.js'); $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/metainfo.js'); if ($componentParams->get('seostats_enabled', 1)) { $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/seostats.js'); } if ($componentParams->get('enable_precaching', 0)) { $doc->addScript(JURI::root(true) . '/administrator/components/com_jmap/js/xmlprecaching.js'); } $doc->addCustomTag('<script type="text/javascript" src="' . JURI::root(true) . '/administrator/components/com_jmap/js/jquery.fancybox.pack.js' . '"></script>'); // Inject js translations $translations = array('COM_JMAP_ROBOTSPROGRESSTITLE', 'COM_JMAP_ROBOTSPROGRESSSUBTITLE', 'COM_JMAP_ROBOTSPROGRESSSUBTITLESUCCESS', 'COM_JMAP_ROBOTSPROGRESSSUBTITLEERROR', 'COM_JMAP_PRECACHING_TITLE', 'COM_JMAP_START_PRECACHING_PROCESS', 'COM_JMAP_PRECACHING_NO_DATASOURCES_FOUND', 'COM_JMAP_PRECACHING_PROCESS_RUNNING', 'COM_JMAP_PRECACHING_PROCESS_COMPLETED', 'COM_JMAP_PRECACHING_REPORT_DATASOURCE', 'COM_JMAP_PRECACHING_REPORT_DATASOURCE_TYPE', 'COM_JMAP_PRECACHING_REPORT_LINKS', 'COM_JMAP_PRECACHING_DATA_SOURCE_COMPLETED', 'COM_JMAP_PRECACHING_DATASOURCES_RETRIEVED', 'COM_JMAP_PRECACHING_PROCESS_FINALIZING', 'COM_JMAP_PRECACHING_INTERRUPT', 'COM_JMAP_PRECACHING_CACHED', 'COM_JMAP_PRECACHING_NOT_CACHED', 'COM_JMAP_PRECACHING_CLEARING', 'COM_JMAP_PRECACHING_CLEAR_CACHE', 'COM_JMAP_PUBLISHED_DATA_SOURCE_CHART', 'COM_JMAP_TOTAL_DATA_SOURCE_CHART', 'COM_JMAP_DATASETS_CHART', 'COM_JMAP_MENU_DATA_SOURCE_CHART', 'COM_JMAP_USER_DATA_SOURCE_CHART', 'COM_JMAP_ANALYZER_TITLE', 'COM_JMAP_ANALYZER_PROCESS_RUNNING', 'COM_JMAP_ANALYZER_STARTED_SITEMAP_GENERATION', 'COM_JMAP_ANALYZER_ERROR_STORING_FILE', 'COM_JMAP_ANALYZER_GENERATION_COMPLETE', 'COM_JMAP_METAINFO_TITLE', 'COM_JMAP_METAINFO_PROCESS_RUNNING', 'COM_JMAP_METAINFO_STARTED_SITEMAP_GENERATION', 'COM_JMAP_METAINFO_ERROR_STORING_FILE', 'COM_JMAP_METAINFO_GENERATION_COMPLETE', 'COM_JMAP_SEOSTATS_LOADING', 'COM_JMAP_ALEXA_GRAPH', 'COM_JMAP_NULL_RESPONSEDATA', 'COM_JMAP_ERROR_HTTP'); $this->injectJsTranslations($translations, $doc); // Check for custom link domain $customDomain = trim($componentParams->get('custom_sitemap_domain', '')); $livesite = $customDomain ? rtrim($customDomain, '/') : substr_replace(JURI::root(), "", -1, 1); $user = JFactory::getUser(); $lists = $this->get('Lists'); $infoData = $this->get('Data'); $doc->addScriptDeclaration('var jmapChartData = ' . json_encode($infoData)); $doc->addScriptDeclaration("var jmap_baseURI='{$base}';"); $doc->addScriptDeclaration("var jmap_linksRandom=" . $componentParams->get('sitemap_links_random', 0) . ";"); $doc->addScriptDeclaration("var jmap_forceFormat=" . $componentParams->get('sitemap_links_forceformat', 0) . ";"); // Assign SEF mode $this->siteRouter = JRouterSite::getInstance('site', array('mode' => JROUTER_MODE_SEF)); $this->showSefLinks = $componentParams->get('sitemap_links_sef', false); $this->joomlaSefLinks = JFactory::getConfig()->get('sef', true); $this->siteItemid = null; if ($this->showSefLinks && $this->joomlaSefLinks) { $siteItemid = trim($componentParams->get('site_itemid', null)); if ($siteItemid && is_numeric($siteItemid)) { $menuItem = JMenu::getInstance('site')->getItem((int) $siteItemid); if (isset($menuItem->alias)) { $menuAlias = $menuItem->alias; $doc->addScriptDeclaration("var jmap_sef_alias_links='{$menuAlias}';"); $this->siteItemid = '&Itemid=' . (int) $siteItemid; } } } // Buffer delle icons ob_start(); $this->getIcon('index.php?option=com_jmap&task=sources.display', 'icon-48-data.png', JText::_('COM_JMAP_SITEMAP_SOURCES'), '', 'title="' . JText::_('COM_JMAP_SITEMAP_SOURCES') . '"'); $this->getIcon('index.php?option=com_jmap&task=wizard.display', 'icon-48-wizard.png', JText::_('COM_JMAP_NEW_WIZARD_DATASOURCE'), '', 'title="' . JText::_('COM_JMAP_NEW_WIZARD_DATASOURCE') . '"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap', 'icon-48-html_sitemap.png', JText::_('COM_JMAP_SHOW_HTML_MAP'), 'target="_blank"', 'title="' . JText::_('COM_JMAP_SHOW_HTML_MAP') . '"', 'data-role="torefresh"'); $this->getIcon('#xmlsitemap', 'icon-48-xml_sitemap.png', JText::_('COM_JMAP_SHOW_XML_MAP'), '', 'title="' . JText::_('COM_JMAP_SHOW_XML_MAP') . '"', 'class="fancybox"'); $this->getIcon('#xmlsitemap_xslt', 'icon-48-xsl_sitemap.png', JText::_('COM_JMAP_SHOW_XML_MAP_XSLT'), '', 'title="' . JText::_('COM_JMAP_SHOW_XML_MAP_XSLT') . '"', 'class="fancybox"'); $this->getIcon('#xmlsitemap_export', 'icon-48-xml_export.png', JText::_('COM_JMAP_EXPORT_XML_SITEMAP'), '', 'title="' . JText::_('COM_JMAP_EXPORT_XML_SITEMAP') . '"', 'class="fancybox"'); $this->getIcon(substr_replace(JURI::root(), "", -1, 1) . '/index.php?option=com_jmap&task=sitemap.exportxml&format=xml', 'icon-48-analyze.png', JText::_('COM_JMAP_ANALYZE_MAP'), '', 'title="' . JText::_('COM_JMAP_ANALYZE_MAP') . '"', 'class="jmap_analyzer"'); $this->getIcon(substr_replace(JURI::root(), "", -1, 1) . '/index.php?option=com_jmap&task=sitemap.exportxml&format=xml', 'icon-48-metainfo.png', JText::_('COM_JMAP_METAINFO'), '', 'title="' . JText::_('COM_JMAP_METAINFO') . '"', 'class="jmap_metainfo"'); $this->getIcon('index.php?option=com_jmap&task=indexing.display', 'icon-48-indexing.png', JText::_('COM_JMAP_SITEMAP_INDEXING'), '', 'title="' . JText::_('COM_JMAP_SITEMAP_INDEXING') . '"'); $this->getIcon('index.php?option=com_jmap&task=datasets.display', 'icon-48-datasets.png', JText::_('COM_JMAP_SITEMAP_DATASETS'), '', 'title="' . JText::_('COM_JMAP_SITEMAP_DATASETS') . '"'); if ($user->authorise('core.edit', 'com_jmap')) { $this->getIcon('index.php?option=com_jmap&task=cpanel.editEntity', 'icon-48-robots.png', JText::_('COM_JMAP_ROBOTS_EDITOR'), '', 'title="' . JText::_('COM_JMAP_ROBOTS_EDITOR') . '"', 'class="fancybox_iframe"'); $this->getIcon('index.php?option=com_jmap&task=htaccess.editEntity', 'icon-48-htaccess.png', JText::_('COM_JMAP_HTACCESS_EDITOR'), '', 'title="' . JText::_('COM_JMAP_HTACCESS_EDITOR') . '"', 'class="fancybox_iframe"'); } $this->getIcon('index.php?option=com_jmap&task=pingomatic.display', 'icon-48-pingomatic.png', JText::_('COM_JMAP_PINGOMATIC_LINKS'), '', 'title="' . JText::_('COM_JMAP_PINGOMATIC_LINKS') . '"'); $this->getIcon('#rssfeed', 'icon-48-rss-feed.png', JText::_('COM_JMAP_SHOW_RSS_FEED'), '', 'title="' . JText::_('COM_JMAP_SHOW_RSS_FEED') . '"', 'class="fancybox rss"'); // Access check. if ($user->authorise('jmap.google', 'com_jmap')) { $this->getIcon('index.php?option=com_jmap&task=google.display', 'icon-48-google.png', JText::_('COM_JMAP_GOOGLE'), '', 'title="' . JText::_('COM_JMAP_GOOGLE_ANALYTICS') . '"'); } // Access check. if ($user->authorise('core.admin', 'com_jmap')) { $this->getIcon('index.php?option=com_jmap&task=config.display', 'icon-48-config.png', JText::_('COM_JMAP_CONFIG'), '', 'title="' . JText::_('COM_JMAP_CONFIG') . '"'); } $this->getIcon('http://storejextensions.org/jsitemap_professional_documentation.html', 'icon-48-help.png', JText::_('COM_JMAP_HELPTITLE'), '', 'title="' . JText::_('COM_JMAP_HELPTITLE') . '"'); echo '<div style="display:none" id="xmlsitemap">'; $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=xml', 'icon-48-xml_sitemap_standard.png', JText::_('COM_JMAP_SHOW_XML_STANDARD_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=images', 'icon-48-xml_sitemap_images.png', JText::_('COM_JMAP_SHOW_XML_IMAGES_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=gnews', 'icon-48-xml_sitemap_gnews.png', JText::_('COM_JMAP_SHOW_XML_GNEWS_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=mobile', 'icon-48-xml_sitemap_mobile.png', JText::_('COM_JMAP_SHOW_XML_MOBILE_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=videos', 'icon-48-xml_sitemap_videos.png', JText::_('COM_JMAP_SHOW_XML_VIDEOS_MAP'), 'target="_blank"'); echo '</div>'; echo '<div style="display:none" id="xmlsitemap_xslt">'; $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=xml&xslt=1', 'icon-48-xml_sitemap_standard.png', JText::_('COM_JMAP_SHOW_XML_STANDARD_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=images&xslt=1', 'icon-48-xml_sitemap_images.png', JText::_('COM_JMAP_SHOW_XML_IMAGES_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=gnews&xslt=1', 'icon-48-xml_sitemap_gnews.png', JText::_('COM_JMAP_SHOW_XML_GNEWS_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=mobile&xslt=1', 'icon-48-xml_sitemap_mobile.png', JText::_('COM_JMAP_SHOW_XML_MOBILE_MAP'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=videos&xslt=1', 'icon-48-xml_sitemap_videos.png', JText::_('COM_JMAP_SHOW_XML_VIDEOS_MAP'), 'target="_blank"'); echo '</div>'; echo '<div style="display:none" id="xmlsitemap_export">'; $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=xml', 'icon-48-xml_sitemap_standard.png', JText::_('COM_JMAP_EXPORT_XML_STANDARD_MAP')); $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=images', 'icon-48-xml_sitemap_images.png', JText::_('COM_JMAP_EXPORT_XML_IMAGES_MAP')); $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=gnews', 'icon-48-xml_sitemap_gnews.png', JText::_('COM_JMAP_EXPORT_XML_GNEWS_MAP')); $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=mobile', 'icon-48-xml_sitemap_mobile.png', JText::_('COM_JMAP_EXPORT_XML_MOBILE_MAP')); $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=videos', 'icon-48-xml_sitemap_videos.png', JText::_('COM_JMAP_EXPORT_XML_VIDEOS_MAP')); echo '</div>'; echo '<div style="display:none" id="rssfeed">'; $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=rss', 'icon-48-xml_sitemap.png', JText::_('COM_JMAP_SHOW_RSS_FEED'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&view=sitemap&format=rss&xslt=1', 'icon-48-xsl_sitemap.png', JText::_('COM_JMAP_SHOW_RSS_FEED_FORMATTED'), 'target="_blank"'); $this->getIcon($livesite . '/index.php?option=com_jmap&task=sitemap.exportxml&format=rss', 'icon-48-xml_export.png', JText::_('COM_JMAP_EXPORT_RSS_FEED')); echo '<label class="label label-primary">' . JText::_('COM_JMAP_RSS_FEED_LINK') . '</label>'; if (!$this->showSefLinks || !$this->joomlaSefLinks) { ?> <input data-role="sitemap_links" class="sitemap_links" type="text" value="<?php echo JFilterOutput::ampReplace($livesite . '/index.php?option=com_jmap&view=sitemap&format=rss'); ?> " /> <?php } else { ?> <input data-role="sitemap_links_sef" class="sitemap_links" type="text" data-valuenosef="<?php echo JFilterOutput::ampReplace($livesite . '/index.php?option=com_jmap&view=sitemap&format=rss'); ?> " value="<?php echo $livesite . preg_replace('/(\\/[A-Za-z0-9_-~]*)*\\/administrator\\//i', '/', $this->siteRouter->build('index.php?option=com_jmap&view=sitemap&format=rss' . $this->siteItemid)); ?> "/> <?php } echo '</div>'; $contents = ob_get_clean(); // Assign reference variables $this->icons = $contents; $this->livesite = $livesite; $this->componentParams = $componentParams; $this->infodata = $infoData; $this->lists = $lists; $this->updatesData = $this->getModel()->getUpdates($this->get('httpclient')); $this->currentVersion = strval(simplexml_load_file(JPATH_COMPONENT_ADMINISTRATOR . '/jmap.xml')->version); // Aggiunta toolbar $this->addDisplayToolbar(); // Output del template parent::display(); }