PHP Class WPDKConfigurationView

## Overview You can subclass this class to build an easy view config. This class help you to render a standard view for the configuration panel. It create for you the wrap HTML content, dispplay the form fields and update or reset the data. In addition display the message for feedback. ### Implement method You can implement some standard method for manage this view * fields() This method return an SDF array to display the form fields * content() This method is used for custom view control. Overwrite the fields() * save() Your own custom save data. If this method id not implement your data aren't saved.
Deprecation: since 1.2.0 Use WPDKPreferencesViewController and WPDKPreferencesView instead
Author: =undo= ([email protected])
Inheritance: extends WPDKView
Datei anzeigen Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$introduction string This is an optional string information
$title string The configuration title

Public Methods

Method Description
__construct ( string $id, string $title, WPDKConfiguration $configuration = null, object | array $sub_configuration = null, string $introduction = '' ) : WPDKConfigurationView Create WPDKConfigurationView instance object
buttonsUpdateReset ( ) : string Return the HTML markup for standard [Reset to default] and [Update] buttons. You can override this method to hide or change the default buttons on bottom form.
draw ( ) Display the content view with form, introduction, fields or custom content. You can override this method with your own drawing.
fields ( ) Return a SDF array for build the form fields
resetToDefault ( ) Reset to default values of sub configuration branch. You can override this method if your sub configuration branch is not an object or not implements a defaults() method.
updatePostData ( ) : boolean Process and set you own post data
wpdk_header_view_after_title ( WPDKHeaderView $header_view ) Display succefully configuration updated message

Private Methods

Method Description
_introduction ( ) : string Return the introduction string, if exists, for HTML output
_processPost ( ) Update or reset configuration

Method Details

__construct() public method

Create WPDKConfigurationView instance object
public __construct ( string $id, string $title, WPDKConfiguration $configuration = null, object | array $sub_configuration = null, string $introduction = '' ) : WPDKConfigurationView
$id string ID key of configuration
$title string Title of configuration view
$configuration WPDKConfiguration Optional. Main configuration pointer
$sub_configuration object | array Optional. Sub configuration
$introduction string Optional. An introduction text message
return WPDKConfigurationView

buttonsUpdateReset() public method

Return the HTML markup for standard [Reset to default] and [Update] buttons. You can override this method to hide or change the default buttons on bottom form.
Since: 1.0.0.b3
public buttonsUpdateReset ( ) : string
return string

draw() public method

Display the content view with form, introduction, fields or custom content. You can override this method with your own drawing.
public draw ( )

fields() public method

Return a SDF array for build the form fields
public fields ( )

resetToDefault() public method

Reset to default values of sub configuration branch. You can override this method if your sub configuration branch is not an object or not implements a defaults() method.
public resetToDefault ( )

updatePostData() public method

Process and set you own post data
public updatePostData ( ) : boolean
return boolean TRUE to update the configuration and display the standard sucessfully message, or FALSE to avoid the update configuration and do a custom display.

wpdk_header_view_after_title() public method

Display succefully configuration updated message
public wpdk_header_view_after_title ( WPDKHeaderView $header_view )
$header_view WPDKHeaderView

Property Details

$introduction public_oe property

This is an optional string information
public string $introduction
return string

$title public_oe property

The configuration title
public string $title
return string