Inheritance diagram for BaseImage:
A class that simplifies loading, editing, deleting, resizing, and saving of an image linked to a mysql database.
Definition at line 12 of file base-image.inc.php.
Public Member Functions | |
__construct ($data=null, $table= 'images', $dataDir=null, $webDir=null, $origDir=null) | |
Our constructor. | |
load ($data, $deep=true) | |
load data, set paths too | |
getPagesXml () | |
adds pages to the module, included are bulkconfig, bulkform, bulkpost and resize. | |
init ($page= 'main', $vars=array()) | |
This initializes the module... | |
delete () | |
This deletes our files and passes it off to our parent for database. | |
deleteFiles () | |
this deletes all our files and directory structures | |
setPaths () | |
this function sets our paths in our ImageSize objects | |
getSize ($search) | |
this will search for an ImageSize that has path info and such | |
editFormAddFields ($form) | |
this adds fields to the edit form. | |
editPagePostSaveSync ($form) | |
this handles the sync part... | |
editPagePostSuccess ($form, $url) | |
this handles resizing the images and such. | |
prepFile () | |
this prepares a file for resizing and such. | |
resizeUploadedFile () | |
this resizes the uploaded file. | |
getResizeCommands () | |
get the commands to do the resizing. | |
resize () | |
this does the real resizing of the image to each ImageSize | |
resizeToSize ($size) | |
this resizes an image to a particular size | |
centerCrop ($size) | |
this crops an image to a square, centered on the image. | |
cleanName ($name) | |
this cleans a name passed into it so its safe. | |
drawViewPage () | |
draws our view page! | |
drawViewNav () | |
draws navigation for our view page | |
drawSizes () | |
draws a list of sizes bigger than 'web' | |
url ($type="thumb") | |
gets the url to an image size. | |
getImage ($type="thumb", $link=true, $drawCaption=true) | |
gets the html markup for the image. | |
drawImage ($type="thumb", $link=true, $drawCaption=true) | |
draws teh markup for the image. | |
drawRow () | |
Draws teh thumbnail of the image in a div with id 'imageCell'. | |
initBulkConfigPage () | |
inializes the bulk config page... | |
drawBulkConfigPage () | |
draws teh bulk configuration page. | |
initBulkFormPage () | |
inits the bulk form page. | |
drawBulkFormPage () | |
draws our bulk form page. | |
drawBulkFormSelect () | |
Draws teh select form for what album to upload to... | |
drawBulkApplet ($contentId) | |
draws teh markup for the bulk applet. | |
initBulkPostPage () | |
inits the bulk post pages and authenticates. | |
drawBulkPostPage () | |
handles the bulk post... | |
drawBulkSuccessText ($contentId) | |
draws the bulk post success | |
moveUploadedFile ($tmp) | |
moves our uploaded file to a safe location | |
initResizePage () | |
initializes the resize page... | |
drawResizePage () | |
calls teh resize functions. | |
getRssItem () | |
gets the rss for the image. | |
getPublicData () | |
gets public data for serialized formats. | |
getCreateFieldsArray () | |
get an array of fields in the table that stores the images | |
getCreateIndexesArray () | |
get an array of indexes on fields in the images table | |
Static Public Member Functions | |
isImage ($path) | |
determines whether something is a real image (gif, jpg, png... | |
Public Attributes | |
$doResize = true | |
protected $doResize tells us whether we want to resize or print out the commands. | |
Protected Attributes | |
$sizeAr = array() | |
protected $sizeAr is an array of ImageSize objects that it uses for various things including resizing. | |
$fullPath = '' | |
protected $fullPath is the system path where the image is stored... | |
$origPath = '' | |
protected $origPath is the system path where the original image is stored... | |
Static Protected Attributes | |
$dataDir = '' | |
protected $dataDir is the system path where to store resized images. | |
$origDir = '' | |
protected $origDir is the system path where to store original images. | |
$webDir = '' | |
protected $webDir is the path via the web where the datadir is located. |
|
Our constructor.
Definition at line 58 of file base-image.inc.php. References $dataDir, $origDir, $webDir, Config::get(), and Config::set(). |
|
this crops an image to a square, centered on the image.
Definition at line 420 of file base-image.inc.php. References Util::shellExec(). Referenced by resizeToSize(). |
|
this cleans a name passed into it so its safe. underscores to dashes, spaces to dashes, any non alphanumeric, dash, or dot gets removed.
Definition at line 449 of file base-image.inc.php. Referenced by prepFile(). |
|
This deletes our files and passes it off to our parent for database.
Reimplemented from BaseObject. Definition at line 162 of file base-image.inc.php. References deleteFiles(). |
|
this deletes all our files and directory structures
Definition at line 172 of file base-image.inc.php. Referenced by delete(), and editPagePostSaveSync(). |
|
draws teh markup for the bulk applet.
Definition at line 862 of file base-image.inc.php. References Config::get(). Referenced by drawBulkFormPage(). |
|
draws teh bulk configuration page. see the url for options. needs to pass teh session and stuff since the java module doesnt have your cookies and shit.
Definition at line 620 of file base-image.inc.php. References BaseModule::getUrl(), and BaseModule::params(). |
|
draws our bulk form page. links to download java, upload single images, and the bulk applet
Definition at line 788 of file base-image.inc.php. References drawBulkApplet(), drawBulkFormSelect(), BaseModule::getLink(), and BaseModule::params(). |
|
Draws teh select form for what album to upload to...
Definition at line 827 of file base-image.inc.php. References BaseModule::getLink(), and BaseModule::getUrl(). Referenced by drawBulkFormPage(). |
|
handles the bulk post... spawns resize processes, etc.
Definition at line 917 of file base-image.inc.php. References drawBulkSuccessText(), and BaseModule::params(). |
|
draws the bulk post success
Definition at line 976 of file base-image.inc.php. Referenced by drawBulkPostPage(). |
|
draws teh markup for the image. see getImage() for parameter descriptions. Definition at line 580 of file base-image.inc.php. References getImage(). Referenced by drawRow(), and drawViewPage(). |
|
calls teh resize functions. remember: called async. Definition at line 1027 of file base-image.inc.php. References resize(). |
|
Draws teh thumbnail of the image in a div with id 'imageCell'.
Reimplemented from BaseObject. Definition at line 588 of file base-image.inc.php. References drawImage(), and getSize(). |
|
draws a list of sizes bigger than 'web'
Definition at line 495 of file base-image.inc.php. References getSize(). Referenced by drawViewPage(). |
|
draws navigation for our view page
Definition at line 483 of file base-image.inc.php. References BaseObject::canDelete(), and BaseObject::canEdit(). Referenced by drawViewPage(). |
|
draws our view page!
Definition at line 464 of file base-image.inc.php. References BaseObject::canDelete(), BaseObject::canEdit(), drawImage(), drawSizes(), and drawViewNav(). |
|
this adds fields to the edit form.
Reimplemented from BaseObject. Definition at line 253 of file base-image.inc.php. |
|
this handles the sync part... if we didnt get a file, remove the upload field to prevent erasing. Reimplemented from BaseObject. Definition at line 271 of file base-image.inc.php. References deleteFiles(). |
|
this handles resizing the images and such.
Definition at line 294 of file base-image.inc.php. References BaseModule::getUrl(), prepFile(), Util::redirect(), resizeUploadedFile(), and url(). |
|
get an array of fields in the table that stores the images
Reimplemented from BaseObject. Definition at line 1077 of file base-image.inc.php. |
|
get an array of indexes on fields in the images table
Reimplemented from BaseObject. Definition at line 1098 of file base-image.inc.php. |
|
gets the html markup for the image.
Definition at line 547 of file base-image.inc.php. References $sizeAr, getSize(), and BaseModule::getUrl(). Referenced by drawImage(), getPublicData(), and getRssItem(). |
|
adds pages to the module, included are bulkconfig, bulkform, bulkpost and resize.
Reimplemented from BaseObject. Definition at line 123 of file base-image.inc.php. |
|
gets public data for serialized formats. see BaseObject for more info. Reimplemented from BaseObject. Definition at line 1053 of file base-image.inc.php. References getImage(), BaseObject::hasField(), and url(). |
|
get the commands to do the resizing. this is intended for use when you are upgrading and need to do bulk resizing via shell scripts, etc.
Definition at line 360 of file base-image.inc.php. References resize(). |
|
gets the rss for the image. you shouldnt have to define getRssItem() for your image... automatic image rss feeds!!
Reimplemented from BaseObject. Definition at line 1040 of file base-image.inc.php. References getImage(). |
|
this will search for an ImageSize that has path info and such
Definition at line 240 of file base-image.inc.php. Referenced by drawRow(), drawSizes(), getImage(), and url(). |
|
This initializes the module... and sets the paths.
Reimplemented from BaseModule. Definition at line 151 of file base-image.inc.php. References setPaths(). |
|
inializes the bulk config page...
Definition at line 599 of file base-image.inc.php. References BaseModule::assertLogin(), BaseModule::params(), and BaseModule::setTemplate(). |
|
inits the bulk form page.
Definition at line 776 of file base-image.inc.php. References BaseModule::assertLogin(). |
|
inits the bulk post pages and authenticates.
Definition at line 894 of file base-image.inc.php. References BaseModule::params(), and BaseModule::setTemplate(). |
|
initializes the resize page... intended to be called async Definition at line 1013 of file base-image.inc.php. References BaseModule::params(), and BaseModule::setTemplate(). |
|
determines whether something is a real image (gif, jpg, png... no bmps here bitch).
Definition at line 989 of file base-image.inc.php. |
|
load data, set paths too
Reimplemented from BaseObject. Definition at line 104 of file base-image.inc.php. References Config::get(), and setPaths(). |
|
moves our uploaded file to a safe location
Definition at line 1005 of file base-image.inc.php. |
|
this prepares a file for resizing and such. cleans the name, creates directories. Definition at line 318 of file base-image.inc.php. References cleanName(), BaseObject::save(), and setPaths(). Referenced by editPagePostSuccess(). |
|
this does the real resizing of the image to each ImageSize
Definition at line 370 of file base-image.inc.php. References resizeToSize(), BaseObject::save(), and setPaths(). Referenced by drawResizePage(), and getResizeCommands(). |
|
this resizes an image to a particular size
Definition at line 400 of file base-image.inc.php. References centerCrop(), and Img::resize(). Referenced by resize(). |
|
this resizes the uploaded file. to make it faster for the end user, it actually spawns an async http request. woot! Definition at line 346 of file base-image.inc.php. References Util::spawnHttpAsync(). Referenced by editPagePostSuccess(). |
|
this function sets our paths in our ImageSize objects
Definition at line 192 of file base-image.inc.php. Referenced by init(), load(), prepFile(), and resize(). |
|
gets the url to an image size.
Definition at line 530 of file base-image.inc.php. References getSize(). Referenced by editPagePostSuccess(), and getPublicData(). |
|
protected $dataDir is the system path where to store resized images.
Definition at line 17 of file base-image.inc.php. Referenced by __construct(). |
|
protected $doResize tells us whether we want to resize or print out the commands.
Definition at line 47 of file base-image.inc.php. |
|
protected $fullPath is the system path where the image is stored... auto generated. Definition at line 37 of file base-image.inc.php. |
|
protected $origDir is the system path where to store original images.
Definition at line 22 of file base-image.inc.php. Referenced by __construct(). |
|
protected $origPath is the system path where the original image is stored... auto generated. Definition at line 42 of file base-image.inc.php. |
|
protected $sizeAr is an array of ImageSize objects that it uses for various things including resizing.
Definition at line 32 of file base-image.inc.php. Referenced by getImage(). |
|
protected $webDir is the path via the web where the datadir is located.
Definition at line 27 of file base-image.inc.php. Referenced by __construct(). |