Page 1 of 1

need lang[] values for a module [solved]

Posted: Tue Jun 12, 2007 4:54 am
by pumuklee
hi

i have a language file with 100 lang[''] values for my module

i want to read this values without to specify lang['username']...
i want to read all the values
because to write 100 times lang['value'] it is complicated

my question is how can i read all the lang[''] values for a specific module?

to use the global $lang is not ok
i become just the common values from cmsms without these ones from my module

thanks

Re: need lang[] values for a module

Posted: Tue Jun 12, 2007 9:31 am
by pumuklee
i found a solution

maybe its not the best
but its working

in my language file i inserted something like this

$langindex = array();
$langindex = array_keys($lang);

$lang['indexes'] = $langindex;

i created in my module a function

function lang_var_defines($varlist_array_name)
{
$varlist_array = array();
$varlist_array = $this->Lang($varlist_array_name);

for($i=0;$iLang($varlist_array[$i]));
}
}

function call:    this->lang_var_defines('indexes');

this one creates for me defines with all the indexes from this module
and just the lang values for this module

so i dont need to write defines line for every value from my language file

i hope its help for someone

thats all folks