Quantcast
Viewing all articles
Browse latest Browse all 15

ckeditor + ckfinder how to install example.

1. download and unzip ckeditor.

2. download and unzip ckfinder.

your view page :

<textarea name="BodyText" id="editor1" ></textarea>

<script src="/Assets/scripts/ckeditor.js" type="text/javascript"></script>

<script type="text/javascript">
//<![CDATA[
 CKEDITOR.replace('editor1',
 {
 // Defines a simpler toolbar to be used in this sample.
 // Note that we have added out "MyButton" button here.
 //toolbar: [['Source', '-', 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Link', '-', 'MyButton']],
 enterMode: CKEDITOR.ENTER_BR,
 filebrowserImageBrowseUrl: '/Assets/ckfinder/ckfinder.html?type=Images',
 filebrowserImageUploadUrl: '/Assets/ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images',
 });

//]]>

}

 

in ckfinder’s config.ascx :

public override bool CheckAuthentication()
 {
 // WARNING : DO NOT simply return "true". By doing so, you are allowing
 // "anyone" to upload and list the files in your server. You must implement
 // some kind of session validation here. Even something very simple as...
 //
 // return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
 //
 // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
 // user logs on your system.

if (HttpContext.Current.User.Identity.Name.Equals("admin"))
 {
 return true;
 }

return false;
 }


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 15

Trending Articles