Commit 722e6a52 authored by Clément Damiens's avatar Clément Damiens

up delete and redirect

parent b4d6b0a5
......@@ -3045,8 +3045,9 @@ var directory = {
.done(function (data) {
if ( data && data.result ) {
toastr.info("élément effacé");
$("#"+type+id).remove();
if( $(".contain_"+type+"_"+id).length > 0 )
if( $("#"+type+id).length > 0)
$("#"+type+id).remove();
else if( $(".contain_"+type+"_"+id).length > 0 )
$(".contain_"+type+"_"+id).remove();
else
urlCtrl.loadByHash( location.hash );
......
......@@ -69,6 +69,16 @@
// $pageConfig=(@Yii::app()->session['paramsConfig']["element"]) ? Yii::app()->session['paramsConfig']["element"] : null;
// $addConfig=(@Yii::app()->session['paramsConfig']["add"]) ? Yii::app()->session['paramsConfig']["add"] : null;
///-------------- END ------------////
if(empty($element["_id"])){
$what=(@$element["type"]) ? "the ".Element::getControlerByCollection($element["type"]) : "the element";
?>
<script type="text/javascript">
urlCtrl.loadByHash("");
bootbox.dialog({message:"<div class='alert-danger text-center'><strong><?php echo Yii::t("common","{what}, that you are looking for, has been deleted or doesn't exist", array("{what}"=>ucfirst(Yii::t("common", $what)))) ?></strong></div>"});
</script>
<?php
exit;
}
if(@Yii::app()->params["front"]) $front = Yii::app()->params["front"];
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
$auth = Authorisation::canParticipate(Yii::app()->session['userId'], $type, (string)$element["_id"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment