Changeset 15674 for trunk/templates
- Timestamp:
- 11/14/11 20:25:08 (6 months ago)
- Location:
- trunk/templates
- Files:
-
- 4 added
- 2 edited
-
base/css/default.css (modified) (1 diff)
-
base/css/grid.css (added)
-
base/grid.html (added)
-
base/scripts/BxBaseFormView.php (modified) (19 diffs)
-
base/scripts/BxBaseGrid.php (added)
-
tmpl_uni/scripts/BxTemplGrid.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/templates/base/css/default.css
r15545 r15674 101 101 102 102 .bx-def-color-bg-sec { 103 background :#f2f2f2;103 background-color:#f2f2f2; 104 104 } 105 105 -
trunk/templates/base/scripts/BxBaseFormView.php
r15633 r15674 109 109 BLAH; 110 110 } else { 111 // add default className to attributes 112 $this->aFormAttrs['class'] = 'bx-form-advanced' . (isset($this->aFormAttrs['class']) ? (' ' . $this->aFormAttrs['class']) : ''); 113 114 $sFormAttrs = $this->convertArray2Attrs($this->aFormAttrs); 111 $sFormAttrs = bx_convert_array2attrs($this->aFormAttrs, 'bx-form-advanced'); 115 112 116 113 $sForm = <<<BLAH … … 227 224 $sErrorIcon = $this->genErrorIcon(empty($aInput['error']) ? '' : $aInput['error']); 228 225 229 $aInput['tr_attrs']['class'] = "bx-form-element-wrapper bx-def-margin-top" . (isset($aInput['tr_attrs']['class']) ? ' ' . $aInput['tr_attrs']['class'] : '');230 226 if (isset($aInput['name'])) 231 227 $aInput['tr_attrs']['id'] = "bx-form-element-" . $aInput['name']; 232 $sTrAttrs = $this->convertArray2Attrs($aInput['tr_attrs']);228 $sTrAttrs = bx_convert_array2attrs(isset($aInput['tr_attrs']) && is_array($aInput['tr_attrs']) ? $aInput['tr_attrs'] : array(), "bx-form-element-wrapper bx-def-margin-top"); 233 229 234 230 if ($aInput['type'] == 'captcha') { … … 281 277 282 278 function genWrapperInput($aInput, $sContent) { 283 $sAttr = isset($aInput['attrs_wrapper']) && is_array($aInput['attrs_wrapper']) ? $this->convertArray2Attrs($aInput['attrs_wrapper']) : '';279 $sAttr = isset($aInput['attrs_wrapper']) && is_array($aInput['attrs_wrapper']) ? bx_convert_array2attrs($aInput['attrs_wrapper']) : ''; 284 280 285 281 $sCode = <<<BLAH … … 310 306 $sInput = $this->$sCustomMethod($aInput, $sInfoIcon, $sErrorIcon); 311 307 312 $aInput['tr_attrs']['class'] = "bx-form-element-wrapper bx-def-margin-top" . (isset($aInput['tr_attrs']['class']) ? ' ' . $aInput['tr_attrs']['class'] : '');313 308 if (isset($aInput['name'])) 314 309 $aInput['tr_attrs']['id'] = "bx-form-element-" . $aInput['name']; 315 $sTrAttrs = $this->convertArray2Attrs(empty($aInput['tr_attrs']) ? array() : $aInput['tr_attrs']);310 $sTrAttrs = bx_convert_array2attrs(empty($aInput['tr_attrs']) ? array() : $aInput['tr_attrs'], "bx-form-element-wrapper bx-def-margin-top"); 316 311 317 312 $sCaptionCode = ''; … … 346 341 if (empty($aInput['caption'])) { 347 342 $sCode = $this->getCloseSection(); 348 $aAttrs['class'] = "bx-form-section-divider bx-def-margin-top " . (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : ''); 349 $sAttrs = $this->convertArray2Attrs($aAttrs); 343 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-section-divider bx-def-margin-top"); 350 344 $sCode .= "<div $sAttrs></div>"; 351 345 $sCode .= $this->getOpenSection(false); … … 365 359 $sClassAdd = ''; 366 360 $aNextTbodyAdd = false; 367 } 368 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" . 370 (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : '') . 371 (isset($sClassAdd) ? ' ' . $sClassAdd : ''); 372 373 $sAttrs = $this->convertArray2Attrs($aAttrs); 361 } 362 363 $sAttrs = bx_convert_array2attrs($aAttrs, "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" . (empty($sClassAdd) ? '' : ' ' . $sClassAdd)); 374 364 375 365 $sCode = ''; … … 537 527 538 528 // add default className to attributes 539 $aAttrs['class'] = "bx-def-font-inputs bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : '');540 529 $aAttrs['type'] = $aInput['type']; 541 530 if (isset($aInput['name'])) $aAttrs['name'] = $aInput['name']; … … 550 539 $aAttrs['checked'] = 'checked'; 551 540 552 $sAttrs = $this->convertArray2Attrs($aAttrs);541 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-def-font-inputs bx-form-input-{$aInput['type']}"); 553 542 554 543 return "<input $sAttrs />\n"; … … 567 556 568 557 // add default className to attributes 569 $aAttrs['class'] = "bx-def-font-inputs bx-form-input-{$aInput['type']} bx-btn" . ('submit' == $aInput['type'] ? ' bx-btn-primary' : '') . (isset($aAttrs['class']) ? ' ' . $aAttrs['class'] : '');570 558 $aAttrs['type'] = $aInput['type']; 571 559 if (isset($aInput['value'])) … … 574 562 if (isset($aInput['name'])) $aAttrs['name'] = $aInput['name']; 575 563 576 $sAttrs = $this->convertArray2Attrs($aAttrs);564 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-def-font-inputs bx-form-input-{$aInput['type']} bx-btn" . ('submit' == $aInput['type'] ? ' bx-btn-primary' : '')); 577 565 578 566 return "<button $sAttrs>" . $aInput['value'] . "</button>\n"; … … 589 577 // clone attributes for system use ;) 590 578 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 591 592 // add default className to attributes593 $aAttrs['class'] =594 "bx-form-input-{$aInput['type']}" .595 (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '') .596 ((isset($aInput['html']) and $aInput['html'] and $this->addHtmlEditor($aInput['html'], $aInput)) ? ' bx-form-input-html' : '');597 579 598 580 $aAttrs['name'] = $aInput['name']; … … 602 584 $aAttrs['id'] = $this->getInputId($aInput); 603 585 604 $sAttrs = $this->convertArray2Attrs($aAttrs);586 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-input-{$aInput['type']}" . ((isset($aInput['html']) and $aInput['html'] and $this->addHtmlEditor($aInput['html'], $aInput)) ? ' bx-form-input-html' : '')); 605 587 606 588 $sValue = isset($aInput['value']) ? bx_process_output($aInput['value']) : ''; … … 789 771 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 790 772 791 // add default className to attributes792 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '');793 794 773 $aAttrs['name'] = $aInput['name']; 795 774 if ($isMultiple) { … … 802 781 $aAttrs['id'] = $this->getInputId($aInput); 803 782 804 $sAttrs = $this->convertArray2Attrs($aAttrs);783 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-input-{$aInput['type']}"); 805 784 806 785 // generate options … … 837 816 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 838 817 839 // add default className to attributes840 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '');841 842 818 $aAttrs['name'] = $aInput['name']; 843 819 … … 846 822 $aAttrs['id'] = $this->getInputId($aInput); 847 823 848 $sAttrs = $this->convertArray2Attrs($aAttrs);824 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-input-{$aInput['type']}"); 849 825 850 826 // generate options … … 888 864 $aAttrs = empty($aInput['attrs']) ? array() : $aInput['attrs']; 889 865 890 // add default className to attributes891 $aAttrs['class'] = "bx-form-input-{$aInput['type']}" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : '');892 893 //$aAttrs['name'] = $aInput['name'];894 895 866 // for inputs with labels generate id 896 867 if (isset($aInput['label'])) 897 868 $aAttrs['id'] = $this->getInputId($aInput); 898 869 899 $sAttrs = $this->convertArray2Attrs($aAttrs);870 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-input-{$aInput['type']}"); 900 871 901 872 $sSimgUrl = BX_DOL_URL_ROOT . 'simg/simg.php'; … … 939 910 } 940 911 941 /**942 * Convert array to attributes string943 *944 * @code945 * $a = array('name' => 'test', 'value' => 5);946 * $s = $this->convertArray2Attrs($a);947 * echo $s;948 * @endcode949 *950 * Output:951 * name="test" value="5"952 *953 * @param array $a954 * @return string955 */956 function convertArray2Attrs($a) {957 $sRet = '';958 959 if (is_array($a)) {960 foreach ($a as $sKey => $sValue) {961 962 if (!isset($sValue) || is_null($sValue)) // pass NULL values963 continue;964 965 $sValueC = bx_html_attribute($sValue);966 967 $sRet .= " $sKey=\"$sValueC\"";968 }969 }970 971 return $sRet;972 }973 912 974 913 function genToggleElement($aInput) { … … 1011 950 } 1012 951 1013 function getOpenSection($aAttrs = false) {952 function getOpenSection($aAttrs = array()) { 1014 953 1015 954 if (!$this->_isSectionOpened) { 1016 955 1017 if ($aAttrs and is_array($aAttrs)) { 1018 $aAttrs['class'] = "bx-form-section bx-def-padding-top bx-def-border-top" . (isset($aAttrs['class']) ? (' ' . $aAttrs['class']) : ''); 1019 $sAttrs = $this->convertArray2Attrs($aAttrs); 1020 } else { 1021 $sAttrs = ' class="bx-form-section bx-def-padding-top bx-def-border-top" '; 1022 } 956 if (!$aAttrs || !is_array($aAttrs)) 957 $aAttrs = array(); 958 $sAttrs = bx_convert_array2attrs($aAttrs, "bx-form-section bx-def-padding-top bx-def-border-top"); 1023 959 1024 960 $this->_isSectionOpened = true;
Note: See TracChangeset
for help on using the changeset viewer.