bp_docs_create_new_folder_markup

Create the markup for creating a new folder.

Description

bp_docs_create_new_folder_markup( (array) $args = array() ); 

Used on Doc Edit/Create as well as the Folders management page.

Parameters (1)

0. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'bp_docs_create_new_folder_markup' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-docs/includes/addon-folders.php'; 
  3.  
  4. // The args. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_docs_create_new_folder_markup($args); 
  9.  

Defined (1)

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

/includes/addon-folders.php  
  1. function bp_docs_create_new_folder_markup( $args = array() ) { 
  2. $default_group_id = null; 
  3. if ( bp_is_active( 'groups' ) && bp_is_group() ) { 
  4. $default_group_id = bp_get_current_group_id(); 
  5.  
  6. $r = wp_parse_args( $args, array( 
  7. 'selected' => $default_group_id,  
  8. 'group_id' => $default_group_id,  
  9. 'folder_type_name' => 'new-folder-type',  
  10. 'folder_type_id' => 'new-folder-type',  
  11. 'folder_type_include_all_groups' => false,  
  12. ) ); 
  13.  
  14. ?> 
  15.  
  16. <label for="new-folder"><?php _e( 'Name', 'bp-docs' ) ?></label> <input name="new-folder" id="new-folder" /> 
  17.  
  18. <?php $folder_type_class = current_user_can( 'bp_docs_change_folder_type' ) ? 'can-change' : 'cannot-change' ?> 
  19.  
  20. <div style="clear:both"></div> 
  21.  
  22. <div class="folder-type-selector-div <?php echo $folder_type_class ?>"> 
  23. <label for="new-folder-type"><?php _e( 'Folder type', 'bp-docs' ) ?></label> 
  24. 'selected' => $r['selected'],  
  25. 'id' => $r['folder_type_id'],  
  26. 'name' => $r['folder_type_name'],  
  27. 'include_all_groups' => $r['folder_type_include_all_groups'],  
  28. ) ) ?> 
  29. </div> 
  30.  
  31. <div style="clear:both"></div> 
  32. <label for="new-folder-parent"><?php _e( 'Parent (optional)', 'bp-docs' ) ?></label> 
  33. <?php bp_docs_folder_selector( array( 
  34. 'name' => 'new-folder-parent',  
  35. 'id' => 'new-folder-parent',  
  36. 'class' => 'folder-parent',  
  37. 'selected' => isset( $_GET['folder'] ) ? intval( $_GET['folder'] ) : false,  
  38. 'group_id' => $r['group_id'],  
  39. ) ) ?> 
  40.  
  41. <div style="clear:both"></div> 
  42. <?php