4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
35 parent::setNode($a_node);
36 $this->incl_node =& $a_node->first_child();
45 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
49 $this->incl_node =& $this->dom->create_element(
"ContentInclude");
50 $this->incl_node =& $this->node->append_child($this->incl_node);
109 if (!empty($a_value))
111 $this->incl_node->set_attribute($a_attr, $a_value);
115 if ($this->incl_node->has_attribute($a_attr))
117 $this->incl_node->remove_attribute($a_attr);
129 if (is_object($this->incl_node))
131 return $this->incl_node->get_attribute($a_attr);
146 self::saveContentIncludeUsage($a_page, $a_domdoc);
156 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
170 self::saveContentIncludeUsage($a_page, $a_old_domdoc, $a_old_nr);
178 include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
179 $ci_ids = self::collectContentIncludes($a_page, $a_domdoc);
181 foreach($ci_ids as $ci_id)
183 if ((
int) $ci_id[
"inst_id"] <= 0)
186 $a_page->getLanguage());
196 $xpath =
new DOMXPath($a_domdoc);
197 $nodes = $xpath->query(
'//ContentInclude');
200 foreach ($nodes as
$node)
202 $type = $node->getAttribute(
"ContentType");
203 $id = $node->getAttribute(
"ContentId");
204 $inst_id = $node->getAttribute(
"InstId");
205 $ci_ids[$type.
":".$id.
":".$inst_id] = array(
206 "type" => $type,
"id" => $id,
"inst_id" => $inst_id);
getInstId()
Get installation id.
getContentId()
Get content id.
static beforePageDelete($a_page)
Before page is being deleted.
setType($a_type)
Set Type.
setContentId($a_id)
Set content id.
static collectContentIncludes($a_page, $a_domdoc)
get all content includes that are used within the page
Class ilPCContentInclude.
setNode(&$a_node)
Set node.
static saveContentIncludeUsage($a_page, $a_domdoc, $a_old_nr=0)
save content include usages
static afterPageHistoryEntry($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
After page history entry has been created.
setContentType($a_type)
Set content type.
setContentIncludeAttribute($a_attr, $a_value)
Set attribute of content include tag.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create content include node in xml.
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) ...
setInstId($a_id)
Set installation id.
static afterPageUpdate($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
After page has been updated (or created)
getContentIncludeAttribute($a_attr)
Get content include tag attribute.
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.
getContentType()
Get content type.