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

  • CheckboxField
  • CheckboxField_Disabled
  • CheckboxField_Readonly
  • CheckboxSetField
  • DropdownField
  • GroupedDropdownField
  • ListboxField
  • LookupField
  • Monument_PolishingTextField
  • NullableField
  • OptionsetField
  • ReadonlyField
  • RoomServiceDropdownField
  • SimpleHTMLEditorField
  • SimpleTinyMCEField
  • SimpleWysiwygField
  • SocleSize_SocleSectionTextField
  • StateDropdownField
  • StateProvinceDropdownField
  • TextareaField
  • TextField
 1 <?php
 2 
 3 class SimpleWysiwygField extends TextareaField
 4 {
 5 
 6     private static $default_configuration = array();
 7     private $configuration = array();
 8     
 9     function __construct($name, $title = null, $config = array(), $rows = 15, $cols = 55, $value = "", $form = null) 
10     {
11         parent::__construct($name, $title, $rows, $cols, $value, $form);
12         
13   }
14   
15   public static function set_default_configuration($conf)
16   {
17     self::$default_configuration = $conf;
18   }
19   
20   public function configure($conf)
21   {
22     $this->configuration = $conf;
23   }
24   
25   private function getConfiguration()
26   {
27     return !empty($this->configuration) ? $this->configuration : self::$default_configuration;
28   }
29   
30   private function buildJS()
31   {
32     $js = "
33       $(function() {
34                 $('#{$this->id()}').htmlbox().idir('dataobject_manager/code/simple_wysiwyg_field/images/')";
35     foreach($this->getConfiguration() as $row => $buttons) {
36       $r = $row+1;
37       $r = $r == 1 ? "" : ",$r";
38       foreach($buttons as $button)
39         $js .= $button == "|" ? ".separator('dots'$r)" : ".button('$button'$r)";
40     }
41     $js .= "
42       .init();
43     });";
44     return $js;
45   }
46   
47   
48   function Field()
49   {
50     Requirements::javascript(THIRDPARTY_DIR."/jquery/jquery.js");
51     Requirements::javascript("dataobject_manager/code/simple_wysiwyg_field/javascript/htmlbox.min.js");
52     Requirements::javascript("dataobject_manager/code/simple_wysiwyg_field/javascript/xhtml.js");
53     Requirements::customScript($this->buildJS());
54     return parent::Field();
55   }
56 
57 }
58 
59 
60 
61 
[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