aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-11-09 07:04:21 +0000
committerChad Little <clittle@users.sourceforge.net>2002-11-09 07:04:21 +0000
commit3e6c502c7209e5ae65f9952c2da7d69c7fb67723 (patch)
treec633e31b35f2a0f2c7e473efc00bcfb1a91b377a /functions
parentc3483ebeac844742b0b0d9910a50b663daeede23 (diff)
downloadphpicalendar-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')
-rw-r--r--functions/init.inc.php19
-rw-r--r--functions/list_languages.php56
2 files changed, 19 insertions, 56 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php
index d3a0e03..bc27ff0 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -8,30 +8,13 @@
// uncomment when developing, comment for shipping version
// error_reporting (E_ALL);
-// Retain some compatibility backwards like.
-//jared.20021003 I think we're always going to make sure these are extracted by hand
-//so I'll comment this out for now, otherwise, uncomment this
-//chad - navigation breaks after 4.2.0 without this.
-// jared-2002.10.19; Re-enabled code at line 32 of this file. Shouldn't need this now.
-// if we're going to use this, we should just extract them for all versions in case
-// someone has manually turned of $register_globals, Otherwise we'll just do it by hand
-// for the vars we care about
-/*
-if(phpversion() >= '4.2.0')
-
- {
- extract($HTTP_GET_VARS);
- extract($HTTP_POST_VARS);
- }
-*/
-
if (!defined('BASE')) define('BASE', './');
include(BASE.'config.inc.php');
include(BASE.'functions/error.php');
// language support
$language = strtolower($language);
-$lang_file = getcwd().'/languages/'.$language.'.inc.php';
+$lang_file = BASE.'/languages/'.$language.'.inc.php';
if (file_exists($lang_file)) {
include($lang_file);
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

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