phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc class.country.inc.php


From: Bettina Gille
Subject: [Phpgroupware-cvs] phpgwapi/inc class.country.inc.php
Date: Thu, 13 Apr 2006 22:40:15 +0000

CVSROOT:        /cvsroot/phpgwapi
Module name:    phpgwapi
Branch:         
Changes by:     Bettina Gille <address@hidden>  06/04/13 22:40:15

Modified files:
        inc            : class.country.inc.php 

Log message:
        xslt support

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/phpgwapi/inc/class.country.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: phpgwapi/inc/class.country.inc.php
diff -u phpgwapi/inc/class.country.inc.php:1.5 
phpgwapi/inc/class.country.inc.php:1.6
--- phpgwapi/inc/class.country.inc.php:1.5      Thu Dec 30 06:47:30 2004
+++ phpgwapi/inc/class.country.inc.php  Thu Apr 13 22:40:15 2006
@@ -3,11 +3,11 @@
        * Countries
        * @author Mark Peters <address@hidden>
        * @copyright Copyright (C) 2001 Mark Peters
-       * @copyright Portions Copyright (C) 2004 Free Software Foundation 
http://www.fsf.org/
+       * @copyright Portions Copyright (C) 2004-2006 Free Software Foundation 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage contacts
-       * @version $Id: class.country.inc.php,v 1.5 2004/12/30 06:47:30 skwashd 
Exp $
+       * @version $Id: class.country.inc.php,v 1.6 2006/04/13 22:40:15 ceb Exp 
$
        */
 
        /**
@@ -23,45 +23,45 @@
                function country()
                {
                        $this->country_array = array(
-                          '  '=>'Select One',
-                               'AF'=>'AFGHANISTAN', 
-                               'AL'=>'ALBANIA', 
-                               'DZ'=>'ALGERIA', 
-                               'AS'=>'AMERICAN SAMOA', 
-                               'AD'=>'ANDORRA', 
-                               'AO'=>'ANGOLA', 
-                               'AI'=>'ANGUILLA', 
-                               'AQ'=>'ANTARCTICA', 
-                               'AG'=>'ANTIGUA AND BARBUDA', 
-                               'AR'=>'ARGENTINA', 
-                               'AM'=>'ARMENIA', 
-                               'AW'=>'ARUBA', 
-                               'AU'=>'AUSTRALIA', 
-                               'AT'=>'AUSTRIA', 
-                               'AZ'=>'AZERBAIJAN', 
-                               'BS'=>'BAHAMAS', 
-                               'BH'=>'BAHRAIN', 
-                               'BD'=>'BANGLADESH', 
-                               'BB'=>'BARBADOS', 
-                               'BY'=>'BELARUS', 
-                               'BE'=>'BELGIUM', 
-                               'BZ'=>'BELIZE', 
-                               'BJ'=>'BENIN', 
-                               'BM'=>'BERMUDA', 
-                               'BT'=>'BHUTAN', 
-                               'BO'=>'BOLIVIA', 
-                               'BA'=>'BOSNIA AND HERZEGOVINA', 
-                               'BW'=>'BOTSWANA', 
-                               'BV'=>'BOUVET ISLAND', 
-                               'BR'=>'BRAZIL', 
-                               'IO'=>'BRITISH INDIAN OCEAN TERRITORY', 
-                               'BN'=>'BRUNEI DARUSSALAM', 
-                               'BG'=>'BULGARIA', 
-                               'BF'=>'BURKINA FASO', 
-                               'BI'=>'BURUNDI', 
-                               'KH'=>'CAMBODIA', 
-                               'CM'=>'CAMEROON', 
-                               'CA'=>'CANADA', 
+                               '  '=>'Select One',
+                               'AF'=>'AFGHANISTAN',
+                               'AL'=>'ALBANIA',
+                               'DZ'=>'ALGERIA',
+                               'AS'=>'AMERICAN SAMOA',
+                               'AD'=>'ANDORRA',
+                               'AO'=>'ANGOLA',
+                               'AI'=>'ANGUILLA',
+                               'AQ'=>'ANTARCTICA',
+                               'AG'=>'ANTIGUA AND BARBUDA',
+                               'AR'=>'ARGENTINA',
+                               'AM'=>'ARMENIA',
+                               'AW'=>'ARUBA',
+                               'AU'=>'AUSTRALIA',
+                               'AT'=>'AUSTRIA',
+                               'AZ'=>'AZERBAIJAN',
+                               'BS'=>'BAHAMAS',
+                               'BH'=>'BAHRAIN',
+                               'BD'=>'BANGLADESH',
+                               'BB'=>'BARBADOS',
+                               'BY'=>'BELARUS',
+                               'BE'=>'BELGIUM',
+                               'BZ'=>'BELIZE',
+                               'BJ'=>'BENIN',
+                               'BM'=>'BERMUDA',
+                               'BT'=>'BHUTAN',
+                               'BO'=>'BOLIVIA',
+                               'BA'=>'BOSNIA AND HERZEGOVINA',
+                               'BW'=>'BOTSWANA',
+                               'BV'=>'BOUVET ISLAND',
+                               'BR'=>'BRAZIL',
+                               'IO'=>'BRITISH INDIAN OCEAN TERRITORY',
+                               'BN'=>'BRUNEI DARUSSALAM',
+                               'BG'=>'BULGARIA',
+                               'BF'=>'BURKINA FASO',
+                               'BI'=>'BURUNDI',
+                               'KH'=>'CAMBODIA',
+                               'CM'=>'CAMEROON',
+                               'CA'=>'CANADA',
                                'CV'=>'CAPE VERDE', 
                                'KY'=>'CAYMAN ISLANDS', 
                                'CF'=>'CENTRAL AFRICAN REPUBLIC', 
@@ -264,6 +264,17 @@
                                'ZM'=>'ZAMBIA', 
                                'ZW'=>'ZIMBABWE'
                        ); 
+
+                       $this->continent_array = array
+                       (
+                               'africa'                => lang('africa'),
+                               'antarktica'    => lang('antarktica'),
+                               'asia'                  => lang('asia'),
+                               'australia'             => lang('australia'),
+                               'europe'                => lang('europe'),
+                               'northamerica'  => lang('north america'),
+                               'southamerica'  => lang('south america')
+                       );
                }
 
                function form_select($selected,$name='')
@@ -276,12 +287,63 @@
                        reset($this->country_array);
                        while(list($key,$value) = each($this->country_array))
                        {
-                               $str .= ' <option value="'.$key.'"'.($selected 
== $key?' selected':'').'>'.$value.'</option>'."\n";
+                               $str .= '<option value="' . $key . '"' . 
($selected == $key?' selected':'').'>'.$value.'</option>'."\n";
                        }
                        $str .= '</select>'."\n";
                        return $str;
                }
 
+               /**
+               * Return into a select box, using countries.xsl
+               *
+               * @param string $selected, selected country code
+               * @param string $select_name, name for select box
+               * @return array $carray
+               */
+               function xslt_country_select($selected = '',$select_name='')
+               {
+                       $GLOBALS['phpgw']->xslttpl->add_file('countries');
+
+                       foreach($this->country_array as $ccode => $cname)
+                       {
+                               $carray[] = array
+                               (
+                                       'country_code' => $ccode,
+                                       'country_name'  => $cname,
+                                       'selected'              => 
($ccode==$selected?'selected':'')
+                               );
+                       }
+
+                       return array
+                       (
+                               'select_name'   => $select_name,
+                               'country_list'  => $carray,
+                               'lang_country_statustext'       => lang('select 
the county')
+                       );
+               }
+
+               function xslt_continent_select($selected = '',$select_name='')
+               {
+                       $GLOBALS['phpgw']->xslttpl->add_file('countries');
+
+                       foreach($this->continent_array as $cname => $ctitle)
+                       {
+                               $carray[] = array
+                               (
+                                       'continent_name'        => $cname,
+                                       'continent_title'       => $ctitle,
+                                       'selected'                      => 
($cname==$selected?'selected':'')
+                               );
+                       }
+
+                       return array
+                       (
+                               'select_name'                           => 
$select_name,
+                               'continent_list'                        => 
$carray,
+                               'lang_continent_statustext'     => lang('select 
the continent')
+                       );
+               }
+
                function get_full_name($selected)
                {
                        return($this->country_array[$selected]);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]