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;
90 $this->rating = $a_rating;
100 $this->rating_block = $a_rating;
110 $this->rating_new_pages = $a_rating;
120 $this->rating_categories = $a_rating;
130 $this->public_notes = $a_val;
150 $this->shorttitle = $a_shorttitle;
160 $this->introduction = $a_introduction;
170 $this->page_toc = $a_val;
180 $this->empty_page_templ = $a_val;
190 $this->link_md_values = $a_val;
199 bool $a_prevent_start_page_creation =
false 203 $id = parent::create();
205 $ilDB->insert(
"il_wiki_data", array(
206 "id" => array(
"integer", $this->
getId()),
207 "is_online" => array(
"integer", (
int) $this->
getOnline()),
210 "rating" => array(
"integer", (
int) $this->
getRating()),
211 "public_notes" => array(
"integer", (
int) $this->
getPublicNotes()),
217 if ($this->
getStartPage() !==
"" && !$a_prevent_start_page_creation) {
219 $start_page->setWikiId($this->
getId());
221 $start_page->create();
230 bool $a_prevent_start_page_creation =
false 234 if (!parent::update()) {
238 $ilDB->update(
"il_wiki_data", array(
239 "is_online" => array(
"integer", $this->
getOnline()),
243 "rating" => array(
"integer", $this->
getRating()),
249 "page_toc" => array(
"integer", $this->
getPageToc()),
253 "id" => array(
"integer", $this->
getId())
258 && !$a_prevent_start_page_creation) {
260 $start_page->setWikiId($this->
getId());
262 $start_page->setWikiRefId($this->
getRefId());
263 $start_page->create();
277 $query =
"SELECT * FROM il_wiki_data WHERE id = " .
279 $set =
$ilDB->query($query);
280 $rec =
$ilDB->fetchAssoc($set);
282 $this->
setOnline((
bool) $rec[
"is_online"]);
302 public function delete():
bool 307 if (!parent::delete()) {
312 $query =
"DELETE FROM il_wiki_data" .
313 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
314 $ilDB->manipulate($query);
325 string $a_short_title
328 $ilDB = $DIC->database();
330 if ($a_short_title ===
"") {
334 "SELECT id FROM il_wiki_data WHERE short = %s",
336 array($a_short_title)
350 return (
bool) self::_lookup($a_wiki_id,
"rating_overall");
358 return (
bool) self::_lookup($a_wiki_id,
"rating");
366 return (
bool) self::_lookup($a_wiki_id,
"rating_ext");
374 return (
bool) self::_lookup($a_wiki_id,
"rating_side");
382 return (
bool) self::_lookup($a_wiki_id,
"public_notes");
390 return (
bool) self::_lookup($a_wiki_id,
"link_md_values");
397 private static function _lookup(
int $a_wiki_id,
string $a_field)
401 $ilDB = $DIC->database();
403 $query =
"SELECT $a_field FROM il_wiki_data WHERE id = " .
404 $ilDB->quote($a_wiki_id,
"integer");
405 $set =
$ilDB->query($query);
406 $rec =
$ilDB->fetchAssoc($set);
407 return $rec[$a_field] ??
null;
412 return (
string) self::_lookup($a_wiki_id,
"startpage");
419 $ilDB = $DIC->database();
422 "UPDATE il_wiki_data SET " .
424 " WHERE id = " .
$ilDB->quote($a_id,
"integer")
437 $query_parser->setCombination(
"or");
438 $query_parser->parse();
441 if ($query_parser->validate()) {
443 $wiki_search->setFilter(array(
'wpg'));
444 $r = $wiki_search->performSearch();
445 $search_result->mergeEntries(
$r);
448 $entries = $search_result->getEntries();
450 $found_pages = array();
451 foreach ($entries as $entry) {
452 if ($entry[
"obj_id"] == $a_wiki_id && is_array($entry[
"child"])) {
453 foreach ($entry[
"child"] as $child) {
454 $found_pages[] = array(
"page_id" => $child);
467 "SELECT * FROM il_wiki_imp_pages WHERE " .
468 " wiki_id = " .
$ilDB->quote($this->getId(),
"integer") .
" AND " .
469 " page_id = " .
$ilDB->quote($a_page_id,
"integer")
471 if (
$ilDB->fetchAssoc($set)) {
485 return (
bool) self::_lookup($a_wiki_id,
"page_toc");
490 $new_obj = parent::cloneObject($target_id, $copy_id, $omit_tree);
506 if (!$cp_options->isRootNode($this->getRefId())) {
523 $this->content_style_service
525 ->cloneTo($new_obj->getId());
529 if (count($pages) > 0) {
533 $start_page->delete();
536 foreach ($pages as $p) {
538 $page->setWikiRefId($this->
getRefId());
540 $new_page->setWikiRefId($new_obj->getRefId());
541 $new_page->setTitle($page->getTitle());
542 $new_page->setWikiId($new_obj->getId());
543 $new_page->setTitle($page->getTitle());
544 $new_page->setBlocked($page->getBlocked());
545 $new_page->setRating($page->getRating());
546 $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
549 $page->copy($new_page->getId(),
"", 0,
true);
553 $map[$p[
"id"]] = $new_page->getId();
566 $imp_pages_manager = $this->domain->importantPage($this->
getRefId());
567 $imp_pages_manager->cloneTo($new_obj->getId(), $map);
573 $new_rc->setParentId($new_obj->getId());
574 $new_rc->setTitle((
string) $rc[
"title"]);
575 $new_rc->setDescription((
string) $rc[
"description"]);
584 foreach ($map as $old_page_id => $new_page_id) {
591 foreach ($targets as $t) {
592 if ((
int) $t[
"inst"] === 0 && in_array($t[
"type"], [
"wpag",
"wpage"]) && isset($map[(
int) $t[
"id"]])) {
594 if ($new_page->moveIntLinks([$t[
"id"] => $map[(
int) $t[
"id"]]])) {
595 $new_page->update(
true,
true);
623 string $a_page_title,
624 int $a_template_page = 0
627 if ($a_template_page === 0) {
631 if (count($ts) === 1) {
633 $a_template_page = $t[
"wpage_id"];
640 $page->setWikiId($this->
getId());
643 $page->setRating(
true);
647 $page->setWikiRefId($this->
getRefId());
651 if ($a_template_page > 0) {
653 $orig->copy($page->getId());
676 $lng = $DIC->language();
678 if ($a_sub_type ===
"wpg") {
686 bool $with_comments =
false 692 $user_export->initUserHTMLExport();
696 bool $with_comments =
false 702 $user_export->startUserHTMLExport();
710 bool $with_comments =
false 716 return $user_export->getProgress();
720 bool $with_comments =
false 726 $user_export->deliverFile();
739 return "<a href='" .
$url .
"'>" . $a_value .
"</a>";
752 if ($setting->
get(
"disable_comments")) {
759 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)
static getAllWikiPages(int $a_wiki_id, string $lang="-")
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)