Esempio n. 1
0
 /**
  * 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;
 }