Difference between revisions of "API:EPrints/Handle/CGI"

From EPrints Documentation
Jump to: navigation, search
m (adding Category:Rubbish, page was emptied 9 years ago and has been untouched since)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<!-- Pod2Wiki=_preamble_
+
[[Category: Rubbish]]
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
+
-->
+
__NOTOC__
+
{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Handle/CGI.pm|package_name=EPrints::Handle::CGI}}[[Category:API|CGI]]<div><!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=head_name --></div>
+
==NAME==
+
'''EPrints::Handle::CGI''' - CGI methods for EPrints::Handle
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=head_synopsis --></div>
+
==SYNOPSIS==
+
  my $user = $handle-&gt;current_user;
+
  EPrints::abort() unless( defined $user );
+
 
+
  my $epid = $handle-&gt;param( "eprintid" );
+
 
+
  $handle-&gt;redirect( "http://www.eprints.org/" );
+
 
+
  my $current_page_uri = $handle-&gt;get_uri();
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=head_description --></div>
+
==DESCRIPTION==
+
This module provides additional methods to EPrints::Handle and is not an object in its own right.
+
 
+
Look at EPrints::Handle for further information on how to access the  Handle methods.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=head_methods --></div>
+
==METHODS==
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_request --></div>
+
===$request = $handle-&gt;get_request;===
+
 
+
Return the Apache request object (from mod_perl) or undefined if  this isn't a CGI script.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_query --></div>
+
===$query = $handle-&gt;get_query;===
+
 
+
Return the CGI.pm object describing the current HTTP query, or  undefined if this isn't a CGI script.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_uri --></div>
+
===$uri = $handle-&gt;get_uri===
+
 
+
Returns the URL of the current script. Or "undef".
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_full_url --></div>
+
===$uri = $handle-&gt;get_full_url===
+
 
+
Returns the URL of the current script plus the CGI params.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_secure --></div>
+
===$secure = $handle-&gt;get_secure===
+
 
+
Returns true if we're using HTTPS/SSL (checks get_online first).
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_redirect --></div>
+
===$handle-&gt;redirect( $url, [%opts] )===
+
 
+
Redirects the browser to $url.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_send_http_header --></div>
+
===$handle-&gt;send_http_header( %opts )===
+
 
+
Send the HTTP header. Only makes sense if this is running as a CGI  script.
+
 
+
Opts supported are:
+
 
+
content_type. Default value is "text/html; charset=UTF-8". This sets the http content type header.
+
 
+
lang. If this is set then a cookie setting the language preference is set in the http header.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_param --></div>
+
===$value or @values = $handle-&gt;param( $name )===
+
 
+
Passes through to CGI.pm param method.
+
 
+
$value = $handle-&gt;param( $name ): returns the value of CGI parameter $name.
+
 
+
$value = $handle-&gt;param( $name ): returns the value of CGI parameter $name.
+
 
+
@values = $handle-&gt;param: returns an array of the names of all the CGI parameters in the current request.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_have_parameters --></div>
+
===$bool = $handle-&gt;have_parameters===
+
 
+
Return true if the current script had any parameters (post or get)
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_current_user --></div>
+
===$user = $handle-&gt;current_user===
+
 
+
Return the current EPrints::DataObj::User for this session.
+
 
+
Return undef if there isn't one.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_client --></div>
+
===$client = $handle-&gt;client===
+
 
+
Return a string representing the kind of browser that made the  current request.
+
 
+
Options are GECKO, LYNX, MSIE4, MSIE5, MSIE6, ?.
+
 
+
GECKO covers mozilla and firefox.
+
 
+
? is what's returned if none of the others were matched.
+
 
+
These divisions are intended for modifying the way pages are rendered not logging what browser was used. Hence merging mozilla and firefox.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=item_get_http_status --></div>
+
===$status = $handle-&gt;get_http_status===
+
 
+
Return the status of the current HTTP request.
+
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
+
<h4><span style='display:none'>User Comments</span></h4>
+
<!-- Edit below this comment -->
+
 
+
 
+
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
+

Latest revision as of 00:30, 3 October 2018