Created
August 22, 2013 20:42
-
-
Save mbabker/6312530 to your computer and use it in GitHub Desktop.
Updated AJAX handling for app client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function installfromweb() { | |
$model = $this->getModel('install'); | |
$response = $model->installfromweb(); | |
echo new JResponseJson($response['body'], $response['message'], $response['error']); | |
jexit(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function installfromweb() { | |
//@TODO: Construct the URL by passing along all URL vars except option & task | |
$apps_dashboard = APPS_BASE_URL.'index.php?option=com_apps&view=dashboard&format=raw'; | |
$response = array(); | |
$http = JHttpFactory::getHttp(); | |
try { | |
$html = $http->get($apps_dashboard); | |
$response['body'] = $html->body; | |
$response['message'] = ''; | |
$response['error'] = false; | |
} catch (Exception $e) { | |
header('HTTP/1.1 503 Service Temporarily Unavailable'); | |
header('Status: 503 Service Temporarily Unavailable'); | |
$response['message'] = $e->getMessage(); | |
$response['error'] = true; | |
} | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment