// Copyright: Matthias Steffens and the file's // original author(s). // // This code is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY. Please see the GNU General Public // License for more details. // // File: ./extract.php // Repository: $HeadURL: file:///svn/p/refbase/code/branches/bleeding-edge/extract.php $ // Author(s): Matthias Steffens // // Created: 29-Jul-02, 16:39 // Modified: $Date: 2012-02-27 20:25:30 +0000 (Mon, 27 Feb 2012) $ // $Author: msteffens $ // $Revision: 1337 $ // Search form that offers to extract // literature cited within a text and build // an appropriate reference list from that. // TODO: I18n // Incorporate some include files: include 'includes/header.inc.php'; // include header include 'includes/footer.inc.php'; // include footer include 'includes/include.inc.php'; // include common functions include 'initialize/ini.inc.php'; // include common variables // -------------------------------------------------------------------- // START A SESSION: // call the 'start_session()' function (from 'include.inc.php') which will also read out available session variables: start_session(true); // -------------------------------------------------------------------- // Initialize preferred display language: // (note that 'locales.inc.php' has to be included *after* the call to the 'start_session()' function) include 'includes/locales.inc.php'; // include the locales // -------------------------------------------------------------------- // If there's no stored message available: if (!isset($_SESSION['HeaderString'])) $HeaderString = "Extract citations from a text and build an appropriate reference list:"; // Provide the default message else { $HeaderString = $_SESSION['HeaderString']; // extract 'HeaderString' session variable (only necessary if register globals is OFF!) // Note: though we clear the session variable, the current message is still available to this script via '$HeaderString': deleteSessionVariable("HeaderString"); // function 'deleteSessionVariable()' is defined in 'include.inc.php' } // Extract the view type requested by the user (either 'Mobile', 'Print', 'Web' or ''): // ('' will produce the default 'Web' output style) if (isset($_REQUEST['viewType'])) $viewType = $_REQUEST['viewType']; else $viewType = ""; // Show the login status: showLogin(); // (function 'showLogin()' is defined in 'include.inc.php') // (2a) Display header: // call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'): displayHTMLhead(encodeHTML($officialDatabaseName) . " -- Extract Citations", "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", false, "", $viewType, array()); showPageHeader($HeaderString); // (2b) Start
and holding the form elements: echo "\n"; echo "\n" . "\n"; // provide a default value for the 'submit' form tag. Otherwise, some browsers may not recognize the correct output format when a user hits within a form field (instead of clicking the "Cite" button) if (!isset($_SESSION['user_styles'])) $citeStyleDisabled = " disabled"; // disable the style popup if the session variable holding the user's styles isn't available else $citeStyleDisabled = ""; if (!isset($_SESSION['user_cite_formats'])) $citeFormatDisabled = " disabled"; // disable the cite format popup if the session variable holding the user's cite formats isn't available else $citeFormatDisabled = ""; echo "\n
" . "\n\n\t\n\t" . "\n\t" . "\n" . "\n\n\t\n\t" . "\n\t" . "\n" . "\n\n\t" . "\n\t" . "\n" . "\n\n\t\n\t" . "\n\t" . "\n" . "\n\n\t" . "\n\t" . "\n" . "\n\n\t\n\t"; if (isset($_SESSION['user_permissions']) AND preg_match("/allow_cite/", $_SESSION['user_permissions'])) // if the 'user_permissions' session variable contains 'allow_cite'... // adjust the title string for the show cite button { $citeButtonLock = ""; $citeTitle = "build a reference list for all citations contained within the entered text"; } else // Note, that disabling the submit button is just a cosmetic thing -- the user can still submit the form by pressing enter or by building the correct URL from scratch! (however, there's some code in 'search.php' that will prevent query execution) { $citeButtonLock = " disabled"; $citeTitle = "not available since you have no permission to use the cite feature"; } echo "\n\t" . "\n" . "\n\n\t" . "\n" . "\n\n\t\n\t" . "\n\t" . "\n" . "\n\n\t\n\t" . "\n\t" . "\n" . "\n
Extract Citations From: 
Serial Delimiters: Specify the character(s) that enclose record serial numbers or cite keys:
 Start Delimiter:        End Delimiter:   
Display Options:    Display Links" . "            Show      records per page
 View type:  " . "\n\t\t" . "\n\t
  \n\t\t
   " . "\n\t\tusing style:  " . "\n\t\t   " . "\n\t\tsort by:  " . "\n\t\t   " . "\n\t\treturn as:  " . "\n\t\t\n\t
 
Help: This form enables you to extract all citations from your text and build an appropriate reference list. To have this work simply include the serial numbers or cite keys of your cited records within your text (as shown below) and enclose the identifiers by some preferrably unique characters. These delimiters must be specified in the text fields above.
Example: Results of the german south polar expedition were published by Hennings (1906) {1141} as well as several other authors (e.g.: Wille 1924 {1785}; Heiden & Kolbe 1928 {1127}).
" . "\n
"; // -------------------------------------------------------------------- // DISPLAY THE HTML FOOTER: // call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php') showPageFooter($HeaderString); displayHTMLfoot(); // -------------------------------------------------------------------- ?>