Exemplo n.º 1
0
 function mark()
 {
     $markid = $this->input->getInt('markid');
     $line = "option=com_jotcache&view=main";
     $this->model->resetMark();
     $uri = Juri::getInstance();
     $domain = $uri->toString(array('host'));
     $parts = explode('.', $domain);
     $last = count($parts) - 1;
     if ($last >= 1 && is_numeric($parts[$last]) === false) {
         $domain = $parts[$last - 1] . '.' . $parts[$last];
     }
     switch ($markid) {
         case 0:
             setcookie('jotcachemark', '0', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line . "&filter_mark=", JText::_('JOTCACHE_RS_MSG_RESET'));
             break;
         case 1:
             setcookie('jotcachemark', '1', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_SET'));
             break;
         case 2:
             setcookie('jotcachemark', '2', '0', '/', $domain);
             $this->setRedirect('index.php?' . $line, JText::_('JOTCACHE_RS_MSG_RENEW'));
             break;
         default:
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * Clear the history until the uri.
  * Two uris are equal if their view and id vars are the same.
  *
  * @param   mixed  $uri  The uri until
  *
  * @return  void
  */
 public function clearHistoryUntil($uri = null)
 {
     $history = $this->history->getQueue();
     if (empty($history)) {
         return;
     }
     if (null === $uri) {
         $uri = str_replace(Juri::base(), '', Juri::getInstance()->toString());
     }
     $uri = new JURI($uri);
     $view = $uri->getVar('view');
     $id = $uri->getVar('id');
     $newHistory = array();
     foreach ($history as $oldLink) {
         $oldUri = new Juri($oldLink);
         $oldView = $oldUri->getVar('view');
         $oldId = $oldUri->getVar('id');
         if ($oldView === $view && $oldId === $id) {
             break;
         }
         $newHistory[] = $oldLink;
     }
     $this->history->setQueue($newHistory);
 }
Exemplo n.º 3
0
 /**
  * @return string
  */
 public function repositoryIdentifier()
 {
     $config = JComponentHelper::getParams('com_fabrik');
     return $config->get('oai_repository_identifier', Juri::getInstance()->toString(array('host')));
 }