Ejemplo n.º 1
0
 function &__performDetailsSearch(&$query_parser, &$result)
 {
     foreach ($this->getDetails() as $type => $enabled) {
         if (!$enabled) {
             continue;
         }
         switch ($type) {
             case 'crs':
                 $crs_search = ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
                 $crs_search->setFilter(array('crs'));
                 $result->mergeEntries($crs_search->performSearch());
                 break;
             case 'grp':
                 $grp_search = ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
                 $grp_search->setFilter(array('grp'));
                 $result->mergeEntries($grp_search->performSearch());
                 break;
             case 'lms':
                 $content_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
                 $content_search->setFilter($this->__getFilter());
                 $result->mergeEntries($content_search->performSearch());
                 break;
             case 'frm':
                 $forum_search =& ilObjectSearchFactory::_getForumSearchInstance($query_parser);
                 $forum_search->setFilter($this->__getFilter());
                 $result->mergeEntries($forum_search->performSearch());
                 break;
             case 'glo':
                 // Glossary term definition pages
                 $gdf_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
                 $gdf_search->setFilter(array('gdf'));
                 $result->mergeEntries($gdf_search->performSearch());
                 // Glossary terms
                 $gdf_term_search =& ilObjectSearchFactory::_getGlossaryDefinitionSearchInstance($query_parser);
                 $result->mergeEntries($gdf_term_search->performSearch());
                 break;
             case 'exc':
                 $exc_search =& ilObjectSearchFactory::_getExerciseSearchInstance($query_parser);
                 $exc_search->setFilter($this->__getFilter());
                 $result->mergeEntries($exc_search->performSearch());
                 break;
             case 'mcst':
                 $mcst_search =& ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
                 $result->mergeEntries($mcst_search->performSearch());
                 break;
             case 'tst':
                 $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
                 $tst_search->setFilter($this->__getFilter());
                 $result->mergeEntries($tst_search->performSearch());
                 break;
             case 'mep':
                 $mep_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
                 $mep_search->setFilter($this->__getFilter());
                 $result->mergeEntries($mep_search->performSearch());
                 // Mob keyword search
                 $mob_search = ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
                 $mob_search->setFilter($this->__getFilter());
                 $result->mergeEntries($mob_search->performKeywordSearch());
                 break;
             case 'wiki':
                 $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
                 $wiki_search->setFilter($this->__getFilter());
                 $result->mergeEntries($wiki_search->performSearch());
                 /*$result_meta =& $this->__searchMeta($query_parser,'title');
                 		$result->mergeEntries($result_meta);
                 		$result_meta =& $this->__searchMeta($query_parser,'description');
                 		$result->mergeEntries($result_meta);*/
                 break;
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * Search in Wiki
  */
 static function _performSearch($a_wiki_id, $a_searchterm)
 {
     // query parser
     include_once 'Services/Search/classes/class.ilQueryParser.php';
     $query_parser = new ilQueryParser($a_searchterm);
     $query_parser->setCombination("or");
     $query_parser->parse();
     include_once 'Services/Search/classes/class.ilSearchResult.php';
     $search_result = new ilSearchResult();
     if ($query_parser->validate()) {
         include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
         $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
         $wiki_search->setFilter(array('wpg'));
         $search_result->mergeEntries($wiki_search->performSearch());
     }
     $entries = $search_result->getEntries();
     $found_pages = array();
     foreach ($entries as $entry) {
         if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"])) {
             foreach ($entry["child"] as $child) {
                 $found_pages[] = array("page_id" => $child);
             }
         }
     }
     return $found_pages;
 }