</option> </select> </td> </tr> </table> <table class="showhide" align="center" border="0" cellpadding="0" cellspacing="10" width="95%"> <tr> <td class="small" width="120" valign="top"> <a href="javascript:toggleVisibility('helptxt','helpToggleimg','helpToggletxt','<?php echo rawurlencode($loc["Help"]); ?> ')"<?php echo addAccessKey("attribute", "search_help"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "search_help"); ?> "> <img id="helpToggleimg" class="toggleimg" src="img/closed.gif" alt="<?php echo $loc["LinkTitle_ToggleVisibility"]; ?> " width="9" height="9" hspace="0" border="0"> <span id="helpToggletxt" class="toggletxt"><?php echo $loc["Help"]; ?> </span> </a> </td> </tr> </table> <table id="helptxt" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds some help text and example queries" style="display: none;">
function showQueryFormAdvanced($dropDownItems1, $dropDownItems2, $dropDownItems3, $dropDownItems4, $showRows, $rowOffset, $indexNamesArray, $viewType) { global $officialDatabaseName; // defined in 'ini.inc.php' global $loc; // defined in 'locales/core.php' // Start <form> and <table> holding the form elements: ?> <form action="opensearch.php" method="GET" name="openSearch"> <input type="hidden" name="formType" value="openSearch"> <input type="hidden" name="submit" value="<?php echo $loc["ButtonTitle_Search"]; ?> "> <input type="hidden" name="viewType" value="<?php echo $viewType; ?> "> <table id="queryform" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds the query form"> <tr> <td width="120" valign="middle"> <div class="sect"><?php if (preg_match("/^Mobile\$/i", $viewType)) { echo $officialDatabaseName; } else { echo $loc["CQLQuery"]; } ?> :</div> </td> <td> <input type="text" name="query" value="" size="60" title="<?php echo $loc["DescriptionEnterSearchString"]; ?> "> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="submit" value="<?php echo $loc["ButtonTitle_Search"]; ?> " title="<?php echo $loc["DescriptionSearchDB"]; ?> "> </td> </tr> </table> <table class="showhide" align="center" border="0" cellpadding="0" cellspacing="10" width="95%"> <tr> <td class="small" width="120" valign="top"> <a href="javascript:toggleVisibility('searchopt','optToggleimg','optToggletxt','<?php echo rawurlencode($loc["DisplayOptions"]); ?> ')"<?php echo addAccessKey("attribute", "search_opt"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "search_opt"); ?> "> <img id="optToggleimg" class="toggleimg" src="img/closed.gif" alt="<?php echo $loc["LinkTitle_ToggleVisibility"]; ?> " width="9" height="9" hspace="0" border="0"> <span id="optToggletxt" class="toggletxt"><?php echo $loc["DisplayOptions"]; ?> </span> </a> </td> </tr> </table> <table id="searchopt" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds search & display options" style="display: none;"> <tr> <td width="120" valign="middle"> <div class="sect"><?php echo $loc["DisplayOptions"]; ?> :</div> </td> <td width="215" valign="top"> <?php echo $loc["StartAtRecord"]; ?> : <input type="text" name="startRecord" value="<?php echo $rowOffset + 1; ?> " size="4" title="<?php echo $loc["DescriptionStartAtRecord"]; ?> "> </td> <td valign="top"> <?php echo $loc["ShowRecordsPerPage_Prefix"]; ?> <input type="text" id="maximumRecords" name="maximumRecords" value="<?php echo $showRows; ?> " size="4" title="<?php echo $loc["DescriptionShowRecordsPerPage"]; ?> "> <?php echo $loc["ShowRecordsPerPage_Suffix"]; ?> </td> </tr> <tr> <td> </td> <td valign="top" colspan="2"> <?php echo $loc["Format"]; ?> : <select name="recordSchema" title="<?php echo $loc["DescriptionSelectCiteFormat"]; ?> "><?php echo $dropDownItems4; ?> </select> </td> </tr> </table> <table class="showhide" align="center" border="0" cellpadding="0" cellspacing="10" width="95%"> <tr> <td class="small" width="120" valign="top"> <a href="javascript:toggleVisibility('helptxt','helpToggleimg','helpToggletxt','<?php echo rawurlencode($loc["HelpAndExamples"]); ?> ')"<?php echo addAccessKey("attribute", "search_help"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "search_help"); ?> "> <img id="helpToggleimg" class="toggleimg" src="img/closed.gif" alt="<?php echo $loc["LinkTitle_ToggleVisibility"]; ?> " width="9" height="9" hspace="0" border="0"> <span id="helpToggletxt" class="toggletxt"><?php echo $loc["HelpAndExamples"]; ?> </span> </a> </td> </tr> </table> <table id="helptxt" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds some help text and example queries" style="display: none;"> <tr> <td width="120" valign="top"> <div class="sect"><?php echo $loc["Help"]; ?> :</div> </td> <td class="helpbody" valign="top"> <div class="even"> This form lets you search the literature database using a standard CQL query (<a href="http://www.loc.gov/standards/sru/specs/cql.html" target="top">Common Query Language</a>). You can simply enter a query term, in which case the <em><?php echo $indexNamesArray["cql.serverChoice"]; ?> </em> field will be searched by default. You can also search any other field, some query examples are given below. An introduction to CQL is given <a href="http://zing.z3950.org/cql/intro.html" target="top">here</a>. </div> </td> </tr> <tr> <td width="120" valign="top"> <div class="sect"><?php echo $loc["Examples"]; ?> :</div> </td> <td class="examples" valign="top"> <div class="even"> Find all records where the <em><?php echo $indexNamesArray["cql.serverChoice"]; ?> </em> field contains the word "ecology": <pre>ecology</pre> </div> <div class="odd"> You can use wildcards anywhere in a search term to match one (<code>?</code>) or more (<code>*</code>) unspecified characters. E.g. this finds all records where the <em><?php echo $indexNamesArray["cql.serverChoice"]; ?> </em> field contains a word that starts with "ecolog": <pre>ecolog*</pre> </div> <div class="even"> Find all records where the <em>title</em> field contains <code>any</code> of the given words ("ecology" OR "diversity"): <pre>title any ecology diversity</pre> </div> <div class="odd"> Find all records where the <em>author</em> field contains <code>all</code> of the given words ("dieckmann" AND "thomas" AND "sullivan"): <pre>author all dieckmann thomas sullivan</pre> </div> <div class="even"> You can also search for <code>exact</code> field matches. E.g. this finds all records where the <em>publication</em> field equals EXACTLY "Marine Ecology Progress Series": <pre>publication exact Marine Ecology Progress Series</pre> </div> <div class="odd"> For numeric fields, the obvious ordered relations (<code><</code>, <code><=</code>, <code>=</code>, <code>>=</code>, <code>></code>) may be used. E.g. this finds all records where the <em>year</em> field is greater than or equals "2005": <pre>year >= 2005</pre> </div> <div class="even"> For numeric fields, you can match a range using the <code>within</code> relation followed by the lower and upper end of the range. E.g. this finds all records where the <em>volume</em> field contains a number between "10" and "20": <pre>volume within 10 20</pre> </div> </td> </tr> </table> </form><?php }
function buildResultsFooter($showRows, $citeStyle, $citeOrder, $displayType, $headerMsg) { global $useVisualEffects; // these variables are defined in 'ini.inc.php' global $allowAnonymousGUIExport; global $displayResultsFooterDefault; global $loc; // defined in 'locales/core.php' if (isset($_SESSION['user_permissions']) and (isset($_SESSION['loginEmail']) and preg_match("/allow_cite|allow_user_groups|allow_export|allow_batch_export/", $_SESSION['user_permissions']) or !isset($_SESSION['loginEmail']) and preg_match("/allow_cite|allow_export|allow_batch_export/", $_SESSION['user_permissions']))) { $resultsFooterToggleText = ""; if (preg_match("/allow_cite/", $_SESSION['user_permissions'])) { $resultsFooterToggleText .= "Cite"; } if (preg_match("/allow_user_groups/", $_SESSION['user_permissions'])) { if (preg_match("/allow_cite/", $_SESSION['user_permissions'])) { if (preg_match("/allow_export|allow_batch_export/", $_SESSION['user_permissions'])) { $resultsFooterToggleText .= ", "; } else { $resultsFooterToggleText .= " & "; } } $resultsFooterToggleText .= "Group"; } if (!isset($_SESSION['loginEmail']) and $allowAnonymousGUIExport == "yes" or isset($_SESSION['loginEmail']) and preg_match("/allow_export|allow_batch_export/", $_SESSION['user_permissions'])) { if (preg_match("/allow_cite|allow_user_groups/", $_SESSION['user_permissions'])) { $resultsFooterToggleText .= " & "; } $resultsFooterToggleText .= "Export"; } $resultsFooterToggleText .= " Options"; if (isset($displayResultsFooterDefault[$displayType]) and $displayResultsFooterDefault[$displayType] == "open") { $resultsFooterDisplayStyle = "block"; $resultsFooterInitialToggleText = encodeHTML($resultsFooterToggleText); } else { $resultsFooterDisplayStyle = "none"; $resultsFooterInitialToggleText = encodeHTML($resultsFooterToggleText); } if ($useVisualEffects == "yes") { $toggleVisibilityFunction = "toggleVisibilitySlide"; } else { $toggleVisibilityFunction = "toggleVisibility"; } $ResultsFooterRow = "\n<div class=\"resultsfooter\">"; $ResultsFooterRow .= "\n<div class=\"showhide\">" . "\n\t<a href=\"javascript:" . $toggleVisibilityFunction . "('resultactions','resultsFooterToggleimg','resultsFooterToggletxt','" . rawurlencode($resultsFooterToggleText) . "')\"" . addAccessKey("attribute", "footer") . " title=\"" . $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "footer") . "\">" . "\n\t\t<h3><i class=\"fa fa-arrow-down\"></i> " . $resultsFooterInitialToggleText . "</h3>" . "\n\t</a>" . "\n</div>"; $ResultsFooterRow .= "\n<div id=\"resultactions\" style=\"display: " . $resultsFooterDisplayStyle . ";\">"; $ResultsFooterRow .= "\n\t<div id=\"selectresults\">" . "\n\t\t<input type=\"radio\" id=\"allRecs\" name=\"recordsSelectionRadio\" value=\"1\" onfocus=\"checkall(false,'marked%5B%5D')\" title=\"cite/group/export all records of the current result set\" checked>" . "\n\t\t<label for=\"allRecs\">All Found Records</label>" . "\n\t\t<input type=\"radio\" id=\"selRecs\" name=\"recordsSelectionRadio\" value=\"0\" onfocus=\"checkall(true,'marked%5B%5D')\" title=\"cite/group/export only those records which you've selected on this page\">" . "\n\t\t<label for=\"selRecs\">Selected Records:</label>" . "\n\t</div>"; // Cite functionality: if (isset($_SESSION['user_permissions']) and preg_match("/allow_cite/", $_SESSION['user_permissions'])) { if (!isset($_SESSION['user_styles'])) { $citeStyleDisabled = " disabled"; } else { $citeStyleDisabled = ""; } if (!isset($_SESSION['user_cite_formats'])) { $citeFormatDisabled = " disabled"; } else { $citeFormatDisabled = ""; } $ResultsFooterRow .= "\n\t<fieldset id=\"citerefs\">" . "\n\t\t<legend>Save Citations:</legend>" . "\n\t\t<input type=\"hidden\" name=\"citeStyle\" value=\"" . rawurlencode($citeStyle) . "\">" . "\n\t\t<input type=\"hidden\" name=\"citeOrder\" value=\"{$citeOrder}\">" . "\n\t\t<input type=\"hidden\" name=\"headerMsg\" value=\"" . rawurlencode($headerMsg) . "\">" . "\n\t\t<label for=\"citeType\">Format:</label>" . "\n\t\t<select id=\"citeType\" name=\"citeType\" title=\"choose how your reference list shall be returned\"{$citeStyleDisabled}{$citeFormatDisabled}>"; if (isset($_SESSION['user_cite_formats'])) { $optionTags = buildSelectMenuOptions($_SESSION['user_cite_formats'], "/ *; */", "\t\t\t", false); // build properly formatted <option> tag elements from the items listed in the 'user_cite_formats' session variable $ResultsFooterRow .= $optionTags; } else { $ResultsFooterRow .= "\n\t\t\t<option>(no formats available)</option>"; } $ResultsFooterRow .= "\n\t\t</select>" . "\n\t\t<input type=\"submit\" class=\"button secondary\" name=\"submit\" value=\"Cite\"" . addAccessKey("attribute", "biblio") . " title=\"build a list of references for all chosen records" . addAccessKey("title", "biblio") . "\"{$citeStyleDisabled}>" . "\n\t</fieldset>"; // Assign the 'selected' param to one of the main non-HTML citation output options (RTF, PDF, LaTeX): if (preg_match("#<option>RTF</option>#i", $ResultsFooterRow)) { $ResultsFooterRow = preg_replace("#<option>RTF</option>#i", "<option selected>RTF</option>", $ResultsFooterRow); } elseif (preg_match("#<option>PDF</option>#i", $ResultsFooterRow)) { $ResultsFooterRow = preg_replace("#<option>PDF</option>#i", "<option selected>PDF</option>", $ResultsFooterRow); } elseif (preg_match("#<option>LaTeX</option>#i", $ResultsFooterRow)) { $ResultsFooterRow = preg_replace("#<option>LaTeX</option>#i", "<option selected>LaTeX</option>", $ResultsFooterRow); } } // User groups functionality: if (isset($_SESSION['loginEmail']) and isset($_SESSION['user_permissions']) and preg_match("/allow_user_groups/", $_SESSION['user_permissions'])) { if (!isset($_SESSION['userGroups'])) { $groupSearchDisabled = " disabled"; // disable the (part of the) 'Add to/Remove from group' form elements if the session variable holding the user's groups isnt't available $groupSearchPopupMenuChecked = ""; $groupSearchTextInputChecked = " checked"; $groupSearchSelectorTitle = "(to setup a new group with all chosen records, enter a group name & click the 'Add' button)"; $groupSearchTextInputTitle = "specify a new group name here, then click the 'Add' button"; } else { $groupSearchDisabled = ""; $groupSearchPopupMenuChecked = " checked"; $groupSearchTextInputChecked = ""; $groupSearchSelectorTitle = "choose the group to (from) which the chosen records shall be added (removed)"; $groupSearchTextInputTitle = "specify a new group name here, then click the 'Add' button"; } $ResultsFooterRow .= "\n\t<fieldset id=\"grouprefs\">" . "\n\t\t<legend>Add to (Remove from) Group:</legend>" . "\n\t\t<div id=\"myGroup\">" . "\n\t\t\t<input type=\"radio\" id=\"myGroupRadio\" name=\"userGroupActionRadio\" value=\"1\" title=\"add (remove) the chosen records to (from) an existing group\"{$groupSearchDisabled}{$groupSearchPopupMenuChecked}>" . "\n\t\t\t<label for=\"userGroupSelector\">My:</label>" . "\n\t\t\t<select id=\"userGroupSelector\" name=\"userGroupSelector\" onfocus=\"toggleRadio('myGroupRadio', 'newGroupRadio', false)\" title=\"{$groupSearchSelectorTitle}\"{$groupSearchDisabled}>"; if (isset($_SESSION['userGroups'])) { $optionTags = buildSelectMenuOptions($_SESSION['userGroups'], "/ *; */", "\t\t\t\t", false); // build properly formatted <option> tag elements from the items listed in the 'userGroups' session variable $ResultsFooterRow .= $optionTags; } else { $ResultsFooterRow .= "\n\t\t\t\t<option>(no groups available)</option>"; } $ResultsFooterRow .= "\n\t\t\t</select>" . "\n\t\t</div>" . "\n\t\t<div id=\"newGroup\">" . "\n\t\t\t<input type=\"radio\" id=\"newGroupRadio\" name=\"userGroupActionRadio\" value=\"0\" title=\"setup a new group with the chosen records\"{$groupSearchTextInputChecked}>" . "\n\t\t\t<label for=\"userGroupName\">New:</label>" . "\n\t\t\t<input type=\"text\" id=\"userGroupName\" name=\"userGroupName\" value=\"\" size=\"12\" onfocus=\"toggleRadio('myGroupRadio', 'newGroupRadio', true)\" title=\"{$groupSearchTextInputTitle}\">" . "\n\t\t</div>" . "\n\t\t<div id=\"addRemoveGroup\">" . "\n\t\t\t<input type=\"submit\" class=\"button secondary\" name=\"submit\" value=\"Add\" title=\"add the chosen records to the specified group\">" . "\n\t\t\t<input type=\"submit\" class=\"button secondary\" name=\"submit\" value=\"Remove\" title=\"remove the chosen records from the specified group\"{$groupSearchDisabled}>" . "\n\t\t</div>" . "\n\t</fieldset>"; } // Export functionality: if (!isset($_SESSION['loginEmail']) and $allowAnonymousGUIExport == "yes" or isset($_SESSION['loginEmail']) and isset($_SESSION['user_permissions']) and preg_match("/allow_export|allow_batch_export/", $_SESSION['user_permissions'])) { if (!isset($_SESSION['user_export_formats'])) { $exportFormatDisabled = " disabled"; } else { $exportFormatDisabled = ""; } $ResultsFooterRow .= "\n\t<fieldset id=\"exportrefs\">" . "\n\t\t<legend>Export Records:</legend>" . "\n\t\t<input type=\"hidden\" name=\"exportType\" value=\"file\">" . "\n\t\t<label for=\"exportFormat\">Format:</label>" . "\n\t\t<select id=\"exportFormat\" name=\"exportFormat\" title=\"choose the export format for your references\"{$exportFormatDisabled}>"; if (isset($_SESSION['user_export_formats'])) { $optionTags = buildSelectMenuOptions($_SESSION['user_export_formats'], "/ *; */", "\t\t\t", false); // build properly formatted <option> tag elements from the items listed in the 'user_export_formats' session variable $ResultsFooterRow .= $optionTags; } else { $ResultsFooterRow .= "\n\t\t\t<option>(no formats available)</option>"; } $ResultsFooterRow .= "\n\t\t</select>" . "\n\t\t<input type=\"submit\" class=\"button secondary\" name=\"submit\" value=\"Export\"" . addAccessKey("attribute", "export") . " title=\"export all chosen records" . addAccessKey("title", "export") . "\"{$exportFormatDisabled}>" . "\n\t</fieldset>"; } $ResultsFooterRow .= "\n</div>" . "\n</div>"; } else { $ResultsFooterRow = ""; } // return an empty string if the 'user_permissions' session variable does NOT contain any of the following: 'allow_cite', 'allow_user_groups', 'allow_export', 'allow_batch_export' return $ResultsFooterRow; }
function showPageFooter($HeaderString) { global $officialDatabaseName; // usage example: <a href="index.php">[? echo encodeHTML($officialDatabaseName); ?]</a> global $adminLoginEmail; global $hostInstitutionAbbrevName; // usage example: <a href="[? echo $hostInstitutionURL; ?]">[? echo encodeHTML($hostInstitutionAbbrevName); ?] Home</a> global $hostInstitutionName; // (note: in the examples above, square brackets must be replaced by their respective angle brackets) global $hostInstitutionURL; global $helpResourcesURL; global $librarySearchPattern; global $loginWelcomeMsg; // these variables are globally defined in function 'showLogin()' in 'include.inc.php' global $loginStatus; global $loginLinks; global $loginEmail; global $loc; // '$loc' is made globally available in 'core.php' ?> <table class="pagefooter" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds the footer"> <tr> <td class="small" width="105"><a href="index.php"<?php echo addAccessKey("attribute", "home"); ?> title="<?php echo $loc["LinkTitle_Home"] . addAccessKey("title", "home"); ?> "><?php echo $loc["Home"]; ?> </a></td> <td class="small" align="center"><?php // ------------------------------------------------------- // ... include a link to 'opensearch.php': ?> <a href="opensearch.php"<?php echo addAccessKey("attribute", "cql_search"); ?> title="<?php echo $loc["LinkTitle_CQLSearch"] . addAccessKey("title", "cql_search"); ?> "><?php echo $loc["CQLSearch"]; ?> </a><?php // ------------------------------------------------------- if (isset($_SESSION['user_permissions']) and preg_match("/allow_sql_search/", $_SESSION['user_permissions'])) { // ... include a link to 'sql_search.php': ?> | <a href="sql_search.php"<?php echo addAccessKey("attribute", "sql_search"); ?> title="<?php echo $loc["LinkTitle_SQLSearch"] . addAccessKey("title", "sql_search"); ?> "><?php echo $loc["SQLSearch"]; ?> </a><?php } // ------------------------------------------------------- if (!empty($librarySearchPattern)) { // ... include a link to 'library_search.php': ?> | <a href="library_search.php"<?php echo addAccessKey("attribute", "lib_search"); ?> title="<?php echo $loc["LinkTitle_LibrarySearch_Prefix"] . encodeHTML($hostInstitutionName) . $loc["LinkTitle_LibrarySearch_Suffix"] . addAccessKey("title", "lib_search"); ?> "><?php echo $loc["LibrarySearch"]; ?> </a><?php } // ------------------------------------------------------- if (isset($_SESSION['user_permissions']) and preg_match("/allow_details_view/", $_SESSION['user_permissions'])) { // ... include a link to 'show.php': ?> | <a href="show.php"<?php echo addAccessKey("attribute", "show_rec"); ?> title="<?php echo $loc["LinkTitle_ShowRecord"] . addAccessKey("title", "show_rec"); ?> "><?php echo $loc["ShowRecord"]; ?> </a><?php } // ------------------------------------------------------- if (isset($_SESSION['user_permissions']) and preg_match("/allow_cite/", $_SESSION['user_permissions'])) { // ... include a link to 'extract.php': ?> | <a href="extract.php"<?php echo addAccessKey("attribute", "extract"); ?> title="<?php echo $loc["LinkTitle_ExtractCitations"] . addAccessKey("title", "extract"); ?> "><?php echo $loc["ExtractCitations"]; ?> </a><?php } // ------------------------------------------------------- if (isset($_SESSION['loginEmail']) && $loginEmail == $adminLoginEmail) { // ... include a link to 'duplicate_manager.php': ?> | <a href="duplicate_manager.php" title="<?php echo $loc["LinkTitle_ManageDuplicates"]; ?> "><?php echo $loc["ManageDuplicates"]; ?> </a><?php } // ------------------------------------------------------- ?> <?php if (!empty($helpResourcesURL)) { ?> | <a href="<?php echo $helpResourcesURL; ?> " title="<?php echo $loc["LinkTitle_Help"]; ?> "><?php echo $loc["Help"]; ?> </a> <?php } ?> </td> <td class="refbase-credit" align="right" width="15%"> <a href="http://www.refbase.net/"><img src="img/refbase_credit.gif" alt="powered by refbase" width="142" height="51" hspace="0" border="0"></a> </td> </tr> </table><?php }
function showPageHeader($HeaderString) { global $officialDatabaseName; // these variables are defined in 'ini.inc.php' global $hostInstitutionAbbrevName; global $hostInstitutionName; global $hostInstitutionURL; global $helpResourcesURL; global $logoImageURL; global $logoImageWidth; global $logoImageHeight; global $loginWelcomeMsg; // these variables are globally defined in function 'showLogin()' in 'include.inc.php' global $loginStatus; global $loginLinks; global $displayType; global $query; global $queryURL; global $showQuery; global $showLinks; global $showRows; global $citeStyle; global $citeOrder; global $loc; // '$loc' is made globally available in 'core.php' ?> <table class="pageheader" align="center" width="95%" summary="This holds the title logo and info"> <tr> <td rowspan="2" align="left" width="<?php echo $logoImageWidth + 26; ?> "><a href="<?php echo $hostInstitutionURL; ?> "><img src="<?php echo $logoImageURL; ?> " border="0" alt="<?php echo encodeHTML($hostInstitutionAbbrevName); ?> Home" title="<?php echo encodeHTML($hostInstitutionName); ?> " width="<?php echo $logoImageWidth; ?> " height="<?php echo $logoImageHeight; ?> "></a></td> <td width="60%"> <h4><?php echo encodeHTML($officialDatabaseName); ?> </h4> <p><?php echo $HeaderString; ?> </p> <span class="smallup"> <a href="index.php"<?php echo addAccessKey("attribute", "home"); ?> title="<?php echo $loc["LinkTitle_Home"] . addAccessKey("title", "home"); ?> "><?php echo $loc["Home"]; ?> </a> | <a href="show.php?records=all"<?php echo addAccessKey("attribute", "show_all"); ?> title="<?php echo $loc["LinkTitle_ShowAll"] . addAccessKey("title", "show_all"); ?> "><?php echo $loc["ShowAll"]; ?> </a> | <a href="simple_search.php"<?php echo addAccessKey("attribute", "search"); ?> title="<?php echo $loc["LinkTitle_SimpleSearch"] . addAccessKey("title", "search"); ?> "><?php echo $loc["SimpleSearch"]; ?> </a> | <a href="advanced_search.php"<?php echo addAccessKey("attribute", "adv_search"); ?> title="<?php echo $loc["LinkTitle_AdvancedSearch"] . addAccessKey("title", "adv_search"); ?> "><?php echo $loc["AdvancedSearch"]; ?> </a><?php // ------------------------------------------------------- if (isset($_SESSION['user_permissions']) and preg_match("/allow_add/", $_SESSION['user_permissions'])) { // ... include a link to 'record.php?recordAction=add...': ?> | <a href="record.php?recordAction=add"<?php echo addAccessKey("attribute", "add"); ?> title="<?php echo $loc["LinkTitle_AddRecord"] . addAccessKey("title", "add"); ?> "><?php echo $loc["AddRecord"]; ?> </a><?php } // ------------------------------------------------------- if (isset($_SESSION['user_permissions']) and preg_match("/allow_import|allow_batch_import/", $_SESSION['user_permissions'])) { // ... include a link to 'import.php': ?> | <a href="import.php"<?php echo addAccessKey("attribute", "import"); ?> title="<?php echo $loc["LinkTitle_Import"] . addAccessKey("title", "import"); ?> "><?php echo $loc["Import"]; ?> </a><?php } // ------------------------------------------------------- ?> </span> </td> <td class="small" rowspan="2" align="right"> <div id="loginInfo" style="text-align: right"> <div id="loginStatus" style="margin: 5px 0"> <?php echo $loginStatus; ?> <?php echo $loginWelcomeMsg ? ' - ' . $loginWelcomeMsg : ''; ?> </div> <div id="loginLinks" style="margin: 5px 0"> <?php echo $loginLinks; ?> </div> <?php if (!isset($_SESSION['loginEmail'])) { // Display Options: // Get all languages that were setup and enabled by the admin: $languagesArray = getLanguages(""); // function 'getLanguages()' is defined in 'include.inc.php' $languageOptionTags = buildSelectMenuOptions($languagesArray, "/ *; */", "\t\t\t", true); // build properly formatted <option> tag elements from language items returned by function 'getLanguages()' ?> <div id="language" style="margin: 5px 0"> <form action="select_language.php" method="post"> <div class="row collapse"> <div class="small-10 columns"> <select name="language_id"> <option value="">-- Language --</option> <?php echo $languageOptionTags; ?> </select> </div> <div class="small-2 columns"> <button type="submit" class="button secondary tiny">Select</button> </div> </div> </form> </div> <?php } ?> </div> <div id="queryrefs"> <?php echo buildQuickSearchElements($query, $queryURL, $showQuery, $showLinks, $showRows, $citeStyle, $citeOrder, $displayType); ?> </div> </td> </tr> </table> <?php }
function buildDisplayOptionsElements($href, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $citeStyle, $citeOrder, $dropDownFieldsArray, $dropDownFieldSelected, $fieldsToDisplay, $displayType, $headerMsg) { global $loc; // '$loc' is made globally available in 'core.php' global $client; if ($displayType == "Browse") { $submitValue = $loc["ButtonTitle_Browse"]; $submitTitle = $loc["DescriptionShowButtonDisplayOptionsFormBrowseView"]; $selectorDivID = "optShowHideField"; $selectorID = "displayOptionsSelector"; $selectorLabel = $loc["Field"] . ":"; $selectorTitle = $loc["DescriptionSelectFieldDisplayOptionsFormBrowseView"]; $showRowsLabel = $loc["ShowRecordsPerPage_SuffixBrowseView"]; $showRowsTitle = $loc["DescriptionShowRecordsPerPageBrowseView"]; } elseif ($displayType == "Cite") { $submitValue = $loc["ButtonTitle_Show"]; $submitTitle = $loc["DescriptionShowButtonDisplayOptionsFormCiteView"]; $selectorDivID = "optCiteStyle"; $selectorID = "citeStyle"; $selectorLabel = $loc["Style"] . ":"; $selectorTitle = $loc["DescriptionSelectStyleDisplayOptionsFormCiteView"]; $showRowsLabel = $loc["ShowRecordsPerPage_SuffixCiteView"]; $showRowsTitle = $loc["DescriptionShowRecordsPerPage"]; } elseif ($displayType == "Display") { $submitValue = $loc["ButtonTitle_Show"]; $submitTitle = $loc["DescriptionShowButtonDisplayOptionsFormDetailsView"]; $selectorDivID = "optShowHideField"; $selectorID = "displayOptionsSelector"; $selectorLabel = $loc["Field"] . ":"; $selectorTitle = $loc["DescriptionSelectFieldDisplayOptionsFormDetailsView"]; $showRowsLabel = $loc["ShowRecordsPerPage_Suffix"]; $showRowsTitle = $loc["DescriptionShowRecordsPerPage"]; } else { $submitValue = $loc["ButtonTitle_Show"]; $submitTitle = $loc["DescriptionShowButtonDisplayOptionsForm"]; $selectorDivID = "optShowHideField"; $selectorID = "displayOptionsSelector"; $selectorLabel = $loc["Field"] . ":"; $selectorTitle = $loc["DescriptionSelectFieldDisplayOptionsForm"]; $showRowsLabel = $loc["ShowRecordsPerPage_Suffix"]; $showRowsTitle = $loc["DescriptionShowRecordsPerPage"]; } if ($displayType != "Cite" and $fieldsToDisplay < 2) { $hideButtonDisabled = " disabled"; // disable the 'Hide' button if there's currently only one field being displayed (except the links column) $hideButtonTitle = "(" . $loc["DescriptionHideButtonDisplayOptionsFormOnlyOneField"] . ")"; } else { $hideButtonDisabled = ""; if ($displayType == "Display") { $hideButtonTitle = $loc["DescriptionHideButtonDisplayOptionsFormDetailsView"]; } else { $hideButtonTitle = $loc["DescriptionHideButtonDisplayOptionsForm"]; } } if ($displayType == "Cite" and !isset($_SESSION['user_styles'])) { $citeStyleDisabled = " disabled"; } else { $citeStyleDisabled = ""; } $encodedCiteStyle = rawurlencode($citeStyle); $encodedClient = rawurlencode($client); $encodedHeaderMsg = rawurlencode($headerMsg); $accessKeyAttribute = addAccessKey("attribute", "max_rows"); $accessKeyTitle = addAccessKey("title", "max_rows"); // NOTE: we embed the current value of '$rowOffset' as hidden tag within the 'displayOptions' form. By this, the current row offset can be re-applied after the user pressed the 'Show'/'Hide' button within the 'displayOptions' form. // To avoid that browse links don't behave as expected, the actual value of '$rowOffset' will be adjusted in function 'seekInMySQLResultsToOffset()' to an exact multiple of '$showRows'! $displayOptionsForm = <<<EOF \t\t<form action="{$href}" method="GET" name="displayOptions"> \t\t\t<fieldset> \t\t\t\t<legend>{$loc['DisplayOptions']}:</legend> \t\t\t\t<input type="hidden" name="formType" value="displayOptions"> \t\t\t\t<input type="hidden" name="submit" value="{$submitValue}"> \t\t\t\t<input type="hidden" name="originalDisplayType" value="{$displayType}"> \t\t\t\t<input type="hidden" name="sqlQuery" value="{$queryURL}"> \t\t\t\t<input type="hidden" name="showQuery" value="{$showQuery}"> \t\t\t\t<input type="hidden" name="showLinks" value="{$showLinks}"> \t\t\t\t<input type="hidden" name="rowOffset" value="{$rowOffset}"> \t\t\t\t<input type="hidden" name="showRows" value="{$showRows}"> \t\t\t\t<input type="hidden" name="client" value="{$encodedClient}"> \t\t\t\t<input type="hidden" name="citeStyle" value="{$encodedCiteStyle}"> \t\t\t\t<input type="hidden" name="citeOrder" value="{$citeOrder}"> \t\t\t\t<input type="hidden" name="headerMsg" value="{$encodedHeaderMsg}"> \t\t\t\t<div id="optMain"> \t\t\t\t\t<div id="{$selectorDivID}"> \t\t\t\t\t\t<label for="{$selectorID}">{$selectorLabel}</label> \t\t\t\t\t\t<select id="{$selectorID}" name="{$selectorID}" title="{$selectorTitle}"{$citeStyleDisabled}> EOF; // build correct option tags from the column items provided: $optionTags = buildSelectMenuOptions($dropDownFieldsArray, "//", "\t\t\t\t\t\t\t", true); $optionTags = preg_replace("/<option([^>]* value=\"{$dropDownFieldSelected}\")/", "<option\\1 selected", $optionTags); // add 'selected' attribute $displayOptionsForm .= $optionTags; $displayOptionsForm .= <<<EOF \t\t\t\t\t\t</select> \t\t\t\t\t</div> EOF; $displayOptionsForm .= <<<EOF \t\t\t\t\t<div id="optSubmit"> \t\t\t\t\t\t<input type="submit" class="button secondary" name="submit" value="{$submitValue}" title="{$submitTitle}"> EOF; if (!preg_match("/^(Browse|Cite)\$/i", $displayType)) { $displayOptionsForm .= "\n\t\t\t\t\t\t<input type=\"submit\" class=\"button secondary\" name=\"submit\" value=\"" . $loc["ButtonTitle_Hide"] . "\" title=\"{$hideButtonTitle}\"{$hideButtonDisabled}>"; } $displayOptionsForm .= <<<EOF \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t\t<div id="optOther"> EOF; if ($displayType == "Cite") { $displayOptionsForm .= <<<EOF \t\t\t\t\t<div id="optCiteOrder"> \t\t\t\t\t\t<label for="citeOrder">{$loc['SortBy']}:</label> \t\t\t\t\t\t<select id="citeOrder" name="citeOrder" title="{$loc['DescriptionSelectOrderDisplayOptionsFormCiteView']}"> EOF; // build correct option tags for the "Sort by" ('citeOrder') dropdown menu (and select the currently chosen option): $citeOrderItemsArray = array("author" => $loc["DropDownFieldName_Author"], "year" => $loc["DropDownFieldName_Year"], "type" => $loc["DropDownFieldName_Type"], "type-year" => $loc["DropDownFieldName_TypeYear"], "creation-date" => $loc["DropDownFieldName_CreationDate"]); $citeOrderOptionTags = buildSelectMenuOptions($citeOrderItemsArray, "//", "\t\t\t\t\t\t\t", true); if (isset($citeOrderItemsArray[$citeOrder])) { $citeOrderOptionTags = preg_replace("/<option([^>]*)>(" . $citeOrderItemsArray[$citeOrder] . ")<\\/option>/", "<option\\1 selected>\\2</option>", $citeOrderOptionTags); } else { // add & select a "(custom order)" option (which indicates that the current sort order matches none of the above 'citeOrder' options): $citeOrderOptionTags = "\n\t\t\t\t\t\t\t<option value=\"\" selected>(" . $loc["DropDownFieldName_Custom"] . ")</option>" . $citeOrderOptionTags; } $displayOptionsForm .= $citeOrderOptionTags; $displayOptionsForm .= <<<EOF \t\t\t\t\t\t</select> \t\t\t\t\t</div> EOF; } $displayOptionsForm .= <<<EOF \t\t\t\t\t<div id="optRecsPerPage"> \t\t\t\t\t\t<label for="showRows">{$showRowsLabel}</label> \t\t\t\t\t\t<input type="text" id="showRows" name="showRows" value="{$showRows}" size="4"{$accessKeyAttribute} title="{$showRowsTitle}{$accessKeyTitle}"> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</fieldset> \t\t</form> EOF; return $displayOptionsForm; }
function displayResultsHeader($href, $formElementsGroup, $formElementsRefine, $formElementsDisplayOptions, $displayType) { global $useVisualEffects; // these variables are defined in 'ini.inc.php' global $displayResultsHeaderDefault; global $loc; // defined in 'locales/core.php' $resultsHeaderToggleText = "Search & Display Options"; if (isset($displayResultsHeaderDefault[$displayType]) and $displayResultsHeaderDefault[$displayType] == "open") { $resultsHeaderDisplayStyle = "block"; $resultsHeaderToggleImage = "img/open.gif"; $resultsHeaderInitialToggleText = encodeHTML($resultsHeaderToggleText); } else { $resultsHeaderDisplayStyle = "none"; $resultsHeaderToggleImage = "img/closed.gif"; $resultsHeaderInitialToggleText = encodeHTML($resultsHeaderToggleText); // function 'encodeHTML()' is defined in 'include.inc.php' } if ($useVisualEffects == "yes") { $toggleVisibilityFunction = "toggleVisibilitySlide"; } else { $toggleVisibilityFunction = "toggleVisibility"; } ?> <div class="resultsheader"> <div class="showhide"> <a href="javascript:<?php echo $toggleVisibilityFunction; ?> ('resultoptions','resultsHeaderToggleimg','resultsHeaderToggletxt','<?php echo rawurlencode($resultsHeaderToggleText); ?> ')"<?php echo addAccessKey("attribute", "header"); ?> title="<?php echo $loc["LinkTitle_ToggleVisibility"] . addAccessKey("title", "header"); ?> "> <h3><i class="fa fa-arrow-down"></i> <?php echo $resultsHeaderInitialToggleText; ?> </h3> </a> </div> <div id="resultoptions" style="display: <?php echo $resultsHeaderDisplayStyle; ?> ;"> <div id="showgroup"> <?php echo $formElementsGroup; ?> </div> <div id="refineresults"> <?php echo $formElementsRefine; ?> </div> <div id="displayopt"> <?php echo $formElementsDisplayOptions; ?> </div> </div> </div><?php }