diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-11-09 07:04:21 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-11-09 07:04:21 +0000 |
commit | 3e6c502c7209e5ae65f9952c2da7d69c7fb67723 (patch) | |
tree | c633e31b35f2a0f2c7e473efc00bcfb1a91b377a /functions/list_languages.php | |
parent | c3483ebeac844742b0b0d9910a50b663daeede23 (diff) | |
download | phpicalendar-3e6c502c7209e5ae65f9952c2da7d69c7fb67723.tar.gz phpicalendar-3e6c502c7209e5ae65f9952c2da7d69c7fb67723.tar.bz2 phpicalendar-3e6c502c7209e5ae65f9952c2da7d69c7fb67723.zip |
Initial preferences check in. doesn't work. Changes to RSS index.
Diffstat (limited to 'functions/list_languages.php')
-rw-r--r-- | functions/list_languages.php | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/functions/list_languages.php b/functions/list_languages.php index 370f570..d54bdf9 100644 --- a/functions/list_languages.php +++ b/functions/list_languages.php @@ -1,40 +1,20 @@ - <?php -ifÊ($allow_languageÊ==Ê"yes")Ê{ -ÊÊÊÊ// start of <select> tag -ÊÊÊÊifÊ(isset($getdate))Ê{ -ÊÊÊÊÊÊÊÊ$query="&getdate=$getdate"; -ÊÊÊÊ}ÊelseÊ{ -ÊÊÊÊÊÊÊÊ$query=""; -ÊÊÊÊ} -ÊÊÊÊprintÊ"<form>\n<selectÊname=\"action\"Êclass=\"query_style\"ÊonChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">\n"; -ÊÊÊÊ -ÊÊÊÊ// open file -ÊÊÊÊ$dir_handleÊ=Ê@opendir("languages/"); -ÊÊÊÊ$tmp_pref_languageÊ=Êurlencode(ucfirst($language)); -ÊÊÊÊ -ÊÊÊÊ// build the <option> tags -ÊÊÊÊwhileÊ($fileÊ=Êreaddir($dir_handle))Ê{ -ÊÊÊÊÊÊÊÊifÊ(substr($file,Ê-8)Ê==Ê'.inc.php')Ê{ -ÊÊÊÊÊÊÊÊÊÊÊÊ -ÊÊÊÊÊÊÊÊÊÊÊÊ// $cal_filename is the filename of the calendar without .inc.php -ÊÊÊÊÊÊÊÊÊÊÊÊ// $cal is a urlencoded version of $cal_filename -ÊÊÊÊÊÊÊÊÊÊÊÊ// $cal_displayname is $cal_filename with occurrences of "32" replaced with " " -ÊÊÊÊÊÊÊÊÊÊÊÊ$language_tmpÊ=Êurlencode(ucfirst(substr($file,Ê0,Ê-8))); -ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊifÊ($language_tmpÊ==Ê$tmp_pref_language)Ê{ -ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊprintÊ"<optionÊvalue=\"$current_view.php?chlang=$language_tmp\"Êselected>inÊ$language_tmp</option>\n"; -ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ}ÊelseÊ{ -ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊprintÊ"<optionÊvalue=\"$current_view.php?chlang=$language_tmp\">inÊ$language_tmp</option>\n";ÊÊÊÊ -ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ}ÊÊÊÊÊÊÊÊ -ÊÊÊÊÊÊÊÊ} -ÊÊÊÊ}ÊÊÊÊÊÊÊÊÊÊÊÊ -ÊÊÊÊ -ÊÊÊÊ -ÊÊÊÊ// close file -ÊÊÊÊclosedir($dir_handle); -ÊÊÊÊ -ÊÊÊÊ// finish <select> -ÊÊÊÊprintÊ"</select>\n</form>"; -ÊÊÊÊ + +print "<form>\n<select name=\"action\" class=\"query_style\">\n"; +$dir_handle = @opendir(BASE.'languages/'); +$tmp_pref_language = urlencode(ucfirst($language)); +while ($file = readdir($dir_handle)) { + if (substr($file, -8) == ".inc.php") { + $language_tmp = urlencode(ucfirst(substr($file, 0, -8))); + if ($language_tmp == $tmp_pref_language) { + print "<option value=\"$current_view.php?chlang=$language_tmp\" selected>in $language_tmp</option>\n"; + } else { + print "<option value=\"$current_view.php?chlang=$language_tmp\">in $language_tmp</option>\n"; + } + } } -?>ÊÊÊÊ
\ No newline at end of file + +closedir($dir_handle); +print "</select>\n</form>\n"; + +?>
\ No newline at end of file |