mirror of
				https://github.com/alchemy-fr/Phraseanet.git
				synced 2025-10-25 02:43:11 +00:00 
			
		
		
		
	Fix #1339 : Fix admin file upload callback
This commit is contained in:
		| @@ -286,8 +286,28 @@ class Root implements ControllerProviderInterface | ||||
|                     break; | ||||
|             } | ||||
|  | ||||
|             if (isset($status[$bit])) { | ||||
|                 $status = $status[$bit]; | ||||
|             } else { | ||||
|                 $status = array( | ||||
|                     "labeloff" => '', | ||||
|                     "labelon" => '', | ||||
|                     "img_off" => '', | ||||
|                     "img_on" => '', | ||||
|                     "path_off" => '', | ||||
|                     "path_on" => '', | ||||
|                     "searchable" => false, | ||||
|                     "printable" => false, | ||||
|                 ); | ||||
|  | ||||
|                 foreach ($app['locales.I18n.available'] as $code => $language) { | ||||
|                     $status['labels_on'][$code] = null; | ||||
|                     $status['labels_off'][$code] = null; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return $app['twig']->render('admin/statusbit/edit.html.twig', array( | ||||
|                 'status' => isset($status[$bit]) ? $status[$bit] : array(), | ||||
|                 'status' => $status, | ||||
|                 'errorMsg' => $errorMsg | ||||
|             )); | ||||
|         })->assert('databox_id', '\d+') | ||||
|   | ||||
| @@ -323,12 +323,7 @@ | ||||
|                   $('#right-ajax').empty().addClass('loading'); | ||||
|                 }, | ||||
|                 done: function (e, data) { | ||||
|                     $('#right-ajax').removeClass('loading').html(data.result); | ||||
|                     enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|  | ||||
|                     $.each($('#right-ajax a'),function(i, el){ | ||||
|                         enableLink($(el)); | ||||
|                     }); | ||||
|                     enableFormsCallback(data.result); | ||||
|                 } | ||||
|             }); | ||||
|         }); | ||||
|   | ||||
| @@ -385,12 +385,7 @@ | ||||
|               $('#right-ajax').empty().addClass('loading'); | ||||
|             }, | ||||
|             done: function (e, data) { | ||||
|                $('#right-ajax').removeClass('loading').html(data.result); | ||||
|                 enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|  | ||||
|                 $.each($('#right-ajax a'),function(i, el){ | ||||
|                     enableLink($(el)); | ||||
|                 }); | ||||
|                 enableFormsCallback(data.result); | ||||
|             } | ||||
|         }); | ||||
|     }); | ||||
|   | ||||
| @@ -78,7 +78,15 @@ | ||||
|                     type: method, | ||||
|                     url: url, | ||||
|                     data: datas, | ||||
|                     success: function(datas){ | ||||
|                     success: enableFormsCallback | ||||
|                 }); | ||||
|                 return false; | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     function enableFormsCallback(datas) | ||||
|     { | ||||
|         $('#right-ajax').removeClass('loading').html(datas); | ||||
|         enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|  | ||||
| @@ -87,11 +95,6 @@ | ||||
|         }); | ||||
|         return; | ||||
|     } | ||||
|                 }); | ||||
|                 return false; | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     function enableLink(link) { | ||||
|  | ||||
| @@ -103,11 +106,7 @@ | ||||
|                 $('#right-ajax').empty().addClass('loading').parent().show(); | ||||
|  | ||||
|                 $.get(dest, function(data) { | ||||
|                   $('#right-ajax').removeClass('loading').html(data); | ||||
|                   enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|                     $.each($('#right-ajax a:not(.no-ajax)'),function(i, el){ | ||||
|                         enableLink($(el)); | ||||
|                     }); | ||||
|                     enableFormsCallback(data); | ||||
|                 }); | ||||
|                 return false; | ||||
|             } | ||||
| @@ -129,12 +128,7 @@ | ||||
|             $('#right-ajax').empty().addClass('loading').parent().show(); | ||||
|  | ||||
|             $.get(dest, function(data) { | ||||
|                 $('#right-ajax').removeClass('loading').html(data); | ||||
|                 enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|  | ||||
|                 $.each($('#right-ajax a'),function(i, el){ | ||||
|                     enableLink($(el)); | ||||
|                 }); | ||||
|                 enableFormsCallback(data); | ||||
|             }); | ||||
|             $('#tree .selected').removeClass('selected'); | ||||
|             $(this).parent().addClass('selected'); | ||||
|   | ||||
| @@ -192,8 +192,7 @@ $(document).ready(function(){ | ||||
|           $('#right-ajax').empty().addClass('loading'); | ||||
|     }, | ||||
|         done: function (e, data) { | ||||
|             $('#right-ajax').removeClass('loading').html(data.result); | ||||
|  | ||||
|             enableFormsCallback(data.result); | ||||
|         } | ||||
|     }); | ||||
|  | ||||
|   | ||||
| @@ -62,12 +62,7 @@ $(function () { | ||||
|           $('#right-ajax').empty().addClass('loading'); | ||||
|         }, | ||||
|         done: function (e, data) { | ||||
|            $('#right-ajax').removeClass('loading').html(data.result); | ||||
|             enableForms($('#right-ajax form:not(.no-ajax)')); | ||||
|  | ||||
|             $.each($('#right-ajax a'),function(i, el){ | ||||
|                 enableLink($(el)); | ||||
|             }); | ||||
|             enableFormsCallback(data.result); | ||||
|         } | ||||
|     }); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Romain Neutron
					Romain Neutron