mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 12:17:42 +02:00
Compare commits
1112 Commits
sparky-js-
...
v3.0.3
Author | SHA1 | Date | |
---|---|---|---|
|
4dd2361e5f | ||
|
7e30f636b6 | ||
|
d768db494e | ||
|
685722cc8e | ||
|
db7792e538 | ||
|
ec8bdf04bf | ||
|
26d68cc593 | ||
|
9c148e44d1 | ||
|
eb17b827d7 | ||
|
fab79a357d | ||
|
099fe32d88 | ||
|
6cc44a146e | ||
|
81b65c761b | ||
|
bc36876eac | ||
|
4908967f67 | ||
|
46378701aa | ||
|
543f42ec1e | ||
|
eec5c01382 | ||
|
be4816a892 | ||
|
154d98b167 | ||
|
b6b0b43970 | ||
|
fd02accbd4 | ||
|
d1c096600a | ||
|
abd6bc6840 | ||
|
b18e724718 | ||
|
4081393325 | ||
|
a6cdab21a3 | ||
|
c9f0ec112f | ||
|
75ddf1292d | ||
|
f3d4ed57cf | ||
|
2e2a1480a2 | ||
|
73bd190942 | ||
|
4ffadb84d3 | ||
|
5ed420208a | ||
|
1b980e4bde | ||
|
c899720f14 | ||
|
8edd205dec | ||
|
e303f9f6aa | ||
|
1de85168f0 | ||
|
fc721f55cb | ||
|
4a3a38bed3 | ||
|
5d7b28f801 | ||
|
fdcb24a3f3 | ||
|
b2a509bc7a | ||
|
13f55afdee | ||
|
7389d1f1c3 | ||
|
13eea5b730 | ||
|
6fce509e81 | ||
|
b0e2e32c71 | ||
|
87b1cb2f96 | ||
|
28210a93db | ||
|
52ac023813 | ||
|
5630bed2ef | ||
|
13577c21b8 | ||
|
c67454940d | ||
|
f646cf11a5 | ||
|
2a18939513 | ||
|
b7f7b10403 | ||
|
51ee940202 | ||
|
48765f9ff2 | ||
|
f1230d43d2 | ||
|
4ebf5ce2eb | ||
|
30a78d2f67 | ||
|
fb90f35cf3 | ||
|
59c214ec55 | ||
|
f777989af7 | ||
|
09371c02f5 | ||
|
872cdc1a25 | ||
|
ef10651f74 | ||
|
fceebb4a1d | ||
|
d68cd28279 | ||
|
dd8905982a | ||
|
acd03a3ead | ||
|
89ee4506e6 | ||
|
01ea53730e | ||
|
bb14b17a41 | ||
|
54b8bc5e36 | ||
|
4b24e337d4 | ||
|
eb6e6aa6be | ||
|
c0619cd13d | ||
|
50b678081e | ||
|
b526ee2d4d | ||
|
613593d7bd | ||
|
46fabc0dee | ||
|
343cefd114 | ||
|
51c1582e36 | ||
|
e0755de9b2 | ||
|
3c5e54fea0 | ||
|
dec8c18b1b | ||
|
fba8dce45e | ||
|
3994d1e2a7 | ||
|
c87ea5029c | ||
|
0eadda37b3 | ||
|
3117d5e448 | ||
|
e635422730 | ||
|
24c6d342c6 | ||
|
797d9e0f18 | ||
|
e5241f6a5f | ||
|
5b41adfd28 | ||
|
4b57135324 | ||
|
1aa2664046 | ||
|
13e1dd1e63 | ||
|
1854cfe80e | ||
|
43297d2006 | ||
|
90c27f3595 | ||
|
e6277af3d0 | ||
|
7ba93ba374 | ||
|
4ed77e4db0 | ||
|
8477d7350f | ||
|
9e3e49a3f1 | ||
|
8803b22705 | ||
|
08974eb996 | ||
|
e63e4eb5ce | ||
|
547f414c32 | ||
|
f188413070 | ||
|
295c90b69c | ||
|
d1bed0529a | ||
|
cee7e89ae0 | ||
|
5986dc65c8 | ||
|
62e0417fb8 | ||
|
19481f7e45 | ||
|
1ad40e50e6 | ||
|
d3f6e90d68 | ||
|
4579bb6a1a | ||
|
9e5d66b234 | ||
|
b4721b7d07 | ||
|
83fcd1b2fd | ||
|
3ecf293ebe | ||
|
886e674de1 | ||
|
b0f9c22a9b | ||
|
78545161e4 | ||
|
2db404be89 | ||
|
7cf4bdbd3c | ||
|
4dc1766304 | ||
|
b92781cadf | ||
|
4aa51394df | ||
|
f02ecafc5b | ||
|
fd98f964f3 | ||
|
e71a2ef911 | ||
|
3ac26fda2a | ||
|
ffa4a7dd46 | ||
|
79c7562550 | ||
|
bced6667a7 | ||
|
e13048fdaf | ||
|
0190e9c67e | ||
|
40ebc20287 | ||
|
1f595a46ad | ||
|
20d247d40a | ||
|
ce4b3fba74 | ||
|
c0f73d2dd3 | ||
|
ddd8eebd05 | ||
|
cbdb29d4a7 | ||
|
6be613bce5 | ||
|
7475b8b13d | ||
|
268237e0c2 | ||
|
c2a56a08c4 | ||
|
6814818615 | ||
|
837eef3495 | ||
|
36a69bd6c5 | ||
|
5f1746d62e | ||
|
9c48c41e55 | ||
|
a088fd9772 | ||
|
d6221b3f50 | ||
|
a39d78d725 | ||
|
dfffa3d984 | ||
|
79f42c2f01 | ||
|
5acdcbd32b | ||
|
57f798e2cb | ||
|
b60ffab09f | ||
|
01a9112966 | ||
|
2dd6faceed | ||
|
ac8ba8a6dc | ||
|
19e0e36eec | ||
|
009e32e635 | ||
|
7ff4ff29d9 | ||
|
31b103d9d3 | ||
|
6b7f1fce17 | ||
|
a4af90a72e | ||
|
eaccc1056d | ||
|
728f6509a6 | ||
|
169803c85a | ||
|
3fddfa8d06 | ||
|
5d696d9a47 | ||
|
1c43b78d71 | ||
|
d58e1c2f92 | ||
|
ab471b9555 | ||
|
9f5516233d | ||
|
f8fa3f966b | ||
|
7c548aa5b4 | ||
|
3592d3342a | ||
|
4743f4e6e1 | ||
|
55324b20a0 | ||
|
c11ee609bc | ||
|
43655828c9 | ||
|
19afcbd9e8 | ||
|
2643a33820 | ||
|
4fb4de67d4 | ||
|
b9d3292899 | ||
|
3470c28c03 | ||
|
3e7f381fc0 | ||
|
392d8c253f | ||
|
c7133368d1 | ||
|
c5534d26ad | ||
|
17569174aa | ||
|
90057e13d0 | ||
|
5abc71089e | ||
|
a078ba2ad1 | ||
|
5bbb9a7871 | ||
|
ad5d92bbff | ||
|
00f4c551a1 | ||
|
1d2c4cd068 | ||
|
0414e887e1 | ||
|
49347e80b6 | ||
|
1bb101edef | ||
|
918f0470e0 | ||
|
aaae5c723f | ||
|
ed9490042d | ||
|
1ef144ba21 | ||
|
970ce69cfa | ||
|
33eedc9481 | ||
|
5bf01e01ca | ||
|
8c66bac570 | ||
|
cd6cd24ed2 | ||
|
d293b649b8 | ||
|
a27564c317 | ||
|
c713cf40d2 | ||
|
abdde2411a | ||
|
d9ee6c89d9 | ||
|
f871958e51 | ||
|
552c84c7b2 | ||
|
b9408b3522 | ||
|
c4895264de | ||
|
3834f931d9 | ||
|
dba81f723e | ||
|
c2e00b3f81 | ||
|
7a89ba8a9b | ||
|
45f6c4952e | ||
|
b758b6e503 | ||
|
2b3bbd247b | ||
|
3c79bc2a45 | ||
|
29d11febfd | ||
|
33d8024866 | ||
|
9e92cc5372 | ||
|
cc3ca4476f | ||
|
7dc755db99 | ||
|
bacfb156f4 | ||
|
d469da3b2d | ||
|
de90f501b6 | ||
|
11ec340a15 | ||
|
5c8b3a2da1 | ||
|
4eaa1165b0 | ||
|
0285dabee3 | ||
|
a8000d167d | ||
|
2a35099a83 | ||
|
fcf349d0a1 | ||
|
44f1fd2e0a | ||
|
acb88579c8 | ||
|
e18c4912b5 | ||
|
b7ce4670ec | ||
|
ff18aba1b5 | ||
|
bf7e12b16d | ||
|
418f89f64d | ||
|
b1455d63af | ||
|
7089970cf6 | ||
|
91dec98620 | ||
|
6d682b3d7f | ||
|
91d769a1c4 | ||
|
3a58e39f5c | ||
|
fc685e0514 | ||
|
f15766ee86 | ||
|
e78cce729b | ||
|
fc0a4cf3b3 | ||
|
8a905b9481 | ||
|
fb5e278073 | ||
|
dc6a689013 | ||
|
b91e746c09 | ||
|
6be93036ae | ||
|
ac1a4b4a6c | ||
|
cbacd6db91 | ||
|
f5566ef2b4 | ||
|
a2596a13a8 | ||
|
054cb8ec65 | ||
|
99a22cf36e | ||
|
daf306bcb3 | ||
|
b386055643 | ||
|
d7510e699e | ||
|
b9fb53820e | ||
|
b6be58ba07 | ||
|
947ebb4a3d | ||
|
e816be56a4 | ||
|
531e81b2ac | ||
|
7357d1c26a | ||
|
fd3a16d72f | ||
|
b697274f86 | ||
|
a01ef33951 | ||
|
a17ee5f09c | ||
|
635eb98c4e | ||
|
ea574a1d40 | ||
|
a115a51fd9 | ||
|
23360d4c42 | ||
|
58bedf57e7 | ||
|
b52ff6abb7 | ||
|
745c06df7f | ||
|
a62a1e7ef5 | ||
|
9741538fb2 | ||
|
48b7be3ecc | ||
|
fe4caf0802 | ||
|
30f5a5969f | ||
|
47af0a0d4b | ||
|
b39381990a | ||
|
1a335cfaad | ||
|
ab647fdce5 | ||
|
a3c75d72fb | ||
|
c60cd592c4 | ||
|
a36b72f32f | ||
|
4803e3285e | ||
|
312d79c2c9 | ||
|
5bea8e2b72 | ||
|
b5a9b3f49a | ||
|
a9c720659d | ||
|
ae587082ac | ||
|
ee168a2aa0 | ||
|
144a3e7cc3 | ||
|
295e2cb873 | ||
|
f2b9975eca | ||
|
12d4be693b | ||
|
616e3a3608 | ||
|
34cade84cf | ||
|
a898a84739 | ||
|
6a7c3a3462 | ||
|
eb5f918f5d | ||
|
6c68b1023c | ||
|
9cdf1a3d71 | ||
|
cec57dc108 | ||
|
bd3df9598a | ||
|
798c121e51 | ||
|
4f2fb1a319 | ||
|
79e8c94468 | ||
|
de4b0eff15 | ||
|
0fa5c3c91d | ||
|
ab69a6128b | ||
|
9981219800 | ||
|
cd2b94c7cc | ||
|
926b99b2fa | ||
|
eeffcca348 | ||
|
1f3ed549d5 | ||
|
fea6350416 | ||
|
01cef7e8e9 | ||
|
efb026013e | ||
|
56562942cd | ||
|
8b63ae4c39 | ||
|
a98ae9bbc2 | ||
|
431337e138 | ||
|
7a9aa577dd | ||
|
9ea7b09e15 | ||
|
c3a1a33c73 | ||
|
44e3f5f31c | ||
|
4e2f2b6528 | ||
|
9594f0d48b | ||
|
8ea46eac2c | ||
|
961f03a7a4 | ||
|
a23885d619 | ||
|
71d0244a01 | ||
|
90f8020d92 | ||
|
369eb76f09 | ||
|
5e1a5f9150 | ||
|
e4ed4a3e00 | ||
|
8c20dd5155 | ||
|
80ea7dbc3a | ||
|
5f79f19542 | ||
|
3624af6371 | ||
|
11eaf2702a | ||
|
69b23097e1 | ||
|
66b331c8a6 | ||
|
faad94b51f | ||
|
92afccf4f8 | ||
|
9d48963513 | ||
|
43925eaf54 | ||
|
80fcdb20f9 | ||
|
b71b0a422a | ||
|
2e51c5ecf9 | ||
|
253cb63630 | ||
|
2070d0ab32 | ||
|
f84ce335c7 | ||
|
507142df0a | ||
|
fa7fdfce56 | ||
|
c462909f0d | ||
|
de3ad26ece | ||
|
84d1fffc71 | ||
|
6b55dd36e5 | ||
|
d046e53ef9 | ||
|
2031d25253 | ||
|
57544b6740 | ||
|
c5b8ad8c3d | ||
|
059ad82591 | ||
|
febd1e7e71 | ||
|
616c8a18af | ||
|
e442d4debd | ||
|
5a876fddb1 | ||
|
6658500691 | ||
|
4756be2309 | ||
|
16dbbcdb16 | ||
|
5c1ea1f819 | ||
|
b2ca81e9d6 | ||
|
dfb4c01ffd | ||
|
45cb0e69d8 | ||
|
ca43003293 | ||
|
4bddfae60f | ||
|
314996be6b | ||
|
32472a1a0e | ||
|
ec6e4bba27 | ||
|
438a81af8f | ||
|
e51ed4c587 | ||
|
a8c163a535 | ||
|
0102715cf3 | ||
|
d68a4c5e28 | ||
|
9c54a443d9 | ||
|
2178b7d406 | ||
|
34d4482911 | ||
|
a0719eac94 | ||
|
32e2890b37 | ||
|
e449381555 | ||
|
ac3c4e6ac8 | ||
|
06981a768e | ||
|
e5af6b060a | ||
|
f0899e9358 | ||
|
e3bc818348 | ||
|
b32452a815 | ||
|
a242cd8804 | ||
|
9fc9843639 | ||
|
190bbe05b1 | ||
|
b0c19f7c81 | ||
|
cae9c77d0a | ||
|
8b58e1536f | ||
|
3339ad0ce5 | ||
|
c003072a5d | ||
|
710f86ffc6 | ||
|
c1a20a5f6e | ||
|
207a13904d | ||
|
5942c29fe9 | ||
|
2a3d9720d1 | ||
|
163914b579 | ||
|
41076ede4a | ||
|
44451af610 | ||
|
e3d0da1047 | ||
|
e436317d7e | ||
|
3b7288cbdb | ||
|
9896ea7c31 | ||
|
5e2984e448 | ||
|
82a516d431 | ||
|
f7bc03ef91 | ||
|
7ca3946f8a | ||
|
80582f2c9f | ||
|
3e4bd66e16 | ||
|
3bd33ab305 | ||
|
608c987e6d | ||
|
582f49418e | ||
|
1b77c928f4 | ||
|
f2d0bd2745 | ||
|
1085953b3b | ||
|
8ac3b92248 | ||
|
37ec41199d | ||
|
9ea4477bd8 | ||
|
81ffb867be | ||
|
eea5606985 | ||
|
c01e03e139 | ||
|
071595fd61 | ||
|
847af54c11 | ||
|
308483f167 | ||
|
1a5d05bfaa | ||
|
e17bc2454d | ||
|
e662a9937b | ||
|
d8a9c746b4 | ||
|
0a08b4131d | ||
|
ba78201812 | ||
|
36bb23db5b | ||
|
6713282196 | ||
|
bcf3d58c14 | ||
|
3f7e3e5b98 | ||
|
baefbef8ab | ||
|
f5ff259344 | ||
|
8380ec5b7d | ||
|
44c274cf8c | ||
|
bcac217db3 | ||
|
a1c7aa1d46 | ||
|
594d6fd51d | ||
|
9a6329a6cd | ||
|
1350491545 | ||
|
61317e99fe | ||
|
46c2d5e93d | ||
|
35029b1e24 | ||
|
8a107d190c | ||
|
ff26fc105c | ||
|
2e19f5c1a7 | ||
|
0bbf9544da | ||
|
27cf070816 | ||
|
66eb4fd120 | ||
|
3aad8db409 | ||
|
6d703b1286 | ||
|
948bf57a1c | ||
|
ef63bda6da | ||
|
87135d00ae | ||
|
350dd8ed8b | ||
|
b8ebd53272 | ||
|
358c7fdefe | ||
|
062460895d | ||
|
7113f09937 | ||
|
918820da3e | ||
|
8f0e576f99 | ||
|
eecf2e85a4 | ||
|
933c1df4f6 | ||
|
28ec930671 | ||
|
e74111fb7d | ||
|
551ce3be6b | ||
|
ceb19b2e83 | ||
|
38efadd6bf | ||
|
97dc6a8f69 | ||
|
1e3689204e | ||
|
fee8dc34e9 | ||
|
a5dbfaee85 | ||
|
e72dcc3a94 | ||
|
106c7b2c56 | ||
|
6749608a17 | ||
|
4b381efb10 | ||
|
8d16632454 | ||
|
67bf91a872 | ||
|
482e865358 | ||
|
fb906708b9 | ||
|
76c71c8174 | ||
|
6d20d97c86 | ||
|
2ba945313f | ||
|
52192f9dea | ||
|
054aa46635 | ||
|
cff06f5564 | ||
|
14dfc59b9e | ||
|
03045d03ae | ||
|
5d8a4abcb9 | ||
|
3ad2cf7a56 | ||
|
474fddd803 | ||
|
a1942f55dc | ||
|
38e6961a91 | ||
|
73d78f0585 | ||
|
bd84514fce | ||
|
9d66c5ca32 | ||
|
54660eb5c1 | ||
|
ea3f059a41 | ||
|
1e2fe718c1 | ||
|
aaba7cef27 | ||
|
2afaba814b | ||
|
2a465bab1b | ||
|
fff6890205 | ||
|
9a5f0a99ba | ||
|
2c4d1c36f9 | ||
|
7b397ddfaa | ||
|
0cecc2e9a6 | ||
|
a8b2725721 | ||
|
274e9a1849 | ||
|
a76207ae96 | ||
|
0bb9915708 | ||
|
f7a716cb76 | ||
|
dfb0b41467 | ||
|
ad5c1802d0 | ||
|
390c5a1354 | ||
|
3f4a04e03a | ||
|
669289af32 | ||
|
d4f57e35d3 | ||
|
cc7d270bfb | ||
|
caecc6df07 | ||
|
0f357ec80b | ||
|
57c43319f7 | ||
|
00ac33e273 | ||
|
3947d3560d | ||
|
4907964484 | ||
|
38c8a3340c | ||
|
7532ad1127 | ||
|
cc613247f3 | ||
|
92064df622 | ||
|
fb121a88d1 | ||
|
abc04ee218 | ||
|
0faba762ba | ||
|
fed3aa5664 | ||
|
6e3a2a63e7 | ||
|
c119c9f84a | ||
|
3eae0d2114 | ||
|
955ba2a9ca | ||
|
25bee212a8 | ||
|
e5f319a961 | ||
|
251acd4949 | ||
|
bc429ac098 | ||
|
a76590930f | ||
|
2f873985a8 | ||
|
ffc0bf62c2 | ||
|
678573b91a | ||
|
83abaae0af | ||
|
bd310d6c7c | ||
|
9fabc679b4 | ||
|
5e06c10ef9 | ||
|
fa00499d93 | ||
|
ed323cfe7b | ||
|
5dc4c65f76 | ||
|
3dfef0e3a3 | ||
|
87a55ed5bb | ||
|
40afdaccc7 | ||
|
290ab4bec2 | ||
|
14baa34888 | ||
|
5c03f0cfab | ||
|
f9ec0b9e18 | ||
|
d2ab853939 | ||
|
fae12cefda | ||
|
1dbd208832 | ||
|
2b1e28a0d5 | ||
|
2c268fc873 | ||
|
15535a460c | ||
|
c2a2dba621 | ||
|
f340fcd3a2 | ||
|
7f71f3e3bc | ||
|
0170c3015e | ||
|
141df2033d | ||
|
a8c9f864e5 | ||
|
8b5bdd266f | ||
|
97a5dcf317 | ||
|
e78f59126a | ||
|
81b070322e | ||
|
aabbb4461e | ||
|
e08c17df4b | ||
|
01be9f66e4 | ||
|
4381179378 | ||
|
015aff3cb3 | ||
|
fb44416902 | ||
|
6721c7829f | ||
|
df745f597c | ||
|
95a791e871 | ||
|
7196ac5067 | ||
|
1db7253e63 | ||
|
1998674217 | ||
|
d6e269a7fa | ||
|
bd1b9d24d6 | ||
|
1c42312010 | ||
|
31e0616a42 | ||
|
b3767f9f59 | ||
|
c68ac3f03a | ||
|
e8f79e99b5 | ||
|
5433a17aa5 | ||
|
0ab72c4208 | ||
|
e71bb980a5 | ||
|
7c0a4d7a50 | ||
|
ca65abd10c | ||
|
26f1abd717 | ||
|
281894d08a | ||
|
b2f3d3d526 | ||
|
1bc19bc850 | ||
|
73b20836c8 | ||
|
aef599de95 | ||
|
0fcae326cb | ||
|
6d38fb9c39 | ||
|
64d13302d5 | ||
|
cc9ce84648 | ||
|
9d6d3dec95 | ||
|
365dbafcc9 | ||
|
da4e3b60c0 | ||
|
ed1edc32db | ||
|
dbb3db8e6b | ||
|
27d55c2e51 | ||
|
2bc94dbe6a | ||
|
d3b00d894b | ||
|
5a142a2353 | ||
|
88b244a6df | ||
|
1fd4892969 | ||
|
a48a587fcd | ||
|
30f5aae0be | ||
|
14d7d93373 | ||
|
4f92cb32c2 | ||
|
1e3e3ce8b3 | ||
|
e3c80959f8 | ||
|
b36a30c4c3 | ||
|
7f8833286c | ||
|
3bfee0107d | ||
|
9d263cb2c9 | ||
|
01a1b5d62d | ||
|
1286de90ae | ||
|
b6de5a3261 | ||
|
5abc7c89db | ||
|
32165e0b18 | ||
|
bdb27de2f1 | ||
|
70f3338470 | ||
|
f82f677f79 | ||
|
a8a425bec1 | ||
|
4bb991ebe8 | ||
|
2c87b85daa | ||
|
fabf51c624 | ||
|
5655dd70a8 | ||
|
4d7383637a | ||
|
8ee7c234e1 | ||
|
b757c19778 | ||
|
2574431dd8 | ||
|
b43422f090 | ||
|
450a7f3c2f | ||
|
79f0ef2701 | ||
|
ce14f9b241 | ||
|
843b460614 | ||
|
15b089f043 | ||
|
2baee12915 | ||
|
1d13ebe490 | ||
|
dee1b7ba75 | ||
|
469a015b8b | ||
|
44860b5cba | ||
|
dd2e241207 | ||
|
986353aa88 | ||
|
5b4a0c3bbf | ||
|
e60fb9921e | ||
|
5cb23c76c3 | ||
|
02fa169760 | ||
|
3d83dc775f | ||
|
432942abf8 | ||
|
29d506a862 | ||
|
83f7be1c7d | ||
|
bbc74df954 | ||
|
fbb65d4568 | ||
|
543b8ae883 | ||
|
51e2cd0a45 | ||
|
aa3d785b97 | ||
|
cd40c09496 | ||
|
7c0fcf42cf | ||
|
a32056db45 | ||
|
de0c1da61c | ||
|
8b0ba10a5a | ||
|
8d681709d2 | ||
|
7f0cdeba25 | ||
|
f4d9b9c53d | ||
|
7b8949dc2b | ||
|
108581e4ef | ||
|
83264e41f3 | ||
|
79f4abe6bd | ||
|
9da99040e1 | ||
|
c3fe4d16bc | ||
|
c1a523acf6 | ||
|
03653831c8 | ||
|
fb12bc8d85 | ||
|
6bbf1ffd51 | ||
|
0c118fb984 | ||
|
b33b85860f | ||
|
d1ef0e47f9 | ||
|
5466099cae | ||
|
2df64961e6 | ||
|
d01a5e36fb | ||
|
97b9982ba0 | ||
|
cac3aeb813 | ||
|
7b24e315b7 | ||
|
73abb00785 | ||
|
4d16d07b2c | ||
|
54be2aa7d0 | ||
|
42e807db22 | ||
|
76f216f516 | ||
|
5def336ff9 | ||
|
b90f3ec00d | ||
|
e58399298f | ||
|
e31c081732 | ||
|
588f67b2e9 | ||
|
e3a623b31f | ||
|
8cacd03c40 | ||
|
5ea80e31e0 | ||
|
83f80306d3 | ||
|
bfc41e03ea | ||
|
7241410c2d | ||
|
8284902d57 | ||
|
791e73c1b6 | ||
|
80d1439471 | ||
|
197cd7afde | ||
|
326a846be3 | ||
|
97542ada1b | ||
|
db5e6b7868 | ||
|
81ff2288b9 | ||
|
cd0d8296a5 | ||
|
03e5fc320c | ||
|
b29abf8da1 | ||
|
6f55f9238b | ||
|
ad870b2120 | ||
|
d9ea1c3d7c | ||
|
6531d3ee87 | ||
|
c7935e6636 | ||
|
a33d1a39d9 | ||
|
cbaa84f50e | ||
|
339413581d | ||
|
7696d90752 | ||
|
c83bb55df3 | ||
|
e76cd74d5b | ||
|
099b206e66 | ||
|
10a6b56b34 | ||
|
8e83ca5bd1 | ||
|
524052b4bf | ||
|
f4eaded4f3 | ||
|
2efff484fc | ||
|
b134abb96e | ||
|
1a1bfabda0 | ||
|
a8ea2d4e02 | ||
|
ce571b6ef3 | ||
|
ac3eeb1508 | ||
|
e9691d6b71 | ||
|
7734822789 | ||
|
75af5452bc | ||
|
c9019ca5fa | ||
|
ee8e1abfd4 | ||
|
6b576be9a5 | ||
|
e823494ab5 | ||
|
f7f3b91f46 | ||
|
0c90ab6bfe | ||
|
35b75e9027 | ||
|
2d5eb31569 | ||
|
146e94c1ac | ||
|
e7bd1d284a | ||
|
b0b62f5444 | ||
|
5d430aa2ee | ||
|
93481f78cf | ||
|
2dc3560f08 | ||
|
8808a47dc7 | ||
|
d5550aa245 | ||
|
db0f5eda80 | ||
|
7947bd3f05 | ||
|
2c3d224e62 | ||
|
2fbb4c30c3 | ||
|
0dfc0e5951 | ||
|
fc4d4cde4f | ||
|
b23f2b9c5a | ||
|
4f35153ac2 | ||
|
82f02a7ab5 | ||
|
16975a3062 | ||
|
9b4ff3e2e3 | ||
|
798f558558 | ||
|
033d66a81a | ||
|
f311163ef4 | ||
|
8947295b83 | ||
|
fccf7b3c63 | ||
|
98c618dbaf | ||
|
4ae5fe6ede | ||
|
230b397530 | ||
|
fc2183b970 | ||
|
25fe85c8f1 | ||
|
c554b42f17 | ||
|
988da91526 | ||
|
d1257fb00b | ||
|
31ec9de178 | ||
|
05a9ff440f | ||
|
b54cac24b1 | ||
|
950b816ca6 | ||
|
dc0c47f5fa | ||
|
dbefe506f0 | ||
|
454b328442 | ||
|
52353d79ef | ||
|
6dcc5ffac8 | ||
|
f73aa53e40 | ||
|
07a8e823f8 | ||
|
489f7017d1 | ||
|
b2ef78b556 | ||
|
d1a5a9c0e2 | ||
|
eaeff17cb9 | ||
|
9e2a7bc23b | ||
|
d1c4f58c2e | ||
|
53c079f00a | ||
|
b23bb4b218 | ||
|
5491848f29 | ||
|
2548103a77 | ||
|
c396744e64 | ||
|
a6156db3a9 | ||
|
ad965bbcb9 | ||
|
2a8babb4f8 | ||
|
a8c582c302 | ||
|
31c661a1e8 | ||
|
a5c197fa99 | ||
|
09addce76e | ||
|
6c280ef102 | ||
|
1623d2b1fb | ||
|
2cabdf2864 | ||
|
397218d9e6 | ||
|
1eb7991f36 | ||
|
bae207e053 | ||
|
4c3dcbcc36 | ||
|
74baf298c5 | ||
|
9f8d7f5198 | ||
|
8f60502a0e | ||
|
d79b092542 | ||
|
4d85666c18 | ||
|
faf95e268e | ||
|
1d69c31aca | ||
|
ca2bd3df8a | ||
|
49185659f6 | ||
|
d9a91f514f | ||
|
5371f9f5db | ||
|
df85b392b8 | ||
|
af9432be1a | ||
|
7e4b4cf9d8 | ||
|
70e5f13649 | ||
|
09c8deed7f | ||
|
a5118781e2 | ||
|
f1ebf0fcc8 | ||
|
e2175d6d0f | ||
|
3854ad3bb5 | ||
|
276c429070 | ||
|
34e79a661c | ||
|
9e422f259d | ||
|
21aba2e8be | ||
|
ac1e309b99 | ||
|
c47ed55eb8 | ||
|
20473439c0 | ||
|
1a4622deb1 | ||
|
daaac9038a | ||
|
47ef2a091e | ||
|
208025b7c8 | ||
|
408a344bad | ||
|
6a63c2da9d | ||
|
bd216f4581 | ||
|
2a034bd1ed | ||
|
eecbcbc4ea | ||
|
e6ffd0130e | ||
|
e0b21a9a3f | ||
|
1e7120be12 | ||
|
4704926a64 | ||
|
8f930f8c6d | ||
|
52465c5cf4 | ||
|
bb8ccb57b7 | ||
|
bf0e5a0f3c | ||
|
ed03e383e0 | ||
|
0566c705b5 | ||
|
c90badf68c | ||
|
d05d7e77b9 | ||
|
5219b4e1fc | ||
|
82c1f97b7d | ||
|
5bbfb1880b | ||
|
13556f2e7d | ||
|
a72c03a7c7 | ||
|
27d78e32ff | ||
|
954b19a064 | ||
|
6abf4ded20 | ||
|
20e2fe9a99 | ||
|
8788146d39 | ||
|
8a8e35cfab | ||
|
75a3df1bd7 | ||
|
7ade902802 | ||
|
246e5519b9 | ||
|
1839a71bbd | ||
|
31f4dd3edc | ||
|
25c33271a6 | ||
|
cc070065a9 | ||
|
28b54e8adf | ||
|
63b2bf2255 | ||
|
2c34eb68d4 | ||
|
cd160deff0 | ||
|
3e47ca02f3 | ||
|
de50eb52dc | ||
|
e8c599f33f | ||
|
86312eb270 | ||
|
48a62e5011 | ||
|
ebda1cb7ba | ||
|
8637f7240b | ||
|
d2ba3e0dc7 | ||
|
14b9fa89a5 | ||
|
6f4fb89839 | ||
|
2fcf8b6c42 | ||
|
696d7d35bb | ||
|
8deb6e8cca | ||
|
783a1160ea | ||
|
e439fc04f4 | ||
|
812acbe956 | ||
|
6496e1bad1 | ||
|
928c12abc7 | ||
|
e007040feb | ||
|
ee1fd08621 | ||
|
08a61017f9 | ||
|
f42a4ce42d | ||
|
f4f699b73a | ||
|
68fed3a3e5 | ||
|
be4c58d242 | ||
|
ad3c63a3d4 | ||
|
b180b797ee | ||
|
9d165d34f5 | ||
|
e2fff5db3c | ||
|
3d886007b3 | ||
|
3dabdda2b8 | ||
|
ce8aa7f921 | ||
|
b2c7eaeb14 | ||
|
a01a304a83 | ||
|
d626ae68be | ||
|
5ee512a77b | ||
|
6257af8e71 | ||
|
dd84366820 | ||
|
b24cdaec96 | ||
|
25a3e4df3d | ||
|
946c1f79d5 | ||
|
9db1ae1b15 | ||
|
abde9ff8fa | ||
|
4e78ac015a | ||
|
289e4d228a | ||
|
23024a9162 | ||
|
6b9077ef35 | ||
|
60929b17bf | ||
|
702efc6a11 | ||
|
3936d266e7 | ||
|
7f7bcaef5f | ||
|
ad494c4dc9 | ||
|
8b1c3a7ba6 | ||
|
f3c304c5b7 | ||
|
bc1c7ffdee | ||
|
8f32e07721 | ||
|
9617d9e864 | ||
|
15d9ad3500 | ||
|
658031c004 | ||
|
599cf96199 | ||
|
23f7fbf39f | ||
|
cb973d3ea9 | ||
|
d261be9b07 | ||
|
2c0fa8eb72 | ||
|
a768bc31ed | ||
|
7433dbd24c | ||
|
a464d2bff5 | ||
|
99ecf3774b | ||
|
29d6d8daf3 | ||
|
a5d19114cb | ||
|
6c8f9cad05 | ||
|
28b3002ded | ||
|
af4bc97bf2 | ||
|
3ab9fcc1a8 | ||
|
4e389d4de2 | ||
|
85c2849037 | ||
|
3cd0ec09dc | ||
|
614b876faf | ||
|
3cb31c2616 | ||
|
b0452c7932 | ||
|
03e10b4507 | ||
|
207d6b4956 | ||
|
e55b1e3344 | ||
|
0d5e023887 | ||
|
42bd547365 | ||
|
0f39d039d0 | ||
|
af67698147 | ||
|
0a4eb5900a | ||
|
db8547c173 | ||
|
f112ec8ddd | ||
|
37f4faa2ff | ||
|
362ec1f2a2 | ||
|
00abeaba1b | ||
|
5b15c1c284 | ||
|
7c70d34552 | ||
|
4282ad853e | ||
|
664e29b6dc | ||
|
29bc706fd7 | ||
|
5ce635283e | ||
|
4e945e9b4e | ||
|
0ac1a1d44b | ||
|
fafb50476b | ||
|
6e875be7ca | ||
|
0f68f836d3 | ||
|
30157ecb94 | ||
|
8384465526 | ||
|
356b4d3194 | ||
|
daefb787f3 | ||
|
05590c76b3 | ||
|
37d9d215c5 | ||
|
a3b46fb25f | ||
|
beda4326cb | ||
|
fd87b58bca | ||
|
5bac23c097 | ||
|
341ca86075 | ||
|
70954e8cdb | ||
|
aba5dda41b | ||
|
ce75fde7a8 | ||
|
2e1c8ebc0e | ||
|
13fb6babb7 | ||
|
572d64323e | ||
|
fa9f43227c | ||
|
4a5403e0c3 | ||
|
aee0387649 | ||
|
c506bbff08 | ||
|
0e5e21d5a3 | ||
|
d3ddd11ed9 | ||
|
027ae36e69 | ||
|
a0ab314424 | ||
|
e25f5ba2f3 | ||
|
bc037a6758 | ||
|
75fb5bfe92 | ||
|
ef47cbedff | ||
|
8d04772473 | ||
|
537f1b999b | ||
|
cf1ce4b660 | ||
|
f259e2e700 | ||
|
5c7ce4f3a4 | ||
|
d322887f05 | ||
|
878aa46457 | ||
|
5315020c1e | ||
|
ded831e9a7 | ||
|
2f2ef57e9d | ||
|
514815a559 | ||
|
b050af69d1 | ||
|
70a9286c33 | ||
|
d0c5296540 | ||
|
bd7591a3c9 | ||
|
efc3dd429d | ||
|
242930c425 | ||
|
0a9ba78091 | ||
|
5baddfa952 | ||
|
b9c2967b18 | ||
|
0f47fd5d50 | ||
|
6f97bf10e7 | ||
|
33795d5267 | ||
|
58c0e1207d | ||
|
fa5824e03c | ||
|
b9471a505e | ||
|
4e3802cde3 | ||
|
1018411068 | ||
|
cebb6deac8 | ||
|
38e53c08db | ||
|
d2aab04430 | ||
|
0f8103d6ae | ||
|
27e355cd56 |
53
.htaccess
53
.htaccess
@@ -1,13 +1,15 @@
|
|||||||
#
|
#
|
||||||
# Monstra CMS :: php & apache settings
|
# This file is part of the Monstra.
|
||||||
|
#
|
||||||
|
# (c) Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
#
|
||||||
|
# For the full copyright and license information, please view the LICENSE
|
||||||
|
# file that was distributed with this source code.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Set default charset utf-8
|
# Set default charset utf-8
|
||||||
AddDefaultCharset UTF-8
|
AddDefaultCharset UTF-8
|
||||||
|
|
||||||
# Don't show directory listings for URLs which map to a directory.
|
|
||||||
Options -Indexes
|
|
||||||
|
|
||||||
# PHP 5, Apache 1 and 2.
|
# PHP 5, Apache 1 and 2.
|
||||||
<IfModule mod_php5.c>
|
<IfModule mod_php5.c>
|
||||||
php_flag magic_quotes_gpc off
|
php_flag magic_quotes_gpc off
|
||||||
@@ -15,12 +17,47 @@ Options -Indexes
|
|||||||
php_flag register_globals off
|
php_flag register_globals off
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
# Setting rewrite rules.
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteBase /projects/monstra-cms/
|
|
||||||
|
## Begin - Rewrite rules to block out some common exploits.
|
||||||
|
# If you experience problems on your site block out the operations listed below
|
||||||
|
# This attempts to block the most common type of exploit `attempts` to Monstra
|
||||||
|
#
|
||||||
|
# Block out any script trying to base64_encode data within the URL.
|
||||||
|
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
|
||||||
|
# Block out any script that includes a <script> tag in URL.
|
||||||
|
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
|
||||||
|
# Block out any script trying to set a PHP GLOBALS variable via URL.
|
||||||
|
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
|
||||||
|
# Block out any script trying to modify a _REQUEST variable via URL.
|
||||||
|
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
|
||||||
|
# Return 403 Forbidden header and show the content of the root homepage
|
||||||
|
RewriteRule .* index.php [F]
|
||||||
|
#
|
||||||
|
## End - Rewrite rules to block out some common exploits.
|
||||||
|
|
||||||
|
## Begin - Rewrite rules for Monstra
|
||||||
|
RewriteBase /%siteurlhere%/
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||||
</IfModule>
|
## End - Rewrite rules for Monstra
|
||||||
|
|
||||||
|
## Begin - Rewrite rules for SEO improvements.
|
||||||
|
# RewriteCond %{HTTP_HOST} ^www.example.org [NC]
|
||||||
|
# RewriteRule ^(.*)$ http://example.org/$1 [R=301,L]
|
||||||
|
# Redirect 301 /index http://example.org/
|
||||||
|
## End - Rewrite rules for SEO improvements.
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Prevent visitors from viewing files directly.
|
||||||
|
<FilesMatch "(^#.*#|\.(md|txt|html|tpl|yml|yaml)|~)$">
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
Satisfy All
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# Don't show directory listings for URLs which map to a directory.
|
||||||
|
Options -Indexes
|
||||||
|
@@ -1,10 +1,155 @@
|
|||||||
|
Monstra 3.0.3, 2016-01-29
|
||||||
|
------------------------
|
||||||
|
- Improved Monstra Security
|
||||||
|
- Minimum PHP version for Monstra is 5.3.2
|
||||||
|
- Admin: Fixed 404 error when using certain server configurations
|
||||||
|
- Localization: Major Fixes for SR, KA-GE, and ES
|
||||||
|
- Install Script Fixes
|
||||||
|
|
||||||
|
Monstra 3.0.2, 2015-10-16
|
||||||
|
------------------------
|
||||||
|
- Added Monstra MIT LICENSE instead of GNU GENERAL PUBLIC LICENSE v3
|
||||||
|
- Code standards fixes.
|
||||||
|
- Localization: Major Fixes for ES and SR
|
||||||
|
|
||||||
|
Monstra 3.0.1, 2014-08-10
|
||||||
|
------------------------
|
||||||
|
- Minimum php is 5.3
|
||||||
|
- Themes Plugin: Imposible to create new CSS - fixed
|
||||||
|
- Themes Plugin: js and css counter does not recalculate - fixed
|
||||||
|
- Error in Monstra Notifications - fixed
|
||||||
|
- Updated plugins url from plugins.monstra.org to monstra.org/download/plugins
|
||||||
|
|
||||||
|
Monstra 3.0.0, 2014-08-01
|
||||||
|
------------------------
|
||||||
|
- Mobile Ready! Monstra fully responsive for mobile devices, tablets, and normal computer screens.
|
||||||
|
- Twitter Bootstrap updated to 3.1.1
|
||||||
|
- Idiorm updated to 1.4.1
|
||||||
|
- jQuery updated to 2.1.0
|
||||||
|
- Admin: New Modern User Interface
|
||||||
|
- Site: New default theme
|
||||||
|
- Layout fixes according to World Wide Web Consortium (W3C) Standards
|
||||||
|
- Prefetch DNS to reduce look up times
|
||||||
|
- Files Manager: added ability to create & rename directories.
|
||||||
|
- Files Manager: Maximum upload file size message - added.
|
||||||
|
- Files Manager: Bootstrap fileinput.js updated to 3.0.0
|
||||||
|
- Files Manager: File Info Popup
|
||||||
|
- Backup: Restore Site from Backup added
|
||||||
|
- Plugins Manager: Uploading new plugins via the admin panel added
|
||||||
|
- Plugins Manager: Read plugin help(README.MD) ability added.
|
||||||
|
- Responsive Chocolat Lightbox instead of TB Lightbox
|
||||||
|
- Blog Plugin as a part of Monstra CMS
|
||||||
|
- CodeMirror Plugin as a part of Monstra CMS
|
||||||
|
- Markdown Plugin as a part of Monstra CMS
|
||||||
|
- MarkItUp Color Pallete fixes
|
||||||
|
- Site Url without trailing slashes
|
||||||
|
- Admin Help Section - added.
|
||||||
|
- Pages Plugin: tags field added.
|
||||||
|
- Pages Plugin: Meta Title added.
|
||||||
|
- Sitemap Errors Fixes.
|
||||||
|
- Monstra automatically renames files - fixed
|
||||||
|
- Monstra Dashboard created and set as default Plugin for Admin Panel
|
||||||
|
- Ink Framework for Monstra Email Templates
|
||||||
|
- iCheck plugin for checkboxes added.
|
||||||
|
- Emails Manager Plugin added.
|
||||||
|
- HubSpot Messaging Library added for notifications
|
||||||
|
- Gelato: Unzip Functionality added.
|
||||||
|
- Gelato: Number Class new method convertToBytes() added.
|
||||||
|
- Gelato: ErroHandler styles updates
|
||||||
|
- Users Plugin getGravatarURL() improve
|
||||||
|
- Plugin API - Actions - Closure support added.
|
||||||
|
- Plugin API - Filters - Closure support added.
|
||||||
|
- Core: Better statuses notification (error,success,warning)
|
||||||
|
- Core: Store user_email in Session
|
||||||
|
- Core: Javascript may be broken if there is no break line - fixed
|
||||||
|
- Core: Added ability to avoid caching JS/CSS by the browser.
|
||||||
|
- Core: Monstra automatically rename files Issue - fixed
|
||||||
|
- Sandbox Plugin cleanup
|
||||||
|
- New Flags: Japanese(JA), Indonesian(ID), Chinese(ZH-CN), Turkish(TR) added.
|
||||||
|
- Localization: Japanese(JA), Indonesian(ID), Chinese(ZH-CN), Turkish(TR) translations added.
|
||||||
|
- Localization: Major Fixes
|
||||||
|
|
||||||
|
Monstra 2.3.1, 2013-12-25
|
||||||
|
------------------------
|
||||||
|
- Localization: Major Fixes
|
||||||
|
- Gelato: Image.php Major Fixes
|
||||||
|
- Sitemap: Errors #175 - fixes
|
||||||
|
- New favicon added #182 - by bernte
|
||||||
|
- Layouts: General Fixes - by bernte
|
||||||
|
- Installer: SERVER_PORT issue - fixed by KANekT
|
||||||
|
- Gelato: Number Class - updated bytes format (JEDEC & IEC 60027) by mbarzda
|
||||||
|
- Email Layout: footer fixes
|
||||||
|
|
||||||
|
Monstra 2.3.0, 2013-12-19
|
||||||
|
------------------------
|
||||||
|
- Update Twitter Bootstrap to 2.3.2
|
||||||
|
- Security: Added limits for login attempts #104
|
||||||
|
- Security: Obfuscate users email to prevent spam-bots from sniffing it.
|
||||||
|
- Core: Added ability to map Monstra Engine Directory.
|
||||||
|
- Core: Maintenance Mode Improvements
|
||||||
|
- Core: ORM::configure - driver options added
|
||||||
|
- Gelato: Image.php fix for PNG files
|
||||||
|
- Gelato: Number.php: Undefined offset fix
|
||||||
|
- XMLDB: error select for empty table fix
|
||||||
|
- Plugin API: Stylesheet.php updates - sourcecode misses a linebreak after minified css
|
||||||
|
- Files Manager: jasny bootstrap-fileupload - added #89
|
||||||
|
- Users Plugin: login page fixes
|
||||||
|
- Users Plugin: Deleting users - fixed by Oleg Gatseluk #158
|
||||||
|
- Pages Plugin: General method getPages() created #123
|
||||||
|
- Pages Plugin: page expand ajax bug #115 - fixed
|
||||||
|
- Pages Plugin: Improved available() method to show only published pages
|
||||||
|
- Pages Plugin: Bug with pages renaming - fixed
|
||||||
|
- Monstra Email Templates #164
|
||||||
|
- Localization: Major Fixes
|
||||||
|
- Localization: PL added
|
||||||
|
- Localization: NL added
|
||||||
|
- .htaccess SEO improvements
|
||||||
|
|
||||||
|
Monstra 2.2.1, 2013-04-06
|
||||||
|
------------------------
|
||||||
|
- Update Gelato to 1.0.3
|
||||||
|
- Error Handler turned off for Production environment
|
||||||
|
- Localization: Farsi(fa) translations fixes.
|
||||||
|
- Pages Manager: fix translates #107
|
||||||
|
- Missing Translation on Login Page - fixed #106
|
||||||
|
- Lithuanian flag and other languages fixes. Thanks to mbarzda
|
||||||
|
|
||||||
|
Monstra 2.2.0, 2013-03-25
|
||||||
|
------------------------
|
||||||
|
- Mobile Ready! Monstra fully responsive for mobile devices, tablets, and normal computer screens.
|
||||||
|
- Improved Monstra Architecture!
|
||||||
|
- New Stand-alone Monstra Library (Gelato) was created! Totally improved old classes and added new classes!
|
||||||
|
- Monstra Library with new useful classes - ClassLoader, ErrorHandler, Log, MinifyJS, MinifyCSS, MinifyHTML, Token, Registry.
|
||||||
|
- Adopted PSR-0 PSR-1 PSR-2
|
||||||
|
- Localization: Farsi(fa), Magyar(hu), Français(fr), Spanish(es), Serbian(sr-yu), Slovakian(sk) translations added. Thanks to Abdulhalim, Lez, Neri, Mapadesign, Hugomano and Nakome.
|
||||||
|
- Idiorm Updated to 1.3.0
|
||||||
|
- jQuery Updated to 1.9.1
|
||||||
|
- Twitter Bootstrap Updated to 2.3.0
|
||||||
|
- Default Theme: Social Meta Tags - added.
|
||||||
|
- Default Theme: Hook "theme_meta" - added.
|
||||||
|
- Admin Default Theme: Added missing meta tags.
|
||||||
|
- Improve Installer Usability. Flags Added.
|
||||||
|
- Default Site Email added.
|
||||||
|
- PHPMailer added.
|
||||||
|
- Pages Manager: added ability to quickly update page status and page access.
|
||||||
|
- Intstaller Layout: Added missing meta tags.
|
||||||
|
- Filesmanager plugin: added ability to view images.
|
||||||
|
- Filesmanager Plugin: forbidden types array - updated.
|
||||||
|
- CSRF detection text - updated.
|
||||||
|
- Engine Uri: code improvements.
|
||||||
|
- XMLDB: Table Class - fixed select method. Thanks to DmitriyMX
|
||||||
|
- Bootstrap CSS: Icons url - fixed.
|
||||||
|
- Plugins Manager: buttons confirm dialog message - fixed.
|
||||||
|
- Pages Manager: page cloning problem - fixed.
|
||||||
|
- Localizations: translations fixes.
|
||||||
|
|
||||||
Monstra 2.1.3, 2012-12-09
|
Monstra 2.1.3, 2012-12-09
|
||||||
------------------------
|
------------------------
|
||||||
- Pages Plugin: New shortcodes added - page_author, page_slug, page_url page_available, page_breadcrumbs, page_date, page_content.
|
- Pages Plugin: New shortcodes added - page_author, page_slug, page_url page_available, page_breadcrumbs, page_date, page_content.
|
||||||
- Pages Plugin: add ability to get content for specific page.
|
- Pages Plugin: add ability to get content for specific page.
|
||||||
- XMLDB: New method factory() added.
|
- XMLDB: New method factory() added.
|
||||||
- Twitter Bootstrap updated to Version 2.2.2
|
- Twitter Bootstrap updated to Version 2.2.2
|
||||||
- Sitemap Plugin: _blank removed.
|
- Sitemap Plugin: `_blank` removed.
|
||||||
- Filesmanager Plugin: fixes.
|
- Filesmanager Plugin: fixes.
|
||||||
- Backup Plugin: fixes.
|
- Backup Plugin: fixes.
|
||||||
|
|
||||||
@@ -99,7 +244,7 @@ Monstra 2.0.0, 2012-10-09
|
|||||||
- Users Plugin: Admin - New User Registration Validation - Fixed
|
- Users Plugin: Admin - New User Registration Validation - Fixed
|
||||||
- Users Plugin: Added ability to set "about me" information.
|
- Users Plugin: Added ability to set "about me" information.
|
||||||
- Improved Password Reset Logic.
|
- Improved Password Reset Logic.
|
||||||
- Information Plugin: Added new tab "Server" with common server information.
|
- Information Plugin: Added new tab "Server" with common server information.
|
||||||
- Box Plugins: CSRF vulnerability resolved.
|
- Box Plugins: CSRF vulnerability resolved.
|
||||||
- Sitemap Plugin: Basic search engine optimization.
|
- Sitemap Plugin: Basic search engine optimization.
|
||||||
- Improved Menu Plugin. Added ability to manage items categories.
|
- Improved Menu Plugin. Added ability to manage items categories.
|
||||||
@@ -109,12 +254,12 @@ Monstra 2.0.0, 2012-10-09
|
|||||||
- Dir Helper: Fixed size() method.
|
- Dir Helper: Fixed size() method.
|
||||||
- New Default Theme: built with best frontend optimization practice.
|
- New Default Theme: built with best frontend optimization practice.
|
||||||
- Options API: Updated get() method. Return empty string if option value doesnt exists.
|
- Options API: Updated get() method. Return empty string if option value doesnt exists.
|
||||||
- CSS variables: Added - @theme_site_url @theme_admin_url
|
- CSS variables: Added - @theme_site_url @theme_admin_url
|
||||||
- CSS variables: Deleted - @theme_url
|
- CSS variables: Deleted - @theme_url
|
||||||
- Themes Plugin: Added ability to create/edit/clone JavaScripts. Added ability to change admin theme in one click.
|
- Themes Plugin: Added ability to create/edit/clone JavaScripts. Added ability to change admin theme in one click.
|
||||||
- Apply filter 'content' to Blocks.
|
- Apply filter 'content' to Blocks.
|
||||||
- Array Helper: get() method improved. New methods keyExists() isAssoc() set() delete() random() added.
|
- Array Helper: get() method improved. New methods keyExists() isAssoc() set() delete() random() added.
|
||||||
- Plugin API: Fixed Javascript and Stylesheet class.
|
- Plugin API: Fixed Javascript and Stylesheet class.
|
||||||
- Plugin API: Added ability to set view file from current theme folder.
|
- Plugin API: Added ability to set view file from current theme folder.
|
||||||
- New options theme_admin_name, theme_site_name, users_frontend_registration added.
|
- New options theme_admin_name, theme_site_name, users_frontend_registration added.
|
||||||
- Form Helper: Custom Macros - added
|
- Form Helper: Custom Macros - added
|
||||||
@@ -134,10 +279,10 @@ Monstra 1.3.0, 2012-09-01
|
|||||||
- Improve Default Monstra theme.
|
- Improve Default Monstra theme.
|
||||||
- Security: Fix Script Insertion Vulnerability.
|
- Security: Fix Script Insertion Vulnerability.
|
||||||
- Blocks and Snippets plugins code fix. Issue #35, Issue #34
|
- Blocks and Snippets plugins code fix. Issue #35, Issue #34
|
||||||
- XMLDB: new method updateField()
|
- XMLDB: new method updateField()
|
||||||
- Plugin API: path updates.
|
- Plugin API: path updates.
|
||||||
- Dir Helper: new method size()
|
- Dir Helper: new method size()
|
||||||
- Filesmanager: shows directory size.
|
- Filesmanager: shows directory size.
|
||||||
- Security Helper: update safeName() method.
|
- Security Helper: update safeName() method.
|
||||||
- Pages Plugin: new method children() Get children pages for a specific parent page.
|
- Pages Plugin: new method children() Get children pages for a specific parent page.
|
||||||
- Update translates.
|
- Update translates.
|
||||||
@@ -145,11 +290,11 @@ Monstra 1.3.0, 2012-09-01
|
|||||||
|
|
||||||
Monstra 1.2.1, 2012-08-09
|
Monstra 1.2.1, 2012-08-09
|
||||||
------------------------
|
------------------------
|
||||||
- Admin styles: add .error class
|
- Admin styles: add .error class
|
||||||
- Fix translates
|
- Fix translates
|
||||||
- Security: fix Cross Site Request Forgery
|
- Security: fix Cross Site Request Forgery
|
||||||
- Site Module: fix template() function
|
- Site Module: fix template() function
|
||||||
- Html Helper: fix nbsp() function
|
- Html Helper: fix nbsp() function
|
||||||
- Site Module: fix template() function
|
- Site Module: fix template() function
|
||||||
|
|
||||||
Monstra 1.2.0, 2012-07-03
|
Monstra 1.2.0, 2012-07-03
|
||||||
@@ -175,7 +320,7 @@ Monstra 1.1.4, 2012-06-09
|
|||||||
------------------------
|
------------------------
|
||||||
- Improve Monstra Error Handler
|
- Improve Monstra Error Handler
|
||||||
|
|
||||||
Monstra 1.1.3, 2012-06-06
|
Monstra 1.1.3, 2012-06-06
|
||||||
------------------------
|
------------------------
|
||||||
- Improve Monstra Error Handler
|
- Improve Monstra Error Handler
|
||||||
|
|
||||||
@@ -211,4 +356,4 @@ Monstra 1.0.1, 2012-04-26
|
|||||||
|
|
||||||
Monstra 1.0.0, 2012-04-24
|
Monstra 1.0.0, 2012-04-24
|
||||||
------------------------
|
------------------------
|
||||||
- Initial release
|
- Initial release
|
21
LICENSE.md
Normal file
21
LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2012 - 2016 Monstra Content Management
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
27
README.md
27
README.md
@@ -1,15 +1,12 @@
|
|||||||
# Monstra CMS
|
# Monstra
|
||||||
|
Monstra is a modern and lightweight Content Management System.
|
||||||
Fast and small content management system written in PHP!
|
|
||||||
|
|
||||||
|
[](https://gitter.im/monstra-cms/monstra?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
## System Requirements
|
## System Requirements
|
||||||
- UNIX/Linux host
|
Operation system: Unix, Linux, Windows, Mac OS
|
||||||
- PHP 5.2.0 or higher
|
Middleware: PHP 5.3.2 or higher with PHP's [SimpleXML module](http://php.net/simplexml) and [Multibyte String module](http://php.net/mbstring)
|
||||||
- SimpleXML Module
|
Webserver: Apache with [Mod Rewrite](http://httpd.apache.org/docs/current/mod/mod_rewrite.html) or Ngnix with [Rewrite Module](http://wiki.nginx.org/HttpRewriteModule)
|
||||||
- Apache Mod Rewrite
|
|
||||||
- Multibyte String
|
|
||||||
|
|
||||||
|
|
||||||
## Steps to Install
|
## Steps to Install
|
||||||
1. [Download the latest version.](http://monstra.org/download)
|
1. [Download the latest version.](http://monstra.org/download)
|
||||||
@@ -19,21 +16,19 @@ Fast and small content management system written in PHP!
|
|||||||
5. Also you may also need to recursively CHMOD the /install.php, /.htaccess and /sitemap.xml to 755(or 777) if your host doesn't set it implicitly.
|
5. Also you may also need to recursively CHMOD the /install.php, /.htaccess and /sitemap.xml to 755(or 777) if your host doesn't set it implicitly.
|
||||||
6. Type http://example.org/install.php in the browser.
|
6. Type http://example.org/install.php in the browser.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
1. Help on the [Forum.](http://forum.monstra.org)
|
1. Help on the [Forum.](http://forum.monstra.org)
|
||||||
2. Donate to keep Monstra free. We will add you to Monstra [Sponsors Page.](http://monstra.org/about/sponsors)
|
2. Donate to keep Monstra free. We will add you to Monstra [Sponsors Page.](http://monstra.org/contribute/sponsors)
|
||||||
3. Develop a new plugin.
|
3. Develop a new plugin.
|
||||||
4. Create a new theme.
|
4. Create a new theme.
|
||||||
5. Find and [report issues.](https://github.com/Monstra/monstra-cms/issues)
|
5. Find and [report issues.](https://github.com/monstra-cms/monstra/issues)
|
||||||
6. Link back to [Monstra](http://monstra.org).
|
6. Link back to [Monstra](http://monstra.org).
|
||||||
|
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
- [Site](http://monstra.org)
|
- [Site](http://monstra.org)
|
||||||
- [Forum](http://forum.monstra.org)
|
- [Forum](http://forum.monstra.org)
|
||||||
- [Documentation](http://monstra.org/documentation)
|
- [Documentation](http://monstra.org/documentation)
|
||||||
- [Github Repository](https://github.com/Monstra/monstra-cms)
|
- [Github Repository](https://github.com/monstra-cms/monstra)
|
||||||
|
|
||||||
|
## License
|
||||||
Copyright (C) 2012-2013 Romanenko Sergey / Awilum [awilum@msn.com]
|
See [LICENSE](https://github.com/monstra-cms/monstra/blob/master/LICENSE.md)
|
||||||
|
104
admin/index.php
104
admin/index.php
@@ -1,20 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Main engine defines
|
// Main engine defines
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/'));
|
define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/'));
|
||||||
@@ -32,25 +29,53 @@ $users = new Table('users');
|
|||||||
|
|
||||||
// Admin login
|
// Admin login
|
||||||
if (Request::post('login_submit')) {
|
if (Request::post('login_submit')) {
|
||||||
|
if (Cookie::get('login_attempts') && Cookie::get('login_attempts') >= 5) {
|
||||||
|
$login_error = __('You are banned for 10 minutes. Try again later', 'users');
|
||||||
|
} else {
|
||||||
|
$user = $users->select("[login='" . trim(Request::post('login')) . "']", null);
|
||||||
|
if (count($user) !== 0) {
|
||||||
|
if ($user['login'] == Request::post('login')) {
|
||||||
|
if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) {
|
||||||
|
if ($user['role'] == 'admin' || $user['role'] == 'editor') {
|
||||||
|
Session::set('admin', true);
|
||||||
|
Session::set('user_id', (int) $user['id']);
|
||||||
|
Session::set('user_login', (string) $user['login']);
|
||||||
|
Session::set('user_role', (string) $user['role']);
|
||||||
|
Session::set('user_email', (string) $user['email']);
|
||||||
|
Request::redirect('index.php');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$login_error = __('Wrong <b>username</b> or <b>password</b>', 'users');
|
||||||
|
|
||||||
$user = $users->select("[login='" . trim(Request::post('login')) . "']", null);
|
if (Cookie::get('login_attempts')) {
|
||||||
if (count($user) !== 0) {
|
if (Cookie::get('login_attempts') < 5) {
|
||||||
if ($user['login'] == Request::post('login')) {
|
$attempts = Cookie::get('login_attempts') + 1;
|
||||||
if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) {
|
Cookie::set('login_attempts', $attempts, 600);
|
||||||
if ($user['role'] == 'admin' || $user['role'] == 'editor') {
|
} else {
|
||||||
Session::set('admin', true);
|
$login_error = __('You are banned for 10 minutes. Try again later', 'users');
|
||||||
Session::set('user_id', (int) $user['id']);
|
}
|
||||||
Session::set('user_login', (string) $user['login']);
|
} else {
|
||||||
Session::set('user_role', (string) $user['role']);
|
Cookie::set('login_attempts', 1, 600);
|
||||||
Request::redirect('index.php');
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$login_error = __('Wrong <b>username</b> or <b>password</b>', 'users');
|
||||||
|
|
||||||
|
if (Cookie::get('login_attempts')) {
|
||||||
|
if (Cookie::get('login_attempts') < 5) {
|
||||||
|
$attempts = Cookie::get('login_attempts') + 1;
|
||||||
|
Cookie::set('login_attempts', $attempts, 600);
|
||||||
|
} else {
|
||||||
|
$login_error = __('You are banned for 10 minutes. Try again later', 'users');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$login_error = __('Wrong <b>username</b> or <b>password</b>', 'users');
|
Cookie::set('login_attempts', 1, 600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$login_error = __('Wrong <b>username</b> or <b>password</b>', 'users');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Notification::setNow('error', $login_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
@@ -63,10 +88,15 @@ $user_login = trim(Request::post('login'));
|
|||||||
|
|
||||||
// Reset Password Form Submit
|
// Reset Password Form Submit
|
||||||
if (Request::post('reset_password_submit')) {
|
if (Request::post('reset_password_submit')) {
|
||||||
|
if (Option::get('captcha_installed') == 'true' && ! CryptCaptcha::check(Request::post('answer'))) {
|
||||||
if (Option::get('captcha_installed') == 'true' && ! CryptCaptcha::check(Request::post('answer'))) $errors['users_captcha_wrong'] = __('Captcha code is wrong', 'users');
|
$errors['users_captcha_wrong'] = __('Captcha code is wrong', 'users');
|
||||||
if ($user_login == '') $errors['users_empty_field'] = __('Required field', 'users');
|
}
|
||||||
if ($user_login != '' && ! $users->select("[login='".$user_login."']")) $errors['users_user_doesnt_exists'] = __('This user doesnt exist', 'users');
|
if ($user_login == '') {
|
||||||
|
$errors['users_empty_field'] = __('Required field', 'users');
|
||||||
|
}
|
||||||
|
if ($user_login != '' && ! $users->select("[login='".$user_login."']")) {
|
||||||
|
$errors['users_user_doesnt_exists'] = __('This user doesnt exist', 'users');
|
||||||
|
}
|
||||||
|
|
||||||
if (count($errors) == 0) {
|
if (count($errors) == 0) {
|
||||||
|
|
||||||
@@ -79,25 +109,29 @@ if (Request::post('reset_password_submit')) {
|
|||||||
// Update user hash
|
// Update user hash
|
||||||
$users->updateWhere("[login='" . $user_login . "']", array('hash' => $new_hash));
|
$users->updateWhere("[login='" . $user_login . "']", array('hash' => $new_hash));
|
||||||
|
|
||||||
// Message
|
$mail = new PHPMailer();
|
||||||
$message = View::factory('box/users/views/frontend/reset_password_email')
|
$mail->CharSet = 'utf-8';
|
||||||
|
$mail->ContentType = 'text/html';
|
||||||
|
$mail->SetFrom(Option::get('system_email'));
|
||||||
|
$mail->AddReplyTo(Option::get('system_email'));
|
||||||
|
$mail->AddAddress($user['email'], $user['login']);
|
||||||
|
$mail->Subject = __('Your login details for :site_name', 'users', array(':site_name' => $site_name));
|
||||||
|
$mail->MsgHTML(View::factory('box/emails/views/emails/email_layout')
|
||||||
->assign('site_url', $site_url)
|
->assign('site_url', $site_url)
|
||||||
->assign('site_name', $site_name)
|
->assign('site_name', $site_name)
|
||||||
->assign('user_id', $user['id'])
|
->assign('user_id', $user['id'])
|
||||||
->assign('user_login', $user['login'])
|
->assign('user_login', $user['login'])
|
||||||
->assign('new_hash', $new_hash)
|
->assign('new_hash', $new_hash)
|
||||||
->render();
|
->assign('email_template', 'reset-password')
|
||||||
|
->render());
|
||||||
// Send
|
$mail->Send();
|
||||||
@mail($user['email'], __('Your login details for :site_name', 'users', array(':site_name' => $site_name)), $message);
|
|
||||||
|
|
||||||
// Set notification
|
// Set notification
|
||||||
Notification::set('success', __('Your login details for :site_name has been sent', 'users', array(':site_name' => $site_name)));
|
Notification::set('success', __('Your login details for :site_name has been sent', 'users', array(':site_name' => $site_name)));
|
||||||
Notification::set('reset_password', 'reset_password');
|
Notification::set('reset_password', 'reset_password');
|
||||||
|
|
||||||
// Redirect to password-reset page
|
// Redirect to password-reset page
|
||||||
Request::redirect(Site::url().'admin');
|
Request::redirect(Site::url().'/admin');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Notification::setNow('reset_password', 'reset_password');
|
Notification::setNow('reset_password', 'reset_password');
|
||||||
@@ -122,7 +156,7 @@ if ($is_admin) {
|
|||||||
if (Request::get('id')) {
|
if (Request::get('id')) {
|
||||||
$area = Request::get('id');
|
$area = Request::get('id');
|
||||||
} else {
|
} else {
|
||||||
Request::redirect('index.php?id=pages');
|
Request::redirect(Site::url().'/admin/index.php?id=dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugins_registered = Plugin::$plugins;
|
$plugins_registered = Plugin::$plugins;
|
||||||
@@ -145,12 +179,10 @@ if ($is_admin) {
|
|||||||
|
|
||||||
// Backend post render
|
// Backend post render
|
||||||
Action::run('admin_post_render');
|
Action::run('admin_post_render');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Display login template
|
// Display login template
|
||||||
require 'themes'. DS . Option::get('theme_admin_name') . DS . 'login.template.php';
|
require 'themes'. DS . Option::get('theme_admin_name') . DS . 'login.template.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush (send) the output buffer and turn off output buffering
|
// Flush (send) the output buffer and turn off output buffering
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
@@ -2,112 +2,163 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
||||||
|
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||||
|
<link rel="dns-prefetch" href="<?php echo Site::url(); ?>" />
|
||||||
|
<link rel="dns-prefetch" href="//www.google-analytics.com" />
|
||||||
|
<link rel="dns-prefetch" href="//www.gravatar.com" />
|
||||||
|
|
||||||
<title>Monstra :: <?php echo __('Administration', 'system'); ?></title>
|
<title>Monstra :: <?php echo __('Administration', 'system'); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="Monstra admin area" />
|
<meta name="description" content="Monstra Admin Area" />
|
||||||
<link rel="icon" href="<?php echo Option::get('siteurl'); ?>favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="<?php echo Option::get('siteurl'); ?>/favicon.ico" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="<?php echo Option::get('siteurl'); ?>favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="<?php echo Option::get('siteurl'); ?>/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<?php Stylesheet::add('public/assets/css/bootstrap.css', 'backend', 1); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/bootstrap.css" type="text/css" />
|
||||||
<?php Stylesheet::add('public/assets/css/bootstrap-responsive.css', 'backend', 2); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/messenger.css" type="text/css" />
|
||||||
<?php Stylesheet::add('admin/themes/default/css/default.css', 'backend', 3); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/messenger-theme-flat.css" type="text/css" />
|
||||||
|
<?php Stylesheet::add('public/assets/css/chocolat.css', 'backend', 2); ?>
|
||||||
|
<?php Stylesheet::add('public/assets/css/bootstrap-fileupload.css', 'backend', 3); ?>
|
||||||
|
<?php Stylesheet::add('public/assets/css/icheck-blue.css', 'backend', 4); ?>
|
||||||
|
<?php Stylesheet::add('admin/themes/default/css/default.css', 'backend', 5); ?>
|
||||||
<?php Stylesheet::load(); ?>
|
<?php Stylesheet::load(); ?>
|
||||||
|
|
||||||
<!-- JavaScripts -->
|
<!-- JavaScripts -->
|
||||||
<?php Javascript::add('public/assets/js/jquery.js', 'backend', 1); ?>
|
<script src="<?php echo Site::url(); ?>/public/assets/js/jquery.min.js"></script>
|
||||||
<?php Javascript::add('public/assets/js/bootstrap.js', 'backend', 2); ?>
|
<script src="<?php echo Site::url(); ?>/public/assets/js/bootstrap.min.js"></script>
|
||||||
<?php Javascript::add('admin/themes/default/js/default.js', 'backend', 3); ?>
|
<script src="<?php echo Site::url(); ?>/public/assets/js/messenger.min.js"></script>
|
||||||
|
<script src="<?php echo Site::url(); ?>/public/assets/js/icheck.min.js"></script>
|
||||||
|
<?php Javascript::add('public/assets/js/jquery.chocolat.js', 'backend', 3); ?>
|
||||||
|
<?php Javascript::add('public/assets/js/bootstrap-fileupload.js', 'backend', 4); ?>
|
||||||
|
<?php Javascript::add('admin/themes/default/js/default.js', 'backend', 5); ?>
|
||||||
<?php Javascript::load(); ?>
|
<?php Javascript::load(); ?>
|
||||||
|
|
||||||
<?php Action::run('admin_header'); ?>
|
<?php Action::run('admin_header'); ?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$('.chocolat').Chocolat({
|
||||||
|
overlayColor : '#000',
|
||||||
|
leftImg : "<?php echo Option::get('siteurl'); ?>/public/assets/img/chocolat/left.gif",
|
||||||
|
rightImg : "<?php echo Option::get('siteurl'); ?>/public/assets/img/chocolat/right.gif",
|
||||||
|
closeImg : "<?php echo Option::get('siteurl'); ?>/public/assets/img/chocolat/close.gif",
|
||||||
|
loadingImg : "<?php echo Option::get('siteurl'); ?>/public/assets/img/chocolat/loading.gif"
|
||||||
|
});
|
||||||
|
|
||||||
|
$('input').iCheck({
|
||||||
|
checkboxClass: 'icheckbox_square-blue',
|
||||||
|
radioClass: 'iradio_square-blue',
|
||||||
|
increaseArea: '20%'
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
|
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
|
||||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
</head>
|
<body class="page-<?php echo Request::get('id'); ?>">
|
||||||
<body>
|
|
||||||
|
|
||||||
<!-- Block_topbar -->
|
<nav class="navbar navbar-default navbar-inverse" role="navigation">
|
||||||
<div class="monstra-header">
|
<div class="container">
|
||||||
<div class="monstra-header-inner">
|
<div class="navbar-header">
|
||||||
<div class="container-fluid">
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||||
<a class="brand" href="<?php echo Option::get('siteurl'); ?>admin"><img src="<?php echo Option::get('siteurl'); ?>public/assets/img/monstra-logo.png" height="27" width="171"></a>
|
<span class="sr-only">Toggle navigation</span>
|
||||||
<p class="pull-right">
|
<span class="icon-bar"></span>
|
||||||
<?php Navigation::draw('top', Navigation::TOP); ?>
|
<span class="icon-bar"></span>
|
||||||
</p>
|
<span class="icon-bar"></span>
|
||||||
</div>
|
</button>
|
||||||
</div>
|
<a class="navbar-brand" href="<?php echo Site::url(); ?>/admin/index.php?id=dashboard">MONSTRA</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- /Block_topbar -->
|
|
||||||
|
|
||||||
<!-- Block_container -->
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
<div class="container-fluid">
|
<ul class="nav navbar-nav">
|
||||||
|
<li<?php if (Request::get('id') == 'dashboard') { ?> class="active"<?php } ?>><a href="<?php echo Site::url(); ?>/admin/index.php?id=dashboard"><?php echo __('Dashboard', 'dashboard'); ?></a></li>
|
||||||
<div class="row-fluid">
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo __('Content', 'pages'); ?> <b class="caret"></b></a>
|
||||||
<!-- Block_sidebar -->
|
<ul class="dropdown-menu">
|
||||||
<div class="span2 monstra-menu-sidebar hidden-phone">
|
|
||||||
<h3><?php echo __('Content', 'pages'); ?></h3>
|
|
||||||
<ul>
|
|
||||||
<?php Navigation::draw('content'); ?>
|
<?php Navigation::draw('content'); ?>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="monstra-menu-category-separator"></div>
|
</li>
|
||||||
<?php if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { ?>
|
<?php if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { ?>
|
||||||
<h3><?php echo __('Extends', 'system'); ?></h3>
|
<li class="dropdown">
|
||||||
<ul>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo __('Extends', 'system'); ?> <b class="caret"></b></a>
|
||||||
<?php Navigation::draw('extends'); ?>
|
<ul class="dropdown-menu">
|
||||||
|
<?php Navigation::draw('extends'); ?>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="monstra-menu-category-separator"></div>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<h3><?php echo __('System', 'system'); ?></h3>
|
<li class="dropdown">
|
||||||
<ul>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo __('System', 'system'); ?> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
<?php Navigation::draw('system'); ?>
|
<?php Navigation::draw('system'); ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</li>
|
||||||
<!-- /Block_sidebar -->
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo __('Help', 'system'); ?> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="http://monstra.org/documentation" target="_blank"><?php echo __('Documentation', 'system'); ?></a></li>
|
||||||
|
<?php if (Option::get('language') == 'ru') { ?>
|
||||||
|
<li><a href="http://ru.forum.monstra.org" target="_blank"><?php echo __('Official Support Forum', 'system'); ?></a></li>
|
||||||
|
<?php } else { ?>
|
||||||
|
<li><a href="http://forum.monstra.org" target="_blank"><?php echo __('Official Support Forum', 'system'); ?></a></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<li><a href="<?php echo Site::url(); ?>" target="_blank"><?php echo __('View Site', 'system'); ?></a></li>
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo Session::get('user_login'); ?> <img src="<?php echo Users::getGravatarURL(Session::get('user_email'), 28); ?>" alt=""> <b class="caret"></b></a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="<?php echo Site::url(); ?>/admin/index.php?id=users&action=edit&user_id=<?php echo Session::get('user_id'); ?>"><?php echo __('Profile', 'users')?></a></li>
|
||||||
|
<li><a href="<?php echo Site::url(); ?>/admin/?logout=do"><?php echo __('Log Out', 'users'); ?></a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<!-- Block_content -->
|
<div class="container">
|
||||||
<div class="span10 monstra-content">
|
|
||||||
|
|
||||||
<div id="update-monstra"></div>
|
<?php
|
||||||
<div><?php Action::run('admin_pre_template'); ?></div>
|
// Monstra Notifications
|
||||||
<div>
|
Notification::get('success') AND Alert::success(Notification::get('success'));
|
||||||
<?php
|
Notification::get('warning') AND Alert::warning(Notification::get('warning'));
|
||||||
if ($plugin_admin_area) {
|
Notification::get('error') AND Alert::error(Notification::get('error'));
|
||||||
if (is_callable(ucfirst(Plugin::$plugins[$area]['id']).'Admin::main')) {
|
?>
|
||||||
call_user_func(ucfirst(Plugin::$plugins[$area]['id']).'Admin::main');
|
|
||||||
} else {
|
|
||||||
echo '<div class="message-error">'.__('Plugin main admin function does not exist', 'system').'</div>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo '<div class="message-error">'.__('Plugin does not exist', 'system').'</div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<div><?php Action::run('admin_post_template'); ?></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- /Block_content -->
|
|
||||||
|
|
||||||
|
<div id="update-monstra"></div>
|
||||||
|
<div><?php Action::run('admin_pre_template'); ?></div>
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
|
if ($plugin_admin_area) {
|
||||||
|
if (is_callable(ucfirst(Plugin::$plugins[$area]['id']).'Admin::main')) {
|
||||||
|
call_user_func(ucfirst(Plugin::$plugins[$area]['id']).'Admin::main');
|
||||||
|
} else {
|
||||||
|
echo '<div class="message-error">'.__('Plugin main admin function does not exist', 'system').'</div>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<div class="message-error">'.__('Plugin does not exist', 'system').'</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<div><?php Action::run('admin_post_template'); ?></div>
|
||||||
<!-- Block_footer -->
|
</div>
|
||||||
<footer>
|
<div class="margin-top-1 margin-bottom-1 hidden-md"></div>
|
||||||
<p align="right">
|
<footer class="container visible-md visible-lg">
|
||||||
<span style="border-top:1px solid #E0E0E0; padding-top:10px;">
|
<p class="pull-right">
|
||||||
<a href="http://forum.monstra.org" target="_blank"><?php echo __('Official Support Forum', 'system'); ?></a> /
|
<span>
|
||||||
<a href="http://monstra.org/documentation" target="_blank"><?php echo __('Documentation', 'system'); ?></a> /
|
<a href="http://monstra.org" target="_blank">Monstra</a> was made by <a href="http://awilum.github.io" target="_blank" class="highlight">Sergey Romanenko</a> and is maintained by <a href="https://github.com/monstra-cms/monstra/network/members" target="_blank" class="highlight">Monstra Community</a> / © 2012 - 2016 <a href="http://monstra.org/about/license" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?>
|
||||||
© 2012 - 2013 <a href="http://monstra.org" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?>
|
</span>
|
||||||
</span>
|
</p>
|
||||||
</p>
|
</footer>
|
||||||
</footer>
|
|
||||||
<!-- /Block_footer -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- /Block_container -->
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,19 +1,23 @@
|
|||||||
/**
|
/**
|
||||||
* Monstra JS module
|
* Monstra JS module
|
||||||
* @package Monstra
|
*
|
||||||
* @author Romanenko Sergey / Awilum
|
* This source file is part of the Monstra Engine. More information,
|
||||||
* @copyright 2012 Romanenko Sergey / Awilum
|
* documentation and tutorials can be found at http://monstra.org
|
||||||
* @version $Id$
|
*
|
||||||
* @since 1.0.0
|
* @package Monstra
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
*
|
||||||
* Monstra is free software. This version may have been modified pursuant
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* to the GNU General Public License, and as distributed it includes or
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* is derivative of works licensed under the GNU General Public License or
|
*
|
||||||
* other free or open source software licenses.
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* See COPYING.txt for copyright notices and details.
|
* file that was distributed with this source code.
|
||||||
* @filesource
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Confirm delete */
|
/* Confirm delete */
|
||||||
function confirmDelete(msg){var data=confirm(msg+" ?"); return data;}
|
function confirmDelete(msg){var data=confirm(msg+" ?"); return data;}
|
||||||
|
|
||||||
|
/* Messanger */
|
||||||
|
Messenger.options = {
|
||||||
|
extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
|
||||||
|
theme: 'flat'
|
||||||
|
}
|
@@ -5,20 +5,28 @@
|
|||||||
<title>Monstra :: <?php echo __('Administration', 'system'); ?></title>
|
<title>Monstra :: <?php echo __('Administration', 'system'); ?></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="Monstra Admin Area">
|
<meta name="description" content="Monstra Admin Area">
|
||||||
<link rel="icon" href="<?php echo Option::get('siteurl'); ?>favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="<?php echo Option::get('siteurl'); ?>/favicon.ico" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="<?php echo Option::get('siteurl'); ?>favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="<?php echo Option::get('siteurl'); ?>/favicon.ico" type="image/x-icon" />
|
||||||
|
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<?php Stylesheet::add('public/assets/css/bootstrap.css', 'backend', 1); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/bootstrap.css" type="text/css" />
|
||||||
<?php Stylesheet::add('public/assets/css/bootstrap-responsive.css', 'backend', 2); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/messenger.css" type="text/css" />
|
||||||
<?php Stylesheet::add('admin/themes/default/css/default.css', 'backend', 3); ?>
|
<link rel="stylesheet" href="<?php echo Site::url(); ?>/public/assets/css/messenger-theme-flat.css" type="text/css" />
|
||||||
|
<?php Stylesheet::add('public/assets/css/bootstrap-lightbox.css', 'backend', 2); ?>
|
||||||
|
<?php Stylesheet::add('public/assets/css/bootstrap-fileupload.css', 'backend', 3); ?>
|
||||||
|
<?php Stylesheet::add('admin/themes/default/css/default.css', 'backend', 5); ?>
|
||||||
<?php Stylesheet::load(); ?>
|
<?php Stylesheet::load(); ?>
|
||||||
|
|
||||||
<!-- JavaScripts -->
|
<!-- JavaScripts -->
|
||||||
<?php Javascript::add('public/assets/js/jquery.js', 'backend', 1); ?>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||||
<?php Javascript::add('public/assets/js/bootstrap.js', 'backend', 2); ?>
|
<script src="<?php echo Site::url(); ?>/public/assets/js/bootstrap.min.js"></script>
|
||||||
<?php Javascript::add('admin/themes/default/js/default.js', 'backend', 3); ?>
|
<script src="<?php echo Site::url(); ?>/public/assets/js/messenger.min.js"></script>
|
||||||
|
<script src="<?php echo Site::url(); ?>/public/assets/js/messenger-theme-flat.js"></script>
|
||||||
|
<?php Javascript::add('public/assets/js/bootstrap-lightbox.js', 'backend', 3); ?>
|
||||||
|
<?php Javascript::add('public/assets/js/bootstrap-fileupload.js', 'backend', 4); ?>
|
||||||
|
<?php Javascript::add('admin/themes/default/js/default.js', 'backend', 5); ?>
|
||||||
<?php Javascript::load(); ?>
|
<?php Javascript::load(); ?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$().ready(function () {
|
$().ready(function () {
|
||||||
<?php if (Notification::get('reset_password') == 'reset_password') { ?>
|
<?php if (Notification::get('reset_password') == 'reset_password') { ?>
|
||||||
@@ -43,47 +51,56 @@
|
|||||||
|
|
||||||
<?php Action::run('admin_header'); ?>
|
<?php Action::run('admin_header'); ?>
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
|
<!--[if lt IE 9]>
|
||||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
|
||||||
<![endif]-->
|
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script>
|
||||||
|
<![endif]-->
|
||||||
</head>
|
</head>
|
||||||
<body class="login-body">
|
<body class="login-body">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Monstra Notifications
|
||||||
|
Notification::get('success') AND Alert::success(Notification::get('success'));
|
||||||
|
Notification::get('warning') AND Alert::warning(Notification::get('warning'));
|
||||||
|
Notification::get('error') AND Alert::error(Notification::get('error'));
|
||||||
|
?>
|
||||||
|
|
||||||
<div class="container form-signin">
|
<div class="container form-signin">
|
||||||
|
|
||||||
<div style="text-align:center;"><a class="brand" href="<?php echo Option::get('siteurl'); ?>admin"><img src="<?php echo Option::get('siteurl'); ?>public/assets/img/monstra-logo.png" height="27" width="171"></a></div>
|
<div class="text-center"><a class="brand" href="<?php echo Option::get('siteurl'); ?>/admin"><img src="<?php echo Option::get('siteurl'); ?>/public/assets/img/monstra-logo-256px.png" alt="monstra" /></a></div>
|
||||||
<div class="administration-area">
|
<div class="administration-area well">
|
||||||
<hr>
|
|
||||||
<div>
|
<div>
|
||||||
<h2 style="text-align:center;"><?php echo __('Administration', 'system'); ?></h2><br />
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<label><?php echo __('Username', 'users'); ?></label>
|
<div class="form-group">
|
||||||
<input class="input-xlarge" name="login" type="text" />
|
<label><?php echo __('Username', 'users'); ?></label>
|
||||||
|
<input class="form-control" name="login" type="text" />
|
||||||
<label><?php echo __('Password', 'users'); ?></label>
|
</div>
|
||||||
<input class="input-xlarge" name="password" type="password" />
|
<div class="form-group">
|
||||||
<br />
|
<label><?php echo __('Password', 'users'); ?></label>
|
||||||
<?php if (isset($login_error) && $login_error !== '') { ?><div class="alert alert-error"><?php echo $login_error; ?></div><?php } ?>
|
<input class="form-control" name="password" type="password" />
|
||||||
<input type="submit" name="login_submit" class="btn" value="<?php echo __('Enter', 'users'); ?>" />
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="submit" name="login_submit" class="btn btn-primary" value="<?php echo __('Log In', 'users'); ?>" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="reset-password-area">
|
<div class="reset-password-area well">
|
||||||
<hr>
|
|
||||||
<div>
|
<div>
|
||||||
<h2 style="text-align:center;"><?php echo __('Reset Password', 'users'); ?></h2><br />
|
|
||||||
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
|
<div class="form-group">
|
||||||
<label><?php echo __('Username', 'users'); ?></label>
|
<label><?php echo __('Username', 'users'); ?></label>
|
||||||
<input name="login" class="input-xlarge" type="text" value="<?php echo $user_login; ?>" />
|
<input name="login" class="form-control" type="text" value="<?php echo $user_login; ?>" />
|
||||||
|
</div>
|
||||||
<?php if (Option::get('captcha_installed') == 'true') { ?>
|
<?php if (Option::get('captcha_installed') == 'true') { ?>
|
||||||
<label><?php echo __('Captcha'); ?><label>
|
<div class="form-group">
|
||||||
<input type="text" name="answer" class="input-xlarge">
|
<label><?php echo __('Captcha', 'users'); ?></label>
|
||||||
|
<input type="text" name="answer" class="form-control">
|
||||||
|
<br>
|
||||||
<?php CryptCaptcha::draw(); ?>
|
<?php CryptCaptcha::draw(); ?>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php
|
||||||
@@ -93,24 +110,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<input type="submit" name="reset_password_submit" class="btn" value="<?php echo __('Send New Password', 'users')?>" />
|
<div class="form-group">
|
||||||
|
<input type="submit" name="reset_password_submit" class="btn btn-primary" value="<?php echo __('Send New Password', 'users')?>" />
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
</div>
|
||||||
<div>
|
|
||||||
<div style="text-align:center;">
|
<div class="login-footer">
|
||||||
<a class="small-grey-text" href="<?php echo Option::get('siteurl'); ?>"><?php echo __('< Back to Website', 'system');?></a> -
|
|
||||||
<a class="small-grey-text reset-password-btn" href="javascript:;"><?php echo __('Forgot your password? >', 'system');?></a>
|
<div class="text-center">
|
||||||
<a class="small-grey-text administration-btn" href="javascript:;"><?php echo __('Administration >', 'system');?></a>
|
<a href="<?php echo Option::get('siteurl'); ?>"><?php echo __('Back to Website', 'system');?></a> -
|
||||||
</div>
|
<a class="reset-password-btn" href="javascript:;"><?php echo __('Forgot your password ?', 'system');?></a>
|
||||||
|
<a class="administration-btn" href="javascript:;"><?php echo __('Log In', 'users');?></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
© 2012 - 2016 <a href="http://monstra.org/about/license" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="text-align:center">
|
|
||||||
<span class="small-grey-text">© 2012 <a href="http://monstra.org" class="small-grey-text" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra CMS Defines
|
* Monstra Defines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,3 +91,4 @@ define('MONSTRA_GZIP', false);
|
|||||||
//define('MONSTRA_DB_DSN', 'mysql:dbname=monstra;host=localhost;port=3306');
|
//define('MONSTRA_DB_DSN', 'mysql:dbname=monstra;host=localhost;port=3306');
|
||||||
//define('MONSTRA_DB_USER', 'root');
|
//define('MONSTRA_DB_USER', 'root');
|
||||||
//define('MONSTRA_DB_PASSWORD', 'password');
|
//define('MONSTRA_DB_PASSWORD', 'password');
|
||||||
|
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Alert
|
class Alert
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -35,16 +32,21 @@ class Alert
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $message Message
|
* @param string $message Message
|
||||||
* @param integer $time Time
|
* @param integer $seconds Seconds
|
||||||
*/
|
*/
|
||||||
public static function success($message, $time = 3000)
|
public static function success($message, $seconds = 3)
|
||||||
{
|
{
|
||||||
// Redefine vars
|
// Redefine vars
|
||||||
$message = (string) $message;
|
$message = (string) $message;
|
||||||
$time = (int) $time;
|
$seconds = (int) $seconds;
|
||||||
|
|
||||||
echo '<div class="alert alert-info">'.$message.'</div>
|
echo '<script type="text/javascript">
|
||||||
<script type="text/javascript">setTimeout(\'$(".alert").slideUp("slow")\', '.$time.'); </script>';
|
Messenger().post({
|
||||||
|
type: "success",
|
||||||
|
message : "'.$message.'",
|
||||||
|
hideAfter: '.$seconds.'
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,16 +57,21 @@ class Alert
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $message Message
|
* @param string $message Message
|
||||||
* @param integer $time Time
|
* @param integer $seconds Seconds
|
||||||
*/
|
*/
|
||||||
public static function warning($message, $time = 3000)
|
public static function warning($message, $seconds = 3)
|
||||||
{
|
{
|
||||||
// Redefine vars
|
// Redefine vars
|
||||||
$message = (string) $message;
|
$message = (string) $message;
|
||||||
$time = (int) $time;
|
$seconds = (int) $seconds;
|
||||||
|
|
||||||
echo '<div class="alert alert-warning">'.$message.'</div>
|
echo '<script type="text/javascript">
|
||||||
<script type="text/javascript">setTimeout(\'$(".alert").slideUp("slow")\', '.$time.'); </script>';
|
Messenger().post({
|
||||||
|
type: "info",
|
||||||
|
message : "'.$message.'",
|
||||||
|
hideAfter: '.$seconds.'
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,16 +82,20 @@ class Alert
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $message Message
|
* @param string $message Message
|
||||||
* @param integer $time Time
|
* @param integer $seconds Seconds
|
||||||
*/
|
*/
|
||||||
public static function error($message, $time = 3000)
|
public static function error($message, $seconds = 3)
|
||||||
{
|
{
|
||||||
// Redefine vars
|
// Redefine vars
|
||||||
$message = (string) $message;
|
$message = (string) $message;
|
||||||
$time = (int) $time;
|
$seconds = (int) $seconds;
|
||||||
|
|
||||||
echo '<div class="alert alert-error">'.$message.'</div>
|
echo '<script type="text/javascript">
|
||||||
<script type="text/javascript">setTimeout(\'$(".alert").slideUp("slow")\', '.$time.'); </script>';
|
Messenger().post({
|
||||||
|
type: "error",
|
||||||
|
message : "'.$message.'",
|
||||||
|
hideAfter: '.$seconds.'
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,11 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* Monstra - Content Management System.
|
* @package Monstra
|
||||||
* Site: www.mostra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* Copyright (C) 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @link http://monstra.org
|
||||||
*
|
|
||||||
* This source file is part of the Monstra Engine. More information,
|
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
|
||||||
*
|
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -39,7 +31,8 @@ class Monstra
|
|||||||
/**
|
/**
|
||||||
* The version of Monstra
|
* The version of Monstra
|
||||||
*/
|
*/
|
||||||
const VERSION = '2.1.3';
|
const VERSION = '3.0.3';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra environment
|
* Monstra environment
|
||||||
@@ -84,7 +77,9 @@ class Monstra
|
|||||||
* Compress HTML with gzip
|
* Compress HTML with gzip
|
||||||
*/
|
*/
|
||||||
if (MONSTRA_GZIP) {
|
if (MONSTRA_GZIP) {
|
||||||
if ( ! ob_start("ob_gzhandler")) ob_start();
|
if (! ob_start("ob_gzhandler")) {
|
||||||
|
ob_start();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ob_start();
|
ob_start();
|
||||||
}
|
}
|
||||||
@@ -93,16 +88,19 @@ class Monstra
|
|||||||
* Send default header and set internal encoding
|
* Send default header and set internal encoding
|
||||||
*/
|
*/
|
||||||
header('Content-Type: text/html; charset=UTF-8');
|
header('Content-Type: text/html; charset=UTF-8');
|
||||||
function_exists('mb_language') AND mb_language('uni');
|
function_exists('mb_language') and mb_language('uni');
|
||||||
function_exists('mb_regex_encoding') AND mb_regex_encoding('UTF-8');
|
function_exists('mb_regex_encoding') and mb_regex_encoding('UTF-8');
|
||||||
function_exists('mb_internal_encoding') AND mb_internal_encoding('UTF-8');
|
function_exists('mb_internal_encoding') and mb_internal_encoding('UTF-8');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current configuration setting of magic_quotes_gpc
|
* Gets the current configuration setting of magic_quotes_gpc
|
||||||
* and kill magic quotes
|
* and kill magic quotes
|
||||||
*/
|
*/
|
||||||
if (get_magic_quotes_gpc()) {
|
if (get_magic_quotes_gpc()) {
|
||||||
function stripslashesGPC(&$value) { $value = stripslashes($value); }
|
function stripslashesGPC(&$value)
|
||||||
|
{
|
||||||
|
$value = stripslashes($value);
|
||||||
|
}
|
||||||
array_walk_recursive($_GET, 'stripslashesGPC');
|
array_walk_recursive($_GET, 'stripslashesGPC');
|
||||||
array_walk_recursive($_POST, 'stripslashesGPC');
|
array_walk_recursive($_POST, 'stripslashesGPC');
|
||||||
array_walk_recursive($_COOKIE, 'stripslashesGPC');
|
array_walk_recursive($_COOKIE, 'stripslashesGPC');
|
||||||
@@ -113,14 +111,24 @@ class Monstra
|
|||||||
* Set Gelato Display Errors to False for Production environment.
|
* Set Gelato Display Errors to False for Production environment.
|
||||||
*/
|
*/
|
||||||
if (Monstra::$environment == Monstra::PRODUCTION) {
|
if (Monstra::$environment == Monstra::PRODUCTION) {
|
||||||
define('GELATO_DISPLAY_ERRORS', false);
|
define('GELATO_DEVELOPMENT', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define Monstra Folder for Gelato Logs
|
||||||
|
*/
|
||||||
|
define('GELATO_LOGS_PATH', LOGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include Gelato Library
|
* Include Gelato Library
|
||||||
*/
|
*/
|
||||||
include ROOT . DS . 'libraries'. DS .'Gelato'. DS .'Gelato.php';
|
include ROOT . DS . 'libraries'. DS .'Gelato'. DS .'Gelato.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map Monstra Engine Directory
|
||||||
|
*/
|
||||||
|
ClassLoader::directory(ROOT . DS . 'engine' . DS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map all Monstra Classes
|
* Map all Monstra Classes
|
||||||
*/
|
*/
|
||||||
@@ -157,6 +165,9 @@ class Monstra
|
|||||||
|
|
||||||
// Idiorm
|
// Idiorm
|
||||||
'ORM' => ROOT . DS .'libraries'. DS . 'Idiorm'. DS .'ORM.php',
|
'ORM' => ROOT . DS .'libraries'. DS . 'Idiorm'. DS .'ORM.php',
|
||||||
|
|
||||||
|
// PHPMailer
|
||||||
|
'PHPMailer' => ROOT . DS .'libraries'. DS . 'PHPMailer'. DS .'PHPMailer.php',
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,18 +182,14 @@ class Monstra
|
|||||||
ORM::configure(MONSTRA_DB_DSN);
|
ORM::configure(MONSTRA_DB_DSN);
|
||||||
ORM::configure('username', MONSTRA_DB_USER);
|
ORM::configure('username', MONSTRA_DB_USER);
|
||||||
ORM::configure('password', MONSTRA_DB_PASSWORD);
|
ORM::configure('password', MONSTRA_DB_PASSWORD);
|
||||||
|
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto cleanup if MONSTRA_DEBUG is TRUE
|
* Auto cleanup if DEVELOPMENT environment
|
||||||
*/
|
*/
|
||||||
if (Monstra::$environment == Monstra::DEVELOPMENT) {
|
if (Monstra::$environment == Monstra::DEVELOPMENT) {
|
||||||
|
Monstra::cleanTmp();
|
||||||
// Cleanup minify
|
|
||||||
if (count($files = File::scan(MINIFY, array('css', 'js', 'php'))) > 0) foreach ($files as $file) File::delete(MINIFY . DS . $file);
|
|
||||||
|
|
||||||
// Cleanup cache
|
|
||||||
if (count($namespaces = Dir::scan(CACHE)) > 0) foreach ($namespaces as $namespace) Dir::delete(CACHE . DS . $namespace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,7 +206,11 @@ class Monstra
|
|||||||
* Set default timezone
|
* Set default timezone
|
||||||
*/
|
*/
|
||||||
@ini_set('date.timezone', Option::get('timezone'));
|
@ini_set('date.timezone', Option::get('timezone'));
|
||||||
if (function_exists('date_default_timezone_set')) date_default_timezone_set(Option::get('timezone')); else putenv('TZ='.Option::get('timezone'));
|
if (function_exists('date_default_timezone_set')) {
|
||||||
|
date_default_timezone_set(Option::get('timezone'));
|
||||||
|
} else {
|
||||||
|
putenv('TZ='.Option::get('timezone'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitize URL to prevent XSS - Cross-site scripting
|
* Sanitize URL to prevent XSS - Cross-site scripting
|
||||||
@@ -229,7 +240,9 @@ class Monstra
|
|||||||
/**
|
/**
|
||||||
* Init site module
|
* Init site module
|
||||||
*/
|
*/
|
||||||
if ( ! BACKEND) Site::init();
|
if (! BACKEND) {
|
||||||
|
Site::init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -290,7 +303,26 @@ class Monstra
|
|||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("The pluggable shortcodes.php file does not exist.");
|
throw new RuntimeException("The pluggable shortcodes.php file does not exist.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean Monstra TMP folder.
|
||||||
|
*/
|
||||||
|
public static function cleanTmp()
|
||||||
|
{
|
||||||
|
// Cleanup minify
|
||||||
|
if (count($files = File::scan(MINIFY, array('css', 'js', 'php'))) > 0) {
|
||||||
|
foreach ($files as $file) {
|
||||||
|
File::delete(MINIFY . DS . $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleanup cache
|
||||||
|
if (count($namespaces = Dir::scan(CACHE)) > 0) {
|
||||||
|
foreach ($namespaces as $namespace) {
|
||||||
|
Dir::delete(CACHE . DS . $namespace);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -300,8 +332,9 @@ class Monstra
|
|||||||
*/
|
*/
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
if ( ! isset(self::$instance)) self::$instance = new Monstra();
|
if (! isset(self::$instance)) {
|
||||||
|
self::$instance = new Monstra();
|
||||||
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Option
|
class Option
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +35,9 @@ class Option
|
|||||||
*/
|
*/
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
if ( ! isset(self::$instance)) self::$instance = new Option();
|
if (! isset(self::$instance)) {
|
||||||
|
self::$instance = new Option();
|
||||||
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,5 +175,4 @@ class Option
|
|||||||
// Check if option exists
|
// Check if option exists
|
||||||
return (count(Option::$options->select('[name="'.$option.'"]', null)) > 0) ? true : false;
|
return (count(Option::$options->select('[name="'.$option.'"]', null)) > 0) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Action
|
class Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +44,7 @@ class Action
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $action_name Action name
|
* @param string $action_name Action name
|
||||||
* @param string $added_function Added function
|
* @param mixed $added_function Added function
|
||||||
* @param integer $priority Priority. Default is 10
|
* @param integer $priority Priority. Default is 10
|
||||||
* @param array $args Arguments
|
* @param array $args Arguments
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +53,7 @@ class Action
|
|||||||
// Hooks a function on to a specific action.
|
// Hooks a function on to a specific action.
|
||||||
Action::$actions[] = array(
|
Action::$actions[] = array(
|
||||||
'action_name' => (string) $action_name,
|
'action_name' => (string) $action_name,
|
||||||
'function' => (string) $added_function,
|
'function' => $added_function,
|
||||||
'priority' => (int) $priority,
|
'priority' => (int) $priority,
|
||||||
'args' => $args
|
'args' => $args
|
||||||
);
|
);
|
||||||
@@ -102,23 +99,15 @@ class Action
|
|||||||
} else {
|
} else {
|
||||||
call_user_func_array($action['function'], $args);
|
call_user_func_array($action['function'], $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ($return) {
|
if ($return) {
|
||||||
return call_user_func_array($action['function'], $action['args']);
|
return call_user_func_array($action['function'], $action['args']);
|
||||||
} else {
|
} else {
|
||||||
call_user_func_array($action['function'], $action['args']);
|
call_user_func_array($action['function'], $action['args']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,15 +1,11 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -17,5 +13,7 @@
|
|||||||
|
|
||||||
class Backend
|
class Backend
|
||||||
{
|
{
|
||||||
public static function main() { }
|
public static function main()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Filter
|
class Filter
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -52,12 +49,12 @@ class Filter
|
|||||||
|
|
||||||
$args = array_slice(func_get_args(), 2);
|
$args = array_slice(func_get_args(), 2);
|
||||||
|
|
||||||
if ( ! isset(Filter::$filters[$filter_name])) {
|
if (! isset(Filter::$filters[$filter_name])) {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Filter::$filters[$filter_name] as $priority => $functions) {
|
foreach (Filter::$filters[$filter_name] as $priority => $functions) {
|
||||||
if ( ! is_null($functions)) {
|
if (! is_null($functions)) {
|
||||||
foreach ($functions as $function) {
|
foreach ($functions as $function) {
|
||||||
$all_args = array_merge(array($value), $args);
|
$all_args = array_merge(array($value), $args);
|
||||||
$function_name = $function['function'];
|
$function_name = $function['function'];
|
||||||
@@ -91,7 +88,7 @@ class Filter
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $filter_name The name of the filter to hook the $function_to_add to.
|
* @param string $filter_name The name of the filter to hook the $function_to_add to.
|
||||||
* @param string $function_to_add The name of the function to be called when the filter is applied.
|
* @param mixed $function_to_add The name of the function to be called when the filter is applied.
|
||||||
* @param integer $priority Function to add priority - default is 10.
|
* @param integer $priority Function to add priority - default is 10.
|
||||||
* @param integer $accepted_args The number of arguments the function accept default is 1.
|
* @param integer $accepted_args The number of arguments the function accept default is 1.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@@ -100,7 +97,7 @@ class Filter
|
|||||||
{
|
{
|
||||||
// Redefine arguments
|
// Redefine arguments
|
||||||
$filter_name = (string) $filter_name;
|
$filter_name = (string) $filter_name;
|
||||||
$function_to_add = (string) $function_to_add;
|
$function_to_add = $function_to_add;
|
||||||
$priority = (int) $priority;
|
$priority = (int) $priority;
|
||||||
$accepted_args = (int) $accepted_args;
|
$accepted_args = (int) $accepted_args;
|
||||||
|
|
||||||
@@ -120,5 +117,4 @@ class Filter
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,27 +1,40 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Frontend
|
class Frontend
|
||||||
{
|
{
|
||||||
public static function main() { }
|
public static function main()
|
||||||
public static function title() { return ''; }
|
{
|
||||||
public static function description() { return ''; }
|
}
|
||||||
public static function keywords() { return ''; }
|
public static function title()
|
||||||
public static function template() { return 'index'; }
|
{
|
||||||
public static function content() { return ''; }
|
return '';
|
||||||
|
}
|
||||||
|
public static function description()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
public static function keywords()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
public static function template()
|
||||||
|
{
|
||||||
|
return 'index';
|
||||||
|
}
|
||||||
|
public static function content()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class I18n
|
class I18n
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -32,11 +29,14 @@ class I18n
|
|||||||
'el' => 'Ελληνικά',
|
'el' => 'Ελληνικά',
|
||||||
'en' => 'English',
|
'en' => 'English',
|
||||||
'es' => 'Español',
|
'es' => 'Español',
|
||||||
|
'fa' => 'Farsi',
|
||||||
'fi' => 'Suomi',
|
'fi' => 'Suomi',
|
||||||
'fr' => 'Français',
|
'fr' => 'Français',
|
||||||
'gl' => 'Galego',
|
'gl' => 'Galego',
|
||||||
|
'ka-ge' => 'Georgian',
|
||||||
'hu' => 'Magyar',
|
'hu' => 'Magyar',
|
||||||
'it' => 'Italiano',
|
'it' => 'Italiano',
|
||||||
|
'id' => 'Bahasa Indonesia',
|
||||||
'ja' => '日本語',
|
'ja' => '日本語',
|
||||||
'lt' => 'Lietuvių',
|
'lt' => 'Lietuvių',
|
||||||
'nl' => 'Nederlands',
|
'nl' => 'Nederlands',
|
||||||
@@ -48,10 +48,10 @@ class I18n
|
|||||||
'sk' => 'Slovenčina',
|
'sk' => 'Slovenčina',
|
||||||
'sl' => 'Slovenščina',
|
'sl' => 'Slovenščina',
|
||||||
'sv' => 'Svenska',
|
'sv' => 'Svenska',
|
||||||
'sr-yu' => 'Serbian',
|
'sr' => 'Srpski',
|
||||||
'tr' => 'Türkçe',
|
'tr' => 'Türkçe',
|
||||||
'uk' => 'Українська',
|
'uk' => 'Українська',
|
||||||
'zh' => '中文',
|
'zh-cn' => '简体中文',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,7 +75,9 @@ class I18n
|
|||||||
*/
|
*/
|
||||||
public static function init($locale)
|
public static function init($locale)
|
||||||
{
|
{
|
||||||
if ( ! isset(self::$instance)) self::$instance = new I18n($locale);
|
if (! isset(self::$instance)) {
|
||||||
|
self::$instance = new I18n($locale);
|
||||||
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +116,6 @@ class I18n
|
|||||||
|
|
||||||
// Loop through each installed plugin
|
// Loop through each installed plugin
|
||||||
foreach ($records as $record) {
|
foreach ($records as $record) {
|
||||||
|
|
||||||
if (is_dir(ROOT . DS . dirname($record['location']) . DS . 'languages')) {
|
if (is_dir(ROOT . DS . dirname($record['location']) . DS . 'languages')) {
|
||||||
|
|
||||||
// Init var
|
// Init var
|
||||||
@@ -125,7 +126,6 @@ class I18n
|
|||||||
|
|
||||||
// Merge the language strings into the sub table
|
// Merge the language strings into the sub table
|
||||||
$t = array_merge($t, include ROOT . DS . dirname($record['location']) . DS . 'languages' . DS . $locale . '.lang.php');
|
$t = array_merge($t, include ROOT . DS . dirname($record['location']) . DS . 'languages' . DS . $locale . '.lang.php');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append the sub table, preventing less specific language files from overloading more specific files
|
// Append the sub table, preventing less specific language files from overloading more specific files
|
||||||
@@ -162,9 +162,12 @@ class I18n
|
|||||||
$string = (string) $string;
|
$string = (string) $string;
|
||||||
|
|
||||||
// Return string
|
// Return string
|
||||||
if (isset(I18n::$dictionary[$namespace][$string])) return I18n::$dictionary[$namespace][$string]; else return $string;
|
if (isset(I18n::$dictionary[$namespace][$string])) {
|
||||||
|
return I18n::$dictionary[$namespace][$string];
|
||||||
|
} else {
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Javascript
|
class Javascript
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +63,6 @@ class Javascript
|
|||||||
|
|
||||||
// Load javascripts
|
// Load javascripts
|
||||||
if (count(Javascript::$javascripts) > 0) {
|
if (count(Javascript::$javascripts) > 0) {
|
||||||
|
|
||||||
$backend_buffer = '';
|
$backend_buffer = '';
|
||||||
$backend_regenerate = false;
|
$backend_regenerate = false;
|
||||||
|
|
||||||
@@ -80,8 +76,8 @@ class Javascript
|
|||||||
|
|
||||||
// Build backend site javascript
|
// Build backend site javascript
|
||||||
foreach ($javascripts as $javascript) {
|
foreach ($javascripts as $javascript) {
|
||||||
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'backend') or ($javascript['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'backend') or ($javascript['load'] == 'both'))) {
|
||||||
if ( ! file_exists($backend_site_js_path) or filemtime(ROOT . DS . $javascript['file']) > filemtime($backend_site_js_path)) {
|
if (! file_exists($backend_site_js_path) or filemtime(ROOT . DS . $javascript['file']) > filemtime($backend_site_js_path)) {
|
||||||
$backend_regenerate = true;
|
$backend_regenerate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -91,20 +87,19 @@ class Javascript
|
|||||||
// Regenerate site javascript
|
// Regenerate site javascript
|
||||||
if ($backend_regenerate) {
|
if ($backend_regenerate) {
|
||||||
foreach ($javascripts as $javascript) {
|
foreach ($javascripts as $javascript) {
|
||||||
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'backend') or ($javascript['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'backend') or ($javascript['load'] == 'both'))) {
|
||||||
$backend_buffer .= file_get_contents(ROOT . DS . $javascript['file']);
|
$backend_buffer .= file_get_contents(ROOT . DS . $javascript['file'])."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_put_contents($backend_site_js_path, $backend_buffer);
|
file_put_contents($backend_site_js_path, $backend_buffer);
|
||||||
$backend_regenerate = false;
|
$backend_regenerate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Build frontend site javascript
|
// Build frontend site javascript
|
||||||
foreach ($javascripts as $javascript) {
|
foreach ($javascripts as $javascript) {
|
||||||
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'frontend') or ($javascript['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'frontend') or ($javascript['load'] == 'both'))) {
|
||||||
if ( ! file_exists($frontend_site_js_path) or filemtime(ROOT . DS . $javascript['file']) > filemtime($frontend_site_js_path)) {
|
if (! file_exists($frontend_site_js_path) or filemtime(ROOT . DS . $javascript['file']) > filemtime($frontend_site_js_path)) {
|
||||||
$frontend_regenerate = true;
|
$frontend_regenerate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -114,23 +109,29 @@ class Javascript
|
|||||||
// Regenerate site javascript
|
// Regenerate site javascript
|
||||||
if ($frontend_regenerate) {
|
if ($frontend_regenerate) {
|
||||||
foreach ($javascripts as $javascript) {
|
foreach ($javascripts as $javascript) {
|
||||||
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'frontend') or ($javascript['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $javascript['file'])) and (($javascript['load'] == 'frontend') or ($javascript['load'] == 'both'))) {
|
||||||
$frontend_buffer .= file_get_contents(ROOT . DS . $javascript['file']);
|
$frontend_buffer .= file_get_contents(ROOT . DS . $javascript['file'])."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_put_contents($frontend_site_js_path, $frontend_buffer);
|
file_put_contents($frontend_site_js_path, $frontend_buffer);
|
||||||
$frontend_regenerate = false;
|
$frontend_regenerate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
if (BACKEND) {
|
if (BACKEND) {
|
||||||
echo '<script type="text/javascript" src="'.Option::get('siteurl').'tmp/minify/backend_site.minify.js"></script>';
|
echo '<script type="text/javascript" src="'.Option::get('siteurl').'/tmp/minify/backend_site.minify.js?'.Option::get('javascript_version').'"></script>';
|
||||||
} else {
|
} else {
|
||||||
echo '<script type="text/javascript" src="'.Option::get('siteurl').'tmp/minify/frontend_site.minify.js"></script>';
|
echo '<script type="text/javascript" src="'.Option::get('siteurl').'/tmp/minify/frontend_site.minify.js?'.Option::get('javascript_version').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* javascriptVersionIncrement
|
||||||
|
*/
|
||||||
|
public static function javascriptVersionIncrement()
|
||||||
|
{
|
||||||
|
Option::update('javascript_version', (int) Option::get('javascript_version') + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Navigation
|
class Navigation
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -83,7 +80,11 @@ class Navigation
|
|||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
|
||||||
// If current plugin id == selected item id then set class to current
|
// If current plugin id == selected item id then set class to current
|
||||||
if (Request::get('id') == $item['id'] && $item['external'] == false) $class = 'class = "current" '; else $class = '';
|
if (Request::get('id') == $item['id'] && $item['external'] == false) {
|
||||||
|
$class = 'class = "current" ';
|
||||||
|
} else {
|
||||||
|
$class = '';
|
||||||
|
}
|
||||||
|
|
||||||
// If current category == item category and navigation type is left them draw this item
|
// If current category == item category and navigation type is left them draw this item
|
||||||
if ($item['category'] == $category && $item['type'] == Navigation::LEFT) {
|
if ($item['category'] == $category && $item['type'] == Navigation::LEFT) {
|
||||||
@@ -110,4 +111,92 @@ class Navigation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw items
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* Navigation::draw('content');
|
||||||
|
* Navigation::draw('top', Navigation::TOP);
|
||||||
|
* <code>
|
||||||
|
*
|
||||||
|
* @param string $category Category
|
||||||
|
* @param integer $type Type. Default is LEFT
|
||||||
|
*/
|
||||||
|
public static function get($category, $type = Navigation::LEFT)
|
||||||
|
{
|
||||||
|
// Sort items by priority
|
||||||
|
$items = Arr::subvalSort(Navigation::$items, 'priority');
|
||||||
|
|
||||||
|
// Draw left navigation
|
||||||
|
if ($type == Navigation::LEFT) {
|
||||||
|
|
||||||
|
// Loop trough the items
|
||||||
|
foreach ($items as $item) {
|
||||||
|
|
||||||
|
// If current plugin id == selected item id then set class to current
|
||||||
|
if (Request::get('id') == $item['id'] && $item['external'] == false) {
|
||||||
|
$class = 'class = "current" ';
|
||||||
|
} else {
|
||||||
|
$class = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If current category == item category and navigation type is left them draw this item
|
||||||
|
if ($item['category'] == $category && $item['type'] == Navigation::LEFT) {
|
||||||
|
|
||||||
|
// Is external item id or not ?
|
||||||
|
if ($item['external'] == false) {
|
||||||
|
echo '<li><a '.$class.'href="index.php?id='.$item['id'].'">'.$item['name'].'</a></li>';
|
||||||
|
} else {
|
||||||
|
echo '<li><a target="_blank" href="'.$item['id'].'">'.$item['name'].'</a></li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($type == Navigation::TOP) {
|
||||||
|
// Draw top navigation
|
||||||
|
foreach ($items as $item) {
|
||||||
|
if ($item['category'] == $category && $item['type'] == Navigation::TOP) {
|
||||||
|
if ($item['external'] == false) {
|
||||||
|
echo '<a class="btn btn-small btn-inverse" href="index.php?id='.$item['id'].'">'.$item['name'].'</a>'.Html::nbsp(2);
|
||||||
|
} else {
|
||||||
|
echo '<a target="_blank" class="btn btn-small btn-inverse" href="'.$item['id'].'">'.$item['name'].'</a>'.Html::nbsp(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw dropdown items
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* Navigation::getDropdown('content');
|
||||||
|
* <code>
|
||||||
|
*
|
||||||
|
* @param string $category Category
|
||||||
|
*/
|
||||||
|
public static function getDropdown($category)
|
||||||
|
{
|
||||||
|
// Sort items by priority
|
||||||
|
$items = Arr::subvalSort(Navigation::$items, 'priority');
|
||||||
|
|
||||||
|
// Loop trough the items
|
||||||
|
foreach ($items as $item) {
|
||||||
|
|
||||||
|
// If current plugin id == selected item id then set class to current
|
||||||
|
if (Request::get('id') == $item['id'] && $item['external'] == false) {
|
||||||
|
$class = 'selected = "selected" ';
|
||||||
|
} else {
|
||||||
|
$class = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If current category == item category and navigation type is left them draw this item
|
||||||
|
if ($item['category'] == $category && $item['type'] == Navigation::LEFT) {
|
||||||
|
|
||||||
|
// Is external item id or not ?
|
||||||
|
if ($item['external'] == false) {
|
||||||
|
echo '<option '.$class.'rel="index.php?id='.$item['id'].'">'.$item['name'].'</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Plugin
|
class Plugin
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +42,9 @@ class Plugin
|
|||||||
*/
|
*/
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
if ( ! isset(self::$instance)) self::$instance = new Plugin();
|
if (! isset(self::$instance)) {
|
||||||
|
self::$instance = new Plugin();
|
||||||
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +67,7 @@ class Plugin
|
|||||||
$plugins = new Table('plugins');
|
$plugins = new Table('plugins');
|
||||||
|
|
||||||
// Select all plugins
|
// Select all plugins
|
||||||
$records = $plugins->select(null, 'all', null, array('location', 'frontend', 'backend', 'status', 'priority'), 'priority', 'ASC');
|
$records = $plugins->select(null, 'all', null, array('location', 'status', 'priority'), 'priority', 'ASC');
|
||||||
|
|
||||||
// Now include plugins from $records plugins array
|
// Now include plugins from $records plugins array
|
||||||
// If plugin is active then load it to the system.
|
// If plugin is active then load it to the system.
|
||||||
@@ -102,7 +101,7 @@ class Plugin
|
|||||||
if (BACKEND) {
|
if (BACKEND) {
|
||||||
|
|
||||||
// Plugin admin folder
|
// Plugin admin folder
|
||||||
if ( ! empty($alt_folder)) {
|
if (! empty($alt_folder)) {
|
||||||
$folder = $alt_folder . DS . strtolower($plug);
|
$folder = $alt_folder . DS . strtolower($plug);
|
||||||
} else {
|
} else {
|
||||||
$folder = strtolower($plug);
|
$folder = strtolower($plug);
|
||||||
@@ -157,7 +156,11 @@ class Plugin
|
|||||||
$id = strtolower(basename($file, '.plugin.php'));
|
$id = strtolower(basename($file, '.plugin.php'));
|
||||||
|
|
||||||
// Set plugin privilege 'box' if $box is true
|
// Set plugin privilege 'box' if $box is true
|
||||||
if ($box) $privilege = 'box'; else $privilege = '';
|
if ($box) {
|
||||||
|
$privilege = 'box';
|
||||||
|
} else {
|
||||||
|
$privilege = '';
|
||||||
|
}
|
||||||
|
|
||||||
// Register plugin in global plugins array.
|
// Register plugin in global plugins array.
|
||||||
Plugin::$plugins[$id] = array(
|
Plugin::$plugins[$id] = array(
|
||||||
@@ -175,9 +178,8 @@ class Plugin
|
|||||||
// Example:
|
// Example:
|
||||||
// www.example.org/guestbook
|
// www.example.org/guestbook
|
||||||
// www.example.org/news
|
// www.example.org/news
|
||||||
if ( ! empty($component)) {
|
if (! empty($component)) {
|
||||||
Plugin::$components[] = $component;
|
Plugin::$components[] = $component;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Stylesheet
|
class Stylesheet
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +63,6 @@ class Stylesheet
|
|||||||
|
|
||||||
// Load stylesheets
|
// Load stylesheets
|
||||||
if (count(Stylesheet::$stylesheets) > 0) {
|
if (count(Stylesheet::$stylesheets) > 0) {
|
||||||
|
|
||||||
$backend_buffer = '';
|
$backend_buffer = '';
|
||||||
$backend_regenerate = false;
|
$backend_regenerate = false;
|
||||||
|
|
||||||
@@ -80,8 +76,8 @@ class Stylesheet
|
|||||||
|
|
||||||
// Build backend site stylesheets
|
// Build backend site stylesheets
|
||||||
foreach ($stylesheets as $stylesheet) {
|
foreach ($stylesheets as $stylesheet) {
|
||||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'backend') or ($stylesheet['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'backend') or ($stylesheet['load'] == 'both'))) {
|
||||||
if ( ! file_exists($backend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($backend_site_css_path)) {
|
if (! file_exists($backend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($backend_site_css_path)) {
|
||||||
$backend_regenerate = true;
|
$backend_regenerate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -91,21 +87,20 @@ class Stylesheet
|
|||||||
// Regenerate site stylesheet
|
// Regenerate site stylesheet
|
||||||
if ($backend_regenerate) {
|
if ($backend_regenerate) {
|
||||||
foreach ($stylesheets as $stylesheet) {
|
foreach ($stylesheets as $stylesheet) {
|
||||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'backend') or ($stylesheet['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'backend') or ($stylesheet['load'] == 'both'))) {
|
||||||
$backend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
|
$backend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$backend_buffer = Stylesheet::parseVariables($backend_buffer);
|
$backend_buffer = Stylesheet::parseVariables($backend_buffer);
|
||||||
file_put_contents($backend_site_css_path, Minify::css($backend_buffer));
|
file_put_contents($backend_site_css_path, MinifyCSS::process($backend_buffer));
|
||||||
$backend_regenerate = false;
|
$backend_regenerate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Build frontend site stylesheets
|
// Build frontend site stylesheets
|
||||||
foreach ($stylesheets as $stylesheet) {
|
foreach ($stylesheets as $stylesheet) {
|
||||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'frontend') or ($stylesheet['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'frontend') or ($stylesheet['load'] == 'both'))) {
|
||||||
if ( ! file_exists($frontend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($frontend_site_css_path)) {
|
if (! file_exists($frontend_site_css_path) or filemtime(ROOT . DS . $stylesheet['file']) > filemtime($frontend_site_css_path)) {
|
||||||
$frontend_regenerate = true;
|
$frontend_regenerate = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -115,22 +110,21 @@ class Stylesheet
|
|||||||
// Regenerate site stylesheet
|
// Regenerate site stylesheet
|
||||||
if ($frontend_regenerate) {
|
if ($frontend_regenerate) {
|
||||||
foreach ($stylesheets as $stylesheet) {
|
foreach ($stylesheets as $stylesheet) {
|
||||||
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'frontend') or ($stylesheet['load'] == 'both')) ) {
|
if ((file_exists(ROOT . DS . $stylesheet['file'])) and (($stylesheet['load'] == 'frontend') or ($stylesheet['load'] == 'both'))) {
|
||||||
$frontend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
|
$frontend_buffer .= file_get_contents(ROOT . DS . $stylesheet['file']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$frontend_buffer = Stylesheet::parseVariables($frontend_buffer);
|
$frontend_buffer = Stylesheet::parseVariables($frontend_buffer);
|
||||||
file_put_contents($frontend_site_css_path, Minify::css($frontend_buffer));
|
file_put_contents($frontend_site_css_path, MinifyCSS::process($frontend_buffer));
|
||||||
$frontend_regenerate = false;
|
$frontend_regenerate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
if (BACKEND) {
|
if (BACKEND) {
|
||||||
echo '<link rel="stylesheet" href="'.Option::get('siteurl').'tmp/minify/backend_site.minify.css'.'" type="text/css" />';
|
echo '<link rel="stylesheet" href="'.Option::get('siteurl').'/tmp/minify/backend_site.minify.css?'.Option::get('styles_version').'" type="text/css" />';
|
||||||
} else {
|
} else {
|
||||||
echo '<link rel="stylesheet" href="'.Option::get('siteurl').'tmp/minify/frontend_site.minify.css'.'" type="text/css" />';
|
echo '<link rel="stylesheet" href="'.Option::get('siteurl').'/tmp/minify/frontend_site.minify.css?'.Option::get('styles_version').'" type="text/css" />'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,9 +138,16 @@ class Stylesheet
|
|||||||
'@theme_site_url',
|
'@theme_site_url',
|
||||||
'@theme_admin_url'),
|
'@theme_admin_url'),
|
||||||
array(Option::get('siteurl'),
|
array(Option::get('siteurl'),
|
||||||
Option::get('siteurl').'public/themes/'.Option::get('theme_site_name'),
|
Option::get('siteurl').'/public/themes/'.Option::get('theme_site_name'),
|
||||||
Option::get('siteurl').'admin/themes/'.Option::get('theme_admin_name')),
|
Option::get('siteurl').'/admin/themes/'.Option::get('theme_admin_name')),
|
||||||
$frontend_buffer);
|
$frontend_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stylesVersionIncrement
|
||||||
|
*/
|
||||||
|
public static function stylesVersionIncrement()
|
||||||
|
{
|
||||||
|
Option::update('styles_version', (int) Option::get('styles_version') + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class View
|
class View
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Security
|
class Security
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -22,7 +19,7 @@ class Security
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $token_name = 'security_token';
|
protected static $token_name = 'security_token';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected constructor since this is a static class.
|
* Protected constructor since this is a static class.
|
||||||
@@ -100,7 +97,7 @@ class Security
|
|||||||
*/
|
*/
|
||||||
public static function encryptPassword($password)
|
public static function encryptPassword($password)
|
||||||
{
|
{
|
||||||
return md5(md5(trim($password) . MONSTRA_PASSWORD_SALT));
|
return md5(md5(trim($password) . MONSTRA_PASSWORD_SALT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,7 +108,7 @@ class Security
|
|||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $str String
|
* @param string $str String
|
||||||
* @param string $delimiter String delimiter
|
* @param mixed $delimiter String delimiter
|
||||||
* @param boolean $lowercase String Lowercase
|
* @param boolean $lowercase String Lowercase
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@@ -119,9 +116,9 @@ class Security
|
|||||||
{
|
{
|
||||||
// Redefine vars
|
// Redefine vars
|
||||||
$str = (string) $str;
|
$str = (string) $str;
|
||||||
$delimiter = (string) $delimiter;
|
$delimiter = $delimiter;
|
||||||
$lowercase = (bool) $lowercase;
|
$lowercase = (bool) $lowercase;
|
||||||
$delimiter = (string) $delimiter;
|
$delimiter = $delimiter;
|
||||||
|
|
||||||
// Remove tags
|
// Remove tags
|
||||||
$str = filter_var($str, FILTER_SANITIZE_STRING);
|
$str = filter_var($str, FILTER_SANITIZE_STRING);
|
||||||
@@ -149,16 +146,20 @@ class Security
|
|||||||
$str = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
|
$str = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
|
||||||
|
|
||||||
// Remove characters
|
// Remove characters
|
||||||
$str = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $str );
|
$str = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $str);
|
||||||
$str = preg_replace("/[\/_|+ -]+/", $delimiter, $str );
|
if ($delimiter != null) {
|
||||||
$str = trim($str, $delimiter);
|
$str = preg_replace("/[\/_|+ -]+/", $delimiter, $str);
|
||||||
|
$str = trim($str, $delimiter);
|
||||||
|
}
|
||||||
|
|
||||||
// Lowercase
|
// Lowercase
|
||||||
if ($lowercase === true) $str = Text::lowercase($str);
|
if ($lowercase === true) {
|
||||||
|
$str = Text::lowercase($str);
|
||||||
|
}
|
||||||
|
|
||||||
// Return safe name
|
// Return safe name
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create safe url.
|
* Create safe url.
|
||||||
@@ -174,9 +175,9 @@ class Security
|
|||||||
{
|
{
|
||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
$url = rawurldecode($url);
|
$url = rawurldecode($url);
|
||||||
$url = str_replace(array('--','"','!','@','#','$','%','^','*','(',')','+','{','}','|',':','"','<','>',
|
$url = str_replace(array('--', '"', '!', '@', '#', '$', '%', '^', '*', '(', ')', '+', '{', '}', '|', ':', '"', '<', '>',
|
||||||
'[',']','\\',';',"'",',','*','+','~','`','laquo','raquo',']>','‘','’','“','”','–','—'),
|
'[', ']', '\\', ';', "'", ',', '*', '+', '~', '`', 'laquo', 'raquo', ']>', '‘', '’', '“', '”', '–', '—'),
|
||||||
array('-','-','','','','','','','','','','','','','','','','','','','','','','','','','','',''),
|
array('-', '-', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''),
|
||||||
$url);
|
$url);
|
||||||
$url = str_replace('--', '-', $url);
|
$url = str_replace('--', '-', $url);
|
||||||
$url = rtrim($url, "-");
|
$url = rtrim($url, "-");
|
||||||
@@ -187,7 +188,7 @@ class Security
|
|||||||
$url = preg_replace('/^\./', '', $url);
|
$url = preg_replace('/^\./', '', $url);
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitize URL to prevent XSS - Cross-site scripting
|
* Sanitize URL to prevent XSS - Cross-site scripting
|
||||||
@@ -235,5 +236,4 @@ class Security
|
|||||||
// Return safe string
|
// Return safe string
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Shortcode
|
class Shortcode
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -55,7 +52,9 @@ class Shortcode
|
|||||||
$shortcode = (string) $shortcode;
|
$shortcode = (string) $shortcode;
|
||||||
|
|
||||||
// Add new shortcode
|
// Add new shortcode
|
||||||
if (is_callable($callback_function)) Shortcode::$shortcode_tags[$shortcode] = $callback_function;
|
if (is_callable($callback_function)) {
|
||||||
|
Shortcode::$shortcode_tags[$shortcode] = $callback_function;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +72,9 @@ class Shortcode
|
|||||||
$shortcode = (string) $shortcode;
|
$shortcode = (string) $shortcode;
|
||||||
|
|
||||||
// Delete shortcode
|
// Delete shortcode
|
||||||
if (Shortcode::exists($shortcode)) unset(Shortcode::$shortcode_tags[$shortcode]);
|
if (Shortcode::exists($shortcode)) {
|
||||||
|
unset(Shortcode::$shortcode_tags[$shortcode]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,7 +122,9 @@ class Shortcode
|
|||||||
*/
|
*/
|
||||||
public static function parse($content)
|
public static function parse($content)
|
||||||
{
|
{
|
||||||
if ( ! Shortcode::$shortcode_tags) return $content;
|
if (! Shortcode::$shortcode_tags) {
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
$shortcodes = implode('|', array_map('preg_quote', array_keys(Shortcode::$shortcode_tags)));
|
$shortcodes = implode('|', array_map('preg_quote', array_keys(Shortcode::$shortcode_tags)));
|
||||||
$pattern = "/(.?)\{([$shortcodes]+)(.*?)(\/)?\}(?(4)|(?:(.+?)\{\/\s*\\2\s*\}))?(.?)/s";
|
$pattern = "/(.?)\{([$shortcodes]+)(.*?)(\/)?\}(?(4)|(?:(.+?)\{\/\s*\\2\s*\}))?(.?)/s";
|
||||||
@@ -147,9 +150,9 @@ class Shortcode
|
|||||||
|
|
||||||
if (preg_match_all('/(\w+) *= *(?:([\'"])(.*?)\\2|([^ "\'>]+))/', $matches[3], $match, PREG_SET_ORDER)) {
|
if (preg_match_all('/(\w+) *= *(?:([\'"])(.*?)\\2|([^ "\'>]+))/', $matches[3], $match, PREG_SET_ORDER)) {
|
||||||
foreach ($match as $attribute) {
|
foreach ($match as $attribute) {
|
||||||
if ( ! empty($attribute[4])) {
|
if (! empty($attribute[4])) {
|
||||||
$attributes[strtolower($attribute[1])] = $attribute[4];
|
$attributes[strtolower($attribute[1])] = $attribute[4];
|
||||||
} elseif ( ! empty($attribute[3])) {
|
} elseif (! empty($attribute[3])) {
|
||||||
$attributes[strtolower($attribute[1])] = $attribute[3];
|
$attributes[strtolower($attribute[1])] = $attribute[3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,5 +161,4 @@ class Shortcode
|
|||||||
// Check if this shortcode realy exists then call user function else return empty string
|
// Check if this shortcode realy exists then call user function else return empty string
|
||||||
return (isset(Shortcode::$shortcode_tags[$shortcode])) ? $prefix . call_user_func(Shortcode::$shortcode_tags[$shortcode], $attributes, $matches[5], $shortcode) . $suffix : '';
|
return (isset(Shortcode::$shortcode_tags[$shortcode])) ? $prefix . call_user_func(Shortcode::$shortcode_tags[$shortcode], $attributes, $matches[5], $shortcode) . $suffix : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Site
|
class Site
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +28,9 @@ class Site
|
|||||||
*/
|
*/
|
||||||
public static function init()
|
public static function init()
|
||||||
{
|
{
|
||||||
if ( ! isset(self::$instance)) self::$instance = new Site();
|
if (! isset(self::$instance)) {
|
||||||
|
self::$instance = new Site();
|
||||||
|
}
|
||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,20 +172,20 @@ class Site
|
|||||||
// else return default template: index
|
// else return default template: index
|
||||||
// also compress template file :)
|
// also compress template file :)
|
||||||
if (File::exists(THEMES_SITE . DS . $current_theme . DS . $template . '.template.php')) {
|
if (File::exists(THEMES_SITE . DS . $current_theme . DS . $template . '.template.php')) {
|
||||||
if ( ! file_exists(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php') or
|
if (! file_exists(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php') or
|
||||||
filemtime(THEMES_SITE . DS . $current_theme . DS . $template .'.template.php') > filemtime(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php')) {
|
filemtime(THEMES_SITE . DS . $current_theme . DS . $template .'.template.php') > filemtime(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php')) {
|
||||||
$buffer = file_get_contents(THEMES_SITE. DS . $current_theme . DS . $template .'.template.php');
|
$buffer = file_get_contents(THEMES_SITE. DS . $current_theme . DS . $template .'.template.php');
|
||||||
$buffer = Minify::html($buffer);
|
$buffer = MinifyHTML::process($buffer);
|
||||||
file_put_contents(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php', $buffer);
|
file_put_contents(MINIFY . DS . 'theme.' . $current_theme . '.minify.' . $template . '.template.php', $buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'minify.'.$template;
|
return 'minify.'.$template;
|
||||||
} else {
|
} else {
|
||||||
if ( ! File::exists(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php') or
|
if (! File::exists(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php') or
|
||||||
filemtime(THEMES_SITE . DS . $current_theme . DS . 'index.template.php') > filemtime(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php')) {
|
filemtime(THEMES_SITE . DS . $current_theme . DS . 'index.template.php') > filemtime(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php')) {
|
||||||
$buffer = file_get_contents(THEMES_SITE . DS . $current_theme . DS . 'index.template.php');
|
$buffer = file_get_contents(THEMES_SITE . DS . $current_theme . DS . 'index.template.php');
|
||||||
$buffer = Minify::html($buffer);
|
$buffer = MinifyHTML::process($buffer);
|
||||||
file_put_contents(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php', $buffer);
|
file_put_contents(MINIFY . DS . 'theme.' . $current_theme . '.' . 'minify.index.template.php', $buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'minify.index';
|
return 'minify.index';
|
||||||
@@ -220,5 +219,4 @@ class Site
|
|||||||
{
|
{
|
||||||
return __('Powered by', 'system').' <a href="http://monstra.org" target="_blank">Monstra</a> ' . Monstra::VERSION;
|
return __('Powered by', 'system').' <a href="http://monstra.org" target="_blank">Monstra</a> ' . Monstra::VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Uri
|
class Uri
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +58,14 @@ class Uri
|
|||||||
|
|
||||||
// Ability to pass parameters
|
// Ability to pass parameters
|
||||||
foreach ($uri as $i => $u) {
|
foreach ($uri as $i => $u) {
|
||||||
if (isset($uri[$i])) { $pos = strrpos($uri[$i], "?"); if ($pos === false) { $uri[$i] = Security::sanitizeURL($uri[$i]); } else { $uri[$i] = Security::sanitizeURL(substr($uri[$i], 0, $pos)); } }
|
if (isset($uri[$i])) {
|
||||||
|
$pos = strrpos($uri[$i], "?");
|
||||||
|
if ($pos === false) {
|
||||||
|
$uri[$i] = Security::sanitizeURL($uri[$i]);
|
||||||
|
} else {
|
||||||
|
$uri[$i] = Security::sanitizeURL(substr($uri[$i], 0, $pos));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return uri segments
|
// Return uri segments
|
||||||
@@ -99,10 +103,10 @@ class Uri
|
|||||||
// Get uri segments
|
// Get uri segments
|
||||||
$uri = Uri::segments();
|
$uri = Uri::segments();
|
||||||
|
|
||||||
if ( ! isset($uri[0])) {
|
if (! isset($uri[0])) {
|
||||||
$uri[0] = Uri::$default_component;
|
$uri[0] = Uri::$default_component;
|
||||||
} else {
|
} else {
|
||||||
if ( ! in_array($uri[0], Plugin::$components) ) {
|
if (! in_array($uri[0], Plugin::$components)) {
|
||||||
$uri[0] = Uri::$default_component;
|
$uri[0] = Uri::$default_component;
|
||||||
} else {
|
} else {
|
||||||
$uri[0] = $uri[0];
|
$uri[0] = $uri[0];
|
||||||
@@ -130,21 +134,16 @@ class Uri
|
|||||||
$uri = Uri::segments();
|
$uri = Uri::segments();
|
||||||
|
|
||||||
// http://site.com/ and http://site.com/index.php same main home pages
|
// http://site.com/ and http://site.com/index.php same main home pages
|
||||||
if ( ! isset($uri[0])) {
|
if (! isset($uri[0])) {
|
||||||
$uri[0] = '';
|
$uri[0] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// param1/param2
|
// param1/param2
|
||||||
if ($uri[0] !== Uri::$default_component) {
|
if ($uri[0] !== Uri::$default_component) {
|
||||||
if (isset($uri[1])) {
|
if (isset($uri[1])) {
|
||||||
$data[0] = $uri[0];
|
foreach ($uri as $part) {
|
||||||
$data[1] = $uri[1];
|
$data[] = $part;
|
||||||
// Some more uri parts :)
|
}
|
||||||
// site.ru/part1/part2/part3/part4/part5/part6/
|
|
||||||
if (isset($uri[2])) $data[2] = $uri[2];
|
|
||||||
if (isset($uri[3])) $data[3] = $uri[3];
|
|
||||||
if (isset($uri[4])) $data[4] = $uri[4];
|
|
||||||
if (isset($uri[5])) $data[5] = $uri[5];
|
|
||||||
} else { // default
|
} else { // default
|
||||||
$data[0] = $uri[0];
|
$data[0] = $uri[0];
|
||||||
}
|
}
|
||||||
@@ -161,5 +160,4 @@ class Uri
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class DB
|
class DB
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +39,9 @@ class DB
|
|||||||
*/
|
*/
|
||||||
public static function configure($setting, $value)
|
public static function configure($setting, $value)
|
||||||
{
|
{
|
||||||
if (property_exists("db", $setting)) DB::$$setting = $value;
|
if (property_exists("db", $setting)) {
|
||||||
|
DB::$$setting = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +57,9 @@ class DB
|
|||||||
$db_name = (string) $db_name;
|
$db_name = (string) $db_name;
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
if (is_dir(DB::$db_dir . '/' . $db_name)) return false;
|
if (is_dir(DB::$db_dir . '/' . $db_name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return mkdir(DB::$db_dir . '/' . $db_name, $chmod);
|
return mkdir(DB::$db_dir . '/' . $db_name, $chmod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,8 +75,18 @@ class DB
|
|||||||
$db_name = (string) $db_name;
|
$db_name = (string) $db_name;
|
||||||
|
|
||||||
// Drop
|
// Drop
|
||||||
if (is_dir(DB::$db_dir . '/' . $db_name)){$ob=scandir(DB::$db_dir . '/' . $db_name); foreach ($ob as $o) {if ($o!='.'&&$o!='..') {if(filetype(DB::$db_dir . '/' . $db_name.'/'.$o)=='dir')DB::drop(DB::$db_dir . '/' . $db_name.'/'.$o); else unlink(DB::$db_dir . '/' . $db_name.'/'.$o);}}}
|
if (is_dir(DB::$db_dir . '/' . $db_name)) {
|
||||||
reset($ob); rmdir(DB::$db_dir . '/' . $db_name);
|
$ob=scandir(DB::$db_dir . '/' . $db_name); foreach ($ob as $o) {
|
||||||
|
if ($o!='.'&&$o!='..') {
|
||||||
|
if (filetype(DB::$db_dir . '/' . $db_name.'/'.$o)=='dir') {
|
||||||
|
DB::drop(DB::$db_dir . '/' . $db_name.'/'.$o);
|
||||||
|
} else {
|
||||||
|
unlink(DB::$db_dir . '/' . $db_name.'/'.$o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reset($ob);
|
||||||
|
rmdir(DB::$db_dir . '/' . $db_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Table
|
class Table
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -46,7 +43,9 @@ class Table
|
|||||||
*/
|
*/
|
||||||
public static function configure($setting, $value)
|
public static function configure($setting, $value)
|
||||||
{
|
{
|
||||||
if (property_exists("table", $setting)) Table::$$setting = $value;
|
if (property_exists("table", $setting)) {
|
||||||
|
Table::$$setting = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,7 +112,7 @@ class Table
|
|||||||
// Redefine vars
|
// Redefine vars
|
||||||
$table_name = (string) $table_name;
|
$table_name = (string) $table_name;
|
||||||
|
|
||||||
if ( ! file_exists(Table::$tables_dir . '/' . $table_name . '.table.xml') &&
|
if (! file_exists(Table::$tables_dir . '/' . $table_name . '.table.xml') &&
|
||||||
is_dir(dirname(Table::$tables_dir)) &&
|
is_dir(dirname(Table::$tables_dir)) &&
|
||||||
is_writable(dirname(Table::$tables_dir)) &&
|
is_writable(dirname(Table::$tables_dir)) &&
|
||||||
isset($fields) &&
|
isset($fields) &&
|
||||||
@@ -121,12 +120,13 @@ class Table
|
|||||||
|
|
||||||
// Create table fields
|
// Create table fields
|
||||||
$_fields = '<fields>';
|
$_fields = '<fields>';
|
||||||
foreach ($fields as $field) $_fields .= "<$field/>";
|
foreach ($fields as $field) {
|
||||||
|
$_fields .= "<$field/>";
|
||||||
|
}
|
||||||
$_fields .= '</fields>';
|
$_fields .= '</fields>';
|
||||||
|
|
||||||
// Create new table
|
// Create new table
|
||||||
return file_put_contents(Table::$tables_dir . '/' . $table_name . '.table.xml','<?xml version="1.0" encoding="UTF-8"?><root><options><autoincrement>0</autoincrement></options>'.$_fields.'</root>', LOCK_EX);
|
return file_put_contents(Table::$tables_dir . '/' . $table_name . '.table.xml', '<?xml version="1.0" encoding="UTF-8"?><root><options><autoincrement>0</autoincrement></options>'.$_fields.'</root>', LOCK_EX);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Something wrong... return false
|
// Something wrong... return false
|
||||||
@@ -150,7 +150,7 @@ class Table
|
|||||||
$table_name = (string) $table_name;
|
$table_name = (string) $table_name;
|
||||||
|
|
||||||
// Drop
|
// Drop
|
||||||
if ( ! is_dir(Table::$tables_dir . '/' . $table_name . '.table.xml')) {
|
if (! is_dir(Table::$tables_dir . '/' . $table_name . '.table.xml')) {
|
||||||
return unlink(Table::$tables_dir . '/' . $table_name . '.table.xml');
|
return unlink(Table::$tables_dir . '/' . $table_name . '.table.xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,12 +260,9 @@ class Table
|
|||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
return Table::_save($table);
|
return Table::_save($table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -297,10 +294,8 @@ class Table
|
|||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
return Table::_save($table);
|
return Table::_save($table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,7 +403,6 @@ class Table
|
|||||||
|
|
||||||
// If exists fields to insert then insert them
|
// If exists fields to insert then insert them
|
||||||
if (count($fields) !== 0) {
|
if (count($fields) !== 0) {
|
||||||
|
|
||||||
$table_fields = array_diff_key($field_names, $fields);
|
$table_fields = array_diff_key($field_names, $fields);
|
||||||
|
|
||||||
// Defined fields
|
// Defined fields
|
||||||
@@ -424,10 +418,8 @@ class Table
|
|||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
return Table::_save($this->table);
|
return Table::_save($this->table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,12 +466,10 @@ class Table
|
|||||||
// If row count is null then select only one record
|
// If row count is null then select only one record
|
||||||
// eg: $users->select('[login="admin"]', null);
|
// eg: $users->select('[login="admin"]', null);
|
||||||
if ($row_count == null) {
|
if ($row_count == null) {
|
||||||
|
|
||||||
if (isset($tmp[0])) {
|
if (isset($tmp[0])) {
|
||||||
$_records = $tmp[0];
|
$_records = $tmp[0];
|
||||||
$one_record = true;
|
$one_record = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// If row count is 'all' then select all records
|
// If row count is 'all' then select all records
|
||||||
@@ -496,12 +486,9 @@ class Table
|
|||||||
|
|
||||||
// If array of fields is exits then get records with this fields only
|
// If array of fields is exits then get records with this fields only
|
||||||
if (count($fields) > 0) {
|
if (count($fields) > 0) {
|
||||||
|
|
||||||
if (count($_records) > 0) {
|
if (count($_records) > 0) {
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($_records as $key => $record) {
|
foreach ($_records as $key => $record) {
|
||||||
|
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$record_array[$count][$field] = (string) $record->$field;
|
$record_array[$count][$field] = (string) $record->$field;
|
||||||
}
|
}
|
||||||
@@ -515,7 +502,6 @@ class Table
|
|||||||
}
|
}
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort records
|
// Sort records
|
||||||
@@ -527,9 +513,7 @@ class Table
|
|||||||
} elseif ($offset !== null && is_int($row_count)) {
|
} elseif ($offset !== null && is_int($row_count)) {
|
||||||
$records = array_slice($records, $offset, $row_count);
|
$records = array_slice($records, $offset, $row_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Convert from XML object to array
|
// Convert from XML object to array
|
||||||
@@ -537,7 +521,6 @@ class Table
|
|||||||
if (! $one_record) {
|
if (! $one_record) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($_records as $xml_objects) {
|
foreach ($_records as $xml_objects) {
|
||||||
|
|
||||||
$vars = get_object_vars($xml_objects);
|
$vars = get_object_vars($xml_objects);
|
||||||
|
|
||||||
foreach ($vars as $key => $value) {
|
foreach ($vars as $key => $value) {
|
||||||
@@ -546,7 +529,7 @@ class Table
|
|||||||
if ($order_by == 'id') {
|
if ($order_by == 'id') {
|
||||||
$records[$count]['sort'] = (int) $vars['id'];
|
$records[$count]['sort'] = (int) $vars['id'];
|
||||||
} else {
|
} else {
|
||||||
$records[$count]['sort'] = (string) $value;
|
$records[$count]['sort'] = (string) $vars[$order_by];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -562,7 +545,6 @@ class Table
|
|||||||
} elseif ($offset !== null && is_int($row_count)) {
|
} elseif ($offset !== null && is_int($row_count)) {
|
||||||
$records = array_slice($records, $offset, $row_count);
|
$records = array_slice($records, $offset, $row_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Single record
|
// Single record
|
||||||
@@ -575,7 +557,6 @@ class Table
|
|||||||
|
|
||||||
// Return records
|
// Return records
|
||||||
return $records;
|
return $records;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -601,7 +582,6 @@ class Table
|
|||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
unset($xml_arr[0]);
|
unset($xml_arr[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
@@ -631,7 +611,6 @@ class Table
|
|||||||
|
|
||||||
// Delete
|
// Delete
|
||||||
unset($xml_arr[0]);
|
unset($xml_arr[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
@@ -690,10 +669,8 @@ class Table
|
|||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
return Table::_save($this->table);
|
return Table::_save($this->table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,16 +724,13 @@ class Table
|
|||||||
|
|
||||||
// And add new one
|
// And add new one
|
||||||
$xml_arr->addChild($key, XML::safe($value, false));
|
$xml_arr->addChild($key, XML::safe($value, false));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save table
|
// Save table
|
||||||
return Table::_save($this->table);
|
return Table::_save($this->table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,12 +775,21 @@ class Table
|
|||||||
protected static function subvalSort($a, $subkey, $order = null)
|
protected static function subvalSort($a, $subkey, $order = null)
|
||||||
{
|
{
|
||||||
if (count($a) != 0 || (!empty($a))) {
|
if (count($a) != 0 || (!empty($a))) {
|
||||||
foreach ($a as $k=>$v) $b[$k] = function_exists('mb_strtolower') ? mb_strtolower($v[$subkey]) : strtolower($v[$subkey]);
|
foreach ($a as $k=>$v) {
|
||||||
if ($order==null || $order== 'ASC') asort($b); else if ($order == 'DESC') arsort($b);
|
$b[$k] = function_exists('mb_strtolower') ? mb_strtolower($v[$subkey]) : strtolower($v[$subkey]);
|
||||||
foreach ($b as $key=>$val) $c[] = $a[$key];
|
}
|
||||||
|
if ($order==null || $order== 'ASC') {
|
||||||
|
asort($b);
|
||||||
|
} elseif ($order == 'DESC') {
|
||||||
|
arsort($b);
|
||||||
|
}
|
||||||
|
foreach ($b as $key=>$val) {
|
||||||
|
$c[] = $a[$key];
|
||||||
|
}
|
||||||
|
|
||||||
return $c;
|
return $c;
|
||||||
}
|
}
|
||||||
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -853,7 +836,7 @@ class Table
|
|||||||
*/
|
*/
|
||||||
protected static function _save($table)
|
protected static function _save($table)
|
||||||
{
|
{
|
||||||
$dom = new DOMDocument('1.0');
|
$dom = new DOMDocument('1.0', 'utf-8');
|
||||||
$dom->preserveWhiteSpace = false;
|
$dom->preserveWhiteSpace = false;
|
||||||
|
|
||||||
// Save new xml data to xml file only if loadXML successful.
|
// Save new xml data to xml file only if loadXML successful.
|
||||||
@@ -871,5 +854,4 @@ class Table
|
|||||||
// report about errors...
|
// report about errors...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,20 +1,17 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class XML
|
class XML
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +49,9 @@ class XML
|
|||||||
} while ($cleaned != $str);
|
} while ($cleaned != $str);
|
||||||
|
|
||||||
// htmlspecialchars
|
// htmlspecialchars
|
||||||
if ($flag) $str = htmlspecialchars($str, ENT_QUOTES, 'utf-8');
|
if ($flag) {
|
||||||
|
$str = htmlspecialchars($str, ENT_QUOTES, 'utf-8');
|
||||||
|
}
|
||||||
|
|
||||||
// Return safe string
|
// Return safe string
|
||||||
return $str;
|
return $str;
|
||||||
@@ -92,5 +91,4 @@ class XML
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,10 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report All Errors
|
* Monstra requires PHP 5.3.2 or greater
|
||||||
*
|
|
||||||
* By setting error reporting to -1, we essentially force PHP to report
|
|
||||||
* every error, and this is guranteed to show every error on future
|
|
||||||
* releases of PHP. This allows everything to be fixed early!
|
|
||||||
*/
|
*/
|
||||||
error_reporting(-1);
|
if (version_compare(PHP_VERSION, "5.3.2", "<")) {
|
||||||
|
exit("Monstra requires PHP 5.3.2 or greater.");
|
||||||
/**
|
|
||||||
* Monstra requires PHP 5.2.0 or greater
|
|
||||||
*/
|
|
||||||
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
|
|
||||||
exit("Monstra requires PHP 5.2.0 or greater.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,7 +21,16 @@ include ROOT . DS .'engine'. DS .'Monstra.php';
|
|||||||
* Monstra::STAGING - The staging environment.
|
* Monstra::STAGING - The staging environment.
|
||||||
* Monstra::PRODUCTION - The production environment.
|
* Monstra::PRODUCTION - The production environment.
|
||||||
*/
|
*/
|
||||||
Monstra::$environment = Monstra::DEVELOPMENT;
|
Monstra::$environment = Monstra::PRODUCTION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Report Errors
|
||||||
|
*/
|
||||||
|
if (Monstra::$environment == Monstra::PRODUCTION) {
|
||||||
|
error_reporting(0);
|
||||||
|
} else {
|
||||||
|
error_reporting(-1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize Monstra
|
* Initialize Monstra
|
||||||
|
@@ -4,4 +4,7 @@
|
|||||||
* Set meta generator
|
* Set meta generator
|
||||||
*/
|
*/
|
||||||
Action::add('theme_meta', 'setMetaGenerator');
|
Action::add('theme_meta', 'setMetaGenerator');
|
||||||
function setMetaGenerator() { echo '<meta name="generator" content="Powered by Monstra '.Monstra::VERSION.'" />'; }
|
function setMetaGenerator()
|
||||||
|
{
|
||||||
|
echo '<meta name="generator" content="Powered by Monstra '.Monstra::VERSION.'" />'."\n";
|
||||||
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
<?php defined('MONSTRA_ACCESS') or die('No direct script access.');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra CMS Defines
|
* Monstra Defines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,3 +91,4 @@ define('MONSTRA_GZIP', false);
|
|||||||
//define('MONSTRA_DB_DSN', 'mysql:dbname=monstra;host=localhost;port=3306');
|
//define('MONSTRA_DB_DSN', 'mysql:dbname=monstra;host=localhost;port=3306');
|
||||||
//define('MONSTRA_DB_USER', 'root');
|
//define('MONSTRA_DB_USER', 'root');
|
||||||
//define('MONSTRA_DB_PASSWORD', 'password');
|
//define('MONSTRA_DB_PASSWORD', 'password');
|
||||||
|
|
||||||
|
@@ -3,7 +3,9 @@
|
|||||||
/**
|
/**
|
||||||
* Evaluate a string as PHP code
|
* Evaluate a string as PHP code
|
||||||
*/
|
*/
|
||||||
if (MONSTRA_EVAL_PHP) Filter::add('content', 'evalPHP');
|
if (MONSTRA_EVAL_PHP) {
|
||||||
|
Filter::add('content', 'evalPHP');
|
||||||
|
}
|
||||||
function obEval($mathes)
|
function obEval($mathes)
|
||||||
{
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
@@ -13,7 +15,10 @@ function obEval($mathes)
|
|||||||
|
|
||||||
return $mathes;
|
return $mathes;
|
||||||
}
|
}
|
||||||
function evalPHP($str) { return preg_replace_callback('/\[php\](.*?)\[\/php\]/ms','obEval', $str); }
|
function evalPHP($str)
|
||||||
|
{
|
||||||
|
return preg_replace_callback('/\[php\](.*?)\[\/php\]/ms', 'obEval', $str);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add shortcode parser filter
|
* Add shortcode parser filter
|
||||||
|
@@ -4,4 +4,7 @@
|
|||||||
* Add new shortcode {siteurl}
|
* Add new shortcode {siteurl}
|
||||||
*/
|
*/
|
||||||
Shortcode::add('siteurl', 'returnSiteUrl');
|
Shortcode::add('siteurl', 'returnSiteUrl');
|
||||||
function returnSiteUrl() { return Option::get('siteurl'); }
|
function returnSiteUrl()
|
||||||
|
{
|
||||||
|
return Option::get('siteurl');
|
||||||
|
}
|
||||||
|
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
32
index.php
32
index.php
@@ -1,36 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monstra Engine
|
* Monstra
|
||||||
*
|
*
|
||||||
* This source file is part of the Monstra Engine. More information,
|
* @package Monstra
|
||||||
* documentation and tutorials can be found at http://monstra.org
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
* @link http://monstra.org
|
||||||
* @package Monstra
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Main engine defines
|
// Main engine defines
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
define('ROOT', rtrim(dirname(__FILE__), '\\/'));
|
define('ROOT', rtrim(dirname(__FILE__), '\\/'));
|
||||||
define('BACKEND', false);
|
define('BACKEND', false);
|
||||||
define('MONSTRA_ACCESS', true);
|
define('MONSTRA_ACCESS', true);
|
||||||
|
|
||||||
/* TEMP CODE BEGIN */
|
|
||||||
function byteFormat($size)
|
|
||||||
{
|
|
||||||
$unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');
|
|
||||||
|
|
||||||
return @round($size/pow(1024, ($i=floor(log($size, 1024)))), 2).' '.$unit[$i];
|
|
||||||
}
|
|
||||||
$_start = memory_get_usage();
|
|
||||||
/* TEMP CODE END */
|
|
||||||
|
|
||||||
// First check for installer then go
|
// First check for installer then go
|
||||||
if (file_exists('install.php')) {
|
if (file_exists('install.php')) {
|
||||||
if (isset($_GET['install'])) {
|
if (isset($_GET['install'])) {
|
||||||
@@ -55,7 +42,10 @@ if (file_exists('install.php')) {
|
|||||||
if ((Session::exists('user_role')) and (Session::get('user_role') == 'admin' or Session::get('user_role') == 'editor')) {
|
if ((Session::exists('user_role')) and (Session::get('user_role') == 'admin' or Session::get('user_role') == 'editor')) {
|
||||||
// Monstra show this page :)
|
// Monstra show this page :)
|
||||||
} else {
|
} else {
|
||||||
die (Text::toHtml(Option::get('maintenance_message')));
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||||
|
header('Status: 503 Service Temporarily Unavailable');
|
||||||
|
header('Retry-After: 600');
|
||||||
|
die(Text::toHtml(Option::get('maintenance_message')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +61,3 @@ if (file_exists('install.php')) {
|
|||||||
// Flush (send) the output buffer and turn off output buffering
|
// Flush (send) the output buffer and turn off output buffering
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TEMP CODE BEGIN */
|
|
||||||
echo byteFormat(memory_get_usage() - $_start);
|
|
||||||
/* TEMP CODE END */
|
|
||||||
|
722
install.php
Normal file → Executable file
722
install.php
Normal file → Executable file
@@ -5,13 +5,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Main engine defines
|
// Main engine defines
|
||||||
if ( ! defined('DS')) define('DS', DIRECTORY_SEPARATOR);
|
if (! defined('DS')) {
|
||||||
if ( ! defined('ROOT')) define('ROOT', rtrim(dirname(__FILE__), '\\/'));
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
if ( ! defined('BACKEND')) define('BACKEND', false);
|
}
|
||||||
if ( ! defined('MONSTRA_ACCESS')) define('MONSTRA_ACCESS', true);
|
if (! defined('ROOT')) {
|
||||||
|
define('ROOT', rtrim(dirname(__FILE__), '\\/'));
|
||||||
// Set default timezone
|
}
|
||||||
$system_timezone = date_default_timezone_get();
|
if (! defined('BACKEND')) {
|
||||||
|
define('BACKEND', false);
|
||||||
|
}
|
||||||
|
if (! defined('MONSTRA_ACCESS')) {
|
||||||
|
define('MONSTRA_ACCESS', true);
|
||||||
|
}
|
||||||
|
|
||||||
// Load bootstrap file
|
// Load bootstrap file
|
||||||
require_once(ROOT . DS . 'engine' . DS . '_init.php');
|
require_once(ROOT . DS . 'engine' . DS . '_init.php');
|
||||||
@@ -19,8 +24,18 @@
|
|||||||
// Get array with the names of all modules compiled and loaded
|
// Get array with the names of all modules compiled and loaded
|
||||||
$php_modules = get_loaded_extensions();
|
$php_modules = get_loaded_extensions();
|
||||||
|
|
||||||
|
// Get server port
|
||||||
|
if ($_SERVER["SERVER_PORT"] == "80") {
|
||||||
|
$port = "";
|
||||||
|
} else {
|
||||||
|
$port = ':'.$_SERVER["SERVER_PORT"];
|
||||||
|
}
|
||||||
|
|
||||||
// Get site URL
|
// Get site URL
|
||||||
$site_url = 'http://'.$_SERVER["SERVER_NAME"].str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']);
|
$site_url = 'http://'.$_SERVER["SERVER_NAME"].$port.str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']);
|
||||||
|
|
||||||
|
// Replace last slash in site_url
|
||||||
|
$site_url = rtrim($site_url, '/');
|
||||||
|
|
||||||
// Rewrite base
|
// Rewrite base
|
||||||
$rewrite_base = str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']);
|
$rewrite_base = str_replace(array("index.php", "install.php"), "", $_SERVER['PHP_SELF']);
|
||||||
@@ -32,38 +47,74 @@
|
|||||||
$dir_array = array('public', 'storage', 'backups', 'tmp');
|
$dir_array = array('public', 'storage', 'backups', 'tmp');
|
||||||
|
|
||||||
// Languages array
|
// Languages array
|
||||||
$languages_array = array('en', 'ru', 'lt', 'it', 'de', 'pt-br', 'uk');
|
$languages_array = array('en', 'ru', 'fr', 'de', 'it', 'es', 'lt', 'pl', 'pt-br', 'hu', 'fa' , 'sk', 'uk', 'nl', 'sr', 'id', 'ja', 'zh-cn', 'tr');
|
||||||
|
|
||||||
// Select Monstra language
|
// Select Monstra language
|
||||||
if (Request::get('language')) {
|
if (Request::get('language')) {
|
||||||
|
if (Request::get('action') && Request::get('action') == 'install') {
|
||||||
|
$action = '?action=install';
|
||||||
|
} else {
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
if (in_array(Request::get('language'), $languages_array)) {
|
if (in_array(Request::get('language'), $languages_array)) {
|
||||||
if (Option::update('language', Request::get('language'))) {
|
if (Option::update('language', Request::get('language'))) {
|
||||||
Request::redirect($site_url);
|
Request::redirect($site_url.$action);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Request::redirect($site_url);
|
Request::redirect($site_url.$action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If pressed <Install> button then try to install
|
// If pressed <Install> button then try to install
|
||||||
if (Request::post('install_submit')) {
|
if (Request::post('install_submit')) {
|
||||||
|
if (Request::post('sitename') == '') {
|
||||||
if (Request::post('sitename') == '') $errors['sitename'] = __('Field "Site name" is empty', 'system');
|
$errors['sitename'] = __('Field "Site name" is empty', 'system');
|
||||||
if (Request::post('siteurl') == '') $errors['siteurl'] = __('Field "Site url" is empty', 'system');
|
}
|
||||||
if (Request::post('login') == '') $errors['login'] = __('Field "Username" is empty', 'system');
|
if (Request::post('siteurl') == '') {
|
||||||
if (Request::post('password') == '') $errors['password'] = __('Field "Password" is empty', 'system');
|
$errors['siteurl'] = __('Field "Site url" is empty', 'system');
|
||||||
if (Request::post('email') == '') $errors['email'] = __('Field "Email" is empty', 'system');
|
}
|
||||||
if ( ! Valid::email(Request::post('email'))) $errors['email_valid'] = __('Email not valid', 'system');
|
if (Request::post('login') == '') {
|
||||||
if (trim(Request::post('php') !== '')) $errors['php'] = true;
|
$errors['login'] = __('Field "Username" is empty', 'system');
|
||||||
if (trim(Request::post('simplexml') !== '')) $errors['simplexml'] = true;
|
}
|
||||||
if (trim(Request::post('mod_rewrite') !== '')) $errors['mod_rewrite'] = true;
|
if (Request::post('password') == '') {
|
||||||
if (trim(Request::post('htaccess') !== '')) $errors['htaccess'] = true;
|
$errors['password'] = __('Field "Password" is empty', 'system');
|
||||||
if (trim(Request::post('sitemap') !== '')) $errors['sitemap'] = true;
|
}
|
||||||
if (trim(Request::post('install') !== '')) $errors['install'] = true;
|
if (Request::post('email') == '') {
|
||||||
if (trim(Request::post('public') !== '')) $errors['public'] = true;
|
$errors['email'] = __('Field "Email" is empty', 'system');
|
||||||
if (trim(Request::post('storage') !== '')) $errors['storage'] = true;
|
}
|
||||||
if (trim(Request::post('backups') !== '')) $errors['backups'] = true;
|
if (! Valid::email(Request::post('email'))) {
|
||||||
if (trim(Request::post('tmp') !== '')) $errors['tmp'] = true;
|
$errors['email_valid'] = __('Email not valid', 'system');
|
||||||
|
}
|
||||||
|
if (trim(Request::post('php') !== '')) {
|
||||||
|
$errors['php'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('simplexml') !== '')) {
|
||||||
|
$errors['simplexml'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('mod_rewrite') !== '')) {
|
||||||
|
$errors['mod_rewrite'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('htaccess') !== '')) {
|
||||||
|
$errors['htaccess'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('sitemap') !== '')) {
|
||||||
|
$errors['sitemap'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('install') !== '')) {
|
||||||
|
$errors['install'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('public') !== '')) {
|
||||||
|
$errors['public'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('storage') !== '')) {
|
||||||
|
$errors['storage'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('backups') !== '')) {
|
||||||
|
$errors['backups'] = true;
|
||||||
|
}
|
||||||
|
if (trim(Request::post('tmp') !== '')) {
|
||||||
|
$errors['tmp'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
// If errors is 0 then install cms
|
// If errors is 0 then install cms
|
||||||
if (count($errors) == 0) {
|
if (count($errors) == 0) {
|
||||||
@@ -77,6 +128,7 @@
|
|||||||
'slogan' => __('Site slogan', 'system'),
|
'slogan' => __('Site slogan', 'system'),
|
||||||
'defaultpage' => 'home',
|
'defaultpage' => 'home',
|
||||||
'timezone' => Request::post('timezone'),
|
'timezone' => Request::post('timezone'),
|
||||||
|
'system_email' => Request::post('email'),
|
||||||
'theme_site_name' => 'default',
|
'theme_site_name' => 'default',
|
||||||
'theme_admin_name' => 'default'));
|
'theme_admin_name' => 'default'));
|
||||||
|
|
||||||
@@ -95,12 +147,14 @@
|
|||||||
$htaccess = file_get_contents('.htaccess');
|
$htaccess = file_get_contents('.htaccess');
|
||||||
$save_htaccess_content = str_replace("/%siteurlhere%/", $rewrite_base, $htaccess);
|
$save_htaccess_content = str_replace("/%siteurlhere%/", $rewrite_base, $htaccess);
|
||||||
|
|
||||||
$handle = fopen ('.htaccess', "w");
|
$handle = fopen('.htaccess', "w");
|
||||||
fwrite($handle, $save_htaccess_content);
|
fwrite($handle, $save_htaccess_content);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
|
||||||
// Installation done :)
|
// Installation done :)
|
||||||
header("location: index.php?install=done");
|
header("location: index.php?install=done");
|
||||||
|
} else {
|
||||||
|
Notification::setNow('errors', $errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -111,108 +165,138 @@
|
|||||||
<title>Monstra :: Install</title>
|
<title>Monstra :: Install</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="Monstra Install Area">
|
<meta name="description" content="Monstra Install Area">
|
||||||
<link rel="icon" href="<?php echo $site_url; ?>favicon.ico" type="image/x-icon" />
|
<link rel="icon" href="<?php echo $site_url; ?>/favicon.ico" type="image/x-icon" />
|
||||||
<link rel="shortcut icon" href="<?php echo $site_url; ?>favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="<?php echo $site_url; ?>/favicon.ico" type="image/x-icon" />
|
||||||
<link rel="stylesheet" href="<?php echo $site_url; ?>public/assets/css/bootstrap.css" media="all" type="text/css" />
|
<link rel="stylesheet" href="<?php echo $site_url; ?>/public/assets/css/bootstrap.css" media="all" type="text/css" />
|
||||||
<link rel="stylesheet" href="<?php echo $site_url; ?>public/assets/css/bootstrap-responsive.css" media="all" type="text/css" />
|
<link rel="stylesheet" href="<?php echo $site_url; ?>/admin/themes/default/css/default.css" media="all" type="text/css" />
|
||||||
<link rel="stylesheet" href="<?php echo $site_url; ?>admin/themes/default/css/default.css" media="all" type="text/css" />
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
.input-xlarge {
|
.install-body {
|
||||||
width: 285px;
|
margin-top: 40px;
|
||||||
|
background: #FAFAFA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.install-languages {
|
.install-languages {
|
||||||
margin: 0 auto;
|
margin: 20px auto 20px;
|
||||||
float: none!important;
|
text-align: center;
|
||||||
margin-bottom:5px;
|
width: 600px;
|
||||||
padding-right:20px;
|
|
||||||
max-width: 300px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.install-block {
|
.install-block,
|
||||||
|
.monstra-dialog,
|
||||||
|
.install-block-footer {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
float: none!important;
|
width: 600px;
|
||||||
max-width: 300px;
|
|
||||||
padding: 19px 29px 29px;
|
|
||||||
background: none repeat scroll 0 0 #fff;
|
|
||||||
-webkit-box-shadow: 0 1px 5px rgba(0,0,0,.15);
|
|
||||||
-moz-box-shadow: 0 1px 5px rgba(0,0,0,.15);
|
|
||||||
box-shadow: 0 1px 5px rgba(0,0,0,.15);
|
|
||||||
-webkit-border-radius: 4px;
|
|
||||||
-moz-border-radius: 4px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.install-block-footer {
|
.install-block-footer {
|
||||||
margin: 0 auto;
|
margin-top: 20px;
|
||||||
float: none!important;
|
margin-bottom: 20px;
|
||||||
margin-top:10px;
|
|
||||||
margin-bottom:10px;
|
|
||||||
max-width: 300px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.install-body {
|
.well {
|
||||||
background-color: #FBFBFB;
|
border: none;
|
||||||
padding-top:40px;
|
border-radius: 0px;
|
||||||
|
background: #fff;
|
||||||
|
color: #555;
|
||||||
|
-webkit-font-smoothing: subpixel-antialiased;
|
||||||
|
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13);
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,.13);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
border-radius: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.monstra-says {
|
||||||
|
margin: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
color:#8E0505;
|
color:#8E0505;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ok {
|
.ok {
|
||||||
color:#00853F;
|
color:#00853F;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.warn {
|
.warn {
|
||||||
color: #F74C18;
|
color: #F74C18;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language-link {
|
.install-languages a {
|
||||||
color:#7A7A7C;
|
padding-left: 2px;
|
||||||
|
padding-right: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language-link+.language-link:before {
|
.language-link img {
|
||||||
color: #ccc;
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
|
||||||
content: ' | ';
|
filter: alpha(opacity=30);
|
||||||
|
-khtml-opacity: 0.3;
|
||||||
|
-moz-opacity:0.3;
|
||||||
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language-link:hover {
|
.language-link-current img {
|
||||||
color:#000;
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||||
text-decoration: none;
|
filter: alpha(opacity=100);
|
||||||
|
-moz-opacity:1.0;
|
||||||
|
-khtml-opacity: 1.0;
|
||||||
|
opacity: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language-link-current {
|
.install-languages a img:hover {
|
||||||
color:#000;
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||||
font-weight: 700;
|
filter: alpha(opacity=100);
|
||||||
|
-moz-opacity:1.0;
|
||||||
|
-khtml-opacity: 1.0;
|
||||||
|
opacity: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.continue {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<script src="<?php echo $site_url; ?>/public/assets/js/jquery.min.js"></script>
|
||||||
|
<script src="<?php echo $site_url; ?>/public/assets/js/bootstrap.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="install-body">
|
<body class="install-body">
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
|
if (version_compare(PHP_VERSION, "5.3.2", "<")) {
|
||||||
$errors['php'] = 'error';
|
$errors['php'] = 'error';
|
||||||
} else {
|
} else {
|
||||||
$errors['php'] = '';
|
$errors['php'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('SimpleXML', $php_modules)) {
|
if (in_array('SimpleXML', $php_modules)) {
|
||||||
$errors['simplexml'] = '';
|
$errors['simplexml'] = '';
|
||||||
} else {
|
} else {
|
||||||
$errors['simplexml'] = 'error';
|
$errors['simplexml'] = 'error';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('apache_get_modules')) {
|
if (function_exists('apache_get_modules')) {
|
||||||
if ( ! in_array('mod_rewrite', apache_get_modules())) {
|
if (! in_array('mod_rewrite', apache_get_modules())) {
|
||||||
$errors['mod_rewrite'] = 'error';
|
$errors['mod_rewrite'] = 'error';
|
||||||
} else {
|
} else {
|
||||||
$errors['mod_rewrite'] = '';
|
$errors['mod_rewrite'] = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors['mod_rewrite'] = '';
|
$errors['mod_rewrite'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_writable(__FILE__)) {
|
if (is_writable(__FILE__)) {
|
||||||
@@ -241,211 +325,297 @@
|
|||||||
$errors[$dir] = 'error';
|
$errors[$dir] = 'error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="install-languages">
|
<div class="text-center"><a class="brand" href="<?php echo Html::toText($site_url); ?>"><img src="<?php echo $site_url; ?>/public/assets/img/monstra-logo-256px.png" alt="Monstra"></a></div>
|
||||||
<?php foreach ($languages_array as $lang_code) {?>
|
|
||||||
<a class="language-link<?php if (Option::get('language') == $lang_code) echo ' language-link-current';?>" href="<?php echo $site_url.'?language=' . $lang_code; ?>"><?php echo $lang_code?></a>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
<div class="install-block">
|
|
||||||
<div style="text-align:center;"><a class="brand" href="<?php echo Html::toText($site_url); ?>"><img src="<?php echo $site_url; ?>public/assets/img/monstra-logo.png" height="27" width="171" alt="Monstra"></a></div>
|
|
||||||
<hr>
|
|
||||||
<div>
|
|
||||||
<form action="install.php" method="post">
|
|
||||||
<input type="hidden" name="php" value="<?php echo $errors['php']; ?>" />
|
|
||||||
<input type="hidden" name="simplexml" value="<?php echo $errors['simplexml']; ?>" />
|
|
||||||
<input type="hidden" name="mod_rewrite" value="<?php echo $errors['mod_rewrite']; ?>" />
|
|
||||||
<input type="hidden" name="install" value="<?php echo $errors['install']; ?>" />
|
|
||||||
<input type="hidden" name="sitemap" value="<?php echo $errors['sitemap']; ?>" />
|
|
||||||
<input type="hidden" name="htaccess" value="<?php echo $errors['htaccess']; ?>" />
|
|
||||||
<input type="hidden" name="public" value="<?php echo $errors['public']; ?>" />
|
|
||||||
<input type="hidden" name="storage" value="<?php echo $errors['storage']; ?>" />
|
|
||||||
<input type="hidden" name="backups" value="<?php echo $errors['backups']; ?>" />
|
|
||||||
<input type="hidden" name="tmp" value="<?php echo $errors['tmp']; ?>" />
|
|
||||||
|
|
||||||
<label><?php echo __('Site name', 'system'); ?></label>
|
<div class="install-languages">
|
||||||
<input class="input-xlarge" name="sitename" type="text" value="<?php if (Request::post('sitename')) echo Html::toText(Request::post('sitename')); ?>" />
|
<?php
|
||||||
<br />
|
if (Request::get('action') && Request::get('action') == 'install') {
|
||||||
<label><?php echo __('Site url', 'system'); ?></label>
|
$action = '&action=install';
|
||||||
<input class="input-xlarge" name="siteurl" type="text" value="<?php echo Html::toText($site_url); ?>" />
|
} else {
|
||||||
<br />
|
$action = '';
|
||||||
<label><?php echo __('Username', 'users'); ?></label>
|
}
|
||||||
<input class="input-xlarge" class="login" name="login" value="<?php if(Request::post('login')) echo Html::toText(Request::post('login')); ?>" type="text" />
|
?>
|
||||||
<br />
|
<?php foreach ($languages_array as $lang_code) {
|
||||||
<label><?php echo __('Password', 'users'); ?></label>
|
?>
|
||||||
<input class="input-xlarge" name="password" type="password" />
|
<a data-placement="top" data-toggle="tooltip" class="language-link<?php if (Option::get('language') == $lang_code) {
|
||||||
<br />
|
echo ' language-link-current';
|
||||||
<label><?php echo __('Time zone', 'system'); ?></label>
|
}
|
||||||
<select class="input-xlarge" name="timezone">
|
?>" title="<?php echo I18n::$locales[$lang_code];
|
||||||
<option value="Kwajalein">(GMT-12:00) International Date Line West</option>
|
?>" href="<?php echo $site_url.'/?language=' . $lang_code.$action;
|
||||||
<option value="Pacific/Samoa">(GMT-11:00) Midway Island, Samoa</option>
|
?>"><img src="<?php echo $site_url;
|
||||||
<option value="Pacific/Honolulu">(GMT-10:00) Hawaii</option>
|
?>/public/assets/img/flags/<?php echo $lang_code?>.png" alt="<?php echo $lang_code?>"></a>
|
||||||
<option value="America/Anchorage">(GMT-09:00) Alaska</option>
|
<?php
|
||||||
<option value="America/Los_Angeles">(GMT-08:00) Pacific Time (US & Canada)</option>
|
|
||||||
<option value="America/Tijuana">(GMT-08:00) Tijuana, Baja California</option>
|
|
||||||
<option value="America/Denver">(GMT-07:00) Mountain Time (US & Canada)</option>
|
|
||||||
<option value="America/Chihuahua">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
|
|
||||||
<option value="America/Phoenix">(GMT-07:00) Arizona</option>
|
|
||||||
<option value="America/Regina">(GMT-06:00) Saskatchewan</option>
|
|
||||||
<option value="America/Tegucigalpa">(GMT-06:00) Central America</option>
|
|
||||||
<option value="America/Chicago">(GMT-06:00) Central Time (US & Canada)</option>
|
|
||||||
<option value="America/Mexico_City">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
|
|
||||||
<option value="America/New_York">(GMT-05:00) Eastern Time (US & Canada)</option>
|
|
||||||
<option value="America/Bogota">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
|
|
||||||
<option value="America/Indiana/Indianapolis">(GMT-05:00) Indiana (East)</option>
|
|
||||||
<option value="America/Caracas">(GMT-04:30) Caracas</option>
|
|
||||||
<option value="America/Halifax">(GMT-04:00) Atlantic Time (Canada)</option>
|
|
||||||
<option value="America/Manaus">(GMT-04:00) Manaus</option>
|
|
||||||
<option value="America/Santiago">(GMT-04:00) Santiago</option>
|
|
||||||
<option value="America/La_Paz">(GMT-04:00) La Paz</option>
|
|
||||||
<option value="America/St_Johns">(GMT-03:30) Newfoundland</option>
|
|
||||||
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Buenos Aires</option>
|
|
||||||
<option value="America/Sao_Paulo">(GMT-03:00) Brasilia</option>
|
|
||||||
<option value="America/Godthab">(GMT-03:00) Greenland</option>
|
|
||||||
<option value="America/Montevideo">(GMT-03:00) Montevideo</option>
|
|
||||||
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Georgetown</option>
|
|
||||||
<option value="Atlantic/South_Georgia">(GMT-02:00) Mid-Atlantic</option>
|
|
||||||
<option value="Atlantic/Azores">(GMT-01:00) Azores</option>
|
|
||||||
<option value="Atlantic/Cape_Verde">(GMT-01:00) Cape Verde Is.</option>
|
|
||||||
<option value="Europe/London">(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option>
|
|
||||||
<option value="Atlantic/Reykjavik">(GMT) Monrovia, Reykjavik</option>
|
|
||||||
<option value="Africa/Casablanca">(GMT) Casablanca</option>
|
|
||||||
<option value="Europe/Belgrade">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
|
|
||||||
<option value="Europe/Sarajevo">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
|
|
||||||
<option value="Europe/Brussels">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option>
|
|
||||||
<option value="Africa/Algiers">(GMT+01:00) West Central Africa</option>
|
|
||||||
<option value="Europe/Amsterdam">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>
|
|
||||||
<option value="Africa/Cairo">(GMT+02:00) Cairo</option>
|
|
||||||
<option value="Europe/Helsinki">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option>
|
|
||||||
<option value="Europe/Athens">(GMT+02:00) Athens, Bucharest, Istanbul</option>
|
|
||||||
<option value="Asia/Jerusalem">(GMT+02:00) Jerusalem</option>
|
|
||||||
<option value="Asia/Amman">(GMT+02:00) Amman</option>
|
|
||||||
<option value="Asia/Beirut">(GMT+02:00) Beirut</option>
|
|
||||||
<option value="Africa/Windhoek">(GMT+02:00) Windhoek</option>
|
|
||||||
<option value="Africa/Harare">(GMT+02:00) Harare, Pretoria</option>
|
|
||||||
<option value="Asia/Kuwait">(GMT+03:00) Kuwait, Riyadh</option>
|
|
||||||
<option value="Asia/Baghdad">(GMT+03:00) Baghdad</option>
|
|
||||||
<option value="Europe/Minsk">(GMT+03:00) Minsk</option>
|
|
||||||
<option value="Africa/Nairobi">(GMT+03:00) Nairobi</option>
|
|
||||||
<option value="Asia/Tbilisi">(GMT+03:00) Tbilisi</option>
|
|
||||||
<option value="Asia/Tehran">(GMT+03:30) Tehran</option>
|
|
||||||
<option value="Asia/Muscat">(GMT+04:00) Abu Dhabi, Muscat</option>
|
|
||||||
<option value="Asia/Baku">(GMT+04:00) Baku</option>
|
|
||||||
<option value="Europe/Moscow">(GMT+04:00) Moscow, St. Petersburg, Volgograd</option>
|
|
||||||
<option value="Asia/Yerevan">(GMT+04:00) Yerevan</option>
|
|
||||||
<option value="Asia/Karachi">(GMT+05:00) Islamabad, Karachi</option>
|
|
||||||
<option value="Asia/Tashkent">(GMT+05:00) Tashkent</option>
|
|
||||||
<option value="Asia/Kolkata">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>
|
|
||||||
<option value="Asia/Colombo">(GMT+05:30) Sri Jayawardenepura</option>
|
|
||||||
<option value="Asia/Katmandu">(GMT+05:45) Kathmandu</option>
|
|
||||||
<option value="Asia/Dhaka">(GMT+06:00) Astana, Dhaka</option>
|
|
||||||
<option value="Asia/Yekaterinburg">(GMT+06:00) Ekaterinburg</option>
|
|
||||||
<option value="Asia/Rangoon">(GMT+06:30) Yangon (Rangoon)</option>
|
|
||||||
<option value="Asia/Novosibirsk">(GMT+07:00) Almaty, Novosibirsk</option>
|
|
||||||
<option value="Asia/Bangkok">(GMT+07:00) Bangkok, Hanoi, Jakarta</option>
|
|
||||||
<option value="Asia/Beijing">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
|
|
||||||
<option value="Asia/Krasnoyarsk">(GMT+08:00) Krasnoyarsk</option>
|
|
||||||
<option value="Asia/Ulaanbaatar">(GMT+08:00) Irkutsk, Ulaan Bataar</option>
|
|
||||||
<option value="Asia/Kuala_Lumpur">(GMT+08:00) Kuala Lumpur, Singapore</option>
|
|
||||||
<option value="Asia/Taipei">(GMT+08:00) Taipei</option>
|
|
||||||
<option value="Australia/Perth">(GMT+08:00) Perth</option>
|
|
||||||
<option value="Asia/Seoul">(GMT+09:00) Seoul</option>
|
|
||||||
<option value="Asia/Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option>
|
|
||||||
<option value="Australia/Darwin">(GMT+09:30) Darwin</option>
|
|
||||||
<option value="Australia/Adelaide">(GMT+09:30) Adelaide</option>
|
|
||||||
<option value="Australia/Sydney">(GMT+10:00) Canberra, Melbourne, Sydney</option>
|
|
||||||
<option value="Australia/Brisbane">(GMT+10:00) Brisbane</option>
|
|
||||||
<option value="Australia/Hobart">(GMT+10:00) Hobart</option>
|
|
||||||
<option value="Asia/Yakutsk">(GMT+10:00) Yakutsk</option>
|
|
||||||
<option value="Pacific/Guam">(GMT+10:00) Guam, Port Moresby</option>
|
|
||||||
<option value="Asia/Vladivostok">(GMT+11:00) Vladivostok</option>
|
|
||||||
<option value="Pacific/Fiji">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option>
|
|
||||||
<option value="Asia/Magadan">(GMT+12:00) Magadan, Solomon Is., New Caledonia</option>
|
|
||||||
<option value="Pacific/Auckland">(GMT+12:00) Auckland, Wellington</option>
|
|
||||||
<option value="Pacific/Tongatapu">(GMT+13:00) Nukualofa</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<label><?php echo __('Email', 'users'); ?></label>
|
} ?>
|
||||||
<input name="email" class="input-xlarge" value="<?php if (Request::post('email')) echo Html::toText(Request::post('email')); ?>" type="text" />
|
</div>
|
||||||
<br /><br />
|
|
||||||
<input type="submit" class="btn" name="install_submit" value="<?php echo __('Install', 'system'); ?>" />
|
<div class="install-block <?php if (Request::get('action') && Request::get('action') == 'install') {
|
||||||
</form>
|
?><?php
|
||||||
|
|
||||||
|
} else {
|
||||||
|
?> hide <?php
|
||||||
|
|
||||||
|
} ?>">
|
||||||
|
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<?php
|
||||||
|
// Monstra Notifications
|
||||||
|
if (Notification::get('errors') && count(Notification::get('errors') > 0)) {
|
||||||
|
foreach (Notification::get('errors') as $error) {
|
||||||
|
?>
|
||||||
|
<li class="error alert alert-danger"><?php echo $error;
|
||||||
|
?></li>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="well">
|
||||||
|
<form action="install.php?action=install" method="post">
|
||||||
|
<input type="hidden" name="php" value="<?php echo $errors['php']; ?>">
|
||||||
|
<input type="hidden" name="simplexml" value="<?php echo $errors['simplexml']; ?>">
|
||||||
|
<input type="hidden" name="mod_rewrite" value="<?php echo $errors['mod_rewrite']; ?>">
|
||||||
|
<input type="hidden" name="install" value="<?php echo $errors['install']; ?>">
|
||||||
|
<input type="hidden" name="sitemap" value="<?php echo $errors['sitemap']; ?>">
|
||||||
|
<input type="hidden" name="htaccess" value="<?php echo $errors['htaccess']; ?>">
|
||||||
|
<input type="hidden" name="public" value="<?php echo $errors['public']; ?>">
|
||||||
|
<input type="hidden" name="storage" value="<?php echo $errors['storage']; ?>">
|
||||||
|
<input type="hidden" name="backups" value="<?php echo $errors['backups']; ?>">
|
||||||
|
<input type="hidden" name="tmp" value="<?php echo $errors['tmp']; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><?php echo __('Site Name', 'system'); ?></label>
|
||||||
|
<input class="form-control" name="sitename" type="text" value="<?php if (Request::post('sitename')) {
|
||||||
|
echo Html::toText(Request::post('sitename'));
|
||||||
|
} ?>" />
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
<p align="center"><strong><?php echo __('...Monstra says...', 'system'); ?></strong></p>
|
|
||||||
<div>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, "5.2.0", "<")) {
|
<div class="form-group">
|
||||||
echo '<span class="error"><li>'.__('PHP 5.2 or greater is required', 'system').'</li></span>';
|
<label><?php echo __('Site Url', 'system'); ?></label>
|
||||||
} else {
|
<input class="form-control" name="siteurl" type="text" value="<?php echo Html::toText($site_url); ?>" />
|
||||||
echo '<span class="ok"><li>'.__('PHP Version', 'system').' '.PHP_VERSION.'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array('SimpleXML', $php_modules)) {
|
|
||||||
echo '<span class="ok"><li>'.__('Module SimpleXML is installed', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('SimpleXML module is required', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array('dom', $php_modules)) {
|
|
||||||
echo '<span class="ok"><li>'.__('Module DOM is installed', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('Module DOM is required', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (function_exists('apache_get_modules')) {
|
|
||||||
if ( ! in_array('mod_rewrite',apache_get_modules())) {
|
|
||||||
echo '<span class="error"><li>'.__('Apache Mod Rewrite is required', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="ok"><li>'.__('Module Mod Rewrite is installed', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo '<span class="ok"><li>'.__('Module Mod Rewrite is installed', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($dir_array as $dir) {
|
|
||||||
if (is_writable($dir.'/')) {
|
|
||||||
echo '<span class="ok"><li>'.__('Directory: <b> :dir </b> writable', 'system', array(':dir' => $dir)).'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('Directory: <b> :dir </b> not writable', 'system', array(':dir' => $dir)).'</li></span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_writable(__FILE__)) {
|
|
||||||
echo '<span class="ok"><li>'.__('Install script writable', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('Install script not writable', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_writable('sitemap.xml')) {
|
|
||||||
echo '<span class="ok"><li>'.__('Sitemap file writable', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('Sitemap file not writable', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_writable('.htaccess')) {
|
|
||||||
echo '<span class="ok"><li>'.__('Main .htaccess file writable', 'system').'</li></span>';
|
|
||||||
} else {
|
|
||||||
echo '<span class="error"><li>'.__('Main .htaccess file not writable', 'system').'</li></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($errors['sitename'])) echo '<span class="error"><li>'.$errors['sitename'].'</li></span>';
|
|
||||||
if (isset($errors['siteurl'])) echo '<span class="error"><li>'.$errors['siteurl'].'</li></span>';
|
|
||||||
if (isset($errors['login'])) echo '<span class="error"><li>'.$errors['login'].'</li></span>';
|
|
||||||
if (isset($errors['password'])) echo '<span class="error"><li>'.$errors['password'].'</li></span>';
|
|
||||||
if (isset($errors['email'])) echo '<span class="error"><li>'.$errors['email'].'</li></span>';
|
|
||||||
if (isset($errors['email_valid'])) echo '<span class="error"><li>'.$errors['email_valid'].'</li></span>';
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="install-block-footer">
|
<div class="form-group">
|
||||||
<div style="text-align:center">
|
<label><?php echo __('Username', 'users'); ?></label>
|
||||||
<span class="small-grey-text">© 2012 - 2013 <a href="http://monstra.org" class="small-grey-text" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?></span>
|
<input class="form-control login" name="login" value="<?php if (Request::post('login')) {
|
||||||
|
echo Html::toText(Request::post('login'));
|
||||||
|
} ?>" type="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><?php echo __('Password', 'users'); ?></label>
|
||||||
|
<input class="form-control" name="password" type="password" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><?php echo __('Time zone', 'system'); ?></label>
|
||||||
|
<select class="form-control" name="timezone">
|
||||||
|
<option value="Kwajalein">(GMT-12:00) International Date Line West</option>
|
||||||
|
<option value="Pacific/Samoa">(GMT-11:00) Midway Island, Samoa</option>
|
||||||
|
<option value="Pacific/Honolulu">(GMT-10:00) Hawaii</option>
|
||||||
|
<option value="America/Anchorage">(GMT-09:00) Alaska</option>
|
||||||
|
<option value="America/Los_Angeles">(GMT-08:00) Pacific Time (US & Canada)</option>
|
||||||
|
<option value="America/Tijuana">(GMT-08:00) Tijuana, Baja California</option>
|
||||||
|
<option value="America/Denver">(GMT-07:00) Mountain Time (US & Canada)</option>
|
||||||
|
<option value="America/Chihuahua">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
|
||||||
|
<option value="America/Phoenix">(GMT-07:00) Arizona</option>
|
||||||
|
<option value="America/Regina">(GMT-06:00) Saskatchewan</option>
|
||||||
|
<option value="America/Tegucigalpa">(GMT-06:00) Central America</option>
|
||||||
|
<option value="America/Chicago">(GMT-06:00) Central Time (US & Canada)</option>
|
||||||
|
<option value="America/Mexico_City">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
|
||||||
|
<option value="America/New_York">(GMT-05:00) Eastern Time (US & Canada)</option>
|
||||||
|
<option value="America/Bogota">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
|
||||||
|
<option value="America/Indiana/Indianapolis">(GMT-05:00) Indiana (East)</option>
|
||||||
|
<option value="America/Caracas">(GMT-04:30) Caracas</option>
|
||||||
|
<option value="America/Halifax">(GMT-04:00) Atlantic Time (Canada)</option>
|
||||||
|
<option value="America/Manaus">(GMT-04:00) Manaus</option>
|
||||||
|
<option value="America/Santiago">(GMT-04:00) Santiago</option>
|
||||||
|
<option value="America/La_Paz">(GMT-04:00) La Paz</option>
|
||||||
|
<option value="America/St_Johns">(GMT-03:30) Newfoundland</option>
|
||||||
|
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Buenos Aires</option>
|
||||||
|
<option value="America/Sao_Paulo">(GMT-03:00) Brasilia</option>
|
||||||
|
<option value="America/Godthab">(GMT-03:00) Greenland</option>
|
||||||
|
<option value="America/Montevideo">(GMT-03:00) Montevideo</option>
|
||||||
|
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Georgetown</option>
|
||||||
|
<option value="Atlantic/South_Georgia">(GMT-02:00) Mid-Atlantic</option>
|
||||||
|
<option value="Atlantic/Azores">(GMT-01:00) Azores</option>
|
||||||
|
<option value="Atlantic/Cape_Verde">(GMT-01:00) Cape Verde Is.</option>
|
||||||
|
<option value="Europe/London">(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option>
|
||||||
|
<option value="Atlantic/Reykjavik">(GMT) Monrovia, Reykjavik</option>
|
||||||
|
<option value="Africa/Casablanca">(GMT) Casablanca</option>
|
||||||
|
<option value="Europe/Belgrade">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
|
||||||
|
<option value="Europe/Sarajevo">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
|
||||||
|
<option value="Europe/Brussels">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option>
|
||||||
|
<option value="Africa/Algiers">(GMT+01:00) West Central Africa</option>
|
||||||
|
<option value="Europe/Amsterdam">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>
|
||||||
|
<option value="Africa/Cairo">(GMT+02:00) Cairo</option>
|
||||||
|
<option value="Europe/Helsinki">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option>
|
||||||
|
<option value="Europe/Athens">(GMT+02:00) Athens, Bucharest, Istanbul</option>
|
||||||
|
<option value="Asia/Jerusalem">(GMT+02:00) Jerusalem</option>
|
||||||
|
<option value="Asia/Amman">(GMT+02:00) Amman</option>
|
||||||
|
<option value="Asia/Beirut">(GMT+02:00) Beirut</option>
|
||||||
|
<option value="Africa/Windhoek">(GMT+02:00) Windhoek</option>
|
||||||
|
<option value="Africa/Harare">(GMT+02:00) Harare, Pretoria</option>
|
||||||
|
<option value="Asia/Kuwait">(GMT+03:00) Kuwait, Riyadh</option>
|
||||||
|
<option value="Asia/Baghdad">(GMT+03:00) Baghdad</option>
|
||||||
|
<option value="Europe/Minsk">(GMT+03:00) Minsk</option>
|
||||||
|
<option value="Africa/Nairobi">(GMT+03:00) Nairobi</option>
|
||||||
|
<option value="Asia/Tbilisi">(GMT+03:00) Tbilisi</option>
|
||||||
|
<option value="Asia/Tehran">(GMT+03:30) Tehran</option>
|
||||||
|
<option value="Asia/Muscat">(GMT+04:00) Abu Dhabi, Muscat</option>
|
||||||
|
<option value="Asia/Baku">(GMT+04:00) Baku</option>
|
||||||
|
<option value="Europe/Moscow">(GMT+04:00) Moscow, St. Petersburg, Volgograd</option>
|
||||||
|
<option value="Asia/Yerevan">(GMT+04:00) Yerevan</option>
|
||||||
|
<option value="Asia/Karachi">(GMT+05:00) Islamabad, Karachi</option>
|
||||||
|
<option value="Asia/Tashkent">(GMT+05:00) Tashkent</option>
|
||||||
|
<option value="Asia/Kolkata">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>
|
||||||
|
<option value="Asia/Colombo">(GMT+05:30) Sri Jayawardenepura</option>
|
||||||
|
<option value="Asia/Katmandu">(GMT+05:45) Kathmandu</option>
|
||||||
|
<option value="Asia/Dhaka">(GMT+06:00) Astana, Dhaka</option>
|
||||||
|
<option value="Asia/Yekaterinburg">(GMT+06:00) Ekaterinburg</option>
|
||||||
|
<option value="Asia/Rangoon">(GMT+06:30) Yangon (Rangoon)</option>
|
||||||
|
<option value="Asia/Novosibirsk">(GMT+07:00) Almaty, Novosibirsk</option>
|
||||||
|
<option value="Asia/Bangkok">(GMT+07:00) Bangkok, Hanoi, Jakarta</option>
|
||||||
|
<option value="Asia/Beijing">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
|
||||||
|
<option value="Asia/Krasnoyarsk">(GMT+08:00) Krasnoyarsk</option>
|
||||||
|
<option value="Asia/Ulaanbaatar">(GMT+08:00) Irkutsk, Ulaan Bataar</option>
|
||||||
|
<option value="Asia/Kuala_Lumpur">(GMT+08:00) Kuala Lumpur, Singapore</option>
|
||||||
|
<option value="Asia/Taipei">(GMT+08:00) Taipei</option>
|
||||||
|
<option value="Australia/Perth">(GMT+08:00) Perth</option>
|
||||||
|
<option value="Asia/Seoul">(GMT+09:00) Seoul</option>
|
||||||
|
<option value="Asia/Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option>
|
||||||
|
<option value="Australia/Darwin">(GMT+09:30) Darwin</option>
|
||||||
|
<option value="Australia/Adelaide">(GMT+09:30) Adelaide</option>
|
||||||
|
<option value="Australia/Sydney">(GMT+10:00) Canberra, Melbourne, Sydney</option>
|
||||||
|
<option value="Australia/Brisbane">(GMT+10:00) Brisbane</option>
|
||||||
|
<option value="Australia/Hobart">(GMT+10:00) Hobart</option>
|
||||||
|
<option value="Asia/Yakutsk">(GMT+10:00) Yakutsk</option>
|
||||||
|
<option value="Pacific/Guam">(GMT+10:00) Guam, Port Moresby</option>
|
||||||
|
<option value="Asia/Vladivostok">(GMT+11:00) Vladivostok</option>
|
||||||
|
<option value="Pacific/Fiji">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option>
|
||||||
|
<option value="Asia/Magadan">(GMT+12:00) Magadan, Solomon Is., New Caledonia</option>
|
||||||
|
<option value="Pacific/Auckland">(GMT+12:00) Auckland, Wellington</option>
|
||||||
|
<option value="Pacific/Tongatapu">(GMT+13:00) Nukualofa</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><?php echo __('Email', 'users'); ?></label>
|
||||||
|
<input name="email" class="form-control" value="<?php if (Request::post('email')) {
|
||||||
|
echo Html::toText(Request::post('email'));
|
||||||
|
} ?>" type="text" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="submit" class="btn btn-primary" name="install_submit" value="<?php echo __('Install', 'system'); ?>" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="monstra-dialog <?php if (Request::get('action') && Request::get('action') == 'install') {
|
||||||
|
?>hide<?php
|
||||||
|
|
||||||
|
} ?>">
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (version_compare(PHP_VERSION, "5.3.2", "<")) {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('PHP 5.3.2 or greater is required', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('PHP Version', 'system').' '.PHP_VERSION.'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array('SimpleXML', $php_modules)) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Module SimpleXML is installed', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('SimpleXML module is required', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array('dom', $php_modules)) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Module DOM is installed', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Module DOM is required', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (function_exists('apache_get_modules')) {
|
||||||
|
if (! in_array('mod_rewrite', apache_get_modules())) {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Apache Mod Rewrite is required', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Module Mod Rewrite is installed', 'system').'</li>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Module Mod Rewrite is installed', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($dir_array as $dir) {
|
||||||
|
if (is_writable($dir.'/')) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Directory: <b> :dir </b> writable', 'system', array(':dir' => $dir)).'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Directory: <b> :dir </b> not writable', 'system', array(':dir' => $dir)).'</li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_writable(__FILE__)) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Install script writable', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Install script not writable', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_writable('sitemap.xml')) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Sitemap file writable', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Sitemap file not writable', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_writable('.htaccess')) {
|
||||||
|
echo '<li class="ok alert alert-success">'.__('Main .htaccess file writable', 'system').'</li>';
|
||||||
|
} else {
|
||||||
|
echo '<li class="error alert alert-danger">'.__('Main .htaccess file not writable', 'system').'</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($errors['sitename'])) {
|
||||||
|
echo '<li class="error">'.$errors['sitename'].'</li>';
|
||||||
|
}
|
||||||
|
if (isset($errors['siteurl'])) {
|
||||||
|
echo '<li class="error">'.$errors['siteurl'].'</li>';
|
||||||
|
}
|
||||||
|
if (isset($errors['login'])) {
|
||||||
|
echo '<li class="error">'.$errors['login'].'</li>';
|
||||||
|
}
|
||||||
|
if (isset($errors['password'])) {
|
||||||
|
echo '<li class="error">'.$errors['password'].'</li>';
|
||||||
|
}
|
||||||
|
if (isset($errors['email'])) {
|
||||||
|
echo '<li class="error">'.$errors['email'].'</li>';
|
||||||
|
}
|
||||||
|
if (isset($errors['email_valid'])) {
|
||||||
|
echo '<li class="error">'.$errors['email_valid'].'</li>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
<a href="install.php?action=install" class="btn btn-primary continue"><?php echo __('Continue', 'system'); ?></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="install-block-footer login-footer">
|
||||||
|
<div class="text-center">
|
||||||
|
<span>© 2012 - 2016 <a href="http://monstra.org" class="small-grey-text" target="_blank">Monstra</a> – <?php echo __('Version', 'system'); ?> <?php echo Monstra::VERSION; ?></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('.language-link').tooltip();
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.continue').click(function() {
|
||||||
|
$('.monstra-dialog').addClass('hide');
|
||||||
|
$('.install-block').removeClass('hide');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -71,6 +71,12 @@ class Agent
|
|||||||
'infoseek',
|
'infoseek',
|
||||||
'lycos',
|
'lycos',
|
||||||
'ia_archiver',
|
'ia_archiver',
|
||||||
|
'yandex',
|
||||||
|
'mail.ru',
|
||||||
|
'ask.com',
|
||||||
|
'Copyscape.com',
|
||||||
|
'bing.com',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -22,14 +22,14 @@ class Cache
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $cache_dir = '';
|
protected static $cache_dir = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache file ext
|
* Cache file ext
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $cache_file_ext = 'txt';
|
protected static $cache_file_ext = 'txt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache life time (in seconds)
|
* Cache life time (in seconds)
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -58,7 +58,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add class to mapping.
|
* Add class to mapping.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::mapClass('ClassName', 'path/to/class');
|
* ClassLoader::mapClass('ClassName', 'path/to/class');
|
||||||
* </code>
|
* </code>
|
||||||
@@ -74,7 +74,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add multiple classes to mapping.
|
* Add multiple classes to mapping.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::mapClasses(array('ClassName' => 'path/to/class','ClassName' => 'path/to/class'));
|
* ClassLoader::mapClasses(array('ClassName' => 'path/to/class','ClassName' => 'path/to/class'));
|
||||||
* </code>
|
* </code>
|
||||||
@@ -91,7 +91,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a PSR-0 directory path.
|
* Adds a PSR-0 directory path.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::directory('path/to/classes');
|
* ClassLoader::directory('path/to/classes');
|
||||||
* </code>
|
* </code>
|
||||||
@@ -106,7 +106,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a namespace.
|
* Registers a namespace.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::registerNamespace('Namespace', '/path/to/namespace/');
|
* ClassLoader::registerNamespace('Namespace', '/path/to/namespace/');
|
||||||
* </code>
|
* </code>
|
||||||
@@ -122,9 +122,9 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set an alias for a class.
|
* Set an alias for a class.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::registerNamespace('ClassNameAlias', 'ClassName');
|
* ClassLoader::alias('ClassNameAlias', 'ClassName');
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
@@ -171,7 +171,7 @@ class ClassLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Autoloader.
|
* Autoloader.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* ClassLoader::load();
|
* ClassLoader::load();
|
||||||
* </code>
|
* </code>
|
||||||
@@ -222,4 +222,15 @@ class ClassLoader
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the Gelato ClassLoader to the SPL autoload stack.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function register()
|
||||||
|
{
|
||||||
|
spl_autoload_register('ClassLoader::load', true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -18,6 +18,25 @@
|
|||||||
class ErrorHandler
|
class ErrorHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error Levels
|
||||||
|
*/
|
||||||
|
public static $levels = array (
|
||||||
|
E_ERROR => 'Fatal Error',
|
||||||
|
E_PARSE => 'Parse Error',
|
||||||
|
E_COMPILE_ERROR => 'Compile Error',
|
||||||
|
E_COMPILE_WARNING => 'Compile Warning',
|
||||||
|
E_STRICT => 'Strict Mode Error',
|
||||||
|
E_NOTICE => 'Notice',
|
||||||
|
E_WARNING => 'Warning',
|
||||||
|
E_RECOVERABLE_ERROR => 'Recoverable Error',
|
||||||
|
E_USER_NOTICE => 'Notice',
|
||||||
|
E_USER_WARNING => 'Warning',
|
||||||
|
E_USER_ERROR => 'Error',
|
||||||
|
/*E_DEPRECATED => 'Deprecated',*/ /* PHP 5.3 only */
|
||||||
|
/*E_USER_DEPRECATED => 'Deprecated'*/ /* PHP 5.3 only */
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected constructor since this is a static class.
|
* Protected constructor since this is a static class.
|
||||||
*
|
*
|
||||||
@@ -80,11 +99,35 @@ class ErrorHandler
|
|||||||
* @param integer $line The line number where the error occurred
|
* @param integer $line The line number where the error occurred
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function errorHandler($code, $message, $file, $line)
|
public static function error($code, $message, $file, $line)
|
||||||
{
|
{
|
||||||
// If isset error_reporting and $code then throw new error exception
|
// If isset error_reporting and $code then throw new error exception
|
||||||
if ((error_reporting() & $code) !== 0) {
|
if ((error_reporting() & $code) !== 0) {
|
||||||
throw new ErrorException($message, $code, 0, $file, $line);
|
|
||||||
|
/**
|
||||||
|
* Dont thow NOTICE exception for PRODUCTION Environment. Just write to log.
|
||||||
|
*/
|
||||||
|
if (GELATO_DEVELOPMENT == false && $code == 8) {
|
||||||
|
|
||||||
|
// Get exception info
|
||||||
|
$error['code'] = $code;
|
||||||
|
$error['message'] = $message;
|
||||||
|
$error['file'] = $file;
|
||||||
|
$error['line'] = $line;
|
||||||
|
$error['type'] = 'ErrorException: ';
|
||||||
|
|
||||||
|
$codes = array (
|
||||||
|
E_USER_NOTICE => 'Notice',
|
||||||
|
);
|
||||||
|
|
||||||
|
$error['type'] .= in_array($error['code'], array_keys($codes)) ? $codes[$error['code']] : 'Unknown Error';
|
||||||
|
|
||||||
|
// Write to log
|
||||||
|
Log::write("{$error['type']}: {$error['message']} in {$error['file']} at line {$error['line']}");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new ErrorException($message, $code, 0, $file, $line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't execute PHP internal error handler
|
// Don't execute PHP internal error handler
|
||||||
@@ -170,7 +213,7 @@ class ErrorHandler
|
|||||||
if (isset($entry['file'])) {
|
if (isset($entry['file'])) {
|
||||||
$location['file'] = $entry['file'];
|
$location['file'] = $entry['file'];
|
||||||
$location['line'] = $entry['line'];
|
$location['line'] = $entry['line'];
|
||||||
$location['code'] = static::highlightCode($entry['file'], $entry['line']);
|
$location['code'] = self::highlightCode($entry['file'], $entry['line']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,9 +231,9 @@ class ErrorHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert errors not caught by the errorHandler to ErrorExceptions.
|
* Convert errors not caught by the error handler to ErrorExceptions.
|
||||||
*/
|
*/
|
||||||
public static function fatalErrorHandler()
|
public static function fatal()
|
||||||
{
|
{
|
||||||
$e = error_get_last();
|
$e = error_get_last();
|
||||||
|
|
||||||
@@ -210,70 +253,54 @@ class ErrorHandler
|
|||||||
public static function exception($exception)
|
public static function exception($exception)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// Empty output buffers
|
|
||||||
|
|
||||||
|
// Empty output buffers
|
||||||
while(ob_get_level() > 0) ob_end_clean();
|
while(ob_get_level() > 0) ob_end_clean();
|
||||||
|
|
||||||
// Get exception info
|
// Get exception info
|
||||||
|
|
||||||
$error['code'] = $exception->getCode();
|
$error['code'] = $exception->getCode();
|
||||||
$error['message'] = $exception->getMessage();
|
$error['message'] = $exception->getMessage();
|
||||||
$error['file'] = $exception->getFile();
|
$error['file'] = $exception->getFile();
|
||||||
$error['line'] = $exception->getLine();
|
$error['line'] = $exception->getLine();
|
||||||
|
|
||||||
// Determine error type
|
// Determine error type
|
||||||
|
|
||||||
if ($exception instanceof ErrorException) {
|
if ($exception instanceof ErrorException) {
|
||||||
$error['type'] = 'ErrorException: ';
|
$error['type'] = 'ErrorException: ';
|
||||||
|
$error['type'] .= in_array($error['code'], array_keys(ErrorHandler::$levels)) ? ErrorHandler::$levels[$error['code']] : 'Unknown Error';
|
||||||
$codes = array
|
|
||||||
(
|
|
||||||
E_ERROR => 'Fatal Error',
|
|
||||||
E_PARSE => 'Parse Error',
|
|
||||||
E_COMPILE_ERROR => 'Compile Error',
|
|
||||||
E_COMPILE_WARNING => 'Compile Warning',
|
|
||||||
E_STRICT => 'Strict Mode Error',
|
|
||||||
E_NOTICE => 'Notice',
|
|
||||||
E_WARNING => 'Warning',
|
|
||||||
E_RECOVERABLE_ERROR => 'Recoverable Error',
|
|
||||||
/*E_DEPRECATED => 'Deprecated',*/
|
|
||||||
E_USER_NOTICE => 'Notice',
|
|
||||||
E_USER_WARNING => 'Warning',
|
|
||||||
E_USER_ERROR => 'Error',
|
|
||||||
/*E_USER_DEPRECATED => 'Deprecated'*/
|
|
||||||
);
|
|
||||||
|
|
||||||
$error['type'] .= in_array($error['code'], array_keys($codes)) ? $codes[$error['code']] : 'Unknown Error';
|
|
||||||
} else {
|
} else {
|
||||||
$error['type'] = get_class($exception);
|
$error['type'] = get_class($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo Write to error log
|
// Write to log
|
||||||
|
Log::write("{$error['type']}: {$error['message']} in {$error['file']} at line {$error['line']}");
|
||||||
/*if () {
|
|
||||||
Write here
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Send headers and output
|
// Send headers and output
|
||||||
@header('Content-Type: text/html; charset=UTF-8');
|
@header('Content-Type: text/html; charset=UTF-8');
|
||||||
|
|
||||||
if (GELATO_DISPLAY_ERRORS) {
|
if (GELATO_DEVELOPMENT) {
|
||||||
|
|
||||||
$error['backtrace'] = $exception->getTrace();
|
$error['backtrace'] = $exception->getTrace();
|
||||||
|
|
||||||
if ($exception instanceof ErrorException) {
|
if ($exception instanceof ErrorException) {
|
||||||
$error['backtrace'] = array_slice($error['backtrace'], 1); //Remove call to error handler from backtrace
|
$error['backtrace'] = array_slice($error['backtrace'], 1); //Remove call to error handler from backtrace
|
||||||
}
|
}
|
||||||
|
|
||||||
$error['backtrace'] = static::formatBacktrace($error['backtrace']);
|
$error['backtrace'] = self::formatBacktrace($error['backtrace']);
|
||||||
$error['highlighted'] = static::highlightCode($error['file'], $error['line']);
|
$error['highlighted'] = self::highlightCode($error['file'], $error['line']);
|
||||||
|
|
||||||
Response::status(500);
|
@header('HTTP/1.1 500 Internal Server Error');
|
||||||
include 'Resources/Views/Errors/exception.php';
|
include 'Resources/Views/Errors/exception.php';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Response::status(500);
|
|
||||||
|
@header('HTTP/1.1 500 Internal Server Error');
|
||||||
include 'Resources/Views/Errors/production.php';
|
include 'Resources/Views/Errors/production.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
// Empty output buffers
|
||||||
while(ob_get_level() > 0) ob_end_clean();
|
while(ob_get_level() > 0) ob_end_clean();
|
||||||
|
|
||||||
echo $e->getMessage() . ' in ' . $e->getFile() . ' (line ' . $e->getLine() . ').';
|
echo $e->getMessage() . ' in ' . $e->getFile() . ' (line ' . $e->getLine() . ').';
|
||||||
|
@@ -4,13 +4,17 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Error</title>
|
<title>Error</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
background: #F5F5F5;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
#gelato-error {
|
#gelato-error {
|
||||||
background:#eee;
|
background:#F5F5F5;
|
||||||
color:0;
|
color:0;
|
||||||
width:95%;
|
width:100%;
|
||||||
font-size:14px;
|
font-size:14px;
|
||||||
font-family:Verdana, Arial, Helvetica, "Nimbus Sans", FreeSans, Malayalam, sans-serif;
|
font-family:Verdana, Arial, Helvetica, "Nimbus Sans", FreeSans, Malayalam, sans-serif;
|
||||||
margin:20px auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#gelato-error pre {
|
#gelato-error pre {
|
||||||
@@ -21,16 +25,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#gelato-error a {
|
#gelato-error a {
|
||||||
color:#cc0a0a;
|
color:#DC143C;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#gelato-error .error {
|
#gelato-error .error {
|
||||||
background:#cc0a0a;
|
background:#DC143C;
|
||||||
color:#fff;
|
color:#fff;
|
||||||
font-size:24px;
|
font-size:24px;
|
||||||
font-weight:700;
|
font-weight:700;
|
||||||
padding:10px;
|
padding:10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#gelato-error .body {
|
#gelato-error .body {
|
||||||
@@ -271,7 +276,10 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top:20px;padding-bottom:20px; padding-left:10px;"><a href="http://gelato.monstra.org">Gelato Library</a></div>
|
<div style="padding-top:20px;padding-bottom:20px; padding-left:10px;">
|
||||||
|
<a href="http://monstra.org">MONSTRA</a>
|
||||||
|
<a href="http://gelato.monstra.org">GELATO</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -203,4 +203,26 @@ class Dir
|
|||||||
return $total_size;
|
return $total_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy directory.
|
||||||
|
* <code>
|
||||||
|
* Dir::copy('source_folder_path', 'destination_folder_path);
|
||||||
|
* </code>
|
||||||
|
* @param $src
|
||||||
|
* @param $dst
|
||||||
|
*/
|
||||||
|
public static function copy($src, $dst) {
|
||||||
|
$dir = opendir($src);
|
||||||
|
@mkdir($dst);
|
||||||
|
while(false !== ( $file = readdir($dir)) ) {
|
||||||
|
if (( $file != '.' ) && ( $file != '..' )) {
|
||||||
|
if ( is_dir($src .'/'. $file) ) {
|
||||||
|
self::copy($src .'/'. $file, $dst .'/'. $file);
|
||||||
|
} else {
|
||||||
|
copy($src .'/'. $file,$dst .'/'. $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -141,7 +141,7 @@ class Form
|
|||||||
$attributes['type'] = 'text';
|
$attributes['type'] = 'text';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<input'.Html::attributes($attributes).' />';
|
return '<input'.Html::attributes($attributes).'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -18,22 +18,46 @@
|
|||||||
/**
|
/**
|
||||||
* The version of Gelato
|
* The version of Gelato
|
||||||
*/
|
*/
|
||||||
define('GELATO_VERSION', '1.0.0');
|
define('GELATO_VERSION', '1.0.3');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define __DIR__ constant for PHP 5.2.x
|
||||||
|
*/
|
||||||
|
if ( ! defined('__DIR__')) {
|
||||||
|
define('__DIR__', dirname(__FILE__));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display Gelato Errors or not ?
|
* Display Gelato Errors or not ?
|
||||||
*/
|
*/
|
||||||
if ( ! defined('GELATO_DISPLAY_ERRORS')) {
|
if ( ! defined('GELATO_DEVELOPMENT')) {
|
||||||
define('GELATO_DISPLAY_ERRORS', true);
|
define('GELATO_DEVELOPMENT', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display Gelato Autoloader or not ?
|
* Use Gelato Class Loader or not ?
|
||||||
*/
|
*/
|
||||||
if ( ! defined('GELATO_AUTOLOADER')) {
|
if ( ! defined('GELATO_CLASS_LOADER')) {
|
||||||
define('GELATO_AUTOLOADER', true);
|
define('GELATO_CLASS_LOADER', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load Gelato Logger
|
||||||
|
*/
|
||||||
|
require_once __DIR__ . '/Log/Log.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use Gelato Logger default path or not ?
|
||||||
|
*/
|
||||||
|
if ( ! defined('GELATO_LOGS_PATH')) {
|
||||||
|
define('GELATO_LOGS_PATH', __DIR__. '/_logs');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure Gelato Logger
|
||||||
|
*/
|
||||||
|
Log::configure('path', GELATO_LOGS_PATH);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load Gelato Error Handler
|
* Load Gelato Error Handler
|
||||||
*/
|
*/
|
||||||
@@ -42,12 +66,12 @@ require_once __DIR__ . '/ErrorHandler/ErrorHandler.php';
|
|||||||
/**
|
/**
|
||||||
* Set Error Handler
|
* Set Error Handler
|
||||||
*/
|
*/
|
||||||
set_error_handler('ErrorHandler::errorHandler');
|
set_error_handler('ErrorHandler::error');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Fatal Error Handler
|
* Set Fatal Error Handler
|
||||||
*/
|
*/
|
||||||
register_shutdown_function('ErrorHandler::fatalErrorHandler');
|
register_shutdown_function('ErrorHandler::fatal');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Exception Handler
|
* Set Exception Handler
|
||||||
@@ -76,7 +100,9 @@ ClassLoader::mapClasses(array(
|
|||||||
'Html' => __DIR__.'/Html/Html.php',
|
'Html' => __DIR__.'/Html/Html.php',
|
||||||
'Image' => __DIR__.'/Image/Image.php',
|
'Image' => __DIR__.'/Image/Image.php',
|
||||||
'Inflector' => __DIR__.'/Inflector/Inflector.php',
|
'Inflector' => __DIR__.'/Inflector/Inflector.php',
|
||||||
'Minify' => __DIR__.'/Minify/Minify.php',
|
'MinifyCSS' => __DIR__.'/Minify/MinifyCSS.php',
|
||||||
|
'MinifyHTML' => __DIR__.'/Minify/MinifyHTML.php',
|
||||||
|
'MinifyJS' => __DIR__.'/Minify/MinifyJS.php',
|
||||||
'Notification' => __DIR__.'/Notification/Notification.php',
|
'Notification' => __DIR__.'/Notification/Notification.php',
|
||||||
'Number' => __DIR__.'/Number/Number.php',
|
'Number' => __DIR__.'/Number/Number.php',
|
||||||
'Registry' => __DIR__.'/Registry/Registry.php',
|
'Registry' => __DIR__.'/Registry/Registry.php',
|
||||||
@@ -91,8 +117,8 @@ ClassLoader::mapClasses(array(
|
|||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register Gelato Autoloader
|
* Register Gelato Class Loader
|
||||||
*/
|
*/
|
||||||
if (GELATO_AUTOLOADER) {
|
if (GELATO_CLASS_LOADER) {
|
||||||
spl_autoload_register('ClassLoader::load');
|
ClassLoader::register();
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -28,6 +28,13 @@ class Html
|
|||||||
'accept', 'tabindex', 'accesskey', 'alt', 'title', 'class',
|
'accept', 'tabindex', 'accesskey', 'alt', 'title', 'class',
|
||||||
'style', 'selected', 'checked', 'readonly', 'disabled',
|
'style', 'selected', 'checked', 'readonly', 'disabled',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The registered custom macros.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $macros = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected constructor since this is a static class.
|
* Protected constructor since this is a static class.
|
||||||
@@ -44,7 +51,7 @@ class Html
|
|||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
*
|
*
|
||||||
* // Registering a Htmlk macro
|
* // Registering a Html macro
|
||||||
* Html::macro('my_element', function() {
|
* Html::macro('my_element', function() {
|
||||||
* return '<element id="monstra">';
|
* return '<element id="monstra">';
|
||||||
* });
|
* });
|
||||||
@@ -54,7 +61,7 @@ class Html
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* // Registering a Html macro with parameters
|
* // Registering a Html macro with parameters
|
||||||
* Html::macro('my_element', function(id = '') {
|
* Html::macro('my_element', function($id = '') {
|
||||||
* return '<element id="'.$id.'">';
|
* return '<element id="'.$id.'">';
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@@ -150,7 +157,7 @@ class Html
|
|||||||
*/
|
*/
|
||||||
public static function br($num = 1)
|
public static function br($num = 1)
|
||||||
{
|
{
|
||||||
return str_repeat("<br />",(int) $num);
|
return str_repeat("<br>",(int) $num);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -278,8 +285,57 @@ class Html
|
|||||||
$attributes['src'] = $file;
|
$attributes['src'] = $file;
|
||||||
$attributes['alt'] = (isset($attributes['alt'])) ? $attributes['alt'] : pathinfo($file, PATHINFO_FILENAME);
|
$attributes['alt'] = (isset($attributes['alt'])) ? $attributes['alt'] : pathinfo($file, PATHINFO_FILENAME);
|
||||||
|
|
||||||
return '<img'.Html::attributes($attributes).' />';
|
return '<img'.Html::attributes($attributes).'>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obfuscate an e-mail address to prevent spam-bots from sniffing it.
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Html::email('gelato@monstra.org');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $email
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function email($email)
|
||||||
|
{
|
||||||
|
return str_replace('@', '@', Html::obfuscate($email));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obfuscate a string to prevent spam-bots from sniffing it.
|
||||||
|
*
|
||||||
|
* This method obfuscate the value, randomly convert each
|
||||||
|
* letter to its entity or hexadecimal representation, keeping a
|
||||||
|
* bot from sniffing the randomly obfuscated letters.
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Html::obfuscate('gelato@monstra.org');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function obfuscate($value)
|
||||||
|
{
|
||||||
|
$safe = '';
|
||||||
|
|
||||||
|
foreach (str_split($value) as $letter) {
|
||||||
|
switch (rand(1, 3)) {
|
||||||
|
case 1:
|
||||||
|
$safe .= '&#'.ord($letter).';';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$safe .= '&#x'.dechex(ord($letter)).';';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$safe .= $letter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $safe;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert html to plain text
|
* Convert html to plain text
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -173,9 +173,10 @@ class Image
|
|||||||
public function resize($width, $height = null, $aspect_ratio = null)
|
public function resize($width, $height = null, $aspect_ratio = null)
|
||||||
{
|
{
|
||||||
// Redefine vars
|
// Redefine vars
|
||||||
$width = (int) $width;
|
$width = (int) $width;
|
||||||
$height = ($height === null) ? null : (int) $height;
|
$height = ($height === null) ? null : (int) $height;
|
||||||
$aspect_ratio = ($aspect_ratio === null) ? null : (int) $aspect_ratio;
|
$aspect_ratio = ($aspect_ratio === null) ? null : (int) $aspect_ratio;
|
||||||
|
$xpos = $ypos = 0;
|
||||||
|
|
||||||
// Resizes the image to {$width}% of the original size
|
// Resizes the image to {$width}% of the original size
|
||||||
if ($height === null) {
|
if ($height === null) {
|
||||||
@@ -186,13 +187,18 @@ class Image
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Resizes the image to the smalles possible dimension while maintaining aspect ratio
|
// Resizes the image to the smalles possible dimension while maintaining aspect ratio
|
||||||
if ($aspect_ratio === Image::AUTO) {
|
if ($aspect_ratio === Image::AUTO || $aspect_ratio === null) {
|
||||||
|
|
||||||
// Calculate smallest size based on given height and width while maintaining aspect ratio
|
// Calculate smallest size based on given height and width while maintaining aspect ratio
|
||||||
$percentage = min(($width / $this->width), ($height / $this->height));
|
$percentage = min(($width / $this->width), ($height / $this->height));
|
||||||
|
|
||||||
$new_width = round($this->width * $percentage);
|
$new_width = round($this->width * $percentage);
|
||||||
$new_height = round($this->height * $percentage);
|
$new_height = round($this->height * $percentage);
|
||||||
|
|
||||||
|
if ($aspect_ratio === null) {
|
||||||
|
$xpos = (int)(($width - $new_width) / 2);
|
||||||
|
$ypos = (int)(($height - $new_height) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
// Resizes the image using the width to maintain aspect ratio
|
// Resizes the image using the width to maintain aspect ratio
|
||||||
} elseif ($aspect_ratio === Image::WIDTH) {
|
} elseif ($aspect_ratio === Image::WIDTH) {
|
||||||
@@ -216,24 +222,28 @@ class Image
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new true color image width new width and height
|
$old_image = $this->image;
|
||||||
$resized = imagecreatetruecolor($new_width, $new_height);
|
|
||||||
|
if ($aspect_ratio === null) {
|
||||||
|
$this->image = imagecreatetruecolor($width, $height);
|
||||||
|
} else {
|
||||||
|
$this->image = imagecreatetruecolor($new_width, $new_height);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->type === IMAGETYPE_PNG) {
|
||||||
|
$bgcolor = imagecolorallocatealpha($this->image, 0, 0, 0, 127);
|
||||||
|
} else {
|
||||||
|
$bgcolor = imagecolorallocate($this->image, 255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
imagefill($this->image, 0, 0, $bgcolor);
|
||||||
|
|
||||||
// Copy and resize part of an image with resampling
|
// Copy and resize part of an image with resampling
|
||||||
imagecopyresampled($resized, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height);
|
imagecopyresampled($this->image, $old_image, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->width, $this->height);
|
||||||
|
|
||||||
// Destroy an image
|
// Destroy an image
|
||||||
imagedestroy($this->image);
|
imagedestroy($old_image);
|
||||||
|
|
||||||
// Create a new true color image width new width and height
|
|
||||||
$this->image = imagecreatetruecolor($new_width, $new_height);
|
|
||||||
|
|
||||||
// Copy and resize part of an image with resampling
|
|
||||||
imagecopyresampled($this->image, $resized, 0, 0, 0, 0, $new_width, $new_height, $new_width, $new_height);
|
|
||||||
|
|
||||||
// Destroy an image
|
|
||||||
imagedestroy($resized);
|
|
||||||
|
|
||||||
// Save new width and height
|
// Save new width and height
|
||||||
$this->width = $new_width;
|
$this->width = $new_width;
|
||||||
$this->height = $new_height;
|
$this->height = $new_height;
|
||||||
@@ -259,32 +269,28 @@ class Image
|
|||||||
// Redefine vars
|
// Redefine vars
|
||||||
$width = (int) $width;
|
$width = (int) $width;
|
||||||
$height = (int) $height;
|
$height = (int) $height;
|
||||||
$x = (int) $x;
|
$x = (int) $x;
|
||||||
$y = (int) $y;
|
$y = (int) $y;
|
||||||
|
|
||||||
// Calculate
|
// Calculate
|
||||||
if ($x + $width > $this->width) $width = $this->width - $x;
|
if ($x + $width > $this->width) $width = $this->width - $x;
|
||||||
if ($y + $height > $this->height) $height = $this->height - $y;
|
if ($y + $height > $this->height) $height = $this->height - $y;
|
||||||
if ($width <= 0 || $height <= 0) return false;
|
if ($width <= 0 || $height <= 0) return false;
|
||||||
|
|
||||||
// Create a new true color image
|
$old_image = $this->image;
|
||||||
$crop = imagecreatetruecolor($width, $height);
|
|
||||||
|
|
||||||
// Copy and resize part of an image with resampling
|
|
||||||
imagecopyresampled($crop, $this->image, 0, 0, $x, $y, $this->width, $this->height, $this->width, $this->height);
|
|
||||||
|
|
||||||
// Destroy an image
|
|
||||||
imagedestroy($this->image);
|
|
||||||
|
|
||||||
// Create a new true color image
|
// Create a new true color image
|
||||||
$this->image = imagecreatetruecolor($width, $height);
|
$this->image = imagecreatetruecolor($width, $height);
|
||||||
|
|
||||||
|
$transparent = imagecolorallocatealpha($this->image, 0, 0, 0, 127);
|
||||||
|
imagefill($this->image, 0, 0, $transparent);
|
||||||
|
|
||||||
// Copy and resize part of an image with resampling
|
// Copy and resize part of an image with resampling
|
||||||
imagecopyresampled($this->image, $crop, 0, 0, 0, 0, $width, $height, $width, $height);
|
imagecopyresampled($this->image, $old_image, 0, 0, $x, $y, $width, $height, $width, $height);
|
||||||
|
|
||||||
// Destroy an image
|
// Destroy an image
|
||||||
imagedestroy($crop);
|
imagedestroy($old_image);
|
||||||
|
|
||||||
// Save new width and height
|
// Save new width and height
|
||||||
$this->width = $width;
|
$this->width = $width;
|
||||||
$this->height = $height;
|
$this->height = $height;
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
63
libraries/Gelato/Log/Log.php
Normal file
63
libraries/Gelato/Log/Log.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gelato Library
|
||||||
|
*
|
||||||
|
* This source file is part of the Gelato Library. More information,
|
||||||
|
* documentation and tutorials can be found at http://gelato.monstra.org
|
||||||
|
*
|
||||||
|
* @package Gelato
|
||||||
|
*
|
||||||
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Log
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the logs.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected static $path = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Protected constructor since this is a static class.
|
||||||
|
*
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected function __construct()
|
||||||
|
{
|
||||||
|
// Nothing here
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure Log
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $setting The setting
|
||||||
|
* @param string $value The value
|
||||||
|
*/
|
||||||
|
public static function configure($setting, $value)
|
||||||
|
{
|
||||||
|
if (property_exists("log", $setting)) Log::$$setting = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes message to log.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $message The message to write to the log
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public static function write($message)
|
||||||
|
{
|
||||||
|
return (bool) file_put_contents(rtrim(Log::$path, '/') . '/' . gmdate('Y_m_d') . '.log',
|
||||||
|
'[' . gmdate('d-M-Y H:i:s') . '] ' . $message . PHP_EOL,
|
||||||
|
FILE_APPEND);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,93 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gelato Library
|
|
||||||
*
|
|
||||||
* This source file is part of the Gelato Library. More information,
|
|
||||||
* documentation and tutorials can be found at http://gelato.monstra.org
|
|
||||||
*
|
|
||||||
* @package Gelato
|
|
||||||
*
|
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Minify
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Protected constructor since this is a static class.
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected function __construct()
|
|
||||||
{
|
|
||||||
// Nothing here
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minify html
|
|
||||||
*
|
|
||||||
* <code>
|
|
||||||
* echo Minify::html($buffer);
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @param string $buffer html
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function html($buffer)
|
|
||||||
{
|
|
||||||
return preg_replace('/^\\s+|\\s+$/m', '', $buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minify css
|
|
||||||
*
|
|
||||||
* <code>
|
|
||||||
* echo Minify::css($buffer);
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @param string $buffer css
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function css($buffer)
|
|
||||||
{
|
|
||||||
// Remove comments
|
|
||||||
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
|
|
||||||
|
|
||||||
// Remove tabs, spaces, newlines, etc.
|
|
||||||
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
|
|
||||||
|
|
||||||
// Preserve empty comment after '>' http://www.webdevout.net/css-hacks#in_css-selectors
|
|
||||||
$buffer = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $buffer);
|
|
||||||
|
|
||||||
// Preserve empty comment between property and value
|
|
||||||
// http://css-discuss.incutio.com/?page=BoxModelHack
|
|
||||||
$buffer = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $buffer);
|
|
||||||
$buffer = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $buffer);
|
|
||||||
|
|
||||||
// Remove ws around { } and last semicolon in declaration block
|
|
||||||
$buffer = preg_replace('/\\s*{\\s*/', '{', $buffer);
|
|
||||||
$buffer = preg_replace('/;?\\s*}\\s*/', '}', $buffer);
|
|
||||||
|
|
||||||
// Remove ws surrounding semicolons
|
|
||||||
$buffer = preg_replace('/\\s*;\\s*/', ';', $buffer);
|
|
||||||
|
|
||||||
// Remove ws around urls
|
|
||||||
$buffer = preg_replace('/url\\(\\s*([^\\)]+?)\\s*\\)/x', 'url($1)', $buffer);
|
|
||||||
|
|
||||||
// Remove ws between rules and colons
|
|
||||||
$buffer = preg_replace('/\\s*([{;])\\s*([\\*_]?[\\w\\-]+)\\s*:\\s*(\\b|[#\'"])/x', '$1$2:$3', $buffer);
|
|
||||||
|
|
||||||
// Minimize hex colors
|
|
||||||
$buffer = preg_replace('/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i', '$1#$2$3$4$5', $buffer);
|
|
||||||
|
|
||||||
// Replace any ws involving newlines with a single newline
|
|
||||||
$buffer = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $buffer);
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
241
libraries/Gelato/Minify/MinifyCSS.php
Normal file
241
libraries/Gelato/Minify/MinifyCSS.php
Normal file
@@ -0,0 +1,241 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gelato Library
|
||||||
|
*
|
||||||
|
* This source file is part of the Gelato Library. More information,
|
||||||
|
* documentation and tutorials can be found at http://gelato.monstra.org
|
||||||
|
*
|
||||||
|
* @package Gelato
|
||||||
|
*
|
||||||
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
* @author Stephen Clay <steve@mrclay.org>
|
||||||
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class MinifyCSS
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $_options = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are we "in" a hack? I.e. are some browsers targetted until the next comment?
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $_inHack = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param array $options (currently ignored)
|
||||||
|
*/
|
||||||
|
private function __construct($options)
|
||||||
|
{
|
||||||
|
$this->_options = $options;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minify a CSS string
|
||||||
|
*
|
||||||
|
* @param string $css
|
||||||
|
*
|
||||||
|
* @param array $options (currently ignored)
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function process($css, $options = array())
|
||||||
|
{
|
||||||
|
$obj = new MinifyCSS($options);
|
||||||
|
|
||||||
|
return $obj->_process($css);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minify a CSS string
|
||||||
|
*
|
||||||
|
* @param string $css
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function _process($css)
|
||||||
|
{
|
||||||
|
$css = str_replace("\r\n", "\n", $css);
|
||||||
|
|
||||||
|
// preserve empty comment after '>'
|
||||||
|
// http://www.webdevout.net/css-hacks#in_css-selectors
|
||||||
|
$css = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $css);
|
||||||
|
|
||||||
|
// preserve empty comment between property and value
|
||||||
|
// http://css-discuss.incutio.com/?page=BoxModelHack
|
||||||
|
$css = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $css);
|
||||||
|
$css = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $css);
|
||||||
|
|
||||||
|
// apply callback to all valid comments (and strip out surrounding ws
|
||||||
|
$css = preg_replace_callback('@\\s*/\\*([\\s\\S]*?)\\*/\\s*@'
|
||||||
|
,array($this, '_commentCB'), $css);
|
||||||
|
|
||||||
|
// remove ws around { } and last semicolon in declaration block
|
||||||
|
$css = preg_replace('/\\s*{\\s*/', '{', $css);
|
||||||
|
$css = preg_replace('/;?\\s*}\\s*/', '}', $css);
|
||||||
|
|
||||||
|
// remove ws surrounding semicolons
|
||||||
|
$css = preg_replace('/\\s*;\\s*/', ';', $css);
|
||||||
|
|
||||||
|
// remove ws around urls
|
||||||
|
$css = preg_replace('/
|
||||||
|
url\\( # url(
|
||||||
|
\\s*
|
||||||
|
([^\\)]+?) # 1 = the URL (really just a bunch of non right parenthesis)
|
||||||
|
\\s*
|
||||||
|
\\) # )
|
||||||
|
/x', 'url($1)', $css);
|
||||||
|
|
||||||
|
// remove ws between rules and colons
|
||||||
|
$css = preg_replace('/
|
||||||
|
\\s*
|
||||||
|
([{;]) # 1 = beginning of block or rule separator
|
||||||
|
\\s*
|
||||||
|
([\\*_]?[\\w\\-]+) # 2 = property (and maybe IE filter)
|
||||||
|
\\s*
|
||||||
|
:
|
||||||
|
\\s*
|
||||||
|
(\\b|[#\'"-]) # 3 = first character of a value
|
||||||
|
/x', '$1$2:$3', $css);
|
||||||
|
|
||||||
|
// minimize hex colors
|
||||||
|
/*$css = preg_replace('/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i'
|
||||||
|
, '$1#$2$3$4$5', $css);*/
|
||||||
|
|
||||||
|
// remove spaces between font families
|
||||||
|
$css = preg_replace_callback('/font-family:([^;}]+)([;}])/'
|
||||||
|
,array($this, '_fontFamilyCB'), $css);
|
||||||
|
|
||||||
|
$css = preg_replace('/@import\\s+url/', '@import url', $css);
|
||||||
|
|
||||||
|
// replace any ws involving newlines with a single newline
|
||||||
|
$css = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $css);
|
||||||
|
|
||||||
|
// separate common descendent selectors w/ newlines (to limit line lengths)
|
||||||
|
$css = preg_replace('/([\\w#\\.\\*]+)\\s+([\\w#\\.\\*]+){/', "$1\n$2{", $css);
|
||||||
|
|
||||||
|
// Use newline after 1st numeric value (to limit line lengths).
|
||||||
|
$css = preg_replace('/
|
||||||
|
((?:padding|margin|border|outline):\\d+(?:px|em)?) # 1 = prop : 1st numeric value
|
||||||
|
\\s+
|
||||||
|
/x'
|
||||||
|
,"$1\n", $css);
|
||||||
|
|
||||||
|
// prevent triggering IE6 bug: http://www.crankygeek.com/ie6pebug/
|
||||||
|
$css = preg_replace('/:first-l(etter|ine)\\{/', ':first-l$1 {', $css);
|
||||||
|
|
||||||
|
return trim($css);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace what looks like a set of selectors
|
||||||
|
*
|
||||||
|
* @param array $m regex matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function _selectorsCB($m)
|
||||||
|
{
|
||||||
|
// remove ws around the combinators
|
||||||
|
return preg_replace('/\\s*([,>+~])\\s*/', '$1', $m[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process a comment and return a replacement
|
||||||
|
*
|
||||||
|
* @param array $m regex matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function _commentCB($m)
|
||||||
|
{
|
||||||
|
$hasSurroundingWs = (trim($m[0]) !== $m[1]);
|
||||||
|
$m = $m[1];
|
||||||
|
// $m is the comment content w/o the surrounding tokens,
|
||||||
|
// but the return value will replace the entire comment.
|
||||||
|
if ($m === 'keep') {
|
||||||
|
return '/**/';
|
||||||
|
}
|
||||||
|
if ($m === '" "') {
|
||||||
|
// component of http://tantek.com/CSS/Examples/midpass.html
|
||||||
|
return '/*" "*/';
|
||||||
|
}
|
||||||
|
if (preg_match('@";\\}\\s*\\}/\\*\\s+@', $m)) {
|
||||||
|
// component of http://tantek.com/CSS/Examples/midpass.html
|
||||||
|
return '/*";}}/* */';
|
||||||
|
}
|
||||||
|
if ($this->_inHack) {
|
||||||
|
// inversion: feeding only to one browser
|
||||||
|
if (preg_match('@
|
||||||
|
^/ # comment started like /*/
|
||||||
|
\\s*
|
||||||
|
(\\S[\\s\\S]+?) # has at least some non-ws content
|
||||||
|
\\s*
|
||||||
|
/\\* # ends like /*/ or /**/
|
||||||
|
@x', $m, $n)) {
|
||||||
|
// end hack mode after this comment, but preserve the hack and comment content
|
||||||
|
$this->_inHack = false;
|
||||||
|
|
||||||
|
return "/*/{$n[1]}/**/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (substr($m, -1) === '\\') { // comment ends like \*/
|
||||||
|
// begin hack mode and preserve hack
|
||||||
|
$this->_inHack = true;
|
||||||
|
|
||||||
|
return '/*\\*/';
|
||||||
|
}
|
||||||
|
if ($m !== '' && $m[0] === '/') { // comment looks like /*/ foo */
|
||||||
|
// begin hack mode and preserve hack
|
||||||
|
$this->_inHack = true;
|
||||||
|
|
||||||
|
return '/*/*/';
|
||||||
|
}
|
||||||
|
if ($this->_inHack) {
|
||||||
|
// a regular comment ends hack mode but should be preserved
|
||||||
|
$this->_inHack = false;
|
||||||
|
|
||||||
|
return '/**/';
|
||||||
|
}
|
||||||
|
// Issue 107: if there's any surrounding whitespace, it may be important, so
|
||||||
|
// replace the comment with a single space
|
||||||
|
return $hasSurroundingWs // remove all other comments
|
||||||
|
? ' '
|
||||||
|
: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process a font-family listing and return a replacement
|
||||||
|
*
|
||||||
|
* @param array $m regex matches
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function _fontFamilyCB($m)
|
||||||
|
{
|
||||||
|
// Issue 210: must not eliminate WS between words in unquoted families
|
||||||
|
$pieces = preg_split('/(\'[^\']+\'|"[^"]+")/', $m[1], null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||||
|
$out = 'font-family:';
|
||||||
|
while (null !== ($piece = array_shift($pieces))) {
|
||||||
|
if ($piece[0] !== '"' && $piece[0] !== "'") {
|
||||||
|
$piece = preg_replace('/\\s+/', ' ', $piece);
|
||||||
|
$piece = preg_replace('/\\s?,\\s?/', ',', $piece);
|
||||||
|
}
|
||||||
|
$out .= $piece;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out . $m[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
47
libraries/Gelato/Minify/MinifyHTML.php
Normal file
47
libraries/Gelato/Minify/MinifyHTML.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gelato Library
|
||||||
|
*
|
||||||
|
* This source file is part of the Gelato Library. More information,
|
||||||
|
* documentation and tutorials can be found at http://gelato.monstra.org
|
||||||
|
*
|
||||||
|
* @package Gelato
|
||||||
|
*
|
||||||
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class MinifyHTML
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Minify html
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo MinifyHTML::process($html);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $buffer html
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function process($html)
|
||||||
|
{
|
||||||
|
// Remove HTML comments (not containing IE conditional comments).
|
||||||
|
$html = preg_replace_callback('/<!--([\\s\\S]*?)-->/', 'MinifyHTML::_comments', $html);
|
||||||
|
|
||||||
|
// Trim each line.
|
||||||
|
$html = preg_replace('/^\\s+|\\s+$/m', '', $html);
|
||||||
|
|
||||||
|
// Return HTML
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function _comments($m)
|
||||||
|
{
|
||||||
|
return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<![')) ? $m[0] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
50
libraries/Gelato/Minify/MinifyJS.php
Normal file
50
libraries/Gelato/Minify/MinifyJS.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gelato Library
|
||||||
|
*
|
||||||
|
* This source file is part of the Gelato Library. More information,
|
||||||
|
* documentation and tutorials can be found at http://gelato.monstra.org
|
||||||
|
*
|
||||||
|
* @package Gelato
|
||||||
|
*
|
||||||
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class MinifyJS
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Minify js
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo MinifyJS::process($js);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $buffer html
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function process($js)
|
||||||
|
{
|
||||||
|
// newlines > linefeed
|
||||||
|
$js = str_replace(array("\r\n", "\r", "\n"), "\n", $js);
|
||||||
|
|
||||||
|
// empty lines > collapse
|
||||||
|
$js = preg_replace('/^[ \t]*|[ \t]*$/m', '', $js);
|
||||||
|
$js = preg_replace('/\n+/m', "\n", $js);
|
||||||
|
$js = trim($js);
|
||||||
|
|
||||||
|
// redundant whitespace > remove
|
||||||
|
$js = preg_replace('/(?<=[{}\[\]\(\)=><&\|;:,\?!\+-])[ \t]*|[ \t]*(?=[{}\[\]\(\)=><&\|;:,\?!\+-])/i', '', $js);
|
||||||
|
$js = preg_replace('/[ \t]+/', ' ', $js);
|
||||||
|
|
||||||
|
// redundant semicolons (followed by another semicolon or closing curly bracket) > remove
|
||||||
|
$js = preg_replace('/;\s*(?=[;}])/s', '', $js);
|
||||||
|
|
||||||
|
// Return JS
|
||||||
|
return $js;
|
||||||
|
}
|
||||||
|
}
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -28,7 +28,7 @@ class Number
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert bytes in 'kb','mb','gb','tb','pb'
|
* Convert bytes in 'KB','MB','GB','TiB','PiB'
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* echo Number::byteFormat(10000);
|
* echo Number::byteFormat(10000);
|
||||||
@@ -42,9 +42,31 @@ class Number
|
|||||||
// Redefine vars
|
// Redefine vars
|
||||||
$size = (int) $size;
|
$size = (int) $size;
|
||||||
|
|
||||||
$unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');
|
$unit = array('B', 'KB', 'MB', 'GB', 'TiB', 'PiB');
|
||||||
|
|
||||||
return @round($size/pow(1024, ($i=floor(log($size, 1024)))), 2).' '.$unit[$i];
|
return @round($size/pow(1024, ($i=floor(log($size, 1024)))), 2).' '.$unit[($i < 0 ? 0 : $i)];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert 'KB','MB','GB' in bytes
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Number::convertToBytes('10MB');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $num Number to convert
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function convertToBytes( $num ) {
|
||||||
|
$num = strtolower( $num );
|
||||||
|
$bytes = (int) $num;
|
||||||
|
if ( strpos( $num, 'k' ) !== false )
|
||||||
|
$bytes = intval( $num ) * 1024;
|
||||||
|
elseif ( strpos( $num, 'm' ) !== false )
|
||||||
|
$bytes = intval($num) * 1024 * 1024;
|
||||||
|
elseif ( strpos( $num, 'g' ) !== false )
|
||||||
|
$bytes = intval( $num ) * 1024 * 1024 * 1024;
|
||||||
|
return $bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4,6 +4,6 @@ Gelato is a PHP5 library for kickass Web Applications.
|
|||||||
|
|
||||||
## Links
|
## Links
|
||||||
- [Site](http://gelato.monstra.org)
|
- [Site](http://gelato.monstra.org)
|
||||||
- [Github Repository](https://github.com/Monstra/gelato-library)
|
- [Github Repository](https://github.com/MonstrLab/gelato)
|
||||||
|
|
||||||
Copyright (C) 2012-2013 Romanenko Sergey / Awilum [awilum@msn.com]
|
Copyright (C) 2013 Romanenko Sergey / Awilum [awilum@msn.com]
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -27,7 +27,7 @@ class Registry
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if an object with this name is in the registry.
|
* Checks if an object with this name is in the registry.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* if (Registry::exists('var')) {
|
* if (Registry::exists('var')) {
|
||||||
* // Do something...
|
* // Do something...
|
||||||
@@ -44,7 +44,7 @@ class Registry
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a given value under a given name.
|
* Registers a given value under a given name.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* Registry::set('var', 'value');
|
* Registry::set('var', 'value');
|
||||||
* </code>
|
* </code>
|
||||||
@@ -69,7 +69,7 @@ class Registry
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch an item from the registry.
|
* Fetch an item from the registry.
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* $var = Registry::get('var', 'value');
|
* $var = Registry::get('var', 'value');
|
||||||
* </code>
|
* </code>
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -22,7 +22,7 @@ class Token
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public static $token_name = 'security_token';
|
protected static $token_name = 'security_token';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Protected constructor since this is a static class.
|
* Protected constructor since this is a static class.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
* @package Gelato
|
* @package Gelato
|
||||||
*
|
*
|
||||||
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
* @author Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum <awilum@msn.com>
|
* @copyright 2012-2014 Romanenko Sergey / Awilum <awilum@msn.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
@@ -24,6 +24,12 @@ class Zip
|
|||||||
public $offset = 0;
|
public $offset = 0;
|
||||||
public $now;
|
public $now;
|
||||||
|
|
||||||
|
private $_archive_info = array();
|
||||||
|
private $_zip_signature = "\x50\x4b\x03\x04";
|
||||||
|
private $_dir_signature = "\x50\x4b\x01\x02";
|
||||||
|
private $_central_signature_end = "\x50\x4b\x05\x06";
|
||||||
|
private $farc = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +270,7 @@ class Zip
|
|||||||
* @param string $root_path Root path
|
* @param string $root_path Root path
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function readDir($path, $preserve_filepath = true, $root_path = null)
|
public function readDir($path, $preserve_filepath = true, $root_path = null, $exclude_files = array())
|
||||||
{
|
{
|
||||||
if ( ! $fp = @opendir($path)) {
|
if ( ! $fp = @opendir($path)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -277,12 +283,12 @@ class Zip
|
|||||||
|
|
||||||
while (false !== ($file = readdir($fp))) {
|
while (false !== ($file = readdir($fp))) {
|
||||||
|
|
||||||
if (substr($file, 0, 1) == '.') {
|
if (substr($file, 0, 1) == '.' || in_array($path.$file, $exclude_files)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@is_dir($path.$file)) {
|
if (@is_dir($path.$file)) {
|
||||||
$this->readDir($path.$file."/", $preserve_filepath, $root_path);
|
$this->readDir($path.$file."/", $preserve_filepath, $root_path, $exclude_files);
|
||||||
} else {
|
} else {
|
||||||
if (false !== ($data = file_get_contents($path.$file))) {
|
if (false !== ($data = file_get_contents($path.$file))) {
|
||||||
$name = str_replace("\\", "/", $path);
|
$name = str_replace("\\", "/", $path);
|
||||||
@@ -372,4 +378,302 @@ class Zip
|
|||||||
$this->offset = 0;
|
$this->offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function extract($zip_file, $target_dir = null)
|
||||||
|
{
|
||||||
|
$chmod = 0777;
|
||||||
|
$this->_archive_info = array();
|
||||||
|
|
||||||
|
$files = $this->_read_archive($zip_file);
|
||||||
|
|
||||||
|
if (!$files) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$file_locations = array();
|
||||||
|
foreach ($files as $file => $trash) {
|
||||||
|
$dirname = pathinfo($file, PATHINFO_DIRNAME);
|
||||||
|
|
||||||
|
$folders = explode('/', $dirname);
|
||||||
|
$out_dn = $target_dir . '/' . $dirname;
|
||||||
|
|
||||||
|
if ( !is_dir($out_dn)) {
|
||||||
|
$str = '';
|
||||||
|
foreach ($folders as $folder) {
|
||||||
|
$str = $str ? $str . '/' . $folder : $folder;
|
||||||
|
if ( !is_dir($target_dir . '/' . $str)) {
|
||||||
|
if ( ! @mkdir($target_dir . '/' . $str)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
chmod($target_dir . '/' . $str, $chmod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (substr($file, -1, 1) == '/') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$file_locations[] = $file_location = $target_dir . '/' . $file;
|
||||||
|
|
||||||
|
$this->_extract_file($file, $file_location);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_archive_info = array();
|
||||||
|
|
||||||
|
return $file_locations;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _read_archive($zip_file)
|
||||||
|
{
|
||||||
|
if (sizeof($this->_archive_info)) {
|
||||||
|
return $this->_archive_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fh = fopen($zip_file, 'r');
|
||||||
|
$this->farc = &$fh;
|
||||||
|
|
||||||
|
if ( !$fh) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$this->_read_file_list_by_eof($fh)) {
|
||||||
|
if ( !$this->_read_files_by_signatures($fh)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_archive_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _read_file_list_by_eof(&$fh)
|
||||||
|
{
|
||||||
|
for ($x = 0; $x < 1024; $x++) {
|
||||||
|
fseek($fh, -22 - $x, SEEK_END);
|
||||||
|
|
||||||
|
$signature = fread($fh, 4);
|
||||||
|
|
||||||
|
if ($signature == $this->_central_signature_end) {
|
||||||
|
$eodir['disk_number_this'] = unpack("v", fread($fh, 2));
|
||||||
|
$eodir['disk_number'] = unpack("v", fread($fh, 2));
|
||||||
|
$eodir['total_entries_this'] = unpack("v", fread($fh, 2));
|
||||||
|
$eodir['total_entries'] = unpack("v", fread($fh, 2));
|
||||||
|
$eodir['size_of_cd'] = unpack("V", fread($fh, 4));
|
||||||
|
$eodir['offset_start_cd'] = unpack("V", fread($fh, 4));
|
||||||
|
$zip_comment_lenght = unpack("v", fread($fh, 2));
|
||||||
|
$eodir['zipfile_comment'] = $zip_comment_lenght[1] ? fread($fh, $zip_comment_lenght[1]) : '';
|
||||||
|
|
||||||
|
fseek($fh, $eodir['offset_start_cd'][1]);
|
||||||
|
$signature = fread($fh, 4);
|
||||||
|
|
||||||
|
while ($signature == $this->_dir_signature) {
|
||||||
|
$dir['version_madeby'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['version_needed'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['general_bit_flag'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['compression_method'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['lastmod_time'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['lastmod_date'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['crc-32'] = fread($fh, 4);
|
||||||
|
$dir['compressed_size'] = unpack("V", fread($fh, 4));
|
||||||
|
$dir['uncompressed_size'] = unpack("V", fread($fh, 4));
|
||||||
|
$zip_file_length = unpack("v", fread($fh, 2));
|
||||||
|
$extra_field_length = unpack("v", fread($fh, 2));
|
||||||
|
$fileCommentLength = unpack("v", fread($fh, 2));
|
||||||
|
$dir['disk_number_start'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['internal_attributes'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['external_attributes1'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['external_attributes2'] = unpack("v", fread($fh, 2));
|
||||||
|
$dir['relative_offset'] = unpack("V", fread($fh, 4));
|
||||||
|
$dir['file_name'] = fread($fh, $zip_file_length[1]);
|
||||||
|
$dir['extra_field'] = $extra_field_length[1] ? fread($fh, $extra_field_length[1]) : '';
|
||||||
|
$dir['file_comment'] = $fileCommentLength[1] ? fread($fh, $fileCommentLength[1]) : '';
|
||||||
|
|
||||||
|
$binary_mod_date = str_pad(decbin($dir['lastmod_date'][1]), 16, '0', STR_PAD_LEFT);
|
||||||
|
$binary_mod_time = str_pad(decbin($dir['lastmod_time'][1]), 16, '0', STR_PAD_LEFT);
|
||||||
|
$last_mod_year = bindec(substr($binary_mod_date, 0, 7)) + 1980;
|
||||||
|
$last_mod_month = bindec(substr($binary_mod_date, 7, 4));
|
||||||
|
$last_mod_day = bindec(substr($binary_mod_date, 11, 5));
|
||||||
|
$last_mod_hour = bindec(substr($binary_mod_time, 0, 5));
|
||||||
|
$last_mod_minute = bindec(substr($binary_mod_time, 5, 6));
|
||||||
|
$last_mod_second = bindec(substr($binary_mod_time, 11, 5));
|
||||||
|
|
||||||
|
$central_dir_list[$dir['file_name']] = array(
|
||||||
|
'version_madeby' => $dir['version_madeby'][1],
|
||||||
|
'version_needed' => $dir['version_needed'][1],
|
||||||
|
'general_bit_flag' => str_pad(decbin($dir['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT),
|
||||||
|
'compression_method' => $dir['compression_method'][1],
|
||||||
|
'lastmod_datetime' => mktime($last_mod_hour, $last_mod_minute, $last_mod_second, $last_mod_month, $last_mod_day, $last_mod_year),
|
||||||
|
'crc-32' => str_pad(dechex(ord($dir['crc-32'][3])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($dir['crc-32'][2])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($dir['crc-32'][1])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($dir['crc-32'][0])), 2, '0', STR_PAD_LEFT),
|
||||||
|
'compressed_size' => $dir['compressed_size'][1],
|
||||||
|
'uncompressed_size' => $dir['uncompressed_size'][1],
|
||||||
|
'disk_number_start' => $dir['disk_number_start'][1],
|
||||||
|
'internal_attributes' => $dir['internal_attributes'][1],
|
||||||
|
'external_attributes1' => $dir['external_attributes1'][1],
|
||||||
|
'external_attributes2' => $dir['external_attributes2'][1],
|
||||||
|
'relative_offset' => $dir['relative_offset'][1],
|
||||||
|
'file_name' => $dir['file_name'],
|
||||||
|
'extra_field' => $dir['extra_field'],
|
||||||
|
'file_comment' => $dir['file_comment'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$signature = fread($fh, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($central_dir_list)) {
|
||||||
|
foreach ($central_dir_list as $filename => $details) {
|
||||||
|
$i = $this->_get_file_header($fh, $details['relative_offset']);
|
||||||
|
|
||||||
|
$this->_archive_info[$filename]['file_name'] = $filename;
|
||||||
|
$this->_archive_info[$filename]['compression_method'] = $details['compression_method'];
|
||||||
|
$this->_archive_info[$filename]['version_needed'] = $details['version_needed'];
|
||||||
|
$this->_archive_info[$filename]['lastmod_datetime'] = $details['lastmod_datetime'];
|
||||||
|
$this->_archive_info[$filename]['crc-32'] = $details['crc-32'];
|
||||||
|
$this->_archive_info[$filename]['compressed_size'] = $details['compressed_size'];
|
||||||
|
$this->_archive_info[$filename]['uncompressed_size'] = $details['uncompressed_size'];
|
||||||
|
$this->_archive_info[$filename]['lastmod_datetime'] = $details['lastmod_datetime'];
|
||||||
|
$this->_archive_info[$filename]['extra_field'] = $i['extra_field'];
|
||||||
|
$this->_archive_info[$filename]['contents_start_offset'] = $i['contents_start_offset'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _read_files_by_signatures(&$fh)
|
||||||
|
{
|
||||||
|
fseek($fh, 0);
|
||||||
|
|
||||||
|
$return = false;
|
||||||
|
for (;;) {
|
||||||
|
$details = $this->_get_file_header($fh);
|
||||||
|
|
||||||
|
if ( !$details) {
|
||||||
|
fseek($fh, 12 - 4, SEEK_CUR);
|
||||||
|
$details = $this->_get_file_header($fh);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$details) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$filename = $details['file_name'];
|
||||||
|
$this->_archive_info[$filename] = $details;
|
||||||
|
$return = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _get_file_header(&$fh, $start_offset = FALSE)
|
||||||
|
{
|
||||||
|
if ($start_offset !== false) {
|
||||||
|
fseek($fh, $start_offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
$signature = fread($fh, 4);
|
||||||
|
|
||||||
|
if ($signature == $this->_zip_signature) {
|
||||||
|
$file['version_needed'] = unpack("v", fread($fh, 2));
|
||||||
|
$file['general_bit_flag'] = unpack("v", fread($fh, 2));
|
||||||
|
$file['compression_method'] = unpack("v", fread($fh, 2));
|
||||||
|
$file['lastmod_time'] = unpack("v", fread($fh, 2));
|
||||||
|
$file['lastmod_date'] = unpack("v", fread($fh, 2));
|
||||||
|
$file['crc-32'] = fread($fh, 4);
|
||||||
|
$file['compressed_size'] = unpack("V", fread($fh, 4));
|
||||||
|
$file['uncompressed_size'] = unpack("V", fread($fh, 4));
|
||||||
|
$zip_file_length = unpack("v", fread($fh, 2));
|
||||||
|
$extra_field_length = unpack("v", fread($fh, 2));
|
||||||
|
$file['file_name'] = fread($fh, $zip_file_length[1]);
|
||||||
|
$file['extra_field'] = $extra_field_length[1] ? fread($fh, $extra_field_length[1]) : '';
|
||||||
|
$file['contents_start_offset'] = ftell($fh);
|
||||||
|
|
||||||
|
fseek($fh, $file['compressed_size'][1], SEEK_CUR);
|
||||||
|
|
||||||
|
$binary_mod_date = str_pad(decbin($file['lastmod_date'][1]), 16, '0', STR_PAD_LEFT);
|
||||||
|
$binary_mod_time = str_pad(decbin($file['lastmod_time'][1]), 16, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
$last_mod_year = bindec(substr($binary_mod_date, 0, 7)) + 1980;
|
||||||
|
$last_mod_month = bindec(substr($binary_mod_date, 7, 4));
|
||||||
|
$last_mod_day = bindec(substr($binary_mod_date, 11, 5));
|
||||||
|
$last_mod_hour = bindec(substr($binary_mod_time, 0, 5));
|
||||||
|
$last_mod_minute = bindec(substr($binary_mod_time, 5, 6));
|
||||||
|
$last_mod_second = bindec(substr($binary_mod_time, 11, 5));
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'file_name' => $file['file_name'],
|
||||||
|
'compression_method' => $file['compression_method'][1],
|
||||||
|
'version_needed' => $file['version_needed'][1],
|
||||||
|
'lastmod_datetime' => mktime($last_mod_hour, $last_mod_minute, $last_mod_second, $last_mod_month, $last_mod_day, $last_mod_year),
|
||||||
|
'crc-32' => str_pad(dechex(ord($file['crc-32'][3])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($file['crc-32'][2])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($file['crc-32'][1])), 2, '0', STR_PAD_LEFT) .
|
||||||
|
str_pad(dechex(ord($file['crc-32'][0])), 2, '0', STR_PAD_LEFT),
|
||||||
|
'compressed_size' => $file['compressed_size'][1],
|
||||||
|
'uncompressed_size' => $file['uncompressed_size'][1],
|
||||||
|
'extra_field' => $file['extra_field'],
|
||||||
|
'general_bit_flag' => str_pad(decbin($file['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT),
|
||||||
|
'contents_start_offset' => $file['contents_start_offset']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _extract_file($compressed_file_name, $target_file_name = false)
|
||||||
|
{
|
||||||
|
if ( !sizeof($this->_archive_info)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fdetails = &$this->_archive_info[$compressed_file_name];
|
||||||
|
|
||||||
|
if ( ! isset($this->_archive_info[$compressed_file_name])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (substr($compressed_file_name, -1) == '/') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !$fdetails['uncompressed_size']) {
|
||||||
|
return $target_file_name ? file_put_contents($target_file_name, '') : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
fseek($this->farc, $fdetails['contents_start_offset']);
|
||||||
|
$ret = $this->_uncompress(
|
||||||
|
fread($this->farc, $fdetails['compressed_size']),
|
||||||
|
$fdetails['compression_method'],
|
||||||
|
$fdetails['uncompressed_size'],
|
||||||
|
$target_file_name
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($target_file_name) {
|
||||||
|
chmod($target_file_name, 0644);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function _uncompress($content, $mode, $uncompressed_size, $target_file_name = false)
|
||||||
|
{
|
||||||
|
switch ($mode) {
|
||||||
|
case 0:
|
||||||
|
return $target_file_name ? file_put_contents($target_file_name, $content) : $content;
|
||||||
|
case 8:
|
||||||
|
return $target_file_name
|
||||||
|
? file_put_contents($target_file_name, gzinflate($content, $uncompressed_size))
|
||||||
|
: gzinflate($content, $uncompressed_size);
|
||||||
|
case 12:
|
||||||
|
return $target_file_name
|
||||||
|
? file_put_contents($target_file_name, bzdecompress($content)) : bzdecompress($content);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
0
libraries/Gelato/_logs/.empty
Normal file
0
libraries/Gelato/_logs/.empty
Normal file
@@ -1,3 +1,21 @@
|
|||||||
Gelato 1.0.0, XXXX-XX-XX
|
Gelato 1.0.3, 2013-04-03
|
||||||
------------------------
|
------------------------
|
||||||
- Initial release
|
- Html Class: obfuscate() method added.
|
||||||
|
- Html Class: email() method added.
|
||||||
|
- Html Class: missing $macros var added.
|
||||||
|
|
||||||
|
Gelato 1.0.2, 2013-03-17
|
||||||
|
------------------------
|
||||||
|
- Added support for PHP 5.2.3
|
||||||
|
|
||||||
|
Gelato 1.0.1, 2013-03-05
|
||||||
|
------------------------
|
||||||
|
- New constant GELATO_CLASS_LOADER instead of GELATO_AUTOLOADER
|
||||||
|
- ErrorHanler Class Improvements.
|
||||||
|
- Log Class Improvements.
|
||||||
|
- ClassLoader: new method register() added.
|
||||||
|
- Define __DIR__ constant for PHP 5.2.x
|
||||||
|
|
||||||
|
Gelato 1.0.0, 2013-02-26
|
||||||
|
------------------------
|
||||||
|
- Initial release
|
||||||
|
File diff suppressed because it is too large
Load Diff
2946
libraries/PHPMailer/PHPMailer.php
Normal file
2946
libraries/PHPMailer/PHPMailer.php
Normal file
File diff suppressed because it is too large
Load Diff
221
license.txt
221
license.txt
@@ -1,221 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
0. Definitions.
|
|
||||||
<EFBFBD>This License<73> refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
<EFBFBD>Copyright<EFBFBD> also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
|
||||||
|
|
||||||
<EFBFBD>The Program<61> refers to any copyrightable work licensed under this License. Each licensee is addressed as <20>you<6F>. <20>Licensees<65> and <20>recipients<74> may be individuals or organizations.
|
|
||||||
|
|
||||||
To <20>modify<66> a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a <20>modified version<6F> of the earlier work or a work <20>based on<6F> the earlier work.
|
|
||||||
|
|
||||||
A <20>covered work<72> means either the unmodified Program or a work based on the Program.
|
|
||||||
|
|
||||||
To <20>propagate<74> a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To <20>convey<65> a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays <20>Appropriate Legal Notices<65> to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
The <20>source code<64> for a work means the preferred form of the work for making modifications to it. <20>Object code<64> means any non-source form of a work.
|
|
||||||
|
|
||||||
A <20>Standard Interface<63> means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The <20>System Libraries<65> of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A <20>Major Component<6E>, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The <20>Corresponding Source<63> for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
|
||||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to <20>keep intact all notices<65>.
|
|
||||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
|
||||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
|
||||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an <20>aggregate<74> if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
|
||||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
|
||||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
|
||||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
|
||||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
|
||||||
|
|
||||||
A <20>User Product<63> is either (1) a <20>consumer product<63>, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, <20>normally used<65> refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
|
||||||
|
|
||||||
<EFBFBD>Installation Information<6F> for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
<EFBFBD>Additional permissions<6E> are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
|
||||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
|
||||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
|
||||||
All other non-permissive additional terms are considered <20>further restrictions<6E> within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An <20>entity transaction<6F> is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
A <20>contributor<6F> is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's <20>contributor version<6F>.
|
|
||||||
|
|
||||||
A contributor's <20>essential patent claims<6D> are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, <20>control<6F> includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a <20>patent license<73> is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To <20>grant<6E> such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. <20>Knowingly relying<6E> means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
|
||||||
|
|
||||||
A patent license is <20>discriminatory<72> if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License <20>or any later version<6F> applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM <20>AS IS<49> WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the <20>copyright<68> line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program 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, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an <20>about box<6F>.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a <20>copyright disclaimer<65> for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program 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 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
40
plugins/blog/README.md
Normal file
40
plugins/blog/README.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
Blog
|
||||||
|
================
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
#### Get Post
|
||||||
|
<?php echo Blog::getPost(); ?>
|
||||||
|
|
||||||
|
#### Get Posts
|
||||||
|
<?php echo Blog::getPosts(); ?>
|
||||||
|
|
||||||
|
#### Get 5 Posts (could be any amount, 5 or 1 or 25):
|
||||||
|
<?php echo Blog::getPosts(5); ?>
|
||||||
|
|
||||||
|
#### Get related Posts
|
||||||
|
<?php echo Blog::getRelatedPosts(); ?>
|
||||||
|
|
||||||
|
#### Get 4 latest posts from Blog
|
||||||
|
<?php echo Blog::getPostsBlock(4); ?>
|
||||||
|
|
||||||
|
#### Get Tags&Keywords
|
||||||
|
<?php Blog::getTags(); ?>
|
||||||
|
|
||||||
|
#### Get Tags&Keywords for current page
|
||||||
|
<?php Blog::getTags(Page::slug()); ?>
|
||||||
|
|
||||||
|
Get Post Title
|
||||||
|
<?php echo Blog::getPostTitle(); ?>
|
||||||
|
|
||||||
|
### Shortcode for content
|
||||||
|
|
||||||
|
#### Divided post into 2 parts (short and full)
|
||||||
|
{cut}
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
<p>Best free themes for Monstra CMS at monstrathemes.com</p>
|
||||||
|
{cut}
|
||||||
|
<p>There is going to display your content as blog post =)</p>
|
||||||
|
|
399
plugins/blog/blog.plugin.php
Normal file
399
plugins/blog/blog.plugin.php
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Blog plugin
|
||||||
|
*
|
||||||
|
* @package Monstra
|
||||||
|
* @subpackage Plugins
|
||||||
|
* @author Romanenko Sergey / Awilum
|
||||||
|
* @copyright 2012 Romanenko Sergey / Awilum
|
||||||
|
* @version 1.7.3
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Register plugin
|
||||||
|
Plugin::register( __FILE__,
|
||||||
|
__('Blog', 'blog'),
|
||||||
|
__('Blog plugin for Monstra', 'blog'),
|
||||||
|
'1.7.3',
|
||||||
|
'Awilum',
|
||||||
|
'http://monstra.org/');
|
||||||
|
|
||||||
|
// Add action
|
||||||
|
Action::add('frontend_pre_render', 'Blog::_rss');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Blog Class
|
||||||
|
*/
|
||||||
|
class Blog {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parrent page name(slug)
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public static $parent_page_name = 'blog';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get tags
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getTags();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getTags($slug = null) {
|
||||||
|
|
||||||
|
// Display view
|
||||||
|
return View::factory('blog/views/frontend/tags')
|
||||||
|
->assign('tags', Blog::getTagsArray($slug))
|
||||||
|
->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get breadcrumbs
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::breadcrumbs();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function breadcrumbs() {
|
||||||
|
$current_page = Pages::$requested_page;
|
||||||
|
$parent_page = '';
|
||||||
|
if ($current_page !== 'error404') {
|
||||||
|
$page = Pages::$pages->select('[slug="'.$current_page.'"]', null);
|
||||||
|
if (trim($page['parent']) !== '') {
|
||||||
|
$parent = true;
|
||||||
|
$parent_page = Pages::$pages->select('[slug="'.$page['parent'].'"]', null);
|
||||||
|
} else {
|
||||||
|
$parent = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display view
|
||||||
|
View::factory('blog/views/frontend/breadcrumbs')
|
||||||
|
->assign('current_page', $current_page)
|
||||||
|
->assign('page', $page)
|
||||||
|
->assign('parent', $parent)
|
||||||
|
->assign('parent_page', $parent_page)
|
||||||
|
->display();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get tags array
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getTagsArray();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getTagsArray($slug = null) {
|
||||||
|
|
||||||
|
// Init vars
|
||||||
|
$tags = array();
|
||||||
|
$tags_string = '';
|
||||||
|
|
||||||
|
if ($slug == null) {
|
||||||
|
$posts = Pages::$pages->select('[parent="'.Blog::$parent_page_name.'" and status="published"]', 'all');
|
||||||
|
} else {
|
||||||
|
$posts = Pages::$pages->select('[parent="'.Blog::$parent_page_name.'" and status="published" and slug="'.$slug.'"]', 'all');
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($posts as $post) {
|
||||||
|
if (isset($post['tags'])) {
|
||||||
|
$tags_string .= $post['tags'].',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$tags_string = substr($tags_string, 0, strlen($tags_string)-1);
|
||||||
|
|
||||||
|
// Explode tags in tags array
|
||||||
|
$tags = explode(',', $tags_string);
|
||||||
|
|
||||||
|
// Remove empty array elementss
|
||||||
|
foreach ($tags as $key => $value) {
|
||||||
|
if ($tags[$key] == '') {
|
||||||
|
unset($tags[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trim tags
|
||||||
|
array_walk($tags, create_function('&$val', '$val = trim($val);'));
|
||||||
|
|
||||||
|
// Get unique tags
|
||||||
|
$tags = array_unique($tags);
|
||||||
|
|
||||||
|
// Return tags
|
||||||
|
return $tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get posts
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* // Get all posts
|
||||||
|
* echo Blog::getPosts();
|
||||||
|
*
|
||||||
|
* // Get last 5 posts
|
||||||
|
* echo Blog::getPosts(5);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param integer $num Number of posts to show
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPosts($nums = 10) {
|
||||||
|
|
||||||
|
// Get page param
|
||||||
|
$page = (Request::get('page')) ? (int)Request::get('page') : 1;
|
||||||
|
|
||||||
|
if (Request::get('tag')) {
|
||||||
|
$query = '[parent="'.Blog::$parent_page_name.'" and status="published" and contains(tags, "'.Request::get('tag').'")]';
|
||||||
|
Notification::set('tag', Request::get('tag'));
|
||||||
|
} else {
|
||||||
|
$query = '[parent="'.Blog::$parent_page_name.'" and status="published"]';
|
||||||
|
Notification::clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Elements Count
|
||||||
|
$elements = count(Pages::$pages->select($query, 'all'));
|
||||||
|
|
||||||
|
// Get Pages Count
|
||||||
|
$pages = ceil($elements/$nums);
|
||||||
|
|
||||||
|
|
||||||
|
if ($page < 1) {
|
||||||
|
$page = 1;
|
||||||
|
} elseif ($page > $pages) {
|
||||||
|
$page = $pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
$start = ($page-1)*$nums;
|
||||||
|
|
||||||
|
// If there is no posts
|
||||||
|
if ($start < 0) $start = 0;
|
||||||
|
|
||||||
|
// Get posts and sort by DESC
|
||||||
|
$posts = Pages::$pages->select($query, $nums, $start, array('slug', 'title', 'author', 'date'), 'date', 'DESC');
|
||||||
|
|
||||||
|
// Loop
|
||||||
|
foreach($posts as $key => $post) {
|
||||||
|
$post_short = explode("{cut}", Text::toHtml(File::getContent(STORAGE . DS . 'pages' . DS . $post['id'] . '.page.txt')));
|
||||||
|
$posts[$key]['content'] = Filter::apply('content', $post_short[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display view
|
||||||
|
return View::factory('blog/views/frontend/index')
|
||||||
|
->assign('posts', $posts)
|
||||||
|
->render().
|
||||||
|
View::factory('blog/views/frontend/pager')
|
||||||
|
->assign('pages', $pages)
|
||||||
|
->assign('page', $page)
|
||||||
|
->render();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get posts block
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* // Get all posts
|
||||||
|
* echo Blog::getPostsBlock();
|
||||||
|
*
|
||||||
|
* // Get last 5 posts
|
||||||
|
* echo Blog::getPostsBlock(5);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param integer $num Number of posts to show
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostsBlock($nums = 10) {
|
||||||
|
|
||||||
|
// XPath Query
|
||||||
|
$query = '[parent="'.Blog::$parent_page_name.'" and status="published"]';
|
||||||
|
|
||||||
|
// Get posts and sort by DESC
|
||||||
|
$posts = Pages::$pages->select($query, $nums, 0, array('slug', 'title', 'author', 'date'), 'date', 'DESC');
|
||||||
|
|
||||||
|
// Loop
|
||||||
|
foreach($posts as $key => $post) {
|
||||||
|
$post_short = explode("{cut}", Text::toHtml(File::getContent(STORAGE . DS . 'pages' . DS . $post['id'] . '.page.txt')));
|
||||||
|
$posts[$key]['content'] = Filter::apply('content', $post_short[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display view
|
||||||
|
return View::factory('blog/views/frontend/block')
|
||||||
|
->assign('posts', $posts)
|
||||||
|
->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get related posts
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getRelatedPosts();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getRelatedPosts($limit = null) {
|
||||||
|
|
||||||
|
$related_posts = array();
|
||||||
|
$tags = Blog::getTagsArray(Page::slug());
|
||||||
|
|
||||||
|
foreach($tags as $tag) {
|
||||||
|
|
||||||
|
$query = '[parent="'.Blog::$parent_page_name.'" and status="published" and contains(tags, "'.$tag.'") and slug!="'.Page::slug().'"]';
|
||||||
|
|
||||||
|
if ($result = Arr::subvalSort(Pages::$pages->select($query, ($limit == null) ? 'all' : (int)$limit), 'date', 'DESC')) {
|
||||||
|
$related_posts = $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display view
|
||||||
|
return View::factory('blog/views/frontend/related_posts')
|
||||||
|
->assign('related_posts', $related_posts)
|
||||||
|
->render();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get post content
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPost();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPost() {
|
||||||
|
|
||||||
|
// Get post
|
||||||
|
$post = Text::toHtml(File::getContent(STORAGE . DS . 'pages' . DS . Pages::$page['id'] . '.page.txt'));
|
||||||
|
|
||||||
|
// Apply content filter
|
||||||
|
$post = Filter::apply('content', $post);
|
||||||
|
|
||||||
|
// Remove {cut} shortcode
|
||||||
|
$post = strtr($post, array('{cut}' => ''));
|
||||||
|
|
||||||
|
// Return post
|
||||||
|
return $post;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get post content before cut
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPostBeforeCut('home');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostBeforeCut($slug) {
|
||||||
|
|
||||||
|
$page = Pages::$pages->select('[slug="'.$slug.'"]', null);
|
||||||
|
|
||||||
|
// Get post
|
||||||
|
$post = explode("{cut}", Text::toHtml(File::getContent(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt')));
|
||||||
|
|
||||||
|
// Apply content filter
|
||||||
|
$post_content = Filter::apply('content', $post[0]);
|
||||||
|
|
||||||
|
// Return post
|
||||||
|
return $post_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get post content after cut
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPostAfterCut('home');
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostAfterCut($slug) {
|
||||||
|
|
||||||
|
$page = Pages::$pages->select('[slug="'.$slug.'"]', null);
|
||||||
|
|
||||||
|
// Get post
|
||||||
|
$post = explode("{cut}", Text::toHtml(File::getContent(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt')));
|
||||||
|
|
||||||
|
// Apply content filter
|
||||||
|
$post_content = Filter::apply('content', $post[1]);
|
||||||
|
|
||||||
|
// Return post
|
||||||
|
return $post_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Blog Post title
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPostTitle();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostTitle() {
|
||||||
|
return Page::title();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Blog Post Date
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPostDate();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $format Date format
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostDate($format = 'Y-m-d') {
|
||||||
|
return Page::date($format);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get author of current post
|
||||||
|
*
|
||||||
|
* <code>
|
||||||
|
* echo Blog::getPostAuthor();
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function getPostAuthor()
|
||||||
|
{
|
||||||
|
return Page::author();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _rss
|
||||||
|
*/
|
||||||
|
public static function _rss() {
|
||||||
|
if (Uri::segment(0) == 'rss') {
|
||||||
|
include PLUGINS . DS . 'blog' . DS . 'rss.php';
|
||||||
|
Request::shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
11
plugins/blog/install/blog.manifest.xml
Normal file
11
plugins/blog/install/blog.manifest.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<root>
|
||||||
|
<plugin_location>plugins/blog/blog.plugin.php</plugin_location>
|
||||||
|
<plugin_status>active</plugin_status>
|
||||||
|
<plugin_priority>15</plugin_priority>
|
||||||
|
<plugin_name>Blog</plugin_name>
|
||||||
|
<plugin_description>Blog plugin for Monstra</plugin_description>
|
||||||
|
<plugin_version>1.7.3</plugin_version>
|
||||||
|
<plugin_author>Awilum</plugin_author>
|
||||||
|
<plugin_author_uri>http://monstra.org/</plugin_author_uri>
|
||||||
|
</root>
|
12
plugins/blog/languages/en.lang.php
Normal file
12
plugins/blog/languages/en.lang.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'blog' => array(
|
||||||
|
'Blog' => 'Blog',
|
||||||
|
'Blog plugin for Monstra' => 'Blog plugin for Monstra',
|
||||||
|
'begin' => 'begin',
|
||||||
|
'end' => 'end',
|
||||||
|
'prev' => 'prev',
|
||||||
|
'next' => 'next',
|
||||||
|
)
|
||||||
|
);
|
12
plugins/blog/languages/pl.lang.php
Normal file
12
plugins/blog/languages/pl.lang.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'blog' => array(
|
||||||
|
'Blog' => 'Blog',
|
||||||
|
'Blog plugin for Monstra' => 'Wtyczka Blog dla systemu Monstra',
|
||||||
|
'begin' => 'początek',
|
||||||
|
'end' => 'koniec',
|
||||||
|
'prev' => 'poprzedni',
|
||||||
|
'next' => 'następny',
|
||||||
|
)
|
||||||
|
);
|
13
plugins/blog/languages/ru.lang.php
Normal file
13
plugins/blog/languages/ru.lang.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'blog' => array(
|
||||||
|
'Blog' => 'Блог',
|
||||||
|
'Blog plugin for Monstra' => 'Плагин блога для Monstra',
|
||||||
|
'begin' => 'начало',
|
||||||
|
'end' => 'конец',
|
||||||
|
'prev' => 'назад',
|
||||||
|
'next' => 'вперед',
|
||||||
|
'Related posts' => 'Статьи по теме',
|
||||||
|
)
|
||||||
|
);
|
11
plugins/blog/languages/sr.lang.php
Normal file
11
plugins/blog/languages/sr.lang.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'blog' => array(
|
||||||
|
'Blog' => 'Blog',
|
||||||
|
'Blog plugin for Monstra' => 'Blog, dodatak za Monstra',
|
||||||
|
'begin' => 'početak',
|
||||||
|
'end' => 'kraj',
|
||||||
|
'prev' => 'predhodna',
|
||||||
|
'next' => 'sledeća',
|
||||||
|
)
|
||||||
|
);
|
12
plugins/blog/languages/tr.lang.php
Normal file
12
plugins/blog/languages/tr.lang.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'blog' => array(
|
||||||
|
'Blog' => 'Günce',
|
||||||
|
'Blog plugin for Monstra' => 'Monstra için günce eklentisi',
|
||||||
|
'begin' => 'Baş',
|
||||||
|
'end' => 'Son',
|
||||||
|
'prev' => 'Önceki',
|
||||||
|
'next' => 'Sonraki',
|
||||||
|
)
|
||||||
|
);
|
34
plugins/blog/rss.php
Normal file
34
plugins/blog/rss.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Get all posts for blog parent page/post
|
||||||
|
$posts = Pages::$pages->select('[parent="'.Blog::$parent_page_name.'" and status="published"]', 5, 0, array('slug', 'title', 'author', 'date'), 'date', 'DESC');
|
||||||
|
|
||||||
|
// Date now
|
||||||
|
$now = date("D, d M Y H:i:s T");
|
||||||
|
ob_end_clean();
|
||||||
|
?>
|
||||||
|
<?php header('Content-type: text/xml; charset="utf-8"'); ?>
|
||||||
|
<?php echo'<?xml version="1.0" encoding="utf-8"?>'."\n"; ?>
|
||||||
|
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>MonstraCMS::BLOG::RSS</title>
|
||||||
|
<link><?php echo Option::get('siteurl'); ?>/blog</link>
|
||||||
|
<description>The latest updates for <?php echo Option::get('sitename'); ?>.</description>
|
||||||
|
<language>en-us</language>
|
||||||
|
<pubDate><?php echo $now; ?></pubDate>
|
||||||
|
<lastBuildDate><?php echo $now; ?></lastBuildDate>
|
||||||
|
<atom:link href="<?php echo Option::get('siteurl'); ?>/rss.php" rel="self" type="application/rss+xml" />
|
||||||
|
<generator>Monstra</generator>
|
||||||
|
<?php foreach ($posts as $post) { ?>
|
||||||
|
<item>
|
||||||
|
<title><?php echo $post['title']; ?></title>
|
||||||
|
<link><?php echo Option::get('siteurl').'/blog/'.$post['slug']; ?></link>
|
||||||
|
<guid><?php echo Option::get('siteurl').'/blog/'.$post['slug']; ?></guid>
|
||||||
|
<pubDate><?php echo Date::format($post['date'], 'd M Y'); ?></pubDate>
|
||||||
|
<description><![CDATA[<?php echo Text::toHtml(Text::cut(File::getContent(STORAGE . DS . 'pages' . DS . $post['id'] . '.page.txt'), 300)); ?>]]></description>
|
||||||
|
<author><?php echo $post['author']; ?></author>
|
||||||
|
</item>
|
||||||
|
<?php } ?>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
|
<?php Response::status(200); ?>
|
7
plugins/blog/views/frontend/block.view.php
Normal file
7
plugins/blog/views/frontend/block.view.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php foreach($posts as $post) { ?>
|
||||||
|
<h3 class="monstra-blog-title"><a href="<?php echo Option::get('siteurl'); ?>/<?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug'] ?>"><?php echo $post['title']; ?></a></h3>
|
||||||
|
<small class="monstra-blog-date"><?php echo Date::format($post['date'], 'd M Y'); ?></small>
|
||||||
|
<div class="monstra-blog-post">
|
||||||
|
<?php echo $post['content']; ?>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
5
plugins/blog/views/frontend/breadcrumbs.view.php
Normal file
5
plugins/blog/views/frontend/breadcrumbs.view.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php if ($parent) { ?>
|
||||||
|
<a href="<?php echo Site::url()."/".$page['parent']; ?><?php if(Notification::get('tag')) { ?>?tag=<?php echo Notification::get('tag'); ?><?php } ?>"><?php echo $parent_page['title']; ?></a> <span>→</span> <a href="<?php echo Site::url().$page['parent'].'/'.$page['slug']; ?>"><?php echo $page['title']; ?></a>
|
||||||
|
<?php } else { ?>
|
||||||
|
<a href="<?php echo Site::url()."/".$page['slug']; ?><?php if(Notification::get('tag')) { ?>?tag=<?php echo Notification::get('tag'); ?><?php } ?>"><?php echo $page['title']; ?></a>
|
||||||
|
<?php } ?>
|
7
plugins/blog/views/frontend/index.view.php
Normal file
7
plugins/blog/views/frontend/index.view.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php foreach($posts as $post) { ?>
|
||||||
|
<h3 class="monstra-blog-title"><a href="<?php echo Option::get('siteurl'); ?>/<?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug'] ?>"><?php echo $post['title']; ?></a></h3>
|
||||||
|
<small class="monstra-blog-date"><?php echo Date::format($post['date'], 'd M Y'); ?> / <?php echo $post['author']; ?></small>
|
||||||
|
<div class="monstra-blog-post">
|
||||||
|
<?php echo $post['content']; ?>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
29
plugins/blog/views/frontend/pager.view.php
Normal file
29
plugins/blog/views/frontend/pager.view.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<br><br>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (Request::get('tag')) $tag = '&tag='.Request::get('tag'); else $tag = '';
|
||||||
|
|
||||||
|
$neighbours = 6;
|
||||||
|
$left_neighbour = $page - $neighbours;
|
||||||
|
if ($left_neighbour < 1) $left_neighbour = 1;
|
||||||
|
|
||||||
|
$right_neighbour = $page + $neighbours;
|
||||||
|
if ($right_neighbour > $pages) $right_neighbour = $pages;
|
||||||
|
|
||||||
|
if ($page > 1) {
|
||||||
|
echo ' <a href="?page=1'.$tag.'">'.__('begin', 'blog').'</a> ... <a href="?page=' . ($page-1) . $tag.'"> '.__('prev', 'blog').'</a> ';
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i=$left_neighbour; $i<=$right_neighbour; $i++) {
|
||||||
|
if ($i != $page) {
|
||||||
|
echo ' <a href="?page=' . $i . $tag.'">' . $i . '</a> ';
|
||||||
|
} else {
|
||||||
|
echo ' <b>' . $i . '</b> ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($page < $pages) {
|
||||||
|
echo ' <a href="?page=' . ($page+1) . $tag.'">'.__('next', 'blog').'</a> ... <a href="?page=' . $pages . $tag.'">'.__('end', 'blog').'</a> ';
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
7
plugins/blog/views/frontend/related_posts.view.php
Normal file
7
plugins/blog/views/frontend/related_posts.view.php
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<br><br>
|
||||||
|
<b><?php echo __('Related posts', 'blog'); ?>:</b>
|
||||||
|
<div>
|
||||||
|
<?php foreach($related_posts as $related_post) { ?>
|
||||||
|
<a href="<?php echo Option::get('siteurl'); ?>/<?php echo Blog::$parent_page_name; ?>/<?php echo $related_post['slug']; ?>"><?php echo $related_post['title']; ?></a><br>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
3
plugins/blog/views/frontend/tags.view.php
Normal file
3
plugins/blog/views/frontend/tags.view.php
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?php foreach($tags as $tag) { ?>
|
||||||
|
<a href="<?php echo Option::get('siteurl'); ?>/<?php echo Blog::$parent_page_name; ?>?tag=<?php echo $tag; ?>" class="monstra-blog-tag"><span class="label label-primary"><?php echo $tag; ?></span></a>
|
||||||
|
<?php } ?>
|
@@ -15,8 +15,6 @@ class BackupAdmin extends Backend
|
|||||||
{
|
{
|
||||||
$backups_path = ROOT . DS . 'backups';
|
$backups_path = ROOT . DS . 'backups';
|
||||||
|
|
||||||
$backups_list = array();
|
|
||||||
|
|
||||||
// Create backup
|
// Create backup
|
||||||
// -------------------------------------
|
// -------------------------------------
|
||||||
if (Request::post('create_backup')) {
|
if (Request::post('create_backup')) {
|
||||||
@@ -32,12 +30,18 @@ class BackupAdmin extends Backend
|
|||||||
$zip->readDir(STORAGE . DS, false);
|
$zip->readDir(STORAGE . DS, false);
|
||||||
|
|
||||||
// Add public folder
|
// Add public folder
|
||||||
if (Request::post('add_public_folder')) $zip->readDir(ROOT . DS . 'public' . DS, false);
|
$zip->readDir(ROOT . DS . 'public' . DS, false);
|
||||||
|
|
||||||
// Add plugins folder
|
// Add plugins folder
|
||||||
if (Request::post('add_plugins_folder')) $zip->readDir(PLUGINS . DS, false);
|
$zip->readDir(PLUGINS . DS, false, null, array(PLUGINS . DS . 'box'));
|
||||||
|
|
||||||
$zip->archive($backups_path . DS . Date::format(time(), "Y-m-d-H-i-s").'.zip');
|
if ($zip->archive($backups_path . DS . Date::format(time(), "Y-m-d-H-i-s").'.zip')) {
|
||||||
|
Notification::set('success', __('Backup was created', 'backup'));
|
||||||
|
} else {
|
||||||
|
Notification::set('error', __('Backup was not created', 'backup'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Request::redirect(Option::get('siteurl').'/admin/index.php?id=backup');
|
||||||
|
|
||||||
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
||||||
}
|
}
|
||||||
@@ -48,8 +52,13 @@ class BackupAdmin extends Backend
|
|||||||
|
|
||||||
if (Security::check(Request::get('token'))) {
|
if (Security::check(Request::get('token'))) {
|
||||||
|
|
||||||
File::delete($backups_path . DS . Request::get('delete_file'));
|
if (File::delete($backups_path . DS . Request::get('delete_file'))) {
|
||||||
Request::redirect(Option::get('siteurl').'admin/index.php?id=backup');
|
Notification::set('success', __('Backup was deleted', 'backup'));
|
||||||
|
} else {
|
||||||
|
Notification::set('error', __('Backup was not deleted', 'backup'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Request::redirect(Option::get('siteurl').'/admin/index.php?id=backup');
|
||||||
|
|
||||||
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
||||||
}
|
}
|
||||||
@@ -62,12 +71,34 @@ class BackupAdmin extends Backend
|
|||||||
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get backup list
|
// Restore backup
|
||||||
$backups_list = File::scan($backups_path, '.zip');
|
// -------------------------------------
|
||||||
|
if (Request::get('restore')) {
|
||||||
|
|
||||||
|
if (Security::check(Request::get('token'))) {
|
||||||
|
|
||||||
|
$tmp_dir = ROOT . DS . 'tmp' . DS . uniqid('backup_');
|
||||||
|
|
||||||
|
if (Dir::create($tmp_dir)) {
|
||||||
|
$file_locations = Zip::factory()->extract($backups_path . DS . Request::get('restore'), $tmp_dir);
|
||||||
|
if (!empty($file_locations)) {
|
||||||
|
Dir::copy($tmp_dir, ROOT . DS);
|
||||||
|
Notification::set('success', __('Backup was restored', 'backup'));
|
||||||
|
} else {
|
||||||
|
Notification::set('error', __('Unzip error', 'backup'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Notification::set('error', __('Backup was not restored', 'backup'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Request::redirect(Option::get('siteurl').'/admin/index.php?id=backup');
|
||||||
|
|
||||||
|
} else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); }
|
||||||
|
}
|
||||||
|
|
||||||
// Display view
|
// Display view
|
||||||
View::factory('box/backup/views/backend/index')
|
View::factory('box/backup/views/backend/index')
|
||||||
->assign('backups_list', $backups_list)
|
->assign('backups_list', File::scan($backups_path, '.zip'))
|
||||||
->display();
|
->display();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
* @package Monstra
|
* @package Monstra
|
||||||
* @subpackage Plugins
|
* @subpackage Plugins
|
||||||
* @author Romanenko Sergey / Awilum
|
* @author Romanenko Sergey / Awilum
|
||||||
* @copyright 2012-2013 Romanenko Sergey / Awilum
|
* @copyright 2012-2014 Romanenko Sergey / Awilum
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -3,8 +3,8 @@
|
|||||||
return array(
|
return array(
|
||||||
'backup' => array(
|
'backup' => array(
|
||||||
'Backups' => 'Backups',
|
'Backups' => 'Backups',
|
||||||
'Backup date' => 'Backup Datum',
|
'Backup' => 'Backup',
|
||||||
'Create backup' => 'Erstelle Backup',
|
'Create Backup' => 'Erstelle Backup',
|
||||||
'Delete' => 'Löschen',
|
'Delete' => 'Löschen',
|
||||||
'storage' => 'Speicher',
|
'storage' => 'Speicher',
|
||||||
'public' => 'Öffentliche',
|
'public' => 'Öffentliche',
|
||||||
|
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'backup' => array(
|
'backup' => array(
|
||||||
'Backups' => 'Backups',
|
'Backups' => 'Backups',
|
||||||
'Backup date' => 'Backup date',
|
'Backup' => 'Backup',
|
||||||
'Create backup' => 'Create backup',
|
'Backup Date' => 'Backup Date',
|
||||||
'Delete' => 'Delete',
|
'Create Backup' => 'Create Backup',
|
||||||
|
'Restore' => 'Restore',
|
||||||
|
'Delete' => 'Delete',
|
||||||
'storage' => 'storage',
|
'storage' => 'storage',
|
||||||
'public' => 'public',
|
'public' => 'public',
|
||||||
'plugins' => 'plugins',
|
'plugins' => 'plugins',
|
||||||
@@ -13,5 +15,12 @@
|
|||||||
'Actions' => 'Actions',
|
'Actions' => 'Actions',
|
||||||
'Delete backup: :backup' => 'Delete backup: :backup',
|
'Delete backup: :backup' => 'Delete backup: :backup',
|
||||||
'Creating...' => 'Creating...',
|
'Creating...' => 'Creating...',
|
||||||
|
'Backup was created' => 'Backup was created',
|
||||||
|
'Backup was not created' => 'Backup was not created',
|
||||||
|
'Backup was deleted' => 'Backup was deleted',
|
||||||
|
'Backup was not deleted' => 'Backup was not deleted',
|
||||||
|
'Backup was restored' => 'Backup was restored',
|
||||||
|
'Unzip error' => 'Unzip error',
|
||||||
|
'Backup was not restored' => 'Backup was not restored',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
26
plugins/box/backup/languages/es.lang.php
Normal file
26
plugins/box/backup/languages/es.lang.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'backup' => array(
|
||||||
|
'Backups' => 'Backups',
|
||||||
|
'Backup' => 'Backup',
|
||||||
|
'Backup Date' => 'Fecha del backup',
|
||||||
|
'Create Backup' => 'Crear backup',
|
||||||
|
'Restore' => 'Restaurar',
|
||||||
|
'Delete' => 'Eliminar',
|
||||||
|
'storage' => 'Almacenamiento',
|
||||||
|
'public' => 'público',
|
||||||
|
'plugins' => 'plugins',
|
||||||
|
'Size' => 'Tamaño',
|
||||||
|
'Actions' => 'Acciones',
|
||||||
|
'Delete backup: :backup' => 'Eliminar backup: :backup',
|
||||||
|
'Creating...' => 'Creando...',
|
||||||
|
'Backup was created' => 'El backup fue creado',
|
||||||
|
'Backup was not created' => 'El backup no fue creado',
|
||||||
|
'Backup was deleted' => 'El backup fue eliminado',
|
||||||
|
'Backup was not deleted' => 'El backup no fue eliminado',
|
||||||
|
'Backup was restored' => 'El backup fue restaurado',
|
||||||
|
'Unzip error' => 'Error de descompresión',
|
||||||
|
'Backup was not restored' => 'El backup no fue restaurado',
|
||||||
|
)
|
||||||
|
);
|
17
plugins/box/backup/languages/fa.lang.php
Normal file
17
plugins/box/backup/languages/fa.lang.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'backup' => array(
|
||||||
|
'Backups' => 'پشتیبان گیری',
|
||||||
|
'Backup Date' => 'تاریخ پشتیبان گیری',
|
||||||
|
'Create Backup' => 'ایجاد نسخه پشتیبان',
|
||||||
|
'Delete' => 'حذف',
|
||||||
|
'storage' => 'ذخیره سازی',
|
||||||
|
'public' => 'عمومی',
|
||||||
|
'plugins' => 'پلاگین',
|
||||||
|
'Size' => 'اندازه',
|
||||||
|
'Actions' => 'عملیات',
|
||||||
|
'Delete backup: :backup' => 'حذف نسخه پشتیبان: :backup',
|
||||||
|
'Creating...' => 'ایجاد...',
|
||||||
|
)
|
||||||
|
);
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user