blueshoes php application framework and cms            applications_imagearchive
[ class tree: applications_imagearchive ] [ index: applications_imagearchive ] [ all elements ]

Class: Bs_ImageArchive

Source Location: /applications/imagearchive/Bs_ImageArchive.class.php

Class Overview

Bs_Object
   |
   --Bs_ImageArchive

Image Archive class.


Author(s):

Version:

  • 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:35 $

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods

Class: Bs_Object

Bs_Object::Bs_Object()
Bs_Object::getErrors()
Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack.
Bs_Object::getLastError()
Basic error handling: Get last error string from the global Bs_Error-error stack.
Bs_Object::getLastErrors()
Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors().
Bs_Object::persist()
Persists this object by serializing it and saving it to a file with unique name.
Bs_Object::setError()
Basic error handling: Push an error string on the global Bs_Error-error stack.
Bs_Object::toHtml()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::toString()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::unpersist()
Fetches an object that was persisted with persist()

Class Details

[line 62]
Image Archive class.

**************************************************************************** features:

  • directory access setting files (who may access what and how)
  • automatic thumbnail generation (currently only for jpg files)
  • file upload
todo:
  • auto thumbnail generation for other formats, especially gif
  • format conversion, things like tiff etc. often ppl dunno how to convert their photo-cd pictures into jpg's.

**************************************************************************** how directory access setting files work:

to find the appropriate access file it works like apache. at first it looks into the current working dir, if nothing is found it goes one directory up etc until a file is found. see var $accessFileName. if no file is found, the directory is treated public.

of course you can still use apache's .htaccess functionality to block/allow ip's, require a login etc.

the files contain 4 lines like this example: view = all add = login edit = u:tom;u:bill;g:admin delete = g:admin

all means everyone can do it. login means everyone that is logged in somehow may do it. u: specifies a user, g:specifies a group. semicolon is the separator. 'none' means no-one can do it. if a line is not there or has no value, it means 'none'.

todo: only 'view' and 'add' are used where 'add' stands for add, edit and delete. so it's currently only read/write access that can be given.




Tags:

copyright:  blueshoes.org
pattern:  singleton: (pseudostatic)
access:  public
version:  4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:35 $
author:  andrej arn <at blueshoes dot org>


[ Top ]


Class Variables

$accessFileName =  '.htBsFaAccess'

[line 234]

name of the directory access definition files.

it is highly recommended to start with '.ht' cause by default apache prohibits web users to view such files (like .htaccess, .htpasswd). Bs stands for BlueShoes, Fa for FileArchive.

if no access file is found, the directory is treated 'public'.




Tags:

see:  header of the class, _getAccessRights(), _mayAccess()
access:  public

Type:   string


[ Top ]

$allowedTypes = array('gif', 'jpg', 'jpeg')

[line 132]

the allowed/accepted image types.



Tags:

todo:  accepte png
access:  public

Type:   mixed


[ Top ]

$Bs_Date =

[line 83]

pseudostatic instance of Bs_Date.



Tags:

access:  public

Type:   object


[ Top ]

$Bs_FileSystem =

[line 69]

pseudostatic instance of Bs_FileSystem.



Tags:

access:  public

Type:   object


[ Top ]

$Bs_HtmlUtil =

[line 90]

pseudostatic instance of Bs_HtmlUtil.



Tags:

access:  public

Type:   object


[ Top ]

$Bs_ImageUtil =

[line 76]

pseudostatic instance of Bs_ImageUtil.



Tags:

access:  public

Type:   object


[ Top ]

$currentDirectory =  ''

[line 115]

if we don't work in the root dir then we are in the given subdirectory.

that path is attached to both vars $serverBasePath and $webBasePath. eg "some/sub/directory/".




Tags:

var:  (default is empty ''.)
access:  public

Type:   string


[ Top ]

$ignoreDir = array('CVS')

[line 140]

dirs that should be ignored.

by default 'CVS' dirs are ignored.




Tags:

access:  public

Type:   array


[ Top ]

$navigationStyle =

[line 219]

defines how the navigation (of image-directories) looks. see class Bs_HtmlNavigation.



Tags:

access:  public

Type:   array


[ Top ]

$numberOfImages =

[line 250]

gets set in getOverview(), tells the number of images found.

will be used in getPageList(), so use getOverview() first.




Tags:


Type:   int


[ Top ]

$offset =  0

[line 124]

offset for the paging functionality.

the querystring is used to pass this information along. example: 3 means offset 3x the full page.




Tags:

access:  public

Type:   int


[ Top ]

$overviewSettings = array(
    'tdWidth'   => 160, 
    'tdHeight'  => 160, 
    'tdColor'   => 'silver', 
    'cols'      => 3, 
    'rows'      => 5, 
  )

[line 174]

settings for the overview display.

currently these key/value pairs are used: 'tdWidth' => 160 'tdHeight' => 160 'tdColor' => 'silver' 'cols' => 3 'rows' => 5




Tags:

var:  (hash)
see:  var $thumbnailStyleString for more customization options.
access:  public

Type:   array


[ Top ]

$serverBasePath =

[line 98]

absolute server path to the image directory.

eg "/home/user/directory/".




Tags:

access:  public

Type:   string


[ Top ]

$sessionUser =

[line 241]

the user that is currently logged in, if any.

used to determine access rights.



Type:   string


[ Top ]

$thumbnailStyleString =

[line 206]

html string to define how a thumbnail will be spitted out.

if used then most keys of $this->overviewSettings will be ignored.

the following constants can be used: __IMAGE_NAME_BIG__ __UPLOAD_DATETIME__ __IMAGE_WIDTH_BIG__ __IMAGE_HEIGHT_BIG__ __IMAGE_TYPE_BIG__ __IMAGE_SIZE_READABLE_BIG__ __IMAGE_WEBPATH_BIG__ __IMAGE_WEBPATH_THUMB__ __IMAGE_WEBPATH_XXL__ __FULL_ALTTEXT__ __DESCRIPTION_HTML__ __DESCRIPTION_PLAIN__ __DESCRIPTION_JS__




Tags:

see:  var $overviewSettings
access:  public

Type:   string


[ Top ]

$thumbnailTableString =  '<table width="100%" border="0" cellspacing="0" cellpadding="0">'

[line 212]



Tags:

access:  public

Type:   string


[ Top ]

$thumbSettings = array(
    'prefix' => 'thumb_', 
    'width'  => 150, 
    'height' => 150, 
  )

[line 154]

settings for auto-generated thumbnails.

currently these key/value pairs are used: 'prefix' => 'thumb_' 'width' => 150 'height' => 150

set this var to bool FALSE if you don't want auto-generated thumbnails.




Tags:

var:  (hash or bool FALSE.)
access:  public

Type:   mixed


[ Top ]

$webBasePath =

[line 106]

relative or absolute web path to the base image directory.

eg "/directory/" or "directory/" or "http://domain.com/directory/".




Tags:

access:  public

Type:   string


[ Top ]



Class Methods


constructor Bs_ImageArchive [line 257]

Bs_ImageArchive Bs_ImageArchive( )

constructor



[ Top ]

method getBreadcrumbNav [line 579]

void getBreadcrumbNav( )



[ Top ]

method getDirectoryControl [line 452]

string getDirectoryControl( )

returns some html code to display a browsable directory tree.



Tags:

access:  public


[ Top ]

method getFileUploadForm [line 649]

string getFileUploadForm( [int $maxFileSize = 1000000], [int $numSimultanousFiles = 1])

returns the html form code to upload files (pictures).

the action in the form tag is PHP_SELF. of course method is post and enctype is 'multipart/form-data'.

the names of the file upload fields are bsiauserfile1, bsfauserfile2 etc. bs stands for blueshoes, fa for file archive. the number is a counter.




Tags:

access:  public


Parameters:

int   $maxFileSize   (default is 1 mb (1000000 bytes).)
int   $numSimultanousFiles   (default and recommended is 1.)

[ Top ]

method getOverview [line 308]

string getOverview( )

returns html code for the overview of a category (thumbnails).



Tags:

access:  public


[ Top ]

method getPageList [line 278]

string getPageList( [string $separator = ', '], [string $cssClass = NULL], [string $cssStyle = NULL])

returns the html code for the paging list.



Tags:

return:  (html code, empty string if not pageable.)
see:  var $numberOfImages
access:  public


Parameters:

string   $separator   (default is ', ', could be ' - ' for example.)
string   $cssClass  
string   $cssStyle  

[ Top ]

method treatUploadedFile [line 608]

? treatUploadedFile( ? 0)

treats uploaded files - if any.



Tags:

todo:  allow multiple file uploads at once as defined in getFileUploadForm().
access:  public


Parameters:

?   0  

[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:11:16 +0100 by phpDocumentor 1.2.3