optionsframework_uploader_function

The ColorWay Theme optionsframework uploader function function.

Description

optionsframework_uploader_function( $id, $std, $mod ); 

Parameters (3)

0. $id
The id.
1. $std
The std.
2. $mod
The mod.

Usage

  1. if ( !function_exists( 'optionsframework_uploader_function' ) ) { 
  2. require_once '/functions/admin-interface.php'; 
  3.  
  4. // The id. 
  5. $id = null; 
  6.  
  7. // The std. 
  8. $std = null; 
  9.  
  10. // The mod. 
  11. $mod = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = optionsframework_uploader_function($id, $std, $mod); 
  15.  

Defined (1)

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

/functions/admin-interface.php  
  1. function optionsframework_uploader_function($id, $std, $mod) { 
  2.  
  3. //$uploader .= '<input type="file" id="attachement_'.$id.'" name="attachement_'.$id.'" class="upload_input"></input>'; 
  4. //$uploader .= '<span class="submit"><input name="save" type="submit" value="Upload" class="button upload_save" /></span>'; 
  5.  
  6. $uploader = ''; 
  7. $upload = get_option($id); 
  8.  
  9. if($mod != 'min') {  
  10. $val = $std; 
  11. if ( get_option( $id ) != "") { $val = get_option($id); } 
  12. $uploader .= '<input class="of-input" name="'. $id .'" id="'. $id .'_upload" type="text" value="'. $val .'" />'; 
  13.  
  14. $uploader .= '<div class="upload_button_div"><span class="button image_upload_button" id="'.$id.'">Upload Image</span>'; 
  15.  
  16. if(!empty($upload)) {$hide = '';} else { $hide = 'hide';} 
  17.  
  18. $uploader .= '<span class="button image_reset_button '. $hide.'" id="reset_'. $id .'" title="' . $id . '">Remove</span>'; 
  19. $uploader .='</div>' . "\n"; 
  20. $uploader .= '<div class="clear"></div>' . "\n"; 
  21. if(!empty($upload)) { 
  22. $uploader .= '<a class="of-uploaded-image" href="'. $upload . '">'; 
  23. $uploader .= '<img class="of-option-image" id="image_'.$id.'" src="'.$upload.'" alt="" />'; 
  24. $uploader .= '</a>'; 
  25. $uploader .= '<div class="clear"></div>' . "\n";  
  26.  
  27.  
  28. return $uploader;