function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $routerHelper = JPATH_ROOT . '/components/com_ars/router.php'; if (is_file($routerHelper)) { require_once $routerHelper; $db = JFactory::getDBO(); $query = 'SELECT id, title, alias, access, created_by' . ' FROM #__ars_categories' . ' WHERE id = ' . $id; $db->setQuery($query); $row = $db->loadObject(); if (!empty($row)) { $options = array('option' => 'com_ars', 'view' => 'browses', 'language' => $language); $menu = ArsRouterHelper::findMenu($options); $Itemid = $menu->id; $Itemid = $Itemid > 0 ? '&Itemid=' . $Itemid : ''; $info->title = $row->title; $info->access = $row->access; $info->userid = $row->created_by; $info->link = JRoute::_('index.php?option=com_ars&view=category&id=' . $id . $Itemid); } } return $info; }
function arsParseRoute(&$segments) { $input = JFactory::getApplication()->input; $format = $input->getCmd('format', null); if (is_null($format)) { $url = JURI::getInstance()->toString(); $ext = substr(strtolower($url), -4); $format = ltrim($ext, '.'); } $segments = ArsRouterHelper::preconditionSegments($segments); switch ($format) { case 'html': return arsParseRouteHtml($segments); break; case 'raw': default: return arsParseRouteRaw($segments); break; case 'xml': return arsParseRouteXml($segments); break; case 'ini': return arsParseRouteIni($segments); break; } }