Maison >php教程 >php手册 >DWZ操作成功后的回调方法

DWZ操作成功后的回调方法

WBOY
WBOYoriginal
2016-06-07 11:43:121230parcourir

tp+dwz回调刷新关dialog的方法
/**<br>      * 操作失败的Ajax返回<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxDelReturnFail($message="删除操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax删除操作成功<br>      * @param string $message<br>      * @param string $navTabId<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxDelReturnSucc($navTabId,$message="删除操作成功",$statusCode="1",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * 操作成功的Ajax返回<br>      * (non-PHPdoc)<br>      * @see Action::ajaxReturn()<br>      */<br>     public function ajaxInsertReturnSucc($navTabId,$message="新增操作成功",$statusCode="1",$callbackType="closeCurrent",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax新增操作失败<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxInsertReturnFail($message="新增操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br> <br>         $result  =  array();<br> <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * 操作成功的Ajax返回<br>      * (non-PHPdoc)<br>      * @see Action::ajaxReturn()<br>      */<br>     public function ajaxUpdateReturnSucc($navTabId,$message="更新操作成功",$statusCode="1",$callbackType="closeCurrent",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>             <br>         $result  =  array();<br>             <br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }<br>     /**<br>      * Ajax新增操作失败<br>      * @param unknown $navTabId<br>      * @param string $message<br>      * @param string $statusCode<br>      * @param string $callbackType<br>      * @param string $rel<br>      * @param string $forwardUrl<br>      * @param string $type<br>      */<br>     public function ajaxUpdateReturnFail($message="更新操作失败",$navTabId="",$statusCode="0",$callbackType="",$rel="", $forwardUrl="",$type="JSON")<br>     {<br>         // 保证AJAX返回后也能保存日志<br>         if(C('LOG_RECORD')) Log::save();<br>         $result  =  array();<br>         $result['statusCode']  = $statusCode;    // zhanghuihua@msn.com<br>         $result['message'] = $message; // zhanghuihua@msn.com<br>         $result['navTabId']  = $navTabId;    // zhanghuihua@msn.com<br>         $result['rel']  = $rel;    // zhanghuihua@msn.com<br>         $result['callbackType']  =$callbackType;    // zhanghuihua@msn.com<br>         $result['forwardUrl']  =  $forwardUrl;    // zhanghuihua@msn.com<br> <br>         // 返回JSON数据格式到客户端 包含状态信息<br>         header("Content-Type:text/html; charset=utf-8");<br>         exit(json_encode($result));<br> <br>     }

AD:真正免费,域名+虚机+企业邮箱=0元

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn