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

Public Member Functions

 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printFrontend ()
 
 setAsset ($id)
 
 getGeneralInfo (Asset $asset, $add_more_attributes=FALSE)
 
 createLink ($parent, $child, $link_type, $link_value, $sort_order, $is_dependant, $is_exclusive)
 
 removeLink ($parent, $child, $link_type=NULL, $link_value=NULL)
 
 moveLink ($old_parent_id, $asset_id_to_move, $old_link_type=SQ_LINK_TYPE_1, $old_link_value='', $new_parent_id, $new_link_type=SQ_LINK_TYPE_1, $new_link_value='', $new_position)
 
 updateLink ($parent, $child, $existing_link_type=SQ_LINK_TYPE_1, $existing_link_value= '', $link_type=SQ_LINK_TYPE_1, $link_value='', $sort_order, $locked=TRUE)
 
 getPermission ($id, $level)
 
 getGroupChildren ($key)
 
 getParents ($id, $level, $type_codes=Array(), $link_types=Array(), $link_values=Array(), $also_attributes=FALSE)
 
 getChildren ($id, $level, $type_codes=Array(), $link_types=Array(), $link_values=Array(), $also_attributes=FALSE)
 
 trashAsset ($ids)
 
 setAttributeValue ($assetid, $attr_name, $attr_val)
 
 setAssetMetadata ($assetid, $fieldid, $new_value)
 
 getLinkId ($parent, $child, $link_type=SQ_LINK_TYPE_1, $link_value=NULL, $all_info=FALSE)
 
 hasLink ($parent, $child)
 
 createAsset ($id, $type_code, $asset_name, $link_type=1, $link_value, $sort_order, $is_dependant=0, $is_exclusive=0, $extra_attributes=FALSE, $attribute_values)
 
 checkParentType ($parent)
 
 checkRoot (&$asset)
 
 getRootNodes ()
 
 updateLookupsforAsset ($assetid)
 
 getKeywordsReplacements ($asset, $keywords)
 
 acquireLocks (Asset $asset, $screen, $dependants_only, $force_acquire)
 
 getLocksInfo ($assetid, $lock_types)
 
 setAssetStatus (Asset $asset, $status, $cascade, $current_status_desc, $to_be_status_desc, $workflow_stream)
 
 getMetadataSchema ($asset, $granted, $cascades)
 
 returnError ($error)
 
 returnJSON ($data, $type='')
 
 getRandomFilename ($file_name)
 
 object2Array ($obj)
 
 array_utf8_encode_recursive ($dat)
 
- Public Member Functions inherited from Page
 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printBody ()
 
- 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 ()
 

Protected Member Functions

 _createAdditional (Array &$link)
 
- Protected Member Functions inherited from Page
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _getName ($short_name=FALSE)
 
- 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)
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 29 of file js_api.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 147 of file js_api.inc.

Member Function Documentation

_createAdditional ( Array &  $link)
protected

Perform any additional processing required during the creation of this asset

Pages add a default web path when they are created

Parameters
array&$linkinformation used to create the initial link
Returns
boolean private

Definition at line 165 of file js_api.inc.

_getAllowedLinks ( )

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

Returns
array private
See Also
Asset::_getAllowLinks()

Definition at line 188 of file js_api.inc.

acquireLocks ( Asset  $asset,
  $screen,
  $dependants_only,
  $force_acquire 
)

Description: trys to acquire locks on the asset if the locks are already acquired then it will update them

Parameters
object$assetthe asset to acquire locks for
string$screenthe screen for which to acquire locks for
boolean$dependants_onlywhether dependants only or all children, defaults to true
boolean$force_acquirewhether to attempt to forceably acquire the lock or not, defaults to false
Returns
array public

Definition at line 3844 of file js_api.inc.

array_utf8_encode_recursive (   $dat)

Purpose : converts the passed multidimensional array to urf8_encoded

Parameters
array$datathe array whos content we want to utf8 encode
Returns
array public

Definition at line 4148 of file js_api.inc.

checkParentType (   $parent)

Description: Check out see if the parent passed matches the allowed types

Parameters
object$parentThe asset to check
Returns
TRUE public

Definition at line 3678 of file js_api.inc.

checkRoot ( $asset)

Description: Check out see if the passed asset is under the root restriction

Parameters
object&$assetThe asset to check
Returns
TRUE public

Definition at line 3696 of file js_api.inc.

createAsset (   $id,
  $type_code,
  $asset_name,
  $link_type = 1,
  $link_value,
  $sort_order,
  $is_dependant = 0,
  $is_exclusive = 0,
  $extra_attributes = FALSE,
  $attribute_values 
)

Description: This operation will create an asset of a specific type under a specific location

Parameters
integer$idParentid of the new parent
string$type_codeType code of new asset
string$asset_nameName for new asset
integer$link_typeType of link to create
string$link_valueValue of the link
integer$sort_orderOrder in the tree
integer$is_dependantDependant to parent
integer$is_exclusiveExclusive to parent
boolean$extra_attributesAny extra attributes to create
array$attribute_valuesarray of name => value of the extra attributes that needs to be set
Returns
array public

Definition at line 3593 of file js_api.inc.

createLink (   $parent,
  $child,
  $link_type,
  $link_value,
  $sort_order,
  $is_dependant,
  $is_exclusive 
)

Description: This will create a link between two assets

Parameters
integer$parentMajor asset id we are linking from
integer$childMinor asset id we are linking to
integer$link_typeType of link to create
string$link_valueValue of the link
integer$sort_orderOrder in the tree
integer$is_dependantDependant to parent
integer$is_exclusiveExclusive to parent
Returns
array public

Definition at line 2807 of file js_api.inc.

getChildren (   $id,
  $level,
  $type_codes = Array(),
  $link_types = Array(),
  $link_values = Array(),
  $also_attributes = FALSE 
)

Description: Gets child asset ids

Parameters
integer$idAsset id of the parent
integer$levelHow deep to go
array$type_codestype_code of assets to return
array$link_typestype of link we are looking to return
array$link_valueslink values we want on the assets returned
boolean$also_attributesif we are getting additional attributes and its values(FALSE by default)

NOTE : link_types, type_codes and link_values works only if the level of gettign the child assets is set to 1

Returns
void public

Definition at line 3226 of file js_api.inc.

getGeneralInfo ( Asset  $asset,
  $add_more_attributes = FALSE 
)

Gets general information for the passed in Asset

Parameters
object$assetThe asset we want to get information about
boolean$add_more_attributesif we are getting additional attributes and its values for the asset(FALSE by default)
Returns
array public

Definition at line 2677 of file js_api.inc.

getGroupChildren (   $key)

Description: Returns arrays of user assets from a parent user group

Parameters
integer$keyAsset id of the user group
Returns
void public

Definition at line 3106 of file js_api.inc.

getKeywordsReplacements (   $asset,
  $keywords 
)

Description: get the asset/global/simple_edit level keyword replacement for the passed in asset

Parameters
object$assetThe asset to fetch replacements for
array$keywordsarray of keywords to get replacement for
Returns
array public

Definition at line 3767 of file js_api.inc.

getLinkId (   $parent,
  $child,
  $link_type = SQ_LINK_TYPE_1,
  $link_value = NULL,
  $all_info = FALSE 
)

Description: Returns the link id between a parent and a child

Parameters
string$parentParent id
string$childChild id
string$link_typeType of link we are looking for (default to TYPE 1 links)
string$link_valueValue of the link we are looking for(Default to NULL)
boolean$all_infoIf to return just LinkId or all the information
Returns
array public

Definition at line 3513 of file js_api.inc.

getLocksInfo (   $assetid,
  $lock_types 
)

Returns an array of information about the current lock on this asset (if any)

Parameters
string$assetidthe assetid of the asset that we want lock info for
string$lock_typeany valid lock type for the passed asset's type, plus 'all' which will return all locks that this asset has -
Returns
array public
See Also
Asset_Manager::getLockInfo()

Definition at line 3904 of file js_api.inc.

getMetadataSchema (   $asset,
  $granted,
  $cascades 
)

Get the info of the Metadata Schema applied to the asset

Parameters
string$assetidThe asset to get the info of the schemas applied to
boolean$grantedtype of access : TRUE = applied, FALSE = denied
boolean$cascadesdoes this schema cascade to newly created assets?
Returns
array public

Definition at line 3980 of file js_api.inc.

getParents (   $id,
  $level,
  $type_codes = Array(),
  $link_types = Array(),
  $link_values = Array(),
  $also_attributes = FALSE 
)

Description: Gets parent asset ids

Parameters
integer$idAsset id of the child
integer$levelHow deep to go
array$type_codestype_code of assets to return
array$link_typestype of link we are looking to return
array$link_valueslink values we want on the assets returned
boolean$also_attributesif we are getting additional attributes and its values(FALSE by default)

NOTE : link_types and link_values works only if the level of gettign the child assets is set to 1

Returns
void public

Definition at line 3142 of file js_api.inc.

getPermission (   $id,
  $level 
)

Description: This operation will return the permission set for on an asset

Parameters
integer$idId of the asset to get permissions for
string$levelRead, Write, Admin
Returns
void public

Definition at line 3043 of file js_api.inc.

getRandomFilename (   $file_name)

getRandomFileName get a random filename for the file being uploaded

Parameters
string$file_nameThe original name of the file
Returns
string public

Definition at line 4101 of file js_api.inc.

getRootNodes ( )

Return a list of the root nodes

Returns
array public

Definition at line 3727 of file js_api.inc.

hasLink (   $parent,
  $child 
)

Description: Check to see if there is a link id between a parent and child

Parameters
string$parentParent id
string$childChild id
Returns
void public

Definition at line 3560 of file js_api.inc.

moveLink (   $old_parent_id,
  $asset_id_to_move,
  $old_link_type = SQ_LINK_TYPE_1,
  $old_link_value = '',
  $new_parent_id,
  $new_link_type = SQ_LINK_TYPE_1,
  $new_link_value = '',
  $new_position 
)

Description: This operation will move a link under a new parent asset

Parameters
integer$old_parent_idOld parent id
integer$asset_id_to_moveAsset id to move
constant$old_link_typeLink type between asset and existing parent
string$old_link_valueLink value between asset and existing parent
integer$new_parent_idNew parent id
integer$old_link_typeLink type to create on moving the asset
integer$old_link_valueLink value to create on moving the asset
integer$new_positionPosition under the new parent
Returns
void public

Definition at line 2931 of file js_api.inc.

object2Array (   $obj)

Purpose : converts our stdClass object to an array

Parameters
object$objthe stdClass object we need to convert
Returns
array public

Definition at line 4120 of file js_api.inc.

printFrontend ( )

Print the frontend of the asset without the design

Returns
void public

Definition at line 203 of file js_api.inc.

removeLink (   $parent,
  $child,
  $link_type = NULL,
  $link_value = NULL 
)

Description: This operation will delete a link based on the LinkID

Parameters
string$parentMajor asset id we are linking from
string$childMinor asset id we are linking to
string$link_typeLink type between parent and child asset
string$link_valueLink value of link between parent and child asset
Returns
array public

Definition at line 2844 of file js_api.inc.

returnError (   $error)

Returns an error in JSON format

Parameters
string$errorThe error to send back as JSON

public

Definition at line 4014 of file js_api.inc.

returnJSON (   $data,
  $type = '' 
)

Returns the JSON output

Parameters
array$dataThe array of information to return as JSON

public

Definition at line 4037 of file js_api.inc.

setAsset (   $id)

Description: This will create a link between two assets

Parameters
string$idThe asset that we are getting
Returns
object public

Definition at line 492 of file js_api.inc.

setAssetMetadata (   $assetid,
  $fieldid,
  $new_value 
)

Description: This operation will set the value for a metadata field(s) of an asset

Parameters
string$assetidThe asset to regenerate metadata for
array$fieldidArray of the metadata field ids
array$new_valueArray of the new value corresponding to metadata field
Returns
void public

Definition at line 3427 of file js_api.inc.

setAssetStatus ( Asset  $asset,
  $status,
  $cascade,
  $current_status_desc,
  $to_be_status_desc,
  $workflow_stream 
)

sets the asset status that is passed

Parameters
string$assetidthe assetid of the asset that we want lock info for
int$statusstatus we want to set to
boolean$cascadeif the status change should be cascaded to non dependant children assets, default to false
string$current_status_descdescription of the current status
string$to_be_status_descdescription of the status to be changed to
Returns
array public

Definition at line 3931 of file js_api.inc.

setAttributeValue (   $assetid,
  $attr_name,
  $attr_val 
)

Description: This operation will return set the attribute value of an asset based on assetid and attribute name

Parameters
string$assetidThe ID of the asset in query
array$attr_nameThe names of the attributes
array$attr_valThe new values of the attributes
Returns
array public

Definition at line 3376 of file js_api.inc.

trashAsset (   $ids)

Description: This operation will send an asset to the trash

Parameters
array$idsThe id of the assets we want to delete
Returns
array public

Definition at line 3300 of file js_api.inc.

updateLink (   $parent,
  $child,
  $existing_link_type = SQ_LINK_TYPE_1,
  $existing_link_value = '',
  $link_type = SQ_LINK_TYPE_1,
  $link_value = '',
  $sort_order,
  $locked = TRUE 
)

Description: This operation will update an existing link

Parameters
integer$parentMajor asset id we are linking from
integer$childMinor asset id we are linking to
integer$link_typeType of link to set
string$link_valueValue of the link
integer$sort_orderSort order in the asset tree
integer$lockedthe asset's link lock status
Returns
array public

Definition at line 2984 of file js_api.inc.

updateLookupsforAsset (   $assetid)

updates the lookup of the assetid passed and all its childrens, (runs freestyle HIPO)

Returns
assetid public

Definition at line 3747 of file js_api.inc.


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