summaryrefslogtreecommitdiff
path: root/javascript/suggest/suggest_lib.php
blob: ae909caa9c5884ca704f634d044fafa011661ae7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php

class SuggestLib {

	public static function exportXml( $pHash, $pFieldName ) {
		$ret = '<?xml version="1.0" ?><ajax-response><response type="object" id="'.$pFieldName.'_updater"><matches>';
		foreach( $pHash as $value=>$name ) {
			$ret .= "<entry><text>".htmlentities( $name )."</text><value>".htmlentities( $value )."</value></entry>";
		}
		$ret .= "</matches></response></ajax-response>";
		return $ret;
	}
}