- Timestamp:
- 01/09/12 00:44:13 (5 months ago)
- Location:
- trunk/templates/base
- Files:
-
- 2 edited
-
css/forms.css (modified) (1 diff)
-
scripts/BxBaseFormView.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/base/css/forms.css
r15850 r15855 364 364 } 365 365 366 .bx-form-value-oneline, 367 .bx-form-caption-oneline { 368 float:left; 369 } 370 371 .bx-form-caption-oneline-switcher { 372 line-height:26px; 373 } 374 366 375 /* extra features */ 367 376 -
trunk/templates/base/scripts/BxBaseFormView.php
r15798 r15855 210 210 $sRow = $this->genRowCustom($aInput, 'genInputFiles'); 211 211 break; 212 213 case 'switcher': 214 case 'checkbox': 215 $sRow = $this->genRowStandard($aInput, true); 216 break; 212 217 213 218 default: … … 224 229 * @return string 225 230 */ 226 function genRowStandard(&$aInput ) {231 function genRowStandard(&$aInput, $isOneLine = false) { 227 232 228 233 $sCaption = isset($aInput['caption']) ? bx_process_output($aInput['caption']) : ''; … … 250 255 } 251 256 257 $sClassOneLineCaption = ''; 258 $sClassOneLineValue = ''; 259 if ($isOneLine) { 260 $sClassOneLineCaption = ' bx-form-caption-oneline bx-form-caption-oneline-' . $aInput['type'] . ' bx-def-margin-sec-left'; 261 $sClassOneLineValue = ' bx-form-value-oneline bx-form-value-oneline-' . $aInput['type']; 262 $aInput['attrs']['id'] = $this->getInputId($aInput); 263 if ($sCaption) 264 $sCaption = '<label for="' . $aInput['attrs']['id'] . '">' . $sCaption . '</label>'; 265 } 266 252 267 $sInput = $this->genInput($aInput); 253 268 254 269 $sCaptionCode = ''; 255 270 if ($sCaption) 256 $sCaptionCode = '<div class="bx-form-caption ">' . $sCaption . $sRequired . '</div>';271 $sCaptionCode = '<div class="bx-form-caption' . $sClassOneLineCaption . '">' . $sCaption . $sRequired . '</div>'; 257 272 else 258 $sInput .= $sRequired; // TODO: maybe some other way to show required item273 $sInput .= $sRequired; 259 274 260 275 $sInputCode = $this->genWrapperInput($aInput, $sInput); … … 267 282 if (empty($sErrorIcon)) $sErrorIcon = ''; 268 283 269 $sCode = <<<BLAH 270 <div $sTrAttrs> 271 $sCaptionCode 272 <div class="bx-form-value$sClassAdd"> 284 $sValueCode = <<<BLAH 285 <div class="bx-form-value{$sClassAdd}{$sClassOneLineValue}"> 273 286 <div class="bx-clear"></div> 274 287 $sInputCode … … 279 292 <div class="bx-clear"></div> 280 293 </div> 281 </div>282 294 BLAH; 283 284 285 return $sCode; 295 296 if ($isOneLine) 297 $sCode = $sValueCode . $sCaptionCode . '<div class="bx-clear"></div>'; 298 else 299 $sCode = $sCaptionCode . $sValueCode; 300 301 return "<div $sTrAttrs>" . $sCode . "</div>"; 286 302 } 287 303 … … 565 581 $aInput['type'] = 'checkbox'; 566 582 $sCheckbox = $this->genInputStandard(&$aInput); 583 $aInput['type'] = 'switcher'; 567 584 568 585 $sClass = 'off';
Note: See TracChangeset
for help on using the changeset viewer.