Ejemplo n.º 1
0
 function imageTagFunc($params, &$view)
 {
     if (!isset($params['src'])) {
         return;
     }
     $src = $params['src'];
     unset($params['src']);
     $alt = '';
     if (isset($params['alt'])) {
         $alt = $params['alt'];
         unset($params['alt']);
     }
     return AssetTagHelper::imageTag($src, $alt, $params);
 }
Ejemplo n.º 2
0
 /**
  * download_icon - Called from a Smarty template to return a string with an icon
  * 					image link.
  *
  * @param	array	A path to a filename.
  * @return	string	An img tag with a particular image for the filetype passed.
  **/
 function download_icon($params)
 {
     $extension = NFilesystem::getExtension($params['file']);
     $icon = '/images/icons/' . $extension . '.png';
     $icon_path = DOCUMENT_ROOT . $icon;
     if (file_exists($icon_path)) {
         return AssetTagHelper::imageTag($icon, 'Download');
     } else {
         return AssetTagHelper::imageTag('/images/icons/default.png', 'Download');
     }
 }