fix indentation and remove \r characters
This commit is contained in:
parent
4d8dc01638
commit
d517bf6e19
|
@ -270,12 +270,11 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$obj = null;
|
$obj = null;
|
||||||
|
|
||||||
$objInfo = $this->getObjInfo($type);
|
$objInfo = $this->getObjInfo($type);
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
$user = new Application_Model_User($userInfo->id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Logging::log("Currently active {$type} {$this->obj_sess->id}");
|
Logging::log("Currently active {$type} {$this->obj_sess->id}");
|
||||||
if (in_array($this->obj_sess->id, $ids)) {
|
if (in_array($this->obj_sess->id, $ids)) {
|
||||||
Logging::log("Deleting currently active {$type}");
|
Logging::log("Deleting currently active {$type}");
|
||||||
|
@ -290,11 +289,9 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
Application_Model_Block::deleteBlocks($ids, $userInfo->id);
|
Application_Model_Block::deleteBlocks($ids, $userInfo->id);
|
||||||
}
|
}
|
||||||
$this->createFullResponse($obj);
|
$this->createFullResponse($obj);
|
||||||
}
|
} catch (PlaylistNoPermissionException $e) {
|
||||||
catch (PlaylistNoPermissionException $e) {
|
|
||||||
$this->playlistNoPermission($type);
|
$this->playlistNoPermission($type);
|
||||||
}
|
} catch (PlaylistNotFoundException $e) {
|
||||||
catch (PlaylistNotFoundException $e) {
|
|
||||||
$this->playlistNotFound($type);
|
$this->playlistNotFound($type);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
|
@ -524,18 +521,18 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->setPlaylistNameDescAction();
|
$this->setPlaylistNameDescAction();
|
||||||
|
|
||||||
if ($params['type'] == 'block') {
|
if ($params['type'] == 'block') {
|
||||||
$form = new Application_Form_SmartBlockCriteria();
|
$form = new Application_Form_SmartBlockCriteria();
|
||||||
$form->startForm($params['obj_id']);
|
$form->startForm($params['obj_id']);
|
||||||
$bl = new Application_Model_Block($params['obj_id']);
|
$bl = new Application_Model_Block($params['obj_id']);
|
||||||
if ($form->isValid($params)) {
|
if ($form->isValid($params)) {
|
||||||
$bl->saveSmartBlockCriteria($params['data']);
|
$bl->saveSmartBlockCriteria($params['data']);
|
||||||
$result['html'] = $this->createFullResponse($bl, true);
|
$result['html'] = $this->createFullResponse($bl, true);
|
||||||
$result['result'] = 0;
|
$result['result'] = 0;
|
||||||
} else {
|
} else {
|
||||||
$this->view->obj = $bl;
|
$this->view->obj = $bl;
|
||||||
$this->view->id = $bl->getId();
|
$this->view->id = $bl->getId();
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$viewPath = 'playlist/smart-block.phtml';
|
$viewPath = 'playlist/smart-block.phtml';
|
||||||
$result['html'] = $this->view->render($viewPath);
|
$result['html'] = $this->view->render($viewPath);
|
||||||
$result['result'] = 1;
|
$result['result'] = 1;
|
||||||
}
|
}
|
||||||
|
@ -545,11 +542,11 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
die(json_encode($result));
|
die(json_encode($result));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function smartBlockGenerateAction()
|
public function smartBlockGenerateAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$params = $request->getPost();
|
$params = $request->getPost();
|
||||||
$form = new Application_Form_SmartBlockCriteria();
|
$form = new Application_Form_SmartBlockCriteria();
|
||||||
$form->startForm($params['obj_id']);
|
$form->startForm($params['obj_id']);
|
||||||
$bl = new Application_Model_Block($params['obj_id']);
|
$bl = new Application_Model_Block($params['obj_id']);
|
||||||
if ($form->isValid($params)) {
|
if ($form->isValid($params)) {
|
||||||
|
@ -564,35 +561,35 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$this->view->obj = $bl;
|
$this->view->obj = $bl;
|
||||||
$this->view->id = $bl->getId();
|
$this->view->id = $bl->getId();
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$viewPath = 'playlist/smart-block.phtml';
|
$viewPath = 'playlist/smart-block.phtml';
|
||||||
$result['html'] = $this->view->render($viewPath);
|
$result['html'] = $this->view->render($viewPath);
|
||||||
$result['result'] = 1;
|
$result['result'] = 1;
|
||||||
die(json_encode($result));
|
die(json_encode($result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function smartBlockShuffleAction()
|
public function smartBlockShuffleAction()
|
||||||
{
|
{
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$params = $request->getPost();
|
$params = $request->getPost();
|
||||||
$bl = new Application_Model_Block($params['obj_id']);
|
$bl = new Application_Model_Block($params['obj_id']);
|
||||||
$result = $bl->shuffleSmartBlock();
|
$result = $bl->shuffleSmartBlock();
|
||||||
|
|
||||||
if ($result['result'] == 0) {
|
if ($result['result'] == 0) {
|
||||||
try {
|
try {
|
||||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
||||||
}
|
}
|
||||||
catch (PlaylistNotFoundException $e) {
|
catch (PlaylistNotFoundException $e) {
|
||||||
$this->playlistNotFound('block');
|
$this->playlistNotFound('block');
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
die(json_encode($result));
|
die(json_encode($result));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +607,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockInfoAction(){
|
public function getBlockInfoAction(){
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$params = $request->getPost();
|
$params = $request->getPost();
|
||||||
$bl = new Application_Model_Block($params['id']);
|
$bl = new Application_Model_Block($params['id']);
|
||||||
if ($bl->isStatic()) {
|
if ($bl->isStatic()) {
|
||||||
|
|
Loading…
Reference in New Issue