本文整理汇总了PHP中Attachments::getFileIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::getFileIcon方法的具体用法?PHP Attachments::getFileIcon怎么用?PHP Attachments::getFileIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::getFileIcon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
foreach ($attachments as $a) {
$file_path = sfConfig::get('sf_upload_dir') . '/attachments/' . $a->getFile();
?>
<div id="attachedFile<?php
echo $a->getId();
?>
">
<table>
<tr>
<td colspan="2"><?php
echo Attachments::getFileIcon($a->getFile()) . ' ' . (is_file($file_path) ? getimagesize($file_path) ? link_to(substr($a->getFile(), 7), 'attachments/view?id=' . $a->getId(), array('target' => '_blank', 'absolute' => true)) : Attachments::getLink($a) : substr($a->getFile(), 7));
?>
</td>
</tr>
</tr>
<?php
if ($a->getBindType() != 'wiki') {
?>
<td><?php
echo __('Description') . ':</td><td> ' . textarea_tag('attachments_info[' . $a->getId() . ']', $a->getInfo(), array('style' => 'height: 50px;', 'class' => 'attachments_textarea'));
?>
</td>
<?php
}
?>
<td><a href="#" onClick="return deleteAttachments(<?php
echo $a->getId();
?>
示例2: array
<?php
$html = '';
$related_attachments = array();
foreach ($attachments as $v) {
$file_path = sfConfig::get('sf_upload_dir') . '/attachments/' . $v['file'];
if (is_file($file_path)) {
if (getimagesize($file_path)) {
$html .= '<li>' . Attachments::getFileIcon($v['file']) . ' ' . link_to(substr($v['file'], 7), 'attachments/view?id=' . $v['id'], array('target' => '_blank', 'absolute' => true)) . ' ' . link_to(image_tag(public_path('images/icons/zoom.png', true), array('border' => 0)) . ' ' . __('view'), 'attachments/view?id=' . $v['id'], array('target' => '_blank', 'style' => 'text-decoration:none', 'absolute' => true)) . ' ' . link_to(image_tag(public_path('images/icons/download.png', true), array('border' => 0)) . ' ' . __('download'), 'attachments/download?id=' . $v['id'], array('style' => 'text-decoration:none', 'absolute' => true)) . ' ' . $v['info'] . '</li>' . "\n";
} else {
$html .= '<li>' . Attachments::getFileIcon($v['file']) . ' ' . link_to(substr($v['file'], 7), 'attachments/download?id=' . $v['id'], array('absolute' => true)) . ' ' . link_to(image_tag(public_path('images/icons/download.png', true), array('border' => 0)) . ' ' . __('download'), 'attachments/download?id=' . $v['id'], array('style' => 'text-decoration:none', 'absolute' => true)) . ' ' . $v['info'] . '</li>' . "\n";
}
$related_attachments[] = $v['id'];
}
}
if (strlen($html) > 0) {
?>
<br><?php
echo __('Attachments');
?>
:
<ul class="attachedList" id="attachedList">
<?php
echo $html;
?>
</ul>
<?php
echo input_hidden_tag('item_attachments', implode(',', $related_attachments));
}
?>