/** * Returns the JPG quality setting for the rendering of the captcha image. * * @return int * * @author Sascha Koehler <*****@*****.**> * @since 2012-12-10 */ public static function SpamCheck_jpgQuality() { if (is_null(self::$SpamCheck_jpgQuality)) { self::$SpamCheck_jpgQuality = self::getConfig()->SpamCheck_jpgQuality; if (empty(self::$SpamCheck_jpgQuality)) { self::$SpamCheck_jpgQuality = 90; } } return self::$SpamCheck_jpgQuality; }
/** * Initializes the field. * * @param string $name Name of the field * @param string $title Title of the field * @param mixed $value Value of the field * @param int $maxLength Max input length * @param Form $form Form to relate field with * * @author Sascha Koehler <*****@*****.**>, * Sebastian Diel <*****@*****.**> * @since 12.02.2013 */ public function __construct($name, $title = null, $value = null, $maxLength = null, $form = null) { parent::__construct($name, $title, $value, $maxLength, $form); $this->setTempDir(ASSETS_PATH . '/pt-captcha'); $this->setWidth(CustomHtmlFormConfiguration::SpamCheck_width()); $this->setHeight(CustomHtmlFormConfiguration::SpamCheck_height()); $this->setJpgQuality(CustomHtmlFormConfiguration::SpamCheck_jpgQuality()); $this->setNrOfChars(CustomHtmlFormConfiguration::SpamCheck_numberOfCharsInCaptcha()); $this->setFont(Director::baseFolder() . '/customhtmlform/fonts/Aller_Rg.ttf'); $this->setFormIdentifier($form->getName() . $this->getName()); }