/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. <form method="post" action="<?php echo $this->uri->uri_string(); ?>" class="default">
  33. <h1 class="headingleft">Edit User Group <small>(<a href="/admin/users/groups">Back to Users Groups</a>)</small></h1>
  34. <div class="headingright">
  35. <input type="submit" value="Save Changes" class="button" />
  36. </div>
  37. <div class="clear"></div>
  38. <?php if ($errors = validation_errors()): ?>
  39. <div class="error">
  40. <?php echo $errors; ?>
  41. </div>
  42. <?php endif; ?>
  43. <label for="groupName">Name this group:</label><br class="clear" />
  44. <?php echo @form_input('groupName',set_value('groupName', $data['groupName']), 'id="groupName" class="formelement"'); ?>
  45. <br class="clear" /><br />
  46. <?php if ($permissions): ?>
  47. <h3>Administrative Permissions</h3>
  48. <p><a href="#" class="selectall button small nolabel grey">Select All</a> <a href="#" class="deselectall button small grey">De-Select All</a></p>
  49. <?php foreach ($permissions as $cat => $perms): ?>
  50. <div class="perm-heading">
  51. <label for="<?php echo strtolower($cat); ?>_all" class="radio"><?php echo $cat; ?></label>
  52. <input type="checkbox" class="selectall checkbox" id="<?php echo strtolower($cat); ?>_all" />
  53. <input type="button" value="See more" class="seemore small-button" />
  54. </div>
  55. <div class="permissions">
  56. <?php foreach ($perms as $perm): ?>
  57. <label for="<?php echo 'perm_'.$perm['key']; ?>" class="radio"><?php echo $perm['permission']; ?></label>
  58. <?php echo @form_checkbox('perm'.$perm['permissionID'], 1, set_value('perm'.$perm['permissionID'], $data['perm'.$perm['permissionID']]), 'id="'.'perm_'.$perm['key'].'" class="checkbox"'); ?>
  59. <br class="clear" />
  60. <?php endforeach; ?>
  61. </div>
  62. <?php endforeach; ?>
  63. <?php endif; ?>
  64. <p class="clear" style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  65. </form>