27 include_once
"./classes/class.ilObject.php";
28 include_once (
"./Modules/Wiki/classes/class.ilWikiUtil.php");
48 function ilObjWiki($a_id = 0,$a_call_by_reference =
true)
51 $this->
ilObject($a_id,$a_call_by_reference);
61 $this->online = $a_online;
81 $this->rating = $a_rating;
111 return $this->startpage;
121 $this->shorttitle = $a_shorttitle;
131 return $this->shorttitle;
141 $this->introduction = $a_introduction;
151 return $this->introduction;
163 $query =
"INSERT INTO il_wiki_data (".
171 $ilDB->quote($this->
getId())
178 $ilDB->query($query);
183 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
185 $start_page->setWikiId($this->
getId());
187 $start_page->create();
202 if (!parent::update())
208 $st = $ilDB->prepareManip(
"UPDATE il_wiki_data SET ".
209 " online = ?, startpage = ?, short = ?, ".
210 " rating = ?, introduction = ? ".
212 array(
"boolean",
"text",
"text",
"boolean",
"text",
"integer"));
213 $ilDB->execute($st, array(
222 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
226 $start_page->setWikiId($this->
getId());
228 $start_page->create();
243 $query =
"SELECT * FROM il_wiki_data WHERE id = ".
244 $ilDB->quote($this->
getId());
245 $set = $ilDB->query($query);
268 if (!parent::delete())
274 $query =
"DELETE FROM il_wiki_data".
275 " WHERE id = ".$ilDB->quote($this->
getId());
276 $ilDB->query($query);
278 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
291 $st = $ilDB->prepare(
"SELECT * FROM il_wiki_data WHERE short = ?",
293 $res = $ilDB->execute($st, array($a_short_title));
294 if ($ilDB->fetchAssoc(
$res))
325 return $roles ? $roles : array();
341 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
381 if ($a_node_id==
$_GET[
"ref_id"])
383 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
384 $parent_type = $parent_obj->getType();
385 if($parent_type == $this->
getType())
387 $a_node_id = (int) $tree->getParentId($a_node_id);
391 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
414 private static function _lookup($a_wiki_id, $a_field)
418 $query =
"SELECT * FROM il_wiki_data WHERE id = ".
419 $ilDB->quote($a_wiki_id);
420 $set = $ilDB->query($query);
422 return $rec[$a_field];
443 include_once
'Services/Search/classes/class.ilQueryParser.php';
446 $query_parser->setCombination(
"or");
447 $query_parser->parse();
449 include_once
'Services/Search/classes/class.ilSearchResult.php';
451 if($query_parser->validate())
454 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
456 $wiki_search->setFilter(array(
'wpg'));
457 $search_result->mergeEntries($wiki_search->performSearch());
460 $entries = $search_result->getEntries();
462 $found_pages = array();
463 foreach($entries as $entry)
465 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"]))
467 foreach($entry[
"child"] as $child)
469 $found_pages[] = $child;