ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCParagraphGUI Class Reference

Class ilPCParagraphGUI User Interface for Paragraph Editing. More...

+ Inheritance diagram for ilPCParagraphGUI:
+ Collaboration diagram for ilPCParagraphGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 execute command More...
 
 determineCharacteristic (bool $a_insert=false)
 Determine current characteristic. More...
 
 editJS ()
 Edit paragraph (Ajax mode, sends the content of the paragraph) More...
 
 editMultipleJS ()
 Edit multiple paragraphs (Ajax mode, sends the content of the paragraphs) More...
 
 outputError (array $a_err)
 Output error. More...
 
 cancel ()
 
 insertCharacteristicTable (ilTemplate $a_tpl, string $a_seleted_value)
 Insert characteristic table. More...
 
 insertStyleSelectionList (ilTemplate $a_tpl, string $a_selected)
 Insert style selection list. More...
 
 insert ()
 insert paragraph form More...
 
 update ()
 update paragraph in dom and update page in db More...
 
 create ()
 create new paragraph in dom and update page in db More...
 
 insertHelp (ilTemplate $a_tpl)
 Insert Help. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Static Public Member Functions

static _getStandardCharacteristics ()
 Get standard characteristics. More...
 
static _getStandardTextCharacteristics ()
 Get standard characteristics. More...
 
static _getCharacteristics (int $a_style_id)
 Get characteristics. More...
 
static xml2outputJS (string $s_text)
 Prepare content for js output. More...
 
static getStyleSelector (string $a_selected, array $a_chars, bool $a_use_callback=false)
 Get style selector. More...
 
static getCharStyleSelector (string $a_par_type, bool $a_use_callback=true, int $a_style_id=0)
 Get character style selector. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 

Protected Attributes

ilObjUser $user
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
Style Content CharacteristicManager $char_manager
 

Private Member Functions

 setStyle ()
 

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
php4DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

Class ilPCParagraphGUI User Interface for Paragraph Editing.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilPCParagraphGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCParagraphGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 30 of file class.ilPCParagraphGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), _getStandardCharacteristics(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), and ILIAS\Repository\user().

35  {
36  global $DIC;
37 
38  $this->user = $DIC->user();
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
42 
43  // characteristics (should be flexible in the future)
45  }
setCharacteristics(array $a_chars)
static _getStandardCharacteristics()
Get standard characteristics.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getCharacteristics()

static ilPCParagraphGUI::_getCharacteristics ( int  $a_style_id)
static

Get characteristics.

Definition at line 79 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\$char_manager, ilPageContentGUI\$chars, $DIC, ilPageContentGUI\$request, ilPageContentGUI\$requested_ref_id, $service, ilPageContentGUI\$style, _getStandardCharacteristics(), and ilObject\_lookupType().

Referenced by ILIAS\COPage\Editor\Components\Paragraph\ParagraphStyleSelector\getStyleSelector(), and ilPageEditorGUI\initCharacteristicForm().

79  : array
80  {
81  global $DIC;
82  $request = $DIC->copage()->internal()
83  ->gui()
84  ->pc()
85  ->editRequest();
86  $requested_ref_id = $request->getRefId();
87 
88  $service = $DIC->contentStyle()->internal();
89 
92  if ($a_style_id > 0 &&
93  ilObject::_lookupType($a_style_id) == "sty") {
94  $access_manager = $service->domain()->access(
96  $DIC->user()->getId()
97  );
98  $char_manager = $service->domain()->characteristic(
99  $a_style_id,
100  $access_manager
101  );
102 
103  $chars = $char_manager->getByTypes(
104  ["text_block", "heading1", "heading2", "heading3"],
105  false,
106  false
107  );
108  $new_chars = array();
109  foreach ($chars as $char) {
110  if (($st_chars[$char->getCharacteristic()] ?? "") != "") { // keep lang vars for standard chars
111  $title = $char_manager->getPresentationTitle(
112  $char->getType(),
113  $char->getCharacteristic()
114  );
115  if ($title == "") {
116  $title = $st_chars[$char->getCharacteristic()];
117  }
118  $new_chars[$char->getCharacteristic()] = $title;
119  } else {
120  $new_chars[$char->getCharacteristic()] = $char_manager->getPresentationTitle(
121  $char->getType(),
122  $char->getCharacteristic()
123  );
124  }
125  }
126  $chars = $new_chars;
127  }
128 
129  return $chars;
130  }
static _getStandardCharacteristics()
Get standard characteristics.
global $DIC
Definition: feed.php:28
Style Content CharacteristicManager $char_manager
static _lookupType(int $id, bool $reference=false)
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getStandardCharacteristics()

static ilPCParagraphGUI::_getStandardCharacteristics ( )
static

Get standard characteristics.

Definition at line 50 of file class.ilPCParagraphGUI.php.

References $DIC, ilPageContentGUI\$lng, and ilLanguage\txt().

Referenced by __construct(), and _getCharacteristics().

50  : array
51  {
52  global $DIC;
53 
54  $lng = $DIC->language();
55 
56  return array("Standard" => $lng->txt("cont_standard"),
57  "Headline1" => $lng->txt("cont_Headline1"),
58  "Headline2" => $lng->txt("cont_Headline2"),
59  "Headline3" => $lng->txt("cont_Headline3"),
60  "Book" => $lng->txt("cont_Book"),
61  "Numbers" => $lng->txt("cont_Numbers"),
62  "Verse" => $lng->txt("cont_Verse"),
63  "List" => $lng->txt("cont_List"),
64  "TableContent" => $lng->txt("cont_TableContent")
65  );
66  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getStandardTextCharacteristics()

static ilPCParagraphGUI::_getStandardTextCharacteristics ( )
static

Get standard characteristics.

Definition at line 71 of file class.ilPCParagraphGUI.php.

71  : array
72  {
73  return ["Mnemonic", "Attention"];
74  }

◆ cancel()

ilPCParagraphGUI::cancel ( )

Definition at line 378 of file class.ilPCParagraphGUI.php.

References ILIAS\Repository\ctrl().

378  : void
379  {
380  $this->log->debug("ilPCParagraphGUI, cancel(): return to parent: jump" . $this->hier_id);
381  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
382  }
+ Here is the call graph for this function:

◆ create()

ilPCParagraphGUI::create ( )

create new paragraph in dom and update page in db

Definition at line 661 of file class.ilPCParagraphGUI.php.

References ILIAS\Repository\ctrl(), ilPageContentGUI\getPage(), insert(), and ilPageContentGUI\setCurrentTextLang().

661  : void
662  {
663  $this->log->debug("ilPCParagraphGUI, create(): start.");
664 
665  if ($this->request->getString("ajaxform_hier_id") != "") {
666  $this->createJS();
667  return;
668  }
669 
670  $this->content_obj = new ilPCParagraph($this->getPage());
671  //echo "+".$this->pc_id."+";
672  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
673 
674  $this->content_obj->setLanguage(
675  $this->request->getString("par_language")
676  );
677  $this->setCurrentTextLang($this->request->getString("par_language"));
678  $this->content_obj->setCharacteristic(
679  $this->request->getString("par_characteristic")
680  );
681 
682  $this->updated = $this->content_obj->setText(
683  $this->content_obj->input2xml(
684  $this->request->getRaw("par_content"),
685  $this->request->getString("usedwsiwygeditor")
686  ),
687  true
688  );
689 
690  if ($this->updated !== true) {
691  $this->insert();
692  return;
693  }
694  $this->updated = $this->content_obj->updatePage($this->pg_obj);
695 
696  if ($this->updated === true) {
697  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
698  } else {
699  $this->insert();
700  }
701  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert()
insert paragraph form
setCurrentTextLang(string $lang_key)
+ Here is the call graph for this function:

◆ determineCharacteristic()

ilPCParagraphGUI::determineCharacteristic ( bool  $a_insert = false)

Determine current characteristic.

Definition at line 213 of file class.ilPCParagraphGUI.php.

References ILIAS\Repository\ctrl(), and ilPageContentGUI\getHierId().

Referenced by editJS().

213  : string
214  {
215  $cmd = $this->ctrl->getCmd();
216  // language and characteristic selection
217  if (!$a_insert) {
218  if ($cmd == "update") {
219  $s_char = $this->request->getString("par_characteristic");
220  } else {
221  $s_char = $this->content_obj->getCharacteristic();
222  if ($s_char == "") {
223  $s_char = "Standard";
224  }
225  }
226  } else {
227  if ($cmd == "create_par") {
228  $s_char = $this->request->getString("par_characteristic");
229  } else {
230  $s_char = "Standard";
231 
232  // set characteristic of new paragraphs in list items to "List"
233  $cont_obj = $this->pg_obj->getContentObject($this->getHierId());
234  if (is_object($cont_obj)) {
235  if ($cont_obj->getType() == "li" ||
236  ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "List")) {
237  $s_char = "List";
238  }
239 
240  if ($cont_obj->getType() == "td" ||
241  ($cont_obj->getType() == "par" && $cont_obj->getCharacteristic() == "TableContent")) {
242  $s_char = "TableContent";
243  }
244  }
245  }
246  }
247  return $s_char;
248  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editJS()

ilPCParagraphGUI::editJS ( )

Edit paragraph (Ajax mode, sends the content of the paragraph)

Definition at line 253 of file class.ilPCParagraphGUI.php.

References determineCharacteristic(), exit, and xml2outputJS().

253  : void
254  {
255  $s_text = $this->content_obj->getText();
256  $this->log->debug("step 1: " . substr($s_text, 0, 1000));
257 
258  //echo "\n<br><br>".htmlentities($s_text);
259  $s_text = $this->content_obj->xml2output($s_text, true, false);
260  $this->log->debug("step 2: " . substr($s_text, 0, 1000));
261 
262  //echo "\n<br><br>".htmlentities($s_text);
263  $char = $this->determineCharacteristic(false);
264  $s_text = ilPCParagraphGUI::xml2outputJS($s_text);
265  $this->log->debug("step 3: " . substr($s_text, 0, 1000));
266 
267  //echo "\n<br><br>".htmlentities($s_text);
268  $ids = "###" . $this->content_obj->readHierId() . ":" . $this->content_obj->readPCId() . "###" .
269  $char . "###";
270  echo $ids . $s_text;
271  $this->log->debug("step 4: " . substr($ids . $s_text, 0, 1000));
272  exit;
273  }
static xml2outputJS(string $s_text)
Prepare content for js output.
exit
Definition: login.php:28
determineCharacteristic(bool $a_insert=false)
Determine current characteristic.
+ Here is the call graph for this function:

◆ editMultipleJS()

ilPCParagraphGUI::editMultipleJS ( )

Edit multiple paragraphs (Ajax mode, sends the content of the paragraphs)

Definition at line 278 of file class.ilPCParagraphGUI.php.

References exit.

278  : void
279  {
280  echo $this->content_obj->getParagraphSequenceContent($this->pg_obj);
281  exit;
282  }
exit
Definition: login.php:28

◆ executeCommand()

ilPCParagraphGUI::executeCommand ( )

execute command

Returns
mixed

Definition at line 186 of file class.ilPCParagraphGUI.php.

References ILIAS\Repository\ctrl(), and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

187  {
188  // get next class that processes or forwards current command
189  $next_class = $this->ctrl->getNextClass($this);
190 
192  array("text_block", "heading1", "heading2", "heading3")
193  ); // scorm-2004
194 
195  // get current command
196  $cmd = $this->ctrl->getCmd();
197 
198  $this->log->debug("ilPCParagraphGUI: executeCommand " . $cmd);
199 
200  switch ($next_class) {
201  default:
202  $ret = $this->$cmd();
203  break;
204  }
205 
206  return $ret;
207  }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
+ Here is the call graph for this function:

◆ getCharStyleSelector()

static ilPCParagraphGUI::getCharStyleSelector ( string  $a_par_type,
bool  $a_use_callback = true,
int  $a_style_id = 0 
)
static

Get character style selector.

Definition at line 508 of file class.ilPCParagraphGUI.php.

References $c, ilPageContentGUI\$chars, $DIC, ILIAS\LTI\ToolProvider\$key, ilPageContentGUI\$lng, ilAdvancedSelectionListGUI\DOWN_ARROW_DARK, ilPageEditorSettings\lookupSettingByParentType(), ilAdvancedSelectionListGUI\ON_ITEM_CLICK_NOP, and ilLanguage\txt().

Referenced by ilPageObjectGUI\getTinyMenu().

512  : string {
513  global $DIC;
514 
515  $lng = $DIC->language();
516 
517  $selection = new ilAdvancedSelectionListGUI();
518  $selection->setPullRight(false);
519  $selection->setFormSelectMode(
520  "char_characteristic",
521  "",
522  false,
523  "",
524  "",
525  "",
526  "",
527  "",
528  "",
529  ""
530  );
531  $selection->setId("char_style_selection");
532  $selection->setSelectionHeaderClass("ilEditSubmit");
533  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
534  //$selection->setSelectedValue($a_selected);
535  $selection->setUseImages(false);
536  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_NOP);
537  $selection->setSelectCallback("ilCOPage.setCharacterClass");
538 
539  //$chars = $a_chars;
540  //$title_char = ($chars[$a_selected] != "")
541  // ? $chars[$a_selected]
542  // : $a_selected;
543  $selection->setListTitle("&nbsp;<i>A</i>");
544 
545  /*if ($chars[$a_seleted] == "" && ($a_seleted != ""))
546  {
547  $chars = array_merge(array($a_seleted => $a_seleted),
548  $chars);
549  }*/
550 
551  $chars = array(
552  "Comment" => array("code" => "com", "txt" => $lng->txt("cont_char_style_com")),
553  "Quotation" => array("code" => "quot", "txt" => $lng->txt("cont_char_style_quot")),
554  "Accent" => array("code" => "acc", "txt" => $lng->txt("cont_char_style_acc")),
555  "Code" => array("code" => "code", "txt" => $lng->txt("cont_char_style_code"))
556  );
557 
558  foreach (ilPCParagraphGUI::_getTextCharacteristics($a_style_id) as $c) {
559  if (!isset($chars[$c])) {
560  $chars[$c] = array("code" => "", "txt" => $c);
561  }
562  }
563 
564  foreach ($chars as $key => $char) {
566  $a_par_type,
567  "active_" . $char["code"],
568  true
569  )) {
570  $t = "text_inline";
571  $tag = "span";
572  switch ($key) {
573  case "Code": $tag = "code"; break;
574  }
575  $html = '<' . $tag . ' class="ilc_' . $t . '_' . $key . '" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">' . $char["txt"] . "</" . $tag . ">";
576 
577  // this next line is very important for IE. The real onclick event is on the surrounding <tr> of the
578  // advanced selection list. But it is impossible to prevent the tr-event from removing the focus
579  // on tiny withouth the following line, that receives the click event before and stops the faulty default
580  // bevaviour of IE, see bug report #8723
581  $html = '<a class="nostyle" style="display:block;" href="#" onclick="return false;">' . $html . "</a>";
582  $selection->addItem(
583  $char["txt"],
584  $key,
585  "",
586  "",
587  $key,
588  "",
589  $html
590  );
591  }
592  }
593  return $selection->getHTML();
594  }
static lookupSettingByParentType(string $a_par_type, string $a_name, string $a_default='0')
Lookup setting by parent type.
$c
Definition: cli.php:38
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStyleSelector()

static ilPCParagraphGUI::getStyleSelector ( string  $a_selected,
array  $a_chars,
bool  $a_use_callback = false 
)
static

Get style selector.

Definition at line 440 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\$chars, ilAdvancedSelectionListGUI\DOWN_ARROW_DARK, and ilAdvancedSelectionListGUI\ON_ITEM_CLICK_FORM_SELECT.

444  : string {
445  $a_seleted = "";
446  $selection = new ilAdvancedSelectionListGUI();
447  $selection->setPullRight(false);
448  $selection->setFormSelectMode(
449  "par_characteristic",
450  "",
451  false,
452  "",
453  "",
454  "",
455  "",
456  "",
457  "",
458  ""
459  );
460  $selection->setId("style_selection");
461  $selection->setSelectionHeaderClass("ilEditSubmit ilTinyMenuDropDown");
462  $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
463  $selection->setSelectedValue($a_selected);
464  $selection->setUseImages(false);
465  $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT);
466  if ($a_use_callback) {
467  $selection->setSelectCallback("ilCOPage.setParagraphClass");
468  }
469 
470  $chars = $a_chars;
471  $title_char = ($chars[$a_selected] != "")
472  ? $chars[$a_selected]
473  : $a_selected;
474  $selection->setListTitle($title_char);
475 
476  if ($chars[$a_seleted] == "" && ($a_seleted != "")) {
477  $chars = array_merge(
478  array($a_seleted => $a_seleted),
479  $chars
480  );
481  }
482 
483  foreach ($chars as $char => $char_lang) {
484  $t = "text_block";
485  $tag = "div";
486  switch ($char) {
487  case "Headline1": $t = "heading1"; $tag = "h1"; break;
488  case "Headline2": $t = "heading2"; $tag = "h2"; break;
489  case "Headline3": $t = "heading3"; $tag = "h3"; break;
490  }
491  $html = '<div class="ilCOPgEditStyleSelectionItem"><' . $tag . ' class="ilc_' . $t . '_' . $char . '" style="' . self::$style_selector_reset . '">' . $char_lang . "</" . $tag . "></div>";
492  $selection->addItem(
493  $char_lang,
494  $char,
495  "",
496  "",
497  $char,
498  "",
499  $html
500  );
501  }
502  return $selection->getHTML();
503  }

◆ insert()

ilPCParagraphGUI::insert ( )

insert paragraph form

Definition at line 613 of file class.ilPCParagraphGUI.php.

Referenced by create().

613  : string
614  {
615  $this->log->debug("ilPCParagraphGUI, saveJS: got updated value " . $this->updated);
616  return $this->edit(true);
617  }
+ Here is the caller graph for this function:

◆ insertCharacteristicTable()

ilPCParagraphGUI::insertCharacteristicTable ( ilTemplate  $a_tpl,
string  $a_seleted_value 
)

Insert characteristic table.

Definition at line 387 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\$chars, $i, ilPageContentGUI\getCharacteristics(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilTemplate\touchBlock().

390  : void {
391  $i = 0;
392 
393  $chars = $this->getCharacteristics();
394 
395  if ($chars[$a_seleted_value] == "" && ($a_seleted_value != "")) {
396  $chars = array_merge(
397  array($a_seleted_value => $a_seleted_value),
398  $chars
399  );
400  }
401 
402  foreach ($chars as $char => $char_lang) {
403  $a_tpl->setCurrentBlock("characteristic_cell");
404  $a_tpl->setVariable(
405  "CHAR_HTML",
406  '<div class="ilc_text_block_' . $char . '" style="margin-top:2px; margin-bottom:2px; position:static;">' . $char_lang . "</div>"
407  );
408  $a_tpl->setVariable("CHAR_VALUE", $char);
409  if ($char == $a_seleted_value) {
410  $a_tpl->setVariable(
411  "SELECTED",
412  ' checked="checked" '
413  );
414  }
415  $a_tpl->parseCurrentBlock();
416  if ((($i + 1) % 3) == 0) { //
417  $a_tpl->touchBlock("characteristic_row");
418  }
419  $i++;
420  }
421  $a_tpl->touchBlock("characteristic_table");
422  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ insertHelp()

ilPCParagraphGUI::insertHelp ( ilTemplate  $a_tpl)

Insert Help.

Definition at line 706 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\$lng, ilPageContentGUI\getPageConfig(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

706  : void
707  {
708  $lng = $this->lng;
709 
710  $a_tpl->setCurrentBlock("help_item");
711  $a_tpl->setVariable("TXT_HELP", "<b>" . $lng->txt("cont_syntax_help") . "</b>");
712  $a_tpl->parseCurrentBlock();
713  $a_tpl->setCurrentBlock("help_item");
714  $a_tpl->setVariable("TXT_HELP", "* " . $lng->txt("cont_bullet_list"));
715  $a_tpl->parseCurrentBlock();
716  $a_tpl->setCurrentBlock("help_item");
717  $a_tpl->setVariable("TXT_HELP", "# " . $lng->txt("cont_numbered_list"));
718  $a_tpl->parseCurrentBlock();
719  $a_tpl->setCurrentBlock("help_item");
720  $a_tpl->setVariable("TXT_HELP", "=" . $lng->txt("cont_Headline1") . "=<br />" .
721  "==" . $lng->txt("cont_Headline2") . "==<br />" .
722  "===" . $lng->txt("cont_Headline3") . "===");
723  $a_tpl->parseCurrentBlock();
724 
725  if ($this->getPageConfig()->getEnableWikiLinks()) {
726  $a_tpl->setCurrentBlock("help_item");
727  $a_tpl->setVariable("TXT_HELP", "[[" . $lng->txt("cont_wiki_page_link") . "]]");
728  $a_tpl->parseCurrentBlock();
729  }
730 
731  $a_tpl->setCurrentBlock("help");
732  $a_tpl->parseCurrentBlock();
733  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ insertStyleSelectionList()

ilPCParagraphGUI::insertStyleSelectionList ( ilTemplate  $a_tpl,
string  $a_selected 
)

Insert style selection list.

Definition at line 427 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\getCharacteristics(), and HTML_Template_IT\setVariable().

430  : void {
431  $a_tpl->setVariable("ADV_SEL_STYLE", self::getStyleSelector(
432  $a_selected,
433  $this->getCharacteristics()
434  ));
435  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
+ Here is the call graph for this function:

◆ outputError()

ilPCParagraphGUI::outputError ( array  $a_err)

Output error.

Definition at line 367 of file class.ilPCParagraphGUI.php.

References exit.

367  : void
368  {
369  $err_str = "";
370  foreach ($a_err as $err) {
371  $err_str .= $err[1] . "<br />";
372  }
373  echo $err_str;
374  $this->log->debug("ilPCParagraphGUI, outputError() and exit: " . substr($err_str, 0, 100));
375  exit;
376  }
exit
Definition: login.php:28

◆ setStyle()

ilPCParagraphGUI::setStyle ( )
private

Definition at line 596 of file class.ilPCParagraphGUI.php.

References ilObjContentObject\_lookupStyleSheetId(), and ilObjStyleSheet\getContentStylePath().

596  : void
597  {
598  if ($this->pg_obj->getParentType() == "gdf" ||
599  $this->pg_obj->getParentType() == "lm") {
600  if ($this->pg_obj->getParentType() != "gdf") {
601  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(
602  ilObjContentObject::_lookupStyleSheetId($this->pg_obj->getParentId())
603  ));
604  } else {
605  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0));
606  }
607  }
608  }
static _lookupStyleSheetId(int $a_cont_obj_id)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
+ Here is the call graph for this function:

◆ update()

ilPCParagraphGUI::update ( )

update paragraph in dom and update page in db

Definition at line 622 of file class.ilPCParagraphGUI.php.

References ILIAS\Repository\ctrl().

622  : void
623  {
624  $this->log->debug("ilPCParagraphGUI, update(): start");
625 
626  // set language and characteristic
627  $this->content_obj->setLanguage(
628  $this->request->getString("par_language")
629  );
630  $this->content_obj->setCharacteristic(
631  $this->request->getString("par_characteristic")
632  );
633 
634  $this->updated = $this->content_obj->setText(
635  $this->content_obj->input2xml(
636  $this->request->getRaw("par_content"),
637  $this->request->getString("usedwsiwygeditor")
638  ),
639  true
640  );
641  if ($this->updated !== true) {
642  $this->edit();
643  return;
644  }
645 
646  $this->updated = $this->content_obj->updatePage($this->pg_obj);
647 
648 
649  if ($this->updated === true) {
650  $this->log->debug("ilPCParagraphGUI, update(): return to parent: jump" . $this->hier_id);
651  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
652  } else {
653  $this->log->debug("ilPCParagraphGUI, update(): call edit.");
654  $this->edit();
655  }
656  }
+ Here is the call graph for this function:

◆ xml2outputJS()

static ilPCParagraphGUI::xml2outputJS ( string  $s_text)
static

Prepare content for js output.

Definition at line 287 of file class.ilPCParagraphGUI.php.

References ilPageContentGUI\_getCommonBBButtons(), and ilPCParagraph\attribsToArray().

Referenced by editJS(), ilPCDataTableGUI\getCellContent(), ilPCTable\getModel(), ilPCParagraph\getModel(), and ilPCParagraph\getParagraphSequenceContent().

287  : string
288  {
289  // lists
290  $s_text = str_replace(
291  array("<SimpleBulletList>", "</SimpleBulletList>"),
292  array("<ul class='ilc_list_u_BulletedList'>", "</ul>"),
293  $s_text
294  );
295  $s_text = str_replace(
296  array("<SimpleNumberedList>", "</SimpleNumberedList>"),
297  array("<ol class='ilc_list_o_NumberedList'>", "</ol>"),
298  $s_text
299  );
300  $s_text = str_replace(
301  array("<SimpleListItem>", "</SimpleListItem>"),
302  array("<li class='ilc_list_item_StandardListItem'>", "</li>"),
303  $s_text
304  );
305  $s_text = str_replace(
306  array("<SimpleListItem/>"),
307  array("<li class='ilc_list_item_StandardListItem'></li>"),
308  $s_text
309  );
310 
311  // spans
312  foreach (ilPageContentGUI::_getCommonBBButtons() as $bb => $cl) {
313  if (!in_array($bb, array("code", "tex", "fn", "xln", "sub", "sup"))) {
314  $s_text = str_replace(
315  "[" . $bb . "]",
316  '<span class="ilc_text_inline_' . $cl . '">',
317  $s_text
318  );
319  $s_text = str_replace(
320  "[/" . $bb . "]",
321  '</span>',
322  $s_text
323  );
324  }
325  }
326 
327  // marked text spans
328  $ws = "[ \t\r\f\v\n]*";
329  while (preg_match("~\[(marked$ws(class$ws=$ws\"([^\"])*\")$ws)\]~i", $s_text, $found)) {
330  $attribs = ilPCParagraph::attribsToArray($found[2]);
331  if (isset($attribs["class"])) {
332  $s_text = str_replace("[" . $found[1] . "]", "<span class=\"ilc_text_inline_" . $attribs["class"] . "\">", $s_text);
333  } else {
334  $s_text = str_replace("[" . $found[1] . "]", "[error:marked" . $found[1] . "]", $s_text);
335  }
336  }
337  $s_text = preg_replace('~\[\/marked\]~i', "</span>", $s_text);
338 
339 
340  // code
341  $s_text = str_replace(
342  array("[code]", "[/code]"),
343  array("<code>", "</code>"),
344  $s_text
345  );
346 
347  // sup
348  $s_text = str_replace(
349  array("[sup]", "[/sup]"),
350  array('<sup class="ilc_sup_Sup">', "</sup>"),
351  $s_text
352  );
353 
354  // sub
355  $s_text = str_replace(
356  array("[sub]", "[/sub]"),
357  array('<sub class="ilc_sub_Sub">', "</sub>"),
358  $s_text
359  );
360 
361  return $s_text;
362  }
static attribsToArray(string $a_str)
converts a string of format var1 = "val1" var2 = "val2" ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $user

ilObjUser ilPCParagraphGUI::$user
protected

Definition at line 28 of file class.ilPCParagraphGUI.php.


The documentation for this class was generated from the following file: