ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Blog\Settings\BlockSettingsGUI Class Reference
+ Collaboration diagram for ILIAS\Blog\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\Blog\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.

43 {
44 $this->settings = $domain->blogSettings();
45 }

References ILIAS\Blog\InternalDomainService\blogSettings(), and ILIAS\Repository\settings().

Referenced by ILIAS\Blog\Settings\BlockSettingsGUI\getTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ edit()

ILIAS\Blog\Settings\BlockSettingsGUI::edit ( )
protected

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

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

◆ executeCommand()

ILIAS\Blog\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\Blog\Settings\BlockSettingsGUI::getTable ( )
protected

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

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 (
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 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id, protected bool $in_repository)
global $lng
Definition: privfeed.php:31

References Vendor\Package\$f, $id, $lng, ILIAS\Blog\Settings\BlockSettingsGUI\$settings, ILIAS\Blog\Settings\BlockSettingsGUI\__construct(), ILIAS\UI\Component\Table\OrderingRowBuilder\buildOrderingRow(), and ILIAS\Repository\settings().

Referenced by ILIAS\Blog\Settings\BlockSettingsGUI\saveOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOrder()

ILIAS\Blog\Settings\BlockSettingsGUI::saveOrder ( )
protected

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

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 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $settings

SettingsManager ILIAS\Blog\Settings\BlockSettingsGUI::$settings
protected

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