Quicktags per content type

peterpoe - January 11, 2008 - 17:10
Project:quicktags
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:tcblack
Status:patch (reviewed & tested by the community)
Description

I needed this, so I coded it. Adds quicktags toolbar visibility per content type to admin/settings/quicktags.

AttachmentSize
quicktags.content_types3 KB

#1

tcblack - January 11, 2008 - 17:43
Status:patch (code needs review)» patch (code needs work)

This is a great idea!
Please submit a proper patch per the handbook.

#2

jmai - January 28, 2008 - 21:39

This was a good mod. Since it hasn't been updated, I volunteered to do.

AttachmentSize
quicktags.diff2.34 KB

#3

jmai - January 29, 2008 - 19:48
Status:patch (code needs work)» patch (code needs review)

#4

tcblack - February 12, 2008 - 21:43

testing and functioning on 5.3

#5

jan krummrey - February 26, 2008 - 13:57
Status:patch (code needs review)» patch (reviewed & tested by the community)

Applied the patch and it worked here also, ready to commit?

Jan

#6

tcblack - February 26, 2008 - 18:55
Assigned to:Anonymous» tcblack

This is a very useful but also potentially problematic code bump, I'd like to try for just a bit more feedback before committing.

#7

nbz - March 2, 2008 - 23:43

Will this (continue to) work for other things such as the privatemsg textarea?

Not tested, but bbcode_wysiwyg has a similar thing, and that does not. (I am using Drupal 6.x so cannot test)

#8

alex-and-r - March 4, 2008 - 13:25

Tested this patch on D5.7 and it works quite well. No bugs so far. I got a drigg module installed with its special scoop content type and no problems there were with that.

#9

tcblack - March 4, 2008 - 15:13

NBZ,
I cannot answer that (#7) question. Can anyone test it and report back here please.

#10

nbz - March 8, 2008 - 20:25

I have just tested this and to answer my question, it does show for privatemsg (using the default "everywhere" option - otherwise no.). Seems good to me.

#11

blairski - June 10, 2008 - 13:45

I've tested the patch as well and have discovered a problem when adding a content type that consists of more then one word.

For example, if the content type if "example", then it works fine. However, if the content type is "example content" then it does not.

The problem is caused by the actual URL when adding the node. When adding a node, each word in the content type is seperated with a hyphen. Whereas, in the actual content type, each word is seperated with an underscore.

This caused $type = node_get_types('type', arg(2)); in the quicktags_show_quicktags() function to not work properly.

I have fixed with this a simple string replace. Therefore, the above becomes:
$arg2 = str_replace('-','_',arg(2));
$type = node_get_types('type', $arg2);

I have edited the patch and attached. Feel free to retest.

AttachmentSize
quicktags.diff2.46 KB

#12

vermario - June 12, 2008 - 16:32

Hi!

I've tried to apply the latest patch, and the patch command ended with an error:

vermario@vermario-desktop:~/quicktags$ patch -p0 < quicktags_1.diff
(Stripping trailing CRs from patch.)
patching file quicktags.module
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 87:

I'm really no expert about patches, but checking documentation the command seems correct... I hope it's not my fault!

#13

david.a.king - June 22, 2008 - 01:56

Using this patch, all the custom fields created with cck have their labels and descriptions replaced with their first letters.. - A: (was author) Q: (was quote) M: L: etc.

works other than that though!

edit: same for comments - changed to C:

edit2: i solved this by changing line 178,

return theme('form_element', $element['#title'], $html, $element['#description'], $element['#id'], $element['#required'], form_get_error($element));

back to

return theme('form_element', $element, $html);
(from the original module)

no idea what it did, or what implications it has, or what i should do next. sorry.

but it seems to work.

 
 

Drupal is a registered trademark of Dries Buytaert.