Author: dgoette
Date: Thu Feb 19 10:10:56 2009
New Revision: 39685
URL:
http://svn.reactos.org/svn/reactos?rev=39685&view=rev
Log:
* make it possible to run roscms in single language mode
* rewrote general index.php to use current roscms libs
Modified:
branches/danny-web/reactos.org/htdocs/index.php
branches/danny-web/reactos.org/htdocs/roscms/config.php
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewUserDe…
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Language.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/om/ThisUser.class.php
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
Modified:
branches/danny-web/reactos.org/htdocs/index.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/in…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/index.php [iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/index.php [iso-8859-1] Thu Feb 19 10:10:56 2009
@@ -1,138 +1,49 @@
<?php
- // RosCMS Config File:
- include("roscms/roscms_config.php");
-
- // Browser Detection:
- $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
- if ($is_opera = strchr($userAgent,"opera")) $is_opera = 1;
- if ($is_saf = strchr($userAgent,"applewebkit") || $is_saf =
strchr($userAgent,"apple computer, inc.")) $is_saf = 1;
- if ($is_webtv = strchr($userAgent,"webtv")) $is_webtv = 1;
- if ($is_ie = strchr($userAgent,"msie") && (!$is_opera) &&
(!$is_webtv)) $is_ie = 1;
- if (($is_ie) && $is_ie4 = strchr($userAgent,"msie 4.")) $is_ie4 = 1;
- if ($is_moz = strchr($userAgent,"gecko") && (!$is_saf)) $is_moz = 1;
- if (($is_moz) && $is_mozff = strchr($userAgent,"firefox")) $is_mozff =
1;
- if ($is_kon = strchr($userAgent,"konqueror")) $is_kon = 1;
- if ($is_ns = strchr($userAgent,"compatible") && $is_ns =
strchr($userAgent,"mozilla") && (!$is_ie) && (!$is_opera)
&& (!$is_webtv) && (!$is_saf)) $is_ns = 1;
-
- session_start();
-
- $roscms_page_format = ".html";
-
- // Language detection
- require_once("roscms/inc/language_detection.php");
-
- if (array_key_exists("page", $_GET))
$rpm_page=htmlspecialchars($_GET["page"]);
- $rpm_lang = check_lang($_REQUEST['lang']);
- if (array_key_exists("forma", $_GET))
$rpm_forma=htmlspecialchars($_GET["forma"]);
- if (array_key_exists("format", $_GET))
$rpm_forma=htmlspecialchars($_GET["format"]);
- if (array_key_exists("skin", $_GET))
$rpm_skin=htmlspecialchars($_GET["skin"]);
-
-
- if ($rpm_lang == '' && isset($_COOKIE['roscms_usrset_lang'])) {
- $rpm_lang = $_COOKIE['roscms_usrset_lang'];
- if (substr($rpm_lang, -1) == '/') {
- $rpm_lang = substr($rpm_lang, strlen($rpm_lang) - 1);
- }
- $rpm_lang = check_lang($rpm_lang);
- }
-
- if ($rpm_lang == '') {
- /* After parameter and cookie processing, we still don't have a valid
- language. So check whether the HTTP Accept-language header can
- help us. */
- $accept_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
- $best_q = 0;
- while (preg_match('/^\s*([^,]+)((,(.*))|$)/',
- $accept_language, $matches)) {
- $lang_range = $matches[1];
- $accept_language = $matches[4];
- if (preg_match('/^(([a-zA-Z]+)(-[a-zA-Z]+)?)(;q=([0-1](\.[0-9]{1,3})?))?/',
- $lang_range, $matches)) {
- $lang = check_lang($matches[1]);
- if ($lang != '') {
- $q = $matches[5];
- if ($q == "") {
- $q = 1;
- }
- else {
- settype($q, 'float');
- }
- if ($best_q < $q) {
- $rpm_lang = $lang;
- $best_q = $q;
- }
- }
- }
- }
- }
- if ($rpm_lang == '') {
- /* If all else fails, use the default language */
- $rpm_lang = check_lang('*');
- }
-
- $roscms_page_lang = $rpm_lang . '/';
-
+// RosCMS Config File:
+define('ROSCMS_PATH','roscms/');
+require_once(ROSCMS_PATH.'/config.php');
+require_once(ROSCMS_PATH.'/lib/RosCMS_Autoloader.class.php');
- $rpm_pic = "";
- if (array_key_exists("pic", $_GET))
$rpm_pic=htmlspecialchars($_GET["pic"]);
+// Language detection
+$page_lang = null;
+if (RosCMS::getInstance()->multiLanguage()) {
-
- switch ($rpm_page) {
- case "home":
- case "index":
- default: // Frontpage
- if ($rpm_pic == "/reactos.gif") {
- require("stats/stats.php"); // stats
- exit;
- }
- else {
- $roscms_page_content = "index";
- }
- break;
- case "cms": // CMS Interface
- case "roscms":
- $roscms_page_content = "roscms/?page=home";
- $roscms_page_format = "";
- $roscms_page_lang = "";
- break;
- case "admin":
- $roscms_page_content = "roscms/?page=admin";
- $roscms_page_format = "";
- $roscms_page_lang = "";
- break;
- case "support":
- $roscms_page_content = "support/";
- $roscms_page_format = "";
- $roscms_page_lang = "";
- break;
- case "development":
- $roscms_page_content = "development";
- break;
- case "community":
- $roscms_page_content = "community";
- break;
- case "info":
- $roscms_page_content = "info";
- break;
- case "download":
- $roscms_page_content = "download";
- break;
- }
-
- if ($rpm_page && $roscms_page_content == "index") {
- $roscms_page_content = $rpm_page;
- }
-
-
- if (isset($_COOKIE['roscms_usrset_lang']) || isset($_REQUEST['lang']))
{
- /* Delete an existing cookie (if any) which uses the full hostname */
- setcookie('roscms_usrset_lang', '', -3600);
- /* Add cookie using just the domain name */
- require_once('roscms/inc/utils.php');
- setcookie('roscms_usrset_lang', $rpm_lang, time() + 5 * 30 * 24 * 3600,
- '/', cookie_domain());
- }
-
- header("Location: " . $roscms_page_lang . $roscms_page_content .
$roscms_page_format);
+ // check for aquired language
+ if (isset($_REQUEST['lang'])) {
+ $page_lang = Language::validate($_REQUEST['lang']);
+ }
+
+ // check for saved language
+ elseif (isset($_COOKIE[RosCMS::getInstance()->cookieLanguage()])) {
+ $page_lang =
Language::validate($_COOKIE[RosCMS::getInstance()->cookieLanguage()]);
+ }
+
+ // check for client language
+ elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+ $page_lang = Language::validate($_SERVER['HTTP_ACCEPT_LANGUAGE']);
+ }
+
+ // set cookie to remember selected language
+ if ($page_lang !== null) {
+ Cookie::write(RosCMS::getInstance()->cookieLanguage(), $page_lang, time() + 5 * 30
* 24 * 3600);
+ }
+}
+
+// no language found, try to get standard language
+if ($page_lang === null) {
+ $page_lang = Language::validate('invalid language code');
+}
+
+// { (replace later with check, if that page exists, and what type of extension it has
set)
+ // standard extension
+ $page_extension = 'html';
+
+ // standard extension
+ $page_name = ((isset($_GET['page']) &&
preg_match('/^[a-z_\-0-9]+$/i',$_GET['page'])) ? $_GET['page'] :
'index');
+// }
+
+// redirect to selected page
+header('Location:
'.ROSCMS_PATH.RosCMS::getInstance()->pathGenerated().$page_lang.'/'.$page_name.'.'.$page_extension);
+exit();
?>
Modified:
branches/danny-web/reactos.org/htdocs/roscms/config.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/config.php [iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/config.php [iso-8859-1] Thu Feb 19
10:10:56 2009
@@ -1,7 +1,7 @@
<?php
/*
RosCMS - ReactOS Content Management System
- Copyright (C) 2008 Danny Götte <dangerground(a)web.de>
+ Copyright (C) 2008,2009 Danny Götte <dangerground(a)web.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,6 +43,8 @@
$config->setSiteLanguage('en'); // standard language
$config->setSiteTimezone(-2); // time difference to utc time from server time
+$config->setMultiLanguage(true); // is site multilingual
+
$config->setPathRoscms('/reactos/roscms/'); // path to roscms files
$config->setPathInstance('/reactos/roscms/'); // path to roscms files
$config->setPathGenerationCache('../roscms_cache/'); // path to generated
files (relative to roscms folder)
@@ -76,5 +78,4 @@
// do not change, it's needed to apply those config settings
$config->apply();
-
?>
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/RosCMS.class.php [iso-8859-1] Thu Feb
19 10:10:56 2009
@@ -35,10 +35,13 @@
private $cookie_password = null; // user_password (used for keep login function)
private $cookie_login_name = null; // where username is stored for 'save
username' in login options
private $cookie_security = null; // stores security settings
+ private $cookie_language = null; // stores default language
private $site_name = null; // sites name
private $site_language = null; // standard language
private $site_timezone = null; // time difference to utc time from server time
+
+ private $multi_language = null; // is site multilingual
private $path_generated = null; // path to generated files
private $path_generation_cache = null; // path to cache files while generation process
@@ -117,6 +120,7 @@
public function cookiePassword() { if ($this->applied) return
$this->cookie_password; }
public function cookieLoginName() { if ($this->applied) return
$this->cookie_login_name; }
public function cookieSecure() { if ($this->applied) return
$this->cookie_security; }
+ public function cookieLanguage() { if ($this->applied) return
$this->cookie_language; }
public function limitUserNameMin() { return $this->limit_username_min; }
public function limitUserNameMax() { return $this->limit_username_max; }
@@ -130,6 +134,8 @@
public function siteLanguage() { if ($this->applied) return $this->site_language;
}
public function siteTimezone(){ if ($this->applied) return $this->site_timezone;
}
+ public function multiLanguage(){ if ($this->applied) return
$this->multi_language; }
+
public function pathGenerated() { if ($this->applied) return
$this->path_generated; }
public function pathGenerationCache() { if ($this->applied) return
$this->path_generation_cache; }
public function pathRosCMS() { if ($this->applied) return $this->path_roscms; }
@@ -173,6 +179,11 @@
else die('bad security login cookie name');
}
+ public function setCookieLanguage( $new_value ) {
+ if (preg_match('/[A-Za-z0-9_]+/', $new_value))
$this->config['cookie_language'] = $new_value;
+ else die('bad language login cookie name');
+ }
+
public function setSiteName( $new_value ) {
$this->config['site_name'] = $new_value;
}
@@ -201,6 +212,10 @@
$this->config['path_instance'] = $new_value;
}
+ public function setMultiLanguage( $new_value ) {
+ $this->config['multi_language'] = $new_value;
+ }
+
} // end of RosCMS
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewUserDe…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewUserDe…
[iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/backend/Backend_ViewUserDe…
[iso-8859-1] Thu Feb 19 10:10:56 2009
@@ -125,21 +125,33 @@
// add membership button
echo_strip('</select>
- <button name="addmemb" id="addmemb"
onclick="'."addMembership(".$_GET['user'].",
document.getElementById('cbmmemb').value)".'">Add
Membership</button>
- <br />
- <br />
- <select id="cbmusrlang" name="cbmusrlang">');
+ <button name="addmemb" id="addmemb"
onclick="'."addMembership(".$_GET['user'].",
document.getElementById('cbmmemb').value)".'">Add
Membership</button>');
+
+ if (RosCMS::getInstance()->multiLanguage()) {
+ echo_strip('
+ <br />
+ <br />
+ <select id="cbmusrlang" name="cbmusrlang">');
- // show available languages, the user can changed to
- $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." ORDER BY name ASC");
- $stmt->execute();
- while ($lang = $stmt->fetch(PDO::FETCH_ASSOC)) {
- echo '<option
value="'.$lang['id'].'"'.($lang['id'] ==
$user['lang_id'] ? ' selected="selected"' :
'').'>'.$lang['name'].'</option>';
+ // show available languages, the user can changed to
+ if ($thisuser->hasAccess('more_lang')) {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." ORDER BY name ASC");
+ }
+ else {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE id IN(:standard_lang, :lang_id) ORDER BY name
ASC");
+
$stmt->bindParam('standard_lang',Language::getStandardId(),PDO::PARAM_INT);
+
$stmt->bindParam('lang_id',$thisuser->language(),PDO::PARAM_INT);
+
+ }
+ $stmt->execute();
+ while ($lang = $stmt->fetch(PDO::FETCH_ASSOC)) {
+ echo '<option
value="'.$lang['id'].'"'.($lang['id'] ==
$user['lang_id'] ? ' selected="selected"' :
'').'>'.$lang['name'].'</option>';
+ }
+
+ // change language button
+ echo_strip('</select>
+ <input type="button" name="addusrlang"
id="addusrlang" value="Update User language"
onclick="'."updateUserLang(".$_GET['user'].",
document.getElementById('cbmusrlang').value)".'" /><br
/>');
}
-
- // change language button
- echo_strip('</select>
- <input type="button" name="addusrlang"
id="addusrlang" value="Update User language"
onclick="'."updateUserLang(".$_GET['user'].",
document.getElementById('cbmusrlang').value)".'" /><br
/>');
}
// show interface to add translators
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Language.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Language.class.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/om/Language.class.php [iso-8859-1]
Thu Feb 19 10:10:56 2009
@@ -17,15 +17,17 @@
*/
public static function validate( $lang_code )
{
- // check for valid code
- $stmt=&DBConnection::getInstance()->prepare("SELECT name_short FROM
".ROSCMST_LANGUAGES." WHERE name_short=:code");
- $stmt->bindParam('code',$lang_code,PDO::PARAM_STR);
- $stmt->execute();
- $valid=$stmt->fetchColumn();
-
- // if we have a result, thats a valid code
- if ($valid !== false) {
- return $valid;
+ if (RosCMS::getInstance()->multiLanguage()) {
+ // check for valid code
+ $stmt=&DBConnection::getInstance()->prepare("SELECT name_short FROM
".ROSCMST_LANGUAGES." WHERE name_short=:code");
+ $stmt->bindParam('code',$lang_code,PDO::PARAM_STR);
+ $stmt->execute();
+ $valid=$stmt->fetchColumn();
+
+ // if we have a result, thats a valid code
+ if ($valid !== false) {
+ return $valid;
+ }
}
return RosCMS::getInstance()->siteLanguage();
} // end of member function validate
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/om/ThisUser.class.php
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/om/ThisUser.class.php [iso-8859-1]
(original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/om/ThisUser.class.php [iso-8859-1]
Thu Feb 19 10:10:56 2009
@@ -46,7 +46,9 @@
*/
public function addAccess( $access_area )
{
- $this->access[$access_area] = true;
+ if ($access_area != 'more_lang' || RosCMS::getInstance()->multiLanguage())
{
+ $this->access[$access_area] = true;
+ }
} // end of member function addAccess
@@ -105,7 +107,10 @@
*/
public function language( )
{
- return (int)$this->user['language'];
+ if (RosCMS::getInstance()->multiLanguage()) {
+ return (int)$this->user['language'];
+ }
+ return Language::getStandardId();
} // end of member function language
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
[iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Maintain.cla…
[iso-8859-1] Thu Feb 19 10:10:56 2009
@@ -111,7 +111,7 @@
<div id="lmGroups" class="lmItemTop"
onclick="loadGroups()"'.(!$thisuser->hasAccess('admin') ? '
style="display: none;"' : '').'>
<div class="lmItemBottom">Groups</div>
</div>
- <div id="lmLanguages" class="lmItemTop"
onclick="loadLanguages()"'.(!$thisuser->hasAccess('admin') ?
' style="display: none;"' : '').'>
+ <div id="lmLanguages" class="lmItemTop"
onclick="loadLanguages()"'.(!$thisuser->hasAccess('admin') ||
!RosCMS::getInstance()->multiLanguage() ? ' style="display: none;"' :
'').'>
<div class="lmItemBottom">Languages</div>
</div>
@@ -205,7 +205,14 @@
<select id="txtaddentrylang"
name="txtaddentrylang">');
// display languages
- $stmt=&DBConnection::getInstance()->prepare("SELECT id, name
FROM ".ROSCMST_LANGUAGES." WHERE level > 0 ORDER BY name ASC");
+ if ($thisuser->hasAccess('more_lang')) {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name
FROM ".ROSCMST_LANGUAGES." ORDER BY name ASC");
+ }
+ else {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name
FROM ".ROSCMST_LANGUAGES." WHERE id IN(:standard_lang,:lang_id) ORDER BY name
ASC");
+
$stmt->bindParam('standard_lang',Language::getStandardId(),PDO::PARAM_INT);
+
$stmt->bindParam('lang_id',$thisuser->language(),PDO::PARAM_INT);
+ }
$stmt->execute();
while ($language=$stmt->fetch(PDO::FETCH_ASSOC)) {
echo '<option
value="'.$language['id'].'"'.($language['id']==Language::getStandardId()
? ' selected="selected"' :
'').'>'.$language['name'].'</option>';
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
==============================================================================
---
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
[iso-8859-1] (original)
+++
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_CMS_Website.clas…
[iso-8859-1] Thu Feb 19 10:10:56 2009
@@ -105,22 +105,11 @@
roscms_access['dont_hide_filter'] =
".($thisuser->hasAccess('dont_hide_filter') ? 'true' :
'false').";
roscms_access['make_stable'] =
".($thisuser->hasAccess('make_stable') ? 'true' :
'false').";
roscms_access['del_entry'] =
".($thisuser->hasAccess('del_entry') ? 'true' :
'false').";
+ roscms_access['del_entry'] =
".($thisuser->hasAccess('del_entry') ? 'true' :
'false').";
// favorite user language
- ";
-
- // set user language for js
- $user_lang = $thisuser->language();
- if (!empty($user_lang)) {
- echo "var userlang = '".$user_lang."';";
- }
- else {
- echo "var userlang = roscms_standard_language;";
- }
-
- echo "
-
-
+ var userlang = ".$thisuser->language().";
+
var exitmsg = ".'"Click Cancel to continue with RosCMS, click OK to
leave RosCMS.\n\nThanks for using RosCMS!"'."
-->
</script>";echo_strip('
@@ -158,7 +147,7 @@
<div id="smenutab2" class="lmItemTop"
onclick="loadMenu(this.id)">
<div id="smenutabc2"
class="lmItemBottom">Pending</div>
</div>
- <div id="smenutab7" class="lmItemTop"
onclick="loadMenu(this.id)">
+ <div id="smenutab7" class="lmItemTop"
onclick="loadMenu(this.id)"'.($thisuser->language() ==
Language::getStandardId() ? ' style="display:none;"' :
'').'>
<div id="smenutabc7"
class="lmItemBottom">Translate</div>
</div>
<div id="smenutab8" class="lmItemTopSelected"
onclick="loadMenu(this.id)">
@@ -229,34 +218,40 @@
<span
class="virtualButton"
onclick="'."addUserFilter(filtstring2)".'"><img
src="'.RosCMS::getInstance()->pathRosCMS().'images/save.gif"
alt="" style="width:14px; height:14px;"
/> Save</span>
</div>
</div>
- </div>
+ </div>');
+
+ if (RosCMS::getInstance()->multiLanguage()) {
+ echo_strip('
<div style="position: absolute; top: 9px; right: 13px;
text-align:right; white-space: nowrap;">
<label for="favlangopt" style="float:left;color:
#666;">Working language:</label><br />
<select name="favlangopt" id="favlangopt"
style="vertical-align: top; width: 22ex;"
onchange="setLang(this.value)">');
- // preselect current user language
- if ($thisuser->hasAccess('more_lang')) {
- $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE level > 0 ORDER BY name ASC");
+ // preselect current user language
+ if ($thisuser->hasAccess('more_lang') ) {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE level > 0 ORDER BY name ASC");
+ }
+ else {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE id IN(:lang_id,:standard_lang)");
+ $stmt->bindParam('lang_id',$thisuser->language(),PDO::PARAM_INT);
+
$stmt->bindParam('standard_lang',Language::getStandardId(),PDO::PARAM_INT);
+ }
+ $stmt->execute();
+ while($language=$stmt->fetch()) {
+ echo '<option value="'.$language['id'].'"';
+
+ if ($language['id'] == $thisuser->language()) {
+ echo ' selected="selected"';
+ }
+
+ echo '>'.$language['name'].'</option>';
+ }
+
+ echo_strip('
+ </select>
+ </div>');
}
- else {
- $stmt=&DBConnection::getInstance()->prepare("SELECT id, name FROM
".ROSCMST_LANGUAGES." WHERE id IN(:lang_id,:standard_lang)");
- $stmt->bindParam('lang_id',$thisuser->language(),PDO::PARAM_INT);
-
$stmt->bindParam('standard_lang',Language::getStandardId(),PDO::PARAM_INT);
- }
- $stmt->execute();
- while($language=$stmt->fetch()) {
- echo '<option value="'.$language['id'].'"';
-
- if ($language['id'] == $user_lang) {
- echo ' selected="selected"';
- }
-
- echo '>'.$language['name'].'</option>';
- }
echo_strip('
- </select>
- </div>
<div style="float: right; white-space: nowrap;padding-top:
1em;">
<span id="mtblnav"> </span>
</div>