Changeset 15963 for trunk/studio/classes/BxDolStudioUtils.php
- Timestamp:
- 02/08/12 05:13:10 (16 months ago)
- File:
-
- 1 edited
-
trunk/studio/classes/BxDolStudioUtils.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/studio/classes/BxDolStudioUtils.php
r15958 r15963 13 13 define('BX_DOL_STUDIO_MODULE_SYSTEM', 'system'); 14 14 define('BX_DOL_STUDIO_MODULE_CUSTOM', 'custom'); 15 16 define('BX_DOL_STUDIO_VISIBLE_ALL', 'all'); 17 define('BX_DOL_STUDIO_VISIBLE_SELECTED', 'selected'); 15 18 16 19 class BxDolStudioUtils extends BxDol { … … 73 76 } 74 77 78 public static function getVisibilityValue($sVisibleFor, $aVisibleForLevels) { 79 if($sVisibleFor == BX_DOL_STUDIO_VISIBLE_ALL) 80 return PHP_INT_MAX; 81 82 $iVisibleFor = 0; 83 foreach($aVisibleForLevels as $iLevelId) 84 $iVisibleFor += pow(2, (int)$iLevelId - 1); 85 86 return $iVisibleFor; 87 } 88 89 public static function getVisibilityValues($iValue, &$aValuesAll, &$aValuesSelected) { 90 bx_import('BxDolAcl'); 91 $aLevels = BxDolAcl::getInstance()->getMemberships(); 92 foreach($aLevels as $iKey => $sValue) { 93 if(((int)$iValue & pow(2, (int)$iKey - 1)) != 0) 94 $aValuesSelected[] = $iKey; 95 96 $aValuesAll[$iKey] = _t($sValue); 97 } 98 } 99 75 100 public static function addInArray($aInput, $sKey, $aValues) { 76 101 reset($aInput);
Note: See TracChangeset
for help on using the changeset viewer.