Code: Select all
/* Picks a specified key from an array and returns it
*
* @access public
* @param array The input array
* @param string The key to search for
* @param string The default value to return when not found
* @return null
*/
function &serendipity_pickKey(&$array, $key, $default) {
if (!is_array($array)) {
return $default;
}
foreach($array AS $child) {
if (is_array($child) && isset($child[$key]) && !empty($child[$key])) {
return $child[$key];
}
}
return $default;
}
I checked, and pickKey is not used in any templates. It and its Smarty wrapper, serendipity_smarty_pickKey, are actually used only in the functions_images.inc.php, for serendipity_parseMediaProperties(). It's used to get and set the DATE, RUN_LENGTH, DPI, COPYRIGHT, TITLE, COMMENT1, and COMMENT2 image fields.
These, in turn, are used in the media selector.
I'd like to modify pickKey to work as I expected. Is the media selector displaying the image properties as expected? (I don't have properties on any of my images, so far as I'm aware, so I can't check it.) If it's not, perhaps I've found the problem.
Anybody use the media metadata in their media selection?