Exemplo n.º 1
0
function showQueryPage($operation, $viewType, $showRows, $rowOffset)
{
    global $officialDatabaseName;
    // defined in 'ini.inc.php'
    global $displayType;
    global $loc;
    // defined in 'locales/core.php'
    global $client;
    // If there's no stored message available:
    if (!isset($_SESSION['HeaderString'])) {
        $HeaderString = $loc["SearchDB"] . ":";
    } 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'
    }
    // For HTML output, we'll need to reset the value of the '$displayType' variable
    // (which, by default, is set to "Export"; see above); otherwise, the 'originalDisplayType'
    // parameter in the 'quickSearch' form of the page header would be incorrectly set to "Export"
    $displayType = "";
    // if '$displayType' is empty, 'show.php' will use the default view that's given in session variable 'userDefaultView'
    // Show the login status:
    showLogin();
    // (function 'showLogin()' is defined in 'include.inc.php')
    // DISPLAY header:
    // call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'):
    displayHTMLhead(encodeHTML($officialDatabaseName) . " -- " . $loc["Search"], "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", true, "", $viewType, array());
    if (!preg_match("/^Mobile\$/i", $viewType) and !preg_match("/^inc/i", $client)) {
        // Note: we omit the visible header in mobile view ('viewType=Mobile') and for include mechanisms!
        showPageHeader($HeaderString);
    }
    // Define variables holding common drop-down elements, i.e. build properly formatted <option> tag elements:
    $dropDownConditionals1Array = array("contains" => $loc["contains"], "does not contain" => $loc["contains not"], "is equal to" => $loc["equal to"], "is not equal to" => $loc["equal to not"], "starts with" => $loc["starts with"], "ends with" => $loc["ends with"]);
    $dropDownItems1 = buildSelectMenuOptions($dropDownConditionals1Array, "//", "\t\t\t", true);
    // function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
    $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);
    $dropDownFieldNames1Array = array("author" => $loc["DropDownFieldName_Author"], "address" => $loc["DropDownFieldName_Address"], "corporate_author" => $loc["DropDownFieldName_CorporateAuthor"], "thesis" => $loc["DropDownFieldName_Thesis"], "", "title" => $loc["DropDownFieldName_Title"], "orig_title" => $loc["DropDownFieldName_OrigTitle"], "", "year" => $loc["DropDownFieldName_Year"], "publication" => $loc["DropDownFieldName_Publication"], "abbrev_journal" => $loc["DropDownFieldName_AbbrevJournal"], "editor" => $loc["DropDownFieldName_Editor"], "", "volume_numeric" => $loc["DropDownFieldName_Volume"], "issue" => $loc["DropDownFieldName_Issue"], "pages" => $loc["DropDownFieldName_Pages"], "", "series_title" => $loc["DropDownFieldName_SeriesTitle"], "abbrev_series_title" => $loc["DropDownFieldName_AbbrevSeriesTitle"], "series_editor" => $loc["DropDownFieldName_SeriesEditor"], "series_volume_numeric" => $loc["DropDownFieldName_SeriesVolume"], "series_issue" => $loc["DropDownFieldName_SeriesIssue"], "", "publisher" => $loc["DropDownFieldName_Publisher"], "place" => $loc["DropDownFieldName_Place"], "", "edition" => $loc["DropDownFieldName_Edition"], "medium" => $loc["DropDownFieldName_Medium"], "issn" => $loc["DropDownFieldName_Issn"], "isbn" => $loc["DropDownFieldName_Isbn"], "", "language" => $loc["DropDownFieldName_Language"], "summary_language" => $loc["DropDownFieldName_SummaryLanguage"], "", "keywords" => $loc["DropDownFieldName_Keywords"], "abstract" => $loc["DropDownFieldName_Abstract"], "", "area" => $loc["DropDownFieldName_Area"], "expedition" => $loc["DropDownFieldName_Expedition"], "conference" => $loc["DropDownFieldName_Conference"], "", "doi" => $loc["DropDownFieldName_Doi"], "url" => $loc["DropDownFieldName_Url"]);
    if (isset($_SESSION['loginEmail'])) {
        // we only include the 'file' field if the user is logged in
        $dropDownFieldNames1Array["file"] = $loc["DropDownFieldName_File"];
    }
    $dropDownFieldNames1Array[] = "";
    $dropDownFieldNames1Array["notes"] = $loc["DropDownFieldName_Notes"];
    if (isset($_SESSION['loginEmail'])) {
        // we only include the 'location' field if the user is logged in
        $dropDownFieldNames1Array["location"] = $loc["DropDownFieldName_Location"];
    }
    $dropDownFieldNames2Array = array("call_number" => $loc["DropDownFieldName_CallNumber"], "", "serial" => $loc["DropDownFieldName_Serial"], "type" => $loc["DropDownFieldName_Type"], "approved" => $loc["DropDownFieldName_Approved"], "", "created_date" => $loc["DropDownFieldName_CreatedDate"], "created_time" => $loc["DropDownFieldName_CreatedTime"]);
    if (isset($_SESSION['loginEmail'])) {
        // we only include the 'created_by' field if the user is logged in
        $dropDownFieldNames2Array["created_by"] = $loc["DropDownFieldName_CreatedBy"];
    }
    $dropDownFieldNames2Array[] = "";
    $dropDownFieldNames2Array["modified_date"] = $loc["DropDownFieldName_ModifiedDate"];
    $dropDownFieldNames2Array["modified_time"] = $loc["DropDownFieldName_ModifiedTime"];
    if (isset($_SESSION['loginEmail'])) {
        // we only include the 'modified_by' field if the user is logged in
        $dropDownFieldNames2Array["modified_by"] = $loc["DropDownFieldName_ModifiedBy"];
    }
    $dropDownItems3 = buildSelectMenuOptions(array_merge($dropDownFieldNames1Array, $dropDownFieldNames2Array), "//", "\t\t\t", true);
    $dropDownConditionals3Array = array("html" => "html", "atom" => "Atom XML", "rss" => "RSS XML", "srw_dc" => "SRW_DC XML", "srw_mods" => "SRW_MODS XML");
    $dropDownItems4 = buildSelectMenuOptions($dropDownConditionals3Array, "//", "\t\t\t", true);
    // Map CQL indexes to refbase field names:
    $indexNamesArray = mapCQLIndexes();
    // function 'mapCQLIndexes()' is defined in 'webservice.inc.php'
    // --------------------------------------------------------------------
    // TODO: when the simple CQL Query Builder interface is done, a call to 'opensearch.php' (or 'opensearch.php?operation=simple')
    //       should activate that simple GUI-based interface (currently, it activates the advanced interface that you'd normally only
    //       get via 'opensearch.php?operation=cql' or 'opensearch.php?operation=advanced')
    //		if (preg_match("/^(advanced|CQL)$/i", $operation))
    showQueryFormAdvanced($dropDownItems1, $dropDownItems2, $dropDownItems3, $dropDownItems4, $showRows, $rowOffset, $indexNamesArray, $viewType);
    // let's you enter a standard CQL query directly
    //		else
    //			showQueryFormSimple($dropDownItems1, $dropDownItems2, $dropDownItems3, $dropDownItems4, $showRows, $rowOffset, $indexNamesArray, $viewType); // let's you build a CQL query via dropdown menues
    // --------------------------------------------------------------------
    // DISPLAY THE HTML FOOTER:
    // call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php')
    if (!preg_match("/^Mobile\$/i", $viewType) and !preg_match("/^inc/i", $client)) {
        // Note: we omit the visible footer in mobile view ('viewType=Mobile') and for include mechanisms!
        showPageFooter($HeaderString);
    }
    displayHTMLfoot();
}
Exemplo n.º 2
0
    ?>
:</legend>
							<input type="hidden" name="formType" value="querySearch">
							<input type="hidden" name="showQuery" value="0">
							<input type="hidden" name="showLinks" value="1">
							<div id="recallSelect">
								<label for="querySearchSelector"><?php 
    echo $loc["Query"];
    ?>
:</label>
								<select name="querySearchSelector"<?php 
    echo $querySearchDisabled;
    ?>
><?php 
    if (isset($_SESSION['userQueries'])) {
        $optionTags = buildSelectMenuOptions($_SESSION['userQueries'], "/ *; */", "\t\t\t\t\t\t\t\t\t", false);
        // build properly formatted <option> tag elements from the items listed in the 'userQueries' session variable
        echo $optionTags;
    } else {
        ?>

									<option>(<?php 
        echo $loc["NoQueriesAvl"];
        ?>
)</option><?php 
    }
    ?>

								</select>
							</div>
							<div id="recallSubmit">
Exemplo n.º 3
0
function buildUserResultsFooter($NoColumns)
{
    global $loc;
    // '$loc' is made globally available in 'core.php'
    // Start a TABLE
    $userResultsFooterRow = "\n<table class=\"resultsfooter\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"10\" width=\"95%\" summary=\"This table holds the results footer which offers a form to assign selected users to a group and set their permissions\">";
    $userResultsFooterRow .= "\n<tr>" . "\n\t<td align=\"left\" valign=\"top\">" . "Selected Users:" . "</td>";
    // Admin user groups functionality:
    if (!isset($_SESSION['adminUserGroups'])) {
        $groupSearchDisabled = " disabled";
        // disable the (part of the) 'Add to/Remove from group' form elements if the session variable holding the admin's user groups isn't available
        $groupSearchPopupMenuChecked = "";
        $groupSearchTextInputChecked = " checked";
        $groupSearchSelectorTitle = "(to setup a new group with all selected users, enter a group name to the right, then click the 'Add' button)";
        $groupSearchTextInputTitle = "to setup a new group with the selected users, specify the name of the group here, then click the 'Add' button";
    } else {
        $groupSearchDisabled = "";
        $groupSearchPopupMenuChecked = " checked";
        $groupSearchTextInputChecked = "";
        $groupSearchSelectorTitle = "choose the group to which the selected users shall belong (or from which they shall be removed)";
        $groupSearchTextInputTitle = "to setup a new group with the selected users, click the radio button to the left &amp; specify the name of the group here, then click the 'Add' button";
    }
    $userResultsFooterRow .= "\n\t<td align=\"left\" valign=\"top\" colspan=\"" . ($NoColumns - 1) . "\">" . "\n\t\t<input type=\"submit\" name=\"submit\" value=\"Add\" title=\"add all selected users to the specified group\">&nbsp;" . "\n\t\t<input type=\"submit\" name=\"submit\" value=\"Remove\" title=\"remove all selected users from the specified group\"{$groupSearchDisabled}>&nbsp;&nbsp;&nbsp;group:&nbsp;&nbsp;" . "\n\t\t<input type=\"radio\" name=\"userGroupActionRadio\" value=\"1\" title=\"click here if you want to add (remove) the selected users to (from) an existing group; then, choose the group name from the popup menu to the right\"{$groupSearchDisabled}{$groupSearchPopupMenuChecked}>" . "\n\t\t<select name=\"userGroupSelector\" title=\"{$groupSearchSelectorTitle}\"{$groupSearchDisabled}>";
    if (!isset($_SESSION['adminUserGroups'])) {
        $userResultsFooterRow .= "\n\t\t\t<option>(no groups available)</option>";
    } else {
        $optionTags = buildSelectMenuOptions($_SESSION['adminUserGroups'], "/ *; */", "\t\t\t", false);
        // build properly formatted <option> tag elements from the items listed in the 'adminUserGroups' session variable
        $userResultsFooterRow .= $optionTags;
    }
    $userResultsFooterRow .= "\n\t\t</select>&nbsp;&nbsp;&nbsp;" . "\n\t\t<input type=\"radio\" name=\"userGroupActionRadio\" value=\"0\" title=\"click here if you want to setup a new group; then, enter the group name in the text box to the right\"{$groupSearchTextInputChecked}>" . "\n\t\t<input type=\"text\" name=\"userGroupName\" value=\"\" size=\"8\" title=\"{$groupSearchTextInputTitle}\">" . "\n\t</td>" . "\n</tr>";
    // Set user permissions functionality:
    $userResultsFooterRow .= "\n<tr>" . "\n\t<td align=\"left\" valign=\"top\">&nbsp;</td>" . "\n\t<td align=\"left\" valign=\"top\" colspan=\"" . ($NoColumns - 1) . "\">" . "\n\t\t<input type=\"submit\" name=\"submit\" value=\"Allow\" title=\"allow all selected users to use the specified feature\">&nbsp;" . "\n\t\t<input type=\"submit\" name=\"submit\" value=\"Disallow\" title=\"do not allow the selected users to use the specified feature\">&nbsp;&nbsp;&nbsp;feature:&nbsp;&nbsp;" . "\n\t\t<select name=\"userPermissionSelector\" title=\"select the permission setting you'd like to change for the selected users\">";
    // Map raw field names from table 'user_permissions' with items of the global localization array ('$loc'):
    $userPermissionsArray = array('allow_add' => $loc['UserPermission_AllowAdd'], 'allow_edit' => $loc['UserPermission_AllowEdit'], 'allow_delete' => $loc['UserPermission_AllowDelete'], 'allow_download' => $loc['UserPermission_AllowDownload'], 'allow_upload' => $loc['UserPermission_AllowUpload'], 'allow_list_view' => $loc['UserPermission_AllowListView'], 'allow_details_view' => $loc['UserPermission_AllowDetailsView'], 'allow_print_view' => $loc['UserPermission_AllowPrintView'], 'allow_sql_search' => $loc['UserPermission_AllowSQLSearch'], 'allow_user_groups' => $loc['UserPermission_AllowUserGroups'], 'allow_user_queries' => $loc['UserPermission_AllowUserQueries'], 'allow_rss_feeds' => $loc['UserPermission_AllowRSSFeeds'], 'allow_import' => $loc['UserPermission_AllowImport'], 'allow_export' => $loc['UserPermission_AllowExport'], 'allow_cite' => $loc['UserPermission_AllowCite'], 'allow_batch_import' => $loc['UserPermission_AllowBatchImport'], 'allow_batch_export' => $loc['UserPermission_AllowBatchExport'], 'allow_modify_options' => $loc['UserPermission_AllowModifyOptions']);
    //										'allow_edit_call_number' => $loc['UserPermission_AllowEditCallNumber']);
    $optionTags = buildSelectMenuOptions($userPermissionsArray, "//", "\t\t\t", true);
    // build properly formatted <option> tag elements from the items listed in the '$userPermissionsArray' variable
    $userResultsFooterRow .= $optionTags;
    $userResultsFooterRow .= "\n\t\t</select>" . "\n\t</td>" . "\n</tr>";
    // Finish the table:
    $userResultsFooterRow .= "\n</table>";
    return $userResultsFooterRow;
}
Exemplo n.º 4
0
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 &amp; 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;
}
Exemplo n.º 5
0
    showPageHeader($HeaderString);
    // Define variables holding drop-down elements, i.e. build properly formatted <option> tag elements:
    $dropDownConditionalsArray = array("is equal to" => $loc["equal to"], "contains" => $loc["contains"], "is within list" => $loc["is within list"]);
    $dropDownItems1 = buildSelectMenuOptions($dropDownConditionalsArray, "//", "\t\t\t", true);
    // 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 
Exemplo n.º 6
0
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>&nbsp;|&nbsp;
			<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>&nbsp;|&nbsp;
			<a href="simple_search.php"<?php 
    echo addAccessKey("attribute", "search");
    ?>
 title="<?php 
    echo $loc["LinkTitle_SimpleSearch"] . addAccessKey("title", "search");
    ?>
"><?php 
    echo $loc["SimpleSearch"];
    ?>
</a>&nbsp;|&nbsp;
			<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...':
        ?>

			&nbsp;|&nbsp;<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':
        ?>

			&nbsp;|&nbsp;<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 
}
Exemplo n.º 7
0
        <?php 
echo $loc["ShowRecordsPerPage_Suffix"];
?>
    </td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
</tr><?php 
if (isset($_SESSION['loginEmail'])) {
    // TODO: if possible, we should use function 'mapFieldNames()' here (see also above)
    $userSpecificSortFieldsNameArray = array("", "marked" => $loc["DropDownFieldName_Marked"], "copy" => $loc["DropDownFieldName_Copy"], "selected" => $loc["DropDownFieldName_Selected"], "user_keys" => $loc["DropDownFieldName_UserKeys"], "user_notes" => $loc["DropDownFieldName_UserNotes"], "user_file" => $loc["DropDownFieldName_UserFile"], "user_groups" => $loc["DropDownFieldName_UserGroups"], "cite_key" => $loc["DropDownFieldName_CiteKey"]);
    $dropDownItems4 = buildSelectMenuOptions($userSpecificSortFieldsNameArray, "//", "\t\t\t", true);
    // function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
} else {
    $dropDownItems4 = "";
}
?>

<tr>
	<td>&nbsp;</td>
	<td>1.&nbsp;<?php 
echo $loc["sort by"];
?>
:</td>
	<td>&nbsp;</td>
	<td>
		<select name="sortSelector1"><?php 
Exemplo n.º 8
0
if (isset($_SESSION['user_permissions']) and preg_match("/allow_cite/", $_SESSION['user_permissions'])) {
    $citeButtonLock = "";
    $citeTitle = "build a reference list for all citations contained within the entered text";
} else {
    $citeButtonLock = " disabled";
    $citeTitle = "not available since you have no permission to use the cite feature";
}
echo "\n\t<td>\n\t\t<br><input type=\"submit\" name=\"submit\" value=\"Cite\"{$citeButtonLock} title=\"{$citeTitle}\">&nbsp;&nbsp;&nbsp;" . "\n\t\tusing style:&nbsp;&nbsp;" . "\n\t\t<select name=\"citeStyle\" title=\"choose the output style for your reference list\"{$citeStyleDisabled}>";
if (isset($_SESSION['user_styles'])) {
    $optionTags = buildSelectMenuOptions($_SESSION['user_styles'], "/ *; */", "\t\t\t", false);
    // build properly formatted <option> tag elements from the items listed in the 'user_styles' session variable
    echo $optionTags;
} else {
    echo "\n\t\t\t<option>" . $defaultCiteStyle . "</option>";
}
// defined in 'ini.inc.php'
echo "\n\t\t</select>&nbsp;&nbsp;&nbsp;" . "\n\t\tsort by:&nbsp;&nbsp;" . "\n\t\t<select name=\"citeOrder\" title=\"choose the primary sort order for your reference list\">" . "\n\t\t\t<option value=\"author\">author</option>" . "\n\t\t\t<option value=\"year\">year</option>" . "\n\t\t\t<option value=\"type\">type</option>" . "\n\t\t\t<option value=\"type-year\">type, year</option>" . "\n\t\t\t<option value=\"creation-date\">date created</option>" . "\n\t\t</select>&nbsp;&nbsp;&nbsp;" . "\n\t\treturn as:&nbsp;&nbsp;" . "\n\t\t<select name=\"citeType\" title=\"choose how your reference list shall be returned\"{$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
    echo $optionTags;
} else {
    echo "\n\t\t\t<option>(no formats available)</option>";
}
echo "\n\t\t</select>\n\t</td>" . "\n</tr>" . "\n<tr>\n\t<td align=\"center\" colspan=\"3\">&nbsp;</td>" . "\n</tr>" . "\n<tr>\n\t<td valign=\"top\"><b>Help:</b></td>\n\t<td>&nbsp;</td>" . "\n\t<td valign=\"top\">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.</td>" . "\n</tr>" . "\n<tr>\n\t<td valign=\"top\"><b>Example:</b></td>\n\t<td>&nbsp;</td>" . "\n\t<td valign=\"top\"><code>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 &amp; Kolbe 1928 {1127}).</code></td>" . "\n</tr>" . "\n</table>" . "\n</form>";
// --------------------------------------------------------------------
// DISPLAY THE HTML FOOTER:
// call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php')
showPageFooter($HeaderString);
displayHTMLfoot();
// --------------------------------------------------------------------
Exemplo n.º 9
0
// 'cite_key_format' option:
if (!empty($userOptionsArray['cite_key_format'])) {
    $citeKeyFormat = $userOptionsArray['cite_key_format'];
} else {
    $citeKeyFormat = "";
}
// 'uniquify_duplicate_cite_keys' option:
if (!empty($userOptionsArray) and $userOptionsArray['uniquify_duplicate_cite_keys'] == "yes") {
    $uniquifyDuplicateCiteKeysChecked = " checked";
} else {
    $uniquifyDuplicateCiteKeysChecked = "";
}
// define variable holding drop-down elements:
$dropDownItemArray = array("transliterate" => "transliterate", "strip" => "strip", "keep" => "keep");
// build properly formatted <option> tag elements from array items given in '$dropDownItemArray':
$nonASCIICharsInCiteKeysOptionTags = buildSelectMenuOptions($dropDownItemArray, "//", "\t\t\t", true);
// function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
// 'nonascii_chars_in_cite_keys' option:
if (!empty($userOptionsArray['nonascii_chars_in_cite_keys'])) {
    $useCustomHandlingOfNonASCIICharsInCiteKeysChecked = " checked";
    // select the drop down option chosen by the current user:
    $nonASCIICharsInCiteKeysOptionTags = preg_replace("/<option([^>]*)>" . $userOptionsArray['nonascii_chars_in_cite_keys'] . "/", "<option\\1 selected>" . $userOptionsArray['nonascii_chars_in_cite_keys'], $nonASCIICharsInCiteKeysOptionTags);
} else {
    $useCustomHandlingOfNonASCIICharsInCiteKeysChecked = "";
}
// Start <form> and <table> holding all the form elements:
?>

<form method="POST" action="user_options_modify.php" name="userOptions">
<input type="hidden" name="userID" value="<?php 
echo encodeHTML($userID);
Exemplo n.º 10
0
    $isEditorCheckBoxIsChecked = "";
}
// don't mark the 'is Editor' checkbox
echo "\n\t<td align=\"right\" class=\"mainfieldsbg\"><input type=\"checkbox\" id=\"isEditorCheckBox\" name=\"isEditorCheckBox\" value=\"1\"{$isEditorCheckBoxIsChecked} title=\"" . $loc["DescriptionEditorCheckBox"] . "\">&nbsp;&nbsp;<b>" . $loc["isEditor"] . "</b></td>" . "\n</tr>" . "\n<tr>" . "\n\t<td width=\"74\" class=\"mainfieldsbg\"><b>" . $loc["Title"] . "</b></td>" . "\n\t<td colspan=\"3\" class=\"mainfieldsbg\">" . "\n\t\t" . fieldError("titleName", $errors) . "<input type=\"text\" id=\"titleName\" name=\"titleName\" value=\"{$titleName}\" size=\"47\" title=\"" . $loc["DescriptionTitle"] . "\">" . $titleSuggestElements . "\n\t</td>" . "\n\t<td width=\"74\" class=\"mainfieldsbg\"><b>" . $loc["Type"] . "</b></td>";
if (!isset($_SESSION['user_types'])) {
    $documentTypeDisabled = " disabled";
} else {
    $documentTypeDisabled = "";
}
$recordType = "\n\t<td align=\"right\" class=\"mainfieldsbg\">" . "\n\t\t<select id=\"typeName\" name=\"typeName\" title=\"" . $loc["DescriptionType"] . "\" {$documentTypeDisabled}>";
if (isset($_SESSION['user_types'])) {
    $userTypesAvail = explode("; ", $_SESSION['user_types']);
    $userTypesAvailInv = array_flip($userTypesAvail);
    $localizedTypeName = array('Journal Article' => $loc['typeJournal Article'], 'Abstract' => $loc['typeAbstract'], 'Book Chapter' => $loc['typeBook Chapter'], 'Book Whole' => $loc['typeBook Whole'], 'Conference Article' => $loc['typeConference Article'], 'Conference Volume' => $loc['typeConference Volume'], 'Journal' => $loc['typeJournal'], 'Magazine Article' => $loc['typeMagazine Article'], 'Manual' => $loc['typeManual'], 'Manuscript' => $loc['typeManuscript'], 'Map' => $loc['typeMap'], 'Miscellaneous' => $loc['typeMiscellaneous'], 'Newspaper Article' => $loc['typeNewspaper Article'], 'Patent' => $loc['typePatent'], 'Report' => $loc['typeReport'], 'Software' => $loc['typeSoftware']);
    $userTypesArray = array_intersect_key($localizedTypeName, $userTypesAvailInv);
    $optionTags = buildSelectMenuOptions($userTypesArray, "//", "\t\t\t", true);
    // build properly formatted <option value=""> tag elements from the items listed in the 'user_types' session variable
    $recordType .= $optionTags;
    if ($recordAction == "edit" || $mode == "import") {
        $userTypes = preg_split("/ *; */", $_SESSION['user_types']);
        $optionPresent = false;
        foreach ($userTypes as $userType) {
            if ($userType == $typeName) {
                $optionPresent = true;
            }
        }
        if ($optionPresent != true) {
            $recordType .= "\n\t\t\t<option value=\"{$typeName}\" selected>{$localizedTypeName[$typeName]}</option>";
        }
    }
} else {
Exemplo n.º 11
0
function selectDistinct($connection, $refsTableName, $refsTablePrimaryKey, $userDataTableName, $userDataTablePrimaryKey, $userDataTableUserID, $userDataTableUserIDvalue, $columnName, $pulldownName, $additionalOptionDisplay, $additionalOption, $defaultValue, $RestrictToField, $RestrictToFieldContents, $SplitValues, $SplitPattern, $outputFormat = "HTML SELECT", $searchSuggestionsPattern = "", $wrapSearchSuggestions = true)
{
    $defaultWithinResultSet = FALSE;
    // Query to find distinct values of '$columnName' in '$refsTableName':
    if (isset($_SESSION['loginEmail'])) {
        if ($RestrictToField == "") {
            $distinctQuery = "SELECT DISTINCT {$columnName} FROM {$refsTableName} LEFT JOIN {$userDataTableName} ON {$refsTablePrimaryKey} = {$userDataTablePrimaryKey} AND {$userDataTableUserID} = {$userDataTableUserIDvalue} ORDER BY {$columnName}";
        } else {
            $distinctQuery = "SELECT DISTINCT {$columnName} FROM {$refsTableName} LEFT JOIN {$userDataTableName} ON {$refsTablePrimaryKey} = {$userDataTablePrimaryKey} AND {$userDataTableUserID} = {$userDataTableUserIDvalue} WHERE {$RestrictToField} RLIKE {$RestrictToFieldContents} ORDER BY {$columnName}";
        }
    } else {
        if ($RestrictToField == "") {
            $distinctQuery = "SELECT DISTINCT {$columnName} FROM {$refsTableName} ORDER BY {$columnName}";
        } else {
            $distinctQuery = "SELECT DISTINCT {$columnName} FROM {$refsTableName} WHERE {$RestrictToField} RLIKE {$RestrictToFieldContents} ORDER BY {$columnName}";
        }
    }
    // Run the distinctQuery on the database through the connection:
    $resultId = queryMySQLDatabase($distinctQuery);
    // Retrieve all distinct values:
    $i = 0;
    $resultBuffer = array();
    while ($row = @mysql_fetch_array($resultId)) {
        if ($SplitValues) {
            // split field data on the pattern specified in '$SplitPattern':
            $splittedFieldData = preg_split("#" . $SplitPattern . "#", $row[$columnName]);
            // ... copy all array elements to end of '$resultBuffer':
            foreach ($splittedFieldData as $element) {
                $element = trim($element);
                // NOTE: in case of OpenSearch search suggestions, we only include those substrings
                //       that match the regular expression given in '$searchSuggestionsPattern'
                if (empty($searchSuggestionsPattern) or !empty($searchSuggestionsPattern) and !empty($element) and preg_match("/" . $searchSuggestionsPattern . "/i", $element)) {
                    $resultBuffer[$i++] = $element;
                }
            }
        } else {
            $element = trim($row[$columnName]);
            if (empty($searchSuggestionsPattern) or !empty($searchSuggestionsPattern) and !empty($element)) {
                $resultBuffer[$i++] = $element;
            }
        }
    }
    if ($SplitValues) {
        if (!empty($resultBuffer)) {
            // remove duplicate values from array:
            $resultBuffer = array_unique($resultBuffer);
            // sort in ascending order:
            sort($resultBuffer);
        }
    }
    if ($outputFormat == "ARRAY") {
        return $resultBuffer;
    } else {
        $outputData = "";
        if ($outputFormat == "HTML SELECT") {
            // Start the HTML select widget:
            if ($wrapSearchSuggestions) {
                $outputData = "\n\t\t<select name=\"{$pulldownName}\">";
            }
            $optionTags = "";
            // initialize variable
            // Add any additional option element:
            if (!empty($additionalOptionDisplay) and !empty($additionalOption)) {
                $optionTags .= "\n\t\t\t<option value=\"{$additionalOption}\">{$additionalOptionDisplay}</option>";
            }
            // Build correct option tags from the provided database values:
            $optionTags .= buildSelectMenuOptions($resultBuffer, "//", "\t\t\t", false);
            $outputData .= preg_replace("/<option([^>]*)>({$defaultValue})<\\/option>/", "<option\\1 selected>\\2</option>", $optionTags);
            // add 'selected' attribute
            if ($wrapSearchSuggestions) {
                $outputData .= "\n\t\t</select>";
            }
        } elseif ($outputFormat == "HTML UL" and !empty($resultBuffer)) {
            $outputData = "<li>" . implode("</li><li>", $resultBuffer) . "</li>";
            if ($wrapSearchSuggestions) {
                $outputData = "<ul>" . $outputData . "</ul>";
            }
        } elseif ($outputFormat == "JSON" and !empty($resultBuffer)) {
            $outputData = '"' . implode('", "', $resultBuffer) . '"';
            // for PHP 5 >= 5.2.0 and UTF-8 data, function 'json_encode()' could be used instead
            if ($wrapSearchSuggestions) {
                $outputData = "[" . $outputData . "]";
            }
        }
        return $outputData;
    }
}