Skip to content

Commit

Permalink
Item13034: Move JsonRpc switchboard setup
Browse files Browse the repository at this point in the history
Also some tidy changes that were somehow missed.
  • Loading branch information
gac410 committed Sep 22, 2014
1 parent 844d7d4 commit f45eba9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
25 changes: 13 additions & 12 deletions ConfigurePlugin/lib/Foswiki/Plugins/ConfigurePlugin.pm
Expand Up @@ -43,11 +43,7 @@ use constant TRACE => 0;
BEGIN {
# Note: if Foswiki is in bootstrap mode, Foswiki.pm will try
# to require this module, thus executing this BEGIN block.
$Foswiki::cfg{SwitchBoard}{jsonrpc} = {
package => 'Foswiki::Contrib::JsonRpcContrib',
function => 'dispatch',
context => { jsonrpc => 1 }
};

$Foswiki::cfg{Plugins}{ConfigurePlugin}{Enabled} = 1;
$Foswiki::cfg{Plugins}{ConfigurePlugin}{Module} =
'Foswiki::Plugins::ConfigurePlugin';
Expand Down Expand Up @@ -109,30 +105,35 @@ sub initPlugin {
}
}

Foswiki::Func::registerTagHandler( 'DEPENDENCYREPORT', \&_DEPENDENCYREPORT );
Foswiki::Func::registerTagHandler( 'DEPENDENCYREPORT',
\&_DEPENDENCYREPORT );

return 1;

}


sub _DEPENDENCYREPORT {
my ( $session, $params, $topic, $web ) = @_;

require Foswiki::Plugins::ConfigurePlugin::DependencyReport;

print STDERR "PARAM = ($params->{_DEFAULT}) \n" if defined $params->{_DEFAULT};
print STDERR "PARAM = ($params->{_DEFAULT}) \n"
if defined $params->{_DEFAULT};

if ( defined $params->{_DEFAULT} && $params->{_DEFAULT} =~ m/'?extensions'?/ ) {
return Foswiki::Plugins::ConfigurePlugin::DependencyReport::analyzeExtensions()
if ( defined $params->{_DEFAULT}
&& $params->{_DEFAULT} =~ m/'?extensions'?/ )
{
return
Foswiki::Plugins::ConfigurePlugin::DependencyReport::analyzeExtensions(
);
}
else {
return Foswiki::Plugins::ConfigurePlugin::DependencyReport::analyzeFoswiki()
return
Foswiki::Plugins::ConfigurePlugin::DependencyReport::analyzeFoswiki();
}

}


sub _JSONwrap {
my $method = shift;
return sub {
Expand Down
5 changes: 5 additions & 0 deletions core/lib/Foswiki/UI.pm
Expand Up @@ -54,6 +54,11 @@ BEGIN {
function => 'edit',
context => { edit => 1 },
};
$Foswiki::cfg{SwitchBoard}{jsonrpc} = {
package => 'Foswiki::Contrib::JsonRpcContrib',
function => 'dispatch',
context => { jsonrpc => 1 },
};
$Foswiki::cfg{SwitchBoard}{login} = {
package => undef,
function => 'logon',
Expand Down

0 comments on commit f45eba9

Please sign in to comment.