/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
- <script type="text/javascript">
- $(function(){
- $('div.permissions input[type="checkbox"]').each(function(){
- if ($(this).attr('checked')) {
- $(this).parent('div').prev('div').children('input[type="checkbox"]').attr('checked', true);
- }
- });
- $('.selectall').click(function(){
- $el = $(this).parent('div').next('div').children('input[type="checkbox"]');
- $flag = $(this).attr('checked');
- if ($flag) {
- $($el).attr('checked', true);
- }
- else {
- $($el).attr('checked', false);
- }
- });
- $('.seemore').click(function(){
- $el = $(this).parent('div').next('div');
- $($el).toggle('400');
- });
- $('a.selectall').click(function(event){
- event.preventDefault();
- $('input[type="checkbox"]').attr('checked', true);
- });
- $('a.deselectall').click(function(event){
- event.preventDefault();
- $('input[type="checkbox"]').attr('checked', false);
- });
- });
- </script>
- <form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
- <h1 class="headingleft">Edit User Group <small>(<a href="/admin/users/groups">Back to Users Groups</a>)</small></h1>
- <div class="headingright">
- <input type="submit" value="Save Changes" class="button" />
- </div>
-
- <div class="clear"></div>
-
- <?php if ($errors = validation_errors()): ?>
- <div class="error">
- <?php echo $errors; ?>
- </div>
- <?php endif; ?>
- <label for="groupName">Name this group:</label><br class="clear" />
- <?php echo @form_input('groupName',set_value('groupName', $data['groupName']), 'id="groupName" class="formelement"'); ?>
- <br class="clear" /><br />
- <?php if ($permissions): ?>
- <h3>Administrative Permissions</h3>
-
- <p><a href="#" class="selectall button small nolabel grey">Select All</a> <a href="#" class="deselectall button small grey">De-Select All</a></p>
-
- <?php foreach ($permissions as $cat => $perms): ?>
- <div class="perm-heading">
- <label for="<?php echo strtolower($cat); ?>_all" class="radio"><?php echo $cat; ?></label>
- <input type="checkbox" class="selectall checkbox" id="<?php echo strtolower($cat); ?>_all" />
- <input type="button" value="See more" class="seemore small-button" />
- </div>
- <div class="permissions">
- <?php foreach ($perms as $perm): ?>
- <label for="<?php echo 'perm_'.$perm['key']; ?>" class="radio"><?php echo $perm['permission']; ?></label>
- <?php echo @form_checkbox('perm'.$perm['permissionID'], 1, set_value('perm'.$perm['permissionID'], $data['perm'.$perm['permissionID']]), 'id="'.'perm_'.$perm['key'].'" class="checkbox"'); ?>
- <br class="clear" />
- <?php endforeach; ?>
- </div>
- <?php endforeach; ?>
- <?php endif; ?>
- <p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
-
- </form>