From 5586893ca2ed4b6ad357f55edd1874fc7ec327b2 Mon Sep 17 00:00:00 2001
From: BENKE Charles <charles.fr@benke.fr>
Date: Sat, 1 Nov 2014 21:00:28 +0100
Subject: [PATCH] Update odf.php

add new fonction getvalue (valuename)
return value inside [valuename][/valuename] tag
---
 htdocs/includes/odtphp/odf.php | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 225466ca453..d4b79af8013 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -610,6 +610,21 @@ IMG;
 			closedir($handle);
 		}
 	}
+
+	/**
+	 * return the value present on odt in [valuename][/valuename]
+	 * @param string $value name balise in the template
+	 * @return string the value inside the balise
+	 *
+	 */
+	public function getvalue($valuename)
+	{
+		$searchreg="/\\[".$valuename."\\](.*)\\[\\/".$valuename."\\]/";
+		preg_match($searchreg, $this->contentXml, $matches); 
+		$this->contentXml = preg_replace($searchreg, "", $this->contentXml);
+		return  $matches[1];
+	}
+
 }
 
 ?>
-- 
GitLab