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

  • FileField
  • FileIFrameField
  • ImageField
  • MultiUploadField
  • SimpleImageField
  • SimpleImageField_Disabled
 1 <?php
 2 /**
 3  * A field that allows you to attach an image to a record from within a iframe - designed for use in AJAX forms where it
 4  * is not possible to use {@link SimpleImageField}.
 5  *
 6  * @package forms
 7  * @subpackage fields-files
 8  */
 9 class ImageField extends FileIFrameField {
10     
11     /**
12      * @return SimpleImageField_Disabled
13      */
14     public function performReadonlyTransformation() {
15         return new SimpleImageField_Disabled($this->name, $this->title, $this->value, $this->form);
16     }
17     
18     /**
19      * @return string
20      */
21     public function FileTypeName() {
22         return _t('ImageField.IMAGE', 'Image');
23     }
24     
25     /**
26      * Adds the filter, so the dropdown displays only images and folders.
27      *
28      * @return Form
29      */
30     public function EditFileForm() {
31         $filter = create_function('$item', 'return ($item->ClassName=="Folder" || $item->ClassName=="Image");');
32         
33         $form = parent::EditFileForm();
34         $form->dataFieldByName('ExistingFile')->setFilterFunction($filter);
35 
36         return $form;
37     }
38 }
[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