mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-06-01 05:50:52 +00:00
Compare commits
75 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 | ||
|
ea64e3777c | ||
|
b69a91491f | ||
|
5f8f6cc0cc | ||
|
afa9df617b | ||
|
83c8202374 |
23
.drone.yml
23
.drone.yml
|
@ -18,6 +18,27 @@ steps:
|
|||
- fluxbox > /dev/null 2>&1 &
|
||||
- vendor/bin/robo run:tests
|
||||
|
||||
- name: artifacts-system-tests
|
||||
image: cschlosser/drone-ftps
|
||||
depends_on: [ weblinks-codeception-tests ]
|
||||
environment:
|
||||
FTP_USERNAME:
|
||||
from_secret: ftpusername
|
||||
FTP_PASSWORD:
|
||||
from_secret: ftppassword
|
||||
PLUGIN_HOSTNAME: ci.joomla.org:21
|
||||
PLUGIN_SRC_DIR: /tests/_output/
|
||||
PLUGIN_DEST_DIR: /artifacts
|
||||
PLUGIN_SECURE: false
|
||||
PLUGIN_EXCLUDE: ^\.git/$
|
||||
commands:
|
||||
- export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST_$DRONE_BUILD_NUMBER/system-tests
|
||||
- echo https://ci.joomla.org:444$PLUGIN_DEST_DIR
|
||||
- /bin/upload.sh
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
|
||||
volumes:
|
||||
- name: weblinks_cache
|
||||
host:
|
||||
|
@ -25,6 +46,6 @@ volumes:
|
|||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 41c9d399a788c8e97a0444ee8483682cfcb5b21d920b4012852a48ed3b2e9db8
|
||||
hmac: 9346f0e74d2605ebe7bc9d33ad0588c1073ba3a9d9b254b71a7a85e219089449
|
||||
|
||||
...
|
||||
|
|
18
README.md
18
README.md
|
@ -1,10 +1,12 @@
|
|||
# Weblinks for Joomla! Travis:
|
||||
# Weblinks for Joomla!
|
||||
|
||||
Travis: [![Travis Build Status](https://travis-ci.org/joomla-extensions/weblinks.svg?branch=master)](https://travis-ci.org/joomla-extensions/weblinks)
|
||||
Build Status
|
||||
---------------------
|
||||
| Drone-CI |
|
||||
| ------------- |
|
||||
| [![Build Status](https://ci.joomla.org/api/badges/joomla-extensions/weblinks/status.svg)](https://ci.joomla.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)
|
||||
|
||||
This repo is meant to hold the decoupled com_weblinks component and related code.
|
||||
Weblinks for Joomla! provides a component and accompanying extensions to create a directory of weblinks.
|
||||
|
||||
# How to test a PR
|
||||
|
||||
|
@ -221,7 +223,7 @@ skipClone = false
|
|||
cmsPath = tests/joomla-cms3
|
||||
|
||||
; 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.
|
||||
localUser =
|
||||
|
@ -258,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.
|
||||
|
||||
skipClone = true
|
||||
cmsPath = tests/joomla-cms3
|
||||
cmsPath = tests/joomla
|
||||
|
||||
The currently available options are as follows:
|
||||
|
||||
* `skipClone`: set to `true` to avoid the cms repo being deleted and re-cloned at each test execution. Useful to save time and bandwidth while you're debugging your test environment. But please be aware that if you don't refresh the repo you'll have to manually check the `installation` folder is present and the `configuration.php` is not.
|
||||
* `cmsPath`: set to the local path (absolute or relative) where you'd like the test website to be installed. Default is `tests/joomla-cms3`.
|
||||
* `branch`: set to whatever existing branch from the `joomla-cms` project if you want to clone that specific branch. Default is `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
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ skipClone = false
|
|||
cmsPath = tests/joomla
|
||||
|
||||
; 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.
|
||||
localUser = www-data
|
||||
|
|
|
@ -398,7 +398,7 @@ class RoboFile extends Tasks
|
|||
*/
|
||||
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";
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
{
|
||||
"name" : "joomla-extensions/weblinks",
|
||||
"description": "The Open Source PHP Framework for creating complex Joomla extensions",
|
||||
"license" : "GPL-2.0+",
|
||||
"license" : "GPL-2.0-or-later",
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "5.6.0"
|
||||
}
|
||||
},
|
||||
"require" : {
|
||||
"php": ">=5.4"
|
||||
"php": "^5.3.10|^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"php": ">=5.6",
|
||||
"codeception/codeception": "^3",
|
||||
"phpunit/phpunit": "^5.7.27",
|
||||
"joomla-projects/joomla-browser": "v3.9.0",
|
||||
"joomla-projects/joomla-browser": "^3.9",
|
||||
"consolidation/robo": "^1.0.0",
|
||||
"joomla-projects/joomla-testing-robo": "~1.0",
|
||||
"joomla-projects/selenium-server-standalone": "^v3.1.0",
|
||||
"joomla-projects/selenium-server-standalone": "^3.14",
|
||||
"fzaninotto/faker": "^1.6",
|
||||
"joomla-projects/jorobo": "~0.7",
|
||||
"behat/gherkin": "^4.4.1"
|
||||
|
|
2048
composer.lock
generated
2048
composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
extension = weblinks
|
||||
version = 3.7.0
|
||||
version = 3.9.0
|
||||
source = src
|
||||
target = package
|
||||
|
||||
|
@ -32,7 +32,7 @@ text = "
|
|||
* @package Joomla.Administrator
|
||||
* @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
|
||||
*/
|
||||
"
|
||||
|
|
50
manifest.xml
50
manifest.xml
|
@ -5,12 +5,54 @@
|
|||
<description>Joomla! CMS Weblinks Package</description>
|
||||
<element>pkg_weblinks</element>
|
||||
<type>package</type>
|
||||
<version>3.6.0</version>
|
||||
<version>3.7.0</version>
|
||||
<client>site</client>
|
||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.6.0</infourl>
|
||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.7.0</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/3-6-0/pkg-weblinks-3.6.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>
|
||||
<targetplatform name="joomla" version="3.[6789]" />
|
||||
<targetplatform name="joomla" version="3.[678]" />
|
||||
</update>
|
||||
<update>
|
||||
<name>Weblinks Extension Package</name>
|
||||
<description>Joomla! CMS Weblinks Package</description>
|
||||
<element>pkg_weblinks</element>
|
||||
<type>package</type>
|
||||
<version>3.9.0</version>
|
||||
<client>site</client>
|
||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/3.9.0</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/3-9-0/pkg-weblinks-3.9.0.zip</downloadurl>
|
||||
</downloads>
|
||||
<sha512>99baa8a622da239b2a0b84414836c494e68b5ff2d1eba2030fccc9d929645a45f7a2459ce2261846a10922f4b77bc6e0f26d34adc1afffb62e51fe45e8f44b53</sha512>
|
||||
<targetplatform name="joomla" version="((3\.(9|10))|(4\.[01234]))" />
|
||||
</update>
|
||||
<update>
|
||||
<name>Weblinks Extension Package</name>
|
||||
<description>Joomla! CMS Weblinks Package</description>
|
||||
<element>pkg_weblinks</element>
|
||||
<type>package</type>
|
||||
<version>4.0.1</version>
|
||||
<client>site</client>
|
||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/4.0.1</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/4-0-1/pkg-weblinks-4.0.1.zip</downloadurl>
|
||||
</downloads>
|
||||
<sha512>8e6ac146d9bf907971a25728f4ed6cfad900ab51d1bf33a157f11b42bfcb8b7dfbc6c21c9eeebfe2cf572220db33f73fa29807f3d350220ed4e73b09866dcdad</sha512>
|
||||
<targetplatform name="joomla" version="((4\.[01234])|(5\.0))" />
|
||||
</update>
|
||||
<update>
|
||||
<name>Weblinks Extension Package</name>
|
||||
<description>Joomla! CMS Weblinks Package</description>
|
||||
<element>pkg_weblinks</element>
|
||||
<type>package</type>
|
||||
<version>4.3.1</version>
|
||||
<client>site</client>
|
||||
<infourl title="Weblinks Extension Package">https://github.com/joomla-extensions/weblinks/releases/tag/4.3.1</infourl>
|
||||
<downloads>
|
||||
<downloadurl type="full" format="zip">https://downloads.joomla.org/extensions/weblinks/4-3-1/pkg-weblinks-4.3.1.zip</downloadurl>
|
||||
</downloads>
|
||||
<sha512>cbc02c3a4d915b2a4b69d5b425cb22b93c2dadd72829e1dac8f3cd55c2deb4ab4cb244ca75a956dd335c861daa2a17a769390e7cab90988501c16417afefb72f</sha512>
|
||||
<targetplatform name="joomla" version="((4\.[34])|(5\.[01234]))" />
|
||||
</update>
|
||||
</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"
|
||||
}
|
||||
}
|
|
@ -146,14 +146,17 @@ class WeblinksHelper extends JHelperContent
|
|||
{
|
||||
$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;
|
||||
|
|
|
@ -65,7 +65,8 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +95,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
->from($db->quoteName('#__weblinks'))
|
||||
->where($db->quoteName('id') . ' = ' . (int) $value);
|
||||
$db->setQuery($query);
|
||||
|
||||
try
|
||||
{
|
||||
$title = $db->loadResult();
|
||||
|
@ -103,6 +105,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
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.
|
||||
|
@ -122,6 +125,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
. '<span class="icon-file" aria-hidden="true"></span> ' . JText::_('JSELECT')
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
// New weblink button
|
||||
if ($allowNew)
|
||||
{
|
||||
|
@ -135,6 +139,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
. '<span class="icon-new" aria-hidden="true"></span> ' . JText::_('JACTION_CREATE')
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
// Edit weblink button
|
||||
if ($allowEdit)
|
||||
{
|
||||
|
@ -148,6 +153,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
. '<span class="icon-edit" aria-hidden="true"></span> ' . JText::_('JACTION_EDIT')
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
// Clear weblink button
|
||||
if ($allowClear)
|
||||
{
|
||||
|
@ -159,6 +165,7 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
. '<span class="icon-remove" aria-hidden="true"></span>' . JText::_('JCLEAR')
|
||||
. '</a>';
|
||||
}
|
||||
|
||||
$html .= '</span>';
|
||||
|
||||
// Select weblink modal
|
||||
|
@ -236,10 +243,12 @@ class JFormFieldModal_Weblink extends JFormField
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -155,6 +155,12 @@ class WeblinksModelWeblink extends JModelAdmin
|
|||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,8 @@ class Com_WeblinksInstallerScript
|
|||
. $db->quote('com_weblinks.weblink') . ', '
|
||||
. $db->quote(
|
||||
'{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":"WeblinksTable","config":"array()"},
|
||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||
) . ', '
|
||||
. $db->quote('') . ', '
|
||||
. $db->quote(
|
||||
'{"common":{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias",
|
||||
|
@ -161,7 +162,8 @@ class Com_WeblinksInstallerScript
|
|||
"core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params",
|
||||
"core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"url",
|
||||
"core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc",
|
||||
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}') . ', '
|
||||
"core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}, "special":{}}'
|
||||
) . ', '
|
||||
. $db->quote('WeblinksHelperRoute::getWeblinkRoute') . ', '
|
||||
. $db->quote(
|
||||
'{"formFile":"administrator\\/components\\/com_weblinks\\/models\\/forms\\/weblink.xml",
|
||||
|
@ -170,7 +172,8 @@ class Com_WeblinksInstallerScript
|
|||
"ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},
|
||||
{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},
|
||||
{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},
|
||||
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}')
|
||||
{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"} ]}'
|
||||
)
|
||||
);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
@ -189,7 +192,8 @@ class Com_WeblinksInstallerScript
|
|||
. $db->quote('com_weblinks.category') . ', '
|
||||
. $db->quote('
|
||||
{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},
|
||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}') . ', '
|
||||
"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'
|
||||
) . ', '
|
||||
. $db->quote('') . ', '
|
||||
. $db->quote('
|
||||
{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias",
|
||||
|
@ -198,7 +202,8 @@ class Com_WeblinksInstallerScript
|
|||
"core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language",
|
||||
"core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey",
|
||||
"core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"},
|
||||
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}') . ', '
|
||||
"special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}'
|
||||
) . ', '
|
||||
. $db->quote('WeblinksHelperRoute::getCategoryRoute') . ', '
|
||||
. $db->quote('
|
||||
{"formFile":"administrator\\/components\\/com_categories\\/models\\/forms\\/category.xml",
|
||||
|
@ -209,7 +214,8 @@ class Com_WeblinksInstallerScript
|
|||
"displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id",
|
||||
"displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id",
|
||||
"displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id",
|
||||
"displayColumn":"title"}]}')
|
||||
"displayColumn":"title"}]}'
|
||||
)
|
||||
);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
|
|
@ -130,6 +130,7 @@ class WeblinksTableWeblink extends JTable
|
|||
if (trim($this->title) == '')
|
||||
{
|
||||
$this->setError(JText::_('COM_WEBLINKS_ERR_TABLES_TITLE'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,15 +88,23 @@ class WeblinksViewWeblink extends JViewLegacy
|
|||
JToolbarHelper::apply('weblink.apply');
|
||||
JToolbarHelper::save('weblink.save');
|
||||
}
|
||||
|
||||
if (!$checkedOut && (count($user->getAuthorisedCategories('com_weblinks', 'core.create'))))
|
||||
{
|
||||
JToolbarHelper::save2new('weblink.save2new');
|
||||
}
|
||||
|
||||
// If an existing item, can save to a copy.
|
||||
if (!$isNew && (count($user->getAuthorisedCategories('com_weblinks', 'core.create')) > 0))
|
||||
{
|
||||
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))
|
||||
{
|
||||
JToolbarHelper::cancel('weblink.cancel');
|
||||
|
|
|
@ -124,7 +124,7 @@ if ($saveOrder)
|
|||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="nowrap has-context">
|
||||
<td class="has-context">
|
||||
<?php if ($item->checked_out) : ?>
|
||||
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'weblinks.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -47,6 +47,7 @@ class WeblinksViewWeblinks extends JViewLegacy
|
|||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
JError::raiseError(500, implode("\n", $errors));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,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_LABEL="Select a Category"
|
||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_DESC="Show the tags for a category."
|
||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags"
|
||||
COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Category Tags"
|
||||
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_TARGET_DESC="Target browser window when the link is selected."
|
||||
COM_WEBLINKS_FIELD_TARGET_LABEL="Target"
|
||||
|
|
|
@ -92,7 +92,7 @@ class WeblinksModelCategories extends JModelList
|
|||
*/
|
||||
public function getItems()
|
||||
{
|
||||
if (!count($this->_items))
|
||||
if ($this->_items === null)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
$menu = $app->getMenu();
|
||||
|
|
|
@ -65,7 +65,7 @@ class WeblinksRouter extends JComponentRouterBase
|
|||
}
|
||||
|
||||
// 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['catid']);
|
||||
|
@ -74,7 +74,7 @@ class WeblinksRouter extends JComponentRouterBase
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -53,6 +53,7 @@ class WeblinksViewCategories extends JViewCategories
|
|||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
JError::raiseWarning(500, implode("\n", $errors));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,6 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
|||
|
||||
JHtml::_('behavior.framework');
|
||||
|
||||
// Create a shortcut for params.
|
||||
$params = &$this->item->params;
|
||||
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
|
@ -29,10 +26,6 @@ $listOrder = $this->escape($this->state->get('list.ordering'));
|
|||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
?>
|
||||
|
||||
<?php if (empty($this->items)) : ?>
|
||||
<p> <?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS'); ?></p>
|
||||
<?php else : ?>
|
||||
|
||||
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<?php if ($this->params->get('filter_field') != 'hide' || $this->params->get('show_pagination_limit')) : ?>
|
||||
<fieldset class="filters btn-toolbar">
|
||||
|
@ -53,6 +46,10 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
<?php endif; ?>
|
||||
</fieldset>
|
||||
<?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">
|
||||
<?php foreach ($this->items as $i => $item) : ?>
|
||||
<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
|
||||
|
@ -69,7 +66,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
|
||||
<?php if ($canEdit) : ?>
|
||||
<span class="list-edit pull-left width-50">
|
||||
<?php echo JHtml::_('icon.edit', $item, $params); ?>
|
||||
<?php echo JHtml::_('icon.edit', $item, $item->params); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -86,12 +83,8 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
<?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 $width = $item->params->get('width', 600); ?>
|
||||
<?php $height = $item->params->get('height', 500); ?>
|
||||
<?php if ($this->items[$i]->state == 0) : ?>
|
||||
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
|
||||
<?php endif; ?>
|
||||
|
@ -108,7 +101,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
case 2:
|
||||
// Open in a popup window
|
||||
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' . $this->escape($width) . ',height=' . $this->escape($height) . '';
|
||||
echo "<a href=\"$link\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\">" .
|
||||
echo '<a href="'. $link .'" onclick="window.open(this.href, \'targetWindow\', \'' . $attribs . '\'); return false;">' .
|
||||
$this->escape($item->title) . '</a>';
|
||||
break;
|
||||
case 3:
|
||||
|
@ -126,28 +119,34 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
}
|
||||
?>
|
||||
</div>
|
||||
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
|
||||
<?php if ($this->params->get('show_tags', 1)) : ?>
|
||||
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
||||
<?php echo $this->item->tagLayout->render($tagsData); ?>
|
||||
<?php 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')) and ($item->description != '')) : ?>
|
||||
<?php if (($this->params->get('show_link_description')) && ($item->description != '')) : ?>
|
||||
<?php $images = json_decode($item->images); ?>
|
||||
<?php if (isset($images->image_first) and !empty($images->image_first)) : ?>
|
||||
<?php $imgfloat = (empty($images->float_first)) ? $this->params->get('float_first') : $images->float_first; ?>
|
||||
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image"> <img
|
||||
<?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>
|
||||
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, ENT_COMPAT, 'UTF-8'); ?> item-image"> <img
|
||||
<?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>
|
||||
src="<?php echo htmlspecialchars($images->image_second); ?>"
|
||||
alt="<?php echo htmlspecialchars($images->image_second_alt); ?>"
|
||||
/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $item->description; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -155,8 +154,8 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
<?php endif;?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php // Code to add a link to submit a weblink. ?>
|
||||
<?php if ($this->params->get('show_pagination')) : ?>
|
||||
<div class="pagination">
|
||||
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
|
||||
|
@ -168,4 +167,3 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -44,7 +44,7 @@ class WeblinksViewCategory extends JViewCategory
|
|||
|
||||
$temp = new JRegistry;
|
||||
$temp->loadString($item->params);
|
||||
$item->params = clone($this->params);
|
||||
$item->params = clone $this->params;
|
||||
$item->params->merge($temp);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ class WeblinksViewCategory extends JViewCategory
|
|||
$path = array(array('title' => $this->category->title, 'link' => ''));
|
||||
$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));
|
||||
$category = $category->getParent();
|
||||
|
|
|
@ -83,7 +83,7 @@ class ModWeblinksHelper
|
|||
|
||||
$model->setState(
|
||||
'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);
|
||||
|
@ -110,6 +110,6 @@ class ModWeblinksHelper
|
|||
return $items;
|
||||
}
|
||||
|
||||
return;
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>3.7.0</version>
|
||||
<version>##VERSION##</version>
|
||||
<description>PLG_EDITORS-XTD_WEBLINK_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
##FILES##
|
||||
|
|
Loading…
Reference in New Issue
Block a user