[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Here?s my though for the best route? this is a slightly more difficult nut to crack than it first seems.
Whilst this works, in my mind it?s a bit ?hacky? ? the links are still present in a page where you don?t want them ? a crawler can still find them.
As the page being served is a cached copy, there isn?t the same access to the EPrint object that you?d have in e.g. an EPrint::View screen ? so adding a link to the toolbar / template isn?t straightforward either.
My two suggestions are:
1. Use a Screen plugin that checks the URL if the request ? trying to match ^(\d+)\D?$ as the EPrint ID
2. Use a Screen plugin that access the Apache request, and looks for $r->pnotes( ?eprint? ); or possibly $r->pnotes( ?eprintid? ); and render the control URL from the EPrint object.
I think the second of these *might* be the best solution, but I?m not sure what the performance impact would be.
Anyone have any thoughts on these options?
From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Alan.Stiles
Sent: 04 March 2016 09:35
To: eprints-tech at ecs.soton.ac.uk
It was I who suggested that idea to Andrew on the user group list, with the belief that some aspect of the user profile was available in JS. Assuming I was wrong on that front, would the best way to get that detail dynamically be an ajax call to a cgi function to return whether or not the user was an admin and, if not, hide the buttons (possibly requiring a surrounding ?div? or some such on the elements to be hidden). That way the worst that happens if the script fails or JS is disabled is that the buttons are still visible, as they are currently?
Any thoughts folks?
From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of martin.braendle at id.uzh.ch<mailto:martin.braendle at id.uzh.ch>
Sent: 04 March 2016 09:08
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
There is the undocument variable $STAFF_ONLY that can be used in EPScript und EPrints Control Format (EPC).
<epc:if test="$STAFF_ONLY = 'TRUE'">display something here</epc:if>
It is mentioned in http://wiki.eprints.org/w/How_to_control_eprint_workflow_based_on_a_user_field (in the workflow description at the bottom), but not explained there.
In my opinion, that variable (and possible other system variables) should be documented in
Dr. Martin Br?ndle
[Inactive hide details for Andrew Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows y]Andrew Collington ---01/03/2016 14:16:18---Hi all, Is there something set up in ePrints that allows you to get user details (such as type/role,
Von: Andrew Collington <a.p.collington at sussex.ac.uk<mailto:a.p.collington at sussex.ac.uk>>
An: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Datum: 01/03/2016 14:16
Gesendet von: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>
The reason I ask is that I want to show a section in the abstract details only to admins (which is currently set up in cfg/citations/eprint/control.xml). I originally tried to modify that section, but with the caching it obviously didn?t work. I then tried to use a pin but had the same problems. Someone responded to my original EPrints UK User Group post (https://groups.google.com/forum/#!topic/eprints-uk-user-group/LloconUdLDg) suggesting that js may be a good way forward.
If there?s not something already available then I could update the main template to include a json object of the user details which I can then use later on in the page. But hopefully someone else has already tried to add/show content dynamically based on role (or any other user property, I imagine) and can give some advice.
Web Programmer, ITS Client Services
ITS-CS Shawcross, University of Sussex, Falmer, Brighton, BN1 9QT
T: (01273) 872591 (ext. 2591)
E: a.p.collington at sussex.ac.uk<mailto:a.p.collington at sussex.ac.uk>
*** 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/
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 105 bytes
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160304/c3f3b92a/attachment-0001.gif