Sorry for not commiting a patch, but my FCKeditor is currently not standard.
This is a simple fix to make the exclude function simpler and work better.
This allows exlude filters like */add/* or node/*_issue etc.

In my code this starts at line 494 to the end of the file.
I am including the original code - commented out.

//	$Number_of_excludes = count($paths_excluded_array)+1;
	// check each array item to see if it matches an excluded path
//	for($i=0; $i<$Number_of_excludes; $i++){
//		$paths_excluded_array[$i] = rtrim($paths_excluded_array[$i]);
		
#		// IF WILDCARD in excluded path
#		if(strpos( $paths_excluded_array[$i] , '*' )){
#			//remove /* frpm excluded_path
#			$excluded_path = substr($paths_excluded_array[$i], 0, -2);
#
#			// see if the page path contains the excluded path
#			if(substr_count ( $page_path, $excluded_path)){
#				$path_match = 0;
#				break;
#			}
#		//IF no wildcard check to see if Page path = excluded path
#		}else{
#			if($paths_excluded_array[$i] == $page_path){
#				$path_match = 0;
#				break;
#			}
#		}
// by regx - Wow, lets just use a regx instead!
foreach($paths_excluded_array as $expath){
	$expath = preg_replace('/[^a-zA-Z0-9*]/','\\/',$expath);
	$expath = preg_replace('/\*/','.*',$expath);
	//print "$expath<br/>"; # for debugging
	if (preg_match("/$expath/",$page_path)){
		$path_match = 0;
		break;
	}
}
	return($path_match);
}


Comments

ontwerpwerk’s picture

Status: Reviewed & tested by the community » Active

Okay, this patch will manage exclusion for certain paths - which will disable the FCKeditor on whole pages.

At the moment the FCKeditor module has a more finegrained control which tells it to exclude certain fields on a page (don't show FCKeditor on all fields with *mail* in the form id)

I have two questions first:

  • How will this extra function be included in the FCKeditor module?
  • Do we need another mechanism to turn FCKeditor off? (see also this discussion: http://drupal.org/node/81297 )
regx’s picture

When was this added?

The code I replaced only seemed to remove the editor if the path matched, and the wildcard did not work if it was in the middle or beginning of the path, but only at the end. If I am correct in this, then the code posted is more consice and does what I needed.

Finer grained control would be very nice, but most of the time I want to remove it for the whole page.

The code I commented out exluded the editor on the whole page correct?

regx’s picture

thinking about this a liitle more, it wouldn't be to hard to come up with a convention that would allow either case.
one method could be to look for / if it is there then assume a node path, otherwise assume a field name.

regx’s picture

Title: Wildcard exclude fix » Re: Wildcard exclude fix

Just wanted to add that I love this module - nice work!
FCK editor is the best editor in my opinion, so thanks for your work making this module.

ontwerpwerk’s picture

Title: Re: Wildcard exclude fix » Wildcard exclude fix

It was added a few weeks ago - along with the posssibility to have (two) different toolbars that are configurable for roles.

Adding slashes for a combined approach would greatly complicate the logic, so I'd like to wait and see what the 'RTE field controller' module (http://drupal.org/node/81297#comment-137803) will do with that - it will probably be the best place to build that kind of function.

Thanx for your praise, but it's not only for me, I just recently took over, so jtite, FredCK and others deserve a lot of credit too.

ontwerpwerk’s picture

Status: Active » Postponed

waiting for 'RTE field controller'

JoshLangner’s picture

This functionality is necessary. http://drupal.org/node/101664

Should work similarly to TinyMCE exclusion settings, although it's nice to have the per-field control.

ontwerpwerk’s picture

Assigned: Unassigned » ontwerpwerk

It's now number 3 on my list of things to do with FCKeditor

JoshLangner’s picture

I think I've come up with a quick & easy solution: http://drupal.org/node/101996

Code and concept still needs help, but the end result is we get more control than TinyMCE!

ontwerpwerk’s picture

Status: Postponed » Fixed

an option to filter by paths is in the current development release

Anonymous’s picture

Status: Fixed » Closed (fixed)