use wcf\system\event\EventHandler;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\SystemException;
+use wcf\system\menu\page\PageMenu;
use wcf\system\search\SearchEngine;
use wcf\system\WCF;
// get messages
$this->readMessages();
+
+ // set active menu item
+ if (count($this->searchData['selectedObjectTypes']) == 1) {
+ $objectType = SearchEngine::getInstance()->getObjectType($this->searchData['selectedObjectTypes'][0]);
+ if (($activeMenuItem = $objectType->getActiveMenuItem())) {
+ PageMenu::getInstance()->setActiveMenuItem($activeMenuItem);
+ }
+ }
}
/**
* @category Community Framework
*/
abstract class AbstractSearchableObjectType extends AbstractObjectTypeProcessor implements ISearchableObjectType {
+ /**
+ * active main menu item
+ * @var string
+ */
+ protected $activeMenuItem = '';
+
/**
* @see \wcf\system\search\ISearchableObjectType::show()
*/
public function getSpecialSQLQuery(PreparedStatementConditionBuilder &$fulltextCondition = null, PreparedStatementConditionBuilder &$searchIndexConditions = null, PreparedStatementConditionBuilder &$additionalConditions = null, $orderBy = 'time DESC') {
return '';
}
+
+ /**
+ * @see \wcf\system\search\ISearchableObjectType::getActiveMenuItem()
+ */
+ public function getActiveMenuItem() {
+ return $this->activeMenuItem;
+ }
}
* @return string
*/
public function getSpecialSQLQuery(PreparedStatementConditionBuilder &$fulltextCondition = null, PreparedStatementConditionBuilder &$searchIndexConditions = null, PreparedStatementConditionBuilder &$additionalConditions = null, $orderBy = 'time DESC');
+
+ /**
+ * Returns the name of the active main menu item.
+ *
+ * @return string
+ */
+ public function getActiveMenuItem();
}