Changeset 15546 for trunk/templates
- Timestamp:
- 10/06/11 02:16:37 (8 months ago)
- Location:
- trunk/templates/base
- Files:
-
- 6 edited
-
css/forms.css (modified) (6 diffs)
-
images/icons/toggle_down.png (modified) (previous)
-
scripts/BxBaseFormView.php (modified) (29 diffs)
-
uploader_button_html5.html (modified) (1 diff)
-
uploader_button_simple.html (modified) (1 diff)
-
uploader_nested_form_wrapper.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/base/css/forms.css
r15484 r15546 1 1 2 .bx-form-advanced-wrapper > .bx-form-section-header:first-child { 3 margin-top:0; 4 } 5 6 .bx-form-advanced-wrapper > .bx-form-section:first-child { 7 border-top:none; 8 padding-top:0; 9 } 2 10 3 11 .bx-form-section-header { 4 font-size:16px; 5 font-weight:bold; 12 position:relative; 6 13 text-transform:uppercase; 14 } 15 16 .bx-form-section { 17 border-width:2px; 7 18 } 8 19 … … 12 23 13 24 .bx-form-caption { 14 font-size:16px;15 25 font-weight:bold; 16 26 margin-bottom:5px; … … 27 37 28 38 .bx-form-info { 29 font-style:italic; 39 30 40 } 31 41 32 42 /* form inputs */ 33 43 44 .bx-form-input-wrapper-doublerange, 45 .bx-form-input-select_multiple, 46 .bx-form-input-select, 47 .bx-form-input-radio_set, 48 .bx-form-input-checkbox_set, 34 49 .bx-form-input-email, 35 50 .bx-form-input-number, … … 86 101 } 87 102 103 .bx-form-input-select_multiple, 104 .bx-form-input-radio_set, 105 .bx-form-input-checkbox_set { 106 height:auto; 107 } 108 88 109 .bx-form-input-textarea { 89 110 padding:8px; … … 94 115 95 116 .bx-form-input-datepicker { 96 width: 80px;117 width:110px; 97 118 } 98 119 … … 117 138 } 118 139 140 /* section toggler */ 141 142 .bx-form-section-toggle { 143 position:absolute; 144 top:10px; 145 right:0; 146 } 147 148 .bx-form-section-toggle .bx-btn u { 149 background-image:url(../images/icons/toggle_down.png); 150 151 -moz-transform: rotate(-180deg); 152 -webkit-transform: rotate(-180deg); 153 -ms-transform: rotate(-180deg); 154 -o-transform: rotate(-180deg); 155 156 -webkit-transition: all 0.5s ease; 157 -moz-transition: all 0.5s ease; 158 -ms-transition: all 0.5s ease; 159 -o-transition: all 0.5s ease; 160 } 161 162 .bx-form-section-toggle .bx-btn u.collapsed { 163 164 -moz-transform: rotate(0deg); 165 -webkit-transform: rotate(0deg); 166 -ms-transform: rotate(0deg); 167 -o-transform: rotate(0deg); 168 } -
trunk/templates/base/scripts/BxBaseFormView.php
r15533 r15546 11 11 class BxBaseFormView extends BxDolForm { 12 12 13 protected static $_isToggleJsAdded = false; 14 15 protected static $_isCssJsAdded = false; 16 13 17 var $bEnableErrorIcon = true; 14 18 … … 42 46 */ 43 47 var $_bHtmlEditorAdded = false; 48 49 /** 50 * Default divider for several inputs 51 * @var string 52 */ 53 var $_sDivider = '<span class="bx-def-margin-left"></span>'; 54 55 /** 56 * Alternative divider for several inputs 57 * @var string 58 */ 59 var $_sDividerAlt = '<br />'; 44 60 45 61 /** … … 130 146 ) 131 147 ); 148 } 149 150 // check if we need to generate open section clause 151 $sOpenSection = ''; 152 foreach ($this->aInputs as $aInput) { 153 if (isset($aInput['type']) && 'hidden' == $aInput['type']) 154 continue; 155 if (isset($aInput['type']) && 'block_header' != $aInput['type']) 156 $sOpenSection = $this->getOpenSection(); 157 break; 132 158 } 133 159 … … 136 162 foreach ($this->aInputs as $aInput) 137 163 $sCont .= $this->genRow($aInput); 138 139 $sOpenSection = $this->getOpenSection(); 164 140 165 $sCloseSection = $this->getCloseSection(); 141 166 … … 150 175 */ 151 176 function genRow(&$aInput) { 177 178 if (!isset($aInput['type'])) 179 $aInput['type'] = false; 152 180 153 181 switch ($aInput['type']) { … … 215 243 } 216 244 217 $sInput = $this->genInput($aInput); 245 $sInput = $this->genInput($aInput); 246 247 $sCaptionCode = ''; 248 if ($sCaption) 249 $sCaptionCode = '<div class="bx-form-caption">' . $sCaption . $sRequired . '</div>'; 250 else 251 $sInput .= $sRequired; // TODO: maybe some other way to show required item 252 218 253 $sInputCode = $this->genWrapperInput($aInput, $sInput); 219 254 … … 227 262 $sCode = <<<BLAH 228 263 <div $sTrAttrs> 229 <div class="bx-form-caption"> 230 $sCaption 231 $sRequired 232 </div> 233 264 $sCaptionCode 234 265 <div class="bx-form-value$sClassAdd"> 235 266 <div class="bx-clear"></div> … … 284 315 $sTrAttrs = $this->convertArray2Attrs(empty($aInput['tr_attrs']) ? array() : $aInput['tr_attrs']); 285 316 317 $sCaptionCode = ''; 318 if ($sCaption) 319 $sCaptionCode = '<div class="bx-form-caption">' . $sCaption . $sRequired . '</div>'; 320 286 321 $sCode = <<<BLAH 287 322 <div $sTrAttrs> 288 <div class="bx-form-caption"> 289 $sCaption 290 $sRequired 291 </div> 292 323 $sCaptionCode 293 324 <div class="bx-form-value$sClassAdd"> 294 325 <div class="bx-clear"></div> … … 312 343 $aAttrs = empty($aInput['attrs']) ? '' : $aInput['attrs']; 313 344 $aNextTbodyAdd = false; // need to have some default 345 346 if (!$aInput['caption']) { 347 $sCode = $this->getCloseSection(); 348 $aAttrs['class'] = "bx-form-section-divider bx-def-margin-top " . (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : ''); 349 $sAttrs = $this->convertArray2Attrs($aAttrs); 350 $sCode .= "<div $sAttrs></div>"; 351 $sCode .= $this->getOpenSection(false); 352 return $sCode; 353 } 314 354 315 355 if (isset($aInput['collapsable']) and $aInput['collapsable']) { … … 327 367 } 328 368 329 $aAttrs['class'] = "bx-form-section-header bx-def-margin- sec" .369 $aAttrs['class'] = "bx-form-section-header bx-def-margin-top bx-def-padding-sec-top bx-def-padding-sec-bottom bx-def-font-grayed bx-def-font-h3" . 330 370 (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : '') . 331 371 (isset($sClassAdd) ? ' ' . $sClassAdd : ''); … … 336 376 337 377 $sCode .= $this->getCloseSection(); 338 339 $sCode .= "<div $sAttrs>" . bx_process_output($aInput['caption']) . " <a href=\"javascript:void(0)\" onclick=\"javascript:$(this).parent().next().toggle()\">Toggle</a></div>\n"; 378 379 $sCode .= "<div $sAttrs>" . bx_process_output($aInput['caption']); 380 if (isset($aInput['collapsable']) and $aInput['collapsable']) 381 $sCode .= $this->genToggleElement($aInput); 382 $sCode .= "</div>\n"; 340 383 341 384 $sCode .= $this->getOpenSection($aNextTbodyAdd); … … 358 401 * @return string Output HTML Code 359 402 */ 360 function genInput(&$aInput) { 361 362 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : ' '; 403 function genInput(&$aInput) { 363 404 364 405 switch ($aInput['type']) { … … 411 452 case 'input_set': // numeric array of inputs 412 453 $sInput = ''; 413 454 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : ' '; 414 455 foreach ($aInput as $iKey => $aSubInput) { 415 456 if (!is_int($iKey) or !$aSubInput) … … 529 570 $aAttrs['type'] = $aInput['type']; 530 571 if (isset($aInput['name'])) $aAttrs['name'] = $aInput['name']; 531 if (isset($aInput['value'])) $aAttrs['value'] = $aInput['value'];532 572 533 573 $sAttrs = $this->convertArray2Attrs($aAttrs); … … 605 645 606 646 /** 647 * Generate Select Box Element 648 * 649 * @param array $aInput 650 * @return string 651 */ 652 function genInputSelectBox(&$aInput, $sInfo = '', $sError = '') { 653 654 $aNewInput = $aInput; 655 656 $aNewInput['type'] = 'select'; 657 $aNewInput['name'] .= '[]'; 658 659 $sInput = $this->genInput($aNewInput); 660 return <<<BLAH 661 <div class="bx-form-input-wrapper input-wrapper-{$aInput['type']}"> 662 $sInput 663 </div> 664 $sInfo 665 $sError 666 BLAH; 667 668 } 669 670 /** 671 * Generate Select Box Element 672 * 673 * @param array $aInput 674 * @return string 675 */ 676 function genInputFiles(&$aInput, $sInfo = '', $sError = '') { 677 678 $sUniqId = genRndPwd (8, false); 679 $sUploaders = ''; 680 $oUploader = null; 681 foreach ($aInput['uploaders'] as $sUploaderObject) { 682 bx_import('BxDolUploader'); 683 $oUploader = BxDolUploader::getObjectInstance($sUploaderObject, $aInput['storage_object'], $sUniqId); 684 if (!$oUploader) 685 continue; 686 687 $sGhostTemplate = false; 688 if (isset($aInput['ghost_template']) && is_object($aInput['ghost_template'])) { // form is not submitted and ghost template is BxDolFormNested object 689 690 $oFormNested = $aInput['ghost_template']; 691 if ($oFormNested instanceof BxDolFormNested) 692 $sGhostTemplate = $oFormNested->getCode(); 693 694 } elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && isset($aInput['ghost_template']['inputs'])) { // form is not submitted and ghost template is form array 695 696 bx_import('BxDolFormNested'); 697 $oFormNested = new BxDolFormNested($aInput['name'], $aInput['ghost_template'], $this->aParams['db']['submit_name'], $this->oTemplate); 698 $sGhostTemplate = $oFormNested->getCode(); 699 700 } elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && $aInput['ghost_template']) { // form is submitted and ghost template is array of BxDolFormNested objects 701 702 bx_import('BxDolFormNested'); 703 $sGhostTemplate = array (); 704 foreach ($aInput['ghost_template'] as $iFileId => $oFormNested) 705 if (is_object($oFormNested) && $oFormNested instanceof BxDolFormNested) 706 $sGhostTemplate[$iFileId] = $oFormNested->getCode(); 707 708 } elseif (isset($aInput['ghost_template']) && is_string($aInput['ghost_template'])) { // ghost template is just string template, without nested form 709 710 $sGhostTemplate = $aInput['ghost_template']; 711 712 } 713 $aParams = array(); 714 if (isset($aInput['images_transcoder']) && $aInput['images_transcoder']) 715 $aParams = array('images_transcoder' => bx_js_string($aInput['images_transcoder'])); 716 $sUploaders .= $oUploader->getUploaderButton($sGhostTemplate, isset($aInput['multiple']) ? $aInput['multiple'] : true, $aParams); 717 } 718 719 return $this->oTemplate->parseHtmlByName('form_field_uploader.html', array( 720 'uploaders_buttons' => $sUploaders, 721 'info' => $sInfo, 722 'id_container_errors' => $oUploader->getIdContainerErrors(), 723 'id_container_result' => $oUploader->getIdContainerResult(), 724 'uploader_instance_name' => $oUploader->getNameJsInstanceUploader(), 725 'is_init_ghosts' => isset($aInput['init_ghosts']) && !$aInput['init_ghosts'] ? 0 : 1, 726 )); 727 } 728 729 /** 607 730 * Generate Select Element 608 731 * … … 611 734 */ 612 735 function genInputSelect(&$aInput) { 736 $sCurValue = isset($aInput['value']) ? $aInput['value'] : ''; 737 return $this->_genInputSelect(&$aInput, false, $sCurValue, '_isSelected'); 738 } 739 740 /** 741 * Generate Multiple Select Element 742 * 743 * @param array $aInput 744 * @return string 745 */ 746 function genInputSelectMultiple(&$aInput) { 747 $aCurValues = array(); 748 if (isset($aInput['value']) && $aInput['value']) 749 $aCurValues = is_array($aInput['value']) ? $aInput['value'] : array($aInput['value']); 750 return $this->_genInputSelect(&$aInput, true, $aCurValues, '_isSelectedMultiple'); 751 } 752 753 /** 754 * Generate Checkbox Set Element 755 * 756 * @param array $aInput 757 * @return string 758 */ 759 function genInputCheckboxSet(&$aInput) { 760 $aCurValues = array(); 761 if (isset($aInput['value']) && $aInput['value']) 762 $aCurValues = is_array($aInput['value']) ? $aInput['value'] : array($aInput['value']); 763 return $this->_genInputsSet($aInput, 'checkbox', $aCurValues, '_isSelectedMultiple', '[]'); 764 } 765 /** 766 * Generate Radiobuttons Set Element 767 * 768 * @param array $aInput 769 * @return string 770 */ 771 function genInputRadioSet(&$aInput) { 772 $sCurValue = isset($aInput['value']) ? $aInput['value'] : ''; 773 return $this->_genInputsSet($aInput, 'radio', $sCurValue, '_isSelected'); 774 } 775 776 function _isSelected ($sValue, $sCurValue) { 777 return ((string)$sValue === (string)$sCurValue); 778 } 779 780 function _isSelectedMultiple ($sValue, $aCurValues) { 781 return in_array($sValue, $aCurValues); 782 } 783 784 function _genInputSelect(&$aInput, $isMultiple, $mixedCurrentVal, $sIsSelectedFunc) { 613 785 614 786 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; … … 618 790 619 791 $aAttrs['name'] = $aInput['name']; 792 if ($isMultiple) { 793 $aAttrs['name'] .= '[]'; 794 $aAttrs['multiple'] = 'multiple'; 795 } 620 796 621 797 // for inputs with labels generate id … … 626 802 627 803 // generate options 628 $sCurValue = $aInput['value'];629 804 $sOptions = ''; 630 631 632 805 if (isset($aInput['values']) and is_array($aInput['values'])) { 633 806 foreach ($aInput['values'] as $sValue => $sTitle) { … … 639 812 $sTitleC = bx_process_output($sTitle); 640 813 641 $sSelected = ((string)$sValue === (string)$sCurValue) ? 'selected="selected"' : '';814 $sSelected = $this->$sIsSelectedFunc($sValue, $mixedCurrentVal) ? 'selected="selected"' : ''; 642 815 643 816 $sOptions .= <<<BLAH … … 658 831 } 659 832 660 /** 661 * Generate Select Box Element 662 * 663 * @param array $aInput 664 * @return string 665 */ 666 function genInputSelectBox(&$aInput, $sInfo = '', $sError = '') { 667 668 $aNewInput = $aInput; 669 670 $aNewInput['type'] = 'select'; 671 $aNewInput['name'] .= '[]'; 672 673 $sInput = $this->genInput($aNewInput); 674 return <<<BLAH 675 <div class="bx-form-input-wrapper input-wrapper-{$aInput['type']}"> 676 $sInput 677 </div> 678 $sInfo 679 $sError 680 BLAH; 681 682 } 683 684 /** 685 * Generate Select Box Element 686 * 687 * @param array $aInput 688 * @return string 689 */ 690 function genInputFiles(&$aInput, $sInfo = '', $sError = '') { 691 692 $sUniqId = genRndPwd (8, false); 693 $sUploaders = ''; 694 $oUploader = null; 695 foreach ($aInput['uploaders'] as $sUploaderObject) { 696 bx_import('BxDolUploader'); 697 $oUploader = BxDolUploader::getObjectInstance($sUploaderObject, $aInput['storage_object'], $sUniqId); 698 if (!$oUploader) 699 continue; 700 701 $sGhostTemplate = false; 702 if (isset($aInput['ghost_template']) && is_object($aInput['ghost_template'])) { // form is not submitted and ghost template is BxDolFormNested object 703 704 $oFormNested = $aInput['ghost_template']; 705 if ($oFormNested instanceof BxDolFormNested) 706 $sGhostTemplate = $oFormNested->getCode(); 707 708 } elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && isset($aInput['ghost_template']['inputs'])) { // form is not submitted and ghost template is form array 709 710 bx_import('BxDolFormNested'); 711 $oFormNested = new BxDolFormNested($aInput['name'], $aInput['ghost_template'], $this->aParams['db']['submit_name'], $this->oTemplate); 712 $sGhostTemplate = $oFormNested->getCode(); 713 714 } elseif (isset($aInput['ghost_template']) && is_array($aInput['ghost_template']) && $aInput['ghost_template']) { // form is submitted and ghost template is array of BxDolFormNested objects 715 716 bx_import('BxDolFormNested'); 717 $sGhostTemplate = array (); 718 foreach ($aInput['ghost_template'] as $iFileId => $oFormNested) 719 if (is_object($oFormNested) && $oFormNested instanceof BxDolFormNested) 720 $sGhostTemplate[$iFileId] = $oFormNested->getCode(); 721 722 } elseif (isset($aInput['ghost_template']) && is_string($aInput['ghost_template'])) { // ghost template is just string template, without nested form 723 724 $sGhostTemplate = $aInput['ghost_template']; 725 726 } 727 $aParams = array(); 728 if (isset($aInput['images_transcoder']) && $aInput['images_transcoder']) 729 $aParams = array('images_transcoder' => bx_js_string($aInput['images_transcoder'])); 730 $sUploaders .= $oUploader->getUploaderButton($sGhostTemplate, isset($aInput['multiple']) ? $aInput['multiple'] : true, $aParams); 731 } 732 733 return $this->oTemplate->parseHtmlByName('form_field_uploader.html', array( 734 'uploaders_buttons' => $sUploaders, 735 'info' => $sInfo, 736 'id_container_errors' => $oUploader->getIdContainerErrors(), 737 'id_container_result' => $oUploader->getIdContainerResult(), 738 'uploader_instance_name' => $oUploader->getNameJsInstanceUploader(), 739 'is_init_ghosts' => isset($aInput['init_ghosts']) && !$aInput['init_ghosts'] ? 0 : 1, 740 )); 741 } 742 743 /** 744 * Generate Multiple Select Element 745 * 746 * @param array $aInput 747 * @return string 748 */ 749 function genInputSelectMultiple(&$aInput) { 750 $aAttrs = $aInput['attrs']; 833 function _genInputsSet(&$aInput, $sType, $mixedCurrentVal, $sIsCheckedFunc, $sNameAppend = '') { 834 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 751 835 752 836 // add default className to attributes 753 837 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : ''); 754 838 755 $aAttrs['name'] = $aInput['name'] . '[]'; 756 $aAttrs['multiple'] = 'multiple'; 839 $aAttrs['name'] = $aInput['name']; 757 840 758 841 // for inputs with labels generate id … … 763 846 764 847 // generate options 765 $aCurValues = $aInput['value'] ? (is_array($aInput['value']) ? $aInput['value'] : array($aInput['value'])) : array(); 848 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : $this->_sDivider; 849 766 850 $sOptions = ''; 767 851 768 852 if (isset($aInput['values']) and is_array($aInput['values'])) { 769 foreach ($aInput['values'] as $sValue => $sTitle) { 770 $sValueC = bx_html_attribute($sValue); 771 $sTitleC = bx_process_output($sTitle); 772 773 $sSelected = in_array($sValue, $aCurValues) ? 'selected="selected"' : ''; 774 775 $sOptions .= <<<BLAH 776 <option value="$sValueC" $sSelected>$sTitleC</option> 777 BLAH; 778 779 } 780 } 781 782 // generate element 783 $sCode = <<<BLAH 784 <select $sAttrs> 785 $sOptions 786 </select> 787 BLAH; 788 789 return $sCode; 790 } 791 792 /** 793 * Generate Checkbox Set Element 794 * 795 * @param array $aInput 796 * @return string 797 */ 798 function genInputCheckboxSet(&$aInput) { 799 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 800 801 // add default className to attributes 802 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : ''); 803 804 $aAttrs['name'] = $aInput['name']; 805 806 // for inputs with labels generate id 807 if (isset($aInput['label'])) 808 $aAttrs['id'] = $this->getInputId($aInput); 809 810 $sAttrs = $this->convertArray2Attrs($aAttrs); 811 812 // generate options 813 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : ' '; 814 $aCurValues = $aInput['value'] ? (is_array($aInput['value']) ? $aInput['value'] : array($aInput['value'])) : array(); 815 816 $sOptions = ''; 817 818 if (isset($aInput['values']) and is_array($aInput['values'])) { 819 if (count($aInput['values']) > 3 && $sDivider == ' ') 820 $sDivider = '<br />'; 853 if (count($aInput['values']) > 3 && $sDivider == $this->_sDivider) 854 $sDivider = $this->_sDividerAlt; 821 855 // generate complex input using simple standard inputs 822 856 foreach ($aInput['values'] as $sValue => $sLabel) { 823 857 // create new simple input 824 858 $aNewInput = array( 825 'type' => 'checkbox',826 'name' => $aInput['name'] . '[]',827 'value' => $sValue,828 'checked' => in_array($sValue, $aCurValues),829 'label' => $sLabel,859 'type' => $sType, 860 'name' => $aInput['name'] . $sNameAppend, 861 'value' => $sValue, 862 'checked' => $this->$sIsCheckedFunc($sValue, $mixedCurrentVal), 863 'label' => $sLabel, 830 864 ); 831 865 … … 846 880 return $sCode; 847 881 } 848 /** 849 * Generate Radiobuttons Set Element 850 * 851 * @param array $aInput 852 * @return string 853 */ 854 function genInputRadioSet(&$aInput) { 882 883 function genInputCaptcha(&$aInput) { 884 855 885 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 856 886 … … 858 888 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : ''); 859 889 860 $aAttrs['name'] = $aInput['name'];890 //$aAttrs['name'] = $aInput['name']; 861 891 862 892 // for inputs with labels generate id … … 866 896 $sAttrs = $this->convertArray2Attrs($aAttrs); 867 897 868 // generate options869 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : ' ';870 $sCurValue = $aInput['value'];871 872 $sOptions = '';873 874 if (isset($aInput['values']) and is_array($aInput['values'])) {875 if (count($aInput['values']) > 3 && $sDivider == ' ')876 $sDivider = '<br />';877 // generate complex input using simple standard inputs878 foreach ($aInput['values'] as $sValue => $sLabel) {879 // create new simple input880 $aNewInput = array(881 'type' => 'radio',882 'name' => $aInput['name'],883 'value' => $sValue,884 'checked' => ((string)$sValue === (string)$sCurValue),885 'label' => $sLabel,886 );887 888 $sNewInput = $this->genInput($aNewInput);889 890 // attach new input to complex891 $sOptions .= ($sNewInput . $sDivider);892 }893 }894 895 // generate element896 $sCode = <<<BLAH897 <div $sAttrs>898 $sOptions899 </div>900 BLAH;901 902 return $sCode;903 }904 905 function genInputCaptcha(&$aInput) {906 907 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs'];908 909 // add default className to attributes910 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '');911 912 //$aAttrs['name'] = $aInput['name'];913 914 // for inputs with labels generate id915 if (isset($aInput['label']))916 $aAttrs['id'] = $this->getInputId($aInput);917 918 $sAttrs = $this->convertArray2Attrs($aAttrs);919 920 898 $sSimgUrl = BX_DOL_URL_ROOT . 'simg/simg.php'; 921 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : '<br />';899 $sDivider = isset($aInput['dv']) ? $aInput['dv'] : $this->_sDividerAlt; 922 900 923 901 $aTextInput = array( … … 961 939 * Convert array to attributes string 962 940 * 963 * <code>941 * @code 964 942 * $a = array('name' => 'test', 'value' => 5); 965 943 * $s = $this->convertArray2Attrs($a); 966 944 * echo $s; 967 * </code>945 * @endcode 968 946 * 969 947 * Output: … … 991 969 } 992 970 971 function genToggleElement($aInput) { 972 973 $sJs = ''; 974 if (!self::$_isToggleJsAdded) { 975 $sJs = "\n<script> 976 function bx_form_section_toggle(e) { 977 var eSection = $(e).parent().parent().next(); 978 if ('none' == eSection.css('display')) { 979 $(e).find('u').removeClass('collapsed'); 980 eSection.slideDown(); 981 } else { 982 $(e).find('u').addClass('collapsed'); 983 eSection.slideUp(); 984 } 985 } 986 </script>\n"; 987 self::$_isToggleJsAdded = true; 988 } 989 990 $sClass = ''; 991 if (isset($aInput['collapsed']) and $aInput['collapsed']) 992 $sClass = 'collapsed'; 993 994 return $sJs . '<div class="bx-form-section-toggle"><a class="bx-btn bx-btn-small bx-btn-symbol-small" href="javascript:void(0)" onclick="bx_form_section_toggle(this)"><u class="' . $sClass . '"></u></a></div>'; 995 } 996 993 997 function genInfoIcon($sInfo) { 994 return '<div class="bx-form-info ">' . bx_process_output($sInfo) . '</div>';998 return '<div class="bx-form-info bx-def-font-grayed bx-def-font-small">' . bx_process_output($sInfo) . '</div>'; 995 999 } 996 1000 … … 1009 1013 1010 1014 if ($aAttrs and is_array($aAttrs)) { 1011 $aAttrs['class'] = "bx-form-section bx-def-padding bx-def-color-bg-sec" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '');1015 $aAttrs['class'] = "bx-form-section bx-def-padding-top bx-def-border-top" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : ''); 1012 1016 $sAttrs = $this->convertArray2Attrs($aAttrs); 1013 1017 } else { 1014 $sAttrs = ' class="bx-form-section bx-def-padding bx-def-color-bg-sec" ';1018 $sAttrs = ' class="bx-form-section bx-def-padding-top bx-def-border-top" '; 1015 1019 } 1016 1020 … … 1040 1044 function addCssJs () { 1041 1045 1042 if ( isset($GLOBALS['glBxFormIsCssJsAdded']) && $GLOBALS['glBxFormIsCssJsAdded'])1046 if (self::$_isCssJsAdded) 1043 1047 return; 1044 1048 … … 1074 1078 $this->oTemplate->addCss($aCss); 1075 1079 1076 $GLOBALS['glBxFormIsCssJsAdded']= true;1080 self::$_isCssJsAdded = true; 1077 1081 } 1078 1082 } -
trunk/templates/base/uploader_button_html5.html
r15516 r15546 1 <a href="javascript:void(0);" onclick="__uploader_instance_name__.showUploaderForm();" class="bx-btn bx- def-margin-sec-left"><bx_text:_sys_uploader_html5_button_name /></a>1 <a href="javascript:void(0);" onclick="__uploader_instance_name__.showUploaderForm();" class="bx-btn bx-btn-small bx-def-margin-sec-left"><bx_text:_sys_uploader_html5_button_name /></a> 2 2 <script> 3 3 $(document).ready(function(){ -
trunk/templates/base/uploader_button_simple.html
r15516 r15546 1 <a href="javascript:void(0);" onclick="__uploader_instance_name__.showUploaderForm();" class="bx-btn bx- def-margin-sec-left"><bx_text:_sys_uploader_simple_button_name /></a>1 <a href="javascript:void(0);" onclick="__uploader_instance_name__.showUploaderForm();" class="bx-btn bx-btn-small bx-def-margin-sec-left"><bx_text:_sys_uploader_simple_button_name /></a> 2 2 <script> 3 3 $(document).ready(function(){ -
trunk/templates/base/uploader_nested_form_wrapper.html
r15500 r15546 1 <div id="bx-uploader-file-{file_id}" class="bx-uploader-ghost bx-def-border-bottom bx-def-padding-bottom">1 <div id="bx-uploader-file-{file_id}" class="bx-uploader-ghost"> 2 2 <div class="bx-uploader-ghost-preview bx-def-padding-right bx-def-padding-top"> 3 3 <img src="{file_icon}" class="bx-def-border" /> 4 4 </div> 5 <div class="bx-uploader-ghost-form ">6 <div class="bx-uploader-ghost-form-filename bx-def-padding- left bx-def-padding-topbx-def-font-grayed">{file_name}</div>5 <div class="bx-uploader-ghost-form "> 6 <div class="bx-uploader-ghost-form-filename bx-def-padding-top bx-def-padding-bottom bx-def-font-grayed">{file_name}</div> 7 7 __nested_form__ 8 <div class="bx-uploader-ghost-form-actions bx-def- padding-left"><ahref="javascript:void(0);" onclick="{js_instance_name}.deleteGhost('{file_id}')"><bx_text:_Delete /></a></div>8 <div class="bx-uploader-ghost-form-actions bx-def-margin-top"><a class="bx-btn bx-btn-small" href="javascript:void(0);" onclick="{js_instance_name}.deleteGhost('{file_id}')"><bx_text:_Delete /></a></div> 9 9 </div> 10 10 <div class="bx-clear"></div>
Note: See TracChangeset
for help on using the changeset viewer.