fix gist.github.com clone urls
[phorkie.git] / src / phorkie / HtmlHelper.php
index ebda58bcc2e3c497d7c69dc60e014e6a5a9c0239..efde7149048d38af172f4a5a003196ea084812ff 100644 (file)
@@ -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 = '<option value="_auto_">* automatic *</option>';
         $fileExt = null;
         if ($file !== null) {
             $fileExt = $file->getExt();
@@ -23,6 +39,11 @@ class HtmlHelper
         }
         return $html;
     }
+
+    public function fullUrl($path = '')
+    {
+        return Tools::fullUrl($path);
+    }
 }
 
-?>
\ No newline at end of file
+?>