home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / shared / regwiz.cab / RegWizUI.dll / HTML / EULA.VBS < prev    next >
Encoding:
Text File  |  2005-07-13  |  2.8 KB  |  134 lines

  1. Option Explicit
  2.  
  3. Dim gstrAcceptUrl, gstrDeclineUrl
  4.  
  5.  
  6. Function OnDecline()
  7. '{
  8.     Call window.location.replace (CStr(CANCEL_HTM))
  9. '}
  10. End Function
  11.  
  12. Function OnAccept()
  13. '{    
  14.     Dim strAccountID, objRequest
  15.     Dim nRegForce, nSubmitResult
  16.  
  17.     Set objRequest = gobjExternal.GetParam ( PROP_REGREQUEST )
  18.  
  19.     If IsObject (objRequest) Then
  20.     '{
  21.         strAccountID = objRequest.Item ( PROP_ACCOUNTID )
  22.         Set objRequest = Nothing
  23.     '}
  24.     End If
  25.  
  26.     If "" = strAccountID Then
  27.         gstrAcceptUrl = PROFILE_HTM
  28.     Else
  29.     '{
  30.         nSubmitResult = SubmitDataForRegistration ( MODE_AUTH )
  31.  
  32.         If REGWIZ_STATUS_NOINTERNET = nSubmitResult Then
  33.         '{
  34.             ' Hide Cancel button for force registration
  35.             nRegForce = gobjExternal.GetParam ( PROP_FORCE_REG )
  36.  
  37.             If 1 = nRegForce Then
  38.             '{
  39.                 gstrAcceptUrl = SUBMITONCONNECT_HTM
  40.             '}
  41.             Else
  42.             '{
  43.                 gstrAcceptUrl = REMINDME_HTM
  44.             '}
  45.             End If
  46.         '}
  47.         Else
  48.         '{
  49.             Exit Function
  50.         '}
  51.         End If
  52.     '}
  53.     End If
  54.  
  55.     Call window.location.replace (CStr(gstrAcceptUrl))
  56. '}
  57. End Function
  58.  
  59. Function OnEulaBodyLoad()
  60. '{
  61.     Dim sIni, sTemp
  62.     Dim objRequest, sAccountID
  63.  
  64.     ' Always check if we are running in MgHtml's instance.
  65.     Call SetExternalObject (gobjExternal)
  66.     
  67.     gstrAcceptUrl  = PROFILE_HTM
  68.     gstrDeclineUrl = CANCEL_HTM
  69.  
  70.     ' gsEulaLang = REGWIZ_LANG_ID
  71.     gsEulaLang = EULA_LANG_ID
  72.  
  73.     Call window.setTimeout ( "SetDefaultEulaText()", 300 )
  74. '}
  75. End Function
  76.  
  77. Function SetDefaultEulaText()
  78. '{
  79.     ' Populate the country list
  80.     Dim szCountry, szLang, szVal, strEulaTextLang, strTempLang
  81.     Dim nLength, nCtr
  82.  
  83.     Call SortArray ( gCountryArray, gCountryArraySorted )
  84.     nLength = getArrayLength ( gCountryArraySorted )
  85.  
  86.     strEulaTextLang = Replace ( gsEulaLang, "-", "_" )
  87.  
  88.     for nCtr = 0 To (nLength-1)
  89.     '{
  90.         szVal = GetCountryNameAndLangCode ( nCtr )
  91.  
  92.         szCountry = split(szVal,"$")(0)
  93.         szLang = split(szVal,"$")(1)
  94.         
  95.         call AddToOptionList(idCountryList, szLang, szCountry)
  96.  
  97.         strTempLang = Replace ( strEulaTextLang, "_", "-" )
  98.  
  99.         ' if strTempLang = "fr-ca" then strTempLang = "en-ca"
  100.  
  101.         If strTempLang = szLang Then
  102.         '{
  103.             idCountryList.options(nCtr).selected = true
  104.         '}
  105.         End If
  106.     '}
  107.     next    
  108.  
  109.     ' language specific country should be selected by default. Ex. for us build it is "United States", for french build it is "France"
  110.     ' if strEulaTextLang = "fr-ca" or strEulaTextLang = "fr_ca" then strEulaTextLang = "en_ca"
  111.  
  112.     idEulaText.value = eval("STR_EULA_CONTENT_" & strEulaTextLang)
  113. '}
  114. End Function
  115.  
  116. Function ShowEulaContents()
  117. '{
  118.     Dim strEulaTextLang
  119.     strEulaTextLang = Replace ( idCountryList.value, "-", "_" )
  120.  
  121.     idEulaText.readOnly = false
  122.     idEulaText.value = eval("STR_EULA_CONTENT_" & strEulaTextLang)
  123.     idEulaText.readOnly = true
  124.  
  125.     gsEulaLang = idCountryList.value
  126. '}
  127. End Function
  128.  
  129. Function PrintPrivacyPolicy()
  130. '{
  131.     ' Calling printDoc()    
  132.     Call printDoc (1)    
  133. '}    
  134. End Function