|
|
@ -869,6 +869,8 @@ function islandora_deprecated($release, $solution = NULL) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Transform recursively-merged array of strings to renderable arrays. |
|
|
|
* Transform recursively-merged array of strings to renderable arrays. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* Renderable arrays are passed-through as-is. |
|
|
|
|
|
|
|
* |
|
|
|
* Previously, functions/hooks like islandora_view_object would return an |
|
|
|
* Previously, functions/hooks like islandora_view_object would return an |
|
|
|
* associative array with string values containing markup. These values were |
|
|
|
* associative array with string values containing markup. These values were |
|
|
|
* then imploded into one large piece of markup. Here, we transform this older |
|
|
|
* then imploded into one large piece of markup. Here, we transform this older |
|
|
@ -880,16 +882,24 @@ function islandora_deprecated($release, $solution = NULL) { |
|
|
|
* of strings, which we transform to renderable markup elements (by |
|
|
|
* of strings, which we transform to renderable markup elements (by |
|
|
|
* reference). |
|
|
|
* reference). |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_array_of_markup_to_renderable_array(&$markup_array) { |
|
|
|
function islandora_as_renderable_array(&$markup_array) { |
|
|
|
foreach ($markup_array as &$value) { |
|
|
|
foreach ($markup_array as &$value) { |
|
|
|
if (!is_array($value)) { |
|
|
|
if (!is_array($value)) { |
|
|
|
|
|
|
|
// Not a renderable array, just a string. Let's convert it to a |
|
|
|
|
|
|
|
// renderable '#markup' element. |
|
|
|
$value = array( |
|
|
|
$value = array( |
|
|
|
'#markup' => $value, |
|
|
|
'#markup' => $value, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
elseif (!isset($value['#type']) && !isset($value['#markup'])) { |
|
|
|
|
|
|
|
// A simple array--possibly the result of a recursive merge? Let's |
|
|
|
|
|
|
|
// look at each, to possibly convert them to a renderable '#markup' |
|
|
|
|
|
|
|
// elements. |
|
|
|
foreach ($value as &$inner) { |
|
|
|
foreach ($value as &$inner) { |
|
|
|
if (!is_array($inner)) { |
|
|
|
if (!is_array($inner)) { |
|
|
|
|
|
|
|
// If it is an array at this level, we can assume that it is a |
|
|
|
|
|
|
|
// renderable array. If it is not an array, convert to a renderable |
|
|
|
|
|
|
|
// '#markup' element. |
|
|
|
$inner = array( |
|
|
|
$inner = array( |
|
|
|
'#markup' => $inner, |
|
|
|
'#markup' => $inner, |
|
|
|
); |
|
|
|
); |
|
|
|