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

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • 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

  • AjaxUniqueTextField
  • AutocompleteTextField
  • ConfirmedPasswordField
  • CreditCardField
  • CurrencyField
  • CurrencyField_Disabled
  • CurrencyField_Readonly
  • EmailField
  • HtmlEditorConfig
  • HtmlEditorField
  • HtmlEditorField_Readonly
  • HtmlEditorField_Toolbar
  • NumericField
  • PasswordField
  • PhoneNumberField
  • UniqueRestrictedTextField
  • UniqueTextField
 1 <?php
 2 /**
 3  * Text field that automatically checks that the value entered is unique for the given
 4  * set of fields in a given set of tables
 5  * @deprecated 2.3
 6  * @package forms
 7  * @subpackage fields-formattedinput
 8  */
 9 class UniqueTextField extends TextField {
10     
11     protected $restrictedField;
12     protected $restrictedTable;
13     protected $restrictedMessage;
14     
15     function __construct($name, $restrictedField, $restrictedTable, $restrictedMessage, $title = null, $value = "", $maxLength = null ){
16         parent::__construct($name, $title, $value, $maxLength); 
17         
18         $this->restrictedField = $restrictedField;
19         
20         $this->restrictedTable = $restrictedTable;
21         $this->restrictedMessage = $restrictedMessage;
22     }
23      
24     function Field() {
25         Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
26         Requirements::javascript(SAPPHIRE_DIR . "/javascript/UniqueFields.js");
27         
28         $attributes = array(
29             'type' => 'text',
30             'class' => 'text ' . $this->class . ($this->extraClass() ? $this->extraClass() : ''),
31             'id' => $this->id(),
32             'name' => $this->Name(),
33             'value' => $this->attrValue(),
34             'tabindex' => $this->getTabIndex(),
35             'maxlength' => ($this->maxLength) ? $this->maxLength : null,
36             'size' => ($this->maxLength) ? min( $this->maxLength, 60 ) : 30
37         );
38         
39         if($this->disabled) $attributes['disabled'] = 'disabled';
40         
41         return 
42             $this->createTag('input', $attributes) 
43             . '<input type="hidden" name="restricted-messages['.$this->id().']" id="'.$this->id().'-restricted-message" value="'.$this->restrictedMessage.'" />'
44         ;
45     }
46 }
47 ?>
[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.1 API Docs API documentation generated by ApiGen 2.8.0