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";
38 public function __construct($a_id = 0, $a_call_by_reference =
true)
42 $this->db = $DIC->database();
43 $this->
user = $DIC->user();
45 parent::__construct($a_id, $a_call_by_reference);
55 $this->online = $a_online;
75 $this->rating_overall = (bool) $a_rating;
85 return $this->rating_overall;
95 $this->rating = (bool) $a_rating;
105 return $this->rating;
115 $this->rating_block = (bool) $a_rating;
125 return $this->rating_block;
135 $this->rating_new_pages = (bool) $a_rating;
145 return $this->rating_new_pages;
155 $this->rating_categories = (bool) $a_rating;
165 return $this->rating_categories;
173 $this->public_notes = $a_val;
191 $this->imp_pages = $a_val;
201 return $this->imp_pages;
221 return $this->startpage;
231 $this->shorttitle = $a_shorttitle;
241 return $this->shorttitle;
251 $this->introduction = $a_introduction;
261 return $this->introduction;
269 return $this->style_id;
277 $this->style_id = $a_style_id;
287 $this->page_toc = $a_val;
297 return $this->page_toc;
307 $this->empty_page_templ = $a_val;
327 $this->link_md_values = $a_val;
347 if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID) {
356 public function create($a_prevent_start_page_creation =
false)
374 if ($this->
getStartPage() !=
"" && !$a_prevent_start_page_creation) {
375 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
377 $start_page->setWikiId($this->
getId());
379 $start_page->create();
383 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
394 public function update($a_prevent_start_page_creation =
false)
422 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
424 && !$a_prevent_start_page_creation) {
426 $start_page->setWikiId($this->
getId());
428 $start_page->create();
431 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
446 $query =
"SELECT * FROM il_wiki_data WHERE id = " .
449 $rec =
$ilDB->fetchAssoc($set);
466 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
477 public function delete()
482 if (!parent::delete()) {
487 $query =
"DELETE FROM il_wiki_data" .
488 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
492 include_once
"./Services/Notification/classes/class.ilNotification.php";
495 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
508 $ilDB = $DIC->database();
511 "SELECT id FROM il_wiki_data WHERE short = %s",
513 array($a_short_title)
602 private static function _lookup($a_wiki_id, $a_field)
606 $ilDB = $DIC->database();
608 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = " .
609 $ilDB->quote($a_wiki_id,
"integer");
611 $rec =
$ilDB->fetchAssoc($set);
612 return $rec[$a_field];
634 $ilDB = $DIC->database();
636 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
638 "UPDATE il_wiki_data SET " .
640 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
650 include_once
'Services/Search/classes/class.ilQueryParser.php';
653 $query_parser->setCombination(
"or");
654 $query_parser->parse();
656 include_once
'Services/Search/classes/class.ilSearchResult.php';
658 if ($query_parser->validate()) {
659 include_once
'Services/Search/classes/class.ilObjectSearchFactory.php';
661 $wiki_search->setFilter(
array(
'wpg'));
662 $search_result->mergeEntries($wiki_search->performSearch());
665 $entries = $search_result->getEntries();
667 $found_pages =
array();
668 foreach ($entries as $entry) {
669 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"])) {
670 foreach ($entry[
"child"] as $child) {
671 $found_pages[] =
array(
"page_id" => $child);
705 $ilDB = $DIC->database();
708 "SELECT * FROM il_wiki_imp_pages WHERE " .
709 " wiki_id = " .
$ilDB->quote($a_wiki_id,
"integer") .
" ORDER BY ord ASC " 712 $imp_pages =
array();
714 while ($rec =
$ilDB->fetchAssoc($set)) {
730 $ilDB = $DIC->database();
733 "SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE " .
734 " wiki_id = " .
$ilDB->quote($a_wiki_id,
"integer")
737 $rec =
$ilDB->fetchAssoc($set);
738 return (
int) $rec[
"m"];
756 $ilDB->manipulate(
"INSERT INTO il_wiki_imp_pages " .
757 "(wiki_id, ord, indent, page_id) VALUES (" .
758 $ilDB->quote($this->getId(),
"integer") .
"," .
759 $ilDB->quote($a_nr,
"integer") .
"," .
760 $ilDB->quote($a_indent,
"integer") .
"," .
761 $ilDB->quote($a_page_id,
"integer") .
777 "SELECT * FROM il_wiki_imp_pages WHERE " .
778 " wiki_id = " .
$ilDB->quote($this->getId(),
"integer") .
" AND " .
779 " page_id = " .
$ilDB->quote($a_page_id,
"integer")
781 if ($rec =
$ilDB->fetchAssoc($set)) {
797 "DELETE FROM il_wiki_imp_pages WHERE " 798 .
" wiki_id = " .
$ilDB->quote($this->getId(),
"integer")
799 .
" AND page_id = " .
$ilDB->quote($a_id,
"integer")
817 foreach ($ipages as $k => $v) {
818 if (isset($a_ord[$v[
"page_id"]])) {
819 $ipages[$k][
"ord"] = (int) $a_ord[$v[
"page_id"]];
821 if (isset($a_indent[$v[
"page_id"]])) {
822 $ipages[$k][
"indent"] = (int) $a_indent[$v[
"page_id"]];
830 foreach ($ipages as $k => $v) {
831 if ($ipages[$k][
"indent"] == 2 && $c_indent == 0) {
832 $ipages[$k][
"indent"] = 1;
835 $c_indent = $ipages[$k][
"indent"];
840 foreach ($ipages as $k => $v) {
842 $q =
"UPDATE il_wiki_imp_pages SET " .
843 " ord = " .
$ilDB->quote($ord,
"integer") .
"," .
844 " indent = " .
$ilDB->quote($v[
"indent"],
"integer") .
845 " WHERE wiki_id = " .
$ilDB->quote($v[
"wiki_id"],
"integer") .
846 " AND page_id = " .
$ilDB->quote($v[
"page_id"],
"integer")
866 foreach ($ipages as $k => $v) {
867 if ($ipages[$k][
"indent"] == 2 && $c_indent == 0) {
868 $ipages[$k][
"indent"] = 1;
871 $c_indent = $ipages[$k][
"indent"];
875 foreach ($ipages as $k => $v) {
877 $q =
"UPDATE il_wiki_imp_pages SET " .
878 " ord = " .
$ilDB->quote($ord,
"integer") .
879 ", indent = " .
$ilDB->quote($v[
"indent"],
"integer") .
880 " WHERE wiki_id = " .
$ilDB->quote($v[
"wiki_id"],
"integer") .
881 " AND page_id = " .
$ilDB->quote($v[
"page_id"],
"integer")
909 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())) {
935 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
939 $new_id = $style_obj->ilClone();
940 $new_obj->setStyleSheetId($new_id);
945 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
947 if (count($pages) > 0) {
951 $start_page->delete();
954 foreach ($pages as $p) {
957 $new_page->setTitle($page->getTitle());
958 $new_page->setWikiId($new_obj->getId());
959 $new_page->setTitle($page->getTitle());
960 $new_page->setBlocked($page->getBlocked());
961 $new_page->setRating($page->getRating());
962 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
965 $page->copy($new_page->getId(),
"", 0,
true);
969 $map[$p[
"id"]] = $new_page->getId();
974 $new_obj->addImportantPage($map[$ip[
"page_id"]], $ip[
"ord"], $ip[
"indent"]);
978 include_once(
"./Services/Rating/classes/class.ilRatingCategory.php");
981 $new_rc->setParentId($new_obj->getId());
982 $new_rc->setTitle($rc[
"title"]);
983 $new_rc->setDescription($rc[
"description"]);
999 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1019 if ($a_template_page == 0) {
1021 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1024 if (count($ts) == 1) {
1026 $a_template_page =
$t[
"wpage_id"];
1033 $page->setWikiId($this->
getId());
1036 $page->setRating(
true);
1040 $page->setWikiRefId($this->
getRefId());
1044 if ($a_template_page > 0) {
1046 $orig->copy($page->getId());
1049 include_once
"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1066 $lng = $DIC->language();
1068 if ($a_sub_type ==
"wpg") {
1069 $lng->loadLanguageModule(
"wiki");
1070 include_once
"./Modules/Wiki/classes/class.ilWikiPage.php";
1086 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1089 $user_export->initUserHTMLExport();
1103 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1106 $user_export->startUserHTMLExport();
1119 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1122 return $user_export->getProgress();
1133 include_once(
"./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1136 return $user_export->deliverFile();
1148 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
1151 return "<a href='" .
$url .
"'>" . $a_value .
"</a>";
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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.
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.
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.
foreach($_POST as $key=> $value) $res
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 getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
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.
update($pash, $contents, Config $config)
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.