26 protected \ILIAS\Notes\Service
$notes;
27 protected \ILIAS\Wiki\InternalDomainService
$domain;
48 bool $a_call_by_reference =
true 52 $this->domain = $DIC->wiki()->internal()->domain();
54 $this->db = $DIC->database();
55 $this->
user = $DIC->user();
57 $this->setting = $DIC->settings();
58 $this->notes = $DIC->notes();
61 $this->content_style_service = $DIC
68 $this->online = $a_online;
79 $this->rating_overall = $a_rating;
95 $this->rating = $a_rating;
105 $this->rating_block = $a_rating;
115 $this->rating_new_pages = $a_rating;
125 $this->rating_categories = $a_rating;
135 $this->public_notes = $a_val;
155 $this->shorttitle = $a_shorttitle;
165 $this->introduction = $a_introduction;
175 $this->page_toc = $a_val;
185 $this->empty_page_templ = $a_val;
195 $this->link_md_values = $a_val;
204 bool $a_prevent_start_page_creation =
false 208 $id = parent::create();
210 $ilDB->insert(
"il_wiki_data", array(
211 "id" => array(
"integer", $this->
getId()),
212 "is_online" => array(
"integer", (
int) $this->
getOnline()),
216 "public_notes" => array(
"integer", (
int) $this->
getPublicNotes()),
222 if ($this->
getStartPage() !==
"" && !$a_prevent_start_page_creation) {
224 $start_page->setWikiId($this->
getId());
226 $start_page->create();
235 bool $a_prevent_start_page_creation =
false 239 if (!parent::update()) {
243 $ilDB->update(
"il_wiki_data", array(
244 "is_online" => array(
"integer", $this->
getOnline()),
254 "page_toc" => array(
"integer", $this->
getPageToc()),
258 "id" => array(
"integer", $this->
getId())
263 && !$a_prevent_start_page_creation) {
265 $start_page->setWikiId($this->
getId());
267 $start_page->setWikiRefId($this->
getRefId());
268 $start_page->create();
281 $query =
"SELECT * FROM il_wiki_data WHERE id = " .
283 $set =
$ilDB->query($query);
284 $rec =
$ilDB->fetchAssoc($set);
286 $this->
setOnline((
bool) $rec[
"is_online"]);
306 public function delete():
bool 311 if (!parent::delete()) {
316 $query =
"DELETE FROM il_wiki_data" .
317 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
318 $ilDB->manipulate($query);
329 string $a_short_title
332 $ilDB = $DIC->database();
334 if ($a_short_title ===
"") {
338 "SELECT id FROM il_wiki_data WHERE short = %s",
340 array($a_short_title)
354 return (
bool) self::_lookup($a_wiki_id,
"rating_overall");
362 return (
bool) self::_lookup($a_wiki_id,
"rating");
370 return (
bool) self::_lookup($a_wiki_id,
"rating_ext");
378 return (
bool) self::_lookup($a_wiki_id,
"rating_side");
386 return (
bool) self::_lookup($a_wiki_id,
"public_notes");
394 return (
bool) self::_lookup($a_wiki_id,
"link_md_values");
401 private static function _lookup(
int $a_wiki_id,
string $a_field)
405 $ilDB = $DIC->database();
407 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = " .
408 $ilDB->quote($a_wiki_id,
"integer");
409 $set =
$ilDB->query($query);
410 $rec =
$ilDB->fetchAssoc($set);
411 return $rec[$a_field] ??
null;
416 return (
string) self::_lookup($a_wiki_id,
"startpage");
423 $ilDB = $DIC->database();
426 "UPDATE il_wiki_data SET " .
428 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
441 $query_parser->setCombination(
"or");
442 $query_parser->parse();
445 if ($query_parser->validate()) {
447 $wiki_search->setFilter(array(
'wpg'));
448 $r = $wiki_search->performSearch();
449 $search_result->mergeEntries(
$r);
452 $entries = $search_result->getEntries();
454 $found_pages = array();
455 foreach ($entries as $entry) {
456 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"])) {
457 foreach ($entry[
"child"] as $child) {
458 $found_pages[] = array(
"page_id" => $child);
471 "SELECT * FROM il_wiki_imp_pages WHERE " .
472 " wiki_id = " .
$ilDB->quote($this->getId(),
"integer") .
" AND " .
473 " page_id = " .
$ilDB->quote($a_page_id,
"integer")
475 if (
$ilDB->fetchAssoc($set)) {
489 return (
bool) self::_lookup($a_wiki_id,
"page_toc");
494 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
510 if (!$cp_options->isRootNode($this->getRefId())) {
526 $this->content_style_service
528 ->cloneTo($new_obj->getId());
532 if (count($pages) > 0) {
536 $start_page->delete();
539 foreach ($pages as $p) {
541 $page->setWikiRefId($this->
getRefId());
543 $new_page->setWikiRefId($new_obj->getRefId());
544 $new_page->setTitle($page->getTitle());
545 $new_page->setWikiId($new_obj->getId());
546 $new_page->setTitle($page->getTitle());
547 $new_page->setBlocked($page->getBlocked());
548 $new_page->setRating($page->getRating());
549 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
552 $page->copy($new_page->getId(),
"", 0,
true);
556 $map[$p[
"id"]] = $new_page->getId();
569 $imp_pages_manager = $this->domain->importantPage($this->
getRefId());
570 $imp_pages_manager->cloneTo($new_obj->getId(), $map);
576 $new_rc->setParentId($new_obj->getId());
577 $new_rc->setTitle((
string) $rc[
"title"]);
578 $new_rc->setDescription((
string) $rc[
"description"]);
587 foreach ($map as $old_page_id => $new_page_id) {
594 foreach ($targets as $t) {
595 if ((
int) $t[
"inst"] === 0 && in_array($t[
"type"], [
"wpag",
"wpage"]) && isset($map[(
int) $t[
"id"]])) {
597 if ($new_page->moveIntLinks([$t[
"id"] => $map[(
int) $t[
"id"]]])) {
598 $new_page->update(
true,
true);
626 string $a_page_title,
627 int $a_template_page = 0
630 if ($a_template_page === 0) {
634 if (count($ts) === 1) {
636 $a_template_page = $t[
"wpage_id"];
643 $page->setWikiId($this->
getId());
646 $page->setRating(
true);
650 $page->setWikiRefId($this->
getRefId());
654 if ($a_template_page > 0) {
656 $orig->copy($page->getId());
679 $lng = $DIC->language();
681 if ($a_sub_type ===
"wpg") {
689 bool $with_comments =
false 695 $user_export->initUserHTMLExport();
699 bool $with_comments =
false 705 $user_export->startUserHTMLExport();
713 bool $with_comments =
false 719 return $user_export->getProgress();
723 bool $with_comments =
false 729 $user_export->deliverFile();
742 return "<a href='" .
$url .
"'>" . $a_value .
"</a>";
755 if ($setting->
get(
"disable_comments")) {
762 if (!$privacy->enabledCommentsExport()) {
setOnline(bool $a_online)
static _getTargetsOfSource(string $a_source_type, int $a_source_id, string $a_source_lang="-")
Get all targets of a source object (e.g., a page)
setStartPage(string $a_startpage)
get(string $a_keyword, ?string $a_default_value=null)
get setting
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setRatingOverall(bool $a_rating)
__construct(int $a_id=0, bool $a_call_by_reference=true)
setRatingAsBlock(bool $a_rating)
static _lookupRatingAsBlock(int $a_wiki_id)
Lookup whether rating side block is activated.
initUserHTMLExport(bool $with_comments=false)
static _lookup(int $a_wiki_id, string $a_field)
Lookup a data field.
static _getWikiContentSearchInstance(ilQueryParser $query_parser)
static lookupTitle(int $a_page_id, string $lang="-")
getTemplateSelectionOnCreation(string $lang="-")
Get template selection on creation? If more than one template (including empty page template) is acti...
static _lookupPageToc(int $a_wiki_id)
update(bool $a_prevent_start_page_creation=false)
isImportantPage(int $a_page_id)
create(bool $a_prevent_start_page_creation=false)
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
loadLanguageModule(string $a_module)
Load language module.
static _lookupRatingCategories(int $a_wiki_id)
Lookup whether rating categories are activated.
setLinkMetadataValues(bool $a_val)
ILIAS Notes Service $notes
static getAdvMDSubItemTitle(int $a_obj_id, string $a_sub_type, int $a_sub_id)
updateInternalLinksOnCopy(array $map)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isCommentsExportPossible()
Is export possible.
Class manages user html export.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
createWikiPage(string $a_page_title, int $a_template_page=0)
Create new wiki page.
getUserHTMLExportProgress(bool $with_comments=false)
Get user html export progress.
setRatingCategories(bool $a_rating)
static checkShortTitleAvailability(string $a_short_title)
setPublicNotes(bool $a_val)
static exists(int $a_wiki_id, string $a_title, string $lang="-")
Checks whether a page with given title exists.
startUserHTMLExport(bool $with_comments=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllForObject(int $a_parent_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static writeStartPage(int $a_id, string $a_name)
static _lookupStartPage(int $a_wiki_id)
decorateAdvMDValue(string $a_value)
Decorate adv md value.
static deleteAllPagesOfWiki(int $a_wiki_id)
ILIAS Wiki InternalDomainService $domain
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
setEmptyPageTemplate(bool $a_val)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
setRating(bool $a_rating)
ILIAS Style Content DomainService $content_style_service
static _cloneValues(int $copy_id, int $a_source_id, int $a_target_id, ?string $a_sub_type=null, ?int $a_source_sub_id=null, ?int $a_target_sub_id=null)
Clone Advanced Meta Data.
setRatingForNewPages(bool $a_rating)
static makeDbTitle(string $a_par)
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
static _lookupRatingOverall(int $a_wiki_id)
Lookup whether rating is activated for whole object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static removeForObject(int $type, int $id)
Remove all notifications for given object.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
static _lookupLinkMetadataValues(int $a_wiki_id)
Lookup whether metadata should be auto linked.
setIntroduction(string $a_introduction)
static _getInstance(int $a_copy_id)
setShortTitle(string $a_shorttitle)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
deliverUserHTMLExport(bool $with_comments=false)
setRatingPages(bool $a_rating)
static getAllWikiPages(int $a_wiki_id, string $lang="-")
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...