Changeset 1048
- Timestamp:
- 11/28/08 18:05:15 (3 years ago)
- Location:
- trunk/core/lib/Foswiki
- Files:
-
- 2 edited
-
Plugin.pm (modified) (8 diffs)
-
Plugins.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/Foswiki/Plugin.pm
r1041 r1048 115 115 116 116 undef $this->{name}; 117 undef $this->{ installWeb};117 undef $this->{topicWeb}; 118 118 undef $this->{module}; 119 119 undef $this->{errors}; … … 129 129 my ($this) = @_; 130 130 my $p = $Foswiki::cfg{Plugins}{$this->{name}}{Module}; 131 $this->{installWeb} = $Foswiki::cfg{SystemWebName};132 131 133 132 if (defined $p) { … … 150 149 my $noTopic = eval '$' . $p . '::NO_PREFS_IN_TOPIC'; 151 150 $this->{no_topic} = $noTopic; 152 $this->{installWeb} = undef; # not known yet 153 154 # Find the plugin topic, if required 155 if ($noTopic) { 156 $this->{installWeb} = $Foswiki::cfg{SystemWebName}; 157 } else { 158 my $store = $this->{session}->{store}; 159 160 foreach my $web (split(/[, ]+/, 161 $Foswiki::cfg{Plugins}{WebSearchPath}), 162 $this->{session}->{webName}) { 163 if ( $store->topicExists( $web, $this->{name} ) ) { 164 $this->{installWeb} = $web; 165 last; 166 } 167 } 168 if (!$this->{installWeb}) { 151 $this->{topicWeb} = undef; # not known yet 152 153 unless ($noTopic) { 154 if (!$this->topicWeb()) { 169 155 # not found 170 156 push( … … 175 161 ); 176 162 $noTopic = 1; 177 $this->{installWeb} = $Foswiki::cfg{SystemWebName};178 163 } 179 164 } … … 230 215 my $prefs = $this->{session}->{prefs}; 231 216 if ( !$this->{no_topic} ) { 232 $prefs->pushPreferences( $this->{ installWeb}, $this->{name}, 'PLUGIN',217 $prefs->pushPreferences( $this->{topicWeb}, $this->{name}, 'PLUGIN', 233 218 uc( $this->{name} ) . '_' ); 234 219 } … … 249 234 $Foswiki::Plugins::SESSION->{webName}, 250 235 $users->getLoginName( $Foswiki::Plugins::SESSION->{user} ), 251 $this->{ installWeb}236 $this->{topicWeb} 252 237 ); 253 238 use strict 'refs'; … … 329 314 $version = $release . ', ' . $version if $release; 330 315 331 my $result = ' ' . $this->{installWeb} . '.' . $this->{name} . ' '; 316 my $web = $this->topicWeb(); 317 my $result = ' ' . ($web ? "$web." : '!') . $this->{name} . ' '; 332 318 $result .= 333 319 CGI::span( { class => 'twikiGrayText twikiSmall' }, … … 337 323 } 338 324 325 =begin TML 326 327 ---++ ObjectMethod topicWeb() -> $webname 328 329 Find the web that has the topic for this plugin by searching the 330 {Plugins}{WebSearchPath} 331 332 =cut 333 334 sub topicWeb { 335 my $this = shift; 336 337 unless ( $this->{topicWeb}) { 338 # Find the plugin topic, if required 339 my $store = $this->{session}->{store}; 340 341 foreach my $web (split(/[, ]+/, 342 $Foswiki::cfg{Plugins}{WebSearchPath}), 343 $this->{session}->{webName}) { 344 if ( $store->topicExists( $web, $this->{name} ) ) { 345 $this->{topicWeb} = $web; 346 last; 347 } 348 } 349 } 350 return $this->{topicWeb}; 351 } 352 339 353 1; -
trunk/core/lib/Foswiki/Plugins.pm
r1041 r1048 393 393 $td = CGI::td('none'); 394 394 } 395 die "BALLS $plugin->{name}" unless $plugin->{installWeb};395 my $web = $plugin->topicWeb(); 396 396 $text .= CGI::Tr( 397 397 { valign => 'top' }, 398 398 CGI::td( 399 ' ' . $plugin->{installWeb} . '.' . $plugin->{name} .' '399 ' ' . ($web ? "$web." : '!').$plugin->{name}.' ' 400 400 ) 401 401 . $td
Note: See TracChangeset
for help on using the changeset viewer.
