ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Hyperlink.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class Hyperlink
9 {
22  public static function set($linkURL = '', $displayName = null, ?Cell $pCell = null)
23  {
24  $linkURL = ($linkURL === null) ? '' : Functions::flattenSingleValue($linkURL);
25  $displayName = ($displayName === null) ? '' : Functions::flattenSingleValue($displayName);
26 
27  if ((!is_object($pCell)) || (trim($linkURL) == '')) {
28  return Functions::REF();
29  }
30 
31  if ((is_object($displayName)) || trim($displayName) == '') {
32  $displayName = $linkURL;
33  }
34 
35  $pCell->getHyperlink()->setUrl($linkURL);
36  $pCell->getHyperlink()->setTooltip($displayName);
37 
38  return $displayName;
39  }
40 }
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649