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"),
54 "Attention" =>
$lng->txt(
"cont_Attention"),
55 "Background" =>
$lng->txt(
"cont_Background"),
56 "Confirmation" =>
$lng->txt(
"cont_Confirmation"),
57 "Information" =>
$lng->txt(
"cont_Information"),
58 "Interaction" =>
$lng->txt(
"cont_Interaction"),
59 "Link" =>
$lng->txt(
"cont_Link"),
60 "Literature" =>
$lng->txt(
"cont_Literature"),
61 "Separator" =>
$lng->txt(
"cont_Separator"),
62 "StandardCenter" =>
$lng->txt(
"cont_StandardCenter"),
64 "Excursus" =>
$lng->txt(
"cont_Excursus"),
65 "AdvancedKnowledge" =>
$lng->txt(
"cont_AdvancedKnowledge"));
75 if ($a_style_id > 0 &&
77 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
79 $chars =
$style->getCharacteristics(
"section");
81 foreach ($chars as $char) {
82 if ($chars[$char] !=
"") {
83 $new_chars[$char] = $chars[$char];
85 $new_chars[$char] = $char;
102 $next_class = $this->ctrl->getNextClass($this);
105 $cmd = $this->ctrl->getCmd();
107 switch ($next_class) {
108 case "ilpropertyformgui":
109 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
111 $this->ctrl->forwardCommand(
$form);
115 $ret = $this->$cmd();
127 $this->
edit(
true, $a_form);
140 $a_form = $this->
initForm($a_insert);
143 $tpl->setContent($a_form->getHTML());
155 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
159 $form->setTitle($this->lng->txt(
"cont_insert_section"));
161 $form->setTitle($this->lng->txt(
"cont_update_section"));
165 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
167 $this->lng->txt(
"cont_characteristic"),
172 if (is_object($this->content_obj)) {
173 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getCharacteristic() !=
"")) {
174 $chars = array_merge(
175 array($this->content_obj->getCharacteristic() => $this->content_obj->getCharacteristic()),
181 $selected = ($a_insert)
183 : $this->content_obj->getCharacteristic();
185 foreach ($chars as $k => $char) {
186 $html =
'<div class="ilCOPgEditStyleSelectionItem"><div class="ilc_section_' . $k .
'" style="' . self::$style_selector_reset .
'">' .
187 $char .
'</div></div>';
188 $char_prop->addOption($k, $char,
$html);
191 $char_prop->setValue($selected);
192 $form->addItem($char_prop);
195 include_once
'Services/Form/classes/class.ilLinkInputGUI.php';
198 $ac->setRequired(
false);
199 $ac->setInfo($this->lng->txt(
"copg_sec_link_info"));
200 $ac->setInternalLinkDefault(
204 $link_types = array();
208 $ac->setInternalLinkFilterTypes($link_types);
209 $ac->setFilterWhiteList(
214 $l = $this->content_obj->getLink();
215 if (
$l[
"LinkType"] ==
"IntLink") {
216 $ac->setValueByIntLinkAttributes(
$l[
"Type"],
$l[
"Target"],
$l[
"TargetFrame"]);
218 if (
$l[
"LinkType"] ==
"ExtLink") {
219 $ac->setValue(
$l[
"Href"]);
228 if (!$a_insert && (
$from = $this->content_obj->getActiveFrom()) !=
"") {
231 $dt_prop->setShowTime(
true);
232 $form->addItem($dt_prop);
236 if (!$a_insert && ($to = $this->content_obj->getActiveTo()) !=
"") {
239 $dt_prop->setShowTime(
true);
240 $form->addItem($dt_prop);
244 include_once(
"./Services/Form/classes/class.ilRepositorySelector2InputGUI.php");
251 "read" =>
$lng->txt(
"read"),
252 "write" =>
$lng->txt(
"write"),
253 "visible" =>
$lng->txt(
"visible"),
256 $si->
setInfo(
$lng->txt(
"cont_permission_object_desc"));
261 $si->setValue($this->content_obj->getPermission());
262 $rs->setValue($this->content_obj->getPermissionRefId());
268 $form->addCommandButton(
"create_section",
$lng->txt(
"save"));
269 $form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
271 $form->addCommandButton(
"update",
$lng->txt(
"save"));
272 $form->addCommandButton(
"cancelUpdate",
$lng->txt(
"cancel"));
284 if (
$form->checkInput()) {
286 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
290 $this->updated = $this->pg_obj->update();
291 if ($this->updated ===
true) {
292 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
305 if (
$form->checkInput()) {
308 $this->updated = $this->pg_obj->update();
309 if ($this->updated ===
true) {
310 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
314 $this->pg_obj->addHierIDs();
325 $this->content_obj->setCharacteristic(
$_POST[
"characteristic"]);
327 $from =
$form->getItemByPostVar(
"active_from")->getDate();
331 $this->content_obj->setActiveFrom(0);
334 $to =
$form->getItemByPostVar(
"active_to")->getDate();
336 $this->content_obj->setActiveTo($to->get(
IL_CAL_UNIX));
338 $this->content_obj->setActiveTo(0);
342 $this->content_obj->setPermissionRefId(
$_POST[
"permission_ref_id"]);
343 $this->content_obj->setPermission(
$_POST[
"permission"]);
346 if (
$_POST[
"link_mode"] ==
"ext" &&
$_POST[
"link"] !=
"") {
347 $this->content_obj->setExtLink(
$_POST[
"link"]);
348 } elseif (
$_POST[
"link_mode"] ==
"int" &&
$_POST[
"link"] !=
"") {
351 $la =
$form->getItemByPostVar(
"link")->getIntLinkAttributes();
354 if ($la[
"Type"] !=
"") {
355 $this->content_obj->setIntLink($la[
"Type"], $la[
"Target"], $la[
"TargetFrame"]);
358 $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.
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.