From 7ac2f8154307fbc8a5022ce8952089259bf040a3 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Thu, 29 May 2008 10:12:36 +0000 Subject: [PATCH] fix template handling --- drupal/drupal.patch | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/drupal/drupal.patch b/drupal/drupal.patch index f951f9d046..32ba13a0e8 100644 --- a/drupal/drupal.patch +++ b/drupal/drupal.patch @@ -330,7 +330,7 @@ Index: sites/all/modules/img_assist/img_assist_popup.js --- /dev/null 2008-05-02 21:08:21 +0200 +++ sites/all/modules/img_assist/img_assist_popup.js 2008-05-02 21:05:56 +0200 @@ -0,0 +1,20 @@ -+/* $Id: drupal.patch,v 1.17 2008/05/29 06:29:42 rse Exp $ */ ++/* $Id: drupal.patch,v 1.18 2008/05/29 10:12:36 rse Exp $ */ + +function launch_popup(nid, mw, mh) { + var ox = mw; @@ -583,18 +583,18 @@ Index: modules/user/user.admin.inc Index: sites/all/modules/xmlcontent/xmlcontent.module --- sites/all/modules/xmlcontent/xmlcontent.module.orig 2007-03-14 22:59:59 +0100 -+++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-29 08:27:28 +0200 ++++ sites/all/modules/xmlcontent/xmlcontent.module 2008-05-29 12:10:00 +0200 @@ -39,7 +39,16 @@ return t('Allows users to post XML node content and get it transformed through a configured XSLT script'); case 'process': - $xslt_path = drupal_get_path('module', 'xmlcontent'). '/' . variable_get("xmlcontent_xslt_path_$format", ''); + $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); -+ if ($tpl_path != "") { ++ if ($tpl_path) { + if (substr($tpl_path, 0, 1) != "/") + $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; + $tpl = file_get_contents($tpl_path); -+ $text = preg_replace(/&template_body;/, $text, $tpl); ++ $text = preg_replace("/&template_body;/", $text, $tpl); + } + $xslt_path = variable_get("xmlcontent_xslt_path_$format", ''); + if (substr($xslt_path, 0, 1) != "/") @@ -623,7 +623,25 @@ Index: sites/all/modules/xmlcontent/xmlcontent.module if (!is_file($schema_path) && ($validation == 'xsd' or $validation == 'rng')) { $schema_path = null; watchdog( 'xmlcontent', t('Validation required but no schema file'), WATCHDOG_WARNING ); -@@ -156,6 +168,13 @@ +@@ -93,7 +105,16 @@ + libxml_clear_errors(); + libxml_use_internal_errors(true); + +- if (!_xmlcontent_validate($node->body, $validation, $schema_path)) { ++ $text = $node->body; ++ $tpl_path = variable_get("xmlcontent_tpl_path_$format", ''); ++ if ($tpl_path) { ++ if (substr($tpl_path, 0, 1) != "/") ++ $tpl_path = drupal_get_path('module', 'xmlcontent') . '/' . $tpl_path; ++ $tpl = file_get_contents($tpl_path); ++ $text = preg_replace("/&template_body;/", $text, $tpl); ++ } ++ ++ if (!_xmlcontent_validate($text, $validation, $schema_path)) { + form_set_error('body', t('XML Content: Invalid XML') . libxml_errors_string()); + } + +@@ -156,6 +177,13 @@ '#collapsible' => TRUE, '#collapsed' => FALSE, ); @@ -637,7 +655,7 @@ Index: sites/all/modules/xmlcontent/xmlcontent.module $form['xmlcontent']["xmlcontent_xslt_path_$format"] = array( '#type' => 'textfield', '#title' => t('XSLT Script File Path'), -@@ -218,6 +237,8 @@ +@@ -218,6 +246,8 @@ // Load the XML document $dom = new DomDocument('1.0', 'UTF-8'); @@ -646,7 +664,7 @@ Index: sites/all/modules/xmlcontent/xmlcontent.module $valid = $dom->loadXML($xml); if (!$valid) { watchdog('xmlcontent', "Invalid XML Content", WATCHDOG_WARNING); -@@ -242,10 +263,8 @@ +@@ -242,10 +272,8 @@ } // Transform