Changeset 325
- Timestamp:
- 09/21/07 21:26:39 (1 year ago)
- Files:
-
- trunk/Elsewhere/plugins/Elsewhere/elsewhere.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Elsewhere/plugins/Elsewhere/elsewhere.pl
r323 r325 43 43 }, 44 44 callbacks => { 45 'MT::App::CMS::template_output.edit_author' => sub { 46 $plugin->insert_profile_link( @_ ); 47 }, 48 'MT::App::CMS::template_output.other_profiles' => sub { 45 'MT::App::CMS::template_source.users_content_nav' => sub { 49 46 $plugin->insert_profile_link( @_ ); 50 47 }, … … 87 84 sub insert_profile_link { 88 85 my $plugin = shift; 89 my( $cb, $app, $html_ref , $param, $tmpl) = @_;86 my( $cb, $app, $html_ref ) = @_; 90 87 my $base_uri = $app->uri; 91 $$html_ref =~ s/(<li>.*?Permissions<\/a><\/li>)/$1\n<li><a href="$base_uri?__mode=other_profiles">Other Profiles<\/a><\/li>/; 88 my $mode = $app->mode; 89 my $active = $mode eq 'other_profiles' ? ' class="active"' : ''; 90 if ( $active ) { 91 $$html_ref =~ s/<li class="active">/<li>/g; 92 } 93 ## Somewhat nasty: we need to match in users_content_nav.tmpl under 94 ## only certain scenarios, i.e. in the Author Profile cases of that 95 ## template. Yuck. 96 $$html_ref =~ s/(<li[^>]*>.*?author_id=.*?<__trans phrase="Permissions"><\/a><\/li>)/$1\n<li$active><a href="$base_uri?__mode=other_profiles">Other Profiles<\/a><\/li>/g; 92 97 } 93 98
