public function FieldHolder($properties = array())
 {
     if (Config::inst()->get('MathSpamProtectorField', 'enabled')) {
         return parent::FieldHolder($properties);
     }
     return null;
 }
 function FieldHolder()
 {
     // TODO Replace with properly extensible view helper system
     $d = Object::create('DateField_View_JQuery', $this);
     $d->onBeforeRender();
     $html = parent::FieldHolder();
     $html = $d->onAfterRender($html);
     return $html;
 }
 public function FieldHolder($properties = array())
 {
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
     Requirements::javascript('latlongfield/javascript/jquery.locationpicker.js');
     Requirements::javascript('latlongfield/javascript/latlongfield.js');
     Requirements::css('latlongfield/css/latlongfield.css');
     return parent::FieldHolder($properties = array());
 }
 public function FieldHolder($properties = array())
 {
     // load requirements
     Requirements::css('international-phone-number-field/lib/intl-tel-input/build/css/intlTelInput.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.min.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
     Requirements::combine_files('InternationalPhoneNumberField.js', array('international-phone-number-field/lib/intl-tel-input/build/js/intlTelInput.min.js', 'international-phone-number-field/javascript/init.js'));
     // call parent
     $html = parent::FieldHolder();
     return $html;
 }
    function FieldHolder()
    {
        $holder = parent::FieldHolder();
        $id = $this->id();
        $holder .= <<<JS
\t\t\t<script type="text/javascript">
\t\t\t\tnew Ajax.Autocompleter( '{$id}', '{$id}_Options', '{$this->optionsURL}', { afterUpdateElement : function(el) { if(el.onajaxupdate) { el.onajaxupdate(); } } } );
\t\t\t</script>
JS;
        return $holder;
    }
 public function FieldHolder($properties = array())
 {
     // load requirements
     Requirements::css('international-phone-number-field/lib/intl-tel-input/build/css/intlTelInput.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.min.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
     Requirements::javascript('international-phone-number-field/lib/intl-tel-input/build/js/intlTelInput.min.js');
     $token = Config::inst()->get('InternationalPhoneNumberField', 'ipinfo_access_token');
     $tokenParameter = $token && strlen($token) > 0 ? '?token=' . $token : '';
     $protocol = $token && strlen($token) > 0 ? 'https' : 'http';
     Requirements::javascriptTemplate('international-phone-number-field/javascript/InternationalPhoneNumberField.js', array('TokenParameter' => $tokenParameter, 'Protocol' => $protocol));
     // call parent
     $html = parent::FieldHolder();
     return $html;
 }
예제 #7
0
 /**
  * FieldList::forTemplate() returns a concatenation of FieldHolder values.
  */
 public function testForTemplate()
 {
     $set = new FieldList($a = new TextField('A'), $b = new TextField('B'));
     $this->assertEquals($a->FieldHolder() . $b->FieldHolder(), $set->forTemplate());
 }
 /**
  * @param array $properties
  *
  * @return string
  */
 public function FieldHolder($properties = array())
 {
     Requirements::javascript('//www.addressfinder.co.nz/assets/v2/widget.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('addressfinder/javascript/addressfinder.js');
     $properties = array('ApiKey' => Config::inst()->get('AddressFinder', 'api_key'), 'ManualAddressFields' => $this->getManualFields(), 'AddressField' => $this->addressField->Field(), 'ManualToggleField' => $this->manualToggle);
     return parent::FieldHolder($properties);
 }
 /**
  *	Return field holder to the form
  **/
 public function FieldHolder($properties = array())
 {
     return parent::FieldHolder($properties);
 }
예제 #10
0
 public function FieldHolder($properties = array())
 {
     if ($this->getConfig('showcalendar')) {
         // TODO Replace with properly extensible view helper system
         $d = DateField_View_JQuery::create($this);
         if (!$d->regionalSettingsExist()) {
             $dateformat = $this->getConfig('dateformat');
             // if no localefile is present, the jQuery DatePicker
             // month- and daynames will default to English, so the date
             // will not pass Zend validatiobn. We provide a fallback
             if (preg_match('/(MMM+)|(EEE+)/', $dateformat)) {
                 $this->setConfig('dateformat', $this->getConfig('datavalueformat'));
             }
         }
         $d->onBeforeRender();
     }
     $html = parent::FieldHolder();
     if (!empty($d)) {
         $html = $d->onAfterRender($html);
     }
     return $html;
 }
 public function FieldHolder()
 {
     $html = "<div class=\"display_anything_field upload_anything_field\">";
     $id = $this->controller->{$this->name}()->getField('ID');
     $migrated_value = $this->controller->{$this->name}()->getField('Migrated');
     $migrator = FALSE;
     if ($this->detect_image_gallery_module && $migrated_value == 0) {
         //display only if we want to detect imagegallery albums and it's not already migrated
         $list = $this->ImageGalleryAlbums();
         if (!empty($list)) {
             $migrator = TRUE;
             $html .= "<div class=\"field_content migrate\">";
             $html .= "<fieldset><h5>Display Anything has detected an ImageGallery album associated with this page</h5>";
             $html .= "<p>Do you wish to migrate it to your new gallery?<p>";
             $html .= "<p>Migration notes:</p><ul>";
             $html .= "<li>The original ImageGallery album will remain untouched.</li>";
             $html .= "<li>Files will be copied alongside current files, this will allow you to remove the old gallery as and when required.</li>";
             $html .= "</ul>";
             $migrate = new DropDownField("{$this->name}[{$id}][MigrateImageGalleryAlbumID]", "Choose an album to migrate images from", $list, '', NULL, '[Do not migrate]');
             $html .= $migrate->FieldHolder();
             $html .= "</fieldset>";
             $html .= "</div>";
         }
     } else {
         if ($migrated_value == 1) {
             $migrator = TRUE;
         }
     }
     $html .= "<div class=\"field_content\">";
     $html .= "<fieldset><h5>Gallery settings and options</h5>";
     $title = new TextField("{$this->name}[{$id}][Title]", "Title", $this->controller->{$this->name}()->getField('Title'));
     $html .= $title->FieldHolder();
     $description = new TextareaField("{$this->name}[{$id}][Description]", "Description", 3, NULL, $this->controller->{$this->name}()->getField('Description'));
     $html .= $description->FieldHolder();
     $visible = new CheckboxField("{$this->name}[{$id}][Visible]", "Publicly Visible", $this->controller->{$this->name}()->getField('Visible') == 1 ? TRUE : FALSE);
     $html .= $visible->FieldHolder();
     if ($migrator && $migrated_value == 1) {
         //only need to show this post migration
         $migrated = new CheckboxField("{$this->name}[{$id}][Migrated]", "Image Gallery migration complete (uncheck and save to display migration options)", TRUE);
         $html .= $migrated->FieldHolder();
     }
     $html .= "</fieldset></div>";
     $html .= "<div class=\"field_content\">";
     $html .= "<fieldset><h5>Gallery Items</h5>";
     if (!empty($id)) {
         $html .= parent::FieldHolder();
     } else {
         $html .= "<div class=\"message\"><p>Gallery items can be uploaded after the gallery is saved for the first time</p></div>";
     }
     $html .= "</fieldset></div>";
     $html .= "</div>";
     return $html;
 }
예제 #12
0
 public function FieldHolder($properties = array())
 {
     // TODO Replace with properly extensible view helper system
     $d = DateField_View_JQuery::create($this);
     $d->onBeforeRender();
     $html = parent::FieldHolder();
     $html = $d->onAfterRender($html);
     return $html;
 }
예제 #13
0
 function SearchField()
 {
     $field = new TextField('MemberListSearch', _t('MemberList.SEARCH', 'Search'));
     return $field->FieldHolder();
 }