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();
231 parent::createMetaData();
237 bool $a_prevent_start_page_creation =
false
241 if (!parent::update()) {
245 $ilDB->update(
"il_wiki_data", array(
246 "is_online" => array(
"integer", $this->getOnline()),
247 "startpage" => array(
"text", $this->getStartPage()),
248 "short" => array(
"text", $this->getShortTitle()),
249 "rating_overall" => array(
"integer", $this->getRatingOverall()),
250 "rating" => array(
"integer", $this->getRatingPages()),
251 "rating_side" => array(
"integer", $this->getRatingAsBlock()),
252 "rating_new" => array(
"integer", $this->getRatingForNewPages()),
253 "rating_ext" => array(
"integer", $this->getRatingCategories()),
254 "public_notes" => array(
"integer", $this->getPublicNotes()),
255 "introduction" => array(
"clob", $this->getIntroduction()),
256 "page_toc" => array(
"integer", $this->getPageToc()),
257 "link_md_values" => array(
"integer", $this->getLinkMetadataValues()),
258 "empty_page_templ" => array(
"integer", $this->getEmptyPageTemplate())
260 "id" => array(
"integer", $this->
getId())
265 && !$a_prevent_start_page_creation) {
267 $start_page->setWikiId($this->
getId());
268 $start_page->setTitle($this->getStartPage());
269 $start_page->setWikiRefId($this->getRefId());
270 $start_page->create();
272 $this->notes->domain()->activateComments($this->
getId(), $this->getPublicNotes());
274 parent::updateMetaData();
285 $query =
"SELECT * FROM il_wiki_data WHERE id = " .
287 $set =
$ilDB->query($query);
288 $rec =
$ilDB->fetchAssoc($set);
290 $this->setOnline((
bool) $rec[
"is_online"]);
291 $this->setStartPage((
string) $rec[
"startpage"]);
292 $this->setShortTitle((
string) $rec[
"short"]);
293 $this->setRatingOverall((
bool) $rec[
"rating_overall"]);
294 $this->setRatingPages((
bool) $rec[
"rating"]);
295 $this->setRatingAsBlock((
bool) $rec[
"rating_side"]);
296 $this->setRatingForNewPages((
bool) $rec[
"rating_new"]);
297 $this->setRatingCategories((
bool) $rec[
"rating_ext"]);
299 $this->setIntroduction((
string) $rec[
"introduction"]);
300 $this->setPageToc((
bool) $rec[
"page_toc"]);
301 $this->setEmptyPageTemplate((
bool) $rec[
"empty_page_templ"]);
302 $this->setLinkMetadataValues((
bool) $rec[
"link_md_values"]);
303 $this->setPublicNotes($this->notes->domain()->commentsActive($this->getId()));
310 public function delete():
bool
315 if (!parent::delete()) {
320 $query =
"DELETE FROM il_wiki_data" .
321 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
322 $ilDB->manipulate($query);
329 parent::deleteMetaData();
335 string $a_short_title
340 if ($a_short_title ===
"") {
344 "SELECT id FROM il_wiki_data WHERE short = %s",
346 array($a_short_title)
360 return (
bool) self::_lookup($a_wiki_id,
"rating_overall");
368 return (
bool) self::_lookup($a_wiki_id,
"rating");
376 return (
bool) self::_lookup($a_wiki_id,
"rating_ext");
384 return (
bool) self::_lookup($a_wiki_id,
"rating_side");
392 return (
bool) self::_lookup($a_wiki_id,
"public_notes");
400 return (
bool) self::_lookup($a_wiki_id,
"link_md_values");
407 private static function _lookup(
int $a_wiki_id,
string $a_field)
413 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = " .
414 $ilDB->quote($a_wiki_id,
"integer");
415 $set =
$ilDB->query($query);
416 $rec =
$ilDB->fetchAssoc($set);
417 return $rec[$a_field] ??
null;
422 return (
string) self::_lookup($a_wiki_id,
"startpage");
432 "UPDATE il_wiki_data SET " .
434 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
448 $query_parser->parse();
451 if ($query_parser->validate()) {
453 $wiki_search->setFilter(array(
'wpg'));
454 $r = $wiki_search->performSearch();
455 $search_result->mergeEntries($r);
458 $entries = $search_result->getEntries();
460 $found_pages = array();
461 foreach ($entries as $entry) {
462 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"])) {
463 foreach ($entry[
"child"] as $child) {
464 $found_pages[] = array(
"page_id" => $child);
477 "SELECT * FROM il_wiki_imp_pages WHERE " .
478 " wiki_id = " .
$ilDB->quote($this->getId(),
"integer") .
" AND " .
479 " page_id = " .
$ilDB->quote($a_page_id,
"integer")
481 if (
$ilDB->fetchAssoc($set)) {
495 return (bool) self::_lookup($a_wiki_id,
"page_toc");
500 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
516 if (!$cp_options->isRootNode($this->getRefId())) {
517 $new_obj->setOnline($this->getOnline());
521 $new_obj->setStartPage($this->getStartPage());
522 $new_obj->setShortTitle($this->getShortTitle());
523 $new_obj->setRatingOverall($this->getRatingOverall());
524 $new_obj->setRatingPages($this->getRatingPages());
525 $new_obj->setRatingAsBlock($this->getRatingAsBlock());
526 $new_obj->setRatingForNewPages($this->getRatingForNewPages());
527 $new_obj->setRatingCategories($this->getRatingCategories());
528 $new_obj->setPublicNotes($this->getPublicNotes());
529 $new_obj->setIntroduction($this->getIntroduction());
530 $new_obj->setPageToc($this->getPageToc());
532 $this->content_style_service
533 ->styleForRefId($this->getRefId())
534 ->cloneTo($new_obj->getId());
538 if (count($pages) > 0) {
542 $start_page->delete();
545 foreach ($pages as $p) {
547 $page->setWikiRefId($this->getRefId());
549 $new_page->setWikiRefId($new_obj->getRefId());
550 $new_page->setTitle($page->getTitle());
551 $new_page->setWikiId($new_obj->getId());
552 $new_page->setTitle($page->getTitle());
553 $new_page->setBlocked($page->getBlocked());
554 $new_page->setRating($page->getRating());
555 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
558 $page->copy($new_page->getId(),
"", 0,
true);
562 $map[$p[
"id"]] = $new_page->getId();
575 $imp_pages_manager = $this->domain->importantPage($this->getRefId());
576 $imp_pages_manager->cloneTo($new_obj->getId(), $map);
577 $this->updateInternalLinksOnCopy($map);
582 $new_rc->setParentId($new_obj->getId());
583 $new_rc->setTitle((
string) $rc[
"title"]);
584 $new_rc->setDescription((
string) $rc[
"description"]);
588 parent::cloneMetaData($new_obj);
595 foreach ($map as $old_page_id => $new_page_id) {
602 foreach ($targets as $t) {
603 if ((
int) $t[
"inst"] === 0 && in_array($t[
"type"], [
"wpag",
"wpage"]) && isset($map[(
int) $t[
"id"]])) {
605 if ($new_page->moveIntLinks([$t[
"id"] => $map[(
int) $t[
"id"]]])) {
606 $new_page->update(
true,
true);
620 $num = (
int) $this->getEmptyPageTemplate();
634 string $a_page_title,
635 int $a_template_page = 0
638 if ($a_template_page === 0) {
639 if (!$this->getEmptyPageTemplate()) {
642 if (count($ts) === 1) {
644 $a_template_page = $t[
"wpage_id"];
651 $page->setWikiId($this->
getId());
653 if ($this->getRatingPages() && $this->getRatingForNewPages()) {
654 $page->setRating(
true);
658 $page->setWikiRefId($this->getRefId());
662 if ($a_template_page > 0) {
664 $orig->copy($page->getId());
689 if ($a_sub_type ===
"wpg") {
690 $lng->loadLanguageModule(
"wiki");
697 bool $with_comments =
false
700 $ilUser = $this->user;
703 $user_export->initUserHTMLExport();
707 bool $with_comments =
false
710 $ilUser = $this->user;
713 $user_export->startUserHTMLExport();
721 bool $with_comments =
false
724 $ilUser = $this->user;
727 return $user_export->getProgress();
731 bool $with_comments =
false
734 $ilUser = $this->user;
737 $user_export->deliverFile();
750 return "<a href='" .
$url .
"'>" . $a_value .
"</a>";
761 $setting = $this->setting;
763 if ($setting->
get(
"disable_comments")) {
767 if (!$this->getPublicNotes()) {
770 if (!$privacy->enabledCommentsExport()) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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.
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static _getInstance(int $a_copy_id)
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)
static removeForObject(int $type, int $id)
Remove all notifications for given object.
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLinkMetadataValues(bool $a_val)
decorateAdvMDValue(string $a_value)
Decorate adv md value.
setRatingAsBlock(bool $a_rating)
static checkShortTitleAvailability(string $a_short_title)
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
isCommentsExportPossible()
Is export possible.
setRating(bool $a_rating)
static _lookupPageToc(int $a_wiki_id)
static writeStartPage(int $a_id, string $a_name)
setOnline(bool $a_online)
ILIAS Notes Service $notes
static _lookupStartPage(int $a_wiki_id)
ILIAS Style Content DomainService $content_style_service
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
setRatingPages(bool $a_rating)
getTemplateSelectionOnCreation(string $lang="-")
Get template selection on creation? If more than one template (including empty page template) is acti...
setStartPage(string $a_startpage)
setIntroduction(string $a_introduction)
setEmptyPageTemplate(bool $a_val)
deliverUserHTMLExport(bool $with_comments=false)
isImportantPage(int $a_page_id)
getUserHTMLExportProgress(bool $with_comments=false)
Get user html export progress.
update(bool $a_prevent_start_page_creation=false)
setRatingForNewPages(bool $a_rating)
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
updateInternalLinksOnCopy(array $map)
static _lookupRatingCategories(int $a_wiki_id)
Lookup whether rating categories are activated.
ILIAS Wiki InternalDomainService $domain
static _lookupRatingAsBlock(int $a_wiki_id)
Lookup whether rating side block is activated.
setPublicNotes(bool $a_val)
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
static _lookupLinkMetadataValues(int $a_wiki_id)
Lookup whether metadata should be auto linked.
setShortTitle(string $a_shorttitle)
create(bool $a_prevent_start_page_creation=false)
setRatingOverall(bool $a_rating)
setRatingCategories(bool $a_rating)
createWikiPage(string $a_page_title, int $a_template_page=0)
Create new wiki page.
__construct(int $a_id=0, bool $a_call_by_reference=true)
startUserHTMLExport(bool $with_comments=false)
static _lookup(int $a_wiki_id, string $a_field)
Lookup a data field.
static getAdvMDSubItemTitle(int $a_obj_id, string $a_sub_type, int $a_sub_id)
static _lookupRatingOverall(int $a_wiki_id)
Lookup whether rating is activated for whole object.
initUserHTMLExport(bool $with_comments=false)
static _getWikiContentSearchInstance(ilQueryParser $query_parser)
Class ilObject Basic functions for all objects.
setCombination(string $a_combination)
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...
get(string $a_keyword, ?string $a_default_value=null)
get setting
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static exists(int $a_wiki_id, string $a_title, string $lang="-")
Checks whether a page with given title exists.
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static lookupTitle(int $a_page_id, string $lang="-")
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
static deleteAllPagesOfWiki(int $a_wiki_id)
static getAllWikiPages(int $a_wiki_id, string $lang="-")
Class manages user html export.
static makeDbTitle(string $a_par)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))