/** * Set adapter specific data attributes. * * Special $data attributes: * - imageDir - Full path to captcha image storage directory * - imageDirUrl - URL-based path to captcha image storage directory * - output - Image format ("png", "jpg", "gif", "resource") * - width - Image width * - height - Image height * - phrase - Pre-defined captcha answer * - phraseOptions - Array of options for Text_Password * - imageOptions: array( * font_size * font_path * font_file * text_color * background_color * lines_color * antialias * ) * * @param string $name Element name * @param mixed $attributes Attributes (either a string or an array) * @param array $data Element data (special captcha settings) */ public function __construct($name = null, $attributes = null, $data = array()) { $this->data['captchaType'] = 'Image'; if (!isset($this->data['captchaHtmlAttributes']['class'])) { $this->data['captchaHtmlAttributes']['class'] = ''; } $this->data['captchaHtmlAttributes']['class'] .= ' qf2-captcha-image'; if (isset($data['imageDir'])) { $this->imageDir = self::fixPath($data['imageDir']); } if (isset($data['imageDirUrl'])) { $this->imageDirUrl = self::fixPath($data['imageDirUrl']); } if (!isset($data['output'])) { $data['output'] = 'png'; } $this->imageSuffix = '.' . $data['output']; parent::__construct($name, $attributes, $data); }