1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2016-01-17 23:18:07 -05:00
parent 096045614c
commit 235228976e
314 changed files with 4458 additions and 2694 deletions

View File

@@ -37,13 +37,13 @@ public class Pfunc_ifexist_tst {
}
@Test public void Media_y_commons() {// DATE:2014-07-04
Pfunc_ifexist.Mgr.Clear();
Xowe_wiki commons_wiki = fxt.App().Wiki_mgr().Get_by_key_or_make(gplx.xowa.wikis.domains.Xow_domain_itm_.Bry__commons);
Xowe_wiki commons_wiki = fxt.App().Wiki_mgr().Get_by_or_make(gplx.xowa.wikis.domains.Xow_domain_itm_.Bry__commons);
fxt.Init_page_create(commons_wiki, "File:A.png", "");
fxt.Test_parse_tmpl_str_test("{{#ifexist:Media:A.png|y|n}}", "{{test}}", "y");
}
@Test public void Media_y_file_v1() {// DATE:2014-07-04
Pfunc_ifexist.Mgr.Clear();
Xof_meta_itm meta_itm = fxt.Wiki().File_mgr().Meta_mgr().Get_itm_or_new(Bry_.new_a7("A.png"));
Xof_meta_itm meta_itm = fxt.Wiki().File_mgr().Dbmeta_mgr().Get_itm_or_new(Bry_.new_a7("A.png"));
meta_itm.Orig_exists_(Bool_.Y_byte);
fxt.Test_parse_tmpl_str_test("{{#ifexist:Media:A.png|y|n}}", "{{test}}", "y");
}

View File

@@ -97,7 +97,7 @@ class Pf_msg_mgr_fxt {
public void Init_msg_db(Xowe_wiki wiki, String ttl, String val) {
fxt.Init_page_create(wiki, "MediaWiki:" + ttl, val);
}
public Xowe_wiki Make_wiki(String domain) {return fxt.App().Wiki_mgr().Get_by_key_or_make(Bry_.new_u8(domain));}
public Xowe_wiki Make_wiki(String domain) {return fxt.App().Wiki_mgr().Get_by_or_make(Bry_.new_u8(domain));}
public void Test_parse_en(String raw, String expd) {
fxt.Test_parse_tmpl_str_test(raw, "{{test}}" , expd);
}

View File

@@ -51,7 +51,7 @@ public class Pfunc_filepath extends Pf_func_base {
private static Xoae_page Load_page(Xowe_wiki wiki, Xoa_ttl ttl) {
Xoae_page page = wiki.Data_mgr().Get_page(ttl, false);
if (page.Missing()) { // file not found in current wiki; try commons;
Xowe_wiki commons_wiki = wiki.Appe().Wiki_mgr().Get_by_key_or_null(wiki.Commons_wiki_key());
Xowe_wiki commons_wiki = (Xowe_wiki)wiki.Appe().Wiki_mgr().Get_by_or_null(wiki.Commons_wiki_key());
if (commons_wiki != null) { // commons_wiki not installed; exit; DATE:2013-06-08
if (!Env_.Mode_testing()) commons_wiki.Init_assert();// must assert load else page_zip never detected; DATE:2013-03-10
page = commons_wiki.Data_mgr().Get_page(ttl, false);