ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjStudyProgrammeSettingsGUI Class Reference

ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI More...

+ Collaboration diagram for ilObjStudyProgrammeSettingsGUI:

Public Member Functions

 __construct (ilGlobalTemplateInterface $tpl, ilCtrl $ilCtrl, ilLanguage $lng, Factory $input_factory, Renderer $renderer, Psr\Http\Message\ServerRequestInterface $request, ILIAS\Refinery\Factory $refinery_factory, ILIAS\Data\Factory $data_factory, ilStudyProgrammeTypeRepository $type_repository, ilStudyProgrammeCommonSettingsGUI $common_settings_gui, ilTabsGUI $tabs, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, LOMServices $lom_services)
 
 setRefId (int $ref_id)
 
 executeCommand ()
 

Data Fields

const PROP_TITLE = "title"
 
const PROP_DESC = "desc"
 
const PROP_DEADLINE = "deadline"
 
const PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"
 
const OPT_NO_DEADLINE = 'opt_no_deadline'
 
const OPT_DEADLINE_PERIOD = "opt_deadline_period"
 
const OPT_DEADLINE_DATE = "opt_deadline_date"
 
const OPT_NO_VALIDITY_OF_QUALIFICATION = 'opt_no_validity_qualification'
 
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD = "opt_validity_qualification_period"
 
const OPT_VALIDITY_OF_QUALIFICATION_DATE = "opt_validity_qualification_date"
 

Protected Member Functions

 view ()
 
 update ()
 
 buildForm (ilObjStudyProgramme $prg, string $submit_action)
 
 buildFormElements (InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilStudyProgrammeSettings $settings)
 
 getEditSection (InputFieldFactory $ff, ilObjectTranslation $trans)
 
 getObject ()
 
 txt (string $code)
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ILIAS UI Component Input Factory $input_factory
 
ILIAS UI Renderer $renderer
 
Psr Http Message ServerRequestInterface $request
 
ILIAS Refinery Factory $refinery_factory
 
ILIAS Data Factory $data_factory
 
ilStudyProgrammeTypeRepository $type_repository
 
ilStudyProgrammeCommonSettingsGUI $common_settings_gui
 
ilTabsGUI $tabs
 
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
 
LOMServices $lom_services
 
ilObjStudyProgramme $object
 
string $tmp_heading
 
int $ref_id
 

Private Attributes

const TAB_SETTINGS = 'settings'
 
const TAB_COMMON_SETTINGS = 'commonSettings'
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeSettingsGUI::__construct ( ilGlobalTemplateInterface  $tpl,
ilCtrl  $ilCtrl,
ilLanguage  $lng,
Factory  $input_factory,
Renderer  $renderer,
Psr\Http\Message\ServerRequestInterface  $request,
ILIAS\Refinery\Factory  $refinery_factory,
ILIAS\Data\Factory  $data_factory,
ilStudyProgrammeTypeRepository  $type_repository,
ilStudyProgrammeCommonSettingsGUI  $common_settings_gui,
ilTabsGUI  $tabs,
ILIAS\HTTP\Wrapper\RequestWrapper  $request_wrapper,
LOMServices  $lom_services 
)

Definition at line 66 of file class.ilObjStudyProgrammeSettingsGUI.php.

References $common_settings_gui, $data_factory, $input_factory, $lng, $lom_services, $refinery_factory, $renderer, $request, $request_wrapper, $tabs, $tpl, $type_repository, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), null, renderer(), and ILIAS\Repository\tabs().

80  {
81  $this->tpl = $tpl;
82  $this->ctrl = $ilCtrl;
83  $this->lng = $lng;
84  $this->input_factory = $input_factory;
85  $this->renderer = $renderer;
86  $this->request = $request;
87  $this->refinery_factory = $refinery_factory;
88  $this->data_factory = $data_factory;
89  $this->type_repository = $type_repository;
90  $this->common_settings_gui = $common_settings_gui;
91  $this->tabs = $tabs;
92  $this->request_wrapper = $request_wrapper;
93  $this->lom_services = $lom_services;
94 
95  $this->object = null;
96 
97  $lng->loadLanguageModule("prg");
98  }
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
renderer()
loadLanguageModule(string $a_module)
Load language module.
Psr Http Message ServerRequestInterface $request
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilStudyProgrammeCommonSettingsGUI $common_settings_gui
ILIAS UI Component Input Factory $input_factory
+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilObjStudyProgrammeSettingsGUI::buildForm ( ilObjStudyProgramme  $prg,
string  $submit_action 
)
protected

Definition at line 164 of file class.ilObjStudyProgrammeSettingsGUI.php.

References buildFormElements(), ilContainer\getObjectTranslation(), ilObjStudyProgramme\getSettings(), ilObject\setDescription(), ilObject\setTitle(), ilObjStudyProgramme\updateCustomIcon(), and ilObjStudyProgramme\updateSettings().

Referenced by view().

168  $trans = $prg->getObjectTranslation();
169  $ff = $this->input_factory->field();
170  $sp_types = $this->type_repository->getAllTypesArray();
171  $settings = $prg->getSettings();
172 
173  return $this->input_factory->container()->form()->standard(
174  $submit_action,
175  $this->buildFormElements(
176  $ff,
177  $trans,
178  $sp_types,
179  $settings
180  )
181  )->withAdditionalTransformation(
182  $this->refinery_factory->custom()->transformation(
183  function ($values) use ($prg) {
184  $object_data = $values[0];
185  $prg->setTitle($object_data[self::PROP_TITLE]);
186  $prg->setDescription($object_data[self::PROP_DESC]);
187 
188  $settings = $prg->getSettings()
189  ->withAssessmentSettings($values['prg_assessment'])
190  ->withDeadlineSettings($values['prg_deadline'])
191  ->withValidityOfQualificationSettings($values['prg_validity_of_qualification'])
192  ->withAutoMailSettings($values['automail_settings'])
193  ->withTypeSettings($values['prg_type']);
194 
195  $prg->updateSettings($settings);
196  $prg->updateCustomIcon();
197  return $prg;
198  }
199  )
200  );
201  }
setTitle(string $title)
buildFormElements(InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilStudyProgrammeSettings $settings)
setDescription(string $description)
updateSettings(ilStudyProgrammeSettings $settings)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFormElements()

ilObjStudyProgrammeSettingsGUI::buildFormElements ( InputFieldFactory  $ff,
ilObjectTranslation  $trans,
array  $sp_types,
ilStudyProgrammeSettings  $settings 
)
protected

Definition at line 203 of file class.ilObjStudyProgrammeSettingsGUI.php.

References ilStudyProgrammeSettings\getAssessmentSettings(), ilStudyProgrammeSettings\getAutoMailSettings(), ilStudyProgrammeSettings\getDeadlineSettings(), getEditSection(), ilStudyProgrammeSettings\getTypeSettings(), ilStudyProgrammeSettings\getValidityOfQualificationSettings(), and ILIAS\Repository\lng().

Referenced by buildForm().

208  : array {
209  $return = [
210  $this->getEditSection($ff, $trans),
211  "prg_type" => $settings
212  ->getTypeSettings()
213  ->toFormInput($ff, $this->lng, $this->refinery_factory, $sp_types)
214  ,
215  "prg_assessment" => $settings
217  ->toFormInput($ff, $this->lng, $this->refinery_factory)
218  ,
219  "prg_deadline" => $settings
221  ->toFormInput($ff, $this->lng, $this->refinery_factory, $this->data_factory)
222  ,
223  "prg_validity_of_qualification" => $settings
225  ->toFormInput($ff, $this->lng, $this->refinery_factory, $this->data_factory)
226  ,
227  "automail_settings" => $settings
229  ->toFormInput($ff, $this->lng, $this->refinery_factory)
230  ];
231 
232  return $return;
233  }
getEditSection(InputFieldFactory $ff, ilObjectTranslation $trans)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStudyProgrammeSettingsGUI::executeCommand ( )

Definition at line 105 of file class.ilObjStudyProgrammeSettingsGUI.php.

References ILIAS\Repository\ctrl(), getObject(), null, ILIAS\Repository\tabs(), and view().

105  : void
106  {
107  $next_class = $this->ctrl->getNextClass();
108  switch ($next_class) {
109  case 'ilstudyprogrammecommonsettingsgui':
110  $this->tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
111  $this->common_settings_gui->setObject($this->getObject());
112  $content = $this->ctrl->forwardCommand($this->common_settings_gui);
113  break;
114  default:
115  $cmd = $this->ctrl->getCmd();
116  if ($cmd === "" || $cmd === null) {
117  $cmd = "view";
118  }
119  switch ($cmd) {
120  case "view":
121  $content = $this->view();
122  break;
123  case "update":
124  $content = $this->$cmd();
125  break;
126  default:
127  throw new ilException(
128  "ilObjStudyProgrammeSettingsGUI: Command not supported: $cmd"
129  );
130  }
131  }
132 
133  $this->tpl->setContent($content);
134  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getEditSection()

ilObjStudyProgrammeSettingsGUI::getEditSection ( InputFieldFactory  $ff,
ilObjectTranslation  $trans 
)
protected

Definition at line 235 of file class.ilObjStudyProgrammeSettingsGUI.php.

References $lang, ILIAS\Repository\ctrl(), ilObjectTranslation\getDefaultDescription(), ilObjectTranslation\getDefaultLanguage(), ilObjectTranslation\getDefaultTitle(), txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by buildFormElements().

239  $lang = '?';
240  foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
241  if ($language->value() === $trans->getDefaultLanguage()) {
242  $lang = $language->presentableLabel();
243  }
244  }
245  return $ff->section(
246  [
247  self::PROP_TITLE =>
248  $ff->text($this->txt("title"))
249  ->withValue($trans->getDefaultTitle())
250  ->withRequired(true),
251  self::PROP_DESC =>
252  $ff->textarea($this->txt("description"))
253  ->withValue($trans->getDefaultDescription() ?? "")
254  ],
255  $this->txt("prg_edit"),
256  $this->txt("language") . ": " . $lang .
257  ' <a href="' . $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "") .
258  '">&raquo; ' . $this->txt("obj_more_translations") . '</a>'
259  );
260  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
$lang
Definition: xapiexit.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObject()

ilObjStudyProgrammeSettingsGUI::getObject ( )
protected

Definition at line 262 of file class.ilObjStudyProgrammeSettingsGUI.php.

References $object, ilObjStudyProgramme\getInstanceByRefId(), and null.

Referenced by executeCommand(), update(), and view().

263  {
264  if ($this->object === null) {
265  $this->object = ilObjStudyProgramme::getInstanceByRefId($this->ref_id);
266  }
267  return $this->object;
268  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRefId()

ilObjStudyProgrammeSettingsGUI::setRefId ( int  $ref_id)

Definition at line 100 of file class.ilObjStudyProgrammeSettingsGUI.php.

References $ref_id.

100  : void
101  {
102  $this->ref_id = $ref_id;
103  }

◆ txt()

ilObjStudyProgrammeSettingsGUI::txt ( string  $code)
protected

Definition at line 270 of file class.ilObjStudyProgrammeSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by getEditSection().

270  : string
271  {
272  return $this->lng->txt($code);
273  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilObjStudyProgrammeSettingsGUI::update ( )
protected
Returns
string|void

Definition at line 146 of file class.ilObjStudyProgrammeSettingsGUI.php.

References ILIAS\Repository\ctrl(), getObject(), ILIAS\Repository\lng(), and renderer().

147  {
148  $form = $this
149  ->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "update"))
150  ->withRequest($this->request);
151 
152  $result = $form->getInputGroup()->getContent();
153 
154  if ($result->isOK()) {
155  $result->value()->update();
156  $this->tpl->setOnScreenMessage("success", $this->lng->txt("msg_obj_modified"), true);
157  $this->ctrl->redirect($this);
158  } else {
159  $this->tpl->setOnScreenMessage("failure", $this->lng->txt("msg_form_save_error"));
160  return $this->renderer->render($form);
161  }
162  }
renderer()
+ Here is the call graph for this function:

◆ view()

ilObjStudyProgrammeSettingsGUI::view ( )
protected

Definition at line 136 of file class.ilObjStudyProgrammeSettingsGUI.php.

References buildForm(), ILIAS\Repository\ctrl(), getObject(), ILIAS\Repository\lng(), and renderer().

Referenced by executeCommand().

136  : string
137  {
138  $this->tmp_heading = "<div class=''>" . $this->lng->txt('prg_async_settings') . "</div>";
139  $form = $this->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "update"));
140  return $this->renderer->render($form);
141  }
renderer()
buildForm(ilObjStudyProgramme $prg, string $submit_action)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $common_settings_gui

ilStudyProgrammeCommonSettingsGUI ilObjStudyProgrammeSettingsGUI::$common_settings_gui
protected

Definition at line 57 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $ctrl

ilCtrl ilObjStudyProgrammeSettingsGUI::$ctrl
protected

Definition at line 49 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $data_factory

ILIAS Data Factory ilObjStudyProgrammeSettingsGUI::$data_factory
protected

Definition at line 55 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $input_factory

ILIAS UI Component Input Factory ilObjStudyProgrammeSettingsGUI::$input_factory
protected

Definition at line 51 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $lng

ilLanguage ilObjStudyProgrammeSettingsGUI::$lng
protected

Definition at line 50 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $lom_services

LOMServices ilObjStudyProgrammeSettingsGUI::$lom_services
protected

Definition at line 60 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $object

ilObjStudyProgramme ilObjStudyProgrammeSettingsGUI::$object
protected

Definition at line 62 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by getObject().

◆ $ref_id

int ilObjStudyProgrammeSettingsGUI::$ref_id
protected

Definition at line 64 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by setRefId().

◆ $refinery_factory

ILIAS Refinery Factory ilObjStudyProgrammeSettingsGUI::$refinery_factory
protected

Definition at line 54 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $renderer

ILIAS UI Renderer ilObjStudyProgrammeSettingsGUI::$renderer
protected

Definition at line 52 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $request

Psr Http Message ServerRequestInterface ilObjStudyProgrammeSettingsGUI::$request
protected

Definition at line 53 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $request_wrapper

ILIAS HTTP Wrapper RequestWrapper ilObjStudyProgrammeSettingsGUI::$request_wrapper
protected

Definition at line 59 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $tabs

ilTabsGUI ilObjStudyProgrammeSettingsGUI::$tabs
protected

Definition at line 58 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $tmp_heading

string ilObjStudyProgrammeSettingsGUI::$tmp_heading
protected

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

◆ $tpl

ilGlobalTemplateInterface ilObjStudyProgrammeSettingsGUI::$tpl
protected

Definition at line 48 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $type_repository

ilStudyProgrammeTypeRepository ilObjStudyProgrammeSettingsGUI::$type_repository
protected

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

Referenced by __construct().

◆ OPT_DEADLINE_DATE

const ilObjStudyProgrammeSettingsGUI::OPT_DEADLINE_DATE = "opt_deadline_date"

◆ OPT_DEADLINE_PERIOD

const ilObjStudyProgrammeSettingsGUI::OPT_DEADLINE_PERIOD = "opt_deadline_period"

Definition at line 41 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ OPT_NO_DEADLINE

const ilObjStudyProgrammeSettingsGUI::OPT_NO_DEADLINE = 'opt_no_deadline'

◆ OPT_NO_VALIDITY_OF_QUALIFICATION

const ilObjStudyProgrammeSettingsGUI::OPT_NO_VALIDITY_OF_QUALIFICATION = 'opt_no_validity_qualification'

◆ OPT_VALIDITY_OF_QUALIFICATION_DATE

const ilObjStudyProgrammeSettingsGUI::OPT_VALIDITY_OF_QUALIFICATION_DATE = "opt_validity_qualification_date"

◆ OPT_VALIDITY_OF_QUALIFICATION_PERIOD

const ilObjStudyProgrammeSettingsGUI::OPT_VALIDITY_OF_QUALIFICATION_PERIOD = "opt_validity_qualification_period"

Definition at line 45 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_DEADLINE

const ilObjStudyProgrammeSettingsGUI::PROP_DEADLINE = "deadline"

◆ PROP_DESC

const ilObjStudyProgrammeSettingsGUI::PROP_DESC = "desc"

Definition at line 36 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_TITLE

const ilObjStudyProgrammeSettingsGUI::PROP_TITLE = "title"

Definition at line 35 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_VALIDITY_OF_QUALIFICATION

const ilObjStudyProgrammeSettingsGUI::PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"

◆ TAB_COMMON_SETTINGS

const ilObjStudyProgrammeSettingsGUI::TAB_COMMON_SETTINGS = 'commonSettings'
private

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

◆ TAB_SETTINGS

const ilObjStudyProgrammeSettingsGUI::TAB_SETTINGS = 'settings'
private

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


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