ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  {
65  $lng = $this->lng;
66 
67  $decl = $this->getForLanguage($user->getLanguage());
68  if ($decl == "") {
69  $decl = $this->getForLanguage($lng->getDefaultLanguage());
70  }
71  return $decl;
72  }
73 }
global $DIC
Definition: saml.php:7
$user
Definition: migrateto20.php:57
global $l
Definition: afr.php:30
setForLanguage(string $l, string $value)
Set for language.
getLanguage()
returns a 2char-language-string public