diff --git a/Source/MantisSourcePlugin.class.php b/Source/MantisSourcePlugin.class.php index b37265c..58a5afa 100644 --- a/Source/MantisSourcePlugin.class.php +++ b/Source/MantisSourcePlugin.class.php @@ -29,6 +29,11 @@ public $type = null; /** + * Override this to "true" if there are configuration options for the vcs plugin. + */ + public $configuration = false; + + /** * Get a long, proper string representing the plugin's source control type. * Should be localized if possible. * @return string Source control name @@ -93,12 +98,22 @@ public function update_repo_form( $p_repo ) {} /** - * Process formelements for custom repository data. + * Process form elements for custom repository data. * @param object Repository */ public function update_repo( $p_repo ) {} /** + * Output form elements for configuration options. + */ + public function update_config_form() {} + + /** + * Process form elements for configuration options. + */ + public function update_config() {} + + /** * If necessary, check GPC inputs to determine if the checkin data * is for a repository handled by this VCS type. * @return array Array with "repo"=>Repository, "data"=>... diff --git a/Source/Source.API.php b/Source/Source.API.php index 2492a18..9bc0d91 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -426,6 +426,8 @@ } } } + + ksort( self::$cache ); } /** @@ -488,6 +490,20 @@ return $value; } + + /** + * Wrap property reference to target object. + */ + function __get( $p_name ) { + return $this->object->$p_name; + } + + /** + * Wrap property mutation to target object. + */ + function __set( $p_name, $p_value ) { + return $this->object->$p_name = $p_value; + } } /** diff --git a/Source/pages/manage_config.php b/Source/pages/manage_config.php index af13923..14be449 100644 --- a/Source/pages/manage_config.php +++ b/Source/pages/manage_config.php @@ -118,6 +118,12 @@ maybe_set_option( 'remote_imports', $f_remote_imports ); maybe_set_option( 'import_urls', serialize( $t_import_urls ) ); +foreach( SourceVCS::all() as $t_type => $t_vcs ) { + if ( $t_vcs->configuration ) { + $t_vcs->update_config(); + } +} + form_security_purge( 'plugin_Source_manage_config' ); print_successful_redirect( plugin_page( 'manage_config_page', true ) ); diff --git a/Source/pages/manage_config_page.php b/Source/pages/manage_config_page.php index d8e4075..c0b1029 100644 --- a/Source/pages/manage_config_page.php +++ b/Source/pages/manage_config_page.php @@ -161,6 +161,15 @@ ?> + $t_vcs ) { + if ( $t_vcs->configuration ) { + echo ''; + $t_vcs->update_config_form(); + } +} +?> +