4require_once(
"./Services/COPage/classes/class.ilPageContent.php");
 
   38        $this->lng = 
$DIC->language();
 
   40        $this->access = 
$DIC->access();
 
   48        parent::setNode($a_node);               
 
   49        $this->incl_node = $a_node->first_child();              
 
   58    public function create(&$a_pg_obj, $a_hier_id, $a_pc_id = 
"")
 
   62        $this->incl_node = $this->dom->create_element(
"ContentInclude");
 
   63        $this->incl_node = $this->node->append_child($this->incl_node);
 
  122        if (!empty($a_value)) {
 
  123            $this->incl_node->set_attribute($a_attr, $a_value);
 
  125            if ($this->incl_node->has_attribute($a_attr)) {
 
  126                $this->incl_node->remove_attribute($a_attr);
 
  138        if (is_object($this->incl_node)) {
 
  139            return  $this->incl_node->get_attribute($a_attr);
 
  151    public static function afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 
  164        include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
  186        include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
  189        foreach ($ci_ids as $ci_id) {
 
  190            if ((
int) $ci_id[
"inst_id"] <= 0 || $ci_id[
"inst_id"] == IL_INST_ID) {
 
  194                    $a_page->getParentType() . 
":pg",
 
  197                    $a_page->getLanguage()
 
  208        $xpath = 
new DOMXPath($a_domdoc);
 
  209        $nodes = $xpath->query(
'//ContentInclude');
 
  212        foreach ($nodes as 
$node) {
 
  214            $id = 
$node->getAttribute(
"ContentId");
 
  215            $inst_id = 
$node->getAttribute(
"InstId");
 
  216            $ci_ids[
$type . 
":" . 
$id . 
":" . $inst_id] = array(
 
  217                "type" => 
$type, 
"id" => 
$id, 
"inst_id" => $inst_id);
 
  231        $start = strpos($a_html, 
"{{{{{ContentInclude;");
 
  232        if (is_int($start)) {
 
  233            $end = strpos($a_html, 
"}}}}}", $start);
 
  237            $param = substr($a_html, $start + 20, 
$end - $start - 20);
 
  238            $param = explode(
";", $param);
 
  240            if ($param[0] == 
"mep" && is_numeric($param[1])) {
 
  241                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
 
  243                $snippet_lang = $this->
getPage()->getLanguage();
 
  249                    if ($a_mode != 
"offline") {
 
  257                    $html = $page_gui->getRawContent();
 
  258                    if ($a_mode == 
"edit") {
 
  259                        include_once(
"./Services/Link/classes/class.ilLink.php");
 
  260                        $par_id = $page_gui->getPageObject()->getParentId();
 
  263                            if ($this->access->checkAccess(
"write", 
"", $ref_id)) {
 
  268                        $html = 
'<p class="small light">' . 
$lng->txt(
"copg_snippet_cannot_be_edited") . 
$info . 
'</p>' . 
$html;
 
  271                    if ($a_mode == 
"edit") {
 
  272                        if ($param[2] <= 0) {
 
  273                            $html = 
"// " . 
$lng->txt(
"cont_missing_snippet") . 
" //";
 
  275                            $html = 
"// " . 
$lng->txt(
"cont_snippet_from_another_installation") . 
" //";
 
  279                $h2 = substr($a_html, 0, $start) .
 
  281                    substr($a_html, 
$end + 5);
 
  286            $start = strpos($a_html, 
"{{{{{ContentInclude;", $start + 5);
 
  288            if (is_int($start)) {
 
  289                $end = strpos($a_html, 
"}}}}}", $start);
 
An exception for terminatinating execution or to throw for unit testing.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilMediaPoolPage GUI class.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
Class ilPCContentInclude.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create content include node in xml.
static afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
After page history entry has been created.
getContentId()
Get content id.
setNode($a_node)
Set node.
getContentIncludeAttribute($a_attr)
Get content include tag attribute.
setInstId($a_id)
Set installation id.
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
static saveContentIncludeUsage($a_page, $a_domdoc, $a_old_nr=0)
save content include usages
setContentType($a_type)
Set content type.
static collectContentIncludes($a_page, $a_domdoc)
get all content includes that are used within the page
modifyPageContentPostXsl($a_html, $a_mode)
Modify page content after xsl.string
setContentIncludeAttribute($a_attr, $a_value)
Set attribute of content include tag.
static beforePageDelete($a_page)
Before page is being deleted.
getInstId()
Get installation id.
setContentId($a_id)
Set content id.
getContentType()
Get content type.
init()
Init page content component.
static saveUsage($a_pc_type, $a_pc_id, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
Save usages.
static deleteAllUsages($a_pc_type, $a_usage_type, $a_usage_id, $a_usage_hist_nr=0, $a_lang="-")
Delete all usages.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
getFileDownloadLink()
Get file download link.
getFullscreenLink()
Get fullscreen link.
getSourcecodeDownloadScript()
Get sourcecode download script.
setType($a_type)
Set Type.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
if(!array_key_exists('StateId', $_REQUEST)) $id