8 include_once
"./Services/Object/classes/class.ilObject.php";
9 include_once
"./Modules/Wiki/classes/class.ilWikiUtil.php";
10 include_once
"./Services/AdvancedMetaData/interfaces/interface.ilAdvancedMetaDataSubItems.php";
36 parent::__construct($a_id,$a_call_by_reference);
46 $this->online = $a_online;
66 $this->rating_overall = (bool)$a_rating;
76 return $this->rating_overall;
86 $this->rating = (bool)$a_rating;
106 $this->rating_block = (bool)$a_rating;
116 return $this->rating_block;
126 $this->rating_new_pages = (bool)$a_rating;
136 return $this->rating_new_pages;
146 $this->rating_categories = (bool)$a_rating;
156 return $this->rating_categories;
164 $this->public_notes = $a_val;
182 $this->imp_pages = $a_val;
192 return $this->imp_pages;
212 return $this->startpage;
222 $this->shorttitle = $a_shorttitle;
232 return $this->shorttitle;
242 $this->introduction = $a_introduction;
252 return $this->introduction;
260 return $this->style_id;
268 $this->style_id = $a_style_id;
278 $this->page_toc = $a_val;
288 return $this->page_toc;
298 $this->empty_page_templ = $a_val;
318 $this->link_md_values = $a_val;
338 if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
348 function create($a_prevent_start_page_creation =
false)
354 $ilDB->insert(
"il_wiki_data",
array(
366 if ($this->
getStartPage() !=
"" && !$a_prevent_start_page_creation)
368 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
370 $start_page->setWikiId($this->
getId());
372 $start_page->create();
377 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
388 function update($a_prevent_start_page_creation =
false)
392 if (!parent::update())
397 $ilDB->update(
"il_wiki_data",
array(
417 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
419 && !$a_prevent_start_page_creation)
422 $start_page->setWikiId($this->
getId());
424 $start_page->create();
427 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
442 $query =
"SELECT * FROM il_wiki_data WHERE id = ".
443 $ilDB->quote($this->
getId(),
"integer");
444 $set = $ilDB->query(
$query);
445 $rec = $ilDB->fetchAssoc($set);
462 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
479 if (!parent::delete())
485 $query =
"DELETE FROM il_wiki_data".
486 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
487 $ilDB->manipulate(
$query);
490 include_once
"./Services/Notification/classes/class.ilNotification.php";
493 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
506 $res = $ilDB->queryF(
"SELECT id FROM il_wiki_data WHERE short = %s",
508 if ($ilDB->fetchAssoc(
$res))
596 private static function _lookup($a_wiki_id, $a_field)
600 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = ".
601 $ilDB->quote($a_wiki_id,
"integer");
602 $set = $ilDB->query(
$query);
603 $rec = $ilDB->fetchAssoc($set);
604 return $rec[$a_field];
626 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
627 $ilDB->manipulate(
"UPDATE il_wiki_data SET ".
629 " WHERE id = ".$ilDB->quote($a_id,
"integer")
639 include_once
'Services/Search/classes/class.ilQueryParser.php';
642 $query_parser->setCombination(
"or");
643 $query_parser->parse();
645 include_once
'Services/Search/classes/class.ilSearchResult.php';
647 if($query_parser->validate())
650 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
652 $wiki_search->setFilter(
array(
'wpg'));
653 $search_result->mergeEntries($wiki_search->performSearch());
656 $entries = $search_result->getEntries();
658 $found_pages =
array();
659 foreach($entries as $entry)
661 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"]))
663 foreach($entry[
"child"] as $child)
665 $found_pages[] =
array(
"page_id" => $child);
699 $set = $ilDB->query(
"SELECT * FROM il_wiki_imp_pages WHERE ".
700 " wiki_id = ".$ilDB->quote($a_wiki_id,
"integer").
" ORDER BY ord ASC " 703 $imp_pages =
array();
705 while ($rec = $ilDB->fetchAssoc($set))
722 $set = $ilDB->query(
"SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE ".
723 " wiki_id = ".$ilDB->quote($a_wiki_id,
"integer")
726 $rec = $ilDB->fetchAssoc($set);
727 return (
int) $rec[
"m"];
747 $ilDB->manipulate(
"INSERT INTO il_wiki_imp_pages ".
748 "(wiki_id, ord, indent, page_id) VALUES (".
749 $ilDB->quote($this->getId(),
"integer").
",".
750 $ilDB->quote($a_nr,
"integer").
",".
751 $ilDB->quote($a_indent,
"integer").
",".
752 $ilDB->quote($a_page_id,
"integer").
767 $set = $ilDB->query(
"SELECT * FROM il_wiki_imp_pages WHERE ".
768 " wiki_id = ".$ilDB->quote($this->getId(),
"integer").
" AND ".
769 " page_id = ".$ilDB->quote($a_page_id,
"integer")
771 if ($rec = $ilDB->fetchAssoc($set))
787 $ilDB->manipulate(
"DELETE FROM il_wiki_imp_pages WHERE " 788 .
" wiki_id = ".$ilDB->quote($this->getId(),
"integer")
789 .
" AND page_id = ".$ilDB->quote($a_id,
"integer")
807 foreach ($ipages as $k => $v)
809 if (isset($a_ord[$v[
"page_id"]]))
811 $ipages[$k][
"ord"] = (int) $a_ord[$v[
"page_id"]];
813 if (isset($a_indent[$v[
"page_id"]]))
815 $ipages[$k][
"indent"] = (int) $a_indent[$v[
"page_id"]];
823 foreach ($ipages as $k => $v)
825 if ($ipages[$k][
"indent"] == 2 && $c_indent == 0)
827 $ipages[$k][
"indent"] = 1;
830 $c_indent = $ipages[$k][
"indent"];
835 foreach ($ipages as $k => $v)
837 $ilDB->manipulate($q =
"UPDATE il_wiki_imp_pages SET ".
838 " ord = ".$ilDB->quote($ord,
"integer").
",".
839 " indent = ".$ilDB->quote($v[
"indent"],
"integer").
840 " WHERE wiki_id = ".$ilDB->quote($v[
"wiki_id"],
"integer").
841 " AND page_id = ".$ilDB->quote($v[
"page_id"],
"integer")
861 foreach ($ipages as $k => $v)
863 if ($ipages[$k][
"indent"] == 2 && $c_indent == 0)
865 $ipages[$k][
"indent"] = 1;
868 $c_indent = $ipages[$k][
"indent"];
872 foreach ($ipages as $k => $v)
874 $ilDB->manipulate($q =
"UPDATE il_wiki_imp_pages SET ".
875 " ord = ".$ilDB->quote($ord,
"integer").
876 ", indent = ".$ilDB->quote($v[
"indent"],
"integer").
877 " WHERE wiki_id = ".$ilDB->quote($v[
"wiki_id"],
"integer").
878 " AND page_id = ".$ilDB->quote($v[
"page_id"],
"integer")
907 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
911 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
916 if(!$cp_options->isRootNode($this->getRefId()))
936 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
940 $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
941 $new_id = $style_obj->ilClone();
942 $new_obj->setStyleSheetId($new_id);
947 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
949 if (count($pages) > 0)
954 $start_page->delete();
957 foreach ($pages as $p)
961 $new_page->setTitle($page->getTitle());
962 $new_page->setWikiId($new_obj->getId());
963 $new_page->setTitle($page->getTitle());
964 $new_page->setBlocked($page->getBlocked());
965 $new_page->setRating($page->getRating());
966 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
969 $page->copy($new_page->getId(),
"", 0,
true);
973 $map[$p[
"id"]] = $new_page->getId();
979 $new_obj->addImportantPage($map[$ip[
"page_id"]], $ip[
"ord"], $ip[
"indent"]);
983 include_once(
"./Services/Rating/classes/class.ilRatingCategory.php");
987 $new_rc->setParentId($new_obj->getId());
988 $new_rc->setTitle($rc[
"title"]);
989 $new_rc->setDescription($rc[
"description"]);
1005 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1026 if ($a_template_page == 0)
1030 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1033 if (count($ts) == 1)
1036 $a_template_page =
$t[
"wpage_id"];
1043 $page->setWikiId($this->
getId());
1047 $page->setRating(
true);
1051 $page->setWikiRefId($this->
getRefId());
1055 if ($a_template_page > 0)
1058 $orig->copy($page->getId());
1061 include_once
"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1078 if($a_sub_type ==
"wpg")
1080 $lng->loadLanguageModule(
"wiki");
1081 include_once
"./Modules/Wiki/classes/class.ilWikiPage.php";
1096 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1099 $user_export->initUserHTMLExport();
1112 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1115 $user_export->startUserHTMLExport();
1127 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1130 return $user_export->getProgress();
1140 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1143 return $user_export->deliverFile();
1155 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1159 return "<a href='".$url.
"'>".$a_value.
"</a>";
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
static removeForObject($type, $id)
Remove all notifications for given object.
static _lookupRatingOverall($a_wiki_id)
Lookup whether rating is activated for whole object.
saveOrderingAndIndentation($a_ord, $a_indent)
Save ordering and indentation.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
setImportantPages($a_val)
Set important pages.
getRatingOverall()
Get Enable Rating For Object.
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
update($a_prevent_start_page_creation=false)
update object data
setOnline($a_online)
Set Online.
getUserHTMLExportProgress()
Get user html export progress.
initUserHTMLExport()
Init user html export.
getStartPage()
Get Start Page.
setIntroduction($a_introduction)
Set Introduction.
static checkShortTitleAvailability($a_short_title)
Check availability of short title.
getLinkMetadataValues()
Get link md values.
getShortTitle()
Get ShortTitle.
setPublicNotes($a_val)
Set public notes.
Class ilObject Basic functions for all objects.
static _lookupStartPage($a_wiki_id)
Lookup start page.
deliverUserHTMLExport()
Send user html export file.
static _lookupLinkMetadataValues($a_wiki_id)
Lookup whether metadata should be auto linked.
getPublicNotes()
Get public notes.
startUserHTMLExport()
Start user html export.
getRatingForNewPages()
Get Enable Rating For New Pages.
static _lookupRatingCategories($a_wiki_id)
Lookup whether rating categories are activated.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getRatingCategories()
Get Enable Rating Categories.
static getAllForObject($a_parent_obj_id)
Get all categories for object.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
setRatingCategories($a_rating)
Set Enable Rating Categories.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
isImportantPage($a_page_id)
Is page an important page?
addImportantPage($a_page_id, $a_nr=0, $a_indent=0)
Add important page.
static _lookupStandard($a_id)
Lookup standard flag.
createWikiPage($a_page_title, $a_template_page=0)
Create new wiki page.
Class manages user html export.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getPageToc()
Get page toc.
static getAdvMDSubItemTitle($a_obj_id, $a_sub_type, $a_sub_id)
setRatingAsBlock($a_rating)
Set Enable Rating Side Block.
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
fixImportantPagesNumbering()
Fix important pages numbering.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getEmptyPageTemplate()
Get empty page template.
setEmptyPageTemplate($a_val)
Set empty page template.
decorateAdvMDValue($a_value)
Decorate adv md value.
getId()
get object id public
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null)
Clone Advanced Meta Data.
getTemplateSelectionOnCreation()
Get template selection on creation? If more than one template (including empty page template) is acti...
getRatingAsBlock()
Get Enable Rating Side Block.
static _lookupRatingAsBlock($a_wiki_id)
Lookup whether rating side block is activated.
static _lookupMaxOrdNrImportantPages($a_wiki_id)
Get important pages list.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone wiki.
getStyleSheetId()
get ID of assigned style sheet object
setShortTitle($a_shorttitle)
Set ShortTitle.
static _lookupPageToc($a_wiki_id)
Lookup whether important pages are activated.
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
static makeDbTitle($a_par)
Handle page GET parameter.
Create styles array
The data for the language used.
setStartPage($a_startpage)
Set Start Page.
setLinkMetadataValues($a_val)
Set link md values.
setRating($a_rating)
Set Enable Rating.
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
getIntroduction()
Get Introduction.
setRatingForNewPages($a_rating)
Set Enable Rating For New Pages.
static isOnlineHelpWiki($a_ref_id)
Is wiki an online help wiki?
getRefId()
get reference id public
getImportantPages()
Get important pages.
setRatingOverall($a_rating)
Set Enable Rating For Object.
create($a_prevent_start_page_creation=false)
Create new wiki.
static deleteAllPagesOfWiki($a_wiki_id)
delete wiki page and al related data
getRating()
Get Enable Rating.
static _lookupImportantPages($a_wiki_id)
Lookup whether important pages are activated.
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
setPageToc($a_val)
Set page toc.
static writeStartPage($a_id, $a_name)
Write start page.
removeImportantPage($a_id)
Remove important page.