19 declare(strict_types=1);
51 $this->wiki = $this->wiki_domain->object($ref_id);
56 return $this->wiki_domain->getObjId($this->wiki_ref_id);
63 int $template_page = 0
75 if ($template_page === 0) {
76 if (!$this->wiki->getEmptyPageTemplate()) {
77 $wt = new \ilWikiPageTemplate($this->
getWikiId());
79 if (count($ts) === 1) {
81 $template_page = (
int) $t[
"wpage_id"];
88 $page = new \ilWikiPage(0);
90 $page->setWikiRefId($this->wiki_ref_id);
92 if ($this->wiki->getRating() && $this->wiki->getRatingForNewPages()) {
93 $page->setRating(
true);
98 $orig_page = $this->page_domain->getWikiPage($this->wiki_ref_id, $wpg_id, 0,
"-");
99 $orig_page->copyPageToTranslation(
$lang);
101 $page = $this->page_domain->getWikiPage($this->wiki_ref_id, $wpg_id, 0,
$lang);
107 if ($template_page > 0) {
108 $t_page = $this->page_domain->getWikiPage($this->wiki_ref_id, $template_page, 0,
$lang);
111 $page->getParentType(),
112 $page->getParentId(),
130 return $page->getId();
138 return $this->page_repo->getWikiPages(
149 return $this->page_repo->getInfoOfSelected(
161 return $this->page_repo->getMasterPagesWithoutTranslation(
172 return $this->page_repo->getAllPagesInfo(
182 return $this->page_repo->getRecentChanges(
192 return $this->page_repo->getNewPages(
202 return $this->page_repo->getPopularPages(
212 return $this->page_repo->getLanguages($wpg_id);
220 $starting_page_id = $this->wiki_domain->getStartingPageId($this->wiki_ref_id);
225 foreach ($sources as $source) {
226 if ($source[
"type"] ===
"wpg:pg") {
227 $ids[] = $source[
"id"];
232 if (count($ids) === 0 || !$this->page_repo->doesAtLeastOnePageExist($this->
getWikiId(), $ids)) {
236 if ($pi->getId() !== $starting_page_id) {
246 return $this->page_repo->getPageIdForTitle(
258 return \ilLink::_getStaticLink(
262 "wpage_" . $id .
"_" . $this->wiki_ref_id .
$lang 272 return \ilLink::_getStaticLink(
280 return $this->page_repo->exists($id,
$lang);
287 return $this->page_repo->existsByTitle($this->
getWikiId(), $title,
$lang);
292 return $this->page_repo->getTitle($id,
$lang);
298 return $this->page_repo->getWikiIdByPageId($id) === $this->
getWikiId();
__construct(InternalDataService $data_service, PageDBRepository $page_repo, \ILIAS\Wiki\Wiki\DomainService $wiki_domain, DomainService $page_domain, int $ref_id)
getInfoOfSelected(array $ids, string $lang="-")
Wiki internal data service.
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
Interface Observer Contains several chained tasks and infos about them.
PageDBRepository $page_repo
getPermaLinkByTitle(string $title, string $lang="-")
getWikiPages(string $lang="-")
DomainService $page_domain
getMasterPagesWithoutTranslation(string $trans)
ILIAS Wiki Wiki DomainService $wiki_domain
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getLanguages(int $wpg_id)
createWikiPage(string $title, int $wpg_id=0, string $lang="-", int $template_page=0)
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 makeDbTitle(string $a_par)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getPageIdForTitle(string $title, string $lang="-")
InternalDataService $data_service
exists(int $id, string $lang="-")
getTitle(int $id, string $lang="-")
existsByTitle(string $title, string $lang="-")
getPermaLink(int $id, string $lang="-")