return $r;
}
}
+
+
+ /**
+ * Merges two variables into a single array
+ *
+ * Similar to PHP array_merge function, but provides same
+ * functionality as array_merge without losing array values
+ * with same key names. If the values under identical array
+ * keys are both strings and $concat_strings is TRUE, those
+ * values are concatenated together, otherwise they are placed
+ * in a sub-array and are merged (recursively) in the same manner.
+ *
+ * If either of the elements being merged is not an array,
+ * it will simply be added to the returned array.
+ *
+ * If both values are strings and $concat_strings is TRUE,
+ * a concatenated string is returned instead of an array.
+ *
+ * @param mixed $a First element to be merged
+ * @param mixed $b Second element to be merged
+ * @param boolean $concat_strings Whether or not string values
+ * should be concatenated instead
+ * of added to different array
+ * keys (default TRUE)
+ *
+ * @return array The merged $a and $b in one array
+ *
+ * @since 1.5.2
+ * @author Paul Lesniewski
+ *
+ */
+function sqm_array_merge($a, $b, $concat_strings=true) {
+
+ $ret = array();
+
+ if (is_array($a)) {
+ $ret = $a;
+ } else {
+ if (is_string($a) && is_string($b) && $concat_strings) {
+ return $a . $b;
+ }
+ $ret[] = $a;
+ }
+
+
+ if (is_array($b)) {
+ foreach ($b as $key => $value) {
+ if (isset($ret[$key])) {
+ $ret[$key] = sqm_array_merge($ret[$key], $value, $concat_strings);
+ } else {
+ $ret[$key] = $value;
+ }
+ }
+ } else {
+ $ret[] = $b;
+ }
+
+ return $ret;
+
+}
+
+
}
}
-/**
- * Merges two variables into a single array
- *
- * Similar to PHP array_merge function, but provides same
- * functionality as array_merge without losing array values
- * with same key names. If the values under identical array
- * keys are both strings and $concat_strings is TRUE, those
- * values are concatenated together, otherwise they are placed
- * in a sub-array and are merged (recursively) in the same manner.
- *
- * If either of the elements being merged is not an array,
- * it will simply be added to the returned array.
- *
- * If both values are strings and $concat_strings is TRUE,
- * a concatenated string is returned instead of an array.
- *
- * @param mixed $a First element to be merged
- * @param mixed $b Second element to be merged
- * @param boolean $concat_strings Whether or not string values
- * should be concatenated instead
- * of added to different array
- * keys (default TRUE)
- *
- * @return array The merged $a and $b in one array
- *
- * @since 1.5.2
- *
- */
-function sq_array_merge($a, $b, $concat_strings=true) {
-
- $ret = array();
-
- if (is_array($a)) {
- $ret = $a;
- } else {
- if (is_string($a) && is_string($b) && $concat_strings) {
- return $a . $b;
- }
- $ret[] = $a;
- }
-
-
- if (is_array($b)) {
- foreach ($b as $key => $value) {
- if (isset($ret[$key])) {
- $ret[$key] = sq_array_merge($ret[$key], $value, $concat_strings);
- } else {
- $ret[$key] = $value;
- }
- }
- } else {
- $ret[] = $b;
- }
-
- return $ret;
-
-}
-
/**
* Add a variable to the session.
* @param mixed $var the variable to register
/* Add something to set correct gettext domain for plugin. */
if (function_exists($function)) {
// $ret .= $function($parm);
- $ret = sq_array_merge($ret, $function($parm));
+ $ret = sqm_array_merge($ret, $function($parm));
}
}
}
$color[16] = '#ff9933'; /* (orange) Highlight color */
require(SM_PATH . 'functions/global.php');
+require(SM_PATH . 'functions/arrays.php');
/* load default configuration */
require(SM_PATH . 'config/config_default.php');
/* SquirrelMail required files. */
require_once(SM_PATH . 'functions/forms.php');
-require_once(SM_PATH . 'functions/arrays.php');
/* get globals */
if (sqgetGlobalVar('num', $num, SQ_GET)) {
$oTemplate->display('options_order.tpl');
$oTemplate->display('footer.tpl');
-?>
\ No newline at end of file
+?>
require_once(SM_PATH . 'functions/date.php');
require_once(SM_PATH . 'functions/url_parser.php');
require_once(SM_PATH . 'functions/identity.php');
-require_once(SM_PATH . 'functions/arrays.php');
require_once(SM_PATH . 'functions/mailbox_display.php');
require_once(SM_PATH . 'functions/forms.php');
require_once(SM_PATH . 'functions/attachment_common.php');