Ignore:
Timestamp:
2012/01/23 04:49:37 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/smarty_extends/function.html_checkboxes_ex.php

    r18234 r21420  
    4949    $separator = ''; 
    5050    $labels = true; 
    51     $label_ids = true; 
     51    $label_ids = true; 
    5252    $output = null; 
    5353 
     
    5656    foreach($params as $_key => $_val) { 
    5757        switch($_key) { 
    58             case 'tags': 
    59                 $$_key = split("\|", $_val); 
    60                 break; 
     58    case 'tags': 
     59    $$_key = split("\|", $_val); 
     60    break; 
    6161            case 'name': 
    6262            case 'separator': 
     
    6565 
    6666            case 'labels': 
    67             case 'label_ids': 
     67    case 'label_ids': 
    6868                $$_key = (bool)$_val; 
    6969                break; 
     
    129129 
    130130function smarty_function_html_checkboxes_output_ex($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $tags) { 
    131     $_output = ''; 
    132          
     131    $_output = ''; 
     132 
    133133    $_output .= '<input type="checkbox" name="' 
    134134        . smarty_function_escape_special_chars($name) . '[]" value="' 
    135135        . smarty_function_escape_special_chars($value) . '"'; 
    136      
    137     if ($labels && $label_ids) { 
    138         $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value)); 
    139         $_output .= ' id="' . $_id . '"'; 
    140     } 
    141      
     136 
     137    if ($labels && $label_ids) { 
     138    $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value)); 
     139    $_output .= ' id="' . $_id . '"'; 
     140    } 
     141 
    142142    if (in_array((string)$value, $selected)) { 
    143143        $_output .= ' checked="checked"'; 
    144144    } 
    145145    $_output .= $extra . ' />'; 
    146      
    147     $_output .= $tags[0]; 
    148      
    149     if ($labels) { 
    150         if($label_ids) { 
    151             $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value)); 
    152             $_output .= '<label for="' . $_id . '">'; 
    153         } else { 
    154             $_output .= '<label>';           
    155         } 
    156     } 
    157      
    158     // 値を挿入 
    159     $_output .= $output; 
    160      
    161     $_output .= $tags[1]; 
    162      
     146 
     147    $_output .= $tags[0]; 
     148 
     149    if ($labels) { 
     150    if($label_ids) { 
     151    $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value)); 
     152    $_output .= '<label for="' . $_id . '">'; 
     153    } else { 
     154    $_output .= '<label>'; 
     155    } 
     156    } 
     157 
     158    // 値を挿入 
     159    $_output .= $output; 
     160 
     161    $_output .= $tags[1]; 
     162 
    163163    if ($labels) $_output .= '</label>'; 
    164164    $_output .=  $separator; 
     
    166166    return $_output; 
    167167} 
    168  
    169 ?> 
Note: See TracChangeset for help on using the changeset viewer.