Пример #1
0
 function renderControl($control, $data, $prefix = '')
 {
     // Print out a label for the control
     print '<label' . Html::attributes(array('for' => $control->id)) . '>' . Html::encode($control->caption) . ($control->required ? '<span class="required">*</span>' : '') . '</label>';
     if ($control->prefix) {
         print Html::encode($control->prefix);
     }
     if ($control instanceof Element_Input) {
         $attributes = $control->getAttributes($data, $prefix);
         // Add an error class to controls with issues
         if ($control->error) {
             $attributes['class'][] = 'error';
         }
         print '<input' . Html::attributes($attributes) . '>';
     } elseif ($control instanceof Element_Select) {
         $attributes = $control->getAttributes($data, $prefix);
         print '<select' . Html::attributes($attributes) . '>' . "\n";
         $value = $control->getValue($data);
         print Element_Select::renderOptions($control->options, $value, $control->multiple);
         print '</select>';
     } else {
         throw new Exception('Unknown control type for renderControl');
     }
     if ($control->suffix) {
         print Html::encode($control->suffix);
     }
     print "\n";
 }
Пример #2
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array(null => '--Select Timezone--', 'Africa/Abidjan' => 'Abidjan', 'Africa/Accra' => 'Accra', 'Africa/Addis_Ababa' => 'Addis Ababa', 'Africa/Algiers' => 'Algiers', 'Africa/Asmara' => 'Asmara', 'Africa/Bamako' => 'Bamako', 'Africa/Bangui' => 'Bangui', 'Africa/Banjul' => 'Banjul', 'Africa/Bissau' => 'Bissau', 'Africa/Blantyre' => 'Blantyre', 'Africa/Brazzaville' => 'Brazzaville', 'Africa/Bujumbura' => 'Bujumbura', 'Africa/Cairo' => 'Cairo', 'Africa/Casablanca' => 'Casablanca', 'Africa/Ceuta' => 'Ceuta', 'Africa/Conakry' => 'Conakry', 'Africa/Dakar' => 'Dakar', 'Africa/Dar_es_Salaam' => 'Dar es Salaam', 'Africa/Djibouti' => 'Djibouti', 'Africa/Douala' => 'Douala', 'Africa/El_Aaiun' => 'El Aaiun', 'Africa/Freetown' => 'Freetown', 'Africa/Gaborone' => 'Gaborone', 'Africa/Harare' => 'Harare', 'Africa/Johannesburg' => 'Johannesburg', 'Africa/Juba' => 'Juba', 'Africa/Kampala' => 'Kampala', 'Africa/Khartoum' => 'Khartoum', 'Africa/Kigali' => 'Kigali', 'Africa/Kinshasa' => 'Kinshasa', 'Africa/Lagos' => 'Lagos', 'Africa/Libreville' => 'Libreville', 'Africa/Lome' => 'Lome', 'Africa/Luanda' => 'Luanda', 'Africa/Lubumbashi' => 'Lubumbashi', 'Africa/Lusaka' => 'Lusaka', 'Africa/Malabo' => 'Malabo', 'Africa/Maputo' => 'Maputo', 'Africa/Maseru' => 'Maseru', 'Africa/Mbabane' => 'Mbabane', 'Africa/Mogadishu' => 'Mogadishu', 'Africa/Monrovia' => 'Monrovia', 'Africa/Nairobi' => 'Nairobi', 'Africa/Ndjamena' => 'Ndjamena', 'Africa/Niamey' => 'Niamey', 'Africa/Nouakchott' => 'Nouakchott', 'Africa/Ouagadougou' => 'Ouagadougou', 'Africa/Porto-Novo' => 'Porto-Novo', 'Africa/Sao_Tome' => 'Sao Tome', 'Africa/Tripoli' => 'Tripoli', 'Africa/Tunis' => 'Tunis', 'Africa/Windhoek' => 'Windhoek', 'America/Adak' => 'Adak', 'America/Anchorage' => 'Anchorage', 'America/Anguilla' => 'Anguilla', 'America/Antigua' => 'Antigua', 'America/Araguaina' => 'Araguaina', 'America/Argentina/Buenos_Aires' => 'Argentina - Buenos Aires', 'America/Argentina/Catamarca' => 'Argentina - Catamarca', 'America/Argentina/Cordoba' => 'Argentina - Cordoba', 'America/Argentina/Jujuy' => 'Argentina - Jujuy', 'America/Argentina/La_Rioja' => 'Argentina - La Rioja', 'America/Argentina/Mendoza' => 'Argentina - Mendoza', 'America/Argentina/Rio_Gallegos' => 'Argentina - Rio Gallegos', 'America/Argentina/Salta' => 'Argentina - Salta', 'America/Argentina/San_Juan' => 'Argentina - San Juan', 'America/Argentina/San_Luis' => 'Argentina - San Luis', 'America/Argentina/Tucuman' => 'Argentina - Tucuman', 'America/Argentina/Ushuaia' => 'Argentina - Ushuaia', 'America/Aruba' => 'Aruba', 'America/Asuncion' => 'Asuncion', 'America/Atikokan' => 'Atikokan', 'America/Bahia' => 'Bahia', 'America/Bahia_Banderas' => 'Bahia Banderas', 'America/Barbados' => 'Barbados', 'America/Belem' => 'Belem', 'America/Belize' => 'Belize', 'America/Blanc-Sablon' => 'Blanc-Sablon', 'America/Boa_Vista' => 'Boa Vista', 'America/Bogota' => 'Bogota', 'America/Boise' => 'Boise', 'America/Cambridge_Bay' => 'Cambridge Bay', 'America/Campo_Grande' => 'Campo Grande', 'America/Cancun' => 'Cancun', 'America/Caracas' => 'Caracas', 'America/Cayenne' => 'Cayenne', 'America/Cayman' => 'Cayman', 'America/Chicago' => 'Chicago', 'America/Chihuahua' => 'Chihuahua', 'America/Costa_Rica' => 'Costa Rica', 'America/Creston' => 'Creston', 'America/Cuiaba' => 'Cuiaba', 'America/Curacao' => 'Curacao', 'America/Danmarkshavn' => 'Danmarkshavn', 'America/Dawson' => 'Dawson', 'America/Dawson_Creek' => 'Dawson Creek', 'America/Denver' => 'Denver', 'America/Detroit' => 'Detroit', 'America/Dominica' => 'Dominica', 'America/Edmonton' => 'Edmonton', 'America/Eirunepe' => 'Eirunepe', 'America/El_Salvador' => 'El Salvador', 'America/Fortaleza' => 'Fortaleza', 'America/Glace_Bay' => 'Glace Bay', 'America/Godthab' => 'Godthab', 'America/Goose_Bay' => 'Goose Bay', 'America/Grand_Turk' => 'Grand Turk', 'America/Grenada' => 'Grenada', 'America/Guadeloupe' => 'Guadeloupe', 'America/Guatemala' => 'Guatemala', 'America/Guayaquil' => 'Guayaquil', 'America/Guyana' => 'Guyana', 'America/Halifax' => 'Halifax', 'America/Havana' => 'Havana', 'America/Hermosillo' => 'Hermosillo', 'America/Indiana/Indianapolis' => 'Indiana - Indianapolis', 'America/Indiana/Knox' => 'Indiana - Knox', 'America/Indiana/Marengo' => 'Indiana - Marengo', 'America/Indiana/Petersburg' => 'Indiana - Petersburg', 'America/Indiana/Tell_City' => 'Indiana - Tell City', 'America/Indiana/Vevay' => 'Indiana - Vevay', 'America/Indiana/Vincennes' => 'Indiana - Vincennes', 'America/Indiana/Winamac' => 'Indiana - Winamac', 'America/Inuvik' => 'Inuvik', 'America/Iqaluit' => 'Iqaluit', 'America/Jamaica' => 'Jamaica', 'America/Juneau' => 'Juneau', 'America/Kentucky/Louisville' => 'Kentucky - Louisville', 'America/Kentucky/Monticello' => 'Kentucky - Monticello', 'America/Kralendijk' => 'Kralendijk', 'America/La_Paz' => 'La Paz', 'America/Lima' => 'Lima', 'America/Los_Angeles' => 'Los Angeles', 'America/Lower_Princes' => 'Lower Princes', 'America/Maceio' => 'Maceio', 'America/Managua' => 'Managua', 'America/Manaus' => 'Manaus', 'America/Marigot' => 'Marigot', 'America/Martinique' => 'Martinique', 'America/Matamoros' => 'Matamoros', 'America/Mazatlan' => 'Mazatlan', 'America/Menominee' => 'Menominee', 'America/Merida' => 'Merida', 'America/Metlakatla' => 'Metlakatla', 'America/Mexico_City' => 'Mexico City', 'America/Miquelon' => 'Miquelon', 'America/Moncton' => 'Moncton', 'America/Monterrey' => 'Monterrey', 'America/Montevideo' => 'Montevideo', 'America/Montserrat' => 'Montserrat', 'America/Nassau' => 'Nassau', 'America/New_York' => 'New York', 'America/Nipigon' => 'Nipigon', 'America/Nome' => 'Nome', 'America/Noronha' => 'Noronha', 'America/North_Dakota/Beulah' => 'North Dakota - Beulah', 'America/North_Dakota/Center' => 'North Dakota - Center', 'America/North_Dakota/New_Salem' => 'North Dakota - New Salem', 'America/Ojinaga' => 'Ojinaga', 'America/Panama' => 'Panama', 'America/Pangnirtung' => 'Pangnirtung', 'America/Paramaribo' => 'Paramaribo', 'America/Phoenix' => 'Phoenix', 'America/Port-au-Prince' => 'Port-au-Prince', 'America/Port_of_Spain' => 'Port of Spain', 'America/Porto_Velho' => 'Porto Velho', 'America/Puerto_Rico' => 'Puerto Rico', 'America/Rainy_River' => 'Rainy River', 'America/Rankin_Inlet' => 'Rankin Inlet', 'America/Recife' => 'Recife', 'America/Regina' => 'Regina', 'America/Resolute' => 'Resolute', 'America/Rio_Branco' => 'Rio Branco', 'America/Santa_Isabel' => 'Santa Isabel', 'America/Santarem' => 'Santarem', 'America/Santiago' => 'Santiago', 'America/Santo_Domingo' => 'Santo Domingo', 'America/Sao_Paulo' => 'Sao Paulo', 'America/Scoresbysund' => 'Scoresbysund', 'America/Sitka' => 'Sitka', 'America/St_Barthelemy' => 'St Barthelemy', 'America/St_Johns' => 'St Johns', 'America/St_Kitts' => 'St Kitts', 'America/St_Lucia' => 'St Lucia', 'America/St_Thomas' => 'St Thomas', 'America/St_Vincent' => 'St Vincent', 'America/Swift_Current' => 'Swift Current', 'America/Tegucigalpa' => 'Tegucigalpa', 'America/Thule' => 'Thule', 'America/Thunder_Bay' => 'Thunder Bay', 'America/Tijuana' => 'Tijuana', 'America/Toronto' => 'Toronto', 'America/Tortola' => 'Tortola', 'America/Vancouver' => 'Vancouver', 'America/Whitehorse' => 'Whitehorse', 'America/Winnipeg' => 'Winnipeg', 'America/Yakutat' => 'Yakutat', 'America/Yellowknife' => 'Yellowknife', 'Antarctica/Casey' => 'Casey', 'Antarctica/Davis' => 'Davis', 'Antarctica/DumontDUrville' => 'DumontDUrville', 'Antarctica/Macquarie' => 'Macquarie', 'Antarctica/Mawson' => 'Mawson', 'Antarctica/McMurdo' => 'McMurdo', 'Antarctica/Palmer' => 'Palmer', 'Antarctica/Rothera' => 'Rothera', 'Antarctica/Syowa' => 'Syowa', 'Antarctica/Troll' => 'Troll', 'Antarctica/Vostok' => 'Vostok', 'Arctic/Longyearbyen' => 'Longyearbyen', 'Asia/Aden' => 'Aden', 'Asia/Almaty' => 'Almaty', 'Asia/Amman' => 'Amman', 'Asia/Anadyr' => 'Anadyr', 'Asia/Aqtau' => 'Aqtau', 'Asia/Aqtobe' => 'Aqtobe', 'Asia/Ashgabat' => 'Ashgabat', 'Asia/Baghdad' => 'Baghdad', 'Asia/Bahrain' => 'Bahrain', 'Asia/Baku' => 'Baku', 'Asia/Bangkok' => 'Bangkok', 'Asia/Beirut' => 'Beirut', 'Asia/Bishkek' => 'Bishkek', 'Asia/Brunei' => 'Brunei', 'Asia/Choibalsan' => 'Choibalsan', 'Asia/Chongqing' => 'Chongqing', 'Asia/Colombo' => 'Colombo', 'Asia/Damascus' => 'Damascus', 'Asia/Dhaka' => 'Dhaka', 'Asia/Dili' => 'Dili', 'Asia/Dubai' => 'Dubai', 'Asia/Dushanbe' => 'Dushanbe', 'Asia/Gaza' => 'Gaza', 'Asia/Harbin' => 'Harbin', 'Asia/Hebron' => 'Hebron', 'Asia/Ho_Chi_Minh' => 'Ho Chi Minh', 'Asia/Hong_Kong' => 'Hong Kong', 'Asia/Hovd' => 'Hovd', 'Asia/Irkutsk' => 'Irkutsk', 'Asia/Jakarta' => 'Jakarta', 'Asia/Jayapura' => 'Jayapura', 'Asia/Jerusalem' => 'Jerusalem', 'Asia/Kabul' => 'Kabul', 'Asia/Kamchatka' => 'Kamchatka', 'Asia/Karachi' => 'Karachi', 'Asia/Kashgar' => 'Kashgar', 'Asia/Kathmandu' => 'Kathmandu', 'Asia/Khandyga' => 'Khandyga', 'Asia/Kolkata' => 'Kolkata', 'Asia/Krasnoyarsk' => 'Krasnoyarsk', 'Asia/Kuala_Lumpur' => 'Kuala Lumpur', 'Asia/Kuching' => 'Kuching', 'Asia/Kuwait' => 'Kuwait', 'Asia/Macau' => 'Macau', 'Asia/Magadan' => 'Magadan', 'Asia/Makassar' => 'Makassar', 'Asia/Manila' => 'Manila', 'Asia/Muscat' => 'Muscat', 'Asia/Nicosia' => 'Nicosia', 'Asia/Novokuznetsk' => 'Novokuznetsk', 'Asia/Novosibirsk' => 'Novosibirsk', 'Asia/Omsk' => 'Omsk', 'Asia/Oral' => 'Oral', 'Asia/Phnom_Penh' => 'Phnom Penh', 'Asia/Pontianak' => 'Pontianak', 'Asia/Pyongyang' => 'Pyongyang', 'Asia/Qatar' => 'Qatar', 'Asia/Qyzylorda' => 'Qyzylorda', 'Asia/Rangoon' => 'Rangoon', 'Asia/Riyadh' => 'Riyadh', 'Asia/Sakhalin' => 'Sakhalin', 'Asia/Samarkand' => 'Samarkand', 'Asia/Seoul' => 'Seoul', 'Asia/Shanghai' => 'Shanghai', 'Asia/Singapore' => 'Singapore', 'Asia/Taipei' => 'Taipei', 'Asia/Tashkent' => 'Tashkent', 'Asia/Tbilisi' => 'Tbilisi', 'Asia/Tehran' => 'Tehran', 'Asia/Thimphu' => 'Thimphu', 'Asia/Tokyo' => 'Tokyo', 'Asia/Ulaanbaatar' => 'Ulaanbaatar', 'Asia/Urumqi' => 'Urumqi', 'Asia/Ust-Nera' => 'Ust-Nera', 'Asia/Vientiane' => 'Vientiane', 'Asia/Vladivostok' => 'Vladivostok', 'Asia/Yakutsk' => 'Yakutsk', 'Asia/Yekaterinburg' => 'Yekaterinburg', 'Asia/Yerevan' => 'Yerevan', 'Atlantic/Azores' => 'Azores', 'Atlantic/Bermuda' => 'Bermuda', 'Atlantic/Canary' => 'Canary', 'Atlantic/Cape_Verde' => 'Cape Verde', 'Atlantic/Faroe' => 'Faroe', 'Atlantic/Madeira' => 'Madeira', 'Atlantic/Reykjavik' => 'Reykjavik', 'Atlantic/South_Georgia' => 'South Georgia', 'Atlantic/Stanley' => 'Stanley', 'Atlantic/St_Helena' => 'St Helena', 'Australia/Adelaide' => 'Adelaide', 'Australia/Brisbane' => 'Brisbane', 'Australia/Broken_Hill' => 'Broken Hill', 'Australia/Currie' => 'Currie', 'Australia/Darwin' => 'Darwin', 'Australia/Eucla' => 'Eucla', 'Australia/Hobart' => 'Hobart', 'Australia/Lindeman' => 'Lindeman', 'Australia/Lord_Howe' => 'Lord Howe', 'Australia/Melbourne' => 'Melbourne', 'Australia/Perth' => 'Perth', 'Australia/Sydney' => 'Sydney', 'Europe/Amsterdam' => 'Amsterdam', 'Europe/Andorra' => 'Andorra', 'Europe/Athens' => 'Athens', 'Europe/Belgrade' => 'Belgrade', 'Europe/Berlin' => 'Berlin', 'Europe/Bratislava' => 'Bratislava', 'Europe/Brussels' => 'Brussels', 'Europe/Bucharest' => 'Bucharest', 'Europe/Budapest' => 'Budapest', 'Europe/Busingen' => 'Busingen', 'Europe/Chisinau' => 'Chisinau', 'Europe/Copenhagen' => 'Copenhagen', 'Europe/Dublin' => 'Dublin', 'Europe/Gibraltar' => 'Gibraltar', 'Europe/Guernsey' => 'Guernsey', 'Europe/Helsinki' => 'Helsinki', 'Europe/Isle_of_Man' => 'Isle of Man', 'Europe/Istanbul' => 'Istanbul', 'Europe/Jersey' => 'Jersey', 'Europe/Kaliningrad' => 'Kaliningrad', 'Europe/Kiev' => 'Kiev', 'Europe/Lisbon' => 'Lisbon', 'Europe/Ljubljana' => 'Ljubljana', 'Europe/London' => 'London', 'Europe/Luxembourg' => 'Luxembourg', 'Europe/Madrid' => 'Madrid', 'Europe/Malta' => 'Malta', 'Europe/Mariehamn' => 'Mariehamn', 'Europe/Minsk' => 'Minsk', 'Europe/Monaco' => 'Monaco', 'Europe/Moscow' => 'Moscow', 'Europe/Oslo' => 'Oslo', 'Europe/Paris' => 'Paris', 'Europe/Podgorica' => 'Podgorica', 'Europe/Prague' => 'Prague', 'Europe/Riga' => 'Riga', 'Europe/Rome' => 'Rome', 'Europe/Samara' => 'Samara', 'Europe/San_Marino' => 'San Marino', 'Europe/Sarajevo' => 'Sarajevo', 'Europe/Simferopol' => 'Simferopol', 'Europe/Skopje' => 'Skopje', 'Europe/Sofia' => 'Sofia', 'Europe/Stockholm' => 'Stockholm', 'Europe/Tallinn' => 'Tallinn', 'Europe/Tirane' => 'Tirane', 'Europe/Uzhgorod' => 'Uzhgorod', 'Europe/Vaduz' => 'Vaduz', 'Europe/Vatican' => 'Vatican', 'Europe/Vienna' => 'Vienna', 'Europe/Vilnius' => 'Vilnius', 'Europe/Volgograd' => 'Volgograd', 'Europe/Warsaw' => 'Warsaw', 'Europe/Zagreb' => 'Zagreb', 'Europe/Zaporozhye' => 'Zaporozhye', 'Europe/Zurich' => 'Zurich', 'Indian/Antananarivo' => 'Antananarivo', 'Indian/Chagos' => 'Chagos', 'Indian/Christmas' => 'Christmas', 'Indian/Cocos' => 'Cocos', 'Indian/Comoro' => 'Comoro', 'Indian/Kerguelen' => 'Kerguelen', 'Indian/Mahe' => 'Mahe', 'Indian/Maldives' => 'Maldives', 'Indian/Mauritius' => 'Mauritius', 'Indian/Mayotte' => 'Mayotte', 'Indian/Reunion' => 'Reunion', 'Pacific/Apia' => 'Apia', 'Pacific/Auckland' => 'Auckland', 'Pacific/Chatham' => 'Chatham', 'Pacific/Chuuk' => 'Chuuk', 'Pacific/Easter' => 'Easter', 'Pacific/Efate' => 'Efate', 'Pacific/Enderbury' => 'Enderbury', 'Pacific/Fakaofo' => 'Fakaofo', 'Pacific/Fiji' => 'Fiji', 'Pacific/Funafuti' => 'Funafuti', 'Pacific/Galapagos' => 'Galapagos', 'Pacific/Gambier' => 'Gambier', 'Pacific/Guadalcanal' => 'Guadalcanal', 'Pacific/Guam' => 'Guam', 'Pacific/Honolulu' => 'Honolulu', 'Pacific/Johnston' => 'Johnston', 'Pacific/Kiritimati' => 'Kiritimati', 'Pacific/Kosrae' => 'Kosrae', 'Pacific/Kwajalein' => 'Kwajalein', 'Pacific/Majuro' => 'Majuro', 'Pacific/Marquesas' => 'Marquesas', 'Pacific/Midway' => 'Midway', 'Pacific/Nauru' => 'Nauru', 'Pacific/Niue' => 'Niue', 'Pacific/Norfolk' => 'Norfolk', 'Pacific/Noumea' => 'Noumea', 'Pacific/Pago_Pago' => 'Pago Pago', 'Pacific/Palau' => 'Palau', 'Pacific/Pitcairn' => 'Pitcairn', 'Pacific/Pohnpei' => 'Pohnpei', 'Pacific/Port_Moresby' => 'Port Moresby', 'Pacific/Rarotonga' => 'Rarotonga', 'Pacific/Saipan' => 'Saipan', 'Pacific/Tahiti' => 'Tahiti', 'Pacific/Tarawa' => 'Tarawa', 'Pacific/Tongatapu' => 'Tongatapu', 'Pacific/Wake' => 'Wake', 'Pacific/Wallis' => 'Wallis', 'UTC' => 'UTC', 'UTC-12' => 'UTC-12', 'UTC-11.5' => 'UTC-11:30', 'UTC-11' => 'UTC-11', 'UTC-10.5' => 'UTC-10:30', 'UTC-10' => 'UTC-10', 'UTC-9.5' => 'UTC-9:30', 'UTC-9' => 'UTC-9', 'UTC-8.5' => 'UTC-8:30', 'UTC-8' => 'UTC-8', 'UTC-7.5' => 'UTC-7:30', 'UTC-7' => 'UTC-7', 'UTC-6.5' => 'UTC-6:30', 'UTC-6' => 'UTC-6', 'UTC-5.5' => 'UTC-5:30', 'UTC-5' => 'UTC-5', 'UTC-4.5' => 'UTC-4:30', 'UTC-4' => 'UTC-4', 'UTC-3.5' => 'UTC-3:30', 'UTC-3' => 'UTC-3', 'UTC-2.5' => 'UTC-2:30', 'UTC-2' => 'UTC-2', 'UTC-1.5' => 'UTC-1:30', 'UTC-1' => 'UTC-1', 'UTC-0.5' => 'UTC-0:30', 'UTC+0' => 'UTC+0', 'UTC+0.5' => 'UTC+0:30', 'UTC+1' => 'UTC+1', 'UTC+1.5' => 'UTC+1:30', 'UTC+2' => 'UTC+2', 'UTC+2.5' => 'UTC+2:30', 'UTC+3' => 'UTC+3', 'UTC+3.5' => 'UTC+3:30', 'UTC+4' => 'UTC+4', 'UTC+4.5' => 'UTC+4:30', 'UTC+5' => 'UTC+5', 'UTC+5.5' => 'UTC+5:30', 'UTC+5.75' => 'UTC+5:45', 'UTC+6' => 'UTC+6', 'UTC+6.5' => 'UTC+6:30', 'UTC+7' => 'UTC+7', 'UTC+7.5' => 'UTC+7:30', 'UTC+8' => 'UTC+8', 'UTC+8.5' => 'UTC+8:30', 'UTC+8.75' => 'UTC+8:45', 'UTC+9' => 'UTC+9', 'UTC+9.5' => 'UTC+9:30', 'UTC+10' => 'UTC+10', 'UTC+10.5' => 'UTC+10:30', 'UTC+11' => 'UTC+11', 'UTC+11.5' => 'UTC+11:30', 'UTC+12' => 'UTC+12', 'UTC+12.75' => 'UTC+12:45', 'UTC+13' => 'UTC+13', 'UTC+13.75' => 'UTC+13:45', 'UTC+14' => 'UTC+14');
     parent::__construct($label, $name, $options, $properties);
 }
function bf_form_elements($form, $args)
{
    extract($args);
    if (!isset($customfields)) {
        return;
    }
    foreach ($customfields as $field_id => $customfield) {
        if (isset($customfield['slug'])) {
            $slug = sanitize_title($customfield['slug']);
        }
        if (empty($slug)) {
            $slug = sanitize_title($customfield['name']);
        }
        if ($slug != '') {
            if (isset($_POST[$slug])) {
                $customfield_val = $_POST[$slug];
            } else {
                $customfield_val = get_post_meta($post_id, $slug, true);
            }
            if (empty($customfield_val) && isset($customfield['default'])) {
                $customfield_val = $customfield['default'];
            }
            $name = '';
            if (isset($customfield['name'])) {
                $name = stripcslashes($customfield['name']);
            }
            $description = '';
            if (isset($customfield['description'])) {
                $description = stripcslashes($customfield['description']);
            }
            $element_attr = array('id' => str_replace("-", "", $slug), 'value' => $customfield_val, 'class' => 'settings-input', 'shortDesc' => $description);
            if (isset($customfield['required'])) {
                $element_attr = array_merge($element_attr, array('required' => true));
            }
            if (isset($customfield['custom_class'])) {
                $element_attr['class'] = $element_attr['class'] . ' ' . $customfield['custom_class'];
            }
            if (isset($customfield['type'])) {
                switch (sanitize_title($customfield['type'])) {
                    case 'number':
                        $form->addElement(new Element_Number($name, $slug, $element_attr));
                        break;
                    case 'html':
                        $form->addElement(new Element_HTML($customfield['html']));
                        break;
                    case 'date':
                        $form->addElement(new Element_Date($name, $slug, $element_attr));
                        break;
                    case 'title':
                        if (isset($_POST['editpost_title'])) {
                            $post_title = stripslashes($_POST['editpost_title']);
                        } else {
                            $post_title = $the_post->post_title;
                        }
                        if (isset($customfield['hidden'])) {
                            $form->addElement(new Element_Hidden('editpost_title', $post_title));
                        } else {
                            $element_attr = array('id' => 'editpost_title', 'value' => $post_title, 'shortDesc' => $description);
                            if (isset($customfield['required'])) {
                                $element_attr = array_merge($element_attr, array('required' => true));
                            }
                            $form->addElement(new Element_Textbox($name, "editpost_title", $element_attr));
                        }
                        break;
                    case 'content':
                        add_filter('tiny_mce_before_init', 'my_tinymce_setup_function');
                        $editpost_content_val = false;
                        if (isset($_POST['editpost_content'])) {
                            $editpost_content_val = stripslashes($_POST['editpost_content']);
                        } else {
                            if (!empty($the_post->post_content)) {
                                $editpost_content_val = $the_post->post_content;
                            }
                        }
                        ob_start();
                        $settings = array('wpautop' => true, 'media_buttons' => isset($customfield['post_content_options']) ? in_array('media_buttons', $customfield['post_content_options']) ? false : true : true, 'tinymce' => isset($customfield['post_content_options']) ? in_array('tinymce', $customfield['post_content_options']) ? false : true : true, 'quicktags' => isset($customfield['post_content_options']) ? in_array('quicktags', $customfield['post_content_options']) ? false : true : true, 'textarea_rows' => 18, 'textarea_name' => 'editpost_content', 'editor_class' => 'textInMce');
                        if (isset($post_id)) {
                            wp_editor($editpost_content_val, 'editpost_content', $settings);
                        } else {
                            $content = false;
                            $post = 0;
                            wp_editor($content, 'editpost_content', $settings);
                        }
                        $wp_editor = ob_get_contents();
                        ob_clean();
                        $required = '';
                        if (isset($customfield['required'])) {
                            $wp_editor = str_replace('<textarea', '<textarea required="required"', $wp_editor);
                            $required = '<span class="required">* </span>';
                        }
                        echo '<div id="editpost_content_val" style="display: none">' . $editpost_content_val . '</div>';
                        if (isset($customfield['hidden'])) {
                            $form->addElement(new Element_Hidden('editpost_content', $editpost_content_val));
                        } else {
                            $wp_editor = '<div class="bf_field_group bf_form_content"><label for="editpost_content">' . $required . $name . '</label><div class="bf_inputs">' . $wp_editor . '</div><span class="help-inline">' . $description . '</span></div>';
                            $form->addElement(new Element_HTML($wp_editor));
                        }
                        break;
                    case 'mail':
                        $form->addElement(new Element_Email($name, $slug, $element_attr));
                        break;
                    case 'radiobutton':
                        if (isset($customfield['options']) && is_array($customfield['options'])) {
                            $options = array();
                            foreach ($customfield['options'] as $key => $option) {
                                $options[$option['value']] = $option['label'];
                            }
                            $element = new Element_Radio($name, $slug, $options, $element_attr);
                            bf_add_element($form, $element);
                        }
                        break;
                    case 'checkbox':
                        if (isset($customfield['options']) && is_array($customfield['options'])) {
                            $options = array();
                            foreach ($customfield['options'] as $key => $option) {
                                $options[$option['value']] = $option['label'];
                            }
                            $element = new Element_Checkbox($name, $slug, $options, $element_attr);
                            bf_add_element($form, $element);
                        }
                        break;
                    case 'dropdown':
                        if (isset($customfield['options']) && is_array($customfield['options'])) {
                            $options = array();
                            foreach ($customfield['options'] as $key => $option) {
                                $options[$option['value']] = $option['label'];
                            }
                            $element_attr['class'] = $element_attr['class'] . ' bf-select2';
                            $element = new Element_Select($name, $slug, $options, $element_attr);
                            if (isset($customfield['multiple']) && is_array($customfield['multiple'])) {
                                $element->setAttribute('multiple', 'multiple');
                            }
                            bf_add_element($form, $element);
                        }
                        break;
                    case 'comments':
                        if (isset($the_post)) {
                            $customfield['value'] = $the_post->comment_status;
                        }
                        $form->addElement(new Element_Select($name, 'comment_status', array('open', 'closed'), $element_attr));
                        break;
                    case 'status':
                        if (isset($customfield['post_status']) && is_array($customfield['post_status'])) {
                            if (in_array('pending', $customfield['post_status'])) {
                                $post_status['pending'] = 'Pending Review';
                            }
                            if (in_array('publish', $customfield['post_status'])) {
                                $post_status['publish'] = 'Published';
                            }
                            if (in_array('draft', $customfield['post_status'])) {
                                $post_status['draft'] = 'Draft';
                            }
                            if (in_array('future', $customfield['post_status']) && empty($customfield_val) || in_array('future', $customfield['post_status']) && get_post_status($post_id) == 'future') {
                                $post_status['future'] = 'Scheduled';
                            }
                            if (in_array('private', $customfield['post_status'])) {
                                $post_status['private'] = 'Privately Published';
                            }
                            if (in_array('private', $customfield['post_status'])) {
                                $post_status['trash'] = 'Trash';
                            }
                            $customfield_val = $the_post->post_status;
                            if (isset($_POST['status'])) {
                                $customfield_val = $_POST['status'];
                            }
                            $form->addElement(new Element_Select($name, 'status', $post_status, $element_attr));
                            if (isset($_POST[$slug])) {
                                $schedule_val = $_POST['schedule'];
                            } else {
                                $schedule_val = get_post_meta($post_id, 'schedule', true);
                            }
                            $element_attr['class'] = $element_attr['class'] . ' bf_datetime';
                            $form->addElement(new Element_HTML('<div class="bf_datetime_wrap">'));
                            $form->addElement(new Element_Textbox('Schedule Time', 'schedule', $element_attr));
                            $form->addElement(new Element_HTML('</div>'));
                        }
                        break;
                    case 'textarea':
                        $form->addElement(new Element_Textarea($name, $slug, $element_attr));
                        break;
                    case 'hidden':
                        $form->addElement(new Element_Hidden($name, $customfield['value']));
                        break;
                    case 'text':
                        $form->addElement(new Element_Textbox($name, $slug, $element_attr));
                        break;
                    case 'link':
                        $form->addElement(new Element_Url($name, $slug, $element_attr));
                        break;
                    case 'featured-image':
                    case 'featured_image':
                        $attachment_ids = $customfield_val;
                        $attachments = array_filter(explode(',', $attachment_ids));
                        $str = '<div id="bf_files_container_' . $slug . '" class="bf_files_container"><ul class="bf_files">';
                        if ($attachments) {
                            foreach ($attachments as $attachment_id) {
                                $attachment_metadat = get_post($attachment_id);
                                $str .= '<li class="image" data-attachment_id="' . esc_attr($attachment_id) . '">

                                    <div class="bf_attachment_li">
                                    <div class="bf_attachment_img">
                                    ' . wp_get_attachment_image($attachment_id, array(64, 64), true) . '
                                    </div><div class="bf_attachment_meta">
                                    <p><b>' . __('Name: ', 'buddyforms') . '</b>' . $attachment_metadat->post_name . '<p>
                                    <p><b>' . __('Type: ', 'buddyforms') . '</b>' . $attachment_metadat->post_mime_type . '<p>

                                    <p>
                                    <a href="#" class="delete tips" data-slug="' . $slug . '" data-tip="' . __('Delete image', 'buddyforms') . '">' . __('Delete', 'buddyforms') . '</a>
                                    <a href="' . wp_get_attachment_url($attachment_id) . '" target="_blank" class="view" data-tip="' . __('View', 'buddyforms') . '">' . __('View', 'buddyforms') . '</a>
                                    </p>
                                    </div></div>

                                </li>';
                            }
                        }
                        $str .= '</ul>';
                        $str .= '<span class="bf_add_files hide-if-no-js">';
                        $str .= '<a class="button btn btn-primary" href="#" data-slug="' . $slug . '" data-type="image/jpeg,image/gif,image/png,image/bmp,image/tiff,image/x-icon" data-multiple="false" data-choose="' . __('Add ', 'buddyforms') . $name . '" data-update="' . __('Add ', 'buddyforms') . $name . '" data-delete="' . __('Delete ', 'buddyforms') . $name . '" data-text="' . __('Delete', 'buddyforms') . '">' . __('Add ', 'buddyforms') . $name . '</a>';
                        $str .= '</span>';
                        $str .= '</div><span class="help-inline">';
                        $str .= $description;
                        $str .= '</span>';
                        $form->addElement(new Element_HTML('
                        <div class="bf_field_group">
                            <label for="_' . $slug . '">'));
                        if (isset($customfield['required'])) {
                            $form->addElement(new Element_HTML('<span class="required">* </span>'));
                        }
                        $form->addElement(new Element_HTML($name . '</label>'));
                        $form->addElement(new Element_HTML('<div class="bf_inputs">
                            ' . $str . '
                            </div>
                        '));
                        $form->addElement(new Element_Hidden('featured_image', $customfield_val, array('id' => $slug)));
                        $form->addElement(new Element_HTML('</div>'));
                        break;
                    case 'file':
                        $attachment_ids = $customfield_val;
                        $str = '<div id="bf_files_container_' . $slug . '" class="bf_files_container"><ul class="bf_files">';
                        $attachments = array_filter(explode(',', $attachment_ids));
                        if ($attachments) {
                            foreach ($attachments as $attachment_id) {
                                $attachment_metadat = get_post($attachment_id);
                                $str .= '<li class="image" data-attachment_id="' . esc_attr($attachment_id) . '">

                                    <div class="bf_attachment_li">
                                    <div class="bf_attachment_img">
                                    ' . wp_get_attachment_image($attachment_id, array(64, 64), true) . '
                                    </div><div class="bf_attachment_meta">
                                    <p><b>' . __('Name: ', 'buddyforms') . '</b>' . $attachment_metadat->post_title . '<p>
                                    <p><b>' . __('Type: ', 'buddyforms') . '</b>' . $attachment_metadat->post_mime_type . '<p>

                                    <p>
                                    <a href="#" class="delete tips" data-slug="' . $slug . '" data-tip="' . __('Delete image', 'buddyforms') . '">' . __('Delete', 'buddyforms') . '</a>
                                    <a href="' . wp_get_attachment_url($attachment_id) . '" target="_blank" class="view" data-tip="' . __('View', 'buddyforms') . '">' . __('View', 'buddyforms') . '</a>
                                    </p>
                                    </div></div>

                                </li>';
                            }
                        }
                        $str .= '</ul>';
                        $str .= '<span class="bf_add_files hide-if-no-js">';
                        $library_types = $allowed_types = '';
                        if (isset($customfield['data_types'])) {
                            $data_types_array = array();
                            $allowed_mime_types = get_allowed_mime_types();
                            foreach ($customfield['data_types'] as $key => $value) {
                                $data_types_array[$value] = $allowed_mime_types[$value];
                            }
                            $library_types = implode(",", $data_types_array);
                            $library_types = 'data-library_type="' . $library_types . '"';
                            $allowed_types = implode(",", $customfield['data_types']);
                            $allowed_types = 'data-allowed_type="' . $allowed_types . '"';
                        }
                        $data_multiple = 'data-multiple="false"';
                        if (isset($customfield['validation_multiple'])) {
                            $data_multiple = 'data-multiple="true"';
                        }
                        $str .= '<a href="#" data-slug="' . $slug . '" ' . $data_multiple . ' ' . $allowed_types . ' ' . $library_types . 'data-choose="' . __('Add into', 'buddyforms') . $name . '" data-update="' . __('Add ', 'buddyforms') . $name . '" data-delete="' . __('Delete ', 'buddyforms') . $name . '" data-text="' . __('Delete', 'buddyforms') . '">' . __('Attache File', 'buddyforms') . '</a>';
                        $str .= '</span>';
                        $str .= '</div><span class="help-inline">';
                        $str .= $description;
                        $str .= '</span>';
                        $form->addElement(new Element_HTML('
                        <div class="bf_field_group">
                            <label for="_' . $slug . '">'));
                        if (isset($customfield['required'])) {
                            $form->addElement(new Element_HTML('<span class="required">* </span>'));
                        }
                        $form->addElement(new Element_HTML($name . '</label>'));
                        $form->addElement(new Element_HTML('<div class="bf_inputs">
                            ' . $str . '
                            </div>
                        '));
                        $form->addElement(new Element_Hidden($slug, $customfield_val, array('id' => $slug)));
                        $form->addElement(new Element_HTML('</div>'));
                        break;
                    case 'taxonomy':
                        $args = array('hide_empty' => 0, 'id' => $field_id, 'child_of' => 0, 'echo' => FALSE, 'selected' => false, 'hierarchical' => 1, 'name' => $slug . '[]', 'class' => 'postform bf-select2', 'depth' => 0, 'tab_index' => 0, 'taxonomy' => $customfield['taxonomy'], 'hide_if_empty' => FALSE, 'orderby' => 'SLUG', 'order' => $customfield['taxonomy_order']);
                        if (isset($customfield['show_option_none']) && !isset($customfield['multiple'])) {
                            $args = array_merge($args, array('show_option_none' => 'Nothing Selected'));
                        }
                        if (isset($customfield['multiple'])) {
                            $args = array_merge($args, array('multiple' => $customfield['multiple']));
                        }
                        $dropdown = wp_dropdown_categories($args);
                        if (isset($customfield['multiple']) && is_array($customfield['multiple'])) {
                            $dropdown = str_replace('id=', 'multiple="multiple" id=', $dropdown);
                        }
                        if (isset($customfield['required']) && is_array($customfield['required'])) {
                            $dropdown = str_replace('id=', 'required id=', $dropdown);
                        }
                        $the_post_terms = get_the_terms($post_id, $customfield['taxonomy']);
                        if (is_array($the_post_terms)) {
                            foreach ($the_post_terms as $key => $post_term) {
                                $dropdown = str_replace(' value="' . $post_term->term_id . '"', ' value="' . $post_term->term_id . '" selected="selected"', $dropdown);
                            }
                        } else {
                            if (isset($customfield['taxonomy_default'])) {
                                foreach ($customfield['taxonomy_default'] as $key => $tax) {
                                    $dropdown = str_replace(' value="' . $customfield['taxonomy_default'][$key] . '"', ' value="' . $tax . '" selected="selected"', $dropdown);
                                }
                            }
                        }
                        $required = '';
                        if (isset($customfield['required']) && is_array($customfield['required'])) {
                            $required = '<span class="required">* </span>';
                        }
                        $dropdown = '<div class="bf_field_group">
                        <label for="editpost-element-' . $field_id . '">
                            ' . $required . $name . '
                        </label>
                        <div class="bf_inputs">' . $dropdown . ' </div>
                        <span class="help-inline">' . $description . '</span>
                    </div>';
                        if (isset($customfield['hidden'])) {
                            if (isset($customfield['taxonomy_default'])) {
                                foreach ($customfield['taxonomy_default'] as $key => $tax) {
                                    $form->addElement(new Element_Hidden($slug . '[' . $key . ']', $tax));
                                }
                            }
                        } else {
                            $form->addElement(new Element_HTML($dropdown));
                            if (isset($customfield['creat_new_tax'])) {
                                $form->addElement(new Element_Textbox(__('Create a new ', 'buddyforms') . $customfield['name'], $slug . '_creat_new_tax', array('class' => 'settings-input')));
                            }
                        }
                        break;
                    default:
                        $form_args = array('field_id' => $field_id, 'post_id' => $post_id, 'post_parent' => $post_parent, 'form_slug' => $form_slug, 'customfield' => $customfield, 'customfield_val' => $customfield_val);
                        // hook to add your form element
                        apply_filters('buddyforms_create_edit_form_display_element', $form, $form_args);
                        break;
                }
            }
        }
    }
}
function buddyforms_afe_create_frontend_element($form, $form_args)
{
    global $buddyforms, $nonce;
    extract($form_args);
    $customfield_val = explode(',', $customfield_val);
    $post_type = $buddyforms[$form_slug]['post_type'];
    if (!$post_type) {
        return $form;
    }
    if (!isset($customfield['type'])) {
        return $form;
    }
    switch ($customfield['type']) {
        case 'tax-afe':
            $categories = get_categories(array('parent' => 0, 'hide_empty' => 0, 'taxonomy' => $customfield['taxonomy'], 'hierarchical' => false));
            $main_cats = false;
            if (is_array($categories)) {
                $main_cats['none'] = 'Select One';
                foreach ($categories as $key => $category) {
                    $main_cats[$category->term_taxonomy_id] = $category->name;
                }
            }
            $form->addElement(new Element_Select($customfield['name'], $customfield['slug'] . '-select', $main_cats, array('value' => $customfield_val, 'class' => 'tax_tax_tax', 'data-id' => $customfield['slug'], 'data-taxonomy' => $customfield['taxonomy'])));
            $form->addElement(new Element_HTML('<div id="taxtax_container">'));
            $terms = wp_get_post_terms($post_id, $customfield['taxonomy']);
            foreach ($terms as $key => $term) {
                $term_children = get_categories(array('parent' => $term->term_id, 'hide_empty' => 0, 'taxonomy' => $customfield['taxonomy'], 'hierarchical' => false));
                $term_children_array = false;
                if (is_array($term_children)) {
                    $term_children_array['none'] = 'Select One';
                    foreach ($term_children as $key => $term_child) {
                        $term_children_array[$term_child->term_taxonomy_id] = $term_child->name;
                    }
                }
                if (is_array($term_children_array) && count($term_children_array) > 1) {
                    $select = new Element_Select('', 'tax_tax_tax[sub][]', $term_children_array, array('class' => 'tax_tax_tax', 'value' => $customfield_val, 'data-id' => $customfield['slug'], 'data-taxonomy' => $customfield['taxonomy']));
                    ob_start();
                    $select->render();
                    $select = ob_get_clean();
                    $form->addElement(new Element_HTML($select));
                }
            }
            $form->addElement(new Element_HTML('</div>'));
            $form->addElement(new Element_Hidden($customfield['slug'], $form_args['customfield_val']));
            break;
    }
    return $form;
}
Пример #5
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array("" => "--Select State--", "AL" => "Alabama", "AK" => "Alaska", "AZ" => "Arizona", "AR" => "Arkansas", "CA" => "California", "CO" => "Colorado", "CT" => "Connecticut", "DE" => "Delaware", "DC" => "District of Columbia", "FL" => "Florida", "GA" => "Georgia", "HI" => "Hawaii", "ID" => "Idaho", "IL" => "Illinois", "IN" => "Indiana", "IA" => "Iowa", "KS" => "Kansas", "KY" => "Kentucky", "LA" => "Louisiana", "ME" => "Maine", "MD" => "Maryland", "MA" => "Massachusetts", "MI" => "Michigan", "MN" => "Minnesota", "MS" => "Mississippi", "MO" => "Missouri", "MT" => "Montana", "NE" => "Nebraska", "NV" => "Nevada", "NH" => "New Hampshire", "NJ" => "New Jersey", "NM" => "New Mexico", "NY" => "New York", "NC" => "North Carolina", "ND" => "North Dakota", "OH" => "Ohio", "OK" => "Oklahoma", "OR" => "Oregon", "PA" => "Pennsylvania", "RI" => "Rhode Island", "SC" => "South Carolina", "SD" => "South Dakota", "TN" => "Tennessee", "TX" => "Texas", "UT" => "Utah", "VT" => "Vermont", "VA" => "Virginia", "WA" => "Washington", "WV" => "West Virginia", "WI" => "Wisconsin", "WY" => "Wyoming");
     parent::__construct($label, $name, $options, $properties);
 }
Пример #6
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array(null => "--Select Country--", "United States[US]" => "United States", "Afghanistan[AF]" => "Afghanistan", "Aland Islands[AX]" => "Aland Islands", "Albania[AL]" => "Albania", "Algeria[DZ]" => "Algeria", "American Samoa[AS]" => "American Samoa", "Andorra[AD]" => "Andorra", "Angola[AO]" => "Angola", "Anguilla[AI]" => "Anguilla", "Antarctica[AQ]" => "Antarctica", "Antigua and Barbuda[AG]" => "Antigua and Barbuda", "Argentina[AR]" => "Argentina", "Armenia[AM]" => "Armenia", "Aruba[AW]" => "Aruba", "Australia[AU]" => "Australia", "Austria[AT]" => "Austria", "Azerbaijan[AZ]" => "Azerbaijan", "Bahamas, The[BS]" => "Bahamas, The", "Bahrain[BH]" => "Bahrain", "Bangladesh[BD]" => "Bangladesh", "Barbados[BB]" => "Barbados", "Belarus[BY]" => "Belarus", "Belgium[BE]" => "Belgium", "Belize[BZ]" => "Belize", "Benin[BJ]" => "Benin", "Bermuda[BM]" => "Bermuda", "Bhutan[BT]" => "Bhutan", "Bolivia[BO]" => "Bolivia", "Bosnia and Herzegovina[BA]" => "Bosnia and Herzegovina", "Botswana[BW]" => "Botswana", "Bouvet Island[BV]" => "Bouvet Island", "Brazil[BR]" => "Brazil", "British Indian Ocean Territory[IO]" => "British Indian Ocean Territory", "Brunei Darussalam[BN]" => "Brunei Darussalam", "Bulgaria[BG]" => "Bulgaria", "Burkina Faso[BF]" => "Burkina Faso", "Burundi[BI]" => "Burundi", "Cambodia[KH]" => "Cambodia", "Cameroon[CM]" => "Cameroon", "Canada[CA]" => "Canada", "Cape Verde[CV]" => "Cape Verde", "Cayman Islands[KY]" => "Cayman Islands", "Central African Republic[CF]" => "Central African Republic", "Chad[TD]" => "Chad", "Chile[CL]" => "Chile", "China[CN]" => "China", "Christmas Island[CX]" => "Christmas Island", "Cocos (Keeling) Islands[CC]" => "Cocos (Keeling) Islands", "Colombia[CO]" => "Colombia", "Comoros[KM]" => "Comoros", "Congo[CG]" => "Congo", "Congo, The Democratic Republic Of The[CD]" => "Congo, The Democratic Republic Of The", "Cook Islands[CK]" => "Cook Islands", "Costa Rica[CR]" => "Costa Rica", "Cote D'ivoire[CI]" => "Cote D'ivoire", "Croatia[HR]" => "Croatia", "Cyprus[CY]" => "Cyprus", "Czech Republic[CZ]" => "Czech Republic", "Denmark[DK]" => "Denmark", "Djibouti[DJ]" => "Djibouti", "Dominica[DM]" => "Dominica", "Dominican Republic[DO]" => "Dominican Republic", "Ecuador[EC]" => "Ecuador", "Egypt[EG]" => "Egypt", "El Salvador[SV]" => "El Salvador", "Equatorial Guinea[GQ]" => "Equatorial Guinea", "Eritrea[ER]" => "Eritrea", "Estonia[EE]" => "Estonia", "Ethiopia[ET]" => "Ethiopia", "Falkland Islands (Malvinas)[FK]" => "Falkland Islands (Malvinas)", "Faroe Islands[FO]" => "Faroe Islands", "Fiji[FJ]" => "Fiji", "Finland[FI]" => "Finland", "France[FR]" => "France", "French Guiana[GF]" => "French Guiana", "French Polynesia[PF]" => "French Polynesia", "French Southern Territories[TF]" => "French Southern Territories", "Gabon[GA]" => "Gabon", "Gambia, The[GM]" => "Gambia, The", "Georgia[GE]" => "Georgia", "Germany[DE]" => "Germany", "Ghana[GH]" => "Ghana", "Gibraltar[GI]" => "Gibraltar", "Greece[GR]" => "Greece", "Greenland[GL]" => "Greenland", "Grenada[GD]" => "Grenada", "Guadeloupe[GP]" => "Guadeloupe", "Guam[GU]" => "Guam", "Guatemala[GT]" => "Guatemala", "Guernsey[GG]" => "Guernsey", "Guinea[GN]" => "Guinea", "Guinea-Bissau[GW]" => "Guinea-Bissau", "Guyana[GY]" => "Guyana", "Haiti[HT]" => "Haiti", "Heard Island and the McDonald Islands[HM]" => "Heard Island and the McDonald Islands", "Holy See[VA]" => "Holy See", "Honduras[HN]" => "Honduras", "Hong Kong[HK]" => "Hong Kong", "Hungary[HU]" => "Hungary", "Iceland[IS]" => "Iceland", "India[IN]" => "India", "Indonesia[ID]" => "Indonesia", "Iraq[IQ]" => "Iraq", "Ireland[IE]" => "Ireland", "Isle Of Man[IM]" => "Isle Of Man", "Israel[IL]" => "Israel", "Italy[IT]" => "Italy", "Jamaica[JM]" => "Jamaica", "Japan[JP]" => "Japan", "Jersey[JE]" => "Jersey", "Jordan[JO]" => "Jordan", "Kazakhstan[KZ]" => "Kazakhstan", "Kenya[KE]" => "Kenya", "Kiribati[KI]" => "Kiribati", "Korea, Republic Of[KR]" => "Korea, Republic Of", "Kuwait[KW]" => "Kuwait", "Kyrgyzstan[KG]" => "Kyrgyzstan", "Lao People's Democratic Republic[LA]" => "Lao People's Democratic Republic", "Latvia[LV]" => "Latvia", "Lebanon[LB]" => "Lebanon", "Lesotho[LS]" => "Lesotho", "Liberia[LR]" => "Liberia", "Libya[LY]" => "Libya", "Liechtenstein[LI]" => "Liechtenstein", "Lithuania[LT]" => "Lithuania", "Luxembourg[LU]" => "Luxembourg", "Macao[MO]" => "Macao", "Macedonia, The Former Yugoslav Republic Of[MK]" => "Macedonia, The Former Yugoslav Republic Of", "Madagascar[MG]" => "Madagascar", "Malawi[MW]" => "Malawi", "Malaysia[MY]" => "Malaysia", "Maldives[MV]" => "Maldives", "Mali[ML]" => "Mali", "Malta[MT]" => "Malta", "Marshall Islands[MH]" => "Marshall Islands", "Martinique[MQ]" => "Martinique", "Mauritania[MR]" => "Mauritania", "Mauritius[MU]" => "Mauritius", "Mayotte[YT]" => "Mayotte", "Mexico[MX]" => "Mexico", "Micronesia, Federated States Of[FM]" => "Micronesia, Federated States Of", "Moldova, Republic Of[MD]" => "Moldova, Republic Of", "Monaco[MC]" => "Monaco", "Mongolia[MN]" => "Mongolia", "Montenegro[ME]" => "Montenegro", "Montserrat[MS]" => "Montserrat", "Morocco[MA]" => "Morocco", "Mozambique[MZ]" => "Mozambique", "Myanmar[MM]" => "Myanmar", "Namibia[NA]" => "Namibia", "Nauru[NR]" => "Nauru", "Nepal[NP]" => "Nepal", "Netherlands[NL]" => "Netherlands", "Netherlands Antilles[AN]" => "Netherlands Antilles", "New Caledonia[NC]" => "New Caledonia", "New Zealand[NZ]" => "New Zealand", "Nicaragua[NI]" => "Nicaragua", "Niger[NE]" => "Niger", "Nigeria[NG]" => "Nigeria", "Niue[NU]" => "Niue", "Norfolk Island[NF]" => "Norfolk Island", "Northern Mariana Islands[MP]" => "Northern Mariana Islands", "Norway[NO]" => "Norway", "Oman[OM]" => "Oman", "Pakistan[PK]" => "Pakistan", "Palau[PW]" => "Palau", "Palestinian Territories[PS]" => "Palestinian Territories", "Panama[PA]" => "Panama", "Papua New Guinea[PG]" => "Papua New Guinea", "Paraguay[PY]" => "Paraguay", "Peru[PE]" => "Peru", "Philippines[PH]" => "Philippines", "Pitcairn[PN]" => "Pitcairn", "Poland[PL]" => "Poland", "Portugal[PT]" => "Portugal", "Puerto Rico[PR]" => "Puerto Rico", "Qatar[QA]" => "Qatar", "Reunion[RE]" => "Reunion", "Romania[RO]" => "Romania", "Russian Federation[RU]" => "Russian Federation", "Rwanda[RW]" => "Rwanda", "Saint Barthelemy[BL]" => "Saint Barthelemy", "Saint Helena[SH]" => "Saint Helena", "Saint Kitts and Nevis[KN]" => "Saint Kitts and Nevis", "Saint Lucia[LC]" => "Saint Lucia", "Saint Martin[MF]" => "Saint Martin", "Saint Pierre and Miquelon[PM]" => "Saint Pierre and Miquelon", "Saint Vincent and The Grenadines[VC]" => "Saint Vincent and The Grenadines", "Samoa[WS]" => "Samoa", "San Marino[SM]" => "San Marino", "Sao Tome and Principe[ST]" => "Sao Tome and Principe", "Saudi Arabia[SA]" => "Saudi Arabia", "Senegal[SN]" => "Senegal", "Serbia[RS]" => "Serbia", "Seychelles[SC]" => "Seychelles", "Sierra Leone[SL]" => "Sierra Leone", "Singapore[SG]" => "Singapore", "Slovakia[SK]" => "Slovakia", "Slovenia[SI]" => "Slovenia", "Solomon Islands[SB]" => "Solomon Islands", "Somalia[SO]" => "Somalia", "South Africa[ZA]" => "South Africa", "South Georgia and the South Sandwich Islands[GS]" => "South Georgia and the South Sandwich Islands", "Spain[ES]" => "Spain", "Sri Lanka[LK]" => "Sri Lanka", "Suriname[SR]" => "Suriname", "Svalbard and Jan Mayen[SJ]" => "Svalbard and Jan Mayen", "Swaziland[SZ]" => "Swaziland", "Sweden[SE]" => "Sweden", "Switzerland[CH]" => "Switzerland", "Taiwan[TW]" => "Taiwan", "Tajikistan[TJ]" => "Tajikistan", "Tanzania, United Republic Of[TZ]" => "Tanzania, United Republic Of", "Thailand[TH]" => "Thailand", "Timor-leste[TL]" => "Timor-leste", "Togo[TG]" => "Togo", "Tokelau[TK]" => "Tokelau", "Tonga[TO]" => "Tonga", "Trinidad and Tobago[TT]" => "Trinidad and Tobago", "Tunisia[TN]" => "Tunisia", "Turkey[TR]" => "Turkey", "Turkmenistan[TM]" => "Turkmenistan", "Turks and Caicos Islands[TC]" => "Turks and Caicos Islands", "Tuvalu[TV]" => "Tuvalu", "Uganda[UG]" => "Uganda", "Ukraine[UA]" => "Ukraine", "United Arab Emirates[AE]" => "United Arab Emirates", "United Kingdom[GB]" => "United Kingdom", "United States Minor Outlying Islands[UM]" => "United States Minor Outlying Islands", "Uruguay[UY]" => "Uruguay", "Uzbekistan[UZ]" => "Uzbekistan", "Vanuatu[VU]" => "Vanuatu", "Venezuela[VE]" => "Venezuela", "Vietnam[VN]" => "Vietnam", "Virgin Islands, British[VG]" => "Virgin Islands, British", "Virgin Islands, U.S.[VI]" => "Virgin Islands, U.S.", "Wallis and Futuna[WF]" => "Wallis and Futuna", "Western Sahara[EH]" => "Western Sahara", "Yemen[YE]" => "Yemen", "Zambia[ZM]" => "Zambia", "Zimbabwe[ZW]" => "Zimbabwe");
     parent::__construct($label, $name, $options, $properties);
 }
Пример #7
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array("" => "--Select Country--", "US" => "United States", "AF" => "Afghanistan", "AX" => "Aland Islands", "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, The", "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", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos (Keeling) Islands", "CO" => "Colombia", "KM" => "Comoros", "CG" => "Congo", "CD" => "Congo, The Democratic Republic Of The", "CK" => "Cook Islands", "CR" => "Costa Rica", "CI" => "Cote D'ivoire", "HR" => "Croatia", "CY" => "Cyprus", "CZ" => "Czech Republic", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands (Malvinas)", "FO" => "Faroe Islands", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "GF" => "French Guiana", "PF" => "French Polynesia", "TF" => "French Southern Territories", "GA" => "Gabon", "GM" => "Gambia, The", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GP" => "Guadeloupe", "GU" => "Guam", "GT" => "Guatemala", "GG" => "Guernsey", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "HM" => "Heard Island and the McDonald Islands", "VA" => "Holy See", "HN" => "Honduras", "HK" => "Hong Kong", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IQ" => "Iraq", "IE" => "Ireland", "IM" => "Isle Of Man", "IL" => "Israel", "IT" => "Italy", "JM" => "Jamaica", "JP" => "Japan", "JE" => "Jersey", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", "KR" => "Korea, Republic Of", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Lao People's Democratic Republic", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macao", "MK" => "Macedonia, The Former Yugoslav Republic Of", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MQ" => "Martinique", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "MX" => "Mexico", "FM" => "Micronesia, Federated States Of", "MD" => "Moldova, Republic Of", "MC" => "Monaco", "MN" => "Mongolia", "ME" => "Montenegro", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "MM" => "Myanmar", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", "NF" => "Norfolk Island", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PS" => "Palestinian Territories", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "RE" => "Reunion", "RO" => "Romania", "RU" => "Russian Federation", "RW" => "Rwanda", "BL" => "Saint Barthelemy", "SH" => "Saint Helena", "KN" => "Saint Kitts and Nevis", "LC" => "Saint Lucia", "MF" => "Saint Martin", "PM" => "Saint Pierre and Miquelon", "VC" => "Saint Vincent and The Grenadines", "WS" => "Samoa", "SM" => "San Marino", "ST" => "Sao Tome and Principe", "SA" => "Saudi Arabia", "SN" => "Senegal", "RS" => "Serbia", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "GS" => "South Georgia and the South Sandwich Islands", "ES" => "Spain", "LK" => "Sri Lanka", "SR" => "Suriname", "SJ" => "Svalbard and Jan Mayen", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania, United Republic Of", "TH" => "Thailand", "TL" => "Timor-leste", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "GB" => "United Kingdom", "UM" => "United States Minor Outlying Islands", "UY" => "Uruguay", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VE" => "Venezuela", "VN" => "Vietnam", "VG" => "Virgin Islands, British", "VI" => "Virgin Islands, U.S.", "WF" => "Wallis and Futuna", "EH" => "Western Sahara", "YE" => "Yemen", "ZM" => "Zambia", "ZW" => "Zimbabwe");
     parent::__construct($label, $name, $options, $properties);
 }