summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINOPIAE <inopiae@cacert.org>2013-09-13 21:38:35 +0200
committerINOPIAE <inopiae@cacert.org>2013-09-13 21:38:35 +0200
commit8e8c6bdaddeadfbc80baed0d2b4701d776d588a1 (patch)
tree441e39f44528714df036f5de6c59ac32f10aa9ee
parentc02d3f05bf9d74b2f9afc132eaf23e34c4630ffe (diff)
downloadcacert-devel-8e8c6bdaddeadfbc80baed0d2b4701d776d588a1.tar.gz
cacert-devel-8e8c6bdaddeadfbc80baed0d2b4701d776d588a1.tar.xz
cacert-devel-8e8c6bdaddeadfbc80baed0d2b4701d776d588a1.zip
bug 988: added function to build the TTP country dropdown from an ini file
-rw-r--r--includes/notary.inc.php26
-rw-r--r--pages/wot/4.php7
2 files changed, 29 insertions, 4 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index 2ed3683..c2fd979 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -1113,3 +1113,29 @@
function check_date_difference($date, $diff=1){
return (strtotime($date)<=time()+$diff*86400);
}
+
+ /**
+ * ttp_select()
+ * fills dropdown option for TTP countrues
+ * @param string $value, TRUE if the TTP CAP form is to be selected
+ * @param string $selection, if selection matches option key the
+ * entry is preselected in the dropdownbox
+ * @return
+ */
+ function ttp_select($value='', $selection=''){
+ $ttpcountrys = parse_ini_file('../config/ttp.ini');
+ ksort($ttpcountrys);
+ $return_str='';
+ foreach ($ttpcountrys as $ttpcountry => $form) {
+ $return_str.='<option ';
+ if (true==$value) {
+ $return_str.='value="'.$form.'" ';
+ }
+ if ($ttpcountry==$selection){
+ $return_str.='selected="selected"';
+ }
+ $return_str.=' >'.$ttpcountry.'</option>';
+ }
+
+ return $return_str;
+ }
diff --git a/pages/wot/4.php b/pages/wot/4.php
index 628e6a5..20521a9 100644
--- a/pages/wot/4.php
+++ b/pages/wot/4.php
@@ -45,9 +45,8 @@ if ($_SESSION['profile']['points']<100){
<tr>
<td class="DataTD"><?=_("Country where you want to visit the TTP")?></td>
<td class="DataTD"><select size="1" name="country">
- <option>Australia</option>
- <option>Puerto Rico</option>
- <option>USA</option>
+ <option><?=_('Choose country')?></option>
+ <?echo ttp_select(TRUE)?>
</select></td>
</tr>
<tr>
@@ -72,7 +71,7 @@ if ($_SESSION['profile']['points']<100){
</form>
*/
?>
- <p><?=_("We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 assurance points to 100 assurance points. Meanwhile you have to close this gap with face to face assurances from CAcert Assurers. Think not only travelling to populated countries, but as well to assurers visiting your country or area.")?></p>
+ <p><?=_("We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 assurance points to 100 assurance points. Meanwhile you have to close this gap with face to face assurances from CAcert Assurers. Think not only travelling to populated countries, but as well to assurers visiting your country or area.")?></p>
<?
}
} else {