PagesController::admin_ajax_copy PHP Method

admin_ajax_copy() public method

コピー
public admin_ajax_copy ( ) : boolean
return boolean
    public function admin_ajax_copy()
    {
        $this->autoRender = false;
        if (!$this->request->data) {
            $this->ajaxError(500, '無効な処理です。');
        }
        $user = $this->BcAuth->user();
        $data = $this->Page->copy($this->request->data['entityId'], $this->request->data['parentId'], $this->request->data['title'], $user['id'], $this->request->data['siteId']);
        if ($data) {
            $message = '固定ページのコピー「' . $this->request->data['title'] . '」を追加しました。';
            $this->setMessage($message, false, true, false);
            return json_encode($data['Content']);
        } else {
            $this->ajaxError(500, $this->Page->validationErrors);
        }
        return false;
    }