mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
TemplateStyles: Add templatestyles to html.head [#314]
This commit is contained in:
@@ -56,6 +56,7 @@ public class Xow_page_cache {
|
||||
boolean page_exists = false;
|
||||
byte[] page_text = null;
|
||||
byte[] page_redirect_from = null;
|
||||
int page_id = -1;
|
||||
// gplx.core.consoles.Console_adp__sys.Instance.Write_str("page_cache:" + String_.new_u8(ttl_full_db));
|
||||
if (load_wkr != null) {
|
||||
page_text = load_wkr.Get_page_or_null(ttl_full_db);
|
||||
@@ -67,9 +68,10 @@ public class Xow_page_cache {
|
||||
page_text = page.Db().Text().Text_bry();
|
||||
page_exists = page.Db().Page().Exists();
|
||||
page_redirect_from = page.Redirect_trail().Itms__get_wtxt_at_0th_or_null();
|
||||
page_id = page.Db().Page().Id();
|
||||
}
|
||||
if (page_exists) {
|
||||
rv = new Xow_page_cache_itm(false, page_ttl, page_text, page_redirect_from);
|
||||
rv = new Xow_page_cache_itm(false, page_id, page_ttl, page_text, page_redirect_from);
|
||||
Add_safe(ttl_full_db, rv);
|
||||
}
|
||||
else {
|
||||
@@ -86,7 +88,7 @@ public class Xow_page_cache {
|
||||
Xoae_page page = wiki.Data_mgr().Load_page_by_ttl(ttl); // NOTE: do not call Db_mgr.Load_page; need to handle redirects
|
||||
if ( page.Db().Page().Exists() // page exists
|
||||
|| page.Redirect_trail().Itms__len() > 0 ) { // page redirects to missing page; note that page.Missing == true and page.Redirected_src() != null; PAGE: en.w:Shah_Rukh_Khan; DATE:2016-05-02
|
||||
rv = new Xow_page_cache_itm(false, page.Ttl(), page.Db().Text().Text_bry(), page.Redirect_trail().Itms__get_wtxt_at_0th_or_null());
|
||||
rv = new Xow_page_cache_itm(false, page.Db().Page().Id(), page.Ttl(), page.Db().Text().Text_bry(), page.Redirect_trail().Itms__get_wtxt_at_0th_or_null());
|
||||
Add_safe(ttl_full_db, rv);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -16,9 +16,9 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
package gplx.xowa.wikis.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
|
||||
import gplx.xowa.wikis.data.tbls.*;
|
||||
public class Xow_page_cache_itm implements Xowd_text_bry_owner {
|
||||
public Xow_page_cache_itm(boolean cache_permanently, Xoa_ttl ttl, byte[] wtxt__direct, byte[] wtxt__redirect) {
|
||||
public Xow_page_cache_itm(boolean cache_permanently, int page_id, Xoa_ttl ttl, byte[] wtxt__direct, byte[] wtxt__redirect) {
|
||||
this.cache_permanently = cache_permanently;
|
||||
this.ttl = ttl; this.wtxt__direct = wtxt__direct; this.wtxt__redirect = wtxt__redirect;
|
||||
this.page_id = page_id; this.ttl = ttl; this.wtxt__direct = wtxt__direct; this.wtxt__redirect = wtxt__redirect;
|
||||
}
|
||||
public Xoa_ttl Ttl() {return ttl;} private Xoa_ttl ttl;
|
||||
public byte[] Wtxt__direct() {return wtxt__direct;} private byte[] wtxt__direct;
|
||||
@@ -32,7 +32,7 @@ public class Xow_page_cache_itm implements Xowd_text_bry_owner {
|
||||
public int Page_id() {return page_id;} private int page_id;
|
||||
public int Redirect_id() {return redirect_id;} private int redirect_id;
|
||||
public void Set_text_bry_by_db(byte[] v) {this.wtxt__direct = v;}
|
||||
public void Set_page_ids(int page_id, int redirect_id) {this.page_id = page_id; this.redirect_id = redirect_id;}
|
||||
public void Redirect_id_(int v) {this.redirect_id = v;}
|
||||
public void Set_redirect(Xoa_ttl ttl, byte[] trg_wtxt) {
|
||||
this.ttl = ttl;
|
||||
this.wtxt__redirect = wtxt__direct;
|
||||
@@ -40,5 +40,5 @@ public class Xow_page_cache_itm implements Xowd_text_bry_owner {
|
||||
}
|
||||
|
||||
public static final Xow_page_cache_itm Null = null;
|
||||
public static final Xow_page_cache_itm Missing = new Xow_page_cache_itm(false, null, null, null);
|
||||
public static final Xow_page_cache_itm Missing = new Xow_page_cache_itm(false, -1, null, null, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user