public function FieldHolder($attributes = array())
    {
        Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
        Requirements::css("registration/css/affiliations.css");
        Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
        Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
        $js_scripts = array("themes/openstack/javascript/pure.min.js", "themes/openstack/javascript/jquery.serialize.js", "themes/openstack/javascript/jquery.cleanform.js", "themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js", "themes/openstack/javascript/jquery.validate.custom.methods.js", 'registration/javascript/affiliations.js');
        foreach ($js_scripts as $js) {
            Requirements::javascript($js);
        }
        $arrayData = new ArrayData(array('Title' => 'Edit Affiliation'));
        $modal = $arrayData->renderWith('AffiliationModalForm');
        $modal = trim(preg_replace('/\\s\\s+/', ' ', $modal));
        $script = <<<JS

        (function( \$ ){

            \$(document).ready(function() {
                \$('{$modal}').appendTo(\$('body'));
                \$("#edit-affiliation-form").affiliations({
                    storage:'{$this->mode}'
                });
            });


        }( jQuery ));
JS;
        Requirements::customScript($script);
        return parent::FieldHolder($attributes);
    }
 public function FieldHolder($properties = array())
 {
     Requirements::css(LINKABLE_PATH . '/css/embeddedobjectfield.css');
     Requirements::javascript(LINKABLE_PATH . '/javascript/embeddedobjectfield.js');
     if ($this->object && $this->object->ID) {
         $properties['SourceURL'] = TextField::create($this->getName() . '[sourceurl]', '')->setAttribute('placeholder', _t('Linkable.SOURCEURL', 'Source URL'));
         if (strlen($this->object->SourceURL)) {
             $properties['ObjectTitle'] = TextField::create($this->getName() . '[title]', _t('Linkable.TITLE', 'Title'));
             $properties['Width'] = TextField::create($this->getName() . '[width]', _t('Linkable.WIDTH', 'Width'));
             $properties['Height'] = TextField::create($this->getName() . '[height]', _t('Linkable.HEIGHT', 'Height'));
             $properties['ThumbURL'] = HiddenField::create($this->getName() . '[thumburl]', '');
             $properties['Type'] = HiddenField::create($this->getName() . '[type]', '');
             $properties['EmbedHTML'] = HiddenField::create($this->getName() . '[embedhtml]', '');
             $properties['ObjectDescription'] = TextAreaField::create($this->getName() . '[description]', _t('Linkable.DESCRIPTION', 'Description'));
             $properties['ExtraClass'] = TextField::create($this->getName() . '[extraclass]', _t('Linkable.CSSCLASS', 'CSS class'));
             foreach ($properties as $key => $field) {
                 if ($key == 'ObjectTitle') {
                     $key = 'Title';
                 } elseif ($key == 'ObjectDescription') {
                     $key = 'Description';
                 }
                 $field->setValue($this->object->{$key});
             }
             if ($this->object->ThumbURL) {
                 $properties['ThumbImage'] = LiteralField::create($this->getName(), '<img src="' . $this->object->ThumbURL . '" />');
             }
         }
     } else {
         $properties['SourceURL'] = TextField::create($this->getName() . '[sourceurl]', '')->setAttribute('placeholder', _t('Linkable.SOURCEURL', 'Source URL'));
     }
     $field = parent::FieldHolder($properties);
     return $field;
 }
Example #3
0
 function FieldHolder()
 {
     $config = array('datetimeorder' => $this->getConfig('datetimeorder'));
     $config = array_filter($config);
     $this->addExtraClass(Convert::raw2json($config));
     return parent::FieldHolder();
 }
 public function FieldHolder($properties = array())
 {
     $config = array('datetimeorder' => $this->getConfig('datetimeorder'));
     $config = array_filter($config);
     $this->addExtraClass('fieldgroup');
     $this->addExtraClass(Convert::raw2json($config));
     return parent::FieldHolder($properties);
 }
 public function FieldHolder($attributes = array())
 {
     //$tags_json = json_encode($this->Category->AllowedTags()->column('Tag'));
     $tag_array = array();
     foreach ($this->Category->AllowedTags() as $tag) {
         if (!isset($tag_array[$tag->Group])) {
             $tag_array[$tag->Group] = array();
         }
         $tag_array[$tag->Group][] = $tag->Tag;
     }
     $tags_json = json_encode($tag_array);
     Requirements::customScript("var category_tags = {$tags_json};");
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::set_write_js_to_body(false);
     return parent::FieldHolder($attributes);
 }
	/**
	 * Checkboxes use the RightLabelledFieldHolder template, to put the field on the left
	 * and the label on the right.  See {@link FormField::FieldHolder} for more information about
	 * how FieldHolder works. 
	 */
	function FieldHolder() {
		if($this->labelLeft) {
			return parent::FieldHolder();
		} else {
			extract($this->getXMLValues(array( 'Name', 'Field', 'Title', 'Message', 'MessageType' )));
			$messageBlock = isset($Message) ? "<span class=\"message $MessageType\">$Message</span>" : '';
			$Type = $this->XML_val('Type');
			return <<<HTML
<p id="$Name" class="field $Type">
	$Field
	<label class="right" for="{$this->id()}">$Title</label>
	$messageBlock
</p>
HTML;
			
		}
	}
Example #7
0
    /**
     * Checkboxes use the RightLabelledFieldHolder template, to put the field on the left
     * and the label on the right.  See {@link FormField::FieldHolder} for more information about
     * how FieldHolder works. 
     */
    function FieldHolder()
    {
        if ($this->labelLeft) {
            return parent::FieldHolder();
        } else {
            extract($this->getXMLValues(array('Name', 'Field', 'Title', 'Message', 'MessageType')), EXTR_SKIP);
            $messageBlock = isset($Message) ? "<span class=\"message {$MessageType}\">{$Message}</span>" : '';
            $Type = $this->XML_val('Type');
            return <<<HTML
<p id="{$Name}" class="field {$Type}">
\t{$Field}
\t<label class="right" for="{$this->id()}">{$Title}</label>
\t{$messageBlock}
</p>
HTML;
        }
    }
 /**
  * Generates the normal field holder for the field
  * @param {array} $properties Properties to add to the field holder
  * @return {string}
  */
 public function FieldHolder($properties = null)
 {
     if (!empty($this->_link) && !empty($this->_label)) {
         return parent::FieldHolder($properties);
     }
 }
Example #9
0
 /**
  * @return string
  */
 public function Field($properties = array())
 {
     Requirements::javascript(project() . '/javascript/WTLinkField.js');
     return "<div class=\"fieldgroup\">" . "<div class=\"fieldgroupField\">" . $this->fieldType->FieldHolder() . "</div>" . "<div class=\"fieldgroupField\">" . $this->fieldLink->FieldHolder() . "</div>" . "</div>";
 }
Example #10
0
 function FieldHolder()
 {
     return FormField::FieldHolder();
 }
 function FieldHolder($properties = array())
 {
     return FormField::FieldHolder($properties);
 }
 public function FieldHolder($properties = array())
 {
     Requirements::css(GSC_DIR . "/css/gridselectionfield.css");
     return parent::FieldHolder($properties);
 }
Example #13
0
 public function FieldHolder($attributes = array())
 {
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::javascript("summit/javascript/forms/tagmanagerfield/tagmanagerfield.bundle.js");
     return parent::FieldHolder($attributes);
 }
 public function FieldHolder($properties = array())
 {
     $this->prepareForRender();
     $this->addExtraClass($this->Type() . '_holder');
     return parent::FieldHolder($properties);
 }