allow modules to disable tinyMCE on specific forms.

patch webform to remove tinyMCE on textareas where it doesn't make sense.
This commit is contained in:
espie 2008-02-17 14:34:14 +00:00
parent 89a492b3cc
commit 658f69f8eb
7 changed files with 52 additions and 6 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/02/16 16:46:59 espie Exp $
# $OpenBSD: Makefile,v 1.2 2008/02/17 14:34:14 espie Exp $
COMMENT = tinymce for drupal
DISTNAME = tinymce-5.x-1.9
PKGNAME = drupal5-tinymce-1.9
PKGNAME = drupal5-tinymce-1.9p0
DISTFILES = ${DISTNAME}.tar.gz \
tinymce_2_1_3.zip:0 tinymce_compressor_php_2_0.zip:0

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-tinymce_module,v 1.1 2008/02/17 14:34:14 espie Exp $
--- tinymce.module.orig Sun Feb 17 15:11:23 2008
+++ tinymce.module Sun Feb 17 15:12:53 2008
@@ -78,6 +78,9 @@ function tinymce_process_textarea($element) {
global $user;
static $profile_name;
+ if (isset($element['#noMCE']) && $element['#noMCE']) {
+ return $element;
+ }
//$element is an array of attributes for the textarea but there is no just 'name' value, so we extract this from the #id field
$textarea_name = substr($element['#id'], strpos($element['#id'], '-') + 1);

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2008/02/16 16:46:59 espie Exp $
@comment $OpenBSD: PLIST,v 1.2 2008/02/17 14:34:14 espie Exp $
@owner www
@group www
${DRUPAL_MODS}/tinymce/
@ -54,6 +54,7 @@ ${DRUPAL_MODS}/tinymce/tinymce/
${DRUPAL_MODS}/tinymce/tinymce.info
${DRUPAL_MODS}/tinymce/tinymce.install
${DRUPAL_MODS}/tinymce/tinymce.module
@comment ${DRUPAL_MODS}/tinymce/tinymce.module.orig
${DRUPAL_MODS}/tinymce/tinymce/jscripts/
${DRUPAL_MODS}/tinymce/tinymce/jscripts/tiny_mce/
${DRUPAL_MODS}/tinymce/tinymce/jscripts/tiny_mce/blank.htm

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.1.1.1 2008/02/16 16:46:59 espie Exp $
# $OpenBSD: Makefile,v 1.2 2008/02/17 14:34:14 espie Exp $
COMMENT = webform
DISTNAME = webform-5.x-1.9
PKGNAME = drupal5-webform-1.9
PKGNAME = drupal5-webform-1.9p0
.include <bsd.port.mk>

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-components_grid_inc,v 1.1 2008/02/17 14:34:14 espie Exp $
--- components/grid.inc.orig Wed Jan 23 05:45:29 2008
+++ components/grid.inc Sun Feb 17 15:31:57 2008
@@ -19,6 +19,7 @@ function _webform_edit_grid($currfield) {
'#rows' => 5,
'#weight' => -3,
'#required' => TRUE,
+ '#noMCE' => TRUE,
);
$edit_fields['extra']['questions'] = array(
'#type' => 'textarea',
@@ -29,6 +30,7 @@ function _webform_edit_grid($currfield) {
'#rows' => 5,
'#weight' => -2,
'#required' => TRUE,
+ '#noMCE' => TRUE,
);
$edit_fields['extra']['optrand'] = array(
'#type' => 'checkbox',

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-components_select_inc,v 1.1 2008/02/17 14:34:14 espie Exp $
--- components/select.inc.orig Sun Feb 10 07:26:40 2008
+++ components/select.inc Sun Feb 17 15:31:57 2008
@@ -20,6 +20,7 @@ function _webform_edit_select($currfield) {
'#rows' => 5,
'#weight' => -2,
'#required' => TRUE,
+ '#noMCE' => TRUE,
);
$edit_fields['value'] = array(
'#type' => 'textfield',

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2008/02/16 16:46:59 espie Exp $
@comment $OpenBSD: PLIST,v 1.2 2008/02/17 14:34:14 espie Exp $
@owner www
@group www
${DRUPAL_MODS}/webform/
@ -12,10 +12,12 @@ ${DRUPAL_MODS}/webform/components/email.inc
${DRUPAL_MODS}/webform/components/fieldset.inc
${DRUPAL_MODS}/webform/components/file.inc
${DRUPAL_MODS}/webform/components/grid.inc
@comment ${DRUPAL_MODS}/webform/components/grid.inc.orig
${DRUPAL_MODS}/webform/components/hidden.inc
${DRUPAL_MODS}/webform/components/markup.inc
${DRUPAL_MODS}/webform/components/pagebreak.inc
${DRUPAL_MODS}/webform/components/select.inc
@comment ${DRUPAL_MODS}/webform/components/select.inc.orig
${DRUPAL_MODS}/webform/components/textarea.inc
${DRUPAL_MODS}/webform/components/textfield.inc
${DRUPAL_MODS}/webform/components/time.inc