Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Advanced Editor Button Positioning

Is there any way to move the smiley/URL/file buttons before the B/I/S buttons on the Advanced Editor?

Tagged:

Comments

  • you can reorder things in the array

    class.editor.plugin.php around line 106.

      public function getAllowedEditorActions() {
            static $allowedEditorActions = array(
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @PFAFF said:
    Is there any way to move the smiley/URL/file buttons before the B/I/S buttons on the Advanced Editor?

    e.g.

      public function getAllowedEditorActions() {
            static $allowedEditorActions = array(
              'emoji' => true,
             'links' => true,
             'images' => true,
             'uploads' => false,
             'sep-media' => true, // separator
    
             'bold' => true,
             'italic' => true,
             'strike' => true,
             'orderedlist' => true,
             'unorderedlist' => true,
             'indent' => false,
             'outdent' => false,
    
             'sep-format' => true, // separator
             'color' => false,
             'highlightcolor' => false, // Dependent on color. TODO add multidim support.
             'format' => true,
             'fontfamily' => false,
    
    
             'sep-align' => true, // separator
             'alignleft' => true,
             'aligncenter' => true,
             'alignright' => true,
    
             'sep-switches' => true, // separator
             'togglehtml' => true,
             'fullpage' => true,
             'lights' => true
            );
    
            return $allowedEditorActions;
        }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    You could hook in via a plugin too:

    public function editorPlugin_toolbarConfig_handler($sender) {
        $actions =& $sender->EventArguments['actions'];
        unset($actions['emoji']);
        $sender->EventArguments['actions'] = array('emoji' => true) + $actions;
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited November 2015

    creating a new plugin hook would certainly mitigate losses during core upgrades instead of modifying core plugin.

    Ideally, a drag and drop for it in the settings built into the plugin itself.
    with checkboxes whether to include in mobile.

    I guess you can do the same for colors, format and fonts since there places to hook into the plugin.

        $this->EventArguments['actions'] =& $allowedEditorActions;
        $this->EventArguments['colors'] =& $fontColorList;
        $this->EventArguments['format'] =& $fontFormatOptions;
        $this->EventArguments['font'] =& $fontFamilyOptions;
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • This worked brilliantly. Thanks!

Sign In or Register to comment.