aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-20 17:44:26 -0700
committerredmatrix <git@macgirvin.com>2016-05-20 17:44:26 -0700
commitb2f0d2d085c355010f1475269c4beb4fba7b07dc (patch)
tree3d2f70ab6f6eb0bd99eb8a9731b30998ff03d067 /include
parentaefeda8c416f8aed34a187a5ca2408598add864f (diff)
downloadvolse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.tar.gz
volse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.tar.bz2
volse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.zip
cleanup proc_run after messing it up with debugging yesterday
Diffstat (limited to 'include')
-rwxr-xr-xinclude/smarty.php5
-rw-r--r--include/text.php29
2 files changed, 32 insertions, 2 deletions
diff --git a/include/smarty.php b/include/smarty.php
index 762efe335..9d443e269 100755
--- a/include/smarty.php
+++ b/include/smarty.php
@@ -1,6 +1,7 @@
<?php /** @file */
-require_once 'include/ITemplateEngine.php';
-require_once("library/Smarty/libs/Smarty.class.php");
+
+require_once('include/ITemplateEngine.php');
+require_once('library/Smarty/libs/Smarty.class.php');
class FriendicaSmarty extends Smarty {
diff --git a/include/text.php b/include/text.php
index 3f2e85fc8..554518e32 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2860,3 +2860,32 @@ function pdl_selector($uid, $current="") {
return $o;
}
+/*
+ * array flatten_array_recursive(array);
+ * returns a one-dimensional array from a multi-dimensional array
+ * empty values are discarded
+ * example: print_r(flatten_array_recursive(array('foo','bar',array('baz','blip',array('zob','glob')),'','grip')));
+ *
+ * Array ( [0] => foo [1] => bar [2] => baz [3] => blip [4] => zob [5] => glob [6] => grip )
+ *
+ */
+
+function flatten_array_recursive($arr) {
+ $ret = array();
+
+ if(! $arr)
+ return $ret;
+
+ foreach($arr as $a) {
+ if(is_array($a)) {
+ $tmp = flatten_array_recursive($a);
+ if($tmp) {
+ $ret = array_merge($ret,$tmp);
+ }
+ }
+ elseif($a) {
+ $ret[] = $a;
+ }
+ }
+ return($ret);
+}