Horde – Allow Advanced HTML Source Editing

These are the steps I took to allow advanced HTML source editing when creating emails in Horde.

This refers to the Horde email/webmail platform. This will add the missing “Source” button into the menu of the Horde WYSIWYG email editor. That will let your view the source and edit the HTML directly.

  1. Log in to server as root:
    ssh root@server_ip_address_here
  2. Take the section I need to override from the prefs.php file. Don’t edit that file, just copy out what I need to modify. So, look in the file:
    vi /usr/local/cpanel/base/horde/imp/config/prefs.php

    Copy out this section:

    // The list of buttons to show in CKeditor
    // See http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar for
    // details on configuration
    $_prefs['ckeditor_buttons'] = array(
        'value' => "[['Bold','Italic','Underline'],['Font','FontSize'],['TextColor','BGColor'],['Cut','Copy','Paste'],['Undo','Redo'],['Link','Unlink'],['Image','Table','Smiley','SpecialChar']]",
        // Very basic set of buttons:
        // 'value' => "['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink']",
        // More advanced set of buttons (default for IMP < 6.2):
        // 'value' => "[['Source','Maximize','-','Templates'],['Cut','Copy','Paste'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],'/',['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],'/',['Styles','Format','Font','FontSize'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['TextColor','BGColor']]",
    );
    
  3. In my copy, disable the first “value” entry and enable the last value entry so it would look like this:
    <?php
    $_prefs['ckeditor_buttons'] = array(
        // 'value' => "[['Bold','Italic','Underline'],['Font','FontSize'],['TextColor','BGColor'],['Cut','Copy','Paste'],['Undo','Redo'],['Link','Unlink'],['Image','Table','Smiley','SpecialChar']]",
        // Very basic set of buttons:
        // 'value' => "['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink']",
        // More advanced set of buttons (default for IMP < 6.2):
        'value' => "[['Source','Maximize','-','Templates'],['Cut','Copy','Paste'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],'/',['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],'/',['Styles','Format','Font','FontSize'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['TextColor','BGColor']]",
    );
    ?>
    

    …or simply this:

    <?php
    $_prefs['ckeditor_buttons'] = array(
        // More advanced set of buttons (default for IMP < 6.2):
        'value' => "[['Source','Maximize','-','Templates'],['Cut','Copy','Paste'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],'/',['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],'/',['Styles','Format','Font','FontSize'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['TextColor','BGColor']]",
    );
    ?>
    
  4. Paste my modified copy into the file prefs.local.php (create the file if it doesn’t exist):
    vi /usr/local/cpanel/base/horde/imp/config/prefs.local.php

    Remember the PHP open and close tags.

  5. Save the prefs.local.php file and exit.

See more:

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]