8 include_once
"./classes/class.ilObject.php";
9 include_once (
"./Modules/Wiki/classes/class.ilWikiUtil.php");
29 function ilObjWiki($a_id = 0,$a_call_by_reference =
true)
32 $this->
ilObject($a_id,$a_call_by_reference);
42 $this->online = $a_online;
62 $this->rating = $a_rating;
92 return $this->startpage;
102 $this->shorttitle = $a_shorttitle;
112 return $this->shorttitle;
122 $this->introduction = $a_introduction;
132 return $this->introduction;
140 return $this->style_id;
148 $this->style_id = $a_style_id;
154 function create($a_prevent_start_page_creation =
false)
160 $ilDB->insert(
"il_wiki_data", array(
161 "id" => array(
"integer", $this->
getId()),
162 "is_online" => array(
"integer", (
int) $this->
getOnline()),
165 "rating" => array(
"integer", (
int) $this->
getRating()),
170 if ($this->
getStartPage() !=
"" && !$a_prevent_start_page_creation)
172 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
174 $start_page->setWikiId($this->
getId());
176 $start_page->create();
181 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
192 function update($a_prevent_start_page_creation =
false)
196 if (!parent::update())
201 $ilDB->update(
"il_wiki_data", array(
202 "is_online" => array(
"integer", $this->
getOnline()),
205 "rating" => array(
"integer", $this->
getRating()),
208 "id" => array(
"integer", $this->
getId())
212 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
214 && !$a_prevent_start_page_creation)
217 $start_page->setWikiId($this->
getId());
219 $start_page->create();
222 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
237 $query =
"SELECT * FROM il_wiki_data WHERE id = ".
238 $ilDB->quote($this->
getId(),
"integer");
239 $set = $ilDB->query(
$query);
240 $rec = $ilDB->fetchAssoc($set);
248 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
265 if (!parent::delete())
271 $query =
"DELETE FROM il_wiki_data".
272 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
273 $ilDB->manipulate(
$query);
276 include_once
"./Services/Notification/classes/class.ilNotification.php";
279 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
292 $res = $ilDB->queryF(
"SELECT id FROM il_wiki_data WHERE short = %s",
293 array(
"text"), 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 $a_field FROM il_wiki_data WHERE id = ".
419 $ilDB->quote($a_wiki_id,
"integer");
420 $set = $ilDB->query(
$query);
421 $rec = $ilDB->fetchAssoc($set);
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;