Browse Source

Handle properly the comments deletion

pull/238/head
Timothée Jaussoin 10 years ago
parent
commit
e957aefac4
  1. 19
      app/widgets/Post/Post.php
  2. 1
      app/widgets/Post/locales.ini
  3. 16
      composer.lock

19
app/widgets/Post/Post.php

@ -34,12 +34,19 @@ class Post extends \Movim\Widget\Base
$this->onComments($packet);
}
function onDelete()
{
Notification::append(false, $this->__('post.deleted'));
$this->ajaxClear();
RPC::call('MovimTpl.hidePanel');
RPC::call('Menu_ajaxGetAll');
function onDelete($packet)
{
$content = $packet->content;
if(substr($content['node'], 0, 29) == 'urn:xmpp:microblog:0:comments') {
Notification::append(false, $this->__('post.comment_deleted'));
$this->ajaxGetComments($content['server'], substr($content['node'], 30));
} else {
Notification::append(false, $this->__('post.deleted'));
$this->ajaxClear();
RPC::call('MovimTpl.hidePanel');
RPC::call('Menu_ajaxGetAll');
}
}
function onComments($packet)

1
app/widgets/Post/locales.ini

@ -23,6 +23,7 @@ discover = Discover more articles on the Groups page
comments_disabled = Comments disabled
comment_published = Comment published
comment_deleted = Comment deleted
[hello]
blog_title = Visit your public blog

16
composer.lock

@ -124,12 +124,12 @@
"source": {
"type": "git",
"url": "https://github.com/oscarotero/Embed.git",
"reference": "43838d5c715679124f8421888db66569bed5b404"
"reference": "d5e6ce1f2483ae86a4c03f45ba9a4430979b0430"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/oscarotero/Embed/zipball/43838d5c715679124f8421888db66569bed5b404",
"reference": "43838d5c715679124f8421888db66569bed5b404",
"url": "https://api.github.com/repos/oscarotero/Embed/zipball/d5e6ce1f2483ae86a4c03f45ba9a4430979b0430",
"reference": "d5e6ce1f2483ae86a4c03f45ba9a4430979b0430",
"shasum": ""
},
"require": {
@ -170,7 +170,7 @@
"opengraph",
"twitter cards"
],
"time": "2016-06-28 11:58:26"
"time": "2016-07-09 18:56:02"
},
{
"name": "evenement/evenement",
@ -772,12 +772,12 @@
"source": {
"type": "git",
"url": "https://github.com/movim/moxl.git",
"reference": "a7d90ad8b4cd9e88e30052bdf0916e17260132d6"
"reference": "e7ace42bbc0243fd0603defe8033239b2c0815a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/movim/moxl/zipball/a7d90ad8b4cd9e88e30052bdf0916e17260132d6",
"reference": "a7d90ad8b4cd9e88e30052bdf0916e17260132d6",
"url": "https://api.github.com/repos/movim/moxl/zipball/e7ace42bbc0243fd0603defe8033239b2c0815a6",
"reference": "e7ace42bbc0243fd0603defe8033239b2c0815a6",
"shasum": ""
},
"require": {
@ -812,7 +812,7 @@
"php",
"xmpp"
],
"time": "2016-07-03 10:56:57"
"time": "2016-07-09 21:16:49"
},
{
"name": "movim/sasl2",

Loading…
Cancel
Save