mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.7.3.1
This commit is contained in:
@@ -21,7 +21,7 @@ public class Bfmtr_eval_wiki implements Bry_fmtr_eval_mgr {
|
||||
public boolean Enabled() {return enabled;} public void Enabled_(boolean v) {enabled = v;} private boolean enabled = true;
|
||||
public byte[] Eval(byte[] cmd) {
|
||||
Object rslt = GfsCore._.Exec_bry(cmd, wiki);
|
||||
return Bry_.new_utf8_(Object_.XtoStr_OrNullStr(rslt));
|
||||
return Bry_.new_utf8_(Object_.Xto_str_strict_or_null_mark(rslt));
|
||||
}
|
||||
public void Eval_mgr_(Bry_fmtr... fmtrs) {
|
||||
int fmtrs_len = fmtrs.length;
|
||||
|
||||
@@ -16,13 +16,14 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.xowa.langs.msgs.*;
|
||||
public class Xow_mainpage_finder {
|
||||
public static byte[] Find_or(Xow_wiki wiki, byte[] or) {
|
||||
Bry_bfr tmp_bfr = wiki.Utl_bry_bfr_mkr().Get_b512();
|
||||
Xol_msg_itm msg_itm = Pf_msg_mgr.Get_msg_itm(tmp_bfr, wiki, wiki.Lang(), Msg_mainpage);
|
||||
Xol_msg_itm msg_itm = Xol_msg_mgr_.Get_msg_itm(tmp_bfr, wiki, wiki.Lang(), Msg_mainpage);
|
||||
byte[] rv = msg_itm.Src_is_missing()
|
||||
? or
|
||||
: Pf_msg_mgr.Get_msg_val(tmp_bfr, wiki, msg_itm, Bry_.Ary_empty)
|
||||
: Xol_msg_mgr_.Get_msg_val(tmp_bfr, wiki, msg_itm, Bry_.Ary_empty)
|
||||
;
|
||||
tmp_bfr.Mkr_rls();
|
||||
return rv;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.xowa.html.sidebar.*;
|
||||
import gplx.xowa.html.sidebar.*; import gplx.xowa.langs.msgs.*;
|
||||
public class Xow_msg_mgr implements GfoInvkAble {
|
||||
private Xow_wiki wiki; private Xol_lang lang; private Xol_msg_mgr msg_mgr;
|
||||
public Xow_msg_mgr(Xow_wiki wiki, Xol_lang lang) {
|
||||
@@ -43,7 +43,7 @@ public class Xow_msg_mgr implements GfoInvkAble {
|
||||
Xol_msg_itm itm = msg_mgr.Itm_by_key_or_null(key);
|
||||
if (itm == null) {
|
||||
Bry_bfr tmp_bfr = wiki.Utl_bry_bfr_mkr().Get_b512();
|
||||
itm = Pf_msg_mgr.Get_msg_itm(tmp_bfr, wiki, lang, key);
|
||||
itm = Xol_msg_mgr_.Get_msg_itm(tmp_bfr, wiki, lang, key);
|
||||
if (itm.Src_is_missing()) itm = null;
|
||||
tmp_bfr.Mkr_rls();
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class Xow_msg_mgr implements GfoInvkAble {
|
||||
Xol_msg_itm itm = msg_mgr.Itm_by_key_or_null(key);
|
||||
Bry_bfr tmp_bfr = wiki.Utl_bry_bfr_mkr().Get_b512();
|
||||
if (itm == null)
|
||||
itm = Pf_msg_mgr.Get_msg_itm(tmp_bfr, wiki, lang, key);
|
||||
itm = Xol_msg_mgr_.Get_msg_itm(tmp_bfr, wiki, lang, key);
|
||||
if (itm.Src_is_missing()) {
|
||||
tmp_bfr.Mkr_rls();
|
||||
return Bry_.Empty;
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
public class Xow_ns_ {
|
||||
public static final int // EX.WP: http://www.mediawiki.org/wiki/Help:Namespaces
|
||||
public static final int // PAGE:en.w:http://www.mediawiki.org/wiki/Help:Namespaces
|
||||
Id_media = -2
|
||||
, Id_special = -1
|
||||
, Id_main = 0 , Id_talk = 1
|
||||
|
||||
@@ -244,7 +244,7 @@ public class Xow_ns_mgr implements GfoInvkAble, gplx.lists.ComparerAble {
|
||||
byte[] line = lines[i];
|
||||
if (line.length == 0) continue;
|
||||
byte[][] flds = Bry_.Split(line, Byte_ascii.Pipe);
|
||||
int cur_id = Bry_.X_to_int_or(flds[0], Int_.MinValue);
|
||||
int cur_id = Bry_.Xto_int_or(flds[0], Int_.MinValue);
|
||||
this.Aliases_add(cur_id, String_.new_utf8_(flds[1]));
|
||||
}
|
||||
Ords_sort();
|
||||
|
||||
@@ -223,7 +223,7 @@ public class Xow_wiki implements GfoInvkAble {
|
||||
app.Gfs_mgr().Run_url_for(this, user.Fsys_mgr().Wiki_root_dir().GenSubFil_nest("#cfg", "system", domain_str + ".gfs")); // run cfg for wiki by user ; EX: /xowa/user/anonymous/wiki/en.wikipedia.org/cfg/user_wiki.gfs
|
||||
fsys_mgr.Scan_dirs();
|
||||
if (lang.Init_by_load()) {
|
||||
if (domain_tid == Xow_wiki_domain_.Tid_wikipedia) // NOTE: if type is wikipedia, add "Wikipedia" as an alias; EX.WP: pt.wikipedia.org/wiki/Página principal which redirects to Wikipedia:Página principal
|
||||
if (domain_tid == Xow_wiki_domain_.Tid_wikipedia) // NOTE: if type is wikipedia, add "Wikipedia" as an alias; PAGE:en.w:pt.wikipedia.org/wiki/Página principal which redirects to Wikipedia:Página principal
|
||||
ns_mgr.Aliases_add(Xow_ns_.Id_project, Xow_ns_.Ns_name_wikipedia);
|
||||
}
|
||||
cfg_parser.Xtns().Itm_pages().Init(ns_mgr); // init ns_mgr for Page / Index ns just before rebuild; usually set by #cfg file
|
||||
|
||||
Reference in New Issue
Block a user