Re: [EP-tech] ScreenProcessor.pm and Admin Screen Messages
John Salter via Eprints-tech <[email protected]>
| Newsgroups | gmane.comp.web.eprints.devel |
|---|---|
| Message-ID | <EMEW3|951dd75ba559f541cc65c059e20e86bcv7C8Gj14eprints-tech-bounces|ecs.soton.ac.uk|DB6PR0302MB271186C8A58C43C223A4B0C6C4D20@DB6PR0302MB2711.eurprd03.prod.outlook.com> |
Hi James, I think you've got all the right parts - you just need to join them all together: - create the link - create the text - append the text to the link - append the link to the message Cheers, John ________________________________ From: [email protected] <[email protected]> on behalf of James Kerwin via Eprints-tech <[email protected]> Sent: 12 August 2019 14:57:39 To: [email protected] <[email protected]> Subject: [EP-tech] ScreenProcessor.pm and Admin Screen Messages Hi All, I have a button on the admin screen that does something when clicked. Then at the top of the screen a message appears upon completion to provide a url for the user to follow (or that is the plan). It usually present a plain text message, but I want a clickable link. At the moment users would need to copy the message text and paste it into the address bar. At the moment I can have either text or a link that can't be seen or clicked, but shows up when you inspect the page. [image.png] Here is my code that I've adapted (only the bit in bold is really relevant): sub add_result_message { my( $self, $ok ) = @_; if( $ok ) { #$self->{processor}->add_message( "message", #$self->html_phrase( "aam_link" ) ); #$self->{processor}->add_message( #"message", #$self->{repository}->make_text( "Please go to https://eur03.safelinks.protection.outlook.com/?url=www.google.co.uk&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C3134cadc840144658f7408d71fbe1c67%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=4gQKo5qRIxQoKHBiIhl%2B81tf9Tam1iWxHp%2BXW7kwE0g%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.google.co.uk&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C3134cadc840144658f7408d71fbe1c67%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=iw%2B3XByh7O2JyFUz81OmntM609dtLDK6zS2UHLUvxXM%3D&reserved=0> to access the AAM Updates.") #); #my $messagelink = my $uri = "https://eur03.safelinks.protection.outlook.com/?url=www.google.co.uk&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C3134cadc840144658f7408d71fbe1c67%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=4gQKo5qRIxQoKHBiIhl%2B81tf9Tam1iWxHp%2BXW7kwE0g%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.google.co.uk&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C3134cadc840144658f7408d71fbe1c67%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=iw%2B3XByh7O2JyFUz81OmntM609dtLDK6zS2UHLUvxXM%3D&reserved=0>"; $self->{processor}->add_message( "message", $self->{repository}->make_text( $self->{session}->render_link( $uri )) ); } Is there a way that I can alter this to show a clickable text link or am I going to need to go further down the EPrints Rabbit Hole? My alternative approach is to alter render_messages in ScreenProcessor.pm, but I don't really want to do that and I also don't know how to make a local archive copy of this file either as it's a few levels up from the plugins directory. Any suggestions or alternative approaches are very welcome. Thanks, James *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/ *** EPrints developers Forum: http://forum.eprints.org/
image.png
(image/png, 17 KB) - not displayed