Addon helps to create galleries of photos.
This is build for PHP 5.3.* and based on Nette Framerwork.
It depends on Nette Framerwork, dibi, MultipleFileUploader and Visual Paginator is also required for paging. If you want to use your own implementation of paginator you have to change one line in code.
- Database layer can be replaced with
DataProvider
. - MultipleFileUploader is optional but recomanded.
-
Copy all files into folder with your project (libs dir).
-
Install all database tables into your database. If it is needed change
DataProvider
. Default database structure is in/DataProvider/mysql.sql
If you want to add custom columns just edit existing tables. -
For easier usage create services for model layer. Example:
parameters:
imageHelper:
baseUrl: http://example.com/
tempDir: files/temp
gallery:
basePath: %wwwDir%/files/gallery
services:
imageHelper:
class: \ImageHelper(@cache, %imageHelper.baseUrl%, %imageHelper.tempDir%)
galleryDataProvider:
class: \stekycz\gallery\DataProvider\Dibi(@database)
galleryItemModel:
class: \stekycz\gallery\models\Item(@galleryDataProvider, %gallery.basePath%)
galleryGroupModel:
class: \stekycz\gallery\models\Group(@galleryDataProvider, %gallery.basePath%)
- Use plugin and create controls:
new GroupControl($this, 'galleries',
$this->context->imageHelper,
$this->context->galleryGroupModel,
$this->context->galleryItemModel,
$this->context->galleryDataProvider->namespaces,
'Homepage:gallery'
);
new ItemControl($this, 'photos',
$this->context->imageHelper,
$this->context->galleryGroupModel,
$this->context->galleryItemModel,
$id
);
In example templates is used fancybox javascript library for photogalleries and Twitter Bootstrap. Templates should be changed/replaced for using in your own project.
The author of the addon is Martin Štekl.