Skip to content

Commit

Permalink
BcFreezeHelper::checkbox() を調整
Browse files Browse the repository at this point in the history
引数が古い仕様のままだったので調整した
  • Loading branch information
ryuring committed Aug 20, 2012
1 parent 78e3ed6 commit 8479e0c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions baser/views/helpers/bc_freeze.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,14 @@ function wyear($fieldName, $minYear = null, $maxYear = null, $selected = null, $
* @return string htmlタグ
* @access public
*/
function checkbox($fieldName,$title,$attributes = array()) {

function checkbox($fieldName, $attributes = array()) {
if($this->freezed) {
$options = array(0=>'',1=>$title);
$label = '';
if(isset($attributes['lable'])) {
$label = $attributes['label'];
}
$options = array(0 => '', 1 => $label);
return $this->freezeControll($fieldName, $options,$attributes);
}else {
return parent::checkbox($fieldName,$attributes);
Expand Down Expand Up @@ -428,7 +432,7 @@ function image($fieldName, $attributes = array(), $imageAttributes = array()) {
$path = DS.$imageAttributes['dir'].DS.Inflector::tableize($model).DS.$imageAttributes['id'].DS.$field.".".$imageAttributes['ext']."?".rand();
unset($imageAttributes['ext']);
$output = sprintf($this->Html->tags['image'], $path, $this->Html->_parseAttributes($imageAttributes));
$output .= "<br />".$this->checkbox($fieldName."_delete","削除する");
$output .= "<br />".$this->checkbox($fieldName."_delete", array('label' => '削除する'));
}
return parent::file($fieldName, $attributes)."<br />".$output;
}
Expand Down

0 comments on commit 8479e0c

Please sign in to comment.