/** * Batch remove all index contents related to a Course. * * @param int $courseId */ public function removeAllByCourse($courseId) { if (!get_config('enable_indexing')) { return; } $cidx = new CourseIndexer($this); $cidx->remove($courseId); $aidx = new AnnouncementIndexer($this); $aidx->removeByCourse($courseId); $agdx = new AgendaIndexer($this); $agdx->removeByCourse($courseId); $lidx = new LinkIndexer($this); $lidx->removeByCourse($courseId); $vdx = new VideoIndexer($this); $vdx->removeByCourse($courseId); $vldx = new VideolinkIndexer($this); $vldx->removeByCourse($courseId); $eidx = new ExerciseIndexer($this); $eidx->removeByCourse($courseId); $fidx = new ForumIndexer($this); $fidx->removeByCourse($courseId); $ftdx = new ForumTopicIndexer($this); $ftdx->removeByCourse($courseId); $fpdx = new ForumPostIndexer($this); $fpdx->removeByCourse($courseId); $didx = new DocumentIndexer($this); $didx->removeByCourse($courseId); $uidx = new UnitIndexer($this); $uidx->removeByCourse($courseId); $urdx = new UnitResourceIndexer($this); $urdx->removeByCourse($courseId); $ndx = new NoteIndexer($this); $ndx->removeByCourse($courseId); }
$exercise = Database::get()->querySingle("SELECT title, description FROM exercise WHERE id = ?d", $exerciseHit->pkid); $class = $numLine % 2 ? 'odd' : 'even'; $tool_content .= "<tr class='{$class}'>\n <td width='1' valign='top'><img style='padding-top:3px;' src='{$themeimg}/arrow.png' title='bullet' /></td>\n <td>"; $desc_text = empty($exercise->description) ? "" : "<br /> <span class='smaller'>" . $exercise->description . "</span>"; $tool_content .= "<a href='" . $exerciseHit->url . "'>" . q($exercise->title) . "</a>{$desc_text} </td></tr>"; $numLine++; } $tool_content .= "</table>"; $found = true; } } // search in forums if ($forums) { $forumHits = $idx->searchRaw(ForumIndexer::buildQuery($_POST)); $forumTopicHits = $idx->searchRaw(ForumTopicIndexer::buildQuery($_POST)); $forumPostHits = $idx->searchRaw(ForumPostIndexer::buildQuery($_POST)); if (count($forumHits) > 0) { $tool_content .= "<script type='text/javascript' src='../auth/sorttable.js'></script>\n <table width='99%' class='sortable' id='t5' align='left'>\n <tr>\n <th colspan='2' class='left'>{$langForum} ({$langCategories}):</th>\n </tr>"; $numLine = 0; foreach ($forumHits as $forumHit) { $forum = Database::get()->querySingle("SELECT name, `desc` FROM forum WHERE id = ?d", $forumHit->pkid); $class = $numLine % 2 ? 'odd' : 'even'; $tool_content .= "<tr class='{$class}'>\n <td width='1' valign='top'><img style='padding-top:3px;' src='{$themeimg}/arrow.png' title='bullet' /></td>\n <td>"; $desc_text = empty($forum->desc) ? "" : "<br /><span class='smaller'>(" . q($forum->desc) . ")</span>"; $tool_content .= "<a href='" . $forumHit->url . "'>" . q($forum->name) . "</a> " . $desc_text . " </td></tr>"; $numLine++; } $tool_content .= "</table>"; $found = true; } if (count($forumTopicHits) > 0) {