PageRenderTime 31ms CodeModel.GetById 22ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/halogy/application/modules/images/views/admin/folders.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 85 lines | 64 code | 21 blank | 0 comment | 1 complexity | 03b19860c90fc1aff5b020153b3440cf MD5 | raw file
 1<script type="text/javascript">
 2function setOrder(){
 3	$.post('/admin/images/order/folder',$(this).sortable('serialize'),function(data){ });
 4};
 5
 6function initOrder(el){
 7	$(el).sortable({ 
 8		axis: 'y',
 9	    revert: false, 
10	    delay: '80',
11	    opacity: '0.5',
12	    update: setOrder
13	});
14};
15
16$(function(){
17	$('a.toggle').click(function(event){ 
18		event.preventDefault();		
19		$('div.hidden').slideToggle('400');
20	});
21
22	$('a.edit').click(function(event){
23		event.preventDefault();
24		$(this).parent().siblings('.col1').children('input').show();
25		$(this).parent().siblings('.col1').children('span').hide();
26	});
27
28	initOrder('ol.order');
29});
30</script>
31
32<h1 class="headingleft">Image Folders</h1>
33
34<div class="headingright">
35	<a href="/admin/images/viewall" class="button blue">View Images</a>
36	<a href="#" class="toggle button blue">Add Folder</a>
37</div>
38
39<div class="clear"></div>
40
41<div class="hidden">
42	<form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
43	
44		<label for="folderName">Folder Name:</label>
45		
46		<?php echo @form_input('folderName',$images_folders['folderName'], 'class="formelement" id="folderName"'); ?>
47			
48		<input type="submit" value="Add Folder" id="submit" class="button" />
49
50		<br class="clear" />
51		
52	</form>
53</div>
54
55<?php if ($folders): ?>
56
57<form method="post" action="/admin/images/edit_folder/">
58
59	<ol class="order">
60	<?php foreach ($folders as $folder): ?>
61		<li id="image_folders-<?php echo $folder['folderID']; ?>">
62			<div class="col1">
63				<span><strong><?php echo $folder['folderName']; ?></strong> <small>(<?php echo url_title(strtolower($folder['folderName'])); ?>)</small></span>
64				<?php echo @form_input($folder['folderID'].'[folderName]', $folder['folderName'], 'class="formelement hide" title="folder Name"'); ?><input type="submit" class="button hide" value="Edit" />
65			</div>
66			<div class="col2">
67				&nbsp;
68			</div>
69			<div class="buttons">
70				<a href="#" class="edit"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_edit.png" alt="Edit" /></a>
71				<a href="/admin/images/delete_folder/<?php echo $folder['folderID']; ?>" onclick="return confirm('Are you sure you want to delete this?')"><img src="<?php echo $this->config->item('staticPath'); ?>/images/btn_delete.png" alt="Delete" /></a>
72			</div>
73			<div class="clear"></div>
74		</li>
75	<?php endforeach; ?>
76	</ol>
77
78</form>
79
80<?php else: ?>
81
82<p>No folders have been created yet.</p>
83
84<?php endif; ?>
85