GalleryManager
extends GalleryLibrary
in package
Gallery
Class to manage the gallery of the CMS
Tags
Table of Contents
Properties
- $_objTpl : mixed
- $arrSettings : mixed
- $importWebPath : mixed
- $intLangId : mixed
- $strErrMessage : mixed
- $strImagePath : mixed
- $strImageWebPath : mixed
- $strImportPath : mixed
- $strOkMessage : mixed
- $strPageTitle : mixed
- $strThumbnailPath : mixed
- $strThumbnailWebPath : mixed
- $allowedImageExtensions : array<string|int, mixed>
- $allowedImageLabels : array<string|int, mixed>
- $allowedImageTypes : array<string|int, mixed>
- $sql : mixed
- $act : mixed
Methods
- __construct() : mixed
- Constructor -> Create the menu and copy the template
- _getSize() : int
- Get filesize
- _getType() : string
- Get filetype
- activateCategory() : mixed
- Activates or inactivates a category
- activatePicture() : mixed
- Activate / Inactivate a picture
- changeCategoryOfPicture() : mixed
- Changes the Category of an Image
- checkImages() : mixed
- Checks if the file is still there, removes dead links
- createImages_JPG_GIF_PNG() : mixed
- Create an Image
- deleteCategory() : mixed
- Delete a Category
- deleteComment() : mixed
- Delete a comment of a picture
- deleteImage() : mixed
- Deletes an Image from the database
- deleteImportPicture() : mixed
- Delete selected pictures
- deleteVote() : mixed
- Delete a voting of a picture
- editCategory() : mixed
- Shows the "Edit-Category"-Form
- fileExists() : mixed
- getCategoryNameByLang() : bool|array<string|int, mixed>
- Get the Category Name by Language
- getPage() : mixed
- Determine the page to display and call the appropriate methods
- getSettings() : mixed
- Gets the gallery settings
- importFromFolder() : mixed
- Import selected pictures from folder
- insertCategory() : mixed
- Inserts a new category into the database
- insertImage() : mixed
- Insert image into the database
- movePicture() : mixed
- Move pictures from gallery_import to gallery
- newCategory() : mixed
- Shows the 'Insert new category'-Form
- reloadAllValidate() : mixed
- Reload the validation page / Validated a picture / delete a picture
- reloadSingleValidate() : mixed
- Reload the validation page / Validated a picture / delete a picture
- resetPicture() : mixed
- Reset the picture and move it back to the validation part
- rotatePicture() : mixed
- Rotates an image clockwise by 90�
- saveCategorySorting() : mixed
- Saves the category sorting
- saveImagesSorting() : mixed
- Saves the image sorting
- saveSettings() : mixed
- Save the settings for the gallery
- setCategoryImage() : mixed
- Define an images as "category-image". This image will be shown in the category-selection.
- showEditComment() : mixed
- Edit a comment of a picture
- showEditPicture() : mixed
- Shows the edit-form for a picture
- showSettings() : mixed
- Shows the settings-page
- showSubCategories() : bool
- Show the Sub Categories
- showValidateForm() : mixed
- Shows the validation-page
- updateCategory() : mixed
- Updates an category in the database
- updateComment() : mixed
- Save all changes done to a comment
- updatePicture() : mixed
- Updates the name of a picture
- uploadFinished() : mixed
- Upload the submitted images
- importPicture() : void
- import Pictures (requires chmod 777 in folder gallery_import)
- overview() : void
- Shows the overview of the gallery
- parseCategoryDropdown() : bool
- Parse a category dropdown recursively.
- parseUploader() : void
- Parses the uploader into the current template
- setNavigation() : void
- showCategoryDetails() : void
- Shows the category-details-page
- checkAccess() : int
- Check access
- checkCategoryAccess() : bool
- Check the access to the category with the given ID
- getGroupLists() : array<string|int, mixed>
- Returns an array of strings containing dropdown menu options with existing (but not assigned) and assigned access groups for the category with the given ID.
Properties
$_objTpl
public
mixed
$_objTpl
$arrSettings
public
mixed
$arrSettings
= array()
$importWebPath
public
mixed
$importWebPath
$intLangId
public
mixed
$intLangId
$strErrMessage
public
mixed
$strErrMessage
= ''
$strImagePath
public
mixed
$strImagePath
$strImageWebPath
public
mixed
$strImageWebPath
$strImportPath
public
mixed
$strImportPath
$strOkMessage
public
mixed
$strOkMessage
= ''
$strPageTitle
public
mixed
$strPageTitle
$strThumbnailPath
public
mixed
$strThumbnailPath
$strThumbnailWebPath
public
mixed
$strThumbnailWebPath
$allowedImageExtensions
protected
static array<string|int, mixed>
$allowedImageExtensions
= array('gif', 'jpg', 'jpeg', 'png', 'webp')
List of file endings to allow
$allowedImageLabels
protected
array<string|int, mixed>
$allowedImageLabels
= array('GIF', 'JPG', 'PNG', 'WEBP')
List of filetypes to show to the user
$allowedImageTypes
protected
array<string|int, mixed>
$allowedImageTypes
= array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_WEBP)
List of IMAGETYPE_... constants
$sql
protected
mixed
$sql
$act
private
mixed
$act
= ''
Methods
__construct()
Constructor -> Create the menu and copy the template
public
__construct() : mixed
Tags
_getSize()
Get filesize
public
_getSize(string $strFile) : int
Parameters
- $strFile : string
Return values
int —$intSize: Size of the file
_getType()
Get filetype
public
_getType(string $strFile) : string
Parameters
- $strFile : string
Return values
string —$strType: Type of the file
activateCategory()
Activates or inactivates a category
public
activateCategory(int $intCategoryId[, mixed $act = NULL ]) : mixed
Parameters
- $intCategoryId : int
- $act : mixed = NULL
Tags
activatePicture()
Activate / Inactivate a picture
public
activatePicture(int $intImageId[, mixed $act = NULL ]) : mixed
Parameters
- $intImageId : int
- $act : mixed = NULL
Tags
changeCategoryOfPicture()
Changes the Category of an Image
public
changeCategoryOfPicture(int $intImageId, int $intNewCatId) : mixed
Parameters
- $intImageId : int
- $intNewCatId : int
Tags
checkImages()
Checks if the file is still there, removes dead links
public
checkImages() : mixed
Tags
createImages_JPG_GIF_PNG()
Create an Image
public
createImages_JPG_GIF_PNG(string $strPathOld, string $strPathNew, string $strFileOld, string $strFileNew, int $intNewWidth, int $intNewHeight, int $intQuality[, bool $update = false ]) : mixed
Parameters
- $strPathOld : string
-
: The old path of the image
- $strPathNew : string
-
: The new path for the created image
- $strFileOld : string
-
: The name of the old file
- $strFileNew : string
-
: The name of the new file
- $intNewWidth : int
-
: Width of the new image
- $intNewHeight : int
-
: Height of the new image
- $intQuality : int
-
: Quality of the new image
- $update : bool = false
-
Whether to regenerate existing thumbnails
deleteCategory()
Delete a Category
public
deleteCategory(int $intCategoryId) : mixed
Parameters
- $intCategoryId : int
Tags
deleteComment()
Delete a comment of a picture
public
deleteComment(int $intComId) : mixed
Parameters
- $intComId : int
-
: The id of the comment which should be deleted
Tags
deleteImage()
Deletes an Image from the database
public
deleteImage(int $intImageId) : mixed
Parameters
- $intImageId : int
-
: Id of the image which should be delted
Tags
deleteImportPicture()
Delete selected pictures
public
deleteImportPicture() : mixed
deleteVote()
Delete a voting of a picture
public
deleteVote(mixed $intVoteId) : mixed
Parameters
- $intVoteId : mixed
Tags
editCategory()
Shows the "Edit-Category"-Form
public
editCategory(int $intCategoryId) : mixed
Parameters
- $intCategoryId : int
Tags
fileExists()
public
static fileExists(mixed $fileName[, mixed $caseSensitive = true ]) : mixed
Parameters
- $fileName : mixed
- $caseSensitive : mixed = true
getCategoryNameByLang()
Get the Category Name by Language
public
getCategoryNameByLang() : bool|array<string|int, mixed>
Tags
Return values
bool|array<string|int, mixed>getPage()
Determine the page to display and call the appropriate methods
public
getPage() : mixed
Tags
getSettings()
Gets the gallery settings
public
getSettings() : mixed
Tags
importFromFolder()
Import selected pictures from folder
public
importFromFolder() : mixed
insertCategory()
Inserts a new category into the database
public
insertCategory() : mixed
Tags
insertImage()
Insert image into the database
public
static insertImage(GalleryManager $objGallery, string $strImagePath, int $imageName[, string $uploadPath = '' ]) : mixed
Parameters
- $objGallery : GalleryManager
-
Instance of static::class
- $strImagePath : string
- $imageName : int
- $uploadPath : string = ''
-
Set to path where the image has been uploaded to.
Tags
movePicture()
Move pictures from gallery_import to gallery
public
movePicture(string $strFile) : mixed
Parameters
- $strFile : string
newCategory()
Shows the 'Insert new category'-Form
public
newCategory() : mixed
Tags
reloadAllValidate()
Reload the validation page / Validated a picture / delete a picture
public
reloadAllValidate() : mixed
Tags
reloadSingleValidate()
Reload the validation page / Validated a picture / delete a picture
public
reloadSingleValidate() : mixed
Tags
resetPicture()
Reset the picture and move it back to the validation part
public
resetPicture(int $intImageId) : mixed
Parameters
- $intImageId : int
Tags
rotatePicture()
Rotates an image clockwise by 90�
public
rotatePicture(mixed $intImageId) : mixed
Parameters
- $intImageId : mixed
Tags
saveCategorySorting()
Saves the category sorting
public
saveCategorySorting() : mixed
Tags
saveImagesSorting()
Saves the image sorting
public
saveImagesSorting() : mixed
Tags
saveSettings()
Save the settings for the gallery
public
saveSettings() : mixed
Tags
setCategoryImage()
Define an images as "category-image". This image will be shown in the category-selection.
public
setCategoryImage(int $intImgId) : mixed
Parameters
- $intImgId : int
Tags
showEditComment()
Edit a comment of a picture
public
showEditComment(int $intCommentId) : mixed
Parameters
- $intCommentId : int
-
: The comment with this id will be shown in the form
Tags
showEditPicture()
Shows the edit-form for a picture
public
showEditPicture() : mixed
Tags
showSettings()
Shows the settings-page
public
showSettings() : mixed
Tags
showSubCategories()
Show the Sub Categories
public
showSubCategories(int $parentId, array<string|int, mixed> $arrCategoryName, array<string|int, mixed> $arrImageCount, array<string|int, mixed> $arrImageSize, string $subCategorySpace) : bool
Parameters
- $parentId : int
- $arrCategoryName : array<string|int, mixed>
- $arrImageCount : array<string|int, mixed>
- $arrImageSize : array<string|int, mixed>
- $subCategorySpace : string
Tags
Return values
boolshowValidateForm()
Shows the validation-page
public
showValidateForm() : mixed
Tags
updateCategory()
Updates an category in the database
public
updateCategory(mixed $categoryId) : mixed
Parameters
- $categoryId : mixed
Tags
updateComment()
Save all changes done to a comment
public
updateComment() : mixed
Tags
updatePicture()
Updates the name of a picture
public
updatePicture() : mixed
Tags
uploadFinished()
Upload the submitted images
public
static uploadFinished(string $tempPath, mixed $tempWebPath, array<string|int, mixed> $paths, int $uploadId, mixed $fileInfos, mixed $response) : mixed
Parameters
- $tempPath : string
- $tempWebPath : mixed
- $paths : array<string|int, mixed>
- $uploadId : int
- $fileInfos : mixed
- $response : mixed
Tags
importPicture()
import Pictures (requires chmod 777 in folder gallery_import)
protected
importPicture() : void
Tags
overview()
Shows the overview of the gallery
protected
overview() : void
Tags
parseCategoryDropdown()
Parse a category dropdown recursively.
protected
parseCategoryDropdown([int $selected = -1 ][, bool $disabled = false ][, string $name = "showCategories" ][, int $parent_id = 0 ][, int $level = 0 ][, bool $parseSubCategories = true ][, mixed $skipIds = [] ]) : bool
This method generates HTML for a category dropdown menu, iterating through categories and optionally subcategories, applying selected and disabled states. If you want no category to be selected, pass -1 for the $selected parameter.
Parameters
- $selected : int = -1
-
The ID of the category to be selected. Pass -1 for no selection.
- $disabled : bool = false
-
Whether to disable the dropdown. Defaults to false.
- $name : string = "showCategories"
-
The template block name to be used for parsing. Defaults to "showCategories".
- $parent_id : int = 0
-
The ID of the parent category to start parsing from. Defaults to 0.
- $level : int = 0
-
The current nesting level for indentation purposes. Defaults to 0.
- $parseSubCategories : bool = true
-
Whether to recursively parse subcategories. Defaults to true.
- $skipIds : mixed = []
Return values
bool —True if at least one category has been parsed beside the selected one; otherwise, false.
parseUploader()
Parses the uploader into the current template
protected
parseUploader() : void
Tags
setNavigation()
protected
setNavigation() : void
showCategoryDetails()
Shows the category-details-page
protected
showCategoryDetails(mixed $intCatId) : void
Parameters
- $intCatId : mixed
Tags
checkAccess()
Check access
private
checkAccess(int $access_id) : int
Parameters
- $access_id : int
Return values
intcheckCategoryAccess()
Check the access to the category with the given ID
private
checkCategoryAccess(int $id) : bool
Parameters
- $id : int
Return values
boolgetGroupLists()
Returns an array of strings containing dropdown menu options with existing (but not assigned) and assigned access groups for the category with the given ID.
private
getGroupLists(int $id[, string $type = "frontend" ]) : array<string|int, mixed>
Parameters
- $id : int
- $type : string = "frontend"