phpClick
[ class tree: phpClick ] [ index: phpClick ] [ all elements ]

Class: Page

Source Location: /includes/Page.inc.php

Class Overview


Represents a page within a web application


Methods



Class Details

[line 5]
Represents a page within a web application



[ Top ]


Class Methods


constructor __construct [line 21]

Page __construct( Application $oParentApp, [DOMNode $oPageNode = NULL])

Construct a new page object



Parameters:

Application   $oParentApp   Reference to the parent application
DOMNode   $oPageNode   XML node for the current page.

[ Top ]

method addComponent [line 918]

void addComponent( Component $oComponent)

Adds an existing component to this page's XML



Tags:

access:  public


Parameters:

Component   $oComponent   A reference to the component object

[ Top ]

method createCopyOfComponent [line 442]

void createCopyOfComponent( mixed $oOriginalComponent, mixed $sCopyComponentId, mixed $bCopyOnSamePage)



Tags:

access:  public


[ Top ]

method createNewComponent [line 417]

Component createNewComponent( string $sType, string $sId, [integer $iX = 0], [integer $iY = 0], [integer $iZ = 0])

Creates a new component of a given type and adds the XML node for same component under this page



Tags:

return:  newly created component object.
access:  public


Parameters:

string   $sType   type of the component to be created
string   $sId   Id of the component to be created
integer   $iX   X axis location of the component, default value is 0
integer   $iY   Y axis location of the component, default value is 0
integer   $iZ   Z axis location of the component, default value is 0

[ Top ]

method deleteCodePage [line 876]

void deleteCodePage( )

Deletes the corresponding code file that had been automatically created

This function is used to "clean up" when pages are deleted or renamed




Tags:

access:  public


[ Top ]

method generateCode [line 888]

void generateCode( )

Generates a file containing the code to implement the page behavior



Tags:

access:  public


[ Top ]

method getAccessRestriction [line 106]

string getAccessRestriction( )

Returns the access restrictions for this page



Tags:

return:  Access restriction (either "public" or "admins")
access:  public


[ Top ]

method getActivePageId [line 399]

string getActivePageId( )

Returns the id of the currently selected page or the "virtual" "global" page



Tags:

return:  Id of the currently selected page or NULL
static:  
access:  public


[ Top ]

method getCodeForPageComponents [line 730]

string getCodeForPageComponents( )

Creates the HTML/Javascript/PHP code necessary to implement the components' functionality



Tags:

return:  A string containing the code


[ Top ]

method getCodeForPageProperties [line 552]

string getCodeForPageProperties( )

Returns the code for page header, includes all the page properties i.e. background color, script file

This checks if any of the components on the page need to put any code before the HTML tag and appends all the code and puts it before the HTML tag. It checks if there are any form elements on the page. If so it adds a form tag in the page. If the page was opened in edit mode then it adds a hidden field "editMode" so that on submitting from this form the edit mode is passed on to another page as well. TODO: should we add the hidden editMode input field always, or only when we have a form element in the page.




Tags:

return:  code snippet for the page.


[ Top ]

method getCodePageFilePath [line 865]

string getCodePageFilePath( )

Returns the full file path of the page that is automatically generated



Tags:

return:  e.g. "c:\webdocroot\apps\0123456789123\page1.php"
access:  public


[ Top ]

method getCodePageName [line 835]

string getCodePageName( )

Returns the file name of the page that is automatically generated



Tags:

return:  e.g. "page1.php"
access:  public


[ Top ]

method getCodePageNameById [line 845]

string getCodePageNameById( string $sPageId)

Returns the file name of the page that is automatically generated for a particular page



Tags:

return:  e.g. "page1.php"
static:  
access:  public


Parameters:

string   $sPageId   Page Id, e.g. "page1"

[ Top ]

method getCodePageUrl [line 855]

string getCodePageUrl( )

Returns the full web path of the page that is automatically generated



Tags:

return:  e.g. "/apps/0123456789123/page1.php"
access:  public


[ Top ]

method getComponentMaxZ [line 208]

int getComponentMaxZ( )

Returns the maximum z value currently used by any component



Tags:

return:  The maximum z value currently in use or 0 if none was found
access:  public


[ Top ]

method getComponents [line 174]

array getComponents( )

Returns an array of all Component objects that comprise the page



Tags:

return:  of Component objects
access:  public


[ Top ]

method getComponentsByType [line 229]

array getComponentsByType( string $sType)

Returns an array of all Component objects that comprise the page and are of a given type



Tags:

return:  of Component objects
access:  public


Parameters:

string   $sType   type of components, e.g. inputText

[ Top ]

method getDbSaveFields [line 275]

Component getDbSaveFields( )

Returns the list of components to be saved into the database as defined by the user. As in:

<saveValue dbFieldName="" /> Currently the XML stores a blank if the inputText field is not to be saved in the database. This function is duplicated on the application level as well. It makes more sense ther since we are always interested in the application. We remove this function later if no need arises.




Tags:

return:  list of components to be saved into the database.
access:  public


[ Top ]

method getDom [line 40]

DOMDocument getDom( )

Returns a reference to the DOMDocument representing the application



Tags:

return:  Reference to the DOM document representing the application's behavior
access:  public


[ Top ]

method getGlobalAndLocalComponents [line 249]

array getGlobalAndLocalComponents( )

Returns an array containing references to all the components within the page and also all globally defined components



Tags:

access:  public


[ Top ]

method getId [line 78]

string getId( )

Returns the id as it is in XML node, if the page exists.



Tags:

return:  id of this page
access:  public


[ Top ]

method getMouseCaptureCode [line 823]

string getMouseCaptureCode( )

Returns the piece of code to get the mouse location. This is accomplished through a javascript file, mousecapture.js TODO: This function is not called when in run mode.



Tags:

return:  code including the javascript file


[ Top ]

method getNumComponents [line 191]

int getNumComponents( )

Returns the number of components that comprise the page



Tags:

return:  Number of components
access:  public


[ Top ]

method getParentApp [line 31]

Application getParentApp( )

Returns the parent Application of this page



Tags:

return:  A reference to the parent app containing this page
access:  public


[ Top ]

method getPropertyNodeByType [line 515]

DOMNode getPropertyNodeByType( string $sPropertyType)

Gets an XML node for a given property, by searching for the property under the given page in the XML.



Tags:

return:  property node if it exists else NULL


Parameters:

string   $sPropertyType   name of the property to be searched e.g. background color

[ Top ]

method getValueForProperty [line 533]

string getValueForProperty( string $sPropertyType)

Gets value for a given property, by searching for the property under the given page in the XML.



Tags:

return:  value of the property else NULL


Parameters:

string   $sPropertyType   name of the property to be searched e.g. background color

[ Top ]

method getXmlNode [line 49]

DOMNode getXmlNode( )

Returns the XML node for the page.



Tags:

return:  xml node
access:  public


[ Top ]

method handlePropertiesUi [line 472]

void handlePropertiesUi( )

Responds to user input from the edit page screen, sets the background color of the page to be the new color if specified.



Tags:

access:  public


[ Top ]

method hasAnyComponents [line 302]

bool hasAnyComponents( )

If the page exists, then it checks in the XML node for the page whether it has any components or not if so it returns true else false.



Tags:

return:  true, it there are any components else false
access:  public


[ Top ]

method hasAnyFormElements [line 318]

bool hasAnyFormElements( )

If the page exists, then it checks in the XML node for the page whether it has any form components i.e. input text and/or button. or not. if so it returns true else false.



Tags:

return:  true, it there are any form components else false
access:  public


[ Top ]

method isActive [line 380]

bool isActive( )

Checks to see is $_SESSION['pageId'] is set to the id of this page



Tags:

return:  true, if this page is active else false.
access:  public


[ Top ]

method isAnyActive [line 390]

boolean isAnyActive( )

Checks to see if any page is currently set as active



Tags:

return:  TRUE, if this page is active, else FALSE.
static:  
access:  public


[ Top ]

method isHomePage [line 134]

void isHomePage( )

Checks if this page is set as homepage for the current application, by reading the attribute isHomePage from the XML file.

$return string "1", if this page is a home page, otherwise "0"




Tags:

access:  public


[ Top ]

method saveToXml [line 481]

void saveToXml( )

saves temporary values from "edit page" screen to XML



Tags:

access:  public


[ Top ]

method setAccessRestriction [line 122]

void setAccessRestriction( string $sAccessRestriction)

Sets the access restrictions for this page



Tags:

access:  public


Parameters:

string   $sAccessRestriction   Either "public" or "admins"

[ Top ]

method setActive [line 351]

void setActive( )

Sets this page as the active page by setting $_SESSION['pageId'] to the id of this page and if the active page is not yet generated it generates the code for the same too.



Tags:

access:  public


[ Top ]

method setActiveGlobal [line 364]

void setActiveGlobal( )

Sets the global page as the active page



Tags:

static:  
access:  public


[ Top ]

method setAsHomePage [line 148]

void setAsHomePage( )

Sets the current page as the home page for the application by adding the attribute isHomePage="1"

and re-generating the index.php in the application's root folder to redirect to the homepage




Tags:

access:  public


[ Top ]

method setId [line 88]

void setId( string $sPageId)

Sets the id in the XML node, if the page exists.



Tags:

access:  public


Parameters:

string   $sPageId   new id for the page.

[ Top ]

method unsetActive [line 371]

void unsetActive( )

unsets the active page



Tags:

static:  
access:  public


[ Top ]

method unsetAsHomePage [line 163]

void unsetAsHomePage( )

Unsets the current page as the home page for the application by removing the attribute isHomePage



Tags:

access:  public


[ Top ]


Documentation generated on Wed, 12 Jan 2005 17:52:32 -0500 by phpDocumentor 1.3.0RC3