BxBaseStudioPermissionsLevels.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup DolphinView Dolphin Studio Representation classes
  7. * @ingroup DolphinStudio
  8. * @{
  9. */
  10. bx_import('BxDolStudioPermissionsLevels');
  11. bx_import('BxTemplStudioFormView');
  12. class BxBaseStudioPermissionsLevels extends BxDolStudioPermissionsLevels {
  13. public static $iBinMB = 1048576;
  14. protected $sUrlPage;
  15. function __construct($aOptions, $oTemplate = false) {
  16. parent::__construct($aOptions, $oTemplate);
  17. $this->_aOptions['actions_single']['edit']['attr']['title'] = _t('_adm_prm_btn_level_edit');
  18. $this->_aOptions['actions_single']['delete']['attr']['title'] = _t('_adm_prm_btn_level_delete');
  19. $this->sUrlPage = BX_DOL_URL_STUDIO . 'builder_permissions.php?page=levels';
  20. }
  21. public function performActionAdd() {
  22. $sAction = 'add';
  23. $oForm = $this->_getFormObject($sAction);
  24. $oForm->initChecker();
  25. if($oForm->isSubmittedAndValid()) {
  26. if(($iId = $this->_getAvailableId()) === false) {
  27. $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_id')), true);
  28. return;
  29. }
  30. $mixedIcon = '';
  31. if(!empty($_FILES['Icon_image']['tmp_name'])) {
  32. bx_import('BxDolStorage');
  33. $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
  34. $mixedIcon = $oStorage->storeFileFromForm($_FILES['Icon_image'], false, 0);
  35. if($mixedIcon === false) {
  36. $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()), true);
  37. return;
  38. }
  39. $oStorage->afterUploadCleanup($mixedIcon, 0);
  40. }
  41. if(empty($mixedIcon))
  42. $mixedIcon = $oForm->getCleanValue('Icon');
  43. if(empty($mixedIcon))
  44. $mixedIcon = 'acl-unconfirmed.png';
  45. BxDolForm::setSubmittedValue('Icon', $mixedIcon, $oForm->aFormAttrs['method']);
  46. $fQuotaSize = round($oForm->getCleanValue('QuotaSize'), 1);
  47. BxDolForm::setSubmittedValue('QuotaSize', self::$iBinMB * $fQuotaSize, $oForm->aFormAttrs['method']);
  48. $fQuotaMaxFileSize = round($oForm->getCleanValue('QuotaMaxFileSize'), 1);
  49. BxDolForm::setSubmittedValue('QuotaMaxFileSize', self::$iBinMB * $fQuotaMaxFileSize, $oForm->aFormAttrs['method']);
  50. $iId = (int)$oForm->insert(array('ID' => $iId, 'Icon' => $mixedIcon, 'Order' => $this->oDb->getLevelOrderMax() + 1));
  51. if($iId != 0)
  52. $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
  53. else
  54. $aRes = array('msg' => _t('_adm_prm_err_level_create'));
  55. $this->_echoResultJson($aRes, true);
  56. }
  57. else {
  58. bx_import('BxTemplStudioFunctions');
  59. $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-level-create-popup', _t('_adm_prm_txt_level_create_popup'), $this->_oTemplate->parseHtmlByName('prm_add_level.html', array(
  60. 'form_id' => $oForm->aFormAttrs['id'],
  61. 'form' => $oForm->getCode(true),
  62. 'object' => $this->_sObject,
  63. 'action' => $sAction
  64. )));
  65. $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
  66. }
  67. }
  68. public function performActionEdit() {
  69. $sAction = 'edit';
  70. $aIds = bx_get('ids');
  71. if(!$aIds || !is_array($aIds)) {
  72. $iId = (int)bx_get('id');
  73. if(!$iId) {
  74. $this->_echoResultJson(array());
  75. exit;
  76. }
  77. $aIds = array($iId);
  78. }
  79. $iId = $aIds[0];
  80. $aLevel = array();
  81. $iLevel = $this->oDb->getLevels(array('type' => 'by_id', 'value' => $iId), $aLevel);
  82. if($iLevel != 1 || empty($aLevel)){
  83. $this->_echoResultJson(array());
  84. exit;
  85. }
  86. $oForm = $this->_getFormObject($sAction, $aLevel);
  87. $oForm->initChecker();
  88. if($oForm->isSubmittedAndValid()) {
  89. $bIconImageCur = is_numeric($aLevel['icon']) && (int)$aLevel['icon'] != 0;
  90. $bIconImageNew = !empty($_FILES['Icon_image']['tmp_name']);
  91. $sIconFont = $oForm->getCleanValue('Icon');
  92. $bIconFont = !empty($sIconFont);
  93. if($bIconImageCur && ($bIconImageNew || $bIconFont)) {
  94. bx_import('BxDolStorage');
  95. $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
  96. if(!$oStorage->deleteFile((int)$aLevel['icon'], 0)) {
  97. $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image_remove')), true);
  98. return;
  99. }
  100. }
  101. $sIcon = $sIconFont;
  102. if($bIconImageNew) {
  103. bx_import('BxDolStorage');
  104. $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
  105. $sIcon = $oStorage->storeFileFromForm($_FILES['Icon_image'], false, 0);
  106. if($sIcon === false) {
  107. $this->_echoResultJson(array('msg' => _t('_adm_prm_err_level_icon_image') . $oStorage->getErrorString()), true);
  108. return;
  109. }
  110. $oStorage->afterUploadCleanup($sIcon, 0);
  111. }
  112. else if($bIconImageCur && !$bIconFont)
  113. $sIcon = $aLevel['icon'];
  114. BxDolForm::setSubmittedValue('Icon', $sIcon, $oForm->aFormAttrs['method']);
  115. $fQuotaSize = round($oForm->getCleanValue('QuotaSize'), 1);
  116. BxDolForm::setSubmittedValue('QuotaSize', self::$iBinMB * $fQuotaSize, $oForm->aFormAttrs['method']);
  117. $fQuotaMaxFileSize = round($oForm->getCleanValue('QuotaMaxFileSize'), 1);
  118. BxDolForm::setSubmittedValue('QuotaMaxFileSize', self::$iBinMB * $fQuotaMaxFileSize, $oForm->aFormAttrs['method']);
  119. if($oForm->update($iId) !== false)
  120. $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
  121. else
  122. $aRes = array('msg' => _t('_adm_prm_err_level_edit'));
  123. $this->_echoResultJson($aRes, true);
  124. }
  125. else {
  126. bx_import('BxTemplStudioFunctions');
  127. $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-prm-level-edit-popup', _t('_adm_prm_txt_level_edit_popup', _t($aLevel['name'])), $this->_oTemplate->parseHtmlByName('prm_add_level.html', array(
  128. 'form_id' => $oForm->aFormAttrs['id'],
  129. 'form' => $oForm->getCode(true),
  130. 'object' => $this->_sObject,
  131. 'action' => $sAction
  132. )));
  133. $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
  134. }
  135. }
  136. public function performActionDelete() {
  137. $iAffected = 0;
  138. $aIds = bx_get('ids');
  139. if(!$aIds || !is_array($aIds)) {
  140. $this->_echoResultJson(array());
  141. exit;
  142. }
  143. $aIdsAffected = array ();
  144. foreach($aIds as $iId) {
  145. if(!$this->delete($iId))
  146. continue;
  147. $aIdsAffected[] = $iId;
  148. $iAffected++;
  149. }
  150. $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_prm_err_level_delete')));
  151. }
  152. public function performActionDeleteIcon() {
  153. $sAction = 'delete_icon';
  154. $aIds = bx_get('ids');
  155. if(empty($aIds[0])) {
  156. $this->_echoResultJson(array());
  157. exit;
  158. }
  159. $iId = (int)$aIds[0];
  160. $aLevel = array();
  161. $iLevel = $this->oDb->getLevels(array('type' => 'by_id', 'value' => $iId), $aLevel);
  162. if($iLevel != 1 || empty($aLevel)){
  163. $this->_echoResultJson(array());
  164. exit;
  165. }
  166. if(is_numeric($aLevel['icon']) && (int)$aLevel['icon'] != 0) {
  167. bx_import('BxDolStorage');
  168. if(!BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES)->deleteFile((int)$aLevel['icon'], 0)) {
  169. $this->_echoResultJson(array());
  170. exit;
  171. }
  172. }
  173. if($this->oDb->updateLevels($aLevel['id'], array('icon' => '')) !== false)
  174. $this->_echoResultJson(array('grid' => $this->getCode(false), 'blink' => $iId, 'preview' => $this->_getIconPreview($aLevel['id']), 'eval' => $this->getJsObject() . ".onDeleteIcon(oData)"), true);
  175. }
  176. public function getJsObject() {
  177. return 'oBxDolStudioPermissionsLevels';
  178. }
  179. public function getCode($isDisplayHeader = true) {
  180. return $this->_oTemplate->parseHtmlByName('prm_levels.html', array(
  181. 'content' => parent::getCode($isDisplayHeader),
  182. 'js_object' => $this->getJsObject(),
  183. 'page_url' => $this->sUrlPage,
  184. 'grid_object' => $this->_sObject,
  185. 'params_divider' => $this->sParamsDivider
  186. ));
  187. }
  188. protected function _addJsCss() {
  189. parent::_addJsCss();
  190. $this->_oTemplate->addJs(array('jquery.form.js', 'permissions_levels.js'));
  191. bx_import('BxTemplStudioFormView');
  192. $oForm = new BxTemplStudioFormView(array());
  193. $oForm->addCssJs();
  194. }
  195. protected function _getCellSwitcher ($mixedValue, $sKey, $aField, $aRow) {
  196. bx_import('BxDolAcl');
  197. if(in_array($aRow['ID'], array(MEMBERSHIP_ID_NON_MEMBER, MEMBERSHIP_ID_STANDARD, MEMBERSHIP_ID_UNCONFIRMED, MEMBERSHIP_ID_PENDING, MEMBERSHIP_ID_SUSPENDED)))
  198. return parent::_getCellDefault('', $sKey, $aField, $aRow);;
  199. return parent::_getCellSwitcher($mixedValue, $sKey, $aField, $aRow);
  200. }
  201. protected function _getCellIcon ($mixedValue, $sKey, $aField, $aRow) {
  202. $mixedValue = $this->_oTemplate->getImage($mixedValue, array('class' => 'bx-prm-level-icon bx-def-border'));
  203. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  204. }
  205. protected function _getCellActionsList ($mixedValue, $sKey, $aField, $aRow) {
  206. $aActions = array();
  207. $iActions = $this->oDb->getActions(array('type' => 'by_level_id', 'value' => $aRow['ID']), $aActions);
  208. $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
  209. 'href' => BX_DOL_URL_STUDIO . 'builder_permissions.php?page=actions&level=' . $aRow['ID'],
  210. 'title' => _t('_adm_prm_txt_manage_actions'),
  211. 'bx_repeat:attrs' => array(),
  212. 'content' => _t('_adm_prm_txt_n_actions', $iActions)
  213. ));
  214. return parent::_getCellDefault ($mixedValue, $sKey, $aField, $aRow);
  215. }
  216. protected function _getCellQuotaSize ($mixedValue, $sKey, $aField, $aRow) {
  217. return parent::_getCellDefault ($mixedValue > 0 ? _t_format_size($mixedValue) : '&infin;', $sKey, $aField, $aRow);
  218. }
  219. protected function _getCellQuotaNumber ($mixedValue, $sKey, $aField, $aRow) {
  220. return parent::_getCellDefault ($mixedValue > 0 ? $mixedValue : '&infin;', $sKey, $aField, $aRow);
  221. }
  222. protected function _getCellQuotaMaxFileSize ($mixedValue, $sKey, $aField, $aRow) {
  223. return parent::_getCellDefault ($mixedValue > 0 ? _t_format_size($mixedValue) : '&infin;', $sKey, $aField, $aRow);
  224. }
  225. protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array()) {
  226. if ($sType == 'single' && $aRow['Removable'] != 'yes')
  227. return '';
  228. return parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
  229. }
  230. protected function _getIconPreview($iId, $sIconImage = '', $sIconFont = '') {
  231. $bIconImage = !empty($sIconImage);
  232. $bIconFont = !empty($sIconFont);
  233. return $this->_oTemplate->parseHtmlByName('prm_level_icon_preview.html', array(
  234. 'id' => $iId,
  235. 'bx_if:show_icon_empty' => array(
  236. 'condition' => !$bIconImage && !$bIconFont,
  237. 'content' => array()
  238. ),
  239. 'bx_if:show_icon_image' => array(
  240. 'condition' => $bIconImage,
  241. 'content' => array(
  242. 'js_object' => $this->getJsObject(),
  243. 'url' => $sIconImage,
  244. 'id' => $iId
  245. )
  246. ),
  247. 'bx_if:show_icon_font' => array(
  248. 'condition' => $bIconFont,
  249. 'content' => array(
  250. 'icon' => $sIconFont
  251. )
  252. )
  253. ));
  254. }
  255. protected function _getFormObject($sAction, $aLevel = array())
  256. {
  257. $aForm = array(
  258. 'form_attrs' => array(
  259. 'id' => 'adm-prm-level-create',
  260. 'action' => BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction,
  261. 'method' => BX_DOL_STUDIO_METHOD_DEFAULT,
  262. 'enctype' => 'multipart/form-data',
  263. ),
  264. 'params' => array (
  265. 'db' => array(
  266. 'table' => 'sys_acl_levels',
  267. 'key' => 'ID',
  268. 'uri' => '',
  269. 'uri_title' => '',
  270. 'submit_name' => 'do_submit'
  271. ),
  272. ),
  273. 'inputs' => array (
  274. 'id' => array(
  275. 'type' => 'hidden',
  276. 'name' => 'id',
  277. 'value' => isset($aLevel['id']) ? (int)$aLevel['id'] : 0,
  278. 'db' => array (
  279. 'pass' => 'Int',
  280. ),
  281. ),
  282. 'Active' => array(
  283. 'type' => 'hidden',
  284. 'name' => 'Active',
  285. 'value' => 'yes',
  286. 'db' => array (
  287. 'pass' => 'Xss',
  288. ),
  289. ),
  290. 'Purchasable' => array(
  291. 'type' => 'hidden',
  292. 'name' => 'Purchasable',
  293. 'value' => 'no',
  294. 'db' => array (
  295. 'pass' => 'Xss',
  296. ),
  297. ),
  298. 'Removable' => array(
  299. 'type' => 'hidden',
  300. 'name' => 'Removable',
  301. 'value' => 'yes',
  302. 'db' => array (
  303. 'pass' => 'Xss',
  304. ),
  305. ),
  306. 'Name' => array(
  307. 'type' => 'text_translatable',
  308. 'name' => 'Name',
  309. 'caption' => _t('_adm_prm_txt_level_name'),
  310. 'info' => _t('_adm_prm_dsc_level_name'),
  311. 'value' => '_adm_prm_txt_level',
  312. 'required' => '1',
  313. 'db' => array (
  314. 'pass' => 'Xss',
  315. ),
  316. 'checker' => array (
  317. 'func' => 'LengthTranslatable',
  318. 'params' => array(3, 100, 'Name'),
  319. 'error' => _t('_adm_prm_err_level_name'),
  320. ),
  321. ),
  322. 'Description' => array(
  323. 'type' => 'textarea_translatable',
  324. 'name' => 'Description',
  325. 'caption' => _t('_adm_prm_txt_level_description'),
  326. 'info' => _t('_adm_prm_dsc_level_description'),
  327. 'value' => isset($aLevel['description']) ? $aLevel['description'] : '_adm_prm_txt_level',
  328. 'db' => array (
  329. 'pass' => 'XssHtml',
  330. )
  331. ),
  332. 'QuotaSize' => array(
  333. 'type' => 'text',
  334. 'name' => 'QuotaSize',
  335. 'caption' => _t('_adm_prm_txt_level_quota_size'),
  336. 'info' => _t('_adm_prm_dsc_level_quota_size'),
  337. 'value' => isset($aLevel['quota_size']) ? round($aLevel['quota_size'] / self::$iBinMB, 1) : '0',
  338. 'required' => '1',
  339. 'db' => array (
  340. 'pass' => 'Float',
  341. ),
  342. 'checker' => array (
  343. 'func' => 'preg',
  344. 'params' => array('/^[0-9\.]+$/'),
  345. 'error' => _t('_adm_prm_err_level_quota_size'),
  346. ),
  347. ),
  348. 'QuotaMaxFileSize' => array(
  349. 'type' => 'text',
  350. 'name' => 'QuotaMaxFileSize',
  351. 'caption' => _t('_adm_prm_txt_level_quota_max_file_size'),
  352. 'info' => _t('_adm_prm_dsc_level_quota_max_file_size'),
  353. 'value' => isset($aLevel['quota_max_file_size']) ? round($aLevel['quota_max_file_size'] / self::$iBinMB, 1) : '',
  354. 'required' => '1',
  355. 'db' => array (
  356. 'pass' => 'Float',
  357. ),
  358. 'checker' => array (
  359. 'func' => 'preg',
  360. 'params' => array('/^[0-9\.]+$/'),
  361. 'error' => _t('_adm_prm_err_level_quota_max_file_size'),
  362. ),
  363. ),
  364. 'QuotaNumber' => array(
  365. 'type' => 'text',
  366. 'name' => 'QuotaNumber',
  367. 'caption' => _t('_adm_prm_txt_level_quota_number'),
  368. 'info' => _t('_adm_prm_dsc_level_quota_number'),
  369. 'value' => isset($aLevel['quota_number']) ? (int)$aLevel['quota_number'] : '0',
  370. 'required' => '1',
  371. 'db' => array (
  372. 'pass' => 'Int',
  373. ),
  374. 'checker' => array (
  375. 'func' => 'preg',
  376. 'params' => array('/^[0-9]+$/'),
  377. 'error' => _t('_adm_prm_err_level_quota_number'),
  378. ),
  379. ),
  380. 'Icon' => array(
  381. 'type' => 'text',
  382. 'name' => 'Icon',
  383. 'caption' => _t('_adm_prm_txt_level_icon'),
  384. 'info' => _t('_adm_prm_dsc_level_icon'),
  385. 'value' => '',
  386. 'required' => '0',
  387. 'db' => array (
  388. 'pass' => 'Xss',
  389. ),
  390. 'checker' => array (
  391. 'func' => '',
  392. 'params' => array(),
  393. 'error' => _t('_adm_prm_err_level_icon'),
  394. ),
  395. ),
  396. 'Icon_image' => array(
  397. 'type' => 'file',
  398. 'name' => 'Icon_image',
  399. 'caption' => _t('_adm_prm_txt_level_icon_image'),
  400. 'info' => _t('_adm_prm_dsc_level_icon_image'),
  401. 'value' => '',
  402. 'checker' => array (
  403. 'func' => '',
  404. 'params' => '',
  405. 'error' => _t('_adm_prm_err_level_icon_image'),
  406. ),
  407. ),
  408. 'Icon_preview' => array(
  409. 'type' => 'custom',
  410. 'name' => 'Icon_preview',
  411. 'caption' => _t('_adm_prm_txt_level_icon_image_old'),
  412. 'content' => ''
  413. ),
  414. 'controls' => array(
  415. 'name' => 'controls',
  416. 'type' => 'input_set',
  417. array(
  418. 'type' => 'submit',
  419. 'name' => 'do_submit',
  420. 'value' => _t('_adm_prm_btn_level_add'),
  421. ),
  422. array (
  423. 'type' => 'reset',
  424. 'name' => 'close',
  425. 'value' => _t('_adm_prm_btn_level_cancel'),
  426. 'attrs' => array(
  427. 'onclick' => "$('.bx-popup-applied:visible').dolPopupHide()",
  428. 'class' => 'bx-def-margin-sec-left',
  429. ),
  430. )
  431. )
  432. )
  433. );
  434. switch($sAction) {
  435. case 'add':
  436. unset($aForm['inputs']['id']);
  437. unset($aForm['inputs']['Icon_preview']);
  438. $aForm['form_attrs']['id'] .= 'create';
  439. break;
  440. case 'edit':
  441. unset($aForm['inputs']['Active']);
  442. unset($aForm['inputs']['Purchasable']);
  443. unset($aForm['inputs']['Removable']);
  444. unset($aForm['inputs']['Name']);
  445. $aForm['form_attrs']['id'] .= 'edit';
  446. $aForm['inputs']['Icon_image']['caption'] = _t('_adm_prm_txt_level_icon_image_new');
  447. $aForm['inputs']['controls'][0]['value'] = _t('_adm_prm_btn_level_save');
  448. $sIconImage = $sIconFont = "";
  449. if(!empty($aLevel['icon'])) {
  450. if(is_numeric($aLevel['icon']) && (int)$aLevel['icon'] != 0) {
  451. bx_import('BxDolStorage');
  452. $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
  453. $sIconImage = $oStorage->getFileUrlById((int)$aLevel['icon']);
  454. }
  455. else {
  456. $sIconFont = $aLevel['icon'];
  457. $aForm['inputs']['Icon']['value'] = $sIconFont;
  458. }
  459. }
  460. $aForm['inputs']['Icon_preview']['content'] = $this->_getIconPreview($aLevel['id'], $sIconImage, $sIconFont);
  461. break;
  462. }
  463. return new BxTemplStudioFormView($aForm);
  464. }
  465. protected function _getAvailableId() {
  466. $aLevels = array();
  467. $this->oDb->getLevels(array('type' =>'all_order_id'), $aLevels, false);
  468. $iId = 1;
  469. foreach($aLevels as $aLevel) {
  470. if($iId != (int)$aLevel['id'])
  471. break;
  472. $iId++;
  473. }
  474. return $iId <= BX_DOL_STUDIO_PERMISSIONS_LEVEL_ID_INT_MAX ? $iId : false;
  475. }
  476. }
  477. /** @} */