예제 #1
0
 /**
  * getImgTag - get a full HTML img tag to display a flag based on county code
  *
  * @param Response $response    \Xoops\Core\Service\Response object
  * @param string   $countryCode ISO 3166-1 alpha-2 code to select flag
  * @param array    $attributes  array of attribute name => value pairs for img tag
  * @param string   $size        'small', 'medium' or 'large'
  *
  * @return void  - response->value set to image tag
  */
 public function getImgTag(Response $response, $countryCode, $attributes = array(), $size = 'large')
 {
     $url = $this->getFlagUrl($countryCode, $size);
     $imgTag = new Img(array('src' => $url, 'alt' => $countryCode));
     $imgTag->setAttributes($attributes);
     $response->setValue($imgTag->render());
 }
예제 #2
0
 /**
  * getImgTag - get a full HTML img tag to display a QR Code image of supplied text
  *
  * @param Response $response   \Xoops\Core\Service\Response object
  * @param string   $qrText     text to encode in QR Code
  * @param array    $attributes array of attribute name => value pairs for img tag
  *
  * @return void  - response->value set to image tag
  */
 public function getImgTag(Response $response, $qrText, $attributes = array())
 {
     $url = $this->getQRUrl($qrText);
     $imgTag = new Img(array('src' => $url));
     $imgTag->setAttributes($attributes);
     $response->setValue($imgTag->render());
 }
예제 #3
0
 /**
  * getImgTag - get a full HTML img tag to display a thumbnail of the supplied image
  *
  * @param Response $response   \Xoops\Core\Service\Response object
  * @param string   $imgPath    path to image to be thumbed
  * @param integer  $width      maximum width of thumbnail in pixels, 0 to use default
  * @param integer  $height     maximum height of thumbnail in pixels, 0 to use default
  * @param array    $attributes array of attribute name => value pairs for img tag
  *
  * @return void  - response->value set to image tag
  */
 public function getImgTag(Response $response, $imgPath, $width = 0, $height = 0, $attributes = array())
 {
     $url = $this->getThumbnailUrl($imgPath, $width, $height);
     $imgTag = new Img(array('src' => $url));
     $imgTag->setAttributes($attributes);
     $response->setValue($imgTag->render());
 }