- Timestamp:
- 01/22/12 23:18:49 (4 months ago)
- Location:
- trunk/inc/classes
- Files:
-
- 2 edited
-
BxDolForm.php (modified) (2 diffs)
-
BxDolFormQuery.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolForm.php
r15835 r15905 154 154 * - display_name - name of the Form Display from sys_form_displays table. 155 155 * - input_name - name of the Form Field from sys_form_inputs table. 156 * - hidden_for_levels - bit field with set of member level ids. To use member level id in bit field the level id minus 1 is used as power of 2, for example:156 * - visible_for_levels - bit field with set of member level ids. To use member level id in bit field the level id minus 1 is used as power of 2, for example: 157 157 * - user level id = 1 -> 2^(1-1) = 1 158 158 * - user level id = 2 -> 2^(2-1) = 2 … … 962 962 return $isValid; 963 963 } 964 965 /** 966 * Check if form field is visible. 967 * @param $aInput form field array 968 * @return boolean 969 */ 970 protected function _isVisible ($aInput) { 971 bx_import('BxDolAcl'); 972 echo $aInput['name'] . ' - ' . BxDolAcl::getInstance()->isMemberLevelInSet($aInput['visible_for_levels']) . '<br />'; 973 return BxDolAcl::getInstance()->isMemberLevelInSet($aInput['visible_for_levels']); 974 } 964 975 } 965 976 -
trunk/inc/classes/BxDolFormQuery.php
r15798 r15905 70 70 71 71 // form inputs 72 $sQuery = $oDb->prepare("SELECT `i`.* FROM `sys_form_inputs` AS `i` INNER JOIN `sys_form_display_inputs` AS `d` ON (`d`.`input_name` = `i`.`name`) WHERE `d`.`active` = 1 AND `d`.`display_name` = ? ORDER BY `d`.`order` ASC", $aDisplay['display_name']);72 $sQuery = $oDb->prepare("SELECT `i`.*, `d`.`visible_for_levels` FROM `sys_form_inputs` AS `i` INNER JOIN `sys_form_display_inputs` AS `d` ON (`d`.`input_name` = `i`.`name`) WHERE `d`.`active` = 1 AND `d`.`display_name` = ? ORDER BY `d`.`order` ASC", $aDisplay['display_name']); 73 73 $aInputs = $oDb->getAllWithKey($sQuery, 'name'); 74 74 $aForm['inputs'] = array(); … … 78 78 // main attributes 79 79 $aInput = array ( 80 'type' => $a['type'], 80 'type' => $a['type'], 81 81 'name' => $a['name'], 82 82 'caption' => _t($a['caption']), … … 88 88 'tr_attrs' => $a['attrs_tr'] ? unserialize($a['attrs_tr']) : false, 89 89 'attrs_wrapper' => $a['attrs_wrapper'] ? unserialize($a['attrs_wrapper']) : false, 90 'visible_for_levels' => $a['visible_for_levels'], 90 91 ); 91 92
Note: See TracChangeset
for help on using the changeset viewer.