Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Image Class Reference
Inheritance diagram for Image:
File Bridge Asset MySource_Object Data_Source_Graph Thumbnail

Public Member Functions

 Image ($assetid=0)
 
 cloneComponents (&$clone, $components, $override=FALSE)
 
 saveSystemVersion ()
 
 revertToSystemVersion ()
 
 getExistingFile ()
 
 printImageTag ($alt='', $title='', $return=FALSE)
 
 paintBackend (&$o)
 
 saveVariety ($variety, $recreate_image=TRUE, $save_attrs=TRUE, $file_versioning=TRUE, $check_write_access=TRUE)
 
 deleteVariety ($varietyid)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 getAsset ($assetid, $type_code='', $mute_errors=FALSE)
 
 getLinks ($assetid, $link_types, $type_code='', $strict_type_code=TRUE, $side_of_link='major', $sort_by=NULL)
 
 getChildren ($assetid, $type_code='', $strict_type_code=TRUE, $dependant=NULL, $sort_by=NULL)
 
 getParents ($assetid, $type_code='', $strict_type_code=TRUE)
 
 printBody ()
 
 getAvailableKeywords ()
 
 getImageWidthKeywordReplacement ()
 
 getImageHeightKeywordReplacement ()
 
 getImageTagKeywordReplacement ()
 
 getKeywordReplacement ($keyword)
 
 _varietyImageSize ($variety_name)
 
 _getEmbeddedKeywordReplacement ($keyword)
 
 getLineageFromURL ($assetid, $protocol, $url)
 
 getPermission ($assetid, $permission, $granted=NULL, $and_greater=TRUE, $expand_groups=FALSE, $all_info=FALSE)
 
 setPermission ($assetid, $userid, $permission, $granted)
 
 deletePermission ($assetid, $userid, $permission)
 
 getAssetInfo ($assetids, $type_code=Array(), $strict_type_code=TRUE, $field='')
 
 assetExists ($assetids)
 
 getLink ($assetid, $link_type=NULL, $type_code='', $strict_type_code=TRUE, $value=NULL, $side_of_link='major', $exclusive=NULL)
 
 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)
 
 getLinkByAsset ($assetid, $other_assetid, $link_types=NULL, $value=NULL, $side_of_link='major', $force_array=FALSE, $dependant=NULL, $exclusive=NULL)
 
 getAllChildLinks ($assetid, $link_type=0)
 
 updateLink ($linkid, $link_type=NULL, $value=NULL, $sort_order=NULL)
 
 deleteAssetLink ($linkid, $moving=FALSE)
 
 createAssetLink (&$major, &$minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE)
 
 getAssetMapAssetInfo ($assetid)
 
 validFile (Array $info)
 
- Public Member Functions inherited from File
 File ($assetid=0)
 
 create (Array &$link, $info=Array())
 
 createAdditional (Array &$link)
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 lockTypes ()
 
 saveSystemVersion ()
 
 revertToSystemVersion ()
 
 clearSystemVersion ()
 
 morph ($new_type_code)
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 _getAllowedLinks ()
 
 _updated ($update_parents=TRUE)
 
 permissionsUpdated ()
 
 usePublicPath ()
 
 updateLookups ($auto_add_remaps=TRUE)
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 saveAttributes ($dont_run_updated=FALSE)
 
 setAttrValue ($name, $value)
 
 validFile (Array $info)
 
 printFrontend ()
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE)
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getExistingFile ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 getAvailableKeywords ()
 
 getAssetFileSizeInBytesKeywordReplacement ()
 
 getAssetFileSizeReadableKeywordReplacement ()
 
 getAssetFileContentsKeywordReplacement ()
 
 delete ($release_lock=TRUE)
 
 scanFile ($path='')
 
 getFileTypeKeywordReplacement ()
 
 getAssetSummary ()
 
 getOriginalURL ($data_url, $site_url)
 
- 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

 $allowed_extensions = Array('gif', 'jpg', 'jpeg', 'png')
 
- Data Fields inherited from File
 $allowed_extensions = Array()
 
 $ignore_update = FALSE
 
- 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
 

Protected Member Functions

 _checkFileState ()
 
- Protected Member Functions inherited from File
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _checkFileState ()
 
 _removePublicFile ()
 
 _updatePublicFile ()
 
 insertDataLookup ()
 
 _renameFile ($data_path, $old_filename, $new_filename)
 
 _validFileSize (Array &$info, $pre_uploaded=FALSE)
 
 _validFileExtension (Array &$info, $pre_uploaded=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)
 

Detailed Description

Definition at line 34 of file image.inc.

Member Function Documentation

_checkFileState ( )
protected

Look's after the placing and removing of out files in the public directory

Returns
boolean private

Definition at line 524 of file image.inc.

_getEmbeddedKeywordReplacement (   $keyword)

Get replacement for an embedded keyword

Parameters
string$keywordKeyword to find a replacement for
Returns
string public

Definition at line 1123 of file image.inc.

_varietyImageSize (   $variety_name)

Get the image size of an image variety

Parameters
string$variety_nameAsset name of the variety
Returns
string private

Definition at line 1082 of file image.inc.

assetExists (   $assetids)

Determine if the passed assetid or assetids refer(s) to a valid asset in the system

Note that this will always return FALSE if you pass it a shadow asset

Parameters
mixed$assetidsthe ID of the asset we are going to the check for existence or an array of assetids we want to check
Returns
mixed boolean|array public

Definition at line 1291 of file image.inc.

cloneComponents ( $clone,
  $components,
  $override = FALSE 
)

Processes the file upload from the source file so that file versioning cloned properly

Parameters
object&$clonethe clone asset shell
array$componentsthe wanted components to clone eg.
                        Array(
                            'attributes',
                            'metadata_schemas',
                            'metadata',
                            'workflow',
                            'permissions',
                            'data',
                            'content_tags',
                            'roles',
                        );
                        or alternately
                        Array('all');
boolean$overridewhether or not to override the existing permission, metadata schemas, workflow schemas with the new ones.
Returns
boolean public
See Also
asset::cloneComponents()

Definition at line 83 of file image.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 1365 of file image.inc.

createAssetLink ( $major,
$minor,
  $link_type,
  $value = '',
  $sort_order = NULL,
  $dependant = '0',
  $exclusive = '0',
  $moving = FALSE 
)

Create a link between the two supplied assets

Parameters
object&$majorthe major asset that we are linking from
object&$minorthe minor asset that we are linking to
string$link_typethe type of link this is
string$valuethe value that is to be associated with this link
string$sort_orderthe position in the links list that this link should take, if NULL or less than zero places at end of list
string$dependant'0' / '1' - whether the minor asset is dependant on the major
string$exclusive'0' / '1' - whether the major asset is to be the minor's only parent
boolean$movingwhether or not this asset is being moved
Returns
int public

Definition at line 1468 of file image.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 1445 of file image.inc.

deletePermission (   $assetid,
  $userid,
  $permission 
)

Deletes a permission with the passed user or user_group

Parameters
int$assetidthe assetid for asset whose permissions to delete
int$useridthe id of the user or user_group to remove the permission from
string$permissionthe permission code you are deleting
Returns
boolean public

Definition at line 1210 of file image.inc.

deleteVariety (   $varietyid)

Deletes a variety from this image

Parameters
string$varietyidthe shadow assetid or just the shadow part of the variety to delete
Returns
boolean public

Definition at line 453 of file image.inc.

getAllChildLinks (   $assetid,
  $link_type = 0 
)

Get details of the links from the specified asset to all its children

Parameters
string$assetidthe assetid of the asset to find the child links for
int$link_typethe type of links to get
Returns
array public

Definition at line 1408 of file image.inc.

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

Returns a reference to the asset represented by the passed assetid (Asset or NULL on error)

Parameters
int$assetidthe 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
object public
See Also
Asset_Manager::&getAsset()

Implements Bridge.

Definition at line 603 of file image.inc.

getAssetInfo (   $assetids,
  $type_code = Array(),
  $strict_type_code = TRUE,
  $field = '' 
)

Returns an array of information about assets of the passed codes

If one value in $field then the return value is Array(assetid => '[field]'), otherwise Array(assetid => Array())

Parameters
array$assetidsan array of assets to limit
mixed$type_codean asset type code, or array of typecodes, to limit results to
boolean$strict_type_codeensure returned assets are of the passed type codes
string$fieldsingle field from the asset table to return (along with the assetid) Default is all fields
Returns
array public

Definition at line 1231 of file image.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 1483 of file image.inc.

getAvailableKeywords ( )

Return the keywords for this asset type. This function is called in asset-listing situations like the asset listing, search page etc

The return value is in the form:

Array(
  'name' => 'description' => 'the asset name',
);
Returns
array public

Definition at line 909 of file image.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 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 790 of file image.inc.

getExistingFile ( )

Get an array of some useful data about the existing uploaded file

Returns
array private

Definition at line 242 of file image.inc.

getImageHeightKeywordReplacement ( )

Get Image Height keyword replacement

Returns
string public

Definition at line 961 of file image.inc.

getImageTagKeywordReplacement ( )

Get Image Tag keyword replacement

Returns
string public

Definition at line 974 of file image.inc.

getImageWidthKeywordReplacement ( )

Get Image Width keyword replacement

Returns
string public

Definition at line 948 of file image.inc.

getKeywordReplacement (   $keyword)

Get bodycopy keyword replacement

Provides a mechanism for providing keyword replacement functions by looking up the function named 'getKeywordNameKeywordReplacement' so an asset wishing to add support for 'best_ever' custom keyword should implement a function getBestEverKeywordReplacement() which returns a replacement string

Parameters
string$keywordKeyword to find a replacement for
Returns
string public

Definition at line 995 of file image.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 1148 of file image.inc.

getLink (   $assetid,
  $link_type = NULL,
  $type_code = '',
  $strict_type_code = TRUE,
  $value = NULL,
  $side_of_link = 'major',
  $exclusive = NULL 
)

Get details of a link with the specified characteristics

Parameters
int$assetidid of the the $side_of_link asset
int$link_typeinteger that should be a single integer of 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 an asset that is just a $type_code or potentially an inherited type or $type_code and any of it's sub-classes
string$valuethe value that is associated with this link
string$side_of_linkWhich side of the link this (the current) asset is on ('major' or 'minor')
boolean$exclusiveThe exclusive status for the link must be this (if not NULL)
Returns
array public

Definition at line 1319 of file image.inc.

getLinkByAsset (   $assetid,
  $other_assetid,
  $link_types = NULL,
  $value = NULL,
  $side_of_link = 'major',
  $force_array = FALSE,
  $dependant = NULL,
  $exclusive = NULL 
)

Get details of the link(s) between the two specified assets

Parameters
int$assetidid of the the $side_of_link asset
int$other_assetidthe asset on the other side of the link
int$link_typesinteger that can be the product of bitwise operations on the SQ_LINK_* constants
string$valuethe value that is associated with this link
string$side_of_linkWhich side of the link the first assetid is on ('major' or 'minor')
boolean$force_arrayforce the results to return an array of links even if there is only one link
boolean$dependantThe dependant status for all the links must be this (if not NULL)
boolean$exclusiveThe exclusive status for all the links must be this (if not NULL)
Returns
array public

Definition at line 1392 of file image.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 1337 of file image.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$assetidthe shadow part asset id to be loaded (i.e part after the ':') 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 656 of file image.inc.

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

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

Can only find parents of type form_section or form

Parameters
int$assetidthe id of the asset to get its parents for
string | array$type_codethe type of asset that is linked (eg 'Form_Section', 'Form_Question', 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 845 of file image.inc.

getPermission (   $assetid,
  $permission,
  $granted = NULL,
  $and_greater = TRUE,
  $expand_groups = FALSE,
  $all_info = FALSE 
)

Returns an array of all user or user_group assets that have the passed permission for the passed asset

Parameters
int$assetidthe assetid for asset whose permissions to get
string$permissionthe permission code you are getting
boolean$grantedtype of Access : NULL = all, TRUE = granted, FALSE = denied
boolean$and_greaterget effective permission (eg read access = read or write or admin)
boolean$expand_groupsexpand user groups so only user ids get returned (NOTE: only valid if $all_info is FALSE)
boolean$all_infowhen FALSE fn just returns an array of userids for those that have permission When TRUE fn returns all info about the permission in the form of Array(userid => granted) (NOTE: TRUE is only valid if $and_greater and $expand_groups are FALSE)
Returns
array public

Definition at line 1175 of file image.inc.

Image (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 50 of file image.inc.

paintBackend ( $o)

Prints out the backend interface for the asset

Parameters
object&$oA reference to the backend outputter
Returns
boolean public

Definition at line 291 of file image.inc.

printBody ( )

Prints the body of the asset

Returns
void public

Definition at line 888 of file image.inc.

printImageTag (   $alt = '',
  $title = '',
  $return = FALSE 
)

Prints the tag for an image

The output includes the width and height of the image, and the image name for the alt tag

Parameters
string$altthe alt tag content. If empty the alt var is used
string$titlethe alt tag content. If empty the and $alt is set, then that is used, otherwise the title var is used
boolean$returnif TRUE the tag will be returned
Returns
mixed string|void public

Definition at line 269 of file image.inc.

revertToSystemVersion ( )

Replaces the editing version with the system (live) version

Returns
boolean public

Definition at line 181 of file image.inc.

saveSystemVersion ( )

Saves a copy of this asset at this point in time This copy gets used when the asset is live and the user does not have write access

Returns
boolean public

Definition at line 134 of file image.inc.

saveVariety (   $variety,
  $recreate_image = TRUE,
  $save_attrs = TRUE,
  $file_versioning = TRUE,
  $check_write_access = TRUE 
)

Creates/Updates a variety for this image

If the variety has an ID then it must belong to this asset in order to be saved. Returns FALSE on error, shadow assetid on success

Parameters
object$varietythe variety to save
boolean$recreate_imagehether to generate the image file or not
boolean$save_attrswhether to run saveAttributes() or not, usually you only would set this to FALSE if you are running this multiple times and only want to save once at the end
boolean$file_versioningthe argument which will be passed onto image_variety to tell it not to use file_versioning
boolean$check_write_accessit is FALSE when we dont want to check the write access of the user
Returns
mixed boolean|int public

Definition at line 338 of file image.inc.

setPermission (   $assetid,
  $userid,
  $permission,
  $granted 
)

Sets a permission for the passed user or user_group

Parameters
int$assetidthe assetid for asset whose permissions to set
int$useridthe id of the user or user_group to add the permission for
string$permissionthe permission code you are adding
boolean$grantedwhether this permission grants access or not
Returns
boolean public

Definition at line 1193 of file image.inc.

updateLink (   $linkid,
  $link_type = NULL,
  $value = NULL,
  $sort_order = NULL 
)

Update the details of an existing link

If any of the detail vars are NULL they are not updated.

Parameters
int$linkidthe link id of the link to update
int$link_typethe type of the link (one of the SQ_LINK_* constants)
string$valuethe value to place on the link
int$sort_orderthe position in the links list that this link should take, if less than zero places at end of list
Returns
boolean public

Definition at line 1429 of file image.inc.

updateLookups (   $auto_add_remaps = TRUE)

Called to force an update of this assets lookup information

Returns
boolean public
See Also
Asset::updateLookups(), Asset::saveWebPaths()

Definition at line 552 of file image.inc.

validFile ( Array  $info)

Checks a file on the file system to see if it can be used as a valid image file

Parameters
array$infoan array of information about the uploaded file
Returns
boolean public

Definition at line 1498 of file image.inc.


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