Skip to content

Commit 40eb809

Browse files
committed
不要なタグ属性削除
1 parent f4f3a64 commit 40eb809

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

View/Helper/LinkButtonHelper.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function add($title = '', $url = null, $options = array()) {
7474
unset($inputOptions['icon']);
7575
//ボタンサイズ
7676
if ($inputOptions['iconSize']) {
77-
$inputOptions['class'] .= ' ' . h($inputOptions['iconSize']);
77+
$inputOptions['class'] .= ' ' . trim(h($inputOptions['iconSize']));
7878
}
7979
unset($inputOptions['iconSize']);
8080

@@ -123,7 +123,9 @@ public function edit($title = '', $url = null, $options = array()) {
123123
unset($inputOptions['icon']);
124124

125125
//ボタンサイズ
126-
$inputOptions['class'] .= ' ' . h($inputOptions['iconSize']);
126+
if ($inputOptions['iconSize']) {
127+
$inputOptions['class'] .= ' ' . trim(h($inputOptions['iconSize']));
128+
}
127129
unset($inputOptions['iconSize']);
128130

129131
//span tooltipタグの出力
@@ -171,7 +173,9 @@ public function search($title = '', $url = null, $options = array()) {
171173
unset($inputOptions['icon']);
172174

173175
//ボタンサイズ
174-
$inputOptions['class'] .= ' ' . h($inputOptions['iconSize']);
176+
if ($inputOptions['iconSize']) {
177+
$inputOptions['class'] .= ' ' . trim(h($inputOptions['iconSize']));
178+
}
175179
unset($inputOptions['iconSize']);
176180

177181
//span tooltipタグの出力
@@ -227,7 +231,9 @@ public function sort($title = '', $url = null, $options = array()) {
227231
unset($inputOptions['icon']);
228232

229233
//ボタンサイズ
230-
$inputOptions['class'] .= ' ' . h($inputOptions['iconSize']);
234+
if ($inputOptions['iconSize']) {
235+
$inputOptions['class'] .= ' ' . trim(h($inputOptions['iconSize']));
236+
}
231237
unset($inputOptions['iconSize']);
232238

233239
//span tooltipタグの出力

View/Helper/NetCommonsFormHelper.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
241241

242242
$input = '';
243243

244+
$outer = Hash::get($attributes, 'outer');
245+
$attributes = Hash::remove($attributes, 'outer');
246+
244247
$befor = Hash::get($attributes, 'before', '');
245248
$separator = Hash::get($attributes, 'separator', '');
246249
$after = Hash::get($attributes, 'after', '');
@@ -260,7 +263,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
260263
}
261264

262265
$output = '';
263-
if (Hash::get($attributes, 'outer')) {
266+
if ($outer) {
264267
$output .= '<div class="form-input-outer">';
265268
$output .= $input;
266269
$output .= '</div>';
@@ -356,6 +359,10 @@ protected function _multipleCheckbox($fieldName, $options = array()) {
356359
$hiddenField = true;
357360
$input = '';
358361
$divOption = Hash::get($options, 'div');
362+
363+
$outer = Hash::get($options, 'outer');
364+
$options = Hash::remove($options, 'outer');
365+
359366
foreach ($options['options'] as $key => $value) {
360367
$inputOptions = array(
361368
'type' => 'select',
@@ -373,7 +380,7 @@ protected function _multipleCheckbox($fieldName, $options = array()) {
373380
$input = $this->Html->div(null, $input, $divOption);
374381
}
375382

376-
if (Hash::get($options, 'outer')) {
383+
if ($outer) {
377384
$output .= '<div class="form-input-outer">';
378385
$output .= $input;
379386
$output .= '</div>';

0 commit comments

Comments
 (0)