* @copyright 2004 by http://wombat.exit0.net * @package wombatSite * @subpackage formDatasource */ /** * form datasource which finds all static templates * * @version 0.1.0 * @package wombatSite * @subpackage formDatasource */ class wbFormDatasource_LoadModule extends wbFormDatasource { /** * default values of used attributes * @access private * @var array $_atts */ var $_atts = array( ); /** * implement this method * * @access private * @param integer $id * @return boolean $result true on success * @see */ function getValues() { $extDir = wbFactory::getParam( 'systemDir' ) . '/' . wbFactory::getParam( 'includeDir' ) .'/wbModule'; $values = array( array( 'label' => '... select module', 'value' => '' ) ); // read dir $dir = dir( $extDir ); while( ( $entry = $dir->read() ) !== false ) { // skip hidden files if( $entry[0] == '.' ) { continue; } if( is_dir( $extDir . '/' . $entry ) ) { continue; } // see whether it is a php file $val = explode( '.', $entry ); $ext = array_pop( $val ); // skip unknown extensions if( $ext != 'php' ) { continue; } $val = implode( '.', $val ); array_push( $values, array( 'value' => $val, 'label' => $val ) ); } $dir->close(); return $values; } } ?>