Difference between revisions of "API:EPrints/Plugin/Screen/SetLang"
(Created page with "<!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints 3.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment'...") |
|||
Line 17: | Line 17: | ||
<!-- Pod2Wiki=head_description --> | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
− | This plugin allows a cookie called <tt>eprints_lang</tt> to set that | + | This plugin allows a cookie called <tt>eprints_lang</tt> to set that specifies the language that be used for the current visitor to the repository. |
This takes the value of the <tt>lang</tt> attribute from the HTTP GET of the request (<tt>/cgi/set_lang</tt>) to set the cookie. | This takes the value of the <tt>lang</tt> attribute from the HTTP GET of the request (<tt>/cgi/set_lang</tt>) to set the cookie. |
Latest revision as of 10:36, 2 August 2024
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::Plugin::Screen::SetLang - Screen plugin for setting a cookie for the language to use on repository web pages.
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.
METHODS
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.
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.
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.
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/.