Fix error with git 2.25.1 complaining about missing committer
[phorkie.git] / src / phorkie / HtmlHelper.php
index c3336c36b1a6da2cfaf996c3879008a615baa7d3..0a8b926888fca70554bbd56f0d3c2da47957aeca 100644 (file)
@@ -5,11 +5,14 @@ class HtmlHelper
 {
     public function getIconUrl($email, $size = 32)
     {
-        if ($email == 'anonymous@phorkie') {
+        if ($email == 'anonymous@phorkie'
+            || !$GLOBALS['phorkie']['cfg']['avatars']
+        ) {
             return 'phorkie/anonymous.png';
         }
 
         $s = new \Services_Libravatar();
+        $s->detectHttps();
         return $s->url(
             $email,
             array(
@@ -71,6 +74,13 @@ class HtmlHelper
 
         return $logged_in;
     }
+
+    public function getRepositoryEmbedCode(Repository $repo)
+    {
+        return '<script src="' . $repo->getLink('embed', null, true) . '"'
+            . ' id="phork-script-' . $repo->id . '"'
+            . ' type="text/javascript"></script>';
+    }
 }
 
 ?>