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;
159 return $this->style_id;
167 $this->style_id = $a_style_id;
179 $ilDB->insert(
"il_wiki_data", array(
180 "id" => array(
"integer", $this->
getId()),
181 "is_online" => array(
"integer", (
int) $this->
getOnline()),
184 "rating" => array(
"integer", (
int) $this->
getRating()),
191 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
193 $start_page->setWikiId($this->
getId());
195 $start_page->create();
200 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
215 if (!parent::update())
220 $ilDB->update(
"il_wiki_data", array(
221 "is_online" => array(
"integer", $this->
getOnline()),
224 "rating" => array(
"integer", $this->
getRating()),
227 "id" => array(
"integer", $this->
getId())
231 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
235 $start_page->setWikiId($this->
getId());
237 $start_page->create();
240 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
255 $query =
"SELECT * FROM il_wiki_data WHERE id = ".
256 $ilDB->quote($this->
getId(),
"integer");
257 $set = $ilDB->query(
$query);
258 $rec = $ilDB->fetchAssoc($set);
266 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
283 if (!parent::delete())
289 $query =
"DELETE FROM il_wiki_data".
290 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
291 $ilDB->manipulate(
$query);
293 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
306 $res = $ilDB->queryF(
"SELECT id FROM il_wiki_data WHERE short = %s",
307 array(
"text"), array($a_short_title));
308 if ($ilDB->fetchAssoc(
$res))
339 return $roles ? $roles : array();
355 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
395 if ($a_node_id==
$_GET[
"ref_id"])
397 $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
398 $parent_type = $parent_obj->getType();
399 if($parent_type == $this->
getType())
401 $a_node_id = (int) $tree->getParentId($a_node_id);
405 parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
428 private static function _lookup($a_wiki_id, $a_field)
432 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = ".
433 $ilDB->quote($a_wiki_id,
"integer");
434 $set = $ilDB->query(
$query);
435 $rec = $ilDB->fetchAssoc($set);
436 return $rec[$a_field];
457 include_once
'Services/Search/classes/class.ilQueryParser.php';
460 $query_parser->setCombination(
"or");
461 $query_parser->parse();
463 include_once
'Services/Search/classes/class.ilSearchResult.php';
465 if($query_parser->validate())
468 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
470 $wiki_search->setFilter(array(
'wpg'));
471 $search_result->mergeEntries($wiki_search->performSearch());
474 $entries = $search_result->getEntries();
476 $found_pages = array();
477 foreach($entries as $entry)
479 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"]))
481 foreach($entry[
"child"] as $child)
483 $found_pages[] = $child;