phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryCoreApi

Source Location: /modules/core/classes/GalleryCoreApi.class

Class GalleryCoreApi

Class Overview

This is the unified API for Gallery 2.

Located in /modules/core/classes/GalleryCoreApi.class [line 37]



		
		
		
		

Methods

[ Top ]
Method Summary
array   acquireReadLock()   Read Lock one or more objects
array   acquireReadLockParents()   Acquire read locks on all the ancestors of this id. This is useful when we're going to do a filesystem related operation and we want to make sure that the tree does not change out from underneath us.
array   acquireWriteLock()   Write lock one or more objects
array   activatePlugin()   Activate the given plugin
GalleryStatus   addDerivativePreference()   Add a derivative preference to a given item
GalleryStatus   addEntityPermission()   Add the given itemid, entityid, permission mapping.
GalleryStatus   addEventLogEntry()   Store a value in the event log.
GalleryStatus   addExistingItemToAlbum()   Add an existing data item to an album
GalleryStatus   addGroupPermission()   Add the given itemid, groupid, permission mapping
array   addItemToAlbum()   Add a new data item to an album from a data file.
GalleryStatus   addMapEntry()   Add a new entry to a map
GalleryStatus   addMimeType()   Add the given extension to the database and map it to the specified mime type and mark it viewable as requested. Return ERROR_COLLISION if there's already a mapping for the given extension.
void   addPermissionToSession()   Grant permissions identified by an entity id to the current user's session.
GalleryStatus   addUserPermission()   Add the given itemid, userid, permission mapping
GalleryStatus   addUserToGroup()   Add the specified user to the specified group.
GalleryStatus   adjustDependentDerivatives()   Use the given operation as a transform for each derivative that depends on the target
GalleryStatus   applyDerivativePreferences()   (Re)create derivatives for a data item according to preferences for given album
GalleryStatus   applyToolkitOperation()   Use the given operation as a transform for each derivative that depends on the target
GalleryStatus   assertHasItemPermission()   Assert that the current user has the specific permission for the target item
GalleryStatus   assertUserIsSiteAdministrator()   Assert that the active user is a site administrator
array   buildItemQuery()   Build query to select items in a given sort order
array   checkPathCollision()   Check for a collision of FileSystemEntiry paths.
GalleryStatus   compactAccessLists()   Compact the access map. Remove any duplicate access maps and remap any subscribers from the duplicates to the one remaining version.
array   convertExtensionToMime()   Convert a file extension to a mime type
string   convertFromUtf8()   Convert the string from the internal encoding (UTF-8) to target encoding.
array   convertMimeToExtensions()   Convert a mime type to a file extension
array   convertPermissionBitsToIds()   Return all the permission ids for a permission bit set
array   convertPermissionIdsToBits()   Return the permission bits for a set of permission ids
string   convertToUtf8()   Convert the string from the source encoding to UTF8
GalleryStatus   copyDerivativePreferences()   Copy the derivative preferences from one id to another.
GalleryStatus   copyPermissions()   Copy a set of permissions from one id to another
array   createAlbum()   Create a new album.
GalleryStatus   createFastDownloadFile()   Create a small PHP file containing all the information we need to send a data item or derivative to the browser.
GalleryStatus   createItemAttributes()   Create a new set of attributes for an item
array   deactivatePlugin()   Deactivate the given plugin
GalleryStatus   deleteEntityById()   Delete the entity with the given id
void   deleteFastDownloadFileById()   Delete the fast download file for a specific entity
GalleryStatus   deleteRenderer()   Remove the given renderer from all items that are using it.
GalleryStatus   deleteSortOrder()   Remove the given sort order from any thing in the framework that uses it (albums and the default sort order).
array   deleteUserItems()   Delete all non-album items of a user. Then delete all remaining albums that are empty.
array   describeEntity()   Describe the members, modules and parent of an entity
array   describeMap()   Describe all the members of a map
GalleryStatus   error()   Return an error status.
GalleryStatus   estimateDerivativeDimensions()   Estimate the dimensions of a GalleryDerivativeImage from its operations and its source.
GalleryStatus   expireDerivativeTreeBySourceIds()   Expire all derivatives that depend on the source ids specified
array   fetchAccessListId()   Look up an item's access list.
array   fetchAccessListIds()   Fetch all the access list ids that grant the given permission to the given user (either directly or via a group).
array   fetchAlbumTree()   Fetch album tree visible to current user, optionally starting from a given album and to a given depth.
array   fetchAllItemIds()   Return the ids of all items that match the given type and have the given permission.
array   fetchAllItemIdsByOwnerId()   Return the ids of all items which are owned by the given userid.
array   fetchAllPermissionsForItem()   Return a list of permissions for the given item id
array   fetchAllPluginParameters()   Get all the parameters for this plugin
array   fetchChildAlbumItemIds()   Same as fetchChildItemIds except we only want sub-albums
array   fetchChildCounts()   Return the number of children for the items specified, that are visible to the given user.
array   fetchChildDataItemIds()   Same as fetchChildItemIds except we only want data items
array   fetchChildIdByPathComponent()   Returns the id of the child filesystem entity that matches the given path component.
array   fetchChildItemIds()   Return the ids of the children of this entity, in the order specified by the orderBy field and the direction specified by the orderDirection field, that are visible to the given user.
array   fetchChildItemIdsIgnorePermissions()   Same as fetchChildItemIds, except that we ignore permissions
array   fetchChildItemIdsWithPermission()   Return the ids of all the child items of the given item that have the matching permission.
array   fetchDerivativePreferencesForItem()   Get the derivative preferences for the given item
array   fetchDerivativesByItemIds()   Convenience function to fetch all derivatives for a given item id
array   fetchDerivativesBySourceIds()   Load the derivative images that have the specified source id(s) with the type(s) specified
array   fetchDescendentAlbumItemIds()   Same as fetchDescendentItemIds except we only want sub-albums
array   fetchDescendentCounts()   Fetch the breakdown of descendents for a given item
array   fetchDescendentItemIds()   Return the ids of the descendents of this entity that are visible to the given user.
array   fetchEntitiesLinkedTo()   Fetch the ids of the entities linked to the target entity
int   fetchExtremeChildWeight()   Fetch the highest or lowest weight of all children
array   fetchGroupByGroupName()   Lookup a group by name
array   fetchGroupCount()   Return a count of groups, optionally matching a search string
array   fetchGroupNames()   Return a map of groupIds => groupNames.
array   fetchGroupsForUser()   Return a list of groups that a user belongs to.
array   fetchItemIdByPath()   Given a complete logical path, return the item id that it refers to.
array   fetchItemIdCount()   Return the number of of items that match the given type and have the given permission.
array   fetchItemizedDescendentCounts()   Fetch the breakdown of descendents for a given item. Note: this call is more expensive than GalleryCoreApi::fetchDescendentCounts(), so use that version where possible.
array   fetchItemOrderWeight()   Get the order weight for a given item id
array   fetchItemOrderWeights()   Get the order weight for many item ids
array   fetchItemViewCount()   Get the view counts for many item ids
array   fetchItemViewCounts()   Get the view counts for many item ids
array   fetchLanguageCodeForUser()   Fetch the preferred language of a specific user.
array   fetchLinkableChildItemIdsWithPermission()   Return the ids of all the child items of the given item that have the matching permission and are linkable entities. Useful for, example, for finding all the children where we (the active user) has the 'core.changePermissions' permission bit set. This allows us to cascade permission updates.
int   fetchNextItemWeight()   Fetch the weight of the next peer in line (higher or lower, as specified)
array   fetchOriginationTimestamp()   Fetch the originationTimestamp through our known toolkits
array   fetchParents()   Load all the ancestors of this item
array   fetchParentSequence()   Get the parent sequence for this item id
array   fetchPermissionsForItems()   Return a list of permissions for the given items
array   fetchPluginList()   Return a plugin list by plugin type of all installed plugins.
array   fetchPluginStatus()   Get the status of all plugins of a given type
array   fetchPreferredsByItemIds()   Convenience function to fetch the preferred for an item id
array   fetchPreferredSource()   Return the preferred source for this item by returning the first occurrence of the following:
array   fetchResizesByItemIds()   Convenience function to fetch the resizes for an item id
array   fetchThemeId()   Return the correct theme for this item. If the appropriate theme cannot be loaded, we fall back on the default. And if that can't be loaded, then we return null.
array   fetchThumbnailsByItemIds()   Convenience function to fetch the thumbnail for an item id
array   fetchUserByUserName()   Lookup a user by username
array   fetchUserCount()   Return the total number of users
array   fetchUsernames()   Return a map of userNames => userids
array   fetchUsersForGroup()   Return a list of user ids belonging to a group
array(boolean   fetchWebFile()   Fetch the web page at the given url. Follow redirects to get the data and upon completion return the http response, headers and the actual URL that we used to get the data.
array(boolean   fetchWebPage()   Fetch the web page at the given url. Follow redirects to get the data and upon completion return the body, http response, headers and the actual URL that we used to get the data.
array   getAllFactoryImplementationIds()   Return the ids and class names of all the available implementations for a class
array   getAllFactoryImplementationIdsWithHint()   Return the ids of all the available implementations for a class for a given hint.
array   getAllPluginIds()   Get the list of all available plugins of a given type
array   getAnonymousUserId()   Get id of the guest user.
array   getApiVersion()   Return the major and minor version of the Core API.
string   getCodeBasePath()   Get the local path to the Gallery code base path (not URL or web root). Optionally append a relative path.
array   getDefaultAlbumId()   Get id of the album to display by default.
array   getExternalAccessMemberList()   Get a list of entity members which are allowed to be shown / set by external systems (e.g.
array   getFactoryDefinitionHints()   Return the Hints for the specified class type and implId.
array   getLanguageDescription()   Returns the language description of the specified language-country code.
array   getLegalPathComponent()   Get a legal path component in the given parent id. Legal by the platform standards, and legal in that it doesn't cause a conflict with other path components.
object array   getLockIds()   Get the set of lock ids
array   getMapEntry()   Get entries in a map that match a criteria and return selected fields
array   getMaximumManagedToolkitPriority()   Get maximum priority value (lowest priority) in managed priority range (20-40)
array   getMimeType()   Determine the proper mime type given the file and optionally with the mime type from the request
array   getPermissionIds()   Get all the permission ids that match the specified flags.
array   getPermissions()   Return all the permissions that the given user has for the given item.
string   getPluginBaseDir()   Returns the base directory of the specified plugin.
void   getPluginBaseDirs()   Returns an array of directories that can contain plugins.
array   getPluginParameter()   Convenience method to retrieve a plugin parameter
array   getRedundantToolkitPriorities()   Get list of toolkits/priorities in managed priority range (20-40) for which another toolkit supports a same operation and mime type.
array   getSubPermissions()   Expand a single permission into all the possible permissions that it can possibly be.
array['language   getSupportedLanguages()   Return the list of languages that we support.
array   getToolkitByOperation()   Get a toolkit that can perform the given operation
array   getToolkitByProperty()   Get a toolkit that can retrieve the given property
array   getToolkitOperationMimeTypes()   Get all valid input mime types for a certain operation
array   getToolkitOperations()   Get all valid operations on a certain mime type
array   getToolkitPriorityById()   Get maximum priority value (lowest priority) in managed priority range (20-40)
array   getToolkitProperties()   Get all valid properties of a certain mime type
array   getToolkitsByProperty()   Get the toolkits that can retrieve the given property
GalleryStatus   guaranteeAlbumHasThumbnail()   Make sure that the album has a thumbnail. If it doesn't, then grab the first handy child and make it the album's thumbnail. We're not picky.
array   handleThemeSettingsRequest()   Handle theme settings form submission
array   hasItemPermission()   Return true if the current user has the specific permission for the target item
array   hasPermission()   Are any or the given user/group ids directly granted all given permissions for the target item? Ignores session-based permissions.
GalleryStatus   incrementItemViewCount()   Update the view count for this item id
GalleryStatus   installTranslationsForLocale()   Copy the translations for a given locale into our locale hierarchy.
GalleryStatus   installTranslationsForPlugin()   Copy the translations for a given plugin into our locale hierarchy.
GalleryStatus   invalidateDerivativeDimensionsBySourceIds()   Zero out the dimensions for all derivatives that depend on the given source id so that they will be recalculated before the next view.
array   isAnonymousUser()   Is the user a guest?
array   isDisabledUsername()   Return true if this username is not allowed to log in (generally due to automated abuse).
boolean   isPluginCompatibleWithApis()   Return true if the plugin is compatible with the current API versions. False otherwise.
boolean   isPluginInDefaultLocation()   Indicates whether the specified plugin is in the default plugin directory.
boolean   isReadLocked()   Return true if the given id is read locked or write locked by us.
GalleryStatus   isSupportedOperationSequence()   Verify that a given mime-type/operation-sequence combination is supported by our existing toolkits by walking the sequence and making sure that we have a toolkit that can handle each operation.
array   isUserInGroup()   Is the given user id in the given group?
array   isUserInSiteAdminGroup()   Is the active user in the admin group?
array   isViewableMimeType()   Return true if the given mime type is viewble in a web browser
boolean   isWriteLocked()   Return true if the given id is write locked by us.
array   loadAvailableBlocks()   Load the block configuration files from every module
array   loadEntitiesById()   Load the GalleryEntities with the ids specified
array   loadEntityByExternalId()   Map external id to G2 id and then load the entity
array   loadPlugin()   Load and initialize the given plugin
GalleryStatus   loadThemeSettingsForm()   Load template data for a theme settings form
array   makeSupportedViewableOperationSequence()   Make sure operation sequence is supported and produces a browser-viewable output mime type.
GalleryStatus   maybeCompactAccessLists()   Compact the access list map, if we deem that it's a good time to do so.
array   mergeDerivativeOperations()   Merge together two sets of operations into one in the most sensible way.
GalleryEvent   newEvent()   Create a new event with the given name.
GalleryStatus   newFactoryInstance()   Create a new instance of the given type
array   newFactoryInstanceByHint()   Create a new instance of the given type based on the hint(s) provided
array   newFactoryInstanceById()   Create a new instance of the given type based on the id provided
array   newItemByMimeType()   Return the appropriate GalleryItem instance for the mime type provided.
array   postEvent()   Deliver an event to anybody listening.
array(body,   postToWebPage()   Post form data to a remote url and return the http response, headers and body of the reply
GalleryStatus   rebalanceChildOrderWeights()   Rebalance the order weights associated with this item's children. When this method is complete, the child item ids should still have the same order as they have now, but their order weights should be spaced out to exactly the spacing value specified in the arguments.
array   rebuildDerivativeCache()   Rebuild the cache for the given derivative
array   rebuildDerivativeCacheIfNotCurrent()   Rebuild the cached derivative file if it is not current.
GalleryStatus   refreshLocks()   Refresh all the locks that we hold so that they aren't accidentally considered expired
void   registerEventListener()   Register an event listener.
void   registerFactoryImplementation()   Register a new implementation with the factory
GalleryStatus   registerFactoryImplementationForRequest()   Register a new implementation with the factory for this request only
GalleryStatus   registerPermission()   Register a new permission
GalleryStatus   registerToolkitOperation()   Register the operations that a toolkit is able to perform on a certain mime type.
GalleryStatus   registerToolkitProperty()   Register a parameter that a toolkit can extract from a certain mime type.
GalleryStatus   releaseAllLocks()   Let go of all of our locks.
GalleryStatus   releaseLocks()   Release the given lock(s)
GalleryStatus   remapOwnerId()   Transfer the ownership of all items by oldUser to newUser
GalleryStatus   remapSourceIds()   Find all derivatives attached to one source and switch them to another one
GalleryStatus   removeAllMapEntries()   Remove ALL entries from this map.. use with caution!
GalleryStatus   removeAllPluginParameters()   Remove all parameters for this plugin
GalleryStatus   removeAllUsersFromGroup()   Remove any users in the group
string   removeDerivativeOperation()   Remove the given operation from the operation set.
GalleryStatus   removeDerivativePreferenceForItemType()   Remove derivative preference for a given item/type combination
GalleryStatus   removeDerivativePreferencesForItem()   Remove all derivative preferences for a given item
GalleryStatus   removeEntityPermission()   Remove the given itemid, entityid, permission mapping
GalleryStatus   removeGroupPermission()   Remove the given itemid, groupid, permission mapping
GalleryStatus   removeItemAttributes()   Remove the attributes for the given item
GalleryStatus   removeItemPermissions()   Remove all permissions for the given itemid
GalleryStatus   removeMapEntry()   Remove entries from a map
GalleryStatus   removeMimeType()   Remove specified mime data from the list.
GalleryStatus   removeOnLoadHandlers()   Remove onLoadHandlers from all entities
GalleryStatus   removePlugin()   Remove the given plugin from the map
GalleryStatus   removePluginParameter()   Remove a parameter for this plugin
GalleryStatus   removePluginParameterByValue()   Remove all plugin entries for a given parameter and value pair
GalleryStatus   removePluginParametersForItemId()   Remove all plugin parameters for a given item id
GalleryStatus   removeTranslationsForPlugin()   Remove the translations for a given plugin from our locale hierarchy.
GalleryStatus   removeUserFromAllGroups()   Remove the user from all groups
GalleryStatus   removeUserFromGroup()   Remove the specified user to the specified group.
GalleryStatus   removeUserPermission()   Remove the given itemid, userid, permission mapping
array($responseStatus,   requestWebPage()   Make an HTTP request to a remote URL and return the HTTP response status, headers and body.
void   requireOnce()   Require a file, but only once. All specified paths must be relative to the gallery2 directory. Think of it as a virtual PHP include_path.
GalleryStatus   sendTemplatedEmail()   Send an email using a smarty template for the message body
GalleryStatus   setItemOrderWeight()   Set the order weight for an item id
GalleryStatus   setItemViewCount()   Update the view count for this item id
GalleryStatus   setMaintenanceMode()   Allows the application to programmatically set Gallery into or out of maintenance mode.
GalleryStatus   setParentSequence()   Set the parent id sequence for an item id
GalleryStatus   setPluginParameter()   Set a plugin parameter
GalleryStatus   setThumbnailFromItem()   Set the thumbnail for an album from an item, according to the thumbnail preferences for the album.
boolean   shouldDoCompileCheck()   Check whether modification checks should be done to see if the compiled templates are still up to date. The result is cached in memory.
GalleryStatus   studyPermissions()   Study the permissions for all items (for the given user).
GalleryStatus   unregisterFactoryImplementation()   Unregister a factory implementation by id
GalleryStatus   unregisterFactoryImplementationsByModuleId()   Unregister all factory implementations for a module
GalleryStatus   unregisterModulePermissions()   Unregister all permission associated with a given module.
GalleryStatus   unregisterToolkit()   Unregister a toolkit's operations and properties. If we have any remaining that are no longer implemented by any toolkit then remove them from the system also.
GalleryStatus   unregisterToolkitOperation()   Unregister an operation that a toolkit is able to perform on certain mime types
GalleryStatus   unregisterToolkitsByModuleId()   Unregister all operations and properties for toolkits implemented by the given module.
GalleryStatus   updateFactoryDefinitionHints()   Return the Hints for the specified class type and implId.
GalleryStatus   updateMapEntry()   Update entries in a map
GalleryStatus   updateModificationTimestamp()   Set modification timestamp for the given entity id to the current time.
GalleryStatus   updateParentSequence()   Update all items containing the source parent sequence to the new parent sequence
string   utf8Strcut()   mb_strcut for UTF-8, with PHP fallback. Truncates incomplete HTML entity at end of result.
string   utf8Substring()   mb_substr for UTF-8, with PHP fallback. Truncates incomplete HTML entity at end of result.

[ Top ]
Methods
acquireReadLock  [line 2257]

  array acquireReadLock( mixed $ids, [int $timeout = 10]  )

Read Lock one or more objects

Parameters:
mixed   $ids:  array of ids to lock, or single int id
int   $timeout:  (optional) how long to wait for the lock before giving up

API Tags:
Return:  GalleryStatus a status code int the lock id


[ Top ]
acquireReadLockParents  [line 2272]

  array acquireReadLockParents( int $id, [int $timeout = 10]  )

Acquire read locks on all the ancestors of this id. This is useful when we're going to do a filesystem related operation and we want to make sure that the tree does not change out from underneath us.

Parameters:
int   $id: 
int   $timeout:  (optional) how long to wait for the lock before giving up

API Tags:
Return:  GalleryStatus a status code int the lock id


[ Top ]
acquireWriteLock  [line 2296]

  array acquireWriteLock( mixed $ids, [int $timeout = 10]  )

Write lock one or more objects

Parameters:
mixed   $ids:  array of ids to lock, or single int id
int   $timeout:  (optional) how long to wait for the lock before giving up

API Tags:
Return:  GalleryStatus a status code int the lock id


[ Top ]
activatePlugin  [line 400]

  array activatePlugin( string $pluginType, string $pluginId  )

Activate the given plugin

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code array redirect info for error page (empty for success)


[ Top ]
addDerivativePreference  [line 1240]

  GalleryStatus addDerivativePreference( int $order, int $itemId, int $derivativeType, string $derivativeOperations  )

Add a derivative preference to a given item

Parameters:
int   $order:  the position of this preference
int   $itemId: 
int   $derivativeType:  (eg. DERIVATIVE_TYPE_IMAGE_THUMBNAIL)
string   $derivativeOperations:  (eg. 'thumbnail|200')

API Tags:
Return:  a status code


[ Top ]
addEntityPermission  [line 810]

  GalleryStatus addEntityPermission( int $itemId, int $entityId, string $permission, [boolean $applyToChildren = false]  )

Add the given itemid, entityid, permission mapping.

(Session based permissions; permission is granted when this entityId is added to GALLERY_PERMISSION_SESSION_KEY array in the session)

Parameters:
int   $itemId:  the id of the GalleryItem
int   $entityId:  the id of the GalleryEntity
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
addEventLogEntry  [line 3316]

  GalleryStatus addEventLogEntry( string $type, string $summary, $details, string $detail  )

Store a value in the event log.

Parameters:
string   $type:  a short string with the type of event (e.g.: 'Gallery Error', 'PHP Error', 'comment module')
string   $summary:  a brief summary of the event
string   $detail:  the event details
   $details: 

API Tags:
Return:  a status code


[ Top ]
addExistingItemToAlbum  [line 1686]

  GalleryStatus addExistingItemToAlbum( GalleryItem $item, int $albumId, [boolean $isNew = false]  )

Add an existing data item to an album

Parameters:
GalleryItem   $item:  the source item
int   $albumId:  the id of the target album
boolean   $isNew:  (optional) if true, skip check for existing derivatives

API Tags:
Return:  a status code


[ Top ]
addGroupPermission  [line 792]

  GalleryStatus addGroupPermission( int $itemId, int $groupId, string $permission, [boolean $applyToChildren = false]  )

Add the given itemid, groupid, permission mapping

Parameters:
int   $itemId:  the id of the GalleryItem
int   $groupId:  the id of the GalleryGroup
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
addItemToAlbum  [line 1671]

  array addItemToAlbum( string $fileName, string $itemName, string $title, string $summary, string $description, string $mimeType, int $albumId, [boolean $symlink = false]  )

Add a new data item to an album from a data file.

Parameters:
string   $fileName:  the path to the file on the local disk
string   $itemName:  the name of the new item
string   $title:  the title of the new item
string   $summary:  the summary of the new item
string   $description:  the description of the new item
string   $mimeType:  the mime type of the new item
int   $albumId:  the id of the target album
boolean   $symlink:  (optional) a boolean true if we should symlink instead of copy (default is false).

API Tags:
Return:  GalleryStatus a status code GalleryDataItem a new item


[ Top ]
addMapEntry  [line 2958]

  GalleryStatus addMapEntry( string $mapName, array $data, [boolean $useNonTransactionalConnection = false]  )

Add a new entry to a map

Parameters:
string   $mapName:  the map we're working on
array   $data:  an associative array of the entry data
boolean   $useNonTransactionalConnection:  (optional) set to true if we should use a new non transactional database connection for this operation. Default is false.

API Tags:
Return:  a status code


[ Top ]
addMimeType  [line 2648]

  GalleryStatus addMimeType( string $extension, string $mimeType, bool $viewable  )

Add the given extension to the database and map it to the specified mime type and mark it viewable as requested. Return ERROR_COLLISION if there's already a mapping for the given extension.

Parameters:
string   $extension: 
string   $mimeType: 
bool   $viewable:  whether or not it's browser viewable

API Tags:
Return:  a status code


[ Top ]
addPermissionToSession  [line 777]

  void addPermissionToSession( int $entityId  )

Grant permissions identified by an entity id to the current user's session.

Parameters:
int   $entityId:  The permission identifier (e.g. a user, group, or entity id) which grants one or more permissions to one or more items


[ Top ]
addUserPermission  [line 764]

  GalleryStatus addUserPermission( int $itemId, int $userId, string $permission, [boolean $applyToChildren = false]  )

Add the given itemid, userid, permission mapping

Parameters:
int   $itemId:  the id of the GalleryItem
int   $userId:  the id of the GalleryUser
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
addUserToGroup  [line 1807]

  GalleryStatus addUserToGroup( int $userId, int $groupId  )

Add the specified user to the specified group.

Parameters:
int   $userId: 
int   $groupId: 

API Tags:
Return:  a status code


[ Top ]
adjustDependentDerivatives  [line 1165]

  GalleryStatus adjustDependentDerivatives( array $id, string $operation, [boolean $reverse = false]  )

Use the given operation as a transform for each derivative that depends on the target

derivative. This gives the dependent derivatives a chance to perform any necessary transformations required to adapt to an upstream derivative operation change. For example, if you have a preferred which has a dependent thumbnail which has a crop operation in it, then you "rotate|90" the preferred you'd call adjustDependentDerivatives on the thumbnail with the "rotate|90" operation so that we can rotate the crop coordinates appropriately.

Parameters:
array   $id:  id the target derivative
string   $operation:  the operation that was performed on the target derivative
boolean   $reverse:  (optional) true if we should apply the transform in reverse

API Tags:
Return:  a status code


[ Top ]
applyDerivativePreferences  [line 1699]

  GalleryStatus applyDerivativePreferences( GalleryItem $item, int $albumId, [boolean $isNew = false]  )

(Re)create derivatives for a data item according to preferences for given album

Parameters:
GalleryItem   $item:  the source item
int   $albumId:  the id of the target album
boolean   $isNew:  (optional) if true, skip check for existing derivatives

API Tags:
Return:  a status code


[ Top ]
applyToolkitOperation  [line 1183]

  GalleryStatus applyToolkitOperation( string $operation, GalleryItem $args, boolean $preserveOriginal, mixed &$item, [ $preferred = null], [int $serialNumber = null]  )

Use the given operation as a transform for each derivative that depends on the target

Parameters:
string   $operation:  the operation to be executed
GalleryItem   $args:  item to perform the operation on
boolean   $preserveOriginal:  whether to preserve original
int   $serialNumber:  (optional) avoid concurrent edits
   $preferred: 

API Tags:
Return:  a status code


[ Top ]
assertHasItemPermission  [line 555]

  GalleryStatus assertHasItemPermission( int $itemId, string $permission  )

Assert that the current user has the specific permission for the target item

Parameters:
int   $itemId: 
string   $permission: 

API Tags:
Return:  success if the user has permission, ERROR_PERMISSION_DENIED if not.


[ Top ]
assertUserIsSiteAdministrator  [line 622]

  GalleryStatus assertUserIsSiteAdministrator( )

Assert that the active user is a site administrator


API Tags:
Return:  success if the user is an administrator ERROR_PERMISSION_DENIED if not.


[ Top ]
buildItemQuery  [line 2561]

  array buildItemQuery( string $baseTable, string $baseIdColumn, string $baseQuery, string $orderBy, string $orderDirection, string $class, string|array $requiredPermission, boolean $linkableOnly, int $userId  )

Build query to select items in a given sort order

Parameters:
string   $baseTable:  base table to query
string   $baseIdColumn:  name of id column in this table
string   $baseQuery:  where clause for query
string   $orderBy:  order for results
string   $orderDirection:  order direction for results
string   $class:  a class to restrict children to (eg. 'GalleryAlbumItem'; can be null)
string|array   $requiredPermission:  a single required permission (can be null) or an array of required permission-ids
boolean   $linkableOnly:  whether to restrict to linkable items only
int   $userId:  the user we're doing this for

API Tags:
Return:  GalleryStatus a status code string query array data items for query (not including any ? marks in baseQuery)


[ Top ]
checkPathCollision  [line 1920]

  array checkPathCollision( string $pathComponent, int $parentId, [int $selfId = null]  )

Check for a collision of FileSystemEntiry paths.

Parameters:
string   $pathComponent: 
int   $parentId:  the id of the target parent
int   $selfId:  (optional) ignore path collision with this id

API Tags:
Return:  GalleryStatus a status code boolean true if there's a collision


[ Top ]
compactAccessLists  [line 528]

  GalleryStatus compactAccessLists( )

Compact the access map. Remove any duplicate access maps and remap any subscribers from the duplicates to the one remaining version.


API Tags:
Return:  a status code


[ Top ]
convertExtensionToMime  [line 2577]

  array convertExtensionToMime( string $extension  )

Convert a file extension to a mime type

Parameters:
string   $extension:  a file extension

API Tags:
Return:  GalleryStatus a status code string a mime type (application/unknown if no known mapping)


[ Top ]
convertFromUtf8  [line 2731]

  string convertFromUtf8( string $inputString, [string $targetEncoding = null]  )

Convert the string from the internal encoding (UTF-8) to target encoding.

Parameters:
string   $inputString: 
string   $targetEncoding:  target encoding (eg. 'ISO-8859-1'), defaults to system charset

API Tags:
Return:  the result


[ Top ]
convertMimeToExtensions  [line 2590]

  array convertMimeToExtensions( string $mimeType  )

Convert a mime type to a file extension

Parameters:
string   $mimeType: 

API Tags:
Return:  GalleryStatus a status code array of file extensions (empty array if no known mapping)


[ Top ]
convertPermissionBitsToIds  [line 699]

  array convertPermissionBitsToIds( int $permissionBits, [boolean $compress = false]  )

Return all the permission ids for a permission bit set

Parameters:
int   $permissionBits:  the bit mask
boolean   $compress:  should we compress the permission list?

API Tags:
Return:  GalleryStatus a status code array (bits, bits, bits)


[ Top ]
convertPermissionIdsToBits  [line 685]

  array convertPermissionIdsToBits( mixed $permissionIds  )

Return the permission bits for a set of permission ids

Parameters:
mixed   $permissionIds:  array of string permission ids or single permission id

API Tags:
Return:  GalleryStatus a status code integer bits


[ Top ]
convertToUtf8  [line 2718]

  string convertToUtf8( string $inputString, [string $sourceEncoding = null]  )

Convert the string from the source encoding to UTF8

Parameters:
string   $inputString: 
string   $sourceEncoding:  source encoding (eg. 'ISO-8859-1'), defaults to system charset

API Tags:
Return:  the result


[ Top ]
copyDerivativePreferences  [line 1212]

  GalleryStatus copyDerivativePreferences( int $sourceId, int $targetId  )

Copy the derivative preferences from one id to another.

Note that this doesn't modify pre-existing preferences already assigned to the target.

Parameters:
int   $sourceId:  the source id
int   $targetId:  the target id

API Tags:
Return:  a status code


[ Top ]
copyPermissions  [line 899]

  GalleryStatus copyPermissions( int $itemId, int $fromId  )

Copy a set of permissions from one id to another

Parameters:
int   $itemId:  the id of the target item
int   $fromId:  the id of the source item

API Tags:
Return:  a status code


[ Top ]
createAlbum  [line 1649]

  array createAlbum( int $parentAlbumId, string $name, string $title, string $summary, string $description, string $keywords  )

Create a new album.

Parameters:
int   $parentAlbumId:  the id of the parent album
string   $name:  the name of the new album
string   $title:  the title of the new album
string   $summary:  the summary of the new album
string   $description:  the description of the new album
string   $keywords:  the keywords of the new album

API Tags:
Return:  GalleryStatus a status code GalleryAlbumItem a new album


[ Top ]
createFastDownloadFile  [line 3048]

  GalleryStatus createFastDownloadFile( object $entity, [bool $runEvenInUnitTest = false]  )

Create a small PHP file containing all the information we need to send a data item or derivative to the browser.

Note that fast-downloads are only created for items with public permissions

Parameters:
object   $entity:  GalleryDataItem or GalleryDerivative object
bool   $runEvenInUnitTest:  (optional) force this to run, even in the unit test framework

API Tags:
Return:  a status code


[ Top ]
createItemAttributes  [line 1319]

  GalleryStatus createItemAttributes( int $itemId, array $parentSequence  )

Create a new set of attributes for an item

Parameters:
int   $itemId: 
array   $parentSequence:  the sequence of parent ids

API Tags:
Return:  a status code


[ Top ]
deactivatePlugin  [line 414]

  array deactivatePlugin( string $pluginType, string $pluginId  )

Deactivate the given plugin

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  GalleryStatus a status code array redirect info for error page (empty for success)


[ Top ]
deleteEntityById  [line 2381]

  GalleryStatus deleteEntityById( int $id, [mixed $requiredEntityType = null]  )

Delete the entity with the given id

Parameters:
int   $id:  the id of a GalleryEntity to delete
mixed   $requiredEntityType:  (optional) Throw an ERROR_MISSING_OBJECT if the loaded entity doesn't extend the given entity-type (or types). Specify 'GalleryEntity' if any entity type is allowed.

API Tags:
Return:  a status code
Deprecated:  $requiredEntityType will no longer be optional after the next major API change


[ Top ]
deleteFastDownloadFileById  [line 3033]

  void deleteFastDownloadFileById( int $entityId  )

Delete the fast download file for a specific entity

Parameters:
int   $entityId: 


[ Top ]
deleteRenderer  [line 3131]

  GalleryStatus deleteRenderer( string $rendererClassName  )

Remove the given renderer from all items that are using it.

Parameters:
string   $rendererClassName: 

API Tags:
Return:  a status code


[ Top ]
deleteSortOrder  [line 3119]

  GalleryStatus deleteSortOrder( string $sortOrder  )

Remove the given sort order from any thing in the framework that uses it (albums and the default sort order).

Parameters:
string   $sortOrder: 

API Tags:
Return:  a status code


[ Top ]
deleteUserItems  [line 634]

  array deleteUserItems( int $userId  )

Delete all non-album items of a user. Then delete all remaining albums that are empty.

This function can only be called with activeUser = Site Admin

Parameters:
int   $userId: 

API Tags:
Return:  GalleryStatus a status code


[ Top ]
describeEntity  [line 3017]

  array describeEntity( string $entityName, [boolean $tryAllModules = false]  )

Describe the members, modules and parent of an entity

Parameters:
string   $entityName:  a class name
boolean   $tryAllModules:  true if we should scan all modules, not just the active ones

API Tags:
Return:  GalleryStatus a status code entity associative array


[ Top ]
describeMap  [line 2997]

  array describeMap( string $mapName, [boolean $tryAllModules = false]  )

Describe all the members of a map

Parameters:
string   $mapName: 
boolean   $tryAllModules:  true if we should scan all modules, not just the active ones

API Tags:
Return:  GalleryStatus a status code, array member name => member type


[ Top ]
error  [line 2867]

  GalleryStatus error( int $errorCode, [string $fileName = 'ignored'], [string $lineNumber = 'ignored'], [string $errorMessage = null]  )

Return an error status.

Starting in GalleryCoreApi 7.4 we ignore the filename and line number. You still need to provide them if you want to provide an error message. Next major API bump we'll remove the fileName and lineNumber arguments.

Parameters:
int   $errorCode: 
string   $fileName:  deprecated
string   $lineNumber:  deprecated
string   $errorMessage: 

API Tags:
Return:  an error status


[ Top ]
estimateDerivativeDimensions  [line 1283]

  GalleryStatus estimateDerivativeDimensions( &$derivative, $source, GalleryDerivativeImage $derivative, GalleryDerivativeEntity $source   )

Estimate the dimensions of a GalleryDerivativeImage from its operations and its source.

Parameters:
GalleryDerivativeImage   $derivative: 
GalleryDerivativeEntity   $source :  (probably a GalleryPhotoItem or GalleryMovieItem)
   &$derivative: 
   $source: 

API Tags:
Return:  a status code

Information Tags:
Todo:  This method knows too much about a small set of operations. We should move it into the toolkits themselves.

[ Top ]
expireDerivativeTreeBySourceIds  [line 1013]

  GalleryStatus expireDerivativeTreeBySourceIds( array $ids  )

Expire all derivatives that depend on the source ids specified

Parameters:
array   $ids:  source ids

API Tags:
Return:  a status code


[ Top ]
fetchAccessListId  [line 541]

  array fetchAccessListId( int $itemId  )

Look up an item's access list.

Parameters:
int   $itemId:  the id of the source item

API Tags:
Return:  GalleryStatus a status code, int accessListId the associated item's list


[ Top ]
fetchAccessListIds  [line 504]

  array fetchAccessListIds( string|array $permission, int $userId, [boolean $sessionPermissions = true]  )

Fetch all the access list ids that grant the given permission to the given user (either directly or via a group).

Parameters:
string|array   $permission:  a single permission id (eg. 'core.view') or an array of permission ids
int   $userId: 
boolean   $sessionPermissions:  (optional) false to ignore session based permissions

API Tags:
Return:  GalleryStatus a status code array int access list ids


[ Top ]
fetchAlbumTree  [line 1754]

  array fetchAlbumTree( [int $itemId = null], [int $depth = null], [int $userId = null]  )

Fetch album tree visible to current user, optionally starting from a given album and to a given depth.

Parameters:
int   $itemId:  (optional) id of album for root of tree
int   $depth:  (optional) max depth of tree
int   $userId:  (optional) items visible to this user id, instead of current user

API Tags:
Return:  GalleryStatus a status code array (albumId => array(albumId => array, ..), ..)


[ Top ]
fetchAllItemIds  [line 1605]

  array fetchAllItemIds( string $itemType, [array|string $permission = 'core.view']  )

Return the ids of all items that match the given type and have the given permission.

Parameters:
string   $itemType:  an item type (eg. GalleryAlbumItem)
array|string   $permission:  (default is core.view). Either a single permission-id or an array of permission-ids.

API Tags:
Return:  GalleryStatus a status code array(id, id, id, ...)


[ Top ]
fetchAllItemIdsByOwnerId  [line 1618]

  array fetchAllItemIdsByOwnerId( int $ownerId  )

Return the ids of all items which are owned by the given userid.

This function does NOT obey permissions!

Parameters:
int   $ownerId:  the id of the owner of the items

API Tags:
Return:  GalleryStatus a status code array(id, id, id, ...)


[ Top ]
fetchAllPermissionsForItem  [line 886]

  array fetchAllPermissionsForItem( int $itemId, [boolean $compress = false]  )

Return a list of permissions for the given item id

Parameters:
int   $itemId: 
boolean   $compress:  should we compress the permission list?

API Tags:
Return:  GalleryStatus a status code array array('userId' or 'groupId' or 'entityId' => ..., 'permission' => ...)


[ Top ]
fetchAllPluginParameters  [line 321]

  array fetchAllPluginParameters( string $pluginType, string $pluginId, [int $itemId = 0]  )

Get all the parameters for this plugin

Parameters:
string   $pluginType: 
string   $pluginId: 
int   $itemId:  the id of item (or null for global settings)

API Tags:
Return:  GalleryStatus a status code array (parameterName => parameterValue)


[ Top ]
fetchChildAlbumItemIds  [line 2488]

  array fetchChildAlbumItemIds( GalleryItem $item, [int $offset = null], [int $count = null], [int $userId = null]  )

Same as fetchChildItemIds except we only want sub-albums

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return
int   $userId:  optional user id. Defaults to current user id

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchChildCounts  [line 1511]

  array fetchChildCounts( array $itemIds, [int $userId = null]  )

Return the number of children for the items specified, that are visible to the given user.

Parameters:
array   $itemIds: 
int   $userId:  an optional user id (default is the current user)

API Tags:
Return:  GalleryStatus a status code array (itemId => count, itemId => count, ...)


[ Top ]
fetchChildDataItemIds  [line 2505]

  array fetchChildDataItemIds( GalleryItem $item, [int $offset = null], [int $count = null], [int $userId = null]  )

Same as fetchChildItemIds except we only want data items

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return
int   $userId:  optional user id. Defaults to current user id

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchChildIdByPathComponent  [line 1955]

  array fetchChildIdByPathComponent( int $parentId, string $pathComponent  )

Returns the id of the child filesystem entity that matches the given path component.

Note: this call ignores permissions so it must be used very carefully!

Parameters:
int   $parentId: 
string   $pathComponent:  of the target item

API Tags:
Return:  GalleryStatus a status code int an id


[ Top ]
fetchChildItemIds  [line 2454]

  array fetchChildItemIds( GalleryItem $item, [int $offset = null], [int $count = null], [int $userId = null]  )

Return the ids of the children of this entity, in the order specified by the orderBy field and the direction specified by the orderDirection field, that are visible to the given user.

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return
int   $userId:  optional user id. Defaults to current user id

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchChildItemIdsIgnorePermissions  [line 2521]

  array fetchChildItemIdsIgnorePermissions( GalleryItem $item, [int $offset = null], [int $count = null]  )

Same as fetchChildItemIds, except that we ignore permissions

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchChildItemIdsWithPermission  [line 1570]

  array fetchChildItemIdsWithPermission( int $itemId, array|string $permissionId  )

Return the ids of all the child items of the given item that have the matching permission.

Useful for, example, for finding all the children where we (the active user) has the 'core.changePermissions' permission bit set. This allows us to cascade permission updates.

Parameters:
int   $itemId: 
array|string   $permissionId:  Either a single permission-id or an array of permission-ids

API Tags:
Return:  GalleryStatus a status code array a list of ids


[ Top ]
fetchDerivativePreferencesForItem  [line 1225]

  array fetchDerivativePreferencesForItem( int $targetId  )

Get the derivative preferences for the given item

Parameters:
int   $targetId:  the target id

API Tags:
Return:  GalleryStatus a status code array (derivativeType => ..., derivativeOperations => ...)


[ Top ]
fetchDerivativesByItemIds  [line 1146]

  array fetchDerivativesByItemIds( array $ids  )

Convenience function to fetch all derivatives for a given item id

Parameters:
array   $ids:  GalleryItem ids

API Tags:
Return:  GalleryStatus a status code array(GalleryItem id => GalleryDerivativeImage, ...)


[ Top ]
fetchDerivativesBySourceIds  [line 1133]

  array fetchDerivativesBySourceIds( array $ids, [array $types = array()]  )

Load the derivative images that have the specified source id(s) with the type(s) specified

Parameters:
array   $ids:  Derivative source (GalleryFileSystemEntity or GalleryDerivative) ids
array   $types:  derivative types (eg. DERIVATIVE_TYPE_IMAGE_THUMBNAIL)

API Tags:
Return:  GalleryStatus a status code array(GalleryItem id => GalleryDerivativeImage, ...)


[ Top ]
fetchDescendentAlbumItemIds  [line 2470]

  array fetchDescendentAlbumItemIds( GalleryItem $item, [int $offset = null], [int $count = null], [string $permission = 'core.view']  )

Same as fetchDescendentItemIds except we only want sub-albums

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return
string   $permission:  (optional) what permission is required for the item

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchDescendentCounts  [line 1524]

  array fetchDescendentCounts( array $itemIds, [int $userId = null]  )

Fetch the breakdown of descendents for a given item

Parameters:
array   $itemIds: 
int   $userId:  an optional user id (default is the current user)

API Tags:
Return:  GalleryStatus a status code array(id => ##, id => ##)


[ Top ]
fetchDescendentItemIds  [line 2436]

  array fetchDescendentItemIds( GalleryItem $item, [int $offset = null], [int $count = null], [string $permission = 'core.view']  )

Return the ids of the descendents of this entity that are visible to the given user.

Parameters:
GalleryItem   $item: 
int   $offset:  where to start
int   $count:  how many to return
string   $permission:  (optional) what permission is required for the item

API Tags:
Return:  GalleryStatus a status code array integer ids


[ Top ]
fetchEntitiesLinkedTo  [line 2394]

  array fetchEntitiesLinkedTo( int $targetId  )

Fetch the ids of the entities linked to the target entity

Parameters:
int   $targetId:  the target entity id

API Tags:
Return:  GalleryStatus a status code array entity ids


[ Top ]
fetchExtremeChildWeight  [line 1431]

  int fetchExtremeChildWeight( int $itemId, int $direction  )

Fetch the highest or lowest weight of all children

Parameters:
int   $itemId:  the parent item id
int   $direction:  the direction (HIGHER_WEIGHT, LOWER_WEIGHT)

API Tags:
Return:  a weight


[ Top ]
fetchGroupByGroupName  [line 673]

  array fetchGroupByGroupName( [string $groupName = null]  )

Lookup a group by name

Parameters:
string   $groupName: 

API Tags:
Return:  GalleryStatus a status code GalleryGroup a group


[ Top ]
fetchGroupCount  [line 661]

  array fetchGroupCount( [string $substring = null]  )

Return a count of groups, optionally matching a search string

Parameters:
string   $substring:  the substring to match

API Tags:
Return:  GalleryStatus a status code int group count


[ Top ]
fetchGroupNames  [line 649]

  array fetchGroupNames( [int $count = null], [int $offset = null], [string $substring = null]  )

Return a map of groupIds => groupNames.

You can specify how many groups to list, and where the windows is in the list of all groups.

Parameters:
int   $count:  (optional) the number of groupnames desired
int   $offset:  (optional) the start of the range
string   $substring:  (optional) a substring to match

API Tags:
Return:  GalleryStatus a status code array (groupname, groupname, ...)


[ Top ]
fetchGroupsForUser  [line 1880]

  array fetchGroupsForUser( int $userId, [int $count = null], [int $offset = null]  )

Return a list of groups that a user belongs to.

You can specify how many userids to list, and where the windows is in the list of all users.

Parameters:
int   $userId: 
int   $count:  the number of group ids desired
int   $offset:  the start of the range

API Tags:
Return:  GalleryStatus a status code array group id => group name


[ Top ]
fetchItemIdByPath  [line 1905]

  array fetchItemIdByPath( string $path  )

Given a complete logical path, return the item id that it refers to.

Parameters:
string   $path: 

API Tags:
Return:  GalleryStatus a status code int the item id


[ Top ]
fetchItemIdCount  [line 1555]

  array fetchItemIdCount( string $itemType, [string $permission = 'core.view'], [int $userId = null]  )

Return the number of of items that match the given type and have the given permission.

Parameters:
string   $itemType:  an item type (eg. GalleryAlbumItem)
string   $permission:  (default is core.view)
int   $userId:  an optional user id (default is the current user)

API Tags:
Return:  GalleryStatus a status code int a count


[ Top ]
fetchItemizedDescendentCounts  [line 1540]

  array fetchItemizedDescendentCounts( array $itemIds  )

Fetch the breakdown of descendents for a given item. Note: this call is more expensive than GalleryCoreApi::fetchDescendentCounts(), so use that version where possible.

Parameters:
array   $itemIds: 

API Tags:
Return:  GalleryStatus a status code array(id => array('GalleryAlbumItem' => ##, 'GalleryDataItem' => ##), id => array('GalleryAlbumItem' => ##, 'GalleryDataItem' => ##))


[ Top ]
fetchItemOrderWeight  [line 1390]

  array fetchItemOrderWeight( int $itemId  )

Get the order weight for a given item id

Parameters:
int   $itemId: 

API Tags:
Return:  GalleryStatus a status code int the order weight


[ Top ]
fetchItemOrderWeights  [line 1403]

  array fetchItemOrderWeights( array $itemIds  )

Get the order weight for many item ids

Parameters:
array   $itemIds: 

API Tags:
Return:  GalleryStatus a status code array(itemId1 => orderWeight1, itemId2 => orderWeight2, ...)


[ Top ]
fetchItemViewCount  [line 1354]

  array fetchItemViewCount( int $itemId  )

Get the view counts for many item ids

Parameters:
int   $itemId: 

API Tags:
Return:  GalleryStatus a status code int view count


[ Top ]
fetchItemViewCounts  [line 1366]

  array fetchItemViewCounts( array $itemIds  )

Get the view counts for many item ids

Parameters:
array   $itemIds: 

API Tags:
Return:  GalleryStatus a status code array (itemId => viewCount, ..)


[ Top ]
fetchLanguageCodeForUser  [line 1893]

  array fetchLanguageCodeForUser( int $userId  )

Fetch the preferred language of a specific user.

Parameters:
int   $userId: 

API Tags:
Return:  GalleryStatus a status code string code of preferred locale


[ Top ]
fetchLinkableChildItemIdsWithPermission  [line 1589]

  array fetchLinkableChildItemIdsWithPermission( array $itemId, $permissionId, array|string $permission  )

Return the ids of all the child items of the given item that have the matching permission and are linkable entities. Useful for, example, for finding all the children where we (the active user) has the 'core.changePermissions' permission bit set. This allows us to cascade permission updates.

Parameters:
array   $itemId: 
array|string   $permission:  (default is core.view). Either a single permission-id or an array of permission-ids.
   $permissionId: 

API Tags:
Return:  GalleryStatus a status code array a list of ids


[ Top ]
fetchNextItemWeight  [line 1444]

  int fetchNextItemWeight( int $itemId, int $direction  )

Fetch the weight of the next peer in line (higher or lower, as specified)

Parameters:
int   $itemId: 
int   $direction:  the direction (HIGHER_WEIGHT, LOWER_WEIGHT)

API Tags:
Return:  a weight


[ Top ]
fetchOriginationTimestamp  [line 1711]

  array fetchOriginationTimestamp( GalleryItem $item  )

Fetch the originationTimestamp through our known toolkits

Parameters:
GalleryItem   $item: 

API Tags:
Return:  GalleryStatus a status code int a timestamp or null if nothing was found


[ Top ]
fetchParents  [line 2538]

  array fetchParents( GalleryItem $item, [string|array $permission = null], [bool $filterBreadcrumb = false]  )

Load all the ancestors of this item

Parameters:
GalleryItem   $item: 
string|array   $permission:  (optional) only return ancestors with a specific permission or an array of required permissions
bool   $filterBreadcrumb:  (optional) whether to filter results with breadcrumbRootId

API Tags:
Return:  GalleryStatus a status code array of GalleryItem, from top level to parent item


[ Top ]
fetchParentSequence  [line 1484]

  array fetchParentSequence( int $itemId, [bool $filterBreadcrumb = false]  )

Get the parent sequence for this item id

Parameters:
int   $itemId: 
bool   $filterBreadcrumb:  (optional) whether to filter results with breadcrumbRootId

API Tags:
Return:  GalleryStatus a status code array the parent id sequence from root album down; given itemId not included


[ Top ]
fetchPermissionsForItems  [line 714]

  array fetchPermissionsForItems( array $itemIds, [int $userId = null], [boolean $sessionPermissions = true]  )

Return a list of permissions for the given items

Parameters:
array   $itemIds:  int GalleryItem ids
int   $userId:  (optional) id of the user whose permissions we search for
boolean   $sessionPermissions:  (optional) false to ignore session based permissions

API Tags:
Return:  GalleryStatus a status code array (id => array(array(permission.id => 1, ...), ...)


[ Top ]
fetchPluginList  [line 386]

  array fetchPluginList( string $pluginType  )

Return a plugin list by plugin type of all installed plugins.

Parameters:
string   $pluginType: 

API Tags:
Return:  GalleryStatus a status code array of (pluginId => ('active' => boolean))


[ Top ]
fetchPluginStatus  [line 373]

  array fetchPluginStatus( string $pluginType, [bool $ignoreCache = false]  )

Get the status of all plugins of a given type

Notes:

  • Some array elements are empty for uninstalled plugins ('version', 'required*Api', 'callbacks').
  • Installed but unavailable plugins are not listed.

Parameters:
string   $pluginType: 
bool   $ignoreCache:  (optional) true if we want to ignore the cache

API Tags:
Return:  GalleryStatus as status code array (moduleId => array('active' => true/false, 'available' => true/false, 'callbacks' => string, 'requiredCoreApi' => array 'requiredModuleApi' => array, 'version' => string)


[ Top ]
fetchPreferredsByItemIds  [line 1070]

  array fetchPreferredsByItemIds( array $ids  )

Convenience function to fetch the preferred for an item id

Parameters:
array   $ids:  GalleryItem ids

API Tags:
Return:  GalleryStatus a status code array(GalleryItem id => GalleryDerivativeImage, ...)


[ Top ]
fetchPreferredSource  [line 1044]

  array fetchPreferredSource( GalleryDataItem $item  )

Return the preferred source for this item by returning the first occurrence of the following:

  1. This item's preferred derivative
  2. This item's linked item's preferred derivative (if applicable)
  3. This item's linked item (if applicable)
  4. This item itself

Parameters:
GalleryDataItem   $item: 

API Tags:
Return:  GalleryObject a status code GalleryEntity (either a GalleryDataItem or a GalleryDerivative) the preferred source


[ Top ]
fetchResizesByItemIds  [line 1084]

  array fetchResizesByItemIds( array $ids  )

Convenience function to fetch the resizes for an item id

Parameters:
array   $ids:  GalleryItem ids

API Tags:
Return:  GalleryStatus a status code array(GalleryItem id => array(GalleryDerivativeImage, ...) ...)


[ Top ]
fetchThemeId  [line 1498]

  array fetchThemeId( GalleryItem $item  )

Return the correct theme for this item. If the appropriate theme cannot be loaded, we fall back on the default. And if that can't be loaded, then we return null.

Parameters:
GalleryItem   $item: 

API Tags:
Return:  GalleryStatus a status code string a theme plugi


[ Top ]
fetchThumbnailsByItemIds  [line 1057]

  array fetchThumbnailsByItemIds( array $ids  )

Convenience function to fetch the thumbnail for an item id

Parameters:
array   $ids:  GalleryItem ids

API Tags:
Return:  GalleryStatus a status code array(GalleryItem id => GalleryDerivativeImage, ...)


[ Top ]
fetchUserByUserName  [line 611]

  array fetchUserByUserName( [string $userName = null]  )

Lookup a user by username

Parameters:
string   $userName: 

API Tags:
Return:  GalleryStatus a status code GalleryUser a user


[ Top ]
fetchUserCount  [line 599]

  array fetchUserCount( [string $substring = null], [ $groupId = null]  )

Return the total number of users

Parameters:
string   $substring:  an optional substring to match against the username
   $groupId: 

API Tags:
Return:  GalleryStatus a status code int number of users


[ Top ]
fetchUsernames  [line 587]

  array fetchUsernames( [int $count = null], [int $offset = null], [string $substring = null]  )

Return a map of userNames => userids

You can specify how many users to list, and where the windows is in the list of all users.

Parameters:
int   $count:  (optional) the number of usernames desired
int   $offset:  (optional) the start of the range
string   $substring:  (optional) a substring to match

API Tags:
Return:  GalleryStatus a status code array (username, username, ...)


[ Top ]
fetchUsersForGroup  [line 1863]

  array fetchUsersForGroup( int $groupId, [int $count = null], [int $offset = null], [string $substring = null]  )

Return a list of user ids belonging to a group

You can specify how many userids to list, and where the windows is in the list of all users.

Parameters:
int   $groupId: 
int   $count:  the number of user ids desired
int   $offset:  the start of the range
string   $substring:  substring to match against the username

API Tags:
Return:  GalleryStatus a status code array user id => user name


[ Top ]
fetchWebFile  [line 2665]

  array(boolean fetchWebFile( string $url, string $outputFile, [array $extraHeaders = array()], [array $postDataArray = array()]  )

Fetch the web page at the given url. Follow redirects to get the data and upon completion return the http response, headers and the actual URL that we used to get the data.

Parameters:
string   $url: 
string   $outputFile: 
array   $extraHeaders:  (optional) extra headers to pass to the server
array   $postDataArray:  the key/value post data

API Tags:
Return:  success, http response, headers, url) the url is the final url retrieved after redirects


[ Top ]
fetchWebPage  [line 2679]

  array(boolean fetchWebPage( string $url, [array $extraHeaders = array()]  )

Fetch the web page at the given url. Follow redirects to get the data and upon completion return the body, http response, headers and the actual URL that we used to get the data.

Parameters:
string   $url: 
array   $extraHeaders:  (optional) extra headers to pass to the server

API Tags:
Return:  success, string body, http response, headers, url) the url is the final url retrieved after redirects


[ Top ]
getAllFactoryImplementationIds  [line 192]

  array getAllFactoryImplementationIds( string $classType  )

Return the ids and class names of all the available implementations for a class

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')

API Tags:
Return:  GalleryStatus a status code array (id => className, ...)


[ Top ]
getAllFactoryImplementationIdsWithHint  [line 204]

  array getAllFactoryImplementationIdsWithHint( $classType, $hint  )

Return the ids of all the available implementations for a class for a given hint.

Parameters:
   $classType: 
   $hint: 

API Tags:
Return:  GalleryStatus a status code array (id => className, ...)


[ Top ]
getAllPluginIds  [line 440]

  array getAllPluginIds( string $pluginType  )

Get the list of all available plugins of a given type

Parameters:
string   $pluginType: 

API Tags:
Return:  GalleryStatus a status code string plugin ids


[ Top ]
getAnonymousUserId  [line 3080]

  array getAnonymousUserId( )

Get id of the guest user.


API Tags:
Return:  GalleryStatus a status code int user id


[ Top ]
getApiVersion  [line 97]

  array getApiVersion( )

Return the major and minor version of the Core API.

When we add to the API, we'll bump the minor version. When we change or remove something from the API we'll change the major version.

When writing a module, you should verify:

  • The major version of the API exactly matches the version you expect
  • The minor number is the same, or higher than the version you expect
Notes:
  • If the major number is lower, or it's the same and the minor number is lower then it means that the API is older than you require.
  • If the major number is higher, then it means that the API is newer, but has made a change that may be incompatible with your module
  • If the major number is the same and the minor number is higher, then the API has more features than you need but should still work for you.


API Tags:
Return:  major number, minor number

Information Tags:
Todo:  for next major version bump:
  • remove GallerySession::getSessionId
  • remove GalleryPlatform::recursiveFixDirPermissions
  • remove GalleryUtilities::htmlEntityDecode
  • remove GalleryUrlGenerator::getGalleryId
  • remove GalleryStatus::wrap
  • change GalleryCoreApi::error to only take error code and error message
  • remove GalleryCapabilities (major bump of embed api too?)
  • remove 'link' entry in Gallery.class constructor
  • remove GalleryCoreApi::getPluginBaseDirs();
  • remove GalleryCoreApi::getPluginBaseDir();
  • remove GalleryCoreApi::isPluginInDefaultLocation();
  • remove $skipBaseDirectoryDetection from GalleryCoreApi::requireOnce();
  • remove support for check[Sidebar|Album|Photo]Blocks deprecated params for ShouldShowEmergencyEditItemLink in Callbacks.inc and comment in blocks/EmergencyEditItemLink.tpl
  • remove GalleryView::_getItem() (the private version of getItem());
  • remove support for : separator in GalleryView::loadView
  • delete GallerySqlFragment.class
  • remove studyPermissions, fetchPermissionsForItems does the same and more.
  • remove GalleryUtilities::utf8Substring (moved to GalleryCoreApi)
  • remove lib/wz_dragdrop/ (currently used by G2.1's watermark module)
  • refactor renderer code (methods: getRenderer and render, GalleryEntity vs GalleryItem)
  • remove support for {modules,themes}/.../locale dirs from lib/tools/po scripts from GalleryTranslatorHelper_medium::installTranslationsForPlugin, and from getPackageNames() in lib/tools/repository/classes/RepositoryDescriptor.class
  • remove resourceGetTemplateBaseDir from GalleryTemplate class
  • delete GalleryTestCase::failWithStatus
  • loadEntitiesById and deleteEntityById: make optional $requiredEntityType mandatory
  • remove GalleryCoreApi::registerEventListener, GalleryModule::registerEventListeners and other code marked for removal in helpers/GalleryEventHelper_simple.class
  • consider renaming everything using "languageCode" to "locale" for correct terminology (GalleryTranslator.class and Gallery.class)
  • delete modules/core/templates/blocks/NavigationLinks.tpl
  • remove GalleryRepository::getLanguageDescription
  • convert the contents of GALLERY_PERMISSION_SESSION_KEY to array indices instead of array of values.

[ Top ]
getCodeBasePath  [line 3278]

  string getCodeBasePath( [string $relativePath = null]  )

Get the local path to the Gallery code base path (not URL or web root). Optionally append a relative path.

Parameters:
string   $relativePath:  (optional) Relative path to append to the code base path.

API Tags:
Return:  local path to the Gallery code base. If the optional parameter has not been supplied the return value will have the trailing slash appended.


[ Top ]
getDefaultAlbumId  [line 3059]

  array getDefaultAlbumId( )

Get id of the album to display by default.


API Tags:
Return:  GalleryStatus a status code int album id


[ Top ]
getExternalAccessMemberList  [line 3202]

  array getExternalAccessMemberList( string $entityName  )

Get a list of entity members which are allowed to be shown / set by external systems (e.g.

via remote protocols like WebDAV, XML-RPC, etc). This does not include any permission checking.

Parameters:
string   $entityName:  name of the entity

API Tags:
Return:  GalleryStatus a status code array(string memberName => array('read' => boolean true if it's ok to show, 'write' => boolean true if it's ok to set))


[ Top ]
getFactoryDefinitionHints  [line 218]

  array getFactoryDefinitionHints( string $classType, $implId  )

Return the Hints for the specified class type and implId.

Parameters:
string   $classType:  Class type of the factory
   $implId: 

API Tags:
Return:  GalleryStatus array Hints for the specified implementation id and class type


[ Top ]
getLanguageDescription  [line 3265]

  array getLanguageDescription( string $languageCode  )

Returns the language description of the specified language-country code.

eg. en_US => English (US)

Parameters:
string   $languageCode: 

API Tags:
Return:  GalleryStatus a status code string language description


[ Top ]
getLegalPathComponent  [line 1939]

  array getLegalPathComponent( string $pathComponent, int $parentId, [int $selfId = null], [boolean $forDirectory = false]  )

Get a legal path component in the given parent id. Legal by the platform standards, and legal in that it doesn't cause a conflict with other path components.

Parameters:
string   $pathComponent:  the starting path component (eg. "IMG_10293.JPG")
int   $parentId:  the target parent id
int   $selfId:  (optional) ignore path collision with this id
boolean   $forDirectory:  (optional) Whether the path component is for a directory. Defaults to false. Periods are allowed anywhere in directories.

API Tags:
Return:  GalleryStatus a status code string the legal path component


[ Top ]
getLockIds  [line 2349]

  object array getLockIds( )

Get the set of lock ids


API Tags:
Return:  of lock ids


[ Top ]
getMapEntry  [line 2911]

  array getMapEntry( string $mapName, array $select, [array $match = array()], [array $optional = array()]  )

Get entries in a map that match a criteria and return selected fields

Parameters:
string   $mapName:  the map we're working on
array   $select:  the columns to return
array   $match:  the entries to match
array   $optional:  optional arguments (eg. limit, orderBy) array('limit' => array('count' => #, 'offset' => #), 'orderBy' => array(columnName => ORDER_ASCENDING|ORDER_DESCENDING, ...))

API Tags:
Return:  GalleryStatus a status code array the results


[ Top ]
getMaximumManagedToolkitPriority  [line 2181]

  array getMaximumManagedToolkitPriority( )

Get maximum priority value (lowest priority) in managed priority range (20-40)


API Tags:
Return:  GalleryStatus a status code int priority


[ Top ]
getMimeType  [line 2605]

  array getMimeType( string $filename, [string $requestMimeType = null]  )

Determine the proper mime type given the file and optionally with the mime type from the request

Parameters:
string   $filename:  the file name to determine the mime type for
string   $requestMimeType:  (optional)

API Tags:
Return:  GalleryStatus a status code string a mime type (application/unknown if no known extension)


[ Top ]
getPermissionIds  [line 947]

  array getPermissionIds( [int $flags = 0]  )

Get all the permission ids that match the specified flags.

This will return any permissions that contain *all* the bits from flags.

Parameters:
int   $flags: 

API Tags:
Return:  GalleryStatus a status code array (id => description, id => description, ...)


[ Top ]
getPermissions  [line 730]

  array getPermissions( int $itemId, [int $userId = null], [boolean $sessionPermissions = true]  )

Return all the permissions that the given user has for the given item.

Parameters:
int   $itemId: 
int   $userId:  an optional user id (default is current user)
boolean   $sessionPermissions:  (optional) false to ignore session based permissions

API Tags:
Return:  GalleryStatus a status code array (perm1, perm2)


[ Top ]
getPluginBaseDir  [line 2790]

  string getPluginBaseDir( string $pluginType, string $pluginId, [bool $clearCache = false]  )

Returns the base directory of the specified plugin.

OBSOLETE. Remove on next major API bump.

Modules should never assume the filesystem location of any module, not even the core module. Use this function to get the base directory of a module. Possible base directories are usually gallery2/ and gallery2/plugins. The complete list can be read with GalleryCoreApi::getPluginBaseDirs().

Parameters:
string   $pluginType: 
string   $pluginId: 
bool   $clearCache:  (optional) force index to be reread from the filesystem

API Tags:
Return:  plugin base directory


[ Top ]
getPluginBaseDirs  [line 2771]

  void getPluginBaseDirs( )

Returns an array of directories that can contain plugins.

OBSOLETE. Remove on next major API bump.

This function should only be used in special circumstances, for example when a list of all plugins needs to be made. Currently it returns gallery2/ and gallery2/plugins/.



[ Top ]
getPluginParameter  [line 305]

  array getPluginParameter( string $pluginType, string $pluginId, string $parameterName, [string $itemId = 0]  )

Convenience method to retrieve a plugin parameter

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $parameterName: 
string   $itemId:  (optional)

API Tags:
Return:  GalleryStatus a status code string a value


[ Top ]
getRedundantToolkitPriorities  [line 2208]

  array getRedundantToolkitPriorities( )

Get list of toolkits/priorities in managed priority range (20-40) for which another toolkit supports a same operation and mime type.


API Tags:
Return:  GalleryStatus a status code array (toolkitId=>priority, ..)


[ Top ]
getSubPermissions  [line 961]

  array getSubPermissions( $permissionId  )

Expand a single permission into all the possible permissions that it can possibly be.

For example, convert 'core.viewAll' into: ('core.viewAll', 'core.view', 'core.viewOriginal', 'core.viewResizes')

Parameters:
   $permissionId: 

API Tags:
Return:  GalleryStatus a status code array(array('id' => ..., 'description' => ...), ...)


[ Top ]
getSupportedLanguages  [line 3251]

  array['language getSupportedLanguages( )

Return the list of languages that we support.


API Tags:
Return:  code']['country code'] = array('description', 'right-to-left'?)


[ Top ]
getToolkitByOperation  [line 2105]

  array getToolkitByOperation( string $mimeType, string $operationName  )

Get a toolkit that can perform the given operation

Parameters:
string   $mimeType: 
string   $operationName: 

API Tags:
Return:  GalleryStatus a status code GalleryToolkit a toolkit string a result mime type


[ Top ]
getToolkitByProperty  [line 2155]

  array getToolkitByProperty( string $mimeType, string $propertyName  )

Get a toolkit that can retrieve the given property

Parameters:
string   $mimeType: 
string   $propertyName: 

API Tags:
Return:  GalleryStatus a status code GalleryToolkit a toolkit


[ Top ]
getToolkitOperationMimeTypes  [line 2074]

  array getToolkitOperationMimeTypes( string $operationName  )

Get all valid input mime types for a certain operation

Parameters:
string   $operationName: 

API Tags:
Return:  GalleryStatus a status code array(mime type => array(toolkit ids, sorted by priority))


[ Top ]
getToolkitOperations  [line 2061]

  array getToolkitOperations( string $mimeType  )

Get all valid operations on a certain mime type

Parameters:
string   $mimeType: 

API Tags:
Return:  GalleryStatus a status code array('name' => ..., 'outputMimeType' => ..., 'description' => ..., arguments => array('type' => ..., 'description' => ...), ...)


[ Top ]
getToolkitPriorityById  [line 2194]

  array getToolkitPriorityById( string $toolkitId  )

Get maximum priority value (lowest priority) in managed priority range (20-40)

Parameters:
string   $toolkitId: 

API Tags:
Return:  GalleryStatus a status code int priority


[ Top ]
getToolkitProperties  [line 2090]

  array getToolkitProperties( string $mimeType  )

Get all valid properties of a certain mime type

Parameters:
string   $mimeType: 

API Tags:
Return:  GalleryStatus a status code array ( array('name' => property, 'type' => type, 'description' => description), .. )


[ Top ]
getToolkitsByProperty  [line 2169]

  array getToolkitsByProperty( string $mimeType, string $propertyName  )

Get the toolkits that can retrieve the given property

Parameters:
string   $mimeType: 
string   $propertyName: 

API Tags:
Return:  GalleryStatus a status code array of toolkitIds


[ Top ]
guaranteeAlbumHasThumbnail  [line 1738]

  GalleryStatus guaranteeAlbumHasThumbnail( int $itemId  )

Make sure that the album has a thumbnail. If it doesn't, then grab the first handy child and make it the album's thumbnail. We're not picky.

Parameters:
int   $itemId:  the album id

API Tags:
Return:  a status code boolean true if successful


[ Top ]
handleThemeSettingsRequest  [line 3174]

  array handleThemeSettingsRequest( string $themeId, int $itemId, array $form  )

Handle theme settings form submission

Parameters:
string   $themeId:  if empty, site default theme is used
int   $itemId: 
array   $form:  form values

API Tags:
Return:  GalleryStatus a status code array error messages string localized status message


[ Top ]
hasItemPermission  [line 570]

  array hasItemPermission( int $itemId, string $permission, [int $userId = null], [boolean $sessionPermissions = true]  )

Return true if the current user has the specific permission for the target item

Parameters:
int   $itemId: 
string   $permission: 
int   $userId:  an optional user id (default is the current user)
boolean   $sessionPermissions:  (optional) false to ignore session based permissions

API Tags:
Return:  GalleryStatus a status code boolean true if yes


[ Top ]
hasPermission  [line 915]

  array hasPermission( int $itemId, mixed $entityIds, mixed $permissions  )

Are any or the given user/group ids directly granted all given permissions for the target item? Ignores session-based permissions.

Parameters:
int   $itemId: 
mixed   $entityIds:  array of int entity ids (usually user or group ids) or a single id
mixed   $permissions:  array of string permission ids or single permission id

API Tags:
Return:  GalleryStatus a status code boolean true if yes


[ Top ]
incrementItemViewCount  [line 1307]

  GalleryStatus incrementItemViewCount( int $itemId, [int $step = 1]  )

Update the view count for this item id

Parameters:
int   $itemId: 
int   $step:  the amount to increment

API Tags:
Return:  a status code


[ Top ]
installTranslationsForLocale  [line 3240]

  GalleryStatus installTranslationsForLocale( [string $locale = null]  )

Copy the translations for a given locale into our locale hierarchy.

Copies for all available (even uninstalled) plugins.

Parameters:
string   $locale:  (optional) Defaults to translator's current locale

API Tags:
Return:  a status code


[ Top ]
installTranslationsForPlugin  [line 3215]

  GalleryStatus installTranslationsForPlugin( string $pluginType, string $pluginId  )

Copy the translations for a given plugin into our locale hierarchy.

Parameters:
string   $pluginType:  'module' or 'theme'
string   $pluginId:  the id of the plugin

API Tags:
Return:  a status code


[ Top ]
invalidateDerivativeDimensionsBySourceIds  [line 1026]

  GalleryStatus invalidateDerivativeDimensionsBySourceIds( array $ids  )

Zero out the dimensions for all derivatives that depend on the given source id so that they will be recalculated before the next view.

Parameters:
array   $ids:  source ids

API Tags:
Return:  a status code


[ Top ]
isAnonymousUser  [line 3100]

  array isAnonymousUser( [int $userId = null]  )

Is the user a guest?

Parameters:
int   $userId:  id of user (default is current user)

API Tags:
Return:  GalleryStatus a status code boolean true if anonymous


[ Top ]
isDisabledUsername  [line 3187]

  array isDisabledUsername( string $userName  )

Return true if this username is not allowed to log in (generally due to automated abuse).

The username doesn't have to correspond to a real user in the system.

Parameters:
string   $userName:  a username

API Tags:
Return:  GalleryStatus a status code bool true if the account is disabled


[ Top ]
isPluginCompatibleWithApis  [line 289]

  boolean isPluginCompatibleWithApis( GalleryPlugin $plugin  )

Return true if the plugin is compatible with the current API versions. False otherwise.

Parameters:
GalleryPlugin   $plugin: 

API Tags:
Return:  true if the plugin is compatible


[ Top ]
isPluginInDefaultLocation  [line 2812]

  boolean isPluginInDefaultLocation( string $pluginType, string $pluginId, [bool $clearCache = false]  )

Indicates whether the specified plugin is in the default plugin directory.

OBSOLETE. Remove on next major API bump.

Sometimes it's useful to know just whether a plugin is in its default directory or not, without actually getting any information about its path. It is used for rewriting URL in the UrlGenerator.

We don't use GalleryPlatform in this function, because it is too low-level and there are significant problems with making it work here. One of the problems is that it breaks dozens of tests that rely on UnitTestPlatform.

Parameters:
string   $pluginType: 
string   $pluginId: 
bool   $clearCache:  (optional) force index to be reread from the filesystem


[ Top ]
isReadLocked  [line 2283]

  boolean isReadLocked( int $id  )

Return true if the given id is read locked or write locked by us.

Parameters:
int   $id:  an entity id

API Tags:
Return:  true if the entity is read locked


[ Top ]
isSupportedOperationSequence  [line 2122]

  GalleryStatus isSupportedOperationSequence( string $mimeType, string $operations  )

Verify that a given mime-type/operation-sequence combination is supported by our existing toolkits by walking the sequence and making sure that we have a toolkit that can handle each operation.

Parameters:
string   $mimeType:  the original mime type
string   $operations:  a sequence of operations

API Tags:
Return:  a status code boolean true if supported, false if not string the output mime type


[ Top ]
isUserInGroup  [line 1794]

  array isUserInGroup( int $userId, int $groupId  )

Is the given user id in the given group?

Parameters:
int   $userId: 
int   $groupId: 

API Tags:
Return:  GalleryStatus a status code boolean true if yes


[ Top ]
isUserInSiteAdminGroup  [line 1780]

  array isUserInSiteAdminGroup( [int $userId = null]  )

Is the active user in the admin group?

Parameters:
int   $userId:  an optional user id (default is the current user)

API Tags:
Return:  GalleryStatus a status code boolean true if yes


[ Top ]
isViewableMimeType  [line 2618]

  array isViewableMimeType( string $mimeType  )

Return true if the given mime type is viewble in a web browser

Parameters:
string   $mimeType: 

API Tags:
Return:  GalleryStatus a status code boolean


[ Top ]
isWriteLocked  [line 2307]

  boolean isWriteLocked( int $id  )

Return true if the given id is write locked by us.

Parameters:
int   $id:  an entity id

API Tags:
Return:  true if the entity is write locked


[ Top ]
loadAvailableBlocks  [line 3159]

  array loadAvailableBlocks( [bool $getInactive = false]  )

Load the block configuration files from every module

Parameters:
bool   $getInactive:  (optional) by default, only active modules' blocks are returned

API Tags:
Return:  GalleryStatus a status code array block configurations


[ Top ]
loadEntitiesById  [line 2365]

  array loadEntitiesById( mixed $ids, [mixed $requiredEntityType = null]  )

Load the GalleryEntities with the ids specified

Parameters:
mixed   $ids:  the ids (or id) of the GalleryEntities to load
mixed   $requiredEntityType:  (optional) Throw an ERROR_MISSING_OBJECT if the loaded entity doesn't extend the given entity-type (or types), e.g. 'GalleryItem'. Specify 'GalleryEntity' if any entity type is allowed.

API Tags:
Return:  GalleryStatus a status code, mixed one GalleryEntity or an array of GalleryEntities
Deprecated:  $requiredEntityType will no longer be optional after the next major API change


[ Top ]
loadEntityByExternalId  [line 2408]

  array loadEntityByExternalId( string $externalId, string $entityType  )

Map external id to G2 id and then load the entity

Parameters:
string   $externalId: 
string   $entityType: 

API Tags:
Return:  GalleryStatus a status code GalleryEntity


[ Top ]
loadPlugin  [line 275]

  array loadPlugin( string $pluginType, string $pluginId, [bool $ignoreVersionMismatch = false], [bool $errorOnVersionMismatch = false]  )

Load and initialize the given plugin

Parameters:
string   $pluginType:  the plugin type (eg. module, theme)
string   $pluginId:  the plugin id
bool   $ignoreVersionMismatch:  should we ignore version mismatches (default: no)
bool   $errorOnVersionMismatch:  should we return an error on version mismatches instead of redirecting to the upgrader? (default: false)

API Tags:
Return:  GalleryStatus a status code object the plugin


[ Top ]
loadThemeSettingsForm  [line 3146]

  GalleryStatus loadThemeSettingsForm( string $themeId, int $itemId, &$template, &$form, GalleryTemplate $template, array $form  )

Load template data for a theme settings form

Parameters:
string   $themeId:  if empty, site default theme is used
int   $itemId: 
GalleryTemplate   $template: 
array   $form: 
   &$template: 
   &$form: 

API Tags:
Return:  a status code


[ Top ]
makeSupportedViewableOperationSequence  [line 2139]

  array makeSupportedViewableOperationSequence( string $mimeType, string $operations, [boolean $prependConversion = true]  )

Make sure operation sequence is supported and produces a browser-viewable output mime type.

Add convert-to-image/jpeg operation if needed.

Parameters:
string   $mimeType:  the original mime type
string   $operations:  a sequence of operations
boolean   $prependConversion:  (optional) true to also try prepending convert-to-image/xxx

API Tags:
Return:  GalleryStatus a status code string a sequence of operations, null if not supported string the output mime type, null if not supported


[ Top ]
maybeCompactAccessLists  [line 516]

  GalleryStatus maybeCompactAccessLists( )

Compact the access list map, if we deem that it's a good time to do so.


API Tags:
Return:  a status code


[ Top ]
mergeDerivativeOperations  [line 1107]

  array mergeDerivativeOperations( string $operationSet1, string $operationSet2, [boolean $highPriority = false]  )

Merge together two sets of operations into one in the most sensible way.

For example:

OPERATION SET 1 OPERATION SET 2 RESULT crop|1,2,3,4;rotate|90 crop|2,3,4,5 crop|2,3,4,5;rotate|90 scale|250;rotate|90 rotate|-90 scale|250 scale|250;rotate|90 rotate|90 scale|250;rotate|180 scale|250;rotate|90 thumbnail|125 thumbnail|125;rotate|180

Parameters:
string   $operationSet1:  the first set of operations
string   $operationSet2:  the second set of operations
boolean   $highPriority:  true if the second set should be added at the beginning of the first set, if it can't be merged.

API Tags:
Return:  GalleryStatus a status code the merged operation set


[ Top ]
newEvent  [line 2219]

  GalleryEvent newEvent( string $eventName  )

Create a new event with the given name.

Parameters:
string   $eventName:  the name of the event, e.g. GalleryEntity::save

API Tags:
Return:  an event with the given name


[ Top ]
newFactoryInstance  [line 165]

  GalleryStatus newFactoryInstance( string $classType, [string $className = null]  )

Create a new instance of the given type

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')
string   $className:  the class name (eg. 'NetPbmToolkit')

API Tags:
Return:  a status code object the instance


[ Top ]
newFactoryInstanceByHint  [line 151]

  array newFactoryInstanceByHint( string $classType, mixed $hints  )

Create a new instance of the given type based on the hint(s) provided

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')
mixed   $hints:  array of hints to try (in order) or single string hint (eg. 'image/jpeg')

API Tags:
Return:  GalleryStatus a status code, object an instance


[ Top ]
newFactoryInstanceById  [line 179]

  array newFactoryInstanceById( string $classType, string $id  )

Create a new instance of the given type based on the id provided

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')
string   $id:  the class name (eg. 'NetPBM')

API Tags:
Return:  GalleryStatus a status code, object an instance


[ Top ]
newItemByMimeType  [line 1632]

  array newItemByMimeType( string $mimeType  )

Return the appropriate GalleryItem instance for the mime type provided.

Use the GalleryFactory to try to find an exact match to the mime type. Failing that, fall back to the major type, then fall back to '*'.

Parameters:
string   $mimeType: 

API Tags:
Return:  GalleryStatus a status code GalleryItem an item


[ Top ]
postEvent  [line 2243]

  array postEvent( GalleryEvent $event  )

Deliver an event to anybody listening.

Parameters:
GalleryEvent   $event: 

API Tags:
Return:  GalleryStatus a status code array data returned from listeners, if any


[ Top ]
postToWebPage  [line 2692]

  array(body, postToWebPage( string $url, array $postDataArray, [array $extraHeaders = array()]  )

Post form data to a remote url and return the http response, headers and body of the reply

Parameters:
string   $url: 
array   $postDataArray:  the key/value post data
array   $extraHeaders:  (optional) extra headers to pass to the server

API Tags:
Return:  http response, headers)


[ Top ]
rebalanceChildOrderWeights  [line 1418]

  GalleryStatus rebalanceChildOrderWeights( int $parentItemId, [int $spacing = 1000]  )

Rebalance the order weights associated with this item's children. When this method is complete, the child item ids should still have the same order as they have now, but their order weights should be spaced out to exactly the spacing value specified in the arguments.

Parameters:
int   $parentItemId: 
int   $spacing:  the order spacing

API Tags:
Return:  a status code


[ Top ]
rebuildDerivativeCache  [line 1001]

  array rebuildDerivativeCache( int $derivativeId  )

Rebuild the cache for the given derivative

Parameters:
int   $derivativeId: 

API Tags:
Return:  GalleryStatus a status code GalleryDerivative the rebuilt derivative


[ Top ]
rebuildDerivativeCacheIfNotCurrent  [line 988]

  array rebuildDerivativeCacheIfNotCurrent( int $derivativeId, [boolean $fixBroken = false]  )

Rebuild the cached derivative file if it is not current.

If the cache is expired, it will be automatically rebuilt

Parameters:
int   $derivativeId: 
boolean   $fixBroken:  (optional) whether to try to fix the derivative if is broken

API Tags:
Return:  GalleryStatus a status code, GalleryDerivative the up-to-date derivative boolean true if it had to be rebuilt, false if not


[ Top ]
refreshLocks  [line 2339]

  GalleryStatus refreshLocks( int $freshUntil  )

Refresh all the locks that we hold so that they aren't accidentally considered expired

Parameters:
int   $freshUntil:  the new "fresh until" timestamp

API Tags:
Return:  a status code


[ Top ]
registerEventListener  [line 2231]

  void registerEventListener( string $eventName, &$eventListener, [boolean $disableForUnitTests = false], GalleryEventListener $eventListener  )

Register an event listener.

Parameters:
string   $eventName:  the name of the event, e.g. GalleryEntity::save
GalleryEventListener   $eventListener: 
boolean   $disableForUnitTests:  (optional) if true, disable event listener during tests
   &$eventListener: 

API Tags:
Deprecated:  Use GalleryCoreApi::registerFactoryImplementation('GalleryEventListener', ...


[ Top ]
registerFactoryImplementation  [line 114]

  void registerFactoryImplementation( string $classType, string $className, string $implId, string $implPath, string $implModuleId, array $hints, [int $orderWeight = 5]  )

Register a new implementation with the factory

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')
string   $className:  the class name (eg. 'NetPbmToolkit')
string   $implId:  an implementation id (eg. 'NetPBM')
string   $implPath:  the relative path to the implementation file (eg. 'modules/netpbm/classes/NetPbmToolkit.class')
string   $implModuleId:  the id of the module containing the implementation (eg. 'netpbm')
array   $hints:  optional hints that can be used to locate this implementation (eg. array('image/jpeg', 'image/gif'))
int   $orderWeight:  the priority of this implementation (lower number == higher priority)


[ Top ]
registerFactoryImplementationForRequest  [line 135]

  GalleryStatus registerFactoryImplementationForRequest( string $classType, string $className, string $implId, string $implPath, string $implModuleId, array $hints  )

Register a new implementation with the factory for this request only

Parameters:
string   $classType:  the class type (eg. 'GalleryToolkit')
string   $className:  the class name (eg. 'NetPbmToolkit')
string   $implId:  an implementation id (eg. 'NetPBM')
string   $implPath:  the relative path to the implementation file (eg. 'modules/netpbm/classes/NetPbmToolkit.class')
string   $implModuleId:  the id of the module containing the implementation (eg. 'netpbm')
array   $hints:  optional hints that can be used to locate this implementation (eg. array('image/jpeg', 'image/gif'))


[ Top ]
registerPermission  [line 931]

  GalleryStatus registerPermission( string $module, string $permissionId, string $description, [int $flags = 0], [array $composites = array()]  )

Register a new permission

Parameters:
string   $module:  the id of the module
string   $permissionId:  the id of the permission
string   $description:  the non-localized description of the permission
int   $flags:  (optional) flags (of the GALLERY_PERMISSION_XYZ variety)
array   $composites:  (optional) ids of other permissions that compose this one

API Tags:
Return:  a status code


[ Top ]
registerToolkitOperation  [line 1978]

  GalleryStatus registerToolkitOperation( string $toolkitId, array $mimeTypes, string $operationName, array $parameterTypesArray, string $description, [string $outputMimeType = ''], [int $priority = 5]  )

Register the operations that a toolkit is able to perform on a certain mime type.

This should be called by a module that provides a toolkit to access certain mime types. The module should also call GalleryCoreApi::registerFactoryImplementation with the same "id" that it registers here, so the correct class can be found later.

Parameters:
string   $toolkitId:  the id of the toolkit
array   $mimeTypes:  the applicable mime types for this operation
string   $operationName:  the id of the operation
array   $parameterTypesArray:  a list of parameters that this operation requires
string   $description:  a translatable description of this operation
string   $outputMimeType:  the output mime type after performing this operation
int   $priority:  priority of this implementation vs other toolkits

API Tags:
Return:  a status code


[ Top ]
registerToolkitProperty  [line 2029]

  GalleryStatus registerToolkitProperty( string $toolkitId, array $mimeTypes, string $propertyName, string $type, string $description  )

Register a parameter that a toolkit can extract from a certain mime type.

This should be called by a module that provides a toolkit to access certain mime types. The module should also call GalleryCoreApi::registerFactoryImplementation with the same "id" that it registers here, so the correct class can be found later.

Parameters:
string   $toolkitId:  the id of the toolkit
array   $mimeTypes:  the applicable mime types for this property
string   $propertyName:  the name of the property
string   $type:  the type of the property
string   $description:  a translatable description of this property

API Tags:
Return:  a status code


[ Top ]
releaseAllLocks  [line 2328]

  GalleryStatus releaseAllLocks( )

Let go of all of our locks.


API Tags:
Return:  a status code


[ Top ]
releaseLocks  [line 2318]

  GalleryStatus releaseLocks( mixed $lockIds  )

Release the given lock(s)

Parameters:
mixed   $lockIds:  array of lock ids, or a single lock id

API Tags:
Return:  a status code


[ Top ]
remapOwnerId  [line 1767]

  GalleryStatus remapOwnerId( int $oldUserId, int $newUserId  )

Transfer the ownership of all items by oldUser to newUser

Parameters:
int   $oldUserId:  the user id of the old owner
int   $newUserId:  the user id of the new owner

API Tags:
Return:  a status code


[ Top ]
remapSourceIds  [line 1198]

  GalleryStatus remapSourceIds( string $originalSourceId, string $newSourceId  )

Find all derivatives attached to one source and switch them to another one

Parameters:
string   $originalSourceId:  the original source id
string   $newSourceId:  the new source id

API Tags:
Return:  a status code


[ Top ]
removeAllMapEntries  [line 2978]

  GalleryStatus removeAllMapEntries( string $mapName, [bool $useNonTransactionalConnection = false]  )

Remove ALL entries from this map.. use with caution!

Parameters:
string   $mapName: 
bool   $useNonTransactionalConnection:  (optional) set to true if we should do this operation outside of a transaction (which will let some databases use the TRUNCATE statement).

API Tags:
Return:  a status code


[ Top ]
removeAllPluginParameters  [line 469]

  GalleryStatus removeAllPluginParameters( string $pluginType, string $pluginId  )

Remove all parameters for this plugin

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  a status code


[ Top ]
removeAllUsersFromGroup  [line 1844]

  GalleryStatus removeAllUsersFromGroup( int $groupId  )

Remove any users in the group

Parameters:
int   $groupId: 

API Tags:
Return:  a status code


[ Top ]
removeDerivativeOperation  [line 1119]

  string removeDerivativeOperation( $operation, $operationSet  )

Remove the given operation from the operation set.

Parameters:
   $operation: 
   $operationSet: 

API Tags:
Return:  the new operation set


[ Top ]
removeDerivativePreferenceForItemType  [line 1254]

  GalleryStatus removeDerivativePreferenceForItemType( int $itemId, int $derivativeType  )

Remove derivative preference for a given item/type combination

Parameters:
int   $itemId: 
int   $derivativeType: 

API Tags:
Return:  a status code


[ Top ]
removeDerivativePreferencesForItem  [line 1267]

  GalleryStatus removeDerivativePreferencesForItem( int $itemId  )

Remove all derivative preferences for a given item

Parameters:
int   $itemId: 

API Tags:
Return:  a status code


[ Top ]
removeEntityPermission  [line 858]

  GalleryStatus removeEntityPermission( int $itemId, int $entityId, string $permission, [boolean $applyToChildren = false]  )

Remove the given itemid, entityid, permission mapping

Parameters:
int   $itemId:  the id of the GalleryItem
int   $entityId:  the id of the GalleryEntity
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
removeGroupPermission  [line 842]

  GalleryStatus removeGroupPermission( int $itemId, int $groupId, string $permission, [boolean $applyToChildren = false]  )

Remove the given itemid, groupid, permission mapping

Parameters:
int   $itemId:  the id of the GalleryItem
int   $groupId:  the id of the GalleryGroup
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
removeItemAttributes  [line 1330]

  GalleryStatus removeItemAttributes( int $itemId  )

Remove the attributes for the given item

Parameters:
int   $itemId: 

API Tags:
Return:  a status code


[ Top ]
removeItemPermissions  [line 871]

  GalleryStatus removeItemPermissions( int $itemId  )

Remove all permissions for the given itemid

Parameters:
int   $itemId: 

API Tags:
Return:  a status code


[ Top ]
removeMapEntry  [line 2934]

  GalleryStatus removeMapEntry( string $mapName, array $data  )

Remove entries from a map

Parameters:
string   $mapName:  the map we're working on
array   $data:  an associative array of data about the entries to match

API Tags:
Return:  a status code


[ Top ]
removeMimeType  [line 2631]

  GalleryStatus removeMimeType( array $mimeMatch  )

Remove specified mime data from the list.

examples: array('mimeType' => 'test/image') or array('extension' => array('img', 'im2'))

Parameters:
array   $mimeMatch:  (keys/values to delete)

API Tags:
Return:  a status code


[ Top ]
removeOnLoadHandlers  [line 2420]

  GalleryStatus removeOnLoadHandlers( array $handlerIds  )

Remove onLoadHandlers from all entities

Parameters:
array   $handlerIds:  of factory impl ids

API Tags:
Return:  a status code


[ Top ]
removePlugin  [line 427]

  GalleryStatus removePlugin( string $pluginType, string $pluginId  )

Remove the given plugin from the map

Parameters:
string   $pluginType: 
string   $pluginId: 

API Tags:
Return:  a status code


[ Top ]
removePluginParameter  [line 455]

  GalleryStatus removePluginParameter( string $pluginType, string $pluginId, string $parameterName, [int $itemId = 0]  )

Remove a parameter for this plugin

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $parameterName: 
int   $itemId:  the id of item (or null for a global setting)

API Tags:
Return:  a status code


[ Top ]
removePluginParameterByValue  [line 348]

  GalleryStatus removePluginParameterByValue( string $pluginType, string $pluginId, string $parameterName, mixed $parameterValue  )

Remove all plugin entries for a given parameter and value pair

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $parameterName: 
mixed   $parameterValue:  the value to be matched

API Tags:
Return:  a status code


[ Top ]
removePluginParametersForItemId  [line 333]

  GalleryStatus removePluginParametersForItemId( int $itemId  )

Remove all plugin parameters for a given item id

Parameters:
int   $itemId:  the id of the GalleryItem

API Tags:
Return:  a status code


[ Top ]
removeTranslationsForPlugin  [line 3228]

  GalleryStatus removeTranslationsForPlugin( string $pluginType, string $pluginId  )

Remove the translations for a given plugin from our locale hierarchy.

Parameters:
string   $pluginType:  'module' or 'theme'
string   $pluginId:  the id of the plugin

API Tags:
Return:  a status code


[ Top ]
removeUserFromAllGroups  [line 1832]

  GalleryStatus removeUserFromAllGroups( int $userId  )

Remove the user from all groups

Parameters:
int   $userId: 

API Tags:
Return:  a status code


[ Top ]
removeUserFromGroup  [line 1820]

  GalleryStatus removeUserFromGroup( int $userId, int $groupId  )

Remove the specified user to the specified group.

Parameters:
int   $userId: 
int   $groupId: 

API Tags:
Return:  a status code


[ Top ]
removeUserPermission  [line 826]

  GalleryStatus removeUserPermission( int $itemId, int $userId, string $permission, [boolean $applyToChildren = false]  )

Remove the given itemid, userid, permission mapping

Parameters:
int   $itemId:  the id of the GalleryItem
int   $userId:  the id of the GalleryUser
string   $permission:  the permission id
boolean   $applyToChildren:  (optional) whether or not this call applies to child items

API Tags:
Return:  a status code


[ Top ]
requestWebPage  [line 2705]

  array($responseStatus, requestWebPage( string $url, [string $requestMethod = 'GET'], [array $requestHeaders = array()], [string $requestBody = '']  )

Make an HTTP request to a remote URL and return the HTTP response status, headers and body.

Parameters:
string   $url: 
string   $requestMethod:  (optional) the HTTP request method, defaults to 'GET'
array   $requestHeaders:  (optional) extra headers to pass to the server
string   $requestBody:  (optional) the request body to pass to the server

API Tags:
Return:  $responseBody)


[ Top ]
requireOnce  [line 2827]

  void requireOnce( string $file, [boolean $skipBaseDirectoryDetection = false]  )

Require a file, but only once. All specified paths must be relative to the gallery2 directory. Think of it as a virtual PHP include_path.

Surprisingly, tracking what's been already loaded in a static variable is actually 10x+ faster than just calling require_once directly, even when using this extra API method to wrap it.

Parameters:
string   $file: 
boolean   $skipBaseDirectoryDetection:  deprecated


[ Top ]
sendTemplatedEmail  [line 2849]

  GalleryStatus sendTemplatedEmail( string $file, array $data, string $from, string $to, string $subject, [string $headers = '']  )

Send an email using a smarty template for the message body

Parameters:
string   $file:  template file
array   $data:  data to pass to smarty template
string   $from:  from address (null allowed)
string   $to:  to address(es) (comma separated)
string   $subject:  email subject
string   $headers:  (optional) additional headers (\r\n separated)

API Tags:
Return:  a status code


[ Top ]
setItemOrderWeight  [line 1378]

  GalleryStatus setItemOrderWeight( int $itemId, int $orderWeight  )

Set the order weight for an item id

Parameters:
int   $itemId: 
int   $orderWeight:  the new order weight

API Tags:
Return:  a status code


[ Top ]
setItemViewCount  [line 1342]

  GalleryStatus setItemViewCount( int $itemId, int $count  )

Update the view count for this item id

Parameters:
int   $itemId: 
int   $count:  the new count

API Tags:
Return:  a status code


[ Top ]
setMaintenanceMode  [line 3303]

  GalleryStatus setMaintenanceMode( mixed $mode  )

Allows the application to programmatically set Gallery into or out of maintenance mode.

Parameters:
mixed   $mode:  This can either be a boolean flag or a string representing the url of the custom maintenance mode page.

API Tags:
Return:  a status code


[ Top ]
setParentSequence  [line 1457]

  GalleryStatus setParentSequence( int $itemId, array $parentSequence  )

Set the parent id sequence for an item id

Parameters:
int   $itemId: 
array   $parentSequence:  the parent sequence (ids)

API Tags:
Return:  a status code


[ Top ]
setPluginParameter  [line 485]

  GalleryStatus setPluginParameter( string $pluginType, string $pluginId, string $parameterName, string $parameterValue, [string $itemId = 0]  )

Set a plugin parameter

Parameters:
string   $pluginType: 
string   $pluginId: 
string   $parameterName: 
string   $parameterValue: 
string   $itemId:  (optional)

API Tags:
Return:  a status code


[ Top ]
setThumbnailFromItem  [line 1725]

  GalleryStatus setThumbnailFromItem( int $itemId, int $fromItemId  )

Set the thumbnail for an album from an item, according to the thumbnail preferences for the album.

Parameters:
int   $itemId:  the album id
int   $fromItemId:  the item id

API Tags:
Return:  a status code boolean true if successful


[ Top ]
shouldDoCompileCheck  [line 3292]

  boolean shouldDoCompileCheck( )

Check whether modification checks should be done to see if the compiled templates are still up to date. The result is cached in memory.


API Tags:
Return:  false if the compiled templates should be used without any checking


[ Top ]
studyPermissions  [line 748]

  GalleryStatus studyPermissions( array $itemIds, [int $userId = null], [boolean $sessionPermissions = true]  )

Study the permissions for all items (for the given user).

Caches the results in memory for the duration of the HTTP request handling such that subsequent permission checks go to memory rather than to the DB.

Parameters:
array   $itemIds:  GalleryItem ids
int   $userId:  an optional user id (default is current user)
boolean   $sessionPermissions:  (optional) false to ignore session based permissions

API Tags:
Return:  a status code
Deprecated:  Use fetchPermissionsForItems instead.


[ Top ]
unregisterFactoryImplementation  [line 258]

  GalleryStatus unregisterFactoryImplementation( string $classType, string $implId  )

Unregister a factory implementation by id

Parameters:
string   $classType:  a class type (eg. 'GalleryToolkit')
string   $implId:  an implementation id (eg. 'NetPBM')

API Tags:
Return:  a status code


[ Top ]
unregisterFactoryImplementationsByModuleId  [line 245]

  GalleryStatus unregisterFactoryImplementationsByModuleId( string $moduleId  )

Unregister all factory implementations for a module

Parameters:
string   $moduleId:  an id (eg. 'netpbm')

API Tags:
Return:  a status code


[ Top ]
unregisterModulePermissions  [line 972]

  GalleryStatus unregisterModulePermissions( $moduleId  )

Unregister all permission associated with a given module.

Parameters:
   $moduleId: 

API Tags:
Return:  a status code


[ Top ]
unregisterToolkit  [line 2043]

  GalleryStatus unregisterToolkit( string $toolkitId  )

Unregister a toolkit's operations and properties. If we have any remaining that are no longer implemented by any toolkit then remove them from the system also.

Parameters:
string   $toolkitId: 

API Tags:
Return:  a status code


[ Top ]
unregisterToolkitOperation  [line 1996]

  GalleryStatus unregisterToolkitOperation( string $toolkitId, string $operationName, [array $mimeTypes = array()]  )

Unregister an operation that a toolkit is able to perform on certain mime types

Parameters:
string   $toolkitId:  the id of the toolkit
string   $operationName:  the id of the operation
array   $mimeTypes:  the applicable mime types to remove; empty for all mime types

API Tags:
Return:  a status code


[ Top ]
unregisterToolkitsByModuleId  [line 2009]

  GalleryStatus unregisterToolkitsByModuleId( string $moduleId  )

Unregister all operations and properties for toolkits implemented by the given module.

Parameters:
string   $moduleId: 

API Tags:
Return:  a status code


[ Top ]
updateFactoryDefinitionHints  [line 232]

  GalleryStatus updateFactoryDefinitionHints( string $classType, $implId, mixed $hints  )

Return the Hints for the specified class type and implId.

Parameters:
string   $classType:  Class type of the factory
mixed   $hints:  array of hints to try (in order) or single string hint (eg. 'image/jpeg')
   $implId: 


[ Top ]
updateMapEntry  [line 2884]

  GalleryStatus updateMapEntry( string $mapName, array $match, array $change, [boolean $useNonTransactionalConnection = false]  )

Update entries in a map

Parameters:
string   $mapName:  the map we're working on
array   $match:  the entries to match
array   $change:  the values to change
boolean   $useNonTransactionalConnection:  (optional) set to true if we should use a new non transactional database connection for this operation. Default is false.

API Tags:
Return:  a status code


[ Top ]
updateModificationTimestamp  [line 1295]

  GalleryStatus updateModificationTimestamp( int $entityId  )

Set modification timestamp for the given entity id to the current time.

Parameters:
int   $entityId: 

API Tags:
Return:  a status code


[ Top ]
updateParentSequence  [line 1470]

  GalleryStatus updateParentSequence( array $oldParentSequence, array $newParentSequence  )

Update all items containing the source parent sequence to the new parent sequence

Parameters:
array   $oldParentSequence: 
array   $newParentSequence:  the parent sequence (ids)

API Tags:
Return:  a status code


[ Top ]
utf8Strcut  [line 2757]

  string utf8Strcut( string $string, int $start, int $length  )

mb_strcut for UTF-8, with PHP fallback. Truncates incomplete HTML entity at end of result.

Parameters:
string   $string:  the input string containing raw UTF-8
int   $start:  the byte-offset of the start position
int   $length:  the length in bytes (not in characters), not optional

API Tags:
Return:  a multibyte safe substring of input value


[ Top ]
utf8Substring  [line 2744]

  string utf8Substring( string $string, int $start, int $length  )

mb_substr for UTF-8, with PHP fallback. Truncates incomplete HTML entity at end of result.

Parameters:
string   $string:  the input string containing raw UTF-8
int   $start:  the start position
int   $length:  the length of the substring, not optional

API Tags:
Return:  a multibyte safe substring of input value


[ Top ]

Documentation generated on Fri, 08 Oct 2010 04:54:37 -0700 by phpDocumentor 1.3.0RC6