Rev 6827 | Rev 7003 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!-- #INCLUDE FILE="..\common\adovbs.inc" --><%'============================================================='//'// Action Button Control'//'=============================================================%><%'--------------- Global Constants ----------------Const enumABTNCTRL_ON_READONLY_HIDE = 1Const enumABTNCTRL_ON_READONLY_DISABLE = 2'-------------------------------------------------Class ActionButtonControlPrivate mArrAbtnDef()Private mobjNameDefMap ' Item can be accesed by name. Must be unique within one pagePrivate mobjIdDefMap ' Item can be accesed by id. Must be unique within one page. If NULL, ubound is assigned to itPrivate mobjSeparator ' Has a name of item after separator is appliedPrivate mobjACActionsMap ' Map of buttons to actions from access controlPrivate mnButtonSpacerPrivate mnImageHspacePrivate mNumOfPropertiesPrivate mLastPropertyInxPrivate mbDisableAllPrivate mbIsReadonlyPrivate mbIsClosedPrivate mReadonlyActionBehaviourPrivate InxIDPrivate InxNamePrivate InxTxtPrivate InxLinkPrivate InxEventHandlerPrivate InxImgPrivate InxImgOffPrivate InxHintPrivate InxVisiblePrivate InxActivePrivate InxIsReadonlyActionPrivate InxHideOnClosedPublic Property Let AllActive ( cActive )If cActive = enumDB_NO ThenmbDisableAll = TRUEElsembDisableAll = FALSEEnd IfEnd PropertyPublic Property Let ButtonSpacer ( nWidth )mnButtonSpacer = nWidthEnd PropertyPublic Property Let ImageHspace ( nWidth )mnImageHspace = nWidthEnd PropertyPublic Property Let IsReadonlyAction ( IsReadonly )If IsReadonly = enumDB_YES ThenmbIsReadonly = TRUEElseIf IsReadonly = enumDB_NO ThenmbIsReadonly = FALSEElsembIsReadonly = IsReadonlyEnd IfEnd PropertyPublic Property Let setClosed ( isClosed )mbIsClosed = isClosedEnd PropertyPublic Property Let ReadonlyActionBehaviour ( nEnum )mReadonlyActionBehaviour = nEnumEnd Property'-----------------------------------------------------------------------------------------------------------------Public Sub SetRelationship ( sButtonName, sActionName )Call mobjACActionsMap.Add ( sButtonName, sActionName )End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub SetItemPropertyByIndex ( nInx, nProperty, Value )If nInx = "" Then Exit Sub ' Exit sub if you don't find defined buttonIf nProperty = "" OR Value = "" Then Err.Raise 8, "Method SetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty &", Value="& ValuemArrAbtnDef ( nProperty, nInx ) = Value'Response.write "mArrAbtnDef ( "& nProperty &", "& nInx &" ) = "& Value &"<br>"End Sub'-----------------------------------------------------------------------------------------------------------------Private Function GetItemPropertyByIndex ( nInx, nProperty )GetItemPropertyByIndex = ""If nInx = "" Then Exit Function ' Exit sub if you don't find defined buttonIf nProperty = "" Then Err.Raise 8, "Method GetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nPropertyGetItemPropertyByIndex = Cstr(mArrAbtnDef ( nProperty, nInx ))End Function'-----------------------------------------------------------------------------------------------------------------Private Function LastItemInx ()LastItemInx = UBound ( mArrAbtnDef, 2 )End Function'-----------------------------------------------------------------------------------------------------------------Public Sub AddActionButton ( sItemName, nItemID )Dim newArrayDimIf InStr( sItemName, " " ) > 0 Then Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' cannot have spaces."If NOT mobjNameDefMap.Exists (CStr( sItemName )) ThennewArrayDim = LastItemInx() + 1ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )' Store nameCall SetItemPropertyByIndex ( newArrayDim, InxName, sItemName )mobjNameDefMap.Add Cstr( sItemName ), CStr( newArrayDim )If Not IsNull(nItemID) Then' Store IDCall SetItemPropertyByIndex ( newArrayDim, InxdbID, nItemID )mobjIdDefMap.Add Cstr( nItemID ), CStr( newArrayDim )End If' Set DefaultsCall SetItemDefaults ( sItemName )ElseErr.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' has been already defined."End IfEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Render ( aAbtnList, ByRef oAccessControl )Dim itemInx, itemName, nLastItemInx, btnImage, ButtonStr, ButtonStrDisabled, bIsVisibleAC, bIsActiveACResponse.write "<table cellpadding='0' cellspacing='0' width='1' ><tr>"For Each itemName in aAbtnListitemInx = mobjNameDefMap.Item (Cstr(itemName))'-- Define ImagebtnImage = "<img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle' border='0'>"If (mArrAbtnDef( InxImg, itemInx ) <> "") ThenbtnImage = "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='"& mnImageHspace &"' border='0' align='absmiddle'>"End If'-- Define Button'-- Two forms'-- Starts with "vixConfirm - Generate confirmation dialog with url'-- Else 'eval' and use in raw formDim uhref,ueventuhref = Eval( mArrAbtnDef( InxLink, itemInx ) )uevent = Eval( mArrAbtnDef( InxEventHandler, itemInx ) )If InStr( uevent, "vixConfirm" ) = 1 Thenuevent = Replace(uevent, "HREF", uhref )uevent = "onclick=""" & uevent & """"uhref = "javascript:;"End IfDim hint: hint = mArrAbtnDef( InxHint, itemInx )If uhref = "javascript:;" ThenButtonStr = _"<td nowrap>"&_"<span id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_" "& uevent &" class='menu_link' title='"& hint &"'>" &_btnImage & mArrAbtnDef( InxTxt, itemInx ) &"<span>"&_"</td>"ElseButtonStr = _"<td nowrap>"&_"<a id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_" name='"& mArrAbtnDef( InxName, itemInx ) &"' href='"& uhref &"' "&_" "& uevent &" class='menu_link' title='"& hint &"'>"&_btnImage & mArrAbtnDef( InxTxt, itemInx ) &"</a>"&_"</td>"End If'-- Define Disabled Button' A Null value of '' will use InxImg with the lessOpacity Classhint = hint & " [Disabled]"If IsNull(mArrAbtnDef( InxImgOff, itemInx )) ThenButtonStrDisabled = _"<td nowrap>"&_"<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='2' border='0' align='absmiddle' class='lessOpacity' title='"&hint&"'>"&_"<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_"</td>"ElseButtonStrDisabled = _"<td nowrap>"&_"<img src='"& mArrAbtnDef( InxImgOff, itemInx ) &"' hspace='2' border='0' align='absmiddle' title='"&hint&"'>"&_"<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_"</td>"End If'-- Get Access Control permissions --bIsVisibleAC = TRUEbIsActiveAC = TRUEIf NOT IsNull( oAccessControl ) Then' Access control object is suppliedIf mobjACActionsMap.Exists ( itemName ) Then' Relationship suppliedbIsVisibleAC = oAccessControl.IsVisible ( mobjACActionsMap.Item( itemName ) )bIsActiveAC = oAccessControl.IsActive ( mobjACActionsMap.Item( itemName ) )'Response.write "<br>" & itemName &":"& bIsVisibleAC &"-"& bIsActiveACEnd IfEnd If' Hide Buttons on closed (Release is closed, or archived)If mbIsClosed AND (mArrAbtnDef( InxHideOnClosed, itemInx ) = enumDB_YES) ThenbIsVisibleAC = FALSEEnd If' Debug'Response.write "<br>Render["&itemInx &"](V:"&itemName &","&_' mArrAbtnDef( InxVisible, itemInx )&":" &bIsVisibleAC & ",A:"&_' mArrAbtnDef( InxActive, itemInx ) &":" &bIsActiveAC & ")"' Button' is visible AND to be shown' OR isa width specification' OR isa height specification'If ( ( mArrAbtnDef( InxVisible, itemInx ) = enumDB_YES) AND bIsVisibleAC ) _OR (InStr( itemName, "width=" ) > 0) _OR (InStr( itemName, "height=" ) > 0) Then' --- Display if Visible ---'AND (NOT bIsActiveAC)'( mbDisableAll OR ( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) ) AND ( itemInx <> "" )'Response.write itemName &":"& mbDisableAll &"-"& Eval( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) &"-"& Eval( NOT bIsActiveAC ) &"-"& itemInx &"<br>"If ( itemInx <> "" ) AND _( mbDisableAll OR _( ( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) OR (NOT bIsActiveAC) ) _) _Then'Response.Write "<br>"&itemName&" is disabled," & itemInx & "," & mbDisableAll & "," & mArrAbtnDef( InxActive, itemInx ) & "," & mArrAbtnDef( InxVisible, itemInx )' --- Display DISABLED Button Item ---Response.write ButtonStrDisabledIf mnButtonSpacer > 0 ThenResponse.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"End IfElse' --- Display Action Button Item ---If ( NOT mbIsReadonly ) OR _( mbIsReadonly AND mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_YES ) ThenIf InStr( itemName, "width=" ) > 0 ThenResponse.write "<td><img src='images/spacer.gif' "& itemName &" height='1' align='absmiddle'></td>"ElseIf InStr( itemName, "height=" ) > 0 ThenResponse.write "<td><img src='images/bg_bage_2.gif' width='1' "& itemName &" align='absmiddle' hspace='4'></td>"Else'/* It is a button, i.e. Display Button */' Check if button is loaded from DatabaseIf itemInx = "" Then Err.Raise 8, "Method Render", "Definition for item name '"& itemName &"' not found."Response.write ButtonStr'Response.Write "<br>"&itemName&" is enabled"If mnButtonSpacer > 0 ThenResponse.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"End IfEnd IfElseIf ( mbIsReadonly AND mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_NO ) ThenIf mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE ThenResponse.write ButtonStrDisabledEnd IfEnd IfEnd IfEnd If' --- Separators added manually using method AddSeparator or AddSeparatorAfter ---If mobjSeparator.Exists ( Cstr(mArrAbtnDef( InxName, itemInx )) ) ThenResponse.write "<td><img src='images/spacer.gif' width='"& mobjSeparator.Item ( Cstr(mArrAbtnDef( InxName, itemInx )) ) &"' height='1'></td>"End IfNextResponse.write "</tr></table>"End Sub'-----------------------------------------------------------------------------------------------------------------' Return true if required_abtnName is one of the strings in the aAbtnList string array, else return falsePrivate Function isAbtnRequired (aAbtnList, required_abtnName)Dim this_abtnNameisAbtnRequired = FALSEFor Each this_abtnName in aAbtnListIf 0 = StrComp(this_abtnName, required_abtnName) ThenisAbtnRequired = TRUEExit FunctionEnd IfNextEnd Function'-----------------------------------------------------------------------------------------------------------------Public Sub LoadActionButtons ( aAbtnList, ByRef objOraDatabase )' The following code is now used in place of the earlier code to acquire action button records.'' This code exploits the fact that in ADO 2.8 onwards, you can create ADO DB record sets' without a connection to an actual database. So, to rid ourselves of the need for a DEF_ACTION_BUTTONS' table in the database, we can simply take all of the table's rows and reproduce them here in row' creation and field assignment statements. The rest of the website code will be ignorant of the fact' that the data has not come from the actual database.'' Complicating factors:' 1) Some action button fields (action_link and event_handler) are to be EVAL'ed later on when used' to render the HTML page. This can lead to some very complex looking strings that are difficult to' understand. EVAL allows things like parRtag_id used in a string to be converted to an actual' number (in string form) at time of HTML rendering. We have to use EVAL. There is no other option.'' 2) The strings from the database must also be represented as VBScript strings in the assignments' below. This means that where a string needs to have an embedded " char, two such chars must be' used, and remember about EVAL mentioned above, meaning that sometimes """" has to be used to' give a single " to the resulting string that pops out from EVAL.' Remember also that whilst HTML doesn't care whether you use single or double quotes, javascript' does (it must use single quotes) and VBScript does (it must use double quotes)'' Possible Future Roadmap' 1) Rid the code of ABTN_ID - I dont think we need this field now that we are free of the database''Dim rsQryDim varFieldsDim varValues' Create the object and configure some of its propertiesSet rsQry = Server.CreateObject("ADODB.Recordset")rsQry.CursorLocation = adUseClientrsQry.CursorType = adOpenKeysetrsQry.LockType = adLockOptimistic' Based upon the original DEF_ACTION_BUTTONS table DDL, define the fields (ie. table columns) being simulatedrsQry.Fields.Append "ABTN_ID", adIntegerrsQry.Fields.Append "ABTN_NAME", adVarChar, 64rsQry.Fields.Append "TEXT", adVarChar, 128, adFldIsNullablersQry.Fields.Append "ACTION_LINK", adVarChar, 512, adFldIsNullablersQry.Fields.Append "EVENT_HANDLER", adVarChar, 512, adFldIsNullablersQry.Fields.Append "IMG_ENABLED", adVarChar, 128, adFldIsNullablersQry.Fields.Append "IMG_DISABLED", adVarChar, 128, adFldIsNullablersQry.Fields.Append "HINT", adVarChar, 256, adFldIsNullablersQry.Fields.Append "VISIBLE", adChar, 1rsQry.Fields.Append "ACTIVE", adChar, 1rsQry.Fields.Append "IS_READONLY_ACTION", adChar, 1rsQry.Fields.Append "HIDE_ON_CLOSED", adChar, 1' open the record set for updatingrsQry.Open' Specify the field order that we are going to use in our row creation statementsvarFields = Array("ABTN_ID", "ABTN_NAME", "TEXT",_"ACTION_LINK",_"EVENT_HANDLER",_"IMG_ENABLED",_"IMG_DISABLED",_"HINT",_"VISIBLE",_"ACTIVE",_"IS_READONLY_ACTION",_"HIDE_ON_CLOSED")' Add the rows to the record set, but only for buttons specifed in the list supplied by the caller' Remember, Field Ordering is... ID, name, text, link, event handler, en-img, dis-img, hint, visible, active, is readonly actionIf isAbtnRequired(aAbtnList, "btnNewVersion") ThenvarValues = Array( 1, "btnNewVersion", null,_"""form_new_version.asp?""& objPMod.ComposeURL()",_null,_"images/abtn_new_version.gif",_"images/abtn_new_version_off.gif",_"Create new version of this package.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnVersionHistory") ThenvarValues = Array( 2, "btnVersionHistory", null,_"""javascript:;""",_"""onClick=""""MM_openBrWindow('_wform_versions_history_release_notes.asp?OLDpv_id=""& parPv_id &""&pkg_id=""& pkgInfoHash.Item (""pkg_id"") &""&FLpkg_version=*""& pkgInfoHash.Item(""v_ext"") &""&FLuser_name=*&rfile=""& scriptName &""&""& objPMod.ComposeURL() &""','History','resizable=yes,scrollbars=yes,width=1000,height='+ ( screen.height - 100 ) );""""""",_"images/abtn_version_history.gif",_null,_"Show version history of this package.",_"Y",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemovePackage") ThenvarValues = Array( 3, "btnRemovePackage", null,_"""_remove_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Remove this package from this release.',{title:'Remove Package', button:'Remove', url: 'HREF'});""",_"images/abtn_remove_pkg.gif",_"images/abtn_remove_pkg_off.gif",_"Remove the package-version from this Release.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMakeRelease") ThenvarValues = Array( 4, "btnMakeRelease", null,_"""_make_released.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Making this package released will prevent any further changes',{title:'Make Release', button:'Release', url: 'HREF'});""""""",_"icons/i_make_released.gif",_"icons/i_make_released_off.gif",_"Make this package released, so that other packages can use it.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMakeUnrelease") ThenvarValues = Array( 5, "btnMakeUnrelease", null,_"""_make_unreleased.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('You are going to unrelease this package.',{title:'Make UnRelease', button:'UnRelease', url: 'HREF'});""""""",_"icons/i_make_unreleased.gif",_"icons/i_make_unreleased_off.gif",_"Unrelease this package.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMakePending") ThenvarValues = Array( 6, "btnMakePending", null,_"""_make_pending.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Making this package pending will prevent any further changes.',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_"icons/i_make_pending.gif",_"icons/i_make_pending_off.gif",_"Make this package pending for build/release.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRejectPackage") ThenvarValues = Array( 7, "btnRejectPackage", null,_"""_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Rejecting a new package version will move it to Work-In-Progress.<br>Rejecting a merge package version will simply remove it from pending.',{title:'Reject Package', button:'Reject', url: 'HREF'});""""""",_"icons/i_reject_pending.gif",_"icons/i_reject_pending_off.gif",_"Reject this package from Pending.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMoveToView") ThenvarValues = Array( 8, "btnMoveToView", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_wform_change_group.asp?""& objPMod.ComposeURL() &""','Set Package Base View');""""""",_"images/abtn_move_package.gif",_"images/abtn_move_package_off.gif",_"Move this package to different Base View (Group).",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnReversionPackage") ThenvarValues = Array( 9, "btnReversionPackage", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_wform_rename_version.asp?renameMode=1&rfile=""& ScriptName & objPMod.ComposeURLWithout(""rfile"") &""','Rename Version Number');""""""",_"images/abtn_rename_version.gif",_"images/abtn_rename_version_off.gif",_"Reversion this package.",_"Y",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnStickyNotes") ThenvarValues = Array(10, "btnStickyNotes", null,_"""javascript:;""",_"""onClick=""""showHideNote();""""""",_"notemanager/images/note.gif",_null,_"Sticky notes",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnObsoletePatch") ThenvarValues = Array(11, "btnObsoletePatch", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Make Patch Obsolete');""""""",_"images/abtn_obsolete_patch.gif",_"images/abtn_obsolete_patch_off.gif",_"Make this patch obsolete.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnUnobsoletePatch") ThenvarValues = Array(12, "btnUnobsoletePatch", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_wform_obsolete_patch.asp?action=true&unobsolete=true&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','UnObsolete Patch');""""""",_"images/abtn_unobsolete_patch.gif",_null,_"Undo patch obsolete.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnApprovePackage") ThenvarValues = Array(13, "btnApprovePackage", null,_"""_make_approved.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Approve this package for auto-build.',{title:'Approve Package', button:'Approve', url: 'HREF'});""""""",_"icons/i_submit_build.gif",_"icons/i_submit_build_off.gif",_"Make this package released for automated build.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNewRelease") ThenvarValues = Array(14, "btnNewRelease", null,_"""new_release.asp?" & objPMod.ComposeURL() &"""",_null,_"images/abtn_new_release.gif",_"images/abtn_new_release_off.gif",_"Create new release...",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditRelease") ThenvarValues = Array(15, "btnEditRelease", null,_"""javascript:go_submit( document.FormName, """"btnEditRelease"""" );""",_null,_"images/abtn_edit.gif",_"images/abtn_edit_off.gif",_"Edit selected release details...",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMergeManager") ThenvarValues = Array(17, "btnMergeManager", null,_"""diff.asp""",_null,_"images/abtn_merge_manager.gif",_"images/abtn_merge_manager_off.gif",_"Run merge manager...",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMoveRelease") ThenvarValues = Array(18, "btnMoveRelease", null,_"""javascript:go_submit( document.FormName, """"btnMoveRelease"""" );""",_null,_"images/abtn_move_release.gif",_"images/abtn_move_release_off.gif",_"Move selected release vertically...",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd If' NOTE: entries 19 and 20 were not used' Index numbers can be reusedIf isAbtnRequired(aAbtnList, "btnNewVersion-MASSREF") ThenvarValues = Array(21, "btnNewVersion-MASSREF", null,_"""form_new_version.asp?rtag_id=""& AssocMASSREFValue &""&pv_id=""& Request(""pv_id"")",_null,_"images/abtn_new_version_MassRef.gif",_null,_"Create new version of this package in associated MASS REF.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDestroyWip") ThenvarValues = Array(34, "btnDestroyWip", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_destroy_package.asp?bfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Destroy WIP');""""""",_"icons/i_destroy_package.gif",_"icons/i_destroy_package_off.gif",_"Destroy this WIP",_"Y",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRecycleBin") ThenvarValues = Array(22, "btnRecycleBin", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_destroy_package.asp?&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Destroy Package Version');""""""",_"icons/i_destroy_package.gif",_"icons/i_destroy_package_off.gif",_"Destroy this package version",_"Y",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeprecation") ThenvarValues = Array(23, "btnDeprecation", null,_"""javascript:;""",_"""onClick='MM_openVixIFrame(""""_wform_deprecate_package.asp?rfile=""& scriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &"""""",""""Deprecate Package"""")' class='body_txt' title='Deprecate the package.'""",_"images/BombBorder.gif",_"images/BombBorder_off.gif",_"Deprecate this package in this release.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnUnDeprecation") ThenvarValues = Array(24, "btnUnDeprecation", null,_"""_wform_undeprecate_package.asp?rfile=""& scriptName &""&pkg_id=""& pkgInfoHash.Item(""pkg_id"") &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id &""""",_"""vixConfirm('You are about to undeprecate package: ""& pkgInfoHash.Item (""pkg_name"") &"".',{title:'Undeprecate Package', url: 'HREF'});""""""",_"images/BombBorder.gif",_null,_"Un Deprecate this package in this release",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAdminView") ThenvarValues = Array(25, "btnAdminView", null,_"""form_edit_project_view.asp?proj_id=""& parProjId &""""",_null,_"images/view_admin.gif",_null,_"Administer the views in the project.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNotificationView") ThenvarValues = Array(25, "btnNotificationView", null,_"""form_view_release_notifications.asp?proj_id=""& parProjId &""""",_null,_"images/view_notifications.gif",_null,_"Display the package notification information in this project .",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnProjectReplication") ThenvarValues = Array(25, "btnProjectReplication", null,_"""form_project_replication.asp?proj_id=""& parProjId &""""",_null,_"images/project_replication.gif",_null,_"Display the project replication information.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd If' NOTE: I do not think this one is ever usedIf isAbtnRequired(aAbtnList, "btnAddProc") ThenvarValues = Array(26, "btnAddProc", "Add Process",_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddProc.asp?rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Add Process');""""""",_"icons/btn_add.gif",_null,_null,_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditGBE_Machtype") ThenvarValues = Array(27, "btnEditGBE_Machtype", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddMachtype.asp?type=edit&gbe_id=""& gbe_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Type');""""""",_"icons/i_edit.gif",_null,_"Edit this GBE MachType value",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteGBE_Machtype") ThenvarValues = Array(28, "btnDeleteGBE_Machtype", null,_"""_DeleteMachtype.asp?rfile=""& SCRIPT_NAME &""&gbe_id=""& gbe_id &""&""& objPMod.ComposeURL()",_"""vixConfirm('Remove \'""& GBE_VALUE &""\' from this list?',{title:'Remove GBE_MACHTYPE', button:'Remove', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete this GBE MachType value",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditDaemon") ThenvarValues = Array(29, "btnEditDaemon", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddDaemon.asp?type=edit&rcon_id=""& rcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Daemon');""""""",_"icons/i_edit.gif",_NULL,_"Edit Build Configuration",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteDaemon") ThenvarValues = Array(30, "btnDeleteDaemon", null,_"""_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Delete&"" & objPMod.ComposeURL()",_"""vixConfirm('Delete the \'""& Daemon &""\' Daemon and associated information from this Release?',{title:'Remove Deamon', button:'Remove', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete Daemon",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveDaemon") ThenvarValues = Array(47, "btnRemoveDaemon", null,_"""_DeleteDaemon.asp?rcon_id=""& rcon_id & ""&action=Remove&""& objPMod.ComposeURL()",_"""vixConfirm('Unlink the \'""& Daemon &""\' Daemon from this Release.<p>Configuration information will be maintained.',{title:'Unlink Deamon', button:'Unlink', url: 'HREF'});""""""",_"icons/break_link.gif",_null,_"Unlink Daemon from entry",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditBuildMachine") ThenvarValues = Array(29, "btnEditBuildMachine", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddBuildMachine.asp?type=edit&bmcon_id=""& bmcon_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Machine');""""""",_"icons/i_edit.gif",_NULL,_"Edit Build Machine",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteBuildMachine") ThenvarValues = Array(30, "btnDeleteBuildMachine", null,_"""_DeleteBuildMachine.asp?rfile=""& SCRIPT_NAME &""&bmcon_id=""& bmcon_id &""&""& objPMod.ComposeURL()",_"""vixConfirm('Remove Build Machine \'""& machine_hostname &""\' from this list?',{title:'Delete Build Machine', button:'Delete', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete Build Machine",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditBlatMachine") ThenvarValues = Array(29, "btnEditBlatMachine", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddPkgReplica.asp?type=edit&server_id=""& server_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Package Replica');""""""",_"icons/i_edit.gif",_NULL,_"Edit Package Replica",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteBlatMachine") ThenvarValues = Array(30, "btnDeleteBlatMachine", null,_"""_DeletePkgReplica.asp?rfile=""& SCRIPT_NAME &""&server_id=""& server_id &""&""& objPMod.ComposeURL()",_"""vixConfirm('Remove Package Replica \'""& display_name &""\' from this list?',{title:'Delete Package Replica', button:'Delete', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete Package Replica",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnPendingIntegration") ThenvarValues = Array(32, "btnPendingIntegration", null,_"""_modify_product_state.asp?state_id=1&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('Do you want to proceed to make this product pending for INTEGRATION?',{title:'Make Pending', button:'Pending', url: 'HREF'});""""""",_"icons/PendingIntegration.gif",_null,_"Make this product pending for Integration.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnPendingTest") ThenvarValues = Array(33, "btnPendingTest", null,_"""_modify_product_state.asp?state_id=2&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('Do you want to proceed to make this product pending for Test?',{title:'Make Test', button:'Test', url: 'HREF'});""""""",_"icons/PendingTest.gif",_null,_"Make this product pending for Test.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnPendingDeployment") ThenvarValues = Array(34, "btnPendingDeployment", null,_"""_modify_product_state.asp?state_id=3&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('Do you want to proceed to make this product pending for DEPLOYMENT?',{title:'Make Deploy', button:'Deploy', url: 'HREF'});""""""",_"icons/PendingDeployment.gif",_null,_"Make this product pending for Deployment.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRejectProduct") ThenvarValues = Array(35, "btnRejectProduct", null,_"""_modify_product_state.asp?state_id=4&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('Do you want to REJECT this product from DEPLOYMENT?',{title:'Reject Product', button:'Reject', url: 'HREF'});""""""",_"icons/i_reject_pending.gif",_null,_"Reject this product from Deployment.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnPendingIntegrateAndDeploy") ThenvarValues = Array(36, "btnPendingIntegrateAndDeploy", null,_"""_modify_product_state.asp?state_id=5&rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('Do you want to proceed to make this product pending for INTEGRATION and DEPLOYMENT?',{title:'Pending Product', button:'Confirm', url: 'HREF'});""""""",_"icons/PendingDeployment.gif",_null,_"Make this product pending for Integration and Deployment.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteSchedule") ThenvarValues = Array(37, "btnDeleteSchedule", null,_"""_DeleteSchedule.asp?scheduled_id=""& scheduled_id &""&""& objPMod.ComposeURL()",_"""vixConfirm('Remove Schedule from this list?',{title:'Remove Schedule', button:'Remove', url: 'HREF'});""""""",_"icons/i_remove.gif",_"icons/i_remove_dis.gif",_"Delete Schedule",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnApproveMerge") ThenvarValues = Array(38, "btnApproveMerge", null,_"""_approve_merge.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id",_"""vixConfirm('The release will be updated by this merge operation',{title:'Approve Merge', button:'Merge', url: 'HREF'});""""""",_"icons/i_make_released.gif",_"icons/i_make_released_off.gif",_"Approve and carry out the pending merge operation",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRejectAutobuildPackage") ThenvarValues = Array( 39, "btnRejectAutobuildPackage", null,_"""_make_rejected.asp?rfile=""& ScriptName &""&pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Rejecting a package already approved for autobuild will set it back to Work-In-Progress',{title:'Reject Package', button:'Reject', url: 'HREF'});""""""",_"icons/i_reject_pending.gif",_"icons/i_reject_pending_off.gif",_"Unapprove autobuild, move back to Work-In-Progress.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteDaemonInst") ThenvarValues = Array(40, "btnDeleteDaemonInst", null,_"""_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&inst_id=""& daemonInstId &""&""& objPMod.ComposeURL()",_"""vixConfirm('Delete the Daemon Instruction from this list?',{title:'Delete Instruction', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_"icons/i_remove.gif",_null,_"Delete this Daemon Instruction",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditDaemonInst") ThenvarValues = Array(41, "btnEditDaemonInst", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?edit=true&inst_id=""& daemonInstId & ""&sort="" & parSortOrder & ""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Edit Daemon Instruction');""""""",_"icons/i_edit.gif",_NULL,_"Edit this Daemon Instruction",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAddDaemonInstRipplePackage") ThenvarValues = Array(42, "btnAddDaemonInstRipplePackage", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddDaemonInstructionSimple.asp?op_code=0"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Ripple or Test Build Package');""""""",_"images/ripplesquare.gif",_NULL,_"Request the Build Daemon to ripple this package version",_"Y",_"Y",_"N",_"Y")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDelDaemonInstRipplePackage") ThenvarValues = Array(42, "btnDelDaemonInstRipplePackage", null,_"""_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&opCode="" & OP_CODE_0_RIPPLE_BUILD_PACKAGE & ""&""& objPMod.ComposeURL()",_"""vixConfirm('Delete the Ripple Request?',{title:'Delete Ripple Request', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_"images/CascadeSquareDel.gif",_NULL,_"Delete the Ripple Request",_"Y",_"Y",_"N",_"Y")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDelDaemonInstTestPackage") ThenvarValues = Array(42, "btnDelDaemonInstTestPackage", null,_"""_DeleteDaemonInstruction.asp?rfile=""& ScriptName &""&opCode="" & OP_CODE_1_TEST_BUILD_PACKAGE & ""&""& objPMod.ComposeURL()",_"""vixConfirm('Delete the Test Build Request?',{title:'Delete Test Build Request', button:'Delete', url: 'HREF', width : 350, height : 150});""""""",_"images/testSquareDel.gif",_NULL,_"Delete the Test Build Request",_"Y",_"Y",_"N",_"Y")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAddDaemonInstTestBuildPackage") ThenvarValues = Array(43, "btnAddDaemonInstTestBuildPackage", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddDaemonInstruction.asp?op_code=1"" &""&rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Add Daemon Instruction');""""""",_"images/abtn_test_build.gif",_NULL,_"Request the Build Daemon to test build this WIP package version",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnMoveWIPToRelease") ThenvarValues = Array( 44, "btnMoveWIPToRelease", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('_wform_move_wip.asp"" &""?rfile=""& ScriptName &""&""& objPMod.ComposeURL() &""','Move WIP');""""""",_"images/abtn_move_wip_to_release.gif",_"images/abtn_move_wip_to_release_off.gif",_"Move this WIP to another release.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnLockPackage") ThenvarValues = Array( 45, "btnLockPackage", null,_"""_s_lock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Lock Package.<p>This will prevent changes to the package.',{title:'Lock Package', button:'Lock', url: 'HREF'});""""""",_"icons/i_lock.gif",_"icons/i_lock_off.gif",_"Lock this package.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnUnLockPackage") ThenvarValues = Array( 46, "btnUnLockPackage", null,_"""_s_unlock_package.asp?pv_id=""& parPv_id &""&rtag_id=""& parRtag_id ",_"""vixConfirm('Unlock Package.<p>This may have serious side effects.',{title:'Unlock Package', button:'Unlock', url: 'HREF'});""""""",_"icons/i_unlock.gif",_"icons/i_unlock_off.gif",_"Unlock this package.",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditProjectExtensions") ThenvarValues = Array(29, "btnEditProjectExtensions", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddProjectExtension.asp?type=edit&ext=""& extName &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Project Extension');""""""",_"icons/i_edit.gif",_NULL,_"Edit Project Extensions",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteProjectExtension") ThenvarValues = Array(30, "btnDeleteProjectExtension", null,_"""_DeleteProjectExtension.asp?rfile=""& SCRIPT_NAME &""&ext=""& extName &""&""& objPMod.ComposeURL()",_"""vixConfirm('Remove Project Extension: \'""& extName &""\' from this list?<p>This will prevent it from being used in new package versions.',{title:'Remove Project Extension', button:'Remove', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete Project Extension",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditGBE_Machclass") ThenvarValues = Array(31, "btnEditGBE_Machclass", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddMachclass.asp?type=edit&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Machine Class');""""""",_"icons/i_edit.gif",_NULL,_"Edit this GBE MachClass value",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteGBE_Machclass") ThenvarValues = Array(32, "btnDeleteGBE_Machclass", null,_"""wAddMachclass.asp?type=delete&bm_id=""& bm_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL()",_"""vixConfirm('Delete the \'""& GBE_VALUE &""\' Machine Class',{title:'Delete Machine Class', button:'Delete', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete this GBE MachClass value",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnEditGBE_BuildStandard") ThenvarValues = Array(48, "btnEditGBE_BuildStandard", null,_"""javascript:;""",_"""onClick=""""MM_openVixIFrame('wAddBuildStandard.asp?type=edit&bsa_id=""& bsa_id &""&rfile=""& SCRIPT_NAME &""&""& objPMod.ComposeURL() &""','Edit Build Standard');""""""",_"icons/i_edit.gif",_NULL,_"Edit this Build Standard",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnDeleteGBE_BuildStandard") ThenvarValues = Array(49, "btnDeleteGBE_BuildStandard", null,_"""_DeleteBuildStandard.asp?rfile=""& SCRIPT_NAME &""&bsa_id=""& bsa_id &""&""& objPMod.ComposeURL()",_"""vixConfirm('Delete the \'""& GBE_VALUE &""\' Build Standard',{title : 'Delete Build Standard', button:'Delete', url: 'HREF'});""""""",_"icons/i_remove.gif",_null,_"Delete this Build Standard",_"Y",_"Y",_"N",_"N")rsQry.AddNew varFields, varValuesEnd If' Move cursor to the first recordrsQry.MoveFirstIf ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) ThenCall LoadButtons ( rsQry.GetRows() )End IfrsQry.CloseSet rsQry = NothingEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub LoadButtons ( aRows )Dim nProperty, newArrayDim, LastRow, rowNumLastRow = UBound( aRows, 2 )For rowNum = 0 To LastRow' Increase array by 1newArrayDim = LastRowInx() + 1ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )mobjNameDefMap.Item ( Cstr( aRows ( InxName, rowNum ) ) ) = newArrayDimFor nProperty = 0 To mLastPropertyInxmArrAbtnDef ( nProperty, newArrayDim ) = aRows ( nProperty, rowNum )NextNextEnd Sub'-----------------------------------------------------------------------------------------------------------------Private Function LastRowInx ()LastRowInx = UBound ( mArrAbtnDef, 2 )End Function'-----------------------------------------------------------------------------------------------------------------Public Sub AddSeparatorAfter ( sItemName, sSeparatorWidth )If InStr( sItemName, " " ) > 0 Then Err.Raise 8, "Method AddSeparatorAfter", "Item Name '"& sItemName &"' cannot have spaces."mobjSeparator.Add (Cstr(sItemName)), CStr(sSeparatorWidth)End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub AddSeparator ( sSeparatorWidth )mobjSeparator.Add ( Cstr(mArrAbtnDef(InxName, LastItemInx())) ), CStr(sSeparatorWidth)End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub SetItemDefaults ( sItemName )' Additional default setupCall SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, enumDB_YES ) ' Default Active = enumDB_YESEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Text ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxTxt, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub ItemID ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxID, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Image ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImg, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value ) ' Default image disable to be the same as imageEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub ImageOff ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Link ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxLink, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub EventHandler ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxEventHandler, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Hint ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxHint, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Visible ( sItemName, Value )'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub ReadOnly ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxIsReadonlyAction, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Function IsVisible ( sItemName )'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))IsVisible = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxVisible )End Function'-----------------------------------------------------------------------------------------------------------------Public Sub Active ( sItemName, Value )'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Function IsActive ( sItemName )IsActive = GetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive )End Function'-----------------------------------------------------------------------------------------------------------------Private Sub Class_Initialize()'// Perform action on creation of object. e.g. Set myObj = New ThisClassNameSet mobjNameDefMap = CreateObject("Scripting.Dictionary")Set mobjIdDefMap = CreateObject("Scripting.Dictionary")Set mobjSeparator = CreateObject("Scripting.Dictionary")Set mobjACActionsMap = CreateObject("Scripting.Dictionary")'mbIsReadonly = FALSE ' Tell control that it should use only readonly action buttons (i.e. actions which will not alter database )mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_HIDE ' Tell control what to do by default if mbIsReadonly = TRUEmnButtonSpacer = 0mnImageHspace = 4mNumOfProperties = 12 ' Number of properties in array which define one menu item.mLastPropertyInx = mNumOfProperties - 1mbDisableAll = FALSEReDim mArrAbtnDef ( mNumOfProperties, -1 )InxID = 0InxName = 1InxTxt = 2InxLink = 3InxEventHandler = 4InxImg = 5InxImgOff = 6InxHint = 7InxVisible = 8InxActive = 9InxIsReadonlyAction = 10InxHideOnClosed = 11End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub Class_Terminate()'// Perform action on object disposal. e.g. Set myObj = NothingSet mobjNameDefMap = NothingSet mobjIdDefMap = NothingSet mobjSeparator = NothingSet mobjACActionsMap = NothingEnd Sub'-----------------------------------------------------------------------------------------------------------------End Class%>