Commit c8e34a60 authored by Liang Ding's avatar Liang Ding

Fixed #27

parent 272d51ab
...@@ -35,13 +35,15 @@ import org.b3log.solo.service.PageQueryService; ...@@ -35,13 +35,15 @@ import org.b3log.solo.service.PageQueryService;
import org.b3log.solo.util.QueryResults; import org.b3log.solo.util.QueryResults;
import org.b3log.solo.util.Users; import org.b3log.solo.util.Users;
import org.b3log.latke.util.Requests; import org.b3log.latke.util.Requests;
import org.b3log.solo.model.Page;
import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
* Plugin console request processing. * Plugin console request processing.
* *
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.0, Oct 27, 2011 * @version 1.0.0.1, Jun 20, 2012
* @since 0.4.0 * @since 0.4.0
*/ */
@RequestProcessor @RequestProcessor
...@@ -419,6 +421,19 @@ public final class PageConsole { ...@@ -419,6 +421,19 @@ public final class PageConsole {
final JSONObject requestJSONObject = Requests.buildPaginationRequest(path); final JSONObject requestJSONObject = Requests.buildPaginationRequest(path);
final JSONObject result = pageQueryService.getPages(requestJSONObject); final JSONObject result = pageQueryService.getPages(requestJSONObject);
final JSONArray pages = result.optJSONArray(Page.PAGES);
// Site-internal URLs process
for (int i = 0; i < pages.length(); i++) {
final JSONObject page = pages.getJSONObject(i);
if ("page".equals(page.optString(Page.PAGE_TYPE))) {
final String permalink = page.optString(Page.PAGE_PERMALINK);
page.put(Page.PAGE_PERMALINK, Latkes.getServePath() + permalink);
}
}
result.put(Keys.STATUS_CODE, true); result.put(Keys.STATUS_CODE, true);
renderer.setJSONObject(result); renderer.setJSONObject(result);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.0, Jun 20, 2012 * @version 1.0.2.1, Jun 20, 2012
*/ */
/* page-list 相关操作 */ /* page-list 相关操作 */
...@@ -151,14 +151,14 @@ admin.pageList = { ...@@ -151,14 +151,14 @@ admin.pageList = {
</div>'; </div>';
} }
pageData[i].pageTitle = "<a class='no-underline' href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" + pageData[i].pageTitle = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>" +
pages[i].pageTitle + "</a>"; pages[i].pageTitle + "</a>";
pageData[i].pagePermalink = "<a class='no-underline' href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>"
+ pages[i].pagePermalink + "</a>"; + pages[i].pagePermalink + "</a>";
pageData[i].pageTarget = pages[i].pageOpenTarget; pageData[i].pageTarget = pages[i].pageOpenTarget;
pageData[i].pageType = pages[i].pageType ; pageData[i].pageType = pages[i].pageType ;
pageData[i].comments = pages[i].pageCommentCount; pageData[i].comments = pages[i].pageCommentCount;
pageData[i].expendRow = "<span><a href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \ pageData[i].expendRow = "<span><a href='" + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\ <a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.pageList.del('" + pages[i].oId + "')\">" + Label.removeLabel + "</a>\ <a href='javascript:void(0)' onclick=\"admin.pageList.del('" + pages[i].oId + "')\">" + Label.removeLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.comment.open('" + pages[i].oId + "', 'page')\">" + Label.commentLabel + "</a></span>"; <a href='javascript:void(0)' onclick=\"admin.comment.open('" + pages[i].oId + "', 'page')\">" + Label.commentLabel + "</a></span>";
......
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