CC-4895: Remove all json die() statements from code
- removed json_encode
This commit is contained in:
parent
7bc4151741
commit
525b2dcb33
15 changed files with 43 additions and 51 deletions
|
@ -133,7 +133,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
if (!$p_isJson) {
|
||||
$this->createFullResponse(null);
|
||||
} else {
|
||||
$this->_helper->json->sendJson(json_encode(array("error"=>$this->view->error, "result"=>1, "html"=>$this->createFullResponse(null, $p_isJson))));
|
||||
$this->_helper->json->sendJson(array("error"=>$this->view->error, "result"=>1, "html"=>$this->createFullResponse(null, $p_isJson)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -509,7 +509,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$result["modified"] = $this->view->modified;
|
||||
$this->_helper->json->sendJson(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
|
||||
public function smartBlockGenerateAction()
|
||||
|
@ -525,7 +525,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$form->startForm($params['obj_id']);
|
||||
if ($form->isValid($params)) {
|
||||
$result = $bl->generateSmartBlock($params['data']);
|
||||
$this->_helper->json->sendJson(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
} else {
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
|
@ -533,7 +533,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$viewPath = 'playlist/smart-block.phtml';
|
||||
$result['html'] = $this->view->render($viewPath);
|
||||
$result['result'] = 1;
|
||||
$this->_helper->json->sendJson(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -552,9 +552,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$result = $bl->shuffleSmartBlock();
|
||||
|
||||
if ($result['result'] == 0) {
|
||||
$this->_helper->json->sendJson(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true)));
|
||||
} else {
|
||||
$this->_helper->json->sendJson(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -572,9 +572,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$result = $pl->shuffle();
|
||||
|
||||
if ($result['result'] == 0) {
|
||||
$this->_helper->json->sendJson(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($pl, true)));
|
||||
} else {
|
||||
$this->_helper->json->sendJson(json_encode($result));
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -595,7 +595,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$out = $bl->getCriteria();
|
||||
$out['isStatic'] = false;
|
||||
}
|
||||
$this->_helper->json->sendJson(json_encode($out));
|
||||
$this->_helper->json->sendJson($out);
|
||||
}
|
||||
}
|
||||
class WrongTypeToBlockException extends Exception {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue