* @license PHP License * @package WB * @subpackage content */ /** * Load classes */ WBClass::load('WBDatasource_Callback'); /** * Wombat Incident Ticket System: Callback * * @version 1.1.0 * @package WB * @subpackage content */ class WBITS_DatasourceCallback implements WBDatasource_Callback { /** * Current Config * @var array */ protected $config; /** * Constructor * * @param array */ public function __construct($parameter = array()) { $this->config = $parameter; } /** * callback when receive whole entry * * @param string $src name of source * @param string $key * @param array $data loaded data * @return bool true on success */ public function onDatasourceGet($src, $key, &$data) { $data['id'] = $key; $data['obscureid'] = $data['obscure'] . $key; $data['status_display'] = patI18n::dgettext('wombat', 'its_status_' . $data['status']); $uri = $this->config['uri']; if (!empty($this->config['namespaces'][$data['namespace']]['uri'])) { $uri = $this->config['namespaces'][$data['namespace']]['uri']; } $data['uri'] = WBString::populate($uri, $data); unset($data['obscure']); return true; } }