4 require_once(
"./Services/COPage/classes/class.ilPCSection.php");
5 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
26 public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
30 $this->tpl = $DIC[
"tpl"];
31 $this->lng = $DIC->language();
32 $this->ctrl = $DIC->ctrl();
33 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
45 $lng = $DIC->language();
47 return array(
"Block" =>
$lng->txt(
"cont_Block"),
48 "Mnemonic" =>
$lng->txt(
"cont_Mnemonic"),
49 "Remark" =>
$lng->txt(
"cont_Remark"),
50 "Example" =>
$lng->txt(
"cont_Example"),
51 "Additional" =>
$lng->txt(
"cont_Additional"),
52 "Special" =>
$lng->txt(
"cont_Special"),
53 "Excursus" =>
$lng->txt(
"cont_Excursus"),
54 "AdvancedKnowledge" =>
$lng->txt(
"cont_AdvancedKnowledge"));
64 if ($a_style_id > 0 &&
66 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
68 $chars =
$style->getCharacteristics(
"section");
70 foreach ($chars as $char) {
71 if ($chars[$char] !=
"") {
72 $new_chars[$char] = $chars[$char];
74 $new_chars[$char] = $char;
91 $next_class = $this->ctrl->getNextClass($this);
94 $cmd = $this->ctrl->getCmd();
96 switch ($next_class) {
97 case "ilpropertyformgui":
98 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
100 $this->ctrl->forwardCommand(
$form);
104 $ret = $this->$cmd();
116 $this->
edit(
true, $a_form);
129 $a_form = $this->
initForm($a_insert);
132 $tpl->setContent($a_form->getHTML());
144 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
148 $form->setTitle($this->lng->txt(
"cont_insert_section"));
150 $form->setTitle($this->lng->txt(
"cont_update_section"));
154 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
156 $this->lng->txt(
"cont_characteristic"),
161 if (is_object($this->content_obj)) {
162 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
"")) {
163 $chars = array_merge(
164 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
170 $selected = ($a_insert)
172 : $this->content_obj->getCharacteristic();
174 foreach ($chars as $k => $char) {
175 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_' . $k .
'" style="' . self::$style_selector_reset .
'">' .
176 $char .
'</div></div>';
177 $char_prop->addOption($k, $char,
$html);
180 $char_prop->setValue($selected);
181 $form->addItem($char_prop);
184 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
187 $ac->setRequired(
false);
188 $ac->setInfo($this->lng->txt(
"copg_sec_link_info"));
189 $ac->setInternalLinkDefault(
193 $link_types =
array();
194 foreach ($this->
getPageConfig()->getIntLinkFilters() as $f) {
197 $ac->setInternalLinkFilterTypes($link_types);
198 $ac->setFilterWhiteList(
203 $l = $this->content_obj->getLink();
204 if (
$l[
"LinkType"] ==
"IntLink") {
205 $ac->setValueByIntLinkAttributes(
$l[
"Type"],
$l[
"Target"],
$l[
"TargetFrame"]);
207 if (
$l[
"LinkType"] ==
"ExtLink") {
208 $ac->setValue(
$l[
"Href"]);
217 if (!$a_insert && (
$from = $this->content_obj->getActiveFrom()) !=
"") {
220 $dt_prop->setShowTime(
true);
221 $form->addItem($dt_prop);
225 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) !=
"") {
228 $dt_prop->setShowTime(
true);
229 $form->addItem($dt_prop);
233 include_once(
"./Services/Form/classes/class.ilRepositorySelector2InputGUI.php");
240 "read" =>
$lng->txt(
"read"),
241 "write" =>
$lng->txt(
"write"),
242 "visible" =>
$lng->txt(
"visible"),
245 $si->
setInfo(
$lng->txt(
"cont_permission_object_desc"));
250 $si->setValue($this->content_obj->getPermission());
251 $rs->setValue($this->content_obj->getPermissionRefId());
257 $form->addCommandButton(
"create_section",
$lng->txt(
"save"));
258 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
260 $form->addCommandButton(
"update",
$lng->txt(
"save"));
261 $form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
273 if (
$form->checkInput()) {
275 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
279 $this->updated = $this->pg_obj->update();
280 if ($this->updated ===
true) {
281 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
294 if (
$form->checkInput()) {
297 $this->updated = $this->pg_obj->update();
298 if ($this->updated ===
true) {
299 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
303 $this->pg_obj->addHierIDs();
314 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
316 $from =
$form->getItemByPostVar(
"active_from")->getDate();
320 $this->content_obj->setActiveFrom(0);
323 $to =
$form->getItemByPostVar(
"active_to")->getDate();
325 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
327 $this->content_obj->setActiveTo(0);
331 $this->content_obj->setPermissionRefId(
$_POST[
"permission_ref_id"]);
332 $this->content_obj->setPermission(
$_POST[
"permission"]);
335 if (
$_POST[
"link_mode"] ==
"ext" &&
$_POST[
"link"] !=
"") {
336 $this->content_obj->setExtLink(
$_POST[
"link"]);
337 } elseif (
$_POST[
"link_mode"] ==
"int" &&
$_POST[
"link"] !=
"") {
340 $la =
$form->getItemByPostVar(
"link")->getIntLinkAttributes();
343 if ($la[
"Type"] !=
"") {
344 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"]);
347 $this->content_obj->setNoLink();
executeCommand()
execute command
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
edit($a_insert=false, ilPropertyFormGUI $a_form=null)
Edit section form.
setValuesFromForm($form)
Set values from form.
create()
Create new Section.
initForm($a_insert=false)
Init editing form.
static _getStandardCharacteristics()
Get standard characteristics.
getPageConfig()
Get Page Config.
setCharacteristics($a_chars)
Set Characteristics.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
static _getCharacteristics($a_style_id)
Get characteristics.
if(isset($_POST['submit'])) $form
displayValidationError()
display validation errors
insert(ilPropertyFormGUI $a_form=null)
Insert new section form.
getCharacteristics()
Get characteristics.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options