This is the heart and soul of each application, primarily this page specifies the template to be loaded and assigns the page to be loaded with in the template.
The following is an example of a typical main.ips file -:
var
NextPage: String;
FolderID: String;
begin
NextPage := PageParamValue('page');
FolderID := PageParamValue('FolderID');
if (FolderID <> '') then
SetSessionValue('current_folder_id', FolderID);
echo('NextPage: ' + NextPage + '<br>');
if NextPage <> '' then
NextPage := LookupExternalString('pages.txt', NextPage);
if NextPage = '' then
begin
// Check any "on-entry" parameters here...
// SetSessionValue('filter_by_project_id', PageParamValue('ProjectID'));
// use first page
NextPage := LookupExternalString('pages.txt', 'StartPage');
end;
echo('NextPage: ' + NextPage + '<br>');
SetSessionValue('NextPage', NextPage);
OpenURL(LookupExternalString('pages.txt', 'Template'));
end.
|