ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilWebLinkItemInternal Class Reference

Immutable class for internal Web Link items. More...

+ Inheritance diagram for ilWebLinkItemInternal:
+ Collaboration diagram for ilWebLinkItemInternal:

Public Member Functions

 isInternal ()
 
 getResolvedLink (bool $with_parameters=true)
 TODO: should be refactored to use URI data object everywhere. More...
 
- Public Member Functions inherited from ilWebLinkItem
 __construct (int $webr_id, int $link_id, string $title, ?string $description, string $target, bool $active, DateTimeImmutable $create_date, DateTimeImmutable $last_update, array $parameters)
 
 getResolvedLink (bool $with_parameters=true)
 
 isInternal ()
 
 toXML (ilXmlWriter $writer, int $position)
 
 getWebrId ()
 
 getLinkId ()
 
 getCreateDate ()
 
 getLastUpdate ()
 
 getParameters ()
 
- Public Member Functions inherited from ilWebLinkBaseItem
 __construct (string $title, ?string $description, string $target, bool $active, array $parameters)
 
 isInternal ()
 
 getTitle ()
 
 getDescription ()
 
 getTarget ()
 
 isActive ()
 
 getParameters ()
 

Protected Member Functions

 appendParameter (string $link, string $key, string $value)
 

Additional Inherited Members

- Protected Attributes inherited from ilWebLinkItem
int $webr_id
 
int $link_id
 
DateTimeImmutable $create_date
 
DateTimeImmutable $last_update
 
array $parameters
 
- Protected Attributes inherited from ilWebLinkBaseItem
string $title
 
string $target
 
bool $active
 
array $parameters
 
string $description
 

Detailed Description

Immutable class for internal Web Link items.

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

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

Member Function Documentation

◆ appendParameter()

ilWebLinkItemInternal::appendParameter ( string  $link,
string  $key,
string  $value 
)
protected

Definition at line 83 of file class.ilWebLinkItemInternal.php.

Referenced by getResolvedLink().

83  : string
84  {
85  $uri = new URI($link);
86  return (string) $uri->withParameter($key, $value);
87  }
string $key
Consumer key/client ID value.
Definition: System.php:193
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
+ Here is the caller graph for this function:

◆ getResolvedLink()

ilWebLinkItemInternal::getResolvedLink ( bool  $with_parameters = true)

TODO: should be refactored to use URI data object everywhere.

Definition at line 37 of file class.ilWebLinkItemInternal.php.

References $parts, $ref_id, ilLink\_getStaticLink(), appendParameter(), ilWebLinkItem\getParameters(), ilWebLinkBaseItem\getTarget(), and ILIAS\Repository\int().

37  : string
38  {
39  $parts = explode("|", $this->getTarget());
40  $type = (string) ($parts[0] ?? '');
41  $ref_id = (int) ($parts[1] ?? 0);
42 
43  switch ($type) {
44  case 'wpage':
45  $link = ilLink::_getStaticLink(
46  0,
47  'wiki',
48  true
49  );
50  $link = $this->appendParameter($link, 'target', 'wiki_wpage_' . $ref_id);
51  break;
52 
53  case 'term':
54  // #16894
55  $link = ilLink::_getStaticLink(
56  0,
57  "git",
58  true
59  );
60  $link = $this->appendParameter($link, 'target', 'git_' . $ref_id);
61  break;
62 
63  case 'page':
64  $type = "pg";
65  $link = ilLink::_getStaticLink($ref_id, $type);
66  break;
67 
68  default:
69  $link = ilLink::_getStaticLink($ref_id, $type);
70  }
71 
72  if (!$with_parameters) {
73  return $link;
74  }
75 
76  foreach ($this->getParameters() as $parameter) {
77  $link = $parameter->appendToLink($link);
78  }
79 
80  return $link;
81  }
appendParameter(string $link, string $key, string $value)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ isInternal()

ilWebLinkItemInternal::isInternal ( )

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

29  : bool
30  {
31  return true;
32  }

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