diff --git a/app/models/postn/Postn.php b/app/models/postn/Postn.php index 7bc6b31d9..f5c96f7b6 100644 --- a/app/models/postn/Postn.php +++ b/app/models/postn/Postn.php @@ -11,6 +11,7 @@ class Postn extends ModlModel { public $aname; // author name public $aid; // author id + public $aemail; // author email public $title; // public $content; // the content @@ -49,6 +50,8 @@ class Postn extends ModlModel { {"type":"string", "size":128 }, "aid" : {"type":"string", "size":128 }, + "aemail" : + {"type":"string", "size":64 }, "title" : {"type":"text" }, "content" : @@ -98,10 +101,13 @@ class Postn extends ModlModel { if($entry->entry->id) $this->nodeid = (string)$entry->entry->id; + // Get some informations on the author if($entry->entry->author->name) $this->aname = (string)$entry->entry->author->name; if($entry->entry->author->uri) $this->aid = substr((string)$entry->entry->author->uri, 5); + if($entry->entry->author->email) + $this->aemail = (string)$entry->entry->author->email; // Non standard support if($entry->entry->source && $entry->entry->source->author->name) @@ -150,12 +156,19 @@ class Postn extends ModlModel { $contentimg = $this->setAttachements($entry->entry->link); + + // Tags parsing if($entry->entry->category) { $this->tags = array(); - foreach($entry->entry->category as $cat) - array_push($this->tags, (string)$cat->attributes()->term); + + if($entry->entry->category->count() == 1 + && isset($entry->entry->category->attributes()->term)) + array_push($this->tags, (string)$entry->entry->category->attributes()->term); + else + foreach($entry->entry->category as $cat) + array_push($this->tags, (string)$cat->attributes()->term); } - + if(!empty($this->tags)) $this->tags = serialize($this->tags); diff --git a/app/models/postn/PostnDAO.php b/app/models/postn/PostnDAO.php index bdfc6826b..f761beed9 100644 --- a/app/models/postn/PostnDAO.php +++ b/app/models/postn/PostnDAO.php @@ -8,6 +8,7 @@ class PostnDAO extends ModlSQL { update postn set aname = :aname, aid = :aid, + aemail = :aemail, title = :title, content = :content, @@ -36,6 +37,7 @@ class PostnDAO extends ModlSQL { array( 'aname' => $post->aname, 'aid' => $post->aid, + 'aemail' => $post->aemail, 'title' => $post->title, 'content' => $post->content, @@ -75,6 +77,7 @@ class PostnDAO extends ModlSQL { aname, aid, + aemail, title, content, @@ -101,6 +104,7 @@ class PostnDAO extends ModlSQL { :aname, :aid, + :aemail, :title, :content, @@ -125,6 +129,7 @@ class PostnDAO extends ModlSQL { array( 'aname' => $post->aname, 'aid' => $post->aid, + 'aemail' => $post->aemail, 'title' => $post->title, 'content' => $post->content, diff --git a/app/widgets/Chat/_chat_contact.tpl b/app/widgets/Chat/_chat_contact.tpl index ef799d68d..f93636e84 100644 --- a/app/widgets/Chat/_chat_contact.tpl +++ b/app/widgets/Chat/_chat_contact.tpl @@ -24,23 +24,23 @@ state = 0; {$send} return false; - } else { + }/* else { if(state == 0 || state == 2) { state = 1; {$composing} since = new Date().getTime(); } - } + }*/ " onkeyup=" movim_textarea_autoheight(this); - setTimeout(function() + /*setTimeout(function() { if(state == 1 && since+5000 < new Date().getTime()) { state = 2; {$paused} } - },5000); + },5000); */ " > diff --git a/app/widgets/Config/Config.php b/app/widgets/Config/Config.php index 3cfc63d97..9f81c5143 100644 --- a/app/widgets/Config/Config.php +++ b/app/widgets/Config/Config.php @@ -24,18 +24,18 @@ class Config extends WidgetBase { $this->addjs('color/jscolor.js'); $this->registerEvent('config', 'onConfig'); - + /* We load the user configuration */ $this->view->assign('languages', load_lang_array()); $this->view->assign('me', $this->user->getLogin()); $this->view->assign('conf', $this->user->getConfig('language')); $this->view->assign('color', $this->user->getConfig('color')); $this->view->assign('size', $this->user->getConfig('size')); - - if($this->user->getConfig('chatbox') == 1) - $this->view->assign('chatbox', 'checked="true"'); + + if($this->user->getConfig('chatbox')) + $this->view->assign('chatbox', 'checked'); else - $this->view->assign('chatbox', 'checked="false"'); + $this->view->assign('chatbox', ''); $this->view->assign('submit', $this->genCallAjax( @@ -43,10 +43,6 @@ class Config extends WidgetBase "movim_parse_form('general')" ) . "this.className='button icon color orange loading'; - setTimeout( - function() { - location.reload(false)}, 2000 - ); this.onclick=null;" ); } @@ -54,6 +50,7 @@ class Config extends WidgetBase function onConfig(array $data) { $this->user->setConfig($data); + RPC::call('movim_reload_this'); Notification::appendNotification(t('Configuration updated')); } diff --git a/app/widgets/Roster/Roster.php b/app/widgets/Roster/Roster.php index bf3f64773..354b7ccf9 100644 --- a/app/widgets/Roster/Roster.php +++ b/app/widgets/Roster/Roster.php @@ -34,7 +34,7 @@ class Roster extends WidgetBase $this->view->assign('offline_shown', ''); $offline_state = Cache::c('offlineshown'); - + $bool = Cache::c('rostershow'); if($bool) $this->view->assign('roster_show', 'hide'); diff --git a/app/widgets/WidgetCommon/WidgetCommon.php b/app/widgets/WidgetCommon/WidgetCommon.php index ff918b13a..6c99ada38 100644 --- a/app/widgets/WidgetCommon/WidgetCommon.php +++ b/app/widgets/WidgetCommon/WidgetCommon.php @@ -102,6 +102,8 @@ class WidgetCommon extends WidgetBase { } else $enc = ''; + $author = $this->prepareAuthor($post); + $content = prepareString(html_entity_decode($post->content)); if($post->node == 'urn:xmpp:microblog:0') @@ -138,6 +140,8 @@ class WidgetCommon extends WidgetBase { $view->assign('recycle', $recycle); $view->assign('group', $group); + $view->assign('author', $author); + $html = $view->draw('_post', true); return $html; @@ -186,6 +190,26 @@ class WidgetCommon extends WidgetBase { return $enc; } + private function prepareAuthor($post) { + $html = $content = ''; + if($post->aname != null) { + $content .= ' '.t('by').' '.$post->aname; + } + + if($post->aemail != null) { + $content .= ' '.t('email').' '.$post->aemail; + } + + if($post->aid != null) { + $content .= ' '.t('jid').' '.$post->aid; + } + + if($content .= '') + $html .= '
'; + + return $html; + } + private function getToolbox($post) { $view = $this->loadTemplate(); diff --git a/app/widgets/WidgetCommon/_post.tpl b/app/widgets/WidgetCommon/_post.tpl index aed763320..9dd2bf052 100644 --- a/app/widgets/WidgetCommon/_post.tpl +++ b/app/widgets/WidgetCommon/_post.tpl @@ -17,6 +17,7 @@ {$content}