From: Roland Haeder Date: Sat, 12 Sep 2015 06:37:58 +0000 (+0200) Subject: Always naming it 'plugin' is not good, it can easily confuse. So better name it X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c4f60ab444ab4768d12c5a4e6de010b185da7528;p=quix0rs-gnu-social.git Always naming it 'plugin' is not good, it can easily confuse. So better name it 'pluginName' when it is actually only the name of the plugin and 'plugin' if it is the Plugin instance. Signed-off-by: Roland Haeder --- diff --git a/lib/pluginlist.php b/lib/pluginlist.php index 038b08a18f..19825ade17 100644 --- a/lib/pluginlist.php +++ b/lib/pluginlist.php @@ -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'] .= "
\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.)')); }