[Mapbender-commits] r2753 - in branches/dev_lenkne/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Aug 7 17:44:17 EDT 2008


Author: lenkne
Date: 2008-08-07 17:44:17 -0400 (Thu, 07 Aug 2008)
New Revision: 2753

Added:
   branches/dev_lenkne/http/classes/class_mb_html.php
Modified:
   branches/dev_lenkne/http/classes/class_locale.php
   branches/dev_lenkne/http/php/mod_adminEditFilteredUser.php
Log:


Modified: branches/dev_lenkne/http/classes/class_locale.php
===================================================================
--- branches/dev_lenkne/http/classes/class_locale.php	2008-08-07 13:15:54 UTC (rev 2752)
+++ branches/dev_lenkne/http/classes/class_locale.php	2008-08-07 21:44:17 UTC (rev 2753)
@@ -1,216 +1,223 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/class_locale.php
-# Copyright (C) 2002 CCGIS 
-#
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-
-/**
- * sets the locale, depending on various settings:
- * 1) a language ID passed to the constructor
- * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
- * 3) a default language ID
- * 
- */
-class Mb_locale {
-	var $knownLanguages = null;
-	var $systemLocales = null;
-	var $browserLanguages = null;
-	var $os = null;
-	var $name = null;
-	var $defaultLanguage = "en";
-	var $status = "No locale set.";
-	
-	function Mb_locale($languageId) {
-		if (!$languageId) {
-			$languageId = LANGUAGE;
-		}
-  		$e = new Mb_notice("class_locale: setting locale to " . $languageId);
-		if (USE_I18N) {
-			if (!$this->setCurrentLocale($languageId)) {
-				$e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
-			}
-		}
-		else {
-			$this->setCurrentLocale($this->defaultLanguage);
-		}
-	}
-
-	/**
-	 * Get the current locale, evaluating GET/POST variables, browser languages
-	 * and a default locale (in that preference)
-	 *
-	 * @returns current locale
-	 */
-	function setCurrentLocale($languageId) {
-
-	  	// try to set the locale to $languageId
-		if ($this->checkAndSetLocale($languageId)) {
-			return true;
-	  	}
-	  	else {
-	  		$e = new Mb_notice("class_locale: no input parameter specified.");
-	  	}
-
-		// determine the browser setting and try to set locale according to that
-		if ($this->browserLanguage == null) {
-			$this->setBrowserLanguages();
-		}		
-		foreach ($this->browserLanguages as $lang) {
-			$e = new Mb_notice("trying browser setting " . $lang);
-			if ($this->checkAndSetLocale($lang)) {
-				return true;
-			}
-		}	
-		
-		// set to default language
-		$e = new Mb_notice("trying default language " . $this->defaultLanguage);
-		return $this->checkAndSetLocale($this->defaultLanguage);
-	}
-	
-	/**
-	 * checks if a locale is available; if yes, it is set via setlocale
-	 * 
-	 * @returns true if the the locale is set successfully; otherwise false
-	 */
-	function checkAndSetLocale($languageId) {
-		if ($this->os == null) {
-			$this->os = $this->guessHostOS();
-		}
-		
-		if (!USE_I18N || ($this->os != null && isset($languageId))) {
-			if ($this->isKnownLanguage($languageId)) {
-				
-				if ($this->systemLocales == null) {
-					$this->setSystemLocales();					
-				}
-				
-				$locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];				
-				$selectedLocale = setlocale(LC_MESSAGES, $locale);
-				if ($selectedLocale) {
-					$this->name = $selectedLocale;
-					$_SESSION["mb_lang"] = $languageId;
-					$_SESSION["mb_locale"] = $this->name;
-					$e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
-					// from http://de3.php.net/manual/de/function.gettext.php
-					$path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
-					$enc = bind_textdomain_codeset("Mapbender", "UTF-8");
-					$dom = textdomain("Mapbender");
-					return true;
-				}
-			}
-		}
-		$e = new Mb_notice("locale " . $locale . " not found.");
-		return false;
-	}
-	
-	/**
-	 * Guess the operating system which on which this code is running
-	 * multiple methods are tested for reliably guessing the os
-	 * 
-	 * @private
-	 * @returns string with os name
-	 */
-	function guessHostOS(){
-	  if (strncasecmp(php_uname(), 'Windows', 7) == 0)
-	    return 'windows';
-	  else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
-	    return 'linux';
-	  else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
-	    return 'bsd';
-	  else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
-	    return 'bsd';  
-	  else {
-	    $e = new mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
-	    return null;
-	  }
-	}
-
-	/**
-	 * checks if a language is supported
-	 * 
-	 * @returns true if the language is supported; otherwise false
-	 */
-	function isKnownLanguage($languageId) {
-		if ($this->knownLocales == null) {
-			$this->setKnownLanguages();
-		}
-		if (array_key_exists($languageId, $this->knownLanguages)) {
-			return true;
-		}
-		else {
-			$e = new Mb_notice("language " . $languageId . " not supported.");
-		}	
-		return false; 
-	}
-	
-
-
-	/**
-	 * determines the available Locales on this system
-	 */
-	function setSystemLocales() {
-		$this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
-	                                'windows' => 'Italian_Italy.1252',
-	                                'bsd' => 'it_IT',
-	                                'posix' => 'it_IT');
-		$this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
-	                                'windows' => 'German_Germany.1252',
-	                                'bsd' => 'de_DE',
-	                                'posix' => 'it_IT');
-		$this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
-	                                'windows' => 'English_United States.1252',
-	                                'bsd' => 'en_US',
-	                                'posix' => 'it_IT');
-	}
-	
-	/**
-	 * set the known languages
-	 */
-	function setKnownLanguages() {
-		$this->knownLanguages = array('en_US' => 'en_US',
-                      'en' => 'en_US',
-                      'de_DE' => 'de_DE',
-                      'de' => 'de_DE',
-                      'bg_BG' => 'bg_BG',
-                      'bg' => 'bg_BG',
-                      'es_ES' => 'es_ES',
-                      'es' => 'es_ES',  
-                      'nl_NL' => 'nl_NL',
-                      'nl' => 'nl_NL',                                                                
-                      'gr_GR' => 'gr_GR',
-                      'gr' => 'gr_GR',
-                      'it_IT' => 'it_IT',
-                      'it' => 'it_IT');
-	}
-	
-	/**
-	 * sets the languages accepted by the client browser
-	 */
-	function setBrowserLanguages () {
-		$this->browserLanguages = array();
-		
-	    $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
-	    foreach ($bLangs as $lang) {
-			if (strpos($lang, ';') === false)
-				array_push($this->browserLanguages, $lang);
-			else
-				array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
-	    }		
-	}
-}
-?>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/class_locale.php
+# Copyright (C) 2002 CCGIS 
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+
+/**
+ * sets the locale, depending on various settings:
+ * 1) a language ID passed to the constructor
+ * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
+ * 3) a default language ID
+ * 
+ */
+
+class Mb_locale {
+	var $knownLanguages = null;
+	var $systemLocales = null;
+	var $browserLanguages = null;
+	var $os = null;
+	var $name = null;
+	var $defaultLanguage = "en";
+	var $status = "No locale set.";
+	
+	function Mb_locale($languageId) {
+		if (!$languageId) {
+			$languageId = LANGUAGE;
+		}
+  		$e = new Mb_notice("class_locale in MB_locale**: setting locale to " . $languageId);
+		if (USE_I18N) {
+			if (!$this->setCurrentLocale($languageId)) {
+				$e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
+			}
+		}
+		else {
+			$this->setCurrentLocale($this->defaultLanguage);
+				$e = new Mb_notice("Cats");
+		}
+	}
+
+	/**
+	 * Get the current locale, evaluating GET/POST variables, browser languages
+	 * and a default locale (in that preference)
+	 *
+	 * @returns current locale
+	 */
+	function setCurrentLocale($languageId) {
+				$e = new Mb_notice("Cats are smelly" . $this->checkAndSetLocale($languageId));
+
+	  	// try to set the locale to $languageId
+		if ($this->checkAndSetLocale($languageId)) {
+			return true;
+	  	}
+	  	else {
+	  		$e = new Mb_notice("class_locale: no input parameter specified.");
+	  	}
+
+		// determine the browser setting and try to set locale according to that
+		if ($this->browserLanguage == null) {
+			$this->setBrowserLanguages();
+		}		
+		foreach ($this->browserLanguages as $lang) {
+			$e = new Mb_notice("trying browser setting " . $lang);
+			if ($this->checkAndSetLocale($lang)) {
+				return true;
+			}
+		}	
+		
+		// set to default language
+		$e = new Mb_notice("trying default language " . $this->defaultLanguage);
+		return $this->checkAndSetLocale($this->defaultLanguage);
+	}
+	
+	/**
+	 * checks if a locale is available; if yes, it is set via setlocale
+	 * 
+	 * @returns true if the the locale is set successfully; otherwise false
+	 */
+	function checkAndSetLocale($languageId) {
+		if ($this->os == null) {
+			$this->os = $this->guessHostOS();
+		}
+		
+		if (!USE_I18N || ($this->os != null && isset($languageId))) {
+			if ($this->isKnownLanguage($languageId)) {
+				
+				if ($this->systemLocales == null) {
+					$this->setSystemLocales();					
+				}
+				
+				$locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];	
+
+				$selectedLocale = setlocale(LC_MESSAGES, $locale);
+				if ($selectedLocale) {
+$e = new Mb_notice("selected lacale " . $selectedLocale);			
+
+					$this->name = $selectedLocale;
+					$_SESSION["mb_lang"] = $languageId;
+					$_SESSION["mb_locale"] = $this->name;
+					$e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
+					// from http://de3.php.net/manual/de/function.gettext.php
+					$path = bindtextdomain("Messages1", dirname(__FILE__)."/../../resources/locale/");
+					$e = new Mb_notice("path " . $path);
+					$enc = bind_textdomain_codeset("Messages1", "UTF-8");
+					$dom = textdomain("Messages1");
+					return true;
+				}
+			}
+		}
+		$e = new Mb_notice("locale " . $locale . " not found.");
+		return false;
+	}
+	
+	/**
+	 * Guess the operating system which on which this code is running
+	 * multiple methods are tested for reliably guessing the os
+	 * 
+	 * @private
+	 * @returns string with os name
+	 */
+	function guessHostOS(){
+	  if (strncasecmp(php_uname(), 'Windows', 7) == 0)
+	    return 'windows';
+	  else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
+	    return 'linux';
+	  else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
+	    return 'bsd';
+	  else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
+	    return 'bsd';  
+	  else {
+	    $e = new mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
+	    return null;
+	  }
+	}
+
+	/**
+	 * checks if a language is supported
+	 * 
+	 * @returns true if the language is supported; otherwise false
+	 */
+	function isKnownLanguage($languageId) {
+		if ($this->knownLocales == null) {
+			$this->setKnownLanguages();
+		}
+		if (array_key_exists($languageId, $this->knownLanguages)) {
+			return true;
+		}
+		else {
+			$e = new Mb_notice("language " . $languageId . " not supported.");
+		}	
+		return false; 
+	}
+	
+
+
+	/**
+	 * determines the available Locales on this system
+	 */
+	function setSystemLocales() {
+		$this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
+	                                'windows' => 'Italian_Italy.1252',
+	                                'bsd' => 'it_IT',
+	                                'posix' => 'it_IT');
+		$this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
+	                                'windows' => 'German_Germany.1252',
+	                                'bsd' => 'de_DE',
+	                                'posix' => 'it_IT');
+		$this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
+	                                'windows' => 'English_United States.1252',
+	                                'bsd' => 'en_US',
+	                                'posix' => 'it_IT');
+	}
+	
+	/**
+	 * set the known languages
+	 */
+	function setKnownLanguages() {
+		$this->knownLanguages = array('en_US' => 'en_US',
+                      'en' => 'en_US',
+                      'de_DE' => 'de_DE',
+                      'de' => 'de_DE',
+                      'bg_BG' => 'bg_BG',
+                      'bg' => 'bg_BG',
+                      'es_ES' => 'es_ES',
+                      'es' => 'es_ES',  
+                      'nl_NL' => 'nl_NL',
+                      'nl' => 'nl_NL',                                                                
+                      'gr_GR' => 'gr_GR',
+                      'gr' => 'gr_GR',
+                      'it_IT' => 'it_IT',
+                      'it' => 'it_IT');
+	}
+	
+	/**
+	 * sets the languages accepted by the client browser
+	 */
+	function setBrowserLanguages () {
+		$this->browserLanguages = array();
+		
+	    $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+	    foreach ($bLangs as $lang) {
+			if (strpos($lang, ';') === false)
+				array_push($this->browserLanguages, $lang);
+			else
+				array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
+	    }		
+	}
+}
+?>

Added: branches/dev_lenkne/http/classes/class_mb_html.php
===================================================================
--- branches/dev_lenkne/http/classes/class_mb_html.php	                        (rev 0)
+++ branches/dev_lenkne/http/classes/class_mb_html.php	2008-08-07 21:44:17 UTC (rev 2753)
@@ -0,0 +1,48 @@
+<?php
+
+class html {
+
+	function beginTag($type,$id,$custom) {
+		print "<" . $type . " id='" . $id . "' ";
+		print $custom . " > ";
+	}
+
+	function endTag($type) {
+		print "</" . $type .">";
+	}
+
+	function selfCloseTag($type,$id,$custom) {
+		print "<" . $type . " id='" . $id . "' ";
+		print $custom . " /> ";
+	}
+
+	function beginEndTag($type,$id,$someText,$custom) {
+		print "<" . $type . " id='" . $id . "' ";
+		print $custom . " > ";
+		print $someText . "</" . $type . "> ";
+	}
+
+	function createInput($type,$mb_column,$value,$custom) {
+		print "<input type='" . $type . "' ";
+		print "id='" . $mb_column . "' ";
+		print "name='" . $mb_column . "' ";
+		print "value='" . $value . "' ";
+		print $custom . " /> ";
+	}
+
+	function createLabel($mb_column,$label) {
+		print "<label for='" . $mb_column . "'>";
+		print $label;
+		print "</label>";
+	}
+
+	function beginForm($id,$method,$action,$custom) {
+		print "<form id='" . $id . "' ";
+		print "name='" . $id . "' ";
+		print "method='" . $method . "' ";
+		print "action='" . $action . "' ";
+		print $custom . " > ";
+	}
+
+}
+?>
\ No newline at end of file

Modified: branches/dev_lenkne/http/php/mod_adminEditFilteredUser.php
===================================================================
--- branches/dev_lenkne/http/php/mod_adminEditFilteredUser.php	2008-08-07 13:15:54 UTC (rev 2752)
+++ branches/dev_lenkne/http/php/mod_adminEditFilteredUser.php	2008-08-07 21:44:17 UTC (rev 2753)
@@ -20,8 +20,13 @@
 require_once(dirname(__FILE__)."/mb_validateSession.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_html.php");
 
+$e = new mb_notice("locale: " . $_SESSION["mb_locale"] . "; lang: " . $_SESSION["mb_lang"]);
+$e = new mb_notice(setlocale(LC_ALL, $_SESSION["mb_locale"]));
+
 $admin = new administration();
+$html = new html();
 $json = new Mapbender_JSON();
 $queryObj = $json->decode(stripslashes($_REQUEST['queryObj']));
 $resultObj = array();
@@ -47,7 +52,7 @@
 	}
 	else {
 		$resultObj["success"] = false;
-		$resultObj["message"] = "User information not found.";
+		$resultObj["message"] = _mb("User information not found.");
 	}
 
 break;
@@ -63,7 +68,7 @@
 	}
 	else {
 		$resultObj["success"] = false;
-		$resultObj["message"] = "User information not found.";
+		$resultObj["message"] = _mb("User information not found.");
 	}
 
 break;
@@ -79,7 +84,7 @@
 	}
 	else {
 		$resultObj["success"] = false;
-		$resultObj["message"] = "No matches found.";
+		$resultObj["message"] = _mb("No matches found.");
 	}
 
 break;
@@ -90,7 +95,7 @@
 
 	if($dbUserId != $queryObj->parameters->mb_user_id){
 		$resultObj["success"] = false;
-		$resultObj["message"] = "Username must be unique. Select a different name.";
+		$resultObj["message"] = _mb("Username must be unique. Select a different name.");
 	}
 	else{ 
 		$tableColumns = $admin->getTableColumns(mb_user,mb_user_id,$queryObj->parameters->mb_user_id);
@@ -131,11 +136,11 @@
 			$resultObj["success"] = true;
 			$resultObj["data"] = $admin->getAllUserColumns($queryObj->parameters->mb_user_id);
 			$resultObj["command"] = "refreshUser";
-			$resultObj["message"] = "User updated.";
+			$resultObj["message"] = _mb("User updated.");
 		}
 		else {
 			$resultObj["success"] = false;
-			$resultObj["message"] = "Error. User not updated.";
+			$resultObj["message"] = _mb("Error. User not updated.");
 		}
 	}
 break;
@@ -201,11 +206,11 @@
 			$resultObj["success"] = true;
 			$resultObj["data"] = $admin->getAllUserColumns($queryObj->parameters->mb_user_id);
 			$resultObj["command"] = "refreshUser";
-			$resultObj["message"] = "User created.";
+			$resultObj["message"] = _mb("User created.");
 		}
 		else {
 			$resultObj["success"] = false;
-			$resultObj["message"] = "Error. User not created.";
+			$resultObj["message"] = _mb("Error. User not created.");
 		}
 	}
 break;
@@ -217,11 +222,11 @@
 		$resultObj["success"] = true;
 		$resultObj["data"] = $result;
 		$resultObj["command"] = "refreshUser";
-		$resultObj["message"] = "User Deleted.";
+		$resultObj["message"] = _mb("User Deleted.");
 	}
 	else {
 		$resultObj["success"] = false;
-		$resultObj["message"] = "Error. User not deleted.";
+		$resultObj["message"] = _mb("Error. User not deleted.");
 	}
 
 break;
@@ -229,123 +234,124 @@
 default:
 
 header("Content-type: text/html;");
-?>
 
-<div id="main">
+$html->begintag("div","main");
+	$html->beginEndTag("h2","",_mb('Create or edit user'));
+	$html->beginForm("user","post");
+		$html->beginTag("fieldset");
+			$html->beginTag("p");
+				$html->createInput("button","insert",_mb('Create')," onclick='insertUser(\"mod_adminEditFilteredUser\")'");
+				$html->createInput("button","update",_mb('Update')," onclick='updateUser(\"mod_adminEditFilteredUser\")'");
+				$html->createInput("button","delete",_mb('Delete')," onclick='deleteUser(\"mod_adminEditFilteredUser\");loadAction(\"mod_adminEditFilteredUser\",this);showFilteredUsers(\"mod_adminEditFilteredUser\")'");
+				$html->createInput("button","cancel",_mb('Cancel')," onclick='loadAction(\"mod_adminEditFilteredUser\",this);showFilteredUsers(\"mod_adminEditFilteredUser\")'");
+			$html->endTag("p");
+		$html->endTag("Fieldset");
+		$html->beginTag("fieldset");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_id",_mb('User ID:'));
+				$html->createInput("text","mb_user_id","","disabled='disabled'");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_name",_mb('Name:'));
+				$html->createInput("text","mb_user_name");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_description",_mb('Description:'));
+				$html->createInput("text","mb_user_description");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_password",_mb('Password:'));
+				$html->createInput("password","mb_user_password");
+			$html->endTag("p");
+		$html->endTag("Fieldset");
+		$html->beginTag("fieldset","details","style=\"visibility:hidden\"");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_email",_mb('E-mail:'));
+				$html->createInput("text","mb_user_email");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_phone",_mb('Telephone:'));
+				$html->createInput("text","mb_user_phone");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_phone1",_mb('Alternate telephone:'));
+				$html->createInput("text","mb_user_phone1");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_facsimile",_mb('Fax:'));
+				$html->createInput("text","mb_user_facsimile");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_organisation_name",_mb('Organisation:'));
+				$html->createInput("text","mb_user_organisation_name");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_department",_mb('Department:'));
+				$html->createInput("text","mb_user_department");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_position_name",_mb('Position:'));
+				$html->createInput("text","mb_user_position_name");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_delivery_point",_mb('Delivery point:'));
+				$html->createInput("text","mb_user_delivery_point");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_city",_mb('City:'));
+				$html->createInput("text","mb_user_city");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_postal_code",_mb('Postal code:'));
+				$html->createInput("text","mb_user_postal_code");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_country",_mb('Country:'));
+				$html->createInput("text","mb_user_country");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_online_resource",_mb('Web site:'));
+				$html->createInput("text","mb_user_online_resource");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_resolution",_mb('Resolution:'));
+				$html->createInput("text","mb_user_resolution");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_login_count",_mb('Login count:'));
+				$html->createInput("text","mb_user_login_count");
+			$html->endTag("p");
+			$html->beginTag("p");
+				$html->createLabel("mb_user_owner",_mb('Owner:'));
+				$html->createInput("text","mb_user_owner","31");
+			$html->endTag("p");
+		$html->endTag("Fieldset");
+	$html->endTag("form");
+$html->endtag("div");
 
-	<h2>Create or edit user</h2>
-	<form id="form" name="form" action="" method="post">
-	<fieldset>
-		<p>
-			<input type="button" id="insert" name="insert" value="Create" onclick="insertUser('mod_adminEditFilteredUser')" /> 
-			<input type="button" id="update" name="update" value="Update" onclick="updateUser('mod_adminEditFilteredUser')" /> 
-			<input type="button" id="delete" name="delete" value="Delete" onclick="deleteUser('mod_adminEditFilteredUser');loadAction('mod_adminEditFilteredUser',this);showFilteredUsers('mod_adminEditFilteredUser')" /> 
-			<input type="button" id="cancel" name="cancel" value="Cancel" onclick="loadAction('mod_adminEditFilteredUser',this);showFilteredUsers('mod_adminEditFilteredUser')" /> 
-		</p>
-	</fieldset>
+$html->begintag("div","options");
+	$html->beginEndTag("h2","",_mb('Current users'));
+	$html->beginEndTag("h3","",_mb('Search by name'));
+		$html->beginTag("p");
+			$html->createInput("text","searchText","","style=\"width:110\"");
+			$html->createInput("button","search",_mb('Filter')," onclick='searchUsers(\"mod_adminEditFilteredUser\")'");
+			$html->createInput("button","allUsers",_mb('All Users')," onclick='showFilteredUsers(\"mod_adminEditFilteredUser\")'");
+		$html->endTag("p");
 
-	<fieldset>
-		<p>
-			<label for="mb_user_id">User ID:</label> 
-			<input type="text" id="mb_user_id" name="mb_user_id" value="" disabled="disabled" /> 
-		</p>
-		<p>
-			<label for="mb_user_name">Name:</label> 
-			<input type="text" id="mb_user_name" name="mb_user_name" value=""  /> 
-		</p>
-		<p>
-			<label for="mb_user_description">Description:</label> 
-			<input type="text" id="mb_user_description" name="mb_user_description" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_password">Password:</label> 
-			<input type="password" id="mb_user_password" name="mb_user_password" value="" /> 
-		</p>
+	$html->begintag("div","usersList");
+	$html->endtag("div");
 
-	</fieldset>
+	$html->selfCloseTag("br");
+	$html->selfCloseTag("br");
+	$html->beginEndTag("h2","",_mb('Options'));
 
-	<fieldset id="details" style="visibility:hidden">
-		<p>
-			<label for="mb_user_email">E-mail:</label> 
-			<input type="text" id="mb_user_email" name="mb_user_email" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_phone">Phone:</label> 
-			<input type="text" id="mb_user_phone" name="mb_user_phone" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_phone1">Phone 1:</label> 
-			<input type="text" id="mb_user_phone1" name="mb_user_phone1" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_facsimile">Facsimile:</label> 
-			<input type="text" id="mb_user_facsimile" name="mb_user_facsimile" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_organization">Organization:</label> 
-			<input type="text" id="mb_user_organisation_name" name="mb_user_organisation_name" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_department">Department:</label> 
-			<input type="text" id="mb_user_department" name="mb_user_department" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_position_name">Position:</label> 
-			<input type="text" id="mb_user_position_name" name="mb_user_position_name" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_delivery_point">Delivery point:</label> 
-			<input type="text" id="mb_user_delivery_point" name="mb_user_delivery_point" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_city">City:</label> 
-			<input type="text" id="mb_user_city" name="mb_user_city" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_postal_code">Postal code:</label> 
-			<input type="text" id="mb_user_postal_code" name="mb_user_postal_code" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_country">Country:</label> 
-			<input type="text" id="mb_user_country" name="mb_user_country" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_online_resource">Web site:</label> 
-			<input type="text" id="mb_user_online_resource" name="mb_user_online_resource" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_resolution">Resolution:</label> 
-			<input type="text" id="mb_user_resolution" name="mb_user_resolution" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_login_count">Login count:</label> 
-			<input type="text" id="mb_user_login_count" name="mb_user_login_count" value="" /> 
-		</p>
-		<p>
-			<label for="mb_user_owner">Owner:</label> 
-			<input type="text" id="mb_user_owner" name="mb_user_owner" value="31" /> 
-		</p>
-	</fieldset>
-	</form>
-</div>
+	$html->createInput("button","showDetails",_mb('Details')," onclick=\"switchVisibility('details');activeButton(this)\" class='optionButton'");
+	$html->selfCloseTag("br");
+	$html->createInput("button","manageGroups",_mb('Groups')," onclick=\"\" class='optionButton'");
+	$html->selfCloseTag("br");
+	$html->createInput("button","manageApps",_mb('Applications')," onclick=\"\" class='optionButton'");
+$html->endtag("div");
 
-<div id="options">
-<h2>Current users</h2>
-
-<h3>Search by name</h3>
-<input type="text" id="searchText" name="searchText" value="" style="width:110" /> 
-<input type="button" id="search" name="search" value="Filter" onclick="searchUsers('mod_adminEditFilteredUser')" />
-<input type="button" id="allUsers" name="allUsers" value="All Users" onclick="showFilteredUsers('mod_adminEditFilteredUser')" />
-<div id="usersList"></div>
-
-<br><br><h2>Options</h2>
-<input type="button" id="showDetails" name="showDetails" value="Details" class="optionButton" onclick="switchVisibility('details');activeButton(this)" /><br>
-<input type="button" id="manageGroups" name="manageGroups" value="Groups" class="optionButton" onclick="" /><br>
-<input type="button" id="manageApps" name="manageApps" value="Applications" class="optionButton" onclick="" />
-
-</div>
-<?php
-
 break; //for default case
 } // end switch
 



More information about the Mapbender_commits mailing list