ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

 getStaticLink (int $ref_id, string $type)
 
 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 80 of file class.ilWebLinkItemInternal.php.

Referenced by getResolvedLink().

80  : string
81  {
82  $uri = new URI($link);
83  return (string) $uri->withParameter($key, $value);
84  }
+ 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, appendParameter(), ilWebLinkItem\getParameters(), getStaticLink(), 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 = $this->getStaticLink(0, 'wiki');
46  $link = $this->appendParameter($link, 'target', 'wiki_wpage_' . $ref_id);
47  break;
48 
49  case 'term':
50  // #16894
51  $link = $this->getStaticLink(0, "git");
52  $link = $this->appendParameter($link, 'target', 'git_' . $ref_id);
53  break;
54 
55  case 'page':
56  $type = "pg";
57  $link = $this->getStaticLink($ref_id, $type);
58  break;
59 
60  default:
61  $link = $this->getStaticLink($ref_id, $type);
62  }
63 
64  if (!$with_parameters) {
65  return $link;
66  }
67 
68  foreach ($this->getParameters() as $parameter) {
69  $link = $parameter->appendToLink($link);
70  }
71 
72  return $link;
73  }
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:61
$ref_id
Definition: ltiauth.php:65
getStaticLink(int $ref_id, string $type)
+ Here is the call graph for this function:

◆ getStaticLink()

ilWebLinkItemInternal::getStaticLink ( int  $ref_id,
string  $type 
)
protected

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

References ilLink\_getStaticLink().

Referenced by getResolvedLink().

75  : string
76  {
77  return ilLink::_getStaticLink($ref_id, $type);
78  }
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller 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: