Class AdminPageFramework_FieldType
The base class for the users to create their custom field types.
When a framework user implements a custom field type into his/her work, this class may be extended to create a field definition class.
- AdminPageFramework_Utility_String
-
AdminPageFramework_Utility_Array
-
AdminPageFramework_Utility_Path
-
AdminPageFramework_Utility_URL
-
AdminPageFramework_Utility_File
-
AdminPageFramework_Utility_SystemInformation
-
AdminPageFramework_Utility
-
AdminPageFramework_WPUtility_URL
-
AdminPageFramework_WPUtility_HTML
-
AdminPageFramework_WPUtility_Page
-
AdminPageFramework_WPUtility_Hook
-
AdminPageFramework_WPUtility_File
-
AdminPageFramework_WPUtility_Option
-
AdminPageFramework_WPUtility_Post
-
AdminPageFramework_WPUtility_SystemInformation
-
AdminPageFramework_WPUtility
-
AdminPageFramework_FieldType_Base
-
AdminPageFramework_FieldType
Package: AdminPageFramework\FieldType
Since: 2.1.5
Since: 3.0.0 Changed the name from
AdminPageFramework_CustomFieldType
to
AdminPageFramework_FieldType
.Remark: The user will extend this class to define their custom field types.
Located at _view/AdminPageFramework_FieldType/AdminPageFramework_FieldType.php
Methods summary
protected
|
#
construct( )
The user constructor. When the user defines a field type, they may use this instead of the real constructor so that they don't have to care about the internal parameters. Since
3.1.3
Remark
The user will override this method in their class definition.
OverridesAdminPageFramework_FieldType_Base::construct |
protected
|
#
setUp( )
Loads the field type necessary components. This method is triggered when a field definition array that calls this field type is parsed. Since
3.0.0
Remark
The user will override this method in their class definition.
|
protected
|
#
getScripts( )
Returns the JavaScript output inside the
Since
3.0.0
Remark
The user will override this method in their class definition.
|
protected
|
#
getIEStyles( )
Returns the CSS output specific to Internet Explorer inside the
Since
3.0.0
Remark
The user will override this method in their class definition.
|
protected
|
#
getStyles( )
Returns the field type specific CSS output inside the
Since
3.0.0
Remark
The user will override this method in their class definition.
|
protected
|
#
getField( mixed $aField )
Returns the field output. Since
3.0.0
Remark
The user will override this method in their class definition.
|
protected
|
#
getEnqueuingScripts( )
Returns an array holding the urls of enqueuing scripts. The returning array should consist of all numeric keys. Each element can be either a string( the url or the path of the source file) or an array of custom argument. Custom Argument Array
Examplesprotected function getEnqueuingScripts() { return array( array( // if you need to set a dependency, pass as a custom argument array. 'src' => dirname( __FILE__ ) . '/asset/my_script.js', // path or url 'dependencies' => array( 'jquery' ) ), dirname( __FILE__ ) . '/asset/my_another.js', // a string value of the target path or url will work as well. ); } Remark
The user will override this method in their class definition.
|
protected
|
#
getEnqueuingStyles( )
Returns an array holding the urls of enqueuing styles. The returning array should consist of all numeric keys. Each element can be either a string( the url or the path of the source file) or an array of custom argument. Custom Argument Array
Examplesprotected function getEnqueuingStyles() { return array( dirname( __FILE__ ) . '/asset/my_style.css', array( 'src' => dirname( __FILE__ ) . '/asset/my_style2.css', 'handle_id' => 'my_style2', ), ); } Remark
The user will override this method in their class definition.
|
Methods inherited from AdminPageFramework_FieldType_Base
__construct()
,
_replyToFieldLoader()
,
_replyToFieldTypeSetter()
,
_replyToGetEnqueuingScripts()
,
_replyToGetEnqueuingStyles()
,
_replyToGetField()
,
_replyToGetInputIEStyles()
,
_replyToGetScripts()
,
_replyToGetStyles()
,
_replyToRegisterInputFieldType()
,
_replyToRemovingMediaLibraryTab()
,
_replyToReplaceThickBoxText()
,
enqueueMediaUploader()
,
geFieldOutput()
,
getDefinitionArray()
,
getFieldElementByKey()
Methods inherited from AdminPageFramework_WPUtility
FlushRewriteRules()
Methods inherited from AdminPageFramework_WPUtility_SystemInformation
getMySQLErrorLog()
,
getMySQLErrorLogPath()
,
getMySQLInfo()
Methods inherited from AdminPageFramework_WPUtility_Post
getSavedMetaArray()
Methods inherited from AdminPageFramework_WPUtility_Option
deleteTransient()
,
getOption()
,
getSiteOption()
,
getTransient()
,
setTransient()
Methods inherited from AdminPageFramework_WPUtility_File
download()
,
getBaseNameOfURL()
,
getScriptData()
,
setTempPath()
Methods inherited from AdminPageFramework_WPUtility_Hook
addAndApplyFilter()
,
addAndApplyFilters()
,
addAndDoAction()
,
addAndDoActions()
,
doActions()
,
getFilterArrayByPrefix()
,
registerAction()
Methods inherited from AdminPageFramework_WPUtility_Page
getCurrentPostType()
,
getCurrentScreenID()
,
getPageNow()
,
isCustomTaxonomyPage()
,
isPostDefinitionPage()
,
isPostListingPage()
Methods inherited from AdminPageFramework_WPUtility_HTML
generateAttributes()
,
generateDataAttributes()
Methods inherited from AdminPageFramework_WPUtility_URL
getCurrentAdminURL()
,
getQueryAdminURL()
,
getQueryURL()
,
getSRCFromPath()
,
resolveSRC()
Methods inherited from AdminPageFramework_Utility
generateClassAttribute()
,
generateInlineCSS()
,
generateStyleAttribute()
,
getDataAttributeArray()
,
getQueryValueInURLByKey()
,
sanitizeLength()
Methods inherited from AdminPageFramework_Utility_SystemInformation
getDefinedConstants()
,
getPHPErrorLog()
,
getPHPErrorLogPath()
,
getPHPInfo()
Methods inherited from AdminPageFramework_Utility_File
getFileTailContents()
,
sanitizeFileName()
Methods inherited from AdminPageFramework_Utility_URL
getCurrentURL()
Methods inherited from AdminPageFramework_Utility_Path
getCallerScriptPath()
,
getRelativePath()
Methods inherited from AdminPageFramework_Utility_Array
castArrayContents()
,
dropElementByValue()
,
dropElementsByKey()
,
dropElementsByType()
,
getArrayDimension()
,
getArrayValueByArrayKeys()
,
getAsArray()
,
getCorrespondingArrayValue()
,
getElement()
,
getElementAsArray()
,
getIntegerElements()
,
getNonIntegerElements()
,
getReadableArrayContents()
,
getReadableArrayContentsHTML()
,
getReadableListOfArray()
,
getReadableListOfArrayAsHTML()
,
invertCastArrayContents()
,
isAssociativeArray()
,
isFirstElement()
,
isLastElement()
,
numerizeElements()
,
shiftTillTrue()
,
uniteArrays()
,
uniteArraysRecursive()
Methods inherited from AdminPageFramework_Utility_String
fixNumber()
,
getNumberOfReadableSize()
,
getReadableBytes()
,
getStringLength()
,
minifyCSS()
,
sanitizeSlug()
,
sanitizeString()
Magic methods summary
Properties summary
public
array
|
$aFieldTypeSlugs |
#
Defines the field type slugs used for this field type. The slug is used for the type key in a field definition array. $this->addSettingFields( array( 'section_id' => '...', 'type' => 'my_filed_type_slug', // <--- THIS PART 'field_id' => '...', 'title' => '...', ) ); Examplepublic $aFieldTypeSlugs = array( 'my_field_type_slug', 'alternative_field_type_slug' ); |
protected
array
|
$aDefaultKeys |
#
Defines the default key-values of this field type. The users will set the values to the defined keys and if not set, the value
set in this property array will take effect. The merged array of the user's
field definition array and this property array will be passed to the first
parameter of the $this->addSettingFields( array( 'section_id' => '...', // built-in key 'type' => '...', // built-in key 'field_id' => '...', // built-in key 'my_custom_key' => 'the default value for this key', // <-- THIS PART 'another_custom)key' => 'the default value for this key', // <-- THIS PART ) ); Example$aDefaultKeys = array( 'my_custom_key' => 'my default value', 'attributes' => array( 'size' => 30, 'maxlength' => 400, ), ); Remark
$_aDefaultKeys defined by the system internally holds shared default
key-values defined in the base class.
|
Properties inherited from AdminPageFramework_FieldType_Base
$_aDefaultKeys
,
$_sFieldSetType
,
$oMsg