Skip to content

Commit

Permalink
Move frames plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
snakajima authored and snakajima committed Apr 14, 2015
1 parent 7ed5bae commit f778f02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
34 changes: 2 additions & 32 deletions Controller/BlocksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BlocksController extends BbsesAppController {
'NetCommons.NetCommonsRoomRole' => array(
//コンテンツの権限設定
'allowedActions' => array(
'blockEditable' => array('index', 'current', 'add', 'edit', 'delete')
'blockEditable' => array('index', 'add', 'edit', 'delete')
),
),
'Paginator',
Expand Down Expand Up @@ -88,7 +88,7 @@ public function index() {
'Block.language_id = ' . $this->viewVars['languageId'],
'Block.room_id = ' . $this->viewVars['roomId'],
),
//'limit' => 1
'limit' => 1
)
);
$bbses = $this->Paginator->paginate('Bbs');
Expand All @@ -111,36 +111,6 @@ public function index() {
}
}

/**
* current
*
* @return void
*/
public function current() {
if (! $this->request->isPost()) {
$this->throwBadRequest();
return;
}

$this->Frame->setDataSource('master');
$frame = $this->Frame->find('first', array(
'recursive' => -1,
'conditions' => array(
'Frame.id' => $this->viewVars['frameId'],
),
));

$data = Hash::merge($frame, $this->data);

$this->Frame->saveFrame($data);
$this->handleValidationError($this->Frame->validationErrors);

if (! $this->request->is('ajax')) {
$this->redirect('/bbses/blocks/index/' . $this->viewVars['frameId'] .
((int)($this->params['named']['page']) > 1 ? '/page:' . (int)$this->params['named']['page'] : ''));
}
}

/**
* add
*
Expand Down
2 changes: 1 addition & 1 deletion View/Blocks/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<div id="nc-bbs-setting-<?php echo $frameId; ?>">
<?php echo $this->Form->create('', array(
'url' => '/bbses/blocks/current/' . $frameId . '/page:' . $this->Paginator->param('page')
'url' => '/frames/frames/edit/' . $frameId
)); ?>

<?php echo $this->Form->hidden('Frame.id', array(
Expand Down

0 comments on commit f778f02

Please sign in to comment.