|
From: Mark W. <ma...@rw...> - 2011-09-09 19:53:20
|
Hi Paul,
Not really no.. The internationalisation is done using the Joomla JText
library which gets its data from an ini file.
The output for the javascript needs to be:
lang["HR"] = "h";
lang["MN"] = "m";
etc
The above output is currently generated with this code:
lang["HR"] = "<?php echo JText::_('HR'); ?>";
lang["MN"] = "<?php echo JText::_('MN'); ?>";
Cheers
Mark
_____________________________________________
Mob: 07725 695178
Email: ma...@rw...
On 09/09/2011 20:06, paul cooper wrote:
> is this the sort of thing you are after.
> ive had to do a series of dropdown menus using a multidimensional JS
> array
>
> http://www.medalto.co.uk/dropdown.php
>
> generated by this. I could probably put it in some sort of recursive
> loop to construct the multiidimensional JS array/object
>
> $SQL = "SELECT * FROM coding ORDER BY SYSTEM,SITE,PROCESS" ;
> $ic=array();
> $r = mysql_query($SQL);
> while ($d = mysql_fetch_assoc($r))
> {
> #print_r($d);print'<hr>';
>
> $sy=$d['SYSTEM'];$si=$d['SITE'];$pr=$d['PROCESS'];$co=$d['CONDITION'];
> if (!(array_key_exists($sy, $ic))){ $ic[$sy]= array(); }
> if (!(array_key_exists($si, $ic[$sy]))){ $ic[$sy][$si]= array(); }
> if (!(array_key_exists($pr, $ic[$sy][$si]))){ $ic[$sy][$si][$pr]=
> array(); }
> if (!(array_key_exists($co, $ic[$sy][$si][$pr]))){
> $ic[$sy][$si][$pr][$co]= array(); }
> $ic[$sy][$si][$pr][$co]=$d['ICMcodeExcludingType'];
> }
> print "\n<br>";
> }
> print '<script language="javascript">';
> print "var sys=document.getElementById(\"system\");\n";
> print "var icnarc = {};\n";
> foreach ($ic as $k1 => $v1)
> {
> print "icnarc[\"$k1\"]={}";print "\n";
> print "icnarc[\"$k1\"]".'.name='."\"$k1\";";print "\n";
> foreach ($v1 as $k2 =>$v2)
> {
> print "icnarc[\"$k1\"][\"$k2\"]={};";print "\n";
> print "icnarc[\"$k1\"][\"$k2\"].name=\"$k2\";";print "\n";
> foreach ($v2 as $k3 =>$v3)
> {
> print "icnarc[\"$k1\"][\"$k2\"][\"$k3\"]={};";print "\n";
> print "icnarc[\"$k1\"][\"$k2\"][\"$k3\"].name=\"$k3\";";print "\n";
> foreach ($v3 as $k4 =>$v4)
> {
> print "icnarc[\"$k1\"][\"$k2\"][\"$k3\"][\"$k4\"]={};";print "\n";
> print "icnarc[\"$k1\"][\"$k2\"][\"$k3\"][\"$k4\"].name=\"$k4\";";print
> "\n";
> print
> "icnarc[\"$k1\"][\"$k2\"][\"$k3\"][\"$k4\"].value=\"$v4\";";print "\n";
> }
> }
> }
> print "\n";
> }
>
> ?>
>
|