<div class="attached-file well shd"> <?php $file = new File($file->path, $file); ?> <?php echo $file->render(); ?> <a href="<?php echo $file->getLink('delete'); ?> " class="sh" title="<?php echo t('Удалить'); ?> "><i class="icon-remove"></i></a> <a href="#" class="sh" title="<?php echo t('Вставить'); ?> "><i class="icon-upload"></i></a> </div>
/** * Format the tool path * * @param File $file * * @return string */ public function getLink(File $file) { return $file->getLink('tool', $this->stripPrefix($this->class)); }
/** * Converts the code to HTML * * @param File $file File to render * @param Tool_Result $res Tool result to integrate * * @return string HTML */ public function toHtml(File $file, Tool_Result $res = null) { return '<div class="image">' . '<img' . ' src="' . htmlspecialchars($file->getLink('raw')) . '"' . ' alt="' . htmlspecialchars($file->getFilename()) . '"' . '/>' . '</div>'; }