Andreas, I'm hoping you might update your countryselect extension (I've made it easy for you!)
This will add the ability to use it in the backend using
'inputType' => 'countryselect',
Add a CountrySelectMenu.php file
Code:
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
/**
* TYPOlight webCMS
* Copyright (C) 2005 Leo Feyer
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 2.1 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at http://www.gnu.org/licenses/.
*
* PHP version 5
* @copyright Andreas Schempp 2009
* @author Andreas Schempp <andreas@schempp.ch
* @license LGPL
*/
class CountrySelectMenu extends SelectMenu
{
public function __set($strKey, $varValue)
{
switch ($strKey)
{
case 'options':
break;
default:
parent::__set($strKey, $varValue);
break;
}
}
public function generate()
{
$arrOptions = array(array('label'=>'-', 'value'=>''));
$arrCountries = $this->getCountries();
foreach( $arrCountries as $short => $name )
{
$arrOptions[] = array('label'=>$name, 'value'=>$short);
}
$this->arrOptions = $arrOptions;
return parent::generate();
}
}
And in the config.php add
Code:
/**
* Backend form fields
*/
$GLOBALS['BE_FFL']['countryselect'] = 'CountrySelectMenu';
I'd rather you update yours if its not a hassle, rather than have two extensions in there.
Cheers, murray
Bookmarks