SearchParameters()->TextDescription(); case "Enabled": return $Item->Enabled() ? "Yes" : "No"; case "Frequency": $Frequencies = array( 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 = array( "Name" => array( "MaxLength" => 40, "DefaultSortField" => TRUE, ), "Criteria" => array( "ValueFunction" => "GetRuleAttribute", ), "Frequency" => array( "ValueFunction" => "GetRuleAttribute", ), "Enabled" => array( "ValueFunction" => "GetRuleAttribute", ), ); # create and display list UI $ListUI = new ItemListUI("Rule List", $Fields, $H_ItemsPerPage, $BaseLink); $ListUI->AddTopButton("Add New Rule", $AddRuleLink, "add_field.png"); $ListUI->AddActionButton("Edit", $RuleEditLink, "pencil.png"); $ListUI->AddActionButton("Delete", $RuleDeleteLink, "cross.png"); $ListUI->Display($H_Items, $H_ItemCount, $H_StartingIndex);