def admin_add_photo
      return if !user_is_allowed('media', 'edit')      
            
      x = Media.maximum(:media_order, :conditions => {:mls => params[:mls], :media_type => 'Photo'})
      x = 0 if x.nil?
      
      m = Media.new
      m.id            = Media.maximum(:id) + 1
      m.mls 		  = params[:mls]
      m.date_modified = DateTime.now                  
      m.media_order   = x + 1
      m.media_type 		= 'Photo'
      m.image         = params[:image]
      m.save
      
      render :text => "<script type='text/javascript'>parent.controller.after_image_upload();</script>"                        
    end
def admin_add_photo
      return if !user_is_allowed('media', 'edit')      
            
      x = Media.maximum(:media_order, :conditions => {:mls => params[:mls], :media_type => 'Photo'})
      x = 0 if x.nil?
      
      m = Media.new
      m.id            = Media.maximum(:id) + 1
      m.mls 		  = params[:mls]
      m.date_modified = DateTime.now                  
      m.media_order   = x + 1
      m.media_type 		= 'Photo'
      m.image         = params[:image]
      m.save
      
      render :text => "<script type='text/javascript'>parent.controller.after_image_upload();</script>"                        
    end
POST /admin/properties/:mls/photos