public function handleJsonResponse($success = false, $retVars = null)
    {
        $result = array();
        if ($success) {
            $result = array(
                'success' => $success
            );
        }
        if ($retVars) {
            $result = array_merge($retVars, $result);
        }

        $response = new SS_HTTPResponse(json_encode($result));
        $response->addHeader('Content-Type', 'application/json');
        return $response;
    }
public function handleJsonResponse($success = false, $retVars = null)
    {
        $result = array();
        if ($success) {
            $result = array(
                'success' => $success
            );
        }
        if ($retVars) {
            $result = array_merge($retVars, $result);
        }

        $response = new SS_HTTPResponse(json_encode($result));
        $response->addHeader('Content-Type', 'application/json');
        return $response;
    }
public function handleJsonResponse ( $ success = false , $ retVars = null ) { $ result = array ( ) ; if ( $ success ) { $ result = array ( 'success' => $ success ) ; } if ( $ retVars ) { $ result = array_merge ( $ retVars , $ result ) ; } $ response = new SS_HTTPResponse ( json_encode ( $ result ) ) ; $ response -> addHeader ( 'Content-Type' , 'application/json' ) ; return $ response ; }
AJAX Json Response handler

@param array|null $retVars
@param boolean $success
@return \SS_HTTPResponse
AJAX Json Response handler