19declare(strict_types=1);
37 public function init(): void
41 $this->
lng = $DIC->language();
43 $this->
access = $DIC->access();
60 $this->setContentIncludeAttribute(
"ContentId", (
string) $a_id);
68 return (
int) $this->getContentIncludeAttribute(
"ContentId");
76 $this->setContentIncludeAttribute(
"ContentType", $a_type);
84 return $this->getContentIncludeAttribute(
"ContentType");
92 $this->setContentIncludeAttribute(
"InstId", $a_id);
100 return $this->getContentIncludeAttribute(
"InstId");
110 if (!empty($a_value)) {
111 $this->getChildNode()->setAttribute($a_attr, $a_value);
113 if ($this->getChildNode()->hasAttribute($a_attr)) {
114 $this->getChildNode()->removeAttribute($a_attr);
124 if (is_object($this->getChildNode())) {
125 return $this->getChildNode()->getAttribute($a_attr);
135 DOMDocument $a_domdoc,
140 self::saveContentIncludeUsage($a_page, $a_domdoc);
156 DOMDocument $a_old_domdoc,
160 self::saveContentIncludeUsage($a_page, $a_old_domdoc, $a_old_nr);
168 DOMDocument $a_domdoc,
171 $ci_ids = self::collectContentIncludes($a_page, $a_domdoc);
173 foreach ($ci_ids as $ci_id) {
174 if ((
int) $ci_id[
"inst_id"] <= 0 || $ci_id[
"inst_id"] ==
IL_INST_ID) {
192 DOMDocument $a_domdoc
194 $xpath = new DOMXPath($a_domdoc);
195 $nodes = $xpath->query(
'//ContentInclude');
198 foreach ($nodes as $node) {
199 $type = $node->getAttribute(
"ContentType");
200 $id = $node->getAttribute(
"ContentId");
201 $inst_id = $node->getAttribute(
"InstId");
202 $ci_ids[$type .
":" .
$id .
":" . $inst_id] = array(
203 "type" => $type,
"id" =>
$id,
"inst_id" => $inst_id);
212 bool $a_abstract_only =
false
217 $start = strpos($a_output,
"{{{{{ContentInclude;");
218 if (is_int($start)) {
219 $end = strpos($a_output,
"}}}}}", $start);
222 $parent_lang = $this->getPage()->getLanguage();
223 if ($parent_lang ==
"-" && $this->getPage()->getConcreteLang() !=
"") {
224 $parent_lang = $this->getPage()->getConcreteLang();
227 $param = substr($a_output, $start + 20, $end - $start - 20);
232 $snippet_lang = $parent_lang;
238 if ($a_mode !=
"offline") {
239 $page_gui->setFileDownloadLink($this->getFileDownloadLink());
240 $page_gui->setProfileBackUrl($this->getProfileBackUrl());
241 $page_gui->setFullscreenLink($this->getFullscreenLink() .
"&pg_type=mep");
242 $page_gui->setSourcecodeDownloadScript($this->getSourcecodeDownloadScript());
247 $html = $page_gui->getRawContent();
248 if ($a_mode ==
"edit") {
249 $par_id = $page_gui->getPageObject()->getParentId();
252 if ($this->
access->checkAccess(
"write",
"", $ref_id)) {
257 $html =
'<p class="small light">' .
$lng->txt(
"copg_snippet_cannot_be_edited") .
$info .
'</p>' . $html;
260 if ($a_mode ==
"edit") {
262 $html =
"// " .
$lng->txt(
"cont_missing_snippet") .
" //";
264 $html =
"// " .
$lng->txt(
"cont_snippet_from_another_installation") .
" //";
268 $h2 = substr($a_output, 0, $start) .
270 substr($a_output, $end + 5);
275 $start = strpos($a_output,
"{{{{{ContentInclude;", $start + 5);
277 if (is_int($start)) {
278 $end = strpos($a_output,
"}}}}}", $start);
288 int $delete_lower_than_nr
292 $usage_repo =
$DIC->copage()
297 $usage_repo->deleteHistoryUsagesLowerEqualThan(
299 $parent_type .
":pg",
301 $delete_lower_than_nr,
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class ilMediaPoolPage GUI class.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
Class ilPCContentInclude.
getContentIncludeAttribute(string $a_attr)
Get content include tag attribute.
setContentId(int $a_id)
Set content id.
static deleteHistoryLowerEqualThan(string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
Overwrite in derived classes, if old history entries are being deleted.
getContentId()
Get content id.
static collectContentIncludes(ilPageObject $a_page, DOMDocument $a_domdoc)
get all content includes that are used within the page
static saveContentIncludeUsage(ilPageObject $a_page, DOMDocument $a_domdoc, int $a_old_nr=0)
save content include usages
modifyPageContentPostXsl(string $a_output, string $a_mode, bool $a_abstract_only=false)
Modify page content after xsl.
setInstId(string $a_id)
Set installation id.
getInstId()
Get installation id.
static beforePageDelete(ilPageObject $a_page)
Before page is being deleted.
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
getContentType()
Get content type.
setContentIncludeAttribute(string $a_attr, string $a_value)
Set attribute of content include tag.
static afterPageHistoryEntry(ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
After page history entry has been created.
init()
Init page content component.
static afterPageUpdate(ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
After page has been updated (or created)
setContentType(string $a_type)
Set content type.
static saveUsage(string $a_pc_type, int $a_pc_id, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")
static deleteAllUsages(string $a_pc_type, string $a_usage_type, int $a_usage_id, int $a_usage_hist_nr=0, string $a_lang="-")
Content object of ilPageObject (see ILIAS DTD).
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])
setType(string $a_type)
Set Type.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
if(!file_exists('../ilias.ini.php'))