Changeset 8a7c339


Ignore:
Timestamp:
Aug 30, 2014 4:14:41 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fa1c077f
Parents:
2302aee8
Message:

/configclients:

  • Re-enable plugin installation by default
  • Don't show configuration section or update-all button if no plugins installed
Location:
apps/routerconsole
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r2302aee8 r8a7c339  
    6060        if (_action.equals(_("Install Plugin"))) {
    6161            if (pluginsEnabled &&
    62                 (_context.getBooleanProperty(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
     62                (_context.getBooleanPropertyDefaultTrue(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
    6363                 isAdvanced()))
    6464                installPlugin();
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java

    r2302aee8 r8a7c339  
    4040    public boolean isPluginInstallEnabled() {
    4141        return PluginStarter.pluginsEnabled(_context) &&
    42                (_context.getBooleanProperty(PROP_ENABLE_PLUGIN_INSTALL) || isAdvanced());
     42               (_context.getBooleanPropertyDefaultTrue(PROP_ENABLE_PLUGIN_INSTALL) || isAdvanced());
     43    }
     44
     45    /** @since 0.9.15 */
     46    public boolean isPluginUpdateEnabled() {
     47        return !PluginStarter.getPlugins().isEmpty();
    4348    }
    4449
  • apps/routerconsole/jsp/configclients.jsp

    r2302aee8 r8a7c339  
    106106</div></form></div>
    107107
    108 <% if (clientshelper.showPlugins()) { %>
     108<%
     109   if (clientshelper.showPlugins()) {
     110       if (clientshelper.isPluginUpdateEnabled()) {
     111%>
    109112<h3><a name="pconfig"></a><%=intl._("Plugin Configuration")%></h3><p>
    110113 <%=intl._("The plugins listed below are started by the webConsole client.")%>
     
    117120 <input type="submit" name="action" class="accept" value="<%=intl._("Save Plugin Configuration")%>" />
    118121</div></form></div>
    119 
    120 <% if (clientshelper.isPluginInstallEnabled()) { %>
     122<%
     123       } // pluginUpdateEnabled
     124       if (clientshelper.isPluginInstallEnabled()) {
     125%>
    121126<h3><a name="plugin"></a><%=intl._("Plugin Installation")%></h3><p>
    122127 <%=intl._("Look for available plugins on {0}.", "<a href=\"http://plugins.i2p\">plugins.i2p</a>")%>
    123128 <%=intl._("To install a plugin, enter the download URL:")%>
    124  </p><div class="wideload">
     129 </p>
     130<%
     131       } // pluginInstallEnabled
     132       if (clientshelper.isPluginInstallEnabled() || clientshelper.isPluginUpdateEnabled()) {
     133%>
     134<div class="wideload">
    125135<form action="configclients" method="POST">
    126136<input type="hidden" name="nonce" value="<%=pageNonce%>" >
     137<%
     138           if (clientshelper.isPluginInstallEnabled()) {
     139%>
    127140<p>
    128141 <input type="text" size="60" name="pluginURL" >
     
    131144 <input type="submit" class="cancel" name="foo" value="<%=intl._("Cancel")%>" />
    132145 <input type="submit" name="action" class="download" value="<%=intl._("Install Plugin")%>" />
    133 </div><hr><div class="formaction">
     146</div>
     147<%
     148           } // pluginInstallEnabled
     149%>
     150</div>
     151<%
     152           if (clientshelper.isPluginUpdateEnabled()) {
     153%>
     154<hr><div class="formaction">
    134155 <input type="submit" name="action" class="reload" value="<%=intl._("Update All Installed Plugins")%>" />
    135  </div></form></div>
     156</div>
    136157<%
    137      } // pluginInstallEnabled
    138  } // showPlugins
     158           } // pluginUpdateEnabled
     159%>
     160</form></div>
     161<%
     162       } // pluginInstallEnabled || pluginUpdateEnabled
     163   } // showPlugins
    139164%>
    140165</div></div></body></html>
Note: See TracChangeset for help on using the changeset viewer.