/
home
/
assocoweys
/
avexp
/
components
/
com_latestnewsenhancedpro
/
Upload File
HOME
<?php /** * @copyright Copyright (C) 2011 Simplify Your Web, Inc. All rights reserved. * @license GNU General Public License version 3 or later; see LICENSE.txt */ // No direct access defined('_JEXEC') or die; \JLoader::register('LatestNewsEnhancedProHelpersLatestNewsEnhancedPro', JPATH_BASE . '/components/com_latestnewsenhancedpro/helpers/latestnewsenhancedpro.php'); /** * Build the route for the com_latestnewsenhancedpro component * * @param array &$query An array of URL arguments * @return array The URL arguments to use to assemble the subsequent URL. */ function LatestNewsEnhancedProBuildRoute(&$query) { $segments = array(); if (isset($query['task'])) { $taskParts = explode('.', $query['task']); $segments[] = implode('/', $taskParts); unset($query['task']); } if (isset($query['view'])) { $segments[] = $query['view']; unset($query['view']); } if (isset($query['catid'])) { $segments[] = $query['catid']; unset($query['catid']); } if (isset($query['id'])) { $segments[] = $query['id']; unset($query['id']); } return $segments; } /** * Parse the segments of a URL. * * @param array &$segments The segments of the URL to parse. * @return array The URL attributes to be used by the application. */ function LatestNewsEnhancedProParseRoute($segments) { $vars = array(); // View is always the first element of the array $vars['view'] = array_shift($segments); $model = LatestNewsEnhancedProHelpersLatestNewsEnhancedPro::getModel($vars['view']); // $count = count($segments); // $cat_id = (int) $segments[0]; // $article_id = (int) $segments[$count - 1]; // if ($article_id > 0) // { // $vars['view'] = 'article'; // $vars['catid'] = $cat_id; // $vars['id'] = $article_id; // } // else // { // $vars['view'] = 'category'; // $vars['id'] = $cat_id; // } // while (!empty($segments)) // { // $segment = array_pop($segments); // // If it's the ID, let's put on the request // if (is_numeric($segment)) // { // $vars['id'] = $segment; // } // else // { // $vars['task'] = $vars['view'] . '.' . $segment; // } // } return $vars; }