HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How to Add Cleditor to all forms

vrijvlindervrijvlinder Papillon-Sauvage MVP
edited August 2013 in Tutorials

If you want to add cleditor to other forms like the activity form and comments just add the controller you wish cleditor to be added to

In the cleditor default.php find this part and add the Activity controller like I did below. That will send cleditor to the activity form of your profile page. This will also allow you to send images etc using the form.

And to make it available in the comments as well uncomment public function PostController_Render_Before($Sender) { like I did below.

$PluginInfo['cleditor'] = array(
   'Name' => 'WYSIWYG (CLEditor)',
   'Description' => 'Adds a WYSIWYG editor to your forum so that your users can enter rich text comments.',
   'Version' => '1.2.7',
   'Author' => "Mirabilia Media",
   'AuthorEmail' => '',
   'AuthorUrl' => '',
   'RequiredApplications' => array('Vanilla' => '>=2'),
   'RequiredTheme' => FALSE, 
   'RequiredPlugins' => FALSE,
   'HasLocale' => FALSE,
   'RegisterPermissions' => FALSE,
   'SettingsUrl' => FALSE,
   'SettingsPermission' => FALSE,
   'MobileFriendly' =>TRUE
);

class cleditorPlugin extends Gdn_Plugin {

    public function PostController_Render_Before($Sender) {
        $this->_AddCLEditor($Sender);
    }
    
//  public function DiscussionController_Render_Before($Sender) {
//      $this->_AddCLEditor($Sender);
//  }
   
   
public function ActivityController_Render_Before($Sender) {
        $this->_AddCLEditor($Sender);
    }


Comments

Sign In or Register to comment.