ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilLink.php
Go to the documentation of this file.
1 <?php
2 
21 
22 class ilLink
23 {
27  public static function _getLink(
28  ?int $a_ref_id,
29  string $a_type = '',
30  array $a_params = [],
31  string $append = ""
32  ): string {
33  global $DIC;
35  $static_url = $DIC["static_url"];
36 
37  $ilObjDataCache = $DIC["ilObjDataCache"];
38 
39  if ($a_type === '' && $a_ref_id) {
40  $a_type = $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_ref_id));
41  }
42 
43  $target = urlencode(CLIENT_ID) . '_' . $a_type . '_' . $a_ref_id . urlencode($append);
44 
45  $a_params = array_merge($a_params, [$append]);
46  $a_params = array_filter($a_params, static function ($value): bool {
47  return $value !== "";
48  });
49 
50  if (!empty($a_type)) {
51  return (string) $static_url->builder()->build(
52  $a_type,
53  $a_ref_id !== null ? new ReferenceId($a_ref_id) : null,
54  $a_params
55  );
56  }
57 
58  return '';
59  }
60 
64  public static function _getStaticLink(
65  ?int $a_ref_id,
66  string $a_type = '',
67  bool $a_fallback_goto = true,
68  string $append = ""
69  ): string {
70  return self::_getLink($a_ref_id, $a_type, [], $append);
71  }
72 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$static_url
Definition: goto.php:29
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:26