mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Removed un-used HtmlEditorField button generation code that has been replaced with HtmlEditorConfig.
From: Andrew Short <andrewjshort@gmail.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88470 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
75b875ae39
commit
fd7b322ed4
@ -279,82 +279,6 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
function Buttons() {
|
||||
return new DataObjectSet(
|
||||
new HtmlEditorField_button("Bold","bold",_t('HtmlEditorField.BUTTONBOLD', "Bold (Ctrl+B)")),
|
||||
new HtmlEditorField_button("Italic","italic",_t('HtmlEditorField.BUTTONITALIC', "Italic (Ctrl+I)")),
|
||||
new HtmlEditorField_button("Underline","underline", _t('HtmlEditorField.BUTTONUNDERLINE', "Underline (Ctrl+U)")),
|
||||
new HtmlEditorField_button("Strikethrough","strikethrough", _t('HtmlEditorField.BUTTONSTRIKE', "strikethrough")),
|
||||
new HtmlEditorField_separator(),
|
||||
new HtmlEditorField_button("JustifyLeft","justifyleft", _t('HtmlEditorField.BUTTONALIGNLEFT', "Align left")),
|
||||
new HtmlEditorField_button("JustifyCenter","justifycenter", _t('HtmlEditorField.BUTTONALIGNCENTER', "Align center")),
|
||||
new HtmlEditorField_button("JustifyRight","justifyright",_t('HtmlEditorField.BUTTONALIGNRIGHT',"Align right")),
|
||||
new HtmlEditorField_button("JustifyFull","justifyfull",_t('HtmlEditorField.BUTTONALIGNJUSTIFY',"Justify")),
|
||||
|
||||
/*new HtmlEditorField_dropdown("mceSetCSSClass", "styleSelect", array(
|
||||
"mceContentBody" => "mceContentBody",
|
||||
)),*/
|
||||
new HtmlEditorField_dropdown("FormatBlock", "formatSelect", array(
|
||||
"<p>" => _t('HtmlEditorField.FORMATP', "Paragraph", PR_MEDIUM, '<p> tag'),
|
||||
"<h1>" => _t('HtmlEditorField.FORMATH1', "Heading 1", PR_MEDIUM, '<h1> tag'),
|
||||
"<h2>" => _t('HtmlEditorField.FORMATH2', "Heading 2", PR_MEDIUM, '<h2> tag'),
|
||||
"<h3>" => _t('HtmlEditorField.FORMATH3', "Heading 3", PR_MEDIUM, '<h3> tag'),
|
||||
"<h4>" => _t('HtmlEditorField.FORMATH4', "Heading 4", PR_MEDIUM, '<h4> tag'),
|
||||
"<h5>" => _t('HtmlEditorField.FORMATH5', "Heading 5", PR_MEDIUM, '<h5> tag'),
|
||||
"<h6>" => _t('HtmlEditorField.FORMATH6', "Heading 6", PR_MEDIUM, '<h6> tag'),
|
||||
"<address>" => _t('HtmlEditorField.FORMATADDR', "Address", PR_MEDIUM, '<address> tag'),
|
||||
"<pre>" => _t('HtmlEditorField.FORMATPRE', "Preformatted", PR_MEDIUM, '<pre> tag'),
|
||||
)),
|
||||
new HtmlEditorField_separator(),
|
||||
new HtmlEditorField_button("InsertUnorderedList","bullist",_t('HtmlEditorField.BULLETLIST', "Bullet-point list")),
|
||||
new HtmlEditorField_button("InsertOrderedList","numlist",_t('HtmlEditorField.OL', "Numbered list")),
|
||||
new HtmlEditorField_button("Outdent","outdent",_t('HtmlEditorField.OUTDENT', "Decrease outdent")),
|
||||
new HtmlEditorField_button("Indent","indent",_t('HtmlEditorField.INDENT', "Increase indent")),
|
||||
new HtmlEditorField_button("inserthorizontalrule","hr",_t('HtmlEditorField.HR', "Insert horizontal line")),
|
||||
new HtmlEditorField_button("mceCharMap","charmap",_t('HtmlEditorField.CHARMAP', "Insert symbol")),
|
||||
|
||||
new HtmlEditorField_break(),
|
||||
|
||||
new HtmlEditorField_button("Undo","undo",_t('HtmlEditorField.UNDO', "Undo (Ctrl+Z)")),
|
||||
new HtmlEditorField_button("Redo","redo",_t('HtmlEditorField.REDO', "Redo (Ctrl+Y)")),
|
||||
new HtmlEditorField_separator(),
|
||||
new HtmlEditorField_button("Cut","cut",_t('HtmlEditorField.CUT', "Cut (Ctrl+X)")),
|
||||
new HtmlEditorField_button("Copy","copy",_t('HtmlEditorField.COPY', "Copy (Ctrl+C)")),
|
||||
new HtmlEditorField_button("Paste","paste",_t('HtmlEditorField.PASTE', "Paste (Ctrl+V)")),
|
||||
new HtmlEditorField_button("mcePasteText","paste:pastetext",_t('HtmlEditorField.PASTETEXT', "Paste plain text")),
|
||||
new HtmlEditorField_button("mcePasteWord","paste:pasteword",_t('HtmlEditorField.PASTEWORD', "Paste from Word")),
|
||||
new HtmlEditorField_button("mceSelectAll","paste:selectall",_t('HtmlEditorField.SELECTALL', "Select All (Ctrl+A)")),
|
||||
new HtmlEditorField_separator(),
|
||||
|
||||
new HtmlEditorField_button("ssImage","image",_t('HtmlEditorField.IMAGE', "Insert image")),
|
||||
new HtmlEditorField_button("ssFlash","flash:flash",_t('HtmlEditorField.FLASH', "Insert flash")),
|
||||
|
||||
new HtmlEditorField_button("ssLink","link",_t('HtmlEditorField.LINK', "Insert/edit link for highlighted text")),
|
||||
new HtmlEditorField_button("unlink","unlink",_t('HtmlEditorField.UNLINK', "Remove link")),
|
||||
new HtmlEditorField_button("mceInsertAnchor","anchor",_t('HtmlEditorField.ANCHOR', "Insert/edit anchor")),
|
||||
new HtmlEditorField_separator(),
|
||||
|
||||
new HtmlEditorField_button("mceCodeEditor","code",_t('HtmlEditorField.EDITCODE', "Edit HTML Code")),
|
||||
|
||||
// We don't need this because tinymce is good at auto-tidying
|
||||
// new HtmlEditorField_button("mceCleanup","cleanup","Clean up code"),
|
||||
|
||||
|
||||
new HtmlEditorField_button("mceToggleVisualAid","visualaid",_t('HtmlEditorField.VISUALAID', "Show/hide guidelines")),
|
||||
|
||||
new HtmlEditorField_separator(),
|
||||
|
||||
new HtmlEditorField_button("mceInsertTable","table:table",_t('HtmlEditorField.INSERTTABLE', "Insert table")),
|
||||
new HtmlEditorField_button("mceTableInsertRowBefore","table:table_insert_row_before",_t('HtmlEditorField.INSERTROWBEF', "Insert row before")),
|
||||
new HtmlEditorField_button("mceTableInsertRowAfter","table:table_insert_row_after",_t('HtmlEditorField.INSERTROWAFTER', "Insert row after")),
|
||||
new HtmlEditorField_button("mceTableDeleteRow","table:table_delete_row",_t('HtmlEditorField.DELETEROW', "Delete row")),
|
||||
new HtmlEditorField_button("mceTableInsertColBefore","table:table_insert_col_before",_t('HtmlEditorField.INSERTCOLBEF', "Insert column before")),
|
||||
new HtmlEditorField_button("mceTableInsertColAfter","table:table_insert_col_after",_t('HtmlEditorField.INSERTCOLAFTER', "Insert column after")),
|
||||
new HtmlEditorField_button("mceTableDeleteCol","table:table_delete_col",_t('HtmlEditorField.DELETECOL', "Delete column"))
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link Form} instance allowing a user to
|
||||
* add links in the TinyMCE content editor.
|
||||
@ -492,102 +416,3 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Base class for HTML editor toolbar buttons.
|
||||
* These controls are used when manually constructing a toolbar, as we do in the CMS.
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_control extends ViewableData {
|
||||
protected $command;
|
||||
|
||||
function Type() { return substr($this->class,strrpos($this->class,'_')+1); }
|
||||
function Command() { return $this->command; }
|
||||
|
||||
function MceRoot() {
|
||||
return MCE_ROOT;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Button on the HTML edityor toolbar.
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_button extends HtmlEditorField_control {
|
||||
function __construct($command, $icon, $title = null) {
|
||||
$this->title = $title ? $title : $command;
|
||||
$this->command = $command;
|
||||
$this->icon = $icon;
|
||||
parent::__construct();
|
||||
}
|
||||
function Command() {
|
||||
return $this->command;
|
||||
}
|
||||
function Icon() {
|
||||
if(strpos($this->icon,'/') !== false) {
|
||||
return $this->icon;
|
||||
|
||||
} else if(strpos($this->icon,':') !== false) {
|
||||
list($plugin,$icon) = explode(':', $this->icon, 2);
|
||||
return MCE_ROOT . 'plugins/' . $plugin . '/images/' . $icon . '.gif';
|
||||
|
||||
} else {
|
||||
return MCE_ROOT . 'themes/advanced/images/' . $this->icon . '.gif';
|
||||
}
|
||||
}
|
||||
function Title() {
|
||||
return $this->title;
|
||||
}
|
||||
function IDSegment() {
|
||||
return $this->icon;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Separator on the HTML edityor toolbar.
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_separator extends HtmlEditorField_control {
|
||||
}
|
||||
|
||||
/**
|
||||
* Dropdown field on the HTML editor toolbar.
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_dropdown extends HtmlEditorField_control {
|
||||
protected $options, $idSegment;
|
||||
|
||||
function __construct($command, $idSegment, $options) {
|
||||
$this->command = $command;
|
||||
$this->options = $options;
|
||||
$this->idSegment = $idSegment;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function Options() {
|
||||
$options = '';
|
||||
foreach($this->options as $k => $v) {
|
||||
$k = Convert::raw2att($k);
|
||||
$v = Convert::raw2xml($v);
|
||||
$options .= "<option value=\"$k\">$v</option>\n";
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
function IDSegment() {
|
||||
return $this->idSegment;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Line break on the HTML editor toolbar.
|
||||
* @package forms
|
||||
* @subpackage fields-formattedinput
|
||||
*/
|
||||
class HtmlEditorField_break extends HtmlEditorField_control {
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user