*/ class CustomFieldCallbacks { /** */ function callback($params, &$smarty, $callback, $userId=null) { global $gallery; GalleryCoreApi::requireOnce('modules/customfield/classes/CustomFieldHelper.class'); switch ($callback) { case 'LoadCustomFields': list ($ret, $item) = GalleryCoreApi::loadEntitiesById($params['itemId']); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } list ($ret, $fields) = CustomFieldHelper::fetchFieldValues(array($item), 'detail'); if ($ret) { return $ret->wrap(__FILE__, __LINE__); } $block =& $smarty->_tpl_vars['block']; $block['customfield']['LoadCustomFields']['fields'] = isset($fields[$item->getId()]) ? $fields[$item->getId()] : array(); return null; } return GalleryCoreApi::error(ERROR_BAD_PARAMETER, __FILE__, __LINE__); } } ?>