Adding a New Page

From ARK
Revision as of 17:15, 26 February 2009 by Guy (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To understand better the relationship between page and module content, read the page or module level content page. Pages are important as they are the main building bloack of ark, containing all the root level includes and the main <head> and <html> tags. Generally speaking a page should be used if you would like a user to be able to reference the page using the url without needing to add any querystring vars. The 'view' variable should only be used for minor alterations for the page such as view states. A default option should always be logical if a user is forwarded to a page without any view var in their session.

The Page

The main page should be created in the root level ark folder and must contain all of its root level includes. The page must also be self sufficient in terms of the xhtml tags.

Code Folder

You should create a code folder in the 'php/' folder which has exactly the same name as the page (minus the dot php bit). This folder is for any code for views and toolboxes that will be used on this page. Take care to ensure that global functions go into the global functions file.

This folder is also a good way to globalise code between modules but below page level. Hence in the case of the detailed data aentry forms, these all reside in a subfolder of data entry. This means they can be accessed by the page itself and also shared between any modules that might be used in relation to this page.

The Left Panel

All pages have their own left_panel.php script which goes intot he code folder. The name of the script is not technically restricted to this as it is called from within the pages. In addition this could be a series of scripts.

This is to be used for navigation of views of this page. Further aditional information could be shown here.

Database entry

In order for the page to work with the Ark security system, and to have auto-generated nav bars, some data about the page should be entered into the data base. This also helps to internationalise the navigation and page headers.

The relevant table is cor_tbl_wwwpages.

Within this table there is a defaultvars field that can be used to store any default variables that may be needed for the page to function properly. These should be stored in the format: variable_name|default_value. each entry should be comma seperated - an example is:

 pownergrp|1,default_view|home,cur_page|data_view,cur_code_dir|php/data_view/

Whatever variables are specified in this field will be avaible to all plc

PLEASE NOTE: this requires the $filename variable to be set - there is probably a way to set this from the php but at the moment it needs to be done before the inc_page_settings call.