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();
    49         $this->ui_wrapper = 
new Server\UIWrapper($this->
ui, $this->
lng);
    55     public function handle(array $query, array $body): Server\Response
    57         switch ($body[
"action"]) {
    71                 return $this->
format($body);
    74                 return $this->
delete($body);
    84                 throw new Exception(
"Unknown action " . $body[
"action"]);
    88     protected function cutCommand(array $body): Server\Response
    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);
   134     protected function format(array $body): Server\Response
   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);
   153     protected function delete(array $body): Server\Response
   155         $pcids = $body[
"data"][
"pcids"];
   156         $page = $this->page_gui->getPageObject();
   168             $this->page_gui->getPageConfig()->getEnableSelfAssessment()
   170         if ($updated === 
true) {
   171             $this->page_gui->afterDeleteContents();
   179         $target = $body[
"data"][
"target"];
   180         $source = $body[
"data"][
"source"];
   182         $page = $this->page_gui->getPageObject();
   184         $source = explode(
":", $source);
   185         $target = explode(
":", $target);
   187         $updated = $page->moveContentAfter($source[0], $target[0], $source[1], $target[1]);
   198         return $this->ui_wrapper->sendPage($this->page_gui, 
$updated);
   206         $page = $this->page_gui->getPageObject();
   208         if (!in_array($pcid, [
"", 
"pg"])) {
   209             $hier_ids = $page->getHierIdsForPCIds([$pcid]);
   210             $id = $hier_ids[$pcid] . 
":" . $pcid;
   220         $page = $this->page_gui->getPageObject();
   222         if (!in_array($pcid, [
"", 
"pg"])) {
   223             $hier_ids = $page->getHierIdsForPCIds([$pcid]);
   224             $id = $hier_ids[$pcid];
   231         $page = $this->page_gui->getPageObject();
   233         $hier_ids = $page->getHierIdsForPCIds([$body[
"data"][
"pcid"]]);
   234         $pcid = $hier_ids[$body[
"data"][
"pcid"]] . 
":" . $body[
"data"][
"pcid"];
   236         $content = 
"<div id='" .
   237             $pcid . 
"' class='ilc_text_block_" .
   238             $body[
"data"][
"characteristic"] . 
"'>" . $body[
"data"][
"content"] . 
"</div>";
   240         $this->content_obj = new \ilPCParagraph($page);
   242         $this->updated = $this->content_obj->saveJS(
   250         $data = new \stdClass();
   251         $data->renderedContent = 
"Test the rendered content";
   252         return new Server\Response(
$data);
   255     protected function activate(array $body): Server\Response
   257         $pcids = $body[
"data"][
"pcids"];
   258         $page = $this->page_gui->getPageObject();
   267         $updated = $page->switchEnableMultiple(
   270             $this->page_gui->getPageConfig()->getEnableSelfAssessment()
   282     protected function listEdit($body): Server\Response
   284         $pcid = $body[
"data"][
"pcid"];
   285         $list_cmd = $body[
"data"][
"list_cmd"];
   286         $page = $this->page_gui->getPageObject();
   288         $pc = $page->getContentObjectForPcId($pcid);
   295             case "newItemBefore":
   296                 $pc->newItemBefore();
 handle(array $query, array $body)
 
getIdForPCId(string $pcid)
Get id for pcid. 
 
updateCommand(array $body)
 
getHierIdForPCId(string $pcid)
Get hier id for pcid. 
 
__construct(\ilPageObjectGUI $page_gui)
 
ilPageObjectGUI $page_gui
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
sendPage($updated)
Send whole page as response. 
 
pasteCommand(array $body)
 
dragDropCommand(array $body)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ilPCParagraph $content_obj
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
Server UIWrapper $ui_wrapper
 
listEdit($body)
Activate command.