28 protected \ILIAS\DI\UIServices
$ui;
34 bool $a_call_by_reference =
true,
35 bool $a_prepare_output =
true 39 $this->rbac_system = $DIC->rbac()->system();
40 $this->
lng = $DIC->language();
42 $this->
ctrl = $DIC->ctrl();
43 $this->
access = $DIC->access();
45 $this->
ui = $DIC->ui();
46 $this->request = $DIC->http()->request();
51 $this->
lng->loadLanguageModule(
"prtf");
56 $next_class = $this->
ctrl->getNextClass($this);
57 $cmd = $this->
ctrl->getCmd();
61 switch ($next_class) {
62 case 'ilpermissiongui':
63 $this->tabs_gui->activateTab(
'perm_settings');
65 $this->
ctrl->forwardCommand($perm_gui);
68 case 'ilportfolioroleassignmentgui':
69 $this->tabs_gui->activateTab(
'role_assignment');
71 $this->
ctrl->forwardCommand($gui);
75 if (!$cmd || $cmd ===
'view') {
76 $cmd =
"editSettings";
94 $this->
ctrl->getLinkTarget($this,
"editSettings")
98 $lng->
txt(
"prtf_role_assignment"),
99 $this->
ctrl->getLinkTargetByClass(
"ilPortfolioRoleAssignmentGUI",
"")
103 $lng->
txt(
"prtf_decl_authorship"),
104 $this->
ctrl->getLinkTarget($this,
"editDeclarationOfAuthorship")
112 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
119 $this->tabs_gui->activateTab(
'settings');
123 $this->tpl->setContent($a_form->getHTML());
133 if ($form->checkInput()) {
134 $ilSetting->set(
'user_portfolios', (
int) $form->getInput(
"prtf"));
136 $banner = (bool) $form->getInput(
"banner");
139 $prfa_set->set(
"banner", $banner);
140 $prfa_set->set(
"banner_width", (
int) $form->getInput(
"width"));
141 $prfa_set->set(
"banner_height", (
int) $form->getInput(
"height"));
142 $prfa_set->set(
"mask", (
bool) $form->getInput(
"mask"));
143 $prfa_set->set(
"mycrs", (
bool) $form->getInput(
"mycrs"));
145 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
146 $ilCtrl->redirect($this,
"editSettings");
148 $form->setValuesByPost();
162 return $this->rbac_system->checkAccess(
"write", $this->
object->getRefId());
167 return $this->rbac_system->checkAccess(
"read", $this->
object->getRefId());
176 $form->setFormAction($this->
ctrl->getFormAction($this));
177 $form->setTitle($this->
lng->txt(
'prtf_settings'));
180 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
181 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
189 $prtf_prop->setInfo(
$lng->
txt(
'user_portfolios_desc'));
190 $prtf_prop->setChecked((
bool)
$ilSetting->get(
'user_portfolios'));
191 $form->addItem($prtf_prop);
197 $form->addItem($banner);
202 $banner->addSubItem($width);
207 $banner->addSubItem($height);
209 $banner->setChecked($prfa_set->get(
"banner",
false));
210 if ($prfa_set->get(
"banner")) {
211 $width->setValue($prfa_set->get(
"banner_width"));
212 $height->setValue($prfa_set->get(
"banner_height"));
214 $width->setValue(1370);
215 $height->setValue(100);
220 $mycourses->setChecked($prfa_set->get(
"mycrs",
true));
221 $form->addItem($mycourses);
231 $fields = array(
'pd_enable_prtf' => array(
$ilSetting->get(
'user_portfolios'),
236 return array(array(
"editSettings", $fields));
248 $renderer = $ui = $this->
ui->renderer();
251 $this->tabs_gui->activateTab(
"authorship");
253 $main_tpl->setContent($renderer->render($form));
271 $fields[
"decl_" . $l] =
$f->input()->field()->textarea(
$txt)
272 ->withRequired(
false)
273 ->withValue($this->declaration_authorship->getForLanguage($l));
277 $section1 =
$f->input()->field()->section($fields,
$lng->
txt(
"prtf_decl_authorship"),
"");
280 return $f->input()->container()->form()->standard(
$form_action, [
"sec" => $section1]);
291 if (
$request->getMethod() ===
"POST") {
292 $form = $form->withRequest(
$request);
293 $data = $form->getData();
294 if (is_array(
$data[
"sec"])) {
296 $this->declaration_authorship->setForLanguage($l,
$data[
"sec"][
"decl_" . $l]);
299 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"msg_obj_modified"),
true);
303 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"msg_no_perm_write"),
true);
ilPortfolioRoleAssignmentGUI: ilPropertyFormGUI
editDeclarationOfAuthorship()
editSettings($a_form=null)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
getDefaultLanguage()
Return default language.
addToExternalSettingsForm(int $a_form_id)
prepareOutput(bool $show_sub_objects=true)
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadLanguageModule(string $a_module)
Load language module.
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...
ilPortfolioDeclarationOfAuthorship $declaration_authorship
ilGlobalTemplateInterface $tpl
ServerRequestInterface $request
Class ilObjectGUI Basic methods of all Output classes.
getInstalledLanguages()
Get installed languages.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
__construct(Container $dic, ilPlugin $plugin)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
__construct( $a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.