Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Simple_Form Class Reference
Inheritance diagram for Simple_Form:
Asset Bridge MySource_Object

Public Member Functions

 Simple_Form ($assetid=0)
 
 getAsset ($assetid, $type_code='', $mute_errors=FALSE)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL, $dependant=NULL, $exclusive=NULL)
 
 getAssetMapLinks ()
 
 getParents ($shadowid, $type_code='', $strict_type_code=TRUE)
 
 getChildren ($assetid, $type_code='', $strict_type_code=TRUE, $dependant=NULL, $sort_by=NULL)
 
 getLineageFromURL ($assetid, $protocol, $url)
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getAllowedLinks ()
 
 createQuestion ($type_code, $name=NULL)
 
 deleteQuestion ($assetid)
 
 paintQuestion ($assetid)
 
 process ()
 
 getErrors ()
 
 getQuestions ($include_nested=FALSE)
 
 getAnswers ()
 
 getAnswerValues ()
 
 getAnswerSummaries ()
 
 getAnswerExtraData ()
 
 getClientSideJS ()
 
 getClientSideFunction ()
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 getDisplayKeywords ($prefix)
 
 getResponseKeywords ($prefix)
 
 getDisplayKeywordReplacement ($prefix)
 
 getResponseKeywordReplacement ($prefix)
 
 createFormatBodycopy ($enable_on_create=TRUE)
 
getFormatBodycopy ($only_if_enabled=TRUE)
 
 isFormatBodycopyEnabled ()
 
 setUseFormatBodycopy ($enabled)
 
 printBody ($print_form_tags=TRUE, $submit_buttons=TRUE, $form_action='', $print_js=TRUE)
 
 printDefaultFormat ($submit_buttons=TRUE)
 
 printCustomFormat (&$bodycopy)
 
 printReceipt ($html=TRUE, $include_form_info=TRUE)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 countLinks ($assetid, $side_of_link='major', $link_types=0, $type_code='', $strict_type_code=TRUE, $ignore_linkid=0)
 
 getAssetMapAssetInfo ($assetid)
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from Bridge
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL)
 

Data Fields

 $_errors = Array()
 
 $_answers = Array()
 
- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Additional Inherited Members

- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 34 of file simple_form.inc.

Member Function Documentation

_getAllowedLinks ( )

Returns an array of all the permitted link type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 543 of file simple_form.inc.

_getName (   $short_name = FALSE,
  $contextid = NULL 
)

Returns name of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
int$contextidwhat context to return the name from
Returns
array private
See Also
Asset::_getName()

Definition at line 518 of file simple_form.inc.

countLinks (   $assetid,
  $side_of_link = 'major',
  $link_types = 0,
  $type_code = '',
  $strict_type_code = TRUE,
  $ignore_linkid = 0 
)

Return the number of links in the system that involve the specified asset

Can be restricted by either link type afnd/or asset type code

Parameters
int$assetidid of the the $side_of_link asset
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
mixed$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
int$ignore_linkidignore the link represented by this link id when returning the count
Returns
int public

Implements Bridge.

Definition at line 1608 of file simple_form.inc.

createFormatBodycopy (   $enable_on_create = TRUE)

Creates the format bodycopy

Returns false if bodycopy already exists

Parameters
boolean$enable_on_createif true, will set the bodycopy to be enabled (TYPE_2 link) when it is created. If false, creates it disabled (TYPE_3 link).
Returns
boolean public

Definition at line 1201 of file simple_form.inc.

createQuestion (   $type_code,
  $name = NULL 
)

Creates a question and adds it to the form

Parameters
string$type_codethe type code of the question we want to add
string$namethe name of the new question
Returns
boolean public

Definition at line 580 of file simple_form.inc.

deleteAssetLink (   $linkid,
  $moving = FALSE 
)

Remove a link by id

Parameters
int$linkidthe link id of the link to remove
boolean$movingTRUE if this delete is part of a move operation
Returns
boolean public

Implements Bridge.

Definition at line 1580 of file simple_form.inc.

deleteQuestion (   $assetid)

Deletes a question

Parameters
string$assetidthe id of the question to delete
Returns
boolean public

Definition at line 621 of file simple_form.inc.

getAnswerExtraData ( )

Return a list of answer extra data recorded from processed questions

Returns
array public

Definition at line 859 of file simple_form.inc.

getAnswers ( )

Return a list of full answer information recorded from processed questions

Returned array is in format:

Array(
    assetid => Array(
            'name'          => string,      // name of question
            'type_code'     => string,      // type code of question
            'value'         => mixed,       // raw value
            'summary'       => string,      // question summary text
            'extra_data'    => mixed,       // free-form metadata for result
            'is_error'      => boolean,     // did this error out?
           ),
)
Returns
array public

Definition at line 812 of file simple_form.inc.

getAnswerSummaries ( )

Return a list of answer summaries recorded from processed questions

Returns
array public

Definition at line 842 of file simple_form.inc.

getAnswerValues ( )

Return a list of raw answer values recorded from processed questions

Returns
array public

Definition at line 825 of file simple_form.inc.

getAsset (   $assetid,
  $type_code = '',
  $mute_errors = FALSE 
)

Returns a reference to the asset represented by the passed assetid or null on error

Parameters
int$assetidthe asset id to be loaded
string$type_codeif this exists then this object is used to load the asset, if not then the DB is queried to find out the asset type
boolean$mute_errorsstops the outputting of errors in this fn, needed because you can't use the '@' operator when returning by reference
Returns
object public
See Also
Asset_Manager::&getAsset()

Implements Bridge.

Definition at line 89 of file simple_form.inc.

getAssetMapAssetInfo (   $assetid)

Get asset info for use by asset map

Parameters
string$assetidFull Asset id to get information for
Returns
array public

Implements Bridge.

Definition at line 1623 of file simple_form.inc.

getAssetMapLinks ( )

Used by asset map to return a asset map-style link array

Returns
array public

Definition at line 290 of file simple_form.inc.

getChildren (   $assetid,
  $type_code = '',
  $strict_type_code = TRUE,
  $dependant = NULL,
  $sort_by = NULL 
)

Get all asset ids that are below the passed assetid in the various trees in which it exists

Parameters
int$assetidthe id of the asset to get its children for
string | array$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
boolean$dependantif TRUE, results will be filtered to assets that are dependants. If FALSE, results will all not be dependants. If NULL, results will not be filtered
string$sort_bya field in the asset table you would like the results sorted by (eg. name, short_name etc)
Returns
array public
See Also
Asset_Manager::getChildren()

Implements Bridge.

Definition at line 411 of file simple_form.inc.

getClientSideFunction ( )

Builds a JavaScript fn that can be called to initiate client-side validation

Returns
string public

Definition at line 943 of file simple_form.inc.

getClientSideJS ( )

Returns the client-side validation code to be placed before the form

Note that this is only defined in the simple form and not the section, as a form should be validated as a whole The return value of this function should be placed in a function that acts as an onSubmit handler. Any text relating to failed rules will be placed in the submission_errors array; do what you wish with those. If no validation rules exist, an empty string ('') will be returned.

Returns
string public

Definition at line 886 of file simple_form.inc.

getDisplayKeywordReplacement (   $prefix)

Returns a list of display keywords for the questions handled by this section

Return format is (string => string) keyword => description

Parameters
string$prefixthe prefix that should be applied to each keyword returned by this function
Returns
array public

Definition at line 1098 of file simple_form.inc.

getDisplayKeywords (   $prefix)

Returns a list of display keywords for the questions handled by this section

return format is (string => string) keyword => description

Parameters
string$prefixthe prefix that should be applied to each keyword returned by this function
Returns
array public

Definition at line 1014 of file simple_form.inc.

getErrors ( )

Return a list of errors from last time we processed the form

Returns
array public

Definition at line 736 of file simple_form.inc.

& getFormatBodycopy (   $only_if_enabled = TRUE)

Returns the format bodycopy or NULL

Parameters
boolean$only_if_enabledif true, will return NULL if the bodycopy is disabled. If false, will only return NULL if never created.
Returns
object public

Definition at line 1245 of file simple_form.inc.

getLineageFromURL (   $assetid,
  $protocol,
  $url 
)

Returns an array of assetid's + info in the order that they propogate out from THIS BRIDGE'S url

Parameters
string$assetidthe id of the last asset in the lineage
string$protocolthe protocol to match -> NULL means it is ignored
string$urlthe url to check for -> NULL defaults it to current url
Returns
array public

Implements Bridge.

Definition at line 498 of file simple_form.inc.

getLinks (   $assetid,
  $link_types,
  $type_code = '',
  $strict_type_code = TRUE,
  $side_of_link = 'major',
  $sort_by = NULL,
  $dependant = NULL,
  $exclusive = NULL 
)

Return all links that this asset has to other assets

Parameters
int$assetidid of the the $side_of_link asset
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
string | array$type_codethe type of asset that is linked (eg 'Page', 'File', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
string$sort_bya field in the asset table you would like the results sorted by (eg. name, short_name etc)
boolean$dependantWhether we want dependant links, non-dependent or (NULL) don't care
boolean$exclusiveWhether we want exclusive links, non-exclusive or (NULL) don't care
Returns
array public

Definition at line 150 of file simple_form.inc.

getParents (   $shadowid,
  $type_code = '',
  $strict_type_code = TRUE 
)

Get all asset ids that are above the passed assetid in the various trees in which it exists

Parameters
int$shadowidthe shadow ID of the shadow asset to get (ie. the part after the ':')
string | array$type_codethe type of asset that is linked (eg 'User', 'User_Group', etc) if an array returns link if matches any of the array values
boolean$strict_type_codewhether we are finding assets that are just a $type_code or $type_code and any of it's sub-classes
Returns
array public
See Also
Asset_Manager::getParents()

Implements Bridge.

Definition at line 360 of file simple_form.inc.

getQuestions (   $include_nested = FALSE)

Return a list of full question information

Returned array is in the following format:

Array(
    assetid => Array(
                'name'          => string,      // name of question
                'type_code'     => string,      // type code of question
            'sort_order'    => int          // sort order (for asset map)
               ),
)
Parameters
boolean$include_nestedif TRUE, return all the questions underneath this form (including those belonging to nested forms); otherwise, only return questions attached to this form
Returns
array public

Definition at line 762 of file simple_form.inc.

getResponseKeywordReplacement (   $prefix)

Returns a list of response keywords for the questions handled by this section

Return format is (string => string) keyword => description

Parameters
string$prefixthe prefix that should be applied to each keyword returned by this function
Returns
array public

Definition at line 1156 of file simple_form.inc.

getResponseKeywords (   $prefix)

Returns a list of response keywords for the questions handled by this section

Return format is (string => string) keyword => description

Parameters
string$prefixthe prefix that should be applied to each keyword returned by this function
Returns
array public

Definition at line 1057 of file simple_form.inc.

isFormatBodycopyEnabled ( )

Returns whether the format bodycopy is enabled

Returns
boolean public

Definition at line 1273 of file simple_form.inc.

onRequestKeywords ( $broadcaster,
  $vars = Array() 
)

Add valid keywords for this asset to an array of keywords when asked

Parameters
object&$broadcasterthe asset that triggered the event
array$varsthe vars that get submitted by the broadcaster we add keywords to the $vars['keywords'] array
Returns
boolean private

Definition at line 989 of file simple_form.inc.

paintQuestion (   $assetid)

Calls a specified question to paint itself

Parameters
string$assetidthe (shadow) asset ID of the question we need to paint
Returns
void public

Definition at line 656 of file simple_form.inc.

printBody (   $print_form_tags = TRUE,
  $submit_buttons = TRUE,
  $form_action = '',
  $print_js = TRUE 
)

Paint the form

Parameters
boolean$print_form_tagsprint out the form tags
boolean$submit_buttonswhether to paint the submit and cancel buttons
boolean$print_jsprint the client-side validation function (if any)
Returns
void public

Definition at line 1336 of file simple_form.inc.

printCustomFormat ( $bodycopy)

Paints the form using the custom format bodycopy

Parameters
object&$bodycopythe custom format bodycopy to be used
Returns
void private

Definition at line 1425 of file simple_form.inc.

printDefaultFormat (   $submit_buttons = TRUE)

Paints the form using a default format

Parameters
boolean$submit_buttonswhether to paint the submit and cancel buttons
Returns
void private

Definition at line 1382 of file simple_form.inc.

printReceipt (   $html = TRUE,
  $include_form_info = TRUE 
)

Print a standard receipt format

Parameters
boolean$htmltrue - (default) to use HTML format false - use text format
boolean$include_form_infoset to true to include form information (if false, the "Form Response" header will not be printed)
Returns
void public

Definition at line 1449 of file simple_form.inc.

process ( )

Processes the form

Returns
boolean public

Definition at line 673 of file simple_form.inc.

setUseFormatBodycopy (   $enabled)

Handles the enabling or disabling of the format bodycopy

Parameters
boolean$enabledset to true to enable the format bodycopy, set to false to disable it
Returns
boolean public

Definition at line 1299 of file simple_form.inc.

Simple_Form (   $assetid = 0)

Constructor

Parameters
string$assetidthe ID of the asset to load, if any
Returns
void public

Definition at line 64 of file simple_form.inc.


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