4require_once(
"./Services/COPage/classes/class.ilPCTable.php");
5require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
41 public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
45 $this->tabs =
$DIC->tabs();
46 $this->ctrl =
$DIC->ctrl();
47 $this->lng =
$DIC->language();
48 $this->tpl =
$DIC[
"tpl"];
49 $this->
user = $DIC->user();
51 $this->
setCharacteristics(array(
"StandardTable" => $this->lng->txt(
"cont_StandardTable")));
52 $this->tool_context =
$DIC->globalScreen()->tool()->context();
61 "Cell3" =>
"Cell3",
"Cell4" =>
"Cell4"));
72 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
77 switch ($next_class) {
90 public function setTabs($data_tab_txt_key =
"")
96 $ilTabs->setBackTarget(
98 $this->ctrl->getParentReturn($this)
101 if ($data_tab_txt_key ==
"") {
102 $data_tab_txt_key =
"cont_table_edit_cells";
107 $ilCtrl->getLinkTarget($this,
"editData"),
113 "cont_table_properties",
114 $ilCtrl->getLinkTarget($this,
"editProperties"),
120 "cont_table_cell_properties",
121 $ilCtrl->getLinkTarget($this,
"editCellStyle"),
136 $ilTabs->addSubTabTarget(
138 $ilCtrl->getLinkTarget($this,
"editCellStyle"),
143 $ilTabs->addSubTabTarget(
145 $ilCtrl->getLinkTarget($this,
"editCellWidth"),
150 $ilTabs->addSubTabTarget(
152 $ilCtrl->getLinkTarget($this,
"editCellAlignment"),
157 $ilTabs->addSubTabTarget(
159 $ilCtrl->getLinkTarget($this,
"editCellSpan"),
170 return parent::getTemplateOptions(
"table");
175 $this->ctrl->redirect($this,
"editData");
190 $html = $this->form->getHTML();
192 $tpl->setContent($html);
205 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
207 $this->form->setFormAction($ilCtrl->getFormAction($this));
208 if ($a_mode ==
"create") {
209 $this->form->setTitle($this->lng->txt(
"cont_insert_table"));
211 $this->form->setTitle($this->lng->txt(
"cont_table_properties"));
214 if ($a_mode ==
"create") {
216 for (
$i = 1;
$i <= 20;
$i++) {
222 $cols->setOptions($nr);
224 $this->form->addItem(
$cols);
228 $rows->setOptions($nr);
230 $this->form->addItem(
$rows);
234 $width =
new ilTextInputGUI($this->lng->txt(
"cont_table_width"),
"width");
236 $width->setMaxLength(6);
237 $this->form->addItem($width);
240 $border =
new ilTextInputGUI($this->lng->txt(
"cont_table_border"),
"border");
241 $border->setInfo($this->lng->txt(
"cont_table_border_info"));
242 $border->setValue(
"1px");
244 $border->setMaxLength(6);
245 $this->form->addItem($border);
248 $padding =
new ilTextInputGUI($this->lng->txt(
"cont_table_cellpadding"),
"padding");
249 $padding->setInfo($this->lng->txt(
"cont_table_cellpadding_info"));
250 $padding->setValue(
"2px");
251 $padding->setSize(6);
252 $padding->setMaxLength(6);
253 $this->form->addItem($padding);
257 $spacing->setValue(
"0px");
258 $this->form->addItem($spacing);
266 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
268 $this->lng->txt(
"cont_characteristic"),
273 $chars = array_merge($templates, $chars);
274 if (is_object($this->content_obj)) {
275 if ($chars[$a_seleted_value] ==
"" && ($this->content_obj->getClass() !=
"")) {
276 $chars = array_merge(
277 array($this->content_obj->getClass() => $this->content_obj->getClass()),
282 foreach ($chars as $k => $char) {
283 if (strpos($k,
":") > 0) {
284 $t = explode(
":", $k);
285 $html = $this->style->lookupTemplatePreview($t[1]) .
'<div style="clear:both;" class="small">' . $char .
"</div>";
287 $html =
'<table class="ilc_table_' . $k .
'"><tr><td class="small">' .
288 $char .
'</td></tr></table>';
290 $char_prop->addOption($k, $char, $html);
292 $char_prop->setValue(
"StandardTable");
293 $this->form->addItem($char_prop);
296 for (
$i = 0;
$i <= 3;
$i++) {
301 $rh =
new ilSelectInputGUI($this->lng->txt(
"cont_nr_row_header"),
"row_header");
302 $rh->setOptions($nr);
304 $this->form->addItem($rh);
307 $rf =
new ilSelectInputGUI($this->lng->txt(
"cont_nr_row_footer"),
"row_footer");
308 $rf->setOptions($nr);
310 $this->form->addItem($rf);
313 $ch =
new ilSelectInputGUI($this->lng->txt(
"cont_nr_col_header"),
"col_header");
314 $ch->setOptions($nr);
316 $this->form->addItem($ch);
319 $cf =
new ilSelectInputGUI($this->lng->txt(
"cont_nr_col_footer"),
"col_footer");
320 $cf->setOptions($nr);
322 $this->form->addItem($cf);
324 if ($a_mode ==
"create") {
326 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
328 $this->lng->txt(
"cont_first_row_style"),
334 $options = array_merge(array(
"" => $this->lng->txt(
"none")), $chars);
335 foreach ($options as $k => $option) {
336 $html =
'<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k .
'">' .
337 $option .
'</td></tr></table>';
338 $fr_style->addOption($k, $option, $html);
341 $fr_style->setValue(
"");
342 $this->form->addItem($fr_style);
346 $align_opts = array(
"Left" =>
$lng->txt(
"cont_left"),
347 "Right" =>
$lng->txt(
"cont_right"),
"Center" =>
$lng->txt(
"cont_center"),
348 "LeftFloat" =>
$lng->txt(
"cont_left_float"),
349 "RightFloat" =>
$lng->txt(
"cont_right_float"));
351 $align->setOptions($align_opts);
352 $align->setValue(
"Center");
353 $this->form->addItem($align);
356 $caption =
new ilTextInputGUI($this->lng->txt(
"cont_caption"),
"caption");
357 $caption->setSize(60);
358 $this->form->addItem($caption);
361 $ca_opts = array(
"top" =>
$lng->txt(
"cont_top"),
362 "bottom" =>
$lng->txt(
"cont_bottom"));
364 $this->lng->txt(
"cont_align"),
367 $ca->setOptions($ca_opts);
368 $caption->addSubItem($ca);
371 if ($a_mode ==
"create") {
374 $op =
new ilRadioOption($this->lng->txt(
"cont_html_table"),
"html");
375 $import->addOption($op);
376 $op2 =
new ilRadioOption($this->lng->txt(
"cont_spreadsheet_table"),
"spreadsheet");
379 $import_data->setRows(8);
380 $import_data->setCols(50);
381 $op2->addSubItem($import_data);
383 $import->addOption($op2);
384 $import->setValue(
"html");
385 $this->form->addItem($import);
392 $s_lang =
$ilUser->getLanguage();
394 require_once(
"Services/MetaData/classes/class.ilMDLanguageItem.php");
397 $language->setOptions(
$lang);
398 $language->setValue($s_lang);
399 $this->form->addItem($language);
401 if ($a_mode ==
"create") {
402 $this->form->addCommandButton(
"create_tab",
$lng->txt(
"save"));
403 $this->form->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
405 $this->form->addCommandButton(
"saveProperties",
$lng->txt(
"save"));
415 $values[
"width"] = $this->content_obj->getWidth();
416 $values[
"border"] = $this->content_obj->getBorder();
417 $values[
"padding"] = $this->content_obj->getCellPadding();
418 $values[
"spacing"] = $this->content_obj->getCellSpacing();
419 $values[
"row_header"] = $this->content_obj->getHeaderRows();
420 $values[
"row_footer"] = $this->content_obj->getFooterRows();
421 $values[
"col_header"] = $this->content_obj->getHeaderCols();
422 $values[
"col_footer"] = $this->content_obj->getFooterCols();
423 if ($this->content_obj->getTemplate() !=
"") {
424 $values[
"characteristic"] =
"t:" .
426 $this->content_obj->getTemplate();
428 $values[
"characteristic"] = $this->content_obj->getClass();
430 $values[
"align"] = $this->content_obj->getHorizontalAlign();
431 $values[
"caption"] = $this->content_obj->getCaption();
432 $values[
"cap_align"] = $this->content_obj->getCaptionAlign();
433 $values[
"language"] = $this->content_obj->getLanguage();
435 $this->form->setValuesByArray($values);
437 $ca = $this->form->getItemByPostVar(
"cap_align");
438 $ca->setValue($this->content_obj->getCaptionAlign());
444 public function renderTable($a_mode =
"table_edit", $a_submode =
"")
446 $tab_node = $this->content_obj->getNode();
447 $tab_node->set_attribute(
"Enabled",
"True");
448 $content = $this->dom->dump_node($tab_node);
450 $trans = $this->pg_obj->getLanguageVariablesXML();
451 $mobs = $this->pg_obj->getMultimediaXML();
454 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
456 $template_xml = $style->getTemplateXML();
460 $content = $content .
$mobs . $trans . $template_xml;
467 !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
477 $a_mode =
"table_edit",
487 $content =
"<dummy>" . $content .
"</dummy>";
489 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
490 $args = array(
'/_xml' => $content,
'/_xsl' => $xsl );
496 $params = array(
'mode' => $a_mode,
497 'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path);
498 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",
null, $args, $params);
504 $output = str_replace(
"<",
"<", $output);
505 $output = str_replace(
">",
">", $output);
506 $output = str_replace(
"&",
"&", $output);
509 if ($a_mode ==
"table_edit" && !is_null($a_table_obj)) {
510 switch ($a_submode) {
530 if (isset($page_object)) {
532 foreach ($defs as $def) {
534 $pc_class = $def[
"pc_class"];
535 $pc_obj =
new $pc_class($page_object);
538 $output = $pc_obj->modifyPageContentPostXsl($output,
"presentation",
false);
555 $classes = $a_table->getAllCellClasses();
557 foreach ($classes as $k => $v) {
559 $v =
$lng->txt(
"none");
561 if (substr($v, 0, 4) ==
"ilc_") {
564 $check =
$lng->txt(
"cont_style") .
": " .
565 '<input type="checkbox" value="1"' .
566 ' name="target[' . $k .
']">' .
'</input> ' . $v;
568 $a_output = str_replace(
"{{{{{TableEdit;" . $k .
"}}}}}", $check, $a_output);
582 $classes = $a_table->getAllCellAlignments();
584 foreach ($classes as $k => $v) {
586 $v =
$lng->txt(
"default");
588 $check =
$lng->txt(
"cont_alignment") .
": " .
589 '<input type="checkbox" value="1"' .
590 ' name="target[' . $k .
']">' .
'</input> ' . $v;
592 $a_output = str_replace(
"{{{{{TableEdit;" . $k .
"}}}}}", $check, $a_output);
606 $widths = $a_table->getAllCellWidths();
608 foreach ($widths as $k => $v) {
609 $check =
$lng->txt(
"cont_width") .
": " .
610 '<input class="small" type="text" size="5" maxlength="10"' .
611 ' name="width[' . $k .
']" value="' . $v .
'">' .
'</input>';
613 $a_output = str_replace(
"{{{{{TableEdit;" . $k .
"}}}}}", $check, $a_output);
627 $spans = $a_table->getAllCellSpans();
629 foreach ($spans as $k => $v) {
631 $selects =
'<div style="white-space:nowrap;">' .
$lng->txt(
"cont_colspan") .
": " .
632 '<select class="small" name="colspan[' . $k .
']">';
633 for (
$i = 1;
$i <= $v[
"max_x"] - $v[
"x"] + 1;
$i++) {
634 $sel_str = (
$i == $v[
"colspan"])
635 ?
'selected="selected"'
637 $selects .=
'<option value="' .
$i .
'" ' . $sel_str .
'>' .
$i .
'</option>';
639 $selects .=
"</select></div>";
642 $selects .=
'<div style="margin-top:3px; white-space:nowrap;">' .
$lng->txt(
"cont_rowspan") .
": " .
643 '<select class="small" name="rowspan[' . $k .
']">';
644 for (
$i = 1;
$i <= $v[
"max_y"] - $v[
"y"] + 1;
$i++) {
645 $sel_str = (
$i == $v[
"rowspan"])
646 ?
'selected="selected"'
648 $selects .=
'<option value="' .
$i .
'" ' . $sel_str .
'>' .
$i .
'</option>';
650 $selects .=
"</select></div>";
652 $a_output = str_replace(
"{{{{{TableEdit;" . $k .
"}}}}}", $selects, $a_output);
670 $ilTabs->setSubTabActive(
"cont_style");
673 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
675 $form->setFormAction($ilCtrl->getFormAction($this));
676 $form->setTitle($this->lng->txt(
"cont_table_cell_properties"));
679 require_once(
"./Services/Form/classes/class.ilAdvSelectInputGUI.php");
681 $this->lng->txt(
"cont_style"),
687 $options = array_merge(array(
"" => $this->lng->txt(
"none")), $chars);
688 foreach ($options as $k => $option) {
689 $html =
'<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k .
'">' .
690 $option .
'</td></tr></table>';
691 $style->addOption($k, $option, $html);
694 $style->setValue(
"");
695 $style->setInfo(
$lng->txt(
"cont_set_tab_style_info"));
696 $form->addItem($style);
697 $form->setKeepOpen(
true);
699 $form->addCommandButton(
"setStyles",
$lng->txt(
"cont_set_styles"));
701 $html = $form->getHTML();
702 $html .=
"<br />" . $this->
renderTable(
"table_edit",
"style") .
"</form>";
703 $tpl->setContent($html);
719 $ilTabs->setSubTabActive(
"cont_width");
720 $ilTabs->setTabActive(
"cont_table_cell_properties");
722 $ctpl =
new ilTemplate(
"tpl.table_cell_properties.html",
true,
true,
"Services/COPage");
723 $ctpl->setVariable(
"BTN_NAME",
"setWidths");
724 $ctpl->setVariable(
"BTN_TEXT",
$lng->txt(
"cont_save_widths"));
725 $ctpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this));
727 $html = $ctpl->get();
728 $html .=
"<br />" . $this->
renderTable(
"table_edit",
"width") .
"</form>";
729 $tpl->setContent($html);
745 $ilTabs->setSubTabActive(
"cont_span");
746 $ilTabs->setTabActive(
"cont_table_cell_properties");
748 $ctpl =
new ilTemplate(
"tpl.table_cell_properties.html",
true,
true,
"Services/COPage");
749 $ctpl->setVariable(
"BTN_NAME",
"setSpans");
750 $ctpl->setVariable(
"BTN_TEXT",
$lng->txt(
"cont_save_spans"));
751 $ctpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this));
753 $html = $ctpl->get();
754 $html .=
"<br />" . $this->
renderTable(
"table_edit",
"span") .
"</form>";
755 $tpl->setContent($html);
765 if (is_array(
$_POST[
"target"])) {
766 foreach (
$_POST[
"target"] as $k => $value) {
768 $cid = explode(
":", $k);
769 $this->content_obj->setTDClass(
777 $this->updated = $this->pg_obj->update();
778 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
779 $this->ctrl->redirect($this,
"editCellStyle");
789 if (is_array(
$_POST[
"width"])) {
790 foreach (
$_POST[
"width"] as $k => $width) {
791 $cid = explode(
":", $k);
792 $this->content_obj->setTDWidth(
799 $this->updated = $this->pg_obj->update();
800 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
801 $this->ctrl->redirect($this,
"editCellWidth");
811 if (is_array(
$_POST[
"colspan"])) {
812 foreach (
$_POST[
"colspan"] as $k => $span) {
816 $this->content_obj->setTDSpans(
$_POST[
"colspan"],
$_POST[
"rowspan"]);
818 $this->updated = $this->pg_obj->update();
819 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
820 $this->ctrl->redirect($this,
"editCellSpan");
830 $caption = str_replace(
"&",
"&", $caption);
831 $caption = str_replace(
"<",
"<", $caption);
832 $caption = str_replace(
">",
">", $caption);
844 if (strpos(
$_POST[
"characteristic"],
":") > 0) {
845 $t = explode(
":",
$_POST[
"characteristic"]);
847 $this->content_obj->setClass(
"");
850 $this->content_obj->setTemplate(
"");
852 $this->content_obj->setCaption(
864 $this->updated = $this->pg_obj->update();
865 if ($this->updated ===
true) {
866 $this->ctrl->redirect($this,
"editProperties");
869 $this->pg_obj->addHierIDs();
879 $this->content_obj->setHorizontalAlign(
"Right");
880 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
881 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
889 $this->content_obj->setHorizontalAlign(
"Left");
890 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
891 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
899 $this->content_obj->setHorizontalAlign(
"Center");
900 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
901 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
909 $this->content_obj->setHorizontalAlign(
"LeftFloat");
910 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
911 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
919 $this->content_obj->setHorizontalAlign(
"RightFloat");
920 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
921 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
937 $html = $this->form->getHTML();
938 $tpl->setContent($html);
957 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
958 $import_table = trim(
$_POST[
"import_table"]);
961 if (!empty($import_table)) {
962 switch (
$_POST[
"import_type"]) {
965 if (!$this->content_obj->importHtml(
$_POST[
"language"], $import_table)) {
973 $this->content_obj->importSpreadsheet(
$_POST[
"language"], $import_table);
977 $this->content_obj->addRows(
987 $this->content_obj->setFirstRowStyle($frtype);
990 $this->updated = $this->pg_obj->update();
992 if ($this->updated ===
true) {
1004 $this->ctrl->returnToParent($this,
"jump" . $this->hier_id);
1025 $ilTabs->setSubTabActive(
"cont_alignment");
1026 $ilTabs->setTabActive(
"cont_table_cell_properties");
1029 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1031 $form->setFormAction($ilCtrl->getFormAction($this));
1032 $form->setTitle($this->lng->txt(
"cont_table_cell_properties"));
1036 "" =>
$lng->txt(
"default"),
1037 "Left" =>
$lng->txt(
"cont_left"),
1038 "Center" =>
$lng->txt(
"cont_center"),
1039 "Right" =>
$lng->txt(
"cont_right")
1042 $si->setOptions($options);
1044 $form->addItem(
$si);
1046 $form->setKeepOpen(
true);
1048 $form->addCommandButton(
"setAlignment",
$lng->txt(
"cont_set_alignment"));
1050 $html = $form->getHTML();
1051 $html .=
"<br />" . $this->
renderTable(
"table_edit",
"alignment") .
"</form>";
1052 $tpl->setContent($html);
1062 if (is_array(
$_POST[
"target"])) {
1063 foreach (
$_POST[
"target"] as $k => $value) {
1065 $cid = explode(
":", $k);
1066 $this->content_obj->setTDAlignment(
1074 $this->updated = $this->pg_obj->update();
1075 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1077 $this->ctrl->redirect($this,
"editCellAlignment");
1085 $collection = $this->tool_context->current()->getAdditionalData();
1104 $editor_init = new \ILIAS\COPage\Editor\UI\Init();
1105 $editor_init->initUI($this->tpl);
1114 include_once(
"./Services/COPage/classes/class.ilPCParagraph.php");
1116 $dtpl =
new ilTemplate(
"tpl.tabledata2.html",
true,
true,
"Services/COPage");
1117 $dtpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"tableAction"));
1118 $dtpl->setVariable(
"HIERID", $this->hier_id);
1119 $dtpl->setVariable(
"PCID", $this->pc_id);
1123 $ilCtrl->getFormAction($this,
"updateJS")
1128 $path =
"//PageContent[@HierId='" . $this->
getHierId() .
"']" .
1132 for (
$i = 0;
$i < count(
$res->nodeset);
$i++) {
1134 $path2 =
"//PageContent[@HierId='" . $this->
getHierId() .
"']" .
1135 "/Table/TableRow[$i+1]/TableData";
1140 for ($j = 0; $j < count($res2->nodeset); $j++) {
1142 $dtpl->touchBlock(
"empty_td");
1145 $move_forward =
false;
1146 $move_backward =
false;
1148 if (count($res2->nodeset) == 1) {
1151 $move_forward =
true;
1153 } elseif ($j == (count($res2->nodeset) - 1)) {
1154 $move_backward =
true;
1156 $move_forward =
true;
1157 $move_backward =
true;
1159 $dtpl->setCurrentBlock(
"col_icon");
1160 $dtpl->setVariable(
"NR_COLUMN", $j + 1);
1161 $dtpl->setVariable(
"PCID_COLUMN", $res2->nodeset[$j]->get_attribute(
"PCID"));
1163 $dtpl->parseCurrentBlock();
1165 $dtpl->setCurrentBlock(
"row");
1166 $dtpl->parseCurrentBlock();
1169 for ($j = 0; $j < count($res2->nodeset); $j++) {
1173 if (count(
$res->nodeset) == 1) {
1174 $move_type =
"none";
1176 $move_type =
"forward";
1178 } elseif (
$i == (count(
$res->nodeset) - 1)) {
1179 $move_type =
"backward";
1181 $move_type =
"both";
1183 $dtpl->setCurrentBlock(
"row_icon");
1184 $dtpl->setVariable(
"NR_ROW",
$i + 1);
1185 $dtpl->setVariable(
"PCID_ROW", $res2->nodeset[$j]->get_attribute(
"PCID"));
1186 $dtpl->setVariable(
"ROW_CAPTION",
$i + 1);
1187 $dtpl->parseCurrentBlock();
1191 if ($res2->nodeset[$j]->get_attribute(
"Hidden") !=
"Y") {
1192 if ($this->content_obj->getType() ==
"dtab") {
1193 $dtpl->touchBlock(
"cell_type");
1198 $dtpl->setCurrentBlock(
"cell");
1200 $dtpl->setVariable(
"PAR_TA_NAME",
"cell[" .
$i .
"][" . $j .
"]");
1201 $dtpl->setVariable(
"PAR_TA_ID",
"cell_" .
$i .
"_" . $j);
1202 $dtpl->setVariable(
"PAR_ROW", (
string)
$i);
1203 $dtpl->setVariable(
"PAR_COLUMN", (
string) $j);
1205 $dtpl->setVariable(
"PAR_TA_CONTENT",
1208 $cs = $res2->nodeset[$j]->get_attribute(
"ColSpan");
1209 $rs = $res2->nodeset[$j]->get_attribute(
"RowSpan");
1210 $dtpl->setVariable(
"WIDTH",
"140");
1211 $dtpl->setVariable(
"HEIGHT",
"80");
1213 $dtpl->setVariable(
"COLSPAN",
'colspan="' . $cs .
'"');
1214 $dtpl->setVariable(
"WIDTH", (140 + ($cs - 1) * 146));
1217 $dtpl->setVariable(
"ROWSPAN",
'rowspan="' . $rs .
'"');
1218 $dtpl->setVariable(
"HEIGHT", (80 + ($rs - 1) * 86));
1220 $dtpl->parseCurrentBlock();
1223 $dtpl->setCurrentBlock(
"row");
1224 $dtpl->parseCurrentBlock();
1227 $dtpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_table"));
1230 $dtpl->setCurrentBlock(
"int_link_prep");
1234 $ilCtrl->getLinkTargetByClass(
1235 array(
"ilpageeditorgui",
"ilinternallinkgui"),
1243 $dtpl->parseCurrentBlock();
1246 $dtpl->touchBlock(
"script");
1249 return $dtpl->get();
1254 $tab_node = $this->content_obj->getNode();
1258 foreach ($tab_node->first_child()->child_nodes() as $child) {
1261 foreach($child->child_nodes() as $child2)
1264 foreach($child2->child_nodes() as $cell_content_node) {
1265 $content.= $this->dom->dump_node($cell_content_node);
1273 $trans = $this->pg_obj->getLanguageVariablesXML();
1274 $mobs = $this->pg_obj->getMultimediaXML();
1278 $template_xml = $style->getTemplateXML();
1282 $content = $content .
$mobs . $trans . $template_xml;
1286 !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
1302 $content =
"<dummy>" . $content .
"</dummy>";
1304 $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
1305 $args = array(
'/_xml' => $content,
'/_xsl' => $xsl );
1309 $params = array(
'webspace_path' => $wb_path,
'enlarge_path' => $enlarge_path);
1310 $output = xslt_process($xh,
"arg:/_xml",
"arg:/_xsl",
null, $args, $params);
1315 $output = str_replace(
"<",
"<", $output);
1316 $output = str_replace(
">",
">", $output);
1317 $output = str_replace(
"&",
"&", $output);
1321 if (isset($page_object)) {
1323 foreach ($defs as $def) {
1325 $pc_class = $def[
"pc_class"];
1326 $pc_obj =
new $pc_class($page_object);
1329 $output = $pc_obj->modifyPageContentPostXsl($output,
"presentation",
false);
1342 $chr = ($nr - 1) %
$base;
1343 $cap = chr($chr + 65) . $cap;
1344 $nr = ($nr - 1 - $chr) /
$base;
An exception for terminatinating execution or to throw for unit testing.
static getPCDefinitions()
Get PC definitions.
static requirePCClassByName($a_name)
Get instance.
static getInitHTML($a_url)
Get initialisation HTML to use interna link editing.
static _lookupTemplateIdByName($a_style_id, $a_name)
Lookup table template preview.
static _lookupType($a_id, $a_reference=false)
lookup object type
getCellContent(int $i, int $j)
setEditorToolContext()
Set editor tool context.
editProperties()
edit properties form
create()
create new table in dom and update page in db
getColumnCaption(int $nr)
setStyles()
Set cell styles and.
setTabs($data_tab_txt_key="")
Set tabs.
editData()
Edit data of table.
getTemplateOptions($a_type="")
Get table templates.
editCellAlignment()
Edit cell styles.
centerAlign()
align table to left
static _addAlignmentCheckboxes($a_output, $a_table)
Add alignment checkboxes in edit mode.
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
setProperties()
Set properties from input form.
static _renderTable( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true, $page_object=null)
Static render table function.
editCellWidth()
Edit cell widths.
static _addWidthInputs($a_output, $a_table)
Add width inputs.
insert()
insert new table form
saveProperties()
save table properties in db and return to page edit screen
setSpans()
Set cell spans.
rightAlign()
align table to right
setWidths()
Set cell widths.
initPropertiesForm($a_mode="edit")
Init properties form.
getEditDataTable($initial=false)
static _addStyleCheckboxes($a_output, $a_table)
Add style checkboxes in edit mode.
getPropertiesFormValues()
Get properties form.
rightFloatAlign()
align table to left
leftFloatAlign()
align table to left float
executeCommand()
execute command
setBasicTableCellStyles()
Set basic table cell styles.
static _addSpanInputs($a_output, $a_table)
Add span inputs.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
editCellStyle()
Edit cell styles.
leftAlign()
align table to left
setCellPropertiesSubTabs()
Set tabs.
editCellSpan()
Edit cell spans.
afterCreation()
After creation processing.
renderCell( $content, $unmask=true, $page_object=null)
Static render table function.
getNewTableObject()
Get new table object.
setAlignment()
Set cell alignments.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getHierId()
get hierarchical id in dom object
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
displayValidationError()
display validation errors
getCharacteristics()
Get characteristics.
setCharacteristics($a_chars)
Set Characteristics.
getStyleId()
Get Style Id.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getWebspaceDir($mode="filesystem")
get webspace directory
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res