Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Doppia voce nel menu toolbar

Autore Messaggio
blackeagle

Amatore
Amatore
43 Discussioni



Profilo - blackeagle
11 gennaio 2007 alle 11:58:10 Profilo - blackeagleInvia un messaggio privato Rispondi quotando
:~( Ciao sto cercando di mettere la lingua inglese anche nel menu toolbar e nonostante faccia le stesse cose del menuitems, le voci del menu mi compaiono sempre doppiate, i passaggi che faccio sono i seguenti:
1) creato traduzione IT LANG_MENU_INTRODUZIONE => Introduzione
2) creato traduzione EN LANG..... => Introdutions
Il codice che inserisco nel menu toolbar è il seguente:
<element>
<text type="translation">LANG_MENU_INTRODUZIONE</text>
<link type="instruction">introduzione.asp</link>
<target>_self</target>
<role></role>
<flag type="instruction">sXMLVersion="IT"</flag>
</element>
<element>
<text type="translation">LANG_MENU_INTRODUZIONE</text>
<link type="instruction">introdution.asp</link>
<target>_self</target>
<role></role>
<flag type="instruction">sXMLVersion="EN"</flag>
</element>

Pls dov'è che sbaglio?
Ciao e grazie
---------------
Si Vis Pacem Para Bellum [lo]
piosky_to2003

Esperto
Esperto
2291 Discussioni



Profilo - piosky_to2003
11 gennaio 2007 alle 12:59:51 Profilo - piosky_to2003Invia un messaggio privato chat_silvio@hotmail.com Rispondi quotando
Modificato il 11 gennaio 2007 alle 13:06:25

Guardando velocemente il codice forse Non sbagli , la toolbar non gestisce il campo FLAG

1) soluzioni o modifichi toobar_js-inc.asp per fargli vedere il campo flag

2) O metti un solo elemento con la traduzione che punta ad un prefile che indirizza sul file giusto
esempio

<element>
<text type="translation">LANG_MENU_INTRODUZIONE</text>
<link type="instruction">introduzioneITEN.asp</link>
<target>_self</target>
<role></role>
</element>

dove il file introduzione.asp

<!-- #include file="includes/includes-inc.asp" -->
<%
sTitlePage = GetTranslation("LANG_TITLE_ACCOUNT")
Select Case sXMLVersion
Case "IT" 'italiano
Response.redirect "pagina_italiano.asp"
Case "EN" 'inglese
Response.redirect "pagina_inglese.asp"
End Select

%>
<!-- #include file="includes/toppage-inc.asp" -->

<!-- #include file="includes/bottompage-inc.asp" -->
<!-- #include file="includes/clearitall-inc.asp" -->

3) o se non vuoi troppi file ti costruisci un unico file e scrivi sia la parte italiano e inglese controllando con l'if

esempio
dove il file introduzioneITEN.asp

<!-- #include file="includes/includes-inc.asp" -->
<%
sTitlePage = GetTranslation("LANG_TITLE_ACCOUNT")
%>
<!-- #include file="includes/toppage-inc.asp" -->
<%
Select Case sXMLVersion
Case "IT" 'italiano
Response.write "ciao mondo"
Case "EN" 'inglese
Response.write "Hello World"
End Select
%>

<!-- #include file="includes/bottompage-inc.asp" -->
<!-- #include file="includes/clearitall-inc.asp" -->

La soluzione 1 sarebbe l'ottimale se lo fai posta il codice cosi si puo aggiungere alla prox release
---------------
Silvio Andrighetti Formaggini (Piosky) [lo]

http://www.roadrunners.to.it
Sito Prove
http://www.piosky.somee.com
msn : chat_silvio@hotmail.com
piosky_to2003

Esperto
Esperto
2291 Discussioni



Profilo - piosky_to2003
11 gennaio 2007 alle 13:27:43 Profilo - piosky_to2003Invia un messaggio privato chat_silvio@hotmail.com Rispondi quotando
Modificato il 11 gennaio 2007 alle 18:16:27

Visto che le soluzioni 2 e 3 non sono eleganti e comportano troppo lavoro , ho modificato il file toolbar_js-inc.asp in pausa pranzo


<%
Sub DisplayToolBar()
Dim totaletesto, totaletarget, totalelink, ind, iMenu
Dim oXML, NodeList, Node, SubNodeList, SubNode
Dim tempNode, tempText
Dim RigaMenu, RigaInit, RigaElements
'AGGIUNGERE LE DUE DICHIARAZIONI DI VARIABILE SEGNATE IN NERETTO mFlag e bOKLang
Dim TotaleMenu, TotaleInit, mRole, bOk, bOKLang, mLink, mTarget, mTarget1, mText,mFlag

TotaleMenu = ""
TotaleInit = ""

Set oXML = GetNewXMLDocument("toolbar")
Set NodeList = oXML.selectNodes("menu")
ind = 0
iMenu = 0
For Each Node In NodeList

RigaMenu = ""
RigaInit = ""
RigaElements = ""

Set SubNodeList = Node.selectNodes("element")
For Each SubNode In SubNodeList
mRole = GetXMLValue("role", SubNode)
mLink = GetXMLValue("link", SubNode)
mTarget = GetXMLValue("target", SubNode)
mText = GetXMLValue("text", SubNode)

' AGGIUNGERE LE SEGUENTI RIGHE

mFlag = GetXMLValue("flag", SubNode)
if mFlag="" then
bOKLang= true
else
bOKLang= mFlag
End if


if mTarget = "_blank" or mTarget = "_self" then
mTarget1 = mTarget
mTarget = "target=""" & mTarget & """"
else
if mLink = "" then
mLink = "Java_Script:void(0);"
else
mTarget = "target=""_self"""
mTarget1 = "_self"
end if
end if

if mrole = "" then
mrole = -1
end if

bOk = false
Select Case mRole
Case -1
bOk = true
Case -2
If isAuthorized(ROLE_NEWS) Then
bOk = true
End If
Case ROLE_USER
If sPseudo <> "" Then
bOk = true
End If
Case 0
If sPseudo = "" Then
bOk = true
End If
Case Else
If isAuthorizedBin(mRole) Then
bOk = true
End If
End Select
' AGGIUNGERE L'AND SULLA VARIABILE BOOLEANA bOkLang

If bOk and bOKLang Then
if RigaMenu = "" then
RigaMenu = " <td nowrap=""nowrap""><a class=""mainlevel-trans"" id=""menu_" & ind & """ title=""" & mText & """ href=""" & mLink & """ " & mTarget & ">" & mText & "</a></td>" & vbCrLf
RigaInit = " document.getElementById(""menu_" & ind & """).onmouseover = function() { ms.hideCurrent();}" & vbCrLf
else
RigaInit = " var tmenu_" & ind & " = ms.addMenu(document.getElementById(""menu_" & ind & """));" & vbCrLf
RigaElements = RigaElements & " tmenu_" & ind & ".addItem(""" & mText & """, """ & mLink & """, """ & mTarget1 & """, 0);" & vbCrLf
end if
End if
Next
TotaleInit = TotaleInit & RigaInit & RigaElements
TotaleMenu = TotaleMenu & RigaMenu

Set SubNodeList = Nothing
ind = ind + 1
Next
Set NodeList = Nothing
Set tempNode = Nothing
Set oXML = Nothing

if ind > 0 then
response.write " <_div id=""wrapMenu"">" & vbCrLf
response.write " <_div id=""topMenu"">" & vbCrLf
response.write " <table id=""topmenu"" cellSpacing=""0"" cellPadding=""0"">" & vbCrLf
response.write " <tr valign=""top"">" & vbCrLf
response.write TotaleMenu & vbCrLf
response.write " <td width=""100%""></td>" & vbCrLf
response.write " </tr>" & vbCrLf
response.write " </table>" & vbCrLf
response.write " </_div>" & vbCrLf
response.write " </_div>" & vbCrLf

response.write " <_Script type=""text/Java_Script"" language=""Java_Script"">" & vbCrLf
response.write " if (TransMenu.isSupported()) {" & vbCrLf
response.write " TransMenu.backgroundColor = ""#000000"";" & vbCrLf
response.write " var ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft);" & vbCrLf
response.write TotaleInit & vbCrLf
response.write " TransMenu.renderAll();" & vbCrLf

response.write " var init1 = function(){TransMenu.initialize();}" & vbCrLf
response.write " if (window.attachEvent) {" & vbCrLf
response.write " window.attachEvent(""onload"", init1);" & vbCrLf
response.write " }else{" & vbCrLf
response.write " TransMenu.initialize();" & vbCrLf
response.write " }" & vbCrLf

response.write " }" & vbCrLf
response.write " </_Script>" & vbCrLf
end if
End Sub
%>


fammi sapere se ci sono problemi ;)
---------------
Silvio Andrighetti Formaggini (Piosky) [lo]

http://www.roadrunners.to.it
Sito Prove
http://www.piosky.somee.com
msn : chat_silvio@hotmail.com
blackeagle

Amatore
Amatore
43 Discussioni



Profilo - blackeagle
11 gennaio 2007 alle 18:03:15 Profilo - blackeagleInvia un messaggio privato Rispondi quotando
GRANDE Piosky funziaaaaaaaa [feu] anche io avrei optato per l'opzione flag, ho dovuto dichiarare solo le 2 variabili mFlag e bOKLang ed è andato tutto per il verso giusto! :-) Big piosky grazieeeeee adesso posso continuare a modificare i menu
Ciao e grazie di nuovo
---------------
Si Vis Pacem Para Bellum [lo]
piosky_to2003

Esperto
Esperto
2291 Discussioni



Profilo - piosky_to2003
11 gennaio 2007 alle 18:07:41 Profilo - piosky_to2003Invia un messaggio privato chat_silvio@hotmail.com Rispondi quotando
Modificato il 11 gennaio 2007 alle 20:04:57

la dichirazione di bOKLang l'ho evidenziata di nero mentre quella di mFlag mi sono dimenticato di evidenziarla, ora correggo ;)
---------------
Silvio Andrighetti Formaggini (Piosky) [lo]

http://www.roadrunners.to.it
Sito Prove
http://www.piosky.somee.com
msn : chat_silvio@hotmail.com

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 87
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5684862 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi