ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Wiki\Settings\SettingsGUI Class Reference
+ Collaboration diagram for ILIAS\Wiki\Settings\SettingsGUI:

Public Member Functions

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

Protected Member Functions

 edit ()
 
 getEditForm ()
 
 save ()
 

Protected Attributes

ilSetting $global_settings
 

Detailed Description

Definition at line 28 of file class.SettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Wiki\Settings\SettingsGUI::__construct ( protected InternalDataService  $data,
protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected int  $obj_id,
protected int  $ref_id 
)

Definition at line 32 of file class.SettingsGUI.php.

38  {
39  $this->global_settings = $this->domain->settings();
40  }

Member Function Documentation

◆ edit()

ILIAS\Wiki\Settings\SettingsGUI::edit ( )
protected

Definition at line 56 of file class.SettingsGUI.php.

References ILIAS\Wiki\Settings\SettingsGUI\getEditForm().

56  : void
57  {
58  $mt = $this->gui->ui()->mainTemplate();
59  $form = $this->getEditForm();
60  $mt->setContent($form->render());
61  }
+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\Wiki\Settings\SettingsGUI::executeCommand ( )

Definition at line 42 of file class.SettingsGUI.php.

42  : void
43  {
44  $ctrl = $this->gui->ctrl();
45  $next_class = $ctrl->getNextClass($this);
46  $cmd = $ctrl->getCmd("edit");
47 
48  switch ($next_class) {
49  default:
50  if (in_array($cmd, ["edit", "save"])) {
51  $this->$cmd();
52  }
53  }
54  }

◆ getEditForm()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::getEditForm ( )
protected

Definition at line 63 of file class.SettingsGUI.php.

References $lng, ILIAS\Repository\Form\addAdditionalFeatures(), ILIAS\Repository\Form\addOnline(), ILIAS\Repository\Form\addStdTile(), ILIAS\Repository\Form\addStdTitleAndDescription(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, and null.

Referenced by ILIAS\Wiki\Settings\SettingsGUI\edit(), and ILIAS\Wiki\Settings\SettingsGUI\save().

63  : FormAdapterGUI
64  {
65  $settings = $this->domain->wikiSettings()->getById($this->obj_id);
66  $start_page_options = $this->domain->wikiSettings()->getStartPageOptions($this->ref_id);
67  $start_page_id = $this->domain->wikiSettings()->getStartPageId($settings);
68 
69  $lng = $this->domain->lng();
70  $lng->loadLanguageModule("rating");
71 
72  $form = $this->gui
73  ->form(self::class, "save")
74  ->section("general", $lng->txt("wiki_settings"))
75  ->addStdTitleAndDescription($this->obj_id, "wiki")
76  ->textarea(
77  "introduction",
78  $lng->txt("wiki_introduction"),
79  "",
80  (string) $settings->getIntroduction()
81  )
82  ->select(
83  "start_page",
84  $lng->txt("wiki_start_page"),
85  $start_page_options,
86  "",
87  $start_page_id ? (string) $start_page_id : null
88  )->required()
89  ->section("avail", $lng->txt("rep_activation_availability"))
90  ->addOnline($this->obj_id, "wiki")
91  ->addStdAvailability($this->ref_id)
92  ->section("presentation", $lng->txt("obj_presentation"))
93  ->addStdTile($this->obj_id, "wiki")
94  ->checkbox(
95  "page_toc",
96  $lng->txt("wiki_page_toc"),
97  $lng->txt("wiki_page_toc_info"),
98  (bool) $settings->getPageToc()
99  )
101  $this->obj_id,
102  [
104  ]
105  )
106  ->checkbox(
107  "rating_overall",
108  $lng->txt("rating_activate_rating"),
109  $lng->txt("rating_activate_rating_info"),
110  (bool) $settings->getRatingOverall()
111  )
112  ->optional(
113  "rating",
114  $lng->txt("wiki_activate_rating"),
115  "",
116  (bool) $settings->getRating()
117  )
118  ->checkbox(
119  "rating_new",
120  $lng->txt("wiki_activate_new_page_rating"),
121  "",
122  (bool) $settings->getRatingForNewPages()
123  )
124  ->checkbox(
125  "rating_ext",
126  $lng->txt("wiki_activate_extended_rating"),
127  "",
128  (bool) $settings->getRatingCategories()
129  )
130  ->end();
131 
132  if(!$this->global_settings->get("disable_comments")) {
133  $form = $form
134  ->checkbox(
135  "public_notes",
136  $lng->txt("wiki_public_comments"),
137  "",
138  (bool) $settings->getPublicNotes()
139  );
140  }
141 
142  return $form;
143  }
addAdditionalFeatures(int $obj_id, array $services)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addStdTitleAndDescription(int $obj_id, string $type)
addStdTile(int $obj_id, string $type)
global $lng
Definition: privfeed.php:31
addOnline(int $obj_id, string $type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::save ( )
protected

Definition at line 145 of file class.SettingsGUI.php.

References $lng, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ILIAS\Wiki\Settings\SettingsGUI\getEditForm(), and ilWikiPage\lookupTitle().

145  : void
146  {
147  $mt = $this->gui->ui()->mainTemplate();
148  $form = $this->getEditForm();
149  $ctrl = $this->gui->ctrl();
150  $lng = $this->domain->lng();
151 
152  $old_settings = $this->domain->wikiSettings()->getById($this->obj_id);
153 
154  if ($form->isValid()) {
155 
156  $form->saveStdTitleAndDescription($this->obj_id, "wiki");
157  $form->saveStdTile($this->obj_id, "wiki");
158  $form->saveOnline($this->obj_id, "wiki");
159  $form->saveStdAvailability($this->ref_id);
160  $form->saveAdditionalFeatures(
161  $this->obj_id,
162  [
164  ]
165  );
166 
167 
168  $settings = $this->data->settings(
169  $this->obj_id,
170  \ilWikiPage::lookupTitle((int) $form->getData("start_page")),
171  $old_settings->getShortTitle(), // obsolete?
172  (bool) $form->getData("rating_overall"),
173  (bool) $form->getData("rating"),
174  $old_settings->getRatingAsBlock(), // obsolete?
175  (bool) $form->getData("rating_new"),
176  (bool) $form->getData("rating_ext"),
177  (bool) $form->getData("public_notes"),
178  $form->getData("introduction"),
179  (bool) $form->getData("page_toc"),
180  $old_settings->getLinkMetadataValues(), // obsolete?
181  $old_settings->getEmptyPageTemplate() // obsolete?
182  );
183  $this->domain->wikiSettings()->update($settings);
184 
185  $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
186  $ctrl->redirectByClass(self::class, "edit");
187  } else {
188  $mt = $this->gui->ui()->mainTemplate();
189  $mt->setContent($form->render());
190  }
191  }
static lookupTitle(int $a_page_id, string $lang="-")
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $global_settings

ilSetting ILIAS\Wiki\Settings\SettingsGUI::$global_settings
protected

Definition at line 30 of file class.SettingsGUI.php.


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