) {
header('Content-type: text/html');
echo "<HTML><HEAD></HEAD><BODY>";
- echo $json->encodeUnsafe(array('success'=> true, 'data' => $str));
+ // encode html characters so they can be read..
+ echo str_replace(array('<','>'), array('\u003c','\u003e'),
+ $json->encodeUnsafe(array('success'=> true, 'data' => $str)));
echo "</BODY></HTML>";
exit;
}
*
* @param {String} action - group/name of event
* @param {DataObject|false} obj - dataobject action occured on.
- * @param {String} any remarks
+ * @param {String} any remarks
+ * @return {Number} id of event created.
*/
function addEvent($act, $obj = false, $remarks = '')
$eid = $e->insert();
$ff = HTML_FlexyFramework::get();
if (empty($ff->Pman['event_log_dir'])) {
- return;
+ return $eid;
}
$file = $ff->Pman['event_log_dir']. date('/Y/m/d/'). $eid . ".php";
if (!file_exists(dirname($file))) {
'POST' => empty($_POST) ? array() : $_POST,
), true));
-
+ return $eid;
}