]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Always naming it 'plugin' is not good, it can easily confuse. So better name it
authorRoland Haeder <roland@mxchange.org>
Sat, 12 Sep 2015 06:37:58 +0000 (08:37 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 12 Sep 2015 06:37:58 +0000 (08:37 +0200)
'pluginName' when it is actually only the name of the plugin and 'plugin' if it
is the Plugin instance.

Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/pluginlist.php

index 038b08a18fdc8e9a1fb625366fb92953b40cd20c..19825ade1783b76fe5a56899aadff8d6737c8de5 100644 (file)
@@ -90,22 +90,22 @@ class PluginList extends Widget
 class PluginListItem extends Widget
 {
     /** Current plugin. */
-    var $plugin = null;
+    private $pluginName = null;
 
     /** Local cache for plugin version info */
     protected static $versions = false;
 
-    function __construct($plugin, Action $out=null)
+    function __construct($pluginName, Action $out=null)
     {
         parent::__construct($out);
-        $this->plugin = $plugin;
+        $this->pluginName = $pluginName;
     }
 
     function show()
     {
         $meta = $this->metaInfo();
 
-        $this->out->elementStart('tr', array('id' => 'plugin-' . $this->plugin));
+        $this->out->elementStart('tr', array('id' => 'plugin-' . $this->pluginName));
 
         // Name and controls
         $this->out->elementStart('td');
@@ -113,7 +113,7 @@ class PluginListItem extends Widget
         if (!empty($meta['homepage'])) {
             $this->out->elementStart('a', array('href' => $meta['homepage']));
         }
-        $this->out->text($this->plugin);
+        $this->out->text($this->pluginName);
         if (!empty($meta['homepage'])) {
             $this->out->elementEnd('a');
         }
@@ -156,11 +156,11 @@ class PluginListItem extends Widget
      */
     protected function getControlForm()
     {
-        $key = 'disable-' . $this->plugin;
+        $key = 'disable-' . $this->pluginName;
         if (common_config('plugins', $key)) {
-            return new PluginEnableForm($this->out, $this->plugin);
+            return new PluginEnableForm($this->out, $this->pluginName);
         } else {
-            return new PluginDisableForm($this->out, $this->plugin);
+            return new PluginDisableForm($this->out, $this->pluginName);
         }
     }
 
@@ -180,7 +180,7 @@ class PluginListItem extends Widget
             // hack for URL shorteners... "LilUrl (ur1.ca)" etc
             list($name, ) = explode(' ', $info['name']);
 
-            if ($name == $this->plugin) {
+            if ($name == $this->pluginName) {
                 if ($found) {
                     // hack for URL shorteners...
                     $found['rawdescription'] .= "<br />\n" . $info['rawdescription'];
@@ -193,7 +193,7 @@ class PluginListItem extends Widget
         if ($found) {
             return $found;
         } else {
-            return array('name' => $this->plugin,
+            return array('name' => $this->pluginName,
                          // TRANS: Plugin description for a disabled plugin.
                          'rawdescription' => _m('plugin-description','(The plugin description is unavailable when a plugin has been disabled.)'));
         }