/** * Get clean URI. * * @return string */ protected function getUri() { $filter = JFilterInput::getInstance(); $uri = Itpmeta\Url\UrlHelper::getUri(); $uriString = $uri->toString(array('path', 'query')); $uriString = $filter->clean($uriString); // Load tags for current address $itpUri = Itpmeta\Url\Uri::getInstance(JFactory::getDbo(), array('uri' => $uriString)); $itpUri->setNotOverridden($this->notOverridden); return $itpUri; }
/** * This method saves the content and * it is used from "inline" editing by AJAX. * * @param integer $itemId * @param string $content * * @return object */ public function saveAjax($itemId, $content) { $tag = new Itpmeta\Tag\Tag(JFactory::getDbo()); $tag->load(array('id' => $itemId)); if (!$tag->getId()) { return null; } $tag->setContent($content); $tag->store(); // Prepare result that will be returned $result = new stdClass(); $result->id = $tag->getId(); $result->content = $tag->getContent(); $result->output = $tag->getOutput(); // Get URL. $uri = new Itpmeta\Url\Uri(JFactory::getDbo()); $uri->load(array('uri_id' => $tag->getUrlId())); $result->autoupdate = $uri->isAutoupdate(); return $result; }