Merge branch 'master' into 'apiext'
# Conflicts: # config/routes.php
This commit is contained in:
@@ -927,6 +927,14 @@ class baseControl
|
||||
{
|
||||
if(!empty($data['message']))
|
||||
{
|
||||
if(is_string($data['message']))
|
||||
{
|
||||
echo js::alert($data['message']);
|
||||
$locate = isset($data['locate']) ? $data['locate'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
|
||||
if (!empty($locate)) die(js::locate($locate));
|
||||
die(isset($data['message']) ? $data['message'] : 'fail');
|
||||
}
|
||||
|
||||
$message = json_decode(json_encode((array)$data['message']));
|
||||
foreach((array)$message as $item => $errors) $message->$item = implode(',', $errors);
|
||||
die(js::alert(strip_tags(implode('\n', (array)$message))));
|
||||
@@ -944,10 +952,7 @@ class baseControl
|
||||
*/
|
||||
public function sendError($error)
|
||||
{
|
||||
$this->send([
|
||||
'result' => 'fail',
|
||||
'message' => $error,
|
||||
]);
|
||||
$this->send(array('result' => 'fail', 'message' => $error));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user