gwynne Thu Aug 9 11:08:49 2007 UTC
Modified files:
/phd/setup Configurator.class.php Option_Metadata.inc.php
Log:
- Fix typo in require()
- Correct processing of themes directory by setup
http://cvs.php.net/viewvc.cgi/phd/setup/Configurator.class.php?r1=1.6&r2=1.7&diff_format=u
Index: phd/setup/Configurator.class.php
diff -u phd/setup/Configurator.class.php:1.6
phd/setup/Configurator.class.php:1.7
--- phd/setup/Configurator.class.php:1.6 Wed Aug 8 23:26:05 2007
+++ phd/setup/Configurator.class.php Thu Aug 9 11:08:49 2007
@@ -1,6 +1,6 @@
<?php
-/* $Id: Configurator.class.php,v 1.6 2007/08/08 23:26:05 gwynne Exp $
+/* $Id: Configurator.class.php,v 1.7 2007/08/09 11:08:49 gwynne Exp $
+-------------------------------------------------------------------------+
| Copyright(c) 2007 |
| Authors: |
@@ -14,7 +14,7 @@
+-------------------------------------------------------------------------+
*/
-require_once 'Template_file.class.php';
+require_once 'Template_File.class.php';
class PhD_Configurator {
http://cvs.php.net/viewvc.cgi/phd/setup/Option_Metadata.inc.php?r1=1.7&r2=1.8&diff_format=u
Index: phd/setup/Option_Metadata.inc.php
diff -u phd/setup/Option_Metadata.inc.php:1.7
phd/setup/Option_Metadata.inc.php:1.8
--- phd/setup/Option_Metadata.inc.php:1.7 Wed Aug 8 23:26:05 2007
+++ phd/setup/Option_Metadata.inc.php Thu Aug 9 11:08:49 2007
@@ -1,6 +1,6 @@
<?php
-/* $Id: Option_Metadata.inc.php,v 1.7 2007/08/08 23:26:05 gwynne Exp $
+/* $Id: Option_Metadata.inc.php,v 1.8 2007/08/09 11:08:49 gwynne Exp $
+-------------------------------------------------------------------------+
| Copyright(c) 2007 |
| Authors: |
@@ -37,6 +37,27 @@
return $lists[ $name ];
}
+function OPTIONS_META_scan_dirs_dir( $name ) {
+ static $lists = NULL;
+
+ if ( is_null( $lists ) ) {
+ $lists = array();
+ }
+ if ( !isset( $lists[ $name ] ) ) {
+ $path = dirname( __FILE__ ) . "/../{$name}";
+ if ( ( $files = @scandir( $path ) ) === FALSE ) {
+ PhD_Error( strtoupper( $name ) . '_UNREADABLE' );
+ }
+ $folderList = array_filter( $files,
+ create_function( '$v', 'return is_dir( "'.$path.'/{$v}" ) &&
!in_array( $v, array( ".", "..", ".svn", "CVS" ) );' ) );
+ if ( count( $folderList ) == 0 ) {
+ PhD_Error( strtoupper( $name ) . '_UNAVAILABLE' );
+ }
+ $lists[ $name ] = $folderList;
+ }
+ return $lists[ $name ];
+}
+
function OPTIONS_META_get_languages() {
global $OPTIONS_DATA, $OPTIONS;
static $languages = NULL;
@@ -105,7 +126,7 @@
MESSAGE
,
'value_list_func' => create_function( '', <<<~FUNCTION
-return OPTIONS_META_scan_script_dir( 'themes' );
+return array_merge( array( 'default' ), OPTIONS_META_scan_dirs_dir( 'themes' )
);
FUNCTION
),
'prompt' => 'Choose a theme',