ePages 6.17.43 - DE_EPAGES/Design/API/Style.pm

Package package

This package provides functions to work with Styles.

Package DE_EPAGES::Design::API::Style

@EXPORT_OK
AddStyle
ExistsStyle
Style
AddStyleLogo
DeleteStyleLogo
InvalidateAllShopStyles
ValidateAndCompareToDefaultButtonValues
DeleteTemporaryStyles
ValidateButtonValues
ProcessStyleTransformation

Functions

AddStyle
AddStyleLogo
DeleteStyleLogo
DeleteTemporaryStyles
ExistsStyle
InvalidateAllShopStyles
IsSubStyle
ProcessStyleTransformation
Style
ValidateAndCompareToDefaultButtonValues
ValidateButtonValues

AddStyle

Adds a Style to the shops style list.

Syntax
$WantedStyle = AddStyle($Shop, $StyleTemplate);
Input
$Shop (object)
shop object
$StyleTemplate (object)
style template
Return
$WantedStyle (object)
created style object

AddStyleLogo

Sets the logo for a style.

Syntax
AddStyleLogo($Style, $ShopLogo, $Extension);
Input
$Style (object)
style object
$ShopLogo (string)
public path for shoplogo
$Extension (string)
image extension

DeleteStyleLogo

Sets the logo for a style.

Syntax
DeleteStyleLogo($Style);
Input
$Style (object)
style object

DeleteTemporaryStyles

Deletes all style from shop with attribute IsTemplate=1 except the default one. The flag for the default one will be corrected. Cause for programming is that the shopwizard could be chanceled (e.g. close browser) and all the temporary style resist.

Syntax
DeleteTemporaryStyles($Shop);
Input
$Shop (object)
shop object

ExistsStyle

Returns true if the style with the given style template exists in this shop.

Syntax
$Exists = ExistsStyle($Shop, $StyleTemplate);
Input
$Shop (object)
shop object
$StyleTemplate (object)
style template
Return
$Exists (boolean)
true if style exists

InvalidateAllShopStyles

Invalidates all styles of a given shop.

Syntax
InvalidateAllShopStyles($Shop);
Input
$Shop (object)
shop object

IsSubStyle

If StyleName contains the string "SubStyles/" return is 1

Syntax
my $IsSubStyle = IsSubStyle($StyleName);
Input
$StyleName (string)
name of the style
Return
$IsSubStyle (boolean)
Style is Sub Style, 0 or 1

ProcessStyleTransformation

Processes a new style transformation.

Syntax
ProcessStyleTransformation($Form, $Style);
Input
$Form (object)
Servlet form object
$Style (object)
style object
Return
$hResult (hash.ref)
hash with transformation results

Style

Returns style of this shop with the StyleName.

Syntax
$Style = Style($Shop, $StyleName);
Input
$Shop (object)
shop object
$StyleTemplate (object)
style template
Return
$Style (object)
style

ValidateAndCompareToDefaultButtonValues

Validates attributes of customizable buttons (basket button, other buttons) and checks if the values are different to the default button style settings.

Syntax
ValidateAndCompareToDefaultButtonValues($hCustomizableBasketButton, $hVALIDATION);
Input
$Form (object)
Servlet form objevt
$hButtonValues (hash.ref)
hash with values to validate e.g.
  • Gradient colors
  • Font (color, size)
  • Padding (width, height)
  • Border (color radius)
allowed hashes:
Design/API/Constants.pm CUSTOMIZABLE_BUTTONS,
$hDefaultValues (optional) (hash.ref)
hash with default values (Style DefaultButtonStyle)
$hVALIDATION (hash.ref)
hash with validation information
(type, max, min, attribute and key names) e.g.
Design/API/Constants.pm CUSTOMIZABLE_BUTTONS,
Return
$hNewButtonValues (hash.ref)
hash with the new validated button values

ValidateButtonValues

Validates attributes of customizable buttons (basket button, other buttons)

Syntax
ValidateButtonValues($hCustomizableBasketButton, $hVALIDATION);
Input
$Form (object)
Servlet form objevt
$hButtonValues (hash.ref)
hash with values to validate e.g.
  • Gradient colors
  • Font (color, size)
  • Padding (width, height)
  • Border (color radius)
allowed hashes:
Design/API/Constants.pm CUSTOMIZABLE_BUTTONS,
$hVALIDATION (hash.ref)
hash with validation information
(type, max, min, attribute and key names) e.g.
Design/API/Constants.pm CUSTOMIZABLE_BUTTONS,
Return
$hNewButtonValues (hash.ref)
hash with the new validated button values