Beispiel #1
0
 function getMenuParams($id)
 {
     static $params = array();
     if (!isset($params[$id])) {
         $params[$id] = AcesefUtility::getMenu()->getParams($id);
     }
     return $params[$id];
 }
Beispiel #2
0
 function _parseRawRoute($uri)
 {
     // Set the URI from Itemid if no option
     if (is_null($uri->getVar('option'))) {
         $menu =& AcesefUtility::getMenu();
         $item = $menu->getItem(intval($uri->getVar('Itemid')));
         if (!is_null($item)) {
             $uri->setQuery($item->query);
             $uri->setVar('Itemid', $item->id);
         }
     }
     if ($this->AcesefConfig->redirect_to_sef == 1 && count($_POST) == 0) {
         // Find the non-SEF URL in the database
         $old_generate_sef = $this->AcesefConfig->generate_sef;
         if ($this->AcesefConfig->redirect_to_sef_gen == 0) {
             $this->AcesefConfig->generate_sef = 0;
         }
         $uri->setPath('index.php');
         $url = $uri->toString(array('path', 'query', 'fragment'));
         $sef = JRoute::_($url);
         // Restore configuration
         $this->AcesefConfig->generate_sef = $old_generate_sef;
         if (strpos($sef, 'index.php?') === false) {
             // Seems the URL is SEF, let's redirect
             $f = $l = '';
             if (!headers_sent($f, $l)) {
                 $mainframe = JFactory::getApplication();
                 $mainframe->redirect($sef);
                 exit;
             } else {
                 self::headers_sent_error($f, $l, __FILE__, __LINE__);
             }
         }
     }
     return $uri->getQuery(true);
 }