LabelToDisplay) * @param SearchParameterSet $SearchParameters Values set for this search * @param int $TypeMask Bitmask of MetadataSchema::MDFTYPE_ values * specifying which fields to display * @return void */ function DisplayLimits($Fields, $SearchParameters, $TypeMask) : void { if (count($Fields) == 0) { return; } $NumberOfListItems = 6; $NumberOfListItemsForFlags = 2; print "
"; foreach ($Fields as $FieldId => $DisplayName) { $Field = MetadataField::getField($FieldId); if ($Field->Type() & $TypeMask) { $CurrentValues = $SearchParameters->GetSearchStringsForField($FieldId); # (ignore phpstan errors for functions defined in AdvancedSearch.php) // @phpstan-ignore function.notFound $CurrentValues = ConvertValueNamesToIds($Field, $CurrentValues); // @phpstan-ignore function.notFound $PossibleValues = DeterminePossibleValues($Field); // @phpstan-ignore function.notFound $DisabledOptions = DetermineDisabledValues($Field, $PossibleValues); $AllowMultiple = ($Field->SearchGroupLogic() == SearchEngine::LOGIC_OR) || ($Field->AllowMultiple()); if (count($PossibleValues) > 0) { print "
" ."
"; $OptionList = new HtmlOptionList( "F_SearchLimit".$FieldId."[]", $PossibleValues, $CurrentValues ); $OptionList->MultipleAllowed($AllowMultiple); $OptionList->DisabledOptions($DisabledOptions); $OptionList->Size( ($Field->Type() == MetadataSchema::MDFTYPE_FLAG) ? $NumberOfListItemsForFlags : $NumberOfListItems ); $OptionList->PrintHtml(); print "
"; } } } print "
"; } # ----- SETUP ---------------------------------------------------------------- if (!isset($H_FieldsHavingTextForms)) { throw new Exception("H_FieldsHavingTextForms not defined."); } if (!isset($H_OpenByDefault)) { throw new Exception("H_OpenByDefault not defined."); } if (!isset($H_OpenSearchLimits)) { throw new Exception("H_OpenSearchLimits not defined."); } if (!isset($H_RecordsPerPage)) { throw new Exception("H_RecordsPerPage not defined."); } if (!isset($H_SavedSearches)) { throw new Exception("H_SavedSearches not defined."); } if (!isset($H_SchemaNames)) { throw new Exception("H_SchemaNames not defined."); } if (!isset($H_SearchLimits)) { throw new Exception("H_SearchLimits not defined."); } if (!isset($H_SearchParameters)) { throw new Exception("H_SearchParameters not defined."); } if (!isset($H_SelectedFields)) { throw new Exception("H_SelectedFields not defined."); } if (!isset($H_SelectedSortField)) { throw new Exception("H_SelectedSortField not defined."); } if (!isset($H_SortFields)) { throw new Exception("H_SortFields not defined."); } $AF = ApplicationFramework::getInstance(); $SearchButton = new HtmlButton("Search"); $SearchButton->setIcon("MagnifyingGlass.svg"); $SearchButton->setSize(HtmlButton::SIZE_SMALL); $SearchButton->makeSubmitButton(); $ShowAllButton = new HtmlButton("Show All"); $ShowAllButton->setIcon("Maximize.svg"); $ShowAllButton->addClass("mv-limits-showall"); $ShowAllButton->setOnclick("showAllLimits()"); $ShowAllButton->setSize(HtmlButton::SIZE_SMALL); $HideAllButton = new HtmlButton("Hide All"); $HideAllButton->setIcon("Minimize.svg"); $HideAllButton->addClass("mv-limits-hideall"); $HideAllButton->setOnclick("hideAllLimits()"); $HideAllButton->setSize(HtmlButton::SIZE_SMALL); $SaveButton = new HtmlButton("Save"); $SaveButton->setIcon("Disk.svg"); $SaveButton->setSize(HtmlButton::SIZE_SMALL); $SaveButton->makeSubmitButton(); $ClearButton = new HtmlButton("Clear"); $ClearButton->setIcon("Broom.svg"); $ClearButton->setSize(HtmlButton::SIZE_SMALL); $ClearButton->setTitle("Reset all search terms"); $ClearButton->setLink("index.php?P=AdvancedSearch"); $CheckIfButton = new HtmlButton("Allow Unassigned Values"); $CheckIfButton->setIcon("Check.svg"); $CheckIfButton->addClass("toggle-disabled"); $CheckIfButton->setSize(HtmlButton::SIZE_SMALL); $AddFieldButton = new HtmlButton("Add Field"); $AddFieldButton->setIcon("Plus.svg"); $AddFieldButton->addClass("mv-content-addfield"); $AddFieldButton->setSize(HtmlButton::SIZE_SMALL); $AddFieldButton->setOnclick("addFieldClick()"); # ----- DISPLAY -------------------------------------------------------------- PageTitle("Advanced Search"); ?>

Advanced Search

  • ".$H_Error."
  • "; } ?>
    Field
    Search Terms
     
    GetKeywordSearchStrings(); } else { # if this is a multi-field search, display the value from # the first field as the remainder should all be identical $FieldIds = explode("-", $FieldId); $CurrentValues = $H_SearchParameters->GetSearchStringsForField( current($FieldIds) ); } # if we have no values for this field, add a single empty value # so that the field is still displayed if (count($CurrentValues) == 0) { $CurrentValues = [""]; } # iterate over all the currently set values, printing # corresponding HTML elements for each foreach ($CurrentValues as $CurrentValue) { print "
    " ."
    "; $OptionList = new HtmlOptionList( "F_SearchCat".$SearchCatIndex, $H_FieldsHavingTextForms, $FieldId ); $OptionList->AddAttribute("title", "Search Field ".$SearchCatIndex); $OptionList->AddAttribute("aria-labelledby", "mv-adv-field-label"); $OptionList->PrintHtml(); print "
    " ."" ."
    " ."
     
    " ."
    "; $SearchCatIndex++; } } ?>

    Limits (Optional)

    getHtml() ?> getHtml() ?> getHtml() ?>
    $Limits) { ?>
    1) { ?> []
    getHtml() ?> IsLoggedIn()) { ?> getHtml() ?> getHtml(); ?>
         PrintHtml(); ?> 5, 10 => 10, 20 => 20, 30 => 30, 50 => 50, 100 => 100 ]; $OptList = new HtmlOptionList("F_RecordsPerPage", $DisplayOptions, $H_RecordsPerPage); $OptList->PrintHtml(); ?>

    Load Saved Search:

    " ."\n"; } ?>