Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Output, Form Input as Columns #94

Open
wants to merge 15 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _build/properties/properties.formitcountryoptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@
'value' => '',
'lexicon' => 'formit:properties',
),
array(
'name' => 'country',
'desc' => 'prop_fico.country_desc',
'type' => 'textfield',
'options' => '',
'value' => '[[++cultureKey]]',
'lexicon' => 'formit:properties',
),
);

return $properties;
2 changes: 1 addition & 1 deletion _build/properties/properties.formitstateoptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'desc' => 'prop_fiso.country_desc',
'type' => 'textfield',
'options' => '',
'value' => 'us',
'value' => '[[++cultureKey]]',
'lexicon' => 'formit:properties',
),
array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$output = ' checked="checked"';
}
$input = $modx->fromJSON($input);
if (in_array($options,$input)) {
if (!empty($input) && is_array($input) && in_array($options,$input)) {
$output = ' checked="checked"';
}
return $output;
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
$output = ' selected="selected"';
}
$input = $modx->fromJSON($input);
if (in_array($options,$input)) {
$output = ' selected="selected"';
if(is_array($input)){
if (in_array($options,$input)) {
$output = ' selected="selected"';
}
}
return $output;
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path').'components/formit/').'model/formit/formit.class.php';
$fi = new FormIt($modx,$scriptProperties);

/** @var fiCountryOptions $co */
$co = $fi->loadModule('fiStateOptions','stateOptions',$scriptProperties);
$co->initialize();
$co->getData();
$co->iterate();
return $co->output();
/** @var fiStateOptions $so */
$so = $fi->loadModule('fiStateOptions','stateOptions',$scriptProperties);
$so->initialize();
$so->getData();
$so->iterate();
return $so->output();
267 changes: 267 additions & 0 deletions core/components/formit/includes/de.countries.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
<?php
/**
* FormIt
*
* Copyright 2009-2012 by Shaun McCormick <[email protected]>
*
* FormIt is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* FormIt 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
* FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package formit
*/
/**
* Array of countries
* @package formit
* @author Erhard Maria Klein at weitblick.net <[email protected]>
*/
return array(
'AF' => 'Afghanistan',
'EG' => '&Auml;gypten',
'AL' => 'Albanien',
'DZ' => 'Algerien',
'AS' => 'Amerikanisch-Samoa',
'VI' => 'Amerikanische Jungferninseln',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarktis',
'AG' => 'Antigua und Barbuda',
'GQ' => '&Auml;quatorialguinea',
'AR' => 'Argentinien',
'AM' => 'Armenien',
'AW' => 'Aruba',
'AZ' => 'Aserbaidschan',
'ET' => '&Auml;thiopien',
'AU' => 'Australien',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Bangladesch',
'BB' => 'Barbados',
'BE' => 'Belgien',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivien',
'BA' => 'Bosnien-Herzegowina',
'BW' => 'Botsuana',
'BV' => 'Bouvetinsel',
'BR' => 'Brasilien',
'VG' => 'Britische Jungferninseln',
'IO' => 'Britisches Territorium im Indischen Ozean',
'BN' => 'Brunei',
'BG' => 'Bulgarien',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'CL' => 'Chile',
'CK' => 'Cookinseln',
'CR' => 'Costa Rica',
'DK' => 'D&auml;nemark',
'EH' => 'Demokratische Arabische Republik Sahara',
'CD' => 'Demokratische Republik Kongo',
'KP' => 'Demokratische Volksrepublik Korea',
'DE' => 'Deutschland',
'DM' => 'Dominica',
'DO' => 'Dominikanische Republik',
'DJ' => 'Dschibuti',
'EC' => 'Ecuador',
'SV' => 'El Salvador',
'CI' => 'Elfenbeink&uuml;ste',
'ER' => 'Eritrea',
'EE' => 'Estland',
'FK' => 'Falkland Inseln',
'FO' => 'F&auml;r&ouml;er',
'FJ' => 'Fidschi',
'FI' => 'Finnland',
'FR' => 'Frankreich',
'GF' => 'Franz&ouml;sisch Guyana',
'PF' => 'Franz&ouml;sisch-Polynesien',
'TF' => 'Franz&ouml;sische S&uuml;d- und Antarktisgebiete',
'GA' => 'Gabun',
'GM' => 'Gambia',
'GE' => 'Georgien',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GD' => 'Grenada',
'GR' => 'Griechenland',
'GL' => 'Gr&ouml;nland',
'GB' => 'Gro&szlig;britannien und Nordirland',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard-Insel',
'HN' => 'Honduras',
'HK' => 'Hongkong',
'IN' => 'Indien',
'ID' => 'Indonesien',
'IQ' => 'Irak',
'IR' => 'Iran',
'IE' => 'Irland',
'IS' => 'Island',
'IL' => 'Israel',
'IT' => 'Italien',
'JM' => 'Jamaika',
'JP' => 'Japan',
'YE' => 'Jemen',
'JO' => 'Jordanien',
'KY' => 'Kaimaninseln',
'KH' => 'Kambodscha',
'CM' => 'Kamerun',
'CA' => 'Kanada',
'CV' => 'Kap Verde',
'KZ' => 'Kasachstan',
'QA' => 'Katar',
'KE' => 'Kenia',
'KG' => 'Kirgisistan',
'KI' => 'Kiribati',
'CC' => 'Kokos- bzw. Keelinginseln',
'CO' => 'Kolumbien',
'KM' => 'Komoren',
'HR' => 'Kroatien',
'CU' => 'Kuba',
'KW' => 'Kuwait',
'LA' => 'Laos',
'LS' => 'Lesotho',
'LV' => 'Lettland',
'LB' => 'Libanon',
'LR' => 'Liberia',
'LY' => 'Libyen',
'LI' => 'Liechtenstein',
'LT' => 'Litauen',
'LU' => 'Luxemburg',
'MO' => 'Macau',
'MG' => 'Madagaskar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Malediven',
'ML' => 'Mali',
'MT' => 'Malta',
'MA' => 'Marokko',
'MH' => 'Marshallinseln',
'MQ' => 'Martinique',
'MR' => 'Mauretanien',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MK' => 'Mazedonien',
'MX' => 'Mexiko',
'FM' => 'Mikronesien',
'MC' => 'Monaco',
'MN' => 'Mongolei',
'MS' => 'Montserrat',
'MZ' => 'Mosambik',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NC' => 'Neukaledonien',
'NZ' => 'Neuseeland',
'NI' => 'Nicaragua',
'NL' => 'Niederlande',
'AN' => 'Niederl&auml;ndische Antillen',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'MP' => 'N&ouml;rdliche Marianen',
'NF' => 'Norfolkinsel',
'NO' => 'Norwegen',
'OM' => 'Oman',
'TP' => 'Ost-Timor',
'AT' => '&Ouml;sterreich',
'PK' => 'Pakistan',
'PS' => 'Pal&auml;stina',
'PW' => 'Palau',
'PA' => 'Panama',
'PG' => 'Papua-Neuguinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippinen',
'PN' => 'Pitcairninseln',
'PL' => 'Polen',
'PT' => 'Portugal',
'PR' => 'Puerto Rico',
'TW' => 'Republik China (Taiwan)',
'CG' => 'Republik Kongo',
'KR' => 'Republik Korea',
'MD' => 'Republik Moldau',
'RE' => 'R&eacute;union',
'RW' => 'Ruanda',
'RO' => 'Rum&auml;nien',
'RU' => 'Russische F&ouml;deration',
'PM' => 'Saint Pierre und Miquelon',
'SB' => 'Salomonen',
'ZM' => 'Sambia',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tom&eacute; und Pr&iacute;ncipe',
'SA' => 'Saudi-Arabien',
'SE' => 'Schweden',
'CH' => 'Schweiz',
'SN' => 'Senegal',
'CS' => 'Serbien und Montenegro',
'SC' => 'Seychellen',
'SL' => 'Sierra Leone',
'ZW' => 'Simbabwe',
'SG' => 'Singapur',
'SK' => 'Slowakei',
'SI' => 'Slowenien',
'SO' => 'Somalia',
'ES' => 'Spanien',
'SJ' => 'Spitzbergen und Jan Mayen Inseln',
'LK' => 'Sri Lanka',
'SH' => 'St. Helena',
'KN' => 'St. Kitts und Nevis',
'LC' => 'St. Lucia',
'VC' => 'St. Vincent und die Grenadinen',
'GS' => 'S&uuml;d-Georgien und S&uuml;dliche Sandwichinseln',
'ZA' => 'S&uuml;dafrika',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SZ' => 'Swasiland',
'SY' => 'Syrien',
'TJ' => 'Tadschikistan',
'TZ' => 'Tansania',
'TH' => 'Thailand',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad und Tobago',
'TD' => 'Tschad',
'CZ' => 'Tschechische Republik',
'TN' => 'Tunesien',
'TR' => 'T&uuml;rkei',
'TM' => 'Turkmenistan',
'TC' => 'Turks- und Caicosinseln',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'HU' => 'Ungarn',
'UY' => 'Uruguay',
'UZ' => 'Usbekistan',
'VU' => 'Vanuatu',
'VA' => 'Vatikanstadt',
'VE' => 'Venezuela',
'AE' => 'Vereinigte Arabische Emirate',
'US' => 'Vereinigte Staaten von Amerika',
'VN' => 'Vietnam',
'CN' => 'Volksrepublik China',
'WF' => 'Wallis und Futuna',
'CX' => 'Weihnachtsinsel',
'BY' => 'Wei&szlig;ru&szlig;land',
'CF' => 'Zentralafrikanische Republik',
'UM' => 'zur USA geh&ouml;rende Inseln',
'CY' => 'Zypern'
);
Loading