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

DWZ操作成功后的回调方法

WBOY
WBOY原創
2016-06-07 11:43:121242瀏覽

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元

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn