CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • ckeditor config
Pages: 1 [2] 3 4

Author Topic: ckeditor config  (Read 88862 times)

Arjan

  • Guest
Re: ckeditor config
March 31, 2010, 02:46:22 pm
Quote
I think the best solution for Drupal/Civicrm would be to have Civicrm detect the editor used in Drupal and then use the same

This was done before in CiviCRM 2.x. There were patches to do this. See http://forum.civicrm.org/index.php/topic,6443.msg38902.html. I don't know about 3.x...

I posted some ideas here http://forum.civicrm.org/index.php/topic,12956.0.html. I think your case is more reason to consider detecting WYSIWYG installed in Drupal (my reason would be that I already have IMCE configured there).

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: ckeditor config
April 29, 2010, 04:41:12 pm
Got ckeditor + ckfinder working together.  Pretty big security gap on line 21 function CheckAuthentication() in file ckfinder/config.php

Read what it says there about needing authentication.

How would I expose CiviCRM's session user id into this PHP package file/scope?  Is there some other trick I could use with Drupal to tell if a person is logged in, some kind of quick hack in the session, cookie or something?  Anyone found a solution?

Tried these, and they don't work:
Code: [Select]
$checklogin =& CRM_Core_Session::singleton( );
  
global $user;
  if ($user->uid)
Try CiviTeacher: the online video tutorial CiviCRM learning library.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: ckeditor config
May 04, 2010, 12:56:24 pm
for anyone who doesn't want to spend the $60, you can do it like junglecoder says in http://forum.civicrm.org/index.php/topic,12091.msg54358.html#msg54358 using IMCE. The only issue is when you want to send the image back into the WYSIWYG popup, it instead opens in a blank window. For my org this is fine because they can then copy the URL of the image, close that window, and then just paste it into the path on the original image window and continue setting things like alignment, etc. but spending the $60 gets it working fully.

westy

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 1
  • CiviCRM version: CiviCRM 4.5.0
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.38
  • PHP version: Ubuntu Linux 12.04.3
Re: ckeditor config
June 20, 2010, 06:54:25 am
Has anybody got CKEditor and CKFinder working together in CiviMail as discussed in earlier posts?
I used junglecoders method of editing sites/all/modules/civicrm/packages/HTML/QuickForm/ckeditor.php and this at least got me as far as opening CKFinder from CKEditor.

Clicking the 'Image' button in CKEditor opens CKFinder but clicking 'Browse Server' opens a new 'Folders' window, as it should do, then  gives me the following information message
"The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file."

Now  I have tried configuring config.php in many ways, including in a similar way to the code I used that got the Drupal CKFinder working, but to no avail.

I have the two apps working together in the Drupal side of things but can't get them to work in CiviMail.
I am running in a drupal test environment and apart from CiviCRM the only modules are CKEdit and CKFinder and they work together very well in Drupal.
Is anybody able to tell me how they have configured config.php in CiviMail?
Please help or I'm back to putting postcards in envelopes and mailing them!  ::)

yung

  • Guest
Re: ckeditor config
June 21, 2010, 01:10:36 pm
As I understand it, not including image upload (as is commonly found in CK Editor) is a decision made by CIVICrm.  If not, please disregard the following statement:

Not including image upload in the CKEditor renders CIVICrm a third-world application.

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: ckeditor config
July 06, 2010, 04:54:15 am
@yung,

That's a harsh comment. @kurund and @stoob have already raised security concerns on this post about allowing browsing.

I too am frustrated by not being able to browse for images etc. Your post doesn't take us any closer to a solution

Ken

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: ckeditor config
July 06, 2010, 05:04:43 am
@stoob,

I don't have a copy of the ckfinder file you quote. Can you post Line 21 here?

Ken

sushil

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Art of Living
  • CiviCRM version: 3.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.2
Re: ckeditor config
July 21, 2010, 04:31:09 pm
I was able to integrate ckfinder with ckeditor but when I click on "Submit to Server" after I select the image I get the civicrm dashboard page inside the ckfinder popup as oppose to the "Image Info" tab inside the popup.
I use a paid version of ckfinder

Your help greatly appreciated

jtbayly

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 0
Re: ckeditor config
August 03, 2010, 03:31:18 pm
It might seem harsh, but I have to agree. Security keeps us from being able to easily insert images into an email? What?

In another discussion, people were trying to figure out why their clients were giving up on using CiviMail and going back to Constant Contact. They were looking for a list of ways to make CiviMail easier to use. This should certainly be on the list. I'd never have one of the organizations I work with try to use CiviMail without this basic type of functionality working.

(post I was referring to:http://forum.civicrm.org/index.php/topic,13232.msg63795.html)

-Joseph

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: ckeditor config
August 04, 2010, 06:48:49 pm

please consider looking into ckfinder+ckeditor and posting a recipe on how folks can embed images into the email

Contributions help an open source project improve and prosper :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: ckeditor config
August 04, 2010, 09:22:07 pm
In my Drupal environment, I'm using ckeditor + imce and the integration (almost) works. This is still a test environment, so it hasn't yet stood the fire of live users.

  • I use ckeditor is the WYSIWYG editor for Drupal (I'm using the ckeditor module rather than the wysiwyg module)
  • I use imce for loading/accessing files and images, and only give access to user-roles I trust
  • I use the better formats module and set it so people get "filtered html" by default, and people with user-roles I trust get "full html" by default
  • I make 2 changes to CiviCRM code so: CiviCRM uses the Drupal ckeditor rather than the bundled copy; and the Insert Link and Insert Image dialogs have a "browse server" button

This mostly works...

  • In the case where someone receives a CiviMail from us, then if the email contains a "forward" link, they can choose to forward it and make a comment using the HTML editor. The access controls allow the person to use the editor but prevent this person from browsing our file system, or submitting unfiltered HTML.
  • Staff can use ckeditor when writing a CiviMail, and it's identical in behaviour to the editor they use for creating articles or blog entries.
  • Staff can browse the file system when inserting images or links.

But there is one key problem, which includes a (heavily disguised) blessing...

  • When browsing for an image, you can't insert the image URL into the Insert Image dialog. imce can't seem to find ckeditor, so double-clicking on the image opens a new browser window. (This could be a Firefox issue, or perhaps someone could post a fix?)

The problem is, that one has to scrape the image URL from the browser and paste it into the Insert Image dialog. Tacky.

The blessing is that what imce normally gives you is a site-relative URL (/path/image.jpg) whereas what you need for emails is an absolute URL (http://site.org/path/image.jpg). Scraping the URL from the browser forces the user to enter an absolute URL. Whatever solution is worked out here MUST convert relative URLs to absolute URLs, otherwise recipients of emails won't see the images. (That is perhaps a wider issue for CiviMail, outside the scope of this post.)

Hope this helps,
Ken

My 2 changes are shown below (the code is v3.1.5, and my apologies for not including line numbers!)...

Change to civicrm/templates/CRM/common/drupal.tpl (apologies for hard-coding ckeditor location!)
Code: [Select]
-    <script type="text/javascript" src="{$config->resourceBase}packages/ckeditor/ckeditor.js"></script>
+    <script type="text/javascript" src="/sites/all/modules/ckeditor/ckeditor/ckeditor.js?I"></script>

Change to civicrm/packages/HTML/QuickForm/ckeditor.php (thanks to @junglecoder!)
Code: [Select]
-                    CKEDITOR.replace( '{$name}' );
+                    CKEDITOR.replace( '{$name}',
+                    {
+                       filebrowserBrowseUrl :      '/index.php?q=imce&app=ckeditor|sendto@ckeditor_fileUrl|',
+                       filebrowserImageBrowseUrl : '/index.php?q=imce&app=ckeditor|sendto@ckeditor_fileUrl|',
+                       filebrowserFlashBrowseUrl : '/index.php?q=imce&app=ckeditor|sendto@ckeditor_fileUrl|',
+                    } );

leonardwestermeyer

  • Guest
Re: ckeditor config
August 20, 2010, 06:20:50 am
Just thought you might like to know that I found a way to implement the "Send to CkEditor" function in IMCE.  I discovered that the function used to send the URL to CKEditor is missing in the ckeditor.js file, but is found in a helper file called ckeditor.utils.js .

You just have to add the utils library from Java just like you added the editor library to templates/CRM/common/drupal.tpl :

<script type="text/javascript" src="/sites/all/modules/ckeditor/includes/ckeditor.utils.js"></script>
<script type="text/javascript" src="/sites/all/modules/ckeditor/ckeditor/ckeditor.js?I"></script>

And BINGO, the "Send to CkEditor" starts functioning!

Oh, and also the configuration of IMCE in Drupal (admin/setting/imce - Common settings) permits you to specify "absolute" URL's, which solves the other problem you mention.

Let me know if it works for you!

Leonard Westermeyer
leonardwestermeyer@gmail.com
« Last Edit: August 20, 2010, 06:27:43 am by leonardwestermeyer »

arielqgold

  • I’m new here
  • *
  • Posts: 17
  • Karma: 1
  • CiviCRM version: 3.3.1, 3.3.5, 3.4.5
  • CMS version: Drupal 6.22
Re: ckeditor config
August 20, 2010, 11:46:27 am
lobo wrote:
You might want to consider buying a licensed version of CKFinder from CKSource. Open source projects like CKEditor, CiviCRM etc need revenue streams to survive and prosper
-----
After reading the whole thread up to today I'm not sure how to allow users to easily send CiviMail with images, though I will try to mess with some of the proposed solutions.

If CKfinder is an easy solution.... I see that there's a royalty-free OEM version for $1390. Rather than individually buying a $60 version maybe we should pool our funds? 

Something like: http://civicrm.org/blogs/lobo/support-canvassing-and-gotv-get-out-vote-functionality-civicrm ?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: ckeditor config
August 21, 2010, 12:47:05 am
This is our manual workaround for getting images in to civimail via IMCE in case it helps anyone

add this link as a Bookmark or to the sites Menu (eg under CiviCRM/Help) yoursite/imce.

To add an image, go to this link, open the images/civicmail folder in the left hand area

Then look for the UPLOAD link at top of page. This lets you find the file on your pc and UPLOAD it in to the images/civimail folder.

Once uploaded you should see the image in the lower right area.

Right click on this and COPY IMAGE LOCATION.

You can then use this in CiviMail, by clicking on the INSERT IMAGE icon in the wysiwyg, and pasting in the URL you just copied.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: ckeditor config
August 21, 2010, 04:15:27 am
Leonard,

You are the bomb!

Including ckeditor.utils.js does the trick (perhaps the core developers might consider whether ckeditor.utils.js should be generally included... perhaps there are other side effects?)

Unfortunately, I can't find the setting for IMCE to use "absolute" URLs. I'm using 6.x-2.0-beta3 - which version are you using?

Ken

Pages: 1 [2] 3 4
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • ckeditor config

This forum was archived on 2017-11-26.