ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilPortfolioDeclarationOfAuthorship.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $prtf_settings;
17
21 protected $lng;
22
26 public function __construct()
27 {
28 global $DIC;
29
30 $this->lng = $DIC->language();
31 $this->prtf_settings = new ilSetting("prtf");
32 }
33
40 public function getForLanguage(string $l) : string
41 {
42 return $this->prtf_settings->get("decl_author_" . $l);
43 }
44
52 public function setForLanguage(string $l, string $value) : string
53 {
54 return $this->prtf_settings->set("decl_author_" . $l, $value);
55 }
56
63 public function getForUser(ilObjUser $user) : string
64 {
66
67 $decl = $this->getForLanguage($user->getLanguage());
68 if ($decl == "") {
69 $decl = $this->getForLanguage($lng->getDefaultLanguage());
70 }
71 return $decl;
72 }
73}
An exception for terminatinating execution or to throw for unit testing.
getLanguage()
returns a 2char-language-string @access public
setForLanguage(string $l, string $value)
Set for language.
ILIAS Setting Class.
global $DIC
Definition: goto.php:24