ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
$DIC
Definition: xapitoken.php:46
setForLanguage(string $l, string $value)
Set for language.
getLanguage()
returns a 2char-language-string public