Development

/plugins/sfMediaLibraryPlugin/modules/sfMediaLibrary/templates/_block.php

You must first sign up to be able to contribute.

root/plugins/sfMediaLibraryPlugin/modules/sfMediaLibrary/templates/_block.php

Revision 3804, 3.4 kB (checked in by francois, 6 years ago)

sfMediaLibraryPlugin: Fixed a bug in folder navigation and released package 0.8.1

Line 
1 <?php if($sf_context->getActionName() !== 'choice'): ?>
2   <?php $action = 'index' ?>
3 <?php else: ?>
4   <?php $action = $sf_context->getActionName() ?>
5 <?php endif; ?>
6
7 <div class="thumbnails">
8 <?php if ($type === 'folder'): ?>
9   <?php echo link_to(image_tag('/sfMediaLibraryPlugin/images/folder', array(
10     'alt' => $name,
11     'title' => $name,
12     'size' => '64x64',
13   )), 'sfMediaLibrary/'.$action.'?dir='.$current_path.'+'.$name) ?>
14   <?php if (($action !== "index") and $is_file): ?>
15     <?php $size = '&nbsp;' ?>
16   <?php else: ?>
17     <?php $size = '' ?>
18   <?php endif; ?>
19   <?php $delete = 'rmdir' ?>
20 <?php else: ?>
21   <?php if ($info['size'] < 4000): ?>
22     <?php $size2 = array() ?>
23   <?php else: ?>
24     <?php $size2 = array('height' => '64') ?>
25   <?php endif; ?>
26   <?php $thumbnail = image_tag($info['icon'], array(
27     'alt' => $name,
28     'title' => $name,
29     ) + $size2) ?>
30   <?php if($action === "index"): ?>
31     <?php echo content_tag('a', $thumbnail, array(
32       'href' => $web_abs_current_path.'/'.$name,
33       'target' => '_blank',
34     )) ?>
35   <?php else: ?>
36     <?php echo link_to_function($thumbnail, "setFileSrc('".$web_abs_current_path.'/'.$name."')") ?>
37   <?php endif; ?>
38
39     <?php ob_start() ?>
40     <?php if ($info['size'] < 1000): ?>
41       &nbsp;&nbsp;[<?php printf('%d', $info['size']) ?> o]
42     <?php else: ?>
43       &nbsp;&nbsp;[<?php printf('%d', $info['size'] / 1000) ?> Ko]
44     <?php endif; ?>
45     <?php $size = ob_get_contents() ?>
46     <?php ob_end_clean() ?>
47   <?php $delete = 'delete' ?>
48 <?php endif; ?>
49 </div>
50 <div class="assetComment">
51   <div id="view_<?php echo $count ?>"><?php echo ($action === "index") ? link_to_function($name, "Element.show('edit_".$count."');Element.hide('view_".$count."')") : $name ?></div>
52   <?php if($action === "index"): ?>
53     <div id="edit_<?php echo $count ?>">
54       <?php echo form_tag('sfMediaLibrary/rename', 'name=sf_asset_rename_form') ?>
55         <?php echo input_hidden_tag('current_path', $current_path) ?>
56         <?php echo input_hidden_tag('name', $name) ?>
57         <?php echo input_hidden_tag('type', $type) ?>
58         <?php echo input_hidden_tag('count', $count) ?>
59         <?php echo input_tag('new_name', $name) ?>
60         <?php echo submit_to_remote('rename', __('Rename', null, 'sfMediaLibrary'), array(
61           'url' => 'sfMediaLibrary/rename',
62           'update' => 'block_'.$count,
63           'script'=> true,
64           'before' => visual_effect('opacity', 'block_'.$count, array('duration' => '0.5', 'from' => '1.0', 'to' => '0.3')),
65           'complete' => visual_effect('opacity', 'block_'.$count, array('duration' => '0.5', 'from' => '0.3', 'to' => '1.0')),
66           ),'class=sf_asset_action_rename')?>
67           <?php echo button_to_function(__('Cancel', null, 'sfMediaLibrary'), "Element.hide('edit_".$count."');Element.show('view_".$count."')") ?>
68       </form>
69     </div>
70     <?php echo javascript_tag("
71     Element.hide('edit_".$count."');
72     ") ?>
73     <div style="text-align:right">
74     <?php echo $size ?>
75     <?php echo link_to(image_tag('/sfMediaLibraryPlugin/images/delete.png', array(
76       'alt' => __('Delete', null, 'sfMediaLibrary'),
77       'title' => __('Delete', null, 'sfMediaLibrary'),
78       'align' => 'absmiddle',
79     )), 'sfMediaLibrary/'.$delete.'?name='.$name.'&current_path='.$current_path, array(
80       'confirm' => __('Are you sure to want to delete this '.$type.'?', null, 'sfMediaLibrary')
81     )) ?>
82     </div>
83   <?php endif; ?>
84 </div>
85
86
Note: See TracBrowser for help on using the browser.