Update Prototype to 1.7.3.0, core class array flatten, js update

- Prototype updated to 1.7.3 from 1.7.2
- Basic class has a array flatten with keys as flatten part (keys become
values)
- js update with aelx method
This commit is contained in:
Clemens Schwaighofer
2018-07-20 16:48:25 +09:00
parent a190148125
commit 71ab3e27bd
6 changed files with 254 additions and 56 deletions

View File

@@ -1133,7 +1133,7 @@ class Basic
// does NOT preserve keys
public static function flattenArray(array $array)
{
$return = array();
$return = array ();
array_walk_recursive(
$array,
function ($a) use (&$return) {
@@ -1143,6 +1143,22 @@ class Basic
return $return;
}
// METHOD: flattenArrayKey
// PARAMS: the array to flatten
// RETURN: flattened array with array keys as values in order of tree
// DESC : note: the second parameter $return is automatically set
// will loop through an array recursivly and write the array keys back
public static function flattenArrayKey(array $array, array $return = array ())
{
foreach ($array as $key => $sub) {
$return[] = $key;
if (count($sub) > 0) {
$return = Basic::flattenArrayKey($sub, $return);
}
}
return $return;
}
// METHOD: __mbMimeEncode
// WAS : _mb_mime_encode
// PARAMS: string to encode, encoding to encode in