]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Blog/BlogPlugin.php
Failed to reference an object property
[quix0rs-gnu-social.git] / plugins / Blog / BlogPlugin.php
index 04eef36e04195df00469abf217c5d39330cdda95..2d74b6531e241e247e63e6ce590c2da48db0adc5 100644 (file)
@@ -67,35 +67,6 @@ class BlogPlugin extends MicroAppPlugin
         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
      *
@@ -116,17 +87,19 @@ class BlogPlugin extends MicroAppPlugin
     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()
@@ -149,7 +122,7 @@ class BlogPlugin extends MicroAppPlugin
         $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.'));
         }
 
@@ -175,7 +148,8 @@ class BlogPlugin extends MicroAppPlugin
         $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));
         }
 
@@ -191,7 +165,7 @@ class BlogPlugin extends MicroAppPlugin
     {
         if ($notice->object_type == Blog_entry::TYPE) {
             $entry = Blog_entry::fromNotice($notice);
-            if (exists($entry)) {
+            if (!empty($entry)) {
                 $entry->delete();
             }
         }
@@ -204,7 +178,7 @@ class BlogPlugin extends MicroAppPlugin
         if ($notice->object_type == Blog_entry::TYPE) {
             return new BlogEntryListItem($nli);
         }
-        
+
         return null;
     }