return true;
}
- /**
- * Load related modules when needed
- *
- * @param string $cls Name of the class to be loaded
- *
- * @return boolean hook value; true means continue processing, false means stop.
- */
- function onAutoload($cls)
- {
- $dir = dirname(__FILE__);
-
- switch ($cls)
- {
- case 'NewblogentryAction':
- case 'ShowblogentryAction':
- include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
- return false;
- case 'BlogEntryForm':
- case 'BlogEntryListItem':
- include_once $dir . '/'.strtolower($cls).'.php';
- return false;
- case 'Blog_entry':
- include_once $dir . '/'.$cls.'.php';
- return false;
- default:
- return true;
- }
- }
-
/**
* Map URLs to actions
*
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'Blog',
- 'version' => STATUSNET_VERSION,
+ 'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:Blog',
'rawdescription' =>
+ // TRANS: Plugin description.
_m('Let users write and share long-form texts.'));
return true;
}
function appTitle()
{
- return _m('Blog');
+ // TRANS: Blog application title.
+ return _m('TITLE','Blog');
}
function tag()
$entryObj = $activity->objects[0];
if ($entryObj->type != Blog_entry::TYPE) {
- // TRANS: Exception thrown when blog plugin comes across a non-event type object.
+ // TRANS: Exception thrown when blog plugin comes across a non-blog entry type object.
throw new ClientException(_m('Wrong type for object.'));
}
$entry = Blog_entry::fromNotice($notice);
if (empty($entry)) {
- throw new ClientException(sprintf(_('No blog entry for notice %s'),
+ // TRANS: Exception thrown when requesting a non-existing blog entry for notice.
+ throw new ClientException(sprintf(_m('No blog entry for notice %s.'),
$notice->id));
}
{
if ($notice->object_type == Blog_entry::TYPE) {
$entry = Blog_entry::fromNotice($notice);
- if (exists($entry)) {
+ if (!empty($entry)) {
$entry->delete();
}
}
if ($notice->object_type == Blog_entry::TYPE) {
return new BlogEntryListItem($nli);
}
-
+
return null;
}