56 $this->dom = $a_pg_obj->getDom();
59 die(
"Error: ilPageContent::init() did not set type");
70 $this->pg_obj = $a_val;
87 abstract public function init();
96 $this->type = $a_type;
116 $this->node = $a_node;
161 $this->hier_id = $a_hier_id;
178 return $this->node->get_attribute(
"HierId");
188 if (is_object($this->node)) {
189 return $this->node->get_attribute(
"HierId");
200 $this->pcid = $a_pcid;
220 $this->file_download_link = $a_download_link;
235 $this->profile_back_url =
$url;
250 $this->fullscreen_link = $a_fullscreen_link;
270 $this->sourcecode_download_script = $script_name;
291 if (is_object($this->node)) {
292 return $this->node->get_attribute(
"PCID");
301 if (is_object($this->node)) {
302 $this->node->set_attribute(
"PCID", $a_pc_id);
315 $id = explode(
"_", $ed_id);
316 $id[count($id) - 1]++;
318 return implode(
"_", $id);
330 $id = explode(
"_", $ed_id);
331 $id[count($id) - 1]--;
333 return implode(
"_", $id);
346 $id1 = explode(
"_", $ed_id1);
347 $id2 = explode(
"_", $ed_id1);
348 if (count($id1) == count($id2)) {
351 foreach ($id1 as $key => $id) {
352 if ($id != $id2[$key]) {
366 uasort($a_array, array(
"ilPageContent",
"isGreaterHierId"));
376 $a_arr = explode(
"_",
$a);
377 $b_arr = explode(
"_",
$b);
378 for (
$i = 0;
$i < count($a_arr);
$i++) {
379 if ((
int) $a_arr[
$i] > (int) $b_arr[
$i]) {
381 } elseif ((
int) $a_arr[$i] < (
int) $b_arr[$i]) {
396 if (is_object($this->node)) {
397 $this->node->set_attribute(
"Enabled", $value);
424 if (is_object($this->node) && $this->node->has_attribute(
"Enabled")) {
425 $compare = $this->node->get_attribute(
"Enabled");
430 return strcasecmp($compare,
"true") == 0;
438 $node = $this->dom->create_element(
"PageContent");
439 if ($a_set_this_node) {
460 public static function handleCopiedContent(DOMDocument $a_domdoc, $a_self_ass =
true, $a_clone_mobs =
false)
485 public static function afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
setPcId($a_pcid)
Set PC Id.
getSourcecodeDownloadScript()
Get sourcecode download script.
setNode($a_node)
Set xml node of page content.
static incEdId($ed_id)
Increases an hierarchical editing id at lowest level (last number)
lookupHierId()
Get hierarchical id from dom.
getOnloadCode($a_mode)
Get on load code.
disable()
Disable page content.
getType()
Get type of page content.
static sortHierIds($a_array)
Sort an array of Hier IDS in ascending order.
& getNode()
Get xml node of page content.
setEnabled($value)
Set Enabled value for page content component.
static getLangVars()
Get lang vars needed for editing.
$sourcecode_download_script
static beforePageDelete($a_page)
Before page is being deleted.
setType($a_type)
Set Type.
static haveSameContainer($ed_id1, $ed_id2)
Check, if two ids are in same container.
setFullscreenLink($a_fullscreen_link)
Set fullscreen link.
__construct($a_pg_obj)
Constructor.
enable()
Enable page content.
static handleCopiedContent(DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
Handle copied content.
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
isEnabled()
Check whether page content is enabled.
getJavascriptFiles($a_mode)
Get Javascript files.
setSourcecodeDownloadScript($script_name)
Set sourcecode download script.
static afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
After page history entry has been created.
writePCId($a_pc_id)
Write pc id.
modifyPageContentPostXsl($a_output, $a_mode, $a_abstract_only=false)
Modify page content after xsl.
getFullscreenLink()
Get fullscreen link.
getHierId()
Get hierarchical id.
setFileDownloadLink($a_download_link)
Set file download link.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
static decEdId($ed_id)
Decreases an hierarchical editing id at lowest level (last number)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
getCssFiles($a_mode)
Get css files.
static getLogger($a_component_id)
Get component logger.
getFileDownloadLink()
Get file download link.
static isGreaterHierId($a, $b)
Check whether Hier ID $a is greater than Hier ID $b.
setHierId($a_hier_id)
Set hierarchical ID in xml structure.