ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilPCCurriculumGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
27 {
28  public const CMD_INSERT = 'insert';
29  public const CMD_EDIT = 'edit';
30 
31  public function executeCommand(): void
32  {
33  $next_class = $this->ctrl->getNextClass($this);
34  switch ($next_class) {
35  default:
36  $cmd = $this->ctrl->getCmd(self::CMD_EDIT);
37  switch ($cmd) {
38  case self::CMD_INSERT:
39  $this->insertNewContentObj();
40  // no break
41  case self::CMD_EDIT:
42  $this->returnToParent();
43  break;
44 
45  default:
46  throw new Exception('unknown command: ' . $cmd);
47  }
48  }
49  }
50 
51  protected function returnToParent(): void
52  {
53  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
54  }
55 
56  protected function createNewPageContent(): ilPCCurriculum
57  {
58  return new ilPCCurriculum(
59  $this->getPage()
60  );
61  }
62 
63  public function insertNewContentObj(): void
64  {
65  $this->content_obj = $this->createNewPageContent();
66  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
67  $this->pg_obj->update();
68  }
69 }
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...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)