Last active
December 18, 2015 22:49
-
-
Save kinglozzer/5856871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private static $image_alignment_options = null; | |
//.... | |
new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')), | |
DropdownField::create( | |
'CSSClass', | |
_t('HtmlEditorField.CSSCLASS', 'Alignment / style'), | |
$this->getImageAlignmentOptions() | |
)->addExtraClass('last') | |
//.... | |
public function getImageAlignmentOptions() { | |
$options = Config::inst()->get('HtmlEditorField', 'image_alignment_options'); | |
if ($options) { | |
return $options; | |
} else { | |
return array( | |
'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'), | |
'center' => _t('HtmlEditorField.CSSCLASSCENTER', 'Centered, on its own.'), | |
'left' => _t('HtmlEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'), | |
'right' => _t('HtmlEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.') | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment