当前位置: 首页>>代码示例>>PHP>>正文


PHP FinderIndexerResult::addTaxonomy方法代码示例

本文整理汇总了PHP中FinderIndexerResult::addTaxonomy方法的典型用法代码示例。如果您正苦于以下问题:PHP FinderIndexerResult::addTaxonomy方法的具体用法?PHP FinderIndexerResult::addTaxonomy怎么用?PHP FinderIndexerResult::addTaxonomy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FinderIndexerResult的用法示例。


在下文中一共展示了FinderIndexerResult::addTaxonomy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Override method to index a certain result
  *
  * @param   FinderIndexerResult  $item    Finder item
  * @param   string               $format  Formatting (html or text)
  *
  * @return  null
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     /*
     if (JComponentHelper::isEnabled($this->extension) == false)
     {
         return;
     }
     */
     // Prepare the item
     $item->access = 1;
     // Define these items as songs
     $item->addTaxonomy('Type', 'Song');
     // Add artist information
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'artist');
     $item->addTaxonomy('Artist', $item->artist);
     // Set language
     //$item->setLanguage();
     //$item->addTaxonomy('Language', $item->language);
     // Set URLs
     $item->route = 'index.php?option=com_music&view=song&id=' . $item->id;
     $item->url = $item->route;
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     // Allow others to hook into our $item as well
     FinderIndexerHelper::getContentExtras($item);
     $this->indexer->index($item);
 }
开发者ID:pjasmits,项目名称:JoomlaPluginsBook,代码行数:34,代码来源:song.php

示例2: _index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param	object		The item to index as an FinderIndexerResult object.
  * @throws	Exception on database error.
  */
 protected function _index(FinderIndexerResult $item)
 {
     // Build the necessary route and path information.
     $item->url = $this->_getURL($item->topic);
     $item->itemid = '100065';
     $item->route = $item->url . '&post=' . $item->id . '&Itemid=' . $item->itemid . '#p' . $item->id;
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     // Add the meta-data processing instructions.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'display_name');
     // Strip slashes!
     $item->title = stripslashes($item->title);
     $item->summary = stripslashes($item->summary);
     $item->display_name = stripslashes($item->display_name);
     $item->text = FinderIndexerHelper::prepareContent($item->summary);
     // Translate the access group to an access level.
     //$item->cat_access = $this->_getAccessLevel($item->cat_access);
     // Inherit state and access form the category.
     $item->state = 1;
     $item->access = 0;
     // Set the language.
     $item->language = FinderIndexerHelper::getDefaultLanguage();
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Forum Post');
     // Add the author taxonomy data.
     if (!empty($item->author)) {
         $item->addTaxonomy('Forum User', $item->display_name);
     }
     // Index the item.
     FinderIndexer::index($item);
 }
开发者ID:ravenlife,项目名称:Ninjaboard,代码行数:36,代码来源:ninjaboard_posts.php

示例3: index

 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);
     }
 }
开发者ID:sansandeep143,项目名称:av,代码行数:25,代码来源:fsf_glossary.php

示例4: testTaxonomy

 /**
  * Tests the addTaxonomy and getTaxonomy methods
  *
  * @return  void
  *
  * @since   3.1
  */
 public function testTaxonomy()
 {
     // Add the test item to the taxonomy
     $this->object->addTaxonomy('testing', 'Test Item');
     // Retrieve our testing branch
     $taxonomy = $this->object->getTaxonomy('testing');
     // Verify our test item is an instance of JObject
     $this->assertInstanceOf('JObject', $taxonomy['Test Item']);
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:16,代码来源:FinderIndexerResultTest.php

示例5: index

 /**
  * Method to index a single item
  *
  * @param FinderIndexerResult $item
  * @param string $format
  *
  * @return null
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Product');
     // @todo: Add the category taxonomy data.
     //$item->addTaxonomy('Category', $item->category);
     // @todo: Add the language taxonomy data.
     //$item->addTaxonomy('Language', $item->language);
     // Index the item.
     $this->indexer->index($item);
 }
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:19,代码来源:magebridge.php

示例6: index

 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false || !$item->id) {
         return;
     }
     if (!($zoo_item = $this->app->table->item->get($item->id, true))) {
         return;
     }
     $registry = new JRegistry();
     $registry->loadArray($zoo_item->getParams()->get("metadata."));
     $item->metadata = $registry;
     $item->metaauthor = $zoo_item->getParams()->get("metadata.author");
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'link');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'element_data');
     $item->summary = $this->renderer->render('item.default', array('item' => $zoo_item));
     $item->url = $this->getURL($item->id, $this->extension, $this->layout);
     $item->route = $this->app->route->item($zoo_item, false);
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     $item->state = $zoo_item->searchable == 1 && $zoo_item->state == 1;
     $item->element_data = $this->app->database->queryResultArray('SELECT value FROM ' . ZOO_TABLE_SEARCH . ' WHERE item_id = ' . (int) $item->id);
     $item->addTaxonomy('Type', $zoo_item->getType()->name);
     foreach ($zoo_item->getRelatedCategories(true) as $category) {
         $item->addTaxonomy('Category', $category->name);
     }
     foreach ($zoo_item->getTags() as $tag) {
         $item->addTaxonomy('Tag', $tag);
     }
     FinderIndexerHelper::getContentExtras($item);
     if ($this->app->joomla->version->isCompatible('3.0')) {
         $this->indexer->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
开发者ID:unrealprojects,项目名称:journal,代码行数:40,代码来源:zoosmartsearch.php

示例7: index

 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);
     }
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:21,代码来源:fss_kb.php

示例8: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item    The item to index as an FinderIndexerResult object.
  * @param   string               $format  The item format
  *
  * @return  void
  *
  * @since   2.5
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     // Initialize the item parameters.
     $registry = new JRegistry();
     $registry->loadString($item->params);
     $item->params = JComponentHelper::getParams('com_jevents', true);
     $item->params->merge($registry);
     $registry = new JRegistry();
     $registry->loadString($item->metadata);
     $item->metadata = $registry;
     // Trigger the onContentPrepare event.
     $item->summary = FinderIndexerHelper::prepareContent($item->summary, $item->params);
     $item->body = FinderIndexerHelper::prepareContent($item->body, $item->params);
     // Build the necessary route and path information.
     $itemid = $this->params->get("target_itemid", 0);
     $item->url = "index.php?option=com_jevents&task=icalevent.detail&evid=" . $item->eventid . "&Itemid=" . $itemid;
     //$this->getURL($item->id, $this->extension, $this->layout);
     $item->route = "index.php?option=com_jevents&task=icalevent.detail&evid=" . $item->eventid . "&Itemid=" . $itemid;
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     // title is already set
     //$item->title;
     // Events should only be published if the category is published.etc. - do this later
     //$item->state;
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Event');
     // Add the creator taxonomy data.
     if (!empty($item->creator) || !empty($item->created_by_alias)) {
         $item->addTaxonomy('Creator', !empty($item->created_by_alias) ? $item->created_by_alias : $item->creator);
     }
     // Add the category taxonomy data. - can we do multiple categories?
     $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
     // Add the language taxonomy data.
     //$item->addTaxonomy('Language', $item->language);
     // Get jevents extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (JevJoomlaVersion::isCompatible("3.0.0")) {
         $this->indexer->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:57,代码来源:jevents.php

示例9: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item    The item to index as an FinderIndexerResult object.
  * @param   string               $format  The item format
  *
  * @return  void
  *
  * @since   2.5
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     $access = 1;
     if (is_null($item->privacy)) {
         $privacy = FD::privacy($item->user_id);
         $privacyValue = $privacy->getValue('photos', 'view');
         $item->privacy = $privacyValue;
     }
     if ($item->privacy == SOCIAL_PRIVACY_PUBLIC) {
         $access = 1;
     } else {
         if ($item->privacy == SOCIAL_PRIVACY_MEMBER) {
             $access = 2;
         } else {
             // this is not public / member items. do not index this item
             return;
         }
     }
     // $sql->select('a.id, a.title, a.alias, a.introtext AS summary, a.fulltext AS body');
     // $sql->select('a.state, a.catid, a.created AS start_date, a.created_by');
     // $sql->select('a.created_by_alias, a.modified, a.modified_by, a.attribs AS params');
     // $sql->select('a.metakey, a.metadesc, a.metadata, a.language, a.access, a.version, a.ordering');
     // $sql->select('a.publish_up AS publish_start_date, a.publish_down AS publish_end_date');
     // $sql->select('c.title AS category, c.published AS cat_state, c.access AS cat_access');
     // album onwer
     $user = FD::user($item->user_id);
     $userAlias = $user->getAlias(false);
     $photo = FD::table('Photo');
     $photo->load($item->id);
     // Build the necessary route and path information.
     // index.php?option=com_easysocial&view=photos&layout=item&id=510:00000690&type=user&uid=84:jenny-siew
     $item->url = 'index.php?option=com_easysocial&view=photos&layout=item&id=' . $photo->getAlias() . '&type=' . $photo->type . '&uid=' . $userAlias;
     $item->route = $photo->getPermalink();
     $item->route = $this->removeAdminSegment($item->route);
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     $category = 'user photo';
     if ($item->type == SOCIAL_TYPE_GROUP) {
         $category = 'group photo';
     }
     $item->access = $access;
     $item->alias = $photo->getAlias();
     $item->state = 1;
     $item->catid = $photo->type == SOCIAL_TYPE_GROUP ? 2 : 1;
     $item->start_date = $photo->created;
     $item->created_by = $photo->user_id;
     $item->created_by_alias = $userAlias;
     $item->modified = $photo->assigned_date == '0000-00-00 00:00:00' ? $photo->created : $photo->assigned_date;
     $item->modified_by = $photo->user_id;
     $item->params = '';
     $item->metakey = $category . ' ' . $photo->title;
     $item->metadesc = $category . ' ' . $photo->title;
     $item->metadata = '';
     $item->publish_start_date = $item->modified;
     $item->category = $category;
     $item->cat_state = 1;
     $item->cat_access = 0;
     $item->summary = $photo->title;
     $item->body = $photo->title;
     // Add the meta-author.
     $item->metaauthor = $userAlias;
     $item->author = $userAlias;
     // add image param
     $registry = FD::registry();
     $registry->set('image', $photo->getSource());
     $item->params = $registry;
     // Add the meta-data processing instructions.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'EasySocial.Photos');
     // Add the author taxonomy data.
     $item->addTaxonomy('Author', $userAlias);
     // Add the category taxonomy data.
     $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
     // Add the language taxonomy data.
     $langParams = JComponentHelper::getParams('com_languages');
     $item->language = $langParams->get('site', 'en-GB');
     $item->addTaxonomy('Language', $item->language);
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (FD::isJoomla30()) {
         $this->indexer->index($item);
//.........这里部分代码省略.........
开发者ID:knigherrant,项目名称:decopatio,代码行数:101,代码来源:easysocialphotos.php

示例10: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item    The item to index as an FinderIndexerResult object.
  * @param   string               $format  The item format
  *
  * @return  void
  *
  * @since   2.5
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     $item->setLanguage();
     $extension = ucfirst(substr($item->extension, 4));
     $item->url = $this->getURL($item->id, $item->extension, $this->layout);
     $item->route = 'index.php?option=' . $this->extension . '&view=book&layout=' . $this->layout . '&id=' . $item->book_id;
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Book');
     // Add the language taxonomy data.
     $item->addTaxonomy('Language', $item->language);
     // Index the item.
     $this->indexer->index($item);
 }
开发者ID:rrgarcia-tiempodev,项目名称:lendr,代码行数:28,代码来源:books.php

示例11: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item  The item to index as an FinderIndexerResult object.
  *
  * @return  void
  *
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item)
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     // Add the meta-data processing instructions.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Forum Post');
     // Add the author taxonomy data.
     if (!empty($item->author)) {
         $item->addTaxonomy('Author', $item->author);
     }
     // Add the category taxonomy data.
     //		$item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
     // Add the language taxonomy data.
     $item->addTaxonomy('Language', $item->language);
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     FinderIndexer::index($item);
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:32,代码来源:kunena.php

示例12: index

 /**
  * Main index function run when indexing happens
  *
  * @param FinderIndexerResult $item
  * @return bool|void
  */
 protected function index(FinderIndexerResult $item)
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     //Add the instructions
     foreach ($this->instructions as $type => $instructions) {
         foreach ($instructions as $instruction) {
             $item->addInstruction($type, $instruction);
         }
     }
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', $this->type_title);
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (method_exists('FinderIndexer', 'getInstance')) {
         FinderIndexer::getInstance()->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
开发者ID:daodaoliang,项目名称:nooku-framework,代码行数:28,代码来源:finder.php

示例13: index


//.........这里部分代码省略.........
         }
     }
     // get data from customfields
     // get customfields.
     // $fieldsLib		= FD::fields();
     // $fieldModel  	= FD::model( 'Fields' );
     // $fieldsResult 	= array();
     // $options = array();
     // $options['data'] 		= true;
     // $options['dataId'] 		= $user->user_id;
     // $options['dataType'] 	= SOCIAL_TYPE_USER;
     // $options['searchable'] 	= 1;
     // //todo: get customfields.
     // $fields = $fieldModel->getCustomFields( $options );
     // if( count( $fields ) > 0 )
     // {
     // 	//foreach( $fields as $item )
     // 	foreach( $fields as $field )
     // 	{
     // 		$userFieldData = isset( $field->data ) ? $field->data : '';
     // 		$args 			= array( $userFieldData );
     // 		$f 				= array( &$field );
     // 		$dataResult 	= @$fieldsLib->trigger( 'onIndexer' , SOCIAL_FIELDS_GROUP_USER , $f , $args );
     // 		if( $dataResult !== false && count( $dataResult ) > 0 )
     // 			$fieldsResult[]  	= $dataResult[0];
     // 	}
     // 	if( $fieldsResult )
     // 	{
     // 		$customFieldsContent 	= implode( ' ', $fieldsResult );
     // 		$contentSnapshot[] 		= $customFieldsContent;
     // 	}
     // }
     $content = implode(' ', $contentSnapshot);
     // Build the necessary route and path information.
     // we need to pass in raw url so that if the site on sef, smart serach will not create new item.
     // index.php?option=com_easysocial&view=profile&id=84:jenny-siew
     // $item->url		= 'index.php?option=com_easysocial&view=profile&id=' . $userAlias;
     $item->url = 'index.php?option=com_easysocial&view=profile&id=' . $user->id;
     $item->route = $user->getPermalink();
     $item->route = $this->removeAdminSegment($item->route);
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     $userProfile = $user->getProfile();
     $metaKey = $userName;
     if ($userEmail) {
         $metaKey .= ', ' . $userEmail;
     }
     $item->title = $userName;
     $item->access = $access;
     $item->alias = $userAlias;
     $item->state = 1;
     $item->start_date = $user->registerDate;
     $item->created_by = $item->user_id;
     $item->created_by_alias = $userAlias;
     $item->modified = $user->registerDate;
     $item->modified_by = $item->user_id;
     $item->params = '';
     $item->metakey = $metaKey;
     $item->metadesc = $content;
     $item->metadata = '';
     $item->publish_start_date = $user->registerDate;
     // let put user profile as category
     $item->catid = $userProfile->id;
     $item->category = $userProfile->getTitle();
     $item->cat_state = 1;
     $item->cat_access = 0;
     $item->summary = $content;
     $item->body = $content;
     // Add the meta-author.
     $item->metaauthor = $userAlias;
     $item->author = $userAlias;
     // add image param
     $registry = FD::registry();
     $registry->set('image', $user->getAvatar());
     $item->params = $registry;
     // Add the meta-data processing instructions.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'EasySocial.Users');
     // Add the author taxonomy data.
     $item->addTaxonomy('Author', $userAlias);
     // Add the category taxonomy data.
     $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
     // Add the language taxonomy data.
     // $langParams 	= JComponentHelper::getParams('com_languages');
     // $item->language = $langParams->get( 'site', 'en-GB');
     //
     $item->language = '*';
     $item->addTaxonomy('Language', $item->language);
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     if (FD::isJoomla30()) {
         $this->indexer->index($item);
     } else {
         FinderIndexer::index($item);
     }
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:101,代码来源:easysocialusers.php

示例14: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item    The item to index as an FinderIndexerResult object.
  * @param   string               $format  The item format
  *
  * @return  void
  *
  * @since   3.1
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     $item->setLanguage();
     // Initialize the item parameters.
     $registry = new JRegistry();
     $registry->loadString($item->params);
     $item->params = JComponentHelper::getParams('com_tags', true);
     $item->params->merge($registry);
     $registry = new JRegistry();
     $registry->loadString($item->metadata);
     $item->metadata = $registry;
     // Build the necessary route and path information.
     $item->url = $this->getURL($item->id, $this->extension, $this->layout);
     $item->route = TagsHelperRoute::getTagRoute($item->slug);
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     // Get the menu title if it exists.
     $title = $this->getItemMenuTitle($item->url);
     // Adjust the title if necessary.
     if (!empty($title) && $this->params->get('use_menu_title', true)) {
         $item->title = $title;
     }
     // Add the meta-author.
     $item->metaauthor = $item->metadata->get('author');
     // Handle the link to the meta-data.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'link');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias');
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Tag');
     // Add the author taxonomy data.
     if (!empty($item->author) || !empty($item->created_by_alias)) {
         $item->addTaxonomy('Author', !empty($item->created_by_alias) ? $item->created_by_alias : $item->author);
     }
     // Add the language taxonomy data.
     $item->addTaxonomy('Language', $item->language);
     // Index the item.
     $this->indexer->index($item);
 }
开发者ID:Tommar,项目名称:vino2,代码行数:56,代码来源:tags.php

示例15: index

 /**
  * Method to index an item. The item must be a FinderIndexerResult object.
  *
  * @param   FinderIndexerResult  $item    The item to index as an FinderIndexerResult object.
  * @param   string               $format  The item format
  *
  * @return  void
  *
  * @since   2.5
  * @throws  Exception on database error.
  */
 protected function index(FinderIndexerResult $item, $format = 'html')
 {
     // Check if the extension is enabled
     if (JComponentHelper::isEnabled($this->extension) == false) {
         return;
     }
     // Initialize the item parameters.
     $registry = new JRegistry();
     $registry->loadString($item->params);
     $item->params = $registry;
     $registry = new JRegistry();
     $registry->loadString($item->metadata);
     $item->metadata = $registry;
     // Build the necessary route and path information.
     $item->url = $this->getURL($item->id, $this->extension, $this->layout);
     $item->route = WeblinksHelperRoute::getWeblinkRoute($item->slug, $item->catslug);
     $item->path = FinderIndexerHelper::getContentPath($item->route);
     /*
      * Add the meta-data processing instructions based on the newsfeeds
      * configuration parameters.
      */
     // Add the meta-author.
     $item->metaauthor = $item->metadata->get('author');
     // Handle the link to the meta-data.
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'link');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
     $item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias');
     // Add the type taxonomy data.
     $item->addTaxonomy('Type', 'Web Link');
     // Add the category taxonomy data.
     $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
     // Add the language taxonomy data.
     $item->addTaxonomy('Language', $item->language);
     // Get content extras.
     FinderIndexerHelper::getContentExtras($item);
     // Index the item.
     FinderIndexer::index($item);
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:52,代码来源:weblinks.php


注:本文中的FinderIndexerResult::addTaxonomy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。