API:EPrints/Plugin/Screen/SetLang

From EPrints Documentation
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Plugin::Screen::SetLang - Screen plugin for setting a cookie for the language to use on repository web pages.

User Comments


DESCRIPTION

This plugin allows a cookie called eprints_lang to set that specifies the language that be used for the current visitor to the repository.

This takes the value of the lang attribute from the HTTP GET of the request (/cgi/set_lang) to set the cookie.

Once the language is set the user is returned the page they original came from, which now should display in their preferred lanaguage.

User Comments


METHODS

User Comments


from

EPrints::Plugin::Screen::SetLang->from

Creates the eprints_lang cookie using the value of lang attribute from the HTTP GET of the request (/cgi/set_lang).

Once the cookie is set the client is redirected back to their original page (specified by the Referrer header of the request or the repository homepage.

User Comments


render_action_link

EPrints::Plugin::Screen::SetLang->render_action_link

Returns a XHTML DOM fragment for a link or links to alternative languages that could be used on the repository, (including a link to clear the currently selected language). Once one of these links is clicked, the eprints_lang cookie will be updated appropriately.

User Comments


render

EPrints::Plugin::Screen::SetLang->render

Returns an XHTML DOM object that is a rendering of screen. As the client should be always be redirected from this page, once the eprints_lang cookie is updated, it just contain as message saying the redirect failed.

User Comments


COPYRIGHT

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments