Created
June 24, 2013 08:20
-
-
Save kinglozzer/5848538 to your computer and use it in GitHub Desktop.
'No alignment' option for images. Only tested on 3.0, though I imagine it would work on 3.1 fine. Apply with Object::add_extension('HtmlEditorField_Toolbar', 'HtmlEditorField_ToolbarExtension');
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 | |
/** | |
* Add 'no alignment' option when inserting images through 'Insert Media' form | |
*/ | |
class HtmlEditorField_ToolbarExtension extends Extension { | |
public function updateFieldsForImage(&$fields, $url, $file) { | |
$className = $fields->fieldByName('CSSClass'); | |
$classes = $className->getSource(); | |
$classes = array_merge(array('' => _t('HtmlEditorField.CSSCLASSNONE', 'No alignment.')), $classes); | |
$className->setSource($classes); | |
return $fields; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment