From 0bcc962131f793f4c2c71f307caa6e991b05ca69 Mon Sep 17 00:00:00 2001 From: Ilya Utkin Date: Wed, 5 Oct 2022 16:30:23 +0300 Subject: [PATCH 01/10] Add compatibility with MODX 3 --- .gitignore | 2 + _build/build.php | 729 ++++++++++++++++++ _build/config.inc.php | 43 ++ _build/elements/_policies.php | 10 + _build/elements/_policy_templates.php | 11 + _build/elements/_resources.php | 33 + _build/elements/_templates.php | 8 + _build/elements/_widgets.php | 12 + _build/elements/chunks.php | 16 + _build/elements/menus.php | 9 + _build/elements/plugins.php | 26 + _build/elements/settings.php | 49 ++ _build/elements/snippets.php | 86 +++ _build/lingua/build.config.sample.php | 5 - _build/lingua/build.transport.php | 247 ------ ...ault.lingua.getvalue.snippet.properties.js | 1 - ...ault.lingua.selector.snippet.properties.js | 1 - .../lingua.getvalue.snippet.properties.php | 55 -- .../lingua.selector.snippet.properties.php | 55 -- _build/lingua/data/transport.menu.php | 50 -- .../lingua/data/transport.plugin.events.php | 59 -- _build/lingua/data/transport.plugins.php | 63 -- _build/lingua/data/transport.settings.php | 109 --- _build/lingua/data/transport.snippets.php | 86 --- _build/lingua/resolvers/tables.resolver.php | 89 --- _build/lingua/validators/tables.validator.php | 60 -- _build/resolvers/tables.php | 146 ++++ .../components/lingua/conn/mgr.php | 10 +- .../components/lingua/css/mgr.css | 0 .../lingua/icons/flags/gif/.DS_Store | Bin .../components/lingua/icons/flags/gif/ad.gif | Bin .../components/lingua/icons/flags/gif/ae.gif | Bin .../components/lingua/icons/flags/gif/af.gif | Bin .../components/lingua/icons/flags/gif/ag.gif | Bin .../components/lingua/icons/flags/gif/ai.gif | Bin .../components/lingua/icons/flags/gif/al.gif | Bin .../components/lingua/icons/flags/gif/am.gif | Bin .../components/lingua/icons/flags/gif/an.gif | Bin .../components/lingua/icons/flags/gif/ao.gif | Bin .../components/lingua/icons/flags/gif/ar.gif | Bin .../components/lingua/icons/flags/gif/as.gif | Bin .../components/lingua/icons/flags/gif/at.gif | Bin .../components/lingua/icons/flags/gif/au.gif | Bin .../components/lingua/icons/flags/gif/aw.gif | Bin .../components/lingua/icons/flags/gif/ax.gif | Bin .../components/lingua/icons/flags/gif/az.gif | Bin .../components/lingua/icons/flags/gif/ba.gif | Bin .../components/lingua/icons/flags/gif/bb.gif | Bin .../components/lingua/icons/flags/gif/bd.gif | Bin .../components/lingua/icons/flags/gif/be.gif | Bin .../components/lingua/icons/flags/gif/bf.gif | Bin .../components/lingua/icons/flags/gif/bg.gif | Bin .../components/lingua/icons/flags/gif/bh.gif | Bin .../components/lingua/icons/flags/gif/bi.gif | Bin .../components/lingua/icons/flags/gif/bj.gif | Bin .../components/lingua/icons/flags/gif/bm.gif | Bin .../components/lingua/icons/flags/gif/bn.gif | Bin .../components/lingua/icons/flags/gif/bo.gif | Bin .../components/lingua/icons/flags/gif/br.gif | Bin .../components/lingua/icons/flags/gif/bs.gif | Bin .../components/lingua/icons/flags/gif/bt.gif | Bin .../components/lingua/icons/flags/gif/bv.gif | Bin .../components/lingua/icons/flags/gif/bw.gif | Bin .../components/lingua/icons/flags/gif/by.gif | Bin .../components/lingua/icons/flags/gif/bz.gif | Bin .../components/lingua/icons/flags/gif/ca.gif | Bin .../lingua/icons/flags/gif/catalonia.gif | Bin .../components/lingua/icons/flags/gif/cc.gif | Bin .../components/lingua/icons/flags/gif/cd.gif | Bin .../components/lingua/icons/flags/gif/cf.gif | Bin .../components/lingua/icons/flags/gif/cg.gif | Bin .../components/lingua/icons/flags/gif/ch.gif | Bin .../components/lingua/icons/flags/gif/ci.gif | Bin .../components/lingua/icons/flags/gif/ck.gif | Bin .../components/lingua/icons/flags/gif/cl.gif | Bin .../components/lingua/icons/flags/gif/cm.gif | Bin .../components/lingua/icons/flags/gif/cn.gif | Bin .../components/lingua/icons/flags/gif/co.gif | Bin .../components/lingua/icons/flags/gif/cr.gif | Bin .../components/lingua/icons/flags/gif/cs.gif | Bin .../components/lingua/icons/flags/gif/cu.gif | Bin .../components/lingua/icons/flags/gif/cv.gif | Bin .../components/lingua/icons/flags/gif/cx.gif | Bin .../components/lingua/icons/flags/gif/cy.gif | Bin .../components/lingua/icons/flags/gif/cz.gif | Bin .../components/lingua/icons/flags/gif/de.gif | Bin .../components/lingua/icons/flags/gif/dj.gif | Bin .../components/lingua/icons/flags/gif/dk.gif | Bin .../components/lingua/icons/flags/gif/dm.gif | Bin .../components/lingua/icons/flags/gif/do.gif | Bin .../components/lingua/icons/flags/gif/dz.gif | Bin .../components/lingua/icons/flags/gif/ec.gif | Bin .../components/lingua/icons/flags/gif/ee.gif | Bin .../components/lingua/icons/flags/gif/eg.gif | Bin .../components/lingua/icons/flags/gif/eh.gif | Bin .../lingua/icons/flags/gif/england.gif | Bin .../components/lingua/icons/flags/gif/er.gif | Bin .../components/lingua/icons/flags/gif/es.gif | Bin .../components/lingua/icons/flags/gif/et.gif | Bin .../lingua/icons/flags/gif/europeanunion.gif | Bin .../components/lingua/icons/flags/gif/fam.gif | Bin .../components/lingua/icons/flags/gif/fi.gif | Bin .../components/lingua/icons/flags/gif/fj.gif | Bin .../components/lingua/icons/flags/gif/fk.gif | Bin .../components/lingua/icons/flags/gif/fm.gif | Bin .../components/lingua/icons/flags/gif/fo.gif | Bin .../components/lingua/icons/flags/gif/fr.gif | Bin .../components/lingua/icons/flags/gif/ga.gif | Bin .../components/lingua/icons/flags/gif/gb.gif | Bin .../components/lingua/icons/flags/gif/gd.gif | Bin .../components/lingua/icons/flags/gif/ge.gif | Bin .../components/lingua/icons/flags/gif/gf.gif | Bin .../components/lingua/icons/flags/gif/gh.gif | Bin .../components/lingua/icons/flags/gif/gi.gif | Bin .../components/lingua/icons/flags/gif/gl.gif | Bin .../components/lingua/icons/flags/gif/gm.gif | Bin .../components/lingua/icons/flags/gif/gn.gif | Bin .../components/lingua/icons/flags/gif/gp.gif | Bin .../components/lingua/icons/flags/gif/gq.gif | Bin .../components/lingua/icons/flags/gif/gr.gif | Bin .../components/lingua/icons/flags/gif/gs.gif | Bin .../components/lingua/icons/flags/gif/gt.gif | Bin .../components/lingua/icons/flags/gif/gu.gif | Bin .../components/lingua/icons/flags/gif/gw.gif | Bin .../components/lingua/icons/flags/gif/gy.gif | Bin .../components/lingua/icons/flags/gif/hk.gif | Bin .../components/lingua/icons/flags/gif/hm.gif | Bin .../components/lingua/icons/flags/gif/hn.gif | Bin .../components/lingua/icons/flags/gif/hr.gif | Bin .../components/lingua/icons/flags/gif/ht.gif | Bin .../components/lingua/icons/flags/gif/hu.gif | Bin .../components/lingua/icons/flags/gif/id.gif | Bin .../components/lingua/icons/flags/gif/ie.gif | Bin .../components/lingua/icons/flags/gif/il.gif | Bin .../components/lingua/icons/flags/gif/in.gif | Bin .../components/lingua/icons/flags/gif/io.gif | Bin .../components/lingua/icons/flags/gif/iq.gif | Bin .../components/lingua/icons/flags/gif/ir.gif | Bin .../components/lingua/icons/flags/gif/is.gif | Bin .../components/lingua/icons/flags/gif/it.gif | Bin .../components/lingua/icons/flags/gif/jm.gif | Bin .../components/lingua/icons/flags/gif/jo.gif | Bin .../components/lingua/icons/flags/gif/jp.gif | Bin .../components/lingua/icons/flags/gif/ke.gif | Bin .../components/lingua/icons/flags/gif/kg.gif | Bin .../components/lingua/icons/flags/gif/kh.gif | Bin .../components/lingua/icons/flags/gif/ki.gif | Bin .../components/lingua/icons/flags/gif/km.gif | Bin .../components/lingua/icons/flags/gif/kn.gif | Bin .../components/lingua/icons/flags/gif/kp.gif | Bin .../components/lingua/icons/flags/gif/kr.gif | Bin .../components/lingua/icons/flags/gif/kw.gif | Bin .../components/lingua/icons/flags/gif/ky.gif | Bin .../components/lingua/icons/flags/gif/kz.gif | Bin .../components/lingua/icons/flags/gif/la.gif | Bin .../components/lingua/icons/flags/gif/lb.gif | Bin .../components/lingua/icons/flags/gif/lc.gif | Bin .../components/lingua/icons/flags/gif/li.gif | Bin .../components/lingua/icons/flags/gif/lk.gif | Bin .../components/lingua/icons/flags/gif/lr.gif | Bin .../components/lingua/icons/flags/gif/ls.gif | Bin .../components/lingua/icons/flags/gif/lt.gif | Bin .../components/lingua/icons/flags/gif/lu.gif | Bin .../components/lingua/icons/flags/gif/lv.gif | Bin .../components/lingua/icons/flags/gif/ly.gif | Bin .../components/lingua/icons/flags/gif/ma.gif | Bin .../components/lingua/icons/flags/gif/mc.gif | Bin .../components/lingua/icons/flags/gif/md.gif | Bin .../components/lingua/icons/flags/gif/me.gif | Bin .../components/lingua/icons/flags/gif/mg.gif | Bin .../components/lingua/icons/flags/gif/mh.gif | Bin .../components/lingua/icons/flags/gif/mk.gif | Bin .../components/lingua/icons/flags/gif/ml.gif | Bin .../components/lingua/icons/flags/gif/mm.gif | Bin .../components/lingua/icons/flags/gif/mn.gif | Bin .../components/lingua/icons/flags/gif/mo.gif | Bin .../components/lingua/icons/flags/gif/mp.gif | Bin .../components/lingua/icons/flags/gif/mq.gif | Bin .../components/lingua/icons/flags/gif/mr.gif | Bin .../components/lingua/icons/flags/gif/ms.gif | Bin .../components/lingua/icons/flags/gif/mt.gif | Bin .../components/lingua/icons/flags/gif/mu.gif | Bin .../components/lingua/icons/flags/gif/mv.gif | Bin .../components/lingua/icons/flags/gif/mw.gif | Bin .../components/lingua/icons/flags/gif/mx.gif | Bin .../components/lingua/icons/flags/gif/my.gif | Bin .../components/lingua/icons/flags/gif/mz.gif | Bin .../components/lingua/icons/flags/gif/na.gif | Bin .../components/lingua/icons/flags/gif/nc.gif | Bin .../components/lingua/icons/flags/gif/ne.gif | Bin .../components/lingua/icons/flags/gif/nf.gif | Bin .../components/lingua/icons/flags/gif/ng.gif | Bin .../components/lingua/icons/flags/gif/ni.gif | Bin .../components/lingua/icons/flags/gif/nl.gif | Bin .../components/lingua/icons/flags/gif/no.gif | Bin .../components/lingua/icons/flags/gif/np.gif | Bin .../components/lingua/icons/flags/gif/nr.gif | Bin .../components/lingua/icons/flags/gif/nu.gif | Bin .../components/lingua/icons/flags/gif/nz.gif | Bin .../components/lingua/icons/flags/gif/om.gif | Bin .../components/lingua/icons/flags/gif/pa.gif | Bin .../components/lingua/icons/flags/gif/pe.gif | Bin .../components/lingua/icons/flags/gif/pf.gif | Bin .../components/lingua/icons/flags/gif/pg.gif | Bin .../components/lingua/icons/flags/gif/ph.gif | Bin .../components/lingua/icons/flags/gif/pk.gif | Bin .../components/lingua/icons/flags/gif/pl.gif | Bin .../components/lingua/icons/flags/gif/pm.gif | Bin .../components/lingua/icons/flags/gif/pn.gif | Bin .../components/lingua/icons/flags/gif/pr.gif | Bin .../components/lingua/icons/flags/gif/ps.gif | Bin .../components/lingua/icons/flags/gif/pt.gif | Bin .../components/lingua/icons/flags/gif/pw.gif | Bin .../components/lingua/icons/flags/gif/py.gif | Bin .../components/lingua/icons/flags/gif/qa.gif | Bin .../components/lingua/icons/flags/gif/re.gif | Bin .../components/lingua/icons/flags/gif/ro.gif | Bin .../components/lingua/icons/flags/gif/rs.gif | Bin .../components/lingua/icons/flags/gif/ru.gif | Bin .../components/lingua/icons/flags/gif/rw.gif | Bin .../components/lingua/icons/flags/gif/sa.gif | Bin .../components/lingua/icons/flags/gif/sb.gif | Bin .../components/lingua/icons/flags/gif/sc.gif | Bin .../lingua/icons/flags/gif/scotland.gif | Bin .../components/lingua/icons/flags/gif/sd.gif | Bin .../components/lingua/icons/flags/gif/se.gif | Bin .../components/lingua/icons/flags/gif/sg.gif | Bin .../components/lingua/icons/flags/gif/sh.gif | Bin .../components/lingua/icons/flags/gif/si.gif | Bin .../components/lingua/icons/flags/gif/sj.gif | Bin .../components/lingua/icons/flags/gif/sk.gif | Bin .../components/lingua/icons/flags/gif/sl.gif | Bin .../components/lingua/icons/flags/gif/sm.gif | Bin .../components/lingua/icons/flags/gif/sn.gif | Bin .../components/lingua/icons/flags/gif/so.gif | Bin .../components/lingua/icons/flags/gif/sr.gif | Bin .../components/lingua/icons/flags/gif/st.gif | Bin .../components/lingua/icons/flags/gif/sv.gif | Bin .../components/lingua/icons/flags/gif/sy.gif | Bin .../components/lingua/icons/flags/gif/sz.gif | Bin .../components/lingua/icons/flags/gif/tc.gif | Bin .../components/lingua/icons/flags/gif/td.gif | Bin .../components/lingua/icons/flags/gif/tf.gif | Bin .../components/lingua/icons/flags/gif/tg.gif | Bin .../components/lingua/icons/flags/gif/th.gif | Bin .../components/lingua/icons/flags/gif/tj.gif | Bin .../components/lingua/icons/flags/gif/tk.gif | Bin .../components/lingua/icons/flags/gif/tl.gif | Bin .../components/lingua/icons/flags/gif/tm.gif | Bin .../components/lingua/icons/flags/gif/tn.gif | Bin .../components/lingua/icons/flags/gif/to.gif | Bin .../components/lingua/icons/flags/gif/tr.gif | Bin .../components/lingua/icons/flags/gif/tt.gif | Bin .../components/lingua/icons/flags/gif/tv.gif | Bin .../components/lingua/icons/flags/gif/tw.gif | Bin .../components/lingua/icons/flags/gif/tz.gif | Bin .../components/lingua/icons/flags/gif/ua.gif | Bin .../components/lingua/icons/flags/gif/ug.gif | Bin .../components/lingua/icons/flags/gif/um.gif | Bin .../components/lingua/icons/flags/gif/us.gif | Bin .../components/lingua/icons/flags/gif/uy.gif | Bin .../components/lingua/icons/flags/gif/uz.gif | Bin .../components/lingua/icons/flags/gif/va.gif | Bin .../components/lingua/icons/flags/gif/vc.gif | Bin .../components/lingua/icons/flags/gif/ve.gif | Bin .../components/lingua/icons/flags/gif/vg.gif | Bin .../components/lingua/icons/flags/gif/vi.gif | Bin .../components/lingua/icons/flags/gif/vn.gif | Bin .../components/lingua/icons/flags/gif/vu.gif | Bin .../lingua/icons/flags/gif/wales.gif | Bin .../components/lingua/icons/flags/gif/wf.gif | Bin .../components/lingua/icons/flags/gif/ws.gif | Bin .../components/lingua/icons/flags/gif/ye.gif | Bin .../components/lingua/icons/flags/gif/yt.gif | Bin .../components/lingua/icons/flags/gif/za.gif | Bin .../components/lingua/icons/flags/gif/zm.gif | Bin .../components/lingua/icons/flags/gif/zw.gif | Bin .../lingua/icons/flags/png/.DS_Store | Bin .../components/lingua/icons/flags/png/ad.png | Bin .../components/lingua/icons/flags/png/ae.png | Bin .../components/lingua/icons/flags/png/af.png | Bin .../components/lingua/icons/flags/png/ag.png | Bin .../components/lingua/icons/flags/png/ai.png | Bin .../components/lingua/icons/flags/png/al.png | Bin .../components/lingua/icons/flags/png/am.png | Bin .../components/lingua/icons/flags/png/an.png | Bin .../components/lingua/icons/flags/png/ao.png | Bin .../components/lingua/icons/flags/png/ar.png | Bin .../components/lingua/icons/flags/png/as.png | Bin .../components/lingua/icons/flags/png/at.png | Bin .../components/lingua/icons/flags/png/au.png | Bin .../components/lingua/icons/flags/png/aw.png | Bin .../components/lingua/icons/flags/png/ax.png | Bin .../components/lingua/icons/flags/png/az.png | Bin .../components/lingua/icons/flags/png/ba.png | Bin .../components/lingua/icons/flags/png/bb.png | Bin .../components/lingua/icons/flags/png/bd.png | Bin .../components/lingua/icons/flags/png/be.png | Bin .../components/lingua/icons/flags/png/bf.png | Bin .../components/lingua/icons/flags/png/bg.png | Bin .../components/lingua/icons/flags/png/bh.png | Bin .../components/lingua/icons/flags/png/bi.png | Bin .../components/lingua/icons/flags/png/bj.png | Bin .../components/lingua/icons/flags/png/bm.png | Bin .../components/lingua/icons/flags/png/bn.png | Bin .../components/lingua/icons/flags/png/bo.png | Bin .../components/lingua/icons/flags/png/br.png | Bin .../components/lingua/icons/flags/png/bs.png | Bin .../components/lingua/icons/flags/png/bt.png | Bin .../components/lingua/icons/flags/png/bv.png | Bin .../components/lingua/icons/flags/png/bw.png | Bin .../components/lingua/icons/flags/png/by.png | Bin .../components/lingua/icons/flags/png/bz.png | Bin .../components/lingua/icons/flags/png/ca.png | Bin .../lingua/icons/flags/png/catalonia.png | Bin .../components/lingua/icons/flags/png/cc.png | Bin .../components/lingua/icons/flags/png/cd.png | Bin .../components/lingua/icons/flags/png/cf.png | Bin .../components/lingua/icons/flags/png/cg.png | Bin .../components/lingua/icons/flags/png/ch.png | Bin .../components/lingua/icons/flags/png/ci.png | Bin .../components/lingua/icons/flags/png/ck.png | Bin .../components/lingua/icons/flags/png/cl.png | Bin .../components/lingua/icons/flags/png/cm.png | Bin .../components/lingua/icons/flags/png/cn.png | Bin .../components/lingua/icons/flags/png/co.png | Bin .../components/lingua/icons/flags/png/cr.png | Bin .../components/lingua/icons/flags/png/cs.png | Bin .../components/lingua/icons/flags/png/cu.png | Bin .../components/lingua/icons/flags/png/cv.png | Bin .../components/lingua/icons/flags/png/cx.png | Bin .../components/lingua/icons/flags/png/cy.png | Bin .../components/lingua/icons/flags/png/cz.png | Bin .../components/lingua/icons/flags/png/de.png | Bin .../components/lingua/icons/flags/png/dj.png | Bin .../components/lingua/icons/flags/png/dk.png | Bin .../components/lingua/icons/flags/png/dm.png | Bin .../components/lingua/icons/flags/png/do.png | Bin .../components/lingua/icons/flags/png/dz.png | Bin .../components/lingua/icons/flags/png/ec.png | Bin .../components/lingua/icons/flags/png/ee.png | Bin .../components/lingua/icons/flags/png/eg.png | Bin .../components/lingua/icons/flags/png/eh.png | Bin .../lingua/icons/flags/png/england.png | Bin .../components/lingua/icons/flags/png/er.png | Bin .../components/lingua/icons/flags/png/es.png | Bin .../components/lingua/icons/flags/png/et.png | Bin .../lingua/icons/flags/png/europeanunion.png | Bin .../components/lingua/icons/flags/png/fam.png | Bin .../components/lingua/icons/flags/png/fi.png | Bin .../components/lingua/icons/flags/png/fj.png | Bin .../components/lingua/icons/flags/png/fk.png | Bin .../components/lingua/icons/flags/png/fm.png | Bin .../components/lingua/icons/flags/png/fo.png | Bin .../components/lingua/icons/flags/png/fr.png | Bin .../components/lingua/icons/flags/png/ga.png | Bin .../components/lingua/icons/flags/png/gb.png | Bin .../components/lingua/icons/flags/png/gd.png | Bin .../components/lingua/icons/flags/png/ge.png | Bin .../components/lingua/icons/flags/png/gf.png | Bin .../components/lingua/icons/flags/png/gh.png | Bin .../components/lingua/icons/flags/png/gi.png | Bin .../components/lingua/icons/flags/png/gl.png | Bin .../components/lingua/icons/flags/png/gm.png | Bin .../components/lingua/icons/flags/png/gn.png | Bin .../components/lingua/icons/flags/png/gp.png | Bin .../components/lingua/icons/flags/png/gq.png | Bin .../components/lingua/icons/flags/png/gr.png | Bin .../components/lingua/icons/flags/png/gs.png | Bin .../components/lingua/icons/flags/png/gt.png | Bin .../components/lingua/icons/flags/png/gu.png | Bin .../components/lingua/icons/flags/png/gw.png | Bin .../components/lingua/icons/flags/png/gy.png | Bin .../components/lingua/icons/flags/png/hk.png | Bin .../components/lingua/icons/flags/png/hm.png | Bin .../components/lingua/icons/flags/png/hn.png | Bin .../components/lingua/icons/flags/png/hr.png | Bin .../components/lingua/icons/flags/png/ht.png | Bin .../components/lingua/icons/flags/png/hu.png | Bin .../components/lingua/icons/flags/png/id.png | Bin .../components/lingua/icons/flags/png/ie.png | Bin .../components/lingua/icons/flags/png/il.png | Bin .../components/lingua/icons/flags/png/in.png | Bin .../components/lingua/icons/flags/png/io.png | Bin .../components/lingua/icons/flags/png/iq.png | Bin .../components/lingua/icons/flags/png/ir.png | Bin .../components/lingua/icons/flags/png/is.png | Bin .../components/lingua/icons/flags/png/it.png | Bin .../components/lingua/icons/flags/png/jm.png | Bin .../components/lingua/icons/flags/png/jo.png | Bin .../components/lingua/icons/flags/png/jp.png | Bin .../components/lingua/icons/flags/png/ke.png | Bin .../components/lingua/icons/flags/png/kg.png | Bin .../components/lingua/icons/flags/png/kh.png | Bin .../components/lingua/icons/flags/png/ki.png | Bin .../components/lingua/icons/flags/png/km.png | Bin .../components/lingua/icons/flags/png/kn.png | Bin .../components/lingua/icons/flags/png/kp.png | Bin .../components/lingua/icons/flags/png/kr.png | Bin .../components/lingua/icons/flags/png/kw.png | Bin .../components/lingua/icons/flags/png/ky.png | Bin .../components/lingua/icons/flags/png/kz.png | Bin .../components/lingua/icons/flags/png/la.png | Bin .../components/lingua/icons/flags/png/lb.png | Bin .../components/lingua/icons/flags/png/lc.png | Bin .../components/lingua/icons/flags/png/li.png | Bin .../components/lingua/icons/flags/png/lk.png | Bin .../components/lingua/icons/flags/png/lr.png | Bin .../components/lingua/icons/flags/png/ls.png | Bin .../components/lingua/icons/flags/png/lt.png | Bin .../components/lingua/icons/flags/png/lu.png | Bin .../components/lingua/icons/flags/png/lv.png | Bin .../components/lingua/icons/flags/png/ly.png | Bin .../components/lingua/icons/flags/png/ma.png | Bin .../components/lingua/icons/flags/png/mc.png | Bin .../components/lingua/icons/flags/png/md.png | Bin .../components/lingua/icons/flags/png/me.png | Bin .../components/lingua/icons/flags/png/mg.png | Bin .../components/lingua/icons/flags/png/mh.png | Bin .../components/lingua/icons/flags/png/mk.png | Bin .../components/lingua/icons/flags/png/ml.png | Bin .../components/lingua/icons/flags/png/mm.png | Bin .../components/lingua/icons/flags/png/mn.png | Bin .../components/lingua/icons/flags/png/mo.png | Bin .../components/lingua/icons/flags/png/mp.png | Bin .../components/lingua/icons/flags/png/mq.png | Bin .../components/lingua/icons/flags/png/mr.png | Bin .../components/lingua/icons/flags/png/ms.png | Bin .../components/lingua/icons/flags/png/mt.png | Bin .../components/lingua/icons/flags/png/mu.png | Bin .../components/lingua/icons/flags/png/mv.png | Bin .../components/lingua/icons/flags/png/mw.png | Bin .../components/lingua/icons/flags/png/mx.png | Bin .../components/lingua/icons/flags/png/my.png | Bin .../components/lingua/icons/flags/png/mz.png | Bin .../components/lingua/icons/flags/png/na.png | Bin .../components/lingua/icons/flags/png/nc.png | Bin .../components/lingua/icons/flags/png/ne.png | Bin .../components/lingua/icons/flags/png/nf.png | Bin .../components/lingua/icons/flags/png/ng.png | Bin .../components/lingua/icons/flags/png/ni.png | Bin .../components/lingua/icons/flags/png/nl.png | Bin .../components/lingua/icons/flags/png/no.png | Bin .../components/lingua/icons/flags/png/np.png | Bin .../components/lingua/icons/flags/png/nr.png | Bin .../components/lingua/icons/flags/png/nu.png | Bin .../components/lingua/icons/flags/png/nz.png | Bin .../components/lingua/icons/flags/png/om.png | Bin .../components/lingua/icons/flags/png/pa.png | Bin .../components/lingua/icons/flags/png/pe.png | Bin .../components/lingua/icons/flags/png/pf.png | Bin .../components/lingua/icons/flags/png/pg.png | Bin .../components/lingua/icons/flags/png/ph.png | Bin .../components/lingua/icons/flags/png/pk.png | Bin .../components/lingua/icons/flags/png/pl.png | Bin .../components/lingua/icons/flags/png/pm.png | Bin .../components/lingua/icons/flags/png/pn.png | Bin .../components/lingua/icons/flags/png/pr.png | Bin .../components/lingua/icons/flags/png/ps.png | Bin .../components/lingua/icons/flags/png/pt.png | Bin .../components/lingua/icons/flags/png/pw.png | Bin .../components/lingua/icons/flags/png/py.png | Bin .../components/lingua/icons/flags/png/qa.png | Bin .../components/lingua/icons/flags/png/re.png | Bin .../components/lingua/icons/flags/png/ro.png | Bin .../components/lingua/icons/flags/png/rs.png | Bin .../components/lingua/icons/flags/png/ru.png | Bin .../components/lingua/icons/flags/png/rw.png | Bin .../components/lingua/icons/flags/png/sa.png | Bin .../components/lingua/icons/flags/png/sb.png | Bin .../components/lingua/icons/flags/png/sc.png | Bin .../lingua/icons/flags/png/scotland.png | Bin .../components/lingua/icons/flags/png/sd.png | Bin .../components/lingua/icons/flags/png/se.png | Bin .../components/lingua/icons/flags/png/sg.png | Bin .../components/lingua/icons/flags/png/sh.png | Bin .../components/lingua/icons/flags/png/si.png | Bin .../components/lingua/icons/flags/png/sj.png | Bin .../components/lingua/icons/flags/png/sk.png | Bin .../components/lingua/icons/flags/png/sl.png | Bin .../components/lingua/icons/flags/png/sm.png | Bin .../components/lingua/icons/flags/png/sn.png | Bin .../components/lingua/icons/flags/png/so.png | Bin .../components/lingua/icons/flags/png/sr.png | Bin .../components/lingua/icons/flags/png/st.png | Bin .../components/lingua/icons/flags/png/sv.png | Bin .../components/lingua/icons/flags/png/sy.png | Bin .../components/lingua/icons/flags/png/sz.png | Bin .../components/lingua/icons/flags/png/tc.png | Bin .../components/lingua/icons/flags/png/td.png | Bin .../components/lingua/icons/flags/png/tf.png | Bin .../components/lingua/icons/flags/png/tg.png | Bin .../components/lingua/icons/flags/png/th.png | Bin .../components/lingua/icons/flags/png/tj.png | Bin .../components/lingua/icons/flags/png/tk.png | Bin .../components/lingua/icons/flags/png/tl.png | Bin .../components/lingua/icons/flags/png/tm.png | Bin .../components/lingua/icons/flags/png/tn.png | Bin .../components/lingua/icons/flags/png/to.png | Bin .../components/lingua/icons/flags/png/tr.png | Bin .../components/lingua/icons/flags/png/tt.png | Bin .../components/lingua/icons/flags/png/tv.png | Bin .../components/lingua/icons/flags/png/tw.png | Bin .../components/lingua/icons/flags/png/tz.png | Bin .../components/lingua/icons/flags/png/ua.png | Bin .../components/lingua/icons/flags/png/ug.png | Bin .../components/lingua/icons/flags/png/um.png | Bin .../components/lingua/icons/flags/png/us.png | Bin .../components/lingua/icons/flags/png/uy.png | Bin .../components/lingua/icons/flags/png/uz.png | Bin .../components/lingua/icons/flags/png/va.png | Bin .../components/lingua/icons/flags/png/vc.png | Bin .../components/lingua/icons/flags/png/ve.png | Bin .../components/lingua/icons/flags/png/vg.png | Bin .../components/lingua/icons/flags/png/vi.png | Bin .../components/lingua/icons/flags/png/vn.png | Bin .../components/lingua/icons/flags/png/vu.png | Bin .../lingua/icons/flags/png/wales.png | Bin .../components/lingua/icons/flags/png/wf.png | Bin .../components/lingua/icons/flags/png/ws.png | Bin .../components/lingua/icons/flags/png/ye.png | Bin .../components/lingua/icons/flags/png/yt.png | Bin .../components/lingua/icons/flags/png/za.png | Bin .../components/lingua/icons/flags/png/zm.png | Bin .../components/lingua/icons/flags/png/zw.png | Bin .../components/lingua/icons/flags/readme.txt | 0 assets/components/lingua/index.html | 0 .../components/lingua/js/mgr/fcinit.js | 0 .../components/lingua/js/mgr/lingua.js | 0 .../components/lingua/js/mgr/resource.js | 0 .../lingua/js/mgr/sections/index.js | 0 .../lingua/js/mgr/widgets/combo.resource.js | 0 .../lingua/js/mgr/widgets/combo.tv.js | 2 +- .../lingua/js/mgr/widgets/grid.langs.js | 14 +- .../js/mgr/widgets/grid.resourcescopes.js | 10 +- .../lingua/js/mgr/widgets/grid.sync.js | 8 +- .../lingua/js/mgr/widgets/grid.tvs.js | 6 +- .../lingua/js/mgr/widgets/grid.tvspatterns.js | 12 +- .../lingua/js/mgr/widgets/panel.home.js | 0 .../lingua/js/mgr/widgets/window.autosync.js | 0 .../lingua/js/mgr/widgets/window.lang.js | 0 .../js/mgr/widgets/window.manualsync.js | 2 +- .../js/mgr/widgets/window.resourcescope.js | 0 .../lingua/js/mgr/widgets/window.tv.js | 0 .../lingua/js/mgr/widgets/window.tvpattern.js | 0 .../components/lingua/js/ux/CheckColumn.js | 0 core/components/lingua/bootstrap.php | 13 + .../lingua/controllers/home.class.php | 120 ++- .../lingua/defaults/default.langs.php | 4 +- .../lingua/defaults/default.patterns.php | 4 +- core/components/lingua/docs/changelog.txt | 6 +- core/components/lingua/docs/license.txt | 2 +- core/components/lingua/docs/readme.txt | 2 +- core/components/lingua/index.class.php | 61 -- .../lingua/lexicon/en/default.inc.php | 2 +- .../{property.inc.php => properties.inc.php} | 2 +- .../lingua/model/lingua/lingualangs.class.php | 2 - .../model/lingua/linguarequest.class.php | 398 ---------- .../lingua/linguaresourcescopes.class.php | 2 - .../model/lingua/linguaresponse.class.php | 15 - .../linguasitetmplvarcontentvalues.class.php | 2 - .../model/lingua/linguasitetmplvars.class.php | 2 - .../linguasitetmplvarspatterns.class.php | 2 - .../lingua/model/lingua/metadata.mysql.php | 13 - .../model/lingua/mysql/lingualangs.class.php | 3 - .../lingua/mysql/lingualangs.map.inc.php | 131 ---- .../mysql/linguaresourcescopes.class.php | 3 - .../mysql/linguaresourcescopes.map.inc.php | 59 -- .../lingua/mysql/linguasitecontent.class.php | 3 - .../mysql/linguasitecontent.map.inc.php | 341 -------- .../linguasitetmplvarcontentvalues.class.php | 3 - ...linguasitetmplvarcontentvalues.map.inc.php | 148 ---- .../lingua/mysql/linguasitetmplvars.class.php | 3 - .../mysql/linguasitetmplvars.map.inc.php | 54 -- .../linguasitetmplvarspatterns.class.php | 3 - .../linguasitetmplvarspatterns.map.inc.php | 37 - .../schema/lingua.mysql.schema.xml | 26 +- .../lingua.class.php => src/Lingua.php} | 192 ++--- .../lingua/src/Model/LinguaLangs.php | 26 + .../lingua/src/Model/LinguaResourceScopes.php | 19 + .../Model/LinguaSiteContent.php} | 45 +- .../Model/LinguaSiteTmplvarContentvalues.php | 18 + .../lingua/src/Model/LinguaSiteTmplvars.php | 17 + .../src/Model/LinguaSiteTmplvarsPatterns.php | 17 + .../lingua/src/Model/metadata.mysql.php | 18 + .../lingua/src/Model/mysql/LinguaLangs.php | 144 ++++ .../src/Model/mysql/LinguaResourceScopes.php | 72 ++ .../src/Model/mysql/LinguaSiteContent.php | 354 +++++++++ .../mysql/LinguaSiteTmplvarContentvalues.php | 161 ++++ .../src/Model/mysql/LinguaSiteTmplvars.php | 67 ++ .../mysql/LinguaSiteTmplvarsPatterns.php | 50 ++ .../Processors/Contexts/GetList.php} | 14 +- .../Processors/Langs/Create.php} | 13 +- .../Processors/Langs/GetList.php} | 13 +- .../Processors/Langs/Remove.php} | 12 +- .../Processors/Langs/Update.php} | 12 +- .../Processors/Langs/UpdateFromGrid.php} | 9 +- .../Processors/Resource/GetList.php} | 15 +- .../Processors/ResourceScopes/Create.php} | 12 +- .../Processors/ResourceScopes/GetList.php} | 19 +- .../Processors/ResourceScopes/Remove.php} | 12 +- .../Processors/ResourceScopes/Update.php} | 12 +- .../ResourceScopes/UpdateFromGrid.php} | 9 +- .../Processors/Tools/AutoSync.php} | 39 +- .../Processors/Tools/ManualSync.php} | 37 +- .../Processors/Tv/ComboGetList.php} | 16 +- .../Processors/Tv/Create.php} | 12 +- .../Processors/Tv/GetList.php} | 18 +- .../Processors/Tv/Remove.php} | 12 +- .../Processors/TvPatterns/Create.php} | 12 +- .../Processors/TvPatterns/GetList.php} | 28 +- .../src/Processors/TvPatterns/Remove.php | 37 + .../Processors/TvPatterns/Update.php} | 12 +- .../Processors/TvPatterns/UpdateFromGrid.php} | 9 +- core/components/lingua/templates/home.tpl | 2 +- 615 files changed, 2684 insertions(+), 2492 deletions(-) create mode 100644 .gitignore create mode 100644 _build/build.php create mode 100644 _build/config.inc.php create mode 100644 _build/elements/_policies.php create mode 100644 _build/elements/_policy_templates.php create mode 100644 _build/elements/_resources.php create mode 100644 _build/elements/_templates.php create mode 100644 _build/elements/_widgets.php create mode 100644 _build/elements/chunks.php create mode 100644 _build/elements/menus.php create mode 100644 _build/elements/plugins.php create mode 100644 _build/elements/settings.php create mode 100644 _build/elements/snippets.php delete mode 100644 _build/lingua/build.config.sample.php delete mode 100644 _build/lingua/build.transport.php delete mode 100644 _build/lingua/data/properties/default.lingua.getvalue.snippet.properties.js delete mode 100644 _build/lingua/data/properties/default.lingua.selector.snippet.properties.js delete mode 100644 _build/lingua/data/properties/lingua.getvalue.snippet.properties.php delete mode 100644 _build/lingua/data/properties/lingua.selector.snippet.properties.php delete mode 100644 _build/lingua/data/transport.menu.php delete mode 100644 _build/lingua/data/transport.plugin.events.php delete mode 100644 _build/lingua/data/transport.plugins.php delete mode 100644 _build/lingua/data/transport.settings.php delete mode 100644 _build/lingua/data/transport.snippets.php delete mode 100644 _build/lingua/resolvers/tables.resolver.php delete mode 100644 _build/lingua/validators/tables.validator.php create mode 100644 _build/resolvers/tables.php rename {www/assets => assets}/components/lingua/conn/mgr.php (87%) rename {www/assets => assets}/components/lingua/css/mgr.css (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/.DS_Store (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ad.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ae.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/af.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ag.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ai.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/al.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/am.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/an.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ao.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ar.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/as.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/at.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/au.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/aw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ax.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/az.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ba.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bb.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bd.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/be.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bi.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bj.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bo.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/br.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bs.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/by.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/bz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ca.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/catalonia.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cd.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ch.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ci.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ck.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/co.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cs.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cx.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cy.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/cz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/de.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/dj.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/dk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/dm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/do.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/dz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ec.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ee.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/eg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/eh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/england.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/er.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/es.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/et.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/europeanunion.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fam.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fi.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fj.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fo.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/fr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ga.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gb.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gd.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ge.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gi.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gp.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gq.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gs.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/gy.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/hk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/hm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/hn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/hr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ht.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/hu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/id.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ie.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/il.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/in.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/io.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/iq.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ir.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/is.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/it.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/jm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/jo.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/jp.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ke.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ki.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/km.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kp.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ky.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/kz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/la.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lb.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/li.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ls.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/lv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ly.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ma.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/md.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/me.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ml.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mo.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mp.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mq.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ms.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mx.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/my.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/mz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/na.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ne.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ng.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ni.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/no.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/np.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/nz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/om.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pa.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pe.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ph.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ps.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/pw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/py.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/qa.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/re.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ro.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/rs.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ru.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/rw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sa.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sb.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/scotland.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sd.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/se.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sh.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/si.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sj.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/so.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/st.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sy.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/sz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/td.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/th.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tj.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tk.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tl.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/to.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tr.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tv.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/tz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ua.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ug.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/um.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/us.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/uy.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/uz.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/va.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/vc.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ve.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/vg.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/vi.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/vn.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/vu.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/wales.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/wf.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ws.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/ye.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/yt.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/za.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/zm.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/gif/zw.gif (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/.DS_Store (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ad.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ae.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/af.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ag.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ai.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/al.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/am.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/an.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ao.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ar.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/as.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/at.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/au.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/aw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ax.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/az.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ba.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bb.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bd.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/be.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bi.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bj.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bo.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/br.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bs.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/by.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/bz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ca.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/catalonia.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cd.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ch.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ci.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ck.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/co.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cs.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cx.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cy.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/cz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/de.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/dj.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/dk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/dm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/do.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/dz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ec.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ee.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/eg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/eh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/england.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/er.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/es.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/et.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/europeanunion.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fam.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fi.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fj.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fo.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/fr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ga.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gb.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gd.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ge.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gi.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gp.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gq.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gs.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/gy.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/hk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/hm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/hn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/hr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ht.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/hu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/id.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ie.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/il.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/in.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/io.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/iq.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ir.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/is.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/it.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/jm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/jo.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/jp.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ke.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ki.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/km.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kp.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ky.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/kz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/la.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lb.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/li.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ls.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/lv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ly.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ma.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/md.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/me.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ml.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mo.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mp.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mq.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ms.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mx.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/my.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/mz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/na.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ne.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ng.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ni.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/no.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/np.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/nz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/om.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pa.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pe.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ph.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ps.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/pw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/py.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/qa.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/re.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ro.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/rs.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ru.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/rw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sa.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sb.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/scotland.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sd.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/se.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sh.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/si.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sj.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/so.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/st.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sy.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/sz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/td.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/th.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tj.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tk.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tl.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/to.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tr.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tv.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/tz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ua.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ug.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/um.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/us.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/uy.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/uz.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/va.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/vc.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ve.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/vg.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/vi.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/vn.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/vu.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/wales.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/wf.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ws.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/ye.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/yt.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/za.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/zm.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/png/zw.png (100%) rename {www/assets => assets}/components/lingua/icons/flags/readme.txt (100%) create mode 100644 assets/components/lingua/index.html rename {www/assets => assets}/components/lingua/js/mgr/fcinit.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/lingua.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/resource.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/sections/index.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/combo.resource.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/combo.tv.js (92%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/grid.langs.js (94%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/grid.resourcescopes.js (93%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/grid.sync.js (96%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/grid.tvs.js (93%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/grid.tvspatterns.js (91%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/panel.home.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.autosync.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.lang.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.manualsync.js (97%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.resourcescope.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.tv.js (100%) rename {www/assets => assets}/components/lingua/js/mgr/widgets/window.tvpattern.js (100%) rename {www/assets => assets}/components/lingua/js/ux/CheckColumn.js (100%) create mode 100644 core/components/lingua/bootstrap.php delete mode 100644 core/components/lingua/index.class.php rename core/components/lingua/lexicon/en/{property.inc.php => properties.inc.php} (94%) delete mode 100644 core/components/lingua/model/lingua/lingualangs.class.php delete mode 100644 core/components/lingua/model/lingua/linguarequest.class.php delete mode 100644 core/components/lingua/model/lingua/linguaresourcescopes.class.php delete mode 100644 core/components/lingua/model/lingua/linguaresponse.class.php delete mode 100644 core/components/lingua/model/lingua/linguasitetmplvarcontentvalues.class.php delete mode 100644 core/components/lingua/model/lingua/linguasitetmplvars.class.php delete mode 100644 core/components/lingua/model/lingua/linguasitetmplvarspatterns.class.php delete mode 100644 core/components/lingua/model/lingua/metadata.mysql.php delete mode 100644 core/components/lingua/model/lingua/mysql/lingualangs.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/lingualangs.map.inc.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguaresourcescopes.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguaresourcescopes.map.inc.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitecontent.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitecontent.map.inc.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvarcontentvalues.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvarcontentvalues.map.inc.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvars.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvars.map.inc.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvarspatterns.class.php delete mode 100644 core/components/lingua/model/lingua/mysql/linguasitetmplvarspatterns.map.inc.php rename core/components/lingua/{model => }/schema/lingua.mysql.schema.xml (86%) rename core/components/lingua/{model/lingua/lingua.class.php => src/Lingua.php} (88%) create mode 100644 core/components/lingua/src/Model/LinguaLangs.php create mode 100644 core/components/lingua/src/Model/LinguaResourceScopes.php rename core/components/lingua/{model/lingua/linguasitecontent.class.php => src/Model/LinguaSiteContent.php} (90%) create mode 100644 core/components/lingua/src/Model/LinguaSiteTmplvarContentvalues.php create mode 100644 core/components/lingua/src/Model/LinguaSiteTmplvars.php create mode 100644 core/components/lingua/src/Model/LinguaSiteTmplvarsPatterns.php create mode 100644 core/components/lingua/src/Model/metadata.mysql.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaLangs.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaResourceScopes.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaSiteContent.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaSiteTmplvarContentvalues.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaSiteTmplvars.php create mode 100644 core/components/lingua/src/Model/mysql/LinguaSiteTmplvarsPatterns.php rename core/components/lingua/{processors/mgr/contexts/getlist.class.php => src/Processors/Contexts/GetList.php} (88%) rename core/components/lingua/{processors/mgr/langs/create.class.php => src/Processors/Langs/Create.php} (90%) rename core/components/lingua/{processors/mgr/langs/getlist.class.php => src/Processors/Langs/GetList.php} (85%) rename core/components/lingua/{processors/mgr/langs/remove.class.php => src/Processors/Langs/Remove.php} (82%) rename core/components/lingua/{processors/mgr/langs/update.class.php => src/Processors/Langs/Update.php} (82%) rename core/components/lingua/{processors/mgr/langs/updatefromgrid.class.php => src/Processors/Langs/UpdateFromGrid.php} (88%) rename core/components/lingua/{processors/mgr/resource/getlist.class.php => src/Processors/Resource/GetList.php} (86%) rename core/components/lingua/{processors/mgr/resourcescopes/create.class.php => src/Processors/ResourceScopes/Create.php} (87%) rename core/components/lingua/{processors/mgr/resourcescopes/getlist.class.php => src/Processors/ResourceScopes/GetList.php} (80%) rename core/components/lingua/{processors/mgr/resourcescopes/remove.class.php => src/Processors/ResourceScopes/Remove.php} (80%) rename core/components/lingua/{processors/mgr/resourcescopes/update.class.php => src/Processors/ResourceScopes/Update.php} (86%) rename core/components/lingua/{processors/mgr/tvpatterns/updatefromgrid.class.php => src/Processors/ResourceScopes/UpdateFromGrid.php} (88%) rename core/components/lingua/{processors/mgr/tools/autosync.class.php => src/Processors/Tools/AutoSync.php} (79%) rename core/components/lingua/{processors/mgr/tools/manualsync.class.php => src/Processors/Tools/ManualSync.php} (79%) rename core/components/lingua/{processors/mgr/tv/combogetlist.class.php => src/Processors/Tv/ComboGetList.php} (80%) rename core/components/lingua/{processors/mgr/tv/create.class.php => src/Processors/Tv/Create.php} (81%) rename core/components/lingua/{processors/mgr/tv/getlist.class.php => src/Processors/Tv/GetList.php} (76%) rename core/components/lingua/{processors/mgr/tv/remove.class.php => src/Processors/Tv/Remove.php} (81%) rename core/components/lingua/{processors/mgr/tvpatterns/create.class.php => src/Processors/TvPatterns/Create.php} (86%) rename core/components/lingua/{processors/mgr/tvpatterns/getlist.class.php => src/Processors/TvPatterns/GetList.php} (76%) create mode 100644 core/components/lingua/src/Processors/TvPatterns/Remove.php rename core/components/lingua/{processors/mgr/tvpatterns/update.class.php => src/Processors/TvPatterns/Update.php} (89%) rename core/components/lingua/{processors/mgr/resourcescopes/updatefromgrid.class.php => src/Processors/TvPatterns/UpdateFromGrid.php} (87%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8850303 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +config.core.php diff --git a/_build/build.php b/_build/build.php new file mode 100644 index 0000000..b63433d --- /dev/null +++ b/_build/build.php @@ -0,0 +1,729 @@ +modx = $modx; + $this->modx->initialize('mgr'); + + $root = dirname(__FILE__, 2) . '/'; + $core = $root . 'core/components/' . $config['name_lower'] . '/'; + $assets = $root . 'assets/components/' . $config['name_lower'] . '/'; + + $this->config = array_merge([ + 'log_level' => modX::LOG_LEVEL_INFO, + 'log_target' => XPDO_CLI_MODE ? 'ECHO' : 'HTML', + + 'root' => $root, + 'build' => $root . '_build/', + 'elements' => $root . '_build/elements/', + 'resolvers' => $root . '_build/resolvers/', + 'core' => $core, + 'assets' => $assets, + ], $config); + $this->modx->setLogLevel($this->config['log_level']); + $this->modx->setLogTarget($this->config['log_target']); + + $this->initialize(); + } + + /** + * @return modPackageBuilder + */ + public function process() + { + // $this->buildModel(); + + // Add elements + $elements = scandir($this->config['elements']); + foreach ($elements as $element) { + if (in_array($element[0], ['_', '.'])) { + continue; + } + $name = preg_replace('#\.php$#', '', $element); + if (method_exists($this, $name)) { + $this->{$name}(); + } + } + + // Create main vehicle + $vehicle = $this->builder->createVehicle($this->category, $this->category_attributes); + + // Files resolvers + $vehicle->resolve('file', [ + 'source' => $this->config['core'], + 'target' => "return MODX_CORE_PATH . 'components/';", + ]); + $vehicle->resolve('file', [ + 'source' => $this->config['assets'], + 'target' => "return MODX_ASSETS_PATH . 'components/';", + ]); + + // Add resolvers into vehicle + $resolvers = scandir($this->config['resolvers']); + foreach ($resolvers as $resolver) { + if (in_array($resolver[0], ['_', '.'])) { + continue; + } + if ($vehicle->resolve('php', ['source' => $this->config['resolvers'] . $resolver])) { + $this->modx->log(modX::LOG_LEVEL_INFO, 'Added resolver ' . preg_replace('#\.php$#', '', $resolver)); + } + } + + $this->builder->putVehicle($vehicle); + + $this->builder->setPackageAttributes([ + 'changelog' => file_get_contents($this->config['core'] . 'docs/changelog.txt'), + 'license' => file_get_contents($this->config['core'] . 'docs/license.txt'), + 'readme' => file_get_contents($this->config['core'] . 'docs/readme.txt'), + 'requires' => [ + 'php' => '>=7.2.0', + 'modx' => '>=3.0.0', + ], + ]); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Added package attributes and setup options.'); + + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packing up transport package zip...'); + $this->builder->pack(); + + if (!empty($this->config['install'])) { + $this->install(); + } + + return $this->builder; + } + + + /** + * Initialize package builder + */ + private function initialize() + { + $this->builder = new modPackageBuilder($this->modx); + $this->builder->createPackage($this->config['name_lower'], $this->config['version'], $this->config['release']); + $this->builder->registerNamespace($this->config['name_lower'], false, true, '{core_path}components/' . $this->config['name_lower'] . '/'); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Created Transport Package and Namespace.'); + + $this->category = $this->modx->newObject(modCategory::class); + $this->category->set('category', $this->config['name']); + $this->category_attributes = [ + xPDOTransport::UNIQUE_KEY => 'category', + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => true, + xPDOTransport::RELATED_OBJECTS => true, + xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [], + ]; + $this->modx->log(modX::LOG_LEVEL_INFO, 'Created main Category.'); + } + + + /** + * Update the model + */ + private function buildModel() + { + $schemaFile = $this->config['core'] . 'schema/' . $this->config['name_lower'] . '.mysql.schema.xml'; + $outputDir = $this->config['core'] . 'src/'; + if (!file_exists($schemaFile) || empty(file_get_contents($schemaFile))) { + return; + } + + $manager = $this->modx->getManager(); + $generator = $manager->getGenerator(); + $generator->parseSchema( + $schemaFile, + $outputDir, + [ + "compile" => 0, + "update" => 1, + "regenerate" => 1, + "namespacePrefix" => "Lingua\\" + ] + ); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Model updated'); + } + + /** + * Install package + */ + private function install() + { + $signature = $this->builder->getSignature(); + $sig = explode('-', $signature); + $versionSignature = explode('.', $sig[1]); + + /** @var modTransportPackage $package */ + $package = $this->modx->getObject(modTransportPackage::class, ['signature' => $signature]); + if (!$package) { + $package = $this->modx->newObject(modTransportPackage::class); + $package->set('signature', $signature); + $package->fromArray([ + 'created' => date('Y-m-d h:i:s'), + 'updated' => null, + 'state' => 1, + 'workspace' => 1, + 'provider' => 0, + 'source' => $signature . '.transport.zip', + 'package_name' => $this->config['name'], + 'version_major' => $versionSignature[0], + 'version_minor' => !empty($versionSignature[1]) ? $versionSignature[1] : 0, + 'version_patch' => !empty($versionSignature[2]) ? $versionSignature[2] : 0, + ]); + if (!empty($sig[2])) { + $r = preg_split('#([0-9]+)#', $sig[2], -1, PREG_SPLIT_DELIM_CAPTURE); + if (is_array($r) && !empty($r)) { + $package->set('release', $r[0]); + $package->set('release_index', (isset($r[1]) ? $r[1] : '0')); + } else { + $package->set('release', $sig[2]); + } + } + $package->save(); + } + + //$package->xpdo->packages['MODX\Revolution\\'] = $package->xpdo->packages['Revolution']; + if ($package->install()) { + $this->modx->runProcessor('System/ClearCache'); + } + } + + /** + * Add settings + */ + private function settings() + { + /** @noinspection PhpIncludeInspection */ + $settings = include($this->config['elements'] . 'settings.php'); + if (!is_array($settings)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in System Settings'); + return; + } + $attributes = [ + xPDOTransport::UNIQUE_KEY => 'key', + xPDOTransport::PRESERVE_KEYS => true, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['settings']), + xPDOTransport::RELATED_OBJECTS => false, + ]; + foreach ($settings as $name => $data) { + /** @var modSystemSetting $setting */ + $setting = $this->modx->newObject(modSystemSetting::class); + $setting->fromArray(array_merge([ + 'key' => $this->config['name_lower'] . '_' . $name, + 'namespace' => $this->config['name_lower'], + ], $data), '', true, true); + $vehicle = $this->builder->createVehicle($setting, $attributes); + $this->builder->putVehicle($vehicle); + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings'); + } + + + /** + * Add menus + */ + private function menus() + { + /** @noinspection PhpIncludeInspection */ + $menus = include($this->config['elements'] . 'menus.php'); + if (!is_array($menus)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Menus'); + + return; + } + $attributes = [ + xPDOTransport::PRESERVE_KEYS => true, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['menus']), + xPDOTransport::UNIQUE_KEY => 'text', + xPDOTransport::RELATED_OBJECTS => true, + ]; + if (is_array($menus)) { + foreach ($menus as $name => $data) { + /** @var modMenu $menu */ + $menu = $this->modx->newObject(modMenu::class); + $menu->fromArray(array_merge([ + 'text' => $name, + 'parent' => 'components', + 'namespace' => $this->config['name_lower'], + 'icon' => '', + 'menuindex' => 0, + 'params' => '', + 'handler' => '', + ], $data), '', true, true); + $vehicle = $this->builder->createVehicle($menu, $attributes); + $this->builder->putVehicle($vehicle); + } + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($menus) . ' Menus'); + } + + + /** + * Add Dashboard Widgets + */ + private function widgets() + { + /** @noinspection PhpIncludeInspection */ + $widgets = include($this->config['elements'] . 'widgets.php'); + if (!is_array($widgets)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Dashboard Widgets'); + + return; + } + $attributes = [ + xPDOTransport::PRESERVE_KEYS => true, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['widgets']), + xPDOTransport::UNIQUE_KEY => 'name', + ]; + foreach ($widgets as $name => $data) { + /** @var modDashboardWidget $widget */ + $widget = $this->modx->newObject(modDashboardWidget::class); + $widget->fromArray(array_merge([ + 'name' => $name, + 'namespace' => 'core', + 'lexicon' => 'core:dashboards', + ], $data), '', true, true); + $vehicle = $this->builder->createVehicle($widget, $attributes); + $this->builder->putVehicle($vehicle); + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($widgets) . ' Dashboard Widgets'); + } + + + /** + * Add resources + */ + private function resources() + { + /** @noinspection PhpIncludeInspection */ + $resources = include($this->config['elements'] . 'resources.php'); + if (!is_array($resources)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Resources'); + + return; + } + $attributes = [ + xPDOTransport::UNIQUE_KEY => 'id', + xPDOTransport::PRESERVE_KEYS => true, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['resources']), + xPDOTransport::RELATED_OBJECTS => false, + ]; + $objects = []; + foreach ($resources as $context => $items) { + $menuindex = 0; + foreach ($items as $alias => $item) { + if (!isset($item['id'])) { + $item['id'] = $this->_idx++; + } + $item['alias'] = $alias; + $item['context_key'] = $context; + $item['menuindex'] = $menuindex++; + $objects = array_merge( + $objects, + $this->createResource($item, $alias) + ); + } + } + + /** @var modResource $resource */ + foreach ($objects as $resource) { + $vehicle = $this->builder->createVehicle($resource, $attributes); + $this->builder->putVehicle($vehicle); + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($objects) . ' Resources'); + } + + + /** + * Add plugins + */ + private function plugins() + { + /** @noinspection PhpIncludeInspection */ + $plugins = include($this->config['elements'] . 'plugins.php'); + if (!is_array($plugins)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Plugins'); + + return; + } + $this->category_attributes[xPDOTransport::RELATED_OBJECT_ATTRIBUTES]['Plugins'] = [ + xPDOTransport::UNIQUE_KEY => 'name', + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['plugins']), + xPDOTransport::RELATED_OBJECTS => true, + xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [ + 'PluginEvents' => [ + xPDOTransport::PRESERVE_KEYS => true, + xPDOTransport::UPDATE_OBJECT => true, + xPDOTransport::UNIQUE_KEY => ['pluginid', 'event'], + ], + ], + ]; + $objects = []; + foreach ($plugins as $name => $data) { + /** @var modPlugin $plugin */ + $plugin = $this->modx->newObject(modPlugin::class); + $plugin->fromArray(array_merge([ + 'name' => $name, + 'category' => 0, + 'description' => @$data['description'], + 'plugincode' => $this::getFileContent($this->config['core'] . 'elements/plugins/' . $data['file'] . '.php'), + 'static' => !empty($this->config['static']['plugins']), + 'source' => 1, + 'static_file' => 'core/components/' . $this->config['name_lower'] . '/elements/plugins/' . $data['file'] . '.php', + ], $data), '', true, true); + + $events = []; + if (!empty($data['events'])) { + foreach ($data['events'] as $event_name => $event_data) { + /** @var modPluginEvent $event */ + $event = $this->modx->newObject(modPluginEvent::class); + $event->fromArray(array_merge([ + 'event' => $event_name, + 'priority' => 0, + 'propertyset' => 0, + ], $event_data), '', true, true); + $events[] = $event; + } + } + if (!empty($events)) { + $plugin->addMany($events); + } + $objects[] = $plugin; + } + $this->category->addMany($objects); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($objects) . ' Plugins'); + } + + + /** + * Add snippets + */ + private function snippets() + { + /** @noinspection PhpIncludeInspection */ + $snippets = include($this->config['elements'] . 'snippets.php'); + if (!is_array($snippets)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Snippets'); + return; + } + $this->category_attributes[xPDOTransport::RELATED_OBJECT_ATTRIBUTES]['Snippets'] = [ + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['snippets']), + xPDOTransport::UNIQUE_KEY => 'name', + ]; + $objects = []; + foreach ($snippets as $name => $data) { + /** @var modSnippet $snippet */ + $objects[$name] = $this->modx->newObject(modSnippet::class); + $objects[$name]->fromArray(array_merge([ + 'id' => 0, + 'name' => $name, + 'description' => @$data['description'], + 'snippet' => $this::getFileContent($this->config['core'] . 'elements/snippets/' . $data['file'] . '.php'), + 'static' => !empty($this->config['static']['snippets']), + 'source' => 1, + 'static_file' => 'core/components/' . $this->config['name_lower'] . '/elements/snippets/' . $data['file'] . '.php', + ], $data), '', true, true); + $properties = []; + foreach (@$data['properties'] as $k => $v) { + $properties[] = array_merge([ + 'name' => $k, + 'desc' => $this->config['name_lower'] . '_prop_' . $k, + 'lexicon' => $this->config['name_lower'] . ':properties', + ], $v); + } + $objects[$name]->setProperties($properties); + } + $this->category->addMany($objects); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($objects) . ' Snippets'); + } + + + /** + * Add chunks + */ + private function chunks() + { + /** @noinspection PhpIncludeInspection */ + $chunks = include($this->config['elements'] . 'chunks.php'); + if (!is_array($chunks)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Chunks'); + + return; + } + $this->category_attributes[xPDOTransport::RELATED_OBJECT_ATTRIBUTES]['Chunks'] = [ + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['chunks']), + xPDOTransport::UNIQUE_KEY => 'name', + ]; + $objects = []; + foreach ($chunks as $name => $data) { + /** @var modChunk[] $objects */ + $objects[$name] = $this->modx->newObject(modChunk::class); + $objects[$name]->fromArray(array_merge([ + 'id' => 0, + 'name' => $name, + 'description' => @$data['description'], + 'snippet' => $this::getFileContent($this->config['core'] . 'elements/chunks/' . $data['file'] . '.tpl'), + 'static' => !empty($this->config['static']['chunks']), + 'source' => 1, + 'static_file' => 'core/components/' . $this->config['name_lower'] . '/elements/chunks/' . $data['file'] . '.tpl', + ], $data), '', true, true); + $objects[$name]->setProperties(@$data['properties']); + } + $this->category->addMany($objects); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($objects) . ' Chunks'); + } + + + /** + * Add templates + */ + private function templates() + { + /** @noinspection PhpIncludeInspection */ + $templates = include($this->config['elements'] . 'templates.php'); + if (!is_array($templates)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Templates'); + + return; + } + $this->category_attributes[xPDOTransport::RELATED_OBJECT_ATTRIBUTES]['Templates'] = [ + xPDOTransport::UNIQUE_KEY => 'templatename', + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['templates']), + xPDOTransport::RELATED_OBJECTS => false, + ]; + $objects = []; + foreach ($templates as $name => $data) { + /** @var modTemplate[] $objects */ + $objects[$name] = $this->modx->newObject(modTemplate::class); + $objects[$name]->fromArray(array_merge([ + 'templatename' => $name, + 'description' => $data['description'], + 'content' => $this::getFileContent($this->config['core'] . 'elements/templates/' . $data['file'] . '.tpl'), + 'static' => !empty($this->config['static']['templates']), + 'source' => 1, + 'static_file' => 'core/components/' . $this->config['name_lower'] . '/elements/templates/' . $data['file'] . '.tpl', + ], $data), '', true, true); + } + $this->category->addMany($objects); + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($objects) . ' Templates'); + } + + + /** + * Add access policy + */ + private function policies() + { + /** @noinspection PhpIncludeInspection */ + $policies = include($this->config['elements'] . 'policies.php'); + if (!is_array($policies)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Access Policies'); + return; + } + $attributes = [ + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UNIQUE_KEY => array('name'), + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['policies']), + ]; + foreach ($policies as $name => $data) { + if (isset($data['data'])) { + $data['data'] = json_encode($data['data']); + } + /** @var $policy modAccessPolicy */ + $policy = $this->modx->newObject(modAccessPolicy::class); + $policy->fromArray(array_merge(array( + 'name' => $name, + 'lexicon' => $this->config['name_lower'] . ':permissions', + ), $data) + , '', true, true); + $vehicle = $this->builder->createVehicle($policy, $attributes); + $this->builder->putVehicle($vehicle); + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($policies) . ' Access Policies'); + } + + + /** + * Add policy templates + */ + private function policy_templates() + { + /** @noinspection PhpIncludeInspection */ + $policy_templates = include($this->config['elements'] . 'policy_templates.php'); + if (!is_array($policy_templates)) { + $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in Policy Templates'); + return; + } + $attributes = [ + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UNIQUE_KEY => array('name'), + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['policy_templates']), + xPDOTransport::RELATED_OBJECTS => true, + xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array( + 'Permissions' => array( + xPDOTransport::PRESERVE_KEYS => false, + xPDOTransport::UPDATE_OBJECT => !empty($this->config['update']['permission']), + xPDOTransport::UNIQUE_KEY => array('template', 'name'), + ), + ), + ]; + foreach ($policy_templates as $name => $data) { + $permissions = array(); + if (isset($data['permissions']) && is_array($data['permissions'])) { + foreach ($data['permissions'] as $name2 => $data2) { + /** @var $permission modAccessPermission */ + $permission = $this->modx->newObject(modAccessPermission::class); + $permission->fromArray(array_merge(array( + 'name' => $name2, + 'description' => $name2, + 'value' => true, + ), $data2) + , '', true, true); + $permissions[] = $permission; + } + } + /** @var $permission modAccessPolicyTemplate */ + $permission = $this->modx->newObject(modAccessPolicyTemplate::class); + $permission->fromArray(array_merge(array( + 'name' => $name, + 'lexicon' => $this->config['name_lower'] . ':permissions', + ), $data) + , '', true, true); + if (!empty($permissions)) { + $permission->addMany($permissions); + } + $vehicle = $this->builder->createVehicle($permission, $attributes); + $this->builder->putVehicle($vehicle); + } + $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($policy_templates) . ' Access Policy Templates'); + } + + /** + * @param $filename + * + * @return string + */ + private function getFileContent($filename) + { + if (file_exists($filename)) { + $file = trim(file_get_contents($filename)); + + return preg_match('#\<\?php(.*)#is', $file, $data) + ? rtrim(rtrim(trim(@$data[1]), '?>')) + : $file; + } + + return ''; + } + + /** + * @param array $data + * @param string $uri + * @param int $parent + * + * @return array + */ + protected function createResource(array $data, $uri, $parent = 0) + { + $file = $data['context_key'] . '/' . $uri; + /** @var modResource $resource */ + $resource = $this->modx->newObject(modResource::class); + $resource->fromArray(array_merge([ + 'parent' => $parent, + 'published' => true, + 'deleted' => false, + 'hidemenu' => false, + 'createdon' => time(), + 'template' => 1, + 'isfolder' => !empty($data['isfolder']) || !empty($data['resources']), + 'uri' => $uri, + 'uri_override' => false, + 'richtext' => false, + 'searchable' => true, + 'content' => $this::getFileContent($this->config['core'] . 'elements/resources/' . $file . '.tpl'), + ], $data), '', true, true); + + if (!empty($data['groups'])) { + foreach ($data['groups'] as $group) { + $resource->joinGroup($group); + } + } + $resources[] = $resource; + + if (!empty($data['resources'])) { + $menuindex = 0; + foreach ($data['resources'] as $alias => $item) { + if (!isset($item['id'])) { + $item['id'] = $this->_idx++; + } + $item['alias'] = $alias; + $item['context_key'] = $data['context_key']; + $item['menuindex'] = $menuindex++; + $resources = array_merge( + $resources, + $this->createResource($item, $uri . '/' . $alias, $data['id']) + ); + } + } + + return $resources; + } +} + +/** @var array $config */ +if (!file_exists(dirname(__FILE__) . '/config.inc.php')) { + exit('Could not load MODX config. Please specify correct MODX_CORE_PATH constant in config file!'); +} +$config = require(dirname(__FILE__) . '/config.inc.php'); +require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; +$modx = new modX(); +$install = new LinguaPackage($modx, $config); +$builder = $install->process(); + +if (!empty($config['download'])) { + $name = $builder->getSignature() . '.transport.zip'; + if ($content = file_get_contents(MODX_CORE_PATH . '/packages/' . $name)) { + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename=' . $name); + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . strlen($content)); + exit($content); + } +} diff --git a/_build/config.inc.php b/_build/config.inc.php new file mode 100644 index 0000000..dbe4970 --- /dev/null +++ b/_build/config.inc.php @@ -0,0 +1,43 @@ + 1)) { + $path = dirname($path); + } + define('MODX_CORE_PATH', $path . '/core/'); +} + +return [ + 'name' => 'Lingua', + 'name_lower' => 'lingua', + 'version' => '3.0.0', + 'release' => 'pl', + // Install package to site right after build + 'install' => true, + // Which elements should be updated on package upgrade + 'update' => [ + 'chunks' => true, + 'menus' => true, + 'permission' => true, + 'plugins' => true, + 'policies' => true, + 'policy_templates' => true, + 'resources' => false, + 'settings' => false, + 'snippets' => true, + 'templates' => false, + 'widgets' => false, + ], + // Which elements should be static by default + 'static' => [ + 'plugins' => false, + 'snippets' => false, + 'chunks' => false, + ], + // Log settings + 'log_level' => !empty($_REQUEST['download']) ? 0 : 3, + 'log_target' => php_sapi_name() == 'cli' ? 'ECHO' : 'HTML', + // Download transport.zip after build + 'download' => !empty($_REQUEST['download']), +]; diff --git a/_build/elements/_policies.php b/_build/elements/_policies.php new file mode 100644 index 0000000..51695d7 --- /dev/null +++ b/_build/elements/_policies.php @@ -0,0 +1,10 @@ + [ + 'description' => 'Lingua policy description.', + 'data' => [ + 'lingua_save' => true, + ] + ], +]; diff --git a/_build/elements/_policy_templates.php b/_build/elements/_policy_templates.php new file mode 100644 index 0000000..0eed480 --- /dev/null +++ b/_build/elements/_policy_templates.php @@ -0,0 +1,11 @@ + [ + 'description' => 'Lingua policy template description.', + 'template_group' => 1, + 'permissions' => [ + 'lingua_save' => [], + ] + ], +]; diff --git a/_build/elements/_resources.php b/_build/elements/_resources.php new file mode 100644 index 0000000..d84ed01 --- /dev/null +++ b/_build/elements/_resources.php @@ -0,0 +1,33 @@ + [ + 'index' => [ + 'pagetitle' => 'Home', + 'template' => 1, + 'hidemenu' => false, + ], + 'service' => [ + 'pagetitle' => 'Service', + 'template' => 0, + 'hidemenu' => true, + 'published' => false, + 'resources' => [ + '404' => [ + 'pagetitle' => '404', + 'template' => 1, + 'hidemenu' => true, + 'uri' => '404', + 'uri_override' => true, + ], + 'sitemap.xml' => [ + 'pagetitle' => 'Sitemap', + 'template' => 0, + 'hidemenu' => true, + 'uri' => 'sitemap.xml', + 'uri_override' => true, + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/_build/elements/_templates.php b/_build/elements/_templates.php new file mode 100644 index 0000000..d4d3cd1 --- /dev/null +++ b/_build/elements/_templates.php @@ -0,0 +1,8 @@ + [ + 'file' => 'base', + 'description' => 'Base template', + ], +]; diff --git a/_build/elements/_widgets.php b/_build/elements/_widgets.php new file mode 100644 index 0000000..fec0945 --- /dev/null +++ b/_build/elements/_widgets.php @@ -0,0 +1,12 @@ + [ + 'description' => '', + 'type' => 'file', + 'content' => '', + 'namespace' => 'lingua', + 'lexicon' => 'lingua:dashboards', + 'size' => 'half', + ], +]; diff --git a/_build/elements/chunks.php b/_build/elements/chunks.php new file mode 100644 index 0000000..4622555 --- /dev/null +++ b/_build/elements/chunks.php @@ -0,0 +1,16 @@ + [ + 'file' => 'lingua.resourcetv.row.chunk', + 'description' => '', + ], + 'lingua.selector.item' => [ + 'file' => 'lingua.selector.item.chunk', + 'description' => '', + ], + 'lingua.selector.wrapper' => [ + 'file' => 'lingua.selector.wrapper.chunk', + 'description' => '', + ], +]; diff --git a/_build/elements/menus.php b/_build/elements/menus.php new file mode 100644 index 0000000..2c79bab --- /dev/null +++ b/_build/elements/menus.php @@ -0,0 +1,9 @@ + [ + 'description' => 'lingua_desc', + 'action' => 'home', + //'icon' => '', + ], +]; diff --git a/_build/elements/plugins.php b/_build/elements/plugins.php new file mode 100644 index 0000000..5e6db4a --- /dev/null +++ b/_build/elements/plugins.php @@ -0,0 +1,26 @@ + [ + 'file' => 'lingua.plugin', + 'description' => '', + 'events' => [ + 'OnHandleRequest' => [], + 'OnInitCulture' => [], + /////////////////// MANAGER SIDE /////////////////// + 'OnDocFormPrerender' => [], + 'OnResourceTVFormRender' => [], + 'OnDocFormSave' => [], + 'OnResourceDuplicate' => [], + 'OnEmptyTrash' => [], + 'OnTemplateSave' => [], + 'OnTempFormSave' => [], + 'OnTVFormSave' => [], + 'OnSnipFormSave' => [], + 'OnPluginFormSave' => [], + 'OnMediaSourceFormSave' => [], + 'OnChunkFormSave' => [], + 'OnSiteRefresh' => [], + ], + ], +]; diff --git a/_build/elements/settings.php b/_build/elements/settings.php new file mode 100644 index 0000000..e9f63d6 --- /dev/null +++ b/_build/elements/settings.php @@ -0,0 +1,49 @@ + [ + 'xtype' => 'combo-boolean', + 'value' => false, + 'area' => 'general', + ], + 'lingua.get_key' => [ + 'xtype' => 'textfield', + 'value' => 'lang', + 'area' => 'URL', + ], + 'lingua.code_field' => [ + 'xtype' => 'textfield', + 'value' => 'lang_code', + 'area' => 'URL', + ], + 'lingua.contexts' => [ + 'xtype' => 'textfield', + 'value' => 'web', + 'area' => 'general', + ], + 'lingua.parents' => [ + 'xtype' => 'textfield', + 'value' => '', + 'area' => 'general', + ], + 'lingua.ids' => [ + 'xtype' => 'textfield', + 'value' => '', + 'area' => 'general', + ], + 'lingua.detect_browser' => [ + 'xtype' => 'combo-boolean', + 'value' => false, + 'area' => 'general', + ], + 'lingua.empty_returns_default' => [ + 'xtype' => 'combo-boolean', + 'value' => false, + 'area' => 'general', + ], + 'lingua.form_customization' => [ + 'xtype' => 'combo-boolean', + 'value' => false, + 'area' => 'manager', + ], +]; diff --git a/_build/elements/snippets.php b/_build/elements/snippets.php new file mode 100644 index 0000000..56f2c58 --- /dev/null +++ b/_build/elements/snippets.php @@ -0,0 +1,86 @@ + [ + 'file' => 'lingua.selector.snippet', + 'description' => 'Languages selector drop down.', + 'properties' => [ + 'codeField' => [ + 'type' => 'textfield', + 'value' => '', + ], + 'getKey' => [ + 'type' => 'textfield', + 'value' => '', + ], + 'phsPrefix' => [ + 'type' => 'textfield', + 'value' => '', + ], + 'sortby' => [ + 'type' => 'list', + 'value' => 'id', + 'options' => [ + [ + 'text' => 'ID', + 'value' => 'id', + 'name' => 'ID', + ], + [ + 'text' => 'iso_code', + 'value' => 'iso_code', + 'name' => 'iso_code', + ], + ], + ], + 'sortdir' => [ + 'type' => 'list', + 'value' => 'asc', + 'options' => [ + [ + 'text' => 'ASC', + 'value' => 'asc', + 'name' => 'ASC', + ], + [ + 'text' => 'DESC', + 'value' => 'desc', + 'name' => 'DESC', + ], + ], + ], + 'tplItem' => [ + 'type' => 'textfield', + 'value' => 'lingua.selector.item', + ], + 'tplWrapper' => [ + 'type' => 'textfield', + 'value' => 'lingua.selector.wrapper', + ], + ], + ], + 'lingua.cultureKey' => [ + 'file' => 'lingua.culturekey.snippet', + 'description' => 'Helper snippet to get the run time cultureKey, which is set by lingua\'s plugin.', + 'properties' => [], + ], + 'lingua.getField' => [ + 'file' => 'lingua.getfield.snippet', + 'description' => 'Get the value of the given field for the run time culture key.', + 'properties' => [], + ], + 'lingua.getValue' => [ + 'file' => 'lingua.getvalue.snippet', + 'description' => 'Get the value of the clone\'s field for the run time culture key.', + 'properties' => [ + 'emptyReturnsDefault' => [ + 'type' => 'combo-boolean', + 'value' => false, + ], + 'field' => [ + 'type' => 'textfield', + 'value' => '', + ] + ], + ], +]; diff --git a/_build/lingua/build.config.sample.php b/_build/lingua/build.config.sample.php deleted file mode 100644 index 4e0a111..0000000 --- a/_build/lingua/build.config.sample.php +++ /dev/null @@ -1,5 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ -$mtime = microtime(); -$mtime = explode(" ", $mtime); -$mtime = $mtime[1] + $mtime[0]; -$tstart = $mtime; -set_time_limit(0); - -/* define version */ -define('PKG_NAME', 'Lingua'); -define('PKG_NAME_LOWER', 'lingua'); - -/* override with your own defines here (see build.config.sample.php) */ -require_once dirname(__FILE__) . '/build.config.php'; -require_once realpath(MODX_CORE_PATH) . '/model/modx/modx.class.php'; - -/* define sources */ -$root = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR; -$sources = array( - 'root' => $root, - 'build' => BUILD_PATH, - 'resolvers' => BUILD_PATH . 'resolvers' . DIRECTORY_SEPARATOR, - 'validators' => realpath(BUILD_PATH . 'validators/') . DIRECTORY_SEPARATOR, - 'data' => BUILD_PATH . 'data' . DIRECTORY_SEPARATOR, - 'properties' => realpath(BUILD_PATH . 'data/properties/') . DIRECTORY_SEPARATOR, - 'source_core' => realpath(MODX_CORE_PATH . 'components') . DIRECTORY_SEPARATOR . PKG_NAME_LOWER, - 'source_assets' => realpath(MODX_ASSETS_PATH . 'components') . DIRECTORY_SEPARATOR . PKG_NAME_LOWER, - 'docs' => realpath(MODX_CORE_PATH . 'components/' . PKG_NAME_LOWER . '/docs/') . DIRECTORY_SEPARATOR, - 'lexicon' => realpath(MODX_CORE_PATH . 'components/' . PKG_NAME_LOWER . '/lexicon/') . DIRECTORY_SEPARATOR, -); -unset($root); - -$modx = new modX(); -$modx->initialize('mgr'); -$modx->setLogLevel(modX::LOG_LEVEL_INFO); -$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); -echo '
';
-
-$lingua = $modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/');
-
-if (!($lingua instanceof Lingua)) {
-    return '';
-}
-define('PKG_VERSION', Lingua::VERSION);
-define('PKG_RELEASE', Lingua::RELEASE);
-
-$modx->loadClass('transport.modPackageBuilder', '', false, true);
-$builder = new modPackageBuilder($modx);
-$builder->createPackage(PKG_NAME_LOWER, PKG_VERSION, PKG_RELEASE);
-$builder->registerNamespace(PKG_NAME_LOWER, false, true, '{core_path}components/' . PKG_NAME_LOWER . '/');
-
-/**
- * MENU & ACTION
- */
-$menu = include $sources['data'] . 'transport.menu.php';
-if (empty($menu)) {
-    $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in menu.');
-} else {
-    $modx->log(modX::LOG_LEVEL_INFO, 'Packaging in menu...');
-    $menuVehicle = $builder->createVehicle($menu, array(
-        xPDOTransport::PRESERVE_KEYS => true,
-        xPDOTransport::UPDATE_OBJECT => true,
-        xPDOTransport::UNIQUE_KEY => 'text',
-        xPDOTransport::RELATED_OBJECTS => true,
-        xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array(
-            'Action' => array(
-                xPDOTransport::PRESERVE_KEYS => false,
-                xPDOTransport::UPDATE_OBJECT => true,
-                xPDOTransport::UNIQUE_KEY => array('namespace', 'controller'),
-            ),
-        ),
-    ));
-    $modx->log(modX::LOG_LEVEL_INFO, 'Adding in Menu & Action done.');
-    $builder->putVehicle($menuVehicle);
-    unset($menuVehicle, $menu);
-}
-
-/**
- * SYSTEM SETTINGS
- */
-$settings = include $sources['data'] . 'transport.settings.php';
-if (!is_array($settings)) {
-    $modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
-} else {
-    $modx->log(modX::LOG_LEVEL_INFO, 'Packaging in System Settings...');
-    $settingAttributes = array(
-        xPDOTransport::UNIQUE_KEY => 'key',
-        xPDOTransport::PRESERVE_KEYS => true,
-        xPDOTransport::UPDATE_OBJECT => false,
-    );
-    foreach ($settings as $setting) {
-        $settingVehicle = $builder->createVehicle($setting, $settingAttributes);
-        $builder->putVehicle($settingVehicle);
-    }
-    $modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($settings) . ' System Settings done.');
-    unset($settingVehicle, $settings, $setting, $settingAttributes);
-}
-
-/**
- * CATEGORY
- */
-$category = $modx->newObject('modCategory');
-$category->set('id', 1);
-$category->set('category', 'Lingua');
-
-/**
- * SNIPPETS
- */
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in snippets.');
-$snippets = include $sources['data'] . 'transport.snippets.php';
-if (is_array($snippets)) {
-    $category->addMany($snippets);
-    $modx->log(modX::LOG_LEVEL_INFO, 'Adding in ' . count($snippets) . ' snippets done.');
-} else {
-    $modx->log(modX::LOG_LEVEL_FATAL, 'Adding snippets failed.');
-}
-
-
-/**
- * PLUGINS
- */
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in plugins.');
-$plugins = include $sources['data'] . 'transport.plugins.php';
-if (is_array($plugins)) {
-    $category->addMany($plugins);
-    $modx->log(modX::LOG_LEVEL_INFO, 'Adding in ' . count($plugins) . ' plugins done.');
-} else {
-    $modx->log(modX::LOG_LEVEL_FATAL, 'Adding plugins failed.');
-}
-
-/**
- * Apply category to the elements
- */
-$elementsAttribute = array(
-    xPDOTransport::UNIQUE_KEY => 'category',
-    xPDOTransport::PRESERVE_KEYS => false,
-    xPDOTransport::UPDATE_OBJECT => true,
-    xPDOTransport::RELATED_OBJECTS => true,
-    xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array(
-        'Snippets' => array(
-            xPDOTransport::PRESERVE_KEYS => false,
-            xPDOTransport::UPDATE_OBJECT => true,
-            xPDOTransport::UNIQUE_KEY => 'name',
-        ),
-        'Chunks' => array(
-            xPDOTransport::PRESERVE_KEYS => false,
-            xPDOTransport::UPDATE_OBJECT => true,
-            xPDOTransport::UNIQUE_KEY => 'name',
-        ),
-        'Plugins' => array(
-            xPDOTransport::PRESERVE_KEYS => false,
-            xPDOTransport::UPDATE_OBJECT => true,
-            xPDOTransport::UNIQUE_KEY => 'name',
-        ),
-        'PluginEvents' => array(
-            xPDOTransport::PRESERVE_KEYS => true,
-            xPDOTransport::UPDATE_OBJECT => false,
-            xPDOTransport::UNIQUE_KEY => array('pluginid', 'event'),
-        ),
-    )
-);
-$elementsVehicle = $builder->createVehicle($category, $elementsAttribute);
-
-/**
- * FILE RESOLVERS
- */
-$elementsVehicle->resolve('file', array(
-    'source' => $sources['source_core'],
-    'target' => "return MODX_CORE_PATH . 'components/';",
-));
-$elementsVehicle->resolve('file', array(
-    'source' => $sources['source_assets'],
-    'target' => "return MODX_ASSETS_PATH . 'components/';",
-));
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in files done.');
-
-/**
- * RESOLVERS
- */
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in PHP resolvers...');
-flush();
-$elementsVehicle->resolve('php', array(
-    'source' => $sources['resolvers'] . 'tables.resolver.php',
-));
-
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in PHP resolvers done.');
-
-/**
- * VALIDATORS
- */
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in PHP validators...');
-$elementsVehicle->validate('php', array(
-    'source' => $sources['validators'] . 'tables.validator.php',
-));
-$modx->log(modX::LOG_LEVEL_INFO, 'Adding in PHP validators done.');
-
-$builder->putVehicle($elementsVehicle);
-unset($elementsVehicle);
-$modx->log(modX::LOG_LEVEL_INFO, 'Packaged in Elements done.');
-flush();
-
-
-/**
- * license file, readme and setup options
- */
-$builder->setPackageAttributes(array(
-    'license' => file_get_contents($sources['docs'] . 'license.txt'),
-    'readme' => file_get_contents($sources['docs'] . 'readme.txt'),
-    'changelog' => file_get_contents($sources['docs'] . 'changelog.txt'),
-));
-
-$builder->pack();
-
-$mtime = microtime();
-$mtime = explode(" ", $mtime);
-$mtime = $mtime[1] + $mtime[0];
-$tend = $mtime;
-$totalTime = ($tend - $tstart);
-$totalTime = sprintf("%2.4f s", $totalTime);
-
-$modx->log(modX::LOG_LEVEL_INFO, "\n
" . PKG_NAME . " package built.
\nExecution time: {$totalTime}\n"); - -exit(); diff --git a/_build/lingua/data/properties/default.lingua.getvalue.snippet.properties.js b/_build/lingua/data/properties/default.lingua.getvalue.snippet.properties.js deleted file mode 100644 index 5d519ae..0000000 --- a/_build/lingua/data/properties/default.lingua.getvalue.snippet.properties.js +++ /dev/null @@ -1 +0,0 @@ -[{"name":"emptyReturnsDefault","desc":"setting_lingua.empty_returns_default_desc","xtype":"combo-boolean","options":[],"value":false,"lexicon":"lingua:default","overridden":false,"desc_trans":"If translated field has empty value, should Lingue return value from default language or not?","area":"","area_trans":"","menu":null},{"name":"field","desc":"prop_field_desc","xtype":"textfield","options":[],"value":"","lexicon":"lingua:property","overridden":false,"desc_trans":"Which field this snippet should take value from? Options: pagetitle, longtitle, description, alias, link_attributes, introtext, content, menutitle, uri, uri_override, properties, OR any TV's name","area":"","area_trans":"","menu":null}] \ No newline at end of file diff --git a/_build/lingua/data/properties/default.lingua.selector.snippet.properties.js b/_build/lingua/data/properties/default.lingua.selector.snippet.properties.js deleted file mode 100644 index 48fa184..0000000 --- a/_build/lingua/data/properties/default.lingua.selector.snippet.properties.js +++ /dev/null @@ -1 +0,0 @@ -[{"name":"codeField","desc":"prop_codeField_desc","xtype":"textfield","options":[],"value":"lang_code","lexicon":"lingua:property","overridden":false,"desc_trans":"Field name to be used for selector","area":"","area_trans":"","menu":null},{"name":"getKey","desc":"prop_getKey_desc","xtype":"textfield","options":[],"value":"lang","lexicon":"lingua:property","overridden":false,"desc_trans":"Request key","area":"","area_trans":"","menu":null},{"name":"phsPrefix","desc":"prop_phsPrefix_desc","xtype":"textfield","options":[],"value":"lingua.","lexicon":"lingua:property","overridden":false,"desc_trans":"Additional prefix for templates","area":"","area_trans":"","menu":null},{"name":"sortby","desc":"prop_sortby_desc","xtype":"list","options":[{"text":"ID","value":"id","name":"ID"},{"text":"iso_code","value":"iso_code","name":"iso_code"}],"value":"id","lexicon":"lingua:property","overridden":false,"desc_trans":"Sort the list by","area":"","area_trans":"","menu":null},{"name":"sortdir","desc":"prop_sortdir_desc","xtype":"list","options":[{"text":"ASC","value":"asc","name":"ASC"},{"text":"DESC","value":"desc","name":"DESC"}],"value":"asc","lexicon":"lingua:property","overridden":false,"desc_trans":"Sort direction","area":"","area_trans":"","menu":null},{"name":"tplItem","desc":"prop_tplItem_desc","xtype":"textfield","options":[],"value":"lingua.selector.item","lexicon":"lingua:property","overridden":false,"desc_trans":"Item template","area":"","area_trans":"","menu":null},{"name":"tplWrapper","desc":"prop_tplWrapper_desc","xtype":"textfield","options":[],"value":"lingua.selector.wrapper","lexicon":"lingua:property","overridden":false,"desc_trans":"Wrapper template","area":"","area_trans":"","menu":null}] \ No newline at end of file diff --git a/_build/lingua/data/properties/lingua.getvalue.snippet.properties.php b/_build/lingua/data/properties/lingua.getvalue.snippet.properties.php deleted file mode 100644 index 456b4ec..0000000 --- a/_build/lingua/data/properties/lingua.getvalue.snippet.properties.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ - -if (!function_exists("fixJson")) { - - function fixJson(array $array) { - $fixed = array(); - foreach ($array as $k => $v) { - $fixed[] = array( - 'name' => $v['name'], - 'desc' => $v['desc'], - 'type' => $v['xtype'], - 'options' => empty($v['options']) ? '' : $v['options'], - 'value' => $v['value'], - 'lexicon' => $v['lexicon'], - ); - } - return $fixed; - } - -} - -ob_start(); -include dirname(__FILE__) . '/default.lingua.getvalue.snippet.properties.js'; -$json = ob_get_contents(); -ob_end_clean(); - -$properties = $modx->fromJSON($json); -$properties = fixJson($properties); - -return $properties; \ No newline at end of file diff --git a/_build/lingua/data/properties/lingua.selector.snippet.properties.php b/_build/lingua/data/properties/lingua.selector.snippet.properties.php deleted file mode 100644 index d5b4d72..0000000 --- a/_build/lingua/data/properties/lingua.selector.snippet.properties.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ - -if (!function_exists("fixJson")) { - - function fixJson(array $array) { - $fixed = array(); - foreach ($array as $k => $v) { - $fixed[] = array( - 'name' => $v['name'], - 'desc' => $v['desc'], - 'type' => $v['xtype'], - 'options' => empty($v['options']) ? '' : $v['options'], - 'value' => $v['value'], - 'lexicon' => $v['lexicon'], - ); - } - return $fixed; - } - -} - -ob_start(); -include dirname(__FILE__) . '/default.lingua.selector.snippet.properties.js'; -$json = ob_get_contents(); -ob_end_clean(); - -$properties = $modx->fromJSON($json); -$properties = fixJson($properties); - -return $properties; \ No newline at end of file diff --git a/_build/lingua/data/transport.menu.php b/_build/lingua/data/transport.menu.php deleted file mode 100644 index 96406ea..0000000 --- a/_build/lingua/data/transport.menu.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * @package lingua - * @subpackage build - */ - -$action = $modx->newObject('modAction'); -$action->fromArray(array( - 'id' => 1, - 'namespace' => 'lingua', - 'parent' => 0, - 'controller' => 'index', - 'haslayout' => true, - 'lang_topics' => 'lingua:default', - 'assets' => '', - ), '', true, true); - -$menu = $modx->newObject('modMenu'); -$menu->fromArray(array( - 'text' => 'lingua', - 'parent' => 'components', - 'description' => 'lingua_desc', - 'icon' => 'images/icons/plugin.gif', - 'menuindex' => 0, - 'params' => '', - 'handler' => '', - ), '', true, true); -$menu->addOne($action); -unset($menus); - -return $menu; \ No newline at end of file diff --git a/_build/lingua/data/transport.plugin.events.php b/_build/lingua/data/transport.plugin.events.php deleted file mode 100644 index f5d07f2..0000000 --- a/_build/lingua/data/transport.plugin.events.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * @package Lingua - * @subpackage build - */ - -function setEventObjects(array $events = array()) { - global $modx; - $eventObjects = array(); - foreach ($events as $k => $v) { - $eventObjects[$v] = $modx->newObject('modPluginEvent'); - $eventObjects[$v]->fromArray(array( - 'event' => $v, - 'priority' => 0, - 'propertyset' => 0, - ), '', true, true); - - } - return $eventObjects; -} -$events = setEventObjects(array( - 'OnHandleRequest', - 'OnInitCulture', - /////////////////// MANAGER SIDE /////////////////// - 'OnDocFormPrerender', - 'OnResourceTVFormRender', - 'OnDocFormSave', - 'OnResourceDuplicate', - 'OnEmptyTrash', - 'OnTemplateSave', - 'OnTempFormSave', - 'OnTVFormSave', - 'OnSnipFormSave', - 'OnPluginFormSave', - 'OnMediaSourceFormSave', - 'OnChunkFormSave', - 'OnSiteRefresh', -)); - -return $events; \ No newline at end of file diff --git a/_build/lingua/data/transport.plugins.php b/_build/lingua/data/transport.plugins.php deleted file mode 100644 index 0283d9d..0000000 --- a/_build/lingua/data/transport.plugins.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ - -/** - * @param string $filename filename - * @return string file content - */ -if (!function_exists('getSnippetContent')) { - function getSnippetContent($filename) { - $o = file_get_contents($filename); - $o = str_replace('', '', $o); - $o = trim($o); - return $o; - } -} - -$plugins = array(); - -$plugins[0] = $modx->newObject('modPlugin'); -$plugins[0]->fromArray(array( - 'id' => 0, - 'property_preprocess' => 1, - 'name' => 'Lingua', - 'description' => '', - 'plugincode' => getSnippetContent($sources['source_core'] . '/elements/plugins/lingua.plugin.php'), - ), '', true, true); - -/* add plugin events */ -$events = include $sources['data'] . 'transport.plugin.events.php'; -if (is_array($events) && !empty($events)) { - $plugins[0]->addMany($events); - $modx->log(xPDO::LOG_LEVEL_INFO, 'Packaged in ' . count($events) . ' Plugin Events.'); - flush(); -} else { - $modx->log(xPDO::LOG_LEVEL_ERROR, 'Could not find plugin events!'); -} - -return $plugins; \ No newline at end of file diff --git a/_build/lingua/data/transport.settings.php b/_build/lingua/data/transport.settings.php deleted file mode 100644 index 49e4d8f..0000000 --- a/_build/lingua/data/transport.settings.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ - -$settings['lingua.debug'] = $modx->newObject('modSystemSetting'); -$settings['lingua.debug']->fromArray(array( - 'key' => 'lingua.debug', - 'value' => '0', - 'xtype' => 'combo-boolean', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.get_key'] = $modx->newObject('modSystemSetting'); -$settings['lingua.get_key']->fromArray(array( - 'key' => 'lingua.get_key', - 'value' => 'lang', - 'xtype' => 'textfield', - 'namespace' => 'lingua', - 'area' => 'URL', - ), '', true, true); - -$settings['lingua.code_field'] = $modx->newObject('modSystemSetting'); -$settings['lingua.code_field']->fromArray(array( - 'key' => 'lingua.code_field', - 'value' => 'lang_code', - 'xtype' => 'textfield', - 'namespace' => 'lingua', - 'area' => 'URL', - ), '', true, true); - -$settings['lingua.contexts'] = $modx->newObject('modSystemSetting'); -$settings['lingua.contexts']->fromArray(array( - 'key' => 'lingua.contexts', - 'value' => 'web', - 'xtype' => 'textfield', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.parents'] = $modx->newObject('modSystemSetting'); -$settings['lingua.parents']->fromArray(array( - 'key' => 'lingua.parents', - 'value' => '', - 'xtype' => 'textfield', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.ids'] = $modx->newObject('modSystemSetting'); -$settings['lingua.ids']->fromArray(array( - 'key' => 'lingua.ids', - 'value' => '', - 'xtype' => 'textfield', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.detect_browser'] = $modx->newObject('modSystemSetting'); -$settings['lingua.detect_browser']->fromArray(array( - 'key' => 'lingua.detect_browser', - 'value' => '0', - 'xtype' => 'combo-boolean', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.empty_returns_default'] = $modx->newObject('modSystemSetting'); -$settings['lingua.empty_returns_default']->fromArray(array( - 'key' => 'lingua.empty_returns_default', - 'value' => '0', - 'xtype' => 'combo-boolean', - 'namespace' => 'lingua', - 'area' => 'general', - ), '', true, true); - -$settings['lingua.form_customization'] = $modx->newObject('modSystemSetting'); -$settings['lingua.form_customization']->fromArray(array( - 'key' => 'lingua.form_customization', - 'value' => '0', - 'xtype' => 'combo-boolean', - 'namespace' => 'lingua', - 'area' => 'manager', - ), '', true, true); - -return $settings; \ No newline at end of file diff --git a/_build/lingua/data/transport.snippets.php b/_build/lingua/data/transport.snippets.php deleted file mode 100644 index 7228998..0000000 --- a/_build/lingua/data/transport.snippets.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Lingua build script - * - * @package lingua - * @subpackage build - */ - -/** - * @param string $filename filename - * @return string file content - */ -if (!function_exists('getSnippetContent')) { - function getSnippetContent($filename) { - $o = file_get_contents($filename); - $o = str_replace('', '', $o); - $o = trim($o); - return $o; - } -} - -$snippets = array(); - -$snippets['lingua.selector'] = $modx->newObject('modSnippet'); -$snippets['lingua.selector']->fromArray(array( - 'id' => 0, - 'property_preprocess' => 1, - 'name' => 'lingua.selector', - 'description' => 'Languages selector drop down.', - 'snippet' => getSnippetContent($sources['source_core'] . '/elements/snippets/lingua.selector.snippet.php'), - ), '', true, true); -$properties = include $sources['properties'] . 'lingua.selector.snippet.properties.php'; -$snippets['lingua.selector']->setProperties($properties); -unset($properties); - -$snippets['lingua.cultureKey'] = $modx->newObject('modSnippet'); -$snippets['lingua.cultureKey']->fromArray(array( - 'id' => 0, - 'property_preprocess' => 1, - 'name' => 'lingua.cultureKey', - 'description' => 'Helper snippet to get the run time cultureKey, which is set by lingua\'s plugin.', - 'snippet' => getSnippetContent($sources['source_core'] . '/elements/snippets/lingua.culturekey.snippet.php'), - ), '', true, true); - -$snippets['lingua.getField'] = $modx->newObject('modSnippet'); -$snippets['lingua.getField']->fromArray(array( - 'id' => 0, - 'property_preprocess' => 1, - 'name' => 'lingua.getField', - 'description' => 'Get the value of the given field for the run time culture key.', - 'snippet' => getSnippetContent($sources['source_core'] . '/elements/snippets/lingua.getfield.snippet.php'), - ), '', true, true); - -$snippets['lingua.getValue'] = $modx->newObject('modSnippet'); -$snippets['lingua.getValue']->fromArray(array( - 'id' => 0, - 'property_preprocess' => 1, - 'name' => 'lingua.getValue', - 'description' => 'Get the value of the clone\'s field for the run time culture key.', - 'snippet' => getSnippetContent($sources['source_core'] . '/elements/snippets/lingua.getvalue.snippet.php'), - ), '', true, true); -$properties = include $sources['properties'] . 'lingua.selector.snippet.properties.php'; -$snippets['lingua.getValue']->setProperties($properties); -unset($properties); - -return $snippets; \ No newline at end of file diff --git a/_build/lingua/resolvers/tables.resolver.php b/_build/lingua/resolvers/tables.resolver.php deleted file mode 100644 index 049e2de..0000000 --- a/_build/lingua/resolvers/tables.resolver.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Resolve creating db tables - * - * @package lingua - * @subpackage build - */ -if ($modx = & $object->xpdo) { - // http://forums.modx.com/thread/88734/package-version-check#dis-post-489104 - $c = $modx->newQuery('transport.modTransportPackage'); - $c->where(array( - 'workspace' => 1, - "(SELECT - `signature` - FROM {$modx->getTableName('modTransportPackage')} AS `latestPackage` - WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` - ORDER BY - `latestPackage`.`version_major` DESC, - `latestPackage`.`version_minor` DESC, - `latestPackage`.`version_patch` DESC, - IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, - `latestPackage`.`release_index` DESC - LIMIT 1,1) = `modTransportPackage`.`signature`", - )); - $c->where(array( - 'modTransportPackage.signature:LIKE' => '%lingua%', - 'OR:modTransportPackage.package_name:LIKE' => '%lingua%', - 'installed:IS NOT' => null - )); - $oldPackage = $modx->getObject('transport.modTransportPackage', $c); - - switch ($options[xPDOTransport::PACKAGE_ACTION]) { - case xPDOTransport::ACTION_INSTALL: - case xPDOTransport::ACTION_UPGRADE: - $modelPath = $modx->getOption('core_path') . 'components/lingua/model/'; - $tablePrefix = $modx->getOption('lingua.table_prefix', null, $modx->config[modX::OPT_TABLE_PREFIX] . 'lingua_'); - $modx->addPackage('lingua', $modelPath, $tablePrefix); - $modx->addExtensionPackage('lingua', '[[++core_path]]components/lingua/model/', array('tablePrefix' => $tablePrefix)); - - $manager = $modx->getManager(); - if ($manager->createObjectContainer('linguaLangs')) { - $defaults = include $modx->getOption('core_path') . 'components/lingua/defaults/default.langs.php'; - foreach ($defaults as $default) { - $default->save(); - } - } - $manager->createObjectContainer('linguaSiteContent'); - $manager->createObjectContainer('linguaSiteTmplvarContentvalues'); - $manager->createObjectContainer('linguaSiteTmplvars'); - $manager->createObjectContainer('linguaResourceScopes'); - if ($oldPackage && $oldPackage->compareVersion('2.0.0-rc1', '>')) { - $manager->addField('linguaSiteContent', 'parent', array('after' => 'link_attributes')); - $manager->addField('linguaSiteContent', 'isfolder', array('after' => 'parent')); - $manager->addField('linguaSiteContent', 'context_key', array('after' => 'menutitle')); - $manager->addField('linguaSiteContent', 'content_type', array('after' => 'context_key')); - } - if ($manager->createObjectContainer('linguaSiteTmplvarsPatterns')) { - $defaults = include $modx->getOption('core_path') . 'components/lingua/defaults/default.patterns.php'; - foreach ($defaults as $default) { - $default->save(); - } - } - break; - case xPDOTransport::ACTION_UNINSTALL: - $modx->removeExtensionPackage('lingua'); - break; - } -} - -return true; diff --git a/_build/lingua/validators/tables.validator.php b/_build/lingua/validators/tables.validator.php deleted file mode 100644 index 2afe5b3..0000000 --- a/_build/lingua/validators/tables.validator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Validates before action. - * - * @package lingua - * @subpackage build - */ -if ($modx = & $object->xpdo) { - switch ($options[xPDOTransport::PACKAGE_ACTION]) { - case xPDOTransport::ACTION_INSTALL: - if ($modx->getDebug()) { - $modx->log(modX::LOG_LEVEL_WARN, 'validator xPDOTransport::ACTION_INSTALL'); - $modelPath = $modx->getOption('core_path') . 'components/lingua/model/'; - $tablePrefix = $modx->getOption('lingua.table_prefix', null, $modx->config[modX::OPT_TABLE_PREFIX] . 'lingua_'); - if ($modx->addPackage('lingua', $modelPath, $tablePrefix)) { - $modx->log(modX::LOG_LEVEL_WARN, '[Lingua] package was added in validator xPDOTransport::ACTION_INSTALL'); - } - } - break; - case xPDOTransport::ACTION_UPGRADE: - break; - case xPDOTransport::ACTION_UNINSTALL: - if ($modx->getDebug()) { - $modx->log(modX::LOG_LEVEL_WARN, 'validator xPDOTransport::ACTION_UNINSTALL'); - } - $modelPath = $modx->getOption('core_path') . 'components/lingua/model/'; - $tablePrefix = $modx->getOption('lingua.table_prefix', null, $modx->config[modX::OPT_TABLE_PREFIX] . 'lingua_'); - if ($modx->addPackage('lingua', $modelPath, $tablePrefix)) { - if ($modx->getDebug()) { - $modx->log(modX::LOG_LEVEL_WARN, '[Lingua] package was added in validator xPDOTransport::ACTION_UNINSTALL'); - } -// $manager = $modx->getManager(); -// $manager->removeObjectContainer('linguaLangs'); -// $manager->removeObjectContainer('linguaSiteContent'); -// $manager->removeObjectContainer('linguaSiteTmplvarContentvalues'); -// $manager->removeObjectContainer('linguaSiteTmplvars'); - } - break; - } -} -return true; \ No newline at end of file diff --git a/_build/resolvers/tables.php b/_build/resolvers/tables.php new file mode 100644 index 0000000..c16af70 --- /dev/null +++ b/_build/resolvers/tables.php @@ -0,0 +1,146 @@ + + * + * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface + * + * Lingua is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation version 3. + * + * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * Resolve creating db tables + * + * @package lingua + * @subpackage build + */ + +/** @var xPDO\Transport\xPDOTransport $transport */ +/** @var array $options */ +/** @var MODX\Revolution\modX $modx */ + +if ($transport->xpdo) { + $modx = $transport->xpdo; + + switch ($options[xPDOTransport::PACKAGE_ACTION]) { + case xPDOTransport::ACTION_INSTALL: + case xPDOTransport::ACTION_UPGRADE: + $modx->addPackage('Lingua\Model', MODX_CORE_PATH . 'components/lingua/src/', null, 'Lingua\\'); + //$modx->addExtensionPackage('Lingua\Model', '[[++core_path]]components/lingua/src/'); + + $manager = $modx->getManager(); + $objects = []; + $schemaFile = MODX_CORE_PATH . 'components/lingua/schema/lingua.mysql.schema.xml'; + if (is_file($schemaFile)) { + $schema = new SimpleXMLElement($schemaFile, 0, true); + if (isset($schema->object)) { + foreach ($schema->object as $obj) { + $objects[] = (string)$obj['class']; + } + } + unset($schema); + } + foreach ($objects as $class) { + $class = 'Lingua\\Model\\' . $class; + $table = $modx->getTableName($class); + + $sql = "SHOW TABLES LIKE '" . trim($table, '`') . "'"; + $stmt = $modx->prepare($sql); + $newTable = true; + if ($stmt->execute() && $stmt->fetchAll()) { + $newTable = false; + } + // If the table is just created + if ($newTable) { + $manager->createObjectContainer($class); + } else { + // If the table exists + // 1. Operate with tables + $tableFields = []; + $c = $modx->prepare("SHOW COLUMNS IN {$modx->getTableName($class)}"); + $c->execute(); + while ($cl = $c->fetch(PDO::FETCH_ASSOC)) { + $tableFields[$cl['Field']] = $cl['Field']; + } + foreach ($modx->getFields($class) as $field => $v) { + if (in_array($field, $tableFields)) { + unset($tableFields[$field]); + $manager->alterField($class, $field); + } else { + $manager->addField($class, $field); + } + } + foreach ($tableFields as $field) { + $manager->removeField($class, $field); + } + // 2. Operate with indexes + $indexes = []; + $c = $modx->prepare("SHOW INDEX FROM {$modx->getTableName($class)}"); + $c->execute(); + while ($row = $c->fetch(PDO::FETCH_ASSOC)) { + $name = $row['Key_name']; + if (!isset($indexes[$name])) { + $indexes[$name] = [$row['Column_name']]; + } else { + $indexes[$name][] = $row['Column_name']; + } + } + foreach ($indexes as $name => $values) { + sort($values); + $indexes[$name] = implode(':', $values); + } + $map = $modx->getIndexMeta($class); + // Remove old indexes + foreach ($indexes as $key => $index) { + if (!isset($map[$key])) { + if ($manager->removeIndex($class, $key)) { + $modx->log(modX::LOG_LEVEL_INFO, "Removed index \"{$key}\" of the table \"{$class}\""); + } + } + } + // Add or alter existing + foreach ($map as $key => $index) { + ksort($index['columns']); + $index = implode(':', array_keys($index['columns'])); + if (!isset($indexes[$key])) { + if ($manager->addIndex($class, $key)) { + $modx->log(modX::LOG_LEVEL_INFO, "Added index \"{$key}\" in the table \"{$class}\""); + } + } else { + if ($index != $indexes[$key]) { + if ($manager->removeIndex($class, $key) && $manager->addIndex($class, $key)) { + $modx->log(modX::LOG_LEVEL_INFO, + "Updated index \"{$key}\" of the table \"{$class}\"" + ); + } + } + } + } + } + } + $defaults = include MODX_CORE_PATH . 'components/lingua/defaults/default.langs.php'; + foreach ($defaults as $default) { + $default->save(); + } + $defaults = include MODX_CORE_PATH . 'components/lingua/defaults/default.patterns.php'; + foreach ($defaults as $default) { + $default->save(); + } + break; + case xPDOTransport::ACTION_UNINSTALL: + $modx->removeExtensionPackage('Lingua'); + break; + } +} + +return true; diff --git a/www/assets/components/lingua/conn/mgr.php b/assets/components/lingua/conn/mgr.php similarity index 87% rename from www/assets/components/lingua/conn/mgr.php rename to assets/components/lingua/conn/mgr.php index 1f366b0..8a73c90 100644 --- a/www/assets/components/lingua/conn/mgr.php +++ b/assets/components/lingua/conn/mgr.php @@ -1,4 +1,5 @@ getOption('lingua.core_path', null, $modx->getOption('core_path') . 'components/lingua/'); -require_once $corePath . 'model/lingua/lingua.class.php'; -$modx->lingua = new Lingua($modx); +$Lingua = $modx->services->get('Lingua'); $modx->lexicon->load('lingua:cmp'); /* handle request */ -$path = $modx->getOption('processorsPath', $modx->lingua->config, $corePath . 'processors/'); +$path = $modx->getOption('processorsPath', $Lingua->config, $corePath . 'src/Processors/'); +$modx->getRequest(); + $modx->request->handleRequest(array( 'processors_path' => $path, 'location' => '', -)); \ No newline at end of file +)); diff --git a/www/assets/components/lingua/css/mgr.css b/assets/components/lingua/css/mgr.css similarity index 100% rename from www/assets/components/lingua/css/mgr.css rename to assets/components/lingua/css/mgr.css diff --git a/www/assets/components/lingua/icons/flags/gif/.DS_Store b/assets/components/lingua/icons/flags/gif/.DS_Store similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/.DS_Store rename to assets/components/lingua/icons/flags/gif/.DS_Store diff --git a/www/assets/components/lingua/icons/flags/gif/ad.gif b/assets/components/lingua/icons/flags/gif/ad.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ad.gif rename to assets/components/lingua/icons/flags/gif/ad.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ae.gif b/assets/components/lingua/icons/flags/gif/ae.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ae.gif rename to assets/components/lingua/icons/flags/gif/ae.gif diff --git a/www/assets/components/lingua/icons/flags/gif/af.gif b/assets/components/lingua/icons/flags/gif/af.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/af.gif rename to assets/components/lingua/icons/flags/gif/af.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ag.gif b/assets/components/lingua/icons/flags/gif/ag.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ag.gif rename to assets/components/lingua/icons/flags/gif/ag.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ai.gif b/assets/components/lingua/icons/flags/gif/ai.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ai.gif rename to assets/components/lingua/icons/flags/gif/ai.gif diff --git a/www/assets/components/lingua/icons/flags/gif/al.gif b/assets/components/lingua/icons/flags/gif/al.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/al.gif rename to assets/components/lingua/icons/flags/gif/al.gif diff --git a/www/assets/components/lingua/icons/flags/gif/am.gif b/assets/components/lingua/icons/flags/gif/am.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/am.gif rename to assets/components/lingua/icons/flags/gif/am.gif diff --git a/www/assets/components/lingua/icons/flags/gif/an.gif b/assets/components/lingua/icons/flags/gif/an.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/an.gif rename to assets/components/lingua/icons/flags/gif/an.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ao.gif b/assets/components/lingua/icons/flags/gif/ao.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ao.gif rename to assets/components/lingua/icons/flags/gif/ao.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ar.gif b/assets/components/lingua/icons/flags/gif/ar.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ar.gif rename to assets/components/lingua/icons/flags/gif/ar.gif diff --git a/www/assets/components/lingua/icons/flags/gif/as.gif b/assets/components/lingua/icons/flags/gif/as.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/as.gif rename to assets/components/lingua/icons/flags/gif/as.gif diff --git a/www/assets/components/lingua/icons/flags/gif/at.gif b/assets/components/lingua/icons/flags/gif/at.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/at.gif rename to assets/components/lingua/icons/flags/gif/at.gif diff --git a/www/assets/components/lingua/icons/flags/gif/au.gif b/assets/components/lingua/icons/flags/gif/au.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/au.gif rename to assets/components/lingua/icons/flags/gif/au.gif diff --git a/www/assets/components/lingua/icons/flags/gif/aw.gif b/assets/components/lingua/icons/flags/gif/aw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/aw.gif rename to assets/components/lingua/icons/flags/gif/aw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ax.gif b/assets/components/lingua/icons/flags/gif/ax.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ax.gif rename to assets/components/lingua/icons/flags/gif/ax.gif diff --git a/www/assets/components/lingua/icons/flags/gif/az.gif b/assets/components/lingua/icons/flags/gif/az.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/az.gif rename to assets/components/lingua/icons/flags/gif/az.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ba.gif b/assets/components/lingua/icons/flags/gif/ba.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ba.gif rename to assets/components/lingua/icons/flags/gif/ba.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bb.gif b/assets/components/lingua/icons/flags/gif/bb.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bb.gif rename to assets/components/lingua/icons/flags/gif/bb.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bd.gif b/assets/components/lingua/icons/flags/gif/bd.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bd.gif rename to assets/components/lingua/icons/flags/gif/bd.gif diff --git a/www/assets/components/lingua/icons/flags/gif/be.gif b/assets/components/lingua/icons/flags/gif/be.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/be.gif rename to assets/components/lingua/icons/flags/gif/be.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bf.gif b/assets/components/lingua/icons/flags/gif/bf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bf.gif rename to assets/components/lingua/icons/flags/gif/bf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bg.gif b/assets/components/lingua/icons/flags/gif/bg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bg.gif rename to assets/components/lingua/icons/flags/gif/bg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bh.gif b/assets/components/lingua/icons/flags/gif/bh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bh.gif rename to assets/components/lingua/icons/flags/gif/bh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bi.gif b/assets/components/lingua/icons/flags/gif/bi.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bi.gif rename to assets/components/lingua/icons/flags/gif/bi.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bj.gif b/assets/components/lingua/icons/flags/gif/bj.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bj.gif rename to assets/components/lingua/icons/flags/gif/bj.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bm.gif b/assets/components/lingua/icons/flags/gif/bm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bm.gif rename to assets/components/lingua/icons/flags/gif/bm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bn.gif b/assets/components/lingua/icons/flags/gif/bn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bn.gif rename to assets/components/lingua/icons/flags/gif/bn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bo.gif b/assets/components/lingua/icons/flags/gif/bo.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bo.gif rename to assets/components/lingua/icons/flags/gif/bo.gif diff --git a/www/assets/components/lingua/icons/flags/gif/br.gif b/assets/components/lingua/icons/flags/gif/br.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/br.gif rename to assets/components/lingua/icons/flags/gif/br.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bs.gif b/assets/components/lingua/icons/flags/gif/bs.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bs.gif rename to assets/components/lingua/icons/flags/gif/bs.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bt.gif b/assets/components/lingua/icons/flags/gif/bt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bt.gif rename to assets/components/lingua/icons/flags/gif/bt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bv.gif b/assets/components/lingua/icons/flags/gif/bv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bv.gif rename to assets/components/lingua/icons/flags/gif/bv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bw.gif b/assets/components/lingua/icons/flags/gif/bw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bw.gif rename to assets/components/lingua/icons/flags/gif/bw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/by.gif b/assets/components/lingua/icons/flags/gif/by.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/by.gif rename to assets/components/lingua/icons/flags/gif/by.gif diff --git a/www/assets/components/lingua/icons/flags/gif/bz.gif b/assets/components/lingua/icons/flags/gif/bz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/bz.gif rename to assets/components/lingua/icons/flags/gif/bz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ca.gif b/assets/components/lingua/icons/flags/gif/ca.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ca.gif rename to assets/components/lingua/icons/flags/gif/ca.gif diff --git a/www/assets/components/lingua/icons/flags/gif/catalonia.gif b/assets/components/lingua/icons/flags/gif/catalonia.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/catalonia.gif rename to assets/components/lingua/icons/flags/gif/catalonia.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cc.gif b/assets/components/lingua/icons/flags/gif/cc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cc.gif rename to assets/components/lingua/icons/flags/gif/cc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cd.gif b/assets/components/lingua/icons/flags/gif/cd.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cd.gif rename to assets/components/lingua/icons/flags/gif/cd.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cf.gif b/assets/components/lingua/icons/flags/gif/cf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cf.gif rename to assets/components/lingua/icons/flags/gif/cf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cg.gif b/assets/components/lingua/icons/flags/gif/cg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cg.gif rename to assets/components/lingua/icons/flags/gif/cg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ch.gif b/assets/components/lingua/icons/flags/gif/ch.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ch.gif rename to assets/components/lingua/icons/flags/gif/ch.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ci.gif b/assets/components/lingua/icons/flags/gif/ci.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ci.gif rename to assets/components/lingua/icons/flags/gif/ci.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ck.gif b/assets/components/lingua/icons/flags/gif/ck.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ck.gif rename to assets/components/lingua/icons/flags/gif/ck.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cl.gif b/assets/components/lingua/icons/flags/gif/cl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cl.gif rename to assets/components/lingua/icons/flags/gif/cl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cm.gif b/assets/components/lingua/icons/flags/gif/cm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cm.gif rename to assets/components/lingua/icons/flags/gif/cm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cn.gif b/assets/components/lingua/icons/flags/gif/cn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cn.gif rename to assets/components/lingua/icons/flags/gif/cn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/co.gif b/assets/components/lingua/icons/flags/gif/co.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/co.gif rename to assets/components/lingua/icons/flags/gif/co.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cr.gif b/assets/components/lingua/icons/flags/gif/cr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cr.gif rename to assets/components/lingua/icons/flags/gif/cr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cs.gif b/assets/components/lingua/icons/flags/gif/cs.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cs.gif rename to assets/components/lingua/icons/flags/gif/cs.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cu.gif b/assets/components/lingua/icons/flags/gif/cu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cu.gif rename to assets/components/lingua/icons/flags/gif/cu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cv.gif b/assets/components/lingua/icons/flags/gif/cv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cv.gif rename to assets/components/lingua/icons/flags/gif/cv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cx.gif b/assets/components/lingua/icons/flags/gif/cx.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cx.gif rename to assets/components/lingua/icons/flags/gif/cx.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cy.gif b/assets/components/lingua/icons/flags/gif/cy.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cy.gif rename to assets/components/lingua/icons/flags/gif/cy.gif diff --git a/www/assets/components/lingua/icons/flags/gif/cz.gif b/assets/components/lingua/icons/flags/gif/cz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/cz.gif rename to assets/components/lingua/icons/flags/gif/cz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/de.gif b/assets/components/lingua/icons/flags/gif/de.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/de.gif rename to assets/components/lingua/icons/flags/gif/de.gif diff --git a/www/assets/components/lingua/icons/flags/gif/dj.gif b/assets/components/lingua/icons/flags/gif/dj.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/dj.gif rename to assets/components/lingua/icons/flags/gif/dj.gif diff --git a/www/assets/components/lingua/icons/flags/gif/dk.gif b/assets/components/lingua/icons/flags/gif/dk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/dk.gif rename to assets/components/lingua/icons/flags/gif/dk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/dm.gif b/assets/components/lingua/icons/flags/gif/dm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/dm.gif rename to assets/components/lingua/icons/flags/gif/dm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/do.gif b/assets/components/lingua/icons/flags/gif/do.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/do.gif rename to assets/components/lingua/icons/flags/gif/do.gif diff --git a/www/assets/components/lingua/icons/flags/gif/dz.gif b/assets/components/lingua/icons/flags/gif/dz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/dz.gif rename to assets/components/lingua/icons/flags/gif/dz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ec.gif b/assets/components/lingua/icons/flags/gif/ec.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ec.gif rename to assets/components/lingua/icons/flags/gif/ec.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ee.gif b/assets/components/lingua/icons/flags/gif/ee.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ee.gif rename to assets/components/lingua/icons/flags/gif/ee.gif diff --git a/www/assets/components/lingua/icons/flags/gif/eg.gif b/assets/components/lingua/icons/flags/gif/eg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/eg.gif rename to assets/components/lingua/icons/flags/gif/eg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/eh.gif b/assets/components/lingua/icons/flags/gif/eh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/eh.gif rename to assets/components/lingua/icons/flags/gif/eh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/england.gif b/assets/components/lingua/icons/flags/gif/england.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/england.gif rename to assets/components/lingua/icons/flags/gif/england.gif diff --git a/www/assets/components/lingua/icons/flags/gif/er.gif b/assets/components/lingua/icons/flags/gif/er.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/er.gif rename to assets/components/lingua/icons/flags/gif/er.gif diff --git a/www/assets/components/lingua/icons/flags/gif/es.gif b/assets/components/lingua/icons/flags/gif/es.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/es.gif rename to assets/components/lingua/icons/flags/gif/es.gif diff --git a/www/assets/components/lingua/icons/flags/gif/et.gif b/assets/components/lingua/icons/flags/gif/et.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/et.gif rename to assets/components/lingua/icons/flags/gif/et.gif diff --git a/www/assets/components/lingua/icons/flags/gif/europeanunion.gif b/assets/components/lingua/icons/flags/gif/europeanunion.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/europeanunion.gif rename to assets/components/lingua/icons/flags/gif/europeanunion.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fam.gif b/assets/components/lingua/icons/flags/gif/fam.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fam.gif rename to assets/components/lingua/icons/flags/gif/fam.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fi.gif b/assets/components/lingua/icons/flags/gif/fi.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fi.gif rename to assets/components/lingua/icons/flags/gif/fi.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fj.gif b/assets/components/lingua/icons/flags/gif/fj.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fj.gif rename to assets/components/lingua/icons/flags/gif/fj.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fk.gif b/assets/components/lingua/icons/flags/gif/fk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fk.gif rename to assets/components/lingua/icons/flags/gif/fk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fm.gif b/assets/components/lingua/icons/flags/gif/fm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fm.gif rename to assets/components/lingua/icons/flags/gif/fm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fo.gif b/assets/components/lingua/icons/flags/gif/fo.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fo.gif rename to assets/components/lingua/icons/flags/gif/fo.gif diff --git a/www/assets/components/lingua/icons/flags/gif/fr.gif b/assets/components/lingua/icons/flags/gif/fr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/fr.gif rename to assets/components/lingua/icons/flags/gif/fr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ga.gif b/assets/components/lingua/icons/flags/gif/ga.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ga.gif rename to assets/components/lingua/icons/flags/gif/ga.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gb.gif b/assets/components/lingua/icons/flags/gif/gb.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gb.gif rename to assets/components/lingua/icons/flags/gif/gb.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gd.gif b/assets/components/lingua/icons/flags/gif/gd.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gd.gif rename to assets/components/lingua/icons/flags/gif/gd.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ge.gif b/assets/components/lingua/icons/flags/gif/ge.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ge.gif rename to assets/components/lingua/icons/flags/gif/ge.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gf.gif b/assets/components/lingua/icons/flags/gif/gf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gf.gif rename to assets/components/lingua/icons/flags/gif/gf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gh.gif b/assets/components/lingua/icons/flags/gif/gh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gh.gif rename to assets/components/lingua/icons/flags/gif/gh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gi.gif b/assets/components/lingua/icons/flags/gif/gi.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gi.gif rename to assets/components/lingua/icons/flags/gif/gi.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gl.gif b/assets/components/lingua/icons/flags/gif/gl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gl.gif rename to assets/components/lingua/icons/flags/gif/gl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gm.gif b/assets/components/lingua/icons/flags/gif/gm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gm.gif rename to assets/components/lingua/icons/flags/gif/gm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gn.gif b/assets/components/lingua/icons/flags/gif/gn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gn.gif rename to assets/components/lingua/icons/flags/gif/gn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gp.gif b/assets/components/lingua/icons/flags/gif/gp.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gp.gif rename to assets/components/lingua/icons/flags/gif/gp.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gq.gif b/assets/components/lingua/icons/flags/gif/gq.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gq.gif rename to assets/components/lingua/icons/flags/gif/gq.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gr.gif b/assets/components/lingua/icons/flags/gif/gr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gr.gif rename to assets/components/lingua/icons/flags/gif/gr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gs.gif b/assets/components/lingua/icons/flags/gif/gs.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gs.gif rename to assets/components/lingua/icons/flags/gif/gs.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gt.gif b/assets/components/lingua/icons/flags/gif/gt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gt.gif rename to assets/components/lingua/icons/flags/gif/gt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gu.gif b/assets/components/lingua/icons/flags/gif/gu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gu.gif rename to assets/components/lingua/icons/flags/gif/gu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gw.gif b/assets/components/lingua/icons/flags/gif/gw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gw.gif rename to assets/components/lingua/icons/flags/gif/gw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/gy.gif b/assets/components/lingua/icons/flags/gif/gy.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/gy.gif rename to assets/components/lingua/icons/flags/gif/gy.gif diff --git a/www/assets/components/lingua/icons/flags/gif/hk.gif b/assets/components/lingua/icons/flags/gif/hk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/hk.gif rename to assets/components/lingua/icons/flags/gif/hk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/hm.gif b/assets/components/lingua/icons/flags/gif/hm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/hm.gif rename to assets/components/lingua/icons/flags/gif/hm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/hn.gif b/assets/components/lingua/icons/flags/gif/hn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/hn.gif rename to assets/components/lingua/icons/flags/gif/hn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/hr.gif b/assets/components/lingua/icons/flags/gif/hr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/hr.gif rename to assets/components/lingua/icons/flags/gif/hr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ht.gif b/assets/components/lingua/icons/flags/gif/ht.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ht.gif rename to assets/components/lingua/icons/flags/gif/ht.gif diff --git a/www/assets/components/lingua/icons/flags/gif/hu.gif b/assets/components/lingua/icons/flags/gif/hu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/hu.gif rename to assets/components/lingua/icons/flags/gif/hu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/id.gif b/assets/components/lingua/icons/flags/gif/id.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/id.gif rename to assets/components/lingua/icons/flags/gif/id.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ie.gif b/assets/components/lingua/icons/flags/gif/ie.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ie.gif rename to assets/components/lingua/icons/flags/gif/ie.gif diff --git a/www/assets/components/lingua/icons/flags/gif/il.gif b/assets/components/lingua/icons/flags/gif/il.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/il.gif rename to assets/components/lingua/icons/flags/gif/il.gif diff --git a/www/assets/components/lingua/icons/flags/gif/in.gif b/assets/components/lingua/icons/flags/gif/in.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/in.gif rename to assets/components/lingua/icons/flags/gif/in.gif diff --git a/www/assets/components/lingua/icons/flags/gif/io.gif b/assets/components/lingua/icons/flags/gif/io.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/io.gif rename to assets/components/lingua/icons/flags/gif/io.gif diff --git a/www/assets/components/lingua/icons/flags/gif/iq.gif b/assets/components/lingua/icons/flags/gif/iq.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/iq.gif rename to assets/components/lingua/icons/flags/gif/iq.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ir.gif b/assets/components/lingua/icons/flags/gif/ir.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ir.gif rename to assets/components/lingua/icons/flags/gif/ir.gif diff --git a/www/assets/components/lingua/icons/flags/gif/is.gif b/assets/components/lingua/icons/flags/gif/is.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/is.gif rename to assets/components/lingua/icons/flags/gif/is.gif diff --git a/www/assets/components/lingua/icons/flags/gif/it.gif b/assets/components/lingua/icons/flags/gif/it.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/it.gif rename to assets/components/lingua/icons/flags/gif/it.gif diff --git a/www/assets/components/lingua/icons/flags/gif/jm.gif b/assets/components/lingua/icons/flags/gif/jm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/jm.gif rename to assets/components/lingua/icons/flags/gif/jm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/jo.gif b/assets/components/lingua/icons/flags/gif/jo.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/jo.gif rename to assets/components/lingua/icons/flags/gif/jo.gif diff --git a/www/assets/components/lingua/icons/flags/gif/jp.gif b/assets/components/lingua/icons/flags/gif/jp.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/jp.gif rename to assets/components/lingua/icons/flags/gif/jp.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ke.gif b/assets/components/lingua/icons/flags/gif/ke.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ke.gif rename to assets/components/lingua/icons/flags/gif/ke.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kg.gif b/assets/components/lingua/icons/flags/gif/kg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kg.gif rename to assets/components/lingua/icons/flags/gif/kg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kh.gif b/assets/components/lingua/icons/flags/gif/kh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kh.gif rename to assets/components/lingua/icons/flags/gif/kh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ki.gif b/assets/components/lingua/icons/flags/gif/ki.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ki.gif rename to assets/components/lingua/icons/flags/gif/ki.gif diff --git a/www/assets/components/lingua/icons/flags/gif/km.gif b/assets/components/lingua/icons/flags/gif/km.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/km.gif rename to assets/components/lingua/icons/flags/gif/km.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kn.gif b/assets/components/lingua/icons/flags/gif/kn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kn.gif rename to assets/components/lingua/icons/flags/gif/kn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kp.gif b/assets/components/lingua/icons/flags/gif/kp.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kp.gif rename to assets/components/lingua/icons/flags/gif/kp.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kr.gif b/assets/components/lingua/icons/flags/gif/kr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kr.gif rename to assets/components/lingua/icons/flags/gif/kr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kw.gif b/assets/components/lingua/icons/flags/gif/kw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kw.gif rename to assets/components/lingua/icons/flags/gif/kw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ky.gif b/assets/components/lingua/icons/flags/gif/ky.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ky.gif rename to assets/components/lingua/icons/flags/gif/ky.gif diff --git a/www/assets/components/lingua/icons/flags/gif/kz.gif b/assets/components/lingua/icons/flags/gif/kz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/kz.gif rename to assets/components/lingua/icons/flags/gif/kz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/la.gif b/assets/components/lingua/icons/flags/gif/la.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/la.gif rename to assets/components/lingua/icons/flags/gif/la.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lb.gif b/assets/components/lingua/icons/flags/gif/lb.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lb.gif rename to assets/components/lingua/icons/flags/gif/lb.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lc.gif b/assets/components/lingua/icons/flags/gif/lc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lc.gif rename to assets/components/lingua/icons/flags/gif/lc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/li.gif b/assets/components/lingua/icons/flags/gif/li.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/li.gif rename to assets/components/lingua/icons/flags/gif/li.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lk.gif b/assets/components/lingua/icons/flags/gif/lk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lk.gif rename to assets/components/lingua/icons/flags/gif/lk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lr.gif b/assets/components/lingua/icons/flags/gif/lr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lr.gif rename to assets/components/lingua/icons/flags/gif/lr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ls.gif b/assets/components/lingua/icons/flags/gif/ls.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ls.gif rename to assets/components/lingua/icons/flags/gif/ls.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lt.gif b/assets/components/lingua/icons/flags/gif/lt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lt.gif rename to assets/components/lingua/icons/flags/gif/lt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lu.gif b/assets/components/lingua/icons/flags/gif/lu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lu.gif rename to assets/components/lingua/icons/flags/gif/lu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/lv.gif b/assets/components/lingua/icons/flags/gif/lv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/lv.gif rename to assets/components/lingua/icons/flags/gif/lv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ly.gif b/assets/components/lingua/icons/flags/gif/ly.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ly.gif rename to assets/components/lingua/icons/flags/gif/ly.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ma.gif b/assets/components/lingua/icons/flags/gif/ma.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ma.gif rename to assets/components/lingua/icons/flags/gif/ma.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mc.gif b/assets/components/lingua/icons/flags/gif/mc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mc.gif rename to assets/components/lingua/icons/flags/gif/mc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/md.gif b/assets/components/lingua/icons/flags/gif/md.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/md.gif rename to assets/components/lingua/icons/flags/gif/md.gif diff --git a/www/assets/components/lingua/icons/flags/gif/me.gif b/assets/components/lingua/icons/flags/gif/me.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/me.gif rename to assets/components/lingua/icons/flags/gif/me.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mg.gif b/assets/components/lingua/icons/flags/gif/mg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mg.gif rename to assets/components/lingua/icons/flags/gif/mg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mh.gif b/assets/components/lingua/icons/flags/gif/mh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mh.gif rename to assets/components/lingua/icons/flags/gif/mh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mk.gif b/assets/components/lingua/icons/flags/gif/mk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mk.gif rename to assets/components/lingua/icons/flags/gif/mk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ml.gif b/assets/components/lingua/icons/flags/gif/ml.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ml.gif rename to assets/components/lingua/icons/flags/gif/ml.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mm.gif b/assets/components/lingua/icons/flags/gif/mm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mm.gif rename to assets/components/lingua/icons/flags/gif/mm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mn.gif b/assets/components/lingua/icons/flags/gif/mn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mn.gif rename to assets/components/lingua/icons/flags/gif/mn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mo.gif b/assets/components/lingua/icons/flags/gif/mo.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mo.gif rename to assets/components/lingua/icons/flags/gif/mo.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mp.gif b/assets/components/lingua/icons/flags/gif/mp.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mp.gif rename to assets/components/lingua/icons/flags/gif/mp.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mq.gif b/assets/components/lingua/icons/flags/gif/mq.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mq.gif rename to assets/components/lingua/icons/flags/gif/mq.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mr.gif b/assets/components/lingua/icons/flags/gif/mr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mr.gif rename to assets/components/lingua/icons/flags/gif/mr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ms.gif b/assets/components/lingua/icons/flags/gif/ms.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ms.gif rename to assets/components/lingua/icons/flags/gif/ms.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mt.gif b/assets/components/lingua/icons/flags/gif/mt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mt.gif rename to assets/components/lingua/icons/flags/gif/mt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mu.gif b/assets/components/lingua/icons/flags/gif/mu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mu.gif rename to assets/components/lingua/icons/flags/gif/mu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mv.gif b/assets/components/lingua/icons/flags/gif/mv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mv.gif rename to assets/components/lingua/icons/flags/gif/mv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mw.gif b/assets/components/lingua/icons/flags/gif/mw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mw.gif rename to assets/components/lingua/icons/flags/gif/mw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mx.gif b/assets/components/lingua/icons/flags/gif/mx.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mx.gif rename to assets/components/lingua/icons/flags/gif/mx.gif diff --git a/www/assets/components/lingua/icons/flags/gif/my.gif b/assets/components/lingua/icons/flags/gif/my.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/my.gif rename to assets/components/lingua/icons/flags/gif/my.gif diff --git a/www/assets/components/lingua/icons/flags/gif/mz.gif b/assets/components/lingua/icons/flags/gif/mz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/mz.gif rename to assets/components/lingua/icons/flags/gif/mz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/na.gif b/assets/components/lingua/icons/flags/gif/na.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/na.gif rename to assets/components/lingua/icons/flags/gif/na.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nc.gif b/assets/components/lingua/icons/flags/gif/nc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nc.gif rename to assets/components/lingua/icons/flags/gif/nc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ne.gif b/assets/components/lingua/icons/flags/gif/ne.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ne.gif rename to assets/components/lingua/icons/flags/gif/ne.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nf.gif b/assets/components/lingua/icons/flags/gif/nf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nf.gif rename to assets/components/lingua/icons/flags/gif/nf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ng.gif b/assets/components/lingua/icons/flags/gif/ng.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ng.gif rename to assets/components/lingua/icons/flags/gif/ng.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ni.gif b/assets/components/lingua/icons/flags/gif/ni.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ni.gif rename to assets/components/lingua/icons/flags/gif/ni.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nl.gif b/assets/components/lingua/icons/flags/gif/nl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nl.gif rename to assets/components/lingua/icons/flags/gif/nl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/no.gif b/assets/components/lingua/icons/flags/gif/no.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/no.gif rename to assets/components/lingua/icons/flags/gif/no.gif diff --git a/www/assets/components/lingua/icons/flags/gif/np.gif b/assets/components/lingua/icons/flags/gif/np.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/np.gif rename to assets/components/lingua/icons/flags/gif/np.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nr.gif b/assets/components/lingua/icons/flags/gif/nr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nr.gif rename to assets/components/lingua/icons/flags/gif/nr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nu.gif b/assets/components/lingua/icons/flags/gif/nu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nu.gif rename to assets/components/lingua/icons/flags/gif/nu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/nz.gif b/assets/components/lingua/icons/flags/gif/nz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/nz.gif rename to assets/components/lingua/icons/flags/gif/nz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/om.gif b/assets/components/lingua/icons/flags/gif/om.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/om.gif rename to assets/components/lingua/icons/flags/gif/om.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pa.gif b/assets/components/lingua/icons/flags/gif/pa.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pa.gif rename to assets/components/lingua/icons/flags/gif/pa.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pe.gif b/assets/components/lingua/icons/flags/gif/pe.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pe.gif rename to assets/components/lingua/icons/flags/gif/pe.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pf.gif b/assets/components/lingua/icons/flags/gif/pf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pf.gif rename to assets/components/lingua/icons/flags/gif/pf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pg.gif b/assets/components/lingua/icons/flags/gif/pg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pg.gif rename to assets/components/lingua/icons/flags/gif/pg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ph.gif b/assets/components/lingua/icons/flags/gif/ph.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ph.gif rename to assets/components/lingua/icons/flags/gif/ph.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pk.gif b/assets/components/lingua/icons/flags/gif/pk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pk.gif rename to assets/components/lingua/icons/flags/gif/pk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pl.gif b/assets/components/lingua/icons/flags/gif/pl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pl.gif rename to assets/components/lingua/icons/flags/gif/pl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pm.gif b/assets/components/lingua/icons/flags/gif/pm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pm.gif rename to assets/components/lingua/icons/flags/gif/pm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pn.gif b/assets/components/lingua/icons/flags/gif/pn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pn.gif rename to assets/components/lingua/icons/flags/gif/pn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pr.gif b/assets/components/lingua/icons/flags/gif/pr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pr.gif rename to assets/components/lingua/icons/flags/gif/pr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ps.gif b/assets/components/lingua/icons/flags/gif/ps.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ps.gif rename to assets/components/lingua/icons/flags/gif/ps.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pt.gif b/assets/components/lingua/icons/flags/gif/pt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pt.gif rename to assets/components/lingua/icons/flags/gif/pt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/pw.gif b/assets/components/lingua/icons/flags/gif/pw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/pw.gif rename to assets/components/lingua/icons/flags/gif/pw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/py.gif b/assets/components/lingua/icons/flags/gif/py.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/py.gif rename to assets/components/lingua/icons/flags/gif/py.gif diff --git a/www/assets/components/lingua/icons/flags/gif/qa.gif b/assets/components/lingua/icons/flags/gif/qa.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/qa.gif rename to assets/components/lingua/icons/flags/gif/qa.gif diff --git a/www/assets/components/lingua/icons/flags/gif/re.gif b/assets/components/lingua/icons/flags/gif/re.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/re.gif rename to assets/components/lingua/icons/flags/gif/re.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ro.gif b/assets/components/lingua/icons/flags/gif/ro.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ro.gif rename to assets/components/lingua/icons/flags/gif/ro.gif diff --git a/www/assets/components/lingua/icons/flags/gif/rs.gif b/assets/components/lingua/icons/flags/gif/rs.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/rs.gif rename to assets/components/lingua/icons/flags/gif/rs.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ru.gif b/assets/components/lingua/icons/flags/gif/ru.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ru.gif rename to assets/components/lingua/icons/flags/gif/ru.gif diff --git a/www/assets/components/lingua/icons/flags/gif/rw.gif b/assets/components/lingua/icons/flags/gif/rw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/rw.gif rename to assets/components/lingua/icons/flags/gif/rw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sa.gif b/assets/components/lingua/icons/flags/gif/sa.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sa.gif rename to assets/components/lingua/icons/flags/gif/sa.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sb.gif b/assets/components/lingua/icons/flags/gif/sb.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sb.gif rename to assets/components/lingua/icons/flags/gif/sb.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sc.gif b/assets/components/lingua/icons/flags/gif/sc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sc.gif rename to assets/components/lingua/icons/flags/gif/sc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/scotland.gif b/assets/components/lingua/icons/flags/gif/scotland.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/scotland.gif rename to assets/components/lingua/icons/flags/gif/scotland.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sd.gif b/assets/components/lingua/icons/flags/gif/sd.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sd.gif rename to assets/components/lingua/icons/flags/gif/sd.gif diff --git a/www/assets/components/lingua/icons/flags/gif/se.gif b/assets/components/lingua/icons/flags/gif/se.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/se.gif rename to assets/components/lingua/icons/flags/gif/se.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sg.gif b/assets/components/lingua/icons/flags/gif/sg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sg.gif rename to assets/components/lingua/icons/flags/gif/sg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sh.gif b/assets/components/lingua/icons/flags/gif/sh.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sh.gif rename to assets/components/lingua/icons/flags/gif/sh.gif diff --git a/www/assets/components/lingua/icons/flags/gif/si.gif b/assets/components/lingua/icons/flags/gif/si.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/si.gif rename to assets/components/lingua/icons/flags/gif/si.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sj.gif b/assets/components/lingua/icons/flags/gif/sj.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sj.gif rename to assets/components/lingua/icons/flags/gif/sj.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sk.gif b/assets/components/lingua/icons/flags/gif/sk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sk.gif rename to assets/components/lingua/icons/flags/gif/sk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sl.gif b/assets/components/lingua/icons/flags/gif/sl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sl.gif rename to assets/components/lingua/icons/flags/gif/sl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sm.gif b/assets/components/lingua/icons/flags/gif/sm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sm.gif rename to assets/components/lingua/icons/flags/gif/sm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sn.gif b/assets/components/lingua/icons/flags/gif/sn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sn.gif rename to assets/components/lingua/icons/flags/gif/sn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/so.gif b/assets/components/lingua/icons/flags/gif/so.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/so.gif rename to assets/components/lingua/icons/flags/gif/so.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sr.gif b/assets/components/lingua/icons/flags/gif/sr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sr.gif rename to assets/components/lingua/icons/flags/gif/sr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/st.gif b/assets/components/lingua/icons/flags/gif/st.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/st.gif rename to assets/components/lingua/icons/flags/gif/st.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sv.gif b/assets/components/lingua/icons/flags/gif/sv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sv.gif rename to assets/components/lingua/icons/flags/gif/sv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sy.gif b/assets/components/lingua/icons/flags/gif/sy.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sy.gif rename to assets/components/lingua/icons/flags/gif/sy.gif diff --git a/www/assets/components/lingua/icons/flags/gif/sz.gif b/assets/components/lingua/icons/flags/gif/sz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/sz.gif rename to assets/components/lingua/icons/flags/gif/sz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tc.gif b/assets/components/lingua/icons/flags/gif/tc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tc.gif rename to assets/components/lingua/icons/flags/gif/tc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/td.gif b/assets/components/lingua/icons/flags/gif/td.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/td.gif rename to assets/components/lingua/icons/flags/gif/td.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tf.gif b/assets/components/lingua/icons/flags/gif/tf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tf.gif rename to assets/components/lingua/icons/flags/gif/tf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tg.gif b/assets/components/lingua/icons/flags/gif/tg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tg.gif rename to assets/components/lingua/icons/flags/gif/tg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/th.gif b/assets/components/lingua/icons/flags/gif/th.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/th.gif rename to assets/components/lingua/icons/flags/gif/th.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tj.gif b/assets/components/lingua/icons/flags/gif/tj.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tj.gif rename to assets/components/lingua/icons/flags/gif/tj.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tk.gif b/assets/components/lingua/icons/flags/gif/tk.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tk.gif rename to assets/components/lingua/icons/flags/gif/tk.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tl.gif b/assets/components/lingua/icons/flags/gif/tl.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tl.gif rename to assets/components/lingua/icons/flags/gif/tl.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tm.gif b/assets/components/lingua/icons/flags/gif/tm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tm.gif rename to assets/components/lingua/icons/flags/gif/tm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tn.gif b/assets/components/lingua/icons/flags/gif/tn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tn.gif rename to assets/components/lingua/icons/flags/gif/tn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/to.gif b/assets/components/lingua/icons/flags/gif/to.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/to.gif rename to assets/components/lingua/icons/flags/gif/to.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tr.gif b/assets/components/lingua/icons/flags/gif/tr.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tr.gif rename to assets/components/lingua/icons/flags/gif/tr.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tt.gif b/assets/components/lingua/icons/flags/gif/tt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tt.gif rename to assets/components/lingua/icons/flags/gif/tt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tv.gif b/assets/components/lingua/icons/flags/gif/tv.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tv.gif rename to assets/components/lingua/icons/flags/gif/tv.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tw.gif b/assets/components/lingua/icons/flags/gif/tw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tw.gif rename to assets/components/lingua/icons/flags/gif/tw.gif diff --git a/www/assets/components/lingua/icons/flags/gif/tz.gif b/assets/components/lingua/icons/flags/gif/tz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/tz.gif rename to assets/components/lingua/icons/flags/gif/tz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ua.gif b/assets/components/lingua/icons/flags/gif/ua.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ua.gif rename to assets/components/lingua/icons/flags/gif/ua.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ug.gif b/assets/components/lingua/icons/flags/gif/ug.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ug.gif rename to assets/components/lingua/icons/flags/gif/ug.gif diff --git a/www/assets/components/lingua/icons/flags/gif/um.gif b/assets/components/lingua/icons/flags/gif/um.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/um.gif rename to assets/components/lingua/icons/flags/gif/um.gif diff --git a/www/assets/components/lingua/icons/flags/gif/us.gif b/assets/components/lingua/icons/flags/gif/us.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/us.gif rename to assets/components/lingua/icons/flags/gif/us.gif diff --git a/www/assets/components/lingua/icons/flags/gif/uy.gif b/assets/components/lingua/icons/flags/gif/uy.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/uy.gif rename to assets/components/lingua/icons/flags/gif/uy.gif diff --git a/www/assets/components/lingua/icons/flags/gif/uz.gif b/assets/components/lingua/icons/flags/gif/uz.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/uz.gif rename to assets/components/lingua/icons/flags/gif/uz.gif diff --git a/www/assets/components/lingua/icons/flags/gif/va.gif b/assets/components/lingua/icons/flags/gif/va.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/va.gif rename to assets/components/lingua/icons/flags/gif/va.gif diff --git a/www/assets/components/lingua/icons/flags/gif/vc.gif b/assets/components/lingua/icons/flags/gif/vc.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/vc.gif rename to assets/components/lingua/icons/flags/gif/vc.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ve.gif b/assets/components/lingua/icons/flags/gif/ve.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ve.gif rename to assets/components/lingua/icons/flags/gif/ve.gif diff --git a/www/assets/components/lingua/icons/flags/gif/vg.gif b/assets/components/lingua/icons/flags/gif/vg.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/vg.gif rename to assets/components/lingua/icons/flags/gif/vg.gif diff --git a/www/assets/components/lingua/icons/flags/gif/vi.gif b/assets/components/lingua/icons/flags/gif/vi.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/vi.gif rename to assets/components/lingua/icons/flags/gif/vi.gif diff --git a/www/assets/components/lingua/icons/flags/gif/vn.gif b/assets/components/lingua/icons/flags/gif/vn.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/vn.gif rename to assets/components/lingua/icons/flags/gif/vn.gif diff --git a/www/assets/components/lingua/icons/flags/gif/vu.gif b/assets/components/lingua/icons/flags/gif/vu.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/vu.gif rename to assets/components/lingua/icons/flags/gif/vu.gif diff --git a/www/assets/components/lingua/icons/flags/gif/wales.gif b/assets/components/lingua/icons/flags/gif/wales.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/wales.gif rename to assets/components/lingua/icons/flags/gif/wales.gif diff --git a/www/assets/components/lingua/icons/flags/gif/wf.gif b/assets/components/lingua/icons/flags/gif/wf.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/wf.gif rename to assets/components/lingua/icons/flags/gif/wf.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ws.gif b/assets/components/lingua/icons/flags/gif/ws.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ws.gif rename to assets/components/lingua/icons/flags/gif/ws.gif diff --git a/www/assets/components/lingua/icons/flags/gif/ye.gif b/assets/components/lingua/icons/flags/gif/ye.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/ye.gif rename to assets/components/lingua/icons/flags/gif/ye.gif diff --git a/www/assets/components/lingua/icons/flags/gif/yt.gif b/assets/components/lingua/icons/flags/gif/yt.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/yt.gif rename to assets/components/lingua/icons/flags/gif/yt.gif diff --git a/www/assets/components/lingua/icons/flags/gif/za.gif b/assets/components/lingua/icons/flags/gif/za.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/za.gif rename to assets/components/lingua/icons/flags/gif/za.gif diff --git a/www/assets/components/lingua/icons/flags/gif/zm.gif b/assets/components/lingua/icons/flags/gif/zm.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/zm.gif rename to assets/components/lingua/icons/flags/gif/zm.gif diff --git a/www/assets/components/lingua/icons/flags/gif/zw.gif b/assets/components/lingua/icons/flags/gif/zw.gif similarity index 100% rename from www/assets/components/lingua/icons/flags/gif/zw.gif rename to assets/components/lingua/icons/flags/gif/zw.gif diff --git a/www/assets/components/lingua/icons/flags/png/.DS_Store b/assets/components/lingua/icons/flags/png/.DS_Store similarity index 100% rename from www/assets/components/lingua/icons/flags/png/.DS_Store rename to assets/components/lingua/icons/flags/png/.DS_Store diff --git a/www/assets/components/lingua/icons/flags/png/ad.png b/assets/components/lingua/icons/flags/png/ad.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ad.png rename to assets/components/lingua/icons/flags/png/ad.png diff --git a/www/assets/components/lingua/icons/flags/png/ae.png b/assets/components/lingua/icons/flags/png/ae.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ae.png rename to assets/components/lingua/icons/flags/png/ae.png diff --git a/www/assets/components/lingua/icons/flags/png/af.png b/assets/components/lingua/icons/flags/png/af.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/af.png rename to assets/components/lingua/icons/flags/png/af.png diff --git a/www/assets/components/lingua/icons/flags/png/ag.png b/assets/components/lingua/icons/flags/png/ag.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ag.png rename to assets/components/lingua/icons/flags/png/ag.png diff --git a/www/assets/components/lingua/icons/flags/png/ai.png b/assets/components/lingua/icons/flags/png/ai.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ai.png rename to assets/components/lingua/icons/flags/png/ai.png diff --git a/www/assets/components/lingua/icons/flags/png/al.png b/assets/components/lingua/icons/flags/png/al.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/al.png rename to assets/components/lingua/icons/flags/png/al.png diff --git a/www/assets/components/lingua/icons/flags/png/am.png b/assets/components/lingua/icons/flags/png/am.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/am.png rename to assets/components/lingua/icons/flags/png/am.png diff --git a/www/assets/components/lingua/icons/flags/png/an.png b/assets/components/lingua/icons/flags/png/an.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/an.png rename to assets/components/lingua/icons/flags/png/an.png diff --git a/www/assets/components/lingua/icons/flags/png/ao.png b/assets/components/lingua/icons/flags/png/ao.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ao.png rename to assets/components/lingua/icons/flags/png/ao.png diff --git a/www/assets/components/lingua/icons/flags/png/ar.png b/assets/components/lingua/icons/flags/png/ar.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ar.png rename to assets/components/lingua/icons/flags/png/ar.png diff --git a/www/assets/components/lingua/icons/flags/png/as.png b/assets/components/lingua/icons/flags/png/as.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/as.png rename to assets/components/lingua/icons/flags/png/as.png diff --git a/www/assets/components/lingua/icons/flags/png/at.png b/assets/components/lingua/icons/flags/png/at.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/at.png rename to assets/components/lingua/icons/flags/png/at.png diff --git a/www/assets/components/lingua/icons/flags/png/au.png b/assets/components/lingua/icons/flags/png/au.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/au.png rename to assets/components/lingua/icons/flags/png/au.png diff --git a/www/assets/components/lingua/icons/flags/png/aw.png b/assets/components/lingua/icons/flags/png/aw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/aw.png rename to assets/components/lingua/icons/flags/png/aw.png diff --git a/www/assets/components/lingua/icons/flags/png/ax.png b/assets/components/lingua/icons/flags/png/ax.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ax.png rename to assets/components/lingua/icons/flags/png/ax.png diff --git a/www/assets/components/lingua/icons/flags/png/az.png b/assets/components/lingua/icons/flags/png/az.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/az.png rename to assets/components/lingua/icons/flags/png/az.png diff --git a/www/assets/components/lingua/icons/flags/png/ba.png b/assets/components/lingua/icons/flags/png/ba.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ba.png rename to assets/components/lingua/icons/flags/png/ba.png diff --git a/www/assets/components/lingua/icons/flags/png/bb.png b/assets/components/lingua/icons/flags/png/bb.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bb.png rename to assets/components/lingua/icons/flags/png/bb.png diff --git a/www/assets/components/lingua/icons/flags/png/bd.png b/assets/components/lingua/icons/flags/png/bd.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bd.png rename to assets/components/lingua/icons/flags/png/bd.png diff --git a/www/assets/components/lingua/icons/flags/png/be.png b/assets/components/lingua/icons/flags/png/be.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/be.png rename to assets/components/lingua/icons/flags/png/be.png diff --git a/www/assets/components/lingua/icons/flags/png/bf.png b/assets/components/lingua/icons/flags/png/bf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bf.png rename to assets/components/lingua/icons/flags/png/bf.png diff --git a/www/assets/components/lingua/icons/flags/png/bg.png b/assets/components/lingua/icons/flags/png/bg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bg.png rename to assets/components/lingua/icons/flags/png/bg.png diff --git a/www/assets/components/lingua/icons/flags/png/bh.png b/assets/components/lingua/icons/flags/png/bh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bh.png rename to assets/components/lingua/icons/flags/png/bh.png diff --git a/www/assets/components/lingua/icons/flags/png/bi.png b/assets/components/lingua/icons/flags/png/bi.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bi.png rename to assets/components/lingua/icons/flags/png/bi.png diff --git a/www/assets/components/lingua/icons/flags/png/bj.png b/assets/components/lingua/icons/flags/png/bj.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bj.png rename to assets/components/lingua/icons/flags/png/bj.png diff --git a/www/assets/components/lingua/icons/flags/png/bm.png b/assets/components/lingua/icons/flags/png/bm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bm.png rename to assets/components/lingua/icons/flags/png/bm.png diff --git a/www/assets/components/lingua/icons/flags/png/bn.png b/assets/components/lingua/icons/flags/png/bn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bn.png rename to assets/components/lingua/icons/flags/png/bn.png diff --git a/www/assets/components/lingua/icons/flags/png/bo.png b/assets/components/lingua/icons/flags/png/bo.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bo.png rename to assets/components/lingua/icons/flags/png/bo.png diff --git a/www/assets/components/lingua/icons/flags/png/br.png b/assets/components/lingua/icons/flags/png/br.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/br.png rename to assets/components/lingua/icons/flags/png/br.png diff --git a/www/assets/components/lingua/icons/flags/png/bs.png b/assets/components/lingua/icons/flags/png/bs.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bs.png rename to assets/components/lingua/icons/flags/png/bs.png diff --git a/www/assets/components/lingua/icons/flags/png/bt.png b/assets/components/lingua/icons/flags/png/bt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bt.png rename to assets/components/lingua/icons/flags/png/bt.png diff --git a/www/assets/components/lingua/icons/flags/png/bv.png b/assets/components/lingua/icons/flags/png/bv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bv.png rename to assets/components/lingua/icons/flags/png/bv.png diff --git a/www/assets/components/lingua/icons/flags/png/bw.png b/assets/components/lingua/icons/flags/png/bw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bw.png rename to assets/components/lingua/icons/flags/png/bw.png diff --git a/www/assets/components/lingua/icons/flags/png/by.png b/assets/components/lingua/icons/flags/png/by.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/by.png rename to assets/components/lingua/icons/flags/png/by.png diff --git a/www/assets/components/lingua/icons/flags/png/bz.png b/assets/components/lingua/icons/flags/png/bz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/bz.png rename to assets/components/lingua/icons/flags/png/bz.png diff --git a/www/assets/components/lingua/icons/flags/png/ca.png b/assets/components/lingua/icons/flags/png/ca.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ca.png rename to assets/components/lingua/icons/flags/png/ca.png diff --git a/www/assets/components/lingua/icons/flags/png/catalonia.png b/assets/components/lingua/icons/flags/png/catalonia.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/catalonia.png rename to assets/components/lingua/icons/flags/png/catalonia.png diff --git a/www/assets/components/lingua/icons/flags/png/cc.png b/assets/components/lingua/icons/flags/png/cc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cc.png rename to assets/components/lingua/icons/flags/png/cc.png diff --git a/www/assets/components/lingua/icons/flags/png/cd.png b/assets/components/lingua/icons/flags/png/cd.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cd.png rename to assets/components/lingua/icons/flags/png/cd.png diff --git a/www/assets/components/lingua/icons/flags/png/cf.png b/assets/components/lingua/icons/flags/png/cf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cf.png rename to assets/components/lingua/icons/flags/png/cf.png diff --git a/www/assets/components/lingua/icons/flags/png/cg.png b/assets/components/lingua/icons/flags/png/cg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cg.png rename to assets/components/lingua/icons/flags/png/cg.png diff --git a/www/assets/components/lingua/icons/flags/png/ch.png b/assets/components/lingua/icons/flags/png/ch.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ch.png rename to assets/components/lingua/icons/flags/png/ch.png diff --git a/www/assets/components/lingua/icons/flags/png/ci.png b/assets/components/lingua/icons/flags/png/ci.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ci.png rename to assets/components/lingua/icons/flags/png/ci.png diff --git a/www/assets/components/lingua/icons/flags/png/ck.png b/assets/components/lingua/icons/flags/png/ck.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ck.png rename to assets/components/lingua/icons/flags/png/ck.png diff --git a/www/assets/components/lingua/icons/flags/png/cl.png b/assets/components/lingua/icons/flags/png/cl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cl.png rename to assets/components/lingua/icons/flags/png/cl.png diff --git a/www/assets/components/lingua/icons/flags/png/cm.png b/assets/components/lingua/icons/flags/png/cm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cm.png rename to assets/components/lingua/icons/flags/png/cm.png diff --git a/www/assets/components/lingua/icons/flags/png/cn.png b/assets/components/lingua/icons/flags/png/cn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cn.png rename to assets/components/lingua/icons/flags/png/cn.png diff --git a/www/assets/components/lingua/icons/flags/png/co.png b/assets/components/lingua/icons/flags/png/co.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/co.png rename to assets/components/lingua/icons/flags/png/co.png diff --git a/www/assets/components/lingua/icons/flags/png/cr.png b/assets/components/lingua/icons/flags/png/cr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cr.png rename to assets/components/lingua/icons/flags/png/cr.png diff --git a/www/assets/components/lingua/icons/flags/png/cs.png b/assets/components/lingua/icons/flags/png/cs.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cs.png rename to assets/components/lingua/icons/flags/png/cs.png diff --git a/www/assets/components/lingua/icons/flags/png/cu.png b/assets/components/lingua/icons/flags/png/cu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cu.png rename to assets/components/lingua/icons/flags/png/cu.png diff --git a/www/assets/components/lingua/icons/flags/png/cv.png b/assets/components/lingua/icons/flags/png/cv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cv.png rename to assets/components/lingua/icons/flags/png/cv.png diff --git a/www/assets/components/lingua/icons/flags/png/cx.png b/assets/components/lingua/icons/flags/png/cx.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cx.png rename to assets/components/lingua/icons/flags/png/cx.png diff --git a/www/assets/components/lingua/icons/flags/png/cy.png b/assets/components/lingua/icons/flags/png/cy.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cy.png rename to assets/components/lingua/icons/flags/png/cy.png diff --git a/www/assets/components/lingua/icons/flags/png/cz.png b/assets/components/lingua/icons/flags/png/cz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/cz.png rename to assets/components/lingua/icons/flags/png/cz.png diff --git a/www/assets/components/lingua/icons/flags/png/de.png b/assets/components/lingua/icons/flags/png/de.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/de.png rename to assets/components/lingua/icons/flags/png/de.png diff --git a/www/assets/components/lingua/icons/flags/png/dj.png b/assets/components/lingua/icons/flags/png/dj.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/dj.png rename to assets/components/lingua/icons/flags/png/dj.png diff --git a/www/assets/components/lingua/icons/flags/png/dk.png b/assets/components/lingua/icons/flags/png/dk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/dk.png rename to assets/components/lingua/icons/flags/png/dk.png diff --git a/www/assets/components/lingua/icons/flags/png/dm.png b/assets/components/lingua/icons/flags/png/dm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/dm.png rename to assets/components/lingua/icons/flags/png/dm.png diff --git a/www/assets/components/lingua/icons/flags/png/do.png b/assets/components/lingua/icons/flags/png/do.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/do.png rename to assets/components/lingua/icons/flags/png/do.png diff --git a/www/assets/components/lingua/icons/flags/png/dz.png b/assets/components/lingua/icons/flags/png/dz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/dz.png rename to assets/components/lingua/icons/flags/png/dz.png diff --git a/www/assets/components/lingua/icons/flags/png/ec.png b/assets/components/lingua/icons/flags/png/ec.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ec.png rename to assets/components/lingua/icons/flags/png/ec.png diff --git a/www/assets/components/lingua/icons/flags/png/ee.png b/assets/components/lingua/icons/flags/png/ee.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ee.png rename to assets/components/lingua/icons/flags/png/ee.png diff --git a/www/assets/components/lingua/icons/flags/png/eg.png b/assets/components/lingua/icons/flags/png/eg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/eg.png rename to assets/components/lingua/icons/flags/png/eg.png diff --git a/www/assets/components/lingua/icons/flags/png/eh.png b/assets/components/lingua/icons/flags/png/eh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/eh.png rename to assets/components/lingua/icons/flags/png/eh.png diff --git a/www/assets/components/lingua/icons/flags/png/england.png b/assets/components/lingua/icons/flags/png/england.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/england.png rename to assets/components/lingua/icons/flags/png/england.png diff --git a/www/assets/components/lingua/icons/flags/png/er.png b/assets/components/lingua/icons/flags/png/er.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/er.png rename to assets/components/lingua/icons/flags/png/er.png diff --git a/www/assets/components/lingua/icons/flags/png/es.png b/assets/components/lingua/icons/flags/png/es.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/es.png rename to assets/components/lingua/icons/flags/png/es.png diff --git a/www/assets/components/lingua/icons/flags/png/et.png b/assets/components/lingua/icons/flags/png/et.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/et.png rename to assets/components/lingua/icons/flags/png/et.png diff --git a/www/assets/components/lingua/icons/flags/png/europeanunion.png b/assets/components/lingua/icons/flags/png/europeanunion.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/europeanunion.png rename to assets/components/lingua/icons/flags/png/europeanunion.png diff --git a/www/assets/components/lingua/icons/flags/png/fam.png b/assets/components/lingua/icons/flags/png/fam.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fam.png rename to assets/components/lingua/icons/flags/png/fam.png diff --git a/www/assets/components/lingua/icons/flags/png/fi.png b/assets/components/lingua/icons/flags/png/fi.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fi.png rename to assets/components/lingua/icons/flags/png/fi.png diff --git a/www/assets/components/lingua/icons/flags/png/fj.png b/assets/components/lingua/icons/flags/png/fj.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fj.png rename to assets/components/lingua/icons/flags/png/fj.png diff --git a/www/assets/components/lingua/icons/flags/png/fk.png b/assets/components/lingua/icons/flags/png/fk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fk.png rename to assets/components/lingua/icons/flags/png/fk.png diff --git a/www/assets/components/lingua/icons/flags/png/fm.png b/assets/components/lingua/icons/flags/png/fm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fm.png rename to assets/components/lingua/icons/flags/png/fm.png diff --git a/www/assets/components/lingua/icons/flags/png/fo.png b/assets/components/lingua/icons/flags/png/fo.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fo.png rename to assets/components/lingua/icons/flags/png/fo.png diff --git a/www/assets/components/lingua/icons/flags/png/fr.png b/assets/components/lingua/icons/flags/png/fr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/fr.png rename to assets/components/lingua/icons/flags/png/fr.png diff --git a/www/assets/components/lingua/icons/flags/png/ga.png b/assets/components/lingua/icons/flags/png/ga.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ga.png rename to assets/components/lingua/icons/flags/png/ga.png diff --git a/www/assets/components/lingua/icons/flags/png/gb.png b/assets/components/lingua/icons/flags/png/gb.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gb.png rename to assets/components/lingua/icons/flags/png/gb.png diff --git a/www/assets/components/lingua/icons/flags/png/gd.png b/assets/components/lingua/icons/flags/png/gd.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gd.png rename to assets/components/lingua/icons/flags/png/gd.png diff --git a/www/assets/components/lingua/icons/flags/png/ge.png b/assets/components/lingua/icons/flags/png/ge.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ge.png rename to assets/components/lingua/icons/flags/png/ge.png diff --git a/www/assets/components/lingua/icons/flags/png/gf.png b/assets/components/lingua/icons/flags/png/gf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gf.png rename to assets/components/lingua/icons/flags/png/gf.png diff --git a/www/assets/components/lingua/icons/flags/png/gh.png b/assets/components/lingua/icons/flags/png/gh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gh.png rename to assets/components/lingua/icons/flags/png/gh.png diff --git a/www/assets/components/lingua/icons/flags/png/gi.png b/assets/components/lingua/icons/flags/png/gi.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gi.png rename to assets/components/lingua/icons/flags/png/gi.png diff --git a/www/assets/components/lingua/icons/flags/png/gl.png b/assets/components/lingua/icons/flags/png/gl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gl.png rename to assets/components/lingua/icons/flags/png/gl.png diff --git a/www/assets/components/lingua/icons/flags/png/gm.png b/assets/components/lingua/icons/flags/png/gm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gm.png rename to assets/components/lingua/icons/flags/png/gm.png diff --git a/www/assets/components/lingua/icons/flags/png/gn.png b/assets/components/lingua/icons/flags/png/gn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gn.png rename to assets/components/lingua/icons/flags/png/gn.png diff --git a/www/assets/components/lingua/icons/flags/png/gp.png b/assets/components/lingua/icons/flags/png/gp.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gp.png rename to assets/components/lingua/icons/flags/png/gp.png diff --git a/www/assets/components/lingua/icons/flags/png/gq.png b/assets/components/lingua/icons/flags/png/gq.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gq.png rename to assets/components/lingua/icons/flags/png/gq.png diff --git a/www/assets/components/lingua/icons/flags/png/gr.png b/assets/components/lingua/icons/flags/png/gr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gr.png rename to assets/components/lingua/icons/flags/png/gr.png diff --git a/www/assets/components/lingua/icons/flags/png/gs.png b/assets/components/lingua/icons/flags/png/gs.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gs.png rename to assets/components/lingua/icons/flags/png/gs.png diff --git a/www/assets/components/lingua/icons/flags/png/gt.png b/assets/components/lingua/icons/flags/png/gt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gt.png rename to assets/components/lingua/icons/flags/png/gt.png diff --git a/www/assets/components/lingua/icons/flags/png/gu.png b/assets/components/lingua/icons/flags/png/gu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gu.png rename to assets/components/lingua/icons/flags/png/gu.png diff --git a/www/assets/components/lingua/icons/flags/png/gw.png b/assets/components/lingua/icons/flags/png/gw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gw.png rename to assets/components/lingua/icons/flags/png/gw.png diff --git a/www/assets/components/lingua/icons/flags/png/gy.png b/assets/components/lingua/icons/flags/png/gy.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/gy.png rename to assets/components/lingua/icons/flags/png/gy.png diff --git a/www/assets/components/lingua/icons/flags/png/hk.png b/assets/components/lingua/icons/flags/png/hk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/hk.png rename to assets/components/lingua/icons/flags/png/hk.png diff --git a/www/assets/components/lingua/icons/flags/png/hm.png b/assets/components/lingua/icons/flags/png/hm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/hm.png rename to assets/components/lingua/icons/flags/png/hm.png diff --git a/www/assets/components/lingua/icons/flags/png/hn.png b/assets/components/lingua/icons/flags/png/hn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/hn.png rename to assets/components/lingua/icons/flags/png/hn.png diff --git a/www/assets/components/lingua/icons/flags/png/hr.png b/assets/components/lingua/icons/flags/png/hr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/hr.png rename to assets/components/lingua/icons/flags/png/hr.png diff --git a/www/assets/components/lingua/icons/flags/png/ht.png b/assets/components/lingua/icons/flags/png/ht.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ht.png rename to assets/components/lingua/icons/flags/png/ht.png diff --git a/www/assets/components/lingua/icons/flags/png/hu.png b/assets/components/lingua/icons/flags/png/hu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/hu.png rename to assets/components/lingua/icons/flags/png/hu.png diff --git a/www/assets/components/lingua/icons/flags/png/id.png b/assets/components/lingua/icons/flags/png/id.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/id.png rename to assets/components/lingua/icons/flags/png/id.png diff --git a/www/assets/components/lingua/icons/flags/png/ie.png b/assets/components/lingua/icons/flags/png/ie.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ie.png rename to assets/components/lingua/icons/flags/png/ie.png diff --git a/www/assets/components/lingua/icons/flags/png/il.png b/assets/components/lingua/icons/flags/png/il.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/il.png rename to assets/components/lingua/icons/flags/png/il.png diff --git a/www/assets/components/lingua/icons/flags/png/in.png b/assets/components/lingua/icons/flags/png/in.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/in.png rename to assets/components/lingua/icons/flags/png/in.png diff --git a/www/assets/components/lingua/icons/flags/png/io.png b/assets/components/lingua/icons/flags/png/io.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/io.png rename to assets/components/lingua/icons/flags/png/io.png diff --git a/www/assets/components/lingua/icons/flags/png/iq.png b/assets/components/lingua/icons/flags/png/iq.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/iq.png rename to assets/components/lingua/icons/flags/png/iq.png diff --git a/www/assets/components/lingua/icons/flags/png/ir.png b/assets/components/lingua/icons/flags/png/ir.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ir.png rename to assets/components/lingua/icons/flags/png/ir.png diff --git a/www/assets/components/lingua/icons/flags/png/is.png b/assets/components/lingua/icons/flags/png/is.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/is.png rename to assets/components/lingua/icons/flags/png/is.png diff --git a/www/assets/components/lingua/icons/flags/png/it.png b/assets/components/lingua/icons/flags/png/it.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/it.png rename to assets/components/lingua/icons/flags/png/it.png diff --git a/www/assets/components/lingua/icons/flags/png/jm.png b/assets/components/lingua/icons/flags/png/jm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/jm.png rename to assets/components/lingua/icons/flags/png/jm.png diff --git a/www/assets/components/lingua/icons/flags/png/jo.png b/assets/components/lingua/icons/flags/png/jo.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/jo.png rename to assets/components/lingua/icons/flags/png/jo.png diff --git a/www/assets/components/lingua/icons/flags/png/jp.png b/assets/components/lingua/icons/flags/png/jp.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/jp.png rename to assets/components/lingua/icons/flags/png/jp.png diff --git a/www/assets/components/lingua/icons/flags/png/ke.png b/assets/components/lingua/icons/flags/png/ke.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ke.png rename to assets/components/lingua/icons/flags/png/ke.png diff --git a/www/assets/components/lingua/icons/flags/png/kg.png b/assets/components/lingua/icons/flags/png/kg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kg.png rename to assets/components/lingua/icons/flags/png/kg.png diff --git a/www/assets/components/lingua/icons/flags/png/kh.png b/assets/components/lingua/icons/flags/png/kh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kh.png rename to assets/components/lingua/icons/flags/png/kh.png diff --git a/www/assets/components/lingua/icons/flags/png/ki.png b/assets/components/lingua/icons/flags/png/ki.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ki.png rename to assets/components/lingua/icons/flags/png/ki.png diff --git a/www/assets/components/lingua/icons/flags/png/km.png b/assets/components/lingua/icons/flags/png/km.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/km.png rename to assets/components/lingua/icons/flags/png/km.png diff --git a/www/assets/components/lingua/icons/flags/png/kn.png b/assets/components/lingua/icons/flags/png/kn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kn.png rename to assets/components/lingua/icons/flags/png/kn.png diff --git a/www/assets/components/lingua/icons/flags/png/kp.png b/assets/components/lingua/icons/flags/png/kp.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kp.png rename to assets/components/lingua/icons/flags/png/kp.png diff --git a/www/assets/components/lingua/icons/flags/png/kr.png b/assets/components/lingua/icons/flags/png/kr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kr.png rename to assets/components/lingua/icons/flags/png/kr.png diff --git a/www/assets/components/lingua/icons/flags/png/kw.png b/assets/components/lingua/icons/flags/png/kw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kw.png rename to assets/components/lingua/icons/flags/png/kw.png diff --git a/www/assets/components/lingua/icons/flags/png/ky.png b/assets/components/lingua/icons/flags/png/ky.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ky.png rename to assets/components/lingua/icons/flags/png/ky.png diff --git a/www/assets/components/lingua/icons/flags/png/kz.png b/assets/components/lingua/icons/flags/png/kz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/kz.png rename to assets/components/lingua/icons/flags/png/kz.png diff --git a/www/assets/components/lingua/icons/flags/png/la.png b/assets/components/lingua/icons/flags/png/la.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/la.png rename to assets/components/lingua/icons/flags/png/la.png diff --git a/www/assets/components/lingua/icons/flags/png/lb.png b/assets/components/lingua/icons/flags/png/lb.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lb.png rename to assets/components/lingua/icons/flags/png/lb.png diff --git a/www/assets/components/lingua/icons/flags/png/lc.png b/assets/components/lingua/icons/flags/png/lc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lc.png rename to assets/components/lingua/icons/flags/png/lc.png diff --git a/www/assets/components/lingua/icons/flags/png/li.png b/assets/components/lingua/icons/flags/png/li.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/li.png rename to assets/components/lingua/icons/flags/png/li.png diff --git a/www/assets/components/lingua/icons/flags/png/lk.png b/assets/components/lingua/icons/flags/png/lk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lk.png rename to assets/components/lingua/icons/flags/png/lk.png diff --git a/www/assets/components/lingua/icons/flags/png/lr.png b/assets/components/lingua/icons/flags/png/lr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lr.png rename to assets/components/lingua/icons/flags/png/lr.png diff --git a/www/assets/components/lingua/icons/flags/png/ls.png b/assets/components/lingua/icons/flags/png/ls.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ls.png rename to assets/components/lingua/icons/flags/png/ls.png diff --git a/www/assets/components/lingua/icons/flags/png/lt.png b/assets/components/lingua/icons/flags/png/lt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lt.png rename to assets/components/lingua/icons/flags/png/lt.png diff --git a/www/assets/components/lingua/icons/flags/png/lu.png b/assets/components/lingua/icons/flags/png/lu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lu.png rename to assets/components/lingua/icons/flags/png/lu.png diff --git a/www/assets/components/lingua/icons/flags/png/lv.png b/assets/components/lingua/icons/flags/png/lv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/lv.png rename to assets/components/lingua/icons/flags/png/lv.png diff --git a/www/assets/components/lingua/icons/flags/png/ly.png b/assets/components/lingua/icons/flags/png/ly.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ly.png rename to assets/components/lingua/icons/flags/png/ly.png diff --git a/www/assets/components/lingua/icons/flags/png/ma.png b/assets/components/lingua/icons/flags/png/ma.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ma.png rename to assets/components/lingua/icons/flags/png/ma.png diff --git a/www/assets/components/lingua/icons/flags/png/mc.png b/assets/components/lingua/icons/flags/png/mc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mc.png rename to assets/components/lingua/icons/flags/png/mc.png diff --git a/www/assets/components/lingua/icons/flags/png/md.png b/assets/components/lingua/icons/flags/png/md.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/md.png rename to assets/components/lingua/icons/flags/png/md.png diff --git a/www/assets/components/lingua/icons/flags/png/me.png b/assets/components/lingua/icons/flags/png/me.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/me.png rename to assets/components/lingua/icons/flags/png/me.png diff --git a/www/assets/components/lingua/icons/flags/png/mg.png b/assets/components/lingua/icons/flags/png/mg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mg.png rename to assets/components/lingua/icons/flags/png/mg.png diff --git a/www/assets/components/lingua/icons/flags/png/mh.png b/assets/components/lingua/icons/flags/png/mh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mh.png rename to assets/components/lingua/icons/flags/png/mh.png diff --git a/www/assets/components/lingua/icons/flags/png/mk.png b/assets/components/lingua/icons/flags/png/mk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mk.png rename to assets/components/lingua/icons/flags/png/mk.png diff --git a/www/assets/components/lingua/icons/flags/png/ml.png b/assets/components/lingua/icons/flags/png/ml.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ml.png rename to assets/components/lingua/icons/flags/png/ml.png diff --git a/www/assets/components/lingua/icons/flags/png/mm.png b/assets/components/lingua/icons/flags/png/mm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mm.png rename to assets/components/lingua/icons/flags/png/mm.png diff --git a/www/assets/components/lingua/icons/flags/png/mn.png b/assets/components/lingua/icons/flags/png/mn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mn.png rename to assets/components/lingua/icons/flags/png/mn.png diff --git a/www/assets/components/lingua/icons/flags/png/mo.png b/assets/components/lingua/icons/flags/png/mo.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mo.png rename to assets/components/lingua/icons/flags/png/mo.png diff --git a/www/assets/components/lingua/icons/flags/png/mp.png b/assets/components/lingua/icons/flags/png/mp.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mp.png rename to assets/components/lingua/icons/flags/png/mp.png diff --git a/www/assets/components/lingua/icons/flags/png/mq.png b/assets/components/lingua/icons/flags/png/mq.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mq.png rename to assets/components/lingua/icons/flags/png/mq.png diff --git a/www/assets/components/lingua/icons/flags/png/mr.png b/assets/components/lingua/icons/flags/png/mr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mr.png rename to assets/components/lingua/icons/flags/png/mr.png diff --git a/www/assets/components/lingua/icons/flags/png/ms.png b/assets/components/lingua/icons/flags/png/ms.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ms.png rename to assets/components/lingua/icons/flags/png/ms.png diff --git a/www/assets/components/lingua/icons/flags/png/mt.png b/assets/components/lingua/icons/flags/png/mt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mt.png rename to assets/components/lingua/icons/flags/png/mt.png diff --git a/www/assets/components/lingua/icons/flags/png/mu.png b/assets/components/lingua/icons/flags/png/mu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mu.png rename to assets/components/lingua/icons/flags/png/mu.png diff --git a/www/assets/components/lingua/icons/flags/png/mv.png b/assets/components/lingua/icons/flags/png/mv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mv.png rename to assets/components/lingua/icons/flags/png/mv.png diff --git a/www/assets/components/lingua/icons/flags/png/mw.png b/assets/components/lingua/icons/flags/png/mw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mw.png rename to assets/components/lingua/icons/flags/png/mw.png diff --git a/www/assets/components/lingua/icons/flags/png/mx.png b/assets/components/lingua/icons/flags/png/mx.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mx.png rename to assets/components/lingua/icons/flags/png/mx.png diff --git a/www/assets/components/lingua/icons/flags/png/my.png b/assets/components/lingua/icons/flags/png/my.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/my.png rename to assets/components/lingua/icons/flags/png/my.png diff --git a/www/assets/components/lingua/icons/flags/png/mz.png b/assets/components/lingua/icons/flags/png/mz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/mz.png rename to assets/components/lingua/icons/flags/png/mz.png diff --git a/www/assets/components/lingua/icons/flags/png/na.png b/assets/components/lingua/icons/flags/png/na.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/na.png rename to assets/components/lingua/icons/flags/png/na.png diff --git a/www/assets/components/lingua/icons/flags/png/nc.png b/assets/components/lingua/icons/flags/png/nc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nc.png rename to assets/components/lingua/icons/flags/png/nc.png diff --git a/www/assets/components/lingua/icons/flags/png/ne.png b/assets/components/lingua/icons/flags/png/ne.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ne.png rename to assets/components/lingua/icons/flags/png/ne.png diff --git a/www/assets/components/lingua/icons/flags/png/nf.png b/assets/components/lingua/icons/flags/png/nf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nf.png rename to assets/components/lingua/icons/flags/png/nf.png diff --git a/www/assets/components/lingua/icons/flags/png/ng.png b/assets/components/lingua/icons/flags/png/ng.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ng.png rename to assets/components/lingua/icons/flags/png/ng.png diff --git a/www/assets/components/lingua/icons/flags/png/ni.png b/assets/components/lingua/icons/flags/png/ni.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ni.png rename to assets/components/lingua/icons/flags/png/ni.png diff --git a/www/assets/components/lingua/icons/flags/png/nl.png b/assets/components/lingua/icons/flags/png/nl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nl.png rename to assets/components/lingua/icons/flags/png/nl.png diff --git a/www/assets/components/lingua/icons/flags/png/no.png b/assets/components/lingua/icons/flags/png/no.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/no.png rename to assets/components/lingua/icons/flags/png/no.png diff --git a/www/assets/components/lingua/icons/flags/png/np.png b/assets/components/lingua/icons/flags/png/np.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/np.png rename to assets/components/lingua/icons/flags/png/np.png diff --git a/www/assets/components/lingua/icons/flags/png/nr.png b/assets/components/lingua/icons/flags/png/nr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nr.png rename to assets/components/lingua/icons/flags/png/nr.png diff --git a/www/assets/components/lingua/icons/flags/png/nu.png b/assets/components/lingua/icons/flags/png/nu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nu.png rename to assets/components/lingua/icons/flags/png/nu.png diff --git a/www/assets/components/lingua/icons/flags/png/nz.png b/assets/components/lingua/icons/flags/png/nz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/nz.png rename to assets/components/lingua/icons/flags/png/nz.png diff --git a/www/assets/components/lingua/icons/flags/png/om.png b/assets/components/lingua/icons/flags/png/om.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/om.png rename to assets/components/lingua/icons/flags/png/om.png diff --git a/www/assets/components/lingua/icons/flags/png/pa.png b/assets/components/lingua/icons/flags/png/pa.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pa.png rename to assets/components/lingua/icons/flags/png/pa.png diff --git a/www/assets/components/lingua/icons/flags/png/pe.png b/assets/components/lingua/icons/flags/png/pe.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pe.png rename to assets/components/lingua/icons/flags/png/pe.png diff --git a/www/assets/components/lingua/icons/flags/png/pf.png b/assets/components/lingua/icons/flags/png/pf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pf.png rename to assets/components/lingua/icons/flags/png/pf.png diff --git a/www/assets/components/lingua/icons/flags/png/pg.png b/assets/components/lingua/icons/flags/png/pg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pg.png rename to assets/components/lingua/icons/flags/png/pg.png diff --git a/www/assets/components/lingua/icons/flags/png/ph.png b/assets/components/lingua/icons/flags/png/ph.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ph.png rename to assets/components/lingua/icons/flags/png/ph.png diff --git a/www/assets/components/lingua/icons/flags/png/pk.png b/assets/components/lingua/icons/flags/png/pk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pk.png rename to assets/components/lingua/icons/flags/png/pk.png diff --git a/www/assets/components/lingua/icons/flags/png/pl.png b/assets/components/lingua/icons/flags/png/pl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pl.png rename to assets/components/lingua/icons/flags/png/pl.png diff --git a/www/assets/components/lingua/icons/flags/png/pm.png b/assets/components/lingua/icons/flags/png/pm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pm.png rename to assets/components/lingua/icons/flags/png/pm.png diff --git a/www/assets/components/lingua/icons/flags/png/pn.png b/assets/components/lingua/icons/flags/png/pn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pn.png rename to assets/components/lingua/icons/flags/png/pn.png diff --git a/www/assets/components/lingua/icons/flags/png/pr.png b/assets/components/lingua/icons/flags/png/pr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pr.png rename to assets/components/lingua/icons/flags/png/pr.png diff --git a/www/assets/components/lingua/icons/flags/png/ps.png b/assets/components/lingua/icons/flags/png/ps.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ps.png rename to assets/components/lingua/icons/flags/png/ps.png diff --git a/www/assets/components/lingua/icons/flags/png/pt.png b/assets/components/lingua/icons/flags/png/pt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pt.png rename to assets/components/lingua/icons/flags/png/pt.png diff --git a/www/assets/components/lingua/icons/flags/png/pw.png b/assets/components/lingua/icons/flags/png/pw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/pw.png rename to assets/components/lingua/icons/flags/png/pw.png diff --git a/www/assets/components/lingua/icons/flags/png/py.png b/assets/components/lingua/icons/flags/png/py.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/py.png rename to assets/components/lingua/icons/flags/png/py.png diff --git a/www/assets/components/lingua/icons/flags/png/qa.png b/assets/components/lingua/icons/flags/png/qa.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/qa.png rename to assets/components/lingua/icons/flags/png/qa.png diff --git a/www/assets/components/lingua/icons/flags/png/re.png b/assets/components/lingua/icons/flags/png/re.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/re.png rename to assets/components/lingua/icons/flags/png/re.png diff --git a/www/assets/components/lingua/icons/flags/png/ro.png b/assets/components/lingua/icons/flags/png/ro.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ro.png rename to assets/components/lingua/icons/flags/png/ro.png diff --git a/www/assets/components/lingua/icons/flags/png/rs.png b/assets/components/lingua/icons/flags/png/rs.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/rs.png rename to assets/components/lingua/icons/flags/png/rs.png diff --git a/www/assets/components/lingua/icons/flags/png/ru.png b/assets/components/lingua/icons/flags/png/ru.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ru.png rename to assets/components/lingua/icons/flags/png/ru.png diff --git a/www/assets/components/lingua/icons/flags/png/rw.png b/assets/components/lingua/icons/flags/png/rw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/rw.png rename to assets/components/lingua/icons/flags/png/rw.png diff --git a/www/assets/components/lingua/icons/flags/png/sa.png b/assets/components/lingua/icons/flags/png/sa.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sa.png rename to assets/components/lingua/icons/flags/png/sa.png diff --git a/www/assets/components/lingua/icons/flags/png/sb.png b/assets/components/lingua/icons/flags/png/sb.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sb.png rename to assets/components/lingua/icons/flags/png/sb.png diff --git a/www/assets/components/lingua/icons/flags/png/sc.png b/assets/components/lingua/icons/flags/png/sc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sc.png rename to assets/components/lingua/icons/flags/png/sc.png diff --git a/www/assets/components/lingua/icons/flags/png/scotland.png b/assets/components/lingua/icons/flags/png/scotland.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/scotland.png rename to assets/components/lingua/icons/flags/png/scotland.png diff --git a/www/assets/components/lingua/icons/flags/png/sd.png b/assets/components/lingua/icons/flags/png/sd.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sd.png rename to assets/components/lingua/icons/flags/png/sd.png diff --git a/www/assets/components/lingua/icons/flags/png/se.png b/assets/components/lingua/icons/flags/png/se.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/se.png rename to assets/components/lingua/icons/flags/png/se.png diff --git a/www/assets/components/lingua/icons/flags/png/sg.png b/assets/components/lingua/icons/flags/png/sg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sg.png rename to assets/components/lingua/icons/flags/png/sg.png diff --git a/www/assets/components/lingua/icons/flags/png/sh.png b/assets/components/lingua/icons/flags/png/sh.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sh.png rename to assets/components/lingua/icons/flags/png/sh.png diff --git a/www/assets/components/lingua/icons/flags/png/si.png b/assets/components/lingua/icons/flags/png/si.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/si.png rename to assets/components/lingua/icons/flags/png/si.png diff --git a/www/assets/components/lingua/icons/flags/png/sj.png b/assets/components/lingua/icons/flags/png/sj.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sj.png rename to assets/components/lingua/icons/flags/png/sj.png diff --git a/www/assets/components/lingua/icons/flags/png/sk.png b/assets/components/lingua/icons/flags/png/sk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sk.png rename to assets/components/lingua/icons/flags/png/sk.png diff --git a/www/assets/components/lingua/icons/flags/png/sl.png b/assets/components/lingua/icons/flags/png/sl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sl.png rename to assets/components/lingua/icons/flags/png/sl.png diff --git a/www/assets/components/lingua/icons/flags/png/sm.png b/assets/components/lingua/icons/flags/png/sm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sm.png rename to assets/components/lingua/icons/flags/png/sm.png diff --git a/www/assets/components/lingua/icons/flags/png/sn.png b/assets/components/lingua/icons/flags/png/sn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sn.png rename to assets/components/lingua/icons/flags/png/sn.png diff --git a/www/assets/components/lingua/icons/flags/png/so.png b/assets/components/lingua/icons/flags/png/so.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/so.png rename to assets/components/lingua/icons/flags/png/so.png diff --git a/www/assets/components/lingua/icons/flags/png/sr.png b/assets/components/lingua/icons/flags/png/sr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sr.png rename to assets/components/lingua/icons/flags/png/sr.png diff --git a/www/assets/components/lingua/icons/flags/png/st.png b/assets/components/lingua/icons/flags/png/st.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/st.png rename to assets/components/lingua/icons/flags/png/st.png diff --git a/www/assets/components/lingua/icons/flags/png/sv.png b/assets/components/lingua/icons/flags/png/sv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sv.png rename to assets/components/lingua/icons/flags/png/sv.png diff --git a/www/assets/components/lingua/icons/flags/png/sy.png b/assets/components/lingua/icons/flags/png/sy.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sy.png rename to assets/components/lingua/icons/flags/png/sy.png diff --git a/www/assets/components/lingua/icons/flags/png/sz.png b/assets/components/lingua/icons/flags/png/sz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/sz.png rename to assets/components/lingua/icons/flags/png/sz.png diff --git a/www/assets/components/lingua/icons/flags/png/tc.png b/assets/components/lingua/icons/flags/png/tc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tc.png rename to assets/components/lingua/icons/flags/png/tc.png diff --git a/www/assets/components/lingua/icons/flags/png/td.png b/assets/components/lingua/icons/flags/png/td.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/td.png rename to assets/components/lingua/icons/flags/png/td.png diff --git a/www/assets/components/lingua/icons/flags/png/tf.png b/assets/components/lingua/icons/flags/png/tf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tf.png rename to assets/components/lingua/icons/flags/png/tf.png diff --git a/www/assets/components/lingua/icons/flags/png/tg.png b/assets/components/lingua/icons/flags/png/tg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tg.png rename to assets/components/lingua/icons/flags/png/tg.png diff --git a/www/assets/components/lingua/icons/flags/png/th.png b/assets/components/lingua/icons/flags/png/th.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/th.png rename to assets/components/lingua/icons/flags/png/th.png diff --git a/www/assets/components/lingua/icons/flags/png/tj.png b/assets/components/lingua/icons/flags/png/tj.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tj.png rename to assets/components/lingua/icons/flags/png/tj.png diff --git a/www/assets/components/lingua/icons/flags/png/tk.png b/assets/components/lingua/icons/flags/png/tk.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tk.png rename to assets/components/lingua/icons/flags/png/tk.png diff --git a/www/assets/components/lingua/icons/flags/png/tl.png b/assets/components/lingua/icons/flags/png/tl.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tl.png rename to assets/components/lingua/icons/flags/png/tl.png diff --git a/www/assets/components/lingua/icons/flags/png/tm.png b/assets/components/lingua/icons/flags/png/tm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tm.png rename to assets/components/lingua/icons/flags/png/tm.png diff --git a/www/assets/components/lingua/icons/flags/png/tn.png b/assets/components/lingua/icons/flags/png/tn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tn.png rename to assets/components/lingua/icons/flags/png/tn.png diff --git a/www/assets/components/lingua/icons/flags/png/to.png b/assets/components/lingua/icons/flags/png/to.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/to.png rename to assets/components/lingua/icons/flags/png/to.png diff --git a/www/assets/components/lingua/icons/flags/png/tr.png b/assets/components/lingua/icons/flags/png/tr.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tr.png rename to assets/components/lingua/icons/flags/png/tr.png diff --git a/www/assets/components/lingua/icons/flags/png/tt.png b/assets/components/lingua/icons/flags/png/tt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tt.png rename to assets/components/lingua/icons/flags/png/tt.png diff --git a/www/assets/components/lingua/icons/flags/png/tv.png b/assets/components/lingua/icons/flags/png/tv.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tv.png rename to assets/components/lingua/icons/flags/png/tv.png diff --git a/www/assets/components/lingua/icons/flags/png/tw.png b/assets/components/lingua/icons/flags/png/tw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tw.png rename to assets/components/lingua/icons/flags/png/tw.png diff --git a/www/assets/components/lingua/icons/flags/png/tz.png b/assets/components/lingua/icons/flags/png/tz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/tz.png rename to assets/components/lingua/icons/flags/png/tz.png diff --git a/www/assets/components/lingua/icons/flags/png/ua.png b/assets/components/lingua/icons/flags/png/ua.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ua.png rename to assets/components/lingua/icons/flags/png/ua.png diff --git a/www/assets/components/lingua/icons/flags/png/ug.png b/assets/components/lingua/icons/flags/png/ug.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ug.png rename to assets/components/lingua/icons/flags/png/ug.png diff --git a/www/assets/components/lingua/icons/flags/png/um.png b/assets/components/lingua/icons/flags/png/um.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/um.png rename to assets/components/lingua/icons/flags/png/um.png diff --git a/www/assets/components/lingua/icons/flags/png/us.png b/assets/components/lingua/icons/flags/png/us.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/us.png rename to assets/components/lingua/icons/flags/png/us.png diff --git a/www/assets/components/lingua/icons/flags/png/uy.png b/assets/components/lingua/icons/flags/png/uy.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/uy.png rename to assets/components/lingua/icons/flags/png/uy.png diff --git a/www/assets/components/lingua/icons/flags/png/uz.png b/assets/components/lingua/icons/flags/png/uz.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/uz.png rename to assets/components/lingua/icons/flags/png/uz.png diff --git a/www/assets/components/lingua/icons/flags/png/va.png b/assets/components/lingua/icons/flags/png/va.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/va.png rename to assets/components/lingua/icons/flags/png/va.png diff --git a/www/assets/components/lingua/icons/flags/png/vc.png b/assets/components/lingua/icons/flags/png/vc.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/vc.png rename to assets/components/lingua/icons/flags/png/vc.png diff --git a/www/assets/components/lingua/icons/flags/png/ve.png b/assets/components/lingua/icons/flags/png/ve.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ve.png rename to assets/components/lingua/icons/flags/png/ve.png diff --git a/www/assets/components/lingua/icons/flags/png/vg.png b/assets/components/lingua/icons/flags/png/vg.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/vg.png rename to assets/components/lingua/icons/flags/png/vg.png diff --git a/www/assets/components/lingua/icons/flags/png/vi.png b/assets/components/lingua/icons/flags/png/vi.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/vi.png rename to assets/components/lingua/icons/flags/png/vi.png diff --git a/www/assets/components/lingua/icons/flags/png/vn.png b/assets/components/lingua/icons/flags/png/vn.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/vn.png rename to assets/components/lingua/icons/flags/png/vn.png diff --git a/www/assets/components/lingua/icons/flags/png/vu.png b/assets/components/lingua/icons/flags/png/vu.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/vu.png rename to assets/components/lingua/icons/flags/png/vu.png diff --git a/www/assets/components/lingua/icons/flags/png/wales.png b/assets/components/lingua/icons/flags/png/wales.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/wales.png rename to assets/components/lingua/icons/flags/png/wales.png diff --git a/www/assets/components/lingua/icons/flags/png/wf.png b/assets/components/lingua/icons/flags/png/wf.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/wf.png rename to assets/components/lingua/icons/flags/png/wf.png diff --git a/www/assets/components/lingua/icons/flags/png/ws.png b/assets/components/lingua/icons/flags/png/ws.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ws.png rename to assets/components/lingua/icons/flags/png/ws.png diff --git a/www/assets/components/lingua/icons/flags/png/ye.png b/assets/components/lingua/icons/flags/png/ye.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/ye.png rename to assets/components/lingua/icons/flags/png/ye.png diff --git a/www/assets/components/lingua/icons/flags/png/yt.png b/assets/components/lingua/icons/flags/png/yt.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/yt.png rename to assets/components/lingua/icons/flags/png/yt.png diff --git a/www/assets/components/lingua/icons/flags/png/za.png b/assets/components/lingua/icons/flags/png/za.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/za.png rename to assets/components/lingua/icons/flags/png/za.png diff --git a/www/assets/components/lingua/icons/flags/png/zm.png b/assets/components/lingua/icons/flags/png/zm.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/zm.png rename to assets/components/lingua/icons/flags/png/zm.png diff --git a/www/assets/components/lingua/icons/flags/png/zw.png b/assets/components/lingua/icons/flags/png/zw.png similarity index 100% rename from www/assets/components/lingua/icons/flags/png/zw.png rename to assets/components/lingua/icons/flags/png/zw.png diff --git a/www/assets/components/lingua/icons/flags/readme.txt b/assets/components/lingua/icons/flags/readme.txt similarity index 100% rename from www/assets/components/lingua/icons/flags/readme.txt rename to assets/components/lingua/icons/flags/readme.txt diff --git a/assets/components/lingua/index.html b/assets/components/lingua/index.html new file mode 100644 index 0000000..e69de29 diff --git a/www/assets/components/lingua/js/mgr/fcinit.js b/assets/components/lingua/js/mgr/fcinit.js similarity index 100% rename from www/assets/components/lingua/js/mgr/fcinit.js rename to assets/components/lingua/js/mgr/fcinit.js diff --git a/www/assets/components/lingua/js/mgr/lingua.js b/assets/components/lingua/js/mgr/lingua.js similarity index 100% rename from www/assets/components/lingua/js/mgr/lingua.js rename to assets/components/lingua/js/mgr/lingua.js diff --git a/www/assets/components/lingua/js/mgr/resource.js b/assets/components/lingua/js/mgr/resource.js similarity index 100% rename from www/assets/components/lingua/js/mgr/resource.js rename to assets/components/lingua/js/mgr/resource.js diff --git a/www/assets/components/lingua/js/mgr/sections/index.js b/assets/components/lingua/js/mgr/sections/index.js similarity index 100% rename from www/assets/components/lingua/js/mgr/sections/index.js rename to assets/components/lingua/js/mgr/sections/index.js diff --git a/www/assets/components/lingua/js/mgr/widgets/combo.resource.js b/assets/components/lingua/js/mgr/widgets/combo.resource.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/combo.resource.js rename to assets/components/lingua/js/mgr/widgets/combo.resource.js diff --git a/www/assets/components/lingua/js/mgr/widgets/combo.tv.js b/assets/components/lingua/js/mgr/widgets/combo.tv.js similarity index 92% rename from www/assets/components/lingua/js/mgr/widgets/combo.tv.js rename to assets/components/lingua/js/mgr/widgets/combo.tv.js index f2a22d1..8568a2c 100644 --- a/www/assets/components/lingua/js/mgr/widgets/combo.tv.js +++ b/assets/components/lingua/js/mgr/widgets/combo.tv.js @@ -4,7 +4,7 @@ Lingua.combo.TV = function(config) { Ext.applyIf(config, { url: Lingua.config.connectorUrl, baseParams: { - action: 'mgr/tv/combogetlist', + action: 'Lingua\\Processors\\Tv\\ComboGetList', excludeExisting: 1 }, width: 300, diff --git a/www/assets/components/lingua/js/mgr/widgets/grid.langs.js b/assets/components/lingua/js/mgr/widgets/grid.langs.js similarity index 94% rename from www/assets/components/lingua/js/mgr/widgets/grid.langs.js rename to assets/components/lingua/js/mgr/widgets/grid.langs.js index 9d4e04e..665e1e7 100644 --- a/www/assets/components/lingua/js/mgr/widgets/grid.langs.js +++ b/assets/components/lingua/js/mgr/widgets/grid.langs.js @@ -4,13 +4,13 @@ Lingua.grid.Langs = function (config) { Ext.applyIf(config, { id: 'lingua-grid-langs', url: Lingua.config.connectorUrl, - baseParams: {action: 'mgr/langs/getList'}, + baseParams: {action: 'Lingua\\Processors\\Langs\\GetList'}, fields: ['id', 'active', 'local_name', 'lang_code', 'lcid_string', 'lcid_dec', 'date_format_lite', 'date_format_full', 'is_rtl', 'flag'], paging: true, remoteSort: true, anchor: '97%', - save_action: 'mgr/langs/updateFromGrid', + save_action: 'Lingua\\Processors\\Langs\\UpdateFromGrid', autosave: true, autoExpandColumn: 'local_name', columns: [{ @@ -54,7 +54,7 @@ Lingua.grid.Langs = function (config) { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/langs/updateFromGrid', + action: 'Lingua\\Processors\\Langs\\UpdateFromGrid', data: JSON.stringify(selectedRow.data) } }); @@ -112,7 +112,7 @@ Lingua.grid.Langs = function (config) { xtype: 'lingua-window-lang', title: _('lingua.lang_create'), baseParams: { - action: 'mgr/langs/create' + action: 'Lingua\\Processors\\Langs\\Create' }, blankValues: true } @@ -167,7 +167,7 @@ Ext.extend(Lingua.grid.Langs, MODx.grid.Grid, { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/langs/updateFromGrid', + action: 'Lingua\\Processors\\Langs\\UpdateFromGrid', data: JSON.stringify(record.data) }, listeners: { @@ -189,7 +189,7 @@ Ext.extend(Lingua.grid.Langs, MODx.grid.Grid, { xtype: 'lingua-window-lang', title: _('lingua.update'), baseParams: { - action: 'mgr/langs/update' + action: 'Lingua\\Processors\\Langs\\Update' }, listeners: { 'success': { @@ -209,7 +209,7 @@ Ext.extend(Lingua.grid.Langs, MODx.grid.Grid, { text: _('lingua.delete_lang_confirm'), url: this.config.url, params: { - action: 'mgr/langs/remove', + action: 'Lingua\\Processors\\Langs\\Remove', id: this.menu.record.id }, listeners: { diff --git a/www/assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js b/assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js similarity index 93% rename from www/assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js rename to assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js index 558676d..b0f84d6 100644 --- a/www/assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js +++ b/assets/components/lingua/js/mgr/widgets/grid.resourcescopes.js @@ -4,7 +4,7 @@ Lingua.grid.ResourceScopes = function (config) { Ext.applyIf(config, { id: 'lingua-grid-resourcescopes', url: Lingua.config.connectorUrl, - baseParams: {action: 'mgr/resourcescopes/getList'}, + baseParams: {action: 'Lingua\\Processors\\ResourceScopes\\GetList'}, fields: ['id', 'resource_id', 'pagetitle', 'properties', 'property_langs', 'as_parent', 'as_ancestor', 'exclude_self'], paging: true, @@ -65,7 +65,7 @@ Lingua.grid.ResourceScopes = function (config) { xtype: 'lingua-window-resourcescope', title: _('lingua.resourcescope_create'), baseParams: { - action: 'mgr/resourcescopes/create' + action: 'Lingua\\Processors\\ResourceScopes\\Create' }, blankValues: true } @@ -120,7 +120,7 @@ Ext.extend(Lingua.grid.ResourceScopes, MODx.grid.Grid, { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/resourcescopes/updateFromGrid', + action: 'Lingua\\Processors\\ResourceScopes\\UpdateFromGrid', data: JSON.stringify(record.data) }, listeners: { @@ -141,7 +141,7 @@ Ext.extend(Lingua.grid.ResourceScopes, MODx.grid.Grid, { xtype: 'lingua-window-resourcescope', title: _('lingua.update'), baseParams: { - action: 'mgr/resourcescopes/update', + action: 'Lingua\\Processors\\ResourceScopes\\Update', id: this.menu.record.id }, closeAction: 'close', @@ -161,7 +161,7 @@ Ext.extend(Lingua.grid.ResourceScopes, MODx.grid.Grid, { text: _('lingua.delete_resourcescope_confirm'), url: this.config.url, params: { - action: 'mgr/resourcescopes/remove', + action: 'Lingua\\Processors\\ResourceScopes\\Remove', id: this.menu.record.id }, listeners: { diff --git a/www/assets/components/lingua/js/mgr/widgets/grid.sync.js b/assets/components/lingua/js/mgr/widgets/grid.sync.js similarity index 96% rename from www/assets/components/lingua/js/mgr/widgets/grid.sync.js rename to assets/components/lingua/js/mgr/widgets/grid.sync.js index a1c449c..eb6dc56 100644 --- a/www/assets/components/lingua/js/mgr/widgets/grid.sync.js +++ b/assets/components/lingua/js/mgr/widgets/grid.sync.js @@ -57,7 +57,7 @@ Ext.extend(Lingua.grid.Sync, MODx.grid.LocalGrid, { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/contexts/getlist', + action: 'Lingua\\Processors\\Contexts\\GetList', }, listeners: { 'success': { @@ -84,7 +84,7 @@ Ext.extend(Lingua.grid.Sync, MODx.grid.LocalGrid, { title: _('lingua.auto_sync'), contexts: contexts, baseParams: { - action: 'mgr/tools/autosync', + action: 'Lingua\\Processors\\Tools\\AutoSync', limit: 20, start: 0 }, @@ -124,7 +124,7 @@ Ext.extend(Lingua.grid.Sync, MODx.grid.LocalGrid, { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/tools/autosync', + action: 'Lingua\\Processors\\Tools\\AutoSync', limit: (limit ? limit : 20), start: (start ? start : 0) }, @@ -193,7 +193,7 @@ Ext.extend(Lingua.grid.Sync, MODx.grid.LocalGrid, { MODx.Ajax.request({ url: Lingua.config.connectorUrl, params: { - action: 'mgr/tools/manualsync', + action: 'Lingua\\Processors\\Tools\\ManualSync', limit: (limit ? limit : 20), start: (start ? start : 0), ids: JSON.stringify(ids) diff --git a/www/assets/components/lingua/js/mgr/widgets/grid.tvs.js b/assets/components/lingua/js/mgr/widgets/grid.tvs.js similarity index 93% rename from www/assets/components/lingua/js/mgr/widgets/grid.tvs.js rename to assets/components/lingua/js/mgr/widgets/grid.tvs.js index 61f1a7c..c93c571 100644 --- a/www/assets/components/lingua/js/mgr/widgets/grid.tvs.js +++ b/assets/components/lingua/js/mgr/widgets/grid.tvs.js @@ -4,7 +4,7 @@ Lingua.grid.TVs = function(config) { Ext.applyIf(config, { id: 'lingua-grid-tvs', url: Lingua.config.connectorUrl, - baseParams: {action: 'mgr/tv/getList'}, + baseParams: {action: 'Lingua\\Processors\\Tv\\GetList'}, fields: ['id', 'name', 'type'], paging: true, remoteSort: true, @@ -31,7 +31,7 @@ Lingua.grid.TVs = function(config) { xtype: 'lingua-window-tv', title: _('lingua.add_tv'), baseParams: { - action: 'mgr/tv/create' + action: 'Lingua\\Processors\\Tv\\Create' }, blankValues: true } @@ -83,7 +83,7 @@ Ext.extend(Lingua.grid.TVs, MODx.grid.Grid, { text: _('lingua.delete_tv_confirm'), url: this.config.url, params: { - action: 'mgr/tv/remove', + action: 'Lingua\\Processors\\Tv\\Remove', id: this.menu.record.id }, listeners: { diff --git a/www/assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js b/assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js similarity index 91% rename from www/assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js rename to assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js index 3bce79e..31c3464 100644 --- a/www/assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js +++ b/assets/components/lingua/js/mgr/widgets/grid.tvspatterns.js @@ -4,12 +4,12 @@ Lingua.grid.TVsPatterns = function(config) { Ext.applyIf(config, { id: 'lingua-grid-tvspatterns', url: Lingua.config.connectorUrl, - baseParams: {action: 'mgr/tvpatterns/getList'}, + baseParams: {action: 'Lingua\\Processors\\TvPatterns\\GetList'}, fields: ['id', 'type', 'search', 'replacement'], paging: true, remoteSort: true, anchor: '97%', - save_action: 'mgr/tvpatterns/updateFromGrid', + save_action: 'Lingua\\Processors\\TvPatterns\\UpdateFromGrid', autosave: true, autoExpandColumn: 'search', columns: [{ @@ -40,7 +40,7 @@ Lingua.grid.TVsPatterns = function(config) { xtype: 'lingua-window-tvpattern', title: _('lingua.add_pattern'), baseParams: { - action: 'mgr/tvpatterns/create' + action: 'Lingua\\Processors\\TvPatterns\\Create' }, blankValues: true } @@ -98,7 +98,7 @@ Ext.extend(Lingua.grid.TVsPatterns, MODx.grid.Grid, { xtype: 'lingua-window-tvpattern', title: _('lingua.update'), baseParams: { - action: 'mgr/tvpatterns/update' + action: 'Lingua\\Processors\\TvPatterns\\Update' }, listeners: { 'success': { @@ -118,7 +118,7 @@ Ext.extend(Lingua.grid.TVsPatterns, MODx.grid.Grid, { xtype: 'lingua-window-tvpattern', title: _('duplicate'), baseParams: { - action: 'mgr/tvpatterns/create' + action: 'Lingua\\Processors\\TvPatterns\\Create' }, listeners: { 'success': { @@ -139,7 +139,7 @@ Ext.extend(Lingua.grid.TVsPatterns, MODx.grid.Grid, { text: _('lingua.delete_lang_confirm'), url: this.config.url, params: { - action: 'mgr/tvpatterns/remove', + action: 'Lingua\\Processors\\TvPatterns\\Remove', id: this.menu.record.id }, listeners: { diff --git a/www/assets/components/lingua/js/mgr/widgets/panel.home.js b/assets/components/lingua/js/mgr/widgets/panel.home.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/panel.home.js rename to assets/components/lingua/js/mgr/widgets/panel.home.js diff --git a/www/assets/components/lingua/js/mgr/widgets/window.autosync.js b/assets/components/lingua/js/mgr/widgets/window.autosync.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/window.autosync.js rename to assets/components/lingua/js/mgr/widgets/window.autosync.js diff --git a/www/assets/components/lingua/js/mgr/widgets/window.lang.js b/assets/components/lingua/js/mgr/widgets/window.lang.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/window.lang.js rename to assets/components/lingua/js/mgr/widgets/window.lang.js diff --git a/www/assets/components/lingua/js/mgr/widgets/window.manualsync.js b/assets/components/lingua/js/mgr/widgets/window.manualsync.js similarity index 97% rename from www/assets/components/lingua/js/mgr/widgets/window.manualsync.js rename to assets/components/lingua/js/mgr/widgets/window.manualsync.js index 773f965..34ceebc 100644 --- a/www/assets/components/lingua/js/mgr/widgets/window.manualsync.js +++ b/assets/components/lingua/js/mgr/widgets/window.manualsync.js @@ -18,7 +18,7 @@ Lingua.window.ManualSync = function (config) { anchor: '100%', url: Lingua.config.connectorUrl, baseParams: { - action: 'mgr/resource/getlist', + action: 'Lingua\\Processors\\Resource\\GetList', combo: true }, displayField: 'pagetitle', diff --git a/www/assets/components/lingua/js/mgr/widgets/window.resourcescope.js b/assets/components/lingua/js/mgr/widgets/window.resourcescope.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/window.resourcescope.js rename to assets/components/lingua/js/mgr/widgets/window.resourcescope.js diff --git a/www/assets/components/lingua/js/mgr/widgets/window.tv.js b/assets/components/lingua/js/mgr/widgets/window.tv.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/window.tv.js rename to assets/components/lingua/js/mgr/widgets/window.tv.js diff --git a/www/assets/components/lingua/js/mgr/widgets/window.tvpattern.js b/assets/components/lingua/js/mgr/widgets/window.tvpattern.js similarity index 100% rename from www/assets/components/lingua/js/mgr/widgets/window.tvpattern.js rename to assets/components/lingua/js/mgr/widgets/window.tvpattern.js diff --git a/www/assets/components/lingua/js/ux/CheckColumn.js b/assets/components/lingua/js/ux/CheckColumn.js similarity index 100% rename from www/assets/components/lingua/js/ux/CheckColumn.js rename to assets/components/lingua/js/ux/CheckColumn.js diff --git a/core/components/lingua/bootstrap.php b/core/components/lingua/bootstrap.php new file mode 100644 index 0000000..20250e5 --- /dev/null +++ b/core/components/lingua/bootstrap.php @@ -0,0 +1,13 @@ +addPackage('Lingua\Model', $namespace['path'] . 'src/', null, 'Lingua\\'); + +$modx->services->add('Lingua', function ($c) use ($modx) { + return new Lingua\Lingua($modx); +}); diff --git a/core/components/lingua/controllers/home.class.php b/core/components/lingua/controllers/home.class.php index 441345c..1331635 100644 --- a/core/components/lingua/controllers/home.class.php +++ b/core/components/lingua/controllers/home.class.php @@ -1,5 +1,7 @@ modx->lexicon('lingua'); - } - - public function loadCustomCssJs() { - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.autosync.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.manualsync.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/grid.sync.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/combo.resource.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.resourcescope.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/grid.resourcescopes.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'ux/CheckColumn.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.tvpattern.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/grid.tvspatterns.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/combo.tv.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.tv.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/grid.tvs.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/window.lang.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/grid.langs.js'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/widgets/panel.home.js'); - $this->addLastJavascript($this->lingua->config['jsUrl'] . 'mgr/sections/index.js'); - } - - public function getTemplateFile() { - return $this->lingua->config['templatesPath'] . 'home.tpl'; - } - -} \ No newline at end of file +class LinguaHomeManagerController extends modExtraManagerController +{ + /** @var Lingua\Lingua $Lingua */ + public $Lingua; + + + /** + * + */ + public function initialize() + { + $this->Lingua = $this->modx->services->get('Lingua'); + + $this->addCss($this->Lingua->config['cssUrl'] . 'mgr.css'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/lingua.js'); + $this->addHtml(''); + + parent::initialize(); + } + + + /** + * @return array + */ + public function getLanguageTopics() + { + return ['lingua:default', 'lingua:cmp']; + } + + + /** + * @return bool + */ + public function checkPermissions() + { + return true; + } + + + /** + * @return null|string + */ + public function getPageTitle() + { + return $this->modx->lexicon('lingua'); + } + + + /** + * @return void + */ + public function loadCustomCssJs() + { + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.autosync.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.manualsync.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/grid.sync.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/combo.resource.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.resourcescope.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/grid.resourcescopes.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'ux/CheckColumn.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.tvpattern.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/grid.tvspatterns.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/combo.tv.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.tv.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/grid.tvs.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/window.lang.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/grid.langs.js'); + $this->addJavascript($this->Lingua->config['jsUrl'] . 'mgr/widgets/panel.home.js'); + $this->addLastJavascript($this->Lingua->config['jsUrl'] . 'mgr/sections/index.js'); + } + + + /** + * @return string + */ + public function getTemplateFile() + { + return $this->Lingua->config['templatesPath'] . 'home.tpl'; + } +} diff --git a/core/components/lingua/defaults/default.langs.php b/core/components/lingua/defaults/default.langs.php index 78eadc8..8475d3f 100644 --- a/core/components/lingua/defaults/default.langs.php +++ b/core/components/lingua/defaults/default.langs.php @@ -27,7 +27,7 @@ $collection = array(); $langs = include dirname(__FILE__) . '/modx_lingua_langs.php'; foreach ($langs as $lang) { - $oldLang = $modx->getObject('linguaLangs', array( + $oldLang = $modx->getObject('Lingua\\Model\\LinguaLangs', array( 'lang_code' => $lang['lang_code'], 'lcid_string' => $lang['lcid_string'], 'lcid_dec' => $lang['lcid_dec'], @@ -35,7 +35,7 @@ if ($oldLang) { continue; } - $newLang = $modx->newObject('linguaLangs'); + $newLang = $modx->newObject('Lingua\\Model\\LinguaLangs'); $newLang->fromArray(array( 'active' => $lang['lang_code'] === 'en' ? 1 : 0, 'local_name' => $lang['local_name'], diff --git a/core/components/lingua/defaults/default.patterns.php b/core/components/lingua/defaults/default.patterns.php index db5c103..ce02d63 100644 --- a/core/components/lingua/defaults/default.patterns.php +++ b/core/components/lingua/defaults/default.patterns.php @@ -27,7 +27,7 @@ $collection = array(); $patterns = include dirname(__FILE__) . '/modx_lingua_site_tmplvars_patterns.php'; foreach ($patterns as $pattern) { - $oldPattern = $modx->getObject('linguaSiteTmplvarsPatterns', array( + $oldPattern = $modx->getObject('Lingua\\Model\\LinguaSiteTmplvarsPatterns', array( 'type' => $pattern['type'], 'search' => $pattern['search'], 'replacement' => $pattern['replacement'], @@ -35,7 +35,7 @@ if ($oldPattern) { continue; } - $newPattern = $modx->newObject('linguaSiteTmplvarsPatterns'); + $newPattern = $modx->newObject('Lingua\\Model\\LinguaSiteTmplvarsPatterns'); $newPattern->fromArray(array( 'type' => $pattern['type'], 'search' => $pattern['search'], diff --git a/core/components/lingua/docs/changelog.txt b/core/components/lingua/docs/changelog.txt index a9bca8c..4ed3710 100644 --- a/core/components/lingua/docs/changelog.txt +++ b/core/components/lingua/docs/changelog.txt @@ -1,3 +1,7 @@ +Lingua 3.0.0-dev +====================================== +- Add compatibility with MODX 3 + Lingua 2.1.0-dev ====================================== - [#48] TV saving problem: saving empty value @@ -117,4 +121,4 @@ Lingua 1.0.0-dev.2 Lingua 1.0.0-dev.1 ================================= -- initial setup \ No newline at end of file +- initial setup diff --git a/core/components/lingua/docs/license.txt b/core/components/lingua/docs/license.txt index 20d40b6..94a9ed0 100644 --- a/core/components/lingua/docs/license.txt +++ b/core/components/lingua/docs/license.txt @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. \ No newline at end of file +. diff --git a/core/components/lingua/docs/readme.txt b/core/components/lingua/docs/readme.txt index c1c77c4..fde587d 100644 --- a/core/components/lingua/docs/readme.txt +++ b/core/components/lingua/docs/readme.txt @@ -12,4 +12,4 @@ Lingua is a multi-lingual plugin system for MODX Revolution. References: 1. http://en.wikipedia.org/wiki/ISO_639-1_language_matrix 2. http://www.science.co.il/language/locale-codes.asp -3. http://www.php.net/manual/en/book.intl.php \ No newline at end of file +3. http://www.php.net/manual/en/book.intl.php diff --git a/core/components/lingua/index.class.php b/core/components/lingua/index.class.php deleted file mode 100644 index ae6d83d..0000000 --- a/core/components/lingua/index.class.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * @package lingua - * @subpackage lingua_controller - */ -require_once dirname(__FILE__) . '/model/lingua/lingua.class.php'; - -abstract class LinguaManagerController extends modExtraManagerController { - - /** @var Lingua $lingua */ - public $lingua; - - public function initialize() { - $this->lingua = new Lingua($this->modx); - - $this->addCss($this->lingua->config['cssUrl'] . 'mgr.css'); - $this->addJavascript($this->lingua->config['jsUrl'] . 'mgr/lingua.js'); - $this->addHtml(''); - return parent::initialize(); - } - - public function getLanguageTopics() { - return array('lingua:default', 'lingua:cmp'); - } - - public function checkPermissions() { - return true; - } - -} - -class IndexManagerController extends LinguaManagerController { - - public static function getDefaultController() { - return 'home'; - } - -} diff --git a/core/components/lingua/lexicon/en/default.inc.php b/core/components/lingua/lexicon/en/default.inc.php index d251c41..af1b1e6 100644 --- a/core/components/lingua/lexicon/en/default.inc.php +++ b/core/components/lingua/lexicon/en/default.inc.php @@ -23,4 +23,4 @@ $_lang['setting_lingua.empty_returns_default'] = 'Empty value returns default?'; $_lang['setting_lingua.empty_returns_default_desc'] = 'If translated field has empty value, should Lingue return value from default language or not?'; $_lang['setting_lingua.form_customization'] = 'Check Form Customization?'; -$_lang['setting_lingua.form_customization_desc'] = 'If Lingua needs to check Form Customization, it will parse the whole document page again after FC is initiated.'; \ No newline at end of file +$_lang['setting_lingua.form_customization_desc'] = 'If Lingua needs to check Form Customization, it will parse the whole document page again after FC is initiated.'; diff --git a/core/components/lingua/lexicon/en/property.inc.php b/core/components/lingua/lexicon/en/properties.inc.php similarity index 94% rename from core/components/lingua/lexicon/en/property.inc.php rename to core/components/lingua/lexicon/en/properties.inc.php index 2b5eaf2..30d7a0e 100644 --- a/core/components/lingua/lexicon/en/property.inc.php +++ b/core/components/lingua/lexicon/en/properties.inc.php @@ -8,4 +8,4 @@ $_lang['prop_sortby_desc'] = 'Sort the list by'; $_lang['prop_sortdir_desc'] = 'Sort direction'; $_lang['prop_phsPrefix_desc'] = 'Additional prefix for templates'; -$_lang['prop_field_desc'] = 'Which field this snippet should take value from? Options: pagetitle, longtitle, description, alias, link_attributes, introtext, content, menutitle, uri, uri_override, properties, OR any TV\'s name'; \ No newline at end of file +$_lang['prop_field_desc'] = 'Which field this snippet should take value from? Options: pagetitle, longtitle, description, alias, link_attributes, introtext, content, menutitle, uri, uri_override, properties, OR any TV\'s name'; diff --git a/core/components/lingua/model/lingua/lingualangs.class.php b/core/components/lingua/model/lingua/lingualangs.class.php deleted file mode 100644 index 253f8ff..0000000 --- a/core/components/lingua/model/lingua/lingualangs.class.php +++ /dev/null @@ -1,2 +0,0 @@ - - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. - * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * Encapsulates the interaction of MODX manager with an HTTP request. - * - * {@inheritdoc} - * - * @package lingua - * @subpackage linguarequest - */ -require_once MODX_CORE_PATH . 'model/modx/modrequest.class.php'; - -class LinguaRequest extends modRequest { - /** - * - * @var object $lingua A reference to the Lingua object - */ - public $lingua; - - /** - * @param modX $modx A reference to the modX object - */ - function __construct(modX &$modx) { - parent::__construct($modx); - $this->lingua = $this->modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/'); - } - - - /** - * The primary MODX request handler (a.k.a. controller). - * - * @return boolean True if a request is handled without interruption. - */ - public function handleRequest() { - $this->loadErrorHandler(); - - $this->sanitizeRequest(); - $this->modx->invokeEvent('OnHandleRequest'); - if (!$this->modx->checkSiteStatus()) { - header('HTTP/1.1 503 Service Unavailable'); - if (!$this->modx->getOption('site_unavailable_page',null,1)) { - $this->modx->resource = $this->modx->newObject('modDocument'); - $this->modx->resource->template = 0; - $this->modx->resource->content = $this->modx->getOption('site_unavailable_message'); - } else { - $this->modx->resourceMethod = "id"; - $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1); - } - } else { - $this->checkPublishStatus(); - $this->modx->resourceMethod = $this->getResourceMethod(); - $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod); - if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) { - $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier); - if (!empty($uri)) { - if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) { - $url = $this->modx->getOption('site_url', null, MODX_SITE_URL); - } else { - $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri; - } - $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); - } - } - } - if (empty ($this->modx->resourceMethod)) { - $this->modx->resourceMethod = "id"; - } - if ($this->modx->resourceMethod == "alias") { - $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier); - } - if ($this->modx->resourceMethod == "alias") { - $found = $this->findResource($this->modx->resourceIdentifier); - if ($found) { - $this->modx->resourceIdentifier = $found; - $this->modx->resourceMethod = 'id'; - } else { - $this->modx->sendErrorPage(); - } - } - $this->modx->beforeRequest(); - $this->modx->invokeEvent("OnWebPageInit"); - - if (!is_object($this->modx->resource)) { - if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) { - $this->modx->sendErrorPage(); - return true; - } - } - - return $this->prepareResponse(); - } - - /** - * Gets a requested resource and all required data. - * - * @param string $method The method, 'id', or 'alias', by which to perform - * the resource lookup. - * @param string|integer $identifier The identifier with which to search. - * @param array $options An array of options for the resource fetching - * @return modResource The requested modResource instance or request - * is forwarded to the error page, or unauthorized page. - */ - public function getResource($method, $identifier, array $options = array()) { - $resource = null; - if ($method == 'alias') { - $resourceId = $this->findResource($identifier); - } else { - $resourceId = $identifier; - } - - if (!is_numeric($resourceId)) { - $this->modx->sendErrorPage(); - } - - $resource = parent::getResource($method, $identifier, $options); - if ($resource) { - $context = $resource->get('context_key'); - $allowedContexts = $this->modx->getOption('lingua.contexts'); - $allowedContexts = array_map('trim', @explode(',', $allowedContexts)); - if (empty($context) || empty($allowedContexts) || !in_array($context, $allowedContexts)) { - return $resource; - } - } - $this->modx->setOption('cache_resource_key', 'lingua/resource/' . $this->modx->cultureKey); - - $isForward = array_key_exists('forward', $options) && !empty($options['forward']); - $fromCache = false; - $cacheKey = $this->modx->context->get('key') . "/resources/{$resourceId}"; - $cultureKey = !empty($this->modx->cultureKey) ? $this->modx->cultureKey : $this->modx->getOption('cultureKey', null, 'en'); - $cachedResource = $this->modx->cacheManager->get($cacheKey, array( - xPDO::OPT_CACHE_KEY => $this->modx->getOption('cache_resource_key', null, 'lingua/resource/' . $cultureKey), - xPDO::OPT_CACHE_HANDLER => $this->modx->getOption('cache_resource_handler', null, $this->modx->getOption(xPDO::OPT_CACHE_HANDLER)), - xPDO::OPT_CACHE_FORMAT => (integer) $this->modx->getOption('cache_resource_format', null, $this->modx->getOption(xPDO::OPT_CACHE_FORMAT, null, xPDOCacheManager::CACHE_PHP)), - )); - if (is_array($cachedResource) && array_key_exists('resource', $cachedResource) && is_array($cachedResource['resource'])) { - /** @var modResource $resource */ - $resource = $this->modx->newObject($cachedResource['resourceClass']); - if ($resource) { - $resource->fromArray($cachedResource['resource'], '', true, true, true); - $resource->_content = $cachedResource['resource']['_content']; - $resource->_isForward = $isForward; - if (isset($cachedResource['contentType'])) { - $contentType = $this->modx->newObject('modContentType'); - $contentType->fromArray($cachedResource['contentType'], '', true, true, true); - $resource->addOne($contentType, 'ContentType'); - } - if (isset($cachedResource['resourceGroups'])) { - $rGroups = array(); - foreach ($cachedResource['resourceGroups'] as $rGroupKey => $rGroup) { - $rGroups[$rGroupKey] = $this->modx->newObject('modResourceGroupResource', $rGroup); - } - $resource->addMany($rGroups); - } - if (isset($cachedResource['policyCache'])) - $resource->setPolicies(array($this->modx->context->get('key') => $cachedResource['policyCache'])); - if (isset($cachedResource['elementCache'])) - $this->modx->elementCache = $cachedResource['elementCache']; - if (isset($cachedResource['sourceCache'])) - $this->modx->sourceCache = $cachedResource['sourceCache']; - if ($resource->get('_jscripts')) - $this->modx->jscripts = $this->modx->jscripts + $resource->get('_jscripts'); - if ($resource->get('_sjscripts')) - $this->modx->sjscripts = $this->modx->sjscripts + $resource->get('_sjscripts'); - if ($resource->get('_loadedjscripts')) - $this->modx->loadedjscripts = array_merge($this->modx->loadedjscripts, $resource->get('_loadedjscripts')); - $isForward = $resource->_isForward; - $resource->setProcessed(true); - $fromCache = true; - } - } - if (!$fromCache || !is_object($resource)) { - $criteria = $this->modx->newQuery('modResource'); - $criteria->select(array($this->modx->escape('modResource') . '.*')); - $criteria->where(array('id' => $resourceId, 'deleted' => '0')); - if (!$this->modx->hasPermission('view_unpublished') || $this->modx->getSessionState() !== modX::SESSION_STATE_INITIALIZED) { - $criteria->where(array('published' => 1)); - } - if ($resource = $this->modx->getObject('modResource', $criteria)) { - if ($resource instanceof modResource) { - if ($resource->get('context_key') !== $this->modx->context->get('key')) { - if (!$isForward || ($isForward && !$this->modx->getOption('allow_forward_across_contexts', $options, false))) { - if (!$this->modx->getCount('modContextResource', array($this->modx->context->get('key'), $resourceId))) { - return null; - } - } - } - $resource->_isForward = $isForward; - if (!$resource->checkPolicy('view')) { - $this->modx->sendUnauthorizedPage(); - } - - // hack the resource's content in here --------------------> - $linguaLangs = $this->modx->getObject('linguaLangs', array('lang_code' => $cultureKey)); - $emptyReturnsDefault = $this->modx->getOption('lingua.empty_returns_default', null, false); - if (($this->lingua instanceof Lingua) && $linguaLangs) { - $linguaSiteContent = $this->modx->getObject('linguaSiteContent', array( - 'resource_id' => $resource->get('id'), - 'lang_id' => $linguaLangs->get('id'), - )); - if ($linguaSiteContent) { - $linguaSiteContentArray = $linguaSiteContent->toArray(); - unset($linguaSiteContentArray['id']); - foreach ($linguaSiteContentArray as $k => $v) { - // exclude URI to reveal back the original URI later - if ($k === 'uri') { - continue; - } - if (empty($v)) { - if (!$emptyReturnsDefault) { - $resource->set($k, $v); // return empty value - } - } else { - $resource->set($k, $v); - } - } - } - } - // hacking ends -------------------------------------------> - - if ($tvs = $resource->getMany('TemplateVars', 'all')) { - /** @var modTemplateVar $tv */ - /** - * Override with LinguaTV when applicable - */ - foreach ($tvs as $tv) { - $value = $tv->getValue($resource->get('id')); - // hack the tv's content in here ------------------> - if (($this->lingua instanceof Lingua) && $linguaLangs) { - $linguaTVContent = $this->modx->getObject('linguaSiteTmplvarContentvalues', array( - 'tmplvarid' => $tv->get('id'), - 'contentid' => $resourceId, - 'lang_id' => $linguaLangs->get('id') - )); - if ($linguaTVContent) { - $linguaTVContentValue = $linguaTVContent->get('value'); - if (empty($linguaTVContentValue)) { - if (!$emptyReturnsDefault) { - $value = $linguaTVContentValue; // return empty value - } - } else { - $value = $linguaTVContentValue; - } - } - } - // hacking ends -----------------------------------> - - $resource->set($tv->get('name'), array( - $tv->get('name'), - $value, - $tv->get('display'), - $tv->get('display_params'), - $tv->get('type'), - )); - } - } - $this->modx->resourceGenerated = true; - } - } - } elseif ($fromCache && $resource instanceof modResource && !$resource->get('deleted')) { - if ($resource->checkPolicy('load') && ($resource->get('published') || ($this->modx->getSessionState() === modX::SESSION_STATE_INITIALIZED && $this->modx->hasPermission('view_unpublished')))) { - if ($resource->get('context_key') !== $this->modx->context->get('key')) { - if (!$isForward || ($isForward && !$this->modx->getOption('allow_forward_across_contexts', $options, false))) { - if (!$this->modx->getCount('modContextResource', array($this->modx->context->get('key'), $resourceId))) { - return null; - } - } - } - if (!$resource->checkPolicy('view')) { - $this->modx->sendUnauthorizedPage(); - } - } else { - return null; - } - $this->modx->invokeEvent('OnLoadWebPageCache'); - } - if ($this->modx->getOption('lingua.debug')) { - $this->modx->log(modX::LOG_LEVEL_ERROR, __FILE__ . ' '); - $this->modx->log(modX::LOG_LEVEL_ERROR, __METHOD__ . ' '); - $this->modx->log(modX::LOG_LEVEL_ERROR, __LINE__ . ': $resourceArray: ' . print_r($resource->toArray(), 1)); - } - return $resource; - } - - /** - * Cleans the resource identifier from the request params. - * - * @param string $identifier The raw identifier. - * @return string|integer The cleansed identifier. - */ - public function _cleanResourceIdentifier($identifier) { - if (empty ($identifier)) { - if ($this->modx->getOption('base_url', null, MODX_BASE_URL) !== strtok($_SERVER["REQUEST_URI"],'?')) { - $this->modx->sendRedirect($this->modx->getOption('site_url', null, MODX_SITE_URL), array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); - } - $identifier = $this->modx->getOption('site_start', null, 1); - $this->modx->resourceMethod = 'id'; - } - elseif ($this->modx->getOption('friendly_urls', null, false) && $this->modx->resourceMethod = 'alias') { - $containerSuffix = trim($this->modx->getOption('container_suffix', null, '')); - $found = $this->findResource($identifier); - if ($found === false && !empty ($containerSuffix)) { - $suffixLen = strlen($containerSuffix); - $identifierLen = strlen($identifier); - if (substr($identifier, $identifierLen - $suffixLen) === $containerSuffix) { - $identifier = substr($identifier, 0, $identifierLen - $suffixLen); - $found = $this->findResource($identifier); - } else { - $identifier = "{$identifier}{$containerSuffix}"; - $found = $this->findResource("{$identifier}{$containerSuffix}"); - } - if ($found) { - $parameters = $this->getParameters(); - unset($parameters[$this->modx->getOption('request_param_alias')]); - $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full'); - $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); - } - $this->modx->resourceMethod = 'alias'; - } elseif ((integer) $this->modx->getOption('site_start', null, 1) === $found) { - $parameters = $this->getParameters(); - unset($parameters[$this->modx->getOption('request_param_alias')]); - $url = $this->modx->makeUrl($this->modx->getOption('site_start', null, 1), $this->modx->context->get('key'), $parameters, 'full'); - $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); - } else { - if ($this->modx->getOption('friendly_urls_strict', null, false)) { - $requestUri = $_SERVER['REQUEST_URI']; - $qsPos = strpos($requestUri, '?'); - if ($qsPos !== false) $requestUri = substr($requestUri, 0, $qsPos); - $fullId = $this->modx->getOption('base_url', null, MODX_BASE_URL) . $identifier; - $requestUri = urldecode($requestUri); - if ($fullId !== $requestUri && strpos($requestUri, $fullId) !== 0) { - $parameters = $this->getParameters(); - unset($parameters[$this->modx->getOption('request_param_alias')]); - $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full'); - $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); - } - } - $this->modx->resourceMethod = 'alias'; - } - } else { - $this->modx->resourceMethod = 'id'; - } - return $identifier; - } - - public function findResource($uri, $context = '') { - $resourceId = $this->modx->findResource($uri, $context); - if (!is_numeric($resourceId)) { - $resourceId = $this->findCloneResource($uri, $context); - } - return $resourceId; - } - - public function findCloneResource($uri, $context = '') { - $resourceId = false; - if (empty($context) && isset($this->modx->context)) $context = $this->modx->context->get('key'); - if (!empty($context) && (!empty($uri) || $uri === '0')) { - $query = $this->modx->newQuery('linguaSiteContent'); - $query->leftJoin('modResource', 'Resource', 'Resource.id = linguaSiteContent.resource_id'); - $query->where(array( - 'context_key' => $context, - 'uri' => $uri, - 'Resource.deleted' => false - )); - $linguaContent = $this->modx->getObject('linguaSiteContent', $query); - if ($linguaContent) { - $resourceId = $linguaContent->get('resource_id'); - // reset the culture key - $lang = $linguaContent->getOne('Lang'); - if ($lang) { - $cultureKey = $lang->get('lang_code'); - $this->lingua->setCultureKey($cultureKey); - $this->modx->setOption('cultureKey', $cultureKey); - $this->modx->context->config['cultureKey'] = $cultureKey; - } - } - } - return $resourceId; - } -} diff --git a/core/components/lingua/model/lingua/linguaresourcescopes.class.php b/core/components/lingua/model/lingua/linguaresourcescopes.class.php deleted file mode 100644 index 94a75a6..0000000 --- a/core/components/lingua/model/lingua/linguaresourcescopes.class.php +++ /dev/null @@ -1,2 +0,0 @@ - - array ( - 0 => 'linguaLangs', - 1 => 'linguaResourceScopes', - 2 => 'linguaSiteContent', - 3 => 'linguaSiteTmplvarContentvalues', - 4 => 'linguaSiteTmplvars', - 5 => 'linguaSiteTmplvarsPatterns', - ), -); \ No newline at end of file diff --git a/core/components/lingua/model/lingua/mysql/lingualangs.class.php b/core/components/lingua/model/lingua/mysql/lingualangs.class.php deleted file mode 100644 index 7048c15..0000000 --- a/core/components/lingua/model/lingua/mysql/lingualangs.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'langs', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'active' => 0, - 'local_name' => NULL, - 'lang_code' => NULL, - 'lcid_string' => NULL, - 'lcid_dec' => NULL, - 'date_format_lite' => 'Y-m-d', - 'date_format_full' => 'Y-m-d H:i:s', - 'is_rtl' => 0, - 'flag' => NULL, - ), - 'fieldMeta' => - array ( - 'active' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '3', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'local_name' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - ), - 'lang_code' => - array ( - 'dbtype' => 'char', - 'precision' => '2', - 'phptype' => 'string', - 'null' => false, - 'index' => 'index', - ), - 'lcid_string' => - array ( - 'dbtype' => 'char', - 'precision' => '10', - 'phptype' => 'string', - 'null' => true, - ), - 'lcid_dec' => - array ( - 'dbtype' => 'int', - 'precision' => '6', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => true, - ), - 'date_format_lite' => - array ( - 'dbtype' => 'char', - 'precision' => '32', - 'phptype' => 'string', - 'null' => true, - 'default' => 'Y-m-d', - ), - 'date_format_full' => - array ( - 'dbtype' => 'char', - 'precision' => '32', - 'phptype' => 'string', - 'null' => true, - 'default' => 'Y-m-d H:i:s', - ), - 'is_rtl' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'flag' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - ), - ), - 'indexes' => - array ( - 'lang_code' => - array ( - 'alias' => 'lang_code', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'lang_code' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - ), - 'composites' => - array ( - 'SiteContent' => - array ( - 'class' => 'linguaSiteContent', - 'local' => 'id', - 'foreign' => 'lang_id', - 'cardinality' => 'many', - 'owner' => 'local', - ), - 'TmplvarContentvalues' => - array ( - 'class' => 'linguaSiteTmplvarContentvalues', - 'local' => 'id', - 'foreign' => 'lang_id', - 'cardinality' => 'many', - 'owner' => 'local', - ), - ), -); diff --git a/core/components/lingua/model/lingua/mysql/linguaresourcescopes.class.php b/core/components/lingua/model/lingua/mysql/linguaresourcescopes.class.php deleted file mode 100644 index f2a4736..0000000 --- a/core/components/lingua/model/lingua/mysql/linguaresourcescopes.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'resource_scopes', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'resource_id' => NULL, - 'properties' => NULL, - 'as_parent' => 0, - 'as_ancestor' => 0, - 'exclude_self' => 0, - ), - 'fieldMeta' => - array ( - 'resource_id' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - ), - 'properties' => - array ( - 'dbtype' => 'text', - 'phptype' => 'string', - 'null' => false, - ), - 'as_parent' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'as_ancestor' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'exclude_self' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - ), -); diff --git a/core/components/lingua/model/lingua/mysql/linguasitecontent.class.php b/core/components/lingua/model/lingua/mysql/linguasitecontent.class.php deleted file mode 100644 index a9d924e..0000000 --- a/core/components/lingua/model/lingua/mysql/linguasitecontent.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'site_content', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'resource_id' => 0, - 'lang_id' => 0, - 'pagetitle' => '', - 'longtitle' => '', - 'description' => '', - 'alias' => '', - 'link_attributes' => '', - 'parent' => 0, - 'isfolder' => 0, - 'introtext' => NULL, - 'content' => NULL, - 'menutitle' => '', - 'context_key' => 'web', - 'content_type' => 1, - 'uri' => NULL, - 'uri_override' => 0, - 'properties' => NULL, - ), - 'fieldMeta' => - array ( - 'resource_id' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'lang_id' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - ), - 'pagetitle' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => false, - 'default' => '', - 'index' => 'index', - ), - 'longtitle' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => false, - 'default' => '', - ), - 'description' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => false, - 'default' => '', - ), - 'alias' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - 'default' => '', - 'index' => 'index', - ), - 'link_attributes' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => false, - 'default' => '', - ), - 'parent' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'isfolder' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'introtext' => - array ( - 'dbtype' => 'text', - 'phptype' => 'string', - 'null' => true, - ), - 'content' => - array ( - 'dbtype' => 'mediumtext', - 'phptype' => 'string', - 'null' => true, - ), - 'menutitle' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => false, - 'default' => '', - ), - 'context_key' => - array ( - 'dbtype' => 'varchar', - 'precision' => '100', - 'phptype' => 'string', - 'null' => false, - 'default' => 'web', - 'index' => 'index', - ), - 'content_type' => - array ( - 'dbtype' => 'int', - 'precision' => '11', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 1, - ), - 'uri' => - array ( - 'dbtype' => 'text', - 'phptype' => 'string', - 'null' => true, - 'index' => 'index', - ), - 'uri_override' => - array ( - 'dbtype' => 'tinyint', - 'precision' => '1', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'properties' => - array ( - 'dbtype' => 'mediumtext', - 'phptype' => 'string', - 'null' => true, - ), - ), - 'indexes' => - array ( - 'alias' => - array ( - 'alias' => 'alias', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'alias' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => true, - ), - ), - ), - 'uri' => - array ( - 'alias' => 'uri', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'uri' => - array ( - 'length' => '333', - 'collation' => 'A', - 'null' => true, - ), - ), - ), - 'uri_override' => - array ( - 'alias' => 'uri_override', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'uri_override' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'cache_refresh_idx' => - array ( - 'alias' => 'cache_refresh_idx', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'id' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - 'parent' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'parent' => - array ( - 'alias' => 'parent', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'parent' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'context_key' => - array ( - 'alias' => 'context_key', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'context_key' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'isfolder' => - array ( - 'alias' => 'isfolder', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'isfolder' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'content_ft_idx' => - array ( - 'alias' => 'content_ft_idx', - 'primary' => false, - 'unique' => false, - 'type' => 'FULLTEXT', - 'columns' => - array ( - 'pagetitle' => - array ( - 'length' => '', - 'collation' => '', - 'null' => false, - ), - 'longtitle' => - array ( - 'length' => '', - 'collation' => '', - 'null' => false, - ), - 'description' => - array ( - 'length' => '', - 'collation' => '', - 'null' => false, - ), - 'introtext' => - array ( - 'length' => '', - 'collation' => '', - 'null' => true, - ), - 'content' => - array ( - 'length' => '', - 'collation' => '', - 'null' => true, - ), - ), - ), - ), - 'aggregates' => - array ( - 'Lang' => - array ( - 'class' => 'linguaLangs', - 'local' => 'lang_id', - 'foreign' => 'id', - 'cardinality' => 'one', - 'owner' => 'foreign', - ), - ), -); diff --git a/core/components/lingua/model/lingua/mysql/linguasitetmplvarcontentvalues.class.php b/core/components/lingua/model/lingua/mysql/linguasitetmplvarcontentvalues.class.php deleted file mode 100644 index 3c349cb..0000000 --- a/core/components/lingua/model/lingua/mysql/linguasitetmplvarcontentvalues.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'site_tmplvar_contentvalues', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'lang_id' => 0, - 'tmplvarid' => 0, - 'contentid' => 0, - 'value' => NULL, - ), - 'fieldMeta' => - array ( - 'lang_id' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'tmplvarid' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'contentid' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - 'value' => - array ( - 'dbtype' => 'mediumtext', - 'phptype' => 'string', - 'null' => false, - ), - ), - 'indexes' => - array ( - 'tmplvarid' => - array ( - 'alias' => 'tmplvarid', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'tmplvarid' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'contentid' => - array ( - 'alias' => 'contentid', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'contentid' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'tv_cnt' => - array ( - 'alias' => 'tv_cnt', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'tmplvarid' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - 'contentid' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - 'lang_id' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - 'lang_id' => - array ( - 'alias' => 'lang_id', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'lang_id' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - ), - 'aggregates' => - array ( - 'Tmplvars' => - array ( - 'class' => 'linguaSiteTmplvars', - 'local' => 'tmplvarid', - 'foreign' => 'tmplvarid', - 'cardinality' => 'one', - 'owner' => 'foreign', - ), - 'Lang' => - array ( - 'class' => 'linguaLangs', - 'local' => 'lang_id', - 'foreign' => 'id', - 'cardinality' => 'one', - 'owner' => 'foreign', - ), - ), -); diff --git a/core/components/lingua/model/lingua/mysql/linguasitetmplvars.class.php b/core/components/lingua/model/lingua/mysql/linguasitetmplvars.class.php deleted file mode 100644 index d084e0d..0000000 --- a/core/components/lingua/model/lingua/mysql/linguasitetmplvars.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'site_tmplvars', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'tmplvarid' => 0, - ), - 'fieldMeta' => - array ( - 'tmplvarid' => - array ( - 'dbtype' => 'int', - 'precision' => '10', - 'attributes' => 'unsigned', - 'phptype' => 'integer', - 'null' => false, - 'default' => 0, - 'index' => 'index', - ), - ), - 'indexes' => - array ( - 'tmplvarid' => - array ( - 'alias' => 'tmplvarid', - 'primary' => false, - 'unique' => false, - 'type' => 'BTREE', - 'columns' => - array ( - 'tmplvarid' => - array ( - 'length' => '', - 'collation' => 'A', - 'null' => false, - ), - ), - ), - ), - 'composites' => - array ( - 'TmplvarContentvalues' => - array ( - 'class' => 'linguaSiteTmplvarContentvalues', - 'local' => 'tmplvarid', - 'foreign' => 'tmplvarid', - 'cardinality' => 'many', - 'owner' => 'local', - ), - ), -); diff --git a/core/components/lingua/model/lingua/mysql/linguasitetmplvarspatterns.class.php b/core/components/lingua/model/lingua/mysql/linguasitetmplvarspatterns.class.php deleted file mode 100644 index 6c3635a..0000000 --- a/core/components/lingua/model/lingua/mysql/linguasitetmplvarspatterns.class.php +++ /dev/null @@ -1,3 +0,0 @@ - 'lingua', - 'version' => '1.1', - 'table' => 'site_tmplvars_patterns', - 'extends' => 'xPDOSimpleObject', - 'fields' => - array ( - 'type' => NULL, - 'search' => NULL, - 'replacement' => NULL, - ), - 'fieldMeta' => - array ( - 'type' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - ), - 'search' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - ), - 'replacement' => - array ( - 'dbtype' => 'varchar', - 'precision' => '255', - 'phptype' => 'string', - 'null' => true, - ), - ), -); diff --git a/core/components/lingua/model/schema/lingua.mysql.schema.xml b/core/components/lingua/schema/lingua.mysql.schema.xml similarity index 86% rename from core/components/lingua/model/schema/lingua.mysql.schema.xml rename to core/components/lingua/schema/lingua.mysql.schema.xml index 106e2ef..b9d8fff 100644 --- a/core/components/lingua/model/schema/lingua.mysql.schema.xml +++ b/core/components/lingua/schema/lingua.mysql.schema.xml @@ -1,6 +1,6 @@ - - + + @@ -15,18 +15,18 @@ - - + + - + - + @@ -75,10 +75,10 @@ - + - + @@ -99,21 +99,21 @@ - - + + - + - + - + diff --git a/core/components/lingua/model/lingua/lingua.class.php b/core/components/lingua/src/Lingua.php similarity index 88% rename from core/components/lingua/model/lingua/lingua.class.php rename to core/components/lingua/src/Lingua.php index 978e941..d3d847f 100644 --- a/core/components/lingua/model/lingua/lingua.class.php +++ b/core/components/lingua/src/Lingua.php @@ -1,5 +1,10 @@ modx = & $modx; - $config = is_array($config) ? $config : array(); + public function __construct(modX $modx, array $config = []) + { + $this->modx = $modx; + $config = is_array($config) ? $config : []; $basePath = $this->modx->getOption('lingua.core_path', $config, $this->modx->getOption('core_path') . 'components/lingua/'); $assetsUrl = $this->modx->getOption('lingua.assets_url', $config, $this->modx->getOption('assets_url') . 'components/lingua/'); - $this->config = array_merge(array( + $this->config = array_merge([ 'version' => self::VERSION . '-' . self::RELEASE, 'basePath' => $basePath, 'corePath' => $basePath, 'modelPath' => $basePath . 'model/', - 'processorsPath' => $basePath . 'processors/', + 'processorsPath' => $basePath . 'src/Processors/', 'chunksPath' => $basePath . 'elements/chunks/', 'templatesPath' => $basePath . 'templates/', 'jsUrl' => $assetsUrl . 'js/', 'cssUrl' => $assetsUrl . 'css/', 'assetsUrl' => $assetsUrl, 'connectorUrl' => $assetsUrl . 'conn/mgr.php', - ), $config); + ], $config); $this->modx->lexicon->load('lingua:default'); - $tablePrefix = $this->modx->getOption('lingua.table_prefix', null, $this->modx->config[modX::OPT_TABLE_PREFIX] . 'lingua_'); - $this->modx->addPackage('lingua', $this->config['modelPath'], $tablePrefix); + $modx->addPackage('Lingua\Model', $basePath . 'src/', null, 'Lingua\\'); } + /** * Set class configuration exclusively for multiple snippet calls * @param array $config snippet's parameters */ - public function setConfigs(array $config = array()) { + public function setConfigs(array $config = []) { $this->config = array_merge($this->config, $config); } @@ -206,8 +213,8 @@ public function getPlaceholders() { * @param array $holder to hold temporary array results * @return array one level array */ - public function implodePhs(array $array, $keyName = null, $separator = '.', array $holder = array()) { - $phs = !empty($holder) ? $holder : array(); + public function implodePhs(array $array, $keyName = null, $separator = '.', array $holder = []) { + $phs = !empty($holder) ? $holder : []; foreach ($array as $k => $v) { $key = !empty($keyName) ? $keyName . $separator . $k : $k; if (is_array($v)) { @@ -248,7 +255,7 @@ public function trimString($string, $charlist = null) { */ public function trimArray($input, $charlist = null) { if (is_array($input)) { - $output = array_map(array($this, 'trimArray'), $input); + $output = array_map([$this, 'trimArray'], $input); } else { $output = $this->trimString($input, $charlist); } @@ -263,7 +270,7 @@ public function trimArray($input, $charlist = null) { * @return string parsed output * @link http://forums.modx.com/thread/74071/help-with-getchunk-and-modx-speed-please?page=2#dis-post-413789 */ - public function parseTpl($tpl, array $phs = array()) { + public function parseTpl($tpl, array $phs = []) { $output = ''; if (isset($this->_chunks[$tpl]) && !empty($this->_chunks[$tpl])) { @@ -296,7 +303,7 @@ public function parseTpl($tpl, array $phs = array()) { $tplChunk = ltrim($tpl, ':'); $tplChunk = trim($tpl); - $chunk = $this->modx->getObject('modChunk', array('name' => $tplChunk), true); + $chunk = $this->modx->getObject('modChunk', ['name' => $tplChunk], true); if (empty($chunk)) { // try to use @splittingred's fallback $f = $this->config['chunksPath'] . strtolower($tplChunk) . '.chunk.tpl'; @@ -328,7 +335,7 @@ public function parseTpl($tpl, array $phs = array()) { * @param array $phs placeholders * @return string parsed output */ - public function parseTplCode($code, array $phs = array()) { + public function parseTplCode($code, array $phs = []) { $chunk = $this->modx->newObject('modChunk'); $chunk->setContent($code); $chunk->setCacheable(false); @@ -344,7 +351,7 @@ public function parseTplCode($code, array $phs = array()) { * @return string parsed output * @throws Exception if file is not found */ - public function parseTplFile($file, array $phs = array()) { + public function parseTplFile($file, array $phs = []) { if (!file_exists($file)) { throw new Exception('File: ' . $file . ' is not found.'); } @@ -381,13 +388,13 @@ public function parseTplFile($file, array $phs = array()) { * @param array $options option for iteration * @return string parsed content */ - public function processElementTags($content, array $options = array()) { + public function processElementTags($content, array $options = []) { $maxIterations = intval($this->modx->getOption('parser_max_iterations', $options, 10)); if (!$this->modx->parser) { $this->modx->getParser(); } - $this->modx->parser->processElementTags('', $content, true, false, '[[', ']]', array(), $maxIterations); - $this->modx->parser->processElementTags('', $content, true, true, '[[', ']]', array(), $maxIterations); + $this->modx->parser->processElementTags('', $content, true, false, '[[', ']]', [], $maxIterations); + $this->modx->parser->processElementTags('', $content, true, true, '[[', ']]', [], $maxIterations); return $content; } @@ -397,24 +404,24 @@ public function processElementTags($content, array $options = array()) { * @return array The replaced results */ public function replacePropPhs($subject) { - $pattern = array( + $pattern = [ '/\{core_path\}/', '/\{base_path\}/', '/\{assets_url\}/', '/\{filemanager_path\}/', '/\[\[\+\+core_path\]\]/', '/\[\[\+\+base_path\]\]/' - ); - $replacement = array( + ]; + $replacement = [ $this->modx->getOption('core_path'), $this->modx->getOption('base_path'), $this->modx->getOption('assets_url'), $this->modx->getOption('filemanager_path'), $this->modx->getOption('core_path'), $this->modx->getOption('base_path') - ); + ]; if (is_array($subject)) { - $parsedString = array(); + $parsedString = []; foreach ($subject as $k => $s) { if (is_array($s)) { $s = $this->replacePropPhs($s); @@ -443,7 +450,7 @@ public function getQueryCount($className, $criteria = null) { $expr = '*'; if ($pk = $this->modx->getPK($className)) { if (!is_array($pk)) { - $pk = array($pk); + $pk = [$pk]; } $expr = $this->modx->getSelectColumns($className, 'alias', '', $pk); } @@ -478,12 +485,12 @@ public function getQueryCount($className, $criteria = null) { * @author Coroico */ public function niceQuery(xPDOQuery $query = null) { - $searched = array("SELECT", "GROUP_CONCAT", "LEFT JOIN", "INNER JOIN", "EXISTS", "LIMIT", "FROM", + $searched = ["SELECT", "GROUP_CONCAT", "LEFT JOIN", "INNER JOIN", "EXISTS", "LIMIT", "FROM", "WHERE", "GROUP BY", "HAVING", "ORDER BY", "OR", "AND", "IFNULL", "ON", "MATCH", "AGAINST", - "COUNT"); - $replace = array(" \r\nSELECT", " \r\nGROUP_CONCAT", " \r\nLEFT JOIN", " \r\nINNER JOIN", " \r\nEXISTS", " \r\nLIMIT", " \r\nFROM", + "COUNT"]; + $replace = [" \r\nSELECT", " \r\nGROUP_CONCAT", " \r\nLEFT JOIN", " \r\nINNER JOIN", " \r\nEXISTS", " \r\nLIMIT", " \r\nFROM", " \r\nWHERE", " \r\nGROUP BY", " \r\nHAVING", " ORDER BY", " \r\nOR", " \r\nAND", " \r\nIFNULL", " \r\nON", " \r\nMATCH", " \r\nAGAINST", - " \r\nCOUNT"); + " \r\nCOUNT"]; $output = ''; if (isset($query)) { $query->prepare(); @@ -511,14 +518,14 @@ public function getLanguages($activeOnly = true, $assoc = true, $persist = true) } } } - $this->_placeholders['languages_assoc_array'] = array(); - $this->_placeholders['languages_array'] = array(); + $this->_placeholders['languages_assoc_array'] = []; + $this->_placeholders['languages_array'] = []; // $modx->getOption('cultureKey') doesn't work! - $modCultureKey = $this->modx->getObject('modSystemSetting', array('key' => 'cultureKey')); + $modCultureKey = $this->modx->getObject('modSystemSetting', ['key' => 'cultureKey']); $cultureKey = $modCultureKey->get('value'); - $defaultLang = $this->modx->getObject('linguaLangs', array( + $defaultLang = $this->modx->getObject('LinguaLangs', [ 'lang_code' => $cultureKey - )); + ]); if ($defaultLang) { if ($assoc) { $this->_placeholders['languages_assoc_array'][$defaultLang->get('lang_code')] = $defaultLang->toArray(); @@ -526,28 +533,28 @@ public function getLanguages($activeOnly = true, $assoc = true, $persist = true) $this->_placeholders['languages_array'][] = $defaultLang->toArray(); } } - $c = $this->modx->newQuery('linguaLangs'); + $c = $this->modx->newQuery('LinguaLangs'); $definedLanguages = $this->getOption('lingua.langs'); if (!empty($definedLanguages)) { $definedLanguages = array_map('trim', @explode(',', $definedLanguages)); - $c->where(array( + $c->where([ 'lang_code:IN' => $definedLanguages - )); + ]); } else { if ($activeOnly) { - $c->where(array( + $c->where([ 'active' => 1 - )); + ]); } } if ($defaultLang) { - $c->where(array( + $c->where([ 'id:!=' => $defaultLang->get('id') - )); + ]); } - $collection = $this->modx->getCollection('linguaLangs', $c); + $collection = $this->modx->getCollection('LinguaLangs', $c); if ($collection) { foreach ($collection as $item) { if ($assoc) { @@ -571,7 +578,7 @@ public function getLanguages($activeOnly = true, $assoc = true, $persist = true) */ public function getOption($key) { // Scope's setting overrides CMP's setting of defining active languages - $config = array(); + $config = []; // system wide $config = array_merge($config, $this->modx->config); // context wide @@ -583,9 +590,9 @@ public function getOption($key) { } else { $ctxKey = $this->modx->resource->get('context_key'); } - $contextSettings = $this->modx->getCollection('modContextSetting', array( + $contextSettings = $this->modx->getCollection('modContextSetting', [ 'context_key' => $ctxKey, - )); + ]); if ($contextSettings) { foreach ($contextSettings as $setting) { $config[$setting->get('key')] = $setting->get('value'); @@ -599,10 +606,10 @@ public function getOption($key) { // check resource's ancestors scope $ancestors = $this->getAncestors($this->modx->resource->get('id')); if (!empty($ancestors)) { - $countResourceAncestorsScopes = $this->modx->getCount('linguaResourceScopes', array( + $countResourceAncestorsScopes = $this->modx->getCount('LinguaResourceScopes', [ 'resource_id:IN' => $ancestors, 'as_ancestor' => 1, - )); + ]); if ($countResourceAncestorsScopes > 0) { /** * loop the ancestors array instead, because ancestors are @@ -610,10 +617,10 @@ public function getOption($key) { * from the closest ancestor */ foreach ($ancestors as $ancestor) { - $scope = $this->modx->getObject('linguaResourceScopes', array( + $scope = $this->modx->getObject('LinguaResourceScopes', [ 'resource_id' => $ancestor, 'as_ancestor' => 1, - )); + ]); if ($scope) { $props = $scope->get('properties'); $props = json_decode($props, true); @@ -628,10 +635,10 @@ public function getOption($key) { // check resource's parent scope $parentId = $this->modx->resource->get('parent'); if ($parentId > 0) { - $linguaResourceParentScope = $this->modx->getObject('linguaResourceScopes', array( + $linguaResourceParentScope = $this->modx->getObject('LinguaResourceScopes', [ 'resource_id' => $parentId, 'as_parent' => 1, - )); + ]); if ($linguaResourceParentScope) { $props = $linguaResourceScope->get('properties'); $props = json_decode($props, true); @@ -641,7 +648,7 @@ public function getOption($key) { } } // check resource's scope - $linguaResourceScope = $this->modx->getObject('linguaResourceScopes', array('resource_id' => $this->modx->resource->get('id'))); + $linguaResourceScope = $this->modx->getObject('LinguaResourceScopes', ['resource_id' => $this->modx->resource->get('id')]); if ($linguaResourceScope) { $props = $linguaResourceScope->get('properties'); $props = json_decode($props, true); @@ -657,9 +664,9 @@ public function getOption($key) { // user's defined properties if ($this->modx->context->get('key') !== 'mgr') { if ($this->modx->user->get('id') !== 0) { - $userSettings = $this->modx->getCollection('modUserSetting', array( + $userSettings = $this->modx->getCollection('modUserSetting', [ 'user' => $this->modx->user->get('id'), - )); + ]); if ($userSettings) { foreach ($userSettings as $setting) { $config[$setting->get('key')] = $setting->get('value'); @@ -735,27 +742,27 @@ public function setCultureKey($cultureKey) { * @param boolean $update allow update or not? * @return boolean */ - public function setContentTranslation($id, $langCode, array $values = array(), $update = true) { + public function setContentTranslation($id, $langCode, array $values = [], $update = true) { $resource = $this->modx->getObject('modResource', $id); if (!$resource) { return false; } - $this->modx->context = $this->modx->getObject('modContext', array('key' => $resource->get('context_key'))); + $this->modx->context = $this->modx->getObject('modContext', ['key' => $resource->get('context_key')]); $defaultCultureKey = $this->modx->context->getOption('cultureKey'); if ($langCode === $defaultCultureKey) { return false; } - $linguaLangs = $this->modx->getObject('linguaLangs', array('lang_code' => $langCode)); + $linguaLangs = $this->modx->getObject('LinguaLangs', ['lang_code' => $langCode]); if (!$linguaLangs) { return false; } - $params = array( + $params = [ 'resource_id' => $id, 'lang_id' => $linguaLangs->get('id'), - ); - $linguaSiteContent = $this->modx->getObject('linguaSiteContent', $params); + ]; + $linguaSiteContent = $this->modx->getObject('LinguaSiteContent', $params); if (!$linguaSiteContent) { - $linguaSiteContent = $this->modx->newObject('linguaSiteContent'); + $linguaSiteContent = $this->modx->newObject('LinguaSiteContent'); $linguaSiteContent->fromArray($params); $linguaSiteContent->save(); } else { @@ -820,23 +827,23 @@ public function setTVTranslation($resourceId, $langCode, $tvId, $val = '', $upda if (!$resource) { return false; } - $this->modx->context = $this->modx->getObject('modContext', array('key' => $resource->get('context_key'))); + $this->modx->context = $this->modx->getObject('modContext', ['key' => $resource->get('context_key')]); $defaultCultureKey = $this->modx->context->getOption('cultureKey'); if ($langCode === $defaultCultureKey) { return false; } - $linguaLangs = $this->modx->getObject('linguaLangs', array('lang_code' => $langCode)); + $linguaLangs = $this->modx->getObject('LinguaLangs', ['lang_code' => $langCode]); if (!$linguaLangs) { return false; } - $params = array( + $params = [ 'lang_id' => $linguaLangs->get('id'), 'tmplvarid' => $tvId, 'contentid' => $resourceId, - ); - $linguaSiteTmplvarContentvalues = $this->modx->getObject('linguaSiteTmplvarContentvalues', $params); + ]; + $linguaSiteTmplvarContentvalues = $this->modx->getObject('LinguaSiteTmplvarContentvalues', $params); if (!$linguaSiteTmplvarContentvalues) { - $linguaSiteTmplvarContentvalues = $this->modx->newObject('linguaSiteTmplvarContentvalues'); + $linguaSiteTmplvarContentvalues = $this->modx->newObject('LinguaSiteTmplvarContentvalues'); $linguaSiteTmplvarContentvalues->set('lang_id', $linguaLangs->get('id')); $linguaSiteTmplvarContentvalues->set('tmplvarid', $tvId); $linguaSiteTmplvarContentvalues->set('contentid', $resourceId); @@ -859,18 +866,18 @@ public function synchronize(modResource $resource) { $this->modx->resource = $resource; $languages = $this->getLanguages(true, true, false); if ($languages) { - $langCodes = array(); + $langCodes = []; foreach ($languages as $language) { $langCodes[] = $language['lang_code']; } // first, delete unused translation - $c = $this->modx->newQuery('linguaSiteContent'); - $c->innerJoin('linguaLangs', 'Lang'); - $c->where(array( - 'linguaSiteContent.resource_id:=' => $resourceArray['id'], + $c = $this->modx->newQuery('LinguaSiteContent'); + $c->innerJoin('LinguaLangs', 'Lang'); + $c->where([ + 'LinguaSiteContent.resource_id:=' => $resourceArray['id'], 'Lang.lang_code:NOT IN' => $langCodes, - )); - $unusedContents = $this->modx->getCollection('linguaSiteContent', $c); + ]); + $unusedContents = $this->modx->getCollection('LinguaSiteContent', $c); if ($unusedContents) { foreach ($unusedContents as $item) { $item->remove(); @@ -880,22 +887,22 @@ public function synchronize(modResource $resource) { $this->setContentTranslation($resourceArray['id'], $language['lang_code'], $resourceArray, false); } $tvs = $resource->getTemplateVars(); - $translatedTvs = $this->modx->getCollection('linguaSiteTmplvars'); + $translatedTvs = $this->modx->getCollection('LinguaSiteTmplvars'); if ($translatedTvs && $tvs) { - $translatedTvsArray = array(); + $translatedTvsArray = []; foreach ($translatedTvs as $translatedTv) { $translatedTvsArray[] = $translatedTv->get('tmplvarid'); } foreach ($tvs as $tv) { // first, delete unused translation - $c = $this->modx->newQuery('linguaSiteTmplvarContentvalues'); - $c->innerJoin('linguaLangs', 'Lang'); - $c->where(array( - 'linguaSiteTmplvarContentvalues.contentid:=' => $resourceArray['id'], - 'linguaSiteTmplvarContentvalues.tmplvarid:=' => $tv->get('id'), + $c = $this->modx->newQuery('LinguaSiteTmplvarContentvalues'); + $c->innerJoin('LinguaLangs', 'Lang'); + $c->where([ + 'LinguaSiteTmplvarContentvalues.contentid:=' => $resourceArray['id'], + 'LinguaSiteTmplvarContentvalues.tmplvarid:=' => $tv->get('id'), 'Lang.lang_code:NOT IN' => $langCodes, - )); - $unusedContents = $this->modx->getCollection('linguaSiteTmplvarContentvalues', $c); + ]); + $unusedContents = $this->modx->getCollection('LinguaSiteTmplvarContentvalues', $c); if ($unusedContents) { foreach ($unusedContents as $item) { $item->remove(); @@ -911,5 +918,4 @@ public function synchronize(modResource $resource) { return true; } - } diff --git a/core/components/lingua/src/Model/LinguaLangs.php b/core/components/lingua/src/Model/LinguaLangs.php new file mode 100644 index 0000000..33e2a06 --- /dev/null +++ b/core/components/lingua/src/Model/LinguaLangs.php @@ -0,0 +1,26 @@ + - * - * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface - * - * Lingua is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation version 3. + * Class LinguaSiteContent * - * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * @property integer $resource_id + * @property integer $lang_id + * @property string $pagetitle + * @property string $longtitle + * @property string $description + * @property string $alias + * @property string $link_attributes + * @property integer $parent + * @property integer $isfolder + * @property string $introtext + * @property string $content + * @property string $menutitle + * @property string $context_key + * @property integer $content_type + * @property string $uri + * @property integer $uri_override + * @property string $properties * - * You should have received a copy of the GNU General Public License along with - * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * - * @package lingua - * @subpackage lingua_site_content + * @package Lingua\Model */ -class linguaSiteContent extends xPDOSimpleObject { - +class LinguaSiteContent extends \xPDO\Om\xPDOSimpleObject +{ /** * Refresh Resource URI fields for children of the specified parent. * @@ -211,5 +215,4 @@ protected function cleanAlias($alias, array $options = array()) { $resource = $this->xpdo->getService('modResource'); return $resource->cleanAlias($alias, $options); } - } diff --git a/core/components/lingua/src/Model/LinguaSiteTmplvarContentvalues.php b/core/components/lingua/src/Model/LinguaSiteTmplvarContentvalues.php new file mode 100644 index 0000000..71f9b1a --- /dev/null +++ b/core/components/lingua/src/Model/LinguaSiteTmplvarContentvalues.php @@ -0,0 +1,18 @@ + '3.0', + 'namespace' => 'Lingua\\Model', + 'namespacePrefix' => 'Lingua', + 'class_map' => + [ + 'xPDO\\Om\\xPDOSimpleObject' => + [ + 0 => 'Lingua\\Model\\LinguaLangs', + 1 => 'Lingua\\Model\\LinguaResourceScopes', + 2 => 'Lingua\\Model\\LinguaSiteContent', + 3 => 'Lingua\\Model\\LinguaSiteTmplvarContentvalues', + 4 => 'Lingua\\Model\\LinguaSiteTmplvars', + 5 => 'Lingua\\Model\\LinguaSiteTmplvarsPatterns', + ], + ] +]; \ No newline at end of file diff --git a/core/components/lingua/src/Model/mysql/LinguaLangs.php b/core/components/lingua/src/Model/mysql/LinguaLangs.php new file mode 100644 index 0000000..b27a7f7 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaLangs.php @@ -0,0 +1,144 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_langs', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'active' => 0, + 'local_name' => NULL, + 'lang_code' => NULL, + 'lcid_string' => NULL, + 'lcid_dec' => NULL, + 'date_format_lite' => 'Y-m-d', + 'date_format_full' => 'Y-m-d H:i:s', + 'is_rtl' => 0, + 'flag' => NULL, + ), + 'fieldMeta' => + array ( + 'active' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '3', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'local_name' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + ), + 'lang_code' => + array ( + 'dbtype' => 'char', + 'precision' => '2', + 'phptype' => 'string', + 'null' => false, + 'index' => 'index', + ), + 'lcid_string' => + array ( + 'dbtype' => 'char', + 'precision' => '10', + 'phptype' => 'string', + 'null' => true, + ), + 'lcid_dec' => + array ( + 'dbtype' => 'int', + 'precision' => '6', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => true, + ), + 'date_format_lite' => + array ( + 'dbtype' => 'char', + 'precision' => '32', + 'phptype' => 'string', + 'null' => true, + 'default' => 'Y-m-d', + ), + 'date_format_full' => + array ( + 'dbtype' => 'char', + 'precision' => '32', + 'phptype' => 'string', + 'null' => true, + 'default' => 'Y-m-d H:i:s', + ), + 'is_rtl' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'flag' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + ), + ), + 'indexes' => + array ( + 'lang_code' => + array ( + 'alias' => 'lang_code', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'lang_code' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + ), + 'composites' => + array ( + 'SiteContent' => + array ( + 'class' => 'LinguaSiteContent', + 'local' => 'id', + 'foreign' => 'lang_id', + 'cardinality' => 'many', + 'owner' => 'local', + ), + 'TmplvarContentvalues' => + array ( + 'class' => 'LinguaSiteTmplvarContentvalues', + 'local' => 'id', + 'foreign' => 'lang_id', + 'cardinality' => 'many', + 'owner' => 'local', + ), + ), + ); + +} diff --git a/core/components/lingua/src/Model/mysql/LinguaResourceScopes.php b/core/components/lingua/src/Model/mysql/LinguaResourceScopes.php new file mode 100644 index 0000000..2cb74b4 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaResourceScopes.php @@ -0,0 +1,72 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_resource_scopes', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'resource_id' => NULL, + 'properties' => NULL, + 'as_parent' => 0, + 'as_ancestor' => 0, + 'exclude_self' => 0, + ), + 'fieldMeta' => + array ( + 'resource_id' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + ), + 'properties' => + array ( + 'dbtype' => 'text', + 'phptype' => 'string', + 'null' => false, + ), + 'as_parent' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'as_ancestor' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'exclude_self' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + ), + ); + +} diff --git a/core/components/lingua/src/Model/mysql/LinguaSiteContent.php b/core/components/lingua/src/Model/mysql/LinguaSiteContent.php new file mode 100644 index 0000000..eda9ff6 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaSiteContent.php @@ -0,0 +1,354 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_site_content', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'resource_id' => 0, + 'lang_id' => 0, + 'pagetitle' => '', + 'longtitle' => '', + 'description' => '', + 'alias' => '', + 'link_attributes' => '', + 'parent' => 0, + 'isfolder' => 0, + 'introtext' => NULL, + 'content' => NULL, + 'menutitle' => '', + 'context_key' => 'web', + 'content_type' => 1, + 'uri' => NULL, + 'uri_override' => 0, + 'properties' => NULL, + ), + 'fieldMeta' => + array ( + 'resource_id' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'lang_id' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + ), + 'pagetitle' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + 'index' => 'index', + ), + 'longtitle' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'description' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'alias' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + 'default' => '', + 'index' => 'index', + ), + 'link_attributes' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'parent' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'isfolder' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'introtext' => + array ( + 'dbtype' => 'text', + 'phptype' => 'string', + 'null' => true, + ), + 'content' => + array ( + 'dbtype' => 'mediumtext', + 'phptype' => 'string', + 'null' => true, + ), + 'menutitle' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => false, + 'default' => '', + ), + 'context_key' => + array ( + 'dbtype' => 'varchar', + 'precision' => '100', + 'phptype' => 'string', + 'null' => false, + 'default' => 'web', + 'index' => 'index', + ), + 'content_type' => + array ( + 'dbtype' => 'int', + 'precision' => '11', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 1, + ), + 'uri' => + array ( + 'dbtype' => 'text', + 'phptype' => 'string', + 'null' => true, + 'index' => 'index', + ), + 'uri_override' => + array ( + 'dbtype' => 'tinyint', + 'precision' => '1', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'properties' => + array ( + 'dbtype' => 'mediumtext', + 'phptype' => 'string', + 'null' => true, + ), + ), + 'indexes' => + array ( + 'alias' => + array ( + 'alias' => 'alias', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'alias' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => true, + ), + ), + ), + 'uri' => + array ( + 'alias' => 'uri', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'uri' => + array ( + 'length' => '333', + 'collation' => 'A', + 'null' => true, + ), + ), + ), + 'uri_override' => + array ( + 'alias' => 'uri_override', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'uri_override' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'cache_refresh_idx' => + array ( + 'alias' => 'cache_refresh_idx', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'id' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + 'parent' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'parent' => + array ( + 'alias' => 'parent', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'parent' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'context_key' => + array ( + 'alias' => 'context_key', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'context_key' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'isfolder' => + array ( + 'alias' => 'isfolder', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'isfolder' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'content_ft_idx' => + array ( + 'alias' => 'content_ft_idx', + 'primary' => false, + 'unique' => false, + 'type' => 'FULLTEXT', + 'columns' => + array ( + 'pagetitle' => + array ( + 'length' => '', + 'collation' => '', + 'null' => false, + ), + 'longtitle' => + array ( + 'length' => '', + 'collation' => '', + 'null' => false, + ), + 'description' => + array ( + 'length' => '', + 'collation' => '', + 'null' => false, + ), + 'introtext' => + array ( + 'length' => '', + 'collation' => '', + 'null' => true, + ), + 'content' => + array ( + 'length' => '', + 'collation' => '', + 'null' => true, + ), + ), + ), + ), + 'aggregates' => + array ( + 'Lang' => + array ( + 'class' => 'LinguaLangs', + 'local' => 'lang_id', + 'foreign' => 'id', + 'cardinality' => 'one', + 'owner' => 'foreign', + ), + ), + ); + +} diff --git a/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarContentvalues.php b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarContentvalues.php new file mode 100644 index 0000000..0b90433 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarContentvalues.php @@ -0,0 +1,161 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_site_tmplvar_contentvalues', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'lang_id' => 0, + 'tmplvarid' => 0, + 'contentid' => 0, + 'value' => NULL, + ), + 'fieldMeta' => + array ( + 'lang_id' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'tmplvarid' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'contentid' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + 'value' => + array ( + 'dbtype' => 'mediumtext', + 'phptype' => 'string', + 'null' => false, + ), + ), + 'indexes' => + array ( + 'tmplvarid' => + array ( + 'alias' => 'tmplvarid', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'tmplvarid' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'contentid' => + array ( + 'alias' => 'contentid', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'contentid' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'tv_cnt' => + array ( + 'alias' => 'tv_cnt', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'tmplvarid' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + 'contentid' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + 'lang_id' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + 'lang_id' => + array ( + 'alias' => 'lang_id', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'lang_id' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + ), + 'aggregates' => + array ( + 'Tmplvars' => + array ( + 'class' => 'LinguaSiteTmplvars', + 'local' => 'tmplvarid', + 'foreign' => 'tmplvarid', + 'cardinality' => 'one', + 'owner' => 'foreign', + ), + 'Lang' => + array ( + 'class' => 'LinguaLangs', + 'local' => 'lang_id', + 'foreign' => 'id', + 'cardinality' => 'one', + 'owner' => 'foreign', + ), + ), + ); + +} diff --git a/core/components/lingua/src/Model/mysql/LinguaSiteTmplvars.php b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvars.php new file mode 100644 index 0000000..2cb52e7 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvars.php @@ -0,0 +1,67 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_site_tmplvars', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'tmplvarid' => 0, + ), + 'fieldMeta' => + array ( + 'tmplvarid' => + array ( + 'dbtype' => 'int', + 'precision' => '10', + 'attributes' => 'unsigned', + 'phptype' => 'integer', + 'null' => false, + 'default' => 0, + 'index' => 'index', + ), + ), + 'indexes' => + array ( + 'tmplvarid' => + array ( + 'alias' => 'tmplvarid', + 'primary' => false, + 'unique' => false, + 'type' => 'BTREE', + 'columns' => + array ( + 'tmplvarid' => + array ( + 'length' => '', + 'collation' => 'A', + 'null' => false, + ), + ), + ), + ), + 'composites' => + array ( + 'TmplvarContentvalues' => + array ( + 'class' => 'LinguaSiteTmplvarContentvalues', + 'local' => 'tmplvarid', + 'foreign' => 'tmplvarid', + 'cardinality' => 'many', + 'owner' => 'local', + ), + ), + ); + +} diff --git a/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarsPatterns.php b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarsPatterns.php new file mode 100644 index 0000000..5d75cd8 --- /dev/null +++ b/core/components/lingua/src/Model/mysql/LinguaSiteTmplvarsPatterns.php @@ -0,0 +1,50 @@ + 'Lingua\\Model', + 'version' => '1.1', + 'table' => 'lingua_site_tmplvars_patterns', + 'extends' => 'xPDO\\Om\\xPDOSimpleObject', + 'tableMeta' => + array ( + 'engine' => 'MyISAM', + ), + 'fields' => + array ( + 'type' => NULL, + 'search' => NULL, + 'replacement' => NULL, + ), + 'fieldMeta' => + array ( + 'type' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + ), + 'search' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + ), + 'replacement' => + array ( + 'dbtype' => 'varchar', + 'precision' => '255', + 'phptype' => 'string', + 'null' => true, + ), + ), + ); + +} diff --git a/core/components/lingua/processors/mgr/contexts/getlist.class.php b/core/components/lingua/src/Processors/Contexts/GetList.php similarity index 88% rename from core/components/lingua/processors/mgr/contexts/getlist.class.php rename to core/components/lingua/src/Processors/Contexts/GetList.php index e6d5401..49a1c68 100644 --- a/core/components/lingua/processors/mgr/contexts/getlist.class.php +++ b/core/components/lingua/src/Processors/Contexts/GetList.php @@ -22,9 +22,17 @@ * @package lingua * @subpackage lingua_processor */ -class ContextsGetListProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\Contexts; - public $classKey = 'modContext'; +use Lingua\Model\LinguaSiteTmplvars; +use MODX\Revolution\modContext; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends GetListProcessor { + + public $classKey = modContext::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'key'; public $defaultSortDirection = 'ASC'; @@ -70,5 +78,3 @@ public function outputArray(array $array,$count = false) { } } - -return 'ContextsGetListProcessor'; diff --git a/core/components/lingua/processors/mgr/langs/create.class.php b/core/components/lingua/src/Processors/Langs/Create.php similarity index 90% rename from core/components/lingua/processors/mgr/langs/create.class.php rename to core/components/lingua/src/Processors/Langs/Create.php index d840a8e..d92a178 100644 --- a/core/components/lingua/processors/mgr/langs/create.class.php +++ b/core/components/lingua/src/Processors/Langs/Create.php @@ -22,9 +22,15 @@ * @package lingua * @subpackage lingua_processor */ -class LangsCreateProcessor extends modObjectCreateProcessor { - public $classKey = 'linguaLangs'; +namespace Lingua\Processors\Langs; + +use MODX\Revolution\Processors\Model\CreateProcessor; +use Lingua\Model\LinguaLangs; + +class Create extends CreateProcessor { + + public $classKey = LinguaLangs::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.LangsCreate'; @@ -44,7 +50,4 @@ public function beforeSave() { } return parent::beforeSave(); } - } - -return 'LangsCreateProcessor'; diff --git a/core/components/lingua/processors/mgr/langs/getlist.class.php b/core/components/lingua/src/Processors/Langs/GetList.php similarity index 85% rename from core/components/lingua/processors/mgr/langs/getlist.class.php rename to core/components/lingua/src/Processors/Langs/GetList.php index e773a0c..aef65db 100644 --- a/core/components/lingua/processors/mgr/langs/getlist.class.php +++ b/core/components/lingua/src/Processors/Langs/GetList.php @@ -23,9 +23,16 @@ * @subpackage lingua_processor */ -class LangsGetListProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\Langs; - public $classKey = 'linguaLangs'; +use Lingua\Model\LinguaLangs; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends GetListProcessor { + + public $classKey = LinguaLangs::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; @@ -45,5 +52,3 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { } } - -return 'LangsGetListProcessor'; \ No newline at end of file diff --git a/core/components/lingua/processors/mgr/langs/remove.class.php b/core/components/lingua/src/Processors/Langs/Remove.php similarity index 82% rename from core/components/lingua/processors/mgr/langs/remove.class.php rename to core/components/lingua/src/Processors/Langs/Remove.php index 43c78ef..cc1c67e 100644 --- a/core/components/lingua/processors/mgr/langs/remove.class.php +++ b/core/components/lingua/src/Processors/Langs/Remove.php @@ -22,12 +22,16 @@ * @package lingua * @subpackage lingua_processor */ -class LinguaRemoveProcessor extends modObjectRemoveProcessor { - public $classKey = 'linguaLangs'; +namespace Lingua\Processors\Langs; + +use Lingua\Model\LinguaLangs; +use MODX\Revolution\Processors\Model\RemoveProcessor; + +class Remove extends RemoveProcessor { + + public $classKey = LinguaLangs::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.LinguaRemove'; } - -return 'LinguaRemoveProcessor'; diff --git a/core/components/lingua/processors/mgr/langs/update.class.php b/core/components/lingua/src/Processors/Langs/Update.php similarity index 82% rename from core/components/lingua/processors/mgr/langs/update.class.php rename to core/components/lingua/src/Processors/Langs/Update.php index 4bcaddc..c8cb630 100644 --- a/core/components/lingua/processors/mgr/langs/update.class.php +++ b/core/components/lingua/src/Processors/Langs/Update.php @@ -22,12 +22,16 @@ * @package lingua * @subpackage lingua_processor */ -class LangsUpdateProcessor extends modObjectUpdateProcessor { - public $classKey = 'linguaLangs'; +namespace Lingua\Processors\Langs; + +use Lingua\Model\LinguaLangs; +use MODX\Revolution\Processors\Model\UpdateProcessor; + +class Update extends UpdateProcessor { + + public $classKey = LinguaLangs::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.LangsUpdate'; } - -return 'LangsUpdateProcessor'; diff --git a/core/components/lingua/processors/mgr/langs/updatefromgrid.class.php b/core/components/lingua/src/Processors/Langs/UpdateFromGrid.php similarity index 88% rename from core/components/lingua/processors/mgr/langs/updatefromgrid.class.php rename to core/components/lingua/src/Processors/Langs/UpdateFromGrid.php index fa9dbd2..8651ce3 100644 --- a/core/components/lingua/processors/mgr/langs/updatefromgrid.class.php +++ b/core/components/lingua/src/Processors/Langs/UpdateFromGrid.php @@ -22,9 +22,12 @@ * @package lingua * @subpackage lingua_processor */ -require_once (dirname(__FILE__) . '/update.class.php'); -class LangsUpdateFromGridProcessor extends LangsUpdateProcessor { +namespace Lingua\Processors\Langs; + +use Lingua\Processors\Langs\Update; + +class UpdateFromGrid extends Update { public function initialize() { $data = $this->getProperty('data'); @@ -40,5 +43,3 @@ public function initialize() { } } - -return 'LangsUpdateFromGridProcessor'; diff --git a/core/components/lingua/processors/mgr/resource/getlist.class.php b/core/components/lingua/src/Processors/Resource/GetList.php similarity index 86% rename from core/components/lingua/processors/mgr/resource/getlist.class.php rename to core/components/lingua/src/Processors/Resource/GetList.php index 2f583d1..9dbf463 100644 --- a/core/components/lingua/processors/mgr/resource/getlist.class.php +++ b/core/components/lingua/src/Processors/Resource/GetList.php @@ -22,9 +22,13 @@ * @package lingua * @subpackage lingua_processor */ -include_once MODX_CORE_PATH . 'model/modx/processors/resource/getlist.class.php'; +namespace Lingua\Processors\Resource; -class LinguaResourceGetListProcessor extends modResourceGetListProcessor { +use MODX\Revolution\Processors\Resource\GetList as ResourceGetList; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends ResourceGetList { public function prepareQueryBeforeCount(xPDOQuery $c) { $query = $this->getProperty('query'); @@ -48,6 +52,10 @@ public function beforeIteration(array $list) { return $list; } + public function prepareQueryAfterCount(xPDOQuery $c) { + return $c; + } + public function prepareRow(xPDOObject $object) { $objectArray = parent::prepareRow($object); if ($this->getProperty('combo', false)) { @@ -59,7 +67,4 @@ public function prepareRow(xPDOObject $object) { return $objectArray; } - } - -return 'LinguaResourceGetListProcessor'; diff --git a/core/components/lingua/processors/mgr/resourcescopes/create.class.php b/core/components/lingua/src/Processors/ResourceScopes/Create.php similarity index 87% rename from core/components/lingua/processors/mgr/resourcescopes/create.class.php rename to core/components/lingua/src/Processors/ResourceScopes/Create.php index 421ef08..4112edd 100644 --- a/core/components/lingua/processors/mgr/resourcescopes/create.class.php +++ b/core/components/lingua/src/Processors/ResourceScopes/Create.php @@ -22,9 +22,15 @@ * @package lingua * @subpackage lingua_processor */ -class ResourceScopesCreateProcessor extends modObjectCreateProcessor { - public $classKey = 'linguaResourceScopes'; +namespace Lingua\Processors\ResourceScopes; + +use MODX\Revolution\Processors\Model\CreateProcessor; +use Lingua\Model\LinguaResourceScopes; + +class Create extends CreateProcessor { + + public $classKey = LinguaResourceScopes::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.ResourceScopesCreate'; @@ -49,5 +55,3 @@ public function initialize() { } } - -return 'ResourceScopesCreateProcessor'; diff --git a/core/components/lingua/processors/mgr/resourcescopes/getlist.class.php b/core/components/lingua/src/Processors/ResourceScopes/GetList.php similarity index 80% rename from core/components/lingua/processors/mgr/resourcescopes/getlist.class.php rename to core/components/lingua/src/Processors/ResourceScopes/GetList.php index d08fa18..00babff 100644 --- a/core/components/lingua/processors/mgr/resourcescopes/getlist.class.php +++ b/core/components/lingua/src/Processors/ResourceScopes/GetList.php @@ -22,18 +22,27 @@ * @package lingua * @subpackage lingua_processor */ -class ResourceScopesGetListProcessor extends modObjectGetListProcessor { - public $classKey = 'linguaResourceScopes'; +namespace Lingua\Processors\ResourceScopes; + +use Lingua\Model\LinguaResourceScopes; +use MODX\Revolution\modResource; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends GetListProcessor { + + public $classKey = LinguaResourceScopes::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; public $objectType = 'lingua.ResourceScopesGetList'; public function prepareQueryBeforeCount(xPDOQuery $c) { - $c->leftJoin('modResource', 'Resource', 'Resource.id = linguaResourceScopes.resource_id'); + $c->leftJoin(modResource::class, 'Resource', 'Resource.id = LinguaResourceScopes.resource_id'); $c->select(array( - 'linguaResourceScopes.*', + 'LinguaResourceScopes.*', 'pagetitle' => 'Resource.pagetitle' )); $query = $this->getProperty('query'); @@ -60,5 +69,3 @@ public function prepareRow(xPDOObject $object) { } } - -return 'ResourceScopesGetListProcessor'; diff --git a/core/components/lingua/processors/mgr/resourcescopes/remove.class.php b/core/components/lingua/src/Processors/ResourceScopes/Remove.php similarity index 80% rename from core/components/lingua/processors/mgr/resourcescopes/remove.class.php rename to core/components/lingua/src/Processors/ResourceScopes/Remove.php index 519cdb6..3b2327d 100644 --- a/core/components/lingua/processors/mgr/resourcescopes/remove.class.php +++ b/core/components/lingua/src/Processors/ResourceScopes/Remove.php @@ -22,12 +22,16 @@ * @package lingua * @subpackage lingua_processor */ -class ResourceScopesRemoveProcessor extends modObjectRemoveProcessor { - public $classKey = 'linguaResourceScopes'; +namespace Lingua\Processors\ResourceScopes; + +use Lingua\Model\LinguaResourceScopes; +use MODX\Revolution\Processors\Model\RemoveProcessor; + +class Remove extends RemoveProcessor { + + public $classKey = LinguaResourceScopes::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.ResourceScopesRemove'; } - -return 'ResourceScopesRemoveProcessor'; diff --git a/core/components/lingua/processors/mgr/resourcescopes/update.class.php b/core/components/lingua/src/Processors/ResourceScopes/Update.php similarity index 86% rename from core/components/lingua/processors/mgr/resourcescopes/update.class.php rename to core/components/lingua/src/Processors/ResourceScopes/Update.php index 8a9c120..e09d60a 100644 --- a/core/components/lingua/processors/mgr/resourcescopes/update.class.php +++ b/core/components/lingua/src/Processors/ResourceScopes/Update.php @@ -22,9 +22,15 @@ * @package lingua * @subpackage lingua_processor */ -class ResourceScopesUpdateProcessor extends modObjectUpdateProcessor { - public $classKey = 'linguaResourceScopes'; +namespace Lingua\Processors\ResourceScopes; + +use Lingua\Model\LinguaResourceScopes; +use MODX\Revolution\Processors\Model\UpdateProcessor; + +class Update extends UpdateProcessor { + + public $classKey = LinguaResourceScopes::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.ResourceScopesUpdate'; @@ -43,5 +49,3 @@ public function initialize() { } } - -return 'ResourceScopesUpdateProcessor'; diff --git a/core/components/lingua/processors/mgr/tvpatterns/updatefromgrid.class.php b/core/components/lingua/src/Processors/ResourceScopes/UpdateFromGrid.php similarity index 88% rename from core/components/lingua/processors/mgr/tvpatterns/updatefromgrid.class.php rename to core/components/lingua/src/Processors/ResourceScopes/UpdateFromGrid.php index 8618cd1..38169a5 100644 --- a/core/components/lingua/processors/mgr/tvpatterns/updatefromgrid.class.php +++ b/core/components/lingua/src/Processors/ResourceScopes/UpdateFromGrid.php @@ -22,9 +22,12 @@ * @package lingua * @subpackage lingua_processor */ -require_once (dirname(__FILE__) . '/update.class.php'); -class TVPatternUpdateFromGridProcessor extends TVPatternUpdateProcessor { +namespace Lingua\Processors\ResourceScopes; + +use Lingua\Processors\ResourceScopes\Update; + +class UpdateFromGrid extends Update { public function initialize() { $data = $this->getProperty('data'); @@ -40,5 +43,3 @@ public function initialize() { } } - -return 'TVPatternUpdateFromGridProcessor'; diff --git a/core/components/lingua/processors/mgr/tools/autosync.class.php b/core/components/lingua/src/Processors/Tools/AutoSync.php similarity index 79% rename from core/components/lingua/processors/mgr/tools/autosync.class.php rename to core/components/lingua/src/Processors/Tools/AutoSync.php index 909c856..6e65d16 100644 --- a/core/components/lingua/processors/mgr/tools/autosync.class.php +++ b/core/components/lingua/src/Processors/Tools/AutoSync.php @@ -22,21 +22,17 @@ * @package lingua * @subpackage lingua_processor */ -// Apache's timeout: 600 secs -if (function_exists('ini_get') && !ini_get('safe_mode')) { - if (function_exists('set_time_limit')) { - set_time_limit(600); - } - if (function_exists('ini_set')) { - if (ini_get('max_execution_time') !== 600) { - ini_set('max_execution_time', 600); - } - } -} -class ToolAutoSyncProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\Tools; + +use MODX\Revolution\modResource; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; - public $classKey = 'modResource'; +class AutoSync extends GetListProcessor { + + public $classKey = modResource::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; @@ -47,6 +43,18 @@ class ToolAutoSyncProcessor extends modObjectGetListProcessor { * @return boolean */ public function initialize() { + // Apache's timeout: 600 secs + if (function_exists('ini_get') && !ini_get('safe_mode')) { + if (function_exists('set_time_limit')) { + set_time_limit(600); + } + if (function_exists('ini_set')) { + if (ini_get('max_execution_time') !== 600) { + ini_set('max_execution_time', 600); + } + } + } + $props = $this->getProperties(); if (empty($props['contexts'])) { return $this->modx->lexicon($this->objectType . '_err_ns'); @@ -74,7 +82,8 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { * @return array */ public function prepareRow(xPDOObject $object) { - $this->modx->lingua->synchronize($object); + $Lingua = $this->modx->services->get('Lingua'); + $Lingua->synchronize($object); return $object->toArray(); } @@ -107,5 +116,3 @@ public function outputArray(array $array, $count = false) { } } - -return 'ToolAutoSyncProcessor'; diff --git a/core/components/lingua/processors/mgr/tools/manualsync.class.php b/core/components/lingua/src/Processors/Tools/ManualSync.php similarity index 79% rename from core/components/lingua/processors/mgr/tools/manualsync.class.php rename to core/components/lingua/src/Processors/Tools/ManualSync.php index 81e09c5..d379b38 100644 --- a/core/components/lingua/processors/mgr/tools/manualsync.class.php +++ b/core/components/lingua/src/Processors/Tools/ManualSync.php @@ -22,21 +22,17 @@ * @package lingua * @subpackage lingua_processor */ -// Apache's timeout: 600 secs -if (function_exists('ini_get') && !ini_get('safe_mode')) { - if (function_exists('set_time_limit')) { - set_time_limit(600); - } - if (function_exists('ini_set')) { - if (ini_get('max_execution_time') !== 600) { - ini_set('max_execution_time', 600); - } - } -} -class ToolManualSyncProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\Tools; - public $classKey = 'modResource'; +use MODX\Revolution\modResource; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class ManualSync extends GetListProcessor { + + public $classKey = modResource::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; @@ -47,6 +43,18 @@ class ToolManualSyncProcessor extends modObjectGetListProcessor { * @return boolean */ public function initialize() { + // Apache's timeout: 600 secs + if (function_exists('ini_get') && !ini_get('safe_mode')) { + if (function_exists('set_time_limit')) { + set_time_limit(600); + } + if (function_exists('ini_set')) { + if (ini_get('max_execution_time') !== 600) { + ini_set('max_execution_time', 600); + } + } + } + $props = $this->getProperties(); if (empty($props['ids'])) { return $this->modx->lexicon($this->objectType . '_err_ns'); @@ -74,7 +82,8 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { * @return array */ public function prepareRow(xPDOObject $object) { - $this->modx->lingua->synchronize($object); + $Lingua = $this->modx->services->get('Lingua'); + $Lingua->synchronize($object); return $object->toArray(); } diff --git a/core/components/lingua/processors/mgr/tv/combogetlist.class.php b/core/components/lingua/src/Processors/Tv/ComboGetList.php similarity index 80% rename from core/components/lingua/processors/mgr/tv/combogetlist.class.php rename to core/components/lingua/src/Processors/Tv/ComboGetList.php index a15d220..0540f09 100644 --- a/core/components/lingua/processors/mgr/tv/combogetlist.class.php +++ b/core/components/lingua/src/Processors/Tv/ComboGetList.php @@ -22,12 +22,18 @@ * @package lingua * @subpackage lingua_processor */ -include_once MODX_CORE_PATH . 'model/modx/processors/element/tv/getlist.class.php'; +namespace Lingua\Processors\Tv; -class TVComboGetListProcessor extends modTemplateVarGetListProcessor { +use Lingua\Model\LinguaSiteTmplvars; +use MODX\Revolution\modCategory; +use MODX\Revolution\Processors\Element\TemplateVar\GetList; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class ComboGetList extends GetList { public function prepareQueryBeforeCount(xPDOQuery $c) { - $c->leftJoin('modCategory', 'Category'); + $c->leftJoin(modCategory::class, 'Category'); $query = $this->getProperty('query'); if (!empty($query)) { $c->where(array( @@ -36,7 +42,7 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { } $excludeExisting = $this->getProperty('excludeExisting'); if ($excludeExisting) { - $tvs = $this->modx->getCollection('linguaSiteTmplvars'); + $tvs = $this->modx->getCollection(LinguaSiteTmplvars::class); if ($tvs) { $ids = array(); foreach ($tvs as $tv) { @@ -51,5 +57,3 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { } } - -return 'TVComboGetListProcessor'; diff --git a/core/components/lingua/processors/mgr/tv/create.class.php b/core/components/lingua/src/Processors/Tv/Create.php similarity index 81% rename from core/components/lingua/processors/mgr/tv/create.class.php rename to core/components/lingua/src/Processors/Tv/Create.php index 2b7de7e..fc5b875 100644 --- a/core/components/lingua/processors/mgr/tv/create.class.php +++ b/core/components/lingua/src/Processors/Tv/Create.php @@ -22,12 +22,16 @@ * @package lingua * @subpackage lingua_processor */ -class TVCreateProcessor extends modObjectCreateProcessor { - public $classKey = 'linguaSiteTmplvars'; +namespace Lingua\Processors\Tv; + +use MODX\Revolution\Processors\Model\CreateProcessor; +use Lingua\Model\LinguaSiteTmplvars; + +class Create extends CreateProcessor { + + public $classKey = LinguaSiteTmplvars::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.TVCreate'; } - -return 'TVCreateProcessor'; diff --git a/core/components/lingua/processors/mgr/tv/getlist.class.php b/core/components/lingua/src/Processors/Tv/GetList.php similarity index 76% rename from core/components/lingua/processors/mgr/tv/getlist.class.php rename to core/components/lingua/src/Processors/Tv/GetList.php index f86c6cf..acf5424 100644 --- a/core/components/lingua/processors/mgr/tv/getlist.class.php +++ b/core/components/lingua/src/Processors/Tv/GetList.php @@ -23,18 +23,26 @@ * @subpackage lingua_processor */ -class TVGetListProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\Tv; - public $classKey = 'linguaSiteTmplvars'; +use Lingua\Model\LinguaSiteTmplvars; +use MODX\Revolution\modTemplateVar; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends GetListProcessor { + + public $classKey = LinguaSiteTmplvars::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; public $objectType = 'lingua.TVGetList'; public function prepareQueryBeforeCount(xPDOQuery $c) { - $c->leftJoin('modTemplateVar', 'TemplateVar', 'TemplateVar.id = linguaSiteTmplvars.tmplvarid'); + $c->leftJoin(modTemplateVar::class, 'TemplateVar', 'TemplateVar.id = LinguaSiteTmplvars.tmplvarid'); $c->select(array( - 'linguaSiteTmplvars.id', + 'LinguaSiteTmplvars.id', 'TemplateVar.name', 'TemplateVar.type', )); @@ -48,5 +56,3 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { } } - -return 'TVGetListProcessor'; \ No newline at end of file diff --git a/core/components/lingua/processors/mgr/tv/remove.class.php b/core/components/lingua/src/Processors/Tv/Remove.php similarity index 81% rename from core/components/lingua/processors/mgr/tv/remove.class.php rename to core/components/lingua/src/Processors/Tv/Remove.php index 0cbe84d..8a75958 100644 --- a/core/components/lingua/processors/mgr/tv/remove.class.php +++ b/core/components/lingua/src/Processors/Tv/Remove.php @@ -22,12 +22,16 @@ * @package lingua * @subpackage lingua_processor */ -class TVRemoveProcessor extends modObjectRemoveProcessor { - public $classKey = 'linguaSiteTmplvars'; +namespace Lingua\Processors\Tv; + +use Lingua\Model\LinguaSiteTmplvars; +use MODX\Revolution\Processors\Model\RemoveProcessor; + +class Remove extends RemoveProcessor { + + public $classKey = LinguaSiteTmplvars::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.TVRemove'; } - -return 'TVRemoveProcessor'; diff --git a/core/components/lingua/processors/mgr/tvpatterns/create.class.php b/core/components/lingua/src/Processors/TvPatterns/Create.php similarity index 86% rename from core/components/lingua/processors/mgr/tvpatterns/create.class.php rename to core/components/lingua/src/Processors/TvPatterns/Create.php index f10352c..871e31a 100644 --- a/core/components/lingua/processors/mgr/tvpatterns/create.class.php +++ b/core/components/lingua/src/Processors/TvPatterns/Create.php @@ -22,9 +22,15 @@ * @package lingua * @subpackage lingua_processor */ -class TVPatternCreateProcessor extends modObjectCreateProcessor { - public $classKey = 'linguaSiteTmplvarsPatterns'; +namespace Lingua\Processors\TvPatterns; + +use MODX\Revolution\Processors\Model\CreateProcessor; +use Lingua\Model\LinguaSiteTmplvarsPatterns; + +class Create extends CreateProcessor { + + public $classKey = LinguaSiteTmplvarsPatterns::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.TVPatternCreate'; @@ -46,5 +52,3 @@ public function initialize() { } } - -return 'TVPatternCreateProcessor'; diff --git a/core/components/lingua/processors/mgr/tvpatterns/getlist.class.php b/core/components/lingua/src/Processors/TvPatterns/GetList.php similarity index 76% rename from core/components/lingua/processors/mgr/tvpatterns/getlist.class.php rename to core/components/lingua/src/Processors/TvPatterns/GetList.php index 247c374..dbd6a7a 100644 --- a/core/components/lingua/processors/mgr/tvpatterns/getlist.class.php +++ b/core/components/lingua/src/Processors/TvPatterns/GetList.php @@ -23,9 +23,16 @@ * @subpackage lingua_processor */ -class TVPattersGetListProcessor extends modObjectGetListProcessor { +namespace Lingua\Processors\TvPatterns; - public $classKey = 'linguaSiteTmplvarsPatterns'; +use Lingua\Model\LinguaSiteTmplvarsPatterns; +use MODX\Revolution\Processors\Model\GetListProcessor; +use xPDO\Om\xPDOQuery; +use xPDO\Om\xPDOObject; + +class GetList extends GetListProcessor { + + public $classKey = LinguaSiteTmplvarsPatterns::class; public $languageTopics = array('lingua:cmp'); public $defaultSortField = 'id'; public $defaultSortDirection = 'ASC'; @@ -51,21 +58,22 @@ public function getData() { $data = array(); $limit = intval($this->getProperty('limit')); $start = intval($this->getProperty('start')); + $sortKey = $this->getProperty('sort'); /* query for chunks */ $c = $this->modx->newQuery($this->classKey); $c = $this->prepareQueryBeforeCount($c); $data['total'] = $this->modx->getCount($this->classKey,$c); $c = $this->prepareQueryAfterCount($c); - - $sortClassKey = $this->getSortClassKey(); - $sortKey = $this->modx->getSelectColumns($sortClassKey,$this->getProperty('sortAlias',$sortClassKey),'',array($this->getProperty('sort'))); - if (empty($sortKey)) $sortKey = $this->getProperty('sort'); /* make more convenient sorting */ - $c->sortby('type',$this->getProperty('dir')); - $c->sortby('search',$this->getProperty('dir')); - $c->sortby($sortKey,$this->getProperty('dir')); + if (!empty($sortKey) && $sortKey != 'id') { + $c->sortby('type',$this->getProperty('dir')); + $c->sortby('search',$this->getProperty('dir')); + $c->sortby($sortKey,$this->getProperty('dir')); + } else { + $c->sortby('id',$this->getProperty('dir')); + } if ($limit > 0) { $c->limit($limit,$start); @@ -76,5 +84,3 @@ public function getData() { } } - -return 'TVPattersGetListProcessor'; \ No newline at end of file diff --git a/core/components/lingua/src/Processors/TvPatterns/Remove.php b/core/components/lingua/src/Processors/TvPatterns/Remove.php new file mode 100644 index 0000000..741aadb --- /dev/null +++ b/core/components/lingua/src/Processors/TvPatterns/Remove.php @@ -0,0 +1,37 @@ + + * + * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface + * + * Lingua is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation version 3. + * + * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * @package lingua + * @subpackage lingua_processor + */ + +namespace Lingua\Processors\TvPatterns; + +use Lingua\Model\LinguaSiteTmplvarsPatterns; +use MODX\Revolution\Processors\Model\RemoveProcessor; + +class Remove extends RemoveProcessor { + + public $classKey = LinguaSiteTmplvarsPatterns::class; + public $languageTopics = array('lingua:cmp'); + public $objectType = 'lingua.LinguaRemove'; + +} diff --git a/core/components/lingua/processors/mgr/tvpatterns/update.class.php b/core/components/lingua/src/Processors/TvPatterns/Update.php similarity index 89% rename from core/components/lingua/processors/mgr/tvpatterns/update.class.php rename to core/components/lingua/src/Processors/TvPatterns/Update.php index 6a10b81..6616905 100644 --- a/core/components/lingua/processors/mgr/tvpatterns/update.class.php +++ b/core/components/lingua/src/Processors/TvPatterns/Update.php @@ -22,9 +22,15 @@ * @package lingua * @subpackage lingua_processor */ -class TVPatternUpdateProcessor extends modObjectUpdateProcessor { - public $classKey = 'linguaSiteTmplvarsPatterns'; +namespace Lingua\Processors\TvPatterns; + +use Lingua\Model\LinguaSiteTmplvarsPatterns; +use MODX\Revolution\Processors\Model\UpdateProcessor; + +class Update extends UpdateProcessor { + + public $classKey = LinguaSiteTmplvarsPatterns::class; public $languageTopics = array('lingua:cmp'); public $objectType = 'lingua.TVPatternUpdate'; @@ -50,5 +56,3 @@ public function initialize() { } } - -return 'TVPatternUpdateProcessor'; diff --git a/core/components/lingua/processors/mgr/resourcescopes/updatefromgrid.class.php b/core/components/lingua/src/Processors/TvPatterns/UpdateFromGrid.php similarity index 87% rename from core/components/lingua/processors/mgr/resourcescopes/updatefromgrid.class.php rename to core/components/lingua/src/Processors/TvPatterns/UpdateFromGrid.php index 2f6460b..2029b42 100644 --- a/core/components/lingua/processors/mgr/resourcescopes/updatefromgrid.class.php +++ b/core/components/lingua/src/Processors/TvPatterns/UpdateFromGrid.php @@ -22,9 +22,12 @@ * @package lingua * @subpackage lingua_processor */ -require_once (dirname(__FILE__) . '/update.class.php'); -class ResourceScopesUpdateFromGridProcessor extends ResourceScopesUpdateProcessor { +namespace Lingua\Processors\TvPatterns; + +use Lingua\Processors\TvPatterns\Update; + +class UpdateFromGrid extends Update { public function initialize() { $data = $this->getProperty('data'); @@ -40,5 +43,3 @@ public function initialize() { } } - -return 'ResourceScopesUpdateFromGridProcessor'; diff --git a/core/components/lingua/templates/home.tpl b/core/components/lingua/templates/home.tpl index 9e3bf11..f4653fe 100644 --- a/core/components/lingua/templates/home.tpl +++ b/core/components/lingua/templates/home.tpl @@ -1 +1 @@ -
\ No newline at end of file +
From 2de122d4c8d859b0c538866cf3a33bd1cc2502eb Mon Sep 17 00:00:00 2001 From: Ilya Utkin Date: Tue, 25 Oct 2022 13:58:08 +0300 Subject: [PATCH 02/10] Restore LinguaRequest class --- .../lingua/elements/plugins/lingua.plugin.php | 8 +- .../snippets/lingua.getfield.snippet.php | 3 +- .../snippets/lingua.getvalue.snippet.php | 3 +- .../snippets/lingua.selector.snippet.php | 3 +- .../lingua/src/Model/LinguaRequest.php | 432 ++++++++++++++++++ 5 files changed, 439 insertions(+), 10 deletions(-) create mode 100644 core/components/lingua/src/Model/LinguaRequest.php diff --git a/core/components/lingua/elements/plugins/lingua.plugin.php b/core/components/lingua/elements/plugins/lingua.plugin.php index 8668053..e47764e 100644 --- a/core/components/lingua/elements/plugins/lingua.plugin.php +++ b/core/components/lingua/elements/plugins/lingua.plugin.php @@ -32,7 +32,7 @@ if ($modx->context->key === 'mgr') { return; } - $lingua = $modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/'); + $lingua = $modx->getService('lingua', 'Lingua'); if (!($lingua instanceof Lingua)) { return; } @@ -149,7 +149,7 @@ } } - $lingua = $modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/'); + $lingua = $modx->getService('lingua', 'Lingua'); if (!($lingua instanceof Lingua)) { return; } @@ -268,7 +268,7 @@ } } - $lingua = $modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/'); + $lingua = $modx->getService('lingua', 'Lingua'); if (!($lingua instanceof Lingua)) { return; } @@ -429,7 +429,7 @@ } } - $lingua = $modx->getService('lingua', 'Lingua', MODX_CORE_PATH . 'components/lingua/model/lingua/'); + $lingua = $modx->getService('lingua', 'Lingua'); if (!($lingua instanceof Lingua)) { return; } diff --git a/core/components/lingua/elements/snippets/lingua.getfield.snippet.php b/core/components/lingua/elements/snippets/lingua.getfield.snippet.php index a9a4367..4dcf092 100644 --- a/core/components/lingua/elements/snippets/lingua.getfield.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.getfield.snippet.php @@ -30,8 +30,7 @@ $langCodeField = $modx->getOption('codeField', $scriptProperties, $modx->getOption('lingua.code_field', null, 'lang_code')); $defaultLinguaCorePath = $modx->getOption('core_path') . 'components/lingua/'; -$linguaCorePath = $modx->getOption('lingua.core_path', null, $defaultLinguaCorePath); -$lingua = $modx->getService('lingua', 'Lingua', $linguaCorePath . 'model/lingua/', $scriptProperties); +$lingua = $modx->getService('lingua', 'Lingua', null, $scriptProperties); if (!($lingua instanceof Lingua)) { return; diff --git a/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php b/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php index fc774d0..09f5631 100644 --- a/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php @@ -32,8 +32,7 @@ $emptyReturnsDefault = $modx->getOption('emptyReturnsDefault', $scriptProperties, $modx->getOption('lingua.empty_returns_default', null, false)); $defaultLinguaCorePath = $modx->getOption('core_path') . 'components/lingua/'; -$linguaCorePath = $modx->getOption('lingua.core_path', null, $defaultLinguaCorePath); -$lingua = $modx->getService('lingua', 'Lingua', $linguaCorePath . 'model/lingua/', $scriptProperties); +$lingua = $modx->getService('lingua', 'Lingua', null, $scriptProperties); $debug = $modx->getOption('lingua.debug'); if (!($lingua instanceof Lingua)) { $modx->log(modX::LOG_LEVEL_ERROR, '[lingua.getValue]: !($lingua instanceof Lingua)'); diff --git a/core/components/lingua/elements/snippets/lingua.selector.snippet.php b/core/components/lingua/elements/snippets/lingua.selector.snippet.php index 27a28bf..f149bcd 100644 --- a/core/components/lingua/elements/snippets/lingua.selector.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.selector.snippet.php @@ -32,8 +32,7 @@ $codeField = $modx->getOption('codeField', $scriptProperties, 'lang_code'); $defaultLinguaCorePath = $modx->getOption('core_path') . 'components/lingua/'; -$linguaCorePath = $modx->getOption('lingua.core_path', null, $defaultLinguaCorePath); -$lingua = $modx->getService('lingua', 'Lingua', $linguaCorePath . 'model/lingua/', $scriptProperties); +$lingua = $modx->getService('lingua', 'Lingua', null, $scriptProperties); if (!($lingua instanceof Lingua)) { return; diff --git a/core/components/lingua/src/Model/LinguaRequest.php b/core/components/lingua/src/Model/LinguaRequest.php new file mode 100644 index 0000000..356e502 --- /dev/null +++ b/core/components/lingua/src/Model/LinguaRequest.php @@ -0,0 +1,432 @@ + + * + * This file is part of Lingua, a MODX's Lexicon switcher for front-end interface + * + * Lingua is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation version 3. + * + * Lingua is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * Lingua; if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * Encapsulates the interaction of MODX manager with an HTTP request. + * + * {@inheritdoc} + * + * @package lingua + * @subpackage linguarequest + */ + +class LinguaRequest extends modRequest +{ + /** + * + * @var object $lingua A reference to the Lingua object + */ + public $lingua; + + /** + * @param modX $modx A reference to the modX object + */ + function __construct(modX &$modx) { + parent::__construct($modx); + $this->lingua = $this->modx->getService('lingua', 'Lingua'); + } + + + /** + * The primary MODX request handler (a.k.a. controller). + * + * @return boolean True if a request is handled without interruption. + */ + public function handleRequest() { + $this->loadErrorHandler(); + + // If enabled, send the X-Powered-By header to identify this site as running MODX, per discussion in #12882 + if ($this->modx->getOption('send_poweredby_header', null, true)) { + $version = $this->modx->getVersionData(); + header("X-Powered-By: MODX {$version['code_name']}"); + } + + $this->sanitizeRequest(); + $this->modx->invokeEvent('OnHandleRequest'); + if (!$this->modx->checkSiteStatus()) { + header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable'); + if (!$this->modx->getOption('site_unavailable_page', null, 1)) { + $this->modx->resource = $this->modx->newObject(modDocument::class); + $this->modx->resource->template = 0; + $this->modx->resource->content = $this->modx->getOption('site_unavailable_message'); + } else { + $this->modx->resourceMethod = "id"; + $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page', null, 1); + } + } else { + $this->checkPublishStatus(); + $this->modx->resourceMethod = $this->getResourceMethod(); + $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod); + if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, + false) && $this->modx->getOption('request_method_strict', null, false)) { + $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier); + if (!empty($uri)) { + if ((integer)$this->modx->resourceIdentifier === (integer)$this->modx->getOption('site_start', null, + 1)) { + $url = $this->modx->getOption('site_url', null, MODX_SITE_URL); + } else { + $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri; + } + $this->modx->sendRedirect($url, + ['responseCode' => $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently']); + } + } + } + if (empty ($this->modx->resourceMethod)) { + $this->modx->resourceMethod = "id"; + } + if ($this->modx->resourceMethod == "alias") { + $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier); + } + if ($this->modx->resourceMethod == "alias") { + $found = $this->findResource($this->modx->resourceIdentifier); + if ($found) { + $this->modx->resourceIdentifier = $found; + $this->modx->resourceMethod = 'id'; + } else { + $this->modx->sendErrorPage(); + } + } + $this->modx->beforeRequest(); + $this->modx->invokeEvent("OnWebPageInit"); + + if (!is_object($this->modx->resource)) { + if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, + $this->modx->resourceIdentifier)) { + $this->modx->sendErrorPage(); + } + } + + $this->prepareResponse(); + } + + /** + * Gets a requested resource and all required data. + * + * @param string $method The method, 'id', or 'alias', by which to perform + * the resource lookup. + * @param string|integer $identifier The identifier with which to search. + * @param array $options An array of options for the resource fetching + * @return modResource The requested modResource instance or request + * is forwarded to the error page, or unauthorized page. + */ + public function getResource($method, $identifier, array $options = array()) { + $resource = null; + if ($method == 'alias') { + $resourceId = $this->findResource($identifier); + } else { + $resourceId = $identifier; + } + + if (!is_numeric($resourceId)) { + $this->modx->sendErrorPage(); + } + + $resource = parent::getResource($method, $identifier, $options); + if ($resource) { + $context = $resource->get('context_key'); + $allowedContexts = $this->modx->getOption('lingua.contexts'); + $allowedContexts = array_map('trim', @explode(',', $allowedContexts)); + if (empty($context) || empty($allowedContexts) || !in_array($context, $allowedContexts)) { + return $resource; + } + } + $cultureKey = !empty($this->modx->cultureKey) ? $this->modx->cultureKey : $this->modx->getOption('cultureKey', null, 'en'); + $this->modx->setOption('cache_resource_key', 'lingua/resource/' . $cultureKey); + + $isForward = array_key_exists('forward', $options) && !empty($options['forward']); + $fromCache = false; + $cacheKey = $this->modx->context->get('key') . "/resources/{$resourceId}"; + $cachedResource = $this->modx->cacheManager->get($cacheKey, [ + xPDO::OPT_CACHE_KEY => $this->modx->getOption('cache_resource_key', null, 'lingua/resource/' . $cultureKey), + xPDO::OPT_CACHE_HANDLER => $this->modx->getOption('cache_resource_handler', null, + $this->modx->getOption(xPDO::OPT_CACHE_HANDLER)), + xPDO::OPT_CACHE_FORMAT => (integer)$this->modx->getOption('cache_resource_format', null, + $this->modx->getOption(xPDO::OPT_CACHE_FORMAT, null, xPDOCacheManager::CACHE_PHP)), + ]); + if (is_array($cachedResource) && array_key_exists('resource', + $cachedResource) && is_array($cachedResource['resource'])) { + /** @var modResource $resource */ + $resource = $this->modx->newObject($cachedResource['resourceClass']); + if ($resource) { + $resource->fromArray($cachedResource['resource'], '', true, true, true); + $resource->_content = $cachedResource['resource']['_content']; + $resource->_isForward = $isForward; + if (isset($cachedResource['contentType'])) { + $contentType = $this->modx->newObject(modContentType::class); + $contentType->fromArray($cachedResource['contentType'], '', true, true, true); + $resource->addOne($contentType, 'ContentType'); + } + if (isset($cachedResource['resourceGroups'])) { + $rGroups = []; + foreach ($cachedResource['resourceGroups'] as $rGroupKey => $rGroup) { + $rGroups[$rGroupKey] = $this->modx->newObject(modResourceGroupResource::class, $rGroup); + } + $resource->addMany($rGroups); + } + if (isset($cachedResource['policyCache'])) { + $resource->setPolicies([$this->modx->context->get('key') => $cachedResource['policyCache']]); + } + if (isset($cachedResource['elementCache'])) { + $this->modx->elementCache = $cachedResource['elementCache']; + } + if (isset($cachedResource['sourceCache'])) { + $this->modx->sourceCache = $cachedResource['sourceCache']; + } + if ($resource->get('_jscripts')) { + $this->modx->jscripts = $this->modx->jscripts + $resource->get('_jscripts'); + } + if ($resource->get('_sjscripts')) { + $this->modx->sjscripts = $this->modx->sjscripts + $resource->get('_sjscripts'); + } + if ($resource->get('_loadedjscripts')) { + $this->modx->loadedjscripts = array_merge($this->modx->loadedjscripts, + $resource->get('_loadedjscripts')); + } + $isForward = $resource->_isForward; + $resource->setProcessed(true); + $fromCache = true; + } + } + if (!$fromCache || !is_object($resource)) { + $criteria = $this->modx->newQuery(modResource::class); + $criteria->select([$this->modx->escape('modResource') . '.*']); + $criteria->where(['id' => $resourceId, 'deleted' => '0']); + if (!$this->modx->hasPermission('view_unpublished') || $this->modx->getSessionState() !== modX::SESSION_STATE_INITIALIZED) { + $criteria->where(['published' => 1]); + } + if ($resource = $this->modx->getObject(modResource::class, $criteria)) { + if ($resource instanceof modResource) { + if ($resource->get('context_key') !== $this->modx->context->get('key')) { + if (!$isForward || ($isForward && !$this->modx->getOption('allow_forward_across_contexts', + $options, false))) { + if (!$this->modx->getCount(modContextResource::class, + [$this->modx->context->get('key'), $resourceId])) { + return null; + } + } + } + $resource->_isForward = $isForward; + if (!$resource->checkPolicy('view')) { + $this->modx->sendUnauthorizedPage(); + } + + // hack the resource's content in here --------------------> + $linguaLangs = $this->modx->getObject('linguaLangs', array('lang_code' => $cultureKey)); + $emptyReturnsDefault = $this->modx->getOption('lingua.empty_returns_default', null, false); + if (($this->lingua instanceof Lingua) && $linguaLangs) { + $linguaSiteContent = $this->modx->getObject('linguaSiteContent', array( + 'resource_id' => $resource->get('id'), + 'lang_id' => $linguaLangs->get('id'), + )); + if ($linguaSiteContent) { + $linguaSiteContentArray = $linguaSiteContent->toArray(); + unset($linguaSiteContentArray['id']); + foreach ($linguaSiteContentArray as $k => $v) { + // exclude URI to reveal back the original URI later + if ($k === 'uri') { + continue; + } + if (empty($v)) { + if (!$emptyReturnsDefault) { + $resource->set($k, $v); // return empty value + } + } else { + $resource->set($k, $v); + } + } + } + } + // hacking ends -------------------------------------------> + + if ($tvs = $resource->getMany('TemplateVars', 'all')) { + /** @var modTemplateVar $tv */ + foreach ($tvs as $tv) { + $value = $tv->getValue($resource->get('id')); + // hack the tv's content in here ------------------> + if (($this->lingua instanceof Lingua) && $linguaLangs) { + $linguaTVContent = $this->modx->getObject('linguaSiteTmplvarContentvalues', array( + 'tmplvarid' => $tv->get('id'), + 'contentid' => $resourceId, + 'lang_id' => $linguaLangs->get('id') + )); + if ($linguaTVContent) { + $linguaTVContentValue = $linguaTVContent->get('value'); + if (empty($linguaTVContentValue)) { + if (!$emptyReturnsDefault) { + $value = $linguaTVContentValue; // return empty value + } + } else { + $value = $linguaTVContentValue; + } + } + } + // hacking ends -----------------------------------> + + $resource->set($tv->get('name'), [ + $tv->get('name'), + $value, + $tv->get('display'), + $tv->get('display_params'), + $tv->get('type'), + ]); + } + } + $this->modx->resourceGenerated = true; + } + } + } elseif ($fromCache && $resource instanceof modResource && !$resource->get('deleted')) { + if ($resource->checkPolicy('load') && ($resource->get('published') || ($this->modx->getSessionState() === modX::SESSION_STATE_INITIALIZED && $this->modx->hasPermission('view_unpublished')))) { + if ($resource->get('context_key') !== $this->modx->context->get('key')) { + if (!$isForward || ($isForward && !$this->modx->getOption('allow_forward_across_contexts', $options, + false))) { + if (!$this->modx->getCount(modContextResource::class, + [$this->modx->context->get('key'), $resourceId])) { + return null; + } + } + } + if (!$resource->checkPolicy('view')) { + $this->modx->sendUnauthorizedPage(); + } + } else { + return null; + } + $this->modx->invokeEvent('OnLoadWebPageCache', [ + 'resource' => &$resource, + ]); + } + + if ($this->modx->getOption('lingua.debug')) { + $this->modx->log(modX::LOG_LEVEL_ERROR, __FILE__ . ' '); + $this->modx->log(modX::LOG_LEVEL_ERROR, __METHOD__ . ' '); + $this->modx->log(modX::LOG_LEVEL_ERROR, __LINE__ . ': $resourceArray: ' . print_r($resource->toArray(), 1)); + } + + return $resource; + } + + /** + * Cleans the resource identifier from the request params. + * + * @param string $identifier The raw identifier. + * @return string|integer The cleansed identifier. + */ + public function _cleanResourceIdentifier($identifier) { + if (empty ($identifier)) { + if ($this->modx->getOption('base_url', null, MODX_BASE_URL) !== strtok($_SERVER["REQUEST_URI"], '?')) { + $this->modx->sendRedirect($this->modx->getOption('site_url', null, MODX_SITE_URL), + ['responseCode' => $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently']); + } + $identifier = $this->modx->getOption('site_start', null, 1); + $this->modx->resourceMethod = 'id'; + } elseif ($this->modx->getOption('friendly_urls', null, false) && $this->modx->resourceMethod == 'alias') { + $containerSuffix = trim($this->modx->getOption('container_suffix', null, '')); + $found = $this->findResource($identifier); + if ($found === false && !empty ($containerSuffix)) { + $suffixLen = strlen($containerSuffix); + $identifierLen = strlen($identifier); + if (substr($identifier, $identifierLen - $suffixLen) === $containerSuffix) { + $identifier = substr($identifier, 0, $identifierLen - $suffixLen); + $found = $this->findResource($identifier); + } else { + $identifier = "{$identifier}{$containerSuffix}"; + $found = $this->findResource($identifier); + } + if ($found) { + $parameters = $this->getParameters(); + unset($parameters[$this->modx->getOption('request_param_alias')]); + $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full'); + $this->modx->sendRedirect($url, + ['responseCode' => $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently']); + } + $this->modx->resourceMethod = 'alias'; + } elseif ((integer)$this->modx->getOption('site_start', null, 1) === $found) { + $parameters = $this->getParameters(); + unset($parameters[$this->modx->getOption('request_param_alias')]); + $url = $this->modx->makeUrl($this->modx->getOption('site_start', null, 1), + $this->modx->context->get('key'), $parameters, 'full'); + $this->modx->sendRedirect($url, + ['responseCode' => $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently']); + } else { + if ($this->modx->getOption('friendly_urls_strict', null, false)) { + $requestUri = $_SERVER['REQUEST_URI']; + $qsPos = strpos($requestUri, '?'); + if ($qsPos !== false) { + $requestUri = substr($requestUri, 0, $qsPos); + } + $fullId = $this->modx->getOption('base_url', null, MODX_BASE_URL) . $identifier; + $requestUri = urldecode($requestUri); + if ($fullId !== $requestUri && strpos($requestUri, $fullId) !== 0) { + $parameters = $this->getParameters(); + unset($parameters[$this->modx->getOption('request_param_alias')]); + $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full'); + $this->modx->sendRedirect($url, + ['responseCode' => $_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently']); + } + } + $this->modx->resourceMethod = 'alias'; + } + } else { + $this->modx->resourceMethod = 'id'; + } + + return $identifier; + } + + public function findResource($uri, $context = '') { + $resourceId = $this->modx->findResource($uri, $context); + if (!is_numeric($resourceId)) { + $resourceId = $this->findCloneResource($uri, $context); + } + return $resourceId; + } + + public function findCloneResource($uri, $context = '') { + $resourceId = false; + if (empty($context) && isset($this->modx->context)) $context = $this->modx->context->get('key'); + if (!empty($context) && (!empty($uri) || $uri === '0')) { + $query = $this->modx->newQuery('linguaSiteContent'); + $query->leftJoin('modResource', 'Resource', 'Resource.id = linguaSiteContent.resource_id'); + $query->where(array( + 'context_key' => $context, + 'uri' => $uri, + 'Resource.deleted' => false + )); + $linguaContent = $this->modx->getObject('linguaSiteContent', $query); + if ($linguaContent) { + $resourceId = $linguaContent->get('resource_id'); + // reset the culture key + $lang = $linguaContent->getOne('Lang'); + if ($lang) { + $cultureKey = $lang->get('lang_code'); + $this->lingua->setCultureKey($cultureKey); + $this->modx->setOption('cultureKey', $cultureKey); + $this->modx->context->config['cultureKey'] = $cultureKey; + } + } + } + return $resourceId; + } +} From feeedafc819fc3796ff2199affb9271d4a136b13 Mon Sep 17 00:00:00 2001 From: Ilya Utkin Date: Tue, 25 Oct 2022 15:04:33 +0300 Subject: [PATCH 03/10] Fix object getting in snippets and plugin --- .../lingua/elements/plugins/lingua.plugin.php | 41 +++++++++++-------- .../snippets/lingua.getfield.snippet.php | 5 ++- .../snippets/lingua.getvalue.snippet.php | 18 ++++---- .../snippets/lingua.selector.snippet.php | 11 +++-- .../lingua/src/Model/LinguaRequest.php | 24 +++++++---- 5 files changed, 63 insertions(+), 36 deletions(-) diff --git a/core/components/lingua/elements/plugins/lingua.plugin.php b/core/components/lingua/elements/plugins/lingua.plugin.php index e47764e..8bb2fc1 100644 --- a/core/components/lingua/elements/plugins/lingua.plugin.php +++ b/core/components/lingua/elements/plugins/lingua.plugin.php @@ -1,5 +1,12 @@ getCollection('linguaLangs', array( + $linguaLangs = $modx->getCollection(LinguaLangs::class, array( 'active' => 1 )); - $c = $modx->newQuery('linguaLangs'); + $c = $modx->newQuery(LinguaLangs::class); $c->where('active=1'); $contextLangs = $modx->context->config['lingua.langs']; if (!empty($contextLangs)) { @@ -84,7 +91,7 @@ 'lang_code:IN' => $contextLangs )); } - $linguaLangs = $modx->getCollection('linguaLangs', $c); + $linguaLangs = $modx->getCollection(LinguaLangs::class, $c); $existingLangs = array(); if ($linguaLangs) { foreach ($linguaLangs as $linguaLang) { @@ -162,7 +169,7 @@ $modx->regClientCSS(MODX_BASE_URL . 'assets/components/lingua/css/mgr.css'); $modx->controller->addLastJavascript(MODX_BASE_URL . 'assets/components/lingua/js/mgr/resource.js'); // $modx->getOption('cultureKey') doesn't work! - $modCultureKey = $modx->getObject('modSystemSetting', array('key' => 'cultureKey')); + $modCultureKey = $modx->getObject(modSystemSetting::class, array('key' => 'cultureKey')); $cultureKey = $modCultureKey->get('value'); $storeData = array(); $storeDefaultData = array(); @@ -189,7 +196,7 @@ $language['flag'], ); if ($mode === modSystemEvent::MODE_UPD) { - $linguaSiteContent = $modx->getObject('linguaSiteContent', array( + $linguaSiteContent = $modx->getObject(LinguaSiteContent::class, array( 'resource_id' => $resource->get('id'), 'lang_id' => $language['id'] )); @@ -231,7 +238,7 @@ case 'OnResourceTVFormRender': if (!is_object($resource) && is_numeric($resource)) { $resourceId = $resource; - $resource = $modx->getObject('modResource', $resource); + $resource = $modx->getObject(modResource::class, $resource); } $contexts = $modx->getOption('lingua.contexts', $scriptProperties, 'web'); if (!empty($contexts)) { @@ -285,7 +292,7 @@ $tvs = $resource->getTemplateVars(); } else { $templateId = $template; - $template = $modx->getObject('modTemplate', $templateId); + $template = $modx->getObject(modTemplate::class, $templateId); $tvs = $template->getTemplateVars(); } if (!$tvs) { @@ -297,11 +304,11 @@ foreach ($tvs as $tv) { $tvIds[] = $tv->get('id'); } - $c = $modx->newQuery('linguaSiteTmplvars'); + $c = $modx->newQuery(linguaSiteTmplvars::class); $c->where(array( 'tmplvarid:IN' => $tvIds )); - $linguaSiteTmplvars = $modx->getCollection('linguaSiteTmplvars', $c); + $linguaSiteTmplvars = $modx->getCollection(LinguaSiteTmplvars::class, $c); if (!$linguaSiteTmplvars) { return; } @@ -321,7 +328,7 @@ $cloneTVFields = array(); $count = 0; // $modx->getOption('cultureKey') doesn't work! - $modCultureKey = $modx->getObject('modSystemSetting', array('key' => 'cultureKey')); + $modCultureKey = $modx->getObject(modSystemSetting::class, array('key' => 'cultureKey')); $cultureKey = $modCultureKey->get('value'); foreach ($linguaSiteTmplvars as $linguaTv) { $tvId = $linguaTv->get('tmplvarid'); @@ -338,7 +345,7 @@ if ($language['lang_code'] === $cultureKey) { continue; } - $linguaTVContent = $modx->getObject('linguaSiteTmplvarContentvalues', array( + $linguaTVContent = $modx->getObject(LinguaSiteTmplvarContentvalues::class, array( 'tmplvarid' => $tvId, 'contentid' => $resourceId, 'lang_id' => $language['id'] @@ -365,7 +372,7 @@ $cloneInputForm = preg_replace('/("|\'){1}tv' . $tvId . '("|\'){1}/', '${1}tv' . $tvCloneId . '${2}', $cloneInputForm); $cloneInputForm = preg_replace('/("|\'){1}tv' . $tvId . '\[\]("|\'){1}/', '${1}tv' . $tvCloneId . '[]${2}', $cloneInputForm); // advanced replacements - $linguaSiteTmplvarsPatterns = $modx->getCollection('linguaSiteTmplvarsPatterns', array( + $linguaSiteTmplvarsPatterns = $modx->getCollection(LinguaSiteTmplvarsPatterns::class, array( 'type' => $tv->get('type') )); if ($linguaSiteTmplvarsPatterns) { @@ -438,7 +445,7 @@ $reverting = array(); $clearKeys = array(); // $modx->getOption('cultureKey') doesn't work! - $modCultureKey = $modx->getObject('modSystemSetting', array('key' => 'cultureKey')); + $modCultureKey = $modx->getObject(modSystemSetting::class, array('key' => 'cultureKey')); $cultureKey = $modCultureKey->get('value'); foreach ($resource->_fields as $k => $v) { if (!preg_match('/_lingua$/', $k)) { @@ -475,7 +482,7 @@ if ($lang === $cultureKey) { continue; } - $tv = $modx->getObject('modTemplateVar', $tvId); + $tv = $modx->getObject(modTemplateVar::class, $tvId); $tvKey = $tvKeys[0]; /* validation for different types */ switch ($tv->get('type')) { @@ -574,7 +581,7 @@ } } - $linguaSiteContents = $modx->getCollection('linguaSiteContent', array( + $linguaSiteContents = $modx->getCollection(LinguaSiteContent::class, array( 'resource_id' => $oldResource->get('id') )); if ($linguaSiteContents) { @@ -582,7 +589,7 @@ $params = $linguaSiteContent->toArray(); unset($params['id']); $params['resource_id'] = $newResource->get('id'); - $newLinguaSiteContent = $modx->newObject('linguaSiteContent'); + $newLinguaSiteContent = $modx->newObject(LinguaSiteContent::class); $newLinguaSiteContent->fromArray($params); $newLinguaSiteContent->save(); } @@ -591,7 +598,7 @@ case 'OnEmptyTrash': if (!empty($ids) && is_array($ids)) { - $collection = $modx->getCollection('linguaSiteContent', array( + $collection = $modx->getCollection(LinguaSiteContent::class, array( 'resource_id:IN' => $ids )); if ($collection) { diff --git a/core/components/lingua/elements/snippets/lingua.getfield.snippet.php b/core/components/lingua/elements/snippets/lingua.getfield.snippet.php index 4dcf092..adaf64c 100644 --- a/core/components/lingua/elements/snippets/lingua.getfield.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.getfield.snippet.php @@ -1,5 +1,7 @@ getOption('codeField', $scriptProperties, $modx->getOption('lingua.code_field', null, 'lang_code')); -$defaultLinguaCorePath = $modx->getOption('core_path') . 'components/lingua/'; $lingua = $modx->getService('lingua', 'Lingua', null, $scriptProperties); if (!($lingua instanceof Lingua)) { return; } -$langObj = $modx->getObject('linguaLangs', array( +$langObj = $modx->getObject(LinguaLangs::class, array( $langCodeField => $modx->cultureKey )); if (!$langObj) { diff --git a/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php b/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php index 09f5631..ceb19c1 100644 --- a/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.getvalue.snippet.php @@ -1,5 +1,10 @@ getOption('id', $scriptProperties, $modx->resource->get('id')); $emptyReturnsDefault = $modx->getOption('emptyReturnsDefault', $scriptProperties, $modx->getOption('lingua.empty_returns_default', null, false)); -$defaultLinguaCorePath = $modx->getOption('core_path') . 'components/lingua/'; $lingua = $modx->getService('lingua', 'Lingua', null, $scriptProperties); $debug = $modx->getOption('lingua.debug'); if (!($lingua instanceof Lingua)) { @@ -39,7 +43,7 @@ return; } -$langObj = $modx->getObject('linguaLangs', array( +$langObj = $modx->getObject(LinguaLangs::class, array( 'lang_code' => $modx->cultureKey )); if (!$langObj) { @@ -48,13 +52,13 @@ } return; } -$c = $modx->newQuery('linguaSiteContent'); +$c = $modx->newQuery(LinguaSiteContent::class); $c->where(array( 'resource_id' => $id, 'lang_id' => $langObj->get('id'), )); -$linguaSiteContent = $modx->getObject('linguaSiteContent', $c); -$resource = $modx->getObject('modResource', $id); +$linguaSiteContent = $modx->getObject(LinguaSiteContent::class, $c); +$resource = $modx->getObject(modResource::class, $id); if (!$resource) { if ($debug) { $modx->log(modX::LOG_LEVEL_ERROR, '[lingua.getValue]: Missing resource for ' . $field . ' in ' . $modx->cultureKey); @@ -80,11 +84,11 @@ } // try TV else { - $tv = $modx->getObject('modTemplateVar', array( + $tv = $modx->getObject(modTemplateVar::class, array( 'name' => $field, )); if ($tv) { - $linguaSiteTmplvarContentvalues = $modx->getObject('linguaSiteTmplvarContentvalues', array( + $linguaSiteTmplvarContentvalues = $modx->getObject(LinguaSiteTmplvarContentvalues::class, array( 'lang_id' => $langObj->get('id'), 'tmplvarid' => $tv->get('id'), 'contentid' => $id, diff --git a/core/components/lingua/elements/snippets/lingua.selector.snippet.php b/core/components/lingua/elements/snippets/lingua.selector.snippet.php index f149bcd..a7fdee9 100644 --- a/core/components/lingua/elements/snippets/lingua.selector.snippet.php +++ b/core/components/lingua/elements/snippets/lingua.selector.snippet.php @@ -1,5 +1,10 @@ getOption('cultureKey') is overriden by plugin! -$modCultureKey = $modx->getObject('modSystemSetting', array('key' => 'cultureKey')); +$modCultureKey = $modx->getObject(modSystemSetting::class, array('key' => 'cultureKey')); $cultureKey = $modCultureKey->get('value'); $baseUrl = $modx->getOption('base_url', $scriptProperties); $baseUrl = preg_replace('/^'. preg_quote(MODX_BASE_URL, '/') . '/i', '', $baseUrl); -$originResource = $modx->getObject('modResource', $modx->resource->get('id')); +$originResource = $modx->getObject(modResource::class, $modx->resource->get('id')); $languages = $lingua->getLanguages($activeOnly); $selections = array(); @@ -189,7 +194,7 @@ function http_build_url($url, $parts = array(), $flags = HTTP_URL_REPLACE, &$new continue; } - $cloneSite = $modx->getObject('linguaSiteContent', array( + $cloneSite = $modx->getObject(LinguaSiteContent::class, array( 'resource_id' => $modx->resource->get('id'), 'lang_id' => $language['id'], )); diff --git a/core/components/lingua/src/Model/LinguaRequest.php b/core/components/lingua/src/Model/LinguaRequest.php index 356e502..459cdec 100644 --- a/core/components/lingua/src/Model/LinguaRequest.php +++ b/core/components/lingua/src/Model/LinguaRequest.php @@ -1,8 +1,18 @@ - $linguaLangs = $this->modx->getObject('linguaLangs', array('lang_code' => $cultureKey)); + $linguaLangs = $this->modx->getObject(LinguaLangs::class, array('lang_code' => $cultureKey)); $emptyReturnsDefault = $this->modx->getOption('lingua.empty_returns_default', null, false); if (($this->lingua instanceof Lingua) && $linguaLangs) { - $linguaSiteContent = $this->modx->getObject('linguaSiteContent', array( + $linguaSiteContent = $this->modx->getObject(LinguaSiteContent::class, array( 'resource_id' => $resource->get('id'), 'lang_id' => $linguaLangs->get('id'), )); @@ -266,7 +276,7 @@ public function getResource($method, $identifier, array $options = array()) { $value = $tv->getValue($resource->get('id')); // hack the tv's content in here ------------------> if (($this->lingua instanceof Lingua) && $linguaLangs) { - $linguaTVContent = $this->modx->getObject('linguaSiteTmplvarContentvalues', array( + $linguaTVContent = $this->modx->getObject(LinguaSiteTmplvarContentvalues::class, array( 'tmplvarid' => $tv->get('id'), 'contentid' => $resourceId, 'lang_id' => $linguaLangs->get('id') @@ -407,14 +417,14 @@ public function findCloneResource($uri, $context = '') { $resourceId = false; if (empty($context) && isset($this->modx->context)) $context = $this->modx->context->get('key'); if (!empty($context) && (!empty($uri) || $uri === '0')) { - $query = $this->modx->newQuery('linguaSiteContent'); - $query->leftJoin('modResource', 'Resource', 'Resource.id = linguaSiteContent.resource_id'); + $query = $this->modx->newQuery(LinguaSiteContent::class); + $query->leftJoin('modResource', 'Resource', 'Resource.id = LinguaSiteContent.resource_id'); $query->where(array( 'context_key' => $context, 'uri' => $uri, 'Resource.deleted' => false )); - $linguaContent = $this->modx->getObject('linguaSiteContent', $query); + $linguaContent = $this->modx->getObject(LinguaSiteContent::class, $query); if ($linguaContent) { $resourceId = $linguaContent->get('resource_id'); // reset the culture key From e007290074ca11c2590fb3fac7fbd14704e4c5fe Mon Sep 17 00:00:00 2001 From: Ilya Utkin Date: Tue, 25 Oct 2022 16:23:41 +0300 Subject: [PATCH 04/10] Fix classes using in plugin and main class --- _build/config.inc.php | 2 +- _build/elements/chunks.php | 4 + .../lingua.resourcetv.hidden.row.chunk.tpl | 5 ++ .../chunks/lingua.resourcetv.row.chunk.tpl | 5 -- .../lingua/elements/plugins/lingua.plugin.php | 21 ++++-- .../snippets/lingua.getfield.snippet.php | 2 + .../snippets/lingua.getvalue.snippet.php | 2 + .../snippets/lingua.selector.snippet.php | 1 + core/components/lingua/src/Lingua.php | 74 +++++++++++-------- .../lingua/src/Model/LinguaRequest.php | 1 + 10 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 core/components/lingua/elements/chunks/lingua.resourcetv.hidden.row.chunk.tpl diff --git a/_build/config.inc.php b/_build/config.inc.php index dbe4970..52732d9 100644 --- a/_build/config.inc.php +++ b/_build/config.inc.php @@ -12,7 +12,7 @@ 'name' => 'Lingua', 'name_lower' => 'lingua', 'version' => '3.0.0', - 'release' => 'pl', + 'release' => 'beta', // Install package to site right after build 'install' => true, // Which elements should be updated on package upgrade diff --git a/_build/elements/chunks.php b/_build/elements/chunks.php index 4622555..68158e1 100644 --- a/_build/elements/chunks.php +++ b/_build/elements/chunks.php @@ -5,6 +5,10 @@ 'file' => 'lingua.resourcetv.row.chunk', 'description' => '', ], + 'lingua.resourcetv.hidden.row' => [ + 'file' => 'lingua.resourcetv.hidden.row.chunk', + 'description' => '', + ], 'lingua.selector.item' => [ 'file' => 'lingua.selector.item.chunk', 'description' => '', diff --git a/core/components/lingua/elements/chunks/lingua.resourcetv.hidden.row.chunk.tpl b/core/components/lingua/elements/chunks/lingua.resourcetv.hidden.row.chunk.tpl new file mode 100644 index 0000000..846ca6b --- /dev/null +++ b/core/components/lingua/elements/chunks/lingua.resourcetv.hidden.row.chunk.tpl @@ -0,0 +1,5 @@ + + + +[[+tv.formElement]] + \ No newline at end of file diff --git a/core/components/lingua/elements/chunks/lingua.resourcetv.row.chunk.tpl b/core/components/lingua/elements/chunks/lingua.resourcetv.row.chunk.tpl index ebabc1d..06c5902 100644 --- a/core/components/lingua/elements/chunks/lingua.resourcetv.row.chunk.tpl +++ b/core/components/lingua/elements/chunks/lingua.resourcetv.row.chunk.tpl @@ -1,6 +1,5 @@ -[[+tv.type:isnot=`hidden`:then=`