mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-05-29 04:30:46 +00:00
Compare commits
187 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 | ||
|
e6a50f1fdb | ||
|
c0d7a9407f | ||
|
6caa06509b | ||
|
0e5dc69bc1 | ||
|
b7a90bad2c | ||
|
896efa4a6a | ||
|
5bbbf6904d |
71
.drone.yml
71
.drone.yml
|
@ -1,20 +1,51 @@
|
||||||
cache:
|
---
|
||||||
mount:
|
kind: pipeline
|
||||||
- vendor
|
name: default
|
||||||
- .git
|
|
||||||
build:
|
steps:
|
||||||
image: yveshoppe/joomla-systemtests:latest
|
- name: weblinks-codeception-tests
|
||||||
commands:
|
image: joomlaprojects/docker-systemtests:latest
|
||||||
- chmod a+x .drone/build.sh
|
commands:
|
||||||
- ./.drone/build.sh
|
- composer install
|
||||||
- apache2ctl start
|
- chmod a+x .drone/build.sh
|
||||||
- service mysql start
|
- ./.drone/build.sh
|
||||||
- cd /tests/www
|
- apache2ctl start
|
||||||
- export DISPLAY=:0
|
- service mysql start
|
||||||
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
|
- cd /tests/www
|
||||||
- sleep 3
|
- export DISPLAY=:0
|
||||||
- fluxbox > /dev/null 2>&1 &
|
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
|
||||||
- vendor/bin/robo run:tests
|
- sleep 3
|
||||||
clone:
|
- fluxbox > /dev/null 2>&1 &
|
||||||
depth: 1
|
- vendor/bin/robo run:tests
|
||||||
path: repo
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
...
|
||||||
|
|
26
.travis.yml
26
.travis.yml
|
@ -1,5 +1,7 @@
|
||||||
sudo: true
|
sudo: true
|
||||||
language: php
|
language: php
|
||||||
|
services:
|
||||||
|
- xvfb
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
@ -8,29 +10,15 @@ env:
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
- php: 5.5
|
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: RUN_PHPCS="yes"
|
env: RUN_PHPCS="yes"
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
sudo: true
|
sudo: true
|
||||||
addons:
|
addons:
|
||||||
firefox: "47.0.1"
|
firefox: 'latest-esr'
|
||||||
- php: 7.1
|
- php: 7.1
|
||||||
- php: hhvm
|
- php: 7.2
|
||||||
sudo: true
|
- php: 7.3
|
||||||
dist: trusty
|
|
||||||
group: edge # Until the next stable image update sometime after 2016-12-01
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- mysql-server-5.6
|
|
||||||
- mysql-client-core-5.6
|
|
||||||
- mysql-client-5.6
|
|
||||||
services:
|
|
||||||
- mysql
|
|
||||||
- postgresql
|
|
||||||
allow_failures:
|
|
||||||
- php: hhvm
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Forcing localhost in hosts file
|
# Forcing localhost in hosts file
|
||||||
|
@ -48,10 +36,6 @@ before_script:
|
||||||
- sudo sed -e "s?%PHPVERSION%?${TRAVIS_PHP_VERSION:0:1}?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
|
- git submodule update --init --recursive
|
||||||
- sudo service apache2 restart
|
- sudo service apache2 restart
|
||||||
# Xvfb
|
|
||||||
- "export DISPLAY=:99.0"
|
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
|
||||||
- sleep 3 # give xvfb some time to start
|
|
||||||
# Fluxbox
|
# Fluxbox
|
||||||
- sudo apt-get install fluxbox -y --force-yes
|
- sudo apt-get install fluxbox -y --force-yes
|
||||||
- fluxbox &
|
- fluxbox &
|
||||||
|
|
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*
|
56
README.md
56
README.md
|
@ -1,10 +1,16 @@
|
||||||
# Weblinks for Joomla! Travis: [![Travis Build Status](https://travis-ci.org/joomla-extensions/weblinks.svg?branch=master)](https://travis-ci.org/joomla-extensions/weblinks) | Drone: [![Drone Build Status](http://213.160.72.75/api/badges/joomla-extensions/weblinks/status.svg)](http://213.160.72.75/joomla-extensions/weblinks)
|
# Weblinks for Joomla!
|
||||||
|
|
||||||
This repo is meant to hold the decoupled com_weblinks component and related code.
|
Build Status
|
||||||
|
---------------------
|
||||||
|
| Drone-CI |
|
||||||
|
| ------------- |
|
||||||
|
| [![Build Status](https://ci.joomla.org/api/badges/joomla-extensions/weblinks/status.svg)](https://ci.joomla.org/joomla-extensions/weblinks) |
|
||||||
|
|
||||||
#How to test a PR
|
Weblinks for Joomla! provides a component and accompanying extensions to create a directory of weblinks.
|
||||||
|
|
||||||
##With the [Patch Tester Component](https://github.com/joomla-extensions/patchtester/releases/latest)
|
# 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:
|
Easily apply changes from a pull requests against this repo:
|
||||||
|
@ -18,7 +24,7 @@ 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).
|
You can read more about the Patch Tester extension on the [Joomla! Documentation Wiki](https://docs.joomla.org/Component_Patchtester_for_Testers).
|
||||||
|
|
||||||
##With Github
|
## With Github
|
||||||
|
|
||||||
|
|
||||||
If you want to test a patch you can apply the patch via git.
|
If you want to test a patch you can apply the patch via git.
|
||||||
|
@ -45,10 +51,10 @@ git checkout move-lang-files
|
||||||
# For Linux
|
# For Linux
|
||||||
|
|
||||||
|
|
||||||
##Install
|
## Install
|
||||||
|
|
||||||
|
|
||||||
###1. Open a session and change to the document root of your local webserver.
|
### 1. Open a session and change to the document root of your local webserver.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cd /var/www/html/
|
$ cd /var/www/html/
|
||||||
|
@ -56,7 +62,7 @@ $ cd /var/www/html/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###2. Clone the current repository into your webserver root folder
|
### 2. Clone the current repository into your webserver root folder
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html$ git clone git@github.com:joomla-extensions/weblinks.git
|
/var/www/html$ git clone git@github.com:joomla-extensions/weblinks.git
|
||||||
|
@ -73,7 +79,7 @@ Are you new with github? Here you can find informations about setting it up: htt
|
||||||
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
|
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
|
### 3. Change to the directory weblinks
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html$ cd weblinks
|
/var/www/html$ cd weblinks
|
||||||
|
@ -81,7 +87,7 @@ If you get an error you can try git clone https://github.com:joomla-extensions/w
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###4. This files should be in your weblinks folder.
|
### 4. This files should be in your weblinks folder.
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ ls
|
/var/www/html/weblinks$ ls
|
||||||
|
@ -91,7 +97,7 @@ 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.
|
### 5. Optional: Have a look into composer.json for information what software you will install via composer.
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ cat composer.json
|
/var/www/html/weblinks$ cat composer.json
|
||||||
|
@ -103,14 +109,14 @@ 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.
|
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.
|
### 6. Optional: If you have problems using composer set a timeout.
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$export COMPOSER_PROCESS_TIMEOUT=1500;
|
/var/www/html/weblinks$export COMPOSER_PROCESS_TIMEOUT=1500;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###7. Install via composer
|
### 7. Install via composer
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ composer install
|
/var/www/html/weblinks$ composer install
|
||||||
|
@ -125,13 +131,13 @@ Generating autoload files
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###8. After that you have to build [robo](http://robotframework.org/)
|
### 8. After that you have to build [robo](http://robotframework.org/)
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ vendor/bin/robo build
|
/var/www/html/weblinks$ vendor/bin/robo build
|
||||||
```
|
```
|
||||||
|
|
||||||
###9. Optional: Prepare the database
|
### 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.
|
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.
|
But the safest way is to create the database before running Joomla's web installer.
|
||||||
|
|
||||||
|
@ -146,7 +152,7 @@ Bye
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###10. Copy the file acceptance.suite.dist.yml into acceptance.suite.dist.yml
|
### 10. Copy the file acceptance.suite.dist.yml into acceptance.suite.dist.yml
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ cd tests
|
/var/www/html/weblinks$ cd tests
|
||||||
|
@ -154,7 +160,7 @@ Bye
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###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.
|
### 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
|
/var/www/html/weblinks/tests$ cat acceptance.suite.yml
|
||||||
|
@ -203,7 +209,7 @@ env:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###12. Optional: Go back to weblinks directory and create and edit the file RoboFile.ini. Delete the local user www-data.
|
### 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$ cp RoboFile.dist.ini RoboFile.ini
|
||||||
|
@ -217,7 +223,7 @@ skipClone = false
|
||||||
cmsPath = tests/joomla-cms3
|
cmsPath = tests/joomla-cms3
|
||||||
|
|
||||||
; If you want to clone a different branch, you can set it here
|
; If you want to clone a different branch, you can set it here
|
||||||
branch = staging
|
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.
|
; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.
|
||||||
localUser =
|
localUser =
|
||||||
|
@ -227,14 +233,14 @@ insecure = false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###13. Optional: Set use owner of the project to your user.
|
### 13. Optional: Set use owner of the project to your user.
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$sudo chown -R username:usergroup /var/www
|
/var/www/html/weblinks$sudo chown -R username:usergroup /var/www
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
###14. Ready! Run the first tests:
|
### 14. Ready! Run the first tests:
|
||||||
|
|
||||||
```
|
```
|
||||||
/var/www/html/weblinks$ vendor/bin/robo run:tests
|
/var/www/html/weblinks$ vendor/bin/robo run:tests
|
||||||
|
@ -254,13 +260,13 @@ The tests in Weblinks Extension use Codeception Testing Framework, if you want t
|
||||||
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.
|
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
|
skipClone = true
|
||||||
cmsPath = tests/joomla-cms3
|
cmsPath = tests/joomla
|
||||||
|
|
||||||
The currently available options are as follows:
|
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.
|
* `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`.
|
* `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 `staging`.
|
* `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
|
## Additional options
|
||||||
|
|
||||||
|
@ -277,11 +283,11 @@ To set a specific resolution, set is as an option of the command:
|
||||||
Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.
|
Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.
|
||||||
|
|
||||||
|
|
||||||
##Video
|
## 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.
|
[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:
|
# For Windows:
|
||||||
|
|
||||||
You need to install:
|
You need to install:
|
||||||
- Git for windows (https://msysgit.github.io/)
|
- Git for windows (https://msysgit.github.io/)
|
||||||
|
|
|
@ -7,7 +7,7 @@ skipClone = false
|
||||||
cmsPath = tests/joomla
|
cmsPath = tests/joomla
|
||||||
|
|
||||||
; If you want to clone a different branch, you can set it here
|
; If you want to clone a different branch, you can set it here
|
||||||
branch = staging
|
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.
|
; (Linux / Mac only) If you want to set a different owner for the CMS root folder, you can set it here.
|
||||||
localUser = www-data
|
localUser = www-data
|
||||||
|
|
105
RoboFile.php
105
RoboFile.php
|
@ -12,6 +12,10 @@
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @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';
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
if (!defined('JPATH_BASE'))
|
if (!defined('JPATH_BASE'))
|
||||||
|
@ -26,11 +30,11 @@ if (!defined('JPATH_BASE'))
|
||||||
*
|
*
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
class RoboFile extends \Robo\Tasks
|
class RoboFile extends Tasks
|
||||||
{
|
{
|
||||||
// Load tasks from composer, see composer.json
|
// Load tasks from composer, see composer.json
|
||||||
use \joomla_projects\robo\loadTasks;
|
use loadTestingTasks;
|
||||||
use \Joomla\Jorobo\Tasks\loadTasks;
|
use loadReleaseTasks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File extension for executables
|
* File extension for executables
|
||||||
|
@ -77,22 +81,13 @@ class RoboFile extends \Robo\Tasks
|
||||||
/**
|
/**
|
||||||
* Get the executable extension according to Operating System
|
* Get the executable extension according to Operating System
|
||||||
*
|
*
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getExecutableExtension()
|
private function getExecutableExtension()
|
||||||
{
|
{
|
||||||
if ($this->isWindows())
|
if ($this->isWindows())
|
||||||
{
|
{
|
||||||
// Check wehter git.exe or git as command should be used,
|
return '.exe';
|
||||||
// As on window both is possible
|
|
||||||
if (!$this->_exec('git.exe --version')->getMessage())
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return '.exe';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
@ -102,10 +97,11 @@ class RoboFile extends \Robo\Tasks
|
||||||
* Executes all the Selenium System Tests in a suite on your machine
|
* Executes all the Selenium System Tests in a suite on your machine
|
||||||
*
|
*
|
||||||
* @param array $opts Array of configuration options:
|
* @param array $opts Array of configuration options:
|
||||||
* - 'use-htaccess': renames and enable embedded Joomla .htaccess file
|
* - 'use-htaccess': renames and enable embedded Joomla .htaccess file
|
||||||
* - 'env': set a specific environment to get configuration from
|
* - 'env': set a specific environment to get configuration from
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
*/
|
*/
|
||||||
public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
|
public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
|
||||||
{
|
{
|
||||||
|
@ -124,7 +120,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
->arg('--steps')
|
->arg('--steps')
|
||||||
->arg('--debug')
|
->arg('--debug')
|
||||||
->arg('--fail-fast')
|
->arg('--fail-fast')
|
||||||
->arg('--env ' . $opts['env'])
|
->env($opts['env'])
|
||||||
->arg('tests/acceptance/install/')
|
->arg('tests/acceptance/install/')
|
||||||
->run()
|
->run()
|
||||||
->stopOnFail();
|
->stopOnFail();
|
||||||
|
@ -133,7 +129,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
->arg('--steps')
|
->arg('--steps')
|
||||||
->arg('--debug')
|
->arg('--debug')
|
||||||
->arg('--fail-fast')
|
->arg('--fail-fast')
|
||||||
->arg('--env ' . $opts['env'])
|
->env($opts['env'])
|
||||||
->arg('tests/acceptance/administrator/')
|
->arg('tests/acceptance/administrator/')
|
||||||
->run()
|
->run()
|
||||||
->stopOnFail();
|
->stopOnFail();
|
||||||
|
@ -142,7 +138,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
->arg('--steps')
|
->arg('--steps')
|
||||||
->arg('--debug')
|
->arg('--debug')
|
||||||
->arg('--fail-fast')
|
->arg('--fail-fast')
|
||||||
->arg('--env ' . $opts['env'])
|
->env($opts['env'])
|
||||||
->arg('tests/acceptance/frontend/')
|
->arg('tests/acceptance/frontend/')
|
||||||
->run()
|
->run()
|
||||||
->stopOnFail();
|
->stopOnFail();
|
||||||
|
@ -166,6 +162,8 @@ class RoboFile extends \Robo\Tasks
|
||||||
* @param string $suite Optional name of the suite containing the tests, Acceptance by default.
|
* @param string $suite Optional name of the suite containing the tests, Acceptance by default.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws ReflectionException
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
*/
|
*/
|
||||||
public function runTest($pathToTestFile = null, $suite = 'acceptance')
|
public function runTest($pathToTestFile = null, $suite = 'acceptance')
|
||||||
{
|
{
|
||||||
|
@ -205,8 +203,8 @@ class RoboFile extends \Robo\Tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->say('');
|
$this->say('');
|
||||||
$testNumber = $this->ask('Type the number of the test in the list that you want to run...');
|
$testNumber = $this->ask('Type the number of the test in the list that you want to run...');
|
||||||
$test = $tests[$testNumber];
|
$test = $tests[$testNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
$pathToTestFile = 'tests/' . $suite . '/' . $test;
|
$pathToTestFile = 'tests/' . $suite . '/' . $test;
|
||||||
|
@ -215,7 +213,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
require 'tests/' . $suite . '/' . $test;
|
require 'tests/' . $suite . '/' . $test;
|
||||||
|
|
||||||
// Logic to fetch the class name from the file name
|
// Logic to fetch the class name from the file name
|
||||||
$fileName = explode("/", $test);
|
$fileName = explode("/", $test);
|
||||||
$className = explode(".", $fileName[1]);
|
$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
|
// 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
|
||||||
|
@ -245,7 +243,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
|
|
||||||
$this->say('');
|
$this->say('');
|
||||||
$methodNumber = $this->ask('Please choose the method in the test that you would want to run...');
|
$methodNumber = $this->ask('Please choose the method in the test that you would want to run...');
|
||||||
$method = $methods[$methodNumber];
|
$method = $methods[$methodNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($method) && $method != 'All')
|
if (isset($method) && $method != 'All')
|
||||||
|
@ -301,7 +299,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
* Creates a testing Joomla site for running the tests (use it before run:test)
|
* 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
|
* @param bool $use_htaccess (1/0) Rename and enable embedded Joomla .htaccess file
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function createTestingSite($use_htaccess = false)
|
public function createTestingSite($use_htaccess = false)
|
||||||
|
@ -400,7 +398,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
*/
|
*/
|
||||||
private function buildGitCloneCommand()
|
private function buildGitCloneCommand()
|
||||||
{
|
{
|
||||||
$branch = empty($this->configuration->branch) ? 'staging' : $this->configuration->branch;
|
$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";
|
return "git" . $this->executableExtension . " clone -b $branch --single-branch --depth 1 https://github.com/joomla/joomla-cms.git tests/cache";
|
||||||
}
|
}
|
||||||
|
@ -441,26 +439,23 @@ class RoboFile extends \Robo\Tasks
|
||||||
* Runs Selenium Standalone Server.
|
* Runs Selenium Standalone Server.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
*/
|
*/
|
||||||
public function runSelenium()
|
public function runSelenium()
|
||||||
{
|
{
|
||||||
if (!$this->isWindows())
|
|
||||||
{
|
|
||||||
$this->_exec("vendor/bin/selenium-server-standalone " . $this->getWebDriver() . ' >> selenium.log 2>&1 &');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->_exec('START java.exe -jar' . $this->getWebDriver() .
|
|
||||||
' vendor\joomla-projects\selenium-server-standalone\bin\selenium-server-standalone.jar ');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->isWindows())
|
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);
|
sleep(3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->taskWaitForSeleniumStandaloneServer()
|
$this->taskSeleniumStandaloneServer()
|
||||||
|
->setWebdriver($this->getWebdriver())
|
||||||
|
->runSelenium()
|
||||||
|
->waitForSelenium()
|
||||||
->run()
|
->run()
|
||||||
->stopOnFail();
|
->stopOnFail();
|
||||||
}
|
}
|
||||||
|
@ -492,18 +487,23 @@ class RoboFile extends \Robo\Tasks
|
||||||
*
|
*
|
||||||
* @param string $host Web host of the remote server.
|
* @param string $host Web host of the remote server.
|
||||||
* @param string $port Server port.
|
* @param string $port Server port.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function killSelenium($host = 'localhost', $port = '4444')
|
public function killSelenium($host = 'localhost', $port = '4444')
|
||||||
{
|
{
|
||||||
$this->say('Trying to kill the selenium server.');
|
$this->say('Trying to kill the selenium server.');
|
||||||
$this->_exec("curl http://$host:$port/selenium-server/driver/?cmd=shutDownSeleniumServer");
|
|
||||||
|
$this->taskSeleniumStandaloneServer()
|
||||||
|
->setUrl("http://$host:$port")
|
||||||
|
->killSelenium()
|
||||||
|
->run()
|
||||||
|
->stopOnFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the phpmd tool
|
* Run the phpmd tool
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function runPhpmd()
|
private function runPhpmd()
|
||||||
|
@ -513,7 +513,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the phpcs tool
|
* Run the phpcs tool
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function runPhpcs()
|
private function runPhpcs()
|
||||||
|
@ -523,7 +523,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the phpcpd tool
|
* Run the phpcpd tool
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function runPhpcpd()
|
private function runPhpcpd()
|
||||||
|
@ -550,7 +550,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes all unit tests
|
* Executes all unit tests
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function runUnit()
|
public function runUnit()
|
||||||
|
@ -589,6 +589,7 @@ class RoboFile extends \Robo\Tasks
|
||||||
* @return string the webdriver string to use with selenium
|
* @return string the webdriver string to use with selenium
|
||||||
*
|
*
|
||||||
* @since version
|
* @since version
|
||||||
|
* @throws \Codeception\Exception\ConfigurationException
|
||||||
*/
|
*/
|
||||||
public function getWebdriver()
|
public function getWebdriver()
|
||||||
{
|
{
|
||||||
|
@ -627,8 +628,8 @@ class RoboFile extends \Robo\Tasks
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->yell(
|
$this->yell(
|
||||||
print_r($codeceptMainConfig) .
|
print_r($codeceptMainConfig) .
|
||||||
'No driver for your browser. Check your browser in acceptance.suite.yml and the webDrivers in codeception.yml');
|
'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
|
// We can't do anything without a driver, exit
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -693,4 +694,18 @@ class RoboFile extends \Robo\Tasks
|
||||||
{
|
{
|
||||||
(new \Joomla\Jorobo\Tasks\BumpVersion())->run();
|
(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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,14 @@ settings:
|
||||||
memory_limit: 1024M
|
memory_limit: 1024M
|
||||||
webdrivers:
|
webdrivers:
|
||||||
firefox:
|
firefox:
|
||||||
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\gecko\geckodriver64.exe
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\gecko\windows\geckodriver64.exe
|
||||||
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/geckodriver_mac
|
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/mac/geckodriver
|
||||||
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/geckodriver_linux_64
|
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/gecko/linux/geckodriver
|
||||||
chrome:
|
chrome:
|
||||||
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\chrome\chromedriver.exe
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\chrome\windows\chromedriver.exe
|
||||||
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/chromedriver_mac
|
mac: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/mac/chromedriver
|
||||||
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/chromedriver_linux_64
|
linux: vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/linux/chromedriver
|
||||||
internet explorer:
|
internet explorer:
|
||||||
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\internet-explorer32\IEDriverServer.exe
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\internet-explorer32\IEDriverServer.exe
|
||||||
MicrosoftEdge:
|
MicrosoftEdge:
|
||||||
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\edge\MicrosoftWebDriver.exe
|
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\edge\msedgedriver64.exe
|
||||||
MicrosoftEdgeInsiders:
|
|
||||||
windows: vendor\joomla-projects\selenium-server-standalone\bin\webdrivers\edge-insiders\MicrosoftWebDriver.exe
|
|
||||||
|
|
|
@ -1,23 +1,25 @@
|
||||||
{
|
{
|
||||||
"name" : "joomla-extensions/weblinks",
|
"name" : "joomla-extensions/weblinks",
|
||||||
"description": "The Open Source PHP Framework for creating complex Joomla extensions",
|
"description": "The Open Source PHP Framework for creating complex Joomla extensions",
|
||||||
"license" : "GPL-2.0+",
|
"license" : "GPL-2.0-or-later",
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "5.5.33"
|
"php": "5.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require" : {
|
"require" : {
|
||||||
"php": ">=5.3.10"
|
"php": "^5.3.10|^7.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"codeception/codeception": "^2.2",
|
"php": ">=5.6",
|
||||||
"joomla-projects/joomla-browser": "v3.6.5.1",
|
"codeception/codeception": "^3",
|
||||||
"composition/robo": "~1",
|
"phpunit/phpunit": "^5.7.27",
|
||||||
"joomla-projects/robo": "~0",
|
"joomla-projects/joomla-browser": "^3.9",
|
||||||
"joomla-projects/selenium-server-standalone": "v3.0.1.2",
|
"consolidation/robo": "^1.0.0",
|
||||||
|
"joomla-projects/joomla-testing-robo": "~1.0",
|
||||||
|
"joomla-projects/selenium-server-standalone": "^3.14",
|
||||||
"fzaninotto/faker": "^1.6",
|
"fzaninotto/faker": "^1.6",
|
||||||
"joomla-projects/jorobo": "~0.6",
|
"joomla-projects/jorobo": "~0.7",
|
||||||
"Behat/Gherkin": "^4.4.1"
|
"behat/gherkin": "^4.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5143
composer.lock
generated
5143
composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,12 @@
|
||||||
How to install
|
## How to install the weblinks extension
|
||||||
|
|
||||||
Just install the package file over the normal Joomla! installer
|
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.
|
||||||
|
|
||||||
You can also only install certain parts by unzipping the package before.
|
## 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.
|
|
@ -1,17 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<jedupdate version="1">
|
|
||||||
<core_body>The Web Links Manager allows you to add, edit and remove links to other web sites on your Joomla! web site, and organize them into categories. You can then display these links on your site, and optionally let visitors add new links.</core_body>
|
|
||||||
<!-- valid links only or leave blank -->
|
|
||||||
<homepage_link>https://github.com/joomla-extensions/weblinks</homepage_link>
|
|
||||||
<download_link>https://github.com/joomla-extensions/weblinks/releases</download_link>
|
|
||||||
<demo_link>https://demo.joomla.org/</demo_link>
|
|
||||||
<documentation_link>https://docs.joomla.org/Help33:Components_Weblinks_Links</documentation_link>
|
|
||||||
<support_link>http://forum.joomla.org/</support_link>
|
|
||||||
<license_link>http://opensourcematters.org/legal/license-copyright/gnu-general-public-license-v2.html</license_link>
|
|
||||||
<version>3.5.0</version>
|
|
||||||
<compatibility>
|
|
||||||
<version>35</version>
|
|
||||||
<version>36</version>
|
|
||||||
<version>37</version>
|
|
||||||
</compatibility>
|
|
||||||
</jedupdate>
|
|
|
@ -1,5 +1,5 @@
|
||||||
extension = weblinks
|
extension = weblinks
|
||||||
version = 3.6.0-beta
|
version = 3.9.0
|
||||||
source = src
|
source = src
|
||||||
target = package
|
target = package
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ text = "
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Administrator
|
||||||
* @subpackage Weblinks
|
* @subpackage Weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - ##YEAR## Open Source Matters, Inc. All rights reserved.
|
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
"
|
"
|
||||||
|
|
48
manifest.xml
48
manifest.xml
|
@ -5,28 +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.5.0</version>
|
<version>3.7.0</version>
|
||||||
<client>site</client>
|
<client>site</client>
|
||||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.5.0</infourl>
|
<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.5.0/pkg-weblinks-3.5.0.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.[56789]" />
|
<targetplatform name="joomla" version="3.[678]" />
|
||||||
</update>
|
</update>
|
||||||
<update>
|
<update>
|
||||||
<name>Weblinks Extension Package</name>
|
<name>Weblinks Extension Package</name>
|
||||||
<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.6.0-beta</version>
|
<version>3.9.0</version>
|
||||||
<client>site</client>
|
<client>site</client>
|
||||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.6.0-beta</infourl>
|
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.9.0</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/weblinks/releases/download/3.6.0-beta/pkg-weblinks-3.6.0-beta.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/3-9-0/pkg-weblinks-3.9.0.zip</downloadurl>
|
||||||
</downloads>
|
</downloads>
|
||||||
<tags>
|
<sha512>99baa8a622da239b2a0b84414836c494e68b5ff2d1eba2030fccc9d929645a45f7a2459ce2261846a10922f4b77bc6e0f26d34adc1afffb62e51fe45e8f44b53</sha512>
|
||||||
<tag>beta</tag>
|
<targetplatform name="joomla" version="((3\.(9|10))|(4\.[01234]))" />
|
||||||
</tags>
|
</update>
|
||||||
<targetplatform name="joomla" version="3.[6789]" />
|
<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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,7 @@
|
||||||
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_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.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.own" title="JACTION_EDITOWN" description="JACTION_EDITOWN_COMPONENT_DESC" />
|
||||||
|
<action name="core.edit.value" title="JACTION_EDITVALUE" description="JACTION_EDITVALUE_COMPONENT_DESC" />
|
||||||
</section>
|
</section>
|
||||||
<section name="category">
|
<section name="category">
|
||||||
<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
|
<action name="core.create" title="JACTION_CREATE" description="COM_CATEGORIES_ACCESS_CREATE_DESC" />
|
||||||
|
@ -17,4 +18,18 @@
|
||||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_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" />
|
<action name="core.edit.own" title="JACTION_EDITOWN" description="COM_CATEGORIES_ACCESS_EDITOWN_DESC" />
|
||||||
</section>
|
</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>
|
</access>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<config>
|
<config>
|
||||||
<fieldset name="component"
|
<fieldset
|
||||||
|
name="component"
|
||||||
label="COM_WEBLINKS_COMPONENT_LABEL"
|
label="COM_WEBLINKS_COMPONENT_LABEL"
|
||||||
description="COM_WEBLINKS_COMPONENT_DESC"
|
description="COM_WEBLINKS_COMPONENT_DESC"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="captcha"
|
name="captcha"
|
||||||
type="plugins"
|
type="plugins"
|
||||||
|
@ -18,11 +18,13 @@
|
||||||
<option value="0">JOPTION_DO_NOT_USE</option>
|
<option value="0">JOPTION_DO_NOT_USE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="target" type="list"
|
<field
|
||||||
|
name="target"
|
||||||
|
type="list"
|
||||||
default="0"
|
default="0"
|
||||||
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
||||||
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
||||||
>
|
>
|
||||||
<option value="0">JBROWSERTARGET_PARENT</option>
|
<option value="0">JBROWSERTARGET_PARENT</option>
|
||||||
<option value="1">JBROWSERTARGET_NEW</option>
|
<option value="1">JBROWSERTARGET_NEW</option>
|
||||||
<option value="2">JBROWSERTARGET_POPUP</option>
|
<option value="2">JBROWSERTARGET_POPUP</option>
|
||||||
|
@ -40,7 +42,7 @@
|
||||||
<option value="1">JYES</option>
|
<option value="1">JYES</option>
|
||||||
<option value="0">JNO</option>
|
<option value="0">JNO</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="history_limit"
|
name="history_limit"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -48,51 +50,81 @@
|
||||||
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
|
||||||
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
|
||||||
default="5"
|
default="5"
|
||||||
|
showon="save_history:1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="count_clicks" type="radio"
|
<field
|
||||||
class="btn-group btn-group-yesno"
|
name="count_clicks"
|
||||||
default="1"
|
type="radio"
|
||||||
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
class="btn-group btn-group-yesno"
|
||||||
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC">
|
default="1"
|
||||||
<option value="1">JYES</option>
|
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
<option value="0">JNO</option>
|
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
||||||
|
>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="icons" type="list"
|
<field
|
||||||
default="1"
|
name="spacer1"
|
||||||
label="COM_WEBLINKS_FIELD_ICON_LABEL"
|
type="spacer"
|
||||||
description="COM_WEBLINKS_FIELD_ICON_DESC"
|
hr="true"
|
||||||
filter="integer">
|
/>
|
||||||
<option value="0">COM_WEBLINKS_FIELD_ICON_OPTION_TEXT</option>
|
|
||||||
<option value="1">COM_WEBLINKS_FIELD_ICON_OPTION_ICON</option>
|
<field
|
||||||
<option value="2">COM_WEBLINKS_FIELD_ICON_OPTION_WEBLINK</option>
|
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>
|
||||||
|
|
||||||
<field name="link_icons" type="media"
|
<field
|
||||||
|
name="link_icons"
|
||||||
|
type="media"
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_ICON_DESC"
|
description="COM_WEBLINKS_FIELD_CONFIG_ICON_DESC"
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL"
|
label="COM_WEBLINKS_FIELD_CONFIG_ICON_LABEL"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer2"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="float_first"
|
name="float_first"
|
||||||
type="list"
|
type="list"
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
description="COM_WEBLINKS_FLOAT_FIRST_DESC"
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
>
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="float_second"
|
name="float_second"
|
||||||
type="list"
|
type="list"
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
description="COM_WEBLINKS_FLOAT_SECOND_DESC"
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
>
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
|
<field
|
||||||
|
name="spacer3"
|
||||||
|
type="spacer"
|
||||||
|
hr="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
id="show_tags"
|
id="show_tags"
|
||||||
name="show_tags"
|
name="show_tags"
|
||||||
|
@ -100,20 +132,21 @@
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
label="COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL"
|
label="COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_SHOW_TAGS_DESC">
|
description="COM_WEBLINKS_FIELD_SHOW_TAGS_DESC"
|
||||||
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset name="category"
|
<fieldset
|
||||||
|
name="category"
|
||||||
label="JCATEGORY"
|
label="JCATEGORY"
|
||||||
description="COM_WEBLINKS_CATEGORY_DESC"
|
description="COM_WEBLINKS_CATEGORY_DESC"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="category_layout" type="componentlayout"
|
name="category_layout"
|
||||||
|
type="componentlayout"
|
||||||
label="JGLOBAL_FIELD_LAYOUT_LABEL"
|
label="JGLOBAL_FIELD_LAYOUT_LABEL"
|
||||||
description="JGLOBAL_FIELD_LAYOUT_DESC"
|
description="JGLOBAL_FIELD_LAYOUT_DESC"
|
||||||
menuitems="true"
|
menuitems="true"
|
||||||
|
@ -121,158 +154,182 @@
|
||||||
view="category"
|
view="category"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="show_category_title" type="radio"
|
<field
|
||||||
class="btn-group btn-group-yesno"
|
name="show_category_title"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
type="radio"
|
||||||
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
||||||
|
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
||||||
|
default="1"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_description"
|
<field
|
||||||
|
name="show_description"
|
||||||
type="radio"
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
||||||
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC">
|
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_description_image"
|
<field
|
||||||
|
name="show_description_image"
|
||||||
type="radio"
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
||||||
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC">
|
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="maxLevel" type="list"
|
<field
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
name="maxLevel"
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
type="list"
|
||||||
default="-1"
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
|
default="-1"
|
||||||
>
|
>
|
||||||
<option value="0">JNONE</option>
|
<option value="0">JNONE</option>
|
||||||
<option value="-1">JALL</option>
|
<option value="-1">JALL</option>
|
||||||
<option value="1">J1</option>
|
<option value="1">J1</option>
|
||||||
<option value="2">J2</option>
|
<option value="2">J2</option>
|
||||||
<option value="3">J3</option>
|
<option value="3">J3</option>
|
||||||
<option value="4">J4</option>
|
<option value="4">J4</option>
|
||||||
<option value="5">J5</option>
|
<option value="5">J5</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_empty_categories" type="radio"
|
<field
|
||||||
class="btn-group btn-group-yesno"
|
name="show_empty_categories"
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
type="radio"
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
|
default="0"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_subcat_desc" type="radio"
|
<field
|
||||||
|
name="show_subcat_desc"
|
||||||
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="radio"
|
<field
|
||||||
|
name="show_cat_num_links"
|
||||||
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_cat_tags" type="radio"
|
<field
|
||||||
|
name="show_cat_tags"
|
||||||
|
type="radio"
|
||||||
label="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL"
|
label="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC"
|
description="COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
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="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</fieldset>
|
<field
|
||||||
|
name="show_subcat_desc_cat"
|
||||||
<fieldset name="categories"
|
type="radio"
|
||||||
label="JCATEGORIES"
|
class="btn-group btn-group-yesno"
|
||||||
description="COM_WEBLINKS_CATEGORIES_DESC"
|
default="1"
|
||||||
>
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
<field name="show_base_description" type="radio"
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
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="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="maxLevelcat" type="list"
|
<field
|
||||||
default="-1"
|
name="show_cat_num_links_cat"
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
type="radio"
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
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">JALL</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="1">J1</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="2">J2</option>
|
</field>
|
||||||
<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>
|
||||||
|
|
||||||
|
<fieldset
|
||||||
<fieldset name="list_layout"
|
name="list_layout"
|
||||||
label="JGLOBAL_LIST_LAYOUT_OPTIONS"
|
label="JGLOBAL_LIST_LAYOUT_OPTIONS"
|
||||||
description="COM_WEBLINKS_LIST_LAYOUT_DESC"
|
description="COM_WEBLINKS_LIST_LAYOUT_DESC"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="filter_field"
|
name="filter_field"
|
||||||
type="list"
|
type="list"
|
||||||
|
@ -280,70 +337,81 @@
|
||||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
description="JGLOBAL_FILTER_FIELD_DESC"
|
||||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
label="JGLOBAL_FILTER_FIELD_LABEL"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="hide">JHIDE</option>
|
<option value="hide">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="show_pagination_limit"
|
name="show_pagination_limit"
|
||||||
type="radio" default="1"
|
type="radio"
|
||||||
|
default="1"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
description="JGLOBAL_DISPLAY_SELECT_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_headings" type="radio"
|
<field
|
||||||
|
name="show_headings"
|
||||||
|
type="radio"
|
||||||
default="1"
|
default="1"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
||||||
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_link_description" type="radio"
|
<field
|
||||||
|
name="show_link_description"
|
||||||
|
type="radio"
|
||||||
default="1"
|
default="1"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_link_hits" type="radio"
|
<field
|
||||||
|
name="show_link_hits"
|
||||||
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
||||||
label="JGLOBAL_HITS"
|
label="JGLOBAL_HITS"
|
||||||
>
|
>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_pagination"
|
<field
|
||||||
|
name="show_pagination"
|
||||||
type="list"
|
type="list"
|
||||||
default="2"
|
default="2"
|
||||||
label="JGLOBAL_PAGINATION_LABEL"
|
label="JGLOBAL_PAGINATION_LABEL"
|
||||||
description="JGLOBAL_PAGINATION_DESC">
|
description="JGLOBAL_PAGINATION_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="2">JGLOBAL_AUTO</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_pagination_results"
|
<field
|
||||||
|
name="show_pagination_results"
|
||||||
type="radio"
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
description="JGLOBAL_PAGINATION_RESULTS_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset
|
<fieldset
|
||||||
|
@ -351,30 +419,44 @@
|
||||||
label="JGLOBAL_INTEGRATION_LABEL"
|
label="JGLOBAL_INTEGRATION_LABEL"
|
||||||
description="COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC"
|
description="COM_WEBLINKS_CONFIG_INTEGRATION_SETTINGS_DESC"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="show_feed_link"
|
name="show_feed_link"
|
||||||
type="radio"
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="1"
|
default="1"
|
||||||
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
||||||
description="JGLOBAL_SHOW_FEED_LINK_DESC">
|
description="JGLOBAL_SHOW_FEED_LINK_DESC"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
</field>
|
</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>
|
||||||
|
|
||||||
<fieldset name="permissions"
|
<fieldset
|
||||||
|
name="permissions"
|
||||||
description="JCONFIG_PERMISSIONS_DESC"
|
description="JCONFIG_PERMISSIONS_DESC"
|
||||||
label="JCONFIG_PERMISSIONS_LABEL"
|
label="JCONFIG_PERMISSIONS_LABEL"
|
||||||
>
|
>
|
||||||
|
<field
|
||||||
<field name="rules" type="rules"
|
name="rules"
|
||||||
|
type="rules"
|
||||||
component="com_weblinks"
|
component="com_weblinks"
|
||||||
filter="rules"
|
filter="rules"
|
||||||
validate="rules"
|
validate="rules"
|
||||||
label="JCONFIG_PERMISSIONS_LABEL"
|
label="JCONFIG_PERMISSIONS_LABEL"
|
||||||
section="component" />
|
section="component"
|
||||||
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</config>
|
</config>
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -38,6 +38,21 @@ class WeblinksHelper extends JHelperContent
|
||||||
'index.php?option=com_categories&extension=com_weblinks',
|
'index.php?option=com_categories&extension=com_weblinks',
|
||||||
$vName == 'categories'
|
$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'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,4 +107,63 @@ class WeblinksHelper extends JHelperContent
|
||||||
|
|
||||||
return $items;
|
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());
|
||||||
|
}
|
||||||
|
}
|
|
@ -90,6 +90,8 @@
|
||||||
<option value="access_level DESC">JGRID_HEADING_ACCESS_DESC</option>
|
<option value="access_level DESC">JGRID_HEADING_ACCESS_DESC</option>
|
||||||
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
|
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
|
||||||
<option value="a.hits DESC">JGLOBAL_HITS_DESC</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 ASC">JGRID_HEADING_LANGUAGE_ASC</option>
|
||||||
<option value="language_title DESC">JGRID_HEADING_LANGUAGE_DESC</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 ASC">JGRID_HEADING_ID_ASC</option>
|
||||||
|
|
|
@ -3,41 +3,42 @@
|
||||||
<fieldset
|
<fieldset
|
||||||
addfieldpath="/administrator/components/com_categories/models/fields"
|
addfieldpath="/administrator/components/com_categories/models/fields"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="id"
|
name="id"
|
||||||
type="text"
|
type="text"
|
||||||
default="0"
|
|
||||||
label="JGLOBAL_FIELD_ID_LABEL"
|
label="JGLOBAL_FIELD_ID_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_ID_DESC"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
class="readonly"
|
class="readonly"
|
||||||
description="JGLOBAL_FIELD_ID_DESC"
|
default="0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="title"
|
name="title"
|
||||||
type="text"
|
type="text"
|
||||||
class="input-xxlarge input-large-text"
|
label="JGLOBAL_TITLE"
|
||||||
size="40" label="JGLOBAL_TITLE"
|
|
||||||
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
||||||
|
class="input-xxlarge input-large-text"
|
||||||
|
size="40"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="alias"
|
name="alias"
|
||||||
type="text"
|
type="text"
|
||||||
size="40"
|
|
||||||
label="JFIELD_ALIAS_LABEL"
|
label="JFIELD_ALIAS_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
||||||
|
size="40"
|
||||||
hint="JFIELD_ALIAS_PLACEHOLDER"
|
hint="JFIELD_ALIAS_PLACEHOLDER"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="catid"
|
name="catid"
|
||||||
type="categoryedit"
|
type="categoryedit"
|
||||||
extension="com_weblinks"
|
|
||||||
label="JCATEGORY"
|
label="JCATEGORY"
|
||||||
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
||||||
|
extension="com_weblinks"
|
||||||
|
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
|
||||||
required="true"
|
required="true"
|
||||||
default=""
|
default=""
|
||||||
/>
|
/>
|
||||||
|
@ -45,29 +46,31 @@
|
||||||
<field
|
<field
|
||||||
name="url"
|
name="url"
|
||||||
type="url"
|
type="url"
|
||||||
|
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_URL_DESC"
|
||||||
class="span12"
|
class="span12"
|
||||||
filter="url"
|
filter="url"
|
||||||
size="40" label="COM_WEBLINKS_FIELD_URL_LABEL"
|
size="40"
|
||||||
description="COM_WEBLINKS_FIELD_URL_DESC"
|
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="description"
|
name="description"
|
||||||
type="editor"
|
type="editor"
|
||||||
|
label="JGLOBAL_DESCRIPTION"
|
||||||
|
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
||||||
buttons="true"
|
buttons="true"
|
||||||
hide="pagebreak,readmore"
|
hide="pagebreak,readmore"
|
||||||
filter="JComponentHelper::filterText"
|
filter="JComponentHelper::filterText"
|
||||||
label="JGLOBAL_DESCRIPTION"
|
|
||||||
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="hits"
|
name="hits"
|
||||||
type="text"
|
type="text"
|
||||||
class="readonly"
|
label="JGLOBAL_HITS"
|
||||||
size="6" label="JGLOBAL_HITS"
|
|
||||||
description="COM_WEBLINKS_HITS_DESC"
|
description="COM_WEBLINKS_HITS_DESC"
|
||||||
|
class="readonly"
|
||||||
|
size="6"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
filter="unset"
|
filter="unset"
|
||||||
/>
|
/>
|
||||||
|
@ -80,7 +83,7 @@
|
||||||
class="chzn-color-state"
|
class="chzn-color-state"
|
||||||
size="1"
|
size="1"
|
||||||
default="1"
|
default="1"
|
||||||
>
|
>
|
||||||
<option value="1">JPUBLISHED</option>
|
<option value="1">JPUBLISHED</option>
|
||||||
<option value="0">JUNPUBLISHED</option>
|
<option value="0">JUNPUBLISHED</option>
|
||||||
<option value="2">JARCHIVED</option>
|
<option value="2">JARCHIVED</option>
|
||||||
|
@ -109,7 +112,7 @@
|
||||||
type="contentlanguage"
|
type="contentlanguage"
|
||||||
label="JFIELD_LANGUAGE_LABEL"
|
label="JFIELD_LANGUAGE_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_LANGUAGE_DESC"
|
description="COM_WEBLINKS_FIELD_LANGUAGE_DESC"
|
||||||
>
|
>
|
||||||
<option value="*">JALL</option>
|
<option value="*">JALL</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
|
@ -152,14 +155,15 @@
|
||||||
type="text"
|
type="text"
|
||||||
label="JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL"
|
label="JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL"
|
||||||
description="JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC"
|
description="JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC"
|
||||||
size="20" />
|
size="20"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="modified"
|
name="modified"
|
||||||
type="calendar"
|
type="calendar"
|
||||||
class="readonly"
|
|
||||||
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
label="JGLOBAL_FIELD_MODIFIED_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_MODIFIED_DESC"
|
description="COM_WEBLINKS_FIELD_MODIFIED_DESC"
|
||||||
|
class="readonly"
|
||||||
size="22"
|
size="22"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
format="%Y-%m-%d %H:%M:%S"
|
format="%Y-%m-%d %H:%M:%S"
|
||||||
|
@ -210,10 +214,10 @@
|
||||||
<field
|
<field
|
||||||
name="version"
|
name="version"
|
||||||
type="text"
|
type="text"
|
||||||
class="readonly"
|
|
||||||
label="COM_WEBLINKS_FIELD_VERSION_LABEL"
|
label="COM_WEBLINKS_FIELD_VERSION_LABEL"
|
||||||
size="6"
|
|
||||||
description="COM_WEBLINKS_FIELD_VERSION_DESC"
|
description="COM_WEBLINKS_FIELD_VERSION_DESC"
|
||||||
|
class="readonly"
|
||||||
|
size="6"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
filter="unset"
|
filter="unset"
|
||||||
/>
|
/>
|
||||||
|
@ -253,15 +257,14 @@
|
||||||
name="jbasic"
|
name="jbasic"
|
||||||
label="COM_WEBLINKS_FIELDSET_OPTIONS"
|
label="COM_WEBLINKS_FIELDSET_OPTIONS"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="target"
|
name="target"
|
||||||
type="list"
|
type="list"
|
||||||
default=""
|
|
||||||
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
label="COM_WEBLINKS_FIELD_TARGET_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
description="COM_WEBLINKS_FIELD_TARGET_DESC"
|
||||||
>
|
default=""
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JBROWSERTARGET_PARENT</option>
|
<option value="0">JBROWSERTARGET_PARENT</option>
|
||||||
<option value="1">JBROWSERTARGET_NEW</option>
|
<option value="1">JBROWSERTARGET_NEW</option>
|
||||||
<option value="2">JBROWSERTARGET_POPUP</option>
|
<option value="2">JBROWSERTARGET_POPUP</option>
|
||||||
|
@ -271,27 +274,27 @@
|
||||||
<field
|
<field
|
||||||
name="width"
|
name="width"
|
||||||
type="text"
|
type="text"
|
||||||
class="validate-numeric"
|
|
||||||
label="COM_WEBLINKS_FIELD_WIDTH_LABEL"
|
label="COM_WEBLINKS_FIELD_WIDTH_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_WIDTH_DESC"
|
description="COM_WEBLINKS_FIELD_WIDTH_DESC"
|
||||||
|
class="validate-numeric"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="height"
|
name="height"
|
||||||
type="text"
|
type="text"
|
||||||
class="validate-numeric"
|
|
||||||
label="COM_WEBLINKS_FIELD_HEIGHT_LABEL"
|
label="COM_WEBLINKS_FIELD_HEIGHT_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_HEIGHT_DESC"
|
description="COM_WEBLINKS_FIELD_HEIGHT_DESC"
|
||||||
|
class="validate-numeric"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="count_clicks"
|
name="count_clicks"
|
||||||
type="list"
|
type="list"
|
||||||
class="chzn-color"
|
|
||||||
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
label="COM_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
description="COM_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
||||||
>
|
class="chzn-color"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JNO</option>
|
<option value="0">JNO</option>
|
||||||
<option value="1">JYES</option>
|
<option value="1">JYES</option>
|
||||||
</field>
|
</field>
|
||||||
|
@ -305,7 +308,6 @@
|
||||||
name="images"
|
name="images"
|
||||||
label="JGLOBAL_FIELDSET_IMAGE_OPTIONS"
|
label="JGLOBAL_FIELDSET_IMAGE_OPTIONS"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="image_first"
|
name="image_first"
|
||||||
type="media"
|
type="media"
|
||||||
|
@ -316,10 +318,10 @@
|
||||||
<field
|
<field
|
||||||
name="float_first"
|
name="float_first"
|
||||||
type="list"
|
type="list"
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
label="COM_WEBLINKS_FLOAT_FIRST_LABEL"
|
||||||
description="COM_WEBLINKS_FLOAT_DESC"
|
description="COM_WEBLINKS_FLOAT_FIRST_DESC"
|
||||||
>
|
useglobal="true"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
|
@ -357,12 +359,13 @@
|
||||||
<field
|
<field
|
||||||
name="float_second"
|
name="float_second"
|
||||||
type="list"
|
type="list"
|
||||||
label="COM_WEBLINKS_FLOAT_LABEL"
|
label="COM_WEBLINKS_FLOAT_SECOND_LABEL"
|
||||||
description="COM_WEBLINKS_FLOAT_DESC">
|
description="COM_WEBLINKS_FLOAT_SECOND_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option value="right">COM_WEBLINKS_RIGHT</option>
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
<option value="left">COM_WEBLINKS_LEFT</option>
|
<option value="right">COM_WEBLINKS_RIGHT</option>
|
||||||
<option value="none">COM_WEBLINKS_NONE</option>
|
<option value="left">COM_WEBLINKS_LEFT</option>
|
||||||
|
<option value="none">COM_WEBLINKS_NONE</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
|
@ -391,13 +394,12 @@
|
||||||
name="jmetadata"
|
name="jmetadata"
|
||||||
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"
|
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"
|
||||||
>
|
>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="robots"
|
name="robots"
|
||||||
type="list"
|
type="list"
|
||||||
label="JFIELD_METADATA_ROBOTS_LABEL"
|
label="JFIELD_METADATA_ROBOTS_LABEL"
|
||||||
description="JFIELD_METADATA_ROBOTS_DESC"
|
description="JFIELD_METADATA_ROBOTS_DESC"
|
||||||
>
|
>
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
|
||||||
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
@ -26,6 +28,14 @@ class WeblinksModelWeblink extends JModelAdmin
|
||||||
*/
|
*/
|
||||||
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.
|
||||||
*
|
*
|
||||||
|
@ -145,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,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;
|
||||||
|
@ -296,7 +330,7 @@ class WeblinksModelWeblink extends JModelAdmin
|
||||||
|
|
||||||
// Cast catid to integer for comparison
|
// Cast catid to integer for comparison
|
||||||
$catid = (int) $data['catid'];
|
$catid = (int) $data['catid'];
|
||||||
|
|
||||||
// Check if New Category exists
|
// Check if New Category exists
|
||||||
if ($catid > 0)
|
if ($catid > 0)
|
||||||
{
|
{
|
||||||
|
@ -376,6 +410,37 @@ class WeblinksModelWeblink extends JModelAdmin
|
||||||
$form->setFieldAttribute('catid', 'allowAdd', 'true');
|
$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);
|
parent::preprocessForm($form, $data, $group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,13 @@ class WeblinksModelWeblinks extends JModelList
|
||||||
'tag',
|
'tag',
|
||||||
'level', 'c.level',
|
'level', 'c.level',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
|
if ($assoc)
|
||||||
|
{
|
||||||
|
$config['filter_fields'][] = 'association';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
|
@ -70,6 +77,22 @@ class WeblinksModelWeblinks extends JModelList
|
||||||
*/
|
*/
|
||||||
protected function populateState($ordering = 'a.title', $direction = 'asc')
|
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.
|
// Load the filter state.
|
||||||
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
|
$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.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
|
||||||
|
@ -83,6 +106,12 @@ class WeblinksModelWeblinks extends JModelList
|
||||||
$params = JComponentHelper::getParams('com_weblinks');
|
$params = JComponentHelper::getParams('com_weblinks');
|
||||||
$this->setState('params', $params);
|
$this->setState('params', $params);
|
||||||
|
|
||||||
|
// Force a language.
|
||||||
|
if (!empty($forcedLanguage))
|
||||||
|
{
|
||||||
|
$this->setState('filter.language', $forcedLanguage);
|
||||||
|
}
|
||||||
|
|
||||||
// List state information.
|
// List state information.
|
||||||
parent::populateState($ordering, $direction);
|
parent::populateState($ordering, $direction);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +161,7 @@ class WeblinksModelWeblinks extends JModelList
|
||||||
$query->select(
|
$query->select(
|
||||||
$this->getState(
|
$this->getState(
|
||||||
'list.select',
|
'list.select',
|
||||||
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid, a.created_by, ' .
|
'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'
|
'a.hits, a.state, a.access, a.ordering, a.language, a.publish_up, a.publish_down'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -155,6 +184,17 @@ class WeblinksModelWeblinks extends JModelList
|
||||||
$query->select('c.title AS category_title')
|
$query->select('c.title AS category_title')
|
||||||
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid'));
|
->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.
|
// Filter by access level.
|
||||||
if ($access = $this->getState('filter.access'))
|
if ($access = $this->getState('filter.access'))
|
||||||
{
|
{
|
||||||
|
|
|
@ -153,7 +153,8 @@ class Com_WeblinksInstallerScript
|
||||||
. $db->quote('com_weblinks.weblink') . ', '
|
. $db->quote('com_weblinks.weblink') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
||||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('') . ', '
|
. $db->quote('') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
||||||
|
@ -161,7 +162,8 @@ class Com_WeblinksInstallerScript
|
||||||
"core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params",
|
"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_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_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc",
|
||||||
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}') . ', '
|
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
||||||
. $db->quote(
|
. $db->quote(
|
||||||
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
||||||
|
@ -170,7 +172,8 @@ class Com_WeblinksInstallerScript
|
||||||
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
||||||
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
||||||
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
||||||
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}')
|
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
@ -189,7 +192,8 @@ class Com_WeblinksInstallerScript
|
||||||
. $db->quote('com_weblinks.category') . ', '
|
. $db->quote('com_weblinks.category') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
||||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('') . ', '
|
. $db->quote('') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
||||||
|
@ -198,7 +202,8 @@ class Com_WeblinksInstallerScript
|
||||||
"core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language",
|
"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_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"},
|
"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"}}') . ', '
|
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}'
|
||||||
|
) . ', '
|
||||||
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
||||||
. $db->quote('
|
. $db->quote('
|
||||||
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
||||||
|
@ -209,7 +214,8 @@ class Com_WeblinksInstallerScript
|
||||||
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
||||||
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
||||||
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
||||||
"displayColumn":"title"}]}')
|
"displayColumn":"title"}]}'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
|
@ -38,8 +38,11 @@ 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'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,9 +94,10 @@ class WeblinksTableWeblink extends JTable
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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'));
|
||||||
|
|
||||||
|
@ -126,6 +130,7 @@ class WeblinksTableWeblink extends JTable
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +141,7 @@ class WeblinksTableWeblink extends JTable
|
||||||
->select($db->quoteName('id'))
|
->select($db->quoteName('id'))
|
||||||
->from($db->quoteName('#__weblinks'))
|
->from($db->quoteName('#__weblinks'))
|
||||||
->where($db->quoteName('title') . ' = ' . $db->quote($this->title))
|
->where($db->quoteName('title') . ' = ' . $db->quote($this->title))
|
||||||
|
->where($db->quoteName('language') . ' = ' . $db->quote($this->language))
|
||||||
->where($db->quoteName('catid') . ' = ' . (int) $this->catid);
|
->where($db->quoteName('catid') . ' = ' . (int) $this->catid);
|
||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
||||||
|
@ -153,7 +159,7 @@ class WeblinksTableWeblink extends JTable
|
||||||
$this->alias = $this->title;
|
$this->alias = $this->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->alias = JApplicationHelper::stringURLSafe($this->alias);
|
$this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);
|
||||||
|
|
||||||
if (trim(str_replace('-', '', $this->alias)) == '')
|
if (trim(str_replace('-', '', $this->alias)) == '')
|
||||||
{
|
{
|
||||||
|
@ -193,6 +199,6 @@ class WeblinksTableWeblink extends JTable
|
||||||
$this->metakey = implode(", ", $clean_keys);
|
$this->metakey = implode(", ", $clean_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return parent::check();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,13 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
JHtml::_('behavior.formvalidator');
|
JHtml::_('behavior.formvalidator');
|
||||||
JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 ));
|
JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 ));
|
||||||
|
|
||||||
// Ignore Image fieldset for the layouts as we render it manually
|
$app = JFactory::getApplication();
|
||||||
$this->ignore_fieldsets = array('images');
|
$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)
|
||||||
|
@ -26,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); ?>
|
||||||
|
|
||||||
|
@ -39,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">
|
||||||
|
@ -52,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>
|
||||||
|
@ -73,11 +83,20 @@ JFactory::getDocument()->addScriptDeclaration("
|
||||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
||||||
|
|
||||||
<?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,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);
|
|
@ -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.metadata', $this);
|
|
@ -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; ?>
|
|
@ -43,6 +43,20 @@ class WeblinksViewWeblink extends JViewLegacy
|
||||||
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);
|
||||||
|
@ -74,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');
|
||||||
|
|
|
@ -15,12 +15,13 @@ JHtml::_('bootstrap.tooltip');
|
||||||
JHtml::_('behavior.multiselect');
|
JHtml::_('behavior.multiselect');
|
||||||
JHtml::_('formbehavior.chosen', 'select');
|
JHtml::_('formbehavior.chosen', 'select');
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$userId = $user->get('id');
|
$userId = $user->get('id');
|
||||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||||
$canOrder = $user->authorise('core.edit.state', 'com_weblinks.category');
|
$canOrder = $user->authorise('core.edit.state', 'com_weblinks.category');
|
||||||
$saveOrder = $listOrder == 'a.ordering';
|
$saveOrder = $listOrder == 'a.ordering';
|
||||||
|
$assoc = JLanguageAssociations::isEnabled();
|
||||||
|
|
||||||
if ($saveOrder)
|
if ($saveOrder)
|
||||||
{
|
{
|
||||||
|
@ -65,6 +66,11 @@ if ($saveOrder)
|
||||||
<th width="5%" class="nowrap center hidden-phone">
|
<th width="5%" class="nowrap center hidden-phone">
|
||||||
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
|
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
|
||||||
</th>
|
</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">
|
<th width="10%" class="nowrap hidden-phone">
|
||||||
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
|
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?>
|
||||||
</th>
|
</th>
|
||||||
|
@ -98,7 +104,7 @@ if ($saveOrder)
|
||||||
<?php $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); ?>
|
<?php $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<span class="sortable-handler<?php echo $iconClass ?>">
|
<span class="sortable-handler<?php echo $iconClass ?>">
|
||||||
<i class="icon-menu"></i>
|
<i class="icon-menu" aria-hidden="true"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php if ($canChange && $saveOrder) : ?>
|
<?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 " />
|
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
|
||||||
|
@ -118,7 +124,7 @@ if ($saveOrder)
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="nowrap has-context">
|
<td class="has-context">
|
||||||
<?php if ($item->checked_out) : ?>
|
<?php if ($item->checked_out) : ?>
|
||||||
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -141,12 +147,15 @@ if ($saveOrder)
|
||||||
<td class="center hidden-phone">
|
<td class="center hidden-phone">
|
||||||
<?php echo $item->hits; ?>
|
<?php echo $item->hits; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="small nowrap hidden-phone">
|
<?php if ($assoc) : ?>
|
||||||
<?php if ($item->language == '*') : ?>
|
<td class="hidden-phone hidden-tablet">
|
||||||
<?php echo JText::alt('JALL', 'language'); ?>
|
<?php if ($item->association) : ?>
|
||||||
<?php else : ?>
|
<?php echo JHtml::_('weblink.association', $item->id); ?>
|
||||||
<?php echo $item->language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
|
<?php endif; ?>
|
||||||
<?php endif;?>
|
</td>
|
||||||
|
<?php endif; ?>
|
||||||
|
<td class="small hidden-phone">
|
||||||
|
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="center hidden-phone">
|
<td class="center hidden-phone">
|
||||||
<?php echo (int) $item->id; ?>
|
<?php echo (int) $item->id; ?>
|
||||||
|
@ -155,11 +164,22 @@ if ($saveOrder)
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php //Load the batch processing form. ?>
|
|
||||||
<?php echo $this->loadTemplate('batch'); ?>
|
|
||||||
|
|
||||||
<input type="hidden" name="task" value="" />
|
<input type="hidden" name="task" value="" />
|
||||||
<input type="hidden" name="boxchecked" value="0" />
|
<input type="hidden" name="boxchecked" value="0" />
|
||||||
<?php echo JHtml::_('form.token'); ?>
|
<?php echo JHtml::_('form.token'); ?>
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
<?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;
|
|
||||||
|
|
||||||
$published = $this->state->get('filter.published');
|
|
||||||
?>
|
|
||||||
<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>
|
|
|
@ -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>
|
|
@ -37,17 +37,44 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
$this->filterForm = $this->get('FilterForm');
|
$this->filterForm = $this->get('FilterForm');
|
||||||
$this->activeFilters = $this->get('ActiveFilters');
|
$this->activeFilters = $this->get('ActiveFilters');
|
||||||
|
|
||||||
WeblinksHelper::addSubmenu('weblinks');
|
// Modal layout doesn't need the submenu.
|
||||||
|
if ($this->getLayout() !== 'modal')
|
||||||
|
{
|
||||||
|
WeblinksHelper::addSubmenu('weblinks');
|
||||||
|
}
|
||||||
|
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addToolbar();
|
// We don't need toolbar in the modal layout.
|
||||||
$this->sidebar = JHtmlSidebar::render();
|
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);
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +94,7 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
// Get the toolbar object instance
|
// Get the toolbar object instance
|
||||||
$bar = JToolBar::getInstance('toolbar');
|
$bar = JToolbar::getInstance('toolbar');
|
||||||
|
|
||||||
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
|
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
|
||||||
|
|
||||||
|
@ -103,7 +130,7 @@ class WeblinksViewWeblinks extends JViewLegacy
|
||||||
if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks')
|
if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks')
|
||||||
&& $user->authorise('core.edit.state', 'com_weblinks'))
|
&& $user->authorise('core.edit.state', 'com_weblinks'))
|
||||||
{
|
{
|
||||||
JHtml::_('bootstrap.modal', 'collapseModal');
|
JHtml::_('bootstrap.renderModal', 'collapseModal');
|
||||||
$title = JText::_('JTOOLBAR_BATCH');
|
$title = JText::_('JTOOLBAR_BATCH');
|
||||||
|
|
||||||
// Instantiate a new JLayoutFile instance and render the batch button
|
// Instantiate a new JLayoutFile instance and render the batch button
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
</schemas>
|
</schemas>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<media folder="media/com_weblinks" destination="com_weblinks">
|
||||||
|
##MEDIA_FILES##
|
||||||
|
</media>
|
||||||
|
|
||||||
<files folder="components/com_weblinks">
|
<files folder="components/com_weblinks">
|
||||||
##FRONTEND_COMPONENT_FILES##
|
##FRONTEND_COMPONENT_FILES##
|
||||||
</files>
|
</files>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ 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_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_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_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_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_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_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Web Links Component will integrate with other extensions."
|
||||||
|
@ -64,9 +65,9 @@ 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_DESC="Select a web links category to display."
|
||||||
COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL="Select a Category"
|
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_DESC="Show the tags for a category."
|
||||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags"
|
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_DESC="Show the tags for a web link."
|
||||||
COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Show Tags"
|
COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Tags"
|
||||||
COM_WEBLINKS_FIELD_STATE_DESC="Set publication status."
|
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_DESC="Target browser window when the link is selected."
|
||||||
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
|
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
|
||||||
|
@ -81,11 +82,14 @@ COM_WEBLINKS_FIELD_WIDTH_LABEL="Width"
|
||||||
COM_WEBLINKS_FIELDSET_IMAGES="Images"
|
COM_WEBLINKS_FIELDSET_IMAGES="Images"
|
||||||
COM_WEBLINKS_FIELDSET_OPTIONS="Options"
|
COM_WEBLINKS_FIELDSET_OPTIONS="Options"
|
||||||
COM_WEBLINKS_FILTER_CATEGORY="Filter Category"
|
COM_WEBLINKS_FILTER_CATEGORY="Filter Category"
|
||||||
COM_WEBLINKS_FILTER_SEARCH_DESC="Search in web link title and alias. Prefix with ID: to search for an web link ID."
|
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_SEARCH_LABEL="Search Web Links"
|
||||||
COM_WEBLINKS_FILTER_STATE="Filter State"
|
COM_WEBLINKS_FILTER_STATE="Filter State"
|
||||||
COM_WEBLINKS_FLOAT_DESC="Controls placement of the image."
|
COM_WEBLINKS_FLOAT_FIRST_DESC="Controls placement of the first image."
|
||||||
COM_WEBLINKS_FLOAT_LABEL="Image Float"
|
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_HITS_DESC="Number of hits for this web link."
|
||||||
COM_WEBLINKS_LEFT="Left"
|
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_LIST_LAYOUT_DESC="These settings apply for Web Links List Layout Options unless they are changed for a specific menu item."
|
||||||
|
@ -116,12 +120,14 @@ COM_WEBLINKS_ORDER_HEADING="Order"
|
||||||
COM_WEBLINKS_RIGHT="Right"
|
COM_WEBLINKS_RIGHT="Right"
|
||||||
COM_WEBLINKS_SAVE_SUCCESS="Web link successfully saved"
|
COM_WEBLINKS_SAVE_SUCCESS="Web link successfully saved"
|
||||||
COM_WEBLINKS_SEARCH_IN_TITLE="Search in title"
|
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_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_CATEGORIES="Categories"
|
||||||
COM_WEBLINKS_SUBMENU_WEBLINKS="Web Links"
|
COM_WEBLINKS_SUBMENU_WEBLINKS="Web Links"
|
||||||
|
COM_WEBLINKS_WEBLINKS="Web Links"
|
||||||
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
|
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management"
|
||||||
JGLOBAL_NO_ITEM_SELECTED="No web links selected"
|
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."
|
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_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_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."
|
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,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
@ -15,9 +15,15 @@ COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_OPTION="Default"
|
||||||
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_TITLE="List Web Links in a Category"
|
COM_WEBLINKS_CATEGORY_VIEW_DEFAULT_TITLE="List Web Links in a Category"
|
||||||
COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link"
|
COM_WEBLINKS_CONTENT_TYPE_WEBLINK="Web Link"
|
||||||
COM_WEBLINKS_CONTENT_TYPE_CATEGORY="Web Links Category"
|
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_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_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."
|
COM_WEBLINKS_XML_DESCRIPTION="Component for web links management."
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<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>
|
||||||
|
|
|
@ -19,8 +19,6 @@ class Pkg_WeblinksInstallerScript extends JInstallerScript
|
||||||
/**
|
/**
|
||||||
* Extension script constructor.
|
* Extension script constructor.
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since __DEPLOY_VERSION__
|
* @since __DEPLOY_VERSION__
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -36,6 +36,23 @@ abstract class WeblinksHelperAssociation extends CategoryHelperAssociation
|
||||||
$view = is_null($view) ? $jinput->get('view') : $view;
|
$view = is_null($view) ? $jinput->get('view') : $view;
|
||||||
$id = empty($id) ? $jinput->getInt('id') : $id;
|
$id = empty($id) ? $jinput->getInt('id') : $id;
|
||||||
|
|
||||||
|
if ($view === 'weblink')
|
||||||
|
{
|
||||||
|
if ($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')
|
||||||
{
|
{
|
||||||
return self::getCategoryAssociations($id, 'com_weblinks');
|
return self::getCategoryAssociations($id, 'com_weblinks');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -92,7 +92,7 @@ class WeblinksModelCategories extends JModelList
|
||||||
*/
|
*/
|
||||||
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();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -186,7 +186,7 @@ class WeblinksModelCategory extends JModelList
|
||||||
$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 grouping by subcategory, add the subcategory list ordering clause.
|
||||||
if ($this->getState('category.group', 0))
|
if ($this->getState('category.group', 0))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -76,4 +76,28 @@ class WeblinksModelForm extends WeblinksModelWeblink
|
||||||
|
|
||||||
$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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<form>
|
<form>
|
||||||
<fieldset addfieldpath="/administrator/components/com_categories/models/fields">
|
<fieldset addfieldpath="/administrator/components/com_categories/models/fields">
|
||||||
<field name="id" type="hidden"
|
<field
|
||||||
|
name="id"
|
||||||
|
type="hidden"
|
||||||
label="WEBLINK_ID_LABEL"
|
label="WEBLINK_ID_LABEL"
|
||||||
readonly="true"
|
readonly="true"
|
||||||
required="true"
|
required="true"
|
||||||
|
@ -14,52 +16,65 @@
|
||||||
name="contenthistory"
|
name="contenthistory"
|
||||||
type="contenthistory"
|
type="contenthistory"
|
||||||
data-typeAlias="com_weblinks.weblink"
|
data-typeAlias="com_weblinks.weblink"
|
||||||
label="JTOOLBAR_VERSIONS" />
|
label="JTOOLBAR_VERSIONS"
|
||||||
|
/>
|
||||||
|
|
||||||
<field name="title" type="text"
|
<field
|
||||||
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
name="title"
|
||||||
|
type="text"
|
||||||
label="JGLOBAL_TITLE"
|
label="JGLOBAL_TITLE"
|
||||||
|
description="COM_WEBLINKS_FIELD_TITLE_DESC"
|
||||||
required="true"
|
required="true"
|
||||||
size="30"
|
size="30"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="alias" type="text"
|
<field
|
||||||
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
name="alias"
|
||||||
|
type="text"
|
||||||
label="JFIELD_ALIAS_LABEL"
|
label="JFIELD_ALIAS_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_ALIAS_DESC"
|
||||||
hint="JFIELD_ALIAS_PLACEHOLDER"
|
hint="JFIELD_ALIAS_PLACEHOLDER"
|
||||||
size="45"
|
size="45"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="description" type="editor"
|
<field
|
||||||
|
name="description"
|
||||||
|
type="editor"
|
||||||
|
label="JGLOBAL_DESCRIPTION"
|
||||||
|
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
||||||
buttons="true"
|
buttons="true"
|
||||||
hide="pagebreak,readmore"
|
hide="pagebreak,readmore"
|
||||||
description="COM_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
|
||||||
filter="safehtml"
|
filter="safehtml"
|
||||||
label="JGLOBAL_DESCRIPTION"
|
|
||||||
asset_id="com_weblinks"
|
asset_id="com_weblinks"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="state" type="list"
|
<field
|
||||||
default="1"
|
name="state"
|
||||||
description="JFIELD_PUBLISHED_DESC"
|
type="list"
|
||||||
label="JSTATUS"
|
label="JSTATUS"
|
||||||
|
description="JFIELD_PUBLISHED_DESC"
|
||||||
|
default="1"
|
||||||
size="1"
|
size="1"
|
||||||
>
|
>
|
||||||
<option value="1">JPUBLISHED</option>
|
<option value="1">JPUBLISHED</option>
|
||||||
<option value="0">JUNPUBLISHED</option>
|
<option value="0">JUNPUBLISHED</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="catid" type="categoryedit"
|
<field
|
||||||
|
name="catid"
|
||||||
|
type="categoryedit"
|
||||||
|
label="JCATEGORY"
|
||||||
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
|
||||||
extension="com_weblinks"
|
extension="com_weblinks"
|
||||||
label="JCATEGORY"
|
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="url" type="url"
|
<field
|
||||||
filter="url"
|
name="url"
|
||||||
description="COM_WEBLINKS_FIELD_URL_DESC"
|
type="url"
|
||||||
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
label="COM_WEBLINKS_FIELD_URL_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_URL_DESC"
|
||||||
|
filter="url"
|
||||||
required="true"
|
required="true"
|
||||||
size="45"
|
size="45"
|
||||||
/>
|
/>
|
||||||
|
@ -69,16 +84,19 @@
|
||||||
type="contentlanguage"
|
type="contentlanguage"
|
||||||
label="JFIELD_LANGUAGE_LABEL"
|
label="JFIELD_LANGUAGE_LABEL"
|
||||||
description="JFIELD_LANGUAGE_DESC"
|
description="JFIELD_LANGUAGE_DESC"
|
||||||
class="inputbox">
|
class="inputbox"
|
||||||
|
>
|
||||||
<option value="*">JALL</option>
|
<option value="*">JALL</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="tags"
|
<field
|
||||||
|
name="tags"
|
||||||
type="tag"
|
type="tag"
|
||||||
label="JTAG"
|
label="JTAG"
|
||||||
description="JTAG_DESC"
|
description="JTAG_DESC"
|
||||||
class="inputbox"
|
class="inputbox"
|
||||||
multiple="true" />
|
multiple="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="version_note"
|
name="version_note"
|
||||||
|
@ -87,7 +105,8 @@
|
||||||
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
|
||||||
class="inputbox"
|
class="inputbox"
|
||||||
size="45"
|
size="45"
|
||||||
labelclass="control-label" />
|
labelclass="control-label"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="captcha"
|
name="captcha"
|
||||||
|
@ -97,53 +116,58 @@
|
||||||
validate="captcha"
|
validate="captcha"
|
||||||
namespace="weblink"
|
namespace="weblink"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fields name="metadata">
|
<fields name="metadata">
|
||||||
<fieldset name="jmetadata"
|
<fieldset
|
||||||
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
|
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="robots"
|
<field
|
||||||
type="hidden"
|
name="author"
|
||||||
filter="unset"
|
type="hidden"
|
||||||
label="JFIELD_METADATA_ROBOTS_LABEL"
|
label="JAUTHOR"
|
||||||
description="JFIELD_METADATA_ROBOTS_DESC"
|
description="JFIELD_METADATA_AUTHOR_DESC"
|
||||||
labelclass="control-label"
|
filter="unset"
|
||||||
>
|
size="20"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
labelclass="control-label"
|
||||||
<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"
|
<field
|
||||||
type="hidden"
|
name="rights"
|
||||||
filter="unset"
|
type="hidden"
|
||||||
label="JAUTHOR"
|
label="JFIELD_META_RIGHTS_LABEL"
|
||||||
description="JFIELD_METADATA_AUTHOR_DESC"
|
description="JFIELD_META_RIGHTS_DESC"
|
||||||
size="20"
|
filter="unset"
|
||||||
labelclass="control-label"
|
required="false"
|
||||||
/>
|
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" />
|
|
||||||
|
|
||||||
|
<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>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
|
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
|
||||||
|
|
||||||
|
@ -38,61 +39,137 @@ class WeblinksModelWeblink extends JModelItem
|
||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication('site');
|
||||||
$params = $app->getParams();
|
|
||||||
|
|
||||||
// Load the object state.
|
// Load the object state.
|
||||||
$id = $app->input->getInt('id');
|
$pk = $app->input->getInt('id');
|
||||||
$this->setState('weblink.id', $id);
|
$this->setState('weblink.id', $pk);
|
||||||
|
|
||||||
// Load the parameters.
|
// Load the parameters.
|
||||||
|
$params = $app->getParams();
|
||||||
$this->setState('params', $params);
|
$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.
|
* Method to get an object.
|
||||||
*
|
*
|
||||||
* @param integer $id The id of the object to get.
|
* @param integer $pk The id of the object to get.
|
||||||
*
|
*
|
||||||
* @return mixed Object on success, false on failure.
|
* @return mixed Object on success, false on failure.
|
||||||
*/
|
*/
|
||||||
public function getItem($id = null)
|
public function getItem($pk = null)
|
||||||
{
|
{
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
$pk = (!empty($pk)) ? $pk : (int) $this->getState('weblink.id');
|
||||||
|
|
||||||
if ($this->_item === null)
|
if ($this->_item === null)
|
||||||
{
|
{
|
||||||
$this->_item = false;
|
$this->_item = array();
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($id))
|
if (!isset($this->_item[$pk]))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
$id = $this->getState('weblink.id');
|
$db = $this->getDbo();
|
||||||
}
|
$query = $db->getQuery(true)
|
||||||
|
->select($this->getState('item.select', 'a.*'))
|
||||||
|
->from('#__weblinks AS a')
|
||||||
|
->where('a.id = ' . (int) $pk);
|
||||||
|
|
||||||
// Get a level row instance.
|
// Join on category table.
|
||||||
$table = JTable::getInstance('Weblink', 'WeblinksTable');
|
$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');
|
||||||
|
|
||||||
// Attempt to load the row.
|
// Join on user table.
|
||||||
if ($table->load($id))
|
$query->select('u.name AS author')
|
||||||
{
|
->join('LEFT', '#__users AS u on u.id = a.created_by');
|
||||||
// Check published state.
|
|
||||||
if ($published = $this->getState('filter.published'))
|
// Filter by language
|
||||||
|
if ($this->getState('filter.language'))
|
||||||
{
|
{
|
||||||
if ($table->state != $published)
|
$query->where('a.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
|
||||||
{
|
|
||||||
return $this->_item;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the JTable to a clean JObject.
|
// Join over the categories to get parent category titles
|
||||||
$properties = $table->getProperties(1);
|
$query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias')
|
||||||
$this->_item = ArrayHelper::toObject($properties, 'JObject');
|
->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;
|
||||||
}
|
}
|
||||||
elseif ($error = $table->getError())
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
$this->setError($error);
|
$this->setError($e);
|
||||||
|
$this->_item[$pk] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_item;
|
return $this->_item[$pk];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,17 +191,17 @@ class WeblinksModelWeblink extends JModelItem
|
||||||
/**
|
/**
|
||||||
* Method to increment the hit counter for the weblink
|
* Method to increment the hit counter for the weblink
|
||||||
*
|
*
|
||||||
* @param integer $id Optional ID of the weblink.
|
* @param integer $pk Optional ID of the weblink.
|
||||||
*
|
*
|
||||||
* @return boolean True on success
|
* @return boolean True on success
|
||||||
*/
|
*/
|
||||||
public function hit($id = null)
|
public function hit($pk = null)
|
||||||
{
|
{
|
||||||
if (empty($id))
|
if (empty($pk))
|
||||||
{
|
{
|
||||||
$id = $this->getState('weblink.id');
|
$pk = $this->getState('weblink.id');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->getTable('Weblink', 'WeblinksTable')->hit($id);
|
return $this->getTable('Weblink', 'WeblinksTable')->hit($pk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -13,10 +13,12 @@
|
||||||
<fields name="request">
|
<fields name="request">
|
||||||
<fieldset name="request"
|
<fieldset name="request"
|
||||||
>
|
>
|
||||||
<field name="id" type="category"
|
<field
|
||||||
|
name="id"
|
||||||
|
type="category"
|
||||||
|
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
|
||||||
description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
|
description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
|
||||||
extension="com_weblinks"
|
extension="com_weblinks"
|
||||||
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
|
|
||||||
show_root="true"
|
show_root="true"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
|
@ -25,138 +27,163 @@
|
||||||
|
|
||||||
<!-- Add fields to the parameters object for the layout. -->
|
<!-- Add fields to the parameters object for the layout. -->
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
|
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
|
||||||
|
<field
|
||||||
<field name="show_base_description" type="list"
|
name="show_base_description"
|
||||||
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
type="list"
|
||||||
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
|
||||||
|
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
|
||||||
|
useglobal="true"
|
||||||
>
|
>
|
||||||
<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="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="list"
|
<field
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
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"
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
>
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
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="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
@ -164,78 +191,90 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
||||||
<field name="spacer2" type="spacer" class="text"
|
<field
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
name="spacer2"
|
||||||
/>
|
type="spacer"
|
||||||
<field
|
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
||||||
name="filter_field"
|
class="text"
|
||||||
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"
|
<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"
|
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
description="JGLOBAL_DISPLAY_SELECT_DESC"
|
||||||
|
useglobal="true"
|
||||||
<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="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="1">JSHOW</option>
|
</field>
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_link_description" type="list"
|
<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>
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
<field
|
||||||
|
name="show_link_description"
|
||||||
|
type="list"
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
||||||
>
|
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
<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="0">JHIDE</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="1">JSHOW</option>
|
</field>
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field name="show_pagination_results" type="list"
|
<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"
|
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
description="JGLOBAL_PAGINATION_RESULTS_DESC"
|
||||||
|
useglobal="true"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -53,6 +53,7 @@ class WeblinksViewCategories extends JViewCategories
|
||||||
if (count($errors = $this->get('Errors')))
|
if (count($errors = $this->get('Errors')))
|
||||||
{
|
{
|
||||||
JError::raiseWarning(500, implode("\n", $errors));
|
JError::raiseWarning(500, implode("\n", $errors));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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,56 +12,68 @@
|
||||||
<!-- Add fields to the request variables for the layout. -->
|
<!-- Add fields to the request variables for the layout. -->
|
||||||
<fields name="request">
|
<fields name="request">
|
||||||
<fieldset name="request">
|
<fieldset name="request">
|
||||||
|
<field
|
||||||
<field name="id" type="category"
|
name="id"
|
||||||
default="0"
|
type="category"
|
||||||
description="COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC"
|
|
||||||
extension="com_weblinks"
|
|
||||||
label="COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL"
|
label="COM_WEBLINKS_FIELD_SELECT_CATEGORY_LABEL"
|
||||||
|
description="COM_WEBLINKS_FIELD_SELECT_CATEGORY_DESC"
|
||||||
|
default="0"
|
||||||
|
extension="com_weblinks"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
|
|
||||||
<!-- Add fields to the parameters object for the layout. -->
|
<!-- Add fields to the parameters object for the layout. -->
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
|
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
|
||||||
<field name="spacer1" type="spacer" class="text"
|
<field
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
name="spacer1"
|
||||||
|
type="spacer"
|
||||||
|
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
||||||
|
class="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="show_category_title" type="list"
|
<field
|
||||||
|
name="show_category_title"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
label="JGLOBAL_SHOW_CATEGORY_TITLE"
|
||||||
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
|
||||||
>
|
useglobal="true"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_description" type="list"
|
<field
|
||||||
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
name="show_description"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
|
||||||
>
|
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_description_image" type="list"
|
<field
|
||||||
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
name="show_description_image"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
|
||||||
>
|
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="maxLevel" type="list"
|
<field
|
||||||
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
name="maxLevel"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
|
||||||
>
|
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JNONE</option>
|
<option value="0">JNONE</option>
|
||||||
<option value="-1">JALL</option>
|
<option value="-1">JALL</option>
|
||||||
<option value="1">J1</option>
|
<option value="1">J1</option>
|
||||||
|
@ -72,124 +84,140 @@
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_empty_categories" type="list"
|
<field
|
||||||
|
name="show_empty_categories"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
|
||||||
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
description="COM_WEBLINKS_SHOW_EMPTY_CATEGORIES_DESC"
|
||||||
>
|
useglobal="true"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_subcat_desc" type="list"
|
<field
|
||||||
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
name="show_subcat_desc"
|
||||||
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
type="list"
|
||||||
>
|
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
|
||||||
<option value="0">JHIDE</option>
|
useglobal="true"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
</field>
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
<field name="show_cat_num_links" type="list"
|
<field
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
name="show_cat_num_links"
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
type="list"
|
||||||
>
|
label="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_LABEL"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
description="COM_WEBLINKS_FIELD_CONFIG_CAT_SHOWNUMBERS_DESC"
|
||||||
<option value="0">JHIDE</option>
|
useglobal="true"
|
||||||
<option value="1">JSHOW</option>
|
>
|
||||||
</field>
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
|
||||||
<field name="spacer2" type="spacer" class="text"
|
<field
|
||||||
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
name="spacer2"
|
||||||
|
type="spacer"
|
||||||
|
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
|
||||||
|
class="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="filter_field"
|
name="filter_field"
|
||||||
type="list"
|
type="list"
|
||||||
default=""
|
|
||||||
description="JGLOBAL_FILTER_FIELD_DESC"
|
|
||||||
label="JGLOBAL_FILTER_FIELD_LABEL"
|
label="JGLOBAL_FILTER_FIELD_LABEL"
|
||||||
>
|
description="JGLOBAL_FILTER_FIELD_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
default=""
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="hide">JHIDE</option>
|
<option value="hide">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_pagination_limit" type="list"
|
<field
|
||||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
name="show_pagination_limit"
|
||||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
type="list"
|
||||||
|
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
description="JGLOBAL_DISPLAY_SELECT_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_headings" type="list"
|
<field
|
||||||
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
name="show_headings"
|
||||||
|
type="list"
|
||||||
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
label="JGLOBAL_SHOW_HEADINGS_LABEL"
|
||||||
>
|
description="JGLOBAL_SHOW_HEADINGS_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_link_description" type="list"
|
<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>
|
||||||
|
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_DESC"
|
<field
|
||||||
label="COM_WEBLINKS_FIELD_CONFIG_LINKDESCRIPTION_LABEL"
|
name="show_link_hits"
|
||||||
>
|
type="list"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
label="JGLOBAL_HITS"
|
||||||
<option value="0">JHIDE</option>
|
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
||||||
<option value="1">JSHOW</option>
|
useglobal="true"
|
||||||
</field>
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
<field name="show_link_hits" type="list"
|
<field
|
||||||
|
name="show_pagination"
|
||||||
description="COM_WEBLINKS_FIELD_CONFIG_HITS_DESC"
|
type="list"
|
||||||
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"
|
label="JGLOBAL_PAGINATION_LABEL"
|
||||||
>
|
description="JGLOBAL_PAGINATION_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
|
>
|
||||||
<option value="0">JHIDE</option>
|
<option value="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
<option value="2">JGLOBAL_AUTO</option>
|
<option value="2">JGLOBAL_AUTO</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="show_pagination_results" type="list"
|
<field
|
||||||
|
name="show_pagination_results"
|
||||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
type="list"
|
||||||
description="JGLOBAL_PAGINATION_RESULTS_DESC">
|
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||||
|
description="JGLOBAL_PAGINATION_RESULTS_DESC"
|
||||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
useglobal="true"
|
||||||
<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="0">JHIDE</option>
|
||||||
<option value="1">JSHOW</option>
|
<option value="1">JSHOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
|
||||||
|
<fieldset name="integration">
|
||||||
|
<field
|
||||||
|
name="show_feed_link"
|
||||||
|
type="list"
|
||||||
|
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
|
||||||
|
description="JGLOBAL_SHOW_FEED_LINK_DESC"
|
||||||
|
useglobal="true"
|
||||||
|
>
|
||||||
|
<option value="0">JHIDE</option>
|
||||||
|
<option value="1">JSHOW</option>
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -33,9 +33,9 @@ if (count($this->children[$this->category->id]) > 0 && $this->maxLevel != 0) :
|
||||||
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_weblinks.category'); ?>
|
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_weblinks.category'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($this->params->get('show_cat_num_links') == 1) :?>
|
<?php if ($this->params->get('show_cat_num_links') == 1) :?>
|
||||||
<dl class="weblink-count"><dt>
|
<dl class="weblink-count"><dt>
|
||||||
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
|
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
|
||||||
<dd><?php echo $child->numitems; ?></dd>
|
<dd><?php echo $child->numitems; ?></dd>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -13,9 +13,6 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
|
||||||
JHtml::_('behavior.framework');
|
JHtml::_('behavior.framework');
|
||||||
|
|
||||||
// Create a shortcut for params.
|
|
||||||
$params = &$this->item->params;
|
|
||||||
|
|
||||||
// Get the user object.
|
// Get the user object.
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
@ -29,143 +26,144 @@ $listOrder = $this->escape($this->state->get('list.ordering'));
|
||||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
$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">
|
<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')) : ?>
|
<?php if ($this->params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) : ?>
|
||||||
<fieldset class="filters btn-toolbar">
|
<fieldset class="filters btn-toolbar">
|
||||||
<?php if ($this->params->get('filter_field') != 'hide') : ?>
|
<?php if ($this->params->get('filter_field') != 'hide') : ?>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<label class="filter-search-lbl element-invisible" for="filter-search"><?php echo JText::_('COM_WEBLINKS_FILTER_LABEL') . ' '; ?></label>
|
<label class="filter-search-lbl element-invisible" for="filter-search"><?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'); ?>" />
|
<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>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($this->params->get('show_pagination_limit')) : ?>
|
<?php if ($this->params->get('show_pagination_limit')) : ?>
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<label for="limit" class="element-invisible">
|
<label for="limit" class="element-invisible">
|
||||||
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
|
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
|
||||||
</label>
|
</label>
|
||||||
<?php echo $this->pagination->getLimitBox(); ?>
|
<?php echo $this->pagination->getLimitBox(); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if (empty($this->items)) : ?>
|
||||||
|
<p><?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
|
||||||
|
<?php else : ?>
|
||||||
<ul class="category list-striped list-condensed">
|
<ul class="category list-striped list-condensed">
|
||||||
<?php foreach ($this->items as $i => $item) : ?>
|
<?php foreach ($this->items as $i => $item) : ?>
|
||||||
<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
|
<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
|
||||||
<?php if ($this->items[$i]->state == 0) : ?>
|
<?php if ($this->items[$i]->state == 0) : ?>
|
||||||
<li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
|
<li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<li class="cat-list-row<?php echo $i % 2; ?>" >
|
<li class="cat-list-row<?php echo $i % 2; ?>">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($this->params->get('show_link_hits', 1)) : ?>
|
<?php if ($this->params->get('show_link_hits', 1)) : ?>
|
||||||
<span class="list-hits badge badge-info pull-right">
|
<span class="list-hits badge badge-info pull-right">
|
||||||
<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
|
<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
|
||||||
</span>
|
</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 endif; ?>
|
|
||||||
<?php // Compute the correct link ?>
|
|
||||||
<?php $menuclass = 'category' . $this->pageclass_sfx; ?>
|
|
||||||
<?php $link = $item->link; ?>
|
|
||||||
<?php $width = $item->params->get('width'); ?>
|
|
||||||
<?php $height = $item->params->get('height'); ?>
|
|
||||||
<?php if ($width == null || $height == null) : ?>
|
|
||||||
<?php $width = 600; ?>
|
|
||||||
<?php $height = 500; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($this->items[$i]->state == 0) : ?>
|
|
||||||
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php
|
<?php if ($canEdit) : ?>
|
||||||
switch ($item->params->get('target', $this->params->get('target')))
|
<span class="list-edit pull-left width-50">
|
||||||
{
|
<?php echo JHtml::_('icon.edit', $item, $item->params); ?>
|
||||||
case 1:
|
</span>
|
||||||
// Open in a new window
|
<?php endif; ?>
|
||||||
echo '<a href="' . $link . '" target="_blank" class="' . $menuclass . '" rel="nofollow">' .
|
|
||||||
$this->escape($item->title) . '</a>';
|
<div class="list-title">
|
||||||
break;
|
<?php if ($this->params->get('icons', 1) == 0) : ?>
|
||||||
|
<?php echo JText::_('COM_WEBLINKS_LINK'); ?>
|
||||||
case 2:
|
<?php elseif ($this->params->get('icons', 1) == 1) : ?>
|
||||||
// Open in a popup window
|
<?php if (!$this->params->get('link_icons')) : ?>
|
||||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
<?php echo JHtml::_('image', 'system/weblink.png', JText::_('COM_WEBLINKS_LINK'), null, true); ?>
|
||||||
echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\">" .
|
<?php else: ?>
|
||||||
$this->escape($item->title) . '</a>';
|
<?php echo '<img src="' . $this->params->get('link_icons') . '" alt="' . JText::_('COM_WEBLINKS_LINK') . '" />'; ?>
|
||||||
break;
|
<?php endif; ?>
|
||||||
case 3:
|
<?php endif; ?>
|
||||||
// Open in a modal window
|
<?php // Compute the correct link ?>
|
||||||
JHtml::_('behavior.modal', 'a.modal');
|
<?php $menuclass = 'category' . $this->pageclass_sfx; ?>
|
||||||
echo '<a class="modal" href="' . $link . '" rel="{handler: \'iframe\', size: {x:' . $this->escape($width) . ', y:' . $this->escape($height) . '}}">' .
|
<?php $link = $item->link; ?>
|
||||||
$this->escape($item->title) . ' </a>';
|
<?php $width = $item->params->get('width', 600); ?>
|
||||||
break;
|
<?php $height = $item->params->get('height', 500); ?>
|
||||||
|
<?php if ($this->items[$i]->state == 0) : ?>
|
||||||
default:
|
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
|
||||||
// Open in parent window
|
<?php endif; ?>
|
||||||
echo '<a href="' . $link . '" class="' . $menuclass . '" rel="nofollow">' .
|
|
||||||
$this->escape($item->title) . ' </a>';
|
<?php
|
||||||
break;
|
switch ($item->params->get('target', $this->params->get('target')))
|
||||||
}
|
{
|
||||||
?>
|
case 1:
|
||||||
</div>
|
// Open in a new window
|
||||||
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
|
echo '<a href="' . $link . '" target="_blank" class="' . $menuclass . '" rel="nofollow">' .
|
||||||
<?php if ($this->params->get('show_tags', 1)) : ?>
|
$this->escape($item->title) . '</a>';
|
||||||
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
break;
|
||||||
<?php echo $this->item->tagLayout->render($tagsData); ?>
|
|
||||||
<?php endif; ?>
|
case 2:
|
||||||
<?php if (($this->params->get('show_link_description')) and ($item->description != '')) : ?>
|
// Open in a popup window
|
||||||
<?php $images = json_decode($item->images); ?>
|
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
||||||
<?php if (isset($images->image_first) and !empty($images->image_first)) : ?>
|
echo '<a href="'. $link .'" onclick="window.open(this.href, \'targetWindow\', \'' . $attribs . '\'); return false;">' .
|
||||||
<?php $imgfloat = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?>
|
$this->escape($item->title) . '</a>';
|
||||||
<div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>"> <img
|
break;
|
||||||
<?php if ($images->image_first_caption) : ?>
|
case 3:
|
||||||
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_first_caption) . '"'; ?>
|
// 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 if ($this->params->get('show_tags', 1) && !empty($item->tags->itemTags)) : ?>
|
||||||
|
<?php echo JLayoutHelper::render('joomla.content.tags', $item->tags->itemTags); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if (($this->params->get('show_link_description')) && ($item->description != '')) : ?>
|
||||||
|
<?php $images = json_decode($item->images); ?>
|
||||||
|
<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
|
||||||
|
<?php $imgfloat = $images->float_first ?: $this->params->get('float_first'); ?>
|
||||||
|
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
|
||||||
|
<img
|
||||||
|
<?php if ($images->image_first_caption) : ?>
|
||||||
|
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_first_caption) . '"'; ?>
|
||||||
|
<?php 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) && !empty($images->image_second)) : ?>
|
||||||
|
<?php $imgfloat = $images->float_second ?: $this->params->get('float_second'); ?>
|
||||||
|
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
|
||||||
|
<img
|
||||||
|
<?php if ($images->image_second_caption) : ?>
|
||||||
|
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
|
||||||
|
<?php 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; ?>
|
<?php 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) : ?>
|
|
||||||
<?php echo 'class="caption" title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
|
|
||||||
<?php 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>
|
</li>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php // Code to add a link to submit a weblink. ?>
|
<?php if ($this->params->get('show_pagination')) : ?>
|
||||||
<?php if ($this->params->get('show_pagination')) : ?>
|
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
|
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
|
||||||
<p class="counter">
|
<p class="counter">
|
||||||
<?php echo $this->pagination->getPagesCounter(); ?>
|
<?php echo $this->pagination->getPagesCounter(); ?>
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php echo $this->pagination->getPagesLinks(); ?>
|
<?php echo $this->pagination->getPagesLinks(); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</form>
|
</form>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -44,7 +44,7 @@ class WeblinksViewCategory extends JViewCategory
|
||||||
|
|
||||||
$temp = new JRegistry;
|
$temp = new JRegistry;
|
||||||
$temp->loadString($item->params);
|
$temp->loadString($item->params);
|
||||||
$item->params = clone($this->params);
|
$item->params = clone $this->params;
|
||||||
$item->params->merge($temp);
|
$item->params->merge($temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class WeblinksViewCategory extends JViewCategory
|
||||||
$path = array(array('title' => $this->category->title, 'link' => ''));
|
$path = array(array('title' => $this->category->title, 'link' => ''));
|
||||||
$category = $this->category->getParent();
|
$category = $this->category->getParent();
|
||||||
|
|
||||||
while (($menu->query['option'] != 'com_weblinks' || $id != $category->id) && $category->id > 1)
|
while ($category !== null && $category->id !== 'root' && ($menu->query['option'] != 'com_weblinks' || $id != $category->id))
|
||||||
{
|
{
|
||||||
$path[] = array('title' => $category->title, 'link' => WeblinksHelperRoute::getCategoryRoute($category->id));
|
$path[] = array('title' => $category->title, 'link' => WeblinksHelperRoute::getCategoryRoute($category->id));
|
||||||
$category = $category->getParent();
|
$category = $category->getParent();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
34
src/components/com_weblinks/views/weblink/tmpl/default.php
Normal file
34
src/components/com_weblinks/views/weblink/tmpl/default.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?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;
|
||||||
|
|
||||||
|
$weblinkUrl = JStringPunycode::urlToUTF8($this->item->url);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="item-page">
|
||||||
|
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
|
||||||
|
<div class="page-header">
|
||||||
|
<h2 itemprop="headline">
|
||||||
|
<?php echo $this->escape($this->item->title); ?>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
|
||||||
|
<?php echo $this->item->event->afterDisplayTitle; ?>
|
||||||
|
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
|
||||||
|
<?php echo $this->item->event->beforeDisplayContent; ?>
|
||||||
|
<div itemprop="articleBody">
|
||||||
|
<a href="<?php echo $weblinkUrl; ?>" target="_blank" itemprop="url">
|
||||||
|
<?php echo $weblinkUrl; ?>
|
||||||
|
</a>
|
||||||
|
<?php echo $this->item->description; ?>
|
||||||
|
</div>
|
||||||
|
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
|
||||||
|
<?php echo $this->item->event->afterDisplayContent; ?>
|
||||||
|
</div>
|
30
src/components/com_weblinks/views/weblink/tmpl/default.xml
Normal file
30
src/components/com_weblinks/views/weblink/tmpl/default.xml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<metadata>
|
||||||
|
<layout title="COM_WEBLINKS_WEBLINK_VIEW_DEFAULT_TITLE" option="COM_WEBLINKS_WEBLINK_VIEW_DEFAULT_OPTION">
|
||||||
|
<help
|
||||||
|
key = "JHELP_MENUS_MENU_ITEM_WEBLINK_SINGLE_WEBLINK"
|
||||||
|
/>
|
||||||
|
<message>
|
||||||
|
<![CDATA[COM_WEBLINKS_WEBLINK_VIEW_DEFAULT_DESC]]>
|
||||||
|
</message>
|
||||||
|
</layout>
|
||||||
|
|
||||||
|
<fields name="request">
|
||||||
|
<fieldset
|
||||||
|
name="request"
|
||||||
|
addfieldpath="/administrator/components/com_weblinks/models/fields"
|
||||||
|
>
|
||||||
|
|
||||||
|
<field name="id"
|
||||||
|
type="modal_weblink"
|
||||||
|
label="COM_WEBLINKS_FIELD_SELECT_WEBLINK_LABEL"
|
||||||
|
required="true"
|
||||||
|
select="true"
|
||||||
|
new="true"
|
||||||
|
edit="true"
|
||||||
|
clear="true"
|
||||||
|
description="COM_WEBLINKS_FIELD_SELECT_WEBLINK_DESC"
|
||||||
|
/>
|
||||||
|
</fieldset>
|
||||||
|
</fields>
|
||||||
|
</metadata>
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
@ -10,44 +10,53 @@
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTML View class for the WebLinks component
|
* HTML Weblink View class for the Weblinks component
|
||||||
*
|
*
|
||||||
* @since 1.5
|
* @since __DEPLOY_VERSION__
|
||||||
*/
|
*/
|
||||||
class WeblinksViewWeblink extends JViewLegacy
|
class WeblinksViewWeblink extends JViewLegacy
|
||||||
{
|
{
|
||||||
protected $state;
|
|
||||||
|
|
||||||
protected $item;
|
protected $item;
|
||||||
|
|
||||||
|
protected $params;
|
||||||
|
|
||||||
|
protected $state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the view.
|
* Execute and display a template script.
|
||||||
*
|
*
|
||||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
* @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.
|
* @return mixed A string if successful, otherwise an Error object.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
*/
|
*/
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
// Get some data from the models
|
$dispatcher = JEventDispatcher::getInstance();
|
||||||
$item = $this->get('Item');
|
|
||||||
|
|
||||||
if ($this->getLayout() == 'edit')
|
$this->item = $this->get('Item');
|
||||||
{
|
$this->state = $this->get('State');
|
||||||
$this->_displayEdit($tpl);
|
$this->params = $this->state->get('params');
|
||||||
|
|
||||||
return;
|
// Create a shortcut for $item.
|
||||||
}
|
$item = $this->item;
|
||||||
|
|
||||||
if ($item->url)
|
$offset = $this->state->get('list.offset');
|
||||||
{
|
|
||||||
// Redirects to url if matching id found
|
$dispatcher->trigger('onContentPrepare', array ('com_weblinks.weblink', &$item, &$item->params, $offset));
|
||||||
JFactory::getApplication()->redirect($item->url);
|
|
||||||
}
|
$item->event = new stdClass;
|
||||||
else
|
|
||||||
{
|
$results = $dispatcher->trigger('onContentAfterTitle', array('com_weblinks.weblink', &$item, &$item->params, $offset));
|
||||||
// @TODO create proper error handling
|
$item->event->afterDisplayTitle = trim(implode("\n", $results));
|
||||||
JFactory::getApplication()->redirect(JRoute::_('index.php'), JText::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 'notice');
|
|
||||||
}
|
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_weblinks.weblink', &$item, &$item->params, $offset));
|
||||||
|
$item->event->beforeDisplayContent = trim(implode("\n", $results));
|
||||||
|
|
||||||
|
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_weblinks.weblink', &$item, &$item->params, $offset));
|
||||||
|
$item->event->afterDisplayContent = trim(implode("\n", $results));
|
||||||
|
|
||||||
|
parent::display($tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @package Joomla.Administrator
|
* @package Joomla.Site
|
||||||
* @subpackage Weblinks
|
* @subpackage com_weblinks
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2005 - 2017 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
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2015 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
|
||||||
|
|
||||||
|
|
61
src/media/com_weblinks/js/admin-weblinks-modal.js
Normal file
61
src/media/com_weblinks/js/admin-weblinks-modal.js
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
/**
|
||||||
|
* Javascript to insert the link
|
||||||
|
* View element calls jSelectWeblink when an weblink is clicked
|
||||||
|
* jSelectWeblink creates the link tag, sends it to the editor,
|
||||||
|
* and closes the select frame.
|
||||||
|
**/
|
||||||
|
window.jSelectWeblink = function (id, title, catid, object, link, lang) {
|
||||||
|
var hreflang = '', editor, tag;
|
||||||
|
|
||||||
|
if (!Joomla.getOptions('xtd-weblinks')) {
|
||||||
|
// Something went wrong!
|
||||||
|
window.parent.jModalClose();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
editor = Joomla.getOptions('xtd-weblinks').editor;
|
||||||
|
|
||||||
|
if (lang !== '')
|
||||||
|
{
|
||||||
|
hreflang = ' hreflang="' + lang + '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
tag = '<a' + hreflang + ' href="' + link + '">' + title + '</a>';
|
||||||
|
|
||||||
|
/** Use the API, if editor supports it **/
|
||||||
|
if (window.Joomla && window.Joomla.editors && Joomla.editors.instances && Joomla.editors.instances.hasOwnProperty(editor)) {
|
||||||
|
Joomla.editors.instances[editor].replaceSelection(tag)
|
||||||
|
} else {
|
||||||
|
window.parent.jInsertEditorText(tag, editor);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.parent.jModalClose();
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function(){
|
||||||
|
// Get the elements
|
||||||
|
var elements = document.querySelectorAll('.select-link');
|
||||||
|
|
||||||
|
for(var i = 0, l = elements.length; l>i; i++) {
|
||||||
|
// Listen for click event
|
||||||
|
elements[i].addEventListener('click', function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var functionName = event.target.getAttribute('data-function');
|
||||||
|
|
||||||
|
if (functionName === 'jSelectWeblink') {
|
||||||
|
// Used in xtd_weblinks
|
||||||
|
window[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null));
|
||||||
|
} else {
|
||||||
|
// Used in com_menus
|
||||||
|
window.parent[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
1
src/media/com_weblinks/js/admin-weblinks-modal.min.js
vendored
Normal file
1
src/media/com_weblinks/js/admin-weblinks-modal.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
!function(){"use strict";window.jSelectWeblink=function(a,b,c,d,e,f){var h,i,g="";if(!Joomla.getOptions("xtd-weblinks"))return window.parent.jModalClose(),!1;h=Joomla.getOptions("xtd-weblinks").editor,""!==f&&(g=' hreflang="'+f+'"'),i="<a"+g+' href="'+e+'">'+b+"</a>",window.Joomla&&window.Joomla.editors&&Joomla.editors.instances&&Joomla.editors.instances.hasOwnProperty(h)?Joomla.editors.instances[h].replaceSelection(i):window.parent.jInsertEditorText(i,h),window.parent.jModalClose()},document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll(".select-link"),b=0,c=a.length;c>b;b++)a[b].addEventListener("click",function(a){a.preventDefault();var b=a.target.getAttribute("data-function");"jSelectWeblink"===b?window[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language",null)):window.parent[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language",null))})})}();
|
|
@ -83,7 +83,7 @@ class ModWeblinksHelper
|
||||||
|
|
||||||
$model->setState(
|
$model->setState(
|
||||||
'list.select',
|
'list.select',
|
||||||
'a.*, c.published AS c_published,' . $case_when1 . ',' . $case_when2 . ',' . 'DATE_FORMAT(a.created, "%Y-%m-%d") AS created'
|
'a.*, c.description AS c_description, c.published AS c_published,' . $case_when1 . ',' . $case_when2
|
||||||
);
|
);
|
||||||
|
|
||||||
$model->setState('filter.c.published', 1);
|
$model->setState('filter.c.published', 1);
|
||||||
|
@ -110,6 +110,6 @@ class ModWeblinksHelper
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<name>mod_weblinks</name>
|
<name>mod_weblinks</name>
|
||||||
<author>Joomla! Project</author>
|
<author>Joomla! Project</author>
|
||||||
<creationDate>##DATE##</creationDate>
|
<creationDate>##DATE##</creationDate>
|
||||||
<copyright>Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved.</copyright>
|
<copyright>Copyright (C) 2005 - 2017 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>
|
||||||
|
@ -11,6 +11,7 @@
|
||||||
<description>MOD_WEBLINKS_XML_DESCRIPTION</description>
|
<description>MOD_WEBLINKS_XML_DESCRIPTION</description>
|
||||||
<files>
|
<files>
|
||||||
##MODULE_FILES##
|
##MODULE_FILES##
|
||||||
|
<file module="mod_weblinks">mod_weblinks.php</file>
|
||||||
</files>
|
</files>
|
||||||
<languages folder="language">
|
<languages folder="language">
|
||||||
##LANGUAGE_FILES##
|
##LANGUAGE_FILES##
|
||||||
|
@ -22,209 +23,195 @@
|
||||||
<field
|
<field
|
||||||
name="catid"
|
name="catid"
|
||||||
type="category"
|
type="category"
|
||||||
|
label="JCATEGORY"
|
||||||
|
description="MOD_WEBLINKS_FIELD_CATEGORY_DESC"
|
||||||
extension="com_weblinks"
|
extension="com_weblinks"
|
||||||
required="true"
|
required="true"
|
||||||
label="JCATEGORY"
|
/>
|
||||||
description="MOD_WEBLINKS_FIELD_CATEGORY_DESC" />
|
|
||||||
<field
|
<field
|
||||||
name="groupby"
|
name="groupby"
|
||||||
type="radio"
|
type="radio"
|
||||||
|
label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL"
|
||||||
|
description="MOD_WEBLINKS_FIELD_GROUPBY_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBY_LABEL"
|
>
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBY_DESC">
|
<option value="1">JYES</option>
|
||||||
<option
|
<option value="0">JNO</option>
|
||||||
value="1">JYES</option>
|
|
||||||
<option
|
|
||||||
value="0">JNO</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_showtitle"
|
name="groupby_showtitle"
|
||||||
type="radio"
|
type="radio"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="1"
|
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC"
|
description="MOD_WEBLINKS_FIELD_GROUPBYSHOWTITLE_DESC"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="1"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
<option
|
<option value="1">JYES</option>
|
||||||
value="1">JYES</option>
|
<option value="0">JNO</option>
|
||||||
<option
|
|
||||||
value="0">JNO</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_ordering"
|
name="groupby_ordering"
|
||||||
type="list"
|
type="list"
|
||||||
default="c.lft"
|
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYORDERING_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC"
|
description="MOD_WEBLINKS_FIELD_GROUPBYORDERING_DESC"
|
||||||
|
default="c.lft"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
<option
|
<option value="c.title">JGLOBAL_TITLE</option>
|
||||||
value="c.title">JGLOBAL_TITLE</option>
|
<option value="c.lft">MOD_WEBLINKS_FIELD_VALUE_ORDER</option>
|
||||||
<option
|
|
||||||
value="c.lft">MOD_WEBLINKS_FIELD_VALUE_ORDER</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_direction"
|
name="groupby_direction"
|
||||||
type="list"
|
type="list"
|
||||||
default="asc"
|
|
||||||
label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL"
|
label="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC"
|
description="MOD_WEBLINKS_FIELD_GROUPBYDIRECTION_DESC"
|
||||||
|
default="asc"
|
||||||
showon="groupby:1"
|
showon="groupby:1"
|
||||||
>
|
>
|
||||||
<option
|
<option value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
||||||
value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
<option value="desc">MOD_WEBLINKS_FIELD_VALUE_DESCENDING</option>
|
||||||
<option
|
|
||||||
value="desc">MOD_WEBLINKS_FIELD_VALUE_DESCENDING</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="groupby_columns"
|
name="groupby_columns"
|
||||||
type="list"
|
type="list"
|
||||||
default="3"
|
|
||||||
label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL"
|
label="MOD_WEBLINKS_FIELD_COLUMNS_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_COLUMNS_DESC">
|
description="MOD_WEBLINKS_FIELD_COLUMNS_DESC"
|
||||||
<option
|
default="3"
|
||||||
value="1">1</option>
|
>
|
||||||
<option
|
<option value="1">J1</option>
|
||||||
value="2">2</option>
|
<option value="2">J2</option>
|
||||||
<option
|
<option value="3">J3</option>
|
||||||
value="3">3</option>
|
<option value="4">J4</option>
|
||||||
<option
|
<option value="6">J6</option>
|
||||||
value="4">4</option>
|
|
||||||
<option
|
|
||||||
value="6">6</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="count"
|
name="count"
|
||||||
type="text"
|
type="text"
|
||||||
default="5"
|
|
||||||
label="MOD_WEBLINKS_FIELD_COUNT_LABEL"
|
label="MOD_WEBLINKS_FIELD_COUNT_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_COUNT_DESC" />
|
description="MOD_WEBLINKS_FIELD_COUNT_DESC"
|
||||||
|
default="5"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="ordering"
|
name="ordering"
|
||||||
type="list"
|
type="list"
|
||||||
default="title"
|
|
||||||
label="MOD_WEBLINKS_FIELD_ORDERING_LABEL"
|
label="MOD_WEBLINKS_FIELD_ORDERING_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_ORDERING_DESC">
|
description="MOD_WEBLINKS_FIELD_ORDERING_DESC"
|
||||||
<option
|
default="title"
|
||||||
value="title">JGLOBAL_TITLE</option>
|
>
|
||||||
<option
|
<option value="title">JGLOBAL_TITLE</option>
|
||||||
value="order">MOD_WEBLINKS_FIELD_VALUE_ORDER</option>
|
<option value="order">MOD_WEBLINKS_FIELD_VALUE_ORDER</option>
|
||||||
<option
|
<option value="hits">MOD_WEBLINKS_FIELD_VALUE_HITS</option>
|
||||||
value="hits">MOD_WEBLINKS_FIELD_VALUE_HITS</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="direction"
|
name="direction"
|
||||||
type="list"
|
type="list"
|
||||||
default="asc"
|
|
||||||
label="MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL"
|
label="MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC">
|
description="MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC"
|
||||||
<option
|
default="asc"
|
||||||
value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
>
|
||||||
<option
|
<option value="asc">MOD_WEBLINKS_FIELD_VALUE_ASCENDING</option>
|
||||||
value="desc">MOD_WEBLINKS_FIELD_VALUE_DESCENDING</option>
|
<option value="desc">MOD_WEBLINKS_FIELD_VALUE_DESCENDING</option>
|
||||||
</field>
|
|
||||||
<field
|
|
||||||
name="target"
|
|
||||||
type="list"
|
|
||||||
default="3"
|
|
||||||
label="MOD_WEBLINKS_FIELD_TARGET_LABEL"
|
|
||||||
description="MOD_WEBLINKS_FIELD_TARGET_DESC">
|
|
||||||
<option
|
|
||||||
value="1">JBROWSERTARGET_NEW</option>
|
|
||||||
<option
|
|
||||||
value="2">JBROWSERTARGET_POPUP</option>
|
|
||||||
<option
|
|
||||||
value="3">JBROWSERTARGET_PARENT</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="follow"
|
name="follow"
|
||||||
type="list"
|
type="list"
|
||||||
default="0"
|
|
||||||
label="MOD_WEBLINKS_FIELD_FOLLOW_LABEL"
|
label="MOD_WEBLINKS_FIELD_FOLLOW_LABEL"
|
||||||
description="MOD_WEBLINKS_FIELD_FOLLOW_DESC">
|
description="MOD_WEBLINKS_FIELD_FOLLOW_DESC"
|
||||||
<option
|
default="0"
|
||||||
value="follow">MOD_WEBLINKS_FIELD_VALUE_FOLLOW</option>
|
>
|
||||||
<option
|
<option value="follow">MOD_WEBLINKS_FIELD_VALUE_FOLLOW</option>
|
||||||
value="nofollow">MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW</option>
|
<option value="nofollow">MOD_WEBLINKS_FIELD_VALUE_NOFOLLOW</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="description"
|
name="description"
|
||||||
type="radio"
|
type="radio"
|
||||||
|
label="MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL"
|
||||||
|
description="MOD_WEBLINKS_FIELD_DESCRIPTION_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
label="MOD_WEBLINKS_FIELD_DESCRIPTION_LABEL"
|
>
|
||||||
description="MOD_WEBLINKS_FIELD_DESCRIPTION_DESC">
|
<option value="1">JSHOW</option>
|
||||||
<option
|
<option value="0">JHIDE</option>
|
||||||
value="1">JSHOW</option>
|
|
||||||
<option
|
|
||||||
value="0">JHIDE</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="hits"
|
name="hits"
|
||||||
type="radio"
|
type="radio"
|
||||||
|
label="MOD_WEBLINKS_FIELD_HITS_LABEL"
|
||||||
|
description="MOD_WEBLINKS_FIELD_HITS_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
label="MOD_WEBLINKS_FIELD_HITS_LABEL"
|
>
|
||||||
description="MOD_WEBLINKS_FIELD_HITS_DESC">
|
<option value="1">JSHOW</option>
|
||||||
<option
|
<option value="0">JHIDE</option>
|
||||||
value="1">JSHOW</option>
|
|
||||||
<option
|
|
||||||
value="0">JHIDE</option>
|
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="count_clicks"
|
name="count_clicks"
|
||||||
type="list"
|
type="list"
|
||||||
|
label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
||||||
|
description="MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC"
|
||||||
class="chzn-color"
|
class="chzn-color"
|
||||||
default="0"
|
default="0"
|
||||||
label="MOD_WEBLINKS_FIELD_COUNTCLICKS_LABEL"
|
>
|
||||||
description="MOD_WEBLINKS_FIELD_COUNTCLICKS_DESC">
|
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||||
<option
|
<option value="0">JNO</option>
|
||||||
value="">JGLOBAL_USE_GLOBAL</option>
|
<option value="1">JYES</option>
|
||||||
<option
|
|
||||||
value="0">JNO</option>
|
|
||||||
<option
|
|
||||||
value="1">JYES</option>
|
|
||||||
</field>
|
</field>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset
|
|
||||||
name="advanced">
|
<fieldset name="advanced">
|
||||||
<field
|
<field
|
||||||
name="layout"
|
name="layout"
|
||||||
type="modulelayout"
|
type="modulelayout"
|
||||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="moduleclass_sfx"
|
name="moduleclass_sfx"
|
||||||
type="textarea" rows="3"
|
type="textarea"
|
||||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
|
||||||
|
rows="3"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="cache"
|
name="cache"
|
||||||
type="list"
|
type="list"
|
||||||
default="1"
|
|
||||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
description="COM_MODULES_FIELD_CACHING_DESC"
|
||||||
<option
|
default="1"
|
||||||
value="1">JGLOBAL_USE_GLOBAL</option>
|
>
|
||||||
<option
|
<option value="1">JGLOBAL_USE_GLOBAL</option>
|
||||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="cache_time"
|
name="cache_time"
|
||||||
type="text"
|
type="text"
|
||||||
default="900"
|
|
||||||
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||||
description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
|
||||||
|
default="900"
|
||||||
|
/>
|
||||||
|
|
||||||
<field
|
<field
|
||||||
name="cachemode"
|
name="cachemode"
|
||||||
type="hidden"
|
type="hidden"
|
||||||
default="static">
|
default="static"
|
||||||
<option
|
/>
|
||||||
value="static"></option>
|
|
||||||
</field>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fields>
|
</fields>
|
||||||
</config>
|
</config>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
; 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
|
||||||
|
|
||||||
|
PLG_EDITORS-XTD_WEBLINK="Button - Web Link"
|
||||||
|
PLG_EDITORS-XTD_WEBLINK_BUTTON_WEBLINK="Web Link"
|
||||||
|
PLG_EDITORS-XTD_WEBLINK_XML_DESCRIPTION="Displays a button to make it possible to insert web links into an Article. Displays a popup allowing you to choose the web link."
|
|
@ -0,0 +1,7 @@
|
||||||
|
; 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
|
||||||
|
|
||||||
|
PLG_EDITORS-XTD_WEBLINK="Button - Web Link"
|
||||||
|
PLG_EDITORS-XTD_WEBLINK_XML_DESCRIPTION="Displays a button to make it possible to insert web links into an Article. Displays a popup allowing you to choose the web link."
|
59
src/plugins/editors-xtd/weblink/weblink.php
Normal file
59
src/plugins/editors-xtd/weblink/weblink.php
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Plugin
|
||||||
|
* @subpackage Editors-xtd.weblink
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Editor Web Link button
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
class PlgButtonWeblink extends JPlugin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Load the language file on instantiation.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $autoloadLanguage = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the button
|
||||||
|
*
|
||||||
|
* @param string $name The name of the button to add
|
||||||
|
*
|
||||||
|
* @return JObject The button options as JObject
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function onDisplay($name)
|
||||||
|
{
|
||||||
|
$user = JFactory::getUser();
|
||||||
|
|
||||||
|
if ($user->authorise('core.create', 'com_weblinks')
|
||||||
|
|| $user->authorise('core.edit', 'com_weblinks')
|
||||||
|
|| $user->authorise('core.edit.own', 'com_weblinks'))
|
||||||
|
{
|
||||||
|
// The URL for the weblinks list
|
||||||
|
$link = 'index.php?option=com_weblinks&view=weblinks&layout=modal&tmpl=component&'
|
||||||
|
. JSession::getFormToken() . '=1&editor=' . $name;
|
||||||
|
|
||||||
|
$button = new JObject;
|
||||||
|
$button->modal = true;
|
||||||
|
$button->class = 'btn';
|
||||||
|
$button->link = $link;
|
||||||
|
$button->text = JText::_('PLG_EDITORS-XTD_WEBLINK_BUTTON_WEBLINK');
|
||||||
|
$button->name = 'link';
|
||||||
|
$button->options = "{handler: 'iframe', size: {x: 800, y: 500}}";
|
||||||
|
|
||||||
|
return $button;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
18
src/plugins/editors-xtd/weblink/weblink.xml
Normal file
18
src/plugins/editors-xtd/weblink/weblink.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension version="3.7" type="plugin" group="editors-xtd" method="upgrade">
|
||||||
|
<name>plg_editors-xtd_weblink</name>
|
||||||
|
<author>Joomla! Project</author>
|
||||||
|
<creationDate>##DATE##</creationDate>
|
||||||
|
<copyright>Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved.</copyright>
|
||||||
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
|
<authorEmail>admin@joomla.org</authorEmail>
|
||||||
|
<authorUrl>www.joomla.org</authorUrl>
|
||||||
|
<version>##VERSION##</version>
|
||||||
|
<description>PLG_EDITORS-XTD_WEBLINK_XML_DESCRIPTION</description>
|
||||||
|
<files>
|
||||||
|
##FILES##
|
||||||
|
</files>
|
||||||
|
<languages folder="language">
|
||||||
|
##LANGUAGE_FILES##
|
||||||
|
</languages>
|
||||||
|
</extension>
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ defined('JPATH_BASE') or die;
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
// Load the base adapter.
|
// Load the base adapter.
|
||||||
require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php';
|
JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smart Search adapter for Joomla Web Links.
|
* Smart Search adapter for Joomla Web Links.
|
||||||
|
@ -139,7 +139,7 @@ class PlgFinderWeblinks extends FinderIndexerAdapter
|
||||||
public function onFinderAfterSave($context, $row, $isNew)
|
public function onFinderAfterSave($context, $row, $isNew)
|
||||||
{
|
{
|
||||||
// We only want to handle web links here. We need to handle front end and back end editing.
|
// We only want to handle web links here. We need to handle front end and back end editing.
|
||||||
if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form' )
|
if ($context == 'com_weblinks.weblink' || $context == 'com_weblinks.form')
|
||||||
{
|
{
|
||||||
// Check if the access levels are different.
|
// Check if the access levels are different.
|
||||||
if (!$isNew && $this->old_access != $row->access)
|
if (!$isNew && $this->old_access != $row->access)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Joomla! Project
|
; Joomla! Project
|
||||||
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
|
@ -175,15 +175,15 @@ class PlgSearchWeblinks extends JPlugin
|
||||||
$case_when1 .= $c_id . ' END as catslug';
|
$case_when1 .= $c_id . ' END as catslug';
|
||||||
|
|
||||||
$query->select('a.title AS title, a.created AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1)
|
$query->select('a.title AS title, a.created AS created, a.url, a.description AS text, ' . $case_when . "," . $case_when1)
|
||||||
->select($query->concatenate(array($db->quote($searchWeblinks), 'c.title'), " / ") . ' AS section')
|
->select($query->concatenate(array($db->quote($searchWeblinks), 'c.title'), " / ") . ' AS section')
|
||||||
->select('\'1\' AS browsernav')
|
->select('\'1\' AS browsernav')
|
||||||
->from('#__weblinks AS a')
|
->from('#__weblinks AS a')
|
||||||
->join('INNER', '#__categories as c ON c.id = a.catid')
|
->join('INNER', '#__categories as c ON c.id = a.catid')
|
||||||
->where('(' . $where . ') AND a.state IN (' . implode(',', $state) . ') AND c.published = 1 AND c.access IN (' . $groups . ')')
|
->where('(' . $where . ') AND a.state IN (' . implode(',', $state) . ') AND c.published = 1 AND c.access IN (' . $groups . ')')
|
||||||
->order($order);
|
->order($order);
|
||||||
|
|
||||||
// Filter by language.
|
// Filter by language.
|
||||||
if (JFactory::getApplication()->isSite() && JLanguageMultilang::isEnabled())
|
if (JFactory::getApplication()->isClient('site') && JLanguageMultilang::isEnabled())
|
||||||
{
|
{
|
||||||
$tag = JFactory::getLanguage()->getTag();
|
$tag = JFactory::getLanguage()->getTag();
|
||||||
$query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')')
|
$query->where('a.language in (' . $db->quote($tag) . ',' . $db->quote('*') . ')')
|
||||||
|
|
|
@ -12,36 +12,41 @@
|
||||||
<files>
|
<files>
|
||||||
##FILES##
|
##FILES##
|
||||||
</files>
|
</files>
|
||||||
<languages folder="administrator/language">
|
<languages folder="language">
|
||||||
##LANGUAGE_FILES##
|
##LANGUAGE_FILES##
|
||||||
</languages>
|
</languages>
|
||||||
<config>
|
<config>
|
||||||
<fields name="params">
|
<fields name="params">
|
||||||
|
|
||||||
<fieldset name="basic">
|
<fieldset name="basic">
|
||||||
<field name="search_limit" type="text"
|
<field
|
||||||
default="50"
|
name="search_limit"
|
||||||
description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
|
type="text"
|
||||||
label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
|
label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL"
|
||||||
|
description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC"
|
||||||
|
default="50"
|
||||||
size="5"
|
size="5"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<field name="search_content" type="radio"
|
<field
|
||||||
|
name="search_content"
|
||||||
|
type="radio"
|
||||||
|
label="JFIELD_PLG_SEARCH_ALL_LABEL"
|
||||||
|
description="JFIELD_PLG_SEARCH_ALL_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
description="JFIELD_PLG_SEARCH_ALL_DESC"
|
>
|
||||||
label="JFIELD_PLG_SEARCH_ALL_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JON</option>
|
<option value="1">JON</option>
|
||||||
<option value="0">JOFF</option>
|
<option value="0">JOFF</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field name="search_archived" type="radio"
|
<field
|
||||||
|
name="search_archived"
|
||||||
|
type="radio"
|
||||||
|
label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL"
|
||||||
|
description="JFIELD_PLG_SEARCH_ARCHIVED_DESC"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
description="JFIELD_PLG_SEARCH_ARCHIVED_DESC"
|
>
|
||||||
label="JFIELD_PLG_SEARCH_ARCHIVED_LABEL"
|
|
||||||
>
|
|
||||||
<option value="1">JON</option>
|
<option value="1">JON</option>
|
||||||
<option value="0">JOFF</option>
|
<option value="0">JOFF</option>
|
||||||
</field>
|
</field>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
; Joomla! Project
|
||||||
|
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
PLG_SYSTEM_WEBLINKS="System - Web Links"
|
||||||
|
PLG_SYSTEM_WEBLINKS_STATISTICS="Web Links"
|
||||||
|
PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION="This plugin returns statistical information about Joomla! Web Links."
|
|
@ -0,0 +1,7 @@
|
||||||
|
; Joomla! Project
|
||||||
|
; Copyright (C) 2005 - 2016 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
|
||||||
|
|
||||||
|
PLG_SYSTEM_WEBLINKS="System - Web Links"
|
||||||
|
PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION="This plugin returns statistical information about Joomla! Web Links."
|
77
src/plugins/system/weblinks/weblinks.php
Normal file
77
src/plugins/system/weblinks/weblinks.php
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
<?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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System plugin for Joomla Web Links.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
class PlgSystemWeblinks extends JPlugin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Load the language file on instantiation.
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
protected $autoloadLanguage = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supported Extensions
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
private $supportedExtensions = array(
|
||||||
|
'mod_stats',
|
||||||
|
'mod_stats_admin',
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to add statistics information to Administrator control panel.
|
||||||
|
*
|
||||||
|
* @param string $extension The extension requesting information.
|
||||||
|
*
|
||||||
|
* @return array containing statistical information.
|
||||||
|
*
|
||||||
|
* @since __DEPLOY_VERSION__
|
||||||
|
*/
|
||||||
|
public function onGetStats($extension)
|
||||||
|
{
|
||||||
|
if (!in_array($extension, $this->supportedExtensions))
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!JComponentHelper::isEnabled('com_weblinks'))
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = JFactory::getDbo();
|
||||||
|
$query = $db->getQuery(true)
|
||||||
|
->select('COUNT(id) AS count_links')
|
||||||
|
->from('#__weblinks')
|
||||||
|
->where('state = 1');
|
||||||
|
$webLinks = $db->setQuery($query)->loadResult();
|
||||||
|
|
||||||
|
if (!$webLinks)
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(array(
|
||||||
|
'title' => JText::_('PLG_SYSTEM_WEBLINKS_STATISTICS'),
|
||||||
|
'icon' => 'out-2',
|
||||||
|
'data' => $webLinks
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
18
src/plugins/system/weblinks/weblinks.xml
Normal file
18
src/plugins/system/weblinks/weblinks.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<extension version="3.7" type="plugin" group="system" method="upgrade">
|
||||||
|
<name>plg_system_weblinks</name>
|
||||||
|
<author>Joomla! Project</author>
|
||||||
|
<creationDate>##DATE##</creationDate>
|
||||||
|
<copyright>(C) 2005 - ##YEAR## Open Source Matters. All rights reserved.</copyright>
|
||||||
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
|
<authorEmail>admin@joomla.org</authorEmail>
|
||||||
|
<authorUrl>www.joomla.org</authorUrl>
|
||||||
|
<version>##VERSION##</version>
|
||||||
|
<description>PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION</description>
|
||||||
|
<files>
|
||||||
|
##FILES##
|
||||||
|
</files>
|
||||||
|
<languages folder="language">
|
||||||
|
##LANGUAGE_FILES##
|
||||||
|
</languages>
|
||||||
|
</extension>
|
|
@ -11,5 +11,5 @@ I am going to "try to archive a weblink category"
|
||||||
I click toolbar button "archive"
|
I click toolbar button "archive"
|
||||||
I wait for element "['id' => 'system-message-container']"," '60"
|
I wait for element "['id' => 'system-message-container']"," '60"
|
||||||
I expect to "see a success message after Archiving the category"
|
I expect to "see a success message after Archiving the category"
|
||||||
I see "1 category successfully archived."," ['id' => 'system-message-container']"
|
I see "1 category archived."," ['id' => 'system-message-container']"
|
||||||
|
|
||||||
|
|
|
@ -13,5 +13,5 @@ I wait for text "Category Manager: Add A New Weblinks Category"," '60"," ['css'
|
||||||
I fill field "['id' => 'jform_title']"," $this->categoryTitle"
|
I fill field "['id' => 'jform_title']"," $this->categoryTitle"
|
||||||
I click toolbar button "Save & Close"
|
I click toolbar button "Save & Close"
|
||||||
I expect to "see a success message after saving the category"
|
I expect to "see a success message after saving the category"
|
||||||
I see "Category successfully saved"," ['id' => 'system-message-container']"
|
I see "Category saved"," ['id' => 'system-message-container']"
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,5 @@ I am going to "try to delete a Weblinks Category"
|
||||||
I click toolbar button "Empty trash"
|
I click toolbar button "Empty trash"
|
||||||
I wait for element "['id' => 'system-message-container']"," '60"
|
I wait for element "['id' => 'system-message-container']"," '60"
|
||||||
I expect to "see a success message after Deleting the category"
|
I expect to "see a success message after Deleting the category"
|
||||||
I see "1 category successfully deleted."," ['id' => 'system-message-container']"
|
I see "1 category deleted."," ['id' => 'system-message-container']"
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,5 @@ I am going to "try to publish a Weblinks Category"
|
||||||
I click toolbar button "publish"
|
I click toolbar button "publish"
|
||||||
I wait for element "['id' => 'system-message-container']"," '60"
|
I wait for element "['id' => 'system-message-container']"," '60"
|
||||||
I expect to "see a success message after publishing the category"
|
I expect to "see a success message after publishing the category"
|
||||||
I see "1 category successfully published."," ['id' => 'system-message-container']"
|
I see "1 category published."," ['id' => 'system-message-container']"
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,5 @@ I am going to "try to delete a Weblinks Category"
|
||||||
I click toolbar button "Trash"
|
I click toolbar button "Trash"
|
||||||
I wait for element "['id' => 'system-message-container']"," '60"
|
I wait for element "['id' => 'system-message-container']"," '60"
|
||||||
I expect to "see a success message after Trashing the category"
|
I expect to "see a success message after Trashing the category"
|
||||||
I see "1 category successfully trashed."," ['id' => 'system-message-container']"
|
I see "1 category trashed."," ['id' => 'system-message-container']"
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user