ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI Class Reference
+ Collaboration diagram for ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI:

Public Member Functions

 __construct (protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id, protected bool $in_repository)
 
 executeCommand ()
 

Protected Member Functions

 edit ()
 
 getTable ()
 
 saveOrder ()
 

Protected Attributes

SettingsManager $settings
 

Detailed Description

Definition at line 33 of file class.BlockSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::__construct ( protected InternalDataService  $data,
protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected int  $obj_id,
protected bool  $in_repository 
)

Definition at line 37 of file class.BlockSettingsGUI.php.

References ILIAS\Repository\settings().

Referenced by ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\getTable().

43  {
44  $this->settings = $domain->blogSettings();
45  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ edit()

ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::edit ( )
protected

Definition at line 61 of file class.BlockSettingsGUI.php.

References $r.

61  : void
62  {
63  $mt = $this->gui->ui()->mainTemplate();
64  $r = $this->gui->ui()->renderer();
65  $mt->setContent($r->render($this->getTable()));
66  }
$r

◆ executeCommand()

ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::executeCommand ( )

Definition at line 47 of file class.BlockSettingsGUI.php.

47  : void
48  {
49  $ctrl = $this->gui->ctrl();
50  $next_class = $ctrl->getNextClass($this);
51  $cmd = $ctrl->getCmd("edit");
52 
53  switch ($next_class) {
54  default:
55  if (in_array($cmd, ["edit", "saveOrder"])) {
56  $this->$cmd();
57  }
58  }
59  }

◆ getTable()

ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::getTable ( )
protected

Definition at line 68 of file class.BlockSettingsGUI.php.

References Vendor\Package\$f, $id, $lng, ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\$settings, ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\__construct(), and ILIAS\Repository\settings().

Referenced by ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\saveOrder().

68  : Ordering
69  {
70  $f = $this->gui->ui()->factory();
71  $lng = $this->domain->lng();
73  $ctrl = $this->gui->ctrl();
74 
75  $request = $this->gui->http()->request();
76 
77  $columns = [
78  'block' => $f->table()->column()->text($lng->txt("blog_side_blocks"))
79  ->withHighlight(true)
80  ];
81 
82  $actions = [];
83 
84  $data_retrieval = new class (
85  $settings,
86  $this->obj_id,
87  $this->in_repository
88  ) implements OrderingRetrieval {
89  protected array $records;
90 
91  public function __construct(
92  protected SettingsManager $settings,
93  protected int $blog_id,
94  protected bool $in_repository
95  ) {
96  }
97 
98  public function getRows(
99  OrderingRowBuilder $row_builder,
100  array $visible_column_ids
101  ): \Generator {
102  foreach ($this->settings->getOrderingOptions(
103  $this->settings->getByObjId(
104  $this->blog_id
105  ),
106  $this->in_repository
107  ) as $id => $option) {
108  yield $row_builder->buildOrderingRow(
109  $id,
110  ["block" => $option]
111  );
112  }
113  }
114  };
115 
116  $target = $ctrl->getLinkTargetByClass([self::class], "saveOrder");
117  $target = (new URI(ILIAS_HTTP_PATH . "/" . $target));
118  $table = $f->table()->ordering($data_retrieval, $target, $lng->txt("blog_nav_sortorder"), $columns)
119  ->withActions($actions)
120  ->withRequest($request);
121 
122  return $table;
123  }
__construct(protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id, protected bool $in_repository)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOrder()

ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::saveOrder ( )
protected

Definition at line 125 of file class.BlockSettingsGUI.php.

References $lng, ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI\getTable(), and ILIAS\Repository\settings().

125  : void
126  {
127  $mt = $this->gui->ui()->mainTemplate();
128  $lng = $this->domain->lng();
129  $ctrl = $this->gui->ctrl();
130 
131  $this->settings->saveOrder(
132  $this->obj_id,
133  $this->getTable()->getData()
134  );
135 
136  $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
137  $ctrl->redirectByClass(self::class, "edit");
138  }
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $settings

SettingsManager ILIAS\MetaData\OERHarvester\Settings\Settings\BlockSettingsGUI::$settings
protected

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