"
.$Item->SearchParameters()->TextDescription()."
"
."SearchParameters()->UrlParameterString()."\">View Search Results"
."
";
case "Enabled":
return $Item->Enabled() ? "Yes" : "No";
case "Frequency":
$Frequencies = [
60 => "Hourly",
240 => "Every 4 Hours",
480 => "Every 8 Hours",
1440 => "Daily",
10080 => "Weekly",
0 => "Continuously",
];
if (isset($Frequencies[$Item->CheckFrequency()])) {
return $Frequencies[$Item->CheckFrequency()];
} else {
return $Item->CheckFrequency()." minutes";
}
}
}
# set up links
$BaseLink = "index.php?P=P_Rules_ListRules&CK=".$H_ListChecksum;
$AddRuleLink = "index.php?P=P_Rules_EditRule&ID=NEW";
$RuleDisplayLink = "index.php?P=P_Rules_DisplayRule&ID=\$ID";
$RuleEditLink = "index.php?P=P_Rules_EditRule&ID=\$ID";
$RuleDeleteLink = "index.php?P=P_Rules_DeleteRule&ID=\$ID";
# set up fields to display
$Fields = [
"Name" => [
"MaxLength" => 40,
"DefaultSortField" => true,
],
"Criteria" => [
"ValueFunction" => "GetRuleAttribute",
"AllowHTML" => true,
],
"Frequency" => ["ValueFunction" => "GetRuleAttribute"],
"Enabled" => ["ValueFunction" => "GetRuleAttribute"],
];
# create and display list UI
$ListUI = new ItemListUI($Fields);
$ListUI->Heading("Rule List");
$ListUI->ItemsPerPage($H_ItemsPerPage);
$ListUI->BaseLink($BaseLink);
$ListUI->AddTopButton("Add New Rule", $AddRuleLink, "Plus.svg");
$ListUI->AddActionButton("Edit", $RuleEditLink, "Pencil.svg");
$ListUI->AddActionButton("Delete", $RuleDeleteLink, "Delete.svg");
$ListUI->Display($H_Items, $H_ItemCount, $H_StartingIndex);