3 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
38 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
42 $this->lng = $DIC->language();
44 $this->ctrl = $DIC->ctrl();
45 $this->access = $DIC->access();
47 $this->ui = $DIC->ui();
48 $this->request = $DIC->http()->request();
49 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
53 $this->lng->loadLanguageModule(
"prtf");
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
69 switch ($next_class) {
70 case 'ilpermissiongui':
71 $this->tabs_gui->activateTab(
'perm_settings');
72 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
74 $this->ctrl->forwardCommand($perm_gui);
78 if (!$cmd || $cmd ==
'view') {
79 $cmd =
"editSettings";
103 $lng->txt(
"settings"),
104 $this->ctrl->getLinkTarget($this,
"editSettings")
108 $lng->txt(
"prtf_decl_authorship"),
109 $this->ctrl->getLinkTarget($this,
"editDeclarationOfAuthorship")
116 $lng->txt(
"perm_settings"),
117 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
131 $this->tabs_gui->activateTab(
'settings');
147 $this->tpl->setContent($a_form->getHTML());
162 if (
$form->checkInput()) {
165 $banner = (bool)
$form->getInput(
"banner");
168 $prfa_set->set(
"pd_block", (
bool)
$form->getInput(
"pd_block"));
169 $prfa_set->set(
"banner", $banner);
170 $prfa_set->set(
"banner_width", (
int)
$form->getInput(
"width"));
171 $prfa_set->set(
"banner_height", (
int)
$form->getInput(
"height"));
172 $prfa_set->set(
"mask", (
bool)
$form->getInput(
"mask"));
173 $prfa_set->set(
"mycrs", (
bool)
$form->getInput(
"mycrs"));
175 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
176 $ilCtrl->redirect($this,
"editSettings");
179 $form->setValuesByPost();
190 $ilCtrl->redirect($this,
"view");
204 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
206 $form->setFormAction($this->ctrl->getFormAction($this));
207 $form->setTitle($this->lng->txt(
'prtf_settings'));
209 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
210 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
211 $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
215 $lng->loadLanguageModule(
'pd');
216 $lng->loadLanguageModule(
'user');
219 $prtf_prop->setInfo(
$lng->txt(
'user_portfolios_desc'));
220 $prtf_prop->setChecked((
$ilSetting->get(
'user_portfolios') ?
'1' :
'0'));
221 $form->addItem($prtf_prop);
226 $pdblock->
setInfo(
$lng->txt(
"prtf_pd_block_info"));
227 $pdblock->setChecked($prfa_set->get(
"pd_block",
false));
228 $form->addItem($pdblock);
231 $banner->
setInfo(
$lng->txt(
"prtf_preview_banner_info"));
232 $form->addItem($banner);
237 $banner->addSubItem($width);
242 $banner->addSubItem($height);
244 $banner->setChecked($prfa_set->get(
"banner",
false));
245 if ($prfa_set->get(
"banner")) {
246 $width->setValue($prfa_set->get(
"banner_width"));
247 $height->setValue($prfa_set->get(
"banner_height"));
249 $width->setValue(1370);
250 $height->setValue(100);
261 $this->ctrl->setParameter($gui,
"ref_id", $gui->object->getRefId());
262 $link = $this->ctrl->getLinkTarget($gui);
263 $ne->
setValue(
"<a href='$link'> >> " . $this->lng->txt(
"settings") .
"</a>");
267 $mycourses->
setInfo(
$lng->txt(
"prtf_allow_my_courses_info"));
268 $mycourses->setChecked($prfa_set->get(
"mycrs",
true));
269 $form->addItem($mycourses);
278 switch ($a_form_id) {
283 return array(array(
"editSettings", $fields));
297 $renderer =
$ui = $this->ui->renderer();
300 $this->tabs_gui->activateTab(
"authorship");
302 $main_tpl->setContent($renderer->render(
$form));
316 $lng->loadLanguageModule(
"meta");
318 foreach (
$lng->getInstalledLanguages() as
$l) {
320 if (
$lng->getDefaultLanguage() ==
$l) {
321 $txt .=
" (" .
$lng->txt(
"default") .
")";
323 $fields[
"decl_" .
$l] =
$f->input()->field()->textarea(
$txt)
324 ->withRequired(
false)
325 ->withValue((
string) $this->declaration_authorship->getForLanguage(
$l));
329 $section1 =
$f->input()->field()->section($fields,
$lng->txt(
"prtf_decl_authorship"));
331 $form_action =
$ctrl->getLinkTarget($this,
"saveAuthorship");
332 return $f->input()->container()->form()->standard($form_action, [
"sec" => $section1]);
346 if (
$request->getMethod() ==
"POST") {
349 if (is_array(
$data[
"sec"])) {
350 foreach (
$lng->getInstalledLanguages() as
$l) {
351 $this->declaration_authorship->setForLanguage(
$l,
$data[
"sec"][
"decl_" .
$l]);
360 $ctrl->redirect($this,
"editDeclarationOfAuthorship");
editDeclarationOfAuthorship()
Edit declaration of authorship.
editSettings($a_form=null)
Edit settings.
setValue($a_value)
Set Value.
initFormSettings()
Init settings property form.
Declaration of authorship (data gateway)
Portfolio Administration Settings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
prepareOutput($a_show_subobjects=true)
prepare output
executeCommand()
Execute command.
if(isset($_POST['submit'])) $form
Class ilObjectGUI Basic methods of all Output classes.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!empty($this->data['faventry'])) $tabs
This class represents a non editable value in a property form.
addToExternalSettingsForm($a_form_id)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
saveSettings()
Save settings.
saveAuthorship()
Save authorship.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
initAuthorshipForm()
Init authorship form.