24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
66 $this->mob_node =& $a_node->first_child();
82 $this->hier_id = $a_hier_id;
92 $this->mediaobject = $a_mediaobject;
102 return $this->mediaobject;
128 $this->node =& $this->dom->create_element(
"PageContent");
129 $a_pg_obj->insertContent($this, $a_hier_id,
IL_INSERT_AFTER, $a_pc_id);
130 $this->mob_node =& $this->dom->create_element(
"MediaObject");
131 $this->mob_node =& $this->node->append_child($this->mob_node);
132 $this->mal_node =& $this->dom->create_element(
"MediaAlias");
133 $this->mal_node =& $this->mob_node->append_child($this->mal_node);
134 $this->mal_node->set_attribute(
"OriginId",
"il__mob_".$this->
getMediaObject()->getId());
137 $item_node =& $this->dom->create_element(
"MediaAliasItem");
138 $item_node =& $this->mob_node->append_child($item_node);
139 $item_node->set_attribute(
"Purpose",
"Standard");
142 $layout_node =& $this->dom->create_element(
"Layout");
143 $layout_node =& $item_node->append_child($layout_node);
144 if ($media_item->getWidth() > 0)
146 $layout_node->set_attribute(
"Width", $media_item->getWidth());
148 if ($media_item->getHeight() > 0)
150 $layout_node->set_attribute(
"Height", $media_item->getHeight());
152 $layout_node->set_attribute(
"HorizontalAlign",
"Left");
155 if ($media_item->getCaption() !=
"")
157 $cap_node =& $this->dom->create_element(
"Caption");
158 $cap_node =& $item_node->append_child($cap_node);
159 $cap_node->set_attribute(
"Align",
"bottom");
160 $cap_node->set_content($media_item->getCaption());
163 $pars = $media_item->getParameters();
164 foreach($pars as $par => $val)
166 $par_node =& $this->dom->create_element(
"Parameter");
167 $par_node =& $item_node->append_child($par_node);
168 $par_node->set_attribute(
"Name", $par);
169 $par_node->set_attribute(
"Value", $val);
173 $fullscreen_item =& $this->
getMediaObject()->getMediaItem(
"Fullscreen");
174 if (is_object($fullscreen_item))
176 $item_node =& $this->dom->create_element(
"MediaAliasItem");
177 $item_node =& $this->mob_node->append_child($item_node);
178 $item_node->set_attribute(
"Purpose",
"Fullscreen");
181 $layout_node =& $this->dom->create_element(
"Layout");
182 $layout_node =& $item_node->append_child($layout_node);
183 if ($fullscreen_item->getWidth() > 0)
185 $layout_node->set_attribute(
"Width", $fullscreen_item->getWidth());
187 if ($fullscreen_item->getHeight() > 0)
189 $layout_node->set_attribute(
"Height", $fullscreen_item->getHeight());
193 if ($fullscreen_item->getCaption() !=
"")
195 $cap_node =& $this->dom->create_element(
"Caption");
196 $cap_node =& $item_node->append_child($cap_node);
197 $cap_node->set_attribute(
"Align",
"bottom");
198 $cap_node->set_content($fullscreen_item->getCaption());
201 $pars = $fullscreen_item->getParameters();
202 foreach($pars as $par => $val)
204 $par_node =& $this->dom->create_element(
"Parameter");
205 $par_node =& $item_node->append_child($par_node);
206 $par_node->set_attribute(
"Name", $par);
207 $par_node->set_attribute(
"Value", $val);
217 $xml = $this->dom->dump_node($this->node);