diff --git a/.appveyor.yml b/.appveyor.yml index d5fac65bf107b..7bbd2ee4f0c3d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,13 +33,13 @@ install: $VC = "vc14" $PHPBuild = "x64" } - - cinst -y sqlite + - appveyor-retry cinst -y sqlite - cd C:\tools\php # Get the MSSQL DLL's - ps: >- If ($env:PHP -eq "1") { If ($env:php_ver_target -eq "5.6") { - appveyor-retry appveyor DownloadFile https://files.nette.org/misc/php-sqlsrv.zip + appveyor-retry appveyor DownloadFile https://cdn.joomla.org/ci/php-sqlsrv.zip 7z x -y php-sqlsrv.zip > $null copy SQLSRV\php_sqlsrv_56_nts.dll ext\php_sqlsrv_nts.dll copy SQLSRV\php_pdo_sqlsrv_56_nts.dll ext\php_pdo_sqlsrv_nts.dll diff --git a/.gitignore b/.gitignore index bbfb1deaa049f..fe2b19d07b093 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,16 @@ phpdoc-* # Install from Web plugin # /plugins/installer/webinstaller +# Languages # +administrator/language/* +!administrator/language/en-GB +administrator/manifests/packages/* +!administrator/manifests/packages/pkg_en-GB.xml +!administrator/language/overrides/index.html +language/* +!language/en-GB +!language/overrides/index.html + # OSX # ._* .Spotlight-V100 @@ -95,9 +105,13 @@ Desktop.ini /libraries/vendor/paragonie/random_compat/other /libraries/vendor/paragonie/random_compat/CHANGELOG.md /libraries/vendor/paragonie/random_compat/ERRATA.md +/libraries/vendor/paragonie/random_compat/RATIONALE.md /libraries/vendor/paragonie/random_compat/README.md /libraries/vendor/paragonie/random_compat/SECURITY.md +/libraries/vendor/paragonie/random_compat/build-phar.sh /libraries/vendor/paragonie/random_compat/composer.json +/libraries/vendor/paragonie/random_compat/psalm-autoload.php +/libraries/vendor/paragonie/random_compat/psalm.xml /libraries/vendor/paragonie/random_compat/tests /libraries/vendor/phpmailer/phpmailer/docs /libraries/vendor/phpmailer/phpmailer/examples diff --git a/.travis.yml b/.travis.yml index 8595f2f766792..14dae27f2374f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,10 @@ env: matrix: fast_finish: true include: + - php: 7.0 + env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved + - php: 7.1 + env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved - php: 5.3 env: INSTALL_APC="yes" - php: 5.4 @@ -21,27 +25,6 @@ matrix: env: INSTALL_APCU="yes" - php: 5.6 env: INSTALL_APCU="yes" - - php: 7.0 - env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved - - php: 7.1 - env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved - - php: hhvm - sudo: true - dist: trusty - group: edge # until the next update - addons: - apt: - packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - services: - - mysql - - postgresql - - redis-server - env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" # Disabled items that currently do not work in travis-ci hhvm - allow_failures: - - php: hhvm services: - memcache diff --git a/README.md b/README.md index 00e0c5964b458..2b631d9f72d89 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ What is this? --------------------- * This is a Joomla! 3.x installation/upgrade package. * Joomla's [Official website](https://www.joomla.org). -* Joomla! 3.7 [version history](https://docs.joomla.org/Joomla_3.7_version_history). +* Joomla! 3.7 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_3.7_version_history). * Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/master). What is Joomla? @@ -26,20 +26,20 @@ What is Joomla? Is Joomla! for you? --------------------- -* Joomla! is [the right solution for most content web projects](https://docs.joomla.org/Portal:Learn_More). +* Joomla! is [the right solution for most content web projects](https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More). * View Joomla's [core features here](https://www.joomla.org/core-features.html). * Try it out for yourself in our [online demo](https://demo.joomla.org). How to find a Joomla! translation? --------------------- * Repository of [accredited language packs](https://community.joomla.org/translations.html). -* You can also [add languages](https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Installing_New_Language) directly to your website via your Joomla! administration panel. -* Learn how to [setup a Multilingual Joomla! Site](https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site) +* You can also [add languages](https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site/Installing_New_Language) directly to your website via your Joomla! administration panel. +* Learn how to [setup a Multilingual Joomla! Site](https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site) Learn Joomla! --------------------- -* Read ['Getting Started with Joomla!'](https://docs.joomla.org/J3.x:Getting_Started_with_Joomla!) to learn the basics. -* Before installing, read the ['Beginners' Guide'](https://docs.joomla.org/Portal:Beginners). +* Read ['Getting Started with Joomla!'](https://docs.joomla.org/Special:MyLanguage/J3.x:Getting_Started_with_Joomla!) to learn the basics. +* Before installing, read the ['Beginners' Guide'](https://docs.joomla.org/Special:MyLanguage/Portal:Beginners). What are the benefits of Joomla? --------------------- @@ -51,13 +51,13 @@ Is it easy to change the layout display? --------------------- * The layout is controlled by templates that you can edit. * There are a lot of ready-made professional templates that you can download. -* Template management information is [available here](https://docs.joomla.org/Portal:Template_Management). +* Template management information is [available here](https://docs.joomla.org/Special:MyLanguage/Portal:Template_Management). Ready to install Joomla? --------------------- * Check the [minimum requirements](https://downloads.joomla.org/technical-requirements). -* How do you [install Joomla](https://docs.joomla.org/J3.x:Installing_Joomla)? -* You could start your Joomla! experience by [building your site on a local test server](https://docs.joomla.org/Installing_Joomla_locally). +* How do you [install Joomla](https://docs.joomla.org/Special:MyLanguage/J3.x:Installing_Joomla)? +* You could start your Joomla! experience by [building your site on a local test server](https://docs.joomla.org/Special:MyLanguage/Installing_Joomla_locally). When ready, it can be moved to an online hosting account of your choice. Updates are free! @@ -66,9 +66,9 @@ Updates are free! Where can you get support and help? --------------------- -* [The Joomla! Documentation](https://docs.joomla.org/Main_Page); -* [Frequently Asked Questions](https://docs.joomla.org/Category:FAQ) (FAQ); -* Find the [information you need](https://docs.joomla.org/Start_here); +* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page); +* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ); +* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here); * Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html); * Post questions at [our forums](https://forum.joomla.org); * [Joomla Resources Directory](https://resources.joomla.org/) (JRD). @@ -76,21 +76,21 @@ Where can you get support and help? Do you already have a Joomla! site that isn't built with Joomla! 3.x? --------------------- * What's [new in Joomla! 3.x](https://www.joomla.org/3)? -* What are the [main differences between 2.5 and 3.x](https://docs.joomla.org/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F)? -* How to [migrate from 2.5.x to 3.x](https://docs.joomla.org/Joomla_2.5_to_3.x_Step_by_Step_Migration). -* How to [migrate from 1.5.x to 3.x](https://docs.joomla.org/Joomla_1.5_to_3.x_Step_by_Step_Migration). +* What are the [main differences between 2.5 and 3.x](https://docs.joomla.org/Special:MyLanguage/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F)? +* How to [migrate from 2.5.x to 3.x](https://docs.joomla.org/Special:MyLanguage/Joomla_2.5_to_3.x_Step_by_Step_Migration). +* How to [migrate from 1.5.x to 3.x](https://docs.joomla.org/Special:MyLanguage/Joomla_1.5_to_3.x_Step_by_Step_Migration). Do you want to improve Joomla? -------------------- * Where to [request a feature](https://issues.joomla.org/)? -* How do you [report a bug](https://docs.joomla.org/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org/)? +* How do you [report a bug](https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues) on the [Issue Tracker](https://issues.joomla.org/)? * Get Involved: Joomla! is community developed software. [Join the community](https://volunteers.joomla.org/). -* Documentation for [Developers](https://docs.joomla.org/Portal:Developers). -* Documentation for [Web designers](https://docs.joomla.org/Web_designers). +* Documentation for [Developers](https://docs.joomla.org/Special:MyLanguage/Portal:Developers). +* Documentation for [Web designers](https://docs.joomla.org/Special:MyLanguage/Web_designers). Copyright --------------------- * Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. -* [Special Thanks](https://docs.joomla.org/Joomla!_Credits_and_Thanks) +* [Special Thanks](https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks) * Distributed under the GNU General Public License version 2 or later -* See [License details](https://docs.joomla.org/Joomla_Licenses) +* See [License details](https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses) diff --git a/README.txt b/README.txt index 9881b46597896..a9c9c1789e1cf 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ 1- What is this? * This is a Joomla! installation/upgrade package to version 3.x * Joomla! Official site: https://www.joomla.org - * Joomla! 3.7 version history - https://docs.joomla.org/Joomla_3.7_version_history + * Joomla! 3.7 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_3.7_version_history * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master 2- What is Joomla? @@ -11,18 +11,18 @@ You can find full technical requirements here: https://downloads.joomla.org/technical-requirements. 3- Is Joomla! for you? - * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Portal:Learn_More + * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More * See Joomla's core features - https://www.joomla.org/core-features.html * Try out our online demo: https://demo.joomla.org/ 4- How to find a Joomla! translation? * Repository of accredited language packs: https://community.joomla.org/translations.html - * You can also add languages directly to your website via your Joomla! administration panel: https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site/Installing_New_Language - * Learn how to setup a Multilingual Joomla! Site: https://docs.joomla.org/J3.x:Setup_a_Multilingual_Site + * You can also add languages directly to your website via your Joomla! administration panel: https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site/Installing_New_Language + * Learn how to setup a Multilingual Joomla! Site: https://docs.joomla.org/Special:MyLanguage/J3.x:Setup_a_Multilingual_Site 5- Learn Joomla! - * Read Getting Started with Joomla to find out the basics: https://docs.joomla.org/J3.x:Getting_Started_with_Joomla! - * Before installing, read the beginners guide: https://docs.joomla.org/Portal:Beginners + * Read Getting Started with Joomla to find out the basics: https://docs.joomla.org/Special:MyLanguage/J3.x:Getting_Started_with_Joomla! + * Before installing, read the beginners guide: https://docs.joomla.org/Special:MyLanguage/Portal:Beginners 6- What are the benefits of Joomla? * The functionality of a Joomla! website can be extended by installing extensions that you can create (or download) to suit your needs. @@ -32,41 +32,41 @@ 7- Is it easy to change the layout display? * The layout is controlled by templates that you can edit. * There are a lot of ready-made professional templates that you can download. - * Check out the template management information: https://docs.joomla.org/Portal:Template_Management + * Check out the template management information: https://docs.joomla.org/Special:MyLanguage/Portal:Template_Management 8- Ready to install Joomla? * Check the minimum requirements here: https://downloads.joomla.org/technical-requirements - * How do you install Joomla - https://docs.joomla.org/J3.x:Installing_Joomla + * How do you install Joomla - https://docs.joomla.org/Special:MyLanguage/J3.x:Installing_Joomla * You could start your Joomla! experience building your site on a local test server. When ready it can be moved to an online hosting account of your choice. - See the tutorial: https://docs.joomla.org/Installing_Joomla_locally + See the tutorial: https://docs.joomla.org/Special:MyLanguage/Installing_Joomla_locally 9- Updates are free! * Always use the latest version: https://downloads.joomla.org/latest 10- Where can you get support and help? - * The Joomla! Documentation: https://docs.joomla.org/Main_Page - * FAQ Frequently Asked Questions: https://docs.joomla.org/Category:FAQ - * Find the information you need: https://docs.joomla.org/Start_here + * The Joomla! Documentation: https://docs.joomla.org/Special:MyLanguage/Main_Page + * FAQ Frequently Asked Questions: https://docs.joomla.org/Special:MyLanguage/Category:FAQ + * Find the information you need: https://docs.joomla.org/Special:MyLanguage/Start_here * Find help and other users: https://www.joomla.org/about-joomla/create-and-share.html * Post questions at our forums: https://forum.joomla.org * Joomla! Resources Directory (JRD): https://resources.joomla.org/ 11- Do you already have a Joomla! site that's not built with Joomla! 3.x ? * What's new in Joomla! 3.x: https://www.joomla.org/3 - * What are the main differences from 2.5 to 3? https://docs.joomla.org/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F - * How to migrate from 2.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_2.5_to_3.x_Step_by_Step_Migration - * How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Joomla_1.5_to_3.x_Step_by_Step_Migration + * What are the main differences from 2.5 to 3? https://docs.joomla.org/Special:MyLanguage/What_are_the_major_differences_between_Joomla!_2.5_and_3.x%3F + * How to migrate from 2.5.x to 3.x? Tutorial: https://docs.joomla.org/Special:MyLanguage/Joomla_2.5_to_3.x_Step_by_Step_Migration + * How to migrate from 1.5.x to 3.x? Tutorial: https://docs.joomla.org/Special:MyLanguage/Joomla_1.5_to_3.x_Step_by_Step_Migration 12- Do you want to improve Joomla? * Where to request a feature? https://issues.joomla.org/ - * How do you report a bug? https://docs.joomla.org/Filing_bugs_and_issues + * How do you report a bug? https://docs.joomla.org/Special:MyLanguage/Filing_bugs_and_issues * Get Involved: Joomla! is a community developed software. Join the community at https://volunteers.joomla.org/ - * Documentation for Developers: https://docs.joomla.org/Portal:Developers - * Documentation for Web designers: https://docs.joomla.org/Web_designers + * Documentation for Developers: https://docs.joomla.org/Special:MyLanguage/Portal:Developers + * Documentation for Web designers: https://docs.joomla.org/Special:MyLanguage/Web_designers Copyright: * Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. - * Special Thanks: https://docs.joomla.org/Joomla!_Credits_and_Thanks + * Special Thanks: https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks * Distributed under the GNU General Public License version 2 or later - * See Licenses details at https://docs.joomla.org/Joomla_Licenses + * See Licenses details at https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses diff --git a/administrator/components/com_admin/models/forms/profile.xml b/administrator/components/com_admin/models/forms/profile.xml index ca772b2e257fb..f665004d4fbe7 100644 --- a/administrator/components/com_admin/models/forms/profile.xml +++ b/administrator/components/com_admin/models/forms/profile.xml @@ -1,46 +1,56 @@
- - - - - + />
@@ -90,48 +100,61 @@
- + description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC" + client="administrator" + > - + description="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_DESC" + client="administrator" + > - + description="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_DESC" + client="site" + > - + description="COM_ADMIN_USER_FIELD_EDITOR_DESC" + folder="editors" + > - + > - + >
diff --git a/administrator/components/com_admin/models/sysinfo.php b/administrator/components/com_admin/models/sysinfo.php index c8d8850f46558..b2c9ea6ed1abf 100644 --- a/administrator/components/com_admin/models/sysinfo.php +++ b/administrator/components/com_admin/models/sysinfo.php @@ -482,18 +482,13 @@ public function getExtensions() 'authorUrl' => 'unknown', ); - $manifest = json_decode($extension->manifest_cache); - - if (!$manifest instanceof stdClass) - { - continue; - } + $manifest = new Registry($extension->manifest_cache); $extraData = array( - 'author' => $manifest->author, - 'version' => $manifest->version, - 'creationDate' => $manifest->creationDate, - 'authorUrl' => $manifest->authorUrl, + 'author' => $manifest->get('author', ''), + 'version' => $manifest->get('version', ''), + 'creationDate' => $manifest->get('creationDate', ''), + 'authorUrl' => $manifest->get('authorUrl', '') ); $installed[$extension->name] = array_merge($installed[$extension->name], $extraData); diff --git a/administrator/components/com_admin/postinstall/joomla40checks.php b/administrator/components/com_admin/postinstall/joomla40checks.php index 7f921fa3629e7..c55571c29015e 100644 --- a/administrator/components/com_admin/postinstall/joomla40checks.php +++ b/administrator/components/com_admin/postinstall/joomla40checks.php @@ -18,7 +18,7 @@ * * @since 3.7 * - * @see https://developer.joomla.org/news/658-joomla4-manifesto.html + * @link https://developer.joomla.org/news/658-joomla4-manifesto.html */ function admin_postinstall_joomla40checks_condition() { diff --git a/administrator/components/com_admin/postinstall/languageaccess340.php b/administrator/components/com_admin/postinstall/languageaccess340.php index 86186a95d355d..d55964eb122dd 100644 --- a/administrator/components/com_admin/postinstall/languageaccess340.php +++ b/administrator/components/com_admin/postinstall/languageaccess340.php @@ -15,8 +15,8 @@ /** * Checks if the installation is affected by the issue with content languages access in 3.4.0 * - * @see https://github.com/joomla/joomla-cms/pull/6172 - * @see https://github.com/joomla/joomla-cms/pull/6194 + * @link https://github.com/joomla/joomla-cms/pull/6172 + * @link https://github.com/joomla/joomla-cms/pull/6194 * * @return boolean * diff --git a/administrator/components/com_admin/postinstall/phpversion.php b/administrator/components/com_admin/postinstall/phpversion.php deleted file mode 100644 index 7e1a4aec28533..0000000000000 --- a/administrator/components/com_admin/postinstall/phpversion.php +++ /dev/null @@ -1,24 +0,0 @@ - 0 THEN MAX(p.published) ELSE MIN(p.published) END AS newPublished FROM `#__categories` AS `c2` @@ -6,6 +7,7 @@ UPDATE `#__categories` AS `c` INNER JOIN ( ON c.id = c2.id SET published = c2.newPublished; +UPDATE `#__menu` SET `published` = 1 WHERE `alias` = 'root'; UPDATE `#__menu` AS `c` INNER JOIN ( SELECT c2.id, CASE WHEN MIN(p.published) > 0 THEN MAX(p.published) ELSE MIN(p.published) END AS newPublished FROM `#__menu` AS `c2` diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..35327661646c8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-04-19.sql @@ -0,0 +1,3 @@ +-- Set integer field default values. +UPDATE `#__extensions` SET `params` = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE `name` = 'plg_fields_integer'; + diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.3-2017-06-03.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.3-2017-06-03.sql new file mode 100644 index 0000000000000..eac66fa67b28e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.3-2017-06-03.sql @@ -0,0 +1 @@ +ALTER TABLE `#__menu` MODIFY `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'The time the menu item was checked out.'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql index 1515c80895030..1676d972db1fa 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql @@ -66,12 +66,12 @@ CREATE TABLE "#__fields_groups" ( "access" bigint DEFAULT 0 NOT NULL, PRIMARY KEY ("id") ); -CREATE INDEX "#__fields_idx_checked_out" ON "#__fields_groups" ("checked_out"); -CREATE INDEX "#__fields_idx_state" ON "#__fields_groups" ("state"); -CREATE INDEX "#__fields_idx_created_by" ON "#__fields_groups" ("created_by"); -CREATE INDEX "#__fields_idx_access" ON "#__fields_groups" ("access"); -CREATE INDEX "#__fields_idx_context" ON "#__fields_groups" ("context"); -CREATE INDEX "#__fields_idx_language" ON "#__fields_groups" ("language"); +CREATE INDEX "#__fields_groups_idx_checked_out" ON "#__fields_groups" ("checked_out"); +CREATE INDEX "#__fields_groups_idx_state" ON "#__fields_groups" ("state"); +CREATE INDEX "#__fields_groups_idx_created_by" ON "#__fields_groups" ("created_by"); +CREATE INDEX "#__fields_groups_idx_access" ON "#__fields_groups" ("access"); +CREATE INDEX "#__fields_groups_idx_context" ON "#__fields_groups" ("context"); +CREATE INDEX "#__fields_groups_idx_language" ON "#__fields_groups" ("language"); -- -- Table: #__fields_values diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql index 109609388f86a..08aa07b95e254 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-03-09.sql @@ -1,3 +1,4 @@ +UPDATE "#__categories" SET published = 1 WHERE alias = 'root'; UPDATE "#__categories" AS "c" SET published = c2.newPublished FROM ( @@ -7,6 +8,7 @@ INNER JOIN "#__categories" AS "p" ON p.lft <= c2.lft AND c2.rgt <= p.rgt GROUP BY c2.id) AS c2 WHERE c2.id = c.id; +UPDATE "#__menu" SET published = 1 WHERE alias = 'root'; UPDATE "#__menu" AS "c" SET published = c2.newPublished FROM ( diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..5df4318cc3680 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2017-04-19.sql @@ -0,0 +1,2 @@ +-- Set integer field default values. +UPDATE `#__extensions` SET `params` = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE `name` = 'plg_fields_integer'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql index d250fb881f58a..feb0fc106b9f7 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-03-09.sql @@ -1,3 +1,4 @@ +UPDATE "#__categories" SET published = 1 WHERE alias = 'root'; UPDATE "c" SET published = c2.newPublished FROM "#__categories" AS "c" @@ -7,6 +8,7 @@ FROM "#__categories" AS "c2" INNER JOIN "#__categories" AS "p" ON p.lft <= c2.lft AND c2.rgt <= p.rgt GROUP BY c2.id) AS c2 ON c2.id = c.id; +UPDATE "#__menu" SET published = 1 WHERE alias = 'root'; UPDATE "c" SET published = c2.newPublished FROM "#__menu" AS "c" diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql new file mode 100644 index 0000000000000..042487bcbc4d3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2017-04-19.sql @@ -0,0 +1,3 @@ +-- Set integer field default values. +UPDATE [#__extensions] SET [params] = '{"multiple":"0","first":"1","last":"100","step":"1"}' WHERE [name] = 'plg_fields_integer'; + diff --git a/administrator/components/com_admin/views/profile/view.html.php b/administrator/components/com_admin/views/profile/view.html.php index d23010b43fe92..fbe3e3747f3cd 100644 --- a/administrator/components/com_admin/views/profile/view.html.php +++ b/administrator/components/com_admin/views/profile/view.html.php @@ -58,9 +58,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->form->setValue('password', null); diff --git a/administrator/components/com_admin/views/sysinfo/view.html.php b/administrator/components/com_admin/views/sysinfo/view.html.php index fc1a93a1bf795..b406ed27f8885 100644 --- a/administrator/components/com_admin/views/sysinfo/view.html.php +++ b/administrator/components/com_admin/views/sysinfo/view.html.php @@ -70,7 +70,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $this->php_settings = $this->get('PhpSettings'); diff --git a/administrator/components/com_admin/views/sysinfo/view.json.php b/administrator/components/com_admin/views/sysinfo/view.json.php index 92455c573581b..4d7a9b7c08eed 100644 --- a/administrator/components/com_admin/views/sysinfo/view.json.php +++ b/administrator/components/com_admin/views/sysinfo/view.json.php @@ -30,7 +30,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } header('MIME-Version: 1.0'); diff --git a/administrator/components/com_admin/views/sysinfo/view.text.php b/administrator/components/com_admin/views/sysinfo/view.text.php index f284e2cf3e6b7..d90a045be1c35 100644 --- a/administrator/components/com_admin/views/sysinfo/view.text.php +++ b/administrator/components/com_admin/views/sysinfo/view.text.php @@ -30,7 +30,7 @@ public function display($tpl = null) // Access check. if (!JFactory::getUser()->authorise('core.admin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } header('Content-Type: text/plain; charset=utf-8'); diff --git a/administrator/components/com_associations/controllers/association.php b/administrator/components/com_associations/controllers/association.php index 69fb8c7371a24..60d5234559b58 100644 --- a/administrator/components/com_associations/controllers/association.php +++ b/administrator/components/com_associations/controllers/association.php @@ -31,9 +31,9 @@ class AssociationsControllerAssociation extends JControllerForm */ public function edit($key = null, $urlVar = null) { - list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); - $id = $this->input->get('id', 0); + $id = $this->input->get('id', 0, 'int'); // Check if reference item can be edited. if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id)) @@ -52,7 +52,7 @@ public function edit($key = null, $urlVar = null) * * @param string $key The name of the primary key of the URL variable. * - * @return void. + * @return void * * @since 3.7.0 */ @@ -60,7 +60,7 @@ public function cancel($key = null) { JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); - list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string')); // Only check in, if component item type allows to check out. if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName)) @@ -73,7 +73,7 @@ public function cancel($key = null) $ids = array_unique(explode(',', $targetId)); } - $ids[] = $this->input->get('id', 0); + $ids[] = $this->input->get('id', 0, 'int'); foreach ($ids as $key => $id) { diff --git a/administrator/components/com_associations/controllers/associations.php b/administrator/components/com_associations/controllers/associations.php index 8ec6606574b6b..23cbb6d04908e 100644 --- a/administrator/components/com_associations/controllers/associations.php +++ b/administrator/components/com_associations/controllers/associations.php @@ -68,4 +68,63 @@ public function clean() $this->getModel('associations')->clean(); $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); } + + /** + * Method to check in an item from the association item overview. + * + * @return void + * + * @since 3.7.1 + */ + public function checkin() + { + // Set the redirect so we can just stop processing when we find a condition we can't process + $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false)); + + // Figure out if the item supports checking and check it in + $type = null; + + list($extensionName, $typeName) = explode('.', $this->input->get('itemtype')); + + $extension = AssociationsHelper::getSupportedExtension($extensionName); + $types = $extension->get('types'); + + if (!array_key_exists($typeName, $types)) + { + return; + } + + if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName) === false) + { + // How on earth we came to that point, eject internet + return; + } + + $cid = $this->input->get('cid', array(), 'array'); + + if (empty($cid)) + { + // Seems we don't have an id to work with. + return; + } + + // We know the first element is the one we need because we don't allow multi selection of rows + $id = $cid[0]; + + if (AssociationsHelper::canCheckinItem($extensionName, $typeName, $id) === true) + { + $item = AssociationsHelper::getItem($extensionName, $typeName, $id); + + $item->checkIn($id); + + return; + } + + $this->setRedirect( + JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list), + JText::_('COM_ASSOCIATIONS_YOU_ARE_NOT_ALLOWED_TO_CHECKIN_THIS_ITEM') + ); + + return; + } } diff --git a/administrator/components/com_associations/helpers/associations.php b/administrator/components/com_associations/helpers/associations.php index 02bb2c2d3a0aa..38b9193b8a2cf 100644 --- a/administrator/components/com_associations/helpers/associations.php +++ b/administrator/components/com_associations/helpers/associations.php @@ -641,4 +641,33 @@ public static function getTypeFieldName($extensionName, $typeName, $fieldName) return $helper->getTypeFieldName($typeName, $fieldName); } + + /** + * Gets the language filter system plugin extension id. + * + * @return int The language filter system plugin extension id. + * + * @since 3.7.2 + */ + public static function getLanguagefilterPluginId() + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) + ->where($db->quoteName('element') . ' = ' . $db->quote('languagefilter')); + $db->setQuery($query); + + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + + return $result; + } } diff --git a/administrator/components/com_associations/models/associations.php b/administrator/components/com_associations/models/associations.php index 03a3696e3d78e..67114f93fbcf0 100644 --- a/administrator/components/com_associations/models/associations.php +++ b/administrator/components/com_associations/models/associations.php @@ -151,7 +151,6 @@ protected function getStoreId($id = '') protected function getListQuery() { $type = null; - $listOrdering = $this->getState('list.fullordering'); list($extensionName, $typeName) = explode('.', $this->state->get('itemtype')); @@ -403,11 +402,11 @@ protected function getListQuery() // Add the group by clause $query->group($db->qn($groupby)); - // Add the list ordering clause. - if (!empty($listOrdering)) - { - $query->order($db->escape($listOrdering)); - } + // Add the list ordering clause + $listOrdering = $this->state->get('list.ordering', 'id'); + $orderDirn = $this->state->get('list.direction', 'ASC'); + + $query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn)); return $query; } diff --git a/administrator/components/com_associations/models/fields/itemlanguage.php b/administrator/components/com_associations/models/fields/itemlanguage.php index 04bbafd7948d3..459a91a7c2c6f 100644 --- a/administrator/components/com_associations/models/fields/itemlanguage.php +++ b/administrator/components/com_associations/models/fields/itemlanguage.php @@ -40,7 +40,7 @@ protected function getOptions() { $input = JFactory::getApplication()->input; - list($extensionName, $typeName) = explode('.', $input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string')); // Get the extension specific helper method $helper = AssociationsHelper::getExtensionHelper($extensionName); diff --git a/administrator/components/com_associations/models/fields/modalassociation.php b/administrator/components/com_associations/models/fields/modalassociation.php index 64371e85df692..5f2278dc70b5f 100644 --- a/administrator/components/com_associations/models/fields/modalassociation.php +++ b/administrator/components/com_associations/models/fields/modalassociation.php @@ -95,8 +95,8 @@ protected function getInput() 'width' => '800px', 'bodyHeight' => '70', 'modalWidth' => '80', - 'footer' => '', + 'footer' => '', ) ); diff --git a/administrator/components/com_associations/models/forms/association.xml b/administrator/components/com_associations/models/forms/association.xml index 89add5542b210..9e8d880e22984 100644 --- a/administrator/components/com_associations/models/forms/association.xml +++ b/administrator/components/com_associations/models/forms/association.xml @@ -6,7 +6,7 @@ type="itemlanguage" label="COM_ASSOCIATIONS_ITEM_FIELD_LANGUAGE_LABEL" description="COM_ASSOCIATIONS_ITEM_FIELD_LANGUAGE_DESC" - > + > diff --git a/administrator/components/com_associations/models/forms/filter_associations.xml b/administrator/components/com_associations/models/forms/filter_associations.xml index c44a3804fd005..9563de4489650 100644 --- a/administrator/components/com_associations/models/forms/filter_associations.xml +++ b/administrator/components/com_associations/models/forms/filter_associations.xml @@ -7,7 +7,7 @@ description="COM_ASSOCIATIONS_COMPONENT_SELECTOR_DESC" filtermode="selector" onchange="jQuery('select[id^=\'filter_\']').val('');jQuery('select[id^=\'list_\']').val('');this.form.submit();" - > + > @@ -15,10 +15,10 @@ name="language" type="contentlanguage" label="JOPTION_FILTER_LANGUAGE" - filtermode="selector" description="JOPTION_FILTER_LANGUAGE_DESC" + filtermode="selector" onchange="this.form.submit();" - > + > @@ -37,7 +37,7 @@ label="JOPTION_FILTER_PUBLISHED" description="JOPTION_FILTER_PUBLISHED_DESC" onchange="this.form.submit();" - > + > @@ -49,7 +49,7 @@ published="0,1,2" extension="dynamic" onchange="this.form.submit();" - > + > @@ -60,7 +60,7 @@ description="COM_ASSOCIATIONS_FILTER_MENUTYPE_DESC" clientid="0" onchange="this.form.submit();" - > + > @@ -70,7 +70,7 @@ label="JOPTION_FILTER_ACCESS" description="JOPTION_FILTER_ACCESS_DESC" onchange="this.form.submit();" - > + > @@ -83,7 +83,7 @@ last="10" step="1" onchange="this.form.submit();" - > + > @@ -94,7 +94,7 @@ type="list" default="id ASC" onchange="this.form.submit();" - > + > diff --git a/administrator/components/com_associations/views/association/tmpl/edit.php b/administrator/components/com_associations/views/association/tmpl/edit.php index ced7000ad5d54..d4e6b689a5c78 100644 --- a/administrator/components/com_associations/views/association/tmpl/edit.php +++ b/administrator/components/com_associations/views/association/tmpl/edit.php @@ -22,7 +22,7 @@ 'id' => $this->referenceId, ); ?> - diff --git a/administrator/components/com_associations/views/association/view.html.php b/administrator/components/com_associations/views/association/view.html.php index 4d77a8d7ef012..00bdcb4467b72 100644 --- a/administrator/components/com_associations/views/association/view.html.php +++ b/administrator/components/com_associations/views/association/view.html.php @@ -62,6 +62,7 @@ class AssociationsViewAssociation extends JViewLegacy * @return void * * @since 3.7.0 + * @throws Exception */ public function display($tpl = null) { @@ -69,8 +70,6 @@ public function display($tpl = null) if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors), 500); - - return false; } $this->app = JFactory::getApplication(); @@ -78,7 +77,7 @@ public function display($tpl = null) $input = $this->app->input; $this->referenceId = $input->get('id', 0, 'int'); - list($extensionName, $typeName) = explode('.', $input->get('itemtype')); + list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string')); $extension = AssociationsHelper::getSupportedExtension($extensionName); $types = $extension->get('types'); @@ -135,7 +134,7 @@ public function display($tpl = null) $this->targetId = $matches[1]; $this->targetLanguage = $matches[0]; $task = $typeName . '.' . $this->targetAction; - $this->defaultTargetSrc = JRoute::_($this->editUri . '&task= ' . $task . ' &id=' . (int) $this->targetId); + $this->defaultTargetSrc = JRoute::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId); $this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction); } @@ -198,13 +197,13 @@ protected function addToolbar() $bar->appendButton( 'Custom', '', 'reference' ); $bar->appendButton( 'Custom', '', 'target' ); diff --git a/administrator/components/com_associations/views/associations/tmpl/default.php b/administrator/components/com_associations/views/associations/tmpl/default.php index 9b6dbaa6893c5..b00dd9f74f10c 100644 --- a/administrator/components/com_associations/views/associations/tmpl/default.php +++ b/administrator/components/com_associations/views/associations/tmpl/default.php @@ -16,7 +16,7 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$listOrder = $this->escape($this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canManageCheckin = JFactory::getUser()->authorise('core.manage', 'com_checkin'); $colSpan = 5; @@ -110,7 +110,6 @@ items as $i => $item) : - $canCheckin = true; $canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id); $canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id); $isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id); @@ -122,9 +121,13 @@ + id); ?> level)) : ?> $item->level)); ?> + + editor, $item->checked_out_time, 'associations.'); ?> + editor, $item->checked_out_time, 'associations.', $canCheckin); ?> @@ -173,6 +176,7 @@ +
diff --git a/administrator/components/com_associations/views/associations/tmpl/default.xml b/administrator/components/com_associations/views/associations/tmpl/default.xml new file mode 100644 index 0000000000000..d2dc27b12bdf2 --- /dev/null +++ b/administrator/components/com_associations/views/associations/tmpl/default.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/administrator/components/com_associations/views/associations/tmpl/modal.php b/administrator/components/com_associations/views/associations/tmpl/modal.php index 2a5d2755000fe..f4315e6e38c24 100644 --- a/administrator/components/com_associations/views/associations/tmpl/modal.php +++ b/administrator/components/com_associations/views/associations/tmpl/modal.php @@ -21,10 +21,12 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$function = $app->input->getCmd('function', 'jSelectAssociation'); -$listOrder = $this->escape($this->state->get('list.ordering')); -$listDirn = $this->escape($this->state->get('list.direction')); -$colSpan = 4; +$function = $app->input->getCmd('function', 'jSelectAssociation'); +$listOrder = $this->escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); +$canManageCheckin = JFactory::getUser()->authorise('core.manage', 'com_checkin'); +$colSpan = 4; + $iconStates = array( -2 => 'icon-trash', 0 => 'icon-unpublish', @@ -102,18 +104,31 @@ items as $i => $item) : + $canEdit = AssociationsHelper::allowEdit($this->extensionName, $this->typeName, $item->id); + $canCheckin = $canManageCheckin || AssociationsHelper::canCheckinItem($this->extensionName, $this->typeName, $item->id); + $isCheckout = AssociationsHelper::isCheckoutItem($this->extensionName, $this->typeName, $item->id); ?> typeSupports['state'])) : ?> - + level)) : ?> $item->level)); ?> - escape($item->title); ?> + + + escape($item->title); ?> + + editor, $item->checked_out_time, 'associations.'); ?> + + escape($item->title); ?> + + + escape($item->title); ?> + typeFields['alias'])) : ?> escape($item->alias)); ?> diff --git a/administrator/components/com_associations/views/associations/view.html.php b/administrator/components/com_associations/views/associations/view.html.php index 5c82f82b483d5..ce481471ab11a 100644 --- a/administrator/components/com_associations/views/associations/view.html.php +++ b/administrator/components/com_associations/views/associations/view.html.php @@ -69,7 +69,8 @@ public function display($tpl = null) if (!JLanguageAssociations::isEnabled()) { - JFactory::getApplication()->enqueueMessage(JText::_('COM_ASSOCIATIONS_ERROR_NO_ASSOC'), 'warning'); + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . AssociationsHelper::getLanguagefilterPluginId()); + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_ASSOCIATIONS_ERROR_NO_ASSOC', $link), 'warning'); } elseif ($this->state->get('itemtype') == '' || $this->state->get('language') == '') { diff --git a/administrator/components/com_banners/controllers/tracks.raw.php b/administrator/components/com_banners/controllers/tracks.raw.php index 146ef47c0bc95..ebf4970d56bf2 100644 --- a/administrator/components/com_banners/controllers/tracks.raw.php +++ b/administrator/components/com_banners/controllers/tracks.raw.php @@ -79,12 +79,31 @@ public function display($cachable = false, $urlparams = array()) $model->setState('basename', $form['basename']); $model->setState('compressed', $form['compressed']); - $config = JFactory::getConfig(); - $cookie_domain = $config->get('cookie_domain', ''); - $cookie_path = $config->get('cookie_path', '/'); + // Create one year cookies. + $cookieLifeTime = time() + 365 * 86400; + $cookieDomain = $app->get('cookie_domain', ''); + $cookiePath = $app->get('cookie_path', '/'); + $isHttpsForced = $app->isHttpsForced(); - setcookie(JApplicationHelper::getHash($this->context . '.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain); - setcookie(JApplicationHelper::getHash($this->context . '.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain); + $app->input->cookie->set( + JApplicationHelper::getHash($this->context . '.basename'), + $form['basename'], + $cookieLifeTime, + $cookiePath, + $cookieDomain, + $isHttpsForced, + true + ); + + $app->input->cookie->set( + JApplicationHelper::getHash($this->context . '.compressed'), + $form['compressed'], + $cookieLifeTime, + $cookiePath, + $cookieDomain, + $isHttpsForced, + true + ); // Push the model into the view (as default). $view->setModel($model, true); diff --git a/administrator/components/com_banners/models/forms/download.xml b/administrator/components/com_banners/models/forms/download.xml index 0c90b70bc95d4..17c0cc6ec96de 100644 --- a/administrator/components/com_banners/models/forms/download.xml +++ b/administrator/components/com_banners/models/forms/download.xml @@ -18,8 +18,8 @@ get('height', 0)); // Sets the width and height to an empty string if = 0 - $registry->set('width', ($width ? $width : '')); - $registry->set('height', ($height ? $height : '')); + $registry->set('width', $width ?: ''); + $registry->set('height', $height ?: ''); $array['params'] = (string) $registry; } diff --git a/administrator/components/com_banners/views/banner/view.html.php b/administrator/components/com_banners/views/banner/view.html.php index 503ab2b4f03e2..56d98cf202f4c 100644 --- a/administrator/components/com_banners/views/banner/view.html.php +++ b/administrator/components/com_banners/views/banner/view.html.php @@ -56,9 +56,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php index faacb3bfedeba..7965e485af151 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default.php +++ b/administrator/components/com_banners/views/banners/tmpl/default.php @@ -111,7 +111,7 @@ + value="ordering; ?>" class="width-20 text-area-order" /> @@ -156,7 +156,7 @@ client_name; ?> - impmade, $item->imptotal ? $item->imptotal : JText::_('COM_BANNERS_UNLIMITED')); ?> + impmade, $item->imptotal ?: JText::_('COM_BANNERS_UNLIMITED')); ?> clicks; ?> - @@ -180,8 +180,8 @@ 'bootstrap.renderModal', 'collapseModal', array( - 'title' => JText::_('COM_BANNERS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') + 'title' => JText::_('COM_BANNERS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer'), ), $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_banners/views/banners/view.html.php b/administrator/components/com_banners/views/banners/view.html.php index d954cff9ccb0e..0fc752ea058d7 100644 --- a/administrator/components/com_banners/views/banners/view.html.php +++ b/administrator/components/com_banners/views/banners/view.html.php @@ -65,9 +65,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('banners'); @@ -103,7 +101,7 @@ protected function addToolbar() JToolbarHelper::addNew('banner.add'); } - if (($canDo->get('core.edit'))) + if ($canDo->get('core.edit')) { JToolbarHelper::editList('banner.edit'); } @@ -175,15 +173,15 @@ protected function addToolbar() protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.state' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_BANNERS_HEADING_NAME'), - 'a.sticky' => JText::_('COM_BANNERS_HEADING_STICKY'), + 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.state' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_BANNERS_HEADING_NAME'), + 'a.sticky' => JText::_('COM_BANNERS_HEADING_STICKY'), 'client_name' => JText::_('COM_BANNERS_HEADING_CLIENT'), - 'impmade' => JText::_('COM_BANNERS_HEADING_IMPRESSIONS'), - 'clicks' => JText::_('COM_BANNERS_HEADING_CLICKS'), - 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'impmade' => JText::_('COM_BANNERS_HEADING_IMPRESSIONS'), + 'clicks' => JText::_('COM_BANNERS_HEADING_CLICKS'), + 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.id' => JText::_('JGRID_HEADING_ID'), ); } } diff --git a/administrator/components/com_banners/views/client/view.html.php b/administrator/components/com_banners/views/client/view.html.php index ab0975e8acc1e..f4f0005104af4 100644 --- a/administrator/components/com_banners/views/client/view.html.php +++ b/administrator/components/com_banners/views/client/view.html.php @@ -63,9 +63,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_banners/views/clients/tmpl/default.php b/administrator/components/com_banners/views/clients/tmpl/default.php index ef63cdba1779f..fcf1fb49acee6 100644 --- a/administrator/components/com_banners/views/clients/tmpl/default.php +++ b/administrator/components/com_banners/views/clients/tmpl/default.php @@ -27,7 +27,7 @@ $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -$params = (isset($this->state->params)) ? $this->state->params : new JObject; +$params = isset($this->state->params) ? $this->state->params : new JObject; ?>
diff --git a/administrator/components/com_banners/views/clients/view.html.php b/administrator/components/com_banners/views/clients/view.html.php index efdc218fc5df4..ae0034b9a35b9 100644 --- a/administrator/components/com_banners/views/clients/view.html.php +++ b/administrator/components/com_banners/views/clients/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('clients'); diff --git a/administrator/components/com_banners/views/download/view.html.php b/administrator/components/com_banners/views/download/view.html.php index a4b0a4243a313..a963d6ec1a5aa 100644 --- a/administrator/components/com_banners/views/download/view.html.php +++ b/administrator/components/com_banners/views/download/view.html.php @@ -37,9 +37,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_banners/views/tracks/view.html.php b/administrator/components/com_banners/views/tracks/view.html.php index 32887e9947e8a..cd93b888975f6 100644 --- a/administrator/components/com_banners/views/tracks/view.html.php +++ b/administrator/components/com_banners/views/tracks/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } BannersHelper::addSubmenu('tracks'); diff --git a/administrator/components/com_banners/views/tracks/view.raw.php b/administrator/components/com_banners/views/tracks/view.raw.php index 918fca9583554..f9babb40b0596 100644 --- a/administrator/components/com_banners/views/tracks/view.raw.php +++ b/administrator/components/com_banners/views/tracks/view.raw.php @@ -33,9 +33,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $document = JFactory::getDocument(); diff --git a/administrator/components/com_cache/views/cache/tmpl/default.php b/administrator/components/com_cache/views/cache/tmpl/default.php index 1886d59a66721..06a4a60cbe608 100644 --- a/administrator/components/com_cache/views/cache/tmpl/default.php +++ b/administrator/components/com_cache/views/cache/tmpl/default.php @@ -67,7 +67,7 @@ count; ?> - size*1024); ?> + size); ?> diff --git a/administrator/components/com_cache/views/cache/view.html.php b/administrator/components/com_cache/views/cache/view.html.php index 35e56171b5751..d61cb7927463d 100644 --- a/administrator/components/com_cache/views/cache/view.html.php +++ b/administrator/components/com_cache/views/cache/view.html.php @@ -47,9 +47,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php index da87beab3b9da..3103328d8b8a7 100644 --- a/administrator/components/com_categories/helpers/categories.php +++ b/administrator/components/com_categories/helpers/categories.php @@ -152,7 +152,7 @@ public static function validateCategoryId($catid, $extension) * * @param array $data Array of data for new category. * - * @return integer. + * @return integer */ public static function createCategory($data) { diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index a684032c74d4c..13b223191dbae 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -480,7 +480,7 @@ public function save($data) $isNew = true; $context = $this->option . '.' . $this->name; - if ((!empty($data['tags']) && $data['tags'][0] != '')) + if (!empty($data['tags']) && $data['tags'][0] != '') { $table->newTags = $data['tags']; } diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php index be7220b4ab1cf..1df485656d9d3 100644 --- a/administrator/components/com_categories/models/fields/categoryedit.php +++ b/administrator/components/com_categories/models/fields/categoryedit.php @@ -41,7 +41,7 @@ class JFormFieldCategoryEdit extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * @@ -119,7 +119,7 @@ public function __set($name, $value) protected function getOptions() { $options = array(); - $published = $this->element['published'] ? $this->element['published'] : array(0, 1); + $published = $this->element['published'] ?: array(0, 1); $name = (string) $this->element['name']; // Let's get the id for the current item, either category or content item. @@ -143,7 +143,6 @@ protected function getOptions() $db = JFactory::getDbo(); $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); $query = $db->getQuery(true) ->select('DISTINCT a.id AS value, a.title AS text, a.level, a.published, a.lft'); @@ -186,7 +185,12 @@ protected function getOptions() } // Filter categories on User Access Level - $subQuery->where('access IN (' . $groups . ')'); + // Filter by access level on categories. + if (!$user->authorise('core.admin')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $subQuery->where('access IN (' . $groups . ')'); + } $query->from('(' . (string) $subQuery . ') AS a') ->join('LEFT', $db->quoteName('#__categories') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); @@ -257,9 +261,6 @@ protected function getOptions() } } - // Get the current user object. - $user = JFactory::getUser(); - // For new items we want a list of categories you are allowed to create in. if ($oldCat == 0) { @@ -293,7 +294,7 @@ protected function getOptions() continue; } - if ($option->level != 0 && isset($oldParent) && $option->value != $oldParent && !$user->authorise('core.edit.state', $assetKey)) + if ($option->level != 0 && isset($oldParent) && $option->value != $oldParent && !$user->authorise('core.edit.state', $assetKey)) { unset($options[$i]); continue; @@ -311,7 +312,7 @@ protected function getOptions() continue; } - if ($option->level != 0 && isset($oldParent) && $option->value != $oldParent && !$user->authorise('core.create', $assetKey)) + if ($option->level != 0 && isset($oldParent) && $option->value != $oldParent && !$user->authorise('core.create', $assetKey)) { unset($options[$i]); continue; @@ -413,8 +414,19 @@ protected function getInput() } } else - // Create a regular list. { + // Create a regular list. + if (count($options) === 0) + { + // All Categories have been deleted, so we need a new category (This will create on save if selected). + $options[0] = new stdClass; + $options[0]->value = 'Uncategorised'; + $options[0]->text = 'Uncategorised'; + $options[0]->level = '1'; + $options[0]->published = '1'; + $options[0]->lft = '1'; + } + $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); } diff --git a/administrator/components/com_categories/models/forms/category.xml b/administrator/components/com_categories/models/forms/category.xml index 1b41ed27ac806..cad1b4196ca5b 100644 --- a/administrator/components/com_categories/models/forms/category.xml +++ b/administrator/components/com_categories/models/forms/category.xml @@ -25,6 +25,8 @@ name="asset_id" type="hidden" filter="unset" + label="JFIELD_ASSET_ID_LABEL" + description="JFIELD_ASSET_ID_DESC" /> authorise('core.edit', $extension) && $user->authorise('core.edit.state', $extension)) : ?> JText::_('COM_CATEGORIES_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> + 'bootstrap.renderModal', + 'collapseModal', + array( + 'title' => JText::_('COM_CATEGORIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer'), + ), + $this->loadTemplate('batch_body') + ); ?> diff --git a/administrator/components/com_categories/views/categories/tmpl/modal.php b/administrator/components/com_categories/views/categories/tmpl/modal.php index 6590314d0bcc2..5c6dc125540d2 100644 --- a/administrator/components/com_categories/views/categories/tmpl/modal.php +++ b/administrator/components/com_categories/views/categories/tmpl/modal.php @@ -78,9 +78,9 @@ 'icon-trash', - 0 => 'icon-unpublish', - 1 => 'icon-publish', - 2 => 'icon-archive', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ); ?> items as $i => $item) : ?> @@ -107,7 +107,7 @@ ?> - + $item->level)); ?> diff --git a/administrator/components/com_categories/views/categories/view.html.php b/administrator/components/com_categories/views/categories/view.html.php index f60d332b7af9d..94943883f9314 100644 --- a/administrator/components/com_categories/views/categories/view.html.php +++ b/administrator/components/com_categories/views/categories/view.html.php @@ -84,9 +84,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Preprocess the list of items to find ordering divisions. @@ -186,7 +184,7 @@ protected function addToolbar() // Prepare the toolbar. JToolbarHelper::title($title, 'folder categories ' . substr($component, 4) . ($section ? "-$section" : '') . '-categories'); - if ($canDo->get('core.create') || (count($user->getAuthorisedCategories($component, 'core.create'))) > 0) + if ($canDo->get('core.create') || count($user->getAuthorisedCategories($component, 'core.create')) > 0) { JToolbarHelper::addNew('category.add'); } @@ -277,12 +275,12 @@ protected function addToolbar() protected function getSortFields() { return array( - 'a.lft' => JText::_('JGRID_HEADING_ORDERING'), + 'a.lft' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), - 'a.title' => JText::_('JGLOBAL_TITLE'), - 'a.access' => JText::_('JGRID_HEADING_ACCESS'), - 'language' => JText::_('JGRID_HEADING_LANGUAGE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.title' => JText::_('JGLOBAL_TITLE'), + 'a.access' => JText::_('JGRID_HEADING_ACCESS'), + 'language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.id' => JText::_('JGRID_HEADING_ID'), ); } } diff --git a/administrator/components/com_categories/views/category/tmpl/edit.xml b/administrator/components/com_categories/views/category/tmpl/edit.xml index 11d01e0cf8540..f96948e4ad153 100755 --- a/administrator/components/com_categories/views/category/tmpl/edit.xml +++ b/administrator/components/com_categories/views/category/tmpl/edit.xml @@ -13,7 +13,7 @@ label="COM_CATEGORIES_CHOOSE_COMPONENT_LABEL" description="COM_CATEGORIES_CHOOSE_COMPONENT_DESC" required="true" - > + > get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Check for tag type diff --git a/administrator/components/com_checkin/views/checkin/view.html.php b/administrator/components/com_checkin/views/checkin/view.html.php index 4594dbd113411..2943c79484d5e 100644 --- a/administrator/components/com_checkin/views/checkin/view.html.php +++ b/administrator/components/com_checkin/views/checkin/view.html.php @@ -71,9 +71,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php index 1b3474735037b..17fc3f0fad3da 100644 --- a/administrator/components/com_config/model/application.php +++ b/administrator/components/com_config/model/application.php @@ -283,7 +283,7 @@ public function save($data) * Look for a custom cache_path * First check if a path is given in the submitted data, then check if a path exists in the previous data, otherwise use the default */ - if ($data['cache_path']) + if (!empty($data['cache_path'])) { $path = $data['cache_path']; } @@ -564,120 +564,101 @@ public function storePermissions($permission = null) try { - // Load the current settings for this component. - $query = $this->db->getQuery(true) - ->select($this->db->quoteName(array('name', 'rules'))) - ->from($this->db->quoteName('#__assets')) - ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); - - $this->db->setQuery($query); - - // Load the results as a list of stdClass objects (see later for more options on retrieving data). - $results = $this->db->loadAssocList(); - } - catch (Exception $e) - { - $app->enqueueMessage($e->getMessage(), 'error'); - - return false; - } - - // No record found, let's create one. - if (empty($results)) - { - $data = array(); - $data[$permission['action']] = array($permission['rule'] => $permission['value']); + $asset = JTable::getInstance('asset'); + $result = $asset->loadByName($permission['component']); - $rules = new JAccessRules($data); - $asset = JTable::getInstance('asset'); - $asset->rules = (string) $rules; - $asset->name = (string) $permission['component']; - $asset->title = (string) $permission['title']; - - // Get the parent asset id so we have a correct tree. - $parentAsset = JTable::getInstance('Asset'); - - if (strpos($asset->name, '.') !== false) + if ($result === false) { - $assetParts = explode('.', $asset->name); - $parentAsset->loadByName($assetParts[0]); - $parentAssetId = $parentAsset->id; - } - else - { - $parentAssetId = $parentAsset->getRootId(); - } - - /** - * @to do: incorrect ACL stored - * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created. - * This works fine for item <-> component <-> global config scenario and component <-> global config scenario. - * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario, - * because a wrong parent asset id (the component) is stored. - * Happens when there is no row in the asset table (ex: deleted or not created on update). - */ + $data = array($permission['action'] => array($permission['rule'] => $permission['value'])); - $asset->setLocation($parentAssetId, 'last-child'); - - if (!$asset->check() || !$asset->store()) - { - $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error'); + $rules = new JAccessRules($data); + $asset->rules = (string) $rules; + $asset->name = (string) $permission['component']; + $asset->title = (string) $permission['title']; - return false; - } - } - else - { - // Decode the rule settings. - $temp = json_decode($results[0]['rules'], true); + // Get the parent asset id so we have a correct tree. + $parentAsset = JTable::getInstance('Asset'); - // Check if a new value is to be set. - if (isset($permission['value'])) - { - // Check if we already have an action entry. - if (!isset($temp[$permission['action']])) + if (strpos($asset->name, '.') !== false) { - $temp[$permission['action']] = array(); + $assetParts = explode('.', $asset->name); + $parentAsset->loadByName($assetParts[0]); + $parentAssetId = $parentAsset->id; } - - // Check if we already have a rule entry. - if (!isset($temp[$permission['action']][$permission['rule']])) + else { - $temp[$permission['action']][$permission['rule']] = array(); + $parentAssetId = $parentAsset->getRootId(); } - // Set the new permission. - $temp[$permission['action']][$permission['rule']] = (int) $permission['value']; + /** + * @to do: incorrect ACL stored + * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created. + * This works fine for item <-> component <-> global config scenario and component <-> global config scenario. + * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario, + * because a wrong parent asset id (the component) is stored. + * Happens when there is no row in the asset table (ex: deleted or not created on update). + */ - // Check if we have an inherited setting. - if (strlen($permission['value']) === 0) - { - unset($temp[$permission['action']][$permission['rule']]); - } + $asset->setLocation($parentAssetId, 'last-child'); } else { - // There is no value so remove the action as it's not needed. - unset($temp[$permission['action']]); - } + // Decode the rule settings. + $temp = json_decode($asset->rules, true); - // Store the new permissions. - try - { - $query->clear() - ->update($this->db->quoteName('#__assets')) - ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote(json_encode($temp))) - ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); + // Check if a new value is to be set. + if (isset($permission['value'])) + { + // Check if we already have an action entry. + if (!isset($temp[$permission['action']])) + { + $temp[$permission['action']] = array(); + } + + // Check if we already have a rule entry. + if (!isset($temp[$permission['action']][$permission['rule']])) + { + $temp[$permission['action']][$permission['rule']] = array(); + } + + // Set the new permission. + $temp[$permission['action']][$permission['rule']] = (int) $permission['value']; + + // Check if we have an inherited setting. + if ($permission['value'] === '') + { + unset($temp[$permission['action']][$permission['rule']]); + } + + // Check if we have any rules. + if (!$temp[$permission['action']]) + { + unset($temp[$permission['action']]); + } + } + else + { + // There is no value so remove the action as it's not needed. + unset($temp[$permission['action']]); + } - $this->db->setQuery($query)->execute(); + $asset->rules = json_encode($temp, JSON_FORCE_OBJECT); } - catch (Exception $e) + + if (!$asset->check() || !$asset->store()) { - $app->enqueueMessage($e->getMessage(), 'error'); + $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error'); return false; } } + catch (Exception $e) + { + $app->enqueueMessage($e->getMessage(), 'error'); + + return false; + } + // All checks done. $result = array( @@ -691,7 +672,7 @@ public function storePermissions($permission = null) try { // Get the asset id by the name of the component. - $query->clear() + $query = $this->db->getQuery(true) ->select($this->db->quoteName('id')) ->from($this->db->quoteName('#__assets')) ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index 2f965fe43d503..8fda9c7e445fa 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -7,9 +7,9 @@ @@ -32,7 +32,7 @@ default="1" showon="cache_handler:memcache" filter="integer" - > + > @@ -46,7 +46,7 @@ default="0" showon="cache_handler:memcache" filter="integer" - > + > @@ -85,7 +85,7 @@ default="1" showon="cache_handler:memcached" filter="integer" - > + > @@ -99,7 +99,7 @@ default="0" showon="cache_handler:memcached" filter="integer" - > + > @@ -138,7 +138,7 @@ default="1" filter="integer" showon="cache_handler:redis" - > + > @@ -211,7 +211,7 @@ class="btn-group btn-group-yesno" default="0" filter="integer" - > + > @@ -223,7 +223,7 @@ description="COM_CONFIG_FIELD_CACHE_DESC" default="2" filter="integer" - > + > @@ -282,9 +282,9 @@ @@ -298,12 +298,12 @@ + > @@ -311,31 +311,29 @@ + > -
+
+ > @@ -390,8 +388,8 @@ name="ftp_root" type="text" label="COM_CONFIG_FIELD_FTP_ROOT_LABEL" - showon="ftp_enable:1" description="COM_CONFIG_FIELD_FTP_ROOT_DESC" + showon="ftp_enable:1" filter="string" size="50" /> @@ -405,12 +403,12 @@ + > @@ -470,10 +468,10 @@ + default="UTC" + > @@ -491,7 +489,7 @@ class="btn-group btn-group-yesno" default="1" filter="integer" - > + > @@ -505,7 +503,7 @@ default="0" filter="integer" showon="mailonline:1" - > + > @@ -560,7 +558,7 @@ default="mail" filter="word" showon="mailonline:1" - > + > @@ -612,7 +610,7 @@ default="none" showon="mailonline:1[AND]mailer:smtp" filter="word" - > + > @@ -627,7 +625,7 @@ default="0" showon="mailonline:1[AND]mailer:smtp" filter="integer" - > + > @@ -686,7 +684,7 @@ label="JFIELD_METADATA_ROBOTS_LABEL" description="JFIELD_METADATA_ROBOTS_DESC" default="" - > + > @@ -706,12 +704,12 @@ + > @@ -719,12 +717,12 @@ + > @@ -738,12 +736,12 @@ + > @@ -751,13 +749,13 @@ + > @@ -765,13 +763,13 @@ + > @@ -779,13 +777,13 @@ + > @@ -793,11 +791,11 @@ + > @@ -821,12 +819,12 @@ + > @@ -834,11 +832,11 @@ + > @@ -849,11 +847,11 @@ + > @@ -945,7 +943,7 @@ class="btn-group btn-group-yesno" default="0" filter="integer" - > + > @@ -969,12 +967,12 @@ + > @@ -982,12 +980,12 @@ + > @@ -1015,11 +1013,11 @@ + > @@ -1028,42 +1026,42 @@ + > + > @@ -1079,11 +1077,11 @@ + > @@ -1097,11 +1095,11 @@ + > @@ -1169,7 +1167,7 @@ translate_label="false" validate="rules" filter="rules" - > + > + form->getFieldset($name) as $field) : ?> - + type === 'Spacer' ? ' field-spacer' : ''; + ?> showon) : ?> 'auto', 'relative' => true)); ?> @@ -87,7 +90,7 @@ hidden) : ?> input; ?> -
> +
>
label; ?> diff --git a/administrator/components/com_contact/config.xml b/administrator/components/com_contact/config.xml index 3683321c4073f..3bc8da197b319 100644 --- a/administrator/components/com_contact/config.xml +++ b/administrator/components/com_contact/config.xml @@ -112,7 +112,7 @@ > - + JHIDE + + + + + getError()); } + + if ($value == 1) + { + $message = JText::plural('COM_CONTACT_N_ITEMS_FEATURED', count($ids)); + } + else + { + $message = JText::plural('COM_CONTACT_N_ITEMS_UNFEATURED', count($ids)); + } } - $this->setRedirect('index.php?option=com_contact&view=contacts'); + $this->setRedirect('index.php?option=com_contact&view=contacts', $message); } /** diff --git a/administrator/components/com_contact/helpers/html/contact.php b/administrator/components/com_contact/helpers/html/contact.php index aff48320506c3..52a9814fd53df 100644 --- a/administrator/components/com_contact/helpers/html/contact.php +++ b/administrator/components/com_contact/helpers/html/contact.php @@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true) if ($canChange) { $html = ''; + . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3]) + . '">'; } else { - $html = ''; + $html = ''; } return $html; diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index fe10f796b468a..8795988f3aa3e 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -52,9 +52,9 @@ class ContactModelContact extends JModelAdmin */ protected $batch_commands = array( 'assetgroup_id' => 'batchAccess', - 'language_id' => 'batchLanguage', - 'tag' => 'batchTag', - 'user_id' => 'batchUser' + 'language_id' => 'batchLanguage', + 'tag' => 'batchTag', + 'user_id' => 'batchUser', ); /** diff --git a/administrator/components/com_contact/models/forms/contact.xml b/administrator/components/com_contact/models/forms/contact.xml index f697a5f1cbc4e..397a2099dd30d 100644 --- a/administrator/components/com_contact/models/forms/contact.xml +++ b/administrator/components/com_contact/models/forms/contact.xml @@ -60,7 +60,7 @@ id="published" class="chzn-color-state" size="1" - > + > @@ -530,6 +530,18 @@ + + + + + diff --git a/administrator/components/com_contact/models/forms/fields/mail.xml b/administrator/components/com_contact/models/forms/fields/mail.xml new file mode 100644 index 0000000000000..452bcd4aeb22b --- /dev/null +++ b/administrator/components/com_contact/models/forms/fields/mail.xml @@ -0,0 +1,12 @@ + + + +
+ +
+
+ diff --git a/administrator/components/com_contact/tables/contact.php b/administrator/components/com_contact/tables/contact.php index 556baa184e63a..5c67d62db63bf 100644 --- a/administrator/components/com_contact/tables/contact.php +++ b/administrator/components/com_contact/tables/contact.php @@ -161,7 +161,7 @@ public function check() } // Sanity check for user_id - if (!($this->user_id)) + if (!$this->user_id) { $this->user_id = 0; } diff --git a/administrator/components/com_contact/views/contact/view.html.php b/administrator/components/com_contact/views/contact/view.html.php index de63c695b8827..57d367bf16b4a 100644 --- a/administrator/components/com_contact/views/contact/view.html.php +++ b/administrator/components/com_contact/views/contact/view.html.php @@ -54,9 +54,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). diff --git a/administrator/components/com_contact/views/contacts/tmpl/default.php b/administrator/components/com_contact/views/contacts/tmpl/default.php index a50ecd75adc81..0883511d7035e 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/default.php +++ b/administrator/components/com_contact/views/contacts/tmpl/default.php @@ -115,7 +115,7 @@ + value="ordering; ?>" class="width-20 text-area-order" /> @@ -187,8 +187,8 @@ 'bootstrap.renderModal', 'collapseModal', array( - 'title' => JText::_('COM_CONTACT_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') + 'title' => JText::_('COM_CONTACT_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer'), ), $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php index 0b87502a434f5..0553535534f84 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/modal.php +++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php @@ -88,9 +88,9 @@ 'icon-trash', - 0 => 'icon-unpublish', - 1 => 'icon-publish', - 2 => 'icon-archive', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ); ?> items as $i => $item) : ?> @@ -116,7 +116,7 @@ ?> - + diff --git a/administrator/components/com_contact/views/contacts/view.html.php b/administrator/components/com_contact/views/contacts/view.html.php index 81a2a48b2251c..47bcb57709178 100644 --- a/administrator/components/com_contact/views/contacts/view.html.php +++ b/administrator/components/com_contact/views/contacts/view.html.php @@ -81,9 +81,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Preprocess the list of items to find ordering divisions. @@ -135,12 +133,12 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_CONTACT_MANAGER_CONTACTS'), 'address contact'); - if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_contact', 'core.create'))) > 0) + if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_contact', 'core.create')) > 0) { JToolbarHelper::addNew('contact.add'); } - if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own'))) + if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolbarHelper::editList('contact.edit'); } @@ -198,15 +196,15 @@ protected function addToolbar() protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('JGLOBAL_TITLE'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('JGLOBAL_TITLE'), 'category_title' => JText::_('JCATEGORY'), - 'ul.name' => JText::_('COM_CONTACT_FIELD_LINKED_USER_LABEL'), - 'a.featured' => JText::_('JFEATURED'), - 'a.access' => JText::_('JGRID_HEADING_ACCESS'), - 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'ul.name' => JText::_('COM_CONTACT_FIELD_LINKED_USER_LABEL'), + 'a.featured' => JText::_('JFEATURED'), + 'a.access' => JText::_('JGRID_HEADING_ACCESS'), + 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.id' => JText::_('JGRID_HEADING_ID'), ); } } diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index d467380a479cb..01b5110bf3dda 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -3,10 +3,12 @@
+ description="COM_CONTENT_CONFIG_ARTICLE_SETTINGS_DESC" + > + > @@ -28,11 +31,12 @@ + class="btn-group btn-group-yesno" + default="1" + showon="show_title:1" + > @@ -40,10 +44,11 @@ + > @@ -51,9 +56,10 @@ + description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC" + default="0" + > @@ -62,10 +68,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -73,10 +80,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -84,11 +92,12 @@ + showon="show_category:1" + > @@ -96,10 +105,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -107,11 +117,12 @@ + showon="show_parent_category:1" + > @@ -125,11 +136,11 @@ + > @@ -137,12 +148,12 @@ + > @@ -156,10 +167,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -167,11 +179,12 @@ + showon="show_author:1" + > @@ -179,10 +192,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -190,10 +204,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -201,10 +216,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -212,10 +228,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -223,20 +240,23 @@ + class="btn-group btn-group-yesno" + default="0" + > + + class="btn-group btn-group-yesno" + default="1" + > @@ -244,11 +264,12 @@ + showon="show_readmore:1" + > @@ -263,13 +284,14 @@ /> + > @@ -279,13 +301,15 @@ type="spacer" hr="true" /> + + class="btn-group btn-group-yesno" + default="1" + > @@ -293,10 +317,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -304,10 +329,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -315,10 +341,11 @@ + class="btn-group btn-group-yesno" + default="1" + > @@ -326,107 +353,123 @@ + > + + description="COM_CONTENT_FIELD_URLSPOSITION_DESC" + default="0" + >
-
+ +
+ + > + + class="btn-group btn-group-yesno" + default="1" + > + + class="btn-group btn-group-yesno" + default="1" + > + + class="btn-group btn-group-yesno" + default="0" + > + + + class="btn-group btn-group-yesno" + default="0" + > + + class="btn-group btn-group-yesno" + default="0" + > + + + > + + > + + > + + > + + > @@ -501,65 +548,77 @@
-
+ + class="btn-group btn-group-yesno" + default="1" + > - + > - + > - + > - + > @@ -569,82 +628,92 @@ - + > - + > - + class="btn-group btn-group-yesno" + > - + > - + >
-
- + class="btn-group btn-group-yesno" + default="1" + > - + description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC" + default="-1" + > @@ -654,101 +723,109 @@ - + > - + > - + class="btn-group btn-group-yesno" + default="1" + >
-
- - + description="JGLOBAL_NUM_LEADING_ARTICLES_DESC" + default="1" + /> - - + description="JGLOBAL_NUM_INTRO_ARTICLES_DESC" + default="4" + /> - - + description="JGLOBAL_NUM_COLUMNS_DESC" + default="2" + /> - - + description="JGLOBAL_NUM_LINKS_DESC" + default="4" + /> - - - + > + + - - + description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC" + default="0" + > @@ -759,26 +836,32 @@
-
- + > - + description="JGLOBAL_FILTER_FIELD_DESC" + default="hide" + > @@ -786,181 +869,174 @@ - + > - + description="JGLOBAL_SHOW_DATE_DESC" + default="0" + > - - + > - + > - - - + description="JGLOBAL_LIST_VOTES_DESC" + default="0" + > + + - - - + description="JGLOBAL_LIST_RATINGS_DESC" + default="0" + > + +
-
- - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + default="published" + > - + description="JGLOBAL_PAGINATION_DESC" + default="2" + > - + > - + default="show" + > @@ -968,7 +1044,8 @@
-
@@ -976,10 +1053,11 @@ + > @@ -991,24 +1069,20 @@ description="JGLOBAL_FEED_SUMMARY_DESC" default="0" showon="show_feed_link:1" - > - - + > + + + > @@ -1016,11 +1090,11 @@ + > @@ -1040,6 +1114,7 @@ validate="rules" filter="rules" component="com_content" - section="component"/> + section="component" + />
diff --git a/administrator/components/com_content/helpers/content.php b/administrator/components/com_content/helpers/content.php index edd822c453a4c..be806fc1782e1 100644 --- a/administrator/components/com_content/helpers/content.php +++ b/administrator/components/com_content/helpers/content.php @@ -40,6 +40,12 @@ public static function addSubmenu($vName) $vName == 'categories' ); + JHtmlSidebar::addEntry( + JText::_('COM_CONTENT_SUBMENU_FEATURED'), + 'index.php?option=com_content&view=featured', + $vName == 'featured' + ); + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1')) { JHtmlSidebar::addEntry( @@ -53,12 +59,6 @@ public static function addSubmenu($vName) $vName == 'fields.groups' ); } - - JHtmlSidebar::addEntry( - JText::_('COM_CONTENT_SUBMENU_FEATURED'), - 'index.php?option=com_content&view=featured', - $vName == 'featured' - ); } /** diff --git a/administrator/components/com_content/helpers/html/contentadministrator.php b/administrator/components/com_content/helpers/html/contentadministrator.php index b3f7bd06dd9e3..f5e8da1c34520 100644 --- a/administrator/components/com_content/helpers/html/contentadministrator.php +++ b/administrator/components/com_content/helpers/html/contentadministrator.php @@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true) if ($canChange) { $html = '
'; + . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3]) + . '">'; } else { $html = ''; + . JHtml::_('tooltipText', $state[2]) . '">'; } return $html; diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 86daa1e1dae33..b6dba4d0cfefe 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -414,7 +414,7 @@ public function getForm($data = array(), $loadData = true) protected function loadFormData() { // Check the session for previously entered form data. - $app = JFactory::getApplication(); + $app = JFactory::getApplication(); $data = $app->getUserState('com_content.edit.article.data', array()); if (empty($data)) @@ -451,6 +451,38 @@ protected function loadFormData() return $data; } + /** + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return array|boolean Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 3.7.0 + */ + public function validate($form, $data, $group = null) + { + // Don't allow to change the users if not allowed to access com_users. + if (JFactory::getApplication()->isClient('administrator') && !JFactory::getUser()->authorise('core.manage', 'com_users')) + { + if (isset($data['created_by'])) + { + unset($data['created_by']); + } + + if (isset($data['modified_by'])) + { + unset($data['modified_by']); + } + } + + return parent::validate($form, $data, $group); + } + /** * Method to save the form data. * diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index dd4606404256a..9cbf323a94948 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -40,6 +40,7 @@ public function __construct($config = array()) 'state', 'a.state', 'access', 'a.access', 'access_level', 'created', 'a.created', + 'modified', 'a.modified', 'created_by', 'a.created_by', 'created_by_alias', 'a.created_by_alias', 'ordering', 'a.ordering', @@ -52,7 +53,8 @@ public function __construct($config = array()) 'author_id', 'category_id', 'level', - 'tag' + 'tag', + 'rating_count', 'rating', ); if (JLanguageAssociations::isEnabled()) @@ -174,7 +176,7 @@ protected function getListQuery() $this->getState( 'list.select', 'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' . - ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' . + ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits' . ', a.publish_up, a.publish_down' ) ); @@ -322,14 +324,8 @@ protected function getListQuery() } // Add the list ordering clause. - $orderCol = $this->state->get('list.fullordering', 'a.id'); - $orderDirn = ''; - - if (empty($orderCol)) - { - $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'DESC'); - } + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'DESC'); $query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn)); @@ -379,7 +375,7 @@ public function getItems() { $groups = JFactory::getUser()->getAuthorisedViewLevels(); - for ($x = 0, $count = count($items); $x < $count; $x++) + foreach (array_keys($items) as $x) { // Check the access level. Remove articles the user shouldn't see if (!in_array($items[$x]->access, $groups)) diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 1293c1abacc2a..c66dc0921f4f4 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -55,7 +55,8 @@ public function __construct($config = array()) 'author_id', 'category_id', 'level', - 'tag' + 'tag', + 'rating_count', 'rating', ); } @@ -220,14 +221,8 @@ protected function getListQuery() } // Add the list ordering clause. - $orderCol = $this->state->get('list.fullordering', 'a.title'); - $orderDirn = ''; - - if (empty($orderCol)) - { - $orderCol = $this->state->get('list.ordering', 'a.title'); - $orderDirn = $this->state->get('list.direction', 'ASC'); - } + $orderCol = $this->state->get('list.ordering', 'a.title'); + $orderDirn = $this->state->get('list.direction', 'ASC'); $query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn)); diff --git a/administrator/components/com_content/models/fields/votelist.php b/administrator/components/com_content/models/fields/votelist.php new file mode 100644 index 0000000000000..c116dbcb8ee28 --- /dev/null +++ b/administrator/components/com_content/models/fields/votelist.php @@ -0,0 +1,43 @@ +
- + - + - + required="true" + /> - + size="40" + /> - - - - - - - - - + size="45" + /> + + + + + + + + - - + default="" + /> - - + /> + /> - + filter="user_utc" + /> - + - + - + filter="user_utc" + /> - + - + - + - + filter="user_utc" + /> - + filter="user_utc" + /> - + - + - + - + - + - + - + > - + > -
@@ -166,19 +272,22 @@
- @@ -188,40 +297,42 @@ - - + @@ -246,10 +357,10 @@ @@ -258,10 +369,10 @@ @@ -270,10 +381,10 @@ @@ -282,10 +393,10 @@ @@ -294,9 +405,9 @@ @@ -306,10 +417,10 @@ @@ -318,10 +429,10 @@ @@ -330,10 +441,10 @@ @@ -342,10 +453,10 @@ @@ -354,9 +465,9 @@ @@ -366,10 +477,10 @@ @@ -378,10 +489,10 @@ @@ -390,10 +501,10 @@ @@ -402,10 +513,10 @@ @@ -414,10 +525,10 @@ @@ -426,10 +537,10 @@ @@ -438,10 +549,10 @@ @@ -450,10 +561,10 @@ @@ -465,63 +576,71 @@ hr="true" /> - + size="25" + /> - - + size="25" + />
+ + + @@ -534,140 +653,145 @@ type="hidden" label="JGLOBAL_SHOW_TITLE_LABEL" description="JGLOBAL_SHOW_TITLE_DESC" - > - + /> - + description="JGLOBAL_LINKED_TITLES_DESC" + /> - - + description="JGLOBAL_SHOW_INTRO_DESC" + /> - + description="JGLOBAL_SHOW_CATEGORY_DESC" + /> - + description="JGLOBAL_LINK_CATEGORY_DESC" + /> - + description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" + /> - + description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" + /> - + description="JGLOBAL_SHOW_AUTHOR_DESC" + /> - + description="JGLOBAL_LINK_AUTHOR_DESC" + /> - + description="JGLOBAL_SHOW_CREATE_DATE_DESC" + /> - + description="JGLOBAL_SHOW_MODIFY_DATE_DESC" + /> - + description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" + /> - + description="JGLOBAL_SHOW_NAVIGATION_DESC" + /> - + description="JGLOBAL_SHOW_ICONS_DESC" + /> - + description="JGLOBAL_SHOW_PRINT_ICON_DESC" + /> - + description="JGLOBAL_SHOW_EMAIL_ICON_DESC" + /> + - + /> + - + description="JGLOBAL_SHOW_HITS_DESC" + /> - + description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC" + /> - + size="25" + /> - - + size="20" + /> + description="COM_CONTENT_FIELD_INTRO_DESC" + /> + COM_CONTENT_LEFT - - + + + size="20" + /> + + /> + + description="COM_CONTENT_FIELD_FULL_DESC" + /> + COM_CONTENT_LEFT - - + + + size="20" + /> - + + + size="20" + /> + JBROWSERTARGET_POPUP + + /> + - + + + size="20" + /> + JBROWSERTARGET_POPUP + + /> + + /> + + size="20" + /> + - JGLOBAL_NOINDEX_NOFOLLOW - + - - + + + size="20" + />
- - + + +
diff --git a/administrator/components/com_content/models/forms/filter_articles.xml b/administrator/components/com_content/models/forms/filter_articles.xml index 3ac0fcdbbdcc8..e41c8d0d5e00f 100644 --- a/administrator/components/com_content/models/forms/filter_articles.xml +++ b/administrator/components/com_content/models/forms/filter_articles.xml @@ -8,6 +8,7 @@ description="COM_CONTENT_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + + + - - + name="author_id" + type="author" + label="COM_CONTENT_FILTER_AUTHOR" + description="COM_CONTENT_FILTER_AUTHOR_DESC" + onchange="this.form.submit();" + > + + + JOPTION_SELECT_LANGUAGE + + > - - + + + + JGRID_HEADING_LANGUAGE_DESC + + @@ -123,13 +133,14 @@ + diff --git a/administrator/components/com_content/models/forms/filter_featured.xml b/administrator/components/com_content/models/forms/filter_featured.xml index 2f7f1a9621a33..fe5b19b2a7155 100644 --- a/administrator/components/com_content/models/forms/filter_featured.xml +++ b/administrator/components/com_content/models/forms/filter_featured.xml @@ -8,6 +8,7 @@ description="COM_CONTENT_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + + + - - + name="author_id" + type="author" + label="COM_CONTENT_FILTER_AUTHOR" + description="COM_CONTENT_FILTER_AUTHOR_DESC" + onchange="this.form.submit();" + > + + + JOPTION_SELECT_LANGUAGE + + > - - - + + + + + JGRID_HEADING_ID_ASC + diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php index 4a3154fbb5161..299957ef8902a 100644 --- a/administrator/components/com_content/views/article/view.html.php +++ b/administrator/components/com_content/views/article/view.html.php @@ -69,9 +69,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // If we are forcing a language in modal (used for associations). diff --git a/administrator/components/com_content/views/articles/tmpl/default.php b/administrator/components/com_content/views/articles/tmpl/default.php index a06d75f48f795..6afa9bef0fa63 100644 --- a/administrator/components/com_content/views/articles/tmpl/default.php +++ b/administrator/components/com_content/views/articles/tmpl/default.php @@ -18,7 +18,7 @@ $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; $columns = 10; @@ -31,6 +31,10 @@ { $orderingColumn = 'publish_down'; } +elseif (strpos($listOrder, 'modified') !== false) +{ + $orderingColumn = 'modified'; +} else { $orderingColumn = 'created'; @@ -147,7 +151,7 @@ - + @@ -172,11 +176,6 @@ checked_out) : ?> editor, $item->checked_out_time, 'articles.', $canCheckin); ?> - language == '*') : ?> - - - language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - escape($item->title); ?> @@ -252,8 +251,8 @@ 'bootstrap.renderModal', 'collapseModal', array( - 'title' => JText::_('COM_CONTENT_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') + 'title' => JText::_('COM_CONTENT_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer'), ), $this->loadTemplate('batch_body') ); ?> diff --git a/administrator/components/com_content/views/articles/tmpl/modal.php b/administrator/components/com_content/views/articles/tmpl/modal.php index 686b71450018d..5f524f1d8f554 100644 --- a/administrator/components/com_content/views/articles/tmpl/modal.php +++ b/administrator/components/com_content/views/articles/tmpl/modal.php @@ -91,9 +91,9 @@ 'icon-trash', - 0 => 'icon-unpublish', - 1 => 'icon-publish', - 2 => 'icon-archive', + 0 => 'icon-unpublish', + 1 => 'icon-publish', + 2 => 'icon-archive', ); ?> items as $i => $item) : ?> @@ -119,7 +119,7 @@ ?> - + escape($onclick) . '"' diff --git a/administrator/components/com_content/views/articles/view.html.php b/administrator/components/com_content/views/articles/view.html.php index 76b97bddcdc3c..5c8ca3ab6fc4d 100644 --- a/administrator/components/com_content/views/articles/view.html.php +++ b/administrator/components/com_content/views/articles/view.html.php @@ -90,9 +90,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Levels filter - Used in Hathor. @@ -153,12 +151,12 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'stack article'); - if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_content', 'core.create'))) > 0) + if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0) { JToolbarHelper::addNew('article.add'); } - if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own'))) + if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolbarHelper::editList('article.edit'); } diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php index 4c41a9168e3b5..cd7c4ed7ff5c3 100644 --- a/administrator/components/com_content/views/featured/tmpl/default.php +++ b/administrator/components/com_content/views/featured/tmpl/default.php @@ -17,7 +17,7 @@ $user = JFactory::getUser(); $userId = $user->get('id'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'fp.ordering'; $columns = 10; @@ -141,7 +141,7 @@ - + @@ -166,11 +166,6 @@ checked_out) : ?> editor, $item->checked_out_time, 'articles.', $canCheckin); ?> - language == '*') : ?> - - - language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - escape($item->title); ?> @@ -203,7 +198,8 @@ {$orderingColumn}; echo $date > 0 ? JHtml::_('date', $date, JText::_('DATE_FORMAT_LC4')) : '-'; - ?> + ?> + hits; ?> diff --git a/administrator/components/com_content/views/featured/view.html.php b/administrator/components/com_content/views/featured/view.html.php index 0fbd1bd3aa920..9f2529c9c3c12 100644 --- a/administrator/components/com_content/views/featured/view.html.php +++ b/administrator/components/com_content/views/featured/view.html.php @@ -87,9 +87,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Levels filter - Used in Hathor. @@ -172,15 +170,15 @@ protected function addToolbar() protected function getSortFields() { return array( - 'fp.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.state' => JText::_('JSTATUS'), - 'a.title' => JText::_('JGLOBAL_TITLE'), + 'fp.ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.state' => JText::_('JSTATUS'), + 'a.title' => JText::_('JGLOBAL_TITLE'), 'category_title' => JText::_('JCATEGORY'), - 'access_level' => JText::_('JGRID_HEADING_ACCESS'), - 'a.created_by' => JText::_('JAUTHOR'), - 'language' => JText::_('JGRID_HEADING_LANGUAGE'), - 'a.created' => JText::_('JDATE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'access_level' => JText::_('JGRID_HEADING_ACCESS'), + 'a.created_by' => JText::_('JAUTHOR'), + 'language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.created' => JText::_('JDATE'), + 'a.id' => JText::_('JGRID_HEADING_ID'), ); } } diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php index 5b4d971fdb0f3..2b5801ea75710 100644 --- a/administrator/components/com_contenthistory/helpers/contenthistory.php +++ b/administrator/components/com_contenthistory/helpers/contenthistory.php @@ -29,6 +29,11 @@ public static function createObjectArray($object) { $result = array(); + if ($object === null) + { + return $result; + } + foreach ($object as $name => $value) { $result[$name] = $value; @@ -289,6 +294,11 @@ public static function mergeLabels($object, $formValues) { $result = new stdClass; + if ($object === null) + { + return $result; + } + $labelsArray = $formValues->labels; $valuesArray = $formValues->values; diff --git a/administrator/components/com_contenthistory/helpers/html/textdiff.php b/administrator/components/com_contenthistory/helpers/html/textdiff.php index 3b34ac97eca50..01906194ec875 100644 --- a/administrator/components/com_contenthistory/helpers/html/textdiff.php +++ b/administrator/components/com_contenthistory/helpers/html/textdiff.php @@ -4,7 +4,7 @@ * @subpackage com_contenthistory * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; diff --git a/administrator/components/com_contenthistory/views/compare/view.html.php b/administrator/components/com_contenthistory/views/compare/view.html.php index 701242388f6a0..d02063defff09 100644 --- a/administrator/components/com_contenthistory/views/compare/view.html.php +++ b/administrator/components/com_contenthistory/views/compare/view.html.php @@ -37,9 +37,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_contenthistory/views/history/tmpl/modal.php b/administrator/components/com_contenthistory/views/history/tmpl/modal.php index 70da60d755d3a..ce6de9d985568 100644 --- a/administrator/components/com_contenthistory/views/history/tmpl/modal.php +++ b/administrator/components/com_contenthistory/views/history/tmpl/modal.php @@ -91,15 +91,15 @@
- - - - -
diff --git a/administrator/components/com_contenthistory/views/history/view.html.php b/administrator/components/com_contenthistory/views/history/view.html.php index a3596af43d3d3..c26fcdc291b72 100644 --- a/administrator/components/com_contenthistory/views/history/view.html.php +++ b/administrator/components/com_contenthistory/views/history/view.html.php @@ -40,9 +40,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_contenthistory/views/preview/view.html.php b/administrator/components/com_contenthistory/views/preview/view.html.php index 726cbd4c9b87a..84d1932eb2de7 100644 --- a/administrator/components/com_contenthistory/views/preview/view.html.php +++ b/administrator/components/com_contenthistory/views/preview/view.html.php @@ -46,9 +46,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php index 6250e9d38af30..27b5d7824cf20 100644 --- a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php +++ b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php @@ -28,7 +28,7 @@
-
+
authorise('core.manage', 'com_postinstall') && $this->postinstall_message_count) : ?>
diff --git a/administrator/components/com_fields/controllers/field.php b/administrator/components/com_fields/controllers/field.php index 83b0dbb8979ae..d2205e87d837a 100644 --- a/administrator/components/com_fields/controllers/field.php +++ b/administrator/components/com_fields/controllers/field.php @@ -72,7 +72,15 @@ public function storeform() $app->setUserState($this->input->get('userstatevariable'), $data); } - $app->redirect(base64_decode($this->input->get->getBase64('return'))); + $redirectUrl = base64_decode($this->input->get->getBase64('return')); + + // Don't redirect to an external URL. + If (!JUri::isInternal($redirectUrl)) + { + $redirectUrl = 'index.php'; + } + + $app->redirect($redirectUrl); $app->close(); } diff --git a/administrator/components/com_fields/fields.php b/administrator/components/com_fields/fields.php index ef0dbf01d9c9a..0b806a0d3d4ca 100644 --- a/administrator/components/com_fields/fields.php +++ b/administrator/components/com_fields/fields.php @@ -22,7 +22,7 @@ if (!$parts || !JFactory::getUser()->authorise('core.manage', $parts[0])) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Fields'); diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php index aedb4666112b0..cc15aa96ae5fb 100644 --- a/administrator/components/com_fields/helpers/fields.php +++ b/administrator/components/com_fields/helpers/fields.php @@ -277,6 +277,8 @@ public static function prepareForm($context, JForm $form, $data) return true; } + $context = $parts[0] . '.' . $parts[1]; + // When no fields available return here $fields = self::getFields($parts[0] . '.' . $parts[1], new JObject); @@ -403,10 +405,13 @@ function categoryHasChanged(element) { // On the front, sometimes the admin fields path is not included JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables'); + $model = JModelLegacy::getInstance('Groups', 'FieldsModel', array('ignore_request' => true)); + $model->setState('filter.context', $context); + // Looping through the groups - foreach ($fieldsPerGroup as $group_id => $groupFields) + foreach ($model->getItems() as $group) { - if (!$groupFields) + if (empty($fieldsPerGroup[$group->id])) { continue; } @@ -414,49 +419,32 @@ function categoryHasChanged(element) { // Defining the field set /** @var DOMElement $fieldset */ $fieldset = $fieldsNode->appendChild(new DOMElement('fieldset')); - $fieldset->setAttribute('name', 'fields-' . $group_id); + $fieldset->setAttribute('name', 'fields-' . $group->id); $fieldset->setAttribute('addfieldpath', '/administrator/components/' . $component . '/models/fields'); $fieldset->setAttribute('addrulepath', '/administrator/components/' . $component . '/models/rules'); - $label = ''; - $description = ''; + $label = $group->title; + $description = $group->description; - if ($group_id) + if (!$label) { - $group = JTable::getInstance('Group', 'FieldsTable'); - $group->load($group_id); + $key = strtoupper($component . '_FIELDS_' . $section . '_LABEL'); - if ($group->id) + if (!JFactory::getLanguage()->hasKey($key)) { - $label = $group->title; - $description = $group->description; + $key = 'JGLOBAL_FIELDS'; } + + $label = $key; } - if (!$label || !$description) + if (!$description) { - $lang = JFactory::getLanguage(); + $key = strtoupper($component . '_FIELDS_' . $section . '_DESC'); - if (!$label) + if (JFactory::getLanguage()->hasKey($key)) { - $key = strtoupper($component . '_FIELDS_' . $section . '_LABEL'); - - if (!$lang->hasKey($key)) - { - $key = 'JGLOBAL_FIELDS'; - } - - $label = $key; - } - - if (!$description) - { - $key = strtoupper($component . '_FIELDS_' . $section . '_DESC'); - - if ($lang->hasKey($key)) - { - $description = $key; - } + $description = $key; } } @@ -464,11 +452,11 @@ function categoryHasChanged(element) { $fieldset->setAttribute('description', strip_tags($description)); // Looping through the fields for that context - foreach ($groupFields as $field) + foreach ($fieldsPerGroup[$group->id] as $field) { try { - JEventDispatcher::getInstance()->trigger('onCustomFieldsPrepareDom', array($field, $fieldset, $form)); + JFactory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($field, $fieldset, $form)); /* * If the field belongs to an assigned_cat_id but the assigned_cat_ids in the data diff --git a/administrator/components/com_fields/libraries/fieldslistplugin.php b/administrator/components/com_fields/libraries/fieldslistplugin.php index 92f9cb83dc54e..2074010440035 100644 --- a/administrator/components/com_fields/libraries/fieldslistplugin.php +++ b/administrator/components/com_fields/libraries/fieldslistplugin.php @@ -41,8 +41,8 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form foreach ($this->getOptionsFromField($field) as $value => $name) { - $option = new DOMElement('option', htmlentities($value)); - $option->nodeValue = htmlentities(JText::_($name)); + $option = new DOMElement('option', htmlspecialchars($value, ENT_COMPAT, 'UTF-8')); + $option->nodeValue = htmlspecialchars(JText::_($name), ENT_COMPAT, 'UTF-8'); $element = $fieldNode->appendChild($option); $element->setAttribute('value', $value); diff --git a/administrator/components/com_fields/libraries/fieldsplugin.php b/administrator/components/com_fields/libraries/fieldsplugin.php index f5d9c1973079b..84eca9a148988 100644 --- a/administrator/components/com_fields/libraries/fieldsplugin.php +++ b/administrator/components/com_fields/libraries/fieldsplugin.php @@ -166,13 +166,6 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form $node->setAttribute('class', $field->params->get('class')); $node->setAttribute('hint', $field->params->get('hint')); $node->setAttribute('required', $field->required ? 'true' : 'false'); - $node->setAttribute('readonly', $field->params->get('readonly', 0) ? 'true' : 'false'); - - // Set the disabled state based on the parameter and the permission - if ($field->params->get('disabled', 0)) - { - $node->setAttribute('disabled', 'true'); - } // Combine the two params $params = clone $this->params; diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php index 6dcb19fc63622..ce320dc5aaafc 100644 --- a/administrator/components/com_fields/models/field.php +++ b/administrator/components/com_fields/models/field.php @@ -109,7 +109,7 @@ public function save($data) if ($data['title'] == $origTable->title) { - list($title, $name) = $this->generateNewTitle($data['group_id'], $data['alias'], $data['title']); + list($title, $name) = $this->generateNewTitle($data['group_id'], $data['name'], $data['title']); $data['title'] = $title; $data['label'] = $title; $data['name'] = $name; @@ -565,9 +565,8 @@ public function setFieldValue($fieldId, $itemId, $value) $params = new Registry($params); } - // Don't save the value when the field is disabled or the user is - // not authorized to change it - if (!$field || $params->get('disabled', 0) || !FieldsHelper::canEditFieldValue($field)) + // Don't save the value when the user is not authorized to change it + if (!$field || !FieldsHelper::canEditFieldValue($field)) { return false; } @@ -921,6 +920,7 @@ protected function loadFormData() protected function preprocessForm(JForm $form, $data, $group = 'content') { $component = $this->state->get('field.component'); + $section = $this->state->get('field.section'); $dataObject = $data; if (is_array($dataObject)) @@ -968,6 +968,21 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $form->setFieldAttribute('group_id', 'context', $this->state->get('field.context')); $form->setFieldAttribute('rules', 'component', $component); + // Looking first in the component models/forms folder + $path = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fields/' . $section . '.xml'); + + if (file_exists($path)) + { + $lang = JFactory::getLanguage(); + $lang->load($component, JPATH_BASE, null, false, true); + $lang->load($component, JPATH_BASE . '/components/' . $component, null, false, true); + + if (!$form->loadFile($path, false)) + { + throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); + } + } + // Trigger the default form events. parent::preprocessForm($form, $data, $group); } diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php index 91f043aef0a7f..56620b66212b8 100644 --- a/administrator/components/com_fields/models/fields.php +++ b/administrator/components/com_fields/models/fields.php @@ -228,7 +228,7 @@ protected function getListQuery() } // Implement View Level Access - if (!$user->authorise('core.admin')) + if (!$app->isClient('administrator') || !$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); $query->where('a.access IN (' . $groups . ') AND (a.group_id = 0 OR g.access IN (' . $groups . '))'); @@ -302,15 +302,9 @@ protected function getListQuery() } // Add the list ordering clause - $listOrdering = $this->getState('list.fullordering', 'a.ordering'); - $orderDirn = ''; + $listOrdering = $this->state->get('list.ordering', 'a.ordering'); + $orderDirn = $this->state->get('list.direction', 'ASC'); - if (empty($listOrdering)) - { - $listOrdering = $this->state->get('list.ordering', 'a.ordering'); - $orderDirn = $this->state->get('list.direction', 'DESC'); - } - $query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn)); return $query; @@ -350,7 +344,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) * @param array $data data * @param boolean $loadData load current data * - * @return JForm/false the JForm object or false + * @return JForm|false the JForm object or false * * @since 3.7.0 */ diff --git a/administrator/components/com_fields/models/fields/fieldgroups.php b/administrator/components/com_fields/models/fields/fieldgroups.php index 0adac1584a04a..cf92647ed746b 100644 --- a/administrator/components/com_fields/models/fields/fieldgroups.php +++ b/administrator/components/com_fields/models/fields/fieldgroups.php @@ -31,7 +31,7 @@ class JFormFieldFieldgroups extends JFormFieldList protected function getOptions() { $context = (string) $this->element['context']; - $states = $this->element['state'] ? $this->element['state'] : '0,1'; + $states = $this->element['state'] ?: '0,1'; $states = ArrayHelper::toInteger(explode(',', $states)); $user = JFactory::getUser(); @@ -44,6 +44,7 @@ protected function getOptions() $query->where('state IN (' . implode(',', $states) . ')'); $query->where('context = ' . $db->quote($context)); $query->where('access IN (' . implode(',', $viewlevels) . ')'); + $query->order('ordering asc, id asc'); $db->setQuery($query); $options = $db->loadObjectList(); diff --git a/administrator/components/com_fields/models/fields/section.php b/administrator/components/com_fields/models/fields/section.php index 4d74202c1d61b..9532ac633c485 100644 --- a/administrator/components/com_fields/models/fields/section.php +++ b/administrator/components/com_fields/models/fields/section.php @@ -24,7 +24,7 @@ class JFormFieldSection extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * diff --git a/administrator/components/com_fields/models/fields/type.php b/administrator/components/com_fields/models/fields/type.php index 054fb68b9b9f0..aa24240595cdb 100644 --- a/administrator/components/com_fields/models/fields/type.php +++ b/administrator/components/com_fields/models/fields/type.php @@ -24,7 +24,7 @@ class JFormFieldType extends JFormFieldList * * @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object. * @param mixed $value The form field value to validate. - * @param string $group The field name group control value. This acts as as an array container for the field. + * @param string $group The field name group control value. This acts as an array container for the field. * For example if the field has name="foo" and the group value is set to "bar" then the * full field name would end up being "bar[foo]". * diff --git a/administrator/components/com_fields/models/forms/field.xml b/administrator/components/com_fields/models/forms/field.xml index 69398da5f8f29..0e2e105937d8c 100644 --- a/administrator/components/com_fields/models/forms/field.xml +++ b/administrator/components/com_fields/models/forms/field.xml @@ -4,9 +4,9 @@ @@ -27,7 +27,7 @@ type="fieldgroups" label="COM_FIELDS_FIELD_GROUP_LABEL" description="COM_FIELDS_FIELD_GROUP_DESC" - > + > @@ -35,10 +35,10 @@ name="assigned_cat_ids" type="category" label="JCATEGORY" - extension="com_content" description="JFIELD_FIELDS_CATEGORY_DESC" + extension="com_content" multiple="true" - > + > @@ -65,19 +65,19 @@ name="type" type="type" label="COM_FIELDS_FIELD_TYPE_LABEL" - default="text" description="COM_FIELDS_FIELD_TYPE_DESC" + default="text" required="true" /> + class="btn-group btn-group-yesno" + default="0" + > @@ -85,20 +85,20 @@ + > @@ -107,9 +107,9 @@ + > @@ -189,8 +189,8 @@ name="description" type="textarea" label="JGLOBAL_DESCRIPTION" - size="40" description="COM_FIELDS_FIELD_DESCRIPTION_DESC" + size="40" filter="HTML" /> @@ -202,10 +202,10 @@ />
+
+ class="btn-group btn-group-yesno" + default="1" + > - - - - - - - - - - + class="btn-group btn-group-yesno" + default="" + > @@ -304,7 +281,7 @@ label="COM_FIELDS_FIELD_DISPLAY_LABEL" description="COM_FIELDS_FIELD_DISPLAY_DESC" default="2" - > + > diff --git a/administrator/components/com_fields/models/forms/filter_fields.xml b/administrator/components/com_fields/models/forms/filter_fields.xml index be53abbe5cea9..aca47a63e508b 100644 --- a/administrator/components/com_fields/models/forms/filter_fields.xml +++ b/administrator/components/com_fields/models/forms/filter_fields.xml @@ -20,7 +20,7 @@ name="state" type="status" onchange="this.form.submit();" - > + > @@ -45,7 +45,7 @@ name="access" type="accesslevel" onchange="this.form.submit();" - > + > @@ -53,7 +53,7 @@ name="language" type="contentlanguage" onchange="this.form.submit();" - > + > @@ -63,11 +63,11 @@ name="fullordering" type="list" label="JGLOBAL_SORT_BY" - statuses="*,0,1,2,-2" description="JGLOBAL_SORT_BY" + statuses="*,0,1,2,-2" onchange="this.form.submit();" default="a.ordering ASC" - > + > @@ -90,9 +90,10 @@ diff --git a/administrator/components/com_fields/models/forms/group.xml b/administrator/components/com_fields/models/forms/group.xml index d4e4e114368d3..575054f15fd23 100644 --- a/administrator/components/com_fields/models/forms/group.xml +++ b/administrator/components/com_fields/models/forms/group.xml @@ -41,7 +41,7 @@ description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" default="1" - > + > @@ -74,7 +74,7 @@ name="created_by" type="user" label="JGLOBAL_FIELD_CREATED_BY_LABEL" - desc="JGLOBAL_FIELD_CREATED_BY_DESC" + description="JGLOBAL_FIELD_CREATED_BY_DESC" /> -
diff --git a/administrator/components/com_fields/models/groups.php b/administrator/components/com_fields/models/groups.php index beb82f0d2ad4b..bf0edd52e1685 100644 --- a/administrator/components/com_fields/models/groups.php +++ b/administrator/components/com_fields/models/groups.php @@ -121,13 +121,7 @@ protected function getListQuery() $user = JFactory::getUser(); // Select the required fields from the table. - $query->select( - $this->getState( - 'list.select', - 'a.id, a.title, a.checked_out, a.checked_out_time, a.note' . - ', a.state, a.access, a.created, a.created_by, a.ordering, a.language' - ) - ); + $query->select($this->getState('list.select', 'a.*')); $query->from('#__fields_groups AS a'); // Join over the language diff --git a/administrator/components/com_fields/tables/field.php b/administrator/components/com_fields/tables/field.php index 0d64971277bee..452e4398b1fa9 100644 --- a/administrator/components/com_fields/tables/field.php +++ b/administrator/components/com_fields/tables/field.php @@ -78,7 +78,7 @@ public function bind($src, $ignore = '') * * @return boolean True if the instance is sane and able to be stored in the database. * - * @link https://docs.joomla.org/JTable/check + * @link https://docs.joomla.org/Special:MyLanguage/JTable/check * @since 3.7.0 */ public function check() @@ -177,7 +177,7 @@ protected function _getAssetName() * * @return string The string to use as the title in the asset table. * - * @link https://docs.joomla.org/JTable/getAssetTitle + * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle * @since 3.7.0 */ protected function _getAssetTitle() diff --git a/administrator/components/com_fields/tables/group.php b/administrator/components/com_fields/tables/group.php index ec160ddc46336..200231e56a3da 100644 --- a/administrator/components/com_fields/tables/group.php +++ b/administrator/components/com_fields/tables/group.php @@ -71,7 +71,7 @@ public function bind($src, $ignore = '') * * @return boolean True if the instance is sane and able to be stored in the database. * - * @link https://docs.joomla.org/JTable/check + * @link https://docs.joomla.org/Special:MyLanguage/JTable/check * @since 3.7.0 */ public function check() @@ -133,7 +133,7 @@ protected function _getAssetName() * * @return string The string to use as the title in the asset table. * - * @link https://docs.joomla.org/JTable/getAssetTitle + * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle * @since 3.7.0 */ protected function _getAssetTitle() diff --git a/administrator/components/com_fields/views/field/view.html.php b/administrator/components/com_fields/views/field/view.html.php index 32f5c449f7cb8..8c7940a725a80 100644 --- a/administrator/components/com_fields/views/field/view.html.php +++ b/administrator/components/com_fields/views/field/view.html.php @@ -57,9 +57,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JFactory::getApplication()->input->set('hidemainmenu', true); diff --git a/administrator/components/com_fields/views/fields/tmpl/default.php b/administrator/components/com_fields/views/fields/tmpl/default.php index e05c47f302200..cb96ce15463ad 100644 --- a/administrator/components/com_fields/views/fields/tmpl/default.php +++ b/administrator/components/com_fields/views/fields/tmpl/default.php @@ -20,7 +20,7 @@ $userId = $user->get('id'); $context = $this->escape($this->state->get('filter.context')); $component = $this->state->get('filter.component'); -$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); +$listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.ordering'); $saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc'); diff --git a/administrator/components/com_fields/views/fields/tmpl/modal.php b/administrator/components/com_fields/views/fields/tmpl/modal.php index d4ddd216f03c4..49d63ab82dfeb 100644 --- a/administrator/components/com_fields/views/fields/tmpl/modal.php +++ b/administrator/components/com_fields/views/fields/tmpl/modal.php @@ -17,6 +17,7 @@ JHtml::_('behavior.core'); JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('script', 'com_fields/admin-fields-modal.js', array('version' => 'auto', 'relative' => true)); // Special case for the search field tooltip. $searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter'); @@ -25,16 +26,6 @@ $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $editor = JFactory::getApplication()->input->get('editor', '', 'cmd'); - -JFactory::getDocument()->addScriptDeclaration(' -fieldIns = function(id) { - window.parent.jInsertEditorText("{field " + id + "}", "' . $editor . '"); - window.parent.jModalClose(); -}; -fieldgroupIns = function(id) { - window.parent.jInsertEditorText("{fieldgroup " + id + "}", "' . $editor . '"); - window.parent.jModalClose(); -};'); ?>
@@ -91,13 +82,13 @@ ?> - + - escape($item->title); ?> + escape($item->title); ?> - group_id ? $this->escape($item->group_title) : JText::_('JNONE'); ?> + group_id ? $this->escape($item->group_title) : JText::_('JNONE'); ?> type; ?> diff --git a/administrator/components/com_fields/views/fields/view.html.php b/administrator/components/com_fields/views/fields/view.html.php index a6cefc6fe9e25..da6aa7f407f92 100644 --- a/administrator/components/com_fields/views/fields/view.html.php +++ b/administrator/components/com_fields/views/fields/view.html.php @@ -78,9 +78,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Display a warning if the fields system plugin is disabled diff --git a/administrator/components/com_fields/views/group/view.html.php b/administrator/components/com_fields/views/group/view.html.php index 9b89f2527e17a..0b5789c33aace 100644 --- a/administrator/components/com_fields/views/group/view.html.php +++ b/administrator/components/com_fields/views/group/view.html.php @@ -75,9 +75,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JFactory::getApplication()->input->set('hidemainmenu', true); diff --git a/administrator/components/com_fields/views/groups/view.html.php b/administrator/components/com_fields/views/groups/view.html.php index f0bdcec38b51f..3450e1acec288 100644 --- a/administrator/components/com_fields/views/groups/view.html.php +++ b/administrator/components/com_fields/views/groups/view.html.php @@ -78,9 +78,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Display a warning if the fields system plugin is disabled diff --git a/administrator/components/com_finder/config.xml b/administrator/components/com_finder/config.xml index 6c3e4491d6d81..20e95a924b43f 100644 --- a/administrator/components/com_finder/config.xml +++ b/administrator/components/com_finder/config.xml @@ -3,185 +3,230 @@
+ description="COM_FINDER_FIELDSET_SEARCH_OPTIONS_DESCRIPTION" + > + + > + + > + - + > + + > + + > - + > - + > + + > - + > + + > + + > - + > - + > + + > + + +
+
+ description="COM_FINDER_FIELDSET_INDEX_OPTIONS_DESCRIPTION" + > + + default="50" + validate="options" + > @@ -193,86 +238,107 @@ + + size="10" + default="30000" + filter="integer" + /> + + /> + + /> + + /> + + /> + + /> + + > + + > + + > +
+
+ description="JCONFIG_PERMISSIONS_DESC" + > + + section="component" + /> +
diff --git a/administrator/components/com_finder/controller.php b/administrator/components/com_finder/controller.php index 48b9014d479b4..9a02f2ddf331a 100644 --- a/administrator/components/com_finder/controller.php +++ b/administrator/components/com_finder/controller.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/controllers/filter.php b/administrator/components/com_finder/controllers/filter.php index b3bba2c42a6c9..3a488e82d6e07 100644 --- a/administrator/components/com_finder/controllers/filter.php +++ b/administrator/components/com_finder/controllers/filter.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -121,7 +121,7 @@ public function save($key = null, $urlVar = null) // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { - if (($errors[$i]) instanceof Exception) + if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } diff --git a/administrator/components/com_finder/controllers/filters.php b/administrator/components/com_finder/controllers/filters.php index 5a03f1a6c04f1..efd2bac416c2e 100644 --- a/administrator/components/com_finder/controllers/filters.php +++ b/administrator/components/com_finder/controllers/filters.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/controllers/index.php b/administrator/components/com_finder/controllers/index.php index fff73f3b77e2b..0be6d0054d77d 100644 --- a/administrator/components/com_finder/controllers/index.php +++ b/administrator/components/com_finder/controllers/index.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/controllers/indexer.json.php b/administrator/components/com_finder/controllers/indexer.json.php index ac6e08e8b4570..71683cf008adc 100644 --- a/administrator/components/com_finder/controllers/indexer.json.php +++ b/administrator/components/com_finder/controllers/indexer.json.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/controllers/maps.php b/administrator/components/com_finder/controllers/maps.php index 74e3df9052b4b..24b4413fcda6f 100644 --- a/administrator/components/com_finder/controllers/maps.php +++ b/administrator/components/com_finder/controllers/maps.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/finder.php b/administrator/components/com_finder/finder.php index c386a830d2758..fc2aab405eced 100644 --- a/administrator/components/com_finder/finder.php +++ b/administrator/components/com_finder/finder.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/finder.php b/administrator/components/com_finder/helpers/finder.php index 824304147561c..d58de10516bfd 100644 --- a/administrator/components/com_finder/helpers/finder.php +++ b/administrator/components/com_finder/helpers/finder.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/html/finder.php b/administrator/components/com_finder/helpers/html/finder.php index d31ebeb2f2447..1daa519138692 100644 --- a/administrator/components/com_finder/helpers/html/finder.php +++ b/administrator/components/com_finder/helpers/html/finder.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/adapter.php b/administrator/components/com_finder/helpers/indexer/adapter.php index e73547a10be83..22f1ab5cc2b01 100644 --- a/administrator/components/com_finder/helpers/indexer/adapter.php +++ b/administrator/components/com_finder/helpers/indexer/adapter.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/driver/mysql.php b/administrator/components/com_finder/helpers/indexer/driver/mysql.php index 20cfa9ffbeb27..ac62b74527233 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/mysql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/mysql.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -140,8 +140,8 @@ public function index($item, $format = 'html') . $db->quote($item->publish_end_date) . ', ' . $db->quote($item->start_date) . ', ' . $db->quote($item->end_date) . ', ' - . (double) ($item->list_price ? $item->list_price : 0) . ', ' - . (double) ($item->sale_price ? $item->sale_price : 0) + . (double) ($item->list_price ?: 0) . ', ' + . (double) ($item->sale_price ?: 0) ); $db->setQuery($query); $db->execute(); @@ -167,8 +167,8 @@ public function index($item, $format = 'html') ->set($db->quoteName('publish_end_date') . ' = ' . $db->quote($item->publish_end_date)) ->set($db->quoteName('start_date') . ' = ' . $db->quote($item->start_date)) ->set($db->quoteName('end_date') . ' = ' . $db->quote($item->end_date)) - ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ? $item->list_price : 0)) - ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ? $item->sale_price : 0)) + ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ?: 0)) + ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ?: 0)) ->where('link_id = ' . (int) $linkId); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php index 9b454cdf73a3d..dfe26f28403f7 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -132,8 +132,8 @@ public function index($item, $format = 'html') . $db->quote($item->publish_end_date) . ', ' . $db->quote($item->start_date) . ', ' . $db->quote($item->end_date) . ', ' - . (double) ($item->list_price ? $item->list_price : 0) . ', ' - . (double) ($item->sale_price ? $item->sale_price : 0) + . (double) ($item->list_price ?: 0) . ', ' + . (double) ($item->sale_price ?: 0) ); $db->setQuery($query); $db->execute(); @@ -159,8 +159,8 @@ public function index($item, $format = 'html') ->set($db->quoteName('publish_end_date') . ' = ' . $db->quote($item->publish_end_date)) ->set($db->quoteName('start_date') . ' = ' . $db->quote($item->start_date)) ->set($db->quoteName('end_date') . ' = ' . $db->quote($item->end_date)) - ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ? $item->list_price : 0)) - ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ? $item->sale_price : 0)) + ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ?: 0)) + ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ?: 0)) ->where('link_id = ' . (int) $linkId); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php b/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php index bea14157e0430..e89e19bad1d52 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php +++ b/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -140,8 +140,8 @@ public function index($item, $format = 'html') . $db->quote($item->publish_end_date) . ', ' . $db->quote($item->start_date) . ', ' . $db->quote($item->end_date) . ', ' - . (double) ($item->list_price ? $item->list_price : 0) . ', ' - . (double) ($item->sale_price ? $item->sale_price : 0) + . (double) ($item->list_price ?: 0) . ', ' + . (double) ($item->sale_price ?: 0) ); $db->setQuery($query); $db->execute(); @@ -167,8 +167,8 @@ public function index($item, $format = 'html') ->set($db->quoteName('publish_end_date') . ' = ' . $db->quote($item->publish_end_date)) ->set($db->quoteName('start_date') . ' = ' . $db->quote($item->start_date)) ->set($db->quoteName('end_date') . ' = ' . $db->quote($item->end_date)) - ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ? $item->list_price : 0)) - ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ? $item->sale_price : 0)) + ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ?: 0)) + ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ?: 0)) ->where('link_id = ' . (int) $linkId); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php index 312c2f906d745..e46e9d3803f3c 100644 --- a/administrator/components/com_finder/helpers/indexer/helper.php +++ b/administrator/components/com_finder/helpers/indexer/helper.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php index 8648d39326b03..e62907ec87767 100644 --- a/administrator/components/com_finder/helpers/indexer/indexer.php +++ b/administrator/components/com_finder/helpers/indexer/indexer.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/parser.php b/administrator/components/com_finder/helpers/indexer/parser.php index 943f0b5c6c12f..04cd9614586f6 100644 --- a/administrator/components/com_finder/helpers/indexer/parser.php +++ b/administrator/components/com_finder/helpers/indexer/parser.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php index f7f3fcf2cac5e..bb0fb1bd7f067 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/html.php +++ b/administrator/components/com_finder/helpers/indexer/parser/html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/parser/rtf.php b/administrator/components/com_finder/helpers/indexer/parser/rtf.php index 37872f5f2f773..e230608085775 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/rtf.php +++ b/administrator/components/com_finder/helpers/indexer/parser/rtf.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/parser/txt.php b/administrator/components/com_finder/helpers/indexer/parser/txt.php index a58aa646163a3..15a11387858ef 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/txt.php +++ b/administrator/components/com_finder/helpers/indexer/parser/txt.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php index fd83b4509ed7b..d4d6522d8b7fa 100644 --- a/administrator/components/com_finder/helpers/indexer/query.php +++ b/administrator/components/com_finder/helpers/indexer/query.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -346,9 +346,10 @@ public function toUri($base = null) // Get the menu item id. $query = array( 'view' => $uri->getVar('view'), - 'f' => $uri->getVar('f'), - 'q' => $uri->getVar('q') + 'f' => $uri->getVar('f'), + 'q' => $uri->getVar('q'), ); + $item = FinderHelperRoute::getItemid($query); // Add the menu item id if present. @@ -742,7 +743,7 @@ protected function processString($input, $lang, $mode) */ $patterns = array( 'before' => JText::_('COM_FINDER_FILTER_WHEN_BEFORE'), - 'after' => JText::_('COM_FINDER_FILTER_WHEN_AFTER') + 'after' => JText::_('COM_FINDER_FILTER_WHEN_AFTER'), ); // Add the taxonomy branch titles to the possible patterns. @@ -753,7 +754,7 @@ protected function processString($input, $lang, $mode) } // Container for search terms and phrases. - $terms = array(); + $terms = array(); $phrases = array(); // Cleared filter branches. @@ -964,8 +965,8 @@ protected function processString($input, $lang, $mode) // An array of our boolean operators. $operator => $translation $operators = array( 'AND' => StringHelper::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_AND')), - 'OR' => StringHelper::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_OR')), - 'NOT' => StringHelper::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_NOT')) + 'OR' => StringHelper::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_OR')), + 'NOT' => StringHelper::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_NOT')), ); // If language debugging is enabled you need to ignore the debug strings in matching. diff --git a/administrator/components/com_finder/helpers/indexer/result.php b/administrator/components/com_finder/helpers/indexer/result.php index 623c57d753bba..25b5c5d517d2b 100644 --- a/administrator/components/com_finder/helpers/indexer/result.php +++ b/administrator/components/com_finder/helpers/indexer/result.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -40,10 +40,10 @@ class FinderIndexerResult */ protected $instructions = array( FinderIndexer::TITLE_CONTEXT => array('title', 'subtitle', 'id'), - FinderIndexer::TEXT_CONTEXT => array('summary', 'body'), - FinderIndexer::META_CONTEXT => array('meta', 'list_price', 'sale_price'), - FinderIndexer::PATH_CONTEXT => array('path', 'alias'), - FinderIndexer::MISC_CONTEXT => array('comments') + FinderIndexer::TEXT_CONTEXT => array('summary', 'body'), + FinderIndexer::META_CONTEXT => array('meta', 'list_price', 'sale_price'), + FinderIndexer::PATH_CONTEXT => array('path', 'alias'), + FinderIndexer::MISC_CONTEXT => array('comments'), ); /** diff --git a/administrator/components/com_finder/helpers/indexer/stemmer.php b/administrator/components/com_finder/helpers/indexer/stemmer.php index f1853a59d4809..cf96686c45c8a 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php index 6d0d77cc663fd..9b8bb5b4ce1c5 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -199,7 +199,7 @@ private static function check($reversed_stem) } // And at least one of these must be a vowel or "y" - return (preg_match('/[' . $vars['vowels'] . ']/', utf8_encode($reversed_stem))); + return preg_match('/[' . $vars['vowels'] . ']/', utf8_encode($reversed_stem)); } } @@ -234,7 +234,7 @@ private static function getStem($input) $rule = $vars['rules'][$rule_number]; preg_match($vars['rule_pattern'], $rule, $matches); - if (($matches[2] != '*') || ($intact)) + if ($matches[2] != '*' || $intact) { $reversed_stem = utf8_decode($matches[4]) . substr($reversed_input, $matches[3], strlen($reversed_input) - $matches[3]); diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php index 59b561a2465ef..4be1b8e4a498b 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php b/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php index e691d870714fd..7c2f77243881f 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/taxonomy.php b/administrator/components/com_finder/helpers/indexer/taxonomy.php index 1f022f8d27ed6..75b7a40529f76 100644 --- a/administrator/components/com_finder/helpers/indexer/taxonomy.php +++ b/administrator/components/com_finder/helpers/indexer/taxonomy.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/indexer/token.php b/administrator/components/com_finder/helpers/indexer/token.php index b359fd52f0704..f5602e34717f6 100644 --- a/administrator/components/com_finder/helpers/indexer/token.php +++ b/administrator/components/com_finder/helpers/indexer/token.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/helpers/language.php b/administrator/components/com_finder/helpers/language.php index 3a84cb8ff3abb..169dc710cd41f 100644 --- a/administrator/components/com_finder/helpers/language.php +++ b/administrator/components/com_finder/helpers/language.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/models/fields/branches.php b/administrator/components/com_finder/models/fields/branches.php index bd3b8f6b7bc78..dcf416f0cfe9f 100644 --- a/administrator/components/com_finder/models/fields/branches.php +++ b/administrator/components/com_finder/models/fields/branches.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die(); diff --git a/administrator/components/com_finder/models/fields/contentmap.php b/administrator/components/com_finder/models/fields/contentmap.php index 0f55e16111952..3e12dacff3a5c 100644 --- a/administrator/components/com_finder/models/fields/contentmap.php +++ b/administrator/components/com_finder/models/fields/contentmap.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; diff --git a/administrator/components/com_finder/models/fields/contenttypes.php b/administrator/components/com_finder/models/fields/contenttypes.php index 9cdbda8b583bd..dee0f1cc8af98 100644 --- a/administrator/components/com_finder/models/fields/contenttypes.php +++ b/administrator/components/com_finder/models/fields/contenttypes.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die(); diff --git a/administrator/components/com_finder/models/fields/directories.php b/administrator/components/com_finder/models/fields/directories.php index 890612c8727bc..fdb24125d3c81 100644 --- a/administrator/components/com_finder/models/fields/directories.php +++ b/administrator/components/com_finder/models/fields/directories.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/models/fields/searchfilter.php b/administrator/components/com_finder/models/fields/searchfilter.php index 371ca13ecdab9..d4a36094ba2f0 100644 --- a/administrator/components/com_finder/models/fields/searchfilter.php +++ b/administrator/components/com_finder/models/fields/searchfilter.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die(); diff --git a/administrator/components/com_finder/models/filter.php b/administrator/components/com_finder/models/filter.php index fde588a811e63..17e1d6fe0d1a2 100644 --- a/administrator/components/com_finder/models/filter.php +++ b/administrator/components/com_finder/models/filter.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/models/filters.php b/administrator/components/com_finder/models/filters.php index 3f33df3b23944..470091e572bfe 100644 --- a/administrator/components/com_finder/models/filters.php +++ b/administrator/components/com_finder/models/filters.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/models/forms/filter.xml b/administrator/components/com_finder/models/forms/filter.xml index b0a311e78ac4b..f281aa884712c 100644 --- a/administrator/components/com_finder/models/forms/filter.xml +++ b/administrator/components/com_finder/models/forms/filter.xml @@ -1,20 +1,36 @@
- + - + - + hint="JFIELD_ALIAS_PLACEHOLDER" + size="45" + /> - + - - + + - - - + + - - - + filter="intval" + size="1" + default="1" + > + + + name="map_count" + type="text" + label="COM_FINDER_FILTER_MAP_COUNT" + description="COM_FINDER_FILTER_MAP_COUNT_DESCRIPTION" + class="readonly" + size="10" + default="0" + readonly="true" + />
@@ -82,14 +126,16 @@ label="COM_FINDER_FILTER_WHEN_START_DATE_LABEL" description="COM_FINDER_FILTER_WHEN_START_DATE_DESCRIPTION" default="" - filter="string"> + filter="string" + > - + filter="string" + > diff --git a/administrator/components/com_finder/models/forms/filter_filters.xml b/administrator/components/com_finder/models/forms/filter_filters.xml index f125a445c87e4..f5ea1528f992b 100644 --- a/administrator/components/com_finder/models/forms/filter_filters.xml +++ b/administrator/components/com_finder/models/forms/filter_filters.xml @@ -8,17 +8,19 @@ description="COM_FINDER_SEARCH_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + JGRID_HEADING_ID_ASC + + + + COM_FINDER_FILTER_SELECT_CONTENT_MAP + COM_FINDER_INDEX_HEADING_LINK_URL_ASC + + + + JOPTION_SELECT_MAX_LEVELS + JSTATUS_ASC + addScriptDeclaration(' Joomla.submitbutton = function(task) @@ -70,7 +71,7 @@
form->renderField('map_count'); ?>
- diff --git a/administrator/components/com_finder/views/filter/view.html.php b/administrator/components/com_finder/views/filter/view.html.php index fa7140476bb02..702ab8076a1a3 100644 --- a/administrator/components/com_finder/views/filter/view.html.php +++ b/administrator/components/com_finder/views/filter/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -65,9 +65,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/filters/tmpl/default.php b/administrator/components/com_finder/views/filters/tmpl/default.php index f177ad7804cce..c7ead6c2b3df7 100644 --- a/administrator/components/com_finder/views/filters/tmpl/default.php +++ b/administrator/components/com_finder/views/filters/tmpl/default.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -113,7 +113,7 @@ - created_by_alias ? $item->created_by_alias : $item->user_name; ?> + created_by_alias ?: $item->user_name; ?> created, JText::_('DATE_FORMAT_LC4')); ?> diff --git a/administrator/components/com_finder/views/filters/view.html.php b/administrator/components/com_finder/views/filters/view.html.php index e557b22c746c0..f65859ba4fd6b 100644 --- a/administrator/components/com_finder/views/filters/view.html.php +++ b/administrator/components/com_finder/views/filters/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -75,9 +75,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/index/tmpl/default.php b/administrator/components/com_finder/views/index/tmpl/default.php index 87a097e4be91b..7b2a066403c8a 100644 --- a/administrator/components/com_finder/views/index/tmpl/default.php +++ b/administrator/components/com_finder/views/index/tmpl/default.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/index/view.html.php b/administrator/components/com_finder/views/index/view.html.php index 53fc3f7e27f1e..880a696e19094 100644 --- a/administrator/components/com_finder/views/index/view.html.php +++ b/administrator/components/com_finder/views/index/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/indexer/tmpl/default.php b/administrator/components/com_finder/views/indexer/tmpl/default.php index fb27f4f0ea5a9..20ef8c7e2e994 100644 --- a/administrator/components/com_finder/views/indexer/tmpl/default.php +++ b/administrator/components/com_finder/views/indexer/tmpl/default.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/indexer/view.html.php b/administrator/components/com_finder/views/indexer/view.html.php index 4f86a099052aa..fb12941060b7a 100644 --- a/administrator/components/com_finder/views/indexer/view.html.php +++ b/administrator/components/com_finder/views/indexer/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/maps/tmpl/default.php b/administrator/components/com_finder/views/maps/tmpl/default.php index 8e48034755864..5835f81048dae 100644 --- a/administrator/components/com_finder/views/maps/tmpl/default.php +++ b/administrator/components/com_finder/views/maps/tmpl/default.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/maps/view.html.php b/administrator/components/com_finder/views/maps/view.html.php index e0f3287594f33..9a5cdfe4495bc 100644 --- a/administrator/components/com_finder/views/maps/view.html.php +++ b/administrator/components/com_finder/views/maps/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -80,9 +80,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); diff --git a/administrator/components/com_finder/views/statistics/tmpl/default.php b/administrator/components/com_finder/views/statistics/tmpl/default.php index b163df4dc7f5d..f5597fffa26fa 100644 --- a/administrator/components/com_finder/views/statistics/tmpl/default.php +++ b/administrator/components/com_finder/views/statistics/tmpl/default.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_finder/views/statistics/view.html.php b/administrator/components/com_finder/views/statistics/view.html.php index bb7ad0c0b8e93..a938942bb7450 100644 --- a/administrator/components/com_finder/views/statistics/view.html.php +++ b/administrator/components/com_finder/views/statistics/view.html.php @@ -4,7 +4,7 @@ * @subpackage com_finder * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE + * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -40,9 +40,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } return parent::display($tpl); diff --git a/administrator/components/com_installer/controllers/install.php b/administrator/components/com_installer/controllers/install.php index 9334a83800781..8289990361a2e 100644 --- a/administrator/components/com_installer/controllers/install.php +++ b/administrator/components/com_installer/controllers/install.php @@ -28,15 +28,11 @@ public function install() // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + /** @var InstallerModelInstall $model */ $model = $this->getModel('install'); - if ($result = $model->install()) - { - $cache = JFactory::getCache('mod_menu'); - $cache->clean(); - - // TODO: Reset the users acl here as well to kill off any missing bits. - } + // TODO: Reset the users acl here as well to kill off any missing bits. + $result = $model->install(); $app = JFactory::getApplication(); $redirect_url = $app->getUserState('com_installer.redirect_url'); diff --git a/administrator/components/com_installer/controllers/manage.php b/administrator/components/com_installer/controllers/manage.php index af9df3f34e942..e4f01a2ca237e 100644 --- a/administrator/components/com_installer/controllers/manage.php +++ b/administrator/components/com_installer/controllers/manage.php @@ -58,6 +58,7 @@ public function publish() else { // Get the model. + /** @var InstallerModelManage $model */ $model = $this->getModel('manage'); // Change the state of the records. @@ -95,7 +96,9 @@ public function remove() // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); - $eid = $this->input->get('cid', array(), 'array'); + $eid = $this->input->get('cid', array(), 'array'); + + /** @var InstallerModelManage $model */ $model = $this->getModel('manage'); $eid = ArrayHelper::toInteger($eid, array()); diff --git a/administrator/components/com_installer/controllers/update.php b/administrator/components/com_installer/controllers/update.php index a3b541c07a6ef..c691e5c144de1 100644 --- a/administrator/components/com_installer/controllers/update.php +++ b/administrator/components/com_installer/controllers/update.php @@ -43,11 +43,6 @@ public function update() $model->update($uid, $minimum_stability); - if ($model->getState('result', false)) - { - JFactory::getCache('mod_menu')->clean(); - } - $app = JFactory::getApplication(); $redirect_url = $app->getUserState('com_installer.redirect_url'); diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php index 6d24747c3f6e6..bd6a3e013498f 100644 --- a/administrator/components/com_installer/models/database.php +++ b/administrator/components/com_installer/models/database.php @@ -15,7 +15,7 @@ JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php'); /** - * Installer Manage Model + * Installer Database Model * * @since 1.6 */ diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php index cdeaa1e63601b..d97e293fe9180 100644 --- a/administrator/components/com_installer/models/extension.php +++ b/administrator/components/com_installer/models/extension.php @@ -122,7 +122,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) $this->setState('list.start', 0); } - return array_slice($result, $limitstart, $limit ? $limit : null); + return array_slice($result, $limitstart, $limit ?: null); } // Process searching, ordering and pagination for regular database fields. diff --git a/administrator/components/com_installer/models/forms/filter_discover.xml b/administrator/components/com_installer/models/forms/filter_discover.xml index 8f21ab2d8e954..b11e1f2dd4379 100644 --- a/administrator/components/com_installer/models/forms/filter_discover.xml +++ b/administrator/components/com_installer/models/forms/filter_discover.xml @@ -10,6 +10,7 @@ description="COM_INSTALLER_DISCOVER_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + + COM_INSTALLER_VALUE_FOLDER_SELECT
+ JGRID_HEADING_ID_ASC + COM_INSTALLER_HEADING_LANGUAGE_TAG_ASC + + + + + COM_INSTALLER_VALUE_FOLDER_SELECT + JGRID_HEADING_ID_ASC + - - + + cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php index 18ccb15b9e987..f6f6f492ecd3a 100644 --- a/administrator/components/com_installer/models/manage.php +++ b/administrator/components/com_installer/models/manage.php @@ -146,6 +146,14 @@ public function publish(&$eid = array(), $value = 1) } } + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } @@ -261,6 +269,16 @@ public function remove($eid = array()) $app->setUserState('com_installer.message', $installer->message); $app->setUserState('com_installer.extension_message', $installer->get('extension_message')); + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + return $result; } diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php index 368b48101cb37..a0d3e48a6aa21 100644 --- a/administrator/components/com_installer/models/update.php +++ b/administrator/components/com_installer/models/update.php @@ -168,7 +168,7 @@ protected function translate(&$items) $manifest = json_decode($item->manifest_cache); $item->current_version = isset($manifest->version) ? $manifest->version : JText::_('JLIB_UNKNOWN'); $item->type_translated = JText::_('COM_INSTALLER_TYPE_' . strtoupper($item->type)); - $item->folder_translated = $item->folder ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); + $item->folder_translated = $item->folder ?: JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); $item->install_type = $item->extension_id ? JText::_('COM_INSTALLER_MSG_UPDATE_UPDATE') : JText::_('COM_INSTALLER_NEW_INSTALL'); } @@ -207,7 +207,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0) $this->setState('list.start', 0); } - return array_slice($result, $limitstart, $limit ? $limit : null); + return array_slice($result, $limitstart, $limit ?: null); } else { @@ -371,6 +371,16 @@ public function update($uids, $minimum_stability = JUpdater::STABILITY_STABLE) $result = $res & $result; } + // Clear the cached extension data and menu cache + $this->cleanCache('_system', 0); + $this->cleanCache('_system', 1); + $this->cleanCache('com_modules', 0); + $this->cleanCache('com_modules', 1); + $this->cleanCache('com_plugins', 0); + $this->cleanCache('com_plugins', 1); + $this->cleanCache('mod_menu', 0); + $this->cleanCache('mod_menu', 1); + // Set the final state $this->setState('result', $result); } @@ -525,7 +535,7 @@ protected function loadFormData() protected function preparePreUpdate($update, $table) { jimport('joomla.filesystem.file'); - + switch ($table->type) { // Components could have a helper which adds additional data @@ -535,11 +545,11 @@ protected function preparePreUpdate($update, $table) $cname = ucfirst($ename) . 'Helper'; $path = JPATH_ADMINISTRATOR . '/components/' . $table->element . '/helpers/' . $fname; - + if (JFile::exists($path)) { require_once $path; - + if (class_exists($cname) && is_callable(array($cname, 'prepareUpdate'))) { call_user_func_array(array($cname, 'prepareUpdate'), array(&$update, &$table)); @@ -552,19 +562,19 @@ protected function preparePreUpdate($update, $table) case 'module': $cname = str_replace('_', '', $table->element) . 'Helper'; $path = ($table->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $table->element . '/helper.php'; - + if (JFile::exists($path)) { require_once $path; - + if (class_exists($cname) && is_callable(array($cname, 'prepareUpdate'))) { call_user_func_array(array($cname, 'prepareUpdate'), array(&$update, &$table)); } } - + break; - + // If we have a plugin, we can use the plugin trigger "onInstallerBeforePackageDownload" // But we should make sure, that our plugin is loaded, so we don't need a second "installer" plugin case 'plugin': diff --git a/administrator/components/com_installer/models/warnings.php b/administrator/components/com_installer/models/warnings.php index e62aea647785d..d3427ae6ceb7a 100644 --- a/administrator/components/com_installer/models/warnings.php +++ b/administrator/components/com_installer/models/warnings.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; /** - * Extension Manager Templates Model + * Installer Warnings Model * * @since 1.6 */ diff --git a/administrator/components/com_installer/views/database/tmpl/default.php b/administrator/components/com_installer/views/database/tmpl/default.php index e16680737ec15..e1c620c0aa3e6 100644 --- a/administrator/components/com_installer/views/database/tmpl/default.php +++ b/administrator/components/com_installer/views/database/tmpl/default.php @@ -44,9 +44,9 @@ queryType; $msgs = $error->msgElements; $file = basename($error->file); - $msg0 = (isset($msgs[0])) ? $msgs[0] : ' '; - $msg1 = (isset($msgs[1])) ? $msgs[1] : ' '; - $msg2 = (isset($msgs[2])) ? $msgs[2] : ' '; + $msg0 = isset($msgs[0]) ? $msgs[0] : ' '; + $msg1 = isset($msgs[1]) ? $msgs[1] : ' '; + $msg2 = isset($msgs[2]) ? $msgs[2] : ' '; $message = JText::sprintf($key, $file, $msg0, $msg1, $msg2); ?>
  • diff --git a/administrator/components/com_installer/views/database/view.html.php b/administrator/components/com_installer/views/database/view.html.php index d1cf21f5ea9c7..1c0bc4fba372c 100644 --- a/administrator/components/com_installer/views/database/view.html.php +++ b/administrator/components/com_installer/views/database/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Extension Manager Manage View + * Extension Manager Database View * * @since 1.6 */ @@ -40,8 +40,8 @@ public function display($tpl = null) $this->schemaVersion = $this->get('SchemaVersion'); $this->updateVersion = $this->get('UpdateVersion'); $this->filterParams = $this->get('DefaultTextFilters'); - $this->schemaVersion = ($this->schemaVersion) ? $this->schemaVersion : JText::_('JNONE'); - $this->updateVersion = ($this->updateVersion) ? $this->updateVersion : JText::_('JNONE'); + $this->schemaVersion = $this->schemaVersion ?: JText::_('JNONE'); + $this->updateVersion = $this->updateVersion ?: JText::_('JNONE'); $this->pagination = $this->get('Pagination'); $this->errorCount = count($this->errors); diff --git a/administrator/components/com_installer/views/discover/tmpl/default.php b/administrator/components/com_installer/views/discover/tmpl/default.php index 5d184b9e5bb30..d2918e86ce134 100644 --- a/administrator/components/com_installer/views/discover/tmpl/default.php +++ b/administrator/components/com_installer/views/discover/tmpl/default.php @@ -34,11 +34,15 @@ $this)); ?>
    +
    + +
    items)) : ?>
    + @@ -115,7 +119,6 @@
    -
    diff --git a/administrator/components/com_installer/views/languages/tmpl/default.php b/administrator/components/com_installer/views/languages/tmpl/default.php index 6eb4e5bb65336..4a92616ee53a2 100644 --- a/administrator/components/com_installer/views/languages/tmpl/default.php +++ b/administrator/components/com_installer/views/languages/tmpl/default.php @@ -74,9 +74,7 @@ - + name; ?> code; ?> diff --git a/administrator/components/com_installer/views/languages/view.html.php b/administrator/components/com_installer/views/languages/view.html.php index 7c41f9cee388a..36ab4bb8e9e0a 100644 --- a/administrator/components/com_installer/views/languages/view.html.php +++ b/administrator/components/com_installer/views/languages/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Language installer view + * Extension Manager Language Install View * * @since 2.5.7 */ @@ -53,9 +53,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } parent::display($tpl); diff --git a/administrator/components/com_installer/views/manage/view.html.php b/administrator/components/com_installer/views/manage/view.html.php index 4f1b6d4aae3f7..b8891f18d7c32 100644 --- a/administrator/components/com_installer/views/manage/view.html.php +++ b/administrator/components/com_installer/views/manage/view.html.php @@ -47,9 +47,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } // Include the component HTML helpers. diff --git a/administrator/components/com_installer/views/update/tmpl/default.php b/administrator/components/com_installer/views/update/tmpl/default.php index 7d470a2154ccc..d1e3cd871cf4d 100644 --- a/administrator/components/com_installer/views/update/tmpl/default.php +++ b/administrator/components/com_installer/views/update/tmpl/default.php @@ -93,7 +93,7 @@ diff --git a/administrator/components/com_installer/views/warnings/view.html.php b/administrator/components/com_installer/views/warnings/view.html.php index 0a9078f99c34f..1b9a8dcc8ed52 100644 --- a/administrator/components/com_installer/views/warnings/view.html.php +++ b/administrator/components/com_installer/views/warnings/view.html.php @@ -12,7 +12,7 @@ JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** - * Extension Manager Templates View + * Extension Manager Warning View * * @since 1.6 */ diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index 3af6fcd0ea384..9cb780a2b85c2 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -849,7 +849,7 @@ public function upload() // Make sure that zlib is loaded so that the package can be unpacked. if (!extension_loaded('zlib')) { - throw new RuntimeException(('COM_INSTALLER_MSG_INSTALL_WARNINSTALLZLIB'), 500); + throw new RuntimeException('COM_INSTALLER_MSG_INSTALL_WARNINSTALLZLIB', 500); } // If there is no uploaded file, we have a problem... @@ -924,7 +924,7 @@ public function captiveLogin($credentials) $username = isset($credentials['username']) ? $credentials['username'] : null; $user = JFactory::getUser(); - if ($user->username != $username) + if (strtolower($user->username) != strtolower($username)) { return false; } diff --git a/administrator/components/com_joomlaupdate/restore_finalisation.php b/administrator/components/com_joomlaupdate/restore_finalisation.php index fd702319997b1..59622c6519271 100644 --- a/administrator/components/com_joomlaupdate/restore_finalisation.php +++ b/administrator/components/com_joomlaupdate/restore_finalisation.php @@ -164,7 +164,7 @@ function finalizeRestore($siteRoot, $restorePath) if (file_exists($filePath)) { - require_once ($filePath); + require_once $filePath; } // Make sure Joomla!'s code can figure out which files exist and need be removed diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php index 8e12a89bb3828..e46fb4eb56917 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default_upload.php @@ -61,7 +61,7 @@

    - +

    diff --git a/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php b/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php index 3131121d07d19..1aefb29f08ce8 100644 --- a/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php +++ b/administrator/components/com_joomlaupdate/views/update/tmpl/finaliseconfirm.php @@ -33,7 +33,7 @@
    - + @@ -46,7 +46,7 @@
    - + @@ -60,14 +60,14 @@
    - + - +
    @@ -77,12 +77,12 @@
    diff --git a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php index 0f293137091e8..5e39bf2b18188 100644 --- a/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php +++ b/administrator/components/com_joomlaupdate/views/upload/tmpl/captive.php @@ -32,7 +32,7 @@
    - + @@ -45,7 +45,7 @@
    - + @@ -59,14 +59,14 @@
    - + - +
    @@ -76,12 +76,12 @@
    diff --git a/administrator/components/com_languages/config.xml b/administrator/components/com_languages/config.xml index 5453162acf872..fb9bbac94a23d 100644 --- a/administrator/components/com_languages/config.xml +++ b/administrator/components/com_languages/config.xml @@ -13,12 +13,14 @@ filter="rules" validate="rules" component="com_languages" - section="component" /> + section="component" + /> + $warn) { - if (($warn->alang == 1) && ($warn->slang == 0)) + if ($warn->alang == 1 && $warn->slang == 0) { unset($warnings[$index]); } - if (($warn->alang == 0) && (($warn->slang == 0) && (empty($warn->mlang)))) + if ($warn->alang == 0 && $warn->slang == 0 && empty($warn->mlang)) { unset($warnings[$index]); } - if (($warn->alang == 0) && (($warn->slang == $languages) && (empty($warn->mlang)))) + if ($warn->alang == 0 && $warn->slang == $languages && empty($warn->mlang)) { unset($warnings[$index]); } diff --git a/administrator/components/com_languages/models/forms/language.xml b/administrator/components/com_languages/models/forms/language.xml index 89b50cb9d8074..afe244ed84ab7 100644 --- a/administrator/components/com_languages/models/forms/language.xml +++ b/administrator/components/com_languages/models/forms/language.xml @@ -1,41 +1,51 @@
    - - - - - JNONE - - + > -
    - -
    - diff --git a/administrator/components/com_languages/models/forms/override.xml b/administrator/components/com_languages/models/forms/override.xml index 954a6cb4c67fb..8d1a2ddb64e1d 100644 --- a/administrator/components/com_languages/models/forms/override.xml +++ b/administrator/components/com_languages/models/forms/override.xml @@ -8,7 +8,8 @@ description="COM_LANGUAGES_OVERRIDE_FIELD_KEY_DESC" size="60" required="true" - filter="LanguagesHelper::filterKey" /> + filter="LanguagesHelper::filterKey" + /> + filter="LanguagesHelper::filterText" + /> + filter="boolean" + /> + size="50" + /> + default="value" + > - - - + type="hidden" + />
    diff --git a/administrator/components/com_languages/views/installed/view.html.php b/administrator/components/com_languages/views/installed/view.html.php index 282bc9449612d..725eebe0eccd8 100644 --- a/administrator/components/com_languages/views/installed/view.html.php +++ b/administrator/components/com_languages/views/installed/view.html.php @@ -70,9 +70,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_languages/views/language/view.html.php b/administrator/components/com_languages/views/language/view.html.php index 93ca48e1fe771..6dca29fbdabfb 100644 --- a/administrator/components/com_languages/views/language/view.html.php +++ b/administrator/components/com_languages/views/language/view.html.php @@ -39,9 +39,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); diff --git a/administrator/components/com_languages/views/languages/view.html.php b/administrator/components/com_languages/views/languages/view.html.php index 6c771d2a38f82..f7b455bc278f6 100644 --- a/administrator/components/com_languages/views/languages/view.html.php +++ b/administrator/components/com_languages/views/languages/view.html.php @@ -42,9 +42,7 @@ public function display($tpl = null) // Check for errors. if (count($errors = $this->get('Errors'))) { - JError::raiseError(500, implode("\n", $errors)); - - return false; + throw new Exception(implode("\n", $errors), 500); } $this->addToolbar(); @@ -124,15 +122,15 @@ protected function addToolbar() protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.title' => JText::_('JGLOBAL_TITLE'), - 'a.title_native' => JText::_('COM_LANGUAGES_HEADING_TITLE_NATIVE'), - 'a.lang_code' => JText::_('COM_LANGUAGES_FIELD_LANG_TAG_LABEL'), - 'a.sef' => JText::_('COM_LANGUAGES_FIELD_LANG_CODE_LABEL'), - 'a.image' => JText::_('COM_LANGUAGES_HEADING_LANG_IMAGE'), - 'a.access' => JText::_('JGRID_HEADING_ACCESS'), - 'a.lang_id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.title' => JText::_('JGLOBAL_TITLE'), + 'a.title_native' => JText::_('COM_LANGUAGES_HEADING_TITLE_NATIVE'), + 'a.lang_code' => JText::_('COM_LANGUAGES_FIELD_LANG_TAG_LABEL'), + 'a.sef' => JText::_('COM_LANGUAGES_FIELD_LANG_CODE_LABEL'), + 'a.image' => JText::_('COM_LANGUAGES_HEADING_LANG_IMAGE'), + 'a.access' => JText::_('JGRID_HEADING_ACCESS'), + 'a.lang_id' => JText::_('JGRID_HEADING_ID'), ); } } diff --git a/administrator/components/com_languages/views/overrides/tmpl/default.php b/administrator/components/com_languages/views/overrides/tmpl/default.php index f7cf21f49267d..5de95f42ae144 100644 --- a/administrator/components/com_languages/views/overrides/tmpl/default.php +++ b/administrator/components/com_languages/views/overrides/tmpl/default.php @@ -38,8 +38,8 @@
    - - + +
    diff --git a/administrator/components/com_login/models/login.php b/administrator/components/com_login/models/login.php index efc00a6a5befe..360a5525cdfe8 100644 --- a/administrator/components/com_login/models/login.php +++ b/administrator/components/com_login/models/login.php @@ -33,8 +33,8 @@ protected function populateState() $method = $input->getMethod(); $credentials = array( - 'username' => $input->$method->get('username', '', 'USERNAME'), - 'password' => $input->$method->get('passwd', '', 'RAW'), + 'username' => $input->$method->get('username', '', 'USERNAME'), + 'password' => $input->$method->get('passwd', '', 'RAW'), 'secretkey' => $input->$method->get('secretkey', '', 'RAW'), ); $this->setState('credentials', $credentials); diff --git a/administrator/components/com_login/views/login/view.html.php b/administrator/components/com_login/views/login/view.html.php index 0f9d047e4bf87..0297dc3f4fff8 100644 --- a/administrator/components/com_login/views/login/view.html.php +++ b/administrator/components/com_login/views/login/view.html.php @@ -31,8 +31,8 @@ public function display($tpl = null) * To prevent clickjacking, only allow the login form to be used inside a frame in the same origin. * So send a X-Frame-Options HTTP Header with the SAMEORIGIN value. * - * @see https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet - * https://tools.ietf.org/html/rfc7034 + * @link https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet + * @link https://tools.ietf.org/html/rfc7034 */ JFactory::getApplication()->setHeader('X-Frame-Options', 'SAMEORIGIN'); diff --git a/administrator/components/com_media/config.xml b/administrator/components/com_media/config.xml index ffe071a62f513..6ef06cfff1e74 100644 --- a/administrator/components/com_media/config.xml +++ b/administrator/components/com_media/config.xml @@ -6,46 +6,54 @@ + description="COM_MEDIA_FIELD_LEGAL_EXTENSIONS_DESC" + size="50" + default="bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,TXT,XCF,XLS" + /> + /> - + /> + /> + > @@ -53,10 +61,11 @@ + > @@ -64,33 +73,37 @@ + /> + description="COM_MEDIA_FIELD_IGNORED_EXTENSIONS_DESC" + size="50" + /> + description="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_DESC" + size="50" + default="image/jpeg,image/gif,image/png,image/bmp,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip" + /> + />
    + section="component" + />
    diff --git a/administrator/components/com_media/controllers/file.php b/administrator/components/com_media/controllers/file.php index d942a1d424b99..7d5ee2952afd1 100644 --- a/administrator/components/com_media/controllers/file.php +++ b/administrator/components/com_media/controllers/file.php @@ -40,7 +40,7 @@ public function upload() $params = JComponentHelper::getParams('com_media'); // Get some data from the request - $files = $this->input->files->get('Filedata', '', 'array'); + $files = $this->input->files->get('Filedata', array(), 'array'); $return = JFactory::getSession()->get('com_media.return_url'); $this->folder = $this->input->get('folder', '', 'path'); @@ -66,6 +66,12 @@ public function upload() return false; } + // If there are no files to upload - then bail + if (empty($files)) + { + return false; + } + // Total length of post back data in bytes. $contentLength = (int) $_SERVER['CONTENT_LENGTH']; diff --git a/administrator/components/com_media/models/list.php b/administrator/components/com_media/models/list.php index 1d6fd526c3839..559518b20884b 100644 --- a/administrator/components/com_media/models/list.php +++ b/administrator/components/com_media/models/list.php @@ -131,11 +131,13 @@ public function getList() // Iterate over the files if they exist if ($fileList !== false) { + $tmpBaseObject = new JObject; + foreach ($fileList as $file) { if (is_file($basePath . '/' . $file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html') { - $tmp = new JObject; + $tmp = clone $tmpBaseObject; $tmp->name = $file; $tmp->title = $file; $tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $file)); @@ -209,9 +211,11 @@ public function getList() // Iterate over the folders if they exist if ($folderList !== false) { + $tmpBaseObject = new JObject; + foreach ($folderList as $folder) { - $tmp = new JObject; + $tmp = clone $tmpBaseObject; $tmp->name = basename($folder); $tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $folder)); $tmp->path_relative = str_replace($mediaBase, '', $tmp->path); diff --git a/administrator/components/com_media/views/media/tmpl/default.php b/administrator/components/com_media/views/media/tmpl/default.php index 406acdb925073..9f2c52160b89d 100644 --- a/administrator/components/com_media/views/media/tmpl/default.php +++ b/administrator/components/com_media/views/media/tmpl/default.php @@ -47,7 +47,7 @@
    sidebar; ?>
    -

    +