예제 #1
0
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     $item->body = FinderIndexerHelper::prepareContent($item->getElement('body'));
     $item->summary = FinderIndexerHelper::prepareContent($item->getElement('body'));
     $item->addTaxonomy('Type', 'FSF_FINDER_GLOSSARY');
     $word = $item->title;
     $anchor = strtolower(preg_replace("/[^A-Za-z0-9]/", '-', $word));
     $letter = strtolower(substr($word, 0, 1));
     $item->url = 'index.php?option=com_fsf&view=glossary&letter=' . $letter . '#' . $anchor;
     $item->route = $item->url;
     $item->state = $item->published;
     $item->access = 1;
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (FSFJ3Helper::IsJ3()) {
         $this->indexer->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
예제 #2
0
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     $item->body = FinderIndexerHelper::prepareContent($item->getElement('body'));
     $item->summary = FinderIndexerHelper::prepareContent($item->getElement('body'));
     $item->addTaxonomy('Type', 'FSS_FINDER_KB_ARTICLE');
     $item->url = 'index.php?option=com_fss&view=kb&kbartid=' . $item->getElement('id');
     $item->route = $item->url;
     $item->state = $item->getElement('pub');
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (FSSJ3Helper::IsJ3()) {
         $this->indexer->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
 /**
  * Tests the getElement and setElement methods
  *
  * @return  void
  *
  * @since   3.1
  */
 public function testGetAndSetElement()
 {
     $this->object->setElement('testItem', 'success');
     $this->assertEquals($this->object->getElement('testItem'), 'success');
 }