nggallery_admin_roles

The NextGEN Gallery nggallery admin roles function.

Description

nggallery_admin_roles(); 

Usage

  1. if ( !function_exists( 'nggallery_admin_roles' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = nggallery_admin_roles(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php  
  1. function nggallery_admin_roles() { 
  2.  
  3. if ( !empty($_POST) ) { 
  4.  
  5. check_admin_referer('ngg_addroles'); 
  6.  
  7. // now set or remove the capability 
  8. ngg_set_capability($_POST['general'], "NextGEN Gallery overview"); 
  9. ngg_set_capability($_POST['tinymce'], "NextGEN Use TinyMCE"); 
  10. ngg_set_capability($_POST['add_gallery'], "NextGEN Upload images"); 
  11. ngg_set_capability($_POST['manage_gallery'], "NextGEN Manage gallery"); 
  12. ngg_set_capability($_POST['manage_others'], "NextGEN Manage others gallery"); 
  13. ngg_set_capability($_POST['manage_tags'], "NextGEN Manage tags"); 
  14. ngg_set_capability($_POST['edit_album'], "NextGEN Edit album"); 
  15. ngg_set_capability($_POST['change_style'], "NextGEN Change style"); 
  16. ngg_set_capability($_POST['change_options'], "NextGEN Change options"); 
  17. ngg_set_capability($_POST['attach_interface'], "NextGEN Attach Interface"); 
  18.  
  19. ?> 
  20. <div class="wrap"> 
  21. <p> 
  22. <?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br /> 
  23. </p> 
  24. <?php wp_nonce_field('ngg_addroles') ?> 
  25. <table class="form-table"> 
  26. <tr valign="top"> 
  27. <th scope="row"><?php _e('Main NextGEN Gallery overview', 'nggallery') ;?>:</th> 
  28. <td><label for="general"><select name="general" id="general"><?php wp_dropdown_roles( ngg_get_role('NextGEN Gallery overview') ); ?></select></label></td> 
  29. </tr> 
  30. <tr valign="top"> 
  31. <th scope="row"><?php _e('Use TinyMCE Button / Upload tab', 'nggallery') ;?>:</th> 
  32. <td><label for="tinymce"><select name="tinymce" id="tinymce"><?php wp_dropdown_roles( ngg_get_role('NextGEN Use TinyMCE') ); ?></select></label></td> 
  33. </tr> 
  34. <tr valign="top"> 
  35. <th scope="row"><?php _e('Add gallery / Upload images', 'nggallery') ;?>:</th> 
  36. <td><label for="add_gallery"><select name="add_gallery" id="add_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Upload images') ); ?></select></label></td> 
  37. </tr> 
  38. <tr valign="top"> 
  39. <th scope="row"><?php _e('Manage gallery', 'nggallery') ;?>:</th> 
  40. <td><label for="manage_gallery"><select name="manage_gallery" id="manage_gallery"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage gallery') ); ?></select></label></td> 
  41. </tr> 
  42. <tr valign="top"> 
  43. <th scope="row"><?php _e('Manage others gallery', 'nggallery') ;?>:</th> 
  44. <td><label for="manage_others"><select name="manage_others" id="manage_others"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage others gallery') ); ?></select></label></td> 
  45. </tr> 
  46. <tr valign="top"> 
  47. <th scope="row"><?php _e('Manage tags', 'nggallery') ;?>:</th> 
  48. <td><label for="manage_tags"><select name="manage_tags" id="manage_tags"><?php wp_dropdown_roles( ngg_get_role('NextGEN Manage tags') ); ?></select></label></td> 
  49. </tr> 
  50. <tr valign="top"> 
  51. <th scope="row"><?php _e('Edit Album', 'nggallery') ;?>:</th> 
  52. <td><label for="edit_album"><select name="edit_album" id="edit_album"><?php wp_dropdown_roles( ngg_get_role('NextGEN Edit album') ); ?></select></label></td> 
  53. </tr> 
  54. <tr valign="top"> 
  55. <th scope="row"><?php _e('Change style', 'nggallery') ;?>:</th> 
  56. <td><label for="change_style"><select name="change_style" id="change_style"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change style') ); ?></select></label></td> 
  57. </tr> 
  58. <tr valign="top"> 
  59. <th scope="row"><?php _e('Change options', 'nggallery') ;?>:</th> 
  60. <td><label for="change_options"><select name="change_options" id="change_options"><?php wp_dropdown_roles( ngg_get_role('NextGEN Change options') ); ?></select></label></td> 
  61. </tr> 
  62. <tr valign="top"> 
  63. <th scope="row"><?php _e('NextGEN Attach Interface', 'nggallery') ;?>:</th> 
  64. <td><label for="attach_interface"><select name="attach_interface" id="attach_interface"><?php wp_dropdown_roles( ngg_get_role('NextGEN Attach Interface') ); ?></select></label></td> 
  65. </tr> 
  66. </table> 
  67. </div> 
  68. <?php 
  69.