X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/2b4b34a76f42841e964a549fc64c02ba4f60a3f4..9cd731256b243511a3a1a1fcec76a1d5f27eb6d3:/src/phorkie/HtmlHelper.php diff --git a/src/phorkie/HtmlHelper.php b/src/phorkie/HtmlHelper.php index ebda58b..ca5f989 100644 --- a/src/phorkie/HtmlHelper.php +++ b/src/phorkie/HtmlHelper.php @@ -3,9 +3,25 @@ namespace phorkie; class HtmlHelper { + public function getIconUrl($email, $size = 32) + { + if ($email == 'anonymous@phorkie') { + return 'phorkie/anonymous.png'; + } + + $s = new \Services_Libravatar(); + return $s->url( + $email, + array( + 'size' => $size, + 'default' => Tools::fullUrl('phorkie/anonymous.png') + ) + ); + } + public function getLanguageOptions(File $file = null) { - $html = ''; + $html = ''; $fileExt = null; if ($file !== null) { $fileExt = $file->getExt(); @@ -23,6 +39,16 @@ class HtmlHelper } return $html; } + + public function getDomain($url) + { + return parse_url($url, PHP_URL_HOST); + } + + public function fullUrl($path = '') + { + return Tools::fullUrl($path); + } } -?> \ No newline at end of file +?>