[ "MaxLength" => 32, "Link" => $TitleLink, "Heading" => "Title" ], "Events: Added By Id" => [ "Heading" => "Author" ], "Events: Last Modified By Id" => [ "Heading" => "Editor" ], "Events: Date Of Record Creation" => [ "Heading" => "Created" ], "Events: Date Last Modified" => [ "Heading" => "Modified" ], "Events: Release Flag" => [ "Heading" => "Rel.", "ValueFunction" => function ($Event) { return $Event->get('Release Flag') ? "Yes" : "No"; } ] ]; $SearchButton = new HtmlButton("Search"); $SearchButton->setIcon("MagnifyingGlass.svg"); $SearchButton->setSize(HtmlButton::SIZE_SMALL); # retrieve existing search text $SearchText = defaulthtmlentities(StdLib::getFormValue("F_SearchText")); # prepare statistic message $SafePastEventsCount = defaulthtmlentities($H_EventCountsByTense["Past"]); $SafeOccurringEventsCount = defaulthtmlentities($H_EventCountsByTense["Occurring"]); $SafeFutureEventsCount = defaulthtmlentities($H_EventCountsByTense["Future"]); $StatisticMsg = ""; if ($H_EventCount > 0) { $StatisticMsg .= "Stats: ".$SafePastEventsCount." past " .StdLib::pluralize("event", $SafePastEventsCount).", " .$SafeOccurringEventsCount." " .StdLib::pluralize("event", $SafeOccurringEventsCount) ." currently occuring, and ".$SafeFutureEventsCount ." future ".StdLib::pluralize("event", $SafeFutureEventsCount); } # prepare search option list definition $SearchListName = "F_Field"; $SearchListSelected = StdLib::getFormValue("F_Field"); $SearchListOptions = [ "ALL" => "(any field)", "Title" => "Title", "ShortTitle" => "Short Title", "Description" => "Description", "URL" => "URL", "ContactEmail" => "Contact Email", "Venue" => "Venue", "Locality" => "City", "Region" => "State", "StartDate" => "Start Date", "EndDate" => "End Date", ]; $SearchList = new HtmlOptionList($SearchListName, $SearchListOptions, $SearchListSelected); # prepare condition option list definition $ConditionListName = "F_Condition"; $ConditionListSelected = StdLib::getFormValue("F_Condition"); $ConditionListOptions = [ "contains" => "contains", "equals" => "equals", "is before" => "is before", "is after" => "is after", ]; $ConditionList = new HtmlOptionList( $ConditionListName, $ConditionListOptions, $ConditionListSelected ); # config ItemListUI and render $ListUI = new ItemListUI($ListFields); $ListUI->baseLink($BaseLink); $ListUI->itemTypeName("Event"); $ListUI->heading("Calendar Events"); $ListUI->subheading($StatisticMsg); $ListUI->noItemsMessage("There are no events."); $ListUI->addActionButton("Edit", $EditLink, 'Pencil.svg'); $ListUI->addActionButton("Delete", $DeleteLink, 'Delete.svg'); $ListUI->addTopButton("Add Event", $NewEventLink, 'Plus.svg'); $ListUI->itemsPerPage($H_EventsPerPage); # ----- DISPLAY -------------------------------------------------------------- ?>
Search: PrintHtml(); $ConditionList->PrintHtml(); ?> getHtml(); ?>
display($H_Events, $H_EventCount, $H_StartingIndex);