phpPeanuts  2.2.0
phpPeanuts framework
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Static Public Member Functions | Data Fields
PntPage Class Reference

Inherits PntRequestHandler.

Inherited by PntDialog, PntErrorPage, PntIndexPage, PntObjectDetailsPage, PntObjectIndexPage, PntObjectSelectionReportPage, PntObjectVerifyDeletePage, PntPagePart, and PntSite.

Public Member Functions

 getInfoStyle ()
 
 setInfoStyle ($value)
 
 printHeader ()
 
 printFooter ()
 
 printBodyTagIeExtraPiece ()
 
 includeSkin ($name, $param=null)
 
 printSetTitle ($title=null)
 
 getButton ($caption, $script, $ghost=false, $len=null)
 
 handleRequest ()
 
 getPartId ()
 
 ajaxHandleRequest ()
 
 ajaxPrintHeaders ()
 
 ajaxPrintUpdates ($preFix='')
 
 getAjaxUpdatePartIds ()
 
 getAjaxUpdateSubPartIds ($prefix)
 
 ajaxShouldUpdate ($partId, $partName=null, $extraParam=null)
 
 ajaxPrintPartUpdate ($partName, $partId=null, $extraParam=null)
 
 isRequestAjax ()
 
 ajaxPrintPartAttributes ()
 
 getAjaxLoadingMessage ()
 
 initForHandleRequest ()
 
 checkAccess ()
 
 isLayoutReport ()
 
 printHeaders ()
 
 printHeaderXframeOptions ()
 
 getCharset ()
 
 printBody ()
 
 printMainPart ()
 
 printPart ($partName)
 
 imp_printPart ($args)
 
 getPart ($args, $cache=true)
 
 getPartIncludeTryParams ($partName)
 
 getSpecificPartPrefix ($partName=null)
 
 printPartDebugComment ($partName, $debug)
 
 printInformationPart ()
 
 getFilterPartString ()
 
 getButtonsList ()
 
 addMultiValuePropertyButtons (&$buttons)
 
 getExcludedMultiValuePropButtonKeys ()
 
 getMultiValuePropertyButtonScript ($propName, $edit=false)
 
 getThisPntContext ()
 
 getDetailsHref ($appName, $pntType)
 
 getLinkDirFromNav ($nav, $pntHandler='')
 
 getTargetAppName ($nav, $pntHandler='')
 
 getDetailsLinkPntHandler ()
 
 getNoItemsMessage ()
 
 getRequestDuration ()
 
 getConvert ($obj, $path, $kind=0, $preformatAndTab=0)
 
 getInitConverter ($prop)
 
 addContextButtonTo (&$buttons)
 
 doScouting ()
 
 getFootprintId ()
 
 printFootprintJsLiteral ($quote="'")
 
 getPropertyName ()
 
 printNextActionTicket ()
 
 getAndCreateNextActionTicket ()
 
 printExtraHeaders ()
 
 getImagesDir ()
 
- Public Member Functions inherited from PntRequestHandler
 __construct ($whole, $requestData)
 
 getDir ()
 
 getDomainDir ($type=null)
 
 getBaseUrl ()
 
 getConverter ()
 
 getDebugMode ()
 
 initForHandleRequest ()
 
 startSession ()
 
 getContextHref ($footprintId)
 
 getController ()
 
 getScout ()
 
 getGlobalFilters ()
 
 forwardRequest ($requestData, $information=null)
 
 redirectRequest ($requestData, $information=null, $dir=null)
 
 queryStringFrom ($requestData, $param=null)
 
 getRequestParam ($key)
 
 getReqParam ($key, $asHtml=false)
 
 htOut ($aString)
 
 getRequestHandler ($requestData, $dir=null)
 
 tryUseHandlerClass ($handlerClass, &$attempted)
 
 getHandlersTriedString ($attempted)
 
 __toString ()
 
 toString ()
 
 getLabel ()
 
 getName ()
 
 getThisPntHandlerName ()
 
 getInformation ()
 
 getEventualItemNotFoundMessage ()
 
 setInformation ($value)
 
 getTypeLabel ()
 
 getType ()
 
 checkAlphaNumeric ($value)
 
 getTryUseClassTryParams ($className, $dir)
 
 getIncludesDir ()
 
 tryUseClass ($className, $dir)
 
 useClass ($className, $dir)
 
 getTypeClassDescriptor ()
 
 getRequestedObject ()
 
 setRequestedObject ($value)
 
 getFormTexts ()
 
 getFormTextPaths ()
 
 setFormTexts ($value)
 
 getMarkedItemsCollector ()
 

Static Public Member Functions

static getInfoStyleOk ()
 
static getInfoStyleError ()
 
static getInfoStyleWarning ()
 

Data Fields

 $infoStyle
 
 $converters
 
 $parts
 
 $filterPartString
 
 $footprintId
 
- Data Fields inherited from PntRequestHandler
 $whole
 
 $information
 
 $controller
 
 $requestData
 
 $request
 

Member Function Documentation

addContextButtonTo ( $buttons)
addMultiValuePropertyButtons ( $buttons)

Add a button for each multi value property except those in whose names are in ::getExcludedMultiValuePropButtonKeys. Each button will hold a javascript from ::getMultiValuePropertyButtonScript, whose default implementation is to retrieve an (MtoN)PropertyPage for the property.

Parameters
array$buttonsto add the butons to.
ajaxHandleRequest ( )

This method should take care of update of an existing page given the new requestData. To know what needs to be updated we would need some form of scouting from which we can reconstruct the page state. So for the moment the InformationPart, MainPart and ButtonsPanel are all updated No context scouting is done on AJAX requests.

ajaxPrintHeaders ( )
ajaxPrintPartAttributes ( )

Print the ajax part atttibutes. Currently the PhpPeanuts user interface componnents do not print any.

ajaxPrintPartUpdate (   $partName,
  $partId = null,
  $extraParam = null 
)

Prints an AJAX update for the named part. all subParts are updated in a single update element

Parameters
string$partNamethe name of the part to print inside the CDATA element of the updateElement
string$partIdthe id of the part in the pntAjaxUpd request param
ajaxPrintUpdates (   $preFix = '')

For each of the parts of this page, print the ajax part update if necessary. Default impleentation is for Body, InformationPart, MainPart and subparts of ButtonsPanel. To be overridden by subclasses to accomodate their specific composition. PartNames should be coded literally or composed from strings coded literally to prevent out of context part access. Developers can browse the applicable overrides of this method to see which parts can be adressed. Be aware that recursive subparts can be addressed,

See Also
PntObjectEditDetailsPage::ajaxPrintUpdates for an example
ajaxShouldUpdate (   $partId,
  $partName = null,
  $extraParam = null 
)
Returns
boolean wheather this should print an ajax update for the specified Part.
Parameters
string$partIdthe id of the part in the pntAjaxUpd request param
string$partNamethe name of the part that may be printed
mixed$extraParamto be passed to ::printPart
checkAccess ( )

Check access to a $this with the SecrurityManager. Forward to Access Denied errorPage and die if check returns an error message.

doScouting ( )

Tell the scout how to interpret the requests PRECONDITION: Session started

getAjaxLoadingMessage ( )
Returns
string HTML the message to be printed inside a placeholder whose contents will be AJAX-loaded. The idea is that this message is only visible for the short time after the placeholder is made visble, until AJAX loader replaces it by its dynamic content.
getAjaxUpdatePartIds ( )
Returns
the ids of the parts to be updated by ajax. NB fiddling with the ajaxUpdatePartIds cache using ::getAjaxUpdateSubPartIds results WARNING, part ids are not yet checked to be alphaNumeric, including without check would be a serious security threat
getAjaxUpdateSubPartIds (   $prefix)
Returns
array with ajaxUpdatePartIds for updating subparts by selecting the getAjaxUpdatePartIds that are prefixed and removing the prefixes. After setting the results of this method in a parts ajaxUpdatePartIds member the whole can delegate updating subparts to the part by calling ::ajaxPrintUpdates ::ajaxPrintUpdates must be overridden for the part to call ::ajaxPrintPartUpdate for the subParts of the part.
Parameters
string$prefixof partIds to be selected and de-prefixed
getAndCreateNextActionTicket ( )

To prevent Cross-site request forgery each form has a parameter pntActionTicket that will change each time the form is printed. It is generated here and stored in the session. When an action is invoked, the ticket is checked and removed from the session.

Returns
int the ticket value
getButton (   $caption,
  $script,
  $ghost = false,
  $len = null 
)
getButtonsList ( )
Returns
array of arrays of PntButtonPart. Overridden by most pages and dialogs to define their specific buttons. Default is to return an empty array, so than no buttons will be printen.
getCharset ( )
Returns
string the identifier of the character set and encoding used for output of content, expected for input and specified for accept
getConvert (   $obj,
  $path,
  $kind = 0,
  $preformatAndTab = 0 
)

Navigate from $obj through $path. Convert the result to a (label)string.

Returns
string The (label)string, for $kind >= 0 as HTML.
Parameters
PntObject$objthe object to start the navigation from
string$paththe path to navigate, as a series of property names separated by a dot
int$kindif < 0 the label is returend. Otherwise this decides wheather line feeds should be converted into
int$preformatAndTabthe number of non breaking spaces to use for a tab. if > 0 existing multiple spaces will be converted into non-breaking spaces
getDetailsHref (   $appName,
  $pntType 
)
Returns
string an url to an (Edit)DetailtPage to wchich the id of the object to edit/show details from can be concatenated.
Parameters
string$appNamenme of applcation folder where the DetailtPage should be retrieved from
string$pntTypethe type of the object to be edite/shown
getDetailsLinkPntHandler ( )
getExcludedMultiValuePropButtonKeys ( )

Return an array with as keys the names of the multi value properties for which no buttons should be added by addMultiValuePropertyButtons to be overridden by subclasses

getFilterPartString ( )
Returns
string HTML describing the active filter. default the active filter is the first global filter that applies to the type of the page.
getFootprintId ( )
Returns
string token identifying this page in context scouting
getImagesDir ( )
Returns
string with the relative path to the folder where the browser can retieve images from by HTTP.
getInfoStyle ( )
Returns
string the css style for the InformationPart
static getInfoStyleError ( )
static
Returns
string the information style for when a transaction erorred
static getInfoStyleOk ( )
static
Returns
string the information style for when a transaction has succeeded
static getInfoStyleWarning ( )
static
Returns
string the information style for when a transaction warning
getInitConverter (   $prop)
getLinkDirFromNav (   $nav,
  $pntHandler = '' 
)
Returns
the directory in which RequestHandlers can be retieved from for the result of the navigation staring my the requested object
Parameters
PntObjectNavigation$nav
PntRequestHandler$pntHandler
getMultiValuePropertyButtonScript (   $propName,
  $edit = false 
)
getNoItemsMessage ( )
Returns
HTML string message replacing itemtable when no items
getPart (   $args,
  $cache = true 
)

Gets a part, either from the cache or newly included and instantiated. The actual part class inclusion and instatiation itself is tried like this:

  • <pntType><partName> from application folder
  • <pntType><partName> from classes folder
  • <partName> from application folder
  • <partName> from classes folder Where <pntType> may be replaced by overriding ::getSpecificPartPrefix()
    Parameters
    array$argswith 0 => $partName (string) and the rest (mixed) to be passed as extra parameters to the part constructor.
    boolean$cachewheather to try cache first and cache the part by $partName
    Returns
    PntPagePart the part, from the cache if available, or newly included and instantiated
getPartId ( )
getPartIncludeTryParams (   $partName)
Returns
Array of arrays with class name and path relative to ../classes describing the actual part inclusion that will be tried for the specified Part.
Parameters
string$partName
getPropertyName ( )

return string alphanumeric the name of the property, or null if not applicable

getRequestDuration ( )
getSpecificPartPrefix (   $partName = null)
Returns
string the prefix for type-specific parts. Default implementation is to return the type of the requested object.
Parameters
string$partName
getTargetAppName (   $nav,
  $pntHandler = '' 
)
Returns
the directory in which RequestHandlers can be retieved from for the result of the navigation staring my the requested object
Parameters
PntObjectNavigation$nav
PntRequestHandler$pntHandler
getThisPntContext ( )
Returns
the value of the pntContext parameter for this page. Before context scouting this parameter was used to return to the context after a SaveAction or when the user pressed the Context button. nowadays it seldomly used.
handleRequest ( )
imp_printPart (   $args)
includeSkin (   $name,
  $param = null 
)
initForHandleRequest ( )

initualize this for handling a HTTP request. Overrides PntRequestHandler to add context scouting. Most RequestHandlers override this to lead the requested object(s)

isLayoutReport ( )
Returns
boolean wheather this page is to be shown in a layous suitable for reports. if true the default implementation of printBody will include skinReportBody instread of skinBody.
isRequestAjax ( )
Returns
boolean wheather the request is an AJAX request
printBody ( )

Print the middle of the HTML document. Default implementation is to include skinBody, but if isLayoutReport skinReportBody

printBodyTagIeExtraPiece ( )

Print the extra piece of the Body tag, for Internet Explorer only

printExtraHeaders ( )

This method is called from skinHeaderPart it's purpose is to be able to append extra stylesheets or scripts to the head section of specific pages

printFooter ( )

Print the end of the HTML document. Default implementation is to include skinFooter

printFootprintJsLiteral (   $quote = "'")
printHeader ( )

Print the start of the HTML document - output starts here Default implementation is to include skinHeader. In the default layout this includes the Body tag and the Page label

printHeaders ( )

Print the HTTP Headers. This method is called before output starts. The default implementation is for no page caching by browser and proxy servers, but what really happens depends on the browser and proxy server(s)

printHeaderXframeOptions ( )
printInformationPart ( )

Print the InformationPart, which informs the user about the processing results

printMainPart ( )

Print the part that contains most of the document. Is often specific for the specific RequestHandler. Default implementaion is to print the <pageName>Part.

printNextActionTicket ( )
printPart (   $partName)

(Inlcude and) print a part. The actual part class inclusion and instatiation itself is tried like this:

  • print<partName> method on $this $this->getPart(<partName>)->printBody(), which does:
    • <pntType><partName> from application folder
    • <pntType><partName> from classes folder
    • <partName> from application folder
    • <partName> from classes folder
  • skin<pntType><partName>.php from application folder $this->IncludeSkin(<partName), which does:
    • skin<partName>.php from application folder
    • skin<partName>.php from classes folder Where <pntType> may be replaced by overriding ::getSpecificPartPrefix(). What actually happened may be inferred from the debug comments printed when Site>>debugMode is set to verbose
      Parameters
      string$partNamethe name of the part to print. more params will be passed to ::getPart.
printPartDebugComment (   $partName,
  $debug 
)

Print the part inclusion debug comment

Parameters
stringthe name of the part
stringthe debug mode
printSetTitle (   $title = null)

Legacy support, only with CMS beheer.css

setInfoStyle (   $value)
Parameters
string$valuethe css style for the InformationPart

Field Documentation

$converters
$filterPartString
$footprintId
$infoStyle
$parts

The documentation for this class was generated from the following file: