Advertisement
deliciousthemes

Untitled

Mar 16th, 2014
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1.     public static function optionsframework_media_uploader_function($id,$std,$mod){
  2.  
  3.         $data = of_get_options();
  4.         $smof_data = of_get_options();
  5.        
  6.         $uploader = '';
  7.         $upload = "";
  8.         if (isset($smof_data[$id]))
  9.             $upload = $smof_data[$id];
  10.         $hide = '';
  11.        
  12.         if ($mod == "min") {$hide ='hide';}
  13.        
  14.         if ( $upload != "") { $val = $upload; } else {$val = $std;}
  15.        
  16.         $uploader .= '<input class="'.$hide.' upload of-input" name="'. $id .'" id="'. $id .'_upload" value="'. $val .'" />';  
  17.        
  18.         //Upload controls DIV
  19.         $uploader .= '<div class="upload_button_div">';
  20.         //If the user has WP3.5+ show upload/remove button
  21.         if ( function_exists( 'wp_enqueue_media' ) ) {
  22.             $uploader .= '<span class="button media_upload_button" id="'.$id.'">Upload</span>';
  23.            
  24.             if(!empty($upload)) {$hide = '';} else { $hide = 'hide';}
  25.             $uploader .= '<span class="button remove-image '. $hide.'" id="reset_'. $id .'" title="' . $id . '">Remove</span>';
  26.         }
  27.         else
  28.         {
  29.             $output .= '<p class="upload-notice"><i>Upgrade your version of WordPress for full media support.</i></p>';
  30.         }
  31.  
  32.         $uploader .='</div>' . "\n";
  33.  
  34.         //Preview
  35.         $uploader .= '<div class="screenshot">';
  36.         if(!empty($upload)){   
  37.             $uploader .= '<a class="of-uploaded-image" href="'. $upload . '">';
  38.             $uploader .= '<img class="of-option-image" id="image_'.$id.'" src="'.$upload.'" alt="" />';
  39.             $uploader .= '</a>';           
  40.             }
  41.         $uploader .= '</div>';
  42.         $uploader .= '<div class="clear"></div>' . "\n";
  43.    
  44.         return $uploader;
  45.        
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement