Revision 723aa98c
Added by Andreas Kohlbecker over 5 years ago
modules/cdm_dataportal/theme/cdm_dataportal.references.theme | ||
---|---|---|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
/** |
96 |
* @param $reference |
|
97 |
* @param $out |
|
96 |
* Creates a anchor tag as clickable link to an external resource, either as text link or as icon. |
|
97 |
* The resulting link will have no 'target' attribute, so the link will open in the same tab by default. |
|
98 |
* So the users can decide. |
|
99 |
* |
|
100 |
* @param $uri |
|
101 |
* The uri to link to |
|
102 |
* @param $iconified |
|
103 |
* The link will be rendered as icon of this is true. |
|
98 | 104 |
* @return string |
105 |
* |
|
99 | 106 |
*/ |
100 | 107 |
function cdm_external_uri($uri, $iconified = true) |
101 | 108 |
{ |
109 |
$options = array( |
|
110 |
'external' => true, |
|
111 |
'html' => false, |
|
112 |
); |
|
102 | 113 |
if (!empty($uri)) { |
103 | 114 |
if($iconified){ |
104 |
return l(font_awesome_icon_markup('fa-external-link', array('class' => array('superscript'))), $uri, array('html' => TRUE)); |
|
115 |
$options['html'] = true; |
|
116 |
return l(font_awesome_icon_markup('fa-external-link', array('class' => array('superscript'))), $uri, $options); |
|
105 | 117 |
} else { |
106 |
return l($uri, $uri); |
|
118 |
return l($uri, $uri, $options);
|
|
107 | 119 |
} |
108 | 120 |
} |
109 | 121 |
} |
Also available in: Unified diff
ref #7611 adding clickable external link to media specimen types with uri