aboutsummaryrefslogtreecommitdiffstats
path: root/functions/list_languages.php
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-11-08 00:48:31 +0000
committerChad Little <clittle@users.sourceforge.net>2002-11-08 00:48:31 +0000
commit99cf0142b949adeb27fe7dd34343c348292dee02 (patch)
treebd5764aa1c8a0c3f26bdcf796a4898e9a0f2f87d /functions/list_languages.php
parentc5c3a7e645ae5f22309313f2a20ebb8b37fcd13e (diff)
downloadphpicalendar-99cf0142b949adeb27fe7dd34343c348292dee02.tar.gz
phpicalendar-99cf0142b949adeb27fe7dd34343c348292dee02.tar.bz2
phpicalendar-99cf0142b949adeb27fe7dd34343c348292dee02.zip
Initial checkin of Language selection.
Diffstat (limited to 'functions/list_languages.php')
-rw-r--r--functions/list_languages.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/functions/list_languages.php b/functions/list_languages.php
new file mode 100644
index 0000000..370f570
--- /dev/null
+++ b/functions/list_languages.php
@@ -0,0 +1,40 @@
+
+<?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>";
+ÊÊÊÊ
+}
+?>ÊÊÊÊ \ No newline at end of file

© 2014-2024 Faster IT GmbH | imprint | privacy policy