summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-04-10 17:38:44 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-04-10 17:38:44 +0000
commit5c24b0d4ae4930c138b17bebed0f47cf9272b8ba (patch)
tree4f7096e73571686933942b4286f3287a7a23856e
parentb308ebfb62b791ff109aa9f0bb98d288624d61a3 (diff)
downloadliberty-5c24b0d4ae4930c138b17bebed0f47cf9272b8ba.tar.gz
liberty-5c24b0d4ae4930c138b17bebed0f47cf9272b8ba.tar.bz2
liberty-5c24b0d4ae4930c138b17bebed0f47cf9272b8ba.zip
revert recent changes. didn't work as expected.
-rw-r--r--LibertyContent.php4
-rwxr-xr-xLibertySystem.php21
-rw-r--r--plugins/data.div.php11
3 files changed, 8 insertions, 28 deletions
diff --git a/LibertyContent.php b/LibertyContent.php
index 088ed03..351f1b8 100644
--- a/LibertyContent.php
+++ b/LibertyContent.php
@@ -3,7 +3,7 @@
* Management of Liberty content
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.93 2006/04/10 13:58:10 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.94 2006/04/10 17:38:44 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -1479,12 +1479,12 @@ class LibertyContent extends LibertyBase {
global $gLibertySystem;
if( $func = $gLibertySystem->getPluginFunction( $formatGuid, 'load_function' ) ) {
$ret = $func( $data, $this, $contentId );
- post_parse_data( $ret );
}
}
return $ret;
}
+
/**
* Special parsing for multipage articles
*
diff --git a/LibertySystem.php b/LibertySystem.php
index f3bdd5f..406cb42 100755
--- a/LibertySystem.php
+++ b/LibertySystem.php
@@ -3,7 +3,7 @@
* System class for handling the liberty package
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.23 2006/04/10 13:58:10 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.24 2006/04/10 17:38:44 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -278,7 +278,7 @@ class LibertySystem extends LibertyBase {
}
function parse_data_plugins( &$data, &$preparsed, &$noparsed, &$pParser ) {
- global $gLibertySystem, $gParsedDataPlugins;
+ global $gLibertySystem;
// Find the plugins
// note: $curlyTags[0] is the complete match, $curlyTags[1] is plugin name, $curlyTags[2] is plugin arguments
preg_match_all("/\{\/?([A-Za-z]+)([^\}]*)\}/", $data, $curlyTags);
@@ -387,10 +387,8 @@ function parse_data_plugins( &$data, &$preparsed, &$noparsed, &$pParser ) {
$ret = preg_replace( "/\~(\/?)[np]p\~/", '', $ret );
}
- // pass plugin output to hash and place a unique key in the text for later replacement
- $key = md5( microtime( rand() ) );
- $gParsedDataPlugins[$key] = $ret;
- $data = substr_replace( $data, $key, $pos, $pos_end - $pos + strlen( $plugin_end ) );
+ // Replace plugin section with its output in data
+ $data = substr_replace($data, $ret, $pos, $pos_end - $pos + strlen($plugin_end));
}
}
$i--;
@@ -403,17 +401,6 @@ function parse_data_plugins( &$data, &$preparsed, &$noparsed, &$pParser ) {
}
}
-// parse_data_plugins places all plugin data in $gParsedDataPlugins. The plugin
-// data is passed back into $data once all the parsing has finished
-function post_parse_data( &$pData ) {
- global $gParsedDataPlugins;
- if( !empty( $gParsedDataPlugins ) && is_array( $gParsedDataPlugins ) ) {
- foreach( $gParsedDataPlugins as $key => $data ) {
- $pData = str_replace( $key, $data, $pData );
- }
- }
-}
-
global $gLibertySystem;
$gLibertySystem = new LibertySystem();
?>
diff --git a/plugins/data.div.php b/plugins/data.div.php
index 7dcd35c..187538e 100644
--- a/plugins/data.div.php
+++ b/plugins/data.div.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
* @package liberty
* @subpackage plugins_data
*/
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: xing
// +----------------------------------------------------------------------+
-// $Id: data.div.php,v 1.6 2006/04/10 17:18:17 squareing Exp $
+// $Id: data.div.php,v 1.7 2006/04/10 17:38:44 squareing Exp $
/**
* definitions
@@ -63,7 +63,6 @@ function data_div_help() {
}
function data_div( $data, $params ) {
- global $gContent;
$style = '';
foreach( $params as $key => $value ) {
if( !empty( $value ) ) {
@@ -90,12 +89,6 @@ function data_div( $data, $params ) {
}
}
}
-
- $parse['data'] = &$data;
- $parse['format_guid'] = ( !empty( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : NULL );
- $parse['content_id'] = ( !empty( $gContent->mInfo['content_id'] ) ? $gContent->mInfo['content_id'] : NULL );
- $data = $gContent->parseData( $parse );
-
return( '<div style="'.$style.'">'.$data.'</div>' );
}
?>