mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-10-31 19:02:30 +00:00
Compare commits
588 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bc87751851 | ||
|
b47cd5a598 | ||
|
e6a8f3ddb1 | ||
|
7546a4867c | ||
|
a928dd3a87 | ||
|
4c9df15e2f | ||
|
4f5c286cb3 | ||
|
268d3d22e6 | ||
|
36492e6133 | ||
|
fd6cf51539 | ||
|
e811a10547 | ||
|
55200beae1 | ||
|
25912ad928 | ||
|
f04e6372a6 | ||
|
cc49a14b5d | ||
|
ecc9e19305 | ||
|
d8504a9c9f | ||
|
098aa2f12f | ||
|
998e57afb5 | ||
|
598942f96e | ||
|
accf06131c | ||
|
b9d7f89266 | ||
|
766dbaf26c | ||
|
4cb294d5f2 | ||
|
fc2d0f4938 | ||
|
dd52c09c30 | ||
|
d48fb44e4f | ||
|
680a44f8aa | ||
|
68a1d385f5 | ||
|
8cf588e57f | ||
|
9ec36613e0 | ||
|
ecd90e0f1b | ||
|
c58a8e339d | ||
|
5de3a59349 | ||
|
0da09499f9 | ||
|
35e84fbbcc | ||
|
17fb02680e | ||
|
06c13b6a72 | ||
|
d007d1d29d | ||
|
5ae2866c28 | ||
|
3883eafa37 | ||
|
f8ea546cfe | ||
|
c70b2f70b0 | ||
|
073d3c8b46 | ||
|
6d0f3cbbdb | ||
|
fc4267038c | ||
|
b81f7c48e0 | ||
|
407b768344 | ||
|
8ee3f1ba1a | ||
|
d1e941f581 | ||
|
d452972144 | ||
|
427998ee0d | ||
|
620f535ceb | ||
|
40fec2bdfa | ||
|
d765eabdf6 | ||
|
95d0f86f1e | ||
|
29ca3c8d52 | ||
|
d42f2227d7 | ||
|
84ec6b93e7 | ||
|
bfee41b26d | ||
|
dffe7c53c3 | ||
|
31964a86e9 | ||
|
5ad08ed6e0 | ||
|
51403b36b1 | ||
|
b304552f37 | ||
|
97a74f5b44 | ||
|
362c14774c | ||
|
4dd89a35c7 | ||
|
855fcb03c1 | ||
|
adc32eeb34 | ||
|
f23e5402a7 | ||
|
571d84bb7e | ||
|
821ca1f4eb | ||
|
4f08aee681 | ||
|
f7519475f1 | ||
|
22df3bff56 | ||
|
20b335d918 | ||
|
c477abd151 | ||
|
5aa2f2fde6 | ||
|
45062c9340 | ||
|
9124a2727d | ||
|
0249510c72 | ||
|
b26c00c34d | ||
|
3b155af6e9 | ||
|
8712d4033a | ||
|
0716d5e3e6 | ||
|
a96ef51de4 | ||
|
68c634976f | ||
|
df58b4c93c | ||
|
fed4615abd | ||
|
5fbb9634da | ||
|
683168e8e4 | ||
|
685435e87d | ||
|
44b1683d18 | ||
|
98d9d21255 | ||
|
a012bc7b63 | ||
|
ea64e3777c | ||
|
b69a91491f | ||
|
802cff4ae8 | ||
|
5f8f6cc0cc | ||
|
afa9df617b | ||
|
83c8202374 | ||
|
8574a4f3cf | ||
|
84df598015 | ||
|
08e6da7006 | ||
|
ffc012d56a | ||
|
9bc1752ca5 | ||
|
c9d4f57cea | ||
|
bb7343450b | ||
|
d0ff882375 | ||
|
50ee6f5a34 | ||
|
c9cae3de4e | ||
|
e69347e255 | ||
|
8b9ab398a9 | ||
|
6243927ffd | ||
|
e8a9d563af | ||
|
ef9e8f4198 | ||
|
84a5009952 | ||
|
1ad63abd54 | ||
|
2ebe811b60 | ||
|
84a98f9718 | ||
|
06bc161692 | ||
|
3cd419ff67 | ||
|
725464800f | ||
|
58fa74a1a2 | ||
|
7e9269d993 | ||
|
b6e084a828 | ||
|
da554cbac7 | ||
|
9b30cedb4d | ||
|
db0bfa95b9 | ||
|
4f33935200 | ||
|
3151bf9c8f | ||
|
75684b9918 | ||
|
9b6e02a384 | ||
|
99f239c8a5 | ||
|
3389bf4902 | ||
|
12498eb311 | ||
|
b68ab0f2bd | ||
|
60557d4f88 | ||
|
02865f3574 | ||
|
c6eac62828 | ||
|
dd7c338448 | ||
|
f30e456ee0 | ||
|
76ec0b8ca6 | ||
|
4c23724ddd | ||
|
bf250e5a62 | ||
|
300460adc8 | ||
|
6b6926d0ab | ||
|
efc3e398d6 | ||
|
41c8206509 | ||
|
26cec36c12 | ||
|
3a32a86772 | ||
|
d463447043 | ||
|
107a3f1a92 | ||
|
bd2e3360d6 | ||
|
7e832b98c5 | ||
|
0f911271bf | ||
|
698928a287 | ||
|
3df6255489 | ||
|
f1f0fffb1c | ||
|
506513ae37 | ||
|
23e07f6cae | ||
|
9e56646abc | ||
|
4b7480f54a | ||
|
e54849f018 | ||
|
0d5021838e | ||
|
5bb713b157 | ||
|
1d4988a25b | ||
|
25bfe2a92e | ||
|
cc7df89721 | ||
|
b0178665d2 | ||
|
0f4632baea | ||
|
b9b7d20ec0 | ||
|
d4a03c2d55 | ||
|
7a0c15a453 | ||
|
95bd6c9c2e | ||
|
f7691ed50d | ||
|
b01cde83c1 | ||
|
3f1a5e3a8d | ||
|
3f29687165 | ||
|
df8d9da962 | ||
|
9f56672c35 | ||
|
1463cd26df | ||
|
29f652a452 | ||
|
6c67d8a9fd | ||
|
ef4415edf1 | ||
|
67cfd94d3e | ||
|
44b155f700 | ||
|
566d2a8350 | ||
|
d06e41c17c | ||
|
e6c0db6275 | ||
|
516252c286 | ||
|
ced791e351 | ||
|
5178381b51 | ||
|
d4cdc056bb | ||
|
2ed39bcc36 | ||
|
155a17cf08 | ||
|
5f461d7a37 | ||
|
a6fe011d05 | ||
|
572eebbfc4 | ||
|
e6a50f1fdb | ||
|
c0d7a9407f | ||
|
6caa06509b | ||
|
0e5dc69bc1 | ||
|
bf25b8e764 | ||
|
b7a90bad2c | ||
|
896efa4a6a | ||
|
5bbbf6904d | ||
|
3037c4007f | ||
|
1431b671d5 | ||
|
ba775ea531 | ||
|
bb4b0bfb46 | ||
|
f44c951a86 | ||
|
6f83dbc6f4 | ||
|
3cf373b43c | ||
|
489cc73c99 | ||
|
143fef691b | ||
|
3548e9f9e0 | ||
|
ab6125be50 | ||
|
ede97061b7 | ||
|
f158889d94 | ||
|
6eb07c1e40 | ||
|
b1b7ff4325 | ||
|
ca12a1baee | ||
|
e495804688 | ||
|
3322e761b5 | ||
|
9a754e4484 | ||
|
e76489b19c | ||
|
3042a7e918 | ||
|
d58e03e3d2 | ||
|
41cebd1b24 | ||
|
5241470c5e | ||
|
3f6f2396cd | ||
|
f470766616 | ||
|
c15fd94d46 | ||
|
97d3c26513 | ||
|
64a377e570 | ||
|
cfd842f5e4 | ||
|
0af9354e1e | ||
|
70012793dc | ||
|
ed336b0466 | ||
|
50f6900439 | ||
|
2b3ec8fdb3 | ||
|
8ef77771e7 | ||
|
42fdd5b4cc | ||
|
c4a202ade1 | ||
|
8416e19d63 | ||
|
b97d472f8f | ||
|
4332a3d7b4 | ||
|
0d11295440 | ||
|
d09319ad78 | ||
|
fc32eea69e | ||
|
778a84e568 | ||
|
afa26265d8 | ||
|
a258f6aa61 | ||
|
bbef568eb8 | ||
|
00ddf5b2e6 | ||
|
93f8892458 | ||
|
aa0a41abe7 | ||
|
4123437d72 | ||
|
5a8135fc3c | ||
|
353300bc2f | ||
|
3fc4d984d1 | ||
|
c2b4bd1dc7 | ||
|
e4a0b0fc41 | ||
|
74b200a632 | ||
|
1680ec7b49 | ||
|
ddfa026180 | ||
|
77d2b1fbf9 | ||
|
8688bfd9cc | ||
|
276c32922e | ||
|
1fd0653eb6 | ||
|
5270b206cc | ||
|
258f337d59 | ||
|
40f0b35013 | ||
|
cff91ba244 | ||
|
d353ec9833 | ||
|
7faa44cdb8 | ||
|
0af518e0f3 | ||
|
3514f29bda | ||
|
a3f6281bd4 | ||
|
8b6db18948 | ||
bf118c40df | |||
|
d840a7f50b | ||
|
778d7aa96b | ||
|
5bc5e45624 | ||
|
4ee799c41c | ||
|
9fb8d3e6fb | ||
|
d2ae0fb830 | ||
|
55f2b835ec | ||
|
b9b95daccc | ||
|
9116cae63d | ||
|
2b636f5427 | ||
|
a44cb31365 | ||
|
3d6cfeef14 | ||
|
c8108bc9eb | ||
|
9c93c7f3ca | ||
|
dca5255169 | ||
|
36c813e759 | ||
|
625ac8316f | ||
|
1ba516bc9f | ||
|
af78c83357 | ||
|
51a9d7f7ca | ||
|
7298ebe146 | ||
|
681ae25b3d | ||
|
2fb0d78ebb | ||
|
25ca0879d9 | ||
|
38d6fb0ec4 | ||
|
777a17f397 | ||
|
24647f6e0e | ||
|
ae8e62c1bc | ||
|
8585bd5300 | ||
|
9a1b7bb893 | ||
|
c279ea86a2 | ||
|
9128775f35 | ||
|
93de9a852e | ||
|
2f8341a00b | ||
|
3499cabd8d | ||
|
74d113ea70 | ||
|
74852b9e18 | ||
|
82da7785a3 | ||
|
6f215297f2 | ||
|
00448623c1 | ||
|
7cfc901fc1 | ||
|
f98b43d789 | ||
|
8e03b129a0 | ||
|
b575a7a346 | ||
|
47af24cdb4 | ||
|
fde1d3618c | ||
|
789f5ca534 | ||
|
6de0dcdb7a | ||
|
fe3962bd23 | ||
|
94dbf20963 | ||
|
7bfa0200f1 | ||
|
80695d0ce3 | ||
|
ce4e1bae4e | ||
|
a26ee4a552 | ||
|
74ce09dda3 | ||
|
6234b9bc8c | ||
|
3214782cf1 | ||
|
56807170f4 | ||
|
4730e9a15a | ||
|
23dcb2a748 | ||
|
b4482e166c | ||
|
9a3bd0c904 | ||
|
4838aa668a | ||
|
8404915409 | ||
|
4596d0c77a | ||
|
6cd0429107 | ||
|
8f464fc91b | ||
|
c9ab22cdf0 | ||
|
52daec90df | ||
|
352b17a3f8 | ||
|
5a5f2b3f73 | ||
|
f1de317317 | ||
|
44be385447 | ||
|
63313389ce | ||
|
73230a4543 | ||
|
7c13b8f488 | ||
|
c07f0d03b7 | ||
|
352e063196 | ||
|
4bd9ce6fec | ||
|
e3e90a2916 | ||
|
06bbd1f093 | ||
|
a429e7cdde | ||
|
6e3b42ea0e | ||
|
01bc962a67 | ||
|
7ea2741520 | ||
|
a79603b994 | ||
|
277ff5c803 | ||
|
cf95385242 | ||
|
6a2955b388 | ||
|
8fd6f1d0e4 | ||
|
d902a88504 | ||
|
84edc8552f | ||
|
2536ca5a6c | ||
|
c811166a7f | ||
|
3d563da619 | ||
|
5e9b7211b2 | ||
|
2caddabe5d | ||
|
9b9603b089 | ||
|
e3bb16c086 | ||
|
e216308f31 | ||
|
533ab019c0 | ||
|
65f544cda1 | ||
|
92dc96881e | ||
|
7c4c3d564d | ||
|
49ad05a930 | ||
|
f913a99a87 | ||
|
16e02d58c4 | ||
|
35e3f1f18a | ||
|
931f1b0e59 | ||
|
3683dfb0a7 | ||
|
dc67401e70 | ||
|
585ce49eaf | ||
|
fa3151900e | ||
|
b18e1a862a | ||
|
8bafcf32c1 | ||
|
33583c8afc | ||
|
7f91f78d11 | ||
|
28ab09ae12 | ||
|
ed8d237816 | ||
|
0c8e3929f7 | ||
|
24552b5e29 | ||
|
6e78edfd2f | ||
|
ba916e5e0e | ||
|
3902ca6332 | ||
|
092ea0328d | ||
|
fb37930a93 | ||
|
ab8dbab01a | ||
|
b1c3dee301 | ||
|
24529c48dd | ||
|
bd8d3ed69e | ||
|
a87cdbd70b | ||
|
4896d5c6e2 | ||
|
da61ac9fe3 | ||
|
0c4c17763e | ||
|
75c309e843 | ||
|
ab8116ccc3 | ||
|
2e91df1c07 | ||
|
d4b80d8ae8 | ||
|
b9d54a1b0a | ||
|
19538a6321 | ||
|
58bf6f8f11 | ||
|
a25d3540af | ||
|
b471903a06 | ||
|
8aac8bf174 | ||
|
8278e96032 | ||
|
c41b53afd8 | ||
|
74f35976a7 | ||
|
dbcb20bff7 | ||
|
7fb20c1630 | ||
|
3f6288b460 | ||
|
78591bdaa6 | ||
|
e1163303bd | ||
|
86e4f0cbe0 | ||
|
d80c21024e | ||
|
fbb4fe63e6 | ||
|
7603c82c0f | ||
|
68c6864021 | ||
|
3c46c84ed1 | ||
|
3f6f869f3d | ||
|
caf010ce4b | ||
|
6f115b1221 | ||
|
6562fd304a | ||
|
28d96c315d | ||
|
204da25f16 | ||
|
b00a245253 | ||
|
f5ee9e9cc7 | ||
|
d41d5c7935 | ||
|
92fff6966d | ||
|
577933c5f8 | ||
|
6bacebcaff | ||
|
02678e65ba | ||
|
7acb192136 | ||
|
15887b9bf0 | ||
|
7a2aca3b9a | ||
|
f944819f3e | ||
|
a80e3ab53c | ||
|
46f42ceb73 | ||
|
d42948bd48 | ||
|
2135f26ea0 | ||
|
0513bdd03f | ||
|
6352c630ce | ||
|
08c2f8b641 | ||
|
2b369b1cff | ||
|
ec02c4f2e6 | ||
|
3e268d0626 | ||
|
c3da104011 | ||
|
f7966408b5 | ||
|
88cff10f0b | ||
|
35840637b8 | ||
|
b3d4ecf6a3 | ||
|
04216cf96d | ||
|
930f4213dd | ||
|
65eae0986c | ||
|
4c6ff1777b | ||
|
5374929e52 | ||
|
9716197fdb | ||
|
1f19991696 | ||
|
32df1efcb2 | ||
|
e308a08642 | ||
|
a0d68ab93b | ||
|
88d25172ca | ||
|
8ccb881d66 | ||
|
8252c35dad | ||
|
8717ae7720 | ||
|
07a7fbbc6a | ||
|
e1ed479219 | ||
|
d771cc8704 | ||
|
f1a532bd38 | ||
|
f32e369137 | ||
|
d3dcadfd2d | ||
|
d92c25b701 | ||
|
e17fba993a | ||
|
cb1a9ae1af | ||
|
4e75b75e51 | ||
|
1e485ebc90 | ||
|
6964d365f0 | ||
|
0a984f778b | ||
|
0910b638a6 | ||
|
4951f7af4a | ||
|
5043ce7681 | ||
|
156b7ec117 | ||
|
667b601185 | ||
|
15a42f5f35 | ||
|
21e9b9682c | ||
|
16b8a8bb49 | ||
|
2c972b3bff | ||
|
346a956e06 | ||
|
752353cb31 | ||
|
64870c54d3 | ||
|
e757e3b96f | ||
|
1a9e2de216 | ||
|
dd71f1efa5 | ||
|
886fe7f997 | ||
|
4b488d6944 | ||
|
f9a0aec0d0 | ||
|
5b6740851e | ||
|
b7b82620cf | ||
|
1dbc7f7c79 | ||
|
c3893e725a | ||
|
f150013651 | ||
|
9569f79aff | ||
|
d49f6d4583 | ||
|
6a7dd1948e | ||
|
0d46dab534 | ||
|
7a5964e8dd | ||
|
13d19ebe42 | ||
|
9cf9399aa7 | ||
|
ee6f6c7d5b | ||
|
87adcbc645 | ||
|
40e4617018 | ||
|
0e35b4deec | ||
|
b5ba7a679e | ||
|
0318b29192 | ||
|
daabd4ced5 | ||
|
bbf005c6a6 | ||
|
00bfb863ff | ||
|
39ea10544a | ||
|
6eff076427 | ||
|
8d486b9145 | ||
|
9f6e29686d | ||
|
6ba6f205bb | ||
|
3938c8fd7a | ||
|
42ec255422 | ||
|
8b0c36d93e | ||
|
36499e5533 | ||
|
55d314eae5 | ||
|
5c577e130b | ||
|
1bc42cfdbc | ||
|
5ed5193149 | ||
|
df1575ee73 | ||
|
dc8cbb11e2 | ||
|
3d6e027f5e | ||
|
59478ebb2e | ||
|
222922033b | ||
|
fdb3d15415 | ||
|
fe9edb142f | ||
|
d25d3ff034 | ||
|
17d223b4c1 | ||
|
0a29b6c0d5 | ||
|
c23179f1c7 | ||
|
9a3c345e05 | ||
|
582ad8d6cf | ||
|
e833da56e3 | ||
|
620fdb8116 | ||
|
ab2fab5a80 | ||
|
f6b614c6ad | ||
|
a8da38ee67 | ||
|
3a83f2d483 | ||
|
7a2be06b9e | ||
|
1f0e75d884 | ||
|
918e3c568f | ||
|
f01b5a1087 | ||
|
917035dec1 | ||
|
75a29c3f28 | ||
|
047ab2e69b | ||
|
d3b6aefe14 | ||
|
dfad65b093 | ||
|
f8e87d5689 | ||
|
8dbc42e45b | ||
|
c0a45f9a40 | ||
|
ebe945ff98 | ||
|
58ec6fef01 | ||
|
5ceb760b54 | ||
|
70ba37b96e | ||
|
8bac55b871 |
51
.drone.yml
Normal file
51
.drone.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: weblinks-codeception-tests
|
||||||
|
image: joomlaprojects/docker-systemtests:latest
|
||||||
|
commands:
|
||||||
|
- composer install
|
||||||
|
- chmod a+x .drone/build.sh
|
||||||
|
- ./.drone/build.sh
|
||||||
|
- apache2ctl start
|
||||||
|
- service mysql start
|
||||||
|
- cd /tests/www
|
||||||
|
- export DISPLAY=:0
|
||||||
|
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
|
||||||
|
- sleep 3
|
||||||
|
- fluxbox > /dev/null 2>&1 &
|
||||||
|
- vendor/bin/robo run:tests
|
||||||
|
|
||||||
|
- name: artifacts-system-tests
|
||||||
|
image: cschlosser/drone-ftps
|
||||||
|
depends_on: [ weblinks-codeception-tests ]
|
||||||
|
environment:
|
||||||
|
FTP_USERNAME:
|
||||||
|
from_secret: ftpusername
|
||||||
|
FTP_PASSWORD:
|
||||||
|
from_secret: ftppassword
|
||||||
|
PLUGIN_HOSTNAME: ci.joomla.org:21
|
||||||
|
PLUGIN_SRC_DIR: /tests/_output/
|
||||||
|
PLUGIN_DEST_DIR: /artifacts
|
||||||
|
PLUGIN_SECURE: false
|
||||||
|
PLUGIN_EXCLUDE: ^\.git/$
|
||||||
|
commands:
|
||||||
|
- export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST_$DRONE_BUILD_NUMBER/system-tests
|
||||||
|
- echo https://ci.joomla.org:444$PLUGIN_DEST_DIR
|
||||||
|
- /bin/upload.sh
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- failure
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: weblinks_cache
|
||||||
|
host:
|
||||||
|
path: /tmp/weblinks_cache
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: signature
|
||||||
|
hmac: 9346f0e74d2605ebe7bc9d33ad0588c1073ba3a9d9b254b71a7a85e219089449
|
||||||
|
|
||||||
|
...
|
32
.drone/build.sh
Normal file
32
.drone/build.sh
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
VERSION="$(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
|
echo "Started building at $(date) - $(whoami)"
|
||||||
|
|
||||||
|
# Update composer
|
||||||
|
composer self-update
|
||||||
|
|
||||||
|
# show directory listing
|
||||||
|
ls -al
|
||||||
|
ls -al vendor
|
||||||
|
mount
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
composer install --no-interaction --no-progress
|
||||||
|
|
||||||
|
mkdir -p /tests/www
|
||||||
|
cp -r ./* /tests/www
|
||||||
|
|
||||||
|
cd /tests/www
|
||||||
|
|
||||||
|
cp jorobo.dist.ini jorobo.ini
|
||||||
|
cp RoboFile.dist.ini RoboFile.ini
|
||||||
|
|
||||||
|
# Build package
|
||||||
|
vendor/bin/robo build --dev
|
||||||
|
|
||||||
|
# Copy acceptance yml
|
||||||
|
cp tests/acceptance.suite.dist.yml tests/acceptance.suite.yml
|
||||||
|
|
||||||
|
chown -R www-data .
|
||||||
|
chown -R www-data /tests
|
17
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
17
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
@ -29,19 +29,12 @@ If you find any new bugs, or want to raise any type of support issue, please use
|
|||||||
|
|
||||||
## Release Procedure
|
## Release Procedure
|
||||||
|
|
||||||
This is the procedure and checklist for creating a new package.
|
This is the procedure and checklist for creating a new package:
|
||||||
|
|
||||||
* Update the version number in `build.ini`.
|
* Update the version number in `jorobo.ini`
|
||||||
* Run `phing set-version`.
|
* Modify `jorobo.ini`, add your GitHub token and add ` Release` after `Package`
|
||||||
* Pun `phing` to make the new package for the version.
|
* Run `robo build` to make the new package and auto-upload and release it on GitHub.
|
||||||
* Run `phing tag`.
|
* Go to the releases page on GitHub, review the Changelog and change the status from Pre-Release to Stable.
|
||||||
* Push the commits and tags up to Github.
|
|
||||||
* Go to the releases page on Github.
|
|
||||||
* Click on the new tag.
|
|
||||||
- Click the `Edit Tag` button.
|
|
||||||
- Fill in the title and description for the release.
|
|
||||||
- Attach the zip-file for the package to the release. Wait for the file to complete uploading!
|
|
||||||
- Click the `Publish Release` button.
|
|
||||||
* Create a new `<update>` tag in the `manifest.xml` file.
|
* Create a new `<update>` tag in the `manifest.xml` file.
|
||||||
- Change the `<version>` tag to the new version.
|
- Change the `<version>` tag to the new version.
|
||||||
- Change the `<downloadurl>` tag to match the URL of the new release.
|
- Change the `<downloadurl>` tag to match the URL of the new release.
|
18
.github/ISSUE_TEMPLATE.md
vendored
Normal file
18
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
### Steps to reproduce the issue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Expected result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Actual result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### System information (as much as possible)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Additional comments
|
||||||
|
|
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
Pull Request for Issue # .
|
||||||
|
|
||||||
|
### Summary of Changes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Testing Instructions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Expected result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Actual result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation Changes Required
|
||||||
|
|
62
.gitignore
vendored
62
.gitignore
vendored
@ -1,4 +1,64 @@
|
|||||||
.idea
|
# Builds
|
||||||
build
|
build
|
||||||
releases
|
releases
|
||||||
|
|
||||||
|
# OSX
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# PHPStorm
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Sublime Text
|
||||||
|
*.sublime*
|
||||||
|
|
||||||
|
# Eclipse
|
||||||
|
.buildpath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
|
||||||
|
# Temp files
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Phing
|
||||||
|
build.properties
|
||||||
|
phing-latest.phar
|
||||||
|
|
||||||
|
# Github pages and Jekyll files
|
||||||
|
/_site/
|
||||||
|
/Gemfile
|
||||||
|
/Gemfile.lock
|
||||||
|
|
||||||
|
# composer
|
||||||
|
composer.phar
|
||||||
|
vendor/*
|
||||||
|
|
||||||
|
# Robo
|
||||||
|
robo.phar
|
||||||
|
RoboFile.ini
|
||||||
|
|
||||||
|
# Test related files
|
||||||
|
tests/acceptance.suite.yml
|
||||||
|
tests/*/*Tester.php
|
||||||
|
tests/_support/_generated/*TesterActions.php
|
||||||
|
tests/joomla*
|
||||||
|
tests/_output*
|
||||||
|
selenium-server-standalone.jar
|
||||||
|
codecept.phar
|
||||||
|
selenium.log
|
||||||
|
tests/cache
|
||||||
|
|
||||||
|
# Package building related
|
||||||
|
/dist
|
||||||
|
jorobo.ini
|
||||||
|
|
||||||
|
54
.travis.yml
Normal file
54
.travis.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
sudo: true
|
||||||
|
language: php
|
||||||
|
services:
|
||||||
|
- xvfb
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- RUN_PHPCS="no"
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
include:
|
||||||
|
- php: 5.6
|
||||||
|
env: RUN_PHPCS="yes"
|
||||||
|
- php: 7.0
|
||||||
|
sudo: true
|
||||||
|
addons:
|
||||||
|
firefox: 'latest-esr'
|
||||||
|
- php: 7.1
|
||||||
|
- php: 7.2
|
||||||
|
- php: 7.3
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
# Forcing localhost in hosts file
|
||||||
|
- sudo sed -i '1s/^/127.0.0.1 localhost\n/' /etc/hosts
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -y --force-yes apache2 libapache2-mod-fastcgi > /dev/null
|
||||||
|
- sudo mkdir $(pwd)/.run
|
||||||
|
- chmod a+x tests/travis-php-fpm.sh
|
||||||
|
- sudo ./tests/travis-php-fpm.sh $USER $(phpenv version-name)
|
||||||
|
- sudo a2enmod rewrite actions fastcgi alias
|
||||||
|
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||||
|
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
||||||
|
- sudo cp -f tests/travis-ci-apache.conf /etc/apache2/sites-available/default
|
||||||
|
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
|
||||||
|
- sudo sed -e "s?%PHPVERSION%?${TRAVIS_PHP_VERSION:0:1}?g" --in-place /etc/apache2/sites-available/default
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
- sudo service apache2 restart
|
||||||
|
# Fluxbox
|
||||||
|
- sudo apt-get install fluxbox -y --force-yes
|
||||||
|
- fluxbox &
|
||||||
|
- sleep 3 # give fluxbox some time to start
|
||||||
|
# Composer
|
||||||
|
- composer install
|
||||||
|
|
||||||
|
script:
|
||||||
|
# Build
|
||||||
|
- mv jorobo.dist.ini jorobo.ini
|
||||||
|
- vendor/bin/robo build
|
||||||
|
# System tests (Codeception)
|
||||||
|
- mv tests/acceptance.suite.dist.yml tests/acceptance.suite.yml
|
||||||
|
- vendor/bin/robo run:tests --use-htaccess
|
||||||
|
# Run phpcs on PHP 5.6 against weblinks source
|
||||||
|
- if [[ $RUN_PHPCS == "yes" ]]; then vendor/bin/phpcs --report=full --extensions=php -p --standard=tests/joomla/build/phpcs/Joomla ./src; fi
|
32
CHANGELOG.md
Normal file
32
CHANGELOG.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
#### 3.7.0
|
||||||
|
|
||||||
|
* Use correct database *2019-08-10*
|
||||||
|
* Move to namespaces *2019-08-10*
|
||||||
|
* First imageignores image float setting366 *2019-08-10*
|
||||||
|
* Changed language strings so that the parameter "image float" in the config is more concrete *2019-08-10*
|
||||||
|
* Improved the Batch view of com_weblinks *2019-08-10*
|
||||||
|
* add Jorobo Map Task To RoboFile *2019-08-10*
|
||||||
|
* makeSameAliasPossibleForDifferentLanguages *2019-08-10*
|
||||||
|
* mapping of new media files was not correct because of this you see the warning "JInstaller: :Install: File does not exist /var/www/html/weblinksecht/weblinks/tests/joomla/tmp/media/js" while installing *2019-08-10*
|
||||||
|
* Delete jed_update.xml *2019-08-10*
|
||||||
|
* xml code-style *2019-08-10*
|
||||||
|
* typo *2019-08-10*
|
||||||
|
* Serve updates through the downloads site *2019-08-10*
|
||||||
|
* Implementing full associations for single weblink *2019-08-10*
|
||||||
|
* Update composer *2019-08-10*
|
||||||
|
* Use correct database *2019-08-10*
|
||||||
|
* Move to namespaces *2019-08-10*
|
||||||
|
* First imageignores image float setting366 *2019-08-10*
|
||||||
|
* Changed language strings so that the parameter "image float" in the config is more concrete *2019-08-10*
|
||||||
|
* Improved the Batch view of com_weblinks *2019-08-10*
|
||||||
|
* add Jorobo Map Task To RoboFile *2019-08-10*
|
||||||
|
* makeSameAliasPossibleForDifferentLanguages *2019-08-10*
|
||||||
|
* mapping of new media files was not correct because of this you see the warning "JInstaller: :Install: File does not exist /var/www/html/weblinksecht/weblinks/tests/joomla/tmp/media/js" while installing *2019-08-10*
|
||||||
|
* Delete jed_update.xml *2019-08-10*
|
||||||
|
* xml code-style *2019-08-10*
|
||||||
|
* typo *2019-08-10*
|
||||||
|
* Serve updates through the downloads site *2019-08-10*
|
||||||
|
* Implementing full associations for single weblink *2019-08-10*
|
||||||
|
* Update composer *2019-08-10*
|
332
README.md
332
README.md
@ -1,3 +1,333 @@
|
|||||||
# Weblinks for Joomla!
|
# Weblinks for Joomla!
|
||||||
|
|
||||||
This is a prototype for isolating the Joomla's Weblinks suite of extensions and managing it as a standalone extension.
|
Build Status
|
||||||
|
---------------------
|
||||||
|
| Drone-CI |
|
||||||
|
| ------------- |
|
||||||
|
| [![Build Status](https://ci.joomla.org/api/badges/joomla-extensions/weblinks/status.svg)](https://ci.joomla.org/joomla-extensions/weblinks) |
|
||||||
|
|
||||||
|
Weblinks for Joomla! provides a component and accompanying extensions to create a directory of weblinks.
|
||||||
|
|
||||||
|
# How to test a PR
|
||||||
|
|
||||||
|
## With the [Patch Tester Component](https://github.com/joomla-extensions/patchtester/releases/latest)
|
||||||
|
|
||||||
|
|
||||||
|
Easily apply changes from a pull requests against this repo:
|
||||||
|
Install the last release of [com_weblinks](https://github.com/joomla-extensions/weblinks/releases/latest) into your Joomla.
|
||||||
|
Install the last release of [com_patchtester](https://github.com/joomla-extensions/patchtester/releases/latest) into your Joomla (weblinks is supported since Version 3.0.0 Alpha 2).
|
||||||
|
Log into your site's administrator section, go to the Patch Tester Component Options (Components -> Patch Tester -> Options)
|
||||||
|
Switch the `GitHub Repository` to `Joomla Weblinks Package`. For this you have to fill the field `GitHub Project Owner` with `joomla-extensions` and the field `GitHub Project Repository` with `weblinks`.
|
||||||
|
Click `Save & Close` and hit the `Fetch Data` Button to the the lastest pull requests
|
||||||
|
Click `Apply Patch` to apply the proposed changes from the pull request.
|
||||||
|
Click `Revert Patch` to revert an applied patch.
|
||||||
|
|
||||||
|
You can read more about the Patch Tester extension on the [Joomla! Documentation Wiki](https://docs.joomla.org/Component_Patchtester_for_Testers).
|
||||||
|
|
||||||
|
## With Github
|
||||||
|
|
||||||
|
|
||||||
|
If you want to test a patch you can apply the patch via git.
|
||||||
|
|
||||||
|
If you cloned this repo under the name upstream - your remote is upstream – you can user the command
|
||||||
|
|
||||||
|
```
|
||||||
|
git fetch upstream pull/PR_NUMBER/head:BRANCHNUMER
|
||||||
|
```
|
||||||
|
|
||||||
|
for fetching the branch of the PR https://github.com/joomla-extensions/weblinks/pull/290 this would be
|
||||||
|
|
||||||
|
```
|
||||||
|
git fetch upstream pull/290/head:move-lang-files
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
After that you can checkout the branch and start testing.
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout move-lang-files
|
||||||
|
```
|
||||||
|
|
||||||
|
# For Linux
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
|
||||||
|
### 1. Open a session and change to the document root of your local webserver.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd /var/www/html/
|
||||||
|
/var/www/html$
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 2. Clone the current repository into your webserver root folder
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html$ git clone git@github.com:joomla-extensions/weblinks.git
|
||||||
|
Clone nach 'weblinks' ...
|
||||||
|
remote: Counting objects: 2446, done.
|
||||||
|
remote: Compressing objects: 100% (75/75), done.
|
||||||
|
remote: Total 2446 (delta 10), reused 0 (delta 0), pack-reused 2361
|
||||||
|
Empfange Objekte: 100% (2446/2446), 615.02 KiB | 375.00 KiB/s, Fertig.
|
||||||
|
Löse Unterschiede auf: 100% (1232/1232), Fertig.
|
||||||
|
Prüfe Konnektivität ... Fertig.
|
||||||
|
```
|
||||||
|
|
||||||
|
Are you new with github? Here you can find informations about setting it up: https://help.github.com/articles/set-up-git/
|
||||||
|
If you get an error you can try git clone https://github.com:joomla-extensions/weblinks.git instead of git clone git@github.com:joomla-extensions/weblinks.git
|
||||||
|
|
||||||
|
|
||||||
|
### 3. Change to the directory weblinks
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html$ cd weblinks
|
||||||
|
/var/www/html/weblinks$
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 4. This files should be in your weblinks folder.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ ls
|
||||||
|
codeception.yml docs LICENSE RoboFile.dist.ini tests
|
||||||
|
composer.json jed_update.xml manifest.xml RoboFile.php
|
||||||
|
composer.lock jorobo.dist.ini README.md src
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 5. Optional: Have a look into composer.json for information what software you will install via composer.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ cat composer.json
|
||||||
|
```
|
||||||
|
|
||||||
|
or https://github.com/joomla-extensions/weblinks/blob/master/composer.json
|
||||||
|
|
||||||
|
|
||||||
|
Read more about [how to install composer](https://getcomposer.org/doc/00-intro.md) here.
|
||||||
|
|
||||||
|
|
||||||
|
### 6. Optional: If you have problems using composer set a timeout.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$export COMPOSER_PROCESS_TIMEOUT=1500;
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 7. Install via composer
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ composer install
|
||||||
|
Loading composer repositories with package information
|
||||||
|
Installing dependencies (including require-dev) from lock file
|
||||||
|
- Installing symfony/yaml (v3.1.3)
|
||||||
|
Downloading: 100%
|
||||||
|
...
|
||||||
|
...
|
||||||
|
Generating autoload files
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 8. After that you have to build [robo](http://robotframework.org/)
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ vendor/bin/robo build
|
||||||
|
```
|
||||||
|
|
||||||
|
### 9. Optional: Prepare the database
|
||||||
|
If you use MySQL or PostgreSQL as database and your user has create database privileges the Database is automatically created by the Joomla installer.
|
||||||
|
But the safest way is to create the database before running Joomla's web installer.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ mysql -u root -p
|
||||||
|
|
||||||
|
mysql> create database weblinks;
|
||||||
|
Query OK, 1 row affected (0,00 sec)
|
||||||
|
|
||||||
|
mysql> quit;
|
||||||
|
Bye
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 10. Copy the file acceptance.suite.dist.yml into acceptance.suite.dist.yml
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ cd tests
|
||||||
|
/var/www/html/weblinks/tests$ cp acceptance.suite.dist.yml acceptance.suite.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 11. Update the file acceptance.suite.yml to your needs. At least you have to update the options url, database name and counter_test_url.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks/tests$ cat acceptance.suite.yml
|
||||||
|
|
||||||
|
class_name: AcceptanceTester
|
||||||
|
modules:
|
||||||
|
enabled:
|
||||||
|
- JoomlaBrowser
|
||||||
|
- AcceptanceHelper
|
||||||
|
config:
|
||||||
|
JoomlaBrowser:
|
||||||
|
url: 'http://localhost/weblinks/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms
|
||||||
|
browser: 'firefox'
|
||||||
|
window_size: 1024x768
|
||||||
|
capabilities:
|
||||||
|
unexpectedAlertBehaviour: 'accept'
|
||||||
|
username: 'admin' # UserName for the Administrator
|
||||||
|
password: 'admin' # Password for the Administrator
|
||||||
|
database host: 'localhost' # place where the Application is Hosted #server Address
|
||||||
|
database user: 'root' # MySQL Server user ID, usually root
|
||||||
|
database password: 'yourPassword' # MySQL Server password, usually empty or root
|
||||||
|
database name: 'weblinks' # DB Name, at the Server
|
||||||
|
database type: 'mysqli' # type in lowercase one of the options: MySQL\MySQLi\PDO
|
||||||
|
database prefix: 'jos_' # DB Prefix for tables
|
||||||
|
install sample data: 'no' # Do you want to Download the Sample Data Along with Joomla Installation, then keep it Yes
|
||||||
|
sample data: 'Default English (GB) Sample Data' # Default Sample Data
|
||||||
|
admin email: 'admin@mydomain.com' # email Id of the Admin
|
||||||
|
language: 'English (United Kingdom)' # Language in which you want the Application to be Installed
|
||||||
|
AcceptanceHelper:
|
||||||
|
repo_folder: '/home/travis/build/joomla-extensions/weblinks/' # Path to the Extension repository. To be used by tests to install via Install from folder
|
||||||
|
counter_test_url: 'http://localhost/weblinks/tests/joomla-cms3' # the url for the weblink item used to test hits counter
|
||||||
|
url: 'http://localhost/weblinks/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here
|
||||||
|
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
|
||||||
|
env:
|
||||||
|
desktop: ~
|
||||||
|
tablet:
|
||||||
|
modules:
|
||||||
|
config:
|
||||||
|
JoomlaBrowser:
|
||||||
|
window_size: 768x1024
|
||||||
|
phone:
|
||||||
|
modules:
|
||||||
|
config:
|
||||||
|
JoomlaBrowser:
|
||||||
|
window_size: 480x640
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 12. Optional: Go back to weblinks directory and create and edit the file RoboFile.ini. Delete the local user www-data.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ cp RoboFile.dist.ini RoboFile.ini
|
||||||
|
/var/www/html/weblinks$ cat RoboFile.ini
|
||||||
|
; If set to true, the repo will not be cloned from GitHub and the local copy will be reused.
|
||||||
|
; This setting will be obsolete once we have local Git cache enabled
|
||||||
|
skipClone = false
|
||||||
|
|
||||||
|
; If you want to setup your test website in a different folder, you can do that here.
|
||||||
|
; You can also set an absolute path, i.e. /path/to/my/cms/folder
|
||||||
|
cmsPath = tests/joomla-cms3
|
||||||
|
|
||||||
|
; If you want to clone a different branch, you can set it here
|
||||||
|
branch = 3.10-dev
|
||||||
|
|
||||||
|
; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.
|
||||||
|
localUser =
|
||||||
|
|
||||||
|
; Set this to true, if your curl binaries are not able to create an https connection
|
||||||
|
insecure = false
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 13. Optional: Set use owner of the project to your user.
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$sudo chown -R username:usergroup /var/www
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 14. Ready! Run the first tests:
|
||||||
|
|
||||||
|
```
|
||||||
|
/var/www/html/weblinks$ vendor/bin/robo run:tests
|
||||||
|
Clone nach 'tests/cache' ...
|
||||||
|
[Exec] Done in 13.18s
|
||||||
|
[FileSystem\CopyDir] Copied from tests/cache to tests/joomla-cms3
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
The tests in Weblinks Extension use Codeception Testing Framework, if you want to know more about the technology used for testing please check: [Testing Joomla Extensions with Codeception](https://docs.joomla.org/Testing_Joomla_Extensions_with_Codeception).
|
||||||
|
|
||||||
|
## Optional: extra configuration for RoboFile
|
||||||
|
|
||||||
|
This is not required, and if in doubt you can just skip this section, but there may be some specific use cases when you need (or want) to override the default behaviour of RoboFile.php. To do this, copy `RoboFile.dist.ini` to `RoboFile.ini` and add options in INI format, one per line, e.g.
|
||||||
|
|
||||||
|
skipClone = true
|
||||||
|
cmsPath = tests/joomla
|
||||||
|
|
||||||
|
The currently available options are as follows:
|
||||||
|
|
||||||
|
* `skipClone`: set to `true` to avoid the cms repo being deleted and re-cloned at each test execution. Useful to save time and bandwidth while you're debugging your test environment. But please be aware that if you don't refresh the repo you'll have to manually check the `installation` folder is present and the `configuration.php` is not.
|
||||||
|
* `cmsPath`: set to the local path (absolute or relative) where you'd like the test website to be installed. Default is `tests/joomla-cms3`.
|
||||||
|
* `branch`: set to whatever existing branch from the `joomla-cms` project if you want to clone that specific branch. Default is `3.10-dev`.
|
||||||
|
|
||||||
|
## Additional options
|
||||||
|
|
||||||
|
You can run the tests against different resolutions. The default acceptance YAML configuration file provides three options:
|
||||||
|
|
||||||
|
* "desktop": default, 1024x768px
|
||||||
|
* "tablet": tablet in portrait mode, 768x1024px
|
||||||
|
* "phone": phone in portrait mode, 480x640px
|
||||||
|
|
||||||
|
To set a specific resolution, set is as an option of the command:
|
||||||
|
|
||||||
|
`$ vendor/bin/robo run:tests --env=tablet`
|
||||||
|
|
||||||
|
Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.
|
||||||
|
|
||||||
|
|
||||||
|
## Video
|
||||||
|
[Here](https://www.youtube.com/watch?v=fWO_Ed_wxpw) you can finde a video that shows the installation of com_weblinks for testing.
|
||||||
|
|
||||||
|
|
||||||
|
# For Windows:
|
||||||
|
|
||||||
|
You need to install:
|
||||||
|
- Git for windows (https://msysgit.github.io/)
|
||||||
|
- GitHub for windows (https://windows.github.com/)
|
||||||
|
- Curl for Windows if necessary.
|
||||||
|
- for complete list of necessary software and tips check this [wiki page](https://github.com/joomla-extensions/weblinks/wiki/Programs-needed-on-Windows-to-get-the-tests-running)
|
||||||
|
|
||||||
|
|
||||||
|
Note: For commands line is better if you use the 'Git shell' program.
|
||||||
|
|
||||||
|
First you should create a fork of the official repository and clone the fork into your web server folder.
|
||||||
|
|
||||||
|
To prepare the system tests (Selenium) to be run in your local machine you are asked to rename the file `tests/acceptance.suite.dist.yml` to `tests/acceptance.suite.yml`. Afterwards, please edit the file according to your system needs.
|
||||||
|
|
||||||
|
The next step is only required if you don't place the weblinks folder into your web server folder. Create a symbolic link from your tests\joomla-cms3 to a subfolder of your web server. For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mklink /J C:\wamp\www\tests\joomla-cms3 C:\Users\Name\Documents\GitHub\weblinks\tests\joomla-cms3
|
||||||
|
```
|
||||||
|
|
||||||
|
Open the console and go in the folder of weblinks, for example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd C:\wamp\www\weblinks
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run the command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ composer install
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then run the following command to start the tests:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ vendor/bin/robo run:tests
|
||||||
|
```
|
||||||
|
|
||||||
|
Once all tests were executed, you may also run a specific test:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ vendor/bin/robo run:test // Then select the test you want to run!
|
||||||
|
```
|
||||||
|
16
RoboFile.dist.ini
Normal file
16
RoboFile.dist.ini
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
; If set to true, the repo will not be cloned from GitHub and the local copy will be reused.
|
||||||
|
; This setting will be obsolete once we have local Git cache enabled
|
||||||
|
skipClone = false
|
||||||
|
|
||||||
|
; If you want to setup your test website in a different folder, you can do that here.
|
||||||
|
; You can also set an absolute path, i.e. /path/to/my/cms/folder
|
||||||
|
cmsPath = tests/joomla
|
||||||
|
|
||||||
|
; If you want to clone a different branch, you can set it here
|
||||||
|
branch = 3.10-dev
|
||||||
|
|
||||||
|
; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.
|
||||||
|
localUser = www-data
|
||||||
|
|
||||||
|
; Set this to true, if your curl binaries are not able to create an https connection
|
||||||
|
insecure = false
|
711
RoboFile.php
Normal file
711
RoboFile.php
Normal file
@ -0,0 +1,711 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This is project's console commands configuration for Robo task runner.
|
||||||
|
*
|
||||||
|
* Download robo.phar from http://robo.li/robo.phar and type in the root of the repo: $ php robo.phar
|
||||||
|
* Or do: $ composer update, and afterwards you will be able to execute robo like $ php vendor/bin/robo
|
||||||
|
*
|
||||||
|
* @package Joomla.Site
|
||||||
|
* @subpackage RoboFile
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Joomla\Jorobo\Tasks\loadTasks as loadReleaseTasks;
|
||||||
|
use Joomla\Testing\Robo\Tasks\loadTasks as loadTestingTasks;
|
||||||
|
use Robo\Tasks;
|
||||||
|
|
||||||
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
|
if (!defined('JPATH_BASE'))
|
||||||
|
{
|
||||||
|
define('JPATH_BASE', __DIR__);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modern php task runner for Joomla! Browser Automated Tests execution
|
||||||
|
*
|
||||||
|
* @package RoboFile
|
||||||
|
*
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
class RoboFile extends Tasks
|
||||||
|
{
|
||||||
|
// Load tasks from composer, see composer.json
|
||||||
|
use loadTestingTasks;
|
||||||
|
use loadReleaseTasks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File extension for executables
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $executableExtension = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local configuration parameters
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $configuration = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the local CMS root
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $cmsPath = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array | null
|
||||||
|
* @since version
|
||||||
|
*/
|
||||||
|
private $suiteConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->configuration = $this->getConfiguration();
|
||||||
|
|
||||||
|
$this->cmsPath = $this->getCmsPath();
|
||||||
|
|
||||||
|
$this->executableExtension = $this->getExecutableExtension();
|
||||||
|
|
||||||
|
// Set default timezone (so no warnings are generated if it is not set)
|
||||||
|
date_default_timezone_set('UTC');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the executable extension according to Operating System
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getExecutableExtension()
|
||||||
|
{
|
||||||
|
if ($this->isWindows())
|
||||||
|
{
|
||||||
|
return '.exe';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes all the Selenium System Tests in a suite on your machine
|
||||||
|
*
|
||||||
|
* @param array $opts Array of configuration options:
|
||||||
|
* - 'use-htaccess': renames and enable embedded Joomla .htaccess file
|
||||||
|
* - 'env': set a specific environment to get configuration from
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
|
*/
|
||||||
|
public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
|
||||||
|
{
|
||||||
|
$this->createTestingSite($opts['use-htaccess']);
|
||||||
|
|
||||||
|
$this->getComposer();
|
||||||
|
|
||||||
|
$this->taskComposerInstall()->run();
|
||||||
|
|
||||||
|
$this->runSelenium();
|
||||||
|
|
||||||
|
// Make sure to run the build command to generate AcceptanceTester
|
||||||
|
$this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build');
|
||||||
|
|
||||||
|
$this->taskCodecept()
|
||||||
|
->arg('--steps')
|
||||||
|
->arg('--debug')
|
||||||
|
->arg('--fail-fast')
|
||||||
|
->env($opts['env'])
|
||||||
|
->arg('tests/acceptance/install/')
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
|
||||||
|
$this->taskCodecept()
|
||||||
|
->arg('--steps')
|
||||||
|
->arg('--debug')
|
||||||
|
->arg('--fail-fast')
|
||||||
|
->env($opts['env'])
|
||||||
|
->arg('tests/acceptance/administrator/')
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
|
||||||
|
$this->taskCodecept()
|
||||||
|
->arg('--steps')
|
||||||
|
->arg('--debug')
|
||||||
|
->arg('--fail-fast')
|
||||||
|
->env($opts['env'])
|
||||||
|
->arg('tests/acceptance/frontend/')
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
|
||||||
|
/*
|
||||||
|
Uncomment this lines if you need to debug selenium errors
|
||||||
|
$seleniumErrors = file_get_contents('selenium.log');
|
||||||
|
if ($seleniumErrors) {
|
||||||
|
$this->say('Printing Selenium Log files');
|
||||||
|
$this->say('------ selenium.log (start) ---------');
|
||||||
|
$this->say($seleniumErrors);
|
||||||
|
$this->say('------ selenium.log (end) -----------');
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes a specific Selenium System Tests in your machine
|
||||||
|
*
|
||||||
|
* @param string $pathToTestFile Optional name of the test to be run
|
||||||
|
* @param string $suite Optional name of the suite containing the tests, Acceptance by default.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
* @throws ReflectionException
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
|
*/
|
||||||
|
public function runTest($pathToTestFile = null, $suite = 'acceptance')
|
||||||
|
{
|
||||||
|
$this->runSelenium();
|
||||||
|
|
||||||
|
// Make sure to run the build command to generate AcceptanceTester
|
||||||
|
$this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build');
|
||||||
|
|
||||||
|
if (!$pathToTestFile)
|
||||||
|
{
|
||||||
|
$this->say('Available tests in the system:');
|
||||||
|
|
||||||
|
$iterator = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator(
|
||||||
|
'tests/' . $suite,
|
||||||
|
RecursiveDirectoryIterator::SKIP_DOTS
|
||||||
|
),
|
||||||
|
RecursiveIteratorIterator::SELF_FIRST
|
||||||
|
);
|
||||||
|
|
||||||
|
$tests = array();
|
||||||
|
|
||||||
|
$iterator->rewind();
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
|
while ($iterator->valid())
|
||||||
|
{
|
||||||
|
if (strripos($iterator->getSubPathName(), 'cept.php')
|
||||||
|
|| strripos($iterator->getSubPathName(), 'cest.php'))
|
||||||
|
{
|
||||||
|
$this->say('[' . $i . '] ' . $iterator->getSubPathName());
|
||||||
|
$tests[$i] = $iterator->getSubPathName();
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$iterator->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->say('');
|
||||||
|
$testNumber = $this->ask('Type the number of the test in the list that you want to run...');
|
||||||
|
$test = $tests[$testNumber];
|
||||||
|
}
|
||||||
|
|
||||||
|
$pathToTestFile = 'tests/' . $suite . '/' . $test;
|
||||||
|
|
||||||
|
// Loading the class to display the methods in the class
|
||||||
|
require 'tests/' . $suite . '/' . $test;
|
||||||
|
|
||||||
|
// Logic to fetch the class name from the file name
|
||||||
|
$fileName = explode("/", $test);
|
||||||
|
$className = explode(".", $fileName[1]);
|
||||||
|
|
||||||
|
// If the selected file is cest only than we will give the option to execute individual methods, we don't need this in cept file
|
||||||
|
$i = 1;
|
||||||
|
|
||||||
|
if (strripos($className[0], 'cest'))
|
||||||
|
{
|
||||||
|
$class_methods = get_class_methods($className[0]);
|
||||||
|
$this->say('[' . $i . '] ' . 'All');
|
||||||
|
$methods[$i] = 'All';
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
foreach ($class_methods as $method_name)
|
||||||
|
{
|
||||||
|
$reflect = new ReflectionMethod($className[0], $method_name);
|
||||||
|
|
||||||
|
if (!$reflect->isConstructor())
|
||||||
|
{
|
||||||
|
if ($reflect->isPublic())
|
||||||
|
{
|
||||||
|
$this->say('[' . $i . '] ' . $method_name);
|
||||||
|
$methods[$i] = $method_name;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->say('');
|
||||||
|
$methodNumber = $this->ask('Please choose the method in the test that you would want to run...');
|
||||||
|
$method = $methods[$methodNumber];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($method) && $method != 'All')
|
||||||
|
{
|
||||||
|
$pathToTestFile = $pathToTestFile . ':' . $method;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->taskCodecept()
|
||||||
|
->test($pathToTestFile)
|
||||||
|
->arg('--steps')
|
||||||
|
->arg('--debug')
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the specified checker tool. Valid options are phpmd, phpcs, phpcpd
|
||||||
|
*
|
||||||
|
* @param string $tool The tool
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function runChecker($tool = null)
|
||||||
|
{
|
||||||
|
if ($tool === null)
|
||||||
|
{
|
||||||
|
$this->say('You have to specify a tool name as argument. Valid tools are phpmd, phpcs, phpcpd.');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($tool, array('phpmd', 'phpcs', 'phpcpd')))
|
||||||
|
{
|
||||||
|
$this->say('The tool you required is not known. Valid tools are phpmd, phpcs, phpcpd.');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($tool)
|
||||||
|
{
|
||||||
|
case 'phpmd':
|
||||||
|
return $this->runPhpmd();
|
||||||
|
|
||||||
|
case 'phpcs':
|
||||||
|
return $this->runPhpcs();
|
||||||
|
|
||||||
|
case 'phpcpd':
|
||||||
|
return $this->runPhpcpd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a testing Joomla site for running the tests (use it before run:test)
|
||||||
|
*
|
||||||
|
* @param bool $use_htaccess (1/0) Rename and enable embedded Joomla .htaccess file
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function createTestingSite($use_htaccess = false)
|
||||||
|
{
|
||||||
|
if (!empty($this->configuration->skipClone))
|
||||||
|
{
|
||||||
|
$this->say('Reusing Joomla CMS site already present at ' . $this->cmsPath);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caching cloned installations locally
|
||||||
|
if (!is_dir('tests/cache') || (time() - filemtime('tests/cache') > 60 * 60 * 24))
|
||||||
|
{
|
||||||
|
if (file_exists('tests/cache'))
|
||||||
|
{
|
||||||
|
$this->taskDeleteDir('tests/cache')->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_exec($this->buildGitCloneCommand());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Joomla Clean Testing sites
|
||||||
|
if (is_dir($this->cmsPath))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$this->taskDeleteDir($this->cmsPath)->run();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
// Sorry, we tried :(
|
||||||
|
$this->say('Sorry, you will have to delete ' . $this->cmsPath . ' manually. ');
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_copyDir('tests/cache', $this->cmsPath);
|
||||||
|
|
||||||
|
// Optionally change owner to fix permissions issues
|
||||||
|
if (!empty($this->configuration->localUser) && !$this->isWindows())
|
||||||
|
{
|
||||||
|
$this->_exec('chown -R ' . $this->configuration->localUser . ' ' . $this->cmsPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy current package
|
||||||
|
if (!file_exists('dist/pkg-weblinks-current.zip'))
|
||||||
|
{
|
||||||
|
$this->build(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_copy('dist/pkg-weblinks-current.zip', $this->cmsPath . "/pkg-weblinks-current.zip");
|
||||||
|
|
||||||
|
$this->say('Joomla CMS site created at ' . $this->cmsPath);
|
||||||
|
|
||||||
|
// Optionally uses Joomla default htaccess file. Used by TravisCI
|
||||||
|
if ($use_htaccess == true)
|
||||||
|
{
|
||||||
|
$this->_copy('./tests/joomla/htaccess.txt', './tests/joomla/.htaccess');
|
||||||
|
$this->_exec('sed -e "s,# RewriteBase /,RewriteBase /tests/joomla/,g" -in-place tests/joomla/.htaccess');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get (optional) configuration from an external file
|
||||||
|
*
|
||||||
|
* @return \stdClass|null
|
||||||
|
*/
|
||||||
|
public function getConfiguration()
|
||||||
|
{
|
||||||
|
$configurationFile = __DIR__ . '/RoboFile.ini';
|
||||||
|
|
||||||
|
if (!file_exists($configurationFile))
|
||||||
|
{
|
||||||
|
$this->say("No local configuration file");
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$configuration = parse_ini_file($configurationFile);
|
||||||
|
|
||||||
|
if ($configuration === false)
|
||||||
|
{
|
||||||
|
$this->say('Local configuration file is empty or wrong (check is it in correct .ini format');
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_decode(json_encode($configuration));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build correct git clone command according to local configuration and OS
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function buildGitCloneCommand()
|
||||||
|
{
|
||||||
|
$branch = empty($this->configuration->branch) ? '3.10-dev' : $this->configuration->branch;
|
||||||
|
|
||||||
|
return "git" . $this->executableExtension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if local OS is Windows
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function isWindows()
|
||||||
|
{
|
||||||
|
return strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the correct CMS root path
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getCmsPath()
|
||||||
|
{
|
||||||
|
if (empty($this->configuration->cmsPath))
|
||||||
|
{
|
||||||
|
return 'tests/joomla';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file_exists(dirname($this->configuration->cmsPath)))
|
||||||
|
{
|
||||||
|
$this->say("Cms path written in local configuration does not exists or is not readable");
|
||||||
|
|
||||||
|
return 'tests/joomla';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->configuration->cmsPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs Selenium Standalone Server.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
|
*/
|
||||||
|
public function runSelenium()
|
||||||
|
{
|
||||||
|
if ($this->isWindows())
|
||||||
|
{
|
||||||
|
// TODO: Move this logic to the selenium standalone server task in the parent joomla repo
|
||||||
|
$this->_exec('START java.exe -jar ' . $this->getWebDriver() .
|
||||||
|
' .\\vendor\\joomla-projects\\selenium-server-standalone\\bin\\selenium-server-standalone.jar ');
|
||||||
|
sleep(3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->taskSeleniumStandaloneServer()
|
||||||
|
->setWebdriver($this->getWebdriver())
|
||||||
|
->runSelenium()
|
||||||
|
->waitForSelenium()
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Downloads Composer
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function getComposer()
|
||||||
|
{
|
||||||
|
// Make sure we have Composer
|
||||||
|
if (!file_exists('./composer.phar'))
|
||||||
|
{
|
||||||
|
$insecure = '';
|
||||||
|
|
||||||
|
if (!empty($this->configuration->insecure))
|
||||||
|
{
|
||||||
|
$insecure = '--insecure';
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_exec('curl ' . $insecure . ' --retry 3 --retry-delay 5 -sS https://getcomposer.org/installer | php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kills the selenium server running
|
||||||
|
*
|
||||||
|
* @param string $host Web host of the remote server.
|
||||||
|
* @param string $port Server port.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function killSelenium($host = 'localhost', $port = '4444')
|
||||||
|
{
|
||||||
|
$this->say('Trying to kill the selenium server.');
|
||||||
|
|
||||||
|
$this->taskSeleniumStandaloneServer()
|
||||||
|
->setUrl("http://$host:$port")
|
||||||
|
->killSelenium()
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the phpmd tool
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function runPhpmd()
|
||||||
|
{
|
||||||
|
return $this->_exec('phpmd' . $this->extension . ' ' . __DIR__ . '/src xml cleancode,codesize,controversial,design,naming,unusedcode');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the phpcs tool
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function runPhpcs()
|
||||||
|
{
|
||||||
|
$this->_exec('phpcs' . $this->extension . ' ' . __DIR__ . '/src');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the phpcpd tool
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function runPhpcpd()
|
||||||
|
{
|
||||||
|
$this->_exec('phpcpd' . $this->extension . ' ' . __DIR__ . '/src');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the joomla extension package
|
||||||
|
*
|
||||||
|
* @param array $params Additional params
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function build($params = ['dev' => false])
|
||||||
|
{
|
||||||
|
if (!file_exists('jorobo.ini'))
|
||||||
|
{
|
||||||
|
$this->_copy('jorobo.dist.ini', 'jorobo.ini');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->taskBuild($params)->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes all unit tests
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function runUnit()
|
||||||
|
{
|
||||||
|
$this->createTestingSite();
|
||||||
|
$this->getComposer();
|
||||||
|
$this->taskComposerInstall()->run();
|
||||||
|
|
||||||
|
// Make sure to run the build command to generate AcceptanceTester
|
||||||
|
$this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build');
|
||||||
|
|
||||||
|
$this->taskCodecept()
|
||||||
|
->suite('unit')
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update copyright headers for this project. (Set the text up in the jorobo.ini)
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function headers()
|
||||||
|
{
|
||||||
|
if (!file_exists('jorobo.ini'))
|
||||||
|
{
|
||||||
|
$this->_copy('jorobo.dist.ini', 'jorobo.ini');
|
||||||
|
}
|
||||||
|
|
||||||
|
(new \Joomla\Jorobo\Tasks\CopyrightHeader)->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect the correct driver for selenium
|
||||||
|
*
|
||||||
|
* @return string the webdriver string to use with selenium
|
||||||
|
*
|
||||||
|
* @since version
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
|
*/
|
||||||
|
public function getWebdriver()
|
||||||
|
{
|
||||||
|
$suiteConfig = $this->getSuiteConfig();
|
||||||
|
$codeceptMainConfig = \Codeception\Configuration::config();
|
||||||
|
$browser = $suiteConfig['modules']['config']['JoomlaBrowser']['browser'];
|
||||||
|
|
||||||
|
if ($browser == 'chrome')
|
||||||
|
{
|
||||||
|
$driver['type'] = 'webdriver.chrome.driver';
|
||||||
|
}
|
||||||
|
elseif ($browser == 'firefox')
|
||||||
|
{
|
||||||
|
$driver['type'] = 'webdriver.gecko.driver';
|
||||||
|
}
|
||||||
|
elseif ($browser == 'MicrosoftEdge')
|
||||||
|
{
|
||||||
|
$driver['type'] = 'webdriver.edge.driver';
|
||||||
|
|
||||||
|
// Check if we are using Windows Insider builds
|
||||||
|
if ($suiteConfig['modules']['config']['AcceptanceHelper']['MicrosoftEdgeInsiders'])
|
||||||
|
{
|
||||||
|
$browser = 'MicrosoftEdgeInsiders';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($browser == 'internet explorer')
|
||||||
|
{
|
||||||
|
$driver['type'] = 'webdriver.ie.driver';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if we have a path for this browser and OS in the codeception settings
|
||||||
|
if (isset($codeceptMainConfig['webdrivers'][$browser][$this->getOs()]))
|
||||||
|
{
|
||||||
|
$driverPath = $codeceptMainConfig['webdrivers'][$browser][$this->getOs()];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->yell(
|
||||||
|
print_r($codeceptMainConfig) .
|
||||||
|
'No driver for your browser. Check your browser in acceptance.suite.yml and the webDrivers in codeception.yml');
|
||||||
|
|
||||||
|
// We can't do anything without a driver, exit
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$driver['path'] = $driverPath;
|
||||||
|
|
||||||
|
return '-D' . implode('=', $driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the suite configuration
|
||||||
|
*
|
||||||
|
* @param string $suite The suite
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function getSuiteConfig($suite = 'acceptance')
|
||||||
|
{
|
||||||
|
if (!$this->suiteConfig)
|
||||||
|
{
|
||||||
|
$this->suiteConfig = Symfony\Component\Yaml\Yaml::parse(file_get_contents("tests/{$suite}.suite.yml"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->suiteConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the os name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since version
|
||||||
|
*/
|
||||||
|
private function getOs()
|
||||||
|
{
|
||||||
|
$os = php_uname('s');
|
||||||
|
|
||||||
|
if (strpos(strtolower($os), 'windows') !== false)
|
||||||
|
{
|
||||||
|
$os = 'windows';
|
||||||
|
}
|
||||||
|
// Who have thought that Mac is actually Darwin???
|
||||||
|
elseif (strpos(strtolower($os), 'darwin') !== false)
|
||||||
|
{
|
||||||
|
$os = 'mac';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$os = 'linux';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $os;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Version __DEPLOY_VERSION__ in Weblinks. (Set the version up in the jorobo.ini)
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function bump()
|
||||||
|
{
|
||||||
|
(new \Joomla\Jorobo\Tasks\BumpVersion())->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map into Joomla installation.
|
||||||
|
*
|
||||||
|
* @param String $target The target joomla instance
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function map($target)
|
||||||
|
{
|
||||||
|
(new \Joomla\Jorobo\Tasks\Map($target))->run();
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +0,0 @@
|
|||||||
# The release version for the extension package.
|
|
||||||
version=3.4.0-rc
|
|
||||||
|
|
||||||
# The name of the package.
|
|
||||||
package=weblinks
|
|
115
build.xml
115
build.xml
@ -1,115 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="Weblinks" default="make" basedir=".">
|
|
||||||
<tstamp>
|
|
||||||
<format property="build.date" pattern="%Y-%m-%d" />
|
|
||||||
</tstamp>
|
|
||||||
|
|
||||||
<property file="build.ini" />
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo>Use `$ phing -l` to list the available targets.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="make-dev" description="Builds the extension release package for development testing." depends="rebuild-extension-archives">
|
|
||||||
<echo msg="Deleting old development build." />
|
|
||||||
<delete quiet="yes" includeemptydirs="true">
|
|
||||||
<fileset dir="releases">
|
|
||||||
<include name="pkg_${package}_dev.zip" />
|
|
||||||
</fileset>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<echo msg="Making the development ${package} package ." />
|
|
||||||
<zip destfile="releases/pkg_${package}_dev.zip">
|
|
||||||
<fileset dir="build">
|
|
||||||
<include name="**" />
|
|
||||||
</fileset>
|
|
||||||
</zip>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="make" description="Builds the extension release package for a version." depends="rebuild-extension-archives">
|
|
||||||
<echo msg="Making the ${package} package for version ${version}." />
|
|
||||||
|
|
||||||
<zip destfile="releases/pkg_${package}_${version}.zip">
|
|
||||||
<fileset dir="build">
|
|
||||||
<include name="**" />
|
|
||||||
</fileset>
|
|
||||||
</zip>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="rebuild-extension-archives" description="Rebuilds the archive (zip) files for each extension.">
|
|
||||||
<mkdir dir="build" />
|
|
||||||
<mkdir dir="releases" />
|
|
||||||
|
|
||||||
<echo msg="Cleaning build directory." />
|
|
||||||
<delete quiet="yes" includeemptydirs="true">
|
|
||||||
<fileset dir="*">
|
|
||||||
<include name="build" />
|
|
||||||
</fileset>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<echo msg="Creating extension archives (zip files)." />
|
|
||||||
<foreach param="extension" target="build-archive">
|
|
||||||
<fileset dir="src">
|
|
||||||
<include name="com_*" />
|
|
||||||
<include name="mod_*" />
|
|
||||||
<include name="plg_*" />
|
|
||||||
<include name="tpl_*" />
|
|
||||||
</fileset>
|
|
||||||
</foreach>
|
|
||||||
|
|
||||||
<copy todir="build" >
|
|
||||||
<fileset dir="src">
|
|
||||||
<include name="language/**" />
|
|
||||||
<include name="pkg_${package}.xml" />
|
|
||||||
</fileset>
|
|
||||||
</copy>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="build-archive" description="Builds an archive for a single extension.">
|
|
||||||
<zip destfile="build/${extension}.zip" basedir="src/${extension}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="replace-deploy-version" description="Replaces the `__DEPLOY_VERSION__` markers with a designated tag and commits the changes.">
|
|
||||||
<echo>Replacing "__DEPLOY_VERSION__" with "${version}".</echo>
|
|
||||||
<reflexive>
|
|
||||||
<fileset dir=".">
|
|
||||||
<include pattern="*.md" />
|
|
||||||
<include pattern="src/**/*.php" />
|
|
||||||
</fileset>
|
|
||||||
<filterchain>
|
|
||||||
<replaceregexp>
|
|
||||||
<regexp pattern="__DEPLOY_VERSION__" replace="${version}"/>
|
|
||||||
</replaceregexp>
|
|
||||||
</filterchain>
|
|
||||||
</reflexive>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="tag" description="Tags the repository using git.">
|
|
||||||
<gitcommit repository="." message="Tagging release `${version}`." allFiles="true" />
|
|
||||||
<gittag repository="." name="${version}" annotate="true" message="${version}" />
|
|
||||||
<!--<gitpush repository="." all="true" />-->
|
|
||||||
<echo>Push tags manually with `$ git push --tags origin`.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="set-version" description="Sets the <version> tag in all XML files with the version from the build.ini file.">
|
|
||||||
<phingcall target="replace-xml">
|
|
||||||
<property name="tag" value="version" />
|
|
||||||
<property name="tagValue" value="${version}" />
|
|
||||||
</phingcall>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="replace-xml" description="[PRIVATE] Sets an XML tag with a new value.">
|
|
||||||
<echo message="Replacing '${tag}' tag with '${tagValue}'."/>
|
|
||||||
<reflexive>
|
|
||||||
<fileset dir=".">
|
|
||||||
<include pattern="src/**/*.xml" />
|
|
||||||
</fileset>
|
|
||||||
<filterchain>
|
|
||||||
<replaceregexp>
|
|
||||||
<regexp pattern="<${tag}>(.*?)</${tag}>"
|
|
||||||
replace="<${tag}>${tagValue}</${tag}>"/>
|
|
||||||
</replaceregexp>
|
|
||||||
</filterchain>
|
|
||||||
</reflexive>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
23
codeception.yml
Normal file
23
codeception.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
actor: Tester
|
||||||
|
paths:
|
||||||
|
tests: tests
|
||||||
|
log: tests/_output
|
||||||
|
data: tests/_data
|
||||||
|
helpers: tests/_support
|
||||||
|
settings:
|
||||||
|
bootstrap: _bootstrap.php
|
||||||
|
colors: true
|
||||||
|
memory_limit: 1024M
|
||||||
|
webdrivers:
|
||||||
|
firefox:
|
||||||
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\gecko\windows\geckodriver64.exe
|
||||||
|
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/mac/geckodriver
|
||||||
|
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/linux/geckodriver
|
||||||
|
chrome:
|
||||||
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\chrome\windows\chromedriver.exe
|
||||||
|
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/mac/chromedriver
|
||||||
|
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/linux/chromedriver
|
||||||
|
internet explorer:
|
||||||
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\internet-explorer32\IEDriverServer.exe
|
||||||
|
MicrosoftEdge:
|
||||||
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\edge\msedgedriver64.exe
|
25
composer.json
Normal file
25
composer.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name" : "joomla-extensions/weblinks",
|
||||||
|
"description": "The Open Source PHP Framework for creating complex Joomla extensions",
|
||||||
|
"license" : "GPL-2.0-or-later",
|
||||||
|
"config": {
|
||||||
|
"platform": {
|
||||||
|
"php": "5.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"require" : {
|
||||||
|
"php": "^5.3.10|^7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php": ">=5.6",
|
||||||
|
"codeception/codeception": "^3",
|
||||||
|
"phpunit/phpunit": "^5.7.27",
|
||||||
|
"joomla-projects/joomla-browser": "^3.9",
|
||||||
|
"consolidation/robo": "^1.0.0",
|
||||||
|
"joomla-projects/joomla-testing-robo": "~1.0",
|
||||||
|
"joomla-projects/selenium-server-standalone": "^3.14",
|
||||||
|
"fzaninotto/faker": "^1.6",
|
||||||
|
"joomla-projects/jorobo": "~0.7",
|
||||||
|
"behat/gherkin": "^4.4.1"
|
||||||
|
}
|
||||||
|
}
|
6226
composer.lock
generated
Normal file
6226
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
docs/README.md
Normal file
12
docs/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## How to install the weblinks extension
|
||||||
|
|
||||||
|
1. Download the last version of the the weblinks package from: https://github.com/joomla-extensions/weblinks/releases/latest
|
||||||
|
2. Install the package file over the normal Joomla! installer
|
||||||
|
3. As we also support the core updater any update will be shown in the updater too.
|
||||||
|
|
||||||
|
## I only need some parts of the package
|
||||||
|
|
||||||
|
1. Download the last version of the the weblinks package from: https://github.com/joomla-extensions/weblinks/releases/latest
|
||||||
|
2. Unzip that package
|
||||||
|
3. Install the parts over the normal Joomla! installer
|
||||||
|
4. Please note that the updater only work if you instal the complete package.
|
38
jorobo.dist.ini
Normal file
38
jorobo.dist.ini
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
extension = weblinks
|
||||||
|
version = 3.9.0
|
||||||
|
source = src
|
||||||
|
target = package
|
||||||
|
|
||||||
|
; Create a pre-release of the extension on GitHub
|
||||||
|
; Add your personal GitHub access tocken
|
||||||
|
; and add Release to the target (separated by space) above
|
||||||
|
[github]
|
||||||
|
remote = origin
|
||||||
|
branch = develop
|
||||||
|
token =
|
||||||
|
owner = joomla-extensions
|
||||||
|
repository = weblinks
|
||||||
|
changelog_source = commits
|
||||||
|
|
||||||
|
; Automatic upload of the built extension package to an FTP server
|
||||||
|
[ftp]
|
||||||
|
host =
|
||||||
|
port = 21
|
||||||
|
user =
|
||||||
|
password =
|
||||||
|
ssl = false
|
||||||
|
target = /
|
||||||
|
|
||||||
|
; Adds / replaces copyright headers at the beginning of files in the source folder
|
||||||
|
[header]
|
||||||
|
files = php,js
|
||||||
|
exclude =
|
||||||
|
text = "
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
"
|
51
manifest.xml
51
manifest.xml
@ -5,11 +5,54 @@
|
|||||||
<description>Joomla! CMS Weblinks Package</description>
|
<description>Joomla! CMS Weblinks Package</description>
|
||||||
<element>pkg_weblinks</element>
|
<element>pkg_weblinks</element>
|
||||||
<type>package</type>
|
<type>package</type>
|
||||||
<version>3.4-0.dev</version>
|
<version>3.7.0</version>
|
||||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks</infourl>
|
<client>site</client>
|
||||||
|
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.7.0</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/weblinks/releases/download/3.4.0-dev/pkg_weblinks_3.4.0-dev.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/3-7-0/pkg-weblinks-3.7.0.zip</downloadurl>
|
||||||
</downloads>
|
</downloads>
|
||||||
<targetplatform name="joomla" version="3.4" />
|
<targetplatform name="joomla" version="3.[678]" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Weblinks Extension Package</name>
|
||||||
|
<description>Joomla! CMS Weblinks Package</description>
|
||||||
|
<element>pkg_weblinks</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>3.9.0</version>
|
||||||
|
<client>site</client>
|
||||||
|
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.9.0</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/3-9-0/pkg-weblinks-3.9.0.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha512>99baa8a622da239b2a0b84414836c494e68b5ff2d1eba2030fccc9d929645a45f7a2459ce2261846a10922f4b77bc6e0f26d34adc1afffb62e51fe45e8f44b53</sha512>
|
||||||
|
<targetplatform name="joomla" version="((3\.(9|10))|(4\.[01234]))" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Weblinks Extension Package</name>
|
||||||
|
<description>Joomla! CMS Weblinks Package</description>
|
||||||
|
<element>pkg_weblinks</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>4.0.1</version>
|
||||||
|
<client>site</client>
|
||||||
|
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/4.0.1</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/4-0-1/pkg-weblinks-4.0.1.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha512>8e6ac146d9bf907971a25728f4ed6cfad900ab51d1bf33a157f11b42bfcb8b7dfbc6c21c9eeebfe2cf572220db33f73fa29807f3d350220ed4e73b09866dcdad</sha512>
|
||||||
|
<targetplatform name="joomla" version="((4\.[01234])|(5\.0))" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Weblinks Extension Package</name>
|
||||||
|
<description>Joomla! CMS Weblinks Package</description>
|
||||||
|
<element>pkg_weblinks</element>
|
||||||
|
<type>package</type>
|
||||||
|
<version>4.3.1</version>
|
||||||
|
<client>site</client>
|
||||||
|
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/4.3.1</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/4-3-1/pkg-weblinks-4.3.1.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha512>cbc02c3a4d915b2a4b69d5b425cb22b93c2dadd72829e1dac8f3cd55c2deb4ab4cb244ca75a956dd335c861daa2a17a769390e7cab90988501c16417afefb72f</sha512>
|
||||||
|
<targetplatform name="joomla" version="((4\.[34])|(5\.[01234]))" />
|
||||||
</update>
|
</update>
|
||||||
</updates>
|
</updates>
|
||||||
|
18
renovate.json
Normal file
18
renovate.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:base",
|
||||||
|
":preserveSemverRanges",
|
||||||
|
":disableMajorUpdates"
|
||||||
|
],
|
||||||
|
"versioning": "semver",
|
||||||
|
"dependencyDashboard": true,
|
||||||
|
"lockFileMaintenance": { "enabled": true },
|
||||||
|
"composerIgnorePlatformReqs": ["ext-*", "lib-*"],
|
||||||
|
"rangeStrategy": "update-lockfile",
|
||||||
|
"baseBranches": ["master", "4.0-dev"],
|
||||||
|
"constraints": {
|
||||||
|
"composer": "> 2.3",
|
||||||
|
"npm": "> 8.0"
|
||||||
|
}
|
||||||
|
}
|
35
src/administrator/components/com_weblinks/access.xml
Normal file
35
src/administrator/components/com_weblinks/access.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<access component="com_weblinks">
|
||||||
|
<section name="component">
|
||||||
|
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||||
|
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
|
||||||
|
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||||
|
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
||||||
|
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||||
|
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
||||||
|
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
||||||
|
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||||
|
<action name="core.edit.value" title="JACTION_EDITVALUE" description="JACTION_EDITVALUE_COMPONENT_DESC" />
|
||||||
|
</section>
|
||||||
|
<section name="category">
|
||||||
|
<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
|
||||||
|
<action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
|
||||||
|
<action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
|
||||||
|
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
|
||||||
|
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
|
||||||
|
</section>
|
||||||
|
<section name="fieldgroup">
|
||||||
|
<action name="core.create" title="JACTION_CREATE" description="COM_FIELDS_GROUP_PERMISSION_CREATE_DESC" />
|
||||||
|
<action name="core.delete" title="JACTION_DELETE" description="COM_FIELDS_GROUP_PERMISSION_DELETE_DESC" />
|
||||||
|
<action name="core.edit" title="JACTION_EDIT" description="COM_FIELDS_GROUP_PERMISSION_EDIT_DESC" />
|
||||||
|
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_FIELDS_GROUP_PERMISSION_EDITSTATE_DESC" />
|
||||||
|
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_FIELDS_GROUP_PERMISSION_EDITOWN_DESC" />
|
||||||
|
<action name="core.edit.value" title="JACTION_EDITVALUE" description="COM_FIELDS_GROUP_PERMISSION_EDITVALUE_DESC" />
|
||||||
|
</section>
|
||||||
|
<section name="field">
|
||||||
|
<action name="core.delete" title="JACTION_DELETE" description="COM_FIELDS_FIELD_PERMISSION_DELETE_DESC" />
|
||||||
|
<action name="core.edit" title="JACTION_EDIT" description="COM_FIELDS_FIELD_PERMISSION_EDIT_DESC" />
|
||||||
|
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_FIELDS_FIELD_PERMISSION_EDITSTATE_DESC" />
|
||||||
|
<action name="core.edit.value" title="JACTION_EDITVALUE" description="COM_FIELDS_FIELD_PERMISSION_EDITVALUE_DESC" />
|
||||||
|
</section>
|
||||||
|
</access>
|
462
src/administrator/components/com_weblinks/config.xml
Normal file
462
src/administrator/components/com_weblinks/config.xml
Normal file
@ -0,0 +1,462 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<config>
|
||||||
|
<fieldset
|
||||||
|
name="component"
|
||||||
|
label="COM_WEBLINKS_COMPONENT_LABEL"
|
||||||
|
description="COM_WEBLINKS_COMPONENT_DESC"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="captcha"
|
||||||
|
type="plugins"
|
||||||
|
label="COM_WEBLINKS_FIELD_CAPTCHA_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_CAPTCHA_DESC"
|
||||||
|
default=""
|
||||||
|
folder="captcha"
|
||||||
|
filter="cmd"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_USE_DEFAULT</option>
|
||||||
|
<option value="0">JOPTION_DO_NOT_USE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="target"
|
||||||
|
type="list"
|
||||||
|
default="0"
|
||||||
|
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
||||||
|
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
||||||
|
>
|
||||||
|
<option value="0">JBROWSERTARGET_PARENT</option>
|
||||||
|
<option value="1">JBROWSERTARGET_NEW</option>
|
||||||
|
<option value="2">JBROWSERTARGET_POPUP</option>
|
||||||
|
<option value="3">JBROWSERTARGET_MODAL</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="save_history"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
|
||||||
|
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="history_limit"
|
||||||
|
type="text"
|
||||||
|
filter="integer"
|
||||||
|
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
||||||
|
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
||||||
|
default="5"
|
||||||
|
showon="save_history:1"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="count_clicks"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer1"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="icons"
|
||||||
|
type="list"
|
||||||
|
default="1"
|
||||||
|
label="COM_WEBLINKS_FIELD_ICON_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_ICON_DESC"
|
||||||
|
filter="integer"
|
||||||
|
>
|
||||||
|
<option value="0">COM_WEBLINKS_FIELD_ICON_OPTION_TEXT</option>
|
||||||
|
<option value="1">COM_WEBLINKS_FIELD_ICON_OPTION_ICON</option>
|
||||||
|
<option value="2">COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="link_icons"
|
||||||
|
type="media"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_ICON_DESC"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer2"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="float_first"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
|
||||||
|
description="COM_WEBLINKS_FLOAT_FIRST_DESC"
|
||||||
|
>
|
||||||
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="float_second"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
|
||||||
|
description="COM_WEBLINKS_FLOAT_SECOND_DESC"
|
||||||
|
>
|
||||||
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer3"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
id="show_tags"
|
||||||
|
name="show_tags"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_SHOW_TAGS_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
|
name="category"
|
||||||
|
label="JCATEGORY"
|
||||||
|
description="COM_WEBLINKS_CATEGORY_DESC"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="category_layout"
|
||||||
|
type="componentlayout"
|
||||||
|
label="JGLOBAL_FIELD_LAYOUT_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_LAYOUT_DESC"
|
||||||
|
menuitems="true"
|
||||||
|
extension="com_weblinks"
|
||||||
|
view="category"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_category_title"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
||||||
|
default="1"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_description"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_description_image"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="maxLevel"
|
||||||
|
type="list"
|
||||||
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
|
default="-1"
|
||||||
|
>
|
||||||
|
<option value="0">JNONE</option>
|
||||||
|
<option value="-1">JALL</option>
|
||||||
|
<option value="1">J1</option>
|
||||||
|
<option value="2">J2</option>
|
||||||
|
<option value="3">J3</option>
|
||||||
|
<option value="4">J4</option>
|
||||||
|
<option value="5">J5</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_empty_categories"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
|
default="0"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_subcat_desc"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_cat_num_links"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_cat_tags"
|
||||||
|
type="radio"
|
||||||
|
label="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
|
name="categories"
|
||||||
|
label="JCATEGORIES"
|
||||||
|
description="COM_WEBLINKS_CATEGORIES_DESC"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="show_base_description"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="maxLevelcat"
|
||||||
|
type="list"
|
||||||
|
default="-1"
|
||||||
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
|
>
|
||||||
|
<option value="-1">JALL</option>
|
||||||
|
<option value="1">J1</option>
|
||||||
|
<option value="2">J2</option>
|
||||||
|
<option value="3">J3</option>
|
||||||
|
<option value="4">J4</option>
|
||||||
|
<option value="5">J5</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_empty_categories_cat"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_subcat_desc_cat"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_cat_num_links_cat"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
|
name="list_layout"
|
||||||
|
label="JGLOBAL_LIST_LAYOUT_OPTIONS"
|
||||||
|
description="COM_WEBLINKS_LIST_LAYOUT_DESC"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="filter_field"
|
||||||
|
type="list"
|
||||||
|
default="1"
|
||||||
|
description="JGLOBAL_FILTER_FIELD_DESC"
|
||||||
|
label="JGLOBAL_FILTER_FIELD_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="hide">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination_limit"
|
||||||
|
type="radio"
|
||||||
|
default="1"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||||
|
description="JGLOBAL_DISPLAY_SELECT_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_headings"
|
||||||
|
type="radio"
|
||||||
|
default="1"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
||||||
|
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_link_description"
|
||||||
|
type="radio"
|
||||||
|
default="1"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_link_hits"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
||||||
|
label="JGLOBAL_HITS"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination"
|
||||||
|
type="list"
|
||||||
|
default="2"
|
||||||
|
label="JGLOBAL_PAGINATION_LABEL"
|
||||||
|
description="JGLOBAL_PAGINATION_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="2">JGLOBAL_AUTO</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination_results"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||||
|
description="JGLOBAL_PAGINATION_RESULTS_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
|
name="integration"
|
||||||
|
label="JGLOBAL_INTEGRATION_LABEL"
|
||||||
|
description="COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="show_feed_link"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
|
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_FEED_LINK_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="custom_fields_enable"
|
||||||
|
type="radio"
|
||||||
|
label="JGLOBAL_CUSTOM_FIELDS_ENABLE_LABEL"
|
||||||
|
description="JGLOBAL_CUSTOM_FIELDS_ENABLE_DESC"
|
||||||
|
default="0"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
|
name="permissions"
|
||||||
|
description="JCONFIG_PERMISSIONS_DESC"
|
||||||
|
label="JCONFIG_PERMISSIONS_LABEL"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="rules"
|
||||||
|
type="rules"
|
||||||
|
component="com_weblinks"
|
||||||
|
filter="rules"
|
||||||
|
validate="rules"
|
||||||
|
label="JCONFIG_PERMISSIONS_LABEL"
|
||||||
|
section="component"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</config>
|
@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblinks Weblink Controller
|
* Weblinks Main Controller
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
@ -19,14 +19,15 @@ class WeblinksController extends JControllerLegacy
|
|||||||
/**
|
/**
|
||||||
* Method to display a view.
|
* Method to display a view.
|
||||||
*
|
*
|
||||||
* @param boolean $cachable If true, the view output will be cached
|
* @param boolean $cacheable If true, the view output will be cached
|
||||||
* @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
* @param array $urlparams An array of safe url parameters and their variable types,
|
||||||
|
* for valid values see {@link JFilterInput::clean()}.
|
||||||
*
|
*
|
||||||
* @return JController This object to support chaining.
|
* @return JControllerLegacy This object to support chaining.
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public function display($cachable = false, $urlparams = false)
|
public function display($cacheable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
require_once JPATH_COMPONENT . '/helpers/weblinks.php';
|
require_once JPATH_COMPONENT . '/helpers/weblinks.php';
|
||||||
|
|
||||||
@ -45,8 +46,6 @@ class WeblinksController extends JControllerLegacy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::display();
|
return parent::display();
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,14 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblink controller class.
|
* Weblink controller class.
|
||||||
*
|
*
|
||||||
@ -27,25 +29,22 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
protected function allowAdd($data = array())
|
protected function allowAdd($data = array())
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
|
||||||
$categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
|
|
||||||
$allow = null;
|
$allow = null;
|
||||||
|
|
||||||
if ($categoryId)
|
if ($categoryId)
|
||||||
{
|
{
|
||||||
// If the category has been passed in the URL check it.
|
// If the category has been passed in the URL check it.
|
||||||
$allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
|
$allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($allow === null)
|
if ($allow !== null)
|
||||||
{
|
|
||||||
// In the absense of better information, revert to the component permissions.
|
|
||||||
return parent::allowAdd($data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return $allow;
|
return $allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In the absense of better information, revert to the component permissions.
|
||||||
|
return parent::allowAdd($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,23 +60,29 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = array(), $key = 'id')
|
||||||
{
|
{
|
||||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||||
$categoryId = 0;
|
|
||||||
|
|
||||||
if ($recordId)
|
// Since there is no asset tracking, fallback to the component permissions.
|
||||||
|
if (!$recordId)
|
||||||
{
|
{
|
||||||
$categoryId = (int) $this->getModel()->getItem($recordId)->catid;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($categoryId)
|
|
||||||
{
|
|
||||||
// The category has been set. Check the category permissions.
|
|
||||||
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Since there is no asset tracking, revert to the component permissions.
|
|
||||||
return parent::allowEdit($data, $key);
|
return parent::allowEdit($data, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the item.
|
||||||
|
$item = $this->getModel()->getItem($recordId);
|
||||||
|
|
||||||
|
// Since there is no item, return false.
|
||||||
|
if (empty($item))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
// Check if can edit own core.edit.own.
|
||||||
|
$canEditOwn = $user->authorise('core.edit.own', $this->option . '.category.' . (int) $item->catid) && $item->created_by == $user->id;
|
||||||
|
|
||||||
|
// Check the category core.edit permissions.
|
||||||
|
return $canEditOwn || $user->authorise('core.edit', $this->option . '.category.' . (int) $item->catid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,9 +113,9 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
* @param JModelLegacy $model The data model object.
|
* @param JModelLegacy $model The data model object.
|
||||||
* @param array $validData The validated data.
|
* @param array $validData The validated data.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||||
{
|
{
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -29,22 +29,6 @@ class WeblinksControllerWeblinks extends JControllerAdmin
|
|||||||
*/
|
*/
|
||||||
public function getModel($name = 'Weblink', $prefix = 'WeblinksModel', $config = array('ignore_request' => true))
|
public function getModel($name = 'Weblink', $prefix = 'WeblinksModel', $config = array('ignore_request' => true))
|
||||||
{
|
{
|
||||||
$model = parent::getModel($name, $prefix, $config);
|
return parent::getModel($name, $prefix, $config);
|
||||||
|
|
||||||
return $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to provide child classes the opportunity to process after the delete task.
|
|
||||||
*
|
|
||||||
* @param JModelLegacy $model The model for the component
|
|
||||||
* @param mixed $ids array of ids deleted.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 3.1
|
|
||||||
*/
|
|
||||||
protected function postDeleteHook(JModelLegacy $model, $ids = null)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,192 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
|
JTable::addIncludePath(__DIR__ . '/../tables');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Content associations helper.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
class WeblinksAssociationsHelper extends JAssociationExtensionHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The extension name
|
||||||
|
*
|
||||||
|
* @var array $extension
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $extension = 'com_weblinks';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Array of item types
|
||||||
|
*
|
||||||
|
* @var array $itemTypes
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $itemTypes = array('weblink', 'category');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has the extension association support
|
||||||
|
*
|
||||||
|
* @var boolean $associationsSupport
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $associationsSupport = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the associated items for an item
|
||||||
|
*
|
||||||
|
* @param string $typeName The item type
|
||||||
|
* @param int $id The id of item for which we need the associated items
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function getAssociations($typeName, $id)
|
||||||
|
{
|
||||||
|
$type = $this->getType($typeName);
|
||||||
|
|
||||||
|
$context = $this->extension . '.item';
|
||||||
|
$catidField = 'catid';
|
||||||
|
|
||||||
|
if ($typeName === 'category')
|
||||||
|
{
|
||||||
|
$context = 'com_categories.item';
|
||||||
|
$catidField = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the associations.
|
||||||
|
$associations = JLanguageAssociations::getAssociations(
|
||||||
|
$this->extension,
|
||||||
|
$type['tables']['a'],
|
||||||
|
$context,
|
||||||
|
$id,
|
||||||
|
'id',
|
||||||
|
'alias',
|
||||||
|
$catidField
|
||||||
|
);
|
||||||
|
|
||||||
|
return $associations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get item information
|
||||||
|
*
|
||||||
|
* @param string $typeName The item type
|
||||||
|
* @param int $id The id of item for which we need the associated items
|
||||||
|
*
|
||||||
|
* @return JTable|null
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function getItem($typeName, $id)
|
||||||
|
{
|
||||||
|
if (empty($id))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table = null;
|
||||||
|
|
||||||
|
switch ($typeName)
|
||||||
|
{
|
||||||
|
case 'weblink':
|
||||||
|
$table = JTable::getInstance('Weblink', 'WeblinksTable');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'category':
|
||||||
|
$table = JTable::getInstance('Category');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($table))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->load($id);
|
||||||
|
|
||||||
|
return $table;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get information about the type
|
||||||
|
*
|
||||||
|
* @param string $typeName The item type
|
||||||
|
*
|
||||||
|
* @return array Array of item types
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function getType($typeName = '')
|
||||||
|
{
|
||||||
|
$fields = $this->getFieldsTemplate();
|
||||||
|
$tables = array();
|
||||||
|
$joins = array();
|
||||||
|
$support = $this->getSupportTemplate();
|
||||||
|
$title = '';
|
||||||
|
|
||||||
|
if (in_array($typeName, $this->itemTypes))
|
||||||
|
{
|
||||||
|
switch ($typeName)
|
||||||
|
{
|
||||||
|
case 'weblink':
|
||||||
|
|
||||||
|
$support['state'] = true;
|
||||||
|
$support['acl'] = true;
|
||||||
|
$support['checkout'] = true;
|
||||||
|
$support['category'] = true;
|
||||||
|
$support['save2copy'] = true;
|
||||||
|
|
||||||
|
$tables = array(
|
||||||
|
'a' => '#__weblinks'
|
||||||
|
);
|
||||||
|
|
||||||
|
$title = 'weblink';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'category':
|
||||||
|
$fields['created_user_id'] = 'a.created_user_id';
|
||||||
|
$fields['ordering'] = 'a.lft';
|
||||||
|
$fields['level'] = 'a.level';
|
||||||
|
$fields['catid'] = '';
|
||||||
|
$fields['state'] = 'a.published';
|
||||||
|
|
||||||
|
$support['state'] = true;
|
||||||
|
$support['acl'] = true;
|
||||||
|
$support['checkout'] = true;
|
||||||
|
$support['level'] = true;
|
||||||
|
|
||||||
|
$tables = array(
|
||||||
|
'a' => '#__categories'
|
||||||
|
);
|
||||||
|
|
||||||
|
$title = 'category';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'fields' => $fields,
|
||||||
|
'support' => $support,
|
||||||
|
'tables' => $tables,
|
||||||
|
'joins' => $joins,
|
||||||
|
'title' => $title
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
|
JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_weblinks/helpers/weblinks.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weblink HTML helper class.
|
||||||
|
*
|
||||||
|
* @since __DELPOY_VERSION__
|
||||||
|
*/
|
||||||
|
abstract class JHtmlWeblink
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the associated language flags
|
||||||
|
*
|
||||||
|
* @param integer $weblinkid The item id to search associations
|
||||||
|
*
|
||||||
|
* @return string The language HTML
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*
|
||||||
|
* @since ___DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public static function association($weblinkid)
|
||||||
|
{
|
||||||
|
// Defaults
|
||||||
|
$html = '';
|
||||||
|
$associations = JLanguageAssociations::getAssociations('com_weblinks', '#__weblinks', 'com_weblinks.item', $weblinkid);
|
||||||
|
|
||||||
|
// Get the associations
|
||||||
|
if ($associations)
|
||||||
|
{
|
||||||
|
foreach ($associations as $tag => $associated)
|
||||||
|
{
|
||||||
|
$associations[$tag] = (int) $associated->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the associated weblinks items
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select('c.id, c.title as title')
|
||||||
|
->select('l.sef as lang_sef, lang_code')
|
||||||
|
->from('#__weblinks as c')
|
||||||
|
->select('cat.title as category_title')
|
||||||
|
->join('LEFT', '#__categories as cat ON cat.id=c.catid')
|
||||||
|
->where('c.id IN (' . implode(',', array_values($associations)) . ')')
|
||||||
|
->join('LEFT', '#__languages as l ON c.language=l.lang_code')
|
||||||
|
->select('l.image')
|
||||||
|
->select('l.title as language_title');
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$items = $db->loadObjectList('id');
|
||||||
|
}
|
||||||
|
catch (RuntimeException $e)
|
||||||
|
{
|
||||||
|
throw new Exception($e->getMessage(), 500, $e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($items)
|
||||||
|
{
|
||||||
|
foreach ($items as &$item)
|
||||||
|
{
|
||||||
|
$text = strtoupper($item->lang_sef);
|
||||||
|
$url = JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id=' . (int) $item->id);
|
||||||
|
|
||||||
|
$tooltip = htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8') . '<br />' . JText::sprintf('JCATEGORY_SPRINTF', $item->category_title);
|
||||||
|
$classes = 'hasPopover label label-association label-' . $item->lang_sef;
|
||||||
|
|
||||||
|
$item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes
|
||||||
|
. '" data-content="' . $tooltip . '" data-placement="top">'
|
||||||
|
. $text . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JHtml::_('bootstrap.popover');
|
||||||
|
|
||||||
|
$html = JLayoutHelper::render('joomla.content.associations', $items);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
}
|
169
src/administrator/components/com_weblinks/helpers/weblinks.php
Normal file
169
src/administrator/components/com_weblinks/helpers/weblinks.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weblinks helper.
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
class WeblinksHelper extends JHelperContent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Configure the Linkbar.
|
||||||
|
*
|
||||||
|
* @param string $vName The name of the active view.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
public static function addSubmenu($vName = 'weblinks')
|
||||||
|
{
|
||||||
|
JHtmlSidebar::addEntry(
|
||||||
|
JText::_('COM_WEBLINKS_SUBMENU_WEBLINKS'),
|
||||||
|
'index.php?option=com_weblinks&view=weblinks',
|
||||||
|
$vName == 'weblinks'
|
||||||
|
);
|
||||||
|
|
||||||
|
JHtmlSidebar::addEntry(
|
||||||
|
JText::_('COM_WEBLINKS_SUBMENU_CATEGORIES'),
|
||||||
|
'index.php?option=com_categories&extension=com_weblinks',
|
||||||
|
$vName == 'categories'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_weblinks')->get('custom_fields_enable', '1'))
|
||||||
|
{
|
||||||
|
JHtmlSidebar::addEntry(
|
||||||
|
JText::_('JGLOBAL_FIELDS'),
|
||||||
|
'index.php?option=com_fields&context=com_weblinks.weblink',
|
||||||
|
$vName == 'fields.fields'
|
||||||
|
);
|
||||||
|
|
||||||
|
JHtmlSidebar::addEntry(
|
||||||
|
JText::_('JGLOBAL_FIELD_GROUPS'),
|
||||||
|
'index.php?option=com_fields&view=groups&context=com_weblinks.weblink',
|
||||||
|
$vName == 'fields.groups'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds Count Items for WebLinks Category Manager.
|
||||||
|
*
|
||||||
|
* @param stdClass[] &$items The weblinks category objects.
|
||||||
|
*
|
||||||
|
* @return stdClass[] The weblinks category objects.
|
||||||
|
*
|
||||||
|
* @since 3.6.0
|
||||||
|
*/
|
||||||
|
public static function countItems(&$items)
|
||||||
|
{
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
$item->count_trashed = 0;
|
||||||
|
$item->count_archived = 0;
|
||||||
|
$item->count_unpublished = 0;
|
||||||
|
$item->count_published = 0;
|
||||||
|
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select('state, COUNT(*) AS count')
|
||||||
|
->from($db->qn('#__weblinks'))
|
||||||
|
->where($db->qn('catid') . ' = ' . (int) $item->id)
|
||||||
|
->group('state');
|
||||||
|
|
||||||
|
$db->setQuery($query);
|
||||||
|
$weblinks = $db->loadObjectList();
|
||||||
|
|
||||||
|
foreach ($weblinks as $weblink)
|
||||||
|
{
|
||||||
|
if ($weblink->state == 1)
|
||||||
|
{
|
||||||
|
$item->count_published = $weblink->count;
|
||||||
|
}
|
||||||
|
elseif ($weblink->state == 0)
|
||||||
|
{
|
||||||
|
$item->count_unpublished = $weblink->count;
|
||||||
|
}
|
||||||
|
elseif ($weblink->state == 2)
|
||||||
|
{
|
||||||
|
$item->count_archived = $weblink->count;
|
||||||
|
}
|
||||||
|
elseif ($weblink->state == -2)
|
||||||
|
{
|
||||||
|
$item->count_trashed = $weblink->count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds Count Items for Tag Manager.
|
||||||
|
*
|
||||||
|
* @param stdClass[] &$items The weblink tag objects
|
||||||
|
* @param string $extension The name of the active view.
|
||||||
|
*
|
||||||
|
* @return stdClass[]
|
||||||
|
*
|
||||||
|
* @since 3.7.0
|
||||||
|
*/
|
||||||
|
public static function countTagItems(&$items, $extension)
|
||||||
|
{
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
$item->count_trashed = 0;
|
||||||
|
$item->count_archived = 0;
|
||||||
|
$item->count_unpublished = 0;
|
||||||
|
$item->count_published = 0;
|
||||||
|
|
||||||
|
$query = $db->getQuery(true);
|
||||||
|
$query->select('published as state, count(*) AS count')
|
||||||
|
->from($db->qn('#__contentitem_tag_map') . 'AS ct ')
|
||||||
|
->where('ct.tag_id = ' . (int) $item->id)
|
||||||
|
->where('ct.type_alias =' . $db->q($extension))
|
||||||
|
->join('LEFT', $db->qn('#__categories') . ' AS c ON ct.content_item_id=c.id')
|
||||||
|
->group('state');
|
||||||
|
|
||||||
|
$db->setQuery($query);
|
||||||
|
$weblinks = $db->loadObjectList();
|
||||||
|
|
||||||
|
foreach ($weblinks as $weblink)
|
||||||
|
{
|
||||||
|
if ($weblink->state == 1)
|
||||||
|
{
|
||||||
|
$item->count_published = $weblink->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($weblink->state == 0)
|
||||||
|
{
|
||||||
|
$item->count_unpublished = $weblink->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($weblink->state == 2)
|
||||||
|
{
|
||||||
|
$item->count_archived = $weblink->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($weblink->state == -2)
|
||||||
|
{
|
||||||
|
$item->count_trashed = $weblink->count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,266 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
defined('JPATH_BASE') or die;
|
||||||
|
/**
|
||||||
|
* Supports a modal weblink picker.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
class JFormFieldModal_Weblink extends JFormField
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The form field type.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $type = 'Modal_Weblink';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get the field input markup.
|
||||||
|
*
|
||||||
|
* @return string The field input markup.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected function getInput()
|
||||||
|
{
|
||||||
|
$allowNew = ((string) $this->element['new'] == 'true');
|
||||||
|
$allowEdit = ((string) $this->element['edit'] == 'true');
|
||||||
|
$allowClear = ((string) $this->element['clear'] != 'false');
|
||||||
|
$allowSelect = ((string) $this->element['select'] != 'false');
|
||||||
|
|
||||||
|
// Load language
|
||||||
|
JFactory::getLanguage()->load('com_weblinks', JPATH_ADMINISTRATOR);
|
||||||
|
|
||||||
|
// The active weblink id field.
|
||||||
|
$value = (int) $this->value > 0 ? (int) $this->value : '';
|
||||||
|
|
||||||
|
// Create the modal id.
|
||||||
|
$modalId = 'Weblink_' . $this->id;
|
||||||
|
|
||||||
|
// Add the modal field script to the document head.
|
||||||
|
JHtml::_('jquery.framework');
|
||||||
|
JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true));
|
||||||
|
|
||||||
|
// Script to proxy the select modal function to the modal-fields.js file.
|
||||||
|
if ($allowSelect)
|
||||||
|
{
|
||||||
|
static $scriptSelect = null;
|
||||||
|
|
||||||
|
if (is_null($scriptSelect))
|
||||||
|
{
|
||||||
|
$scriptSelect = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($scriptSelect[$this->id]))
|
||||||
|
{
|
||||||
|
JFactory::getDocument()->addScriptDeclaration("
|
||||||
|
function jSelectWeblink_" . $this->id . "(id, title, catid, object, url, language) {
|
||||||
|
window.processModalSelect('Weblink', '" . $this->id . "', id, title, catid, object, url, language);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
);
|
||||||
|
$scriptSelect[$this->id] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup variables for display.
|
||||||
|
$linkWeblinks = 'index.php?option=com_weblinks&view=weblinks&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1';
|
||||||
|
$linkWeblink = 'index.php?option=com_weblinks&view=weblink&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1';
|
||||||
|
$modalTitle = JText::_('COM_WEBLINKS_CHANGE_WEBLINK');
|
||||||
|
|
||||||
|
if (isset($this->element['language']))
|
||||||
|
{
|
||||||
|
$linkWeblinks .= '&forcedLanguage=' . $this->element['language'];
|
||||||
|
$linkWeblink .= '&forcedLanguage=' . $this->element['language'];
|
||||||
|
$modalTitle .= ' — ' . $this->element['label'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$urlSelect = $linkWeblinks . '&function=jSelectWeblink_' . $this->id;
|
||||||
|
$urlEdit = $linkWeblink . '&task=weblink.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \'';
|
||||||
|
$urlNew = $linkWeblink . '&task=weblink.add';
|
||||||
|
|
||||||
|
if ($value)
|
||||||
|
{
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select($db->quoteName('title'))
|
||||||
|
->from($db->quoteName('#__weblinks'))
|
||||||
|
->where($db->quoteName('id') . ' = ' . (int) $value);
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$title = $db->loadResult();
|
||||||
|
}
|
||||||
|
catch (RuntimeException $e)
|
||||||
|
{
|
||||||
|
JError::raiseWarning(500, $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$title = empty($title) ? JText::_('COM_WEBLINKS_SELECT_A_WEBLINK') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
|
// The current weblink display field.
|
||||||
|
$html = '<span class="input-append">';
|
||||||
|
$html .= '<input class="input-medium" id="' . $this->id . '_name" type="text" value="' . $title . '" disabled="disabled" size="35" />';
|
||||||
|
|
||||||
|
// Select weblink button
|
||||||
|
if ($allowSelect)
|
||||||
|
{
|
||||||
|
$html .= '<a'
|
||||||
|
. ' class="btn hasTooltip' . ($value ? ' hidden' : '') . '"'
|
||||||
|
. ' id="' . $this->id . '_select"'
|
||||||
|
. ' data-toggle="modal"'
|
||||||
|
. ' role="button"'
|
||||||
|
. ' href="#ModalSelect' . $modalId . '"'
|
||||||
|
. ' title="' . JHtml::tooltipText('COM_WEBLINKS_CHANGE_WEBLINK') . '">'
|
||||||
|
. '<span class="icon-file" aria-hidden="true"></span> ' . JText::_('JSELECT')
|
||||||
|
. '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// New weblink button
|
||||||
|
if ($allowNew)
|
||||||
|
{
|
||||||
|
$html .= '<a'
|
||||||
|
. ' class="btn hasTooltip' . ($value ? ' hidden' : '') . '"'
|
||||||
|
. ' id="' . $this->id . '_new"'
|
||||||
|
. ' data-toggle="modal"'
|
||||||
|
. ' role="button"'
|
||||||
|
. ' href="#ModalNew' . $modalId . '"'
|
||||||
|
. ' title="' . JHtml::tooltipText('COM_WEBLINKS_NEW_WEBLINK') . '">'
|
||||||
|
. '<span class="icon-new" aria-hidden="true"></span> ' . JText::_('JACTION_CREATE')
|
||||||
|
. '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit weblink button
|
||||||
|
if ($allowEdit)
|
||||||
|
{
|
||||||
|
$html .= '<a'
|
||||||
|
. ' class="btn hasTooltip' . ($value ? '' : ' hidden') . '"'
|
||||||
|
. ' id="' . $this->id . '_edit"'
|
||||||
|
. ' data-toggle="modal"'
|
||||||
|
. ' role="button"'
|
||||||
|
. ' href="#ModalEdit' . $modalId . '"'
|
||||||
|
. ' title="' . JHtml::tooltipText('COM_WEBLINKS_EDIT_WEBLINK') . '">'
|
||||||
|
. '<span class="icon-edit" aria-hidden="true"></span> ' . JText::_('JACTION_EDIT')
|
||||||
|
. '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear weblink button
|
||||||
|
if ($allowClear)
|
||||||
|
{
|
||||||
|
$html .= '<a'
|
||||||
|
. ' class="btn' . ($value ? '' : ' hidden') . '"'
|
||||||
|
. ' id="' . $this->id . '_clear"'
|
||||||
|
. ' href="#"'
|
||||||
|
. ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">'
|
||||||
|
. '<span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR')
|
||||||
|
. '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$html .= '</span>';
|
||||||
|
|
||||||
|
// Select weblink modal
|
||||||
|
if ($allowSelect)
|
||||||
|
{
|
||||||
|
$html .= JHtml::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'ModalSelect' . $modalId,
|
||||||
|
array(
|
||||||
|
'title' => $modalTitle,
|
||||||
|
'url' => $urlSelect,
|
||||||
|
'height' => '400px',
|
||||||
|
'width' => '800px',
|
||||||
|
'bodyHeight' => '70',
|
||||||
|
'modalWidth' => '80',
|
||||||
|
'footer' => '<a role="button" class="btn" data-dismiss="modal" aria-hidden="true">' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// New weblink modal
|
||||||
|
if ($allowNew)
|
||||||
|
{
|
||||||
|
$html .= JHtml::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'ModalNew' . $modalId,
|
||||||
|
array(
|
||||||
|
'title' => JText::_('COM_WEBLINKS_NEW_WEBLINK'),
|
||||||
|
'backdrop' => 'static',
|
||||||
|
'keyboard' => false,
|
||||||
|
'closeButton' => false,
|
||||||
|
'url' => $urlNew,
|
||||||
|
'height' => '400px',
|
||||||
|
'width' => '800px',
|
||||||
|
'bodyHeight' => '70',
|
||||||
|
'modalWidth' => '80',
|
||||||
|
'footer' => '<a role="button" class="btn" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'weblink\', \'cancel\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
|
||||||
|
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'weblink\', \'save\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JSAVE') . '</a>'
|
||||||
|
. '<a role="button" class="btn btn-success" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'weblink\', \'apply\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JAPPLY') . '</a>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit weblink modal
|
||||||
|
if ($allowEdit)
|
||||||
|
{
|
||||||
|
$html .= JHtml::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'ModalEdit' . $modalId,
|
||||||
|
array(
|
||||||
|
'title' => JText::_('COM_WEBLINKS_EDIT_WEBLINK'),
|
||||||
|
'backdrop' => 'static',
|
||||||
|
'keyboard' => false,
|
||||||
|
'closeButton' => false,
|
||||||
|
'url' => $urlEdit,
|
||||||
|
'height' => '400px',
|
||||||
|
'width' => '800px',
|
||||||
|
'bodyHeight' => '70',
|
||||||
|
'modalWidth' => '80',
|
||||||
|
'footer' => '<a role="button" class="btn" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'weblink\', \'cancel\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
|
||||||
|
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'weblink\', \'save\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JSAVE') . '</a>'
|
||||||
|
. '<a role="button" class="btn btn-success" aria-hidden="true"'
|
||||||
|
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'weblink\', \'apply\', \'weblink-form\'); return false;">'
|
||||||
|
. JText::_('JAPPLY') . '</a>',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note: class='required' for client side validation.
|
||||||
|
$class = $this->required ? ' class="required modal-value"' : '';
|
||||||
|
$html .= '<input type="hidden" id="' . $this->id . '_id" ' . $class . ' data-required="' . (int) $this->required . '" name="' . $this->name
|
||||||
|
. '" data-text="' . htmlspecialchars(JText::_('COM_WEBLINKS_SELECT_A_WEBLINK', true), ENT_COMPAT, 'UTF-8') . '" value="' . $value . '" />';
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get the field label markup.
|
||||||
|
*
|
||||||
|
* @return string The field label markup.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected function getLabel()
|
||||||
|
{
|
||||||
|
return str_replace($this->id, $this->id . '_id', parent::getLabel());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,108 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<form>
|
||||||
|
<fields name="filter">
|
||||||
|
<field
|
||||||
|
name="search"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FILTER_SEARCH_LABEL"
|
||||||
|
description="COM_WEBLINKS_FILTER_SEARCH_DESC"
|
||||||
|
hint="JSEARCH_FILTER"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="published"
|
||||||
|
type="status"
|
||||||
|
label="JOPTION_FILTER_PUBLISHED"
|
||||||
|
description="JOPTION_FILTER_PUBLISHED_DESC"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_PUBLISHED</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="category_id"
|
||||||
|
type="category"
|
||||||
|
label="JOPTION_FILTER_CATEGORY"
|
||||||
|
description="JOPTION_FILTER_CATEGORY_DESC"
|
||||||
|
extension="com_weblinks"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_CATEGORY</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="access"
|
||||||
|
type="accesslevel"
|
||||||
|
label="JOPTION_FILTER_ACCESS"
|
||||||
|
description="JOPTION_FILTER_ACCESS_DESC"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_ACCESS</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="language"
|
||||||
|
type="contentlanguage"
|
||||||
|
label="JOPTION_FILTER_LANGUAGE"
|
||||||
|
description="JOPTION_FILTER_LANGUAGE_DESC"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_LANGUAGE</option>
|
||||||
|
<option value="*">JALL</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="tag"
|
||||||
|
type="tag"
|
||||||
|
label="JOPTION_FILTER_TAG"
|
||||||
|
description="JOPTION_FILTER_TAG_DESC"
|
||||||
|
mode="nested"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_TAG</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="level"
|
||||||
|
type="integer"
|
||||||
|
label="JOPTION_FILTER_LEVEL"
|
||||||
|
description="JOPTION_FILTER_LEVEL_DESC"
|
||||||
|
first="1"
|
||||||
|
last="10"
|
||||||
|
step="1"
|
||||||
|
languages="*"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
>
|
||||||
|
<option value="">JOPTION_SELECT_MAX_LEVELS</option>
|
||||||
|
</field>
|
||||||
|
</fields>
|
||||||
|
<fields name="list">
|
||||||
|
<field
|
||||||
|
name="fullordering"
|
||||||
|
type="list"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
default="a.title ASC"
|
||||||
|
>
|
||||||
|
<option value="">JGLOBAL_SORT_BY</option>
|
||||||
|
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
|
||||||
|
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
|
||||||
|
<option value="a.state ASC">JSTATUS_ASC</option>
|
||||||
|
<option value="a.state DESC">JSTATUS_DESC</option>
|
||||||
|
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option>
|
||||||
|
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
|
||||||
|
<option value="category_title ASC">JCATEGORY_ASC</option>
|
||||||
|
<option value="category_title DESC">JCATEGORY_DESC</option>
|
||||||
|
<option value="access_level ASC">JGRID_HEADING_ACCESS_ASC</option>
|
||||||
|
<option value="access_level DESC">JGRID_HEADING_ACCESS_DESC</option>
|
||||||
|
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
|
||||||
|
<option value="a.hits DESC">JGLOBAL_HITS_DESC</option>
|
||||||
|
<option value="association ASC" requires="associations">JASSOCIATIONS_ASC</option>
|
||||||
|
<option value="association DESC" requires="associations">JASSOCIATIONS_DESC</option>
|
||||||
|
<option value="language_title ASC">JGRID_HEADING_LANGUAGE_ASC</option>
|
||||||
|
<option value="language_title DESC">JGRID_HEADING_LANGUAGE_DESC</option>
|
||||||
|
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||||
|
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="limit"
|
||||||
|
type="limitbox"
|
||||||
|
class="input-mini"
|
||||||
|
default="25"
|
||||||
|
onchange="this.form.submit();"
|
||||||
|
/>
|
||||||
|
</fields>
|
||||||
|
</form>
|
@ -0,0 +1,422 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<form>
|
||||||
|
<fieldset
|
||||||
|
addfieldpath="/administrator/components/com_categories/models/fields"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="id"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_FIELD_ID_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_ID_DESC"
|
||||||
|
readonly="true"
|
||||||
|
class="readonly"
|
||||||
|
default="0"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="title"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_TITLE"
|
||||||
|
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
||||||
|
class="input-xxlarge input-large-text"
|
||||||
|
size="40"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="alias"
|
||||||
|
type="text"
|
||||||
|
label="JFIELD_ALIAS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
||||||
|
size="40"
|
||||||
|
hint="JFIELD_ALIAS_PLACEHOLDER"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="catid"
|
||||||
|
type="categoryedit"
|
||||||
|
label="JCATEGORY"
|
||||||
|
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
||||||
|
extension="com_weblinks"
|
||||||
|
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
|
||||||
|
required="true"
|
||||||
|
default=""
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="url"
|
||||||
|
type="url"
|
||||||
|
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_URL_DESC"
|
||||||
|
class="span12"
|
||||||
|
filter="url"
|
||||||
|
size="40"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="description"
|
||||||
|
type="editor"
|
||||||
|
label="JGLOBAL_DESCRIPTION"
|
||||||
|
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
||||||
|
buttons="true"
|
||||||
|
hide="pagebreak,readmore"
|
||||||
|
filter="JComponentHelper::filterText"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="hits"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_HITS"
|
||||||
|
description="COM_WEBLINKS_HITS_DESC"
|
||||||
|
class="readonly"
|
||||||
|
size="6"
|
||||||
|
readonly="true"
|
||||||
|
filter="unset"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="state"
|
||||||
|
type="list"
|
||||||
|
label="JSTATUS"
|
||||||
|
description="COM_WEBLINKS_FIELD_STATE_DESC"
|
||||||
|
class="chzn-color-state"
|
||||||
|
size="1"
|
||||||
|
default="1"
|
||||||
|
>
|
||||||
|
<option value="1">JPUBLISHED</option>
|
||||||
|
<option value="0">JUNPUBLISHED</option>
|
||||||
|
<option value="2">JARCHIVED</option>
|
||||||
|
<option value="-3">COM_WEBLINKS_FIELD_VALUE_REPORTED</option>
|
||||||
|
<option value="-2">JTRASHED</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="ordering"
|
||||||
|
type="ordering"
|
||||||
|
label="JFIELD_ORDERING_LABEL"
|
||||||
|
description="JFIELD_ORDERING_DESC"
|
||||||
|
content_type="com_weblinks.weblink"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="access"
|
||||||
|
type="accesslevel"
|
||||||
|
label="JFIELD_ACCESS_LABEL"
|
||||||
|
description="JFIELD_ACCESS_DESC"
|
||||||
|
size="1"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="language"
|
||||||
|
type="contentlanguage"
|
||||||
|
label="JFIELD_LANGUAGE_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_LANGUAGE_DESC"
|
||||||
|
>
|
||||||
|
<option value="*">JALL</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="tags"
|
||||||
|
type="tag"
|
||||||
|
label="JTAG"
|
||||||
|
description="JTAG_DESC"
|
||||||
|
multiple="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="version_note"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
||||||
|
size="45"
|
||||||
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="created"
|
||||||
|
type="calendar"
|
||||||
|
label="JGLOBAL_FIELD_CREATED_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_CREATED_DESC"
|
||||||
|
size="22"
|
||||||
|
format="%Y-%m-%d %H:%M:%S"
|
||||||
|
filter="user_utc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="created_by"
|
||||||
|
type="user"
|
||||||
|
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_CREATED_BY_Desc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="created_by_alias"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="modified"
|
||||||
|
type="calendar"
|
||||||
|
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_MODIFIED_DESC"
|
||||||
|
class="readonly"
|
||||||
|
size="22"
|
||||||
|
readonly="true"
|
||||||
|
format="%Y-%m-%d %H:%M:%S"
|
||||||
|
filter="user_utc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="modified_by"
|
||||||
|
type="user"
|
||||||
|
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
||||||
|
class="readonly"
|
||||||
|
readonly="true"
|
||||||
|
filter="unset"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="checked_out"
|
||||||
|
type="hidden"
|
||||||
|
filter="unset"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="checked_out_time"
|
||||||
|
type="hidden"
|
||||||
|
filter="unset"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="publish_up"
|
||||||
|
type="calendar"
|
||||||
|
label="JGLOBAL_FIELD_PUBLISH_UP_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_PUBLISH_UP_DESC"
|
||||||
|
format="%Y-%m-%d %H:%M:%S"
|
||||||
|
size="22"
|
||||||
|
filter="user_utc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="publish_down"
|
||||||
|
type="calendar"
|
||||||
|
label="JGLOBAL_FIELD_PUBLISH_DOWN_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_PUBLISH_DOWN_DESC"
|
||||||
|
format="%Y-%m-%d %H:%M:%S"
|
||||||
|
size="22"
|
||||||
|
filter="user_utc"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="version"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_VERSION_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_VERSION_DESC"
|
||||||
|
class="readonly"
|
||||||
|
size="6"
|
||||||
|
readonly="true"
|
||||||
|
filter="unset"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="metakey"
|
||||||
|
type="textarea"
|
||||||
|
label="JFIELD_META_KEYWORDS_LABEL"
|
||||||
|
description="JFIELD_META_KEYWORDS_DESC"
|
||||||
|
rows="3"
|
||||||
|
cols="30"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="metadesc"
|
||||||
|
type="textarea"
|
||||||
|
label="JFIELD_META_DESCRIPTION_LABEL"
|
||||||
|
description="JFIELD_META_DESCRIPTION_DESC"
|
||||||
|
rows="3"
|
||||||
|
cols="30"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="xreference"
|
||||||
|
type="text"
|
||||||
|
label="JFIELD_XREFERENCE_LABEL"
|
||||||
|
description="JFIELD_XREFERENCE_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fields
|
||||||
|
name="params"
|
||||||
|
label="JGLOBAL_FIELDSET_DISPLAY_OPTIONS"
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
name="jbasic"
|
||||||
|
label="COM_WEBLINKS_FIELDSET_OPTIONS"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="target"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
||||||
|
default=""
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JBROWSERTARGET_PARENT</option>
|
||||||
|
<option value="1">JBROWSERTARGET_NEW</option>
|
||||||
|
<option value="2">JBROWSERTARGET_POPUP</option>
|
||||||
|
<option value="3">JBROWSERTARGET_MODAL</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="width"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_WIDTH_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_WIDTH_DESC"
|
||||||
|
class="validate-numeric"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="height"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_HEIGHT_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_HEIGHT_DESC"
|
||||||
|
class="validate-numeric"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="count_clicks"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
||||||
|
class="chzn-color"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
|
||||||
|
<fields
|
||||||
|
name="images"
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
name="images"
|
||||||
|
label="JGLOBAL_FIELDSET_IMAGE_OPTIONS"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="image_first"
|
||||||
|
type="media"
|
||||||
|
label="COM_WEBLINKS_FIELD_FIRST_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_FIRST_DESC"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="float_first"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
|
||||||
|
description="COM_WEBLINKS_FLOAT_FIRST_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="image_first_alt"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_IMAGE_ALT_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="image_first_caption"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer1"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="image_second"
|
||||||
|
type="media"
|
||||||
|
label="COM_WEBLINKS_FIELD_SECOND_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_SECOND_DESC"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="float_second"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
|
||||||
|
description="COM_WEBLINKS_FLOAT_SECOND_DESC"
|
||||||
|
>
|
||||||
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="image_second_alt"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_IMAGE_ALT_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="image_second_caption"
|
||||||
|
type="text"
|
||||||
|
label="COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC"
|
||||||
|
size="20"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
|
||||||
|
<fields
|
||||||
|
name="metadata"
|
||||||
|
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"
|
||||||
|
>
|
||||||
|
<fieldset
|
||||||
|
name="jmetadata"
|
||||||
|
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="robots"
|
||||||
|
type="list"
|
||||||
|
label="JFIELD_METADATA_ROBOTS_LABEL"
|
||||||
|
description="JFIELD_METADATA_ROBOTS_DESC"
|
||||||
|
>
|
||||||
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
|
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
||||||
|
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
||||||
|
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
|
||||||
|
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="rights"
|
||||||
|
type="text"
|
||||||
|
label="JFIELD_META_RIGHTS_LABEL"
|
||||||
|
description="JFIELD_META_RIGHTS_DESC"
|
||||||
|
required="false"
|
||||||
|
filter="string"
|
||||||
|
cols="30"
|
||||||
|
rows="2"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</form>
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -11,6 +11,8 @@ defined('_JEXEC') or die;
|
|||||||
|
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
|
JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_weblinks/helpers/weblinks.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblinks model.
|
* Weblinks model.
|
||||||
*
|
*
|
||||||
@ -18,15 +20,22 @@ use Joomla\Registry\Registry;
|
|||||||
*/
|
*/
|
||||||
class WeblinksModelWeblink extends JModelAdmin
|
class WeblinksModelWeblink extends JModelAdmin
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type alias for this content type.
|
* The type alias for this content type.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @since 3.2
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
public $typeAlias = 'com_weblinks.weblink';
|
public $typeAlias = 'com_weblinks.weblink';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The context used for the associations table
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $associationsContext = 'com_weblinks.item';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The prefix to use with controller messages.
|
* The prefix to use with controller messages.
|
||||||
*
|
*
|
||||||
@ -52,16 +61,13 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
if ($record->catid)
|
if ($record->catid)
|
||||||
{
|
{
|
||||||
return $user->authorise('core.delete', 'com_weblinks.category.'.(int) $record->catid);
|
return JFactory::getUser()->authorise('core.delete', 'com_weblinks.category.' . (int) $record->catid);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return parent::canDelete($record);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return parent::canDelete($record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,16 +82,12 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
*/
|
*/
|
||||||
protected function canEditState($record)
|
protected function canEditState($record)
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
if (!empty($record->catid))
|
if (!empty($record->catid))
|
||||||
{
|
{
|
||||||
return $user->authorise('core.edit.state', 'com_weblinks.category.'.(int) $record->catid);
|
return JFactory::getUser()->authorise('core.edit.state', 'com_weblinks.category.' . (int) $record->catid);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return parent::canEditState($record);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return parent::canEditState($record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,6 +155,12 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
$form->setFieldAttribute('publish_down', 'filter', 'unset');
|
$form->setFieldAttribute('publish_down', 'filter', 'unset');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't allow to change the created_by user if not allowed to access com_users.
|
||||||
|
if (!JFactory::getUser()->authorise('core.manage', 'com_users'))
|
||||||
|
{
|
||||||
|
$form->setFieldAttribute('created_by', 'filter', 'unset');
|
||||||
|
}
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,6 +216,24 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
$registry->loadString($item->images);
|
$registry->loadString($item->images);
|
||||||
$item->images = $registry->toArray();
|
$item->images = $registry->toArray();
|
||||||
|
|
||||||
|
// Load associated web links items
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
if ($assoc)
|
||||||
|
{
|
||||||
|
$item->associations = array();
|
||||||
|
|
||||||
|
if ($item->id != null)
|
||||||
|
{
|
||||||
|
$associations = JLanguageAssociations::getAssociations('com_weblinks', '#__weblinks', 'com_weblinks.item', $item->id);
|
||||||
|
|
||||||
|
foreach ($associations as $tag => $association)
|
||||||
|
{
|
||||||
|
$item->associations[$tag] = $association->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($item->id))
|
if (!empty($item->id))
|
||||||
{
|
{
|
||||||
$item->tags = new JHelperTags;
|
$item->tags = new JHelperTags;
|
||||||
@ -234,11 +260,11 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
$table->title = htmlspecialchars_decode($table->title, ENT_QUOTES);
|
$table->title = htmlspecialchars_decode($table->title, ENT_QUOTES);
|
||||||
$table->alias = JApplication::stringURLSafe($table->alias);
|
$table->alias = JApplicationHelper::stringURLSafe($table->alias);
|
||||||
|
|
||||||
if (empty($table->alias))
|
if (empty($table->alias))
|
||||||
{
|
{
|
||||||
$table->alias = JApplication::stringURLSafe($table->title);
|
$table->alias = JApplicationHelper::stringURLSafe($table->title);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($table->id))
|
if (empty($table->id))
|
||||||
@ -262,7 +288,7 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
{
|
{
|
||||||
// Set the values
|
// Set the values
|
||||||
$table->modified = $date->toSql();
|
$table->modified = $date->toSql();
|
||||||
$table->modified_by = $user->get('id');
|
$table->modified_by = $user->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,6 +326,31 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
|
|
||||||
|
JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');
|
||||||
|
|
||||||
|
// Cast catid to integer for comparison
|
||||||
|
$catid = (int) $data['catid'];
|
||||||
|
|
||||||
|
// Check if New Category exists
|
||||||
|
if ($catid > 0)
|
||||||
|
{
|
||||||
|
$catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_weblinks');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save New Category
|
||||||
|
if ($catid == 0 && $this->canCreateCategory())
|
||||||
|
{
|
||||||
|
$table = array();
|
||||||
|
$table['title'] = $data['catid'];
|
||||||
|
$table['parent_id'] = 1;
|
||||||
|
$table['extension'] = 'com_weblinks';
|
||||||
|
$table['language'] = $data['language'];
|
||||||
|
$table['published'] = 1;
|
||||||
|
|
||||||
|
// Create new category and get catid back
|
||||||
|
$data['catid'] = CategoriesHelper::createCategory($table);
|
||||||
|
}
|
||||||
|
|
||||||
// Alter the title for save as copy
|
// Alter the title for save as copy
|
||||||
if ($app->input->get('task') == 'save2copy')
|
if ($app->input->get('task') == 'save2copy')
|
||||||
{
|
{
|
||||||
@ -340,4 +391,68 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||||||
|
|
||||||
return array($name, $alias);
|
return array($name, $alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows preprocessing of the JForm object.
|
||||||
|
*
|
||||||
|
* @param JForm $form The form object
|
||||||
|
* @param array $data The data to be merged into the form object
|
||||||
|
* @param string $group The plugin group to be executed
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.6.0
|
||||||
|
*/
|
||||||
|
protected function preprocessForm(JForm $form, $data, $group = 'content')
|
||||||
|
{
|
||||||
|
if ($this->canCreateCategory())
|
||||||
|
{
|
||||||
|
$form->setFieldAttribute('catid', 'allowAdd', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Association weblinks items
|
||||||
|
if (JLanguageAssociations::isEnabled())
|
||||||
|
{
|
||||||
|
$languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc');
|
||||||
|
|
||||||
|
if (count($languages) > 1)
|
||||||
|
{
|
||||||
|
$addform = new SimpleXMLElement('<form />');
|
||||||
|
$fields = $addform->addChild('fields');
|
||||||
|
$fields->addAttribute('name', 'associations');
|
||||||
|
$fieldset = $fields->addChild('fieldset');
|
||||||
|
$fieldset->addAttribute('name', 'item_associations');
|
||||||
|
|
||||||
|
foreach ($languages as $language)
|
||||||
|
{
|
||||||
|
$field = $fieldset->addChild('field');
|
||||||
|
$field->addAttribute('name', $language->lang_code);
|
||||||
|
$field->addAttribute('type', 'modal_weblink');
|
||||||
|
$field->addAttribute('language', $language->lang_code);
|
||||||
|
$field->addAttribute('label', $language->title);
|
||||||
|
$field->addAttribute('translate_label', 'false');
|
||||||
|
$field->addAttribute('select', 'true');
|
||||||
|
$field->addAttribute('new', 'true');
|
||||||
|
$field->addAttribute('edit', 'true');
|
||||||
|
$field->addAttribute('clear', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
|
$form->load($addform, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::preprocessForm($form, $data, $group);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the user allowed to create an on the fly category?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*
|
||||||
|
* @since 3.6.0
|
||||||
|
*/
|
||||||
|
private function canCreateCategory()
|
||||||
|
{
|
||||||
|
return JFactory::getUser()->authorise('core.create', 'com_weblinks');
|
||||||
|
}
|
||||||
}
|
}
|
285
src/administrator/components/com_weblinks/models/weblinks.php
Normal file
285
src/administrator/components/com_weblinks/models/weblinks.php
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Methods supporting a list of weblink records.
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
class WeblinksModelWeblinks extends JModelList
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param array $config An optional associative array of configuration settings.
|
||||||
|
*
|
||||||
|
* @see JControllerLegacy
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
public function __construct($config = array())
|
||||||
|
{
|
||||||
|
if (empty($config['filter_fields']))
|
||||||
|
{
|
||||||
|
$config['filter_fields'] = array(
|
||||||
|
'id', 'a.id',
|
||||||
|
'title', 'a.title',
|
||||||
|
'alias', 'a.alias',
|
||||||
|
'checked_out', 'a.checked_out',
|
||||||
|
'checked_out_time', 'a.checked_out_time',
|
||||||
|
'catid', 'a.catid', 'category_id',
|
||||||
|
'c.title', 'category_title',
|
||||||
|
'state', 'a.state', 'published',
|
||||||
|
'access', 'a.access',
|
||||||
|
'ag.title', 'access_level',
|
||||||
|
'created', 'a.created',
|
||||||
|
'created_by', 'a.created_by',
|
||||||
|
'ordering', 'a.ordering',
|
||||||
|
'featured', 'a.featured',
|
||||||
|
'language', 'a.language',
|
||||||
|
'l.title', 'language_title',
|
||||||
|
'hits', 'a.hits',
|
||||||
|
'publish_up', 'a.publish_up',
|
||||||
|
'publish_down', 'a.publish_down',
|
||||||
|
'url', 'a.url',
|
||||||
|
'tag',
|
||||||
|
'level', 'c.level',
|
||||||
|
);
|
||||||
|
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
if ($assoc)
|
||||||
|
{
|
||||||
|
$config['filter_fields'][] = 'association';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct($config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to auto-populate the model state.
|
||||||
|
*
|
||||||
|
* @param string $ordering An optional ordering field.
|
||||||
|
* @param string $direction An optional direction (asc|desc).
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @note Calling getState in this method will result in recursion.
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
protected function populateState($ordering = 'a.title', $direction = 'asc')
|
||||||
|
{
|
||||||
|
$app = JFactory::getApplication();
|
||||||
|
|
||||||
|
$forcedLanguage = $app->input->get('forcedLanguage', '', 'cmd');
|
||||||
|
|
||||||
|
// Adjust the context to support modal layouts.
|
||||||
|
if ($layout = $app->input->get('layout'))
|
||||||
|
{
|
||||||
|
$this->context .= '.' . $layout;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjust the context to support forced languages.
|
||||||
|
if ($forcedLanguage)
|
||||||
|
{
|
||||||
|
$this->context .= '.' . $forcedLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the filter state.
|
||||||
|
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
|
||||||
|
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
|
||||||
|
$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));
|
||||||
|
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'cmd'));
|
||||||
|
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
|
||||||
|
$this->setState('filter.tag', $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '', 'string'));
|
||||||
|
$this->setState('filter.level', $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', '', 'cmd'));
|
||||||
|
|
||||||
|
// Load the parameters.
|
||||||
|
$params = JComponentHelper::getParams('com_weblinks');
|
||||||
|
$this->setState('params', $params);
|
||||||
|
|
||||||
|
// Force a language.
|
||||||
|
if (!empty($forcedLanguage))
|
||||||
|
{
|
||||||
|
$this->setState('filter.language', $forcedLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
|
// List state information.
|
||||||
|
parent::populateState($ordering, $direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get a store id based on model configuration state.
|
||||||
|
*
|
||||||
|
* This is necessary because the model is used by the component and
|
||||||
|
* different modules that might need different sets of data or different
|
||||||
|
* ordering requirements.
|
||||||
|
*
|
||||||
|
* @param string $id A prefix for the store id.
|
||||||
|
*
|
||||||
|
* @return string A store id.
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
protected function getStoreId($id = '')
|
||||||
|
{
|
||||||
|
// Compile the store id.
|
||||||
|
$id .= ':' . $this->getState('filter.search');
|
||||||
|
$id .= ':' . $this->getState('filter.access');
|
||||||
|
$id .= ':' . $this->getState('filter.published');
|
||||||
|
$id .= ':' . $this->getState('filter.category_id');
|
||||||
|
$id .= ':' . $this->getState('filter.language');
|
||||||
|
$id .= ':' . $this->getState('filter.tag');
|
||||||
|
$id .= ':' . $this->getState('filter.level');
|
||||||
|
|
||||||
|
return parent::getStoreId($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build an SQL query to load the list data.
|
||||||
|
*
|
||||||
|
* @return JDatabaseQuery
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
protected function getListQuery()
|
||||||
|
{
|
||||||
|
// Create a new query object.
|
||||||
|
$db = $this->getDbo();
|
||||||
|
$query = $db->getQuery(true);
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
// Select the required fields from the table.
|
||||||
|
$query->select(
|
||||||
|
$this->getState(
|
||||||
|
'list.select',
|
||||||
|
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, ' .
|
||||||
|
'a.hits, a.state, a.access, a.ordering, a.language, a.publish_up, a.publish_down'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$query->from($db->quoteName('#__weblinks', 'a'));
|
||||||
|
|
||||||
|
// Join over the language
|
||||||
|
$query->select($db->quoteName('l.title', 'language_title'))
|
||||||
|
->select($db->quoteName('l.image', 'language_image'))
|
||||||
|
->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON ' . $db->qn('l.lang_code') . ' = ' . $db->qn('a.language'));
|
||||||
|
|
||||||
|
// Join over the users for the checked out user.
|
||||||
|
$query->select($db->quoteName('uc.name', 'editor'))
|
||||||
|
->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON ' . $db->qn('uc.id') . ' = ' . $db->qn('a.checked_out'));
|
||||||
|
|
||||||
|
// Join over the asset groups.
|
||||||
|
$query->select($db->quoteName('ag.title', 'access_level'))
|
||||||
|
->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ' . $db->qn('ag.id') . ' = ' . $db->qn('a.access'));
|
||||||
|
|
||||||
|
// Join over the categories.
|
||||||
|
$query->select('c.title AS category_title')
|
||||||
|
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid'));
|
||||||
|
|
||||||
|
// Join over the associations.
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
if ($assoc)
|
||||||
|
{
|
||||||
|
$query->select('COUNT(asso2.id)>1 AS association')
|
||||||
|
->join('LEFT', $db->quoteName('#__associations', 'asso') . ' ON asso.id = a.id AND asso.context = ' . $db->quote('com_weblinks.item'))
|
||||||
|
->join('LEFT', $db->quoteName('#__associations', 'asso2') . ' ON asso2.key = asso.key')
|
||||||
|
->group('a.id, l.title, l.image, uc.name, ag.title, c.title');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by access level.
|
||||||
|
if ($access = $this->getState('filter.access'))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('a.access') . ' = ' . (int) $access);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement View Level Access
|
||||||
|
if (!$user->authorise('core.admin'))
|
||||||
|
{
|
||||||
|
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||||
|
$query->where($db->quoteName('a.access') . ' IN (' . $groups . ')');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by published state
|
||||||
|
$published = $this->getState('filter.published');
|
||||||
|
|
||||||
|
if (is_numeric($published))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('a.state') . ' = ' . (int) $published);
|
||||||
|
}
|
||||||
|
elseif ($published === '')
|
||||||
|
{
|
||||||
|
$query->where('(' . $db->quoteName('a.state') . ' IN (0, 1))');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by category.
|
||||||
|
$categoryId = $this->getState('filter.category_id');
|
||||||
|
|
||||||
|
if (is_numeric($categoryId))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('a.catid') . ' = ' . (int) $categoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter on the level.
|
||||||
|
if ($level = $this->getState('filter.level'))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('c.level') . ' <= ' . (int) $level);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by search in title
|
||||||
|
$search = $this->getState('filter.search');
|
||||||
|
|
||||||
|
if (!empty($search))
|
||||||
|
{
|
||||||
|
if (stripos($search, 'id:') === 0)
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
|
||||||
|
$query->where('(' . $db->quoteName('a.title') . ' LIKE ' . $search . ' OR ' . $db->quoteName('a.alias') . ' LIKE ' . $search . ')');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter on the language.
|
||||||
|
if ($language = $this->getState('filter.language'))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('a.language') . ' = ' . $db->quote($language));
|
||||||
|
}
|
||||||
|
|
||||||
|
$tagId = $this->getState('filter.tag');
|
||||||
|
|
||||||
|
// Filter by a single tag.
|
||||||
|
if (is_numeric($tagId))
|
||||||
|
{
|
||||||
|
$query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId)
|
||||||
|
->join(
|
||||||
|
'LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap')
|
||||||
|
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
|
||||||
|
. ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_weblinks.weblink')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the list ordering clause.
|
||||||
|
$orderCol = $this->state->get('list.ordering', 'a.title');
|
||||||
|
$orderDirn = $this->state->get('list.direction', 'ASC');
|
||||||
|
|
||||||
|
if ($orderCol == 'a.ordering' || $orderCol == 'category_title')
|
||||||
|
{
|
||||||
|
$orderCol = 'c.title ' . $orderDirn . ', a.ordering';
|
||||||
|
}
|
||||||
|
|
||||||
|
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
281
src/administrator/components/com_weblinks/script.php
Normal file
281
src/administrator/components/com_weblinks/script.php
Normal file
@ -0,0 +1,281 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installation class to perform additional changes during install/uninstall/update
|
||||||
|
*
|
||||||
|
* @since 3.4
|
||||||
|
*/
|
||||||
|
class Com_WeblinksInstallerScript
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Function to perform changes during install
|
||||||
|
*
|
||||||
|
* @param JInstallerAdapterComponent $parent The class calling this method
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.4
|
||||||
|
*/
|
||||||
|
public function install($parent)
|
||||||
|
{
|
||||||
|
// Initialize a new category
|
||||||
|
/** @type JTableCategory $category */
|
||||||
|
$category = JTable::getInstance('Category');
|
||||||
|
|
||||||
|
// Check if the Uncategorised category exists before adding it
|
||||||
|
if (!$category->load(array('extension' => 'com_weblinks', 'title' => 'Uncategorised')))
|
||||||
|
{
|
||||||
|
$category->extension = 'com_weblinks';
|
||||||
|
$category->title = 'Uncategorised';
|
||||||
|
$category->description = '';
|
||||||
|
$category->published = 1;
|
||||||
|
$category->access = 1;
|
||||||
|
$category->params = '{"category_layout":"","image":""}';
|
||||||
|
$category->metadata = '{"author":"","robots":""}';
|
||||||
|
$category->metadesc = '';
|
||||||
|
$category->metakey = '';
|
||||||
|
$category->language = '*';
|
||||||
|
$category->checked_out_time = JFactory::getDbo()->getNullDate();
|
||||||
|
$category->version = 1;
|
||||||
|
$category->hits = 0;
|
||||||
|
$category->modified_user_id = 0;
|
||||||
|
$category->checked_out = 0;
|
||||||
|
|
||||||
|
// Set the location in the tree
|
||||||
|
$category->setLocation(1, 'last-child');
|
||||||
|
|
||||||
|
// Check to make sure our data is valid
|
||||||
|
if (!$category->check())
|
||||||
|
{
|
||||||
|
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now store the category
|
||||||
|
if (!$category->store(true))
|
||||||
|
{
|
||||||
|
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build the path for our category
|
||||||
|
$category->rebuildPath($category->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to run after the install routine.
|
||||||
|
*
|
||||||
|
* @param string $type The action being performed
|
||||||
|
* @param JInstallerAdapterComponent $parent The class calling this method
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.4.1
|
||||||
|
*/
|
||||||
|
public function postflight($type, $parent)
|
||||||
|
{
|
||||||
|
// Only execute database changes on MySQL databases
|
||||||
|
$dbName = JFactory::getDbo()->name;
|
||||||
|
|
||||||
|
if (strpos($dbName, 'mysql') !== false)
|
||||||
|
{
|
||||||
|
// Add Missing Table Colums if needed
|
||||||
|
$this->addColumnsIfNeeded();
|
||||||
|
|
||||||
|
// Drop the Table Colums if needed
|
||||||
|
$this->dropColumnsIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert missing UCM Records if needed
|
||||||
|
$this->insertMissingUcmRecords();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to insert missing records for the UCM tables
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.4.1
|
||||||
|
*/
|
||||||
|
private function insertMissingUcmRecords()
|
||||||
|
{
|
||||||
|
// Insert the rows in the #__content_types table if they don't exist already
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
|
||||||
|
// Get the type ID for a Weblink
|
||||||
|
$query = $db->getQuery(true);
|
||||||
|
$query->select($db->quoteName('type_id'))
|
||||||
|
->from($db->quoteName('#__content_types'))
|
||||||
|
->where($db->quoteName('type_alias') . ' = ' . $db->quote('com_weblinks.weblink'));
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
$weblinkTypeId = $db->loadResult();
|
||||||
|
|
||||||
|
// Get the type ID for a Weblink Category
|
||||||
|
$query->clear('where');
|
||||||
|
$query->where($db->quoteName('type_alias') . ' = ' . $db->quote('com_weblinks.category'));
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
$categoryTypeId = $db->loadResult();
|
||||||
|
|
||||||
|
// Set the table columns to insert table to
|
||||||
|
$columnsArray = array(
|
||||||
|
$db->quoteName('type_title'),
|
||||||
|
$db->quoteName('type_alias'),
|
||||||
|
$db->quoteName('table'),
|
||||||
|
$db->quoteName('rules'),
|
||||||
|
$db->quoteName('field_mappings'),
|
||||||
|
$db->quoteName('router'),
|
||||||
|
$db->quoteName('content_history_options'),
|
||||||
|
);
|
||||||
|
|
||||||
|
// If we have no type id for com_weblinks.weblink insert it
|
||||||
|
if (!$weblinkTypeId)
|
||||||
|
{
|
||||||
|
// Insert the data.
|
||||||
|
$query->clear();
|
||||||
|
$query->insert($db->quoteName('#__content_types'));
|
||||||
|
$query->columns($columnsArray);
|
||||||
|
$query->values(
|
||||||
|
$db->quote('Weblink') . ', '
|
||||||
|
. $db->quote('com_weblinks.weblink') . ', '
|
||||||
|
. $db->quote(
|
||||||
|
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
||||||
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
|
. $db->quote('') . ', '
|
||||||
|
. $db->quote(
|
||||||
|
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
||||||
|
"core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"hits",
|
||||||
|
"core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params",
|
||||||
|
"core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"url",
|
||||||
|
"core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc",
|
||||||
|
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}'
|
||||||
|
) . ', '
|
||||||
|
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
||||||
|
. $db->quote(
|
||||||
|
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
||||||
|
"hideFields":["asset_id","checked_out","checked_out_time","version","featured","images"], "ignoreChanges":["modified_by",
|
||||||
|
"modified", "checked_out", "checked_out_time", "version", "hits"], "convertToInt":["publish_up", "publish_down", "featured",
|
||||||
|
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
||||||
|
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
||||||
|
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
||||||
|
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$db->setQuery($query);
|
||||||
|
$db->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have no type id for com_weblinks.category insert it
|
||||||
|
if (!$categoryTypeId)
|
||||||
|
{
|
||||||
|
// Insert the data.
|
||||||
|
$query->clear();
|
||||||
|
$query->insert($db->quoteName('#__content_types'));
|
||||||
|
$query->columns($columnsArray);
|
||||||
|
$query->values(
|
||||||
|
$db->quote('Weblinks Category') . ', '
|
||||||
|
. $db->quote('com_weblinks.category') . ', '
|
||||||
|
. $db->quote('
|
||||||
|
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
||||||
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
|
. $db->quote('') . ', '
|
||||||
|
. $db->quote('
|
||||||
|
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
||||||
|
"core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description",
|
||||||
|
"core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access",
|
||||||
|
"core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language",
|
||||||
|
"core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey",
|
||||||
|
"core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"},
|
||||||
|
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}'
|
||||||
|
) . ', '
|
||||||
|
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
||||||
|
. $db->quote('
|
||||||
|
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
||||||
|
"hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"],
|
||||||
|
"ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version",
|
||||||
|
"hits", "path"],"convertToInt":["publish_up", "publish_down"],
|
||||||
|
"displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id",
|
||||||
|
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
||||||
|
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
||||||
|
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
||||||
|
"displayColumn":"title"}]}'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$db->setQuery($query);
|
||||||
|
$db->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to drop colums from #__weblinks if they still there.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.4.1
|
||||||
|
*/
|
||||||
|
private function dropColumnsIfNeeded()
|
||||||
|
{
|
||||||
|
$oldColumns = array(
|
||||||
|
'sid',
|
||||||
|
'date',
|
||||||
|
'archived',
|
||||||
|
'approved',
|
||||||
|
);
|
||||||
|
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
$table = $db->getTableColumns('#__weblinks');
|
||||||
|
|
||||||
|
$columns = array_intersect($oldColumns, array_keys($table));
|
||||||
|
|
||||||
|
foreach ($columns as $column)
|
||||||
|
{
|
||||||
|
$sql = 'ALTER TABLE ' . $db->quoteName('#__weblinks') . ' DROP COLUMN ' . $db->quoteName($column);
|
||||||
|
$db->setQuery($sql);
|
||||||
|
$db->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to add colums from #__weblinks if they are missing.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 3.4.1
|
||||||
|
*/
|
||||||
|
private function addColumnsIfNeeded()
|
||||||
|
{
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
$table = $db->getTableColumns('#__weblinks');
|
||||||
|
|
||||||
|
if (!array_key_exists('version', $table))
|
||||||
|
{
|
||||||
|
$sql = 'ALTER TABLE ' . $db->quoteName('#__weblinks') . ' ADD COLUMN ' . $db->quoteName('version') . " int(10) unsigned NOT NULL DEFAULT '1'";
|
||||||
|
$db->setQuery($sql);
|
||||||
|
$db->execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!array_key_exists('images', $table))
|
||||||
|
{
|
||||||
|
$sql = 'ALTER TABLE ' . $db->quoteName('#__weblinks') . ' ADD COLUMN ' . $db->quoteName('images') . ' text NOT NULL';
|
||||||
|
$db->setQuery($sql);
|
||||||
|
$db->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -14,7 +14,7 @@ CREATE TABLE IF NOT EXISTS `#__weblinks` (
|
|||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`catid` int(11) NOT NULL DEFAULT 0,
|
`catid` int(11) NOT NULL DEFAULT 0,
|
||||||
`title` varchar(250) NOT NULL DEFAULT '',
|
`title` varchar(250) NOT NULL DEFAULT '',
|
||||||
`alias` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
`alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
|
||||||
`url` varchar(250) NOT NULL DEFAULT '',
|
`url` varchar(250) NOT NULL DEFAULT '',
|
||||||
`description` text NOT NULL,
|
`description` text NOT NULL,
|
||||||
`hits` int(11) NOT NULL DEFAULT 0,
|
`hits` int(11) NOT NULL DEFAULT 0,
|
||||||
@ -48,4 +48,4 @@ CREATE TABLE IF NOT EXISTS `#__weblinks` (
|
|||||||
KEY `idx_featured_catid` (`featured`,`catid`),
|
KEY `idx_featured_catid` (`featured`,`catid`),
|
||||||
KEY `idx_language` (`language`),
|
KEY `idx_language` (`language`),
|
||||||
KEY `idx_xreference` (`xreference`)
|
KEY `idx_xreference` (`xreference`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
|
@ -0,0 +1,3 @@
|
|||||||
|
# This is a rollup of all database schema changes applied from 3.0.0 to 3.3.x
|
||||||
|
|
||||||
|
ALTER TABLE `#__weblinks` ENGINE=InnoDB;
|
@ -0,0 +1,25 @@
|
|||||||
|
# Conversion to utf8mb4
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Step 1.1: Enlarge columns to avoid data loss on later conversion to utf8mb4
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `#__weblinks` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Step 1.2: Convert table to utf8mb4 chracter set with utf8mb4_unicode_ci collation
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `#__weblinks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Step 1.3: Set collation to utf8mb4_bin for formerly utf8_bin collated columns
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `#__weblinks` MODIFY `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Step 1.4: Set default character set and collation for all tables
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `#__weblinks` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -28,6 +28,8 @@ class WeblinksTableWeblink extends JTable
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param JDatabaseDriver &$db A database connector object
|
* @param JDatabaseDriver &$db A database connector object
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public function __construct(&$db)
|
public function __construct(&$db)
|
||||||
{
|
{
|
||||||
@ -36,28 +38,33 @@ class WeblinksTableWeblink extends JTable
|
|||||||
// Set the published column alias
|
// Set the published column alias
|
||||||
$this->setColumnAlias('published', 'state');
|
$this->setColumnAlias('published', 'state');
|
||||||
|
|
||||||
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
if (version_compare(JVERSION, '4.0', '<') == 1)
|
||||||
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
{
|
||||||
|
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
||||||
|
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overload the store method for the Weblinks table.
|
* Overload the store method for the Weblinks table.
|
||||||
*
|
*
|
||||||
* @param boolean Toggle whether null values should be updated.
|
* @param boolean $updateNulls Toggle whether null values should be updated.
|
||||||
|
*
|
||||||
* @return boolean True on success, false on failure.
|
* @return boolean True on success, false on failure.
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function store($updateNulls = false)
|
public function store($updateNulls = false)
|
||||||
{
|
{
|
||||||
$date = JFactory::getDate();
|
$date = JFactory::getDate();
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
$this->modified = $date->toSql();
|
$this->modified = $date->toSql();
|
||||||
|
|
||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
// Existing item
|
// Existing item
|
||||||
$this->modified_by = $user->get('id');
|
$this->modified_by = $user->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -67,30 +74,33 @@ class WeblinksTableWeblink extends JTable
|
|||||||
{
|
{
|
||||||
$this->created = $date->toSql();
|
$this->created = $date->toSql();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->created_by))
|
if (empty($this->created_by))
|
||||||
{
|
{
|
||||||
$this->created_by = $user->get('id');
|
$this->created_by = $user->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set publish_up to null date if not set
|
// Set publish_up to null date if not set
|
||||||
if (!$this->publish_up)
|
if (!$this->publish_up)
|
||||||
{
|
{
|
||||||
$this->publish_up = $this->_db->getNullDate();
|
$this->publish_up = $this->getDbo()->getNullDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set publish_down to null date if not set
|
// Set publish_down to null date if not set
|
||||||
if (!$this->publish_down)
|
if (!$this->publish_down)
|
||||||
{
|
{
|
||||||
$this->publish_down = $this->_db->getNullDate();
|
$this->publish_down = $this->getDbo()->getNullDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that the alias is unique
|
// Verify that the alias is unique
|
||||||
$table = JTable::getInstance('Weblink', 'WeblinksTable');
|
$table = JTable::getInstance('Weblink', 'WeblinksTable', array('dbo' => $this->getDbo()));
|
||||||
|
|
||||||
if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0))
|
if ($table->load(array('language' => $this->language, 'alias' => $this->alias, 'catid' => $this->catid))
|
||||||
|
&& ($table->id != $this->id || $this->id == 0))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_WEBLINKS_ERROR_UNIQUE_ALIAS'));
|
$this->setError(JText::_('COM_WEBLINKS_ERROR_UNIQUE_ALIAS'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,34 +114,43 @@ class WeblinksTableWeblink extends JTable
|
|||||||
* Overloaded check method to ensure data integrity.
|
* Overloaded check method to ensure data integrity.
|
||||||
*
|
*
|
||||||
* @return boolean True on success.
|
* @return boolean True on success.
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public function check()
|
public function check()
|
||||||
{
|
{
|
||||||
if (JFilterInput::checkAttribute(array ('href', $this->url)))
|
if (JFilterInput::checkAttribute(array('href', $this->url)))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_PROVIDE_URL'));
|
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_PROVIDE_URL'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for valid name
|
// Check for valid name
|
||||||
if (trim($this->title) == '')
|
if (trim($this->title) == '')
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_TITLE'));
|
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_TITLE'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for existing name
|
// Check for existing name
|
||||||
$query = $this->_db->getQuery(true)
|
$db = $this->getDbo();
|
||||||
->select($this->_db->quoteName('id'))
|
|
||||||
->from($this->_db->quoteName('#__weblinks'))
|
$query = $db->getQuery(true)
|
||||||
->where($this->_db->quoteName('title') . ' = ' . $this->_db->quote($this->title))
|
->select($db->quoteName('id'))
|
||||||
->where($this->_db->quoteName('catid') . ' = ' . (int) $this->catid);
|
->from($db->quoteName('#__weblinks'))
|
||||||
$this->_db->setQuery($query);
|
->where($db->quoteName('title') . ' = ' . $db->quote($this->title))
|
||||||
|
->where($db->quoteName('language') . ' = ' . $db->quote($this->language))
|
||||||
|
->where($db->quoteName('catid') . ' = ' . (int) $this->catid);
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
$xid = (int) $db->loadResult();
|
||||||
|
|
||||||
$xid = (int) $this->_db->loadResult();
|
|
||||||
if ($xid && $xid != (int) $this->id)
|
if ($xid && $xid != (int) $this->id)
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_NAME'));
|
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_NAME'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,38 +158,47 @@ class WeblinksTableWeblink extends JTable
|
|||||||
{
|
{
|
||||||
$this->alias = $this->title;
|
$this->alias = $this->title;
|
||||||
}
|
}
|
||||||
$this->alias = JApplication::stringURLSafe($this->alias);
|
|
||||||
|
$this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);
|
||||||
|
|
||||||
if (trim(str_replace('-', '', $this->alias)) == '')
|
if (trim(str_replace('-', '', $this->alias)) == '')
|
||||||
{
|
{
|
||||||
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
|
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the publish down date is not earlier than publish up.
|
// Check the publish down date is not earlier than publish up.
|
||||||
if ($this->publish_down > $this->_db->getNullDate() && $this->publish_down < $this->publish_up)
|
if ($this->publish_down > $db->getNullDate() && $this->publish_down < $this->publish_up)
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JGLOBAL_START_PUBLISH_AFTER_FINISH'));
|
$this->setError(JText::_('JGLOBAL_START_PUBLISH_AFTER_FINISH'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up keywords -- eliminate extra spaces between phrases
|
/*
|
||||||
// and cr (\r) and lf (\n) characters from string
|
* Clean up keywords -- eliminate extra spaces between phrases
|
||||||
|
* and cr (\r) and lf (\n) characters from string
|
||||||
|
*/
|
||||||
if (!empty($this->metakey))
|
if (!empty($this->metakey))
|
||||||
{
|
{
|
||||||
// only process if not empty
|
// Array of characters to remove
|
||||||
$bad_characters = array("\n", "\r", "\"", "<", ">"); // array of characters to remove
|
$bad_characters = array("\n", "\r", "\"", "<", ">");
|
||||||
$after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); // remove bad characters
|
$after_clean = JString::str_ireplace($bad_characters, "", $this->metakey);
|
||||||
$keys = explode(',', $after_clean); // create array using commas as delimiter
|
$keys = explode(',', $after_clean);
|
||||||
$clean_keys = array();
|
$clean_keys = array();
|
||||||
|
|
||||||
foreach ($keys as $key)
|
foreach ($keys as $key)
|
||||||
{
|
{
|
||||||
if (trim($key)) { // ignore blank keywords
|
// Ignore blank keywords
|
||||||
|
if (trim($key))
|
||||||
|
{
|
||||||
$clean_keys[] = trim($key);
|
$clean_keys[] = trim($key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->metakey = implode(", ", $clean_keys); // put array back together delimited by ", "
|
|
||||||
|
// Put array back together delimited by ", "
|
||||||
|
$this->metakey = implode(", ", $clean_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return parent::check();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -12,7 +12,15 @@ defined('_JEXEC') or die;
|
|||||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
|
||||||
JHtml::_('behavior.formvalidator');
|
JHtml::_('behavior.formvalidator');
|
||||||
JHtml::_('formbehavior.chosen', 'select');
|
JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 ));
|
||||||
|
|
||||||
|
$app = JFactory::getApplication();
|
||||||
|
$input = $app->input;
|
||||||
|
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
|
||||||
|
$this->ignore_fieldsets = array('details', 'images', 'item_associations', 'jmetadata');
|
||||||
|
|
||||||
JFactory::getDocument()->addScriptDeclaration("
|
JFactory::getDocument()->addScriptDeclaration("
|
||||||
Joomla.submitbutton = function(task)
|
Joomla.submitbutton = function(task)
|
||||||
@ -23,9 +31,14 @@ JFactory::getDocument()->addScriptDeclaration("
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
");
|
");
|
||||||
|
|
||||||
|
// In case of modal
|
||||||
|
$isModal = $input->get('layout') == 'modal' ? true : false;
|
||||||
|
$layout = $isModal ? 'modal' : 'edit';
|
||||||
|
$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
|
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
|
||||||
|
|
||||||
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
|
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
|
||||||
|
|
||||||
@ -36,8 +49,8 @@ JFactory::getDocument()->addScriptDeclaration("
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<div class="form-vertical">
|
<div class="form-vertical">
|
||||||
<?php echo $this->form->getControlGroup('url'); ?>
|
<?php echo $this->form->renderField('url'); ?>
|
||||||
<?php echo $this->form->getControlGroup('description'); ?>
|
<?php echo $this->form->renderField('description'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
@ -49,9 +62,9 @@ JFactory::getDocument()->addScriptDeclaration("
|
|||||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'images', JText::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
|
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'images', JText::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<?php echo $this->form->getControlGroup('images'); ?>
|
<?php echo $this->form->renderField('images'); ?>
|
||||||
<?php foreach ($this->form->getGroup('images') as $field) : ?>
|
<?php foreach ($this->form->getGroup('images') as $field) : ?>
|
||||||
<?php echo $field->getControlGroup(); ?>
|
<?php echo $field->renderField(); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -71,10 +84,19 @@ JFactory::getDocument()->addScriptDeclaration("
|
|||||||
|
|
||||||
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
|
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
|
||||||
|
|
||||||
|
<?php if (!$isModal && $assoc) : ?>
|
||||||
|
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'associations', JText::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
|
||||||
|
<?php echo $this->loadTemplate('associations'); ?>
|
||||||
|
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||||
|
<?php elseif ($isModal && $assoc) : ?>
|
||||||
|
<div class="hidden"><?php echo $this->loadTemplate('associations'); ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="task" value="" />
|
<input type="hidden" name="task" value="" />
|
||||||
|
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>" />
|
||||||
<?php echo JHtml::_('form.token'); ?>
|
<?php echo JHtml::_('form.token'); ?>
|
||||||
</form>
|
</form>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
echo JLayoutHelper::render('joomla.edit.associations', $this);
|
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
echo JLayoutHelper::render('joomla.edit.metadata', $this);
|
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
$fieldSets = $this->form->getFieldsets('params'); ?>
|
||||||
|
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||||
|
<div class="tab-pane" id="params-<?php echo $name; ?>">
|
||||||
|
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||||
|
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="control-label"><?php echo $field->label; ?></div>
|
||||||
|
<div class="controls"><?php echo $field->input; ?></div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
|
||||||
|
|
||||||
|
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0.
|
||||||
|
$function = JFactory::getApplication()->input->getCmd('function', 'jEditWeblink_' . (int) $this->item->id);
|
||||||
|
|
||||||
|
// Function to update input title when changed
|
||||||
|
JFactory::getDocument()->addScriptDeclaration('
|
||||||
|
function jEditWeblinkModal() {
|
||||||
|
if (window.parent && document.formvalidator.isValid(document.getElementById("weblink-form"))) {
|
||||||
|
return window.parent.' . $this->escape($function) . '(document.getElementById("jform_title").value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
');
|
||||||
|
?>
|
||||||
|
<button id="applyBtn" type="button" class="hidden" onclick="Joomla.submitbutton('weblink.apply'); jEditWeblinkModal();"></button>
|
||||||
|
<button id="saveBtn" type="button" class="hidden" onclick="Joomla.submitbutton('weblink.save'); jEditWeblinkModal();"></button>
|
||||||
|
<button id="closeBtn" type="button" class="hidden" onclick="Joomla.submitbutton('weblink.cancel');"></button>
|
||||||
|
|
||||||
|
<div class="container-popup">
|
||||||
|
<?php $this->setLayout('edit'); ?>
|
||||||
|
<?php echo $this->loadTemplate(); ?>
|
||||||
|
</div>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
echo JLayoutHelper::render('joomla.edit.associations', $this);
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
$fieldSets = $this->form->getFieldsets('params'); ?>
|
||||||
|
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||||
|
<div class="tab-pane" id="params-<?php echo $name; ?>">
|
||||||
|
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||||
|
<?php echo '<p class="alert alert-info">' . $this->escape(JText::_($fieldSet->description)) . '</p>'; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="control-label"><?php echo $field->label; ?></div>
|
||||||
|
<div class="controls"><?php echo $field->input; ?></div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -23,42 +23,64 @@ class WeblinksViewWeblink extends JViewLegacy
|
|||||||
protected $form;
|
protected $form;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the view
|
* Display the view.
|
||||||
|
*
|
||||||
|
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||||
|
*
|
||||||
|
* @return mixed A string if successful, otherwise an Error object.
|
||||||
*/
|
*/
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
$this->form = $this->get('Form');
|
$this->form = $this->get('Form');
|
||||||
|
|
||||||
// Check for errors.
|
// Check for errors.
|
||||||
if (count($errors = $this->get('Errors')))
|
if (count($errors = $this->get('Errors')))
|
||||||
{
|
{
|
||||||
JError::raiseError(500, implode("\n", $errors));
|
JError::raiseError(500, implode("\n", $errors));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we are forcing a language in modal (used for associations).
|
||||||
|
if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd'))
|
||||||
|
{
|
||||||
|
// Set the language field to the forcedLanguage and disable changing it.
|
||||||
|
$this->form->setValue('language', null, $forcedLanguage);
|
||||||
|
$this->form->setFieldAttribute('language', 'readonly', 'true');
|
||||||
|
|
||||||
|
// Only allow to select categories with All language or with the forced language.
|
||||||
|
$this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage);
|
||||||
|
|
||||||
|
// Only allow to select tags with All language or with the forced language.
|
||||||
|
$this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
$this->addToolbar();
|
$this->addToolbar();
|
||||||
|
|
||||||
parent::display($tpl);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the page title and toolbar.
|
* Add the page title and toolbar.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function addToolbar()
|
protected function addToolbar()
|
||||||
{
|
{
|
||||||
JFactory::getApplication()->input->set('hidemainmenu', true);
|
JFactory::getApplication()->input->set('hidemainmenu', true);
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$isNew = ($this->item->id == 0);
|
$isNew = ($this->item->id == 0);
|
||||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||||
|
|
||||||
// Since we don't track these assets at the item level, use the category id.
|
// Since we don't track these assets at the item level, use the category id.
|
||||||
$canDo = JHelperContent::getActions('com_weblinks', 'category', $this->item->catid);
|
$canDo = JHelperContent::getActions('com_weblinks', 'category', $this->item->catid);
|
||||||
|
|
||||||
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINK'), 'link weblinks');
|
JToolbarHelper::title($isNew ? JText::_('COM_WEBLINKS_MANAGER_WEBLINK_NEW') : JText::_('COM_WEBLINKS_MANAGER_WEBLINK_EDIT'), 'link weblinks');
|
||||||
|
|
||||||
// If not checked out, can save the item.
|
// If not checked out, can save the item.
|
||||||
if (!$checkedOut && ($canDo->get('core.edit')||(count($user->getAuthorisedCategories('com_weblinks', 'core.create')))))
|
if (!$checkedOut && ($canDo->get('core.edit')||(count($user->getAuthorisedCategories('com_weblinks', 'core.create')))))
|
||||||
@ -66,15 +88,23 @@ class WeblinksViewWeblink extends JViewLegacy
|
|||||||
JToolbarHelper::apply('weblink.apply');
|
JToolbarHelper::apply('weblink.apply');
|
||||||
JToolbarHelper::save('weblink.save');
|
JToolbarHelper::save('weblink.save');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$checkedOut && (count($user->getAuthorisedCategories('com_weblinks', 'core.create'))))
|
if (!$checkedOut && (count($user->getAuthorisedCategories('com_weblinks', 'core.create'))))
|
||||||
{
|
{
|
||||||
JToolbarHelper::save2new('weblink.save2new');
|
JToolbarHelper::save2new('weblink.save2new');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an existing item, can save to a copy.
|
// If an existing item, can save to a copy.
|
||||||
if (!$isNew && (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0))
|
if (!$isNew && (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0))
|
||||||
{
|
{
|
||||||
JToolbarHelper::save2copy('weblink.save2copy');
|
JToolbarHelper::save2copy('weblink.save2copy');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (JLanguageAssociations::isEnabled() && JComponentHelper::isEnabled('com_associations'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::custom('weblink.editAssociations', 'contract', 'contract', 'JTOOLBAR_ASSOCIATIONS', false, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($this->item->id))
|
if (empty($this->item->id))
|
||||||
{
|
{
|
||||||
JToolbarHelper::cancel('weblink.cancel');
|
JToolbarHelper::cancel('weblink.cancel');
|
@ -0,0 +1,187 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
|
||||||
|
JHtml::_('bootstrap.tooltip');
|
||||||
|
JHtml::_('behavior.multiselect');
|
||||||
|
JHtml::_('formbehavior.chosen', 'select');
|
||||||
|
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
$userId = $user->get('id');
|
||||||
|
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||||
|
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||||
|
$canOrder = $user->authorise('core.edit.state', 'com_weblinks.category');
|
||||||
|
$saveOrder = $listOrder == 'a.ordering';
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
if ($saveOrder)
|
||||||
|
{
|
||||||
|
$saveOrderingUrl = 'index.php?option=com_weblinks&task=weblinks.saveOrderAjax&tmpl=component';
|
||||||
|
JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
|
<?php if (!empty($this->sidebar)) : ?>
|
||||||
|
<div id="j-sidebar-container" class="span2">
|
||||||
|
<?php echo $this->sidebar; ?>
|
||||||
|
</div>
|
||||||
|
<div id="j-main-container" class="span10">
|
||||||
|
<?php else : ?>
|
||||||
|
<div id="j-main-container">
|
||||||
|
<?php endif;?>
|
||||||
|
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
|
||||||
|
<div class="clearfix"> </div>
|
||||||
|
<?php if (empty($this->items)) : ?>
|
||||||
|
<div class="alert alert-no-items">
|
||||||
|
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<table class="table table-striped" id="weblinkList">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="1%" class="nowrap center hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
|
||||||
|
</th>
|
||||||
|
<th width="1%" class="nowrap center">
|
||||||
|
<?php echo JHtml::_('grid.checkall'); ?>
|
||||||
|
</th>
|
||||||
|
<th width="1%" class="nowrap center">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th class="title">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="10%" class="nowrap hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="5%" class="nowrap center hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<?php if ($assoc) : ?>
|
||||||
|
<th width="5%" class="nowrap hidden-phone hidden-tablet">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'COM_WEBLINKS_HEADING_ASSOCIATION', 'association', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<?php endif; ?>
|
||||||
|
<th width="10%" class="nowrap hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="1%" class="nowrap center hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="8">
|
||||||
|
<?php echo $this->pagination->getListFooter(); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($this->items as $i => $item) : ?>
|
||||||
|
<?php $ordering = ($listOrder == 'a.ordering'); ?>
|
||||||
|
<?php $item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_weblinks&task=edit&type=other&cid[]=' . $item->catid); ?>
|
||||||
|
<?php $canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $item->catid); ?>
|
||||||
|
<?php $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $item->catid); ?>
|
||||||
|
<?php $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; ?>
|
||||||
|
<?php $canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $item->catid) && $item->created_by == $user->id; ?>
|
||||||
|
<?php $canChange = $user->authorise('core.edit.state', 'com_weblinks.category.' . $item->catid) && $canCheckin; ?>
|
||||||
|
<tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->catid; ?>">
|
||||||
|
<td class="order nowrap center hidden-phone">
|
||||||
|
<?php $iconClass = ''; ?>
|
||||||
|
<?php if (!$canChange) : ?>
|
||||||
|
<?php $iconClass = ' inactive'; ?>
|
||||||
|
<?php elseif (!$saveOrder) : ?>
|
||||||
|
<?php $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<span class="sortable-handler<?php echo $iconClass ?>">
|
||||||
|
<i class="icon-menu" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<?php if ($canChange && $saveOrder) : ?>
|
||||||
|
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<div class="btn-group">
|
||||||
|
<?php echo JHtml::_('jgrid.published', $item->state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
|
||||||
|
<?php // Create dropdown items and render the dropdown list. ?>
|
||||||
|
<?php if ($canChange) : ?>
|
||||||
|
<?php JHtml::_('actionsdropdown.' . ((int) $item->state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'weblinks'); ?>
|
||||||
|
<?php JHtml::_('actionsdropdown.' . ((int) $item->state === -2 ? 'un' : '') . 'trash', 'cb' . $i, 'weblinks'); ?>
|
||||||
|
<?php echo JHtml::_('actionsdropdown.render', $this->escape($item->title)); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="has-context">
|
||||||
|
<?php if ($item->checked_out) : ?>
|
||||||
|
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($canEdit || $canEditOwn) : ?>
|
||||||
|
<a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id=' . (int) $item->id); ?>">
|
||||||
|
<?php echo $this->escape($item->title); ?></a>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php echo $this->escape($item->title); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<span class="small">
|
||||||
|
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
|
||||||
|
</span>
|
||||||
|
<div class="small">
|
||||||
|
<?php echo JText::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="small hidden-phone">
|
||||||
|
<?php echo $this->escape($item->access_level); ?>
|
||||||
|
</td>
|
||||||
|
<td class="center hidden-phone">
|
||||||
|
<?php echo $item->hits; ?>
|
||||||
|
</td>
|
||||||
|
<?php if ($assoc) : ?>
|
||||||
|
<td class="hidden-phone hidden-tablet">
|
||||||
|
<?php if ($item->association) : ?>
|
||||||
|
<?php echo JHtml::_('weblink.association', $item->id); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<?php endif; ?>
|
||||||
|
<td class="small hidden-phone">
|
||||||
|
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
|
||||||
|
</td>
|
||||||
|
<td class="center hidden-phone">
|
||||||
|
<?php echo (int) $item->id; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php // Load the batch processing form. ?>
|
||||||
|
<?php if ($user->authorise('core.create', 'com_content')
|
||||||
|
&& $user->authorise('core.edit', 'com_content')
|
||||||
|
&& $user->authorise('core.edit.state', 'com_content')) : ?>
|
||||||
|
<?php echo JHtml::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'collapseModal',
|
||||||
|
array(
|
||||||
|
'title' => JText::_('COM_WEBLINKS_BATCH_OPTIONS'),
|
||||||
|
'footer' => $this->loadTemplate('batch_footer'),
|
||||||
|
),
|
||||||
|
$this->loadTemplate('batch_body')
|
||||||
|
); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="" />
|
||||||
|
<input type="hidden" name="boxchecked" value="0" />
|
||||||
|
<?php echo JHtml::_('form.token'); ?>
|
||||||
|
</div>
|
||||||
|
</form>
|
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
$published = $this->state->get('filter.published');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="control-group span6">
|
||||||
|
<div class="controls">
|
||||||
|
<?php echo JHtml::_('batch.language'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="control-group span6">
|
||||||
|
<div class="controls">
|
||||||
|
<?php echo JHtml::_('batch.access'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<?php if ($published >= 0) : ?>
|
||||||
|
<div class="control-group span6">
|
||||||
|
<div class="controls">
|
||||||
|
<?php echo JHtml::_('batch.item', 'com_weblinks'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<div class="control-group span6">
|
||||||
|
<div class="controls">
|
||||||
|
<?php echo JHtml::_('batch.tag'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<a class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value='';document.getElementById('batch-user-id').value='';document.getElementById('batch-tag-id').value=''" data-dismiss="modal">
|
||||||
|
<?php echo JText::_('JCANCEL'); ?>
|
||||||
|
</a>
|
||||||
|
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('weblink.batch');">
|
||||||
|
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||||
|
</button>
|
@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
$app = JFactory::getApplication();
|
||||||
|
|
||||||
|
if ($app->isClient('site'))
|
||||||
|
{
|
||||||
|
JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
|
||||||
|
}
|
||||||
|
JLoader::register('WeblinksHelperRoute', JPATH_ROOT . '/components/com_weblinks/helpers/route.php');
|
||||||
|
|
||||||
|
// Include the component HTML helpers.
|
||||||
|
|
||||||
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
JHtml::_('behavior.core');
|
||||||
|
JHtml::_('behavior.polyfill', array('event'), 'lt IE 9');
|
||||||
|
JHtml::_('script', 'com_weblinks/admin-weblinks-modal.js', array('version' => 'auto', 'relative' => true));
|
||||||
|
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
|
||||||
|
JHtml::_('formbehavior.chosen', 'select');
|
||||||
|
|
||||||
|
// Special case for the search field tooltip.
|
||||||
|
$searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter');
|
||||||
|
JHtml::_('bootstrap.tooltip', '#filter_search', array('title' => JText::_($searchFilterDesc), 'placement' => 'bottom'));
|
||||||
|
|
||||||
|
$function = $app->input->getCmd('function', 'jSelectWeblink');
|
||||||
|
$editor = $app->input->getCmd('editor', '');
|
||||||
|
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||||
|
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||||
|
$onclick = $this->escape($function);
|
||||||
|
|
||||||
|
if (!empty($editor))
|
||||||
|
{
|
||||||
|
// This view is used also in com_menus. Load the xtd script only if the editor is set!
|
||||||
|
JFactory::getDocument()->addScriptOptions('xtd-weblinks', array('editor' => $editor));
|
||||||
|
$onclick = "jSelectWeblink";
|
||||||
|
}
|
||||||
|
|
||||||
|
$iconStates = array(
|
||||||
|
-2 => 'icon-trash',
|
||||||
|
0 => 'icon-unpublish',
|
||||||
|
1 => 'icon-publish',
|
||||||
|
2 => 'icon-archive',
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="container-popup">
|
||||||
|
|
||||||
|
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks&layout=modal&tmpl=component&function=' . $function . '&' . JSession::getFormToken() . '=1&editor=' . $editor); ?>" method="post" name="adminForm" id="adminForm" class="form-inline">
|
||||||
|
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
<?php if (empty($this->items)) : ?>
|
||||||
|
<div class="alert alert-no-items">
|
||||||
|
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<table class="table table-striped table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="1%" class="center nowrap">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th class="title">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="10%" class="nowrap hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="15%" class="nowrap">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="5%" class="nowrap hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
<th width="1%" class="nowrap hidden-phone">
|
||||||
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<?php echo $this->pagination->getListFooter(); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($this->items as $i => $item) : ?>
|
||||||
|
<?php $lang = ''; ?>
|
||||||
|
<?php if ($item->language && JLanguageMultilang::isEnabled()) : ?>
|
||||||
|
<?php $tag = strlen($item->language); ?>
|
||||||
|
<?php if ($tag == 5) : ?>
|
||||||
|
<?php $lang = substr($item->language, 0, 2); ?>
|
||||||
|
<?php elseif ($tag == 6) : ?>
|
||||||
|
<?php $lang = substr($item->language, 0, 3); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<tr class="row<?php echo $i % 2; ?>">
|
||||||
|
<td class="center">
|
||||||
|
<span class="<?php echo $iconStates[$this->escape($item->state)]; ?>"></span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php $attribs = 'data-function="' . $this->escape($onclick) . '"'
|
||||||
|
. ' data-id="' . $item->id . '"'
|
||||||
|
. ' data-title="' . $this->escape(addslashes($item->title)) . '"'
|
||||||
|
. ' data-cat-id="' . $this->escape($item->catid) . '"'
|
||||||
|
. ' data-uri="' . $this->escape(WeblinksHelperRoute::getWeblinkRoute($item->id, $item->catid, $item->language)) . '"'
|
||||||
|
. ' data-language="' . $this->escape($lang) . '"';
|
||||||
|
?>
|
||||||
|
<a class="select-link" href="javascript:void(0)" <?php echo $attribs; ?>>
|
||||||
|
<?php echo $this->escape($item->title); ?>
|
||||||
|
</a>
|
||||||
|
<div class="small">
|
||||||
|
<?php echo JText::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="small hidden-phone">
|
||||||
|
<?php echo $this->escape($item->access_level); ?>
|
||||||
|
</td>
|
||||||
|
<td class="small">
|
||||||
|
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
|
||||||
|
</td>
|
||||||
|
<td class="nowrap small hidden-phone">
|
||||||
|
<?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?>
|
||||||
|
</td>
|
||||||
|
<td class="nowrap small hidden-phone">
|
||||||
|
<?php echo (int) $item->id; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<input type="hidden" name="task" value="" />
|
||||||
|
<input type="hidden" name="boxchecked" value="0" />
|
||||||
|
<input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'CMD'); ?>" />
|
||||||
|
<?php echo JHtml::_('form.token'); ?>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
@ -0,0 +1,170 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* View class for a list of weblinks.
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
class WeblinksViewWeblinks extends JViewLegacy
|
||||||
|
{
|
||||||
|
protected $items;
|
||||||
|
|
||||||
|
protected $pagination;
|
||||||
|
|
||||||
|
protected $state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the view.
|
||||||
|
*
|
||||||
|
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||||
|
*
|
||||||
|
* @return mixed A string if successful, otherwise an Error object.
|
||||||
|
*/
|
||||||
|
public function display($tpl = null)
|
||||||
|
{
|
||||||
|
$this->state = $this->get('State');
|
||||||
|
$this->items = $this->get('Items');
|
||||||
|
$this->pagination = $this->get('Pagination');
|
||||||
|
$this->filterForm = $this->get('FilterForm');
|
||||||
|
$this->activeFilters = $this->get('ActiveFilters');
|
||||||
|
|
||||||
|
// Modal layout doesn't need the submenu.
|
||||||
|
if ($this->getLayout() !== 'modal')
|
||||||
|
{
|
||||||
|
WeblinksHelper::addSubmenu('weblinks');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for errors.
|
||||||
|
if (count($errors = $this->get('Errors')))
|
||||||
|
{
|
||||||
|
JError::raiseError(500, implode("\n", $errors));
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We don't need toolbar in the modal layout.
|
||||||
|
if ($this->getLayout() !== 'modal')
|
||||||
|
{
|
||||||
|
$this->addToolbar();
|
||||||
|
$this->sidebar = JHtmlSidebar::render();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// In article associations modal we need to remove language filter if forcing a language.
|
||||||
|
// We also need to change the category filter to show show categories with All or the forced language.
|
||||||
|
if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'CMD'))
|
||||||
|
{
|
||||||
|
// If the language is forced we can't allow to select the language, so transform the language selector filter into an hidden field.
|
||||||
|
$languageXml = new SimpleXMLElement('<field name="language" type="hidden" default="' . $forcedLanguage . '" />');
|
||||||
|
$this->filterForm->setField($languageXml, 'filter', true);
|
||||||
|
|
||||||
|
// Also, unset the active language filter so the search tools is not open by default with this filter.
|
||||||
|
unset($this->activeFilters['language']);
|
||||||
|
|
||||||
|
// One last changes needed is to change the category filter to just show categories with All language or with the forced language.
|
||||||
|
$this->filterForm->setFieldAttribute('category_id', 'language', '*,' . $forcedLanguage, 'filter');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the page title and toolbar.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
protected function addToolbar()
|
||||||
|
{
|
||||||
|
require_once JPATH_COMPONENT . '/helpers/weblinks.php';
|
||||||
|
|
||||||
|
$state = $this->get('State');
|
||||||
|
$canDo = JHelperContent::getActions('com_weblinks', 'category', $state->get('filter.category_id'));
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
// Get the toolbar object instance
|
||||||
|
$bar = JToolbar::getInstance('toolbar');
|
||||||
|
|
||||||
|
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
|
||||||
|
|
||||||
|
if (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0)
|
||||||
|
{
|
||||||
|
JToolbarHelper::addNew('weblink.add');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($canDo->get('core.edit') || $canDo->get('core.edit.own'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::editList('weblink.edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($canDo->get('core.edit.state'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::publish('weblinks.publish', 'JTOOLBAR_PUBLISH', true);
|
||||||
|
JToolbarHelper::unpublish('weblinks.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
||||||
|
|
||||||
|
JToolbarHelper::archiveList('weblinks.archive');
|
||||||
|
JToolbarHelper::checkin('weblinks.checkin');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($state->get('filter.published') == -2 && $canDo->get('core.delete'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'weblinks.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||||
|
}
|
||||||
|
elseif ($canDo->get('core.edit.state'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::trash('weblinks.trash');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add a batch button
|
||||||
|
if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks')
|
||||||
|
&& $user->authorise('core.edit.state', 'com_weblinks'))
|
||||||
|
{
|
||||||
|
JHtml::_('bootstrap.renderModal', 'collapseModal');
|
||||||
|
$title = JText::_('JTOOLBAR_BATCH');
|
||||||
|
|
||||||
|
// Instantiate a new JLayoutFile instance and render the batch button
|
||||||
|
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||||
|
|
||||||
|
$dhtml = $layout->render(array('title' => $title));
|
||||||
|
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->authorise('core.admin', 'com_weblinks') || $user->authorise('core.options', 'com_weblinks'))
|
||||||
|
{
|
||||||
|
JToolbarHelper::preferences('com_weblinks');
|
||||||
|
}
|
||||||
|
|
||||||
|
JToolbarHelper::help('JHELP_COMPONENTS_WEBLINKS_LINKS');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of fields the table can be sorted by
|
||||||
|
*
|
||||||
|
* @return array Array containing the field name to sort by as the key and display text as value
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
*/
|
||||||
|
protected function getSortFields()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
||||||
|
'a.state' => JText::_('JSTATUS'),
|
||||||
|
'a.title' => JText::_('JGLOBAL_TITLE'),
|
||||||
|
'a.access' => JText::_('JGRID_HEADING_ACCESS'),
|
||||||
|
'a.hits' => JText::_('JGLOBAL_HITS'),
|
||||||
|
'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
|
||||||
|
'a.id' => JText::_('JGRID_HEADING_ID')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage com_weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ JHtml::_('behavior.tabstate');
|
|||||||
|
|
||||||
if (!JFactory::getUser()->authorise('core.manage', 'com_weblinks'))
|
if (!JFactory::getUser()->authorise('core.manage', 'com_weblinks'))
|
||||||
{
|
{
|
||||||
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
|
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
$controller = JControllerLegacy::getInstance('Weblinks');
|
$controller = JControllerLegacy::getInstance('Weblinks');
|
@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.1" method="upgrade">
|
<extension type="component" version="3.5" method="upgrade">
|
||||||
<name>com_weblinks</name>
|
<name>com_weblinks</name>
|
||||||
<author>Joomla! Project</author>
|
<author>Joomla! Project</author>
|
||||||
<creationDate>April 2006</creationDate>
|
<creationDate>##DATE##</creationDate>
|
||||||
<copyright>(C) 2005 - 2014 Open Source Matters. All rights reserved.</copyright>
|
<copyright>(C) 2005 - ##YEAR## Open Source Matters. All rights reserved.</copyright>
|
||||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
<authorEmail>admin@joomla.org</authorEmail>
|
<authorEmail>admin@joomla.org</authorEmail>
|
||||||
<authorUrl>www.joomla.org</authorUrl>
|
<authorUrl>www.joomla.org</authorUrl>
|
||||||
<version>3.4.0-rc</version>
|
<version>##VERSION##</version>
|
||||||
<description>COM_WEBLINKS_XML_DESCRIPTION</description>
|
<description>COM_WEBLINKS_XML_DESCRIPTION</description>
|
||||||
<scriptfile>script.php</scriptfile>
|
<scriptfile>script.php</scriptfile>
|
||||||
|
|
||||||
@ -33,17 +33,16 @@
|
|||||||
</schemas>
|
</schemas>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<files folder="site">
|
<media folder="media/com_weblinks" destination="com_weblinks">
|
||||||
<filename>weblinks.php</filename>
|
##MEDIA_FILES##
|
||||||
<filename>controller.php</filename>
|
</media>
|
||||||
<filename>router.php</filename>
|
|
||||||
<filename>metadata.xml</filename>
|
<files folder="components/com_weblinks">
|
||||||
<folder>views</folder>
|
##FRONTEND_COMPONENT_FILES##
|
||||||
<folder>models</folder>
|
|
||||||
<folder>controllers</folder>
|
|
||||||
<folder>helpers</folder>
|
|
||||||
<folder>language</folder>
|
|
||||||
</files>
|
</files>
|
||||||
|
<languages folder="language">
|
||||||
|
##FRONTEND_LANGUAGE_FILES##
|
||||||
|
</languages>
|
||||||
<administration>
|
<administration>
|
||||||
<menu img="class:weblinks">com_weblinks</menu>
|
<menu img="class:weblinks">com_weblinks</menu>
|
||||||
<submenu>
|
<submenu>
|
||||||
@ -56,19 +55,12 @@
|
|||||||
<menu link="option=com_categories&extension=com_weblinks"
|
<menu link="option=com_categories&extension=com_weblinks"
|
||||||
view="categories" img="class:weblinks-cat" alt="Weblinks/Categories">com_weblinks_categories</menu>
|
view="categories" img="class:weblinks-cat" alt="Weblinks/Categories">com_weblinks_categories</menu>
|
||||||
</submenu>
|
</submenu>
|
||||||
<files folder="admin">
|
<files folder="administrator/components/com_weblinks">
|
||||||
<filename>access.xml</filename>
|
##BACKEND_COMPONENT_FILES##
|
||||||
<filename>config.xml</filename>
|
|
||||||
<filename>controller.php</filename>
|
|
||||||
<filename>weblinks.php</filename>
|
|
||||||
<folder>controllers</folder>
|
|
||||||
<folder>helpers</folder>
|
|
||||||
<folder>language</folder>
|
|
||||||
<folder>models</folder>
|
|
||||||
<folder>sql</folder>
|
|
||||||
<folder>tables</folder>
|
|
||||||
<folder>views</folder>
|
|
||||||
</files>
|
</files>
|
||||||
|
<languages folder="administrator/language">
|
||||||
|
##BACKEND_LANGUAGE_FILES##
|
||||||
|
</languages>
|
||||||
</administration>
|
</administration>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
133
src/administrator/language/en-GB/en-GB.com_weblinks.ini
Normal file
133
src/administrator/language/en-GB/en-GB.com_weblinks.ini
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
; Joomla! Project
|
||||||
|
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
|
||||||
|
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
|
||||||
|
; Note : All ini files need to be saved as UTF-8
|
||||||
|
|
||||||
|
COM_WEBLINKS="Web Links"
|
||||||
|
COM_WEBLINKS_ACCESS_HEADING="Access"
|
||||||
|
COM_WEBLINKS_BATCH_OPTIONS="Batch process the selected links"
|
||||||
|
COM_WEBLINKS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved links. Otherwise, all actions are applied to the selected links."
|
||||||
|
COM_WEBLINKS_CATEGORIES_DESC="These settings apply for Web Links Categories Options unless they are changed for a specific menu item."
|
||||||
|
COM_WEBLINKS_CATEGORY_DESC="These settings apply for Web Links Category Options unless they are changed for a specific menu item."
|
||||||
|
COM_WEBLINKS_CHANGE_WEBLINK="Select or Change Web Link"
|
||||||
|
COM_WEBLINKS_COMPONENT_DESC="These settings apply for Web Links unless they are changed for a specific menu item or web link."
|
||||||
|
COM_WEBLINKS_COMPONENT_LABEL="Web Link"
|
||||||
|
COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Web Links Component will integrate with other extensions."
|
||||||
|
COM_WEBLINKS_CONFIGURATION="Web Links Manager Options"
|
||||||
|
COM_WEBLINKS_EDIT_WEBLINK="Edit Web Link"
|
||||||
|
COM_WEBLINKS_ERR_TABLES_NAME="There is already a Web Link with that name in this category. Please try again."
|
||||||
|
COM_WEBLINKS_ERR_TABLES_PROVIDE_URL="Please provide a valid URL"
|
||||||
|
COM_WEBLINKS_ERR_TABLES_TITLE="Your web link must contain a title."
|
||||||
|
COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another web link from this category has the same alias (remember it may be a trashed item)."
|
||||||
|
COM_WEBLINKS_FIELD_ALIAS_DESC="The alias is for internal use only. Leave this blank and Joomla will fill in a default value from the title. It has to be unique for each web link in the same category."
|
||||||
|
COM_WEBLINKS_FIELD_CATEGORY_DESC="Choose a category for this Web link."
|
||||||
|
COM_WEBLINKS_FIELD_CATEGORYCHOOSE_DESC="Please choose a Web Links category to display."
|
||||||
|
COM_WEBLINKS_FIELD_CAPTCHA_DESC="Select the captcha plugin that will be used in the web link submit form. You may need to enter required information for your captcha plugin in the Plugin Manager.<br />If 'Use Default' is selected, make sure a captcha plugin is selected in Global Configuration."
|
||||||
|
COM_WEBLINKS_FIELD_CAPTCHA_LABEL="Allow Captcha on Web Link"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC="Show or hide the number of Web Links in each Category."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL="# Web Links"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_LABEL="Count Clicks"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_DESCRIPTION_DESC="Show or hide the description below."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_HITS_DESC="Show or hide hits."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_ICON_DESC="If Icon is chosen above, select an icon to display with the Web Links. If none is selected, the default icon will be used."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL="Select Icon"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC="Show or hide the links description."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL="Links Description"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_DESC="Show or hide other categories."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_LABEL="Other Categories"
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_DESC="Show or hide the Report Bad Link option."
|
||||||
|
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_LABEL="Reports"
|
||||||
|
COM_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded."
|
||||||
|
COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
|
||||||
|
COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for the web link."
|
||||||
|
COM_WEBLINKS_FIELD_DISPLAY_NUM_DESC="Default number of Web links to list on a page."
|
||||||
|
COM_WEBLINKS_FIELD_DISPLAY_NUM_LABEL="# of Web links to List"
|
||||||
|
COM_WEBLINKS_FIELD_FIRST_DESC="The image to be displayed."
|
||||||
|
COM_WEBLINKS_FIELD_FIRST_LABEL="First Image"
|
||||||
|
|
||||||
|
COM_WEBLINKS_FIELD_HEIGHT_DESC="Height of the target popup or modal window. Defaults to 600x500 if one field is left empty."
|
||||||
|
COM_WEBLINKS_FIELD_HEIGHT_LABEL="Height"
|
||||||
|
COM_WEBLINKS_FIELD_ICON_DESC="Displays a text, an icon or nothing with the Web links. Default is 'Icon'."
|
||||||
|
COM_WEBLINKS_FIELD_ICON_LABEL="Text/Icon/Web Link Only"
|
||||||
|
COM_WEBLINKS_FIELD_ICON_OPTION_ICON="Icon"
|
||||||
|
COM_WEBLINKS_FIELD_ICON_OPTION_TEXT="Text"
|
||||||
|
COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK="Web Link Only"
|
||||||
|
COM_WEBLINKS_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present."
|
||||||
|
COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL="Alt Text"
|
||||||
|
COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image."
|
||||||
|
COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL="Caption"
|
||||||
|
|
||||||
|
COM_WEBLINKS_FIELD_LANGUAGE_DESC="Assign a language to this web link."
|
||||||
|
COM_WEBLINKS_FIELD_MODIFIED_DESC="The date and time the link was last modified."
|
||||||
|
COM_WEBLINKS_FIELD_SECOND_DESC="The second image to be displayed."
|
||||||
|
COM_WEBLINKS_FIELD_SECOND_LABEL="Second Image"
|
||||||
|
COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC="Select a web links category to display."
|
||||||
|
COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL="Select a Category"
|
||||||
|
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC="Show the tags for a category."
|
||||||
|
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Category Tags"
|
||||||
|
COM_WEBLINKS_FIELD_SHOW_TAGS_DESC="Show the tags for a web link."
|
||||||
|
COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Tags"
|
||||||
|
COM_WEBLINKS_FIELD_STATE_DESC="Set publication status."
|
||||||
|
COM_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected."
|
||||||
|
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
|
||||||
|
COM_WEBLINKS_FIELD_TITLE_DESC="Web Link must have a title."
|
||||||
|
COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL. IDN (International) Links are converted to punycode when they are saved."
|
||||||
|
COM_WEBLINKS_FIELD_URL_LABEL="URL"
|
||||||
|
COM_WEBLINKS_FIELD_VALUE_REPORTED="Reported"
|
||||||
|
COM_WEBLINKS_FIELD_VERSION_DESC="A count of the number of times this web link has been revised."
|
||||||
|
COM_WEBLINKS_FIELD_VERSION_LABEL="Revision"
|
||||||
|
COM_WEBLINKS_FIELD_WIDTH_DESC="Width of the target popup or modal window. Defaults to 600x500 if one field is left empty."
|
||||||
|
COM_WEBLINKS_FIELD_WIDTH_LABEL="Width"
|
||||||
|
COM_WEBLINKS_FIELDSET_IMAGES="Images"
|
||||||
|
COM_WEBLINKS_FIELDSET_OPTIONS="Options"
|
||||||
|
COM_WEBLINKS_FILTER_CATEGORY="Filter Category"
|
||||||
|
COM_WEBLINKS_FILTER_SEARCH_DESC="Search in web link title and alias. Prefix with ID: to search for a web link ID."
|
||||||
|
COM_WEBLINKS_FILTER_SEARCH_LABEL="Search Web Links"
|
||||||
|
COM_WEBLINKS_FILTER_STATE="Filter State"
|
||||||
|
COM_WEBLINKS_FLOAT_FIRST_DESC="Controls placement of the first image."
|
||||||
|
COM_WEBLINKS_FLOAT_FIRST_LABEL="First Image Float"
|
||||||
|
COM_WEBLINKS_FLOAT_SECOND_DESC="Controls placement of the second image."
|
||||||
|
COM_WEBLINKS_FLOAT_SECOND_LABEL="Second Image Float"
|
||||||
|
COM_WEBLINKS_HEADING_ASSOCIATION="Association"
|
||||||
|
COM_WEBLINKS_HITS_DESC="Number of hits for this web link."
|
||||||
|
COM_WEBLINKS_LEFT="Left"
|
||||||
|
COM_WEBLINKS_LIST_LAYOUT_DESC="These settings apply for Web Links List Layout Options unless they are changed for a specific menu item."
|
||||||
|
COM_WEBLINKS_MANAGER_WEBLINK="Web Links"
|
||||||
|
COM_WEBLINKS_MANAGER_WEBLINKS="Web Links"
|
||||||
|
COM_WEBLINKS_MANAGER_WEBLINK_EDIT="Web Link: Edit"
|
||||||
|
COM_WEBLINKS_MANAGER_WEBLINK_NEW="Web Link: New"
|
||||||
|
COM_WEBLINKS_N_ITEMS_ARCHIVED="%d web links successfully archived."
|
||||||
|
COM_WEBLINKS_N_ITEMS_ARCHIVED_1="%d web link successfully archived."
|
||||||
|
COM_WEBLINKS_N_ITEMS_CHECKED_IN_0="No web link successfully checked in."
|
||||||
|
COM_WEBLINKS_N_ITEMS_CHECKED_IN_1="%d web link successfully checked in."
|
||||||
|
COM_WEBLINKS_N_ITEMS_CHECKED_IN_MORE="%d web links successfully checked in."
|
||||||
|
COM_WEBLINKS_N_ITEMS_DELETED="%d web links successfully deleted."
|
||||||
|
COM_WEBLINKS_N_ITEMS_DELETED_1="%d web link successfully deleted."
|
||||||
|
COM_WEBLINKS_N_ITEMS_PUBLISHED="%d web links successfully published."
|
||||||
|
COM_WEBLINKS_N_ITEMS_PUBLISHED_1="%d web link successfully published."
|
||||||
|
COM_WEBLINKS_N_ITEMS_TRASHED="%d web links successfully trashed."
|
||||||
|
COM_WEBLINKS_N_ITEMS_TRASHED_1="%d web link successfully trashed."
|
||||||
|
COM_WEBLINKS_N_ITEMS_UNPUBLISHED="%d web links successfully unpublished."
|
||||||
|
COM_WEBLINKS_N_ITEMS_UNPUBLISHED_1="%d web link successfully unpublished."
|
||||||
|
COM_WEBLINKS_NEW_WEBLINK="New Web Link"
|
||||||
|
COM_WEBLINKS_NONE="None"
|
||||||
|
COM_WEBLINKS_OPTION_FILTER_ACCESS="- Filter Access -"
|
||||||
|
COM_WEBLINKS_OPTION_FILTER_CATEGORY="- Filter Category -"
|
||||||
|
COM_WEBLINKS_OPTION_FILTER_PUBLISHED="- Filter State -"
|
||||||
|
COM_WEBLINKS_OPTIONS="Options"
|
||||||
|
COM_WEBLINKS_ORDER_HEADING="Order"
|
||||||
|
COM_WEBLINKS_RIGHT="Right"
|
||||||
|
COM_WEBLINKS_SAVE_SUCCESS="Web link successfully saved"
|
||||||
|
COM_WEBLINKS_SEARCH_IN_TITLE="Search in title"
|
||||||
|
COM_WEBLINKS_SELECT_A_WEBLINK="Select Web Link"
|
||||||
|
COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty - if it has no Web links or subcategories."
|
||||||
|
COM_WEBLINKS_SUBMENU_CATEGORIES="Categories"
|
||||||
|
COM_WEBLINKS_SUBMENU_WEBLINKS="Web Links"
|
||||||
|
COM_WEBLINKS_WEBLINKS="Web Links"
|
||||||
|
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
|
||||||
|
JGLOBAL_NO_ITEM_SELECTED="No web links selected"
|
||||||
|
JGLOBAL_NEWITEMSLAST_DESC="New Web links default to the last position. Ordering can be changed after this Web link is saved."
|
||||||
|
JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new web links in this category."
|
||||||
|
JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these web links."
|
||||||
|
JLIB_RULES_SETTING_NOTES="Changes apply to this component only.<br /><em><strong>Inherited</strong></em> - a Global Configuration setting or higher level setting is applied.<br /><em><strong>Denied</strong></em> always wins - whatever is set at the Global or higher level and applies to all child elements.<br /><em><strong>Allowed</strong></em> will enable the action for this component unless it is overruled by a Global Configuration setting."
|
@ -1,22 +1,29 @@
|
|||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
|
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.
|
||||||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
|
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
|
||||||
; Note : All ini files need to be saved as UTF-8
|
; Note : All ini files need to be saved as UTF-8
|
||||||
|
|
||||||
COM_WEBLINKS="Weblinks"
|
COM_WEBLINKS="Web Links"
|
||||||
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
|
|
||||||
COM_WEBLINKS_LINKS="Links"
|
|
||||||
COM_WEBLINKS_CATEGORIES="Categories"
|
COM_WEBLINKS_CATEGORIES="Categories"
|
||||||
COM_WEBLINKS_CATEGORY_ADD_TITLE="Category Manager: Add A New Weblinks Category"
|
|
||||||
COM_WEBLINKS_CATEGORY_EDIT_TITLE="Category Manager: Edit A Weblinks Category"
|
|
||||||
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_DESC="Displays a list of Web Links for a category"
|
|
||||||
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_OPTION="Default"
|
|
||||||
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_TITLE="List Web Links in a Category"
|
|
||||||
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_DESC="Show all the web link categories within a category."
|
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_DESC="Show all the web link categories within a category."
|
||||||
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_OPTION="Default"
|
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_OPTION="Default"
|
||||||
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_TITLE="List All Web Link Categories"
|
COM_WEBLINKS_CATEGORIES_VIEW_DEFAULT_TITLE="List All Web Link Categories"
|
||||||
COM_WEBLINKS_ERROR_INSTALL_CATEGORY="Could not add default 'Uncategorised' category due to an error: %s"
|
COM_WEBLINKS_CATEGORY_ADD_TITLE="Category Manager: Add A New Web Links Category"
|
||||||
COM_WEBLINKS_FORM_VIEW_DEFAULT_DESC="Display a form to submit a web link in the frontend."
|
COM_WEBLINKS_CATEGORY_EDIT_TITLE="Category Manager: Edit A Web Links Category"
|
||||||
|
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_DESC="Displays a list of Web Links for a category."
|
||||||
|
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_OPTION="Default"
|
||||||
|
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_TITLE="List Web Links in a Category"
|
||||||
|
COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link"
|
||||||
|
COM_WEBLINKS_CONTENT_TYPE_CATEGORY="Web Links Category"
|
||||||
|
COM_WEBLINKS_FIELD_SELECT_WEBLINK_DESC="Select the desired Web link from the list."
|
||||||
|
COM_WEBLINKS_FIELD_SELECT_WEBLINK_LABEL="Select Weblink"
|
||||||
|
COM_WEBLINKS_FORM_VIEW_DEFAULT_DESC="Display a form to submit a web link in the Frontend."
|
||||||
COM_WEBLINKS_FORM_VIEW_DEFAULT_OPTION="Default"
|
COM_WEBLINKS_FORM_VIEW_DEFAULT_OPTION="Default"
|
||||||
COM_WEBLINKS_FORM_VIEW_DEFAULT_TITLE="Submit a Web Link"
|
COM_WEBLINKS_FORM_VIEW_DEFAULT_TITLE="Submit a Web Link"
|
||||||
|
COM_WEBLINKS_LINKS="Links"
|
||||||
|
COM_WEBLINKS_TAGS_WEBLINK="Web Link"
|
||||||
|
COM_WEBLINKS_TAGS_CATEGORY="Web Link Category"
|
||||||
|
COM_WEBLINKS_WEBLINK_VIEW_DEFAULT_DESC="Display a single Web link"
|
||||||
|
COM_WEBLINKS_WEBLINK_VIEW_DEFAULT_TITLE="Single Weblink"
|
||||||
|
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management."
|
||||||
|
|
@ -1,24 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<extension type="package" version="3.0" method="upgrade">
|
<extension type="package" version="3.6" method="upgrade">
|
||||||
<name>pkg_weblinks</name>
|
<name>pkg_weblinks</name>
|
||||||
<packagename>weblinks</packagename>
|
<packagename>weblinks</packagename>
|
||||||
<creationDate>December 2012</creationDate>
|
<creationDate>##DATE##</creationDate>
|
||||||
<packager>Joomla! Project</packager>
|
<packager>Joomla! Project</packager>
|
||||||
<copyright>(C) 2005 - 2014 Open Source Matters. All rights reserved.</copyright>
|
<copyright>(C) 2005 - ##YEAR## Open Source Matters. All rights reserved.</copyright>
|
||||||
<packageremail>admin@joomla.org</packageremail>
|
<packageremail>admin@joomla.org</packageremail>
|
||||||
<packagerurl>www.joomla.org</packagerurl>
|
<packagerurl>www.joomla.org</packagerurl>
|
||||||
<author>Joomla! Project</author>
|
<author>Joomla! Project</author>
|
||||||
<authorEmail>admin@joomla.org</authorEmail>
|
<authorEmail>admin@joomla.org</authorEmail>
|
||||||
<authorUrl>www.joomla.org</authorUrl>
|
<authorUrl>www.joomla.org</authorUrl>
|
||||||
<version>3.4.0-rc</version>
|
<version>##VERSION##</version>
|
||||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
<description>PKG_WEBLINKS_XML_DESCRIPTION</description>
|
<description>PKG_WEBLINKS_XML_DESCRIPTION</description>
|
||||||
|
<scriptfile>script.php</scriptfile>
|
||||||
<files>
|
<files>
|
||||||
<!-- The id for each extension is the element stored in the DB -->
|
<!-- The id for each extension is the element stored in the DB -->
|
||||||
<file type="component" id="com_weblinks">com_weblinks.zip</file>
|
<file type="component" id="com_weblinks">com_weblinks.zip</file>
|
||||||
<file type="module" id="mod_weblinks" client="site">mod_weblinks.zip</file>
|
<file type="module" id="mod_weblinks" client="site">mod_weblinks.zip</file>
|
||||||
<file type="plugin" id="weblinks" group="finder">plg_finder_weblinks.zip</file>
|
<file type="plugin" id="weblinks" group="finder">plg_finder_weblinks.zip</file>
|
||||||
<file type="plugin" id="weblinks" group="search">plg_search_weblinks.zip</file>
|
<file type="plugin" id="weblinks" group="search">plg_search_weblinks.zip</file>
|
||||||
|
<file type="plugin" id="weblinks" group="system">plg_system_weblinks.zip</file>
|
||||||
|
<file type="plugin" id="weblinks" group="editors-xtd">plg_editors-xtd_weblink.zip</file>
|
||||||
</files>
|
</files>
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
<language tag="en-GB">en-GB/en-GB.pkg_weblinks.sys.ini</language>
|
<language tag="en-GB">en-GB/en-GB.pkg_weblinks.sys.ini</language>
|
29
src/administrator/manifests/packages/weblinks/script.php
Normal file
29
src/administrator/manifests/packages/weblinks/script.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Administrator
|
||||||
|
* @subpackage Weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installation class to perform additional changes during install/uninstall/update
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
class Pkg_WeblinksInstallerScript extends JInstallerScript
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Extension script constructor.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->minimumJoomla = '3.6.3';
|
||||||
|
$this->minimumPhp = JOOMLA_MINIMUM_PHP;
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<access component="com_weblinks">
|
|
||||||
<section name="component">
|
|
||||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
|
||||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
|
||||||
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
|
|
||||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
|
||||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
|
|
||||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
|
||||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
|
||||||
</section>
|
|
||||||
<section name="category">
|
|
||||||
<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
|
|
||||||
<action name="core.delete" title="JACTION_DELETE" description="COM_CATEGORIES_ACCESS_DELETE_DESC" />
|
|
||||||
<action name="core.edit" title="JACTION_EDIT" description="COM_CATEGORIES_ACCESS_EDIT_DESC" />
|
|
||||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
|
|
||||||
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
|
|
||||||
</section>
|
|
||||||
</access>
|
|
@ -1,367 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<config>
|
|
||||||
<fieldset name="component"
|
|
||||||
label="COM_WEBLINKS_COMPONENT_LABEL"
|
|
||||||
description="COM_WEBLINKS_COMPONENT_DESC"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field name="target" type="list"
|
|
||||||
default="0"
|
|
||||||
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
|
||||||
>
|
|
||||||
<option value="0">JBROWSERTARGET_PARENT</option>
|
|
||||||
<option value="1">JBROWSERTARGET_NEW</option>
|
|
||||||
<option value="2">JBROWSERTARGET_POPUP</option>
|
|
||||||
<option value="3">JBROWSERTARGET_MODAL</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="save_history"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
|
|
||||||
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
|
|
||||||
>
|
|
||||||
<option value="1">JYES</option>
|
|
||||||
<option value="0">JNO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="history_limit"
|
|
||||||
type="text"
|
|
||||||
filter="integer"
|
|
||||||
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
|
||||||
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
|
||||||
default="5"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="count_clicks" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC">
|
|
||||||
<option value="1">JYES</option>
|
|
||||||
<option value="0">JNO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="icons" type="list"
|
|
||||||
default="1"
|
|
||||||
label="COM_WEBLINKS_FIELD_ICON_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_ICON_DESC"
|
|
||||||
filter="integer">
|
|
||||||
<option value="0">COM_WEBLINKS_FIELD_ICON_OPTION_TEXT</option>
|
|
||||||
<option value="1">COM_WEBLINKS_FIELD_ICON_OPTION_ICON</option>
|
|
||||||
<option value="2">COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="link_icons" type="media"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_ICON_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="float_first"
|
|
||||||
type="list"
|
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
|
||||||
</field>
|
|
||||||
<field
|
|
||||||
name="float_second"
|
|
||||||
type="list"
|
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field
|
|
||||||
id="show_tags"
|
|
||||||
name="show_tags"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_SHOW_TAGS_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="category"
|
|
||||||
label="JCATEGORY"
|
|
||||||
description="COM_WEBLINKS_CATEGORY_DESC"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="category_layout" type="componentlayout"
|
|
||||||
label="JGLOBAL_FIELD_LAYOUT_LABEL"
|
|
||||||
description="JGLOBAL_FIELD_LAYOUT_DESC"
|
|
||||||
menuitems="true"
|
|
||||||
extension="com_weblinks"
|
|
||||||
view="category"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="show_category_title" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
|
||||||
default="1"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description_image"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="maxLevel" type="list"
|
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
|
||||||
default="-1"
|
|
||||||
>
|
|
||||||
<option value="0">JNONE</option>
|
|
||||||
<option value="-1">JALL</option>
|
|
||||||
<option value="1">J1</option>
|
|
||||||
<option value="2">J2</option>
|
|
||||||
<option value="3">J3</option>
|
|
||||||
<option value="4">J4</option>
|
|
||||||
<option value="5">J5</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_empty_categories" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
|
||||||
default="0"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_subcat_desc" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_tags" type="radio"
|
|
||||||
label="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="categories"
|
|
||||||
label="JCATEGORIES"
|
|
||||||
description="COM_WEBLINKS_CATEGORIES_DESC"
|
|
||||||
>
|
|
||||||
<field name="show_base_description" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
|
||||||
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="maxLevelcat" type="list"
|
|
||||||
default="-1"
|
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="-1">JALL</option>
|
|
||||||
<option value="1">J1</option>
|
|
||||||
<option value="2">J2</option>
|
|
||||||
<option value="3">J3</option>
|
|
||||||
<option value="4">J4</option>
|
|
||||||
<option value="5">J5</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
<field name="show_empty_categories_cat" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_subcat_desc_cat" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_num_links_cat" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
|
||||||
>
|
|
||||||
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
|
|
||||||
<fieldset name="list_layout"
|
|
||||||
label="JGLOBAL_LIST_LAYOUT_OPTIONS"
|
|
||||||
description="COM_WEBLINKS_LIST_LAYOUT_DESC"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="filter_field"
|
|
||||||
type="list"
|
|
||||||
default="1"
|
|
||||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
|
||||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="hide">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="show_pagination_limit"
|
|
||||||
type="radio" default="1"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_headings" type="radio"
|
|
||||||
default="1"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
|
||||||
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_description" type="radio"
|
|
||||||
default="1"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_hits" type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
|
||||||
label="JGLOBAL_HITS"
|
|
||||||
>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination"
|
|
||||||
type="list"
|
|
||||||
default="2"
|
|
||||||
label="JGLOBAL_PAGINATION_LABEL"
|
|
||||||
description="JGLOBAL_PAGINATION_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_results"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset
|
|
||||||
name="integration"
|
|
||||||
label="JGLOBAL_INTEGRATION_LABEL"
|
|
||||||
description="COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="show_feed_link"
|
|
||||||
type="radio"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
|
||||||
description="JGLOBAL_SHOW_FEED_LINK_DESC">
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="permissions"
|
|
||||||
description="JCONFIG_PERMISSIONS_DESC"
|
|
||||||
label="JCONFIG_PERMISSIONS_LABEL"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field name="rules" type="rules"
|
|
||||||
component="com_weblinks"
|
|
||||||
filter="rules"
|
|
||||||
validate="rules"
|
|
||||||
label="JCONFIG_PERMISSIONS_LABEL"
|
|
||||||
section="component" />
|
|
||||||
</fieldset>
|
|
||||||
</config>
|
|
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Weblinks helper.
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
class WeblinksHelper extends JHelperContent
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Configure the Linkbar.
|
|
||||||
*
|
|
||||||
* @param string $vName The name of the active view.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
public static function addSubmenu($vName = 'weblinks')
|
|
||||||
{
|
|
||||||
JHtmlSidebar::addEntry(
|
|
||||||
JText::_('COM_WEBLINKS_SUBMENU_WEBLINKS'),
|
|
||||||
'index.php?option=com_weblinks&view=weblinks',
|
|
||||||
$vName == 'weblinks'
|
|
||||||
);
|
|
||||||
|
|
||||||
JHtmlSidebar::addEntry(
|
|
||||||
JText::_('COM_WEBLINKS_SUBMENU_CATEGORIES'),
|
|
||||||
'index.php?option=com_categories&extension=com_weblinks',
|
|
||||||
$vName == 'categories'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,121 +0,0 @@
|
|||||||
; Joomla! Project
|
|
||||||
; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
|
|
||||||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
|
|
||||||
; Note : All ini files need to be saved as UTF-8
|
|
||||||
|
|
||||||
COM_WEBLINKS="Weblinks"
|
|
||||||
COM_WEBLINKS_ACCESS_HEADING="Access"
|
|
||||||
COM_WEBLINKS_BATCH_OPTIONS="Batch process the selected links"
|
|
||||||
COM_WEBLINKS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved links. Otherwise, all actions are applied to the selected links."
|
|
||||||
COM_WEBLINKS_CATEGORIES_DESC="These settings apply for Web Links Categories Options unless they are changed for a specific menu item."
|
|
||||||
COM_WEBLINKS_CATEGORY_DESC="These settings apply for Web Links Category Options unless they are changed for a specific menu item."
|
|
||||||
COM_WEBLINKS_COMPONENT_DESC="These settings apply for Web Links unless they are changed for a specific menu item or web link."
|
|
||||||
COM_WEBLINKS_COMPONENT_LABEL="Weblink"
|
|
||||||
COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Weblinks Component will integrate with other extensions."
|
|
||||||
COM_WEBLINKS_CONFIGURATION="Web Links Manager Options"
|
|
||||||
COM_WEBLINKS_EDIT_WEBLINK="Edit Web Link"
|
|
||||||
COM_WEBLINKS_ERR_TABLES_NAME="There is already a Web Link with that name in this category. Please try again."
|
|
||||||
COM_WEBLINKS_ERR_TABLES_PROVIDE_URL="Please provide a valid URL"
|
|
||||||
COM_WEBLINKS_ERR_TABLES_TITLE="Your web link must contain a title."
|
|
||||||
COM_WEBLINKS_ERROR_UNIQUE_ALIAS="Another web link from this category has the same alias"
|
|
||||||
COM_WEBLINKS_FIELD_ALIAS_DESC="The alias is for internal use only. Leave this blank and Joomla will fill in a default value from the title. It has to be unique for each web link in the same category."
|
|
||||||
COM_WEBLINKS_FIELD_CATEGORY_DESC="Choose a category for this Web link"
|
|
||||||
COM_WEBLINKS_FIELD_CATEGORYCHOOSE_DESC="Please choose a Web Links category to display"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC="Show/Hide the number of Web Links in each Category"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL="# Web Links"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_COUNTCLICKS_LABEL="Count Clicks"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_DESCRIPTION_DESC="Show/Hide the description below"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_HITS_DESC="Show/Hide hits"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_ICON_DESC="If Icon is chosen above, select an icon to display with the Web Links. If none is selected, the default icon will be used."
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL="Select Icon"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC="Show/Hide the links description"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL="Links description"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_DESC="Show/hide other categories"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_OTHERCATS_LABEL="Other categories"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_DESC="Show/Hide the Report Bad Link option"
|
|
||||||
COM_WEBLINKS_FIELD_CONFIG_SHOWREPORT_LABEL="Reports"
|
|
||||||
COM_WEBLINKS_FIELD_COUNTCLICKS_DESC="If set to yes, the number of times the link has been clicked will be recorded"
|
|
||||||
COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL="Count Clicks"
|
|
||||||
COM_WEBLINKS_FIELD_DESCRIPTION_DESC="Enter a description for the web link."
|
|
||||||
COM_WEBLINKS_FIELD_DISPLAY_NUM_DESC="Default number of Web links to list on a page."
|
|
||||||
COM_WEBLINKS_FIELD_DISPLAY_NUM_LABEL="# of Web links to List"
|
|
||||||
COM_WEBLINKS_FIELD_FIRST_DESC="The image to be displayed"
|
|
||||||
COM_WEBLINKS_FIELD_FIRST_LABEL="First image"
|
|
||||||
|
|
||||||
COM_WEBLINKS_FIELD_HEIGHT_DESC="Height of the target popup or modal window. Defaults to 600x500 if one field is left empty."
|
|
||||||
COM_WEBLINKS_FIELD_HEIGHT_LABEL="Height"
|
|
||||||
COM_WEBLINKS_FIELD_ICON_DESC="Displays a text, an icon or nothing with the Web links. Default is 'Icon'."
|
|
||||||
COM_WEBLINKS_FIELD_ICON_LABEL="Text/Icon/Web Link Only"
|
|
||||||
COM_WEBLINKS_FIELD_ICON_OPTION_ICON="Icon"
|
|
||||||
COM_WEBLINKS_FIELD_ICON_OPTION_TEXT="Text"
|
|
||||||
COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK="Web Link Only"
|
|
||||||
COM_WEBLINKS_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present."
|
|
||||||
COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL="Alt text"
|
|
||||||
COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image"
|
|
||||||
COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL="Caption"
|
|
||||||
|
|
||||||
COM_WEBLINKS_FIELD_LANGUAGE_DESC="Assign a language to this weblink"
|
|
||||||
COM_WEBLINKS_FIELD_MODIFIED_DESC="The date and time the link was last modified"
|
|
||||||
COM_WEBLINKS_FIELD_SECOND_DESC="The second image to be displayed"
|
|
||||||
COM_WEBLINKS_FIELD_SECOND_LABEL="Second image"
|
|
||||||
COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC="Select a weblinks category to display"
|
|
||||||
COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL="Select a category"
|
|
||||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC="Show the tags for a category"
|
|
||||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags"
|
|
||||||
COM_WEBLINKS_FIELD_SHOW_TAGS_DESC="Show the tags for a weblink"
|
|
||||||
COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Show Tags "
|
|
||||||
COM_WEBLINKS_FIELD_STATE_DESC="Set publication status."
|
|
||||||
COM_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is clicked"
|
|
||||||
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
|
|
||||||
COM_WEBLINKS_FIELD_TITLE_DESC="Web Link must have a title"
|
|
||||||
COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL. IDN (International) Links are converted to punycode when they are saved."
|
|
||||||
COM_WEBLINKS_FIELD_URL_LABEL="URL"
|
|
||||||
COM_WEBLINKS_FIELD_VALUE_REPORTED="Reported"
|
|
||||||
COM_WEBLINKS_FIELD_VERSION_DESC="A count of the number of times this weblink has been revised."
|
|
||||||
COM_WEBLINKS_FIELD_VERSION_LABEL="Revision"
|
|
||||||
COM_WEBLINKS_FIELD_WIDTH_DESC="Width of the target popup or modal window. Defaults to 600x500 if one field is left empty."
|
|
||||||
COM_WEBLINKS_FIELD_WIDTH_LABEL="Width"
|
|
||||||
COM_WEBLINKS_FIELDSET_IMAGES="Images"
|
|
||||||
COM_WEBLINKS_FIELDSET_OPTIONS="Options"
|
|
||||||
COM_WEBLINKS_FILTER_CATEGORY="Filter Category"
|
|
||||||
COM_WEBLINKS_FILTER_STATE="Filter State"
|
|
||||||
COM_WEBLINKS_FLOAT_DESC="Controls placement of the image"
|
|
||||||
COM_WEBLINKS_FLOAT_LABEL="Image Float"
|
|
||||||
COM_WEBLINKS_HITS_DESC="Number of hits for this weblink"
|
|
||||||
COM_WEBLINKS_LEFT="Left"
|
|
||||||
COM_WEBLINKS_LIST_LAYOUT_DESC="These settings apply for Weblinks List Layout Options unless they are changed for a specific menu item."
|
|
||||||
COM_WEBLINKS_MANAGER_WEBLINK="Web Links Manager: Web Link"
|
|
||||||
COM_WEBLINKS_MANAGER_WEBLINKS="Web Links Manager: Web Links"
|
|
||||||
COM_WEBLINKS_N_ITEMS_ARCHIVED="%d weblinks successfully archived"
|
|
||||||
COM_WEBLINKS_N_ITEMS_ARCHIVED_1="%d weblink successfully archived"
|
|
||||||
COM_WEBLINKS_N_ITEMS_CHECKED_IN_0="No weblink successfully checked in"
|
|
||||||
COM_WEBLINKS_N_ITEMS_CHECKED_IN_1="%d weblink successfully checked in"
|
|
||||||
COM_WEBLINKS_N_ITEMS_CHECKED_IN_MORE="%d weblinks successfully checked in"
|
|
||||||
COM_WEBLINKS_N_ITEMS_DELETED="%d weblinks successfully deleted"
|
|
||||||
COM_WEBLINKS_N_ITEMS_DELETED_1="%d weblink successfully deleted"
|
|
||||||
COM_WEBLINKS_N_ITEMS_PUBLISHED="%d weblinks successfully published"
|
|
||||||
COM_WEBLINKS_N_ITEMS_PUBLISHED_1="%d weblink successfully published"
|
|
||||||
COM_WEBLINKS_N_ITEMS_TRASHED="%d weblinks successfully trashed"
|
|
||||||
COM_WEBLINKS_N_ITEMS_TRASHED_1="%d weblink successfully trashed"
|
|
||||||
COM_WEBLINKS_N_ITEMS_UNPUBLISHED="%d weblinks successfully unpublished"
|
|
||||||
COM_WEBLINKS_N_ITEMS_UNPUBLISHED_1="%d weblink successfully unpublished"
|
|
||||||
COM_WEBLINKS_NEW_WEBLINK="New Web link"
|
|
||||||
COM_WEBLINKS_NONE="None"
|
|
||||||
COM_WEBLINKS_OPTION_FILTER_ACCESS="- Filter Access -"
|
|
||||||
COM_WEBLINKS_OPTION_FILTER_CATEGORY="- Filter Category -"
|
|
||||||
COM_WEBLINKS_OPTION_FILTER_PUBLISHED="- Filter State -"
|
|
||||||
COM_WEBLINKS_OPTIONS="Options"
|
|
||||||
COM_WEBLINKS_ORDER_HEADING="Order"
|
|
||||||
COM_WEBLINKS_RIGHT="Right"
|
|
||||||
COM_WEBLINKS_SAVE_SUCCESS="Weblink successfully saved"
|
|
||||||
COM_WEBLINKS_SEARCH_IN_TITLE="Search in title"
|
|
||||||
COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty - if it has no Weblinks or subcategories."
|
|
||||||
COM_WEBLINKS_SUBMENU_CATEGORIES="Categories"
|
|
||||||
COM_WEBLINKS_SUBMENU_WEBLINKS="Web Links"
|
|
||||||
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
|
|
||||||
JGLOBAL_NO_ITEM_SELECTED="No weblinks selected"
|
|
||||||
JGLOBAL_NEWITEMSLAST_DESC="New Weblinks default to the last position. Ordering can be changed after this Weblink is saved."
|
|
||||||
JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new weblinks in this category."
|
|
||||||
JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these weblinks."
|
|
||||||
JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:<br /><em>Inherited</em> means that the permissions from global configuration and parent group will be used.<br /><em>Denied</em> means that no matter what the global configuration or parent group settings are, the group being edited cannot take this action on this component.<br /><em>Allowed</em> means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by <em>Not Allowed (Locked)</em> under Calculated Settings).<br />2. If you select a new setting, click <em>Save</em> to refresh the calculated settings."
|
|
@ -1,265 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<form>
|
|
||||||
<fieldset
|
|
||||||
addfieldpath="/administrator/components/com_categories/models/fields"
|
|
||||||
>
|
|
||||||
<field name="id" type="text" default="0" label="JGLOBAL_FIELD_ID_LABEL"
|
|
||||||
readonly="true" class="readonly"
|
|
||||||
description="JGLOBAL_FIELD_ID_DESC"/>
|
|
||||||
|
|
||||||
<field name="title" type="text"
|
|
||||||
class="input-xxlarge input-large-text"
|
|
||||||
size="40" label="JGLOBAL_TITLE"
|
|
||||||
description="COM_WEBLINKS_FIELD_TITLE_DESC" required="true" />
|
|
||||||
|
|
||||||
<field name="alias" type="text"
|
|
||||||
size="40" label="JFIELD_ALIAS_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
|
||||||
hint="JFIELD_ALIAS_PLACEHOLDER" />
|
|
||||||
|
|
||||||
<field name="catid" type="categoryedit" extension="com_weblinks"
|
|
||||||
label="JCATEGORY" description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
|
||||||
>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
|
|
||||||
<field name="url" type="url"
|
|
||||||
class="span12"
|
|
||||||
filter="url"
|
|
||||||
size="40" label="COM_WEBLINKS_FIELD_URL_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_URL_DESC" required="true" />
|
|
||||||
|
|
||||||
<field name="description" type="editor" buttons="true" hide="pagebreak,readmore"
|
|
||||||
filter="JComponentHelper::filterText"
|
|
||||||
label="JGLOBAL_DESCRIPTION" description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC" />
|
|
||||||
|
|
||||||
<field name="hits"
|
|
||||||
type="text"
|
|
||||||
class="readonly"
|
|
||||||
size="6" label="JGLOBAL_HITS"
|
|
||||||
description="COM_WEBLINKS_HITS_DESC"
|
|
||||||
readonly="true"
|
|
||||||
filter="unset" />
|
|
||||||
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="state"
|
|
||||||
type="list"
|
|
||||||
label="JSTATUS"
|
|
||||||
description="COM_WEBLINKS_FIELD_STATE_DESC"
|
|
||||||
class="chzn-color-state"
|
|
||||||
size="1"
|
|
||||||
default="1">
|
|
||||||
<option
|
|
||||||
value="1">JPUBLISHED</option>
|
|
||||||
<option
|
|
||||||
value="0">JUNPUBLISHED</option>
|
|
||||||
<option
|
|
||||||
value="2">JARCHIVED</option>
|
|
||||||
<option
|
|
||||||
value="-3">COM_WEBLINKS_FIELD_VALUE_REPORTED</option>
|
|
||||||
<option
|
|
||||||
value="-2">JTRASHED</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="ordering" type="ordering"
|
|
||||||
label="JFIELD_ORDERING_LABEL"
|
|
||||||
description="JFIELD_ORDERING_DESC"
|
|
||||||
content_type="com_weblinks.weblink"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="access" type="accesslevel" label="JFIELD_ACCESS_LABEL"
|
|
||||||
description="JFIELD_ACCESS_DESC" size="1" />
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="language"
|
|
||||||
type="contentlanguage"
|
|
||||||
label="JFIELD_LANGUAGE_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_LANGUAGE_DESC"
|
|
||||||
>
|
|
||||||
<option value="*">JALL</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="tags"
|
|
||||||
type="tag"
|
|
||||||
label="JTAG"
|
|
||||||
description="JTAG_DESC"
|
|
||||||
multiple="true"
|
|
||||||
>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="version_note"
|
|
||||||
type="text"
|
|
||||||
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
|
|
||||||
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
|
||||||
size="45"
|
|
||||||
labelclass="control-label"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="created" type="calendar"
|
|
||||||
label="JGLOBAL_FIELD_CREATED_LABEL" description="JGLOBAL_FIELD_CREATED_DESC"
|
|
||||||
size="22" format="%Y-%m-%d %H:%M:%S"
|
|
||||||
filter="user_utc" />
|
|
||||||
|
|
||||||
<field name="created_by" type="user"
|
|
||||||
label="JGLOBAL_FIELD_CREATED_BY_LABEL" description="JGLOBAL_FIELD_CREATED_BY_Desc" />
|
|
||||||
|
|
||||||
<field name="created_by_alias" type="text"
|
|
||||||
label="JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL" description="JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC"
|
|
||||||
size="20" />
|
|
||||||
|
|
||||||
<field name="modified" type="calendar" class="readonly"
|
|
||||||
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_WEBLINKS_FIELD_MODIFIED_DESC"
|
|
||||||
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S"
|
|
||||||
filter="user_utc" />
|
|
||||||
|
|
||||||
<field name="modified_by" type="user"
|
|
||||||
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
|
|
||||||
class="readonly"
|
|
||||||
readonly="true"
|
|
||||||
filter="unset" />
|
|
||||||
|
|
||||||
<field name="checked_out" type="hidden" filter="unset" />
|
|
||||||
|
|
||||||
<field name="checked_out_time" type="hidden" filter="unset" />
|
|
||||||
|
|
||||||
<field name="publish_up" type="calendar"
|
|
||||||
label="JGLOBAL_FIELD_PUBLISH_UP_LABEL" description="JGLOBAL_FIELD_PUBLISH_UP_DESC"
|
|
||||||
format="%Y-%m-%d %H:%M:%S" size="22"
|
|
||||||
filter="user_utc" />
|
|
||||||
|
|
||||||
<field name="publish_down" type="calendar"
|
|
||||||
label="JGLOBAL_FIELD_PUBLISH_DOWN_LABEL" description="JGLOBAL_FIELD_PUBLISH_DOWN_DESC"
|
|
||||||
format="%Y-%m-%d %H:%M:%S" size="22"
|
|
||||||
filter="user_utc" />
|
|
||||||
|
|
||||||
<field name="version" type="text" class="readonly"
|
|
||||||
label="COM_WEBLINKS_FIELD_VERSION_LABEL" size="6" description="COM_WEBLINKS_FIELD_VERSION_DESC"
|
|
||||||
readonly="true" filter="unset" />
|
|
||||||
|
|
||||||
|
|
||||||
<field name="metakey" type="textarea"
|
|
||||||
label="JFIELD_META_KEYWORDS_LABEL" description="JFIELD_META_KEYWORDS_DESC"
|
|
||||||
rows="3" cols="30" />
|
|
||||||
|
|
||||||
<field name="metadesc" type="textarea"
|
|
||||||
label="JFIELD_META_DESCRIPTION_LABEL" description="JFIELD_META_DESCRIPTION_DESC"
|
|
||||||
rows="3" cols="30" />
|
|
||||||
|
|
||||||
<field name="xreference" type="text"
|
|
||||||
label="JFIELD_XREFERENCE_LABEL" description="JFIELD_XREFERENCE_DESC"
|
|
||||||
size="20" />
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fields name="params" label="JGLOBAL_FIELDSET_DISPLAY_OPTIONS">
|
|
||||||
<fieldset name="jbasic" label="COM_WEBLINKS_FIELDSET_OPTIONS">
|
|
||||||
<field name="target" type="list" default=""
|
|
||||||
label="COM_WEBLINKS_FIELD_TARGET_LABEL" description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JBROWSERTARGET_PARENT</option>
|
|
||||||
<option value="1">JBROWSERTARGET_NEW</option>
|
|
||||||
<option value="2">JBROWSERTARGET_POPUP</option>
|
|
||||||
<option value="3">JBROWSERTARGET_MODAL</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="width" type="text"
|
|
||||||
class="validate-numeric" label="COM_WEBLINKS_FIELD_WIDTH_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_WIDTH_DESC" />
|
|
||||||
|
|
||||||
<field name="height" type="text"
|
|
||||||
class="validate-numeric" label="COM_WEBLINKS_FIELD_HEIGHT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_HEIGHT_DESC" />
|
|
||||||
|
|
||||||
<field name="count_clicks" type="list"
|
|
||||||
class="chzn-color"
|
|
||||||
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JNO</option>
|
|
||||||
<option value="1">JYES</option>
|
|
||||||
</field>
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
<fields name="images">
|
|
||||||
<fieldset name="images" label="JGLOBAL_FIELDSET_IMAGE_OPTIONS">
|
|
||||||
<field
|
|
||||||
name="image_first"
|
|
||||||
type="media"
|
|
||||||
label="COM_WEBLINKS_FIELD_FIRST_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_FIRST_DESC" />
|
|
||||||
<field
|
|
||||||
name="float_first"
|
|
||||||
type="list"
|
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
|
||||||
</field>
|
|
||||||
<field name="image_first_alt"
|
|
||||||
type="text"
|
|
||||||
label="COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_IMAGE_ALT_DESC"
|
|
||||||
size="20" />
|
|
||||||
<field name="image_first_caption"
|
|
||||||
type="text"
|
|
||||||
label="COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC"
|
|
||||||
size="20" />
|
|
||||||
|
|
||||||
<field name="spacer1"
|
|
||||||
type="spacer"
|
|
||||||
hr="true" />
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="image_second"
|
|
||||||
type="media"
|
|
||||||
label="COM_WEBLINKS_FIELD_SECOND_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_SECOND_DESC" />
|
|
||||||
<field
|
|
||||||
name="float_second"
|
|
||||||
type="list"
|
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
|
||||||
</field>
|
|
||||||
<field name="image_second_alt"
|
|
||||||
type="text"
|
|
||||||
label="COM_WEBLINKS_FIELD_IMAGE_ALT_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_IMAGE_ALT_DESC"
|
|
||||||
size="20" />
|
|
||||||
<field name="image_second_caption"
|
|
||||||
type="text"
|
|
||||||
label="COM_WEBLINKS_FIELD_IMAGE_CAPTION_LABEL"
|
|
||||||
description="COM_WEBLINKS_FIELD_IMAGE_CAPTION_DESC"
|
|
||||||
size="20" />
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
|
|
||||||
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
|
|
||||||
<fieldset name="jmetadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
|
|
||||||
|
|
||||||
<field name="robots"
|
|
||||||
type="list"
|
|
||||||
label="JFIELD_METADATA_ROBOTS_LABEL"
|
|
||||||
description="JFIELD_METADATA_ROBOTS_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
|
||||||
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
|
||||||
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
|
|
||||||
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="rights" type="text"
|
|
||||||
label="JFIELD_META_RIGHTS_LABEL" description="JFIELD_META_RIGHTS_DESC"
|
|
||||||
required="false" filter="string" cols="30" rows="2" />
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
</form>
|
|
@ -1,230 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Methods supporting a list of weblink records.
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
class WeblinksModelWeblinks extends JModelList
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @param array An optional associative array of configuration settings.
|
|
||||||
* @see JController
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
public function __construct($config = array())
|
|
||||||
{
|
|
||||||
if (empty($config['filter_fields']))
|
|
||||||
{
|
|
||||||
$config['filter_fields'] = array(
|
|
||||||
'id', 'a.id',
|
|
||||||
'title', 'a.title',
|
|
||||||
'alias', 'a.alias',
|
|
||||||
'checked_out', 'a.checked_out',
|
|
||||||
'checked_out_time', 'a.checked_out_time',
|
|
||||||
'catid', 'a.catid', 'category_title',
|
|
||||||
'state', 'a.state',
|
|
||||||
'access', 'a.access', 'access_level',
|
|
||||||
'created', 'a.created',
|
|
||||||
'created_by', 'a.created_by',
|
|
||||||
'ordering', 'a.ordering',
|
|
||||||
'featured', 'a.featured',
|
|
||||||
'language', 'a.language',
|
|
||||||
'hits', 'a.hits',
|
|
||||||
'publish_up', 'a.publish_up',
|
|
||||||
'publish_down', 'a.publish_down',
|
|
||||||
'url', 'a.url',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::__construct($config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to auto-populate the model state.
|
|
||||||
*
|
|
||||||
* Note. Calling getState in this method will result in recursion.
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function populateState($ordering = null, $direction = null)
|
|
||||||
{
|
|
||||||
// Load the filter state.
|
|
||||||
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
|
|
||||||
$this->setState('filter.search', $search);
|
|
||||||
|
|
||||||
$accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
|
|
||||||
$this->setState('filter.access', $accessId);
|
|
||||||
|
|
||||||
$published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
|
|
||||||
$this->setState('filter.state', $published);
|
|
||||||
|
|
||||||
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '');
|
|
||||||
$this->setState('filter.category_id', $categoryId);
|
|
||||||
|
|
||||||
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
|
|
||||||
$this->setState('filter.language', $language);
|
|
||||||
|
|
||||||
$tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '');
|
|
||||||
$this->setState('filter.tag', $tag);
|
|
||||||
|
|
||||||
// Load the parameters.
|
|
||||||
$params = JComponentHelper::getParams('com_weblinks');
|
|
||||||
$this->setState('params', $params);
|
|
||||||
|
|
||||||
// List state information.
|
|
||||||
parent::populateState('a.title', 'asc');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to get a store id based on model configuration state.
|
|
||||||
*
|
|
||||||
* This is necessary because the model is used by the component and
|
|
||||||
* different modules that might need different sets of data or different
|
|
||||||
* ordering requirements.
|
|
||||||
*
|
|
||||||
* @param string $id A prefix for the store id.
|
|
||||||
* @return string A store id.
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function getStoreId($id = '')
|
|
||||||
{
|
|
||||||
// Compile the store id.
|
|
||||||
$id .= ':' . $this->getState('filter.search');
|
|
||||||
$id .= ':' . $this->getState('filter.access');
|
|
||||||
$id .= ':' . $this->getState('filter.state');
|
|
||||||
$id .= ':' . $this->getState('filter.category_id');
|
|
||||||
$id .= ':' . $this->getState('filter.language');
|
|
||||||
|
|
||||||
return parent::getStoreId($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build an SQL query to load the list data.
|
|
||||||
*
|
|
||||||
* @return JDatabaseQuery
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function getListQuery()
|
|
||||||
{
|
|
||||||
// Create a new query object.
|
|
||||||
$db = $this->getDbo();
|
|
||||||
$query = $db->getQuery(true);
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
// Select the required fields from the table.
|
|
||||||
$query->select(
|
|
||||||
$this->getState(
|
|
||||||
'list.select',
|
|
||||||
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid,' .
|
|
||||||
'a.hits,' .
|
|
||||||
'a.state, a.access, a.ordering,' .
|
|
||||||
'a.language, a.publish_up, a.publish_down'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$query->from($db->quoteName('#__weblinks') . ' AS a');
|
|
||||||
|
|
||||||
// Join over the language
|
|
||||||
$query->select('l.title AS language_title')
|
|
||||||
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
|
|
||||||
|
|
||||||
// Join over the users for the checked out user.
|
|
||||||
$query->select('uc.name AS editor')
|
|
||||||
->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
|
|
||||||
|
|
||||||
// Join over the asset groups.
|
|
||||||
$query->select('ag.title AS access_level')
|
|
||||||
->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
|
|
||||||
|
|
||||||
// Join over the categories.
|
|
||||||
$query->select('c.title AS category_title')
|
|
||||||
->join('LEFT', '#__categories AS c ON c.id = a.catid');
|
|
||||||
|
|
||||||
// Filter by access level.
|
|
||||||
if ($access = $this->getState('filter.access'))
|
|
||||||
{
|
|
||||||
$query->where('a.access = ' . (int) $access);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implement View Level Access
|
|
||||||
if (!$user->authorise('core.admin'))
|
|
||||||
{
|
|
||||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
|
||||||
$query->where('a.access IN (' . $groups . ')');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by published state
|
|
||||||
$published = $this->getState('filter.state');
|
|
||||||
if (is_numeric($published))
|
|
||||||
{
|
|
||||||
$query->where('a.state = ' . (int) $published);
|
|
||||||
}
|
|
||||||
elseif ($published === '')
|
|
||||||
{
|
|
||||||
$query->where('(a.state IN (0, 1))');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by category.
|
|
||||||
$categoryId = $this->getState('filter.category_id');
|
|
||||||
if (is_numeric($categoryId))
|
|
||||||
{
|
|
||||||
$query->where('a.catid = ' . (int) $categoryId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by search in title
|
|
||||||
$search = $this->getState('filter.search');
|
|
||||||
if (!empty($search))
|
|
||||||
{
|
|
||||||
if (stripos($search, 'id:') === 0)
|
|
||||||
{
|
|
||||||
$query->where('a.id = ' . (int) substr($search, 3));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
|
|
||||||
$query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ')');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter on the language.
|
|
||||||
if ($language = $this->getState('filter.language'))
|
|
||||||
{
|
|
||||||
$query->where('a.language = ' . $db->quote($language));
|
|
||||||
}
|
|
||||||
|
|
||||||
$tagId = $this->getState('filter.tag');
|
|
||||||
// Filter by a single tag.
|
|
||||||
if (is_numeric($tagId))
|
|
||||||
{
|
|
||||||
$query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId)
|
|
||||||
->join(
|
|
||||||
'LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap')
|
|
||||||
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
|
|
||||||
. ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_weblinks.weblink')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the list ordering clause.
|
|
||||||
$orderCol = $this->state->get('list.ordering');
|
|
||||||
$orderDirn = $this->state->get('list.direction');
|
|
||||||
if ($orderCol == 'a.ordering' || $orderCol == 'category_title')
|
|
||||||
{
|
|
||||||
$orderCol = 'c.title ' . $orderDirn . ', a.ordering';
|
|
||||||
}
|
|
||||||
$query->order($db->escape($orderCol . ' ' . $orderDirn));
|
|
||||||
|
|
||||||
//echo nl2br(str_replace('#__','jos_',$query));
|
|
||||||
return $query;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Installation class to perform additional changes during install/uninstall/update
|
|
||||||
*
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
* @since 3.4
|
|
||||||
*/
|
|
||||||
class Com_WeblinksInstallerScript
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Function to perform changes during install
|
|
||||||
*
|
|
||||||
* @param JInstallerComponent $parent The class calling this method
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 3.4
|
|
||||||
*/
|
|
||||||
public function install($parent)
|
|
||||||
{
|
|
||||||
// Initialize a new category
|
|
||||||
/** @type JTableCategory $category */
|
|
||||||
$category = JTable::getInstance('Category');
|
|
||||||
|
|
||||||
// Check if the Uncategorised category exists before adding it
|
|
||||||
if (!$category->load(array('extension' => 'com_weblinks', 'title' => 'Uncategorised')))
|
|
||||||
{
|
|
||||||
$category->extension = 'com_weblinks';
|
|
||||||
$category->title = 'Uncategorised';
|
|
||||||
$category->description = '';
|
|
||||||
$category->published = 1;
|
|
||||||
$category->access = 1;
|
|
||||||
$category->params = '{"category_layout":"","image":""}';
|
|
||||||
$category->metadata = '{"author":"","robots":""}';
|
|
||||||
$category->language = '*';
|
|
||||||
|
|
||||||
// Set the location in the tree
|
|
||||||
$category->setLocation(1, 'last-child');
|
|
||||||
|
|
||||||
// Check to make sure our data is valid
|
|
||||||
if (!$category->check())
|
|
||||||
{
|
|
||||||
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now store the category
|
|
||||||
if (!$category->store(true))
|
|
||||||
{
|
|
||||||
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_WEBLINKS_ERROR_INSTALL_CATEGORY', $category->getError()));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build the path for our category
|
|
||||||
$category->rebuildPath($category->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
# This is a rollup of all database schema changes applied from 3.0.0 to 3.3.x
|
|
||||||
|
|
||||||
drop procedure if exists weblinks_schema_change;
|
|
||||||
|
|
||||||
delimiter ';;'
|
|
||||||
create procedure weblinks_schema_change() begin
|
|
||||||
|
|
||||||
/* delete columns if they exist */
|
|
||||||
if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'sid') THEN
|
|
||||||
ALTER TABLE `#__weblinks` DROP COLUMN `sid`;
|
|
||||||
end if;
|
|
||||||
if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'date') THEN
|
|
||||||
ALTER TABLE `#__weblinks` DROP COLUMN `date`;
|
|
||||||
end if;
|
|
||||||
if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'archived') THEN
|
|
||||||
ALTER TABLE `#__weblinks` DROP COLUMN `archived`;
|
|
||||||
end if;
|
|
||||||
if exists(SELECT * FROM information_schema.columns WHERE table_name = '#__weblinks' AND column_name = 'approved') THEN
|
|
||||||
ALTER TABLE `#__weblinks` DROP COLUMN `approved`;
|
|
||||||
end if;
|
|
||||||
|
|
||||||
end;;
|
|
||||||
|
|
||||||
delimiter ';'
|
|
||||||
call weblinks_schema_change();
|
|
||||||
|
|
||||||
drop procedure if exists weblinks_schema_change;
|
|
||||||
|
|
||||||
ALTER TABLE `#__weblinks` ENGINE=InnoDB;
|
|
||||||
ALTER TABLE `#__weblinks` ADD COLUMN `version` int(10) unsigned NOT NULL DEFAULT '1';
|
|
||||||
ALTER TABLE `#__weblinks` ADD COLUMN `images` text NOT NULL;
|
|
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
$fieldSets = $this->form->getFieldsets('params');
|
|
||||||
foreach ($fieldSets as $name => $fieldSet) :
|
|
||||||
?>
|
|
||||||
<div class="tab-pane" id="params-<?php echo $name;?>">
|
|
||||||
<?php
|
|
||||||
if (isset($fieldSet->description) && trim($fieldSet->description)) :
|
|
||||||
echo '<p class="alert alert-info">'.$this->escape(JText::_($fieldSet->description)).'</p>';
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
|
||||||
<div class="control-group">
|
|
||||||
<div class="control-label"><?php echo $field->label; ?></div>
|
|
||||||
<div class="controls"><?php echo $field->input; ?></div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
@ -1,212 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
|
||||||
|
|
||||||
JHtml::_('bootstrap.tooltip');
|
|
||||||
JHtml::_('behavior.multiselect');
|
|
||||||
JHtml::_('formbehavior.chosen', 'select');
|
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
$userId = $user->get('id');
|
|
||||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
|
||||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
|
||||||
$canOrder = $user->authorise('core.edit.state', 'com_weblinks.category');
|
|
||||||
$saveOrder = $listOrder == 'a.ordering';
|
|
||||||
if ($saveOrder)
|
|
||||||
{
|
|
||||||
$saveOrderingUrl = 'index.php?option=com_weblinks&task=weblinks.saveOrderAjax&tmpl=component';
|
|
||||||
JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
|
|
||||||
}
|
|
||||||
$sortFields = $this->getSortFields();
|
|
||||||
|
|
||||||
JFactory::getDocument()->addScriptDeclaration('
|
|
||||||
Joomla.orderTable = function()
|
|
||||||
{
|
|
||||||
table = document.getElementById("sortTable");
|
|
||||||
direction = document.getElementById("directionTable");
|
|
||||||
order = table.options[table.selectedIndex].value;
|
|
||||||
if (order != "' . $listOrder . '")
|
|
||||||
{
|
|
||||||
dirn = "asc";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dirn = direction.options[direction.selectedIndex].value;
|
|
||||||
}
|
|
||||||
Joomla.tableOrdering(order, dirn, "");
|
|
||||||
};
|
|
||||||
');
|
|
||||||
?>
|
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm">
|
|
||||||
<?php if (!empty( $this->sidebar)) : ?>
|
|
||||||
<div id="j-sidebar-container" class="span2">
|
|
||||||
<?php echo $this->sidebar; ?>
|
|
||||||
</div>
|
|
||||||
<div id="j-main-container" class="span10">
|
|
||||||
<?php else : ?>
|
|
||||||
<div id="j-main-container">
|
|
||||||
<?php endif;?>
|
|
||||||
<div id="filter-bar" class="btn-toolbar">
|
|
||||||
<div class="filter-search btn-group pull-left">
|
|
||||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('COM_WEBLINKS_SEARCH_IN_TITLE');?></label>
|
|
||||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_WEBLINKS_SEARCH_IN_TITLE'); ?>" />
|
|
||||||
</div>
|
|
||||||
<div class="btn-group pull-left">
|
|
||||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
|
||||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group pull-right hidden-phone">
|
|
||||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
|
||||||
<?php echo $this->pagination->getLimitBox(); ?>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group pull-right hidden-phone">
|
|
||||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
|
||||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
|
||||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
|
||||||
<option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
|
||||||
<option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
|
||||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
|
||||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
|
||||||
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="clearfix"> </div>
|
|
||||||
<?php if (empty($this->items)) : ?>
|
|
||||||
<div class="alert alert-no-items">
|
|
||||||
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
|
||||||
</div>
|
|
||||||
<?php else : ?>
|
|
||||||
<table class="table table-striped" id="weblinkList">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="1%" class="nowrap center hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
|
|
||||||
</th>
|
|
||||||
<th width="1%" class="hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.checkall'); ?>
|
|
||||||
</th>
|
|
||||||
<th width="1%" style="min-width:55px" class="nowrap center">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
<th class="title">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
<th width="5%" class="nowrap hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
<th width="5%" class="nowrap center hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
<th width="5%" class="nowrap hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
<th width="1%" class="nowrap center hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td colspan="10">
|
|
||||||
<?php echo $this->pagination->getListFooter(); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($this->items as $i => $item) :
|
|
||||||
$ordering = ($listOrder == 'a.ordering');
|
|
||||||
$item->cat_link = JRoute::_('index.php?option=com_categories&extension=com_weblinks&task=edit&type=other&cid[]='. $item->catid);
|
|
||||||
$canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $item->catid);
|
|
||||||
$canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $item->catid);
|
|
||||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0;
|
|
||||||
$canChange = $user->authorise('core.edit.state', 'com_weblinks.category.' . $item->catid) && $canCheckin;
|
|
||||||
?>
|
|
||||||
<tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $item->catid?>">
|
|
||||||
<td class="order nowrap center hidden-phone">
|
|
||||||
<?php
|
|
||||||
$iconClass = '';
|
|
||||||
if (!$canChange)
|
|
||||||
{
|
|
||||||
$iconClass = ' inactive';
|
|
||||||
}
|
|
||||||
elseif (!$saveOrder)
|
|
||||||
{
|
|
||||||
$iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<span class="sortable-handler<?php echo $iconClass ?>">
|
|
||||||
<i class="icon-menu"></i>
|
|
||||||
</span>
|
|
||||||
<?php if ($canChange && $saveOrder) : ?>
|
|
||||||
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering;?>" class="width-20 text-area-order " />
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
<td class="center hidden-phone">
|
|
||||||
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
|
|
||||||
</td>
|
|
||||||
<td class="center">
|
|
||||||
<?php echo JHtml::_('jgrid.published', $item->state, $i, 'weblinks.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
|
|
||||||
</td>
|
|
||||||
<td class="nowrap has-context">
|
|
||||||
<?php if ($item->checked_out) : ?>
|
|
||||||
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($canEdit) : ?>
|
|
||||||
<a href="<?php echo JRoute::_('index.php?option=com_weblinks&task=weblink.edit&id='.(int) $item->id); ?>">
|
|
||||||
<?php echo $this->escape($item->title); ?></a>
|
|
||||||
<?php else : ?>
|
|
||||||
<?php echo $this->escape($item->title); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<span class="small">
|
|
||||||
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias));?>
|
|
||||||
</span>
|
|
||||||
<div class="small">
|
|
||||||
<?php echo $this->escape($item->category_title); ?>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="small hidden-phone">
|
|
||||||
<?php echo $this->escape($item->access_level); ?>
|
|
||||||
</td>
|
|
||||||
<td class="center hidden-phone">
|
|
||||||
<?php echo $item->hits; ?>
|
|
||||||
</td>
|
|
||||||
<td class="small nowrap hidden-phone">
|
|
||||||
<?php if ($item->language == '*'):?>
|
|
||||||
<?php echo JText::alt('JALL', 'language'); ?>
|
|
||||||
<?php else:?>
|
|
||||||
<?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
|
|
||||||
<?php endif;?>
|
|
||||||
</td>
|
|
||||||
<td class="center hidden-phone">
|
|
||||||
<?php echo (int) $item->id; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php //Load the batch processing form. ?>
|
|
||||||
<?php echo $this->loadTemplate('batch'); ?>
|
|
||||||
|
|
||||||
<input type="hidden" name="task" value="" />
|
|
||||||
<input type="hidden" name="boxchecked" value="0" />
|
|
||||||
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
|
|
||||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
|
|
||||||
<?php echo JHtml::_('form.token'); ?>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
$published = $this->state->get('filter.state');
|
|
||||||
?>
|
|
||||||
<div class="modal hide fade" id="collapseModal">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" role="presentation" class="close" data-dismiss="modal">×</button>
|
|
||||||
<h3><?php echo JText::_('COM_WEBLINKS_BATCH_OPTIONS'); ?></h3>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body modal-batch">
|
|
||||||
<p><?php echo JText::_('COM_WEBLINKS_BATCH_TIP'); ?></p>
|
|
||||||
<div class="row-fluid">
|
|
||||||
<div class="control-group span6">
|
|
||||||
<div class="controls">
|
|
||||||
<?php echo JHtml::_('batch.tag'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group span6">
|
|
||||||
<div class="controls">
|
|
||||||
<?php echo JHtml::_('batch.language'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row-fluid">
|
|
||||||
<div class="control-group span6">
|
|
||||||
<div class="controls">
|
|
||||||
<?php echo JHtml::_('batch.access'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php if ($published >= 0) : ?>
|
|
||||||
<div class="control-group span6">
|
|
||||||
<div class="controls">
|
|
||||||
<?php echo JHtml::_('batch.item', 'com_weblinks'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button class="btn" type="button" onclick="document.id('batch-category-id').value='';document.id('batch-access').value='';document.id('batch-language-id').value='';document.id('batch-tag-id)').value=''" data-dismiss="modal">
|
|
||||||
<?php echo JText::_('JCANCEL'); ?>
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('weblink.batch');">
|
|
||||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,162 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Administrator
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* View class for a list of weblinks.
|
|
||||||
*
|
|
||||||
* @since 1.5
|
|
||||||
*/
|
|
||||||
class WeblinksViewWeblinks extends JViewLegacy
|
|
||||||
{
|
|
||||||
protected $items;
|
|
||||||
|
|
||||||
protected $pagination;
|
|
||||||
|
|
||||||
protected $state;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the view
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function display($tpl = null)
|
|
||||||
{
|
|
||||||
$this->state = $this->get('State');
|
|
||||||
$this->items = $this->get('Items');
|
|
||||||
$this->pagination = $this->get('Pagination');
|
|
||||||
|
|
||||||
WeblinksHelper::addSubmenu('weblinks');
|
|
||||||
|
|
||||||
// Check for errors.
|
|
||||||
if (count($errors = $this->get('Errors')))
|
|
||||||
{
|
|
||||||
JError::raiseError(500, implode("\n", $errors));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addToolbar();
|
|
||||||
$this->sidebar = JHtmlSidebar::render();
|
|
||||||
parent::display($tpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the page title and toolbar.
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function addToolbar()
|
|
||||||
{
|
|
||||||
require_once JPATH_COMPONENT . '/helpers/weblinks.php';
|
|
||||||
|
|
||||||
$state = $this->get('State');
|
|
||||||
$canDo = JHelperContent::getActions('com_weblinks', 'category', $state->get('filter.category_id'));
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
// Get the toolbar object instance
|
|
||||||
$bar = JToolBar::getInstance('toolbar');
|
|
||||||
|
|
||||||
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
|
|
||||||
if (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0)
|
|
||||||
{
|
|
||||||
JToolbarHelper::addNew('weblink.add');
|
|
||||||
}
|
|
||||||
if ($canDo->get('core.edit'))
|
|
||||||
{
|
|
||||||
JToolbarHelper::editList('weblink.edit');
|
|
||||||
}
|
|
||||||
if ($canDo->get('core.edit.state')) {
|
|
||||||
|
|
||||||
JToolbarHelper::publish('weblinks.publish', 'JTOOLBAR_PUBLISH', true);
|
|
||||||
JToolbarHelper::unpublish('weblinks.unpublish', 'JTOOLBAR_UNPUBLISH', true);
|
|
||||||
|
|
||||||
JToolbarHelper::archiveList('weblinks.archive');
|
|
||||||
JToolbarHelper::checkin('weblinks.checkin');
|
|
||||||
}
|
|
||||||
if ($state->get('filter.state') == -2 && $canDo->get('core.delete'))
|
|
||||||
{
|
|
||||||
JToolbarHelper::deleteList('', 'weblinks.delete', 'JTOOLBAR_EMPTY_TRASH');
|
|
||||||
} elseif ($canDo->get('core.edit.state'))
|
|
||||||
{
|
|
||||||
JToolbarHelper::trash('weblinks.trash');
|
|
||||||
}
|
|
||||||
// Add a batch button
|
|
||||||
if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks') && $user->authorise('core.edit.state', 'com_weblinks'))
|
|
||||||
{
|
|
||||||
JHtml::_('bootstrap.modal', 'collapseModal');
|
|
||||||
$title = JText::_('JTOOLBAR_BATCH');
|
|
||||||
|
|
||||||
// Instantiate a new JLayoutFile instance and render the batch button
|
|
||||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
|
||||||
|
|
||||||
$dhtml = $layout->render(array('title' => $title));
|
|
||||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
|
||||||
}
|
|
||||||
if ($user->authorise('core.admin', 'com_weblinks'))
|
|
||||||
{
|
|
||||||
JToolbarHelper::preferences('com_weblinks');
|
|
||||||
}
|
|
||||||
|
|
||||||
JToolbarHelper::help('JHELP_COMPONENTS_WEBLINKS_LINKS');
|
|
||||||
|
|
||||||
JHtmlSidebar::setAction('index.php?option=com_weblinks&view=weblinks');
|
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
|
||||||
JText::_('JOPTION_SELECT_PUBLISHED'),
|
|
||||||
'filter_state',
|
|
||||||
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true)
|
|
||||||
);
|
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
|
||||||
JText::_('JOPTION_SELECT_CATEGORY'),
|
|
||||||
'filter_category_id',
|
|
||||||
JHtml::_('select.options', JHtml::_('category.options', 'com_weblinks'), 'value', 'text', $this->state->get('filter.category_id'))
|
|
||||||
);
|
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
|
||||||
JText::_('JOPTION_SELECT_ACCESS'),
|
|
||||||
'filter_access',
|
|
||||||
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
|
|
||||||
);
|
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
|
||||||
JText::_('JOPTION_SELECT_LANGUAGE'),
|
|
||||||
'filter_language',
|
|
||||||
JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))
|
|
||||||
);
|
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
|
||||||
JText::_('JOPTION_SELECT_TAG'),
|
|
||||||
'filter_tag',
|
|
||||||
JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag'))
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of fields the table can be sorted by
|
|
||||||
*
|
|
||||||
* @return array Array containing the field name to sort by as the key and display text as value
|
|
||||||
*
|
|
||||||
* @since 3.0
|
|
||||||
*/
|
|
||||||
protected function getSortFields()
|
|
||||||
{
|
|
||||||
return array(
|
|
||||||
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
|
|
||||||
'a.state' => JText::_('JSTATUS'),
|
|
||||||
'a.title' => JText::_('JGLOBAL_TITLE'),
|
|
||||||
'a.access' => JText::_('JGRID_HEADING_ACCESS'),
|
|
||||||
'a.hits' => JText::_('JGLOBAL_HITS'),
|
|
||||||
'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
|
|
||||||
'a.id' => JText::_('JGRID_HEADING_ID')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Site
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Weblinks Component Controller
|
|
||||||
*
|
|
||||||
* @since 1.5
|
|
||||||
*/
|
|
||||||
class WeblinksController extends JControllerLegacy
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Method to display a view.
|
|
||||||
*
|
|
||||||
* @param boolean If true, the view output will be cached
|
|
||||||
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
|
||||||
*
|
|
||||||
* @return JController This object to support chaining.
|
|
||||||
* @since 1.5
|
|
||||||
*/
|
|
||||||
public function display($cachable = false, $urlparams = false)
|
|
||||||
{
|
|
||||||
$cachable = true; // Huh? Why not just put that in the constructor?
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
// Set the default view name and format from the Request.
|
|
||||||
// Note we are using w_id to avoid collisions with the router and the return page.
|
|
||||||
// Frontend is a bit messier than the backend.
|
|
||||||
$id = $this->input->getInt('w_id');
|
|
||||||
$vName = $this->input->get('view', 'categories');
|
|
||||||
$this->input->set('view', $vName);
|
|
||||||
|
|
||||||
if ($user->get('id') ||($this->input->getMethod() == 'POST' && $vName = 'categories'))
|
|
||||||
{
|
|
||||||
$cachable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$safeurlparams = array(
|
|
||||||
'id' => 'INT',
|
|
||||||
'limit' => 'UINT',
|
|
||||||
'limitstart' => 'UINT',
|
|
||||||
'filter_order' => 'CMD',
|
|
||||||
'filter_order_Dir' => 'CMD',
|
|
||||||
'lang' => 'CMD'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check for edit form.
|
|
||||||
if ($vName == 'form' && !$this->checkEditId('com_weblinks.edit.weblink', $id))
|
|
||||||
{
|
|
||||||
// Somehow the person just went to the form - we don't allow that.
|
|
||||||
return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::display($cachable, $safeurlparams);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,140 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<form>
|
|
||||||
<fieldset addfieldpath="/administrator/components/com_categories/models/fields">
|
|
||||||
<field name="id" type="hidden"
|
|
||||||
label="WEBLINK_ID_LABEL"
|
|
||||||
readonly="true"
|
|
||||||
required="true"
|
|
||||||
size="10"
|
|
||||||
default="0"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field
|
|
||||||
id="contenthistory"
|
|
||||||
name="contenthistory"
|
|
||||||
type="contenthistory"
|
|
||||||
data-typeAlias="com_weblinks.weblink"
|
|
||||||
label="JTOOLBAR_VERSIONS" />
|
|
||||||
|
|
||||||
<field name="title" type="text"
|
|
||||||
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
|
||||||
label="JGLOBAL_TITLE"
|
|
||||||
required="true"
|
|
||||||
size="30"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="alias" type="text"
|
|
||||||
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
|
||||||
label="JFIELD_ALIAS_LABEL"
|
|
||||||
hint="JFIELD_ALIAS_PLACEHOLDER"
|
|
||||||
size="45"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="description" type="editor"
|
|
||||||
buttons="true"
|
|
||||||
hide="pagebreak,readmore"
|
|
||||||
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
|
||||||
filter="safehtml"
|
|
||||||
label="JGLOBAL_DESCRIPTION"
|
|
||||||
asset_id="com_weblinks"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="state" type="list"
|
|
||||||
default="1"
|
|
||||||
description="JFIELD_PUBLISHED_DESC"
|
|
||||||
label="JSTATUS"
|
|
||||||
size="1"
|
|
||||||
>
|
|
||||||
<option value="1">JPUBLISHED</option>
|
|
||||||
<option value="0">JUNPUBLISHED</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="catid" type="categoryedit"
|
|
||||||
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
|
||||||
extension="com_weblinks"
|
|
||||||
label="JCATEGORY"
|
|
||||||
required="true"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="url" type="url"
|
|
||||||
filter="url"
|
|
||||||
description="COM_WEBLINKS_FIELD_URL_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
|
||||||
required="true"
|
|
||||||
size="45"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="language"
|
|
||||||
type="contentlanguage"
|
|
||||||
label="JFIELD_LANGUAGE_LABEL"
|
|
||||||
description="JFIELD_LANGUAGE_DESC"
|
|
||||||
class="inputbox">
|
|
||||||
<option value="*">JALL</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="tags"
|
|
||||||
type="tag"
|
|
||||||
label="JTAG"
|
|
||||||
description="JTAG_DESC"
|
|
||||||
class="inputbox"
|
|
||||||
multiple="true" />
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="version_note"
|
|
||||||
type="text"
|
|
||||||
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
|
|
||||||
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
|
||||||
class="inputbox"
|
|
||||||
size="45"
|
|
||||||
labelclass="control-label" />
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
<fields name="metadata">
|
|
||||||
<fieldset name="jmetadata"
|
|
||||||
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
|
|
||||||
|
|
||||||
<field name="robots"
|
|
||||||
type="hidden"
|
|
||||||
filter="unset"
|
|
||||||
label="JFIELD_METADATA_ROBOTS_LABEL"
|
|
||||||
description="JFIELD_METADATA_ROBOTS_DESC"
|
|
||||||
labelclass="control-label"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
|
||||||
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
|
||||||
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
|
|
||||||
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="author"
|
|
||||||
type="hidden"
|
|
||||||
filter="unset"
|
|
||||||
label="JAUTHOR"
|
|
||||||
description="JFIELD_METADATA_AUTHOR_DESC"
|
|
||||||
size="20"
|
|
||||||
labelclass="control-label"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="rights"
|
|
||||||
type="hidden"
|
|
||||||
label="JFIELD_META_RIGHTS_LABEL"
|
|
||||||
filter="unset"
|
|
||||||
description="JFIELD_META_RIGHTS_DESC"
|
|
||||||
required="false"
|
|
||||||
labelclass="control-label"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="xreference"
|
|
||||||
type="hidden"
|
|
||||||
filter="unset"
|
|
||||||
label="COM_CONTENT_FIELD_XREFERENCE_LABEL"
|
|
||||||
description="COM_CONTENT_FIELD_XREFERENCE_DESC"
|
|
||||||
class="inputbox"
|
|
||||||
size="20"
|
|
||||||
labelclass="control-label" />
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
</form>
|
|
@ -1,126 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Site
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Weblinks Component Model for a Weblink record
|
|
||||||
*
|
|
||||||
* @since 1.5
|
|
||||||
*/
|
|
||||||
class WeblinksModelWeblink extends JModelItem
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Model context string.
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $_context = 'com_weblinks.weblink';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to auto-populate the model state.
|
|
||||||
*
|
|
||||||
* Note. Calling getState in this method will result in recursion.
|
|
||||||
*
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function populateState()
|
|
||||||
{
|
|
||||||
$app = JFactory::getApplication();
|
|
||||||
$params = $app->getParams();
|
|
||||||
|
|
||||||
// Load the object state.
|
|
||||||
$id = $app->input->getInt('id');
|
|
||||||
$this->setState('weblink.id', $id);
|
|
||||||
|
|
||||||
// Load the parameters.
|
|
||||||
$this->setState('params', $params);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to get an object.
|
|
||||||
*
|
|
||||||
* @param integer The id of the object to get.
|
|
||||||
*
|
|
||||||
* @return mixed Object on success, false on failure.
|
|
||||||
*/
|
|
||||||
public function getItem($id = null)
|
|
||||||
{
|
|
||||||
if ($this->_item === null)
|
|
||||||
{
|
|
||||||
$this->_item = false;
|
|
||||||
|
|
||||||
if (empty($id))
|
|
||||||
{
|
|
||||||
$id = $this->getState('weblink.id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get a level row instance.
|
|
||||||
$table = JTable::getInstance('Weblink', 'WeblinksTable');
|
|
||||||
|
|
||||||
// Attempt to load the row.
|
|
||||||
if ($table->load($id))
|
|
||||||
{
|
|
||||||
// Check published state.
|
|
||||||
if ($published = $this->getState('filter.published'))
|
|
||||||
{
|
|
||||||
if ($table->state != $published)
|
|
||||||
{
|
|
||||||
return $this->_item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert the JTable to a clean JObject.
|
|
||||||
$properties = $table->getProperties(1);
|
|
||||||
$this->_item = JArrayHelper::toObject($properties, 'JObject');
|
|
||||||
}
|
|
||||||
elseif ($error = $table->getError())
|
|
||||||
{
|
|
||||||
$this->setError($error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->_item;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a reference to the a Table object, always creating it.
|
|
||||||
*
|
|
||||||
* @param type The table type to instantiate
|
|
||||||
* @param string A prefix for the table class name. Optional.
|
|
||||||
* @param array Configuration array for model. Optional.
|
|
||||||
* @return JTable A database object
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
public function getTable($type = 'Weblink', $prefix = 'WeblinksTable', $config = array())
|
|
||||||
{
|
|
||||||
return JTable::getInstance($type, $prefix, $config);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to increment the hit counter for the weblink
|
|
||||||
*
|
|
||||||
* @param integer $id Optional ID of the weblink.
|
|
||||||
*
|
|
||||||
* @return boolean True on success
|
|
||||||
*/
|
|
||||||
public function hit($id = null)
|
|
||||||
{
|
|
||||||
if (empty($id))
|
|
||||||
{
|
|
||||||
$id = $this->getState('weblink.id');
|
|
||||||
}
|
|
||||||
|
|
||||||
$weblink = $this->getTable('Weblink', 'WeblinksTable');
|
|
||||||
return $weblink->hit($id);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,243 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<metadata>
|
|
||||||
<layout title="com_weblinks_categories_view_default_title" option="com_weblinks_categories_view_default_option">
|
|
||||||
<help
|
|
||||||
key="JHELP_MENUS_MENU_ITEM_WEBLINK_CATEGORIES"
|
|
||||||
/>
|
|
||||||
<message>
|
|
||||||
<![CDATA[com_weblinks_categories_view_default_desc]]>
|
|
||||||
</message>
|
|
||||||
</layout>
|
|
||||||
|
|
||||||
<!-- Add fields to the request variables for the layout. -->
|
|
||||||
<fields name="request">
|
|
||||||
<fieldset name="request"
|
|
||||||
>
|
|
||||||
<field name="id" type="category"
|
|
||||||
description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
|
|
||||||
extension="com_weblinks"
|
|
||||||
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
|
|
||||||
show_root="true"
|
|
||||||
required="true"
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
|
|
||||||
<!-- Add fields to the parameters object for the layout. -->
|
|
||||||
<fields name="params">
|
|
||||||
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
|
|
||||||
|
|
||||||
<field name="show_base_description" type="list"
|
|
||||||
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
|
||||||
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="categories_description" type="textarea"
|
|
||||||
description="JGLOBAL_FIELD_CATEGORIES_DESC_DESC"
|
|
||||||
label="JGLOBAL_FIELD_CATEGORIES_DESC_LABEL"
|
|
||||||
cols="25"
|
|
||||||
rows="5"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="maxLevelcat" type="list"
|
|
||||||
default="-1"
|
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="-1">JALL</option>
|
|
||||||
<option value="1">J1</option>
|
|
||||||
<option value="2">J2</option>
|
|
||||||
<option value="3">J3</option>
|
|
||||||
<option value="4">J4</option>
|
|
||||||
<option value="5">J5</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_empty_categories_cat" type="list"
|
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_subcat_desc_cat" type="list"
|
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_num_links_cat" type="list"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="category" label="JGLOBAL_CATEGORY_OPTIONS">
|
|
||||||
<field name="spacer1" type="spacer" class="text"
|
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="show_category_title" type="list"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description" type="list"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description_image" type="list"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="maxLevel" type="list"
|
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JNONE</option>
|
|
||||||
<option value="-1">JALL</option>
|
|
||||||
<option value="1">J1</option>
|
|
||||||
<option value="2">J2</option>
|
|
||||||
<option value="3">J3</option>
|
|
||||||
<option value="4">J4</option>
|
|
||||||
<option value="5">J5</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_empty_categories" type="list"
|
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_subcat_desc" type="list"
|
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="list"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
|
||||||
<field name="spacer2" type="spacer" class="text"
|
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
|
||||||
/>
|
|
||||||
<field
|
|
||||||
name="filter_field"
|
|
||||||
type="list"
|
|
||||||
default=""
|
|
||||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
|
||||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="hide">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_limit" type="list"
|
|
||||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
|
||||||
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_headings" type="list"
|
|
||||||
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
|
||||||
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_description" type="list"
|
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_hits" type="list"
|
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
|
||||||
label="JGLOBAL_HITS"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination" type="list"
|
|
||||||
description="JGLOBAL_PAGINATION_DESC"
|
|
||||||
label="JGLOBAL_PAGINATION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_results" type="list"
|
|
||||||
|
|
||||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
|
||||||
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
</fields>
|
|
||||||
</metadata>
|
|
@ -1,195 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<metadata>
|
|
||||||
<layout title="com_weblinks_category_view_default_title" option="com_weblinks_category_view_default_option">
|
|
||||||
<help
|
|
||||||
key="JHELP_MENUS_MENU_ITEM_WEBLINK_CATEGORY"
|
|
||||||
/>
|
|
||||||
<message>
|
|
||||||
<![CDATA[com_weblinks_category_view_default_desc]]>
|
|
||||||
</message>
|
|
||||||
</layout>
|
|
||||||
|
|
||||||
<!-- Add fields to the request variables for the layout. -->
|
|
||||||
<fields name="request">
|
|
||||||
<fieldset name="request">
|
|
||||||
|
|
||||||
<field name="id" type="category"
|
|
||||||
default="0"
|
|
||||||
description="COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC"
|
|
||||||
extension="com_weblinks"
|
|
||||||
label="COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL"
|
|
||||||
required="true"
|
|
||||||
/>
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
|
|
||||||
<!-- Add fields to the parameters object for the layout. -->
|
|
||||||
<fields name="params">
|
|
||||||
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
|
|
||||||
<field name="spacer1" type="spacer" class="text"
|
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field name="show_category_title" type="list"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description" type="list"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_description_image" type="list"
|
|
||||||
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
|
||||||
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="maxLevel" type="list"
|
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JNONE</option>
|
|
||||||
<option value="-1">JALL</option>
|
|
||||||
<option value="1">J1</option>
|
|
||||||
<option value="2">J2</option>
|
|
||||||
<option value="3">J3</option>
|
|
||||||
<option value="4">J4</option>
|
|
||||||
<option value="5">J5</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_empty_categories" type="list"
|
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_subcat_desc" type="list"
|
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="list"
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
|
||||||
<field name="spacer2" type="spacer" class="text"
|
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<field
|
|
||||||
name="filter_field"
|
|
||||||
type="list"
|
|
||||||
default=""
|
|
||||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
|
||||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="hide">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_limit" type="list"
|
|
||||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
|
||||||
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_headings" type="list"
|
|
||||||
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
|
||||||
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_description" type="list"
|
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_hits" type="list"
|
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
|
||||||
label="JGLOBAL_HITS"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination" type="list"
|
|
||||||
description="JGLOBAL_PAGINATION_DESC"
|
|
||||||
label="JGLOBAL_PAGINATION_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_results" type="list"
|
|
||||||
|
|
||||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
|
||||||
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset name="integration"
|
|
||||||
>
|
|
||||||
|
|
||||||
<field name="show_feed_link" type="list"
|
|
||||||
description="JGLOBAL_SHOW_FEED_LINK_DESC"
|
|
||||||
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
|
||||||
>
|
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
|
||||||
<option value="0">JHIDE</option>
|
|
||||||
<option value="1">JSHOW</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
</fieldset>
|
|
||||||
</fields>
|
|
||||||
</metadata>
|
|
@ -1,179 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Site
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
|
||||||
|
|
||||||
JHtml::_('behavior.framework');
|
|
||||||
|
|
||||||
// Create a shortcut for params.
|
|
||||||
$params = &$this->item->params;
|
|
||||||
|
|
||||||
// Get the user object.
|
|
||||||
$user = JFactory::getUser();
|
|
||||||
|
|
||||||
// Check if user is allowed to add/edit based on weblinks permissinos.
|
|
||||||
$canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $this->category->id);
|
|
||||||
$canCreate = $user->authorise('core.create', 'com_weblinks');
|
|
||||||
$canEditState = $user->authorise('core.edit.state', 'com_weblinks');
|
|
||||||
|
|
||||||
$n = count($this->items);
|
|
||||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
|
||||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php if (empty($this->items)) : ?>
|
|
||||||
<p> <?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
|
|
||||||
<?php else : ?>
|
|
||||||
|
|
||||||
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
|
|
||||||
<?php if ($this->params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) :?>
|
|
||||||
<fieldset class="filters btn-toolbar">
|
|
||||||
<?php if ($this->params->get('filter_field') != 'hide') :?>
|
|
||||||
<div class="btn-group">
|
|
||||||
<label class="filter-search-lbl element-invisible" for="filter-search"><span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span><?php echo JText::_('COM_WEBLINKS_FILTER_LABEL') . ' '; ?></label>
|
|
||||||
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_WEBLINKS_FILTER_SEARCH_DESC'); ?>" />
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($this->params->get('show_pagination_limit')) : ?>
|
|
||||||
<div class="btn-group pull-right">
|
|
||||||
<label for="limit" class="element-invisible">
|
|
||||||
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
|
|
||||||
</label>
|
|
||||||
<?php echo $this->pagination->getLimitBox(); ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</fieldset>
|
|
||||||
<?php endif; ?>
|
|
||||||
<ul class="category list-striped list-condensed">
|
|
||||||
|
|
||||||
<?php foreach ($this->items as $i => $item) : ?>
|
|
||||||
<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
|
|
||||||
<?php if ($this->items[$i]->state == 0) : ?>
|
|
||||||
<li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
|
|
||||||
<?php else: ?>
|
|
||||||
<li class="cat-list-row<?php echo $i % 2; ?>" >
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($this->params->get('show_link_hits', 1)) : ?>
|
|
||||||
<span class="list-hits badge badge-info pull-right">
|
|
||||||
<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
|
|
||||||
</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ($canEdit) : ?>
|
|
||||||
<span class="list-edit pull-left width-50">
|
|
||||||
<?php echo JHtml::_('icon.edit', $item, $params); ?>
|
|
||||||
</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="list-title">
|
|
||||||
<?php if ($this->params->get('icons', 1) == 0) : ?>
|
|
||||||
<?php echo JText::_('COM_WEBLINKS_LINK'); ?>
|
|
||||||
<?php elseif ($this->params->get('icons', 1) == 1) : ?>
|
|
||||||
<?php if (!$this->params->get('link_icons')) : ?>
|
|
||||||
<?php echo JHtml::_('image', 'system/weblink.png', JText::_('COM_WEBLINKS_LINK'), null, true); ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?php echo '<img src="' . $this->params->get('link_icons') . '" alt="' . JText::_('COM_WEBLINKS_LINK') . '" />'; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php
|
|
||||||
// Compute the correct link
|
|
||||||
$menuclass = 'category' . $this->pageclass_sfx;
|
|
||||||
$link = $item->link;
|
|
||||||
$width = $item->params->get('width');
|
|
||||||
$height = $item->params->get('height');
|
|
||||||
if ($width == null || $height == null)
|
|
||||||
{
|
|
||||||
$width = 600;
|
|
||||||
$height = 500;
|
|
||||||
}
|
|
||||||
if ($this->items[$i]->state == 0) : ?>
|
|
||||||
<span class="label label-warning">Unpublished</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php switch ($item->params->get('target', $this->params->get('target')))
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
// Open in a new window
|
|
||||||
echo '<a href="' . $link . '" target="_blank" class="' . $menuclass . '" rel="nofollow">' .
|
|
||||||
$this->escape($item->title) . '</a>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
// Open in a popup window
|
|
||||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
|
||||||
echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\">" .
|
|
||||||
$this->escape($item->title) . '</a>';
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
// Open in a modal window
|
|
||||||
JHtml::_('behavior.modal', 'a.modal');
|
|
||||||
echo '<a class="modal" href="' . $link . '" rel="{handler: \'iframe\', size: {x:' . $this->escape($width) . ', y:' . $this->escape($height) . '}}">' .
|
|
||||||
$this->escape($item->title) . ' </a>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
// Open in parent window
|
|
||||||
echo '<a href="' . $link . '" class="' . $menuclass . '" rel="nofollow">' .
|
|
||||||
$this->escape($item->title) . ' </a>';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
|
|
||||||
<?php if ($this->params->get('show_tags', 1)) : ?>
|
|
||||||
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
|
||||||
<?php echo $this->item->tagLayout->render($tagsData); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if (($this->params->get('show_link_description')) and ($item->description != '')) : ?>
|
|
||||||
<?php $images = json_decode($item->images); ?>
|
|
||||||
<?php if (isset($images->image_first) and !empty($images->image_first)) : ?>
|
|
||||||
<?php $imgfloat = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?>
|
|
||||||
<div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>"> <img
|
|
||||||
<?php if ($images->image_first_caption):
|
|
||||||
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_first_caption) .'"';
|
|
||||||
endif; ?>
|
|
||||||
src="<?php echo htmlspecialchars($images->image_first); ?>" alt="<?php echo htmlspecialchars($images->image_first_alt); ?>"/> </div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if (isset($images->image_second) and !empty($images->image_second)) : ?>
|
|
||||||
<?php $imgfloat = (empty($images->float_second)) ? $this->params->get('float_second') : $images->float_second; ?>
|
|
||||||
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
|
|
||||||
<?php if ($images->image_second_caption):
|
|
||||||
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_second_caption) .'"';
|
|
||||||
endif; ?>
|
|
||||||
src="<?php echo htmlspecialchars($images->image_second); ?>" alt="<?php echo htmlspecialchars($images->image_second_alt); ?>"/> </div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php echo $item->description; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<?php endif;?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<?php // Code to add a link to submit a weblink. ?>
|
|
||||||
<?php /* if ($canCreate) : // TODO This is not working due to some problem in the router, I think. Ref issue #23685 ?>
|
|
||||||
<?php echo JHtml::_('icon.create', $item, $item->params); ?>
|
|
||||||
<?php endif; */ ?>
|
|
||||||
<?php if ($this->params->get('show_pagination')) : ?>
|
|
||||||
<div class="pagination">
|
|
||||||
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
|
|
||||||
<p class="counter">
|
|
||||||
<?php echo $this->pagination->getPagesCounter(); ?>
|
|
||||||
</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php echo $this->pagination->getPagesLinks(); ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</form>
|
|
||||||
<?php endif; ?>
|
|
@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* @package Joomla.Site
|
|
||||||
* @subpackage com_weblinks
|
|
||||||
*
|
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HTML View class for the WebLinks component
|
|
||||||
*
|
|
||||||
* @since 1.5
|
|
||||||
*/
|
|
||||||
class WeblinksViewWeblink extends JViewLegacy
|
|
||||||
{
|
|
||||||
protected $state;
|
|
||||||
|
|
||||||
protected $item;
|
|
||||||
|
|
||||||
public function display($tpl = null)
|
|
||||||
{
|
|
||||||
// Get some data from the models
|
|
||||||
$item = $this->get('Item');
|
|
||||||
|
|
||||||
if ($this->getLayout() == 'edit')
|
|
||||||
{
|
|
||||||
$this->_displayEdit($tpl);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->url)
|
|
||||||
{
|
|
||||||
// redirects to url if matching id found
|
|
||||||
JFactory::getApplication()->redirect($item->url);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//TODO create proper error handling
|
|
||||||
JFactory::getApplication()->redirect(JRoute::_('index.php'), JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 'notice');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
67
src/components/com_weblinks/controller.php
Normal file
67
src/components/com_weblinks/controller.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Site
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weblinks Component Controller
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
class WeblinksController extends JControllerLegacy
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Method to display a view.
|
||||||
|
*
|
||||||
|
* @param boolean $cacheable If true, the view output will be cached
|
||||||
|
* @param array $urlparams An array of safe url parameters and their variable types,
|
||||||
|
* for valid values see {@link JFilterInput::clean()}.
|
||||||
|
*
|
||||||
|
* @return WeblinksController This object to support chaining.
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
public function display($cacheable = false, $urlparams = false)
|
||||||
|
{
|
||||||
|
// Huh? Why not just put that in the constructor?
|
||||||
|
$cacheable = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the default view name and format from the Request.
|
||||||
|
* Note we are using w_id to avoid collisions with the router and the return page.
|
||||||
|
* Frontend is a bit messier than the backend.
|
||||||
|
*/
|
||||||
|
$id = $this->input->getInt('w_id');
|
||||||
|
$vName = $this->input->get('view', 'categories');
|
||||||
|
$this->input->set('view', $vName);
|
||||||
|
|
||||||
|
if (JFactory::getUser()->id ||($this->input->getMethod() == 'POST' && $vName == 'categories'))
|
||||||
|
{
|
||||||
|
$cacheable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$safeurlparams = array(
|
||||||
|
'id' => 'INT',
|
||||||
|
'limit' => 'UINT',
|
||||||
|
'limitstart' => 'UINT',
|
||||||
|
'filter_order' => 'CMD',
|
||||||
|
'filter_order_Dir' => 'CMD',
|
||||||
|
'lang' => 'CMD'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Check for edit form.
|
||||||
|
if ($vName == 'form' && !$this->checkEditId('com_weblinks.edit.weblink', $id))
|
||||||
|
{
|
||||||
|
// Somehow the person just went to the form - we don't allow that.
|
||||||
|
return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::display($cacheable, $safeurlparams);
|
||||||
|
}
|
||||||
|
}
|
@ -3,12 +3,14 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblinks class.
|
* Weblinks class.
|
||||||
*
|
*
|
||||||
@ -17,12 +19,18 @@ defined('_JEXEC') or die;
|
|||||||
class WeblinksControllerWeblink extends JControllerForm
|
class WeblinksControllerWeblink extends JControllerForm
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @since 1.6
|
* The URL view item variable.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected $view_item = 'form';
|
protected $view_item = 'form';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 1.6
|
* The URL view list variable.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected $view_list = 'categories';
|
protected $view_list = 'categories';
|
||||||
|
|
||||||
@ -38,6 +46,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
* Method to add a new record.
|
* Method to add a new record.
|
||||||
*
|
*
|
||||||
* @return boolean True if the article can be added, false if not.
|
* @return boolean True if the article can be added, false if not.
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
@ -60,25 +69,22 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
protected function allowAdd($data = array())
|
protected function allowAdd($data = array())
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int');
|
||||||
$categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('id'), 'int');
|
$allow = null;
|
||||||
$allow = null;
|
|
||||||
|
|
||||||
if ($categoryId)
|
if ($categoryId)
|
||||||
{
|
{
|
||||||
// If the category has been passed in the URL check it.
|
// If the category has been passed in the URL check it.
|
||||||
$allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId);
|
$allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($allow === null)
|
if ($allow !== null)
|
||||||
{
|
|
||||||
// In the absense of better information, revert to the component permissions.
|
|
||||||
return parent::allowAdd($data);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return $allow;
|
return $allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In the absense of better information, revert to the component permissions.
|
||||||
|
return parent::allowAdd($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,11 +112,9 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
// The category has been set. Check the category permissions.
|
// The category has been set. Check the category permissions.
|
||||||
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
|
return JFactory::getUser()->authorise('core.edit', $this->option . '.category.' . $categoryId);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// Since there is no asset tracking, revert to the component permissions.
|
||||||
// Since there is no asset tracking, revert to the component permissions.
|
return parent::allowEdit($data, $key);
|
||||||
return parent::allowEdit($data, $key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,10 +128,12 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
public function cancel($key = 'w_id')
|
public function cancel($key = 'w_id')
|
||||||
{
|
{
|
||||||
parent::cancel($key);
|
$return = parent::cancel($key);
|
||||||
|
|
||||||
// Redirect to the return page.
|
// Redirect to the return page.
|
||||||
$this->setRedirect($this->getReturnPage());
|
$this->setRedirect($this->getReturnPage());
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -142,9 +148,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
public function edit($key = null, $urlVar = 'w_id')
|
public function edit($key = null, $urlVar = 'w_id')
|
||||||
{
|
{
|
||||||
$result = parent::edit($key, $urlVar);
|
return parent::edit($key, $urlVar);
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -160,9 +164,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true))
|
public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true))
|
||||||
{
|
{
|
||||||
$model = parent::getModel($name, $prefix, $config);
|
return parent::getModel($name, $prefix, $config);
|
||||||
|
|
||||||
return $model;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -178,8 +180,8 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = null)
|
protected function getRedirectToItemAppend($recordId = null, $urlVar = null)
|
||||||
{
|
{
|
||||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||||
$itemId = $this->input->getInt('Itemid');
|
$itemId = $this->input->getInt('Itemid');
|
||||||
$return = $this->getReturnPage();
|
$return = $this->getReturnPage();
|
||||||
|
|
||||||
if ($itemId)
|
if ($itemId)
|
||||||
{
|
{
|
||||||
@ -195,9 +197,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the return URL.
|
* Get the return URL if a "return" variable has been passed in the request
|
||||||
*
|
|
||||||
* If a "return" variable has been passed in the request
|
|
||||||
*
|
*
|
||||||
* @return string The return URL.
|
* @return string The return URL.
|
||||||
*
|
*
|
||||||
@ -211,24 +211,8 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
{
|
{
|
||||||
return JUri::base();
|
return JUri::base();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return base64_decode($return);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return base64_decode($return);
|
||||||
* Function that allows child controller access to model data after the data has been saved.
|
|
||||||
*
|
|
||||||
* @param JModelLegacy $model The data model object.
|
|
||||||
* @param array $validData The validated data.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @since 1.6
|
|
||||||
*/
|
|
||||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -243,11 +227,21 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
*/
|
*/
|
||||||
public function save($key = null, $urlVar = 'w_id')
|
public function save($key = null, $urlVar = 'w_id')
|
||||||
{
|
{
|
||||||
|
// Get the application
|
||||||
|
$app = JFactory::getApplication();
|
||||||
|
|
||||||
|
// Get the data from POST
|
||||||
|
$data = $this->input->post->get('jform', array(), 'array');
|
||||||
|
|
||||||
|
// Save the data in the session.
|
||||||
|
$app->setUserState('com_weblinks.edit.weblink.data', $data);
|
||||||
$result = parent::save($key, $urlVar);
|
$result = parent::save($key, $urlVar);
|
||||||
|
|
||||||
// If ok, redirect to the return page.
|
// If ok, redirect to the return page.
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
|
// Flush the data from the session
|
||||||
|
$app->setUserState('com_weblinks.edit.weblink.data', null);
|
||||||
$this->setRedirect($this->getReturnPage());
|
$this->setRedirect($this->getReturnPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,11 +261,11 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
$id = $this->input->getInt('id');
|
$id = $this->input->getInt('id');
|
||||||
|
|
||||||
// Get the model, requiring published items
|
// Get the model, requiring published items
|
||||||
$modelLink = $this->getModel('Weblink', '', array('ignore_request' => true));
|
$modelLink = $this->getModel('Weblink', '', array('ignore_request' => true));
|
||||||
$modelLink->setState('filter.published', 1);
|
$modelLink->setState('filter.published', 1);
|
||||||
|
|
||||||
// Get the item
|
// Get the item
|
||||||
$link = $modelLink->getItem($id);
|
$link = $modelLink->getItem($id);
|
||||||
|
|
||||||
// Make sure the item was found.
|
// Make sure the item was found.
|
||||||
if (empty($link))
|
if (empty($link))
|
||||||
@ -280,8 +274,7 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check whether item access level allows access.
|
// Check whether item access level allows access.
|
||||||
$user = JFactory::getUser();
|
$groups = JFactory::getUser()->getAuthorisedViewLevels();
|
||||||
$groups = $user->getAuthorisedViewLevels();
|
|
||||||
|
|
||||||
if (!in_array($link->access, $groups))
|
if (!in_array($link->access, $groups))
|
||||||
{
|
{
|
||||||
@ -312,11 +305,9 @@ class WeblinksControllerWeblink extends JControllerForm
|
|||||||
if ($link->url)
|
if ($link->url)
|
||||||
{
|
{
|
||||||
$modelLink->hit($id);
|
$modelLink->hit($id);
|
||||||
JFactory::getApplication()->redirect($link->url);
|
JFactory::getApplication()->redirect($link->url, 301);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return JError::raiseWarning(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_URL_INVALID'));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,13 +3,14 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_weblinks/helpers/weblinks.php');
|
JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_weblinks/helpers/weblinks.php');
|
||||||
|
JLoader::register('WeblinksHelperRoute', JPATH_SITE . '/components/com_weblinks/helpers/route.php');
|
||||||
JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php');
|
JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,17 +28,30 @@ abstract class WeblinksHelperAssociation extends CategoryHelperAssociation
|
|||||||
*
|
*
|
||||||
* @return array Array of associations for the item
|
* @return array Array of associations for the item
|
||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static function getAssociations($id = 0, $view = null)
|
public static function getAssociations($id = 0, $view = null)
|
||||||
{
|
{
|
||||||
jimport('helper.route', JPATH_COMPONENT_SITE);
|
$jinput = JFactory::getApplication()->input;
|
||||||
|
$view = is_null($view) ? $jinput->get('view') : $view;
|
||||||
|
$id = empty($id) ? $jinput->getInt('id') : $id;
|
||||||
|
|
||||||
$app = JFactory::getApplication();
|
if ($view === 'weblink')
|
||||||
$jinput = $app->input;
|
{
|
||||||
$view = is_null($view) ? $jinput->get('view') : $view;
|
if ($id)
|
||||||
$id = empty($id) ? $jinput->getInt('id') : $id;
|
{
|
||||||
|
$associations = JLanguageAssociations::getAssociations('com_weblinks', '#__weblinks', 'com_weblinks.item', $id);
|
||||||
|
|
||||||
|
$return = array();
|
||||||
|
|
||||||
|
foreach ($associations as $tag => $item)
|
||||||
|
{
|
||||||
|
$return[$tag] = WeblinksHelperRoute::getWeblinkRoute($item->id, (int) $item->catid, $item->language);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($view == 'category' || $view == 'categories')
|
if ($view == 'category' || $view == 'categories')
|
||||||
{
|
{
|
||||||
@ -45,6 +59,5 @@ abstract class WeblinksHelperAssociation extends CategoryHelperAssociation
|
|||||||
}
|
}
|
||||||
|
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -16,10 +16,18 @@ defined('_JEXEC') or die;
|
|||||||
*/
|
*/
|
||||||
class WeblinksCategories extends JCategories
|
class WeblinksCategories extends JCategories
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param array $options Array of options
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
public function __construct($options = array())
|
public function __construct($options = array())
|
||||||
{
|
{
|
||||||
$options['table'] = '#__weblinks';
|
$options['table'] = '#__weblinks';
|
||||||
$options['extension'] = 'com_weblinks';
|
$options['extension'] = 'com_weblinks';
|
||||||
|
|
||||||
parent::__construct($options);
|
parent::__construct($options);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -16,6 +16,14 @@ defined('_JEXEC') or die;
|
|||||||
*/
|
*/
|
||||||
class JHtmlIcon
|
class JHtmlIcon
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Create a link to create a new weblink
|
||||||
|
*
|
||||||
|
* @param mixed $weblink Unused
|
||||||
|
* @param mixed $params Unused
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public static function create($weblink, $params)
|
public static function create($weblink, $params)
|
||||||
{
|
{
|
||||||
JHtml::_('bootstrap.tooltip');
|
JHtml::_('bootstrap.tooltip');
|
||||||
@ -24,10 +32,19 @@ class JHtmlIcon
|
|||||||
$url = JRoute::_(WeblinksHelperRoute::getFormRoute(0, base64_encode($uri)));
|
$url = JRoute::_(WeblinksHelperRoute::getFormRoute(0, base64_encode($uri)));
|
||||||
$text = JHtml::_('image', 'system/new.png', JText::_('JNEW'), null, true);
|
$text = JHtml::_('image', 'system/new.png', JText::_('JNEW'), null, true);
|
||||||
$button = JHtml::_('link', $url, $text);
|
$button = JHtml::_('link', $url, $text);
|
||||||
$output = '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_WEBLINKS_FORM_CREATE_WEBLINK') . '">' . $button . '</span>';
|
|
||||||
return $output;
|
return '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_WEBLINKS_FORM_CREATE_WEBLINK') . '">' . $button . '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a link to edit an existing weblink
|
||||||
|
*
|
||||||
|
* @param object $weblink Weblink data
|
||||||
|
* @param \Joomla\Registry\Registry $params Item params
|
||||||
|
* @param array $attribs Unused
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public static function edit($weblink, $params, $attribs = array())
|
public static function edit($weblink, $params, $attribs = array())
|
||||||
{
|
{
|
||||||
$uri = JUri::getInstance();
|
$uri = JUri::getInstance();
|
||||||
@ -46,7 +63,7 @@ class JHtmlIcon
|
|||||||
|
|
||||||
$url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
|
$url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
|
||||||
$icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
|
$icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
|
||||||
$text = JHtml::_('image', 'system/'.$icon, JText::_('JGLOBAL_EDIT'), null, true);
|
$text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), null, true);
|
||||||
|
|
||||||
if ($weblink->state == 0)
|
if ($weblink->state == 0)
|
||||||
{
|
{
|
||||||
@ -67,8 +84,6 @@ class JHtmlIcon
|
|||||||
|
|
||||||
$button = JHtml::_('link', JRoute::_($url), $text);
|
$button = JHtml::_('link', JRoute::_($url), $text);
|
||||||
|
|
||||||
$output = '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
|
return '<span class="hasTooltip" title="' . JHtml::tooltipText('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
|
||||||
|
|
||||||
return $output;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -21,16 +21,20 @@ abstract class WeblinksHelperRoute
|
|||||||
protected static $lang_lookup = array();
|
protected static $lang_lookup = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer The route of the weblink
|
* Get the route of the weblink
|
||||||
|
*
|
||||||
|
* @param integer $id Web link ID
|
||||||
|
* @param integer $catid Category ID
|
||||||
|
* @param string $language Language
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getWeblinkRoute($id, $catid, $language = 0)
|
public static function getWeblinkRoute($id, $catid, $language = 0)
|
||||||
{
|
{
|
||||||
$needles = array(
|
$needles = array('weblink' => array((int) $id));
|
||||||
'weblink' => array((int) $id)
|
|
||||||
);
|
|
||||||
|
|
||||||
//Create the link
|
// Create the link
|
||||||
$link = 'index.php?option=com_weblinks&view=weblink&id='. $id;
|
$link = 'index.php?option=com_weblinks&view=weblink&id=' . $id;
|
||||||
|
|
||||||
if ($catid > 1)
|
if ($catid > 1)
|
||||||
{
|
{
|
||||||
@ -41,7 +45,7 @@ abstract class WeblinksHelperRoute
|
|||||||
{
|
{
|
||||||
$needles['category'] = array_reverse($category->getPath());
|
$needles['category'] = array_reverse($category->getPath());
|
||||||
$needles['categories'] = $needles['category'];
|
$needles['categories'] = $needles['category'];
|
||||||
$link .= '&catid='.$catid;
|
$link .= '&catid=' . $catid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,22 +62,26 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
if ($item = self::_findItem($needles))
|
if ($item = self::_findItem($needles))
|
||||||
{
|
{
|
||||||
$link .= '&Itemid='.$item;
|
$link .= '&Itemid=' . $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer $id The id of the weblink.
|
* Ge the form route
|
||||||
* @param string $return The return page variable.
|
*
|
||||||
|
* @param integer $id The id of the weblink.
|
||||||
|
* @param string $return The return page variable.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getFormRoute($id, $return = null)
|
public static function getFormRoute($id, $return = null)
|
||||||
{
|
{
|
||||||
// Create the link.
|
// Create the link.
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
$link = 'index.php?option=com_weblinks&task=weblink.edit&w_id='. $id;
|
$link = 'index.php?option=com_weblinks&task=weblink.edit&w_id=' . $id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -82,12 +90,20 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
if ($return)
|
if ($return)
|
||||||
{
|
{
|
||||||
$link .= '&return='.$return;
|
$link .= '&return=' . $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Category Route
|
||||||
|
*
|
||||||
|
* @param JCategoryNode|string|integer $catid JCategoryNode object or category ID
|
||||||
|
* @param integer $language Language code
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public static function getCategoryRoute($catid, $language = 0)
|
public static function getCategoryRoute($catid, $language = 0)
|
||||||
{
|
{
|
||||||
if ($catid instanceof JCategoryNode)
|
if ($catid instanceof JCategoryNode)
|
||||||
@ -110,7 +126,7 @@ abstract class WeblinksHelperRoute
|
|||||||
$needles = array();
|
$needles = array();
|
||||||
|
|
||||||
// Create the link
|
// Create the link
|
||||||
$link = 'index.php?option=com_weblinks&view=category&id='.$id;
|
$link = 'index.php?option=com_weblinks&view=category&id=' . $id;
|
||||||
|
|
||||||
$catids = array_reverse($category->getPath());
|
$catids = array_reverse($category->getPath());
|
||||||
$needles['category'] = $catids;
|
$needles['category'] = $catids;
|
||||||
@ -129,13 +145,18 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
if ($item = self::_findItem($needles))
|
if ($item = self::_findItem($needles))
|
||||||
{
|
{
|
||||||
$link .= '&Itemid='.$item;
|
$link .= '&Itemid=' . $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do a language lookup
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected static function buildLanguageLookup()
|
protected static function buildLanguageLookup()
|
||||||
{
|
{
|
||||||
if (count(self::$lang_lookup) == 0)
|
if (count(self::$lang_lookup) == 0)
|
||||||
@ -156,18 +177,25 @@ abstract class WeblinksHelperRoute
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find items per given $needles
|
||||||
|
*
|
||||||
|
* @param array $needles A given array of needles to find
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected static function _findItem($needles = null)
|
protected static function _findItem($needles = null)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$menus = $app->getMenu('site');
|
$menus = $app->getMenu('site');
|
||||||
$language = isset($needles['language']) ? $needles['language'] : '*';
|
$language = isset($needles['language']) ? $needles['language'] : '*';
|
||||||
|
|
||||||
// Prepare the reverse lookup array.
|
// Prepare the reverse lookup array.
|
||||||
if (!isset(self::$lookup[$language]))
|
if (!isset(self::$lookup[$language]))
|
||||||
{
|
{
|
||||||
self::$lookup[$language] = array();
|
self::$lookup[$language] = array();
|
||||||
|
|
||||||
$component = JComponentHelper::getComponent('com_weblinks');
|
$component = JComponentHelper::getComponent('com_weblinks');
|
||||||
|
|
||||||
$attributes = array('component_id');
|
$attributes = array('component_id');
|
||||||
$values = array($component->id);
|
$values = array($component->id);
|
||||||
@ -187,16 +215,19 @@ abstract class WeblinksHelperRoute
|
|||||||
if (isset($item->query) && isset($item->query['view']))
|
if (isset($item->query) && isset($item->query['view']))
|
||||||
{
|
{
|
||||||
$view = $item->query['view'];
|
$view = $item->query['view'];
|
||||||
|
|
||||||
if (!isset(self::$lookup[$language][$view]))
|
if (!isset(self::$lookup[$language][$view]))
|
||||||
{
|
{
|
||||||
self::$lookup[$language][$view] = array();
|
self::$lookup[$language][$view] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item->query['id']))
|
if (isset($item->query['id']))
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
// here it will become a bit tricky
|
* Here it will become a bit tricky
|
||||||
// language != * can override existing entries
|
* language != * can override existing entries
|
||||||
// language == * cannot override existing entries
|
* language == * cannot override existing entries
|
||||||
|
*/
|
||||||
if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*')
|
if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*')
|
||||||
{
|
{
|
||||||
self::$lookup[$language][$view][$item->query['id']] = $item->id;
|
self::$lookup[$language][$view][$item->query['id']] = $item->id;
|
||||||
@ -226,6 +257,7 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
// Check if the active menuitem matches the requested language
|
// Check if the active menuitem matches the requested language
|
||||||
$active = $menus->getActive();
|
$active = $menus->getActive();
|
||||||
|
|
||||||
if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled()))
|
if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled()))
|
||||||
{
|
{
|
||||||
return $active->id;
|
return $active->id;
|
||||||
@ -233,6 +265,7 @@ abstract class WeblinksHelperRoute
|
|||||||
|
|
||||||
// If not found, return language specific home link
|
// If not found, return language specific home link
|
||||||
$default = $menus->getDefault($language);
|
$default = $menus->getDefault($language);
|
||||||
|
|
||||||
return !empty($default->id) ? $default->id : null;
|
return !empty($default->id) ? $default->id : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -17,16 +17,17 @@ defined('_JEXEC') or die;
|
|||||||
class WeblinksModelCategories extends JModelList
|
class WeblinksModelCategories extends JModelList
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Model context string.
|
* Context string for the model type. This is used to handle uniqueness
|
||||||
|
* when dealing with the getStoreId() method and caching data structures.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $_context = 'com_weblinks.categories';
|
protected $context = 'com_weblinks.categories';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The category context (allows other extensions to derived from this model).
|
* The category context (allows other extensions to derived from this model).
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $_extension = 'com_weblinks';
|
protected $_extension = 'com_weblinks';
|
||||||
|
|
||||||
@ -39,6 +40,11 @@ class WeblinksModelCategories extends JModelList
|
|||||||
*
|
*
|
||||||
* Note. Calling getState in this method will result in recursion.
|
* Note. Calling getState in this method will result in recursion.
|
||||||
*
|
*
|
||||||
|
* @param string $ordering An optional ordering field.
|
||||||
|
* @param string $direction An optional direction (asc|desc).
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function populateState($ordering = null, $direction = null)
|
protected function populateState($ordering = null, $direction = null)
|
||||||
@ -53,8 +59,8 @@ class WeblinksModelCategories extends JModelList
|
|||||||
$params = $app->getParams();
|
$params = $app->getParams();
|
||||||
$this->setState('params', $params);
|
$this->setState('params', $params);
|
||||||
|
|
||||||
$this->setState('filter.published', 1);
|
$this->setState('filter.published', 1);
|
||||||
$this->setState('filter.access', true);
|
$this->setState('filter.access', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,29 +70,29 @@ class WeblinksModelCategories extends JModelList
|
|||||||
* different modules that might need different sets of data or different
|
* different modules that might need different sets of data or different
|
||||||
* ordering requirements.
|
* ordering requirements.
|
||||||
*
|
*
|
||||||
* @param string $id A prefix for the store id.
|
* @param string $id A prefix for the store id.
|
||||||
*
|
*
|
||||||
* @return string A store id.
|
* @return string A store id.
|
||||||
*/
|
*/
|
||||||
protected function getStoreId($id = '')
|
protected function getStoreId($id = '')
|
||||||
{
|
{
|
||||||
// Compile the store id.
|
// Compile the store id.
|
||||||
$id .= ':'.$this->getState('filter.extension');
|
$id .= ':' . $this->getState('filter.extension');
|
||||||
$id .= ':'.$this->getState('filter.published');
|
$id .= ':' . $this->getState('filter.published');
|
||||||
$id .= ':'.$this->getState('filter.access');
|
$id .= ':' . $this->getState('filter.access');
|
||||||
$id .= ':'.$this->getState('filter.parentId');
|
$id .= ':' . $this->getState('filter.parentId');
|
||||||
|
|
||||||
return parent::getStoreId($id);
|
return parent::getStoreId($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redefine the function an add some properties to make the styling more easy
|
* Redefine the function and add some properties to make the styling more easy
|
||||||
*
|
*
|
||||||
* @return mixed An array of data items on success, false on failure.
|
* @return mixed An array of data items on success, false on failure.
|
||||||
*/
|
*/
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
if (!count($this->_items))
|
if ($this->_items === null)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$menu = $app->getMenu();
|
$menu = $app->getMenu();
|
||||||
@ -116,12 +122,18 @@ class WeblinksModelCategories extends JModelList
|
|||||||
return $this->_items;
|
return $this->_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the parent
|
||||||
|
*
|
||||||
|
* @return mixed An array of data items on success, false on failure.
|
||||||
|
*/
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
if (!is_object($this->_parent))
|
if (!is_object($this->_parent))
|
||||||
{
|
{
|
||||||
$this->getItems();
|
$this->getItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_parent;
|
return $this->_parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,12 +3,14 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblinks Component Weblink Model
|
* Weblinks Component Weblink Model
|
||||||
*
|
*
|
||||||
@ -34,8 +36,9 @@ class WeblinksModelCategory extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param array An optional associative array of configuration settings.
|
* @param array $config An optional associative array of configuration settings.
|
||||||
* @see JController
|
*
|
||||||
|
* @see JControllerLegacy
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = array())
|
||||||
@ -56,16 +59,14 @@ class WeblinksModelCategory extends JModelList
|
|||||||
/**
|
/**
|
||||||
* The category that applies.
|
* The category that applies.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @var object
|
||||||
* @var object
|
|
||||||
*/
|
*/
|
||||||
protected $_category = null;
|
protected $_category = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of other weblink categories.
|
* The list of other weblink categories.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @var array
|
||||||
* @var array
|
|
||||||
*/
|
*/
|
||||||
protected $_categories = null;
|
protected $_categories = null;
|
||||||
|
|
||||||
@ -84,10 +85,11 @@ class WeblinksModelCategory extends JModelList
|
|||||||
{
|
{
|
||||||
if (!isset($this->_params))
|
if (!isset($this->_params))
|
||||||
{
|
{
|
||||||
$params = new JRegistry;
|
$params = new Registry;
|
||||||
$params->loadString($item->params);
|
$params->loadString($item->params);
|
||||||
$item->params = $params;
|
$item->params = $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the tags
|
// Get the tags
|
||||||
$item->tags = new JHelperTags;
|
$item->tags = new JHelperTags;
|
||||||
$item->tags->getItemTags('com_weblinks.weblink', $item->id);
|
$item->tags->getItemTags('com_weblinks.weblink', $item->id);
|
||||||
@ -97,15 +99,15 @@ class WeblinksModelCategory extends JModelList
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to build an SQL query to load the list data.
|
* Method to get a JDatabaseQuery object for retrieving the data set from a database.
|
||||||
|
*
|
||||||
|
* @return JDatabaseQuery A JDatabaseQuery object to retrieve the data set.
|
||||||
*
|
*
|
||||||
* @return string An SQL query
|
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
|
||||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
|
||||||
|
|
||||||
// Create a new query object.
|
// Create a new query object.
|
||||||
$db = $this->getDbo();
|
$db = $this->getDbo();
|
||||||
@ -119,12 +121,24 @@ class WeblinksModelCategory extends JModelList
|
|||||||
// Filter by category.
|
// Filter by category.
|
||||||
if ($categoryId = $this->getState('category.id'))
|
if ($categoryId = $this->getState('category.id'))
|
||||||
{
|
{
|
||||||
$query->where('a.catid = ' . (int) $categoryId)
|
// Group by subcategory
|
||||||
->join('LEFT', '#__categories AS c ON c.id = a.catid')
|
if ($this->getState('category.group', 0))
|
||||||
->where('c.access IN (' . $groups . ')');
|
{
|
||||||
|
$query->select('c.title AS category_title')
|
||||||
|
->where('c.parent_id = ' . (int) $categoryId)
|
||||||
|
->join('LEFT', '#__categories AS c ON c.id = a.catid')
|
||||||
|
->where('c.access IN (' . $groups . ')');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$query->where('a.catid = ' . (int) $categoryId)
|
||||||
|
->join('LEFT', '#__categories AS c ON c.id = a.catid')
|
||||||
|
->where('c.access IN (' . $groups . ')');
|
||||||
|
}
|
||||||
|
|
||||||
//Filter by published category
|
// Filter by published category
|
||||||
$cpublished = $this->getState('filter.c.published');
|
$cpublished = $this->getState('filter.c.published');
|
||||||
|
|
||||||
if (is_numeric($cpublished))
|
if (is_numeric($cpublished))
|
||||||
{
|
{
|
||||||
$query->where('c.published = ' . (int) $cpublished);
|
$query->where('c.published = ' . (int) $cpublished);
|
||||||
@ -134,24 +148,23 @@ class WeblinksModelCategory extends JModelList
|
|||||||
// Join over the users for the author and modified_by names.
|
// Join over the users for the author and modified_by names.
|
||||||
$query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author")
|
$query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author")
|
||||||
->select("ua.email AS author_email")
|
->select("ua.email AS author_email")
|
||||||
|
|
||||||
->join('LEFT', '#__users AS ua ON ua.id = a.created_by')
|
->join('LEFT', '#__users AS ua ON ua.id = a.created_by')
|
||||||
->join('LEFT', '#__users AS uam ON uam.id = a.modified_by');
|
->join('LEFT', '#__users AS uam ON uam.id = a.modified_by');
|
||||||
|
|
||||||
// Filter by state
|
// Filter by state
|
||||||
|
|
||||||
$state = $this->getState('filter.state');
|
$state = $this->getState('filter.state');
|
||||||
|
|
||||||
if (is_numeric($state))
|
if (is_numeric($state))
|
||||||
{
|
{
|
||||||
$query->where('a.state = ' . (int) $state);
|
$query->where('a.state = ' . (int) $state);
|
||||||
}
|
}
|
||||||
// do not show trashed links on the front-end
|
|
||||||
|
// Do not show trashed links on the front-end
|
||||||
$query->where('a.state != -2');
|
$query->where('a.state != -2');
|
||||||
|
|
||||||
// Filter by start and end dates.
|
// Filter by start and end dates.
|
||||||
$nullDate = $db->quote($db->getNullDate());
|
$nullDate = $db->quote($db->getNullDate());
|
||||||
$date = JFactory::getDate();
|
$nowDate = $db->quote(JFactory::getDate()->toSql());
|
||||||
$nowDate = $db->quote($date->toSql());
|
|
||||||
|
|
||||||
if ($this->getState('filter.publish_date'))
|
if ($this->getState('filter.publish_date'))
|
||||||
{
|
{
|
||||||
@ -167,14 +180,28 @@ class WeblinksModelCategory extends JModelList
|
|||||||
|
|
||||||
// Filter by search in title
|
// Filter by search in title
|
||||||
$search = $this->getState('list.filter');
|
$search = $this->getState('list.filter');
|
||||||
|
|
||||||
if (!empty($search))
|
if (!empty($search))
|
||||||
{
|
{
|
||||||
$search = $db->quote('%' . $db->escape($search, true) . '%');
|
$search = $db->quote('%' . $db->escape($search, true) . '%');
|
||||||
$query->where('(a.title LIKE ' . $search . ')');
|
$query->where('(a.title LIKE ' . $search . ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If grouping by subcategory, add the subcategory list ordering clause.
|
||||||
|
if ($this->getState('category.group', 0))
|
||||||
|
{
|
||||||
|
$query->order(
|
||||||
|
$db->escape($this->getState('category.ordering', 'c.lft')) . ' ' .
|
||||||
|
$db->escape($this->getState('category.direction', 'ASC'))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the list ordering clause.
|
// Add the list ordering clause.
|
||||||
$query->order($db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
|
$query->order(
|
||||||
|
$db->escape($this->getState('list.ordering', 'a.ordering')) . ' ' .
|
||||||
|
$db->escape($this->getState('list.direction', 'ASC'))
|
||||||
|
);
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,6 +210,11 @@ class WeblinksModelCategory extends JModelList
|
|||||||
*
|
*
|
||||||
* Note. Calling getState in this method will result in recursion.
|
* Note. Calling getState in this method will result in recursion.
|
||||||
*
|
*
|
||||||
|
* @param string $ordering An optional ordering field.
|
||||||
|
* @param string $direction An optional direction (asc|desc).
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function populateState($ordering = null, $direction = null)
|
protected function populateState($ordering = null, $direction = null)
|
||||||
@ -201,26 +233,31 @@ class WeblinksModelCategory extends JModelList
|
|||||||
$this->setState('list.filter', $app->input->getString('filter-search'));
|
$this->setState('list.filter', $app->input->getString('filter-search'));
|
||||||
|
|
||||||
$orderCol = $app->input->get('filter_order', 'ordering');
|
$orderCol = $app->input->get('filter_order', 'ordering');
|
||||||
|
|
||||||
if (!in_array($orderCol, $this->filter_fields))
|
if (!in_array($orderCol, $this->filter_fields))
|
||||||
{
|
{
|
||||||
$orderCol = 'ordering';
|
$orderCol = 'ordering';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setState('list.ordering', $orderCol);
|
$this->setState('list.ordering', $orderCol);
|
||||||
|
|
||||||
$listOrder = $app->input->get('filter_order_Dir', 'ASC');
|
$listOrder = $app->input->get('filter_order_Dir', 'ASC');
|
||||||
|
|
||||||
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
|
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
|
||||||
{
|
{
|
||||||
$listOrder = 'ASC';
|
$listOrder = 'ASC';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setState('list.direction', $listOrder);
|
$this->setState('list.direction', $listOrder);
|
||||||
|
|
||||||
$id = $app->input->get('id', 0, 'int');
|
$id = $app->input->get('id', 0, 'int');
|
||||||
$this->setState('category.id', $id);
|
$this->setState('category.id', $id);
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
if ((!$user->authorise('core.edit.state', 'com_weblinks')) && (!$user->authorise('core.edit', 'com_weblinks')))
|
if ((!$user->authorise('core.edit.state', 'com_weblinks')) && (!$user->authorise('core.edit', 'com_weblinks')))
|
||||||
{
|
{
|
||||||
// limit to published for people who can't edit or edit.state.
|
// Limit to published for people who can't edit or edit.state.
|
||||||
$this->setState('filter.state', 1);
|
$this->setState('filter.state', 1);
|
||||||
|
|
||||||
// Filter by start and end dates.
|
// Filter by start and end dates.
|
||||||
@ -236,9 +273,8 @@ class WeblinksModelCategory extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Method to get category data for the current category
|
* Method to get category data for the current category
|
||||||
*
|
*
|
||||||
* @param integer An optional ID
|
|
||||||
*
|
|
||||||
* @return object
|
* @return object
|
||||||
|
*
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public function getCategory()
|
public function getCategory()
|
||||||
@ -248,7 +284,7 @@ class WeblinksModelCategory extends JModelList
|
|||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$menu = $app->getMenu();
|
$menu = $app->getMenu();
|
||||||
$active = $menu->getActive();
|
$active = $menu->getActive();
|
||||||
$params = new JRegistry;
|
$params = new Registry;
|
||||||
|
|
||||||
if ($active)
|
if ($active)
|
||||||
{
|
{
|
||||||
@ -256,17 +292,22 @@ class WeblinksModelCategory extends JModelList
|
|||||||
}
|
}
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
$options['countItems'] = $params->get('show_cat_num_links_cat', 1) || $params->get('show_empty_categories', 0);
|
$options['countItems'] = $params->get('show_cat_num_links_cat', 1)
|
||||||
|
|| $params->get('show_empty_categories', 0);
|
||||||
|
|
||||||
$categories = JCategories::getInstance('Weblinks', $options);
|
$categories = JCategories::getInstance('Weblinks', $options);
|
||||||
$this->_item = $categories->get($this->getState('category.id', 'root'));
|
$this->_item = $categories->get($this->getState('category.id', 'root'));
|
||||||
|
|
||||||
if (is_object($this->_item))
|
if (is_object($this->_item))
|
||||||
{
|
{
|
||||||
$this->_children = $this->_item->getChildren();
|
$this->_children = $this->_item->getChildren();
|
||||||
$this->_parent = false;
|
$this->_parent = false;
|
||||||
|
|
||||||
if ($this->_item->getParent())
|
if ($this->_item->getParent())
|
||||||
{
|
{
|
||||||
$this->_parent = $this->_item->getParent();
|
$this->_parent = $this->_item->getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_rightsibling = $this->_item->getSibling();
|
$this->_rightsibling = $this->_item->getSibling();
|
||||||
$this->_leftsibling = $this->_item->getSibling(false);
|
$this->_leftsibling = $this->_item->getSibling(false);
|
||||||
}
|
}
|
||||||
@ -283,8 +324,6 @@ class WeblinksModelCategory extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Get the parent category
|
* Get the parent category
|
||||||
*
|
*
|
||||||
* @param integer An optional category id. If not supplied, the model state 'category.id' will be used.
|
|
||||||
*
|
|
||||||
* @return mixed An array of categories or false if an error occurs.
|
* @return mixed An array of categories or false if an error occurs.
|
||||||
*/
|
*/
|
||||||
public function getParent()
|
public function getParent()
|
||||||
@ -293,40 +332,46 @@ class WeblinksModelCategory extends JModelList
|
|||||||
{
|
{
|
||||||
$this->getCategory();
|
$this->getCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_parent;
|
return $this->_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the sibling (adjacent) categories.
|
* Get the leftsibling (adjacent) categories.
|
||||||
*
|
*
|
||||||
* @return mixed An array of categories or false if an error occurs.
|
* @return mixed An array of categories or false if an error occurs.
|
||||||
*/
|
*/
|
||||||
function &getLeftSibling()
|
public function &getLeftSibling()
|
||||||
{
|
{
|
||||||
if (!is_object($this->_item))
|
if (!is_object($this->_item))
|
||||||
{
|
{
|
||||||
$this->getCategory();
|
$this->getCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_leftsibling;
|
return $this->_leftsibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
function &getRightSibling()
|
/**
|
||||||
|
* Get the rightsibling (adjacent) categories.
|
||||||
|
*
|
||||||
|
* @return mixed An array of categories or false if an error occurs.
|
||||||
|
*/
|
||||||
|
public function &getRightSibling()
|
||||||
{
|
{
|
||||||
if (!is_object($this->_item))
|
if (!is_object($this->_item))
|
||||||
{
|
{
|
||||||
$this->getCategory();
|
$this->getCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_rightsibling;
|
return $this->_rightsibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the child categories.
|
* Get the child categories.
|
||||||
*
|
*
|
||||||
* @param integer An optional category id. If not supplied, the model state 'category.id' will be used.
|
|
||||||
*
|
|
||||||
* @return mixed An array of categories or false if an error occurs.
|
* @return mixed An array of categories or false if an error occurs.
|
||||||
*/
|
*/
|
||||||
function &getChildren()
|
public function &getChildren()
|
||||||
{
|
{
|
||||||
if (!is_object($this->_item))
|
if (!is_object($this->_item))
|
||||||
{
|
{
|
||||||
@ -339,20 +384,19 @@ class WeblinksModelCategory extends JModelList
|
|||||||
/**
|
/**
|
||||||
* Increment the hit counter for the category.
|
* Increment the hit counter for the category.
|
||||||
*
|
*
|
||||||
* @param int $pk Optional primary key of the category to increment.
|
* @param integer $pk Optional primary key of the category to increment.
|
||||||
*
|
*
|
||||||
* @return boolean True if successful; false otherwise and internal error set.
|
* @return boolean True if successful; false otherwise and internal error set.
|
||||||
*
|
*
|
||||||
* @since 3.2
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
public function hit($pk = 0)
|
public function hit($pk = 0)
|
||||||
{
|
{
|
||||||
$input = JFactory::getApplication()->input;
|
$hitcount = JFactory::getApplication()->input->getInt('hitcount', 1);
|
||||||
$hitcount = $input->getInt('hitcount', 1);
|
|
||||||
|
|
||||||
if ($hitcount)
|
if ($hitcount)
|
||||||
{
|
{
|
||||||
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
|
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
|
||||||
$table = JTable::getInstance('Category', 'JTable');
|
$table = JTable::getInstance('Category', 'JTable');
|
||||||
$table->load($pk);
|
$table->load($pk);
|
||||||
$table->hit($pk);
|
$table->hit($pk);
|
@ -3,13 +3,13 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
require_once JPATH_COMPONENT_ADMINISTRATOR.'/models/weblink.php';
|
require_once JPATH_COMPONENT_ADMINISTRATOR . '/models/weblink.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Weblinks model.
|
* Weblinks model.
|
||||||
@ -21,14 +21,16 @@ class WeblinksModelForm extends WeblinksModelWeblink
|
|||||||
/**
|
/**
|
||||||
* Model typeAlias string. Used for version history.
|
* Model typeAlias string. Used for version history.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
public $typeAlias = 'com_weblinks.weblink';
|
public $typeAlias = 'com_weblinks.weblink';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the return URL.
|
* Get the return URL.
|
||||||
*
|
*
|
||||||
* @return string The return URL.
|
* @return string The return URL.
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function getReturnPage()
|
public function getReturnPage()
|
||||||
@ -41,6 +43,8 @@ class WeblinksModelForm extends WeblinksModelWeblink
|
|||||||
*
|
*
|
||||||
* Note. Calling getState in this method will result in recursion.
|
* Note. Calling getState in this method will result in recursion.
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
@ -50,10 +54,11 @@ class WeblinksModelForm extends WeblinksModelWeblink
|
|||||||
// Load state from the request.
|
// Load state from the request.
|
||||||
$pk = $app->input->getInt('w_id');
|
$pk = $app->input->getInt('w_id');
|
||||||
$this->setState('weblink.id', $pk);
|
$this->setState('weblink.id', $pk);
|
||||||
|
|
||||||
// Add compatibility variable for default naming conventions.
|
// Add compatibility variable for default naming conventions.
|
||||||
$this->setState('form.id', $pk);
|
$this->setState('form.id', $pk);
|
||||||
|
|
||||||
$categoryId = $app->input->getInt('catid');
|
$categoryId = $app->input->getInt('catid');
|
||||||
$this->setState('weblink.catid', $categoryId);
|
$this->setState('weblink.catid', $categoryId);
|
||||||
|
|
||||||
$return = $app->input->get('return', null, 'base64');
|
$return = $app->input->get('return', null, 'base64');
|
||||||
@ -66,9 +71,33 @@ class WeblinksModelForm extends WeblinksModelWeblink
|
|||||||
$this->setState('return_page', base64_decode($return));
|
$this->setState('return_page', base64_decode($return));
|
||||||
|
|
||||||
// Load the parameters.
|
// Load the parameters.
|
||||||
$params = $app->getParams();
|
$params = $app->getParams();
|
||||||
$this->setState('params', $params);
|
$this->setState('params', $params);
|
||||||
|
|
||||||
$this->setState('layout', $app->input->getString('layout'));
|
$this->setState('layout', $app->input->getString('layout'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract method for getting the form from the model.
|
||||||
|
*
|
||||||
|
* @param array $data Data for the form.
|
||||||
|
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||||
|
*
|
||||||
|
* @return mixed A JForm object on success, false on failure
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function getForm($data = array(), $loadData = true)
|
||||||
|
{
|
||||||
|
$form = $this->loadForm('com_weblinks.form', 'weblink', array('control' => 'jform', 'load_data' => $loadData));
|
||||||
|
|
||||||
|
// Disable the buttons and just allow editor none for not authenticated users
|
||||||
|
if (JFactory::getUser()->guest)
|
||||||
|
{
|
||||||
|
$form->setFieldAttribute('description', 'editor', 'none');
|
||||||
|
$form->setFieldAttribute('description', 'buttons', 'no');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
}
|
}
|
173
src/components/com_weblinks/models/forms/weblink.xml
Normal file
173
src/components/com_weblinks/models/forms/weblink.xml
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<form>
|
||||||
|
<fieldset addfieldpath="/administrator/components/com_categories/models/fields">
|
||||||
|
<field
|
||||||
|
name="id"
|
||||||
|
type="hidden"
|
||||||
|
label="WEBLINK_ID_LABEL"
|
||||||
|
readonly="true"
|
||||||
|
required="true"
|
||||||
|
size="10"
|
||||||
|
default="0"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
id="contenthistory"
|
||||||
|
name="contenthistory"
|
||||||
|
type="contenthistory"
|
||||||
|
data-typeAlias="com_weblinks.weblink"
|
||||||
|
label="JTOOLBAR_VERSIONS"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="title"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_TITLE"
|
||||||
|
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
||||||
|
required="true"
|
||||||
|
size="30"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="alias"
|
||||||
|
type="text"
|
||||||
|
label="JFIELD_ALIAS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
||||||
|
hint="JFIELD_ALIAS_PLACEHOLDER"
|
||||||
|
size="45"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="description"
|
||||||
|
type="editor"
|
||||||
|
label="JGLOBAL_DESCRIPTION"
|
||||||
|
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
||||||
|
buttons="true"
|
||||||
|
hide="pagebreak,readmore"
|
||||||
|
filter="safehtml"
|
||||||
|
asset_id="com_weblinks"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="state"
|
||||||
|
type="list"
|
||||||
|
label="JSTATUS"
|
||||||
|
description="JFIELD_PUBLISHED_DESC"
|
||||||
|
default="1"
|
||||||
|
size="1"
|
||||||
|
>
|
||||||
|
<option value="1">JPUBLISHED</option>
|
||||||
|
<option value="0">JUNPUBLISHED</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="catid"
|
||||||
|
type="categoryedit"
|
||||||
|
label="JCATEGORY"
|
||||||
|
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
||||||
|
extension="com_weblinks"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="url"
|
||||||
|
type="url"
|
||||||
|
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_URL_DESC"
|
||||||
|
filter="url"
|
||||||
|
required="true"
|
||||||
|
size="45"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="language"
|
||||||
|
type="contentlanguage"
|
||||||
|
label="JFIELD_LANGUAGE_LABEL"
|
||||||
|
description="JFIELD_LANGUAGE_DESC"
|
||||||
|
class="inputbox"
|
||||||
|
>
|
||||||
|
<option value="*">JALL</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="tags"
|
||||||
|
type="tag"
|
||||||
|
label="JTAG"
|
||||||
|
description="JTAG_DESC"
|
||||||
|
class="inputbox"
|
||||||
|
multiple="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="version_note"
|
||||||
|
type="text"
|
||||||
|
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
||||||
|
class="inputbox"
|
||||||
|
size="45"
|
||||||
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="captcha"
|
||||||
|
type="captcha"
|
||||||
|
label="COM_WEBLINKS_CAPTCHA_LABEL"
|
||||||
|
description="COM_WEBLINKS_CAPTCHA_DESC"
|
||||||
|
validate="captcha"
|
||||||
|
namespace="weblink"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fields name="metadata">
|
||||||
|
<fieldset
|
||||||
|
name="jmetadata"
|
||||||
|
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="robots"
|
||||||
|
type="hidden"
|
||||||
|
label="JFIELD_METADATA_ROBOTS_LABEL"
|
||||||
|
description="JFIELD_METADATA_ROBOTS_DESC"
|
||||||
|
filter="unset"
|
||||||
|
labelclass="control-label"
|
||||||
|
>
|
||||||
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
|
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
||||||
|
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
||||||
|
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
|
||||||
|
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="author"
|
||||||
|
type="hidden"
|
||||||
|
label="JAUTHOR"
|
||||||
|
description="JFIELD_METADATA_AUTHOR_DESC"
|
||||||
|
filter="unset"
|
||||||
|
size="20"
|
||||||
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="rights"
|
||||||
|
type="hidden"
|
||||||
|
label="JFIELD_META_RIGHTS_LABEL"
|
||||||
|
description="JFIELD_META_RIGHTS_DESC"
|
||||||
|
filter="unset"
|
||||||
|
required="false"
|
||||||
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="xreference"
|
||||||
|
type="hidden"
|
||||||
|
label="COM_CONTENT_FIELD_XREFERENCE_LABEL"
|
||||||
|
description="COM_CONTENT_FIELD_XREFERENCE_DESC"
|
||||||
|
filter="unset"
|
||||||
|
class="inputbox"
|
||||||
|
size="20"
|
||||||
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</form>
|
207
src/components/com_weblinks/models/weblink.php
Normal file
207
src/components/com_weblinks/models/weblink.php
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Site
|
||||||
|
* @subpackage com_weblinks
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
|
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weblinks Component Model for a Weblink record
|
||||||
|
*
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
class WeblinksModelWeblink extends JModelItem
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Model context string.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $_context = 'com_weblinks.weblink';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to auto-populate the model state.
|
||||||
|
*
|
||||||
|
* Note. Calling getState in this method will result in recursion.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
protected function populateState()
|
||||||
|
{
|
||||||
|
$app = JFactory::getApplication('site');
|
||||||
|
|
||||||
|
// Load the object state.
|
||||||
|
$pk = $app->input->getInt('id');
|
||||||
|
$this->setState('weblink.id', $pk);
|
||||||
|
|
||||||
|
// Load the parameters.
|
||||||
|
$params = $app->getParams();
|
||||||
|
$this->setState('params', $params);
|
||||||
|
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
if ((!$user->authorise('core.edit.state', 'com_weblinks')) && (!$user->authorise('core.edit', 'com_weblinks')))
|
||||||
|
{
|
||||||
|
$this->setState('filter.published', 1);
|
||||||
|
$this->setState('filter.archived', 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setState('filter.language', JLanguageMultilang::isEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to get an object.
|
||||||
|
*
|
||||||
|
* @param integer $pk The id of the object to get.
|
||||||
|
*
|
||||||
|
* @return mixed Object on success, false on failure.
|
||||||
|
*/
|
||||||
|
public function getItem($pk = null)
|
||||||
|
{
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
$pk = (!empty($pk)) ? $pk : (int) $this->getState('weblink.id');
|
||||||
|
|
||||||
|
if ($this->_item === null)
|
||||||
|
{
|
||||||
|
$this->_item = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($this->_item[$pk]))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$db = $this->getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select($this->getState('item.select', 'a.*'))
|
||||||
|
->from('#__weblinks AS a')
|
||||||
|
->where('a.id = ' . (int) $pk);
|
||||||
|
|
||||||
|
// Join on category table.
|
||||||
|
$query->select('c.title AS category_title, c.alias AS category_alias, c.access AS category_access')
|
||||||
|
->innerJoin('#__categories AS c on c.id = a.catid')
|
||||||
|
->where('c.published > 0');
|
||||||
|
|
||||||
|
// Join on user table.
|
||||||
|
$query->select('u.name AS author')
|
||||||
|
->join('LEFT', '#__users AS u on u.id = a.created_by');
|
||||||
|
|
||||||
|
// Filter by language
|
||||||
|
if ($this->getState('filter.language'))
|
||||||
|
{
|
||||||
|
$query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Join over the categories to get parent category titles
|
||||||
|
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias')
|
||||||
|
->join('LEFT', '#__categories as parent ON parent.id = c.parent_id');
|
||||||
|
|
||||||
|
if ((!$user->authorise('core.edit.state', 'com_weblinks')) && (!$user->authorise('core.edit', 'com_weblinks')))
|
||||||
|
{
|
||||||
|
// Filter by start and end dates.
|
||||||
|
$nullDate = $db->quote($db->getNullDate());
|
||||||
|
$date = JFactory::getDate();
|
||||||
|
|
||||||
|
$nowDate = $db->quote($date->toSql());
|
||||||
|
|
||||||
|
$query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')')
|
||||||
|
->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by published state.
|
||||||
|
$published = $this->getState('filter.published');
|
||||||
|
$archived = $this->getState('filter.archived');
|
||||||
|
|
||||||
|
if (is_numeric($published))
|
||||||
|
{
|
||||||
|
$query->where('(a.state = ' . (int) $published . ' OR a.state =' . (int) $archived . ')');
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
$data = $db->loadObject();
|
||||||
|
|
||||||
|
if (empty($data))
|
||||||
|
{
|
||||||
|
JError::raiseError(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for published state if filter set.
|
||||||
|
if ((is_numeric($published) || is_numeric($archived)) && (($data->state != $published) && ($data->state != $archived)))
|
||||||
|
{
|
||||||
|
JError::raiseError(404, JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert parameter fields to objects.
|
||||||
|
$data->params = new Registry($data->params);
|
||||||
|
$data->metadata = new Registry($data->metadata);
|
||||||
|
|
||||||
|
// Compute access permissions.
|
||||||
|
if ($access = $this->getState('filter.access'))
|
||||||
|
{
|
||||||
|
// If the access filter has been set, we already know this user can view.
|
||||||
|
$data->params->set('access-view', true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If no access filter is set, the layout takes some responsibility for display of limited information.
|
||||||
|
$groups = $user->getAuthorisedViewLevels();
|
||||||
|
$data->params->set('access-view', in_array($data->access, $groups) && in_array($data->category_access, $groups));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_item[$pk] = $data;
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
$this->setError($e);
|
||||||
|
$this->_item[$pk] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->_item[$pk];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a reference to the a Table object, always creating it.
|
||||||
|
*
|
||||||
|
* @param string $type The table type to instantiate
|
||||||
|
* @param string $prefix A prefix for the table class name. Optional.
|
||||||
|
* @param array $config Configuration array for model. Optional.
|
||||||
|
*
|
||||||
|
* @return JTable A database object
|
||||||
|
*
|
||||||
|
* @since 1.6
|
||||||
|
*/
|
||||||
|
public function getTable($type = 'Weblink', $prefix = 'WeblinksTable', $config = array())
|
||||||
|
{
|
||||||
|
return JTable::getInstance($type, $prefix, $config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to increment the hit counter for the weblink
|
||||||
|
*
|
||||||
|
* @param integer $pk Optional ID of the weblink.
|
||||||
|
*
|
||||||
|
* @return boolean True on success
|
||||||
|
*/
|
||||||
|
public function hit($pk = null)
|
||||||
|
{
|
||||||
|
if (empty($pk))
|
||||||
|
{
|
||||||
|
$pk = $this->getState('weblink.id');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getTable('Weblink', 'WeblinksTable')->hit($pk);
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ class WeblinksRouter extends JComponentRouterBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Are we dealing with an weblink that is attached to a menu item?
|
// Are we dealing with an weblink that is attached to a menu item?
|
||||||
if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id']))
|
if (isset($query['view']) && ($mView == $query['view']) && isset($query['id']) && ($mId == (int) $query['id']))
|
||||||
{
|
{
|
||||||
unset($query['view']);
|
unset($query['view']);
|
||||||
unset($query['catid']);
|
unset($query['catid']);
|
||||||
@ -74,7 +74,7 @@ class WeblinksRouter extends JComponentRouterBase
|
|||||||
return $segments;
|
return $segments;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($view) and ($view == 'category' or $view == 'weblink'))
|
if (isset($view) && ($view == 'category' || $view == 'weblink'))
|
||||||
{
|
{
|
||||||
if ($mId != (int) $query['id'] || $mView != $view)
|
if ($mId != (int) $query['id'] || $mView != $view)
|
||||||
{
|
{
|
||||||
@ -259,7 +259,11 @@ class WeblinksRouter extends JComponentRouterBase
|
|||||||
/**
|
/**
|
||||||
* Weblinks router functions
|
* Weblinks router functions
|
||||||
*
|
*
|
||||||
* These functions are proxys for the new router interface
|
* @param array &$query An array of URL arguments
|
||||||
|
*
|
||||||
|
* @return array The URL arguments to use to assemble the subsequent URL.
|
||||||
|
*
|
||||||
|
* Note. These functions are proxies for the new router interface
|
||||||
* for old SEF extensions.
|
* for old SEF extensions.
|
||||||
*
|
*
|
||||||
* @deprecated 4.0 Use Class based routers instead
|
* @deprecated 4.0 Use Class based routers instead
|
||||||
@ -271,6 +275,18 @@ function WeblinksBuildRoute(&$query)
|
|||||||
return $router->build($query);
|
return $router->build($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Weblinks router functions
|
||||||
|
*
|
||||||
|
* @param array $segments The segments of the URL to parse.
|
||||||
|
*
|
||||||
|
* @return array The URL attributes to be used by the application.
|
||||||
|
*
|
||||||
|
* Note. These functions are proxies for the new router interface
|
||||||
|
* for old SEF extensions.
|
||||||
|
*
|
||||||
|
* @deprecated 4.0 Use Class based routers instead
|
||||||
|
*/
|
||||||
function WeblinksParseRoute($segments)
|
function WeblinksParseRoute($segments)
|
||||||
{
|
{
|
||||||
$router = new WeblinksRouter;
|
$router = new WeblinksRouter;
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -22,8 +22,10 @@ jQuery(function($) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});");
|
});");
|
||||||
|
|
||||||
echo JLayoutHelper::render('joomla.content.categories_default', $this);
|
|
||||||
echo $this->loadTemplate('items');
|
|
||||||
?>
|
?>
|
||||||
|
<div class="categories-list<?php echo $this->pageclass_sfx;?>">
|
||||||
|
<?php
|
||||||
|
echo JLayoutHelper::render('joomla.content.categories_default', $this);
|
||||||
|
echo $this->loadTemplate('items');
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
282
src/components/com_weblinks/views/categories/tmpl/default.xml
Normal file
282
src/components/com_weblinks/views/categories/tmpl/default.xml
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<metadata>
|
||||||
|
<layout title="com_weblinks_categories_view_default_title" option="com_weblinks_categories_view_default_option">
|
||||||
|
<help
|
||||||
|
key="JHELP_MENUS_MENU_ITEM_WEBLINK_CATEGORIES"
|
||||||
|
/>
|
||||||
|
<message>
|
||||||
|
<![CDATA[com_weblinks_categories_view_default_desc]]>
|
||||||
|
</message>
|
||||||
|
</layout>
|
||||||
|
|
||||||
|
<!-- Add fields to the request variables for the layout. -->
|
||||||
|
<fields name="request">
|
||||||
|
<fieldset name="request"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="id"
|
||||||
|
type="category"
|
||||||
|
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
|
||||||
|
extension="com_weblinks"
|
||||||
|
show_root="true"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
|
||||||
|
<!-- Add fields to the parameters object for the layout. -->
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
|
||||||
|
<field
|
||||||
|
name="show_base_description"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="categories_description"
|
||||||
|
type="textarea"
|
||||||
|
label="JGLOBAL_FIELD_CATEGORIES_DESC_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_CATEGORIES_DESC_DESC"
|
||||||
|
cols="25"
|
||||||
|
rows="5"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="maxLevelcat"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="-1">JALL</option>
|
||||||
|
<option value="1">J1</option>
|
||||||
|
<option value="2">J2</option>
|
||||||
|
<option value="3">J3</option>
|
||||||
|
<option value="4">J4</option>
|
||||||
|
<option value="5">J5</option>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_empty_categories_cat"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_subcat_desc_cat"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_cat_num_links_cat"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="category" label="JGLOBAL_CATEGORY_OPTIONS">
|
||||||
|
<field
|
||||||
|
name="spacer1"
|
||||||
|
type="spacer"
|
||||||
|
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
||||||
|
class="text"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_category_title"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_description"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_description_image"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="maxLevel"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JNONE</option>
|
||||||
|
<option value="-1">JALL</option>
|
||||||
|
<option value="1">J1</option>
|
||||||
|
<option value="2">J2</option>
|
||||||
|
<option value="3">J3</option>
|
||||||
|
<option value="4">J4</option>
|
||||||
|
<option value="5">J5</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_empty_categories"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_subcat_desc"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_cat_num_links"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
||||||
|
<field
|
||||||
|
name="spacer2"
|
||||||
|
type="spacer"
|
||||||
|
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
||||||
|
class="text"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="filter_field"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_FILTER_FIELD_LABEL"
|
||||||
|
description="JGLOBAL_FILTER_FIELD_DESC"
|
||||||
|
default=""
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="hide">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination_limit"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||||
|
description="JGLOBAL_DISPLAY_SELECT_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_headings"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_link_description"
|
||||||
|
type="list"
|
||||||
|
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_link_hits"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_HITS"
|
||||||
|
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_PAGINATION_LABEL"
|
||||||
|
description="JGLOBAL_PAGINATION_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="2">JGLOBAL_AUTO</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="show_pagination_results"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||||
|
description="JGLOBAL_PAGINATION_RESULTS_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</fields>
|
||||||
|
</metadata>
|
@ -3,7 +3,7 @@
|
|||||||
* @package Joomla.Site
|
* @package Joomla.Site
|
||||||
* @subpackage com_weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user