diff options
author | Michael Tänzer <neo@nhng.de> | 2012-07-23 17:40:24 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2012-07-23 17:40:24 +0200 |
commit | e0f7339704f2e6045774301b0359be3502f4b486 (patch) | |
tree | b8560ed68f42b15585611bba78627740140a80d7 /includes | |
parent | 30ac5366838978bd685da21208974c83883cd9d6 (diff) | |
parent | fd4fbe21e9ef63c555469b595f7748fadfb977f4 (diff) | |
download | cacert-devel-e0f7339704f2e6045774301b0359be3502f4b486.tar.gz cacert-devel-e0f7339704f2e6045774301b0359be3502f4b486.tar.xz cacert-devel-e0f7339704f2e6045774301b0359be3502f4b486.zip |
Merge branch 'release' into bug-964
Diffstat (limited to 'includes')
-rw-r--r-- | includes/account.php | 20 | ||||
-rw-r--r-- | includes/general.php | 131 | ||||
-rw-r--r-- | includes/general_stuff.php | 4 | ||||
-rw-r--r-- | includes/lib/account.php | 10 | ||||
-rw-r--r-- | includes/lib/l10n.php | 343 | ||||
-rw-r--r-- | includes/loggedin.php | 13 | ||||
-rw-r--r-- | includes/wot.inc.php | 90 |
7 files changed, 466 insertions, 145 deletions
diff --git a/includes/account.php b/includes/account.php index 55c9f7a..72165df 100644 --- a/includes/account.php +++ b/includes/account.php @@ -16,6 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ require_once("../includes/loggedin.php"); + require_once("../includes/lib/l10n.php"); loadem("account"); @@ -2288,8 +2289,21 @@ $_SESSION['_config']['errmsg'] = sprintf(_("Wasn't able to match '%s' against any user in the system"), sanitizeHTML($_REQUEST['email'])); } else { $row = mysql_fetch_assoc($res); - mysql_query("insert into `org` set `memid`='".intval($row['id'])."', `orgid`='".intval($_SESSION['_config']['orgid'])."', - `masteracc`='$masteracc', `OU`='$OU', `comments`='$comments'"); + if ( !is_assurer(intval($row['id'])) ) + { + $id = $oldid;
+ $oldid=0;
+ $_SESSION['_config']['errmsg'] = + _("The user is not an Assurer yet"); + } else { + mysql_query( + "insert into `org` + set `memid`='".intval($row['id'])."', + `orgid`='".intval($_SESSION['_config']['orgid'])."', + `masteracc`='$masteracc', + `OU`='$OU', + `comments`='$comments'"); + } } } @@ -2351,7 +2365,7 @@ { csrf_check("mainlang"); $lang = mysql_real_escape_string($_REQUEST['lang']); - foreach($_SESSION['_config']['translations'] as $key => $val) + foreach(L10n::$translations as $key => $val) { if($key == $lang) { diff --git a/includes/general.php b/includes/general.php index 8481018..9e2b131 100644 --- a/includes/general.php +++ b/includes/general.php @@ -39,6 +39,7 @@ require_once($_SESSION['_config']['filepath']."/includes/mysql.php"); require_once($_SESSION['_config']['filepath'].'/includes/lib/account.php'); + require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php'); if(array_key_exists('HTTP_HOST',$_SERVER) && $_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] && @@ -70,122 +71,8 @@ } } - $lang = ""; - if(array_key_exists("lang",$_REQUEST)) - $lang=mysql_escape_string(substr(trim($_REQUEST['lang']), 0, 5)); - if($lang != "") - $_SESSION['_config']['language'] = $lang; - - //if($_SESSION['profile']['id'] == 1 && 1 == 2) - // echo $_SESSION['_config']['language']; - - $_SESSION['_config']['translations'] = array( - "ar_JO" => "العربية", - "bg_BG" => "Български", - "cs_CZ" => "Čeština", - "da_DK" => "Dansk", - "de_DE" => "Deutsch", - "el_GR" => "Ελληνικά", - "en_AU" => "English", - "eo_EO" => "Esperanto", - "es_ES" => "Español", - "fa_IR" => "Farsi", - "fi_FI" => "Suomi", - "fr_FR" => "Français", - "he_IL" => "עברית", - "hr_HR" => "Hrvatski", - "hu_HU" => "Magyar", - "is_IS" => "Íslenska", - "it_IT" => "Italiano", - "ja_JP" => "日本語", - "ka_GE" => "Georgian", - "nl_NL" => "Nederlands", - "pl_PL" => "Polski", - "pt_PT" => "Português", - "pt_BR" => "Português Brasileiro", - "ru_RU" => "Русский", - "ro_RO" => "Română", - "sv_SE" => "Svenska", - "tr_TR" => "Türkçe", - "zh_CN" => "中文(简体)"); - - $value=array(); - - if(!(array_key_exists('language',$_SESSION['_config']) && $_SESSION['_config']['language'] != "")) - { - $bits = explode(",", strtolower(str_replace(" ", "", mysql_real_escape_string(array_key_exists('HTTP_ACCEPT_LANGUAGE',$_SERVER)?$_SERVER['HTTP_ACCEPT_LANGUAGE']:"")))); - foreach($bits as $lang) - { - $b = explode(";", $lang); - if(count($b)>1 && substr($b[1], 0, 2) == "q=") - $c = floatval(substr($b[1], 2)); - else - $c = 1; - $value["$c"] = trim($b[0]); - } - - krsort($value); - - reset($value); - - foreach($value as $key => $val) - { - $val = substr(escapeshellarg($val), 1, -1); - $short = substr($val, 0, 2); - if($val == "en" || $short == "en") - { - $_SESSION['_config']['language'] = "en"; - break; - } - if(file_exists($_SESSION['_config']['filepath']."/locale/$val/LC_MESSAGES/messages.mo")) - { - $_SESSION['_config']['language'] = $val; - break; - } - if(file_exists($_SESSION['_config']['filepath']."/locale/$short/LC_MESSAGES/messages.mo")) - { - $_SESSION['_config']['language'] = $short; - break; - } - } - } - if(!array_key_exists('_config',$_SESSION) || !array_key_exists('language',$_SESSION['_config']) || strlen($_SESSION['_config']['language']) != 5) - { - $lang = array_key_exists('language',$_SESSION['_config'])?$_SESSION['_config']['language']:""; - $_SESSION['_config']['language'] = "en_AU"; - foreach($_SESSION['_config']['translations'] as $key => $val) - { - if(substr($lang, 0, 2) == substr($key, 0, 2)) - { - $_SESSION['_config']['language'] = $val; - break; - } - } - } - - $_SESSION['_config']['recode'] = "html..latin-1"; - if($_SESSION['_config']['language'] == "zh_CN") - { - $_SESSION['_config']['recode'] = "html..gb2312"; - } else if($_SESSION['_config']['language'] == "pl_PL" || $_SESSION['_config']['language'] == "hu_HU") { - $_SESSION['_config']['recode'] = "html..ISO-8859-2"; - } else if($_SESSION['_config']['language'] == "ja_JP") { - $_SESSION['_config']['recode'] = "html..SHIFT-JIS"; - } else if($_SESSION['_config']['language'] == "ru_RU") { - $_SESSION['_config']['recode'] = "html..ISO-8859-5"; - } else if($_SESSION['_config']['language'] == "lt_LT") { - $_SESSION['_config']['recode'] = "html..ISO-8859-13"; - } - - putenv("LANG=".$_SESSION['_config']['language']); - setlocale(LC_ALL, $_SESSION['_config']['language']); - $domain = 'messages'; - bindtextdomain($domain, $_SESSION['_config']['filepath']."/locale"); - textdomain($domain); - - //if($_SESSION['profile']['id'] == -1) - // echo $_SESSION['_config']['language']." - ".$_SESSION['_config']['filepath']."/locale"; - + L10n::detect_language(); + L10n::init_gettext(); if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0) { @@ -600,10 +487,6 @@ return(0); } - if($points >= 300) - return(200); - if($points >= 200) - return(150); if($points >= 150) return(35); if($points >= 140) @@ -632,14 +515,6 @@ return(utf8_decode($data)); } - function screenshot($img) - { - if(file_exists("../screenshots/".$_SESSION['_config']['language']."/$img")) - return("/screenshots/".$_SESSION['_config']['language']."/$img"); - else - return("/screenshots/en/$img"); - } - function signmail($to, $subject, $message, $from, $replyto = "") { if($replyto == "") diff --git a/includes/general_stuff.php b/includes/general_stuff.php index 80cd8a7..4c1bd30 100644 --- a/includes/general_stuff.php +++ b/includes/general_stuff.php @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php'); + if(!function_exists("showheader")) { function showbodycontent($title = "CAcert.org", $title2 = "") @@ -60,7 +62,7 @@ google_color_border = "FFFFFF"; <? include("about_menu.php"); ?> <div class="relatedLinks"> <h3 class="pointer" onclick="explode('trans')">+ <?=_("Translations")?></h3> - <ul class="menu" id="trans"><? foreach($_SESSION['_config']['translations'] as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&lang=<?=$key?>"><?=$val?></a></li><? } ?></ul> + <ul class="menu" id="trans"><? foreach(L10n::$translations as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&lang=<?=$key?>"><?=$val?></a></li><? } ?></ul> </div> <? if(array_key_exists('mconn',$_SESSION) && $_SESSION['mconn']) { ?> <div class="relatedLinks"> diff --git a/includes/lib/account.php b/includes/lib/account.php index f7a24fa..c7697ce 100644 --- a/includes/lib/account.php +++ b/includes/lib/account.php @@ -19,6 +19,8 @@ function fix_assurer_flag($userID) { + // If requirements for assurers are modified see also scripts/cron/updatesort.php + // Update Assurer-Flag on users table if 100 points. // Should the number of points be SUM(points) or SUM(awarded)? $query = mysql_query('UPDATE `users` AS `u` SET `assurer` = 1 WHERE '. @@ -29,11 +31,11 @@ function fix_assurer_flag($userID) '(SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` '. 'AND (`n`.`expire` > now() OR `n`.`expire` IS NULL)) >= 100'); // Challenge has been passed and non-expired points >= 100 - + if (!$query) { return false; } - + // Reset flag if requirements are not met $query = mysql_query('UPDATE `users` AS `u` SET `assurer` = 0 WHERE '. '`u`.`id` = \''.(int)intval($userID).'\' AND '. @@ -42,10 +44,10 @@ function fix_assurer_flag($userID) 'AND `cp`.`user_id` = `u`.`id`) OR '. '(SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` '. 'AND (`n`.`expire` > now() OR `n`.`expire` IS NULL)) < 100)'); - + if (!$query) { return false; } - + return true; }
\ No newline at end of file diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php new file mode 100644 index 0000000..85b7aff --- /dev/null +++ b/includes/lib/l10n.php @@ -0,0 +1,343 @@ +<?php /* + LibreSSL - CAcert web application + Copyright (C) 2004-2011 CAcert Inc. + + 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; version 2 of the License. + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * This class provides some functions for language handling + */ +class L10n { + /** + * These are tranlations we currently support. + * + * If another translation is added, it doesn't suffice to have gettext set + * up, you also need to add it here, because it acts as a white list. + * + * @var array("ISO-language code" => "native name of the language") + */ + public static $translations = array( + "ar" => "العربية", + "bg" => "Български", + "cs" => "Čeština", + "da" => "Dansk", + "de" => "Deutsch", + "el" => "Ελληνικά", + "en" => "English", + "es" => "Español", + "fi" => "Suomi", + "fr" => "Français", + "hu" => "Magyar", + "it" => "Italiano", + "ja" => "日本語", + "lv" => "Latviešu", + "nl" => "Nederlands", + "pl" => "Polski", + "pt" => "Português", + "pt-br" => "Português Brasileiro", + "ru" => "Русский", + "sv" => "Svenska", + "tr" => "Türkçe", + "zh-cn" => "中文(简体)", + "zh-tw" => "中文(臺灣)", + ); + + /** + * setlocale needs a language + region code for whatever reason so here's + * the mapping from a translation code to locales with the region that + * seemed the most common for this language + * + * You probably never need this. Use {@link set_translation()} to change the + * language instead of manually calling setlocale(). + * + * @var array(string => string) + */ + private static $locales = array( + "ar" => "ar_JO", + "bg" => "bg_BG", + "cs" => "cs_CZ", + "da" => "da_DK", + "de" => "de_DE", + "el" => "el_GR", + "en" => "en_US", + "es" => "es_ES", + "fa" => "fa_IR", + "fi" => "fi_FI", + "fr" => "fr_FR", + "he" => "he_IL", + "hr" => "hr_HR", + "hu" => "hu_HU", + "id" => "id_ID", + "is" => "is_IS", + "it" => "it_IT", + "ja" => "ja_JP", + "ka" => "ka_GE", + "ko" => "ko_KR", + "lv" => "lv_LV", + "nb" => "nb_NO", + "nl" => "nl_NL", + "pl" => "pl_PL", + "pt" => "pt_PT", + "pt-br" => "pt_BR", + "ro" => "ro_RO", + "ru" => "ru_RU", + "sl" => "sl_SI", + "sv" => "sv_SE", + "th" => "th_TH", + "tr" => "tr_TR", + "uk" => "uk_UA", + "zh-cn" => "zh_CN", + "zh-tw" => "zh_TW", + ); + + /** + * Auto-detects the language that should be used and sets it. Only works for + * HTTP, not in a command line script. + * + * Priority: + * <ol> + * <li>explicit parameter "lang" passed in HTTP (e.g. via GET)</li> + * <li>existing setting in the session (stick to the setting we had before) + * </li> + * <li>auto-detect via the HTTP Accept-Language header sent by the user + * agent</li> + * </ol> + */ + public static function detect_language() { + if ( (self::get_translation() != "") + // already set in the session? + && + !(array_key_exists("lang", $_REQUEST) && + trim($_REQUEST["lang"]) != "") + // explicit parameter? + ) + { + if ( self::set_translation(self::get_translation()) ) { + return; + } + } + + + $languages = array(); + + // parse Accept-Language header + if (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) { + $bits = explode(",", strtolower( + str_replace(" ", "", $_SERVER['HTTP_ACCEPT_LANGUAGE']) + )); + foreach($bits as $lang) + { + $b = explode(";", $lang); + if(count($b)>1 && substr($b[1], 0, 2) == "q=") + $c = floatval(substr($b[1], 2)); + else + $c = 1; + + if ($c != 0) + { + $languages[trim($b[0])] = $c; + } + } + } + + // check if there is an explicit language given as parameter + if(array_key_exists("lang",$_REQUEST) && trim($_REQUEST["lang"]) != "") + { + // higher priority than those values in the header + $languages[strtolower(trim($_REQUEST["lang"]))] = 2.0; + } + + arsort($languages, SORT_NUMERIC); + + // this is used to be compatible with browsers like internet + // explorer which only provide the language code including the + // region not without. Also handles the fallback to English (qvalues + // may only have three digits after the .) + $fallbacks = array("en" => 0.0005); + + foreach($languages as $lang => $qvalue) + { + // ignore any non-conforming values (that's why we don't need to + // mysql_real_escape() or escapeshellarg(), but take care of + // the '*') + // spec: ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" ) + if ( preg_match('/^(?:([a-zA-Z]{1,8})(?:-[a-zA-Z]{1,8})*|\*)$/', + $lang, $matches) !== 1 ) { + continue; + } + $lang_prefix = $matches[1]; // usually two-letter language code + $fallbacks[$lang_prefix] = $qvalue; + + $chosen_translation = ""; + if ($lang === '*') { + // According to the standard '*' matches anything but any + // language explicitly specified. So in theory if there + // was an explicit mention of "en" with a lower priority + // this would be incorrect, but that's too much trouble. + $chosen_translation = "en"; + } else { + $lang_length = strlen($lang); + foreach (self::$translations as $translation => $ignore) + { + // May match exactly or on every '-' + if ( $translation === $lang || + substr($translation, 0, $lang_length + 1) + === $lang.'-' + ) + { + $chosen_translation = $translation; + break; + } + } + } + + if ($chosen_translation !== "") + { + if (self::set_translation($chosen_translation)) { + return; + } + } + } + + // No translation found yet => try the prefixes + arsort($fallbacks, SORT_NUMERIC); + foreach ($fallbacks as $lang => $qvalue) { + if (self::set_translation($lang)) { + return; + } + } + + // should not get here, as the fallback of "en" is provided and that + // should always work => log an error + trigger_error("L10n::detect_language(): could not set language", + E_USER_WARNING); + } + + /** + * Get the set translation + * + * @return string + * a translation code or the empty string if not set + */ + public static function get_translation() { + if (array_key_exists('language', $_SESSION['_config'])) { + return $_SESSION['_config']['language']; + } else { + return ""; + } + } + + /** + * Set the translation to use. + * + * @param string $translation_code + * the translation code as specified in the keys of {@link $translations} + * + * @return bool + * <ul> + * <li>true if the translation has been set successfully</li> + * <li>false if the $translation_code was not contained in the white + * list or could not be set for other reasons (e.g. setlocale() + * failed because the locale has not been set up on the system - + * details will be logged)</li> + * </ul> + */ + public static function set_translation($translation_code) { + // check $translation_code against whitelist + if ( !array_key_exists($translation_code, self::$translations) ) { + // maybe it's a locale as previously used in the system? e.g. en_AU + if ( preg_match('/^([a-z][a-z])_([A-Z][A-Z])$/', $translation_code, + $matches) !== 1 ) { + return false; + } + + $lang_code = $matches[1]; + $region_code = strtolower($matches[2]); + + if ( array_key_exists("${lang_code}-${region_code}", + self::$translations) ) { + $translation_code = "${lang_code}-${region_code}"; + } elseif ( array_key_exists($lang_code, self::$translations) ) { + $translation_code = $lang_code; + } else { + return false; + } + } + + // map translation to locale + if ( !array_key_exists($translation_code, self::$locales) ) { + // weird. maybe you added a translation but haven't added a + // translation to locale mapping in self::locales? + trigger_error("L10n::set_translation(): could not map the ". + "translation $translation_code to a locale", E_USER_WARNING); + return false; + } + $locale = self::$locales[$translation_code]; + + // set up locale + if ( !putenv("LANG=$locale") ) { + trigger_error("L10n::set_translation(): could not set the ". + "environment variable LANG to $locale", E_USER_WARNING); + return false; + } + if ( !setlocale(LC_ALL, $locale) ) { + trigger_error("L10n::set_translation(): could not setlocale() ". + "LC_ALL to $locale", E_USER_WARNING); + return false; + } + + + // only set if we're running in a server not in a script + if (isset($_SESSION)) { + // save the setting + $_SESSION['_config']['language'] = $translation_code; + + + // Set up the recode settings needed e.g. in PDF creation + $_SESSION['_config']['recode'] = "html..latin-1"; + + if($translation_code === "zh-cn" || $translation_code === "zh-tw") + { + $_SESSION['_config']['recode'] = "html..gb2312"; + + } else if($translation_code === "pl" || $translation_code === "hu") { + $_SESSION['_config']['recode'] = "html..ISO-8859-2"; + + } else if($translation_code === "ja") { + $_SESSION['_config']['recode'] = "html..SHIFT-JIS"; + + } else if($translation_code === "ru") { + $_SESSION['_config']['recode'] = "html..ISO-8859-5"; + + } else if($translation_code == "lt") { // legacy, keep for reference + $_SESSION['_config']['recode'] = "html..ISO-8859-13"; + + } + } + + return true; + } + + /** + * Sets up the text domain used by gettext + * + * @param string $domain + * the gettext domain that should be used, defaults to "messages" + */ + public static function init_gettext($domain = 'messages') { + bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale'); + textdomain($domain); + } +}
\ No newline at end of file diff --git a/includes/loggedin.php b/includes/loggedin.php index bf6b455..5734fad 100644 --- a/includes/loggedin.php +++ b/includes/loggedin.php @@ -17,6 +17,7 @@ */ include_once("../includes/lib/general.php"); + require_once("../includes/lib/l10n.php"); if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] != 0) { @@ -110,18 +111,12 @@ if($_SESSION['profile']['language'] == "") { - $query = "update `users` set `language`='".$_SESSION['_config']['language']."' + $query = "update `users` set `language`='".L10n::get_translation()."' where `id`='".$_SESSION['profile']['id']."'"; mysql_query($query); } else { - $_SESSION['_config']['language'] = $_SESSION['profile']['language']; - - putenv("LANG=".$_SESSION['_config']['language']); - setlocale(LC_ALL, $_SESSION['_config']['language']); - - $domain = 'messages'; - bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale"); - textdomain("$domain"); + L10n::set_translation($_SESSION['profile']['language']); + L10n::init_gettext(); } } diff --git a/includes/wot.inc.php b/includes/wot.inc.php index 884b97f..edc442a 100644 --- a/includes/wot.inc.php +++ b/includes/wot.inc.php @@ -536,4 +536,94 @@ <p>[ <a href='javascript:history.go(-1)'><?=_("Go Back")?></a> ]</p> <? } + +// functions for 6.php (assure somebody) + +function AssureHead($confirmation,$checkname) +{ +?> +<form method="post" action="wot.php"> + <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="600"> + <tr> + <td colspan="2" class="title"><?=$confirmation?></td> + </tr> + <tr> + <td class="DataTD" colspan="2" align="left"><?=$checkname?></td> + </tr> +<? + } + +function AssureTextLine($field1,$field2) +{ +?> + <tr> + <td class="DataTD"><?=$field1?>:</td> + <td class="DataTD"><?=$field2?></td> + </tr> +<? +} + +function AssureCCABoxLine($type,$text) +{ + return; + AssureBoxLine($type,$text); +} + +function AssureBoxLine($type,$text,$checked) +{ ?> + <tr> + <td class="DataTD"><input type="checkbox" name="<?=$type?>" value="1" <?=$checked?"checked":""?>></td> + <td class="DataTD"><?=$text?></td> + </tr> +<? +} + +function AssureMethodLine($text,$methods,$remark) +{ + if (count($methods) != 1) + { +?> + <tr> + <td class="DataTD"><?=$text?></td> + <td class="DataTD"> + <select name="method"> +<? + foreach($methods as $val) { ?> + <option value="<?=$val?>"> <?=$val?></option> + +<? } ?> + </select> + </br><?=$remark?> + </td> + </tr> +<? + } else { +?> + <input type="hidden" name="<?=$val?>" value="<?=$methods[0]?>"> +<? + } +} + +function AssureInboxLine($type,$field,$value,$description) +{ +?> + <tr> + <td class="DataTD"><?=$field?>:</td> + <td class="DataTD"><input type="text" name="<?=$type?>" value="<?=$value?>"><?=$description?></td> + </tr> +<? +} + +function AssureFoot($oldid,$confirm) +{?> + <tr> + <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=$confirm?>"> <input type="submit" name="cancel" value="<?=_("Cancel")?>"></td> + </tr> + </table> + <input type="hidden" name="pagehash" value="<?=$_SESSION['_config']['wothash']?>"> + <input type="hidden" name="oldid" value="<?=$oldid?>"> +</form> +<? +} + |