/** * @internal Save string handler * @attribute[RequestParam('lang','string')] * @attribute[RequestParam('term','string')] * @attribute[RequestParam('text','string','')] */ function SaveString($lang, $term, $text) { $text = urldecode($text); if ($text) { $this->ds->ExecuteSql("REPLACE INTO wdf_translations(lang,id,content)VALUES(?,?,?)", array($lang, $term, $text)); } else { $this->ds->ExecuteSql("DELETE FROM wdf_translations WHERE lang=? AND id=?", array($lang, $term)); } cache_del('lang_' . $term); return AjaxResponse::None(); }
/** * @internal Handles row action clicks and calls the defined handlers (<Table::AddRowAction>) * @attribute[RequestParam('action','string')] * @attribute[RequestParam('row','string')] */ function OnActionClicked($action, $row) { if (isset($this->_actionHandler[$action])) { $model = $this->_rowModels[$row]; return call_user_func_array($this->_actionHandler[$action], array($this, $action, $model, $row)); } log_warn("No handler defined for {$action}"); return AjaxResponse::None(); }
/** * @internal Delete a string * @attribute[RequestParam('term','string')] */ function DeleteString($term) { $ds = model_datasource($GLOBALS['CONFIG']['translation']['sync']['datasource']); $ds->ExecuteSql("DELETE FROM wdf_unknown_strings WHERE term=?", $term); return AjaxResponse::None(); }
/** * @internal SysAdmin cache manager: delete event. * @attribute[RequestParam('key','string',false)] */ function CacheDel($key) { cache_del($key); return AjaxResponse::None(); }