Commit 4adafb56 authored by mainlove's avatar mainlove

忽略没有配置的插件的页面‘设置菜单’

parent 12d6d54f
......@@ -19,6 +19,8 @@ package org.b3log.solo.util;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang.StringUtils;
import org.b3log.latke.Keys;
import org.b3log.latke.model.Plugin;
import org.b3log.latke.plugin.AbstractPlugin;
......@@ -27,6 +29,7 @@ import org.b3log.latke.repository.Query;
import org.b3log.latke.util.CollectionUtils;
import org.b3log.solo.repository.impl.PluginRepositoryImpl;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -73,8 +76,16 @@ public final class Plugins {
if (null != plugin) {
final String status = oldPluginDesc.getString(Plugin.PLUGIN_STATUS);
final String setting = oldPluginDesc.optString(Plugin.PLUGIN_SETTING);
plugin.setStatus(PluginStatus.valueOf(status));
try {
if (StringUtils.isNotBlank(setting)) {
plugin.setSetting(new JSONObject(setting));
}
} catch (final JSONException e) {
LOGGER.log(Level.WARNING, "the formatter of the old config failed to convert to json", e);
}
}
}
......
......@@ -4,7 +4,6 @@
${setting}
</textarea>
<input type="hidden" id="pluginId" value="${oId}">
<button class="marginRight12" id="updateSetting" onclick="updateSetting()">save</button>
......
......@@ -3059,8 +3059,10 @@ admin.pluginList = {
}
datas[i].expendRow += "</a> ";
if(datas[i].setting!="{}"){
datas[i].expendRow +="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+datas[i].oId+"')\"> "+Label.settingLabel+" </a> ";
}
}
that.tablePagination.updateTablePagination(result.plugins, pageNum, result.pagination);
......@@ -3068,15 +3070,7 @@ admin.pluginList = {
}
});
},
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
>>>>>>> 692cfe019926f553440bb6a3e2517360118353a7
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
toSetting:function(pluginId){
$("#loadMsg").text(Label.loadingLabel);
......@@ -3092,7 +3086,7 @@ admin.pluginList = {
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
<<<<<<< HEAD
$("#PluginSetting").html(result);
$("#PluginSetting").dialog({
width: 700,
......@@ -3100,37 +3094,16 @@ admin.pluginList = {
"modal": true,
"hideFooter": true
});
$("#PluginSetting").dialog("open");
=======
<<<<<<< HEAD
$("#PluginSetting").html(result);
$("#PluginSetting").dialog({
width: 700,
height: 190,
"modal": true,
"hideFooter": true
});
$("#PluginSetting").dialog("open");
=======
$("#pluginSetting").html(result);
$("#pluginSetting").dialog("open");
>>>>>>> 692cfe019926f553440bb6a3e2517360118353a7
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
$("#loadMsg").text("");
}
});
},
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
>>>>>>> 692cfe019926f553440bb6a3e2517360118353a7
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
changeStatus: function (pluginId, status) {
if (status === "ENABLED") {
status = "DISABLED";
......@@ -3173,15 +3146,7 @@ admin.register["plugin-list"] = {
"refresh": function () {
$("#loadMsg").text("");
}
<<<<<<< HEAD
}
=======
<<<<<<< HEAD
}
=======
}
>>>>>>> 692cfe019926f553440bb6a3e2517360118353a7
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -98,8 +98,10 @@ admin.pluginList = {
}
datas[i].expendRow += "</a> ";
if(datas[i].setting!="{}"){
datas[i].expendRow +="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+datas[i].oId+"')\"> "+Label.settingLabel+" </a> ";
}
}
that.tablePagination.updateTablePagination(result.plugins, pageNum, result.pagination);
......@@ -123,7 +125,7 @@ admin.pluginList = {
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
<<<<<<< HEAD
$("#PluginSetting").html(result);
$("#PluginSetting").dialog({
width: 700,
......@@ -131,22 +133,16 @@ admin.pluginList = {
"modal": true,
"hideFooter": true
});
$("#PluginSetting").dialog("open");
=======
$("#pluginSetting").html(result);
$("#pluginSetting").dialog("open");
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
$("#loadMsg").text("");
}
});
},
<<<<<<< HEAD
=======
>>>>>>> branch '0.5.6' of https://github.com/b3log/b3log-solo.git
changeStatus: function (pluginId, status) {
if (status === "ENABLED") {
status = "DISABLED";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment