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");
403 private static function _lookup(
int $a_wiki_id,
string $a_field): ?string
409 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = " .
410 $ilDB->quote($a_wiki_id,
"integer");
411 $set =
$ilDB->query($query);
412 $rec =
$ilDB->fetchAssoc($set);
413 return $rec[$a_field] ??
null;
418 return (
string) self::_lookup($a_wiki_id,
"startpage");
428 "UPDATE il_wiki_data SET " .
430 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
444 $query_parser->parse();
447 if ($query_parser->validate()) {
449 $wiki_search->setFilter(array(
'wpg'));
450 $r = $wiki_search->performSearch();
451 $search_result->mergeEntries($r);
454 $entries = $search_result->getEntries();
456 $found_pages = array();
457 foreach ($entries as $entry) {
458 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"])) {
459 foreach ($entry[
"child"] as $child) {
460 $found_pages[] = array(
"page_id" => $child);
473 "SELECT * FROM il_wiki_imp_pages WHERE " .
474 " wiki_id = " .
$ilDB->quote($this->getId(),
"integer") .
" AND " .
475 " page_id = " .
$ilDB->quote($a_page_id,
"integer")
477 if (
$ilDB->fetchAssoc($set)) {
491 return (bool) self::_lookup($a_wiki_id,
"page_toc");
496 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
512 if (!$cp_options->isRootNode($this->getRefId())) {
513 $new_obj->setOnline($this->getOnline());
517 $new_obj->setStartPage($this->getStartPage());
518 $new_obj->setShortTitle($this->getShortTitle());
519 $new_obj->setRatingOverall($this->getRatingOverall());
520 $new_obj->setRatingPages($this->getRatingPages());
521 $new_obj->setRatingAsBlock($this->getRatingAsBlock());
522 $new_obj->setRatingForNewPages($this->getRatingForNewPages());
523 $new_obj->setRatingCategories($this->getRatingCategories());
524 $new_obj->setPublicNotes($this->getPublicNotes());
525 $new_obj->setIntroduction($this->getIntroduction());
526 $new_obj->setPageToc($this->getPageToc());
528 $this->content_style_service
529 ->styleForRefId($this->getRefId())
530 ->cloneTo($new_obj->getId());
534 if (count($pages) > 0) {
538 $start_page->delete();
541 foreach ($pages as $p) {
543 $page->setWikiRefId($this->getRefId());
545 $new_page->setWikiRefId($new_obj->getRefId());
546 $new_page->setTitle($page->getTitle());
547 $new_page->setWikiId($new_obj->getId());
548 $new_page->setTitle($page->getTitle());
549 $new_page->setBlocked($page->getBlocked());
550 $new_page->setRating($page->getRating());
551 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
554 $page->copy($new_page->getId(),
"", 0,
true);
558 $map[$p[
"id"]] = $new_page->getId();
571 $imp_pages_manager = $this->domain->importantPage($this->getRefId());
572 $imp_pages_manager->cloneTo($new_obj->getId(), $map);
573 $this->updateInternalLinksOnCopy($map);
578 $new_rc->setParentId($new_obj->getId());
579 $new_rc->setTitle((
string) $rc[
"title"]);
580 $new_rc->setDescription((
string) $rc[
"description"]);
584 parent::cloneMetaData($new_obj);
591 foreach ($map as $old_page_id => $new_page_id) {
598 foreach ($targets as $t) {
599 if ((
int) $t[
"inst"] === 0 && in_array($t[
"type"], [
"wpag",
"wpage"]) && isset($map[(
int) $t[
"id"]])) {
601 if ($new_page->moveIntLinks([$t[
"id"] => $map[(
int) $t[
"id"]]])) {
602 $new_page->update(
true,
true);
616 $num = (
int) $this->getEmptyPageTemplate();
630 string $a_page_title,
631 int $a_template_page = 0
634 if ($a_template_page === 0) {
635 if (!$this->getEmptyPageTemplate()) {
638 if (count($ts) === 1) {
640 $a_template_page = $t[
"wpage_id"];
647 $page->setWikiId($this->
getId());
649 if ($this->getRatingPages() && $this->getRatingForNewPages()) {
650 $page->setRating(
true);
654 $page->setWikiRefId($this->getRefId());
658 if ($a_template_page > 0) {
660 $orig->copy($page->getId());
685 if ($a_sub_type ===
"wpg") {
686 $lng->loadLanguageModule(
"wiki");
693 bool $with_comments =
false
696 $ilUser = $this->user;
699 $user_export->initUserHTMLExport();
703 bool $with_comments =
false
706 $ilUser = $this->user;
709 $user_export->startUserHTMLExport();
717 bool $with_comments =
false
720 $ilUser = $this->user;
723 return $user_export->getProgress();
727 bool $with_comments =
false
730 $ilUser = $this->user;
733 $user_export->deliverFile();
746 return "<a href='" .
$url .
"'>" . $a_value .
"</a>";
757 $setting = $this->setting;
759 if ($setting->
get(
"disable_comments")) {
763 if (!$this->getPublicNotes()) {
766 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)
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'))