Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
* '1.0.x' of gitorious.org:statusnet/mainline: Fix blog plugin error to allow deleting a blog post correctly show the blog content for blog entries
This commit is contained in:
commit
3b1c5e5ac1
@ -194,7 +194,7 @@ class BlogPlugin extends MicroAppPlugin
|
|||||||
{
|
{
|
||||||
if ($notice->object_type == Blog_entry::TYPE) {
|
if ($notice->object_type == Blog_entry::TYPE) {
|
||||||
$entry = Blog_entry::fromNotice($notice);
|
$entry = Blog_entry::fromNotice($notice);
|
||||||
if (exists($entry)) {
|
if (!empty($entry)) {
|
||||||
$entry->delete();
|
$entry->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,15 +71,31 @@ class BlogEntryListItem extends NoticeListItemAdapter
|
|||||||
$out->element('a', array('href' => $notice->bestUrl()), $entry->title);
|
$out->element('a', array('href' => $notice->bestUrl()), $entry->title);
|
||||||
$out->elementEnd('h4');
|
$out->elementEnd('h4');
|
||||||
|
|
||||||
|
// XXX: kind of a hack
|
||||||
|
|
||||||
|
$actionName = $out->trimmed('action');
|
||||||
|
|
||||||
|
if ($actionName == 'shownotice' ||
|
||||||
|
$actionName == 'showblogentry' ||
|
||||||
|
$actionName == 'conversation') {
|
||||||
|
|
||||||
|
$out->elementStart('div', 'blog-entry-content');
|
||||||
|
$out->raw($entry->content);
|
||||||
|
$out->elementEnd('div');
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if (!empty($entry->summary)) {
|
if (!empty($entry->summary)) {
|
||||||
$out->elementStart('div', 'blog-entry-summary');
|
$out->elementStart('div', 'blog-entry-summary');
|
||||||
$out->raw($entry->summary);
|
$out->raw($entry->summary);
|
||||||
$out->elementEnd('div');
|
$out->elementEnd('div');
|
||||||
} else {
|
}
|
||||||
// XXX: hide content initially; click More... for full text.
|
|
||||||
$out->elementStart('div', 'blog-entry-content');
|
$url = ($entry->url) ? $entry->url : $notice->bestUrl();
|
||||||
$out->raw($entry->content);
|
$out->element('a',
|
||||||
$out->elementEnd('div');
|
array('href' => $url,
|
||||||
|
'class' => 'blog-entry-link'),
|
||||||
|
_('More...'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user