Webylon 3.2 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • 1c
    • exchange
      • catalog
  • auth
  • Booking
  • building
    • company
  • cart
    • shipping
    • steppedcheckout
  • Catalog
    • monument
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • EditableSpamProtectionField
  • SpamProtectorField
  • SpamProtectorManager

Interfaces

  • SpamProtector
 1 <?php
 2 
 3 /**
 4  * Editable Spam Protecter Field. Used with the User Defined Forms module (if 
 5  * installed) to allow the user to have captcha fields with their custom forms
 6  * 
 7  * @package spamprotection
 8  */
 9 
10 class EditableSpamProtectionField extends EditableFormField {
11     
12     static $singular_name = 'Spam Protection Field';
13     
14     static $plural_name = 'Spam Protection Fields';
15 
16     function onBeforeWrite() {
17         parent::onBeforeWrite();
18         $this->Required = 0;
19     }
20 
21     public function getFieldConfiguration() {
22         $options = parent::getFieldConfiguration();
23         $options->removeByName("Fields[$this->ID][CustomSettings][Placeholder]");
24         return $options;
25     }
26     
27     public function getFieldValidationOptions() {
28         return false;
29     }
30     
31     function getFormField() {
32         if($protector = SpamProtectorManager::get_spam_protector()) {
33             if($protector) {
34                 $protector = new $protector();
35                 return $protector->getFormField($this->Name, $this->Title, null);
36             }
37         }
38         return false;
39     }
40 
41     public function Icon() {
42         return 'spamprotection/images/' . strtolower($this->class) . '.png';
43     }
44     
45     function showInReports() {
46         return false;
47     }
48 }
49 
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.2 API Docs API documentation generated by ApiGen 2.8.0