[ Index ] |
|
Code source de LifeType 1.2.4 |
[Code source] [Imprimer] [Statistiques]
\defgroup Gallery The pLog Gallery module encapsulates all the logic necessary for:
Poids: | 896 lignes (36 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 3 fois |
Nécessite: | 0 fichiers |
GalleryResources:: (19 méthodes):
GalleryResources()
getResource()
getNextResource()
getPreviousResource()
getUserResources()
check()
getNumUserResources()
addResourceToDatabase()
_getResourceType()
addResource()
_filterMetadata()
addResourceFromDisk()
getResourceFile()
updateResource()
deleteResource()
deleteUserResources()
isDuplicatedFilename()
getSearchConditions()
mapRow()
Classe: GalleryResources - X-Ref
\ingroup GalleryGalleryResources() X-Ref |
Pas de description |
getResource( $resourceId, $ownerId = -1, $albumId = -1 ) X-Ref |
Fetches GalleryResource objects from the database param: resourceId The id of the resource we'd like to fetch param: ownerId Optional, the id of the owner param: albumId Optional, the id of the album to which this resoruce should belong return: Returns a GalleryResource object representing the resource |
getNextResource( $resource ) X-Ref |
given a resource id, tries to find the next one in the sequence param: resource A GalleryResource object that represents the resource whose next return: Returns a GalleryResource object representing the next resource, or false |
getPreviousResource( $resource ) X-Ref |
given a resource id, tries to find the previus one in the sequence param: resource A GalleryResource object that represents the resource whose next return: Returns a GalleryResource object representing the previous resource, or false |
getUserResources( $ownerId, $albumId = GALLERY_NO_ALBUM, $resourceType = GALLERY_RESOURCE_ANY,$searchTerms = "",$page = DEFAULT_PAGING_ENABLED, $itemsPerPage = DEFAULT_ITEMS_PER_PAGE ) X-Ref |
Returns all the resources that belong to a blog param: blogId The blog to which the resources belong, use -1 to indicate any blog/owner param: albumId Filters by album param: page param: itemsPerPage param: searchTerms return: Returns an array of GalleryResource objects with all |
check( $resource, $ownerId = -1, $albumId = GALLERY_NO_ALBUM, $resourceType = GALLERY_RESOURCE_ANY ) X-Ref |
getNumUserResources( $ownerId, $albumId = GALLERY_NO_ALBUM, $resourceType = GALLERY_RESOURCE_ANY, $searchTerms = "" ) X-Ref |
returns the number of items given certain conditions param: ownerId The id of the user whose amount of albums we'd like to check param: albumId Optional, the id of the album, in case we'd only like to know the number of resources in a certain album. param: resourceType An additional filter parameter, so that we can only count a certain type of resources. param: searchTerms return: the total number of items |
addResourceToDatabase( $ownerId, $albumId, $description, $flags, $resourceType, $filePath, $fileName, $metadata ) X-Ref |
Adds a row related to a resource to the database. You should usually use GalleryResources::addResource() or GalleryResources::addResourceFromDisk(), which are more suitable and will do most of the job for you. param: ownerId param: albumId param: description param: flags param: resourceType param: filePath param: fileName param: metadata return: a valid resource id or false otherwise |
_getResourceType( $fileName, &$metadata ) X-Ref |
param: fileName param: metadata |
addResource( $ownerId, $albumId, $description, $upload ) X-Ref |
adds a resource to the database. This method requires a FileUpload parameter and it will take care of processing the upload file and so on. If the file is already in disk and we'd like to add it, please check GalleryResources::addResourceFromDisk() This method will also take care of extracting the metadata from the file and generating the thumbnail in the required format, according to our configuration. param: ownerId param: albumId param: description param: upload A FileUpload object return: It will return one of the following constants: |
_filterMetadata( &$metadata, $resourceType ) X-Ref |
param: metadata param: resourceType |
addResourceFromDisk( $ownerId, $albumId, $description, $fullFilePath ) X-Ref |
adds a resource to the gallery when the resource is already stored on disk, instead of it coming from an upload as it usually happens. This method is better than GalleryResources::addResource() when instead of dealing with uploaded files, the file is already in disk and all that is left to do is to add it to the database. param: ownerId param: albumId param: description param: fullFilePath The real path where the file is stored. This is expected to be return: It will return one of the following constants: |
getResourceFile( $ownerId, $fileName, $albumId = -1 ) X-Ref |
retrieves a resource, given its filename and its owner param: ownerId param: fileName return: Returns a GalleryResource object containing the given resource |
updateResource( $resource ) X-Ref |
updates a resource in the database. param: resource A GalleryResource object with the information of the return: Returns true if successful or false otherwise |
deleteResource( $resourceId, $ownerId = -1 ) X-Ref |
removes a resource from the database and disk param: resourceId The identifier of the resource we'd like to remove param: ownerId Identifier of the owner of the resource. Optional. return: Returns true if resource deleted ok or false otherwise. |
deleteUserResources( $ownerId ) X-Ref |
Removes all the resource from the given ownerId param: ownerId The blog identifier |
isDuplicatedFilename( $fileName ) X-Ref |
returns true if the given filename already exists in the db param: fileName return: true if the filename already exists or false otherwise |
getSearchConditions( $searchTerms ) X-Ref |
mapRow( $row ) X-Ref |
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |