Don't show update button when there is no update

This commit is contained in:
Max Klaversma 2014-04-16 01:42:40 +02:00 committed by Steffen Schröder
parent 9de5c340c3
commit 78ea617a53

View File

@ -336,15 +336,17 @@ class PluginMenu implements CallbackListener, ConfiguratorMenu, ManialinkPageAns
}
$numberOfOutdated = $this->maniaControl->updateManager->getNumberOfOutdatedPlugins();
$updatePluginsButton = new Label_Button();
$frame->add($updatePluginsButton);
$updatePluginsButton->setHAlign(Control::RIGHT);
$updatePluginsButton->setX($width * 0.1);
$updatePluginsButton->setY(-35.5);
$updatePluginsButton->setZ(2);
$updatePluginsButton->setStyle($updatePluginsButton::STYLE_CardButtonSmall);
$updatePluginsButton->setText('Update '.$numberOfOutdated.' plugin(s)');
$updatePluginsButton->setAction(self::ACTION_UPDATEPLUGINS);
if($numberOfOutdated > 0) {
$updatePluginsButton = new Label_Button();
$frame->add($updatePluginsButton);
$updatePluginsButton->setHAlign(Control::RIGHT);
$updatePluginsButton->setX($width * 0.1);
$updatePluginsButton->setY(-35.5);
$updatePluginsButton->setZ(2);
$updatePluginsButton->setStyle($updatePluginsButton::STYLE_CardButtonSmall);
$updatePluginsButton->setText('Update '.$numberOfOutdated.' plugin(s)');
$updatePluginsButton->setAction(self::ACTION_UPDATEPLUGINS);
}
return $frame;
}