clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • cfApiController
  • cfBackendAdduserAction
  • cfBackendApikeysAction
  • cfBackendBrowsectntAction
  • cfBackendBrowsefilesAction
  • cfBackendClearcacheAction
  • cfBackendClearipblocksAction
  • cfBackendContentpermsAction
  • cfBackendContenttypesAction
  • cfBackendController
  • cfBackendControllerAction
  • cfBackendDashboardAction
  • cfBackendDocumentsAction
  • cfBackendDraftsAction
  • cfBackendEdituserAction
  • cfBackendElementsAction
  • cfBackendFilemgrAction
  • cfBackendFingerprintAction
  • cfBackendForgotpwdAction
  • cfBackendImagepreviewAction
  • cfBackendListusersAction
  • cfBackendLoginAction
  • cfBackendLogoutAction
  • cfBackendModulesAction
  • cfBackendMyprofileAction
  • cfBackendPrivatefilemgrAction
  • cfBackendResetpwdAction
  • cfBackendRolesAction
  • cfBackendSelectsiteAction
  • cfBackendSet403Action
  • cfBackendSet404Action
  • cfBackendSeterrorAction
  • cfBackendSethomeAction
  • cfBackendSetthemeAction
  • cfBackendSettingsAction
  • cfBackendSitemgrAction
  • cfBackendSocialimgsAction
  • cfConfirm
  • cfContent
  • cfContentController
  • cfContentTree
  • cfCron
  • cfCronController
  • cfCustomFieldList
  • cfCustomFields
  • cfDashboardMgr
  • cfDrafts
  • cfInstallController
  • cfNoticesEvent
  • cfNoticesEventMsg
  • cfPseudoCron
  • cfSearchHelper
  • cfSiteManager
  • cfSocialImagesMgr
  • cfTaskRunner
  • cfTaskSnippets
  • cfTemplateEngine
  • cfUserMgr
  • cfUserProfile
  • cfValidatorPageSlug
  • cfValidatorUserEmail
  • cfValidatorUsername
  • clearFusionCMS
  • contentApiV1
  • contentDrafts
  • errorController

Interfaces

  • cfInstallInterface
  • cfInstallUpdInterface
  • cfModuleSettingsInterface
  • cfUserProfileInterface

Exceptions

  • cfException
  • clearFusionCMSException

Class cfCustomFields

cfCustomFields Class

Class to create, manage and use custom fields.

Package: clearFusionCMS
Copyright: Copyright (c) 2012 - 2014 clearFusionCMS. All rights reserved.
Located at system/app/cfCustomFields.php

Methods summary

public
# __construct( flDb $db )

Create the object.

Create the object.

Parameters

$db
The database to use.
public integer
# getCount( integer $catId = null )

Get the count of custom fields.

Get the count of custom fields.

Parameters

$catId
If given is limits the count to a category.

Returns

integer
The number of custom fields.
public array
# getFieldsInCat( integer $catId )

Get the list of fields that are in a category.

Get the list of fields that are in a category.

Parameters

$catId
The category id.

Returns

array
Array of fields in the category.
public array
# getFields( )

Get the list of fields.

Get the list of fields.

Returns

array
Array of fields.
public
# categoryDeleted( integer $catId )

Moves all fields from the deleted category to the root.

Moves all fields from the deleted category to the root.

Parameters

$catId
ID of the category being deleted.
public
# templateDeleted( string $tpl )

Removes all field to template mappings when a template is deleted.

Removes all field to template mappings when a template is deleted.

Parameters

$tpl
The template that was deleted.
public array
# getField( string $id )

Get the data for a field.

Get the data for a field.

Parameters

$id
ID of the field to get.

Returns

array
Associative array of data or false if failed to read.
public boolean
# createField( string $name, string $type, string $caption, string $description, string $edPerm, integer $catId, integer $dispOrder, array $templates, array $validation, boolean $ignoregroup )

Create a field.

Create a field.

Parameters

$name
The name of the field.
$type
The field type.
$caption
The field caption.
$description
The description of the field.
$edPerm
The editor permission required if any.
$catId
The category to add the element to.
$dispOrder
The display order.
$templates
Array of templates the field is assigned to.
$validation
Array of validation data.
$ignoregroup
true if display grouping should be ignored; else false.

Returns

boolean
true if created; or false if failed.
public boolean
# updateField( string $id, string $name, string $type, string $caption, string $description, string $edPerm, integer $catId, integer $dispOrder, array $templates, array $validation, boolean $ignoregroup )

Update a field.

Update a field.

Parameters

$id
The id of the field to update.
$name
The name of the field.
$type
The field type.
$caption
The field caption.
$description
The description of the field.
$edPerm
The editor permission required if any.
$catId
The category to add the element to.
$dispOrder
The display order.
$templates
Array of templates the field is assigned to.
$validation
Array of validation data.
$ignoregroup
if display grouping should be ignored; else false.

Returns

boolean
true if updated; or false if failed.
public
# deleteField( string $id )

Delete a field and all field data.

Delete a field and all field data.

Parameters

$id
ID of the field to delete.
public array
# getTypes( )

Get an array of supported field types and their descriptions

Get an array of supported field types and their descriptions

Returns

array
The available field types.
public cfCustomFieldList
# addToForm( flForm $form, string $template, array $editorData, array $data, boolean $before )

Build the field list and add the fields to the form.

Build the field list and add the fields to the form.

Parameters

$form
The form to add the fields to.
$template
The name of the template being used.
$editorData
Data for use in the editor element.
$data
The existing data to edit.
$before
true if drawing fields before content box or false for those after.

Returns

cfCustomFieldList
The fields.
public array
# getTemplateFields( string $template )

Get the list of fields active on a template.

Get the list of fields active on a template.

Parameters

$template
The name of the template.

Returns

array
The list of placeholders.
public
# storeFields( integer $docId, string $activeSite, array $fields )

Store the field data.

Store the field data.

Parameters

$docId
The document to store the fields for.
$activeSite
The active site name.
$fields
Array of fields and their data.
public array
# loadFields( integer $docId, string $activeSite )

Load the field data.

Load the field data.

Parameters

$docId
The document to load the fields for.
$activeSite
The active site name.

Returns

array
Array of fields and their data.
public
# docDeleted( string $activeSite )

Clean up of deleted documents.

Clean up of deleted documents.

Parameters

$activeSite
The active site name.
public
# docDeleteFields( string $activeSite, integer $id )

Delete the custom fields for a specific document.

Delete the custom fields for a specific document.

Parameters

$activeSite
The active site name.
$id
The ID of the document to delete the fields from.
public
# templateChanged( string $old, string $new )

Track change in template name.

Track change in template name.

Parameters

$old
The old name.
$new
The new name.
public
# copy( string $src, string $dst )

Copy the custom fields between templates.

Copy the custom fields between templates.

Parameters

$src
Source template.
$dst
Destination template.

Properties summary

protected flDb $db

The database object.

The database object.

#
protected array $catCache

Cache of category ids to names.

Cache of category ids to names.

# null
clearFusionCMS 3.0.0 API documentation generated by ApiGen