Get("Date Last Modified"); if ($Modified == "0000-00-00 00:00:00") { $Modified = "—"; } else { $MUser = $Item->Get("Last Modified By Id", TRUE); $MUser = array_shift($MUser); $Modified = GetPrettyTimestamp($Modified) ." - ".(($MUser->Status() == U_OKAY) ? $MUser->Name() : "(unknown)").""; $Modified = str_replace(" ", " ", $Modified); } return $Modified; } # set up links $BaseLink = "index.php?P=P_Pages_ListPages&CK=".$H_ListChecksum; $AddPageLink = "index.php?P=P_Pages_EditPage&ID=NEW"; $PageDisplayLink = "index.php?P=P_Pages_DisplayPage&ID=\$ID"; $PageEditLink = "index.php?P=P_Pages_EditPage&ID=\$ID"; $PageDeleteLink = "index.php?P=P_Pages_DeletePage&ID=\$ID"; # set up fields to display $Fields = array( "Pages: Title" => array( "Link" => $PageDisplayLink, "MaxLength" => 40, ), "Pages: Clean URL" => array( "Heading" => "URL", "Link" => $PageDisplayLink, ), "Pages: Date Last Modified" => array( "Heading" => "Modified", "ValueFunction" => "GetLastModifiedText", "DefaultSortField" => TRUE, "DefaultToDescendingSort" => TRUE, ), ); # create and display list UI $ListUI = new ItemListUI("Page List", $Fields, $H_PagesPerPage, $BaseLink, $H_SchemaId); $ListUI->AddTopButton("Add New Page", $AddPageLink, "add_field.png"); $ListUI->AddActionButton("Edit", $PageEditLink, "pencil.png"); $ListUI->AddActionButton("Delete", $PageDeleteLink, "cross.png"); $ListUI->Display($H_Pages, $H_PageCount, $H_StartingIndex);