$aOldTagsRepeater = array( $aOldTags ); if( $sLogic == 'or' ){ $aOldTagsRepeater = $aOldTags; } $bResult = true; $mResult = array(); foreach( $aOldTagsRepeater as $aOldTags ){ try{ switch( $_POST[ $sDriverName.'_action' ] ){ case 'info': $mTResult = $oTagsManager->getMaterialsByTags( $aOldTags ); break; case 'add_new': if( $TAGS_RIGHT< 'W' ) throw new Exception( GetMessage('TAGSMANAGER_OPERATION_DENIED') ); $mTResult = $oTagsManager->addTags( $aOldTags, $aNewTags ); break; case 'explode': if( $TAGS_RIGHT< 'W' ) throw new Exception( GetMessage('TAGSMANAGER_OPERATION_DENIED') ); $mTResult = $oTagsManager->explodeTags( $aOldTags, $aNewTags ); break; case 'implode': if( $TAGS_RIGHT< 'W' ) throw new Exception( GetMessage('TAGSMANAGER_OPERATION_DENIED') ); $mTResult = $oTagsManager->implodeTags( $aOldTags, $aNewTags ); break; case 'rename': if( $TAGS_RIGHT< 'W' ) throw new Exception( GetMessage('TAGSMANAGER_OPERATION_DENIED') ); $mTResult = $oTagsManager->implodeTags( $aOldTags, $aNewTags );