* @copyright 2004 by http://wombat.exit0.net * @package wombatSite * @subpackage formDatasource */ /** * datasource for Wombat framework * * @version 0.1 * @package wombatSite * @subpackage formDatasource */ class wbFormDatasource_Lang extends wbFormDatasource { /** * default values of used attributes * @access private * @var array $_params */ var $_atts = array( 'area' => 'user' ); /** * returns values suitable for patForms-Elements * * @access public * @return boolean $result true on success */ function getValues() { $values = array(); array_push( $values, array( 'value' => '', 'label' => _('--- default language ---') ) ); if( isset( $this->_atts['area'] ) && $this->_atts['area'] == 'admin') { $conf = wbFactory::getParam( 'config' ); $conf =& wbFactory::singleton( 'patConfiguration' ); $conf->loadConfig( 'admin.xml' ); $langs = $conf->getConfigValue( 'languages' ); $conf->clearConfigValue(); } else { $conf = wbFactory::getParam( 'config' ); $langs = $conf['languages']; } foreach( $langs as $lang ) { $label = $lang; if( $lang == 'C' ) { $label = _( 'System language (English)' ); } array_push( $values, array( 'value' => $lang, 'label' => $label ) ); } return $values; } } ?>