Exemple #1
0
 protected function getOutput()
 {
     $this->setBlock(false);
     $email = $force_default = $a_open = $a_close = '';
     if (($source = $this->source->getValue()) instanceof \User) {
         // parameter 'user'
         $email = $source->getEmail();
         $a_open = '<a href="' . $source->getUserPage()->getFullURL() . '">';
         $a_close = '</a>';
     } elseif (is_string($source)) {
         // parameter 'email'
         $email = $source;
     } else {
         $force_default = '&f=y';
     }
     $email_md5 = md5(strtolower(trim($email)));
     $size = 's=' . $this->size->getOutput();
     // $rating = $this->rating->hasBeenSet() ? '&r='.$this->rating->getOutput() : '';
     $rating = '&r=g';
     // "suitable for display on all websites with any audience type."
     return $a_open . '<img class="' . $this->getCSSClasses() . '" src="http://www.gravatar.com/avatar/' . $email_md5 . '?' . $size . $rating . $force_default . '&d=mm" alt="" />' . $a_close;
 }