requireUIFile( ["jquery-ui.js", "jquery-ui.css"], ApplicationFramework::ORDER_FIRST ); # set up fields to display $Fields = [ "FromAddr" => [ "Heading" => "From", ], "ToAddr" => [ "Heading" => "To", ], "Subject" => [ "Heading" => "Subject", ], "NumResources" => [ "Heading" => "Num. Resources", ], "DateCreated" => [ "Heading" => "Date Queued", ], ]; $FormUI = new FormUI([ "SS" => [ "Type" => FormUI::FTYPE_TEXT, "Label" => "Search", "Value" => $H_SearchString, ], "Template" => [ "Type" => FormUI::FTYPE_OPTION, "Label" => "Mailer Template", "Value" => $H_SelectedTemplate, "Options" => $H_Templates, ], ]); $OptList = new HtmlOptionList("TID", $H_Templates, $H_SelectedTemplate); $OptList->SubmitOnChange(true); $SearchButton = new HtmlButton("Search"); $SearchButton->setIcon("MagnifyingGlass.svg"); $SearchButton->setSize(HtmlButton::SIZE_SMALL); # ----- DISPLAY -------------------------------------------------------------- $AF->setPageTitle("Queued Email"); ?>
Template: GetHtml() ?> Search: getHtml(); ?>

# Queued Email

ItemsPerPage($H_ItemsPerPage); $ListUI->BaseLink($H_BaseLink); # if we have any items, such that it makes any sense to show buttons # to send/view/delete them, then configure those buttons if (count($H_EmailList) > 0) { $SearchParamsForUrl = "&SS=".urlencode($H_SearchString) ."&TID=".urlencode($H_SelectedTemplate); $SendLink = "index.php?P=P_Mailer_ViewMessage&ID=\$ID" ."&A=Send".$SearchParamsForUrl; $ViewLink = "index.php?P=P_Mailer_ViewMessage&ID=\$ID" ."&A=View".$SearchParamsForUrl; $DeleteLink = "index.php?P=P_Mailer_ViewMessage&ID=\$ID" ."&A=Delete".$SearchParamsForUrl; # set the label for our top buttons, showing simply 'All' when all # messages were shown (no subsetting by search string or template, # and the item count equals the total items), or "All Displayed" # otherwise $ManyLabel = (strlen($H_SearchString) == 0 && $H_SelectedTemplate == -1 && count($H_EmailList) == $H_TotalItems) ? "All" : "All Displayed"; $SendManyLink = "index.php?P=P_Mailer_ProcessMany" ."&A=Send" ."&IDs=".implode("-", array_keys($H_EmailList)) .$SearchParamsForUrl; $DeleteManyLink = "index.php?P=P_Mailer_ProcessMany" ."&A=Destroy" ."&IDs=".implode("-", array_keys($H_EmailList)) .$SearchParamsForUrl; $ListUI->AddTopButton( "Send ".$ManyLabel, $SendManyLink, "Check.svg" ); $ListUI->AddTopButton( "Delete ".$ManyLabel, $DeleteManyLink, "Delete.svg" ); $ListUI->AddActionButton("Send", $SendLink, "Check.svg"); $ListUI->AddActionButton("View", $ViewLink, "EyeOpen.svg"); $ListUI->AddActionButton("Delete", $DeleteLink, "Delete.svg"); } $ListUI->Display($H_EmailList, $H_TotalItems);