storeConfig( "home_quota", $_REQUEST["homeSample"], QUOTA_PKG_NAME ); // $gBitSmarty->assign( 'home_quota', $_REQUEST["homeSample"] ); //} use Bitweaver\Quota\LibertyQuota; if( !empty( $_REQUEST['cancelquota'] ) ) { unset( $_REQUEST['quota_id'] ); } $gQuota = new LibertyQuota( !empty( $_REQUEST['quota_id'] ) ? $_REQUEST['quota_id'] : NULL ); if( !empty( $_REQUEST['savequota'] ) ) { if( $gQuota->store( $_REQUEST ) ) { header( 'Location: '.KERNEL_PKG_URL.'admin/index.php?page=quota' ); die; } $saveError = TRUE; $gBitSmarty->assign( 'errors', $gQuota->mErrors ); } elseif( !empty( $_REQUEST['assignquota'] ) ) { foreach( array_keys( $_REQUEST ) as $key ) { if( preg_match( '/^quota_group_([-0-9]*)/', $key, $match ) ) { $groupId = $match[1]; $gQuota->assignQuotaToGroup( $_REQUEST[$key], $groupId ); //vd( $match ); } } } $gQuota->load(); if( $gQuota->isValid() || isset( $_REQUEST['newquota'] ) || !empty( $saveError ) ) { $gBitSmarty->assign('gQuota', $gQuota); } else { $quotas = $gQuota->getList(); $systemGroups = $gQuota->getQuotaGroups(); $gBitSmarty->assign('systemGroups', $systemGroups ); foreach( array_keys( $systemGroups ) as $groupId ) { $groupQuota[$groupId] = $gQuota->getQuotaMenu( 'quota_group_'.$groupId, $systemGroups[$groupId]['quota_id'] ); } $gBitSmarty->assign('groupQuota', $groupQuota ); $gBitSmarty->assign('quotaList', $quotas); }