From 04eb9282b26ea770adcc41b82749312b50a38739 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 6 Aug 2016 17:34:17 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BB=E3=83=B3=E3=82=BF=E3=83=BC=E4=B9=97?= =?UTF-8?q?=E3=81=A3=E5=8F=96=E3=81=A3=E3=81=9F=E5=BE=8C=E3=80=81=E3=83=AA?= =?UTF-8?q?=E3=83=80=E3=82=A4=E3=83=AC=E3=82=AF=E3=83=88=E3=81=99=E3=82=8B?= =?UTF-8?q?=E9=9A=9B=E3=81=AB=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/Component/NetCommonsComponent.php | 10 ++++++++++ View/Elements/common_header.ctp | 4 ++++ View/Helper/BackToHelper.php | 4 ++-- View/Helper/ButtonHelper.php | 6 +++--- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Controller/Component/NetCommonsComponent.php b/Controller/Component/NetCommonsComponent.php index 96b1b9c7..47865db0 100644 --- a/Controller/Component/NetCommonsComponent.php +++ b/Controller/Component/NetCommonsComponent.php @@ -127,4 +127,14 @@ public function setFlashNotification($message, $params = array(), $status = 200) $this->controller->Session->setFlash($message, $element, $params); } } + +/** + * bodyタグの直下に強制的に埋め込むHTMLタグ。特にリダイレクト時に使用する + * + * @param string $html HTML + * @return void + */ + public function setAppendHtml($html) { + $this->controller->Session->write('appendHtml', $html); + } } diff --git a/View/Elements/common_header.ctp b/View/Elements/common_header.ctp index 8e8d281a..e182e47c 100644 --- a/View/Elements/common_header.ctp +++ b/View/Elements/common_header.ctp @@ -109,3 +109,7 @@ if (! isset($isSettingMode)) { + +Session->read('appendHtml'); +CakeSession::delete('appendHtml'); \ No newline at end of file diff --git a/View/Helper/BackToHelper.php b/View/Helper/BackToHelper.php index 3e896fc0..544f5747 100644 --- a/View/Helper/BackToHelper.php +++ b/View/Helper/BackToHelper.php @@ -74,7 +74,7 @@ public function button($title, $url, $options = array()) { if ($url) { $inputOptions = Hash::merge(array( 'class' => 'btn btn-default btn-workflow' . $sizeAttr, - 'ng-disabled' => 'sending', + 'ng-class' => '{disabled: sending}', 'ng-click' => 'sending=true', ), $options); @@ -83,7 +83,7 @@ public function button($title, $url, $options = array()) { $inputOptions = Hash::merge(array( 'type' => 'button', 'class' => 'btn btn-default btn-workflow' . $sizeAttr, - 'ng-disabled' => 'sending', + 'ng-class' => '{disabled: sending}', ), $options); return $this->Form->button($iconElement . $title, $inputOptions); diff --git a/View/Helper/ButtonHelper.php b/View/Helper/ButtonHelper.php index 96a48728..72d8a04f 100644 --- a/View/Helper/ButtonHelper.php +++ b/View/Helper/ButtonHelper.php @@ -118,7 +118,7 @@ public function delete($title, $confirm, $options = array()) { 'name' => 'delete', 'class' => 'btn btn-danger' . $this->getButtonSize(), 'onclick' => 'return confirm(\'' . $confirm . '\')', - 'ng-disabled' => 'sending' + 'ng-class' => '{disabled: sending}', ); if (isset($options['addClass'])) { @@ -166,7 +166,7 @@ public function save($title, $options = array()) { $inputOptions = Hash::merge(array( 'class' => 'btn btn-primary' . $this->getButtonSize() . ' btn-workflow', - 'ng-disabled' => 'sending', + 'ng-class' => '{disabled: sending}', 'ng-click' => 'sending=true' ), $options); $inputOptions = Hash::remove($inputOptions, 'url'); @@ -176,7 +176,7 @@ public function save($title, $options = array()) { $inputOptions = Hash::merge(array( 'name' => 'save', 'class' => 'btn btn-primary' . $this->getButtonSize() . ' btn-workflow', - 'ng-disabled' => 'sending' + 'ng-class' => '{disabled: sending}', ), $options); return $this->Form->button($title, $inputOptions);