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

Public Member Functions

 Form_Section ($assetid=0)
 
 _updated ($update_parents=TRUE)
 
 _getAllowedLinks ()
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 cloneComponents (&$clone, $components, $override=FALSE)
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 getAsset ($shadowid, $type_code='', $mute_errors=FALSE)
 
 getLinkById ($linkid, $assetid=0, $side_of_link='major')
 
 countLinks ($assetid, $side_of_link='major', $link_types=0, $type_code='', $strict_type_code=TRUE, $ignore_linkid=0)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=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)
 
 getAssetMapAssetInfo ($assetid)
 
 fileRegeneration ($form_regen=TRUE)
 
 generateJSCode ()
 
 getQuestions ($force=FALSE)
 
 getQuestionAssets ($type_code=NULL)
 
 getAllQuestionAssets ($type_code=NULL)
 
 getQuestionByID ($questionid)
 
getQuestionByOrder ($orderid)
 
 attachQuestion ($type_code)
 
 deleteQuestion (&$question)
 
 getQuestionCount ()
 
 getSectionLinks ()
 
 printBody (Form $form, $submit_buttons=FALSE)
 
 printDefaultFormat (Form $form, $submit_buttons=FALSE)
 
 printCustomFormat (Form $form, $submit_buttons=FALSE)
 
 printSemanticSummary ()
 
 createFormatBodycopy ($enable_on_create=TRUE)
 
getFormatBodycopy ($only_if_enabled=TRUE)
 
 isFormatBodycopyEnabled ()
 
 setUseFormatBodycopy ($enabled)
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 getDisplayKeywords ($include_submit_keywords=TRUE)
 
 getResponseKeywords ()
 
 getDisplayKeywordReplacements ($generating=FALSE, $include_submit_keywords=TRUE, $form=NULL)
 
- 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 ()
 

Data Fields

 $question_index = 0
 
 $question_col_width = 0
 
 $answer_col_width = 0
 
 $current_answers = Array()
 
 $extra_data = Array()
 
 $submission_errors = 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 31 of file form_section.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 120 of file form_section.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
string private
See Also
Asset::_getName()

Definition at line 279 of file form_section.inc.

_updated (   $update_parents = TRUE)

Set the last updated info for this asset

Call this function when the asset has been changed in some way so we can indicated in the asset table when the asset was last changed and who by. This function will also increment the micro version number for the asset.

Parameters
boolean$update_parentsshould we go through an update all our dependant parents as well ? NOTE: this is passed to incrementVersion to let it know that the parents should have their versions updated as well.
Returns
boolean private

Definition at line 104 of file form_section.inc.

attachQuestion (   $type_code)

attach a question to this form

FALSE if database problem or question already attached, TRUE if sucessful

Parameters
string$type_codethe type of the question to attach
Returns
boolean public

Definition at line 959 of file form_section.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 431 of file form_section.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 1283 of file form_section.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 451 of file form_section.inc.

deleteQuestion ( $question)

delete a question to this form

returns FALSE if database problem or question already deleted, TRUE if sucessful

Parameters
object&$questionthe question object to delete
Returns
boolean public

Definition at line 1018 of file form_section.inc.

fileRegeneration (   $form_regen = TRUE)

regenerates the content file for this section

Parameters
boolean$form_regenif TRUE the section will get all its forms to regen as well
Returns
boolean public

Definition at line 792 of file form_section.inc.

Form_Section (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 79 of file form_section.inc.

generateJSCode ( )

writes JavaScript code for client side validation

This function assumes the skeleton of a JS validation function has been created around this code with a form variable named 'form' passed (this is done when generating the content file).

Returns
string public

Definition at line 830 of file form_section.inc.

getAllQuestionAssets (   $type_code = NULL)

Get all question assets attached to this section, including nested sections

Parameters
string$type_codeWhen specified, only return assets of this exact type
Returns
array public

Definition at line 901 of file form_section.inc.

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

Returns a reference to the asset represented by the passed assetid

Parameters
int$shadowidthe shadow part asset id to be loaded (i.e part after the ':')
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
mixed object|NULL public
See Also
Asset_Manager::&getAsset()

Implements Bridge.

Definition at line 314 of file form_section.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 774 of file form_section.inc.

getAssetMapLinks ( )

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

Returns
array public

Definition at line 588 of file form_section.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

returns array(int => string) returns an array of assetids and their type code

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 700 of file form_section.inc.

getDisplayKeywordReplacements (   $generating = FALSE,
  $include_submit_keywords = TRUE,
  $form = NULL 
)

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

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

Returns
array public

Definition at line 1530 of file form_section.inc.

getDisplayKeywords (   $include_submit_keywords = TRUE)

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

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

Parameters
boolean$include_submit_keywordsIf TRUE, keywords for submit/reset/errors will be made available. If calling from a single-page form, this will probably be FALSE since the form provides its own.
Returns
array public

Definition at line 1446 of file form_section.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 1327 of file form_section.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 urls to check for -> null defaults it to current url
Returns
array public

Implements Bridge.

Definition at line 759 of file form_section.inc.

getLinkById (   $linkid,
  $assetid = 0,
  $side_of_link = 'major' 
)

Get details of the link with specified linkid

Parameters
int$linkidid of the link were returning
int$assetidid of the the $side_of_link asset if zero no check is made and both major and minor information is returned
string$side_of_linkWhich side of the link the asset represented by $assetid is on ('major' or 'minor')
Returns
array public

Definition at line 364 of file form_section.inc.

getLinks (   $assetid,
  $link_types,
  $type_code = '',
  $strict_type_code = TRUE,
  $side_of_link = 'major',
  $sort_by = 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)
Returns
array public

Implements Bridge.

Definition at line 487 of file form_section.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 652 of file form_section.inc.

getQuestionAssets (   $type_code = NULL)

Get the question assets directly attached to this section

Parameters
string$type_codeWhen specified, only return assets of this exact type
Returns
array public

Definition at line 873 of file form_section.inc.

getQuestionByID (   $questionid)

get a specific question

Parameters
int$questionidThe id of the desired question
Returns
array public

Definition at line 924 of file form_section.inc.

& getQuestionByOrder (   $orderid)

get specific question by order

Parameters
int$orderidthe sequence of the desired question
Returns
array public

Definition at line 940 of file form_section.inc.

getQuestionCount ( )

returns the count of questions linked to this section

Returns
int public

Definition at line 1060 of file form_section.inc.

getQuestions (   $force = FALSE)

get the section links attached to this form

Parameters
boolean$forcewhether to force... something or not
Returns
array public

Definition at line 858 of file form_section.inc.

getResponseKeywords ( )

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

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

Returns
array public

Definition at line 1491 of file form_section.inc.

getSectionLinks ( )

get the links to any form sections that are nested within this form section

Returns
array public

Definition at line 1077 of file form_section.inc.

isFormatBodycopyEnabled ( )

Returns whether the format bodycopy is enabled

Returns
boolean public

Definition at line 1355 of file form_section.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 1419 of file form_section.inc.

prepareLink ( Asset  $asset,
  $side_of_link,
$link_type,
$value,
$sort_order,
$dependant,
$exclusive 
)

Prepares for linking by checking that the link values are valid for this link

This function will be called if this asset is the major or minor party in the link, so the side_of_link flag should be checked to work out what side of the link this asset is on. The return value should indicate if any of the link fields were changed.

Parameters
object&$assetthe major or minor asset that we are linking to
string$side_of_linkthe side of the link we are on (major or minor)
string&$link_typethe type of link we are creating
string&$valuethe value that is to be associated with the link
string&$sort_orderthe position in the links list that this link should take,
string&$dependant'0' / '1' on whether the this asset is dependant on the asset that will be linked by the new link
string&$exclusive'0' / '1' on whether the this asset is linked exclusivly to the asset that will be linked by the new link
Returns
boolean public

Definition at line 165 of file form_section.inc.

printBody ( Form  $form,
  $submit_buttons = FALSE 
)

Paint the section contents.

Parameters
Form$formThe form we are printing from. We need to know this, since the section can be shared amongst other forms, but some settings are made at a Form level, such as client side validation.
boolean$submit_buttonsWhether to paint the submit and cancel buttons. If FALSE, these buttons will be blanked out upon painting. Will be set to TRUE in a multi-page form.
Returns
void public

Definition at line 1122 of file form_section.inc.

printCustomFormat ( Form  $form,
  $submit_buttons = FALSE 
)

Paints the form section using a custom format bodycopy

Parameters
Form$formThe form we are printing from
boolean$submit_buttonsWhether to paint the submit and cancel buttons.
Returns
void private

Definition at line 1193 of file form_section.inc.

printDefaultFormat ( Form  $form,
  $submit_buttons = FALSE 
)

Paints the form section using a default bodycopy

Parameters
Form$formThe form we are printing from
boolean$submit_buttonsWhether to paint the submit and cancel buttons.
Returns
void private

Definition at line 1143 of file form_section.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 1381 of file form_section.inc.


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