Exemple #1
0
    // function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
    $dropDownFieldNameArray = array("serial" => $loc["DropDownFieldName_Serial"]);
    if (isset($_SESSION['loginEmail'])) {
        // add drop down items for user-specific record identifiers:
        $dropDownFieldNameArray["call_number"] = $loc["DropDownFieldName_MyCallNumber"];
        $dropDownFieldNameArray["cite_key"] = $loc["DropDownFieldName_MyCiteKey"];
        // adjust the width of the table cell holding the drop down:
        $recordIDCellWidth = "140";
    } else {
        $recordIDCellWidth = "85";
    }
    $dropDownItems2 = buildSelectMenuOptions($dropDownFieldNameArray, "//", "\t\t\t", true);
    // function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
    // Build HTML elements that allow for search suggestions for text entered by the user:
    if (isset($_SESSION['userAutoCompletions']) and $_SESSION['userAutoCompletions'] == "yes") {
        $suggestElements = buildSuggestElements("recordID", "showSuggestions", "showSuggestProgress", "id-recordIDSelector-", "\t\t", "[';',',',' ']");
    } else {
        $suggestElements = "";
    }
    // Start <form> and <table> holding the form elements:
    //
    // TODO: use divs + CSS styling (instead of a table-based layout) for _all_ output, especially for 'viewType=Mobile'
    ?>

<form action="show.php" method="GET" name="show">
<input type="hidden" name="formType" value="show">
<input type="hidden" name="submit" value="<?php 
    echo $loc["ButtonTitle_ShowRecord"];
    ?>
">
<input type="hidden" name="showLinks" value="1">
Exemple #2
0
$dropDownConditionals2Array = array("is greater than" => $loc["is greater than"], "is less than" => $loc["is less than"], "is within range" => $loc["is within range"], "is within list" => $loc["is within list"]);
$dropDownItems2 = buildSelectMenuOptions($dropDownConditionals2Array, "//", "\t\t\t", true);
// function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
// TODO: if possible, we should use function 'mapFieldNames()' here
$dropDownFieldNameArray = array("author" => $loc["DropDownFieldName_Author"], "title" => $loc["DropDownFieldName_Title"], "year" => $loc["DropDownFieldName_Year"], "publication" => $loc["DropDownFieldName_Publication"], "volume_numeric" => $loc["DropDownFieldName_Volume"], "pages" => $loc["DropDownFieldName_Pages"]);
$dropDownItems3 = buildSelectMenuOptions($dropDownFieldNameArray, "//", "\t\t\t", true);
// function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
// Build HTML elements that allow for search suggestions for text entered by the user:
if (isset($_SESSION['userAutoCompletions']) and $_SESSION['userAutoCompletions'] == "yes") {
    $authorSuggestElements = buildSuggestElements("authorName", "authorSuggestions", "authorSuggestProgress", "col-author-");
    // function 'buildSuggestElements()' is defined in 'include.inc.php'
    $titleSuggestElements = buildSuggestElements("titleName", "titleSuggestions", "titleSuggestProgress", "col-title-");
    $yearSuggestElements = buildSuggestElements("yearNo", "yearSuggestions", "yearSuggestProgress", "col-year-");
    $publicationSuggestElements = buildSuggestElements("publicationName2", "publicationSuggestions", "publicationSuggestProgress", "col-publication-");
    $volumeSuggestElements = buildSuggestElements("volumeNo", "volumeSuggestions", "volumeSuggestProgress", "col-volume-");
    $pagesSuggestElements = buildSuggestElements("pagesNo", "pagesSuggestions", "pagesSuggestProgress", "col-pages-");
} else {
    $authorSuggestElements = "";
    $titleSuggestElements = "";
    $yearSuggestElements = "";
    $publicationSuggestElements = "";
    $volumeSuggestElements = "";
    $pagesSuggestElements = "";
}
// (2b) Start <form> and <table> holding the form elements:
?>

<form action="search.php" method="GET" name="simpleSearch">
<input type="hidden" name="formType" value="simpleSearch">
<input type="hidden" name="showQuery" value="0">
<table align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds the search form">
Exemple #3
0
    if (isset($loginEmail) and $loginEmail == $adminLoginEmail) {
        $locationSuggestElements = buildSuggestElements("locationName", "locationSuggestions", "locationSuggestProgress", "col-location-", "\t\t", "';'");
        $callNumberSuggestElements = buildSuggestElements("callNumberName", "callNumberSuggestions", "callNumberSuggestProgress", "col-call_number-", "\t\t", "[';','@']");
    } else {
        $locationSuggestElements = "";
        $callNumberSuggestElements = buildSuggestElements("callNumberNameUserOnly", "callNumberSuggestions", "callNumberSuggestProgress", "col-call_number-", "\t\t", "[';','@']");
    }
    $userKeysSuggestElements = buildSuggestElements("userKeysName", "userKeysSuggestions", "userKeysSuggestProgress", "col-user_keys-", "\t\t", "';'");
    $userNotesSuggestElements = buildSuggestElements("userNotesName", "userNotesSuggestions", "userNotesSuggestProgress", "col-user_notes-", "\t\t", "';'");
    $userFileSuggestElements = buildSuggestElements("userFileName", "userFileSuggestions", "userFileSuggestProgress", "col-user_file-");
    $userGroupsSuggestElements = buildSuggestElements("userGroupsName", "userGroupsSuggestions", "userGroupsSuggestProgress", "col-user_groups-", "\t\t", "';'");
    $citeKeySuggestElements = buildSuggestElements("citeKeyName", "citeKeySuggestions", "citeKeySuggestProgress", "col-cite_key-");
    $relatedSuggestElements = buildSuggestElements("relatedName", "relatedSuggestions", "relatedSuggestProgress", "col-related-", "\t\t", "';'");
    $urlSuggestElements = buildSuggestElements("urlName", "urlSuggestions", "urlSuggestProgress", "col-url-");
    $doiSuggestElements = buildSuggestElements("doiName", "doiSuggestions", "doiSuggestProgress", "col-doi-");
    $onlineCitationSuggestElements = buildSuggestElements("onlineCitationName", "onlineCitationSuggestions", "onlineCitationSuggestProgress", "col-online_citation-");
} else {
    $authorSuggestElements = "";
    $titleSuggestElements = "";
    $yearSuggestElements = "";
    $publicationSuggestElements = "";
    $abbrevJournalSuggestElements = "";
    $volumeSuggestElements = "";
    $issueSuggestElements = "";
    $pagesSuggestElements = "";
    $keywordsSuggestElements = "";
    $addressSuggestElements = "";
    $corporateAuthorSuggestElements = "";
    $publisherSuggestElements = "";
    $placeSuggestElements = "";
    $editorSuggestElements = "";
Exemple #4
0
function buildRefineSearchElements($href, $queryURL, $showQuery, $showLinks, $showRows, $citeStyle, $citeOrder, $dropDownFieldsArray, $dropDownFieldSelected, $displayType)
{
    global $loc;
    // '$loc' is made globally available in 'core.php'
    global $client;
    $encodedCiteStyle = rawurlencode($citeStyle);
    $encodedClient = rawurlencode($client);
    $accessKeyAttribute = addAccessKey("attribute", "refine");
    $accessKeyTitle = addAccessKey("title", "refine");
    // build HTML elements that allow for search suggestions for text entered by the user:
    if ($href == "search.php" and (isset($_SESSION['userAutoCompletions']) and $_SESSION['userAutoCompletions'] == "yes")) {
        $suggestElements = buildSuggestElements("refineSearchName", "refineSearchSuggestions", "refineSearchSuggestProgress", "id-refineSearchSelector-", "\t\t\t\t\t");
    } else {
        $suggestElements = "";
    }
    $refineSearchForm = <<<EOF
\t\t<form action="{$href}" method="GET" name="refineSearch">
\t\t\t<fieldset>
\t\t\t\t<legend>{$loc['SearchWithinResults']}:</legend>
\t\t\t\t<input type="hidden" name="formType" value="refineSearch">
\t\t\t\t<input type="hidden" name="submit" value="{$loc['ButtonTitle_Search']}">
\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="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<div id="refineField">
\t\t\t\t\t<label for="refineSearchSelector">{$loc['Field']}:</label>
\t\t\t\t\t<select id="refineSearchSelector" name="refineSearchSelector" title="{$loc['DescriptionSelectFieldRefineResultsForm']}">
EOF;
    // build correct option tags from the column items provided:
    $optionTags = buildSelectMenuOptions($dropDownFieldsArray, "//", "\t\t\t\t\t\t", true);
    $optionTags = preg_replace("/<option([^>]* value=\"{$dropDownFieldSelected}\")/", "<option\\1 selected", $optionTags);
    // add 'selected' attribute
    $refineSearchForm .= $optionTags;
    $refineSearchForm .= <<<EOF

\t\t\t\t\t</select>
\t\t\t\t\t<label for="refineSearchName">{$loc['contains']}:</label>
\t\t\t\t\t<input type="text" id="refineSearchName" name="refineSearchName" size="11"{$accessKeyAttribute} title="{$loc['DescriptionEnterSearchString']}{$accessKeyTitle}">{$suggestElements}
\t\t\t\t</div>
\t\t\t\t<div id="refineOpt">
\t\t\t\t\t<input type="checkbox" id="refineSearchExclude" name="refineSearchExclude" value="1" title="{$loc['DescriptionExcludeResultsCheckboxRefineResultsForm']}">
\t\t\t\t\t<label for="refineSearchExclude">{$loc['ExcludeMatches']}</label>
\t\t\t\t</div>
\t\t\t\t<div id="refineSubmit">
\t\t\t\t\t<input type="submit" class="button secondary" name="submit" value="{$loc['ButtonTitle_Search']}" title="{$loc['DescriptionSearchButtonRefineResultsForm']}">
\t\t\t\t</div>
\t\t\t</fieldset>
\t\t</form>

EOF;
    return $refineSearchForm;
}