CustomHtmlForm\Forms\PtCaptchaImageField
A ptCaptcha field (uses the jax captcha class).
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class PtCaptchaImageField
extends TextField
{
- // members
- protected $captchaStr = NULL;
- protected $font;
- protected $formIdentifier;
- protected $height;
- protected $imagePath = NULL;
- protected $jpgQuality;
- protected $nrOfChars;
- protected $pic = NULL;
- protected $temp_dir;
- protected $width;
- // methods
- public void __construct()
- public string Field()
- public boolean validate()
- protected boolean generateImage()
- public boolean|string getPic()
- public string getCaptchaString()
- public string getImagePath()
- public string getFont()
- public void setFont()
- public string getFormIdentifier()
- public void setFormIdentifier()
- public int getHeight()
- public void setHeight()
- public int getJpgQuality()
- public void setJpgQuality()
- public int getNrOfChars()
- public void setNrOfChars()
- public string getTempDir()
- public void setTempDir()
- public int getWidth()
- public void setWidth()
Hierarchy
Extends
- SilverStripe\Forms\TextField
Members
protected
- $captchaStr
—
string
The captcha string - $font
—
int
Font of the captcha - $formIdentifier
—
string
Identifier - $height
—
int
height of the captcha - $imagePath
—
string
path to the image - $jpgQuality
—
int
Quality of the captcha - $nrOfChars
—
int
number of chars - $pic
—
string
Holds the pics value - $temp_dir
—
string
Temporary dir - $width
—
int
Width of the captcha
Methods
protected
- generateImage() — Generates Image file for captcha
public
- __construct() — Initializes the field.
- Field() — Creates the image and returns the image HTML tag as string.
- getCaptchaString() — Returns the captcha string
- getFont() — Returns the font to use
- getFormIdentifier() — Returns the form identifier
- getHeight() — Returns the height of the captcha image
- getImagePath() — Returns the path to the captcha image
- getJpgQuality() — Returns the JPEG quality
- getNrOfChars() — Returns the number of chars to use
- getPic() — Returns name of the new generated captcha image file
- getTempDir() — Returns the temporary dir
- getWidth() — Returns the width of the captcha image
- setFont() — Sets the font to use
- setFormIdentifier() — Sets the form identifier
- setHeight() — Sets the height of the captcha image
- setJpgQuality() — Sets the JPEG quality
- setNrOfChars() — Sets the number of chars to use
- setTempDir() — Sets the temporary dir
- setWidth() — Sets the width of the captcha image
- validate() — Validate by submitting to external service