Exemplo n.º 1
0
 /**
  * Show/hide the downloads button
  *
  * @param array  $row
  * @param string $href
  * @param string $label
  * @param string $title
  * @param string $icon
  * @param string $attributes
  *
  * @return string
  */
 public function forDownloads($row, $href, $label, $title, $icon, $attributes)
 {
     if (($objProductType = ProductType::findByProductData($row)) === null || !$objProductType->hasDownloads()) {
         return '';
     }
     return '<a href="' . \Backend::addToUrl($href . '&amp;id=' . $row['id']) . '" title="' . specialchars($title . '<br>' . sprintf($GLOBALS['TL_DCA']['tl_iso_product']['list']['operations']['downloads']['label'][2], $this->getNumberOfDownloadsForProduct($row['id']))) . '"' . $attributes . '>' . \Image::getHtml($icon, $label) . '</a> ';
 }