34 protected \ILIAS\DI\UIServices
$ui;
35 protected \ilLanguage
$lng;
44 $this->
ui = $DIC->ui();
45 $this->
lng = $DIC->language();
47 $this->
user = $DIC->user();
57 switch ($body[
"action"]) {
71 return $this->
format($body);
74 return $this->
delete($body);
84 throw new Exception(
"Unknown action " . $body[
"action"]);
90 $pcids = $body[
"data"][
"pcids"];
91 $page = $this->page_gui->getPageObject();
100 $updated = $page->cutContents($hids);
107 $target_pcid = $body[
"data"][
"target_pcid"];
108 $page = $this->page_gui->getPageObject();
111 $page->getPageConfig()->getEnableSelfAssessment()
119 $pcids = $body[
"data"][
"pcids"];
120 $page = $this->page_gui->getPageObject();
129 $page->copyContents($hids);
136 $pcids = $body[
"data"][
"pcids"];
137 $par = $body[
"data"][
"paragraph_format"];
138 $sec = $body[
"data"][
"section_format"];
139 $med = $body[
"data"][
"media_format"];
140 $page = $this->page_gui->getPageObject();
149 $updated = $page->assignCharacteristic($hids, $par, $sec, $med);
155 $pcids = $body[
"data"][
"pcids"];
156 $page = $this->page_gui->getPageObject();
168 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
176 $target = $body[
"data"][
"target"];
177 $source = $body[
"data"][
"source"];
179 $page = $this->page_gui->getPageObject();
182 $target = explode(
":", $target);
195 return $this->ui_wrapper->sendPage($this->page_gui,
$updated);
203 $page = $this->page_gui->getPageObject();
205 if (!in_array($pcid, [
"",
"pg"])) {
206 $hier_ids = $page->getHierIdsForPCIds([$pcid]);
207 $id = $hier_ids[$pcid] .
":" . $pcid;
217 $page = $this->page_gui->getPageObject();
219 if (!in_array($pcid, [
"",
"pg"])) {
220 $hier_ids = $page->getHierIdsForPCIds([$pcid]);
221 $id = $hier_ids[$pcid];
228 $page = $this->page_gui->getPageObject();
230 $hier_ids = $page->getHierIdsForPCIds([$body[
"data"][
"pcid"]]);
231 $pcid = $hier_ids[$body[
"data"][
"pcid"]] .
":" . $body[
"data"][
"pcid"];
233 $content =
"<div id='" .
234 $pcid .
"' class='ilc_text_block_" .
235 $body[
"data"][
"characteristic"] .
"'>" . $body[
"data"][
"content"] .
"</div>";
237 $this->content_obj = new \ilPCParagraph($page);
239 $this->updated = $this->content_obj->saveJS(
247 $data = new \stdClass();
248 $data->renderedContent =
"Test the rendered content";
254 $pcids = $body[
"data"][
"pcids"];
255 $page = $this->page_gui->getPageObject();
264 $updated = $page->switchEnableMultiple(
267 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
281 $pcid = $body[
"data"][
"pcid"];
282 $list_cmd = $body[
"data"][
"list_cmd"];
283 $page = $this->page_gui->getPageObject();
285 $pc = $page->getContentObjectForPcId($pcid);
292 case "newItemBefore":
293 $pc->newItemBefore();
sendPage($updated)
Send whole page as response.
listEdit($body)
Activate command.
ilPCParagraph $content_obj
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Command action handler interface.
pasteCommand(array $body)
Server UIWrapper $ui_wrapper
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateCommand(array $body)
getHierIdForPCId(string $pcid)
Get hier id for pcid.
getIdForPCId(string $pcid)
Get id for pcid.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
dragDropCommand(array $body)
__construct(\ilPageObjectGUI $page_gui)
ilPageObjectGUI $page_gui
handle(array $query, array $body)