Files
web-doc-editor/js/ui/task/setTopicTask.js
Alexander Moskaliov d426bd3afd Add language specific topic.
Fix small error,
Small refactor some methods
2011-10-23 05:54:26 +00:00

32 lines
947 B
JavaScript

Ext.namespace('ui','ui.task');
// config - { item, value, [notify=true] }
ui.task.setTopicTask = function(config)
{
Ext.apply(this, config);
var isLang = this.isLang;
// Apply modification in DB
XHR({
scope : this,
params : {
task : 'setTopic',
content : this.content,
lang : isLang ? 'lang' : 'global'
},
success : function(r)
{
var o = Ext.util.JSON.decode(r.responseText),
topic = PhDOE.topic[isLang ? 'lang' : 'global'];
// We update the topic information
topic.author = o.author;
topic.content = o.content;
topic.topicDate = Date.parseDate(o.topicDate, 'Y-m-d H:i:s');
topic.topicDate = topic.topicDate.format(_('Y-m-d, H:i'));
// We set the topic
PhDOE.setTopic(isLang);
}
});
};