ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilWebLinkParameter Class Reference

Immutable class for parameters attached to Web Link items. More...

+ Inheritance diagram for ilWebLinkParameter:
+ Collaboration diagram for ilWebLinkParameter:

Public Member Functions

 __construct (ilObjUser $user, int $webr_id, int $link_id, int $param_id, int $value, string $name)
 
 appendToLink (string $link)
 
 getInfo ()
 
 toXML (ilXmlWriter $writer)
 
 getWebrId ()
 
 getLinkId ()
 
 getParamId ()
 
- Public Member Functions inherited from ilWebLinkBaseParameter
 __construct (int $value, string $name)
 
 getValue ()
 
 getName ()
 

Private Attributes

int $webr_id
 
int $link_id
 
int $param_id
 
ilObjUser $user
 

Additional Inherited Members

- Data Fields inherited from ilWebLinkBaseParameter
const string UNDEFINED_NAME = 'undefined'
 
const string USER_ID_NAME = 'user_id'
 
const string LOGIN_NAME = 'login'
 
const string MATRICULATION_NAME = 'matriculation'
 
const array VALUES
 TODO Once the GUI is updated, undefined can be dropped. More...
 
const array VALUES_TEXT
 Keys of the language variables to the possible values, e.g. More...
 
- Protected Attributes inherited from ilWebLinkBaseParameter
int $value
 
string $name
 

Detailed Description

Immutable class for parameters attached to Web Link items.

Author
Tim Schmitz schmi.nosp@m.tz@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilWebLinkParameter.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebLinkParameter::__construct ( ilObjUser  $user,
int  $webr_id,
int  $link_id,
int  $param_id,
int  $value,
string  $name 
)

Member Function Documentation

◆ appendToLink()

ilWebLinkParameter::appendToLink ( string  $link)

Definition at line 49 of file class.ilWebLinkParameter.php.

References ilWebLinkBaseParameter\getName(), ilWebLinkBaseParameter\getValue(), and ILIAS\Repository\user().

49  : string
50  {
51  if (!strpos($link, '?')) {
52  $link .= "?";
53  } else {
54  $link .= "&";
55  }
56  $link .= ($this->getName() . "=");
57  switch ($this->getValue()) {
58  case self::VALUES['login']:
59  $link .= (urlencode(
60  $this->user->getLogin()
61  ));
62  break;
63 
64  case self::VALUES['user_id']:
65  $link .= ($this->user->getId());
66  break;
67 
68  case self::VALUES['matriculation']:
69  $link .= ($this->user->getMatriculation());
70  break;
71 
72  default:
74  'Invalid parameter value'
75  );
76  }
77 
78  return $link;
79  }
+ Here is the call graph for this function:

◆ getInfo()

ilWebLinkParameter::getInfo ( )

Definition at line 81 of file class.ilWebLinkParameter.php.

References $info, ilWebLinkBaseParameter\getName(), and ilWebLinkBaseParameter\getValue().

81  : string
82  {
83  $info = $this->getName();
84 
85  switch ($this->getValue()) {
86  case self::VALUES['user_id']:
87  return $info . '=USER_ID';
88 
89  case self::VALUES['login']:
90  return $info . '=LOGIN';
91 
92  case self::VALUES['matriculation']:
93  return $info . '=MATRICULATION';
94 
95  default:
97  'Invalid parameter value'
98  );
99  }
100  }
$info
Definition: entry_point.php:21
+ Here is the call graph for this function:

◆ getLinkId()

ilWebLinkParameter::getLinkId ( )

Definition at line 136 of file class.ilWebLinkParameter.php.

References $link_id.

136  : int
137  {
138  return $this->link_id;
139  }

◆ getParamId()

ilWebLinkParameter::getParamId ( )

Definition at line 141 of file class.ilWebLinkParameter.php.

References $param_id.

Referenced by toXML().

141  : int
142  {
143  return $this->param_id;
144  }
+ Here is the caller graph for this function:

◆ getWebrId()

ilWebLinkParameter::getWebrId ( )

Definition at line 131 of file class.ilWebLinkParameter.php.

References $webr_id.

131  : int
132  {
133  return $this->webr_id;
134  }

◆ toXML()

ilWebLinkParameter::toXML ( ilXmlWriter  $writer)

Definition at line 102 of file class.ilWebLinkParameter.php.

References ilWebLinkBaseParameter\$value, ilWebLinkBaseParameter\getName(), getParamId(), ilWebLinkBaseParameter\getValue(), and ilXmlWriter\xmlElement().

102  : void
103  {
104  switch ($this->getValue()) {
105  case self::VALUES['user_id']:
106  $value = 'userId';
107  break;
108 
109  case self::VALUES['login']:
110  $value = 'userName';
111  break;
112 
113  case self::VALUES['matriculation']:
114  $value = 'matriculation';
115  break;
116 
117  default:
118  return;
119  }
120 
121  $writer->xmlElement(
122  'DynamicParameter',
123  [
124  'id' => $this->getParamId(),
125  'name' => $this->getName(),
126  'type' => $value
127  ]
128  );
129  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

Field Documentation

◆ $link_id

int ilWebLinkParameter::$link_id
private

Definition at line 28 of file class.ilWebLinkParameter.php.

Referenced by __construct(), and getLinkId().

◆ $param_id

int ilWebLinkParameter::$param_id
private

Definition at line 29 of file class.ilWebLinkParameter.php.

Referenced by __construct(), and getParamId().

◆ $user

ilObjUser ilWebLinkParameter::$user
private

Definition at line 31 of file class.ilWebLinkParameter.php.

Referenced by __construct().

◆ $webr_id

int ilWebLinkParameter::$webr_id
private

Definition at line 27 of file class.ilWebLinkParameter.php.

Referenced by __construct(), and getWebrId().


The documentation for this class was generated from the following file: