name) == 0) { $format_id = $format->format; break; } } if ($format_id == -1) { return t('Invalid format name'); } else { return _formatting_service_process_by_id($text, $format_id); } } /** * Process text with given input format */ function _formatting_service_process_by_id($text, $input_format_id) { // Access checking will be done to ensure no one tries the // PHP filter (if it is enabled). Everyone can use the // default format which is probably the only one used anyway return check_markup($text, $input_format_id, TRUE); } /** * Callback of xmlrpc call 'formats.list'. */ function formatting_service_list() { $result = array(); foreach (filter_formats() as $format) { $result[] = $format->name; } return $result; }