PageRenderTime 324ms CodeModel.GetById 201ms app.highlight 7ms RepoModel.GetById 114ms app.codeStats 0ms

/halogy/application/modules/users/views/edit_group.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 85 lines | 65 code | 20 blank | 0 comment | 5 complexity | 6031b7321c307e1e388a151969143bad MD5 | raw file
 1<script type="text/javascript">
 2$(function(){
 3	$('div.permissions input[type="checkbox"]').each(function(){
 4		if ($(this).attr('checked')) {
 5			$(this).parent('div').prev('div').children('input[type="checkbox"]').attr('checked', true);
 6		}
 7	});
 8	$('.selectall').click(function(){
 9		$el = $(this).parent('div').next('div').children('input[type="checkbox"]');
10		$flag = $(this).attr('checked');
11		if ($flag) {
12			$($el).attr('checked', true);
13		}
14		else {
15			$($el).attr('checked', false);
16		}
17	});
18	$('.seemore').click(function(){
19		$el = $(this).parent('div').next('div');
20		$($el).toggle('400');
21	});
22	$('a.selectall').click(function(event){
23		event.preventDefault();
24		$('input[type="checkbox"]').attr('checked', true);
25	});
26	$('a.deselectall').click(function(event){
27		event.preventDefault();
28		$('input[type="checkbox"]').attr('checked', false);
29	});
30});
31</script>
32
33<form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
34
35	<h1 class="headingleft">Edit User Group <small>(<a href="/admin/users/groups">Back to Users Groups</a>)</small></h1>
36
37	<div class="headingright">
38		<input type="submit" value="Save Changes" class="button" />
39	</div>
40	
41	<div class="clear"></div>
42	
43	<?php if ($errors = validation_errors()): ?>
44		<div class="error">
45			<?php echo $errors; ?>
46		</div>
47	<?php endif; ?>
48
49	<label for="groupName">Name this group:</label><br class="clear" />
50	<?php echo @form_input('groupName',set_value('groupName', $data['groupName']), 'id="groupName" class="formelement"'); ?>
51	<br class="clear" /><br />
52
53	<?php if ($permissions): ?>
54
55	<h3>Administrative Permissions</h3>
56	
57	<p><a href="#" class="selectall button small nolabel grey">Select All</a> <a href="#" class="deselectall button small grey">De-Select All</a></p>
58	
59	<?php foreach ($permissions as $cat => $perms): ?>
60
61		<div class="perm-heading">
62			<label for="<?php echo strtolower($cat); ?>_all" class="radio"><?php echo $cat; ?></label>
63			<input type="checkbox" class="selectall checkbox" id="<?php echo strtolower($cat); ?>_all" />
64			<input type="button" value="See more" class="seemore small-button" />
65		</div>
66
67		<div class="permissions">
68
69		<?php foreach ($perms as $perm): ?>
70
71			<label for="<?php echo 'perm_'.$perm['key']; ?>" class="radio"><?php echo $perm['permission']; ?></label>
72			<?php echo @form_checkbox('perm'.$perm['permissionID'], 1, set_value('perm'.$perm['permissionID'], $data['perm'.$perm['permissionID']]), 'id="'.'perm_'.$perm['key'].'" class="checkbox"'); ?>
73			<br class="clear" />
74
75		<?php endforeach; ?>
76
77		</div>
78
79	<?php endforeach; ?>
80	<?php endif; ?>
81
82
83	<p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
84	
85</form>