diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000000..1c71301190fd9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +build: + image: joomlaprojects/docker-systemtests:latest + commands: + - apt-get install nodejs npm + - ln -s /usr/bin/nodejs /usr/bin/node + - export DISPLAY=:0 + - Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 & + - sleep 3 + - fluxbox > /dev/null 2>&1 & + - cd tests/javascript + - npm install + - cd ../.. + - tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run + clone: + depth: 1 + path: repo diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9df1f82be5060..0f0f125f38d3b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,7 +19,6 @@ There are other branches available which serve specific purposes. | Branch | Purpose | | ------ | ------- | -| staging | Current codebase. | +| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. | | master | Each commit made to staging gets tested if it passes unit tests and codestyle rules. It is then merged into master. This is done automatically. | -| 2.5.x | Branch for the Joomla 2.5.x series. Support for this version has ended, no patches are accepted here. | -| 3.6.x | Branch for the next minor Joomla version. New backward compatible features go into this branch. Commits to staging will be applied to this branch as well. | +| 4.0-dev | Branch for the next major Joomla version. New backward incompatible features go into this branch. Commits to staging will be applied to this branch as well. | diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 722c66ca930c7..0c4fc63367fa1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,18 +1,18 @@ -#### Steps to reproduce the issue +### Steps to reproduce the issue -#### Expected result +### Expected result -#### Actual result +### Actual result -#### System information (as much as possible) +### System information (as much as possible) -#### Additional comments +### Additional comments diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2434a62ddbf49..79955c0bf0594 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,7 @@ Pull Request for Issue # . -#### Summary of Changes +### Summary of Changes -#### Testing Instructions +### Testing Instructions + +### Documentation Changes Required diff --git a/.gitignore b/.gitignore index f1014a7677df9..f7d136459ad47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # IDE & System Related Files # .buildpath +.editorconfig .project .settings .DS_Store @@ -9,23 +10,18 @@ /administrator/cache /administrator/logs /cache +/installation/cache /tmp /configuration.php /.htaccess /web.config +/.php_cs.cache # Test Related Files # /phpunit.xml -/tests/system/webdriver/tests/logs/ -/tests/system/servers/configdef.php -codecept.phar -tests/codeception/_output/* -tests/codeception/vendor/* -tests/codeception/testingsite* -tests/codeception/tests/acceptance.suite.yml -tests/codeception/tests/acceptance/*Tester.php -tests/codeception/tests/functional/*Tester.php -tests/codeception/tests/unit/*Tester.php + +# Node modules # +node_modules/ # phpDocumentor Logs # phpdoc-* @@ -117,6 +113,8 @@ Desktop.ini /libraries/vendor/psr/log/.gitignore /libraries/vendor/psr/log/composer.json /libraries/vendor/psr/log/README.md +/libraries/vendor/symfony/polyfill-php55/composer.json +/libraries/vendor/symfony/polyfill-php55/README.md /libraries/vendor/symfony/polyfill-php56/composer.json /libraries/vendor/symfony/polyfill-php56/README.md /libraries/vendor/symfony/polyfill-util/composer.json diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000000000..597141e11be68 --- /dev/null +++ b/.php_cs @@ -0,0 +1,65 @@ +in(array(__DIR__ . '/libraries')) + ->files() + ->depth(0); + +$mainFinder = Symfony\CS\Finder\DefaultFinder::create() + ->in( + array( + __DIR__ . '/libraries/cms', + __DIR__ . '/libraries/joomla', + __DIR__ . '/libraries/legacy', + ) + ) + ->append($topFilesFinder); + +return Symfony\CS\Config\Config::create() + ->setUsingLinter(false) + ->setUsingCache(true) + ->level(Symfony\CS\FixerInterface::NONE_LEVEL) + ->fixers( + array( + // psr-1 + 'encoding', + // psr-2 + 'elseif', + 'eof_ending', + 'function_call_space', + 'line_after_namespace', + 'linefeed', + 'lowercase_constants', + 'lowercase_keywords', + 'method_argument_space', + 'multiple_use', + 'parenthesis', + 'single_line_after_imports', + 'trailing_spaces', + 'visibility', + // symfony + 'array_element_no_space_before_comma', + 'array_element_white_space_after_comma', + 'duplicate_semicolon', + 'empty_return', + 'extra_empty_lines', + 'function_typehint_space', + 'include', + 'join_function', + 'list_commas', + 'multiline_array_trailing_comma', + 'no_blank_lines_after_class_opening', + 'phpdoc_trim', + 'return', + 'single_array_no_trailing_comma', + 'single_blank_line_before_namespace', + 'spaces_cast', + 'unneeded_control_parentheses', + 'unused_use', + 'whitespacy_lines', + // contrib + 'concat_with_spaces', + 'long_array_syntax', + ) + ) + ->finder($mainFinder); diff --git a/.travis.yml b/.travis.yml index b84dde4227f32..e5be82a2e6ddc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ language: php env: global: - RUN_PHPCS="no" + - RUN_UNIT_TESTS="yes" + - RUN_JAVASCRIPT_TESTS="no" - INSTALL_MEMCACHE="yes" - INSTALL_MEMCACHED="yes" - INSTALL_REDIS="yes" @@ -13,6 +15,8 @@ env: matrix: fast_finish: true include: + - php: 5.6 + env: RUN_PHPCS="yes" RUN_UNIT_TESTS="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" - php: 5.3 env: INSTALL_APC="yes" - php: 5.4 @@ -20,9 +24,14 @@ matrix: - php: 5.5 env: INSTALL_APCU="yes" - php: 5.6 - env: RUN_PHPCS="yes" INSTALL_APCU="yes" + 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 + - node_js: 6.1 + sudo: true + env: RUN_JAVASCRIPT_TESTS="yes" RUN_UNIT_TESTS="no" + - 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 @@ -40,6 +49,7 @@ matrix: 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 + - node_js: 6.1 services: - memcache @@ -47,30 +57,15 @@ services: - redis-server before_script: + # JavaScript tests + - if [[ $RUN_JAVASCRIPT_TESTS == "yes" ]]; then export DISPLAY=:99.0; bash build/travis/javascript-tests.sh $PWD; fi # Make sure all dev dependencies are installed - - composer install - # Set up databases for testing - - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql -e 'create database joomla_ut;'; fi - - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql joomla_ut < tests/unit/schema/mysql.sql; fi - - if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root -e 'create database joomla_ut;'; fi - - if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root joomla_ut < tests/unit/schema/mysql.sql; fi - - psql -c 'create database joomla_ut;' -U postgres - - psql -d joomla_ut -a -f tests/unit/schema/postgresql.sql - # Set up Apache - # - ./build/travis/php-apache.sh - # Enable additional PHP extensions - - if [[ $INSTALL_MEMCACHE == "yes" ]]; then phpenv config-add build/travis/phpenv/memcached.ini; fi - - if [[ $INSTALL_MEMCACHED == "yes" ]]; then phpenv config-add build/travis/phpenv/memcached.ini; fi - - if [[ $INSTALL_APC == "yes" ]]; then phpenv config-add build/travis/phpenv/apc-$TRAVIS_PHP_VERSION.ini; fi - - if [[ $INSTALL_APCU == "yes" && $TRAVIS_PHP_VERSION = 5.* ]]; then printf "\n" | pecl install apcu-4.0.10 && phpenv config-add build/travis/phpenv/apcu-$TRAVIS_PHP_VERSION.ini; fi - - if [[ $INSTALL_APCU == "yes" && $TRAVIS_PHP_VERSION = 7.* ]]; then printf "\n" | pecl install apcu-beta && phpenv config-add build/travis/phpenv/apcu-$TRAVIS_PHP_VERSION.ini; fi - - if [[ $INSTALL_APCU_BC_BETA == "yes" ]]; then printf "\n" | pecl install apcu_bc-beta; fi - - if [[ $INSTALL_REDIS == "yes" && $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-add build/travis/phpenv/redis.ini; fi - - if [[ $INSTALL_REDIS == "yes" && $TRAVIS_PHP_VERSION = hhvm ]]; then cat build/travis/phpenv/redis.ini >> /etc/hhvm/php.ini; fi + - if [[ ( $RUN_UNIT_TESTS == "yes" ) || ( $RUN_PHPCS == "yes" ) ]]; then bash build/travis/unit-tests.sh $PWD; fi script: - - libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml - if [[ $RUN_PHPCS == "yes" ]]; then libraries/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi + - if [[ $RUN_UNIT_TESTS == "yes" ]]; then libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml; fi + - if [[ $RUN_JAVASCRIPT_TESTS == "yes" ]]; then tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run ; fi branches: except: diff --git a/README.md b/README.md index e069380e9e371..1f1ee778ac0c7 100644 --- a/README.md +++ b/README.md @@ -10,53 +10,54 @@ What is this? --------------------- * This is a Joomla! 3.x installation/upgrade package. * Joomla's [Official website](https://www.joomla.org). -* Joomla! 3.6 [version history](https://docs.joomla.org/Joomla_3.6_version_history). +* Joomla! 3.7 [version history](https://docs.joomla.org/Joomla_3.7_version_history). * Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/master). What is Joomla? --------------------- -* Joomla is a **Content Management System** (CMS) which enables you to build websites and powerful online applications. -* It is a simple and powerful web server application which requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. You can find more [details here](https://www.joomla.org/about-joomla.html). -* Joomla is **free and OpenSource software** distributed under the GNU General Public License version 2 or later. +* [Joomla!](https://www.joomla.org/about-joomla.html) is a **Content Management System** (CMS) which enables you to build websites and powerful online applications. +* It is a simple and powerful web server application which requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. You can find [full technical requirements here](https://downloads.joomla.org/technical-requirements). +* Joomla! is **free and Open Source software** distributed under the GNU General Public License version 2 or later. Is Joomla! for you? --------------------- -* Joomla is [the right solution for most content web projects](https://docs.joomla.org/Joomla_Is_it_for_me%3F). -* View Joomla's core [features here](https://www.joomla.org/core-features.html). +* Joomla! is [the right solution for most content web projects](https://docs.joomla.org/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](http://community.joomla.org/translations.html). -* You can also add languages directly to your website via your Joomla! administration panel. +* 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) 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/Beginners). +* Before installing, read the ['Beginners' Guide'](https://docs.joomla.org/Portal:Beginners). 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. +* The functionality of a Joomla! website can be extended by installing extensions that you can create (or download) to suit your needs. * There are many ready-made extensions that you can download and install. -* Check out the [Joomla! Extensions Directory (JED)](http://extensions.joomla.org). +* Check out the [Joomla! Extensions Directory (JED)](https://extensions.joomla.org). 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:Administrators#Template_Management). +* Template management information is [available here](https://docs.joomla.org/Portal:Template_Management). Ready to install Joomla? --------------------- -* Check the [minimum requirements](https://www.joomla.org/about-joomla/technical-requirements.html). -* How do you [install Joomla](https://docs.joomla.org/Installing_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). -When ready, it can be moved to an on-line hosting account of your choice. +When ready, it can be moved to an online hosting account of your choice. Updates are free! --------------------- -* Always use the [latest version](https://www.joomla.org/download.html). +* Always use the [latest version](https://downloads.joomla.org/latest). Where can you get support and help? --------------------- @@ -64,23 +65,22 @@ Where can you get support and help? * [Frequently Asked Questions](https://docs.joomla.org/Category:FAQ) (FAQ); * Find the [information you need](https://docs.joomla.org/Start_here); * Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html); -* Post questions at [our forums](http://forum.joomla.org); +* Post questions at [our forums](https://forum.joomla.org); * [Joomla Resources Directory](http://resources.joomla.org/) (JRD). -Do you already have a Joomla site that isn't built with Joomla 3.x? +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). -* How to [convert an existing website to Joomla](https://docs.joomla.org/How_to_Convert_an_existing_Web_site_to_a_Joomla!_Web_site). Do you want to improve Joomla? -------------------- -* How do you [request a feature](https://docs.joomla.org/How_do_you_request_a_feature%3F)? -* How do you [report a bug](https://docs.joomla.org/Filing_bugs_and_issues)? +* 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/)? * Get Involved: Joomla! is community developed software. [Join the community](https://volunteers.joomla.org/). -* Documentation for [Developers](https://docs.joomla.org/Developers). +* Documentation for [Developers](https://docs.joomla.org/Portal:Developers). * Documentation for [Web designers](https://docs.joomla.org/Web_designers). Copyright diff --git a/README.txt b/README.txt index 72b246a63ce81..163410ea2498f 100644 --- a/README.txt +++ b/README.txt @@ -1,68 +1,69 @@ 1- What is this? * This is a Joomla! installation/upgrade package to version 3.x * Joomla! Official site: https://www.joomla.org - * Joomla! 3.6 version history - https://docs.joomla.org/Joomla_3.6_version_history + * Joomla! 3.7 version history - https://docs.joomla.org/Joomla_3.7_version_history * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master 2- What is Joomla? - * Joomla is a Content Management System (CMS) which enables you to build Web sites and powerful online applications. - * It's a free and OpenSource software, distributed under the GNU General Public License version 2 or later - * This is a simple and powerful web server application and it requires a server with PHP and either MySQL, PostgreSQL, or SQL Server to run it. - More details here: https://www.joomla.org/about-joomla.html + * Joomla! is a Content Management System (CMS) which enables you to build Web sites and powerful online applications. + * It's a free and Open Source software, distributed under the GNU General Public License version 2 or later. + * This is a simple and powerful web server application and it requires a server with PHP and either MySQL, PostgreSQL or SQL Server to run. + You can find full technical requirements here: https://downloads.joomla.org/technical-requirements. -3- Is Joomla for you? - * Joomla is the right solution for any content web project: https://docs.joomla.org/Joomla_Is_it_for_me%3F - * See Features - https://www.joomla.org/core-features.html +3- Is Joomla! for you? + * Joomla! is the right solution for most content web projects: https://docs.joomla.org/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: http://community.joomla.org/translations.html - * You can also add languages directly to your website via your Joomla! administration panel. + * 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 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/Beginners + * Before installing, read the beginners guide: https://docs.joomla.org/Portal:Beginners -6- What are the limits of Joomla? - * Joomla sites can be extended in functionalities with Extensions that you can create (or download) to suite your needs. - * There are lots of ready made extensions that you can download and install. - * See the Joomla! Extensions Directory (JED): http://extensions.joomla.org +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. + * There are many ready-made extensions that you can download and install. + * Check out the Joomla! Extensions Directory (JED): https://extensions.joomla.org 7- Is it easy to change the layout display? * The layout is controlled by templates that you can edit. - * There are lots of ready made templates that you can download. + * 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 8- Ready to install Joomla? - * See minimum requirements here: https://www.joomla.org/about-joomla/technical-requirements.html - * How do you install Joomla! ? - https://docs.joomla.org/Installing_Joomla! - * Start your Joomla experience building your site with a local test server. - When ready it can be moved to an on-line hosting account of your choice. - See the tutorial: https://docs.joomla.org/Tutorial:Joomla_Local_install + * Check the minimum requirements here: 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 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 9- Updates are free! - * Always use the latest version: https://www.joomla.org/download.html + * 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 * Find help and other users: https://www.joomla.org/about-joomla/create-and-share.html - * Post questions at our forums: http://forum.joomla.org - * Joomla Resources Directory (JRD): http://resources.joomla.org/ + * Post questions at our forums: https://forum.joomla.org + * Joomla! Resources Directory (JRD): http://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? Table of contents: https://docs.joomla.org/Differences_from_Joomla_2.5_to_Joomla_3.0 +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 - * Convert an existing Web site to Joomla: https://docs.joomla.org/How_to_Convert_an_existing_Web_site_to_a_Joomla!_Web_site 12- Do you want to improve Joomla? - * How do you request a feature? https://docs.joomla.org/How_do_you_request_a_feature%3F + * Where to request a feature? https://issues.joomla.org/ * How do you report a bug? https://docs.joomla.org/Filing_bugs_and_issues * Get Involved: Joomla! is a community developed software. Join the community at https://volunteers.joomla.org/ - * Are you a Developer? https://docs.joomla.org/Developers - * Are you a Web designer? https://docs.joomla.org/Web_designers + * Documentation for Developers: https://docs.joomla.org/Portal:Developers + * Documentation for Web designers: https://docs.joomla.org/Web_designers Copyright: * Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. diff --git a/administrator/components/com_admin/models/help.php b/administrator/components/com_admin/models/help.php index f18f7f2a155c3..1655c1ea03179 100644 --- a/administrator/components/com_admin/models/help.php +++ b/administrator/components/com_admin/models/help.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + /** * Admin Component Help Model * @@ -173,8 +175,7 @@ public function &getToc() // Strip the extension $file = preg_replace('#\.xml$|\.html$#', '', $file); - if ($help_search - && JString::strpos(JString::strtolower(strip_tags($buffer)), JString::strtolower($help_search)) === false) + if ($help_search && StringHelper::strpos(StringHelper::strtolower(strip_tags($buffer)), StringHelper::strtolower($help_search)) === false) { continue; } @@ -198,7 +199,7 @@ public function &getLatestVersionCheck() { if (!$this->latest_version_check) { - $override = 'https://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:' + $override = 'https://help.joomla.org/proxy/index.php?keyref=Help{major}{minor}:' . 'Joomla_Version_{major}_{minor}_{maintenance}/{langcode}&lang={langcode}'; $this->latest_version_check = JHelp::createUrl('JVERSION', false, $override); } diff --git a/administrator/components/com_admin/models/profile.php b/administrator/components/com_admin/models/profile.php index e97d292bd73f0..779c279f616ad 100644 --- a/administrator/components/com_admin/models/profile.php +++ b/administrator/components/com_admin/models/profile.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; +JLoader::register('UsersModelUser', JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'); /** * User model. diff --git a/administrator/components/com_admin/models/sysinfo.php b/administrator/components/com_admin/models/sysinfo.php index 39113c3585588..c17e2bc4d92d9 100644 --- a/administrator/components/com_admin/models/sysinfo.php +++ b/administrator/components/com_admin/models/sysinfo.php @@ -102,7 +102,7 @@ class AdminModelSysInfo extends JModelLegacy 'session.save_path', 'upload_tmp_dir', 'User/Group', - 'open_basedir' + 'open_basedir', ), 'other' => array( 'db', @@ -126,7 +126,7 @@ class AdminModelSysInfo extends JModelLegacy 'sitename', 'smtphost', 'tmp_path', - 'open_basedir' + 'open_basedir', ) ); @@ -209,6 +209,7 @@ protected function cleanSectionPrivateData($sectionValues) { $sectionValues = 'xxxxxx'; } + return strlen($sectionValues) ? 'xxxxxx' : ''; } @@ -274,7 +275,7 @@ public function &getConfig() $registry = new Registry(new JConfig); $this->config = $registry->toArray(); - $hidden = array('host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass'); + $hidden = array('host', 'user', 'password', 'ftp_user', 'ftp_pass', 'smtpuser', 'smtppass',); foreach ($hidden as $key) { @@ -312,7 +313,7 @@ public function &getInfo() 'sapi_name' => php_sapi_name(), 'version' => $version->getLongVersion(), 'platform' => $platform->getLongVersion(), - 'useragent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "" + 'useragent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "", ); return $this->info; @@ -525,7 +526,10 @@ public function getDirectory($public = false) continue; } - $this->addDirectory('administrator/language/' . $folder->getFilename(), JPATH_ADMINISTRATOR . '/language/' . $folder->getFilename()); + $this->addDirectory( + 'administrator/language/' . $folder->getFilename(), + JPATH_ADMINISTRATOR . '/language/' . $folder->getFilename() + ); } // List all manifests folders @@ -538,7 +542,10 @@ public function getDirectory($public = false) continue; } - $this->addDirectory('administrator/manifests/' . $folder->getFilename(), JPATH_ADMINISTRATOR . '/manifests/' . $folder->getFilename()); + $this->addDirectory( + 'administrator/manifests/' . $folder->getFilename(), + JPATH_ADMINISTRATOR . '/manifests/' . $folder->getFilename() + ); } $this->addDirectory('administrator/modules', JPATH_ADMINISTRATOR . '/modules'); @@ -558,7 +565,10 @@ public function getDirectory($public = false) continue; } - $this->addDirectory('images/' . $folder->getFilename(), JPATH_SITE . '/' . $cparams->get('image_path') . '/' . $folder->getFilename()); + $this->addDirectory( + 'images/' . $folder->getFilename(), + JPATH_SITE . '/' . $cparams->get('image_path') . '/' . $folder->getFilename() + ); } $this->addDirectory('language', JPATH_SITE . '/language'); @@ -611,8 +621,16 @@ public function getDirectory($public = false) if ($public) { - $this->addDirectory('log', $registry->get('log_path', JPATH_ADMINISTRATOR . '/logs'), 'COM_ADMIN_LOG_DIRECTORY'); - $this->addDirectory('tmp', $registry->get('tmp_path', JPATH_ROOT . '/tmp'), 'COM_ADMIN_TEMP_DIRECTORY'); + $this->addDirectory( + 'log', + $registry->get('log_path', JPATH_ADMINISTRATOR . '/logs'), + 'COM_ADMIN_LOG_DIRECTORY' + ); + $this->addDirectory( + 'tmp', + $registry->get('tmp_path', JPATH_ROOT . '/tmp'), + 'COM_ADMIN_TEMP_DIRECTORY' + ); } else { @@ -621,7 +639,11 @@ public function getDirectory($public = false) $registry->get('log_path', JPATH_ADMINISTRATOR . '/logs'), 'COM_ADMIN_LOG_DIRECTORY' ); - $this->addDirectory($registry->get('tmp_path', JPATH_ROOT . '/tmp'), $registry->get('tmp_path', JPATH_ROOT . '/tmp'), 'COM_ADMIN_TEMP_DIRECTORY'); + $this->addDirectory( + $registry->get('tmp_path', JPATH_ROOT . '/tmp'), + $registry->get('tmp_path', JPATH_ROOT . '/tmp'), + 'COM_ADMIN_TEMP_DIRECTORY' + ); } return $this->directories; @@ -640,7 +662,7 @@ public function getDirectory($public = false) */ private function addDirectory($name, $path, $message = '') { - $this->directories[$name] = array('writable' => is_writable($path), 'message' => $message); + $this->directories[$name] = array('writable' => is_writable($path), 'message' => $message,); } /** @@ -697,7 +719,7 @@ protected function parsePhpInfo($html) // 3cols if (preg_match($p2, $val, $matchs)) { - $r[$name][trim($matchs[1])] = array(trim($matchs[2]), trim($matchs[3])); + $r[$name][trim($matchs[1])] = array(trim($matchs[2]), trim($matchs[3]),); } // 2cols elseif (preg_match($p3, $val, $matchs)) diff --git a/administrator/components/com_admin/postinstall/eaccelerator.php b/administrator/components/com_admin/postinstall/eaccelerator.php index 41bbba3772dc0..f83ae6a280290 100644 --- a/administrator/components/com_admin/postinstall/eaccelerator.php +++ b/administrator/components/com_admin/postinstall/eaccelerator.php @@ -46,8 +46,7 @@ function admin_postinstall_eaccelerator_action() $prev = ArrayHelper::fromObject(new JConfig); $data = array_merge($prev, array('cacheHandler' => 'file')); - $config = new Registry('config'); - $config->loadArray($data); + $config = new Registry($data); jimport('joomla.filesystem.path'); jimport('joomla.filesystem.file'); diff --git a/administrator/components/com_admin/postinstall/joomla40checks.php b/administrator/components/com_admin/postinstall/joomla40checks.php new file mode 100644 index 0000000000000..9ddd31b98c859 --- /dev/null +++ b/administrator/components/com_admin/postinstall/joomla40checks.php @@ -0,0 +1,50 @@ +getServerType(); + $serverVersion = $db->getVersion(); + + if ($serverType == 'mssql') + { + // MS SQL support will be dropped + return true; + } + + if ($serverType == 'postgresql' && version_compare($serverVersion, '9.2', 'lt')) + { + // PostgreSQL minimum version is 9.2 + return true; + } + + + if ($serverType == 'mysql' && version_compare($serverVersion, '5.5.3', 'lt')) + { + // MySQL minimum version is 5.5.3 + return true; + } + + // PHP minimum version is 5.5 + return version_compare(PHP_VERSION, '5.5.9', 'lt'); +} diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 0aaa9ad97ed99..5c4fc2a73a68d 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -31,6 +31,8 @@ public function update($installer) JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update'); + // This needs to stay for 2.5 update compatibility + $this->deleteUnexistingFiles(); $this->updateManifestCaches(); $this->updateDatabase(); $this->clearRadCache(); @@ -240,6 +242,7 @@ protected function updateManifestCaches() array('component', 'com_contenthistory', '', 1), array('component', 'com_postinstall', '', 1), array('component', 'com_joomlaupdate', '', 1), + array('component', 'com_fields', '', 1), // Libraries array('library', 'phputf8', '', 0), @@ -248,8 +251,8 @@ protected function updateManifestCaches() array('library', 'fof', '', 0), array('library', 'phpass', '', 0), - // Modules site - // Site + // Modules + // - Site array('module', 'mod_articles_archive', '', 0), array('module', 'mod_articles_latest', '', 0), array('module', 'mod_articles_popular', '', 0), @@ -275,7 +278,7 @@ protected function updateManifestCaches() array('module', 'mod_tags_popular', '', 0), array('module', 'mod_tags_similar', '', 0), - // Administrator + // - Administrator array('module', 'mod_custom', '', 1), array('module', 'mod_feed', '', 1), array('module', 'mod_latest', '', 1), @@ -291,7 +294,7 @@ protected function updateManifestCaches() array('module', 'mod_toolbar', '', 1), array('module', 'mod_multilangstatus', '', 1), - // Plug-ins + // Plugins array('plugin', 'gmail', 'authentication', 0), array('plugin', 'joomla', 'authentication', 0), array('plugin', 'ldap', 'authentication', 0), @@ -341,9 +344,14 @@ protected function updateManifestCaches() array('plugin', 'updatenotification', 'system', 0), array('plugin', 'module', 'editors-xtd', 0), array('plugin', 'stats', 'system', 0), - array('plugin', 'packageinstaller','installer',0), - array('plugin', 'folderinstaller','installer', 0), - array('plugin', 'urlinstaller','installer', 0), + array('plugin', 'packageinstaller', 'installer', 0), + array('plugin', 'folderinstaller', 'installer', 0), + array('plugin', 'urlinstaller', 'installer', 0), + array('plugin', 'phpversioncheck', 'quickicon', 0), + array('plugin', 'menu', 'editors-xtd', 0), + array('plugin', 'contact', 'editors-xtd', 0), + array('plugin', 'fields', 'system', 0), + array('plugin', 'gallery', 'fields', 0), // Templates array('template', 'beez3', '', 0), @@ -1170,6 +1178,12 @@ public function deleteUnexistingFiles() '/libraries/joomla/registry/format/xml.php', // Joomla 3.3.1 '/administrator/templates/isis/html/message.php', + // Joomla 3.3.6 + '/media/editors/tinymce/plugins/compat3x/editable_selects.js', + '/media/editors/tinymce/plugins/compat3x/form_utils.js', + '/media/editors/tinymce/plugins/compat3x/mctabs.js', + '/media/editors/tinymce/plugins/compat3x/tiny_mce_popup.js', + '/media/editors/tinymce/plugins/compat3x/validate.js', // Joomla! 3.4 '/administrator/components/com_tags/helpers/html/index.html', '/administrator/components/com_tags/models/fields/index.html', @@ -1276,9 +1290,25 @@ public function deleteUnexistingFiles() '/media/editors/codemirror/js/php.js', '/media/editors/codemirror/js/xml-fold.js', '/media/editors/codemirror/js/xml.js', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon.svg', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon.ttf', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon.woff', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon-small.eot', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon-small.svg', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon-small.ttf', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon-small.woff', + '/media/editors/tinymce/skins/lightgray/fonts/readme.md', + '/media/editors/tinymce/skins/lightgray/fonts/tinymce.dev.svg', + '/media/editors/tinymce/skins/lightgray/fonts/tinymce-small.dev.svg', + '/media/editors/tinymce/skins/lightgray/img/wline.gif', + '/plugins/editors/codemirror/styles.css', + '/plugins/editors/codemirror/styles.min.css', // Joomla! 3.4.1 '/libraries/joomla/environment/request.php', '/media/editors/tinymce/templates/template_list.js', + '/media/editors/codemirror/lib/addons-uncompressed.js', + '/media/editors/codemirror/lib/codemirror-uncompressed.css', + '/media/editors/codemirror/lib/codemirror-uncompressed.js', '/administrator/help/en-GB/Components_Banners_Banners.html', '/administrator/help/en-GB/Components_Banners_Banners_Edit.html', '/administrator/help/en-GB/Components_Banners_Categories.html', @@ -1380,6 +1410,29 @@ public function deleteUnexistingFiles() '/administrator/components/com_config/models/forms/index.html', // Joomla 3.4.2 '/libraries/composer_autoload.php', + '/administrator/templates/hathor/html/com_categories/categories/default_batch.php', + '/administrator/templates/hathor/html/com_tags/tags/default_batch.php', + '/media/editors/codemirror/mode/clike/scala.html', + '/media/editors/codemirror/mode/css/less.html', + '/media/editors/codemirror/mode/css/less_test.js', + '/media/editors/codemirror/mode/css/scss.html', + '/media/editors/codemirror/mode/css/scss_test.js', + '/media/editors/codemirror/mode/css/test.js', + '/media/editors/codemirror/mode/gfm/test.js', + '/media/editors/codemirror/mode/haml/test.js', + '/media/editors/codemirror/mode/javascript/json-ld.html', + '/media/editors/codemirror/mode/javascript/test.js', + '/media/editors/codemirror/mode/javascript/typescript.html', + '/media/editors/codemirror/mode/markdown/test.js', + '/media/editors/codemirror/mode/php/test.js', + '/media/editors/codemirror/mode/ruby/test.js', + '/media/editors/codemirror/mode/shell/test.js', + '/media/editors/codemirror/mode/slim/test.js', + '/media/editors/codemirror/mode/stex/test.js', + '/media/editors/codemirror/mode/textile/test.js', + '/media/editors/codemirror/mode/verilog/test.js', + '/media/editors/codemirror/mode/xml/test.js', + '/media/editors/codemirror/mode/xquery/test.js', // Joomla 3.4.3 '/libraries/classloader.php', '/libraries/ClassLoader.php', @@ -1390,6 +1443,17 @@ public function deleteUnexistingFiles() '/media/com_joomlaupdate/encryption.js', '/media/com_joomlaupdate/json2.js', '/media/com_joomlaupdate/update.js', + '/media/com_finder/css/finder-rtl.css', + '/media/com_finder/css/selectfilter.css', + '/media/com_finder/css/sliderfilter.css', + '/media/com_finder/js/sliderfilter.js', + '/media/editors/codemirror/mode/kotlin/kotlin.js', + '/media/editors/codemirror/mode/kotlin/kotlin.min.js', + '/media/editors/tinymce/plugins/compat3x/editable_selects.js', + '/media/editors/tinymce/plugins/compat3x/form_utils.js', + '/media/editors/tinymce/plugins/compat3x/mctabs.js', + '/media/editors/tinymce/plugins/compat3x/tiny_mce_popup.js', + '/media/editors/tinymce/plugins/compat3x/validate.js', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Dumper.php', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php', @@ -1410,8 +1474,13 @@ public function deleteUnexistingFiles() '/libraries/joomla/document/opensearch/opensearch.php', '/libraries/joomla/document/raw/raw.php', '/libraries/joomla/document/xml/xml.php', + '/plugins/editors/tinymce/fields/skins.php', + '/plugins/user/profile/fields/dob.php', + '/plugins/user/profile/fields/tos.php', '/administrator/components/com_installer/views/languages/tmpl/default_filter.php', '/administrator/components/com_joomlaupdate/helpers/download.php', + '/administrator/components/com_config/controller/application/refreshhelp.php', + '/administrator/components/com_media/models/forms/index.html', // Joomla 3.6.0 '/libraries/simplepie/README.txt', '/libraries/simplepie/simplepie.php', @@ -1423,6 +1492,60 @@ public function deleteUnexistingFiles() '/administrator/manifests/libraries/simplepie.xml', '/administrator/templates/isis/js/jquery.js', '/administrator/templates/isis/js/bootstrap.min.js', + '/media/system/js/permissions.min.js', + '/libraries/platform.php', + '/plugins/user/profile/fields/tos.php', + '/libraries/joomla/application/web/client.php', + // Joomla! 3.6.1 + '/libraries/joomla/database/iterator/azure.php', + '/media/editors/tinymce/skins/lightgray/fonts/icomoon.eot', + // Joomla! 3.6.3 + '/media/editors/codemirror/mode/jade/jade.js', + '/media/editors/codemirror/mode/jade/jade.min.js', + // Joomla __DEPLOY_VERSION__ + '/libraries/joomla/user/authentication.php', + '/libraries/platform.php', + '/libraries/joomla/data/data.php', + '/libraries/joomla/data/dumpable.php', + '/libraries/joomla/data/set.php', + '/administrator/components/com_banners/views/banners/tmpl/default_batch.php', + '/administrator/components/com_categories/views/category/tmpl/edit_extrafields.php', + '/administrator/components/com_categories/views/category/tmpl/edit_options.php', + '/administrator/components/com_categories/views/categories/tmpl/default_batch.php', + '/administrator/components/com_content/views/articles/tmpl/default_batch.php', + '/administrator/components/com_menus/views/items/tmpl/default_batch.php', + '/administrator/components/com_modules/views/modules/tmpl/default_batch.php', + '/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch.php', + '/administrator/components/com_redirect/views/links/tmpl/default_batch.php', + '/administrator/components/com_tags/views/tags/tmpl/default_batch.php', + '/administrator/components/com_users/views/users/tmpl/default_batch.php', + '/components/com_contact/metadata.xml', + '/components/com_contact/views/category/metadata.xml', + '/components/com_contact/views/contact/metadata.xml', + '/components/com_contact/views/featured/metadata.xml', + '/components/com_content/metadata.xml', + '/components/com_content/views/archive/metadata.xml', + '/components/com_content/views/article/metadata.xml', + '/components/com_content/views/categories/metadata.xml', + '/components/com_content/views/category/metadata.xml', + '/components/com_content/views/featured/metadata.xml', + '/components/com_content/views/form/metadata.xml', + '/components/com_finder/views/search/metadata.xml', + '/components/com_mailto/views/mailto/metadata.xml', + '/components/com_mailto/views/sent/metadata.xml', + '/components/com_newsfeeds/metadata.xml', + '/components/com_newsfeeds/views/category/metadata.xml', + '/components/com_newsfeeds/views/newsfeed/metadata.xml', + '/components/com_search/views/search/metadata.xml', + '/components/com_tags/metadata.xml', + '/components/com_tags/views/tag/metadata.xml', + '/components/com_users/metadata.xml', + '/components/com_users/views/login/metadata.xml', + '/components/com_users/views/profile/metadata.xml', + '/components/com_users/views/registration/metadata.xml', + '/components/com_users/views/remind/metadata.xml', + '/components/com_users/views/reset/metadata.xml', + '/components/com_wrapper/metadata.xml', ); // TODO There is an issue while deleting folders using the ftp mode @@ -1477,6 +1600,9 @@ public function deleteUnexistingFiles() '/plugins/user/joomla/postinstall', '/libraries/joomla/registry/format', '/libraries/joomla/registry', + // Joomla! 3.3 + '/plugins/user/profile/fields', + '/media/editors/tinymce/plugins/compat3x', // Joomla! 3.4 '/administrator/components/com_tags/helpers/html', '/administrator/components/com_tags/models/fields', @@ -1501,10 +1627,13 @@ public function deleteUnexistingFiles() '/libraries/phpmailer', '/media/editors/codemirror/css', '/media/editors/codemirror/js', + '/media/com_banners', // Joomla! 3.4.1 '/administrator/components/com_config/views', '/administrator/components/com_config/models/fields', '/administrator/components/com_config/models/forms', + // Joomla! 3.4.2 + '/media/editors/codemirror/mode/smartymixed', // Joomla! 3.5 '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml/Exception', '/libraries/vendor/symfony/yaml/Symfony/Component/Yaml', @@ -1516,9 +1645,18 @@ public function deleteUnexistingFiles() '/libraries/joomla/document/opensearch', '/libraries/joomla/document/raw', '/libraries/joomla/document/xml', + '/administrator/components/com_media/models/forms', + '/media/editors/codemirror/mode/kotlin', + '/media/editors/tinymce/plugins/compat3x', + '/plugins/editors/tinymce/fields', + '/plugins/user/profile/fields', // Joomla 3.6 '/libraries/simplepie/idn', '/libraries/simplepie', + // Joomla! 3.6.3 + '/media/editors/codemirror/mode/jade', + // Joomla __DEPLOY_VERSION__ + '/libraries/joomla/data', ); jimport('joomla.filesystem.file'); @@ -1545,10 +1683,10 @@ public function deleteUnexistingFiles() * Needed for updates post-3.4 * If com_weblinks doesn't exist then assume we can delete the weblinks package manifest (included in the update packages) */ - if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_weblinks/weblinks.php') - && JFile::exists(JPATH_MANIFESTS . '/packages/pkg_weblinks.xml')) + if (!JFile::exists(JPATH_ROOT . '/administrator/components/com_weblinks/weblinks.php') + && JFile::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_weblinks.xml')) { - JFile::delete(JPATH_MANIFESTS . '/packages/pkg_weblinks.xml'); + JFile::delete(JPATH_ROOT . '/administrator/manifests/packages/pkg_weblinks.xml'); } } @@ -1565,9 +1703,9 @@ protected function clearRadCache() { jimport('joomla.filesystem.file'); - if (JFile::exists(JPATH_CACHE . '/fof/cache.php')) + if (JFile::exists(JPATH_ROOT . '/cache/fof/cache.php')) { - JFile::delete(JPATH_CACHE . '/fof/cache.php'); + JFile::delete(JPATH_ROOT . '/cache/fof/cache.php'); } } @@ -1587,7 +1725,8 @@ public function updateAssets() 'com_tags', 'com_contenthistory', 'com_ajax', - 'com_postinstall' + 'com_postinstall', + 'com_fields', ); foreach ($newComponents as $component) @@ -1741,7 +1880,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false) } // Step 1: Drop indexes later to be added again with column lengths limitations at step 2 - $fileName1 = JPATH_ADMINISTRATOR . "/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql"; + $fileName1 = JPATH_ROOT . "/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql"; if (is_file($fileName1)) { @@ -1765,7 +1904,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false) } // Step 2: Perform the index modifications and conversions - $fileName2 = JPATH_ADMINISTRATOR . "/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql"; + $fileName2 = JPATH_ROOT . "/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql"; if (is_file($fileName2)) { @@ -1811,8 +1950,14 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false) */ private function cleanJoomlaCache() { - JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_cache/models'); + JModelLegacy::addIncludePath(JPATH_ROOT . '/administrator/components/com_cache/models'); $model = JModelLegacy::getInstance('cache', 'CacheModel'); + + // Clean frontend cache + $model->clean(); + + // Clean admin cache + $model->setState('client_id', 1); $model->clean(); } } diff --git a/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-04-01.sql b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-04-01.sql index 3a607f8bb3f83..0ac34df324f64 100644 --- a/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-04-01.sql +++ b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-04-01.sql @@ -1,3 +1,7 @@ +-- Rename update site names +UPDATE `#__update_sites` SET `name` = 'Joomla! Core' WHERE `name` = 'Joomla Core' AND `type` = 'collection'; +UPDATE `#__update_sites` SET `name` = 'Joomla! Extension Directory' WHERE `name` = 'Joomla Extension Directory' AND `type` = 'collection'; + UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/core/list.xml' WHERE `name` = 'Joomla! Core' AND `type` = 'collection'; UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/jed/list.xml' WHERE `name` = 'Joomla! Extension Directory' AND `type` = 'collection'; UPDATE `#__update_sites` SET `location` = 'https://update.joomla.org/language/translationlist_3.xml' WHERE `name` = 'Accredited Joomla! Translations' AND `type` = 'collection'; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-01.sql b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-01.sql new file mode 100644 index 0000000000000..511d7cbac13e5 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-01.sql @@ -0,0 +1 @@ +UPDATE `#__extensions` SET `protected` = 1, `enabled` = 1 WHERE `name` = 'com_ajax'; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-05.sql b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-05.sql new file mode 100644 index 0000000000000..4fcc47c42f600 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.6.0-2016-06-05.sql @@ -0,0 +1,5 @@ +-- +-- Add ACL check for to #__languages +-- + +ALTER TABLE `#__languages` ADD COLUMN `asset_id` INT(11) NOT NULL AFTER `lang_id`; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-15.sql b/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-15.sql new file mode 100644 index 0000000000000..586c542e30e92 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-15.sql @@ -0,0 +1,5 @@ +-- +-- Increasing size of the URL field in com_newsfeeds +-- + +ALTER TABLE `#__newsfeeds` MODIFY `link` VARCHAR(2048) NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-16.sql b/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-16.sql new file mode 100644 index 0000000000000..06d2c9e9565ce --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.6.3-2016-08-16.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) VALUES +(700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-06.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-06.sql new file mode 100644 index 0000000000000..1a861d18009bd --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-06.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-22.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-22.sql new file mode 100644 index 0000000000000..02ec2ac98f912 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-22.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql new file mode 100644 index 0000000000000..bbe6de6f98aa3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-29.sql @@ -0,0 +1,56 @@ +CREATE TABLE IF NOT EXISTS `#__fields` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `asset_id` int(10) NOT NULL DEFAULT 0, + `context` varchar(255) NOT NULL DEFAULT '', + `catid` int(10) NOT NULL DEFAULT 0, + `assigned_cat_ids` varchar(255) NOT NULL DEFAULT '', + `title` varchar(255) NOT NULL DEFAULT '', + `alias` varchar(255) NOT NULL DEFAULT '', + `label` varchar(255) NOT NULL DEFAULT '', + `default_value` text NOT NULL DEFAULT '', + `type` varchar(255) NOT NULL DEFAULT 'text', + `options` varchar(255) NOT NULL DEFAULT '', + `note` varchar(255) NOT NULL DEFAULT '', + `description` text NOT NULL, + `state` tinyint(1) NOT NULL DEFAULT '0', + `required` tinyint(1) NOT NULL DEFAULT '0', + `checked_out` int(11) NOT NULL DEFAULT '0', + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ordering` int(11) NOT NULL DEFAULT '0', + `params` text NOT NULL, + `fieldparams` text NOT NULL, + `attributes` text NOT NULL, + `language` char(7) NOT NULL DEFAULT '', + `created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created_user_id` int(10) unsigned NOT NULL DEFAULT '0', + `created_by_alias` varchar(255) NOT NULL DEFAULT '', + `modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified_by` int(10) unsigned NOT NULL DEFAULT '0', + `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `access` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_state` (`state`), + KEY `idx_created_user_id` (`created_user_id`), + KEY `idx_access` (`access`), + KEY `idx_context` (`context`), + KEY `idx_language` (`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__fields_values` ( + `field_id` int(10) unsigned NOT NULL, + `context` varchar(255) NOT NULL, + `item_id` varchar(255) NOT NULL COMMENT 'Allow references to items which have strings as ids, eg. none db systems.', + `value` text NOT NULL DEFAULT '', + KEY (`field_id`), + KEY (`context`), + KEY (`item_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..6ee23ef7b0d3c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-09-29.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) +VALUES +(700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-01.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-01.sql new file mode 100644 index 0000000000000..0eac30c0aa2ef --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-01.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(460, 'plg_editors-xtd_contact', 'plugin', 'contact', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-02.sql b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-02.sql new file mode 100644 index 0000000000000..73fd38ff7dd95 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-10-02.sql @@ -0,0 +1 @@ +ALTER TABLE `#__session` MODIFY `client_id` tinyint(3) unsigned DEFAULT NULL; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-04-01.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-04-01.sql index ff3d61ce21a60..50d35bbd85db7 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-04-01.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-04-01.sql @@ -1,3 +1,7 @@ +-- Rename update site names +UPDATE "#__update_sites" SET "name" = 'Joomla! Core' WHERE "name" = 'Joomla Core' AND "type" = 'collection'; +UPDATE "#__update_sites" SET "name" = 'Joomla! Extension Directory' WHERE "name" = 'Joomla Extension Directory' AND "type" = 'collection'; + UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/core/list.xml' WHERE "name" = 'Joomla! Core' AND "type" = 'collection'; UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/jed/list.xml' WHERE "name" = 'Joomla! Extension Directory' AND "type" = 'collection'; UPDATE "#__update_sites" SET "location" = 'https://update.joomla.org/language/translationlist_3.xml' WHERE "name" = 'Accredited Joomla! Translations' AND "type" = 'collection'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-05-06.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-05-06.sql index bf966fec35042..9d58322a8803b 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-05-06.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-05-06.sql @@ -1,5 +1,6 @@ -DELETE FROM "#__extensions" WHERE "type" = "library" AND "element" = "simplepie"; -INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +DELETE FROM "#__extensions" WHERE "type" = 'library' AND "element" = 'simplepie'; + +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES (455, 'plg_installer_packageinstaller', 'plugin', 'packageinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 1, 0), (456, 'plg_installer_folderinstaller', 'plugin', 'folderinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 2, 0), (457, 'plg_installer_urlinstaller', 'plugin', 'urlinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 3, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-01.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-01.sql new file mode 100644 index 0000000000000..a8c3f145ab347 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-01.sql @@ -0,0 +1 @@ +UPDATE "#__extensions" SET "protected" = 1, "enabled" = 1 WHERE "name" = 'com_ajax'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-05.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-05.sql new file mode 100644 index 0000000000000..3d4aac89763e6 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.0-2016-06-05.sql @@ -0,0 +1,5 @@ +-- +-- Add ACL check for to #__languages +-- + +ALTER TABLE "#__languages" ADD COLUMN "asset_id" bigint DEFAULT 0 NOT NULL; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-15.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-15.sql new file mode 100644 index 0000000000000..6ece41aed6f3a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-15.sql @@ -0,0 +1,5 @@ +-- +-- Increasing size of the URL field in com_newsfeeds +-- + +ALTER TABLE "#__newsfeeds" ALTER COLUMN "link" TYPE character varying(2048); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-16.sql b/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-16.sql new file mode 100644 index 0000000000000..2fd8013e07427 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.6.3-2016-08-16.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") VALUES +(700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-06.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-06.sql new file mode 100644 index 0000000000000..9d4e415850218 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-06.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-22.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-22.sql new file mode 100644 index 0000000000000..2f3349e752c58 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-22.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); 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 new file mode 100644 index 0000000000000..cc13bcb67b178 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-29.sql @@ -0,0 +1,61 @@ +-- +-- Table: #__fields +-- +CREATE TABLE "#__fields" ( + "id" serial NOT NULL, + "asset_id" bigint DEFAULT 0 NOT NULL, + "context" varchar(255) DEFAULT '' NOT NULL, + "catid" bigint DEFAULT 0 NOT NULL, + "assigned_cat_ids" varchar(255) DEFAULT '' NOT NULL, + "title" varchar(255) DEFAULT '' NOT NULL, + "alias" varchar(255) DEFAULT '' NOT NULL, + "label" varchar(255) DEFAULT '' NOT NULL, + "default_value" text DEFAULT '' NOT NULL, + "type" varchar(255) DEFAULT 'text' NOT NULL, + "options" varchar(255) DEFAULT '' NOT NULL, + "note" varchar(255) DEFAULT '' NOT NULL, + "description" text DEFAULT '' NOT NULL, + "state" smallint DEFAULT 0 NOT NULL, + "required" smallint DEFAULT 0 NOT NULL, + "checked_out" integer DEFAULT 0 NOT NULL, + "checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "ordering" bigint DEFAULT 0 NOT NULL, + "params" text DEFAULT '' NOT NULL, + "fieldparams" text DEFAULT '' NOT NULL, + "attributes" text DEFAULT '' NOT NULL, + "language" varchar(7) DEFAULT '' NOT NULL, + "created_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "created_user_id" bigint DEFAULT 0 NOT NULL, + "created_by_alias" varchar(255) DEFAULT '' NOT NULL, + "modified_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "modified_by" bigint DEFAULT 0 NOT NULL, + "publish_up" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "publish_down" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "access" bigint DEFAULT 0 NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "#__fields_idx_checked_out" ON "#__fields" ("checked_out"); +CREATE INDEX "#__fields_idx_state" ON "#__fields" ("state"); +CREATE INDEX "#__fields_idx_created_user_id" ON "#__fields" ("created_user_id"); +CREATE INDEX "#__fields_idx_access" ON "#__fields" ("access"); +CREATE INDEX "#__fields_idx_context" ON "#__fields" ("context"); +CREATE INDEX "#__fields_idx_language" ON "#__fields" ("language"); + +-- +-- Table: #__fields_values +-- +CREATE TABLE "#__fields_values" ( +"field_id" bigint DEFAULT 0 NOT NULL, +"item_id" varchar(255) DEFAULT '' NOT NULL, +"context" varchar(255) DEFAULT '' NOT NULL, +"value" text DEFAULT '' NOT NULL +); +CREATE INDEX "#__fields_values_idx_field_id" ON "#__fields_values" ("field_id"); +CREATE INDEX "#__fields_values_idx_context" ON "#__fields_values" ("context"); +CREATE INDEX "#__fields_values_idx_item_id" ON "#__fields_values" ("item_id"); + +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); + diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..4bfd02b6a7e36 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-09-29.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") +VALUES +(700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-01.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-01.sql new file mode 100644 index 0000000000000..3e5604675df12 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-01.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(460, 'plg_editors-xtd_contact', 'plugin', 'contact', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-02.sql b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-02.sql new file mode 100644 index 0000000000000..96bb63d217247 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-10-02.sql @@ -0,0 +1,2 @@ +ALTER TABLE "#__session" ALTER COLUMN "client_id" DROP NOT NULL; +ALTER TABLE "#__session" ALTER COLUMN "client_id" SET DEFAULT NULL; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-18.sql b/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-18.sql index 4d1dd335e032d..9fc2f7d13f69b 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-18.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-18.sql @@ -1,9 +1,9 @@ -SET IDENTITY_INSERT #__extensions ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT INTO #__extensions (extension_id, name, type, element, folder, client_id, enabled, access, protected, manifest_cache, params, custom_data, system_data, checked_out, checked_out_time, ordering, state) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 28, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '{"legacy":false,"name":"com_joomlaupdate","type":"component","creationDate":"February 2012","author":"Joomla! Project","copyright":"(C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"2.5.2","description":"COM_JOOMLAUPDATE_XML_DESCRIPTION","group":""}', '{}', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT #__extensions OFF; +SET IDENTITY_INSERT [#__extensions] OFF; -INSERT INTO #__menu (menutype, title, alias, note, path, link, type, published, parent_id, level, component_id, ordering, checked_out, checked_out_time, browserNav, access, img, template_style_id, params, lft, rgt, home, language, client_id) +INSERT INTO [#__menu] ([menutype], [title], [alias], [note], [path], [link], [type], [published], [parent_id], [level], [component_id], [ordering], [checked_out], [checked_out_time], [browserNav], [access], [img], [template_style_id], [params], [lft], [rgt], [home], [language], [client_id]) SELECT 'menu', 'com_joomlaupdate', 'Joomla! Update', '', 'Joomla! Update', 'index.php?option=com_joomlaupdate', 'component', 0, 1, 1, 28, 0, 0, '1900-01-01 00:00:00', 0, 0, 'class:joomlaupdate', 0, '', 41, 42, 0, '*', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-19.sql b/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-19.sql index b006209979c84..c703548907b87 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-19.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/2.5.4-2012-03-19.sql @@ -2,6 +2,6 @@ ALTER TABLE [#__languages] ADD [access] INTEGER CONSTRAINT DF_languages_access CREATE UNIQUE INDEX idx_access ON [#__languages] (access); -UPDATE [#__categories] SET extension = 'com_users.notes' WHERE extension = 'com_users'; +UPDATE [#__categories] SET [extension] = 'com_users.notes' WHERE [extension] = 'com_users'; -UPDATE [#__extensions] SET enabled = '1' WHERE protected = '1' AND [type] <> 'plugin'; +UPDATE [#__extensions] SET [enabled] = '1' WHERE [protected] = '1' AND [type] <> 'plugin'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/2.5.7.sql b/administrator/components/com_admin/sql/updates/sqlazure/2.5.7.sql index 17b691a3beba1..a3655c75bafd8 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/2.5.7.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/2.5.7.sql @@ -1 +1,8 @@ -INSERT INTO #__update_sites (name, type, location, enabled, last_check_timestamp) VALUES ('Accredited Joomla! Translations', 'collection', 'http://update.joomla.org/language/translationlist.xml', 1, 0);INSERT INTO #__update_sites_extensions (update_site_id, extension_id) VALUES (SCOPE_IDENTITY(), 600);UPDATE [#__assets] SET name=REPLACE( name, 'com_user.notes.category','com_users.category' );UPDATE [#__categories] SET extension=REPLACE( extension, 'com_user.notes.category','com_users.category' ); \ No newline at end of file +INSERT INTO [#__update_sites] ([name], [type], [location], [enabled], [last_check_timestamp]) +SELECT 'Accredited Joomla! Translations', 'collection', 'http://update.joomla.org/language/translationlist.xml', 1, 0; + +INSERT INTO [#__update_sites_extensions] ([update_site_id], [extension_id]) +SELECT SCOPE_IDENTITY(), 600; + +UPDATE [#__assets] SET [name] = REPLACE([name], 'com_user.notes.category', 'com_users.category'); +UPDATE [#__categories] SET [extension] = REPLACE([extension], 'com_user.notes.category', 'com_users.category'); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.0.3.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.0.3.sql index da103bd4a336c..1f15dd32684cf 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.0.3.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.0.3.sql @@ -1 +1 @@ -ALTER TABLE #__associations ALTER COLUMN id INT; +ALTER TABLE [#__associations] ALTER COLUMN [id] INT; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.1.0.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.1.0.sql index 250e50631bcb3..c77c99fca42e7 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.1.0.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.1.0.sql @@ -25,35 +25,34 @@ CREATE TABLE [#__content_types] ( CONSTRAINT [PK_#__content_types_type_id] PRIMARY KEY CLUSTERED ( [type_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [idx_alias] ON [#__content_types] ( [type_alias] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); -SET IDENTITY_INSERT #__content_types ON; +SET IDENTITY_INSERT [#__content_types] ON; -INSERT INTO #__content_types ([type_id],[type_title],[type_alias],[table],[rules],[field_mappings],[router]) -SELECT 1,'Article','com_content.article','{"special":{"dbtable":"#__content","key":"id","type":"Content","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"introtext", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"attribs", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"asset_id"}], "special": [{"fulltext":"fulltext"}]}','ContentHelperRoute::getArticleRoute' +INSERT INTO [#__content_types] ([type_id], [type_title], [type_alias], [table], [rules], [field_mappings], [router]) +SELECT 1, 'Article', 'com_content.article', '{"special":{"dbtable":"#__content","key":"id","type":"Content","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"state","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"introtext", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"attribs", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"asset_id"}], "special": [{"fulltext":"fulltext"}]}', 'ContentHelperRoute::getArticleRoute' UNION ALL -SELECT 2,'Contact','com_contact.contact','{"special":{"dbtable":"#__contact_details","key":"id","type":"Contact","prefix":"ContactTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"address", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"image", "core_urls":"webpage", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"con_position":"con_position","suburb":"suburb","state":"state","country":"country","postcode":"postcode","telephone":"telephone","fax":"fax","misc":"misc","email_to":"email_to","default_con":"default_con","user_id":"user_id","mobile":"mobile","sortname1":"sortname1","sortname2":"sortname2","sortname3":"sortname3"}]}','ContactHelperRoute::getContactRoute' +SELECT 2, 'Contact', 'com_contact.contact', '{"special":{"dbtable":"#__contact_details","key":"id","type":"Contact","prefix":"ContactTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"address", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"image", "core_urls":"webpage", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"con_position":"con_position","suburb":"suburb","state":"state","country":"country","postcode":"postcode","telephone":"telephone","fax":"fax","misc":"misc","email_to":"email_to","default_con":"default_con","user_id":"user_id","mobile":"mobile","sortname1":"sortname1","sortname2":"sortname2","sortname3":"sortname3"}]}', 'ContactHelperRoute::getContactRoute' UNION ALL -SELECT 3,'Newsfeed','com_newsfeeds.newsfeed','{"special":{"dbtable":"#__newsfeeds","key":"id","type":"Newsfeed","prefix":"NewsfeedsTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"link", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"numarticles":"numarticles","cache_time":"cache_time","rtl":"rtl"}]}','NewsfeedsHelperRoute::getNewsfeedRoute' +SELECT 3, 'Newsfeed', 'com_newsfeeds.newsfeed', '{"special":{"dbtable":"#__newsfeeds","key":"id","type":"Newsfeed","prefix":"NewsfeedsTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"hits","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"link", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"xreference", "asset_id":"null"}], "special": [{"numarticles":"numarticles","cache_time":"cache_time","rtl":"rtl"}]}', 'NewsfeedsHelperRoute::getNewsfeedRoute' UNION ALL -SELECT 4,'User','com_users.user','{"special":{"dbtable":"#__users","key":"id","type":"User","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"null","core_alias":"username","core_created_time":"registerdate","core_modified_time":"lastvisitDate","core_body":"null", "core_hits":"null","core_publish_up":"null","core_publish_down":"null","access":"null", "core_params":"params", "core_featured":"null", "core_metadata":"null", "core_language":"null", "core_images":"null", "core_urls":"null", "core_version":"null", "core_ordering":"null", "core_metakey":"null", "core_metadesc":"null", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{}]}','UsersHelperRoute::getUserRoute' +SELECT 4, 'User', 'com_users.user', '{"special":{"dbtable":"#__users","key":"id","type":"User","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"name","core_state":"null","core_alias":"username","core_created_time":"registerdate","core_modified_time":"lastvisitDate","core_body":"null", "core_hits":"null","core_publish_up":"null","core_publish_down":"null","access":"null", "core_params":"params", "core_featured":"null", "core_metadata":"null", "core_language":"null", "core_images":"null", "core_urls":"null", "core_version":"null", "core_ordering":"null", "core_metakey":"null", "core_metadesc":"null", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{}]}', 'UsersHelperRoute::getUserRoute' UNION ALL -SELECT 5,'Article Category','com_content.category','{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','ContentHelperRoute::getCategoryRoute' +SELECT 5, 'Article Category', 'com_content.category', '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}', 'ContentHelperRoute::getCategoryRoute' UNION ALL -SELECT 6,'Contact Category','com_contact.category','{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','ContactHelperRoute::getCategoryRoute' +SELECT 6, 'Contact Category', 'com_contact.category', '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}', 'ContactHelperRoute::getCategoryRoute' UNION ALL -SELECT 7,'Newsfeeds Category','com_newsfeeds.category','{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}','NewsfeedsHelperRoute::getCategoryRoute' +SELECT 7, 'Newsfeeds Category', 'com_newsfeeds.category', '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}]}', 'NewsfeedsHelperRoute::getCategoryRoute' UNION ALL -SELECT 8,'Tag','com_tags.tag','{"special":{"dbtable":"#__tags","key":"tag_id","type":"Tag","prefix":"TagsTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}','','{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path"}]}','TagsHelperRoute::getTagRoute'; - -SET IDENTITY_INSERT #__content_types OFF; +SELECT 8, 'Tag', 'com_tags.tag', '{"special":{"dbtable":"#__tags","key":"tag_id","type":"Tag","prefix":"TagsTable","config":"array()"},"common":{"dbtable":"#__core_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":[{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"featured", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"urls", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"null", "core_xreference":"null", "asset_id":"null"}], "special": [{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path"}]}', 'TagsHelperRoute::getTagRoute'; +SET IDENTITY_INSERT [#__content_types] OFF; /****** Object: Table [#__contentitem_tag_map] ******/ SET QUOTED_IDENTIFIER ON; @@ -69,31 +68,30 @@ CREATE TABLE [#__contentitem_tag_map] ( [type_alias] ASC, [content_item_id] ASC, [tag_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [idx_tag_name] ON [#__contentitem_tag_map] ( [tag_id] ASC, [type_alias] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_date_id] ON [#__contentitem_tag_map] ( [tag_date] ASC, [tag_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_tag] ON [#__contentitem_tag_map] ( [tag_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_core_content_id] ON [#__contentitem_tag_map] ( [core_content_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); - +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); /****** Object: Table [#__tags] ******/ SET QUOTED_IDENTIFIER ON; @@ -132,52 +130,52 @@ CREATE TABLE [#__tags] ( CONSTRAINT [PK_#__tags_id] PRIMARY KEY CLUSTERED ( [id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [tag_idx] ON [#__tags] ( [published] ASC, [access] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_access] ON [#__tags] ( [access] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__tags] ( [checked_out] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_path] ON [#__tags] ( [path] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_left_right] ON [#__tags] ( [lft] ASC, [rgt] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_alias] ON [#__tags] ( [alias] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_language] ON [#__tags] ( [language] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); -SET IDENTITY_INSERT #__tags ON; +SET IDENTITY_INSERT [#__tags] ON; -INSERT INTO #__tags (id,parent_id,lft,rgt,level,path,title,alias,note,description,published,checked_out,checked_out_time,access,params,metadesc,metakey,metadata,created_user_id,created_time,modified_user_id,modified_time,images,urls,hits,language) - SELECT 1,0,0,1,0,'','ROOT','root','','',1,0,'1900-01-01 00:00:00',1,'{}','','','',0,'2009-10-18 16:07:09',0,'1900-01-01 00:00:00','','',0,'*'; +INSERT INTO [#__tags] ([id], [parent_id], [lft], [rgt], [level], [path], [title], [alias], [note], [description], [published], [checked_out], [checked_out_time], [access], [params], [metadesc], [metakey], [metadata], [created_user_id], [created_time], [modified_user_id], [modified_time], [images], [urls], [hits], [language]) +SELECT 1, 0, 0, 1, 0, '', 'ROOT', 'root', '', '', 1, 0, '1900-01-01 00:00:00', 1, '{}', '', '', '', 0, '2009-10-18 16:07:09', 0, '1900-01-01 00:00:00', '', '', 0, '*'; -SET IDENTITY_INSERT #__tags OFF; +SET IDENTITY_INSERT [#__tags] OFF; /****** Object: Table [#__ucm_base] ******/ SET QUOTED_IDENTIFIER ON; @@ -190,23 +188,23 @@ CREATE TABLE [#__ucm_base] ( CONSTRAINT [PK_#__ucm_base_ucm_id] PRIMARY KEY CLUSTERED ( [ucm_id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [ucm_item_id] ON [#__ucm_base] ( [ucm_item_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [ucm_type_id] ON [#__ucm_base] ( [ucm_type_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [ucm_language_id] ON [#__ucm_base] ( [ucm_language_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); /****** Object: Table [#__ucm_content] ******/ SET QUOTED_IDENTIFIER ON; @@ -247,83 +245,82 @@ CREATE TABLE [#__ucm_content] ( CONSTRAINT [PK_#__ucm_content_core_content_id] PRIMARY KEY CLUSTERED ( [core_content_id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [#__ucm_content_core_content_id$idx_type_alias_item_id] UNIQUE NONCLUSTERED ( [core_type_alias] ASC, [core_content_item_id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [tag_idx] ON [#__ucm_content] ( [core_state] ASC, [core_access] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_access] ON [#__ucm_content] ( [core_access] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_alias] ON [#__ucm_content] ( [core_alias] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_language] ON [#__ucm_content] ( [core_language] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_title] ON [#__ucm_content] ( [core_title] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_modified_time] ON [#__ucm_content] ( [core_modified_time] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_created_time] ON [#__ucm_content] ( [core_created_time] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_content_type] ON [#__ucm_content] ( [core_type_alias] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_core_modified_user_id] ON [#__ucm_content] ( [core_modified_user_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_core_checked_out_user_id] ON [#__ucm_content] ( [core_checked_out_user_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_core_created_user_id] ON [#__ucm_content] ( [core_created_user_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_core_type_id] ON [#__ucm_content] ( [core_type_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); - +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); -SET IDENTITY_INSERT #__extensions ON; -INSERT INTO #__extensions (extension_id, name, type, element, folder, client_id, enabled, access, protected, manifest_cache, params, custom_data, system_data, checked_out, checked_out_time, ordering, state) - SELECT 29, 'com_tags', 'component', 'com_tags', '', 1, 1, 1, 1, '{"name":"com_joomlaupdate","type":"component","creationDate":"March 2013","author":"Joomla! Project","copyright":"(C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.1.0","description":"COM_TAGS_XML_DESCRIPTION","group":""}', '{}', '', '', 0, '1900-01-01 00:00:00', 0, 0; +SET IDENTITY_INSERT [#__extensions] ON; -SET IDENTITY_INSERT #__extensions OFF; +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SELECT 29, 'com_tags', 'component', 'com_tags', '', 1, 1, 1, 1, '{"name":"com_joomlaupdate","type":"component","creationDate":"March 2013","author":"Joomla! Project","copyright":"(C) 2005 - 2016 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.1.0","description":"COM_TAGS_XML_DESCRIPTION","group":""}', '{}', '', '', 0, '1900-01-01 00:00:00', 0, 0; -INSERT INTO #__menu (menutype, title, alias, note, path, link, type, published, parent_id, level, component_id, ordering, checked_out, checked_out_time, browserNav, access, img, template_style_id, params, lft, rgt, home, language, client_id) - SELECT 'menu', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 0, 1, 1, 29, 0, '1900-01-01 00:00:00', 0, 0, 'class:tags', 0, '', 43, 44, 0, '*', 1 +SET IDENTITY_INSERT [#__extensions] OFF; +INSERT INTO [#__menu] ([menutype], [title], [alias], [note], [path], [link], [type], [published], [parent_id], [level], [component_id], [ordering], [checked_out], [checked_out_time], [browserNav], [access], [img], [template_style_id], [params], [lft], [rgt], [home], [language], [client_id]) +SELECT 'menu', 'com_tags', 'Tags', '', 'Tags', 'index.php?option=com_tags', 'component', 0, 1, 1, 29, 0, '1900-01-01 00:00:00', 0, 0, 'class:tags', 0, '', 43, 44, 0, '*', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.1.4.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.1.4.sql index 4f588882ced3e..1521a450952fb 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.1.4.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.1.4.sql @@ -1,6 +1,6 @@ -SET IDENTITY_INSERT #__extensions ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT INTO #__extensions (extension_id, name, type, element, folder, client_id, enabled, access, protected, manifest_cache, params, custom_data, system_data, checked_out, checked_out_time, ordering, state) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 104, 'IDNA Convert', 'library', 'idna_convert', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT #__extensions OFF; +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.2.0.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.2.0.sql index 5da55b5b7413e..03e54027b9f11 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.2.0.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.2.0.sql @@ -8,7 +8,7 @@ UPDATE [#__content_types] SET [content_history_options] = '{"formFile":"administ UPDATE [#__content_types] SET [content_history_options] = '{"formFile":"administrator\/components\/com_newsfeeds\/models\/forms\/newsfeed.xml","hideFields":["asset_id","checked_out","checked_out_time","version"],"ignoreChanges":["modified_by", "modified", "checked_out", "checked_out_time", "version", "hits"],"convertToInt":["publish_up", "publish_down", "featured", "ordering"],"displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"}]}' WHERE [type_alias] = 'com_newsfeeds.newsfeed'; UPDATE [#__content_types] SET [content_history_options] = '{"formFile":"administrator\/components\/com_tags\/models\/forms\/tag.xml", "hideFields":["checked_out","checked_out_time","version", "lft", "rgt", "level", "path", "urls", "publish_up", "publish_down"],"ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version", "hits", "path"],"convertToInt":["publish_up", "publish_down"], "displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"}, {"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"}, {"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"}]}' WHERE [type_alias] = 'com_tags.tag'; -INSERT [#__content_types] ([type_title], [type_alias], [table], [rules], [field_mappings], [router], [content_history_options]) +INSERT INTO [#__content_types] ([type_title], [type_alias], [table], [rules], [field_mappings], [router], [content_history_options]) SELECT 'Banner', 'com_banners.banner', '{"special":{"dbtable":"#__banners","key":"id","type":"Banner","prefix":"BannersTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":{"core_content_item_id":"id","core_title":"name","core_state":"published","core_alias":"alias","core_created_time":"created","core_modified_time":"modified","core_body":"description", "core_hits":"null","core_publish_up":"publish_up","core_publish_down":"publish_down","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"images", "core_urls":"link", "core_version":"version", "core_ordering":"ordering", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"catid", "core_xreference":"null", "asset_id":"null"}, "special":{"imptotal":"imptotal", "impmade":"impmade", "clicks":"clicks", "clickurl":"clickurl", "custombannercode":"custombannercode", "cid":"cid", "purchase_type":"purchase_type", "track_impressions":"track_impressions", "track_clicks":"track_clicks"}}', '', '{"formFile":"administrator\/components\/com_banners\/models\/forms\/banner.xml", "hideFields":["checked_out","checked_out_time","version", "reset"],"ignoreChanges":["modified_by", "modified", "checked_out", "checked_out_time", "version", "imptotal", "impmade", "reset"], "convertToInt":["publish_up", "publish_down", "ordering"], "displayLookup":[{"sourceColumn":"catid","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}, {"sourceColumn":"cid","targetTable":"#__banner_clients","targetColumn":"id","displayColumn":"name"}, {"sourceColumn":"created_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"modified_by","targetTable":"#__users","targetColumn":"id","displayColumn":"name"}]}' UNION ALL SELECT 'Banners Category', 'com_banners.category', '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}', '', '{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}, "special": {"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}', '', '{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml", "hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"], "ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version", "hits", "path"], "convertToInt":["publish_up", "publish_down"], "displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}' @@ -22,9 +22,9 @@ SELECT 'User Notes Category', 'com_users.category', '{"special":{"dbtable":"#__c UPDATE [#__extensions] SET [params] = '{"template_positions_display":"0","upload_limit":"2","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css","font_formats":"woff,ttf,otf","compressed_formats":"zip"}' WHERE [extension_id] = 20; UPDATE [#__extensions] SET [params] = '{"lineNumbers":"1","lineWrapping":"1","matchTags":"1","matchBrackets":"1","marker-gutter":"1","autoCloseTags":"1","autoCloseBrackets":"1","autoFocus":"1","theme":"default","tabmode":"indent"}' WHERE [extension_id] = 410; -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 30, 'com_contenthistory', 'component', 'com_contenthistory', '', 1, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0 UNION ALL SELECT 31, 'com_ajax', 'component', 'com_ajax', '', 1, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0 @@ -39,7 +39,7 @@ SELECT 449, 'plg_authentication_cookie', 'plugin', 'cookie', 'authentication', 0 UNION ALL SELECT 450, 'plg_twofactorauth_yubikey', 'plugin', 'yubikey', 'twofactorauth', 0, 0, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT [#__extensions] OFF; +SET IDENTITY_INSERT [#__extensions] OFF; INSERT INTO [#__menu] ([menutype], [title], [alias], [note], [path], [link], [type], [published], [parent_id], [level], [component_id], [checked_out], [checked_out_time], [browserNav], [access], [img], [template_style_id], [params], [lft], [rgt], [home], [language], [client_id]) SELECT 'menu', 'com_postinstall', 'Post-installation messages', '', 'Post-installation messages', 'index.php?option=com_postinstall', 'component', 0, 1, 1, 32, 0, '1900-01-01 00:00:00', 0, 1, 'class:postinstall', 0, '', 45, 46, 0, '*', 1; @@ -64,7 +64,7 @@ CREATE TABLE [#__postinstall_messages] ( CONSTRAINT [PK_#__postinstall_message_id] PRIMARY KEY CLUSTERED ( [postinstall_message_id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) @@ -86,19 +86,19 @@ CREATE TABLE [#__ucm_history] ( CONSTRAINT [PK_#__ucm_history_version_id] PRIMARY KEY CLUSTERED ( [version_id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + )WITH (PAD_INDEX= OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]; CREATE NONCLUSTERED INDEX [idx_ucm_item_id] ON [#__ucm_history] ( [ucm_type_id] ASC, [ucm_item_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); CREATE NONCLUSTERED INDEX [idx_save_date] ON [#__ucm_history] ( [save_date] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); ALTER TABLE [#__users] ADD [otpKey] [nvarchar](1000) NOT NULL DEFAULT ''; @@ -115,25 +115,25 @@ CREATE TABLE [#__user_keys] ( CONSTRAINT [PK_#__user_keys_id] PRIMARY KEY CLUSTERED ( [id] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [#__user_keys$series] UNIQUE NONCLUSTERED ( [series] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [#__user_keys$series_2] UNIQUE NONCLUSTERED ( [series] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], CONSTRAINT [#__user_keys$series_3] UNIQUE NONCLUSTERED ( [series] ASC - )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]; CREATE NONCLUSTERED INDEX [user_id] ON [#__user_keys] ( [user_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); /* Queries below sync the schema to MySQL where able without causing errors */ @@ -142,7 +142,7 @@ ALTER TABLE [#__contentitem_tag_map] ADD [type_id] [int] NOT NULL; CREATE NONCLUSTERED INDEX [idx_type] ON [#__contentitem_tag_map] ( [type_id] ASC -)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); +)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF); ALTER TABLE [#__newsfeeds] ALTER COLUMN [alias] [nvarchar](255) NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-08.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-08.sql index f928fc24fd103..fbe9b6afbc511 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-08.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-08.sql @@ -1,6 +1,6 @@ -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 403, 'plg_content_contact', 'plugin', 'contact', 'content', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 1, 0; -SET IDENTITY_INSERT #__extensions OFF; +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-23.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-23.sql index d77e722074676..57e62d7b2a894 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-23.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.2.2-2014-01-23.sql @@ -1,2 +1,6 @@ -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 106, 'PHPass', 'library', 'phpass', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.3.0-2014-04-02.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.3.0-2014-04-02.sql index 089cbd342c5bf..40d8bda560390 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.3.0-2014-04-02.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.3.0-2014-04-02.sql @@ -1,6 +1,6 @@ -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 451, 'plg_search_tags', 'plugin', 'tags', 'search', 0, 0, 1, 0, '', '{"search_limit":"50","show_tagged_items":"1"}', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT #__extensions OFF; +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-08-24.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-08-24.sql index 57dcf15c63c02..3927cec9af5dd 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-08-24.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-08-24.sql @@ -1,2 +1,2 @@ -INSERT INTO #__postinstall_messages ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) SELECT 700, 'COM_CPANEL_MSG_HTACCESS_TITLE', 'COM_CPANEL_MSG_HTACCESS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccess.php', 'admin_postinstall_htaccess_condition', '3.4.0', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-09-01.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-09-01.sql index a2e971e8bbb43..da5e9371f4d0b 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-09-01.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-09-01.sql @@ -1,11 +1,9 @@ -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 801, 'weblinks', 'package', 'pkg_weblinks', '', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT [#__extensions] OFF; - -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SET IDENTITY_INSERT [#__extensions] OFF; INSERT INTO [#__update_sites] ([name], [type], [location], [enabled]) SELECT 'Weblinks Update Site', 'extension', 'https://raw.githubusercontent.com/joomla-extensions/weblinks/master/manifest.xml', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-12-03.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-12-03.sql index b22321e76ce64..1fe05e9e99028 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-12-03.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2014-12-03.sql @@ -1 +1 @@ -UPDATE [#__extensions] SET [protected] = '0' WHERE [name] = 'plg_editors-xtd_article' AND [type] = "plugin" AND [element] = "article" AND [folder] = "editors-xtd"; +UPDATE [#__extensions] SET [protected] = '0' WHERE [name] = 'plg_editors-xtd_article' AND [type] = 'plugin' AND [element] = 'article' AND [folder] = 'editors-xtd'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2015-01-21.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2015-01-21.sql index 345442d98bc64..555a71c1af192 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2015-01-21.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.4.0-2015-01-21.sql @@ -1,2 +1,2 @@ INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) -SELECT 700, 'COM_CPANEL_MSG_ROBOTS_TITLE', 'COM_CPANEL_MSG_ROBOTS_BODY', '', 'com_cpanel', 1, 'message', '', '', '', '', '3.3.0', 1; \ No newline at end of file +SELECT 700, 'COM_CPANEL_MSG_ROBOTS_TITLE', 'COM_CPANEL_MSG_ROBOTS_BODY', '', 'com_cpanel', 1, 'message', '', '', '', '', '3.3.0', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-10-13.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-10-13.sql index 0e6c3f52fc354..b58a8e7a0f236 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-10-13.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-10-13.sql @@ -1,2 +1,6 @@ -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 453, 'plg_editors-xtd_module', 'plugin', 'module', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-04.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-04.sql index 4403fa83d4575..1de0da4e7967e 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-04.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-04.sql @@ -1,8 +1,8 @@ DELETE FROM [#__menu] WHERE [title] = 'com_messages_read' AND [client_id] = 1; -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 452, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT [#__extensions] OFF; +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql index 225b844bd91d9..3ff42e5f136f0 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.5.0-2015-11-05.sql @@ -1,9 +1,9 @@ -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 454, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT [#__extensions] OFF; +SET IDENTITY_INSERT [#__extensions] OFF; -INSERT INTO #__postinstall_messages ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) SELECT 700, 'COM_CPANEL_MSG_STATS_COLLECTION_TITLE', 'COM_CPANEL_MSG_STATS_COLLECTION_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/statscollection.php', 'admin_postinstall_statscollection_condition', '3.5.0', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-01.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-01.sql index 59d5fb4c387ca..45dcf467e5c19 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-01.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-01.sql @@ -1,3 +1,7 @@ +-- Rename update site names +UPDATE [#__update_sites] SET [name] = 'Joomla! Core' WHERE [name] = 'Joomla Core' AND [type] = 'collection'; +UPDATE [#__update_sites] SET [name] = 'Joomla! Extension Directory' WHERE [name] = 'Joomla Extension Directory' AND [type] = 'collection'; + UPDATE [#__update_sites] SET [location] = 'https://update.joomla.org/core/list.xml' WHERE [name] = 'Joomla! Core' AND [type] = 'collection'; UPDATE [#__update_sites] SET [location] = 'https://update.joomla.org/jed/list.xml' WHERE [name] = 'Joomla! Extension Directory' AND [type] = 'collection'; UPDATE [#__update_sites] SET [location] = 'https://update.joomla.org/language/translationlist_3.xml' WHERE [name] = 'Accredited Joomla! Translations' AND [type] = 'collection'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-08.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-08.sql index c900ed2e983ec..c343067a9eb2d 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-08.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-04-08.sql @@ -1,9 +1,9 @@ -SET IDENTITY_INSERT [#__extensions] ON; +SET IDENTITY_INSERT [#__extensions] ON; -INSERT [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 802, 'English (United Kingdom)', 'package', 'pkg_en-GB', '', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; -SET IDENTITY_INSERT [#__extensions] OFF; +SET IDENTITY_INSERT [#__extensions] OFF; UPDATE [#__update_sites_extensions] SET [extension_id] = 802 diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-05-06.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-05-06.sql index 481dc74ae0656..18665f63f01ba 100644 --- a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-05-06.sql +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-05-06.sql @@ -1,11 +1,12 @@ -DELETE FROM [#__extensions] WHERE [type] = "library" AND [element] = "simplepie"; -SET IDENTITY_INSERT #__extensions ON; +DELETE FROM [#__extensions] WHERE [type] = 'library' AND [element] = 'simplepie'; -INSERT INTO #__extensions ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) SELECT 455, 'plg_installer_packageinstaller', 'plugin', 'packageinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 1, 0 UNION ALL SELECT 456, 'plg_installer_folderinstaller', 'plugin', 'folderinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 2, 0 UNION ALL SELECT 457, 'plg_installer_urlinstaller', 'plugin', 'urlinstaller', 'installer', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 3, 0; -SET IDENTITY_INSERT #__extensions OFF; \ No newline at end of file +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-01.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-01.sql new file mode 100644 index 0000000000000..3a547b55371be --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-01.sql @@ -0,0 +1 @@ +UPDATE [#__extensions] SET [protected] = 1, [enabled] = 1 WHERE [name] = 'com_ajax'; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-05.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-05.sql new file mode 100644 index 0000000000000..9355db71a3667 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.0-2016-06-05.sql @@ -0,0 +1,5 @@ +-- +-- Add ACL check for to #__languages +-- + +ALTER TABLE [#__languages] ADD [asset_id] [bigint] NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-15.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-15.sql new file mode 100644 index 0000000000000..515854cd88735 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-15.sql @@ -0,0 +1,5 @@ +-- +-- Increasing size of the URL field in com_newsfeeds +-- + +ALTER TABLE [#__newsfeeds] ALTER COLUMN [link] [nvarchar](2048) NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-16.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-16.sql new file mode 100644 index 0000000000000..c54563d9b41ed --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.6.3-2016-08-16.sql @@ -0,0 +1,2 @@ +INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +SELECT 700, 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY', 'PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION', 'plg_system_updatenotification', 1, 'action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_action', 'site://plugins/system/updatenotification/postinstall/updatecachetime.php', 'updatecachetime_postinstall_condition', '3.6.3', 1; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-06.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-06.sql new file mode 100644 index 0000000000000..feec2ca85b9fe --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-06.sql @@ -0,0 +1,6 @@ +SET IDENTITY_INSERT #__extensions ON; + +INSERT INTO #__extensions ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SELECT 458, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT #__extensions OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-22.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-22.sql new file mode 100644 index 0000000000000..6a9744ef65189 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-22.sql @@ -0,0 +1,6 @@ +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SELECT 459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT [#__extensions] OFF; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql new file mode 100644 index 0000000000000..9da07dbbff1a8 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-09-29.sql @@ -0,0 +1,6 @@ +SET IDENTITY_INSERT [#__postinstall_messages] ON; + +INSERT INTO [#__postinstall_messages] ([extension_id], [title_key], [description_key], [action_key], [language_extension], [language_client_id], [type], [action_file], [action], [condition_file], [condition_method], [version_introduced], [enabled]) +SELECT 700, 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY', '', 'com_cpanel', 1, 'message', '', '', 'admin://components/com_admin/postinstall/joomla40checks.php', 'admin_postinstall_joomla40checks_condition', '3.7.0', 1; + +SET IDENTITY_INSERT [#__postinstall_messages] OFF; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-01.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-01.sql new file mode 100644 index 0000000000000..d975345be02cb --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-01.sql @@ -0,0 +1,6 @@ +SET IDENTITY_INSERT [#__extensions] ON; + +INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) +SELECT 460, 'plg_editors-xtd_contact', 'plugin', 'contact', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; + +SET IDENTITY_INSERT [#__extensions] OFF; diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-02.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-02.sql new file mode 100644 index 0000000000000..1373275218f65 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-10-02.sql @@ -0,0 +1 @@ +ALTER TABLE [#__session] ALTER COLUMN [client_id] [tinyint] NULL; diff --git a/administrator/components/com_admin/views/help/view.html.php b/administrator/components/com_admin/views/help/view.html.php index c24445530c572..d379ad41f26f6 100644 --- a/administrator/components/com_admin/views/help/view.html.php +++ b/administrator/components/com_admin/views/help/view.html.php @@ -54,7 +54,7 @@ class AdminViewHelp extends JViewLegacy * @var string * @since 1.6 */ - protected $latest_version_check = 'https://www.joomla.org/download.html'; + protected $latest_version_check = 'https://downloads.joomla.org/latest'; /** * URL for the start here link diff --git a/administrator/components/com_admin/views/profile/tmpl/edit.php b/administrator/components/com_admin/views/profile/tmpl/edit.php index 7e7c15d950dc3..0e9d8f8f4b785 100644 --- a/administrator/components/com_admin/views/profile/tmpl/edit.php +++ b/administrator/components/com_admin/views/profile/tmpl/edit.php @@ -55,7 +55,7 @@ continue; } ?> - name, JText::_($fieldset->label, true)); ?> + name, JText::_($fieldset->label)); ?> form->getFieldset($fieldset->name) as $field) : ?> hidden) : ?>
diff --git a/administrator/components/com_banners/access.xml b/administrator/components/com_banners/access.xml index 7f3ace116eace..d81db5fbe78ee 100644 --- a/administrator/components/com_banners/access.xml +++ b/administrator/components/com_banners/access.xml @@ -1,18 +1,72 @@
- - - - - - - + + + + + + + + + + + + + +
- - - - + + + + + + +
diff --git a/administrator/components/com_banners/banners.php b/administrator/components/com_banners/banners.php index 2f2891af53155..2db000db4c36f 100644 --- a/administrator/components/com_banners/banners.php +++ b/administrator/components/com_banners/banners.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_banners')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } // Execute the task. diff --git a/administrator/components/com_banners/banners.xml b/administrator/components/com_banners/banners.xml index bcb02355da5e2..2769e45714602 100644 --- a/administrator/components/com_banners/banners.xml +++ b/administrator/components/com_banners/banners.xml @@ -35,14 +35,38 @@ Note that all & must be escaped to & for the file to be valid XML and be parsed by the installer --> - com_banners_banners - com_banners_categories - com_banners_clients - com_banners_tracks + + com_banners_banners + + + com_banners_categories + + + com_banners_clients + + + com_banners_tracks + access.xml diff --git a/administrator/components/com_banners/config.xml b/administrator/components/com_banners/config.xml index 5ea4132f6b837..c81c7627c437d 100644 --- a/administrator/components/com_banners/config.xml +++ b/administrator/components/com_banners/config.xml @@ -1,48 +1,46 @@ -
+ description="COM_BANNERS_FIELDSET_CONFIG_CLIENT_OPTIONS_DESC" + > + - - - - - + + + + + - - + > + + + > @@ -51,33 +49,33 @@ name="metakey_prefix" type="text" label="COM_BANNERS_FIELD_METAKEYWORDPREFIX_LABEL" - description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC" /> - + description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC" + />
-
- + description="COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_DESC" + > + - - + + - + @@ -96,6 +94,7 @@ filter="rules" validate="rules" component="com_banners" - section="component" /> + section="component" + />
diff --git a/administrator/components/com_banners/controller.php b/administrator/components/com_banners/controller.php index 075ef264402de..c64d7edb3aa96 100644 --- a/administrator/components/com_banners/controller.php +++ b/administrator/components/com_banners/controller.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php'); +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** * Banners master display controller. diff --git a/administrator/components/com_banners/helpers/banners.php b/administrator/components/com_banners/helpers/banners.php index 08da97e1e815d..40abd99ae0a2d 100644 --- a/administrator/components/com_banners/helpers/banners.php +++ b/administrator/components/com_banners/helpers/banners.php @@ -238,4 +238,62 @@ public static function countItems(&$items) return $items; } + + /** + * Adds Count Items for Tag Manager. + * + * @param stdClass[] &$items The banner tag objects + * @param string $extension The name of the active view. + * + * @return stdClass[] + * + * @since 3.6 + */ + public static function countTagItems(&$items, $extension) + { + $db = JFactory::getDbo(); + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + $query = $db->getQuery(true); + $query->select('published as state, count(*) AS count') + ->from($db->qn('#__contentitem_tag_map') . 'AS ct ') + ->where('ct.tag_id = ' . (int) $item->id) + ->where('ct.type_alias =' . $db->q($extension)) + ->join('LEFT', $db->qn('#__categories') . ' AS c ON ct.content_item_id=c.id') + ->group('state'); + + $db->setQuery($query); + $banners = $db->loadObjectList(); + + foreach ($banners as $banner) + { + if ($banner->state == 1) + { + $item->count_published = $banner->count; + } + + if ($banner->state == 0) + { + $item->count_unpublished = $banner->count; + } + + if ($banner->state == 2) + { + $item->count_archived = $banner->count; + } + + if ($banner->state == -2) + { + $item->count_trashed = $banner->count; + } + } + } + + return $items; + } } diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index a0c18f25fdb41..866885bfafbc9 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -358,7 +358,7 @@ protected function loadFormData() // Prime some default values. if ($this->getState('banner.id') == 0) { - $filters = (array) $app->getUserState('com_banners.banners.filter'); + $filters = (array) $app->getUserState('com_banners.banners.filter'); $filterCatId = isset($filters['category_id']) ? $filters['category_id'] : null; $data->set('catid', $app->input->getInt('catid', $filterCatId)); @@ -473,6 +473,27 @@ protected function prepareTable($table) $table->version++; } + /** + * Allows preprocessing of the JForm object. + * + * @param JForm $form The form object + * @param array $data The data to be merged into the form object + * @param string $group The plugin group to be executed + * + * @return void + * + * @since 3.6.1 + */ + protected function preprocessForm(JForm $form, $data, $group = 'content') + { + if ($this->canCreateCategory()) + { + $form->setFieldAttribute('catid', 'allowAdd', 'true'); + } + + parent::preprocessForm($form, $data, $group); + } + /** * Method to save the form data. * @@ -498,13 +519,13 @@ public function save($data) } // Save New Category - if ($catid == 0) + if ($catid == 0 && $this->canCreateCategory()) { - $table = array(); - $table['title'] = $data['catid']; + $table = array(); + $table['title'] = $data['catid']; $table['parent_id'] = 1; $table['extension'] = 'com_banners'; - $table['language'] = $data['language']; + $table['language'] = $data['language']; $table['published'] = 1; // Create new category and get catid back @@ -521,8 +542,8 @@ public function save($data) if ($data['name'] == $origTable->name) { list($name, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']); - $data['name'] = $name; - $data['alias'] = $alias; + $data['name'] = $name; + $data['alias'] = $alias; } else { @@ -537,4 +558,16 @@ public function save($data) return parent::save($data); } + + /** + * Is the user allowed to create an on the fly category? + * + * @return bool + * + * @since 3.6.1 + */ + private function canCreateCategory() + { + return JFactory::getUser()->authorise('core.create', 'com_banners'); + } } diff --git a/administrator/components/com_banners/models/banners.php b/administrator/components/com_banners/models/banners.php index d253ea6ec9daf..52ecdd2a5d131 100644 --- a/administrator/components/com_banners/models/banners.php +++ b/administrator/components/com_banners/models/banners.php @@ -96,23 +96,23 @@ protected function getListQuery() $query->select( $this->getState( 'list.select', - 'a.id AS id,' . - 'a.name AS name,' . - 'a.alias AS alias,' . - 'a.checked_out AS checked_out,' . - 'a.checked_out_time AS checked_out_time,' . - 'a.catid AS catid,' . - 'a.clicks AS clicks,' . - 'a.metakey AS metakey,' . - 'a.sticky AS sticky,' . - 'a.impmade AS impmade,' . - 'a.imptotal AS imptotal,' . - 'a.state AS state,' . - 'a.ordering AS ordering,' . - 'a.purchase_type AS purchase_type,' . - 'a.language,' . - 'a.publish_up,' . - 'a.publish_down' + 'a.id AS id,' + . 'a.name AS name,' + . 'a.alias AS alias,' + . 'a.checked_out AS checked_out,' + . 'a.checked_out_time AS checked_out_time,' + . 'a.catid AS catid,' + . 'a.clicks AS clicks,' + . 'a.metakey AS metakey,' + . 'a.sticky AS sticky,' + . 'a.impmade AS impmade,' + . 'a.imptotal AS imptotal,' + . 'a.state AS state,' + . 'a.ordering AS ordering,' + . 'a.purchase_type AS purchase_type,' + . 'a.language,' + . 'a.publish_up,' + . 'a.publish_down' ) ); $query->from($db->quoteName('#__banners', 'a')); diff --git a/administrator/components/com_banners/models/clients.php b/administrator/components/com_banners/models/clients.php index 3eccf56840022..81d483a8ca5dd 100644 --- a/administrator/components/com_banners/models/clients.php +++ b/administrator/components/com_banners/models/clients.php @@ -99,7 +99,7 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true); $defaultPurchase = JComponentHelper::getParams('com_banners')->get('purchase_type', 3); @@ -108,14 +108,14 @@ protected function getListQuery() $query->select( $this->getState( 'list.select', - 'a.id AS id,' . - 'a.name AS name,' . - 'a.contact AS contact,' . - 'a.checked_out AS checked_out,' . - 'a.checked_out_time AS checked_out_time, ' . - 'a.state AS state,' . - 'a.metakey AS metakey,' . - 'a.purchase_type as purchase_type' + 'a.id AS id,' + . 'a.name AS name,' + . 'a.contact AS contact,' + . 'a.checked_out AS checked_out,' + . 'a.checked_out_time AS checked_out_time, ' + . 'a.state AS state,' + . 'a.metakey AS metakey,' + . 'a.purchase_type as purchase_type' ) ); diff --git a/administrator/components/com_banners/models/fields/bannerclient.php b/administrator/components/com_banners/models/fields/bannerclient.php index ec9281ed9a341..1351a2afa1827 100644 --- a/administrator/components/com_banners/models/fields/bannerclient.php +++ b/administrator/components/com_banners/models/fields/bannerclient.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** @@ -18,7 +16,7 @@ * * @since 1.6 */ -class JFormFieldBannerClient extends JFormFieldList +class JFormFieldBannerClient extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_banners/models/forms/banner.xml b/administrator/components/com_banners/models/forms/banner.xml index be3f732e511be..a88d835b51b25 100644 --- a/administrator/components/com_banners/models/forms/banner.xml +++ b/administrator/components/com_banners/models/forms/banner.xml @@ -1,224 +1,376 @@
-
+
- + - + size="40" + required="true" + /> - + size="40" + hint="JFIELD_ALIAS_PLACEHOLDER" + /> - - + size="1" + default="1" + > - + table="#__banners" + /> - + - - + - - - + + + - + - +
-
+
- + - + - + - + - + filter="unset" + /> - + - + - +
-
+
- + default="0" + class="btn-group btn-group-yesno" + >
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + description="COM_BANNERS_FIELD_TRACKIMPRESSION_DESC" + default="0" + > + - - + +
-
+
- + - + class="btn-group btn-group-yesno" + default="0" + > - + description="COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC" + />
- - - - - - - + /> + + + + + +
- +
diff --git a/administrator/components/com_banners/models/forms/client.xml b/administrator/components/com_banners/models/forms/client.xml index 0ff3a5bedb428..d568ab1aeebd6 100644 --- a/administrator/components/com_banners/models/forms/client.xml +++ b/administrator/components/com_banners/models/forms/client.xml @@ -1,38 +1,62 @@
-
- +
+ - + class="input-xxlarge input-large-text" + size="40" + required="true" + /> - + - + - + - - - - - - - - + > + + + + + + - + default="0" + class="chzn-color" + > - + > @@ -80,36 +108,45 @@
-
- - +
+ - + > - - + description="COM_BANNERS_FIELD_CLIENT_METAKEYWORDPREFIX_DESC" + />
- - - + rows="5" + cols="80" + />
diff --git a/administrator/components/com_banners/models/forms/download.xml b/administrator/components/com_banners/models/forms/download.xml index 688c8a129d1c8..0c90b70bc95d4 100644 --- a/administrator/components/com_banners/models/forms/download.xml +++ b/administrator/components/com_banners/models/forms/download.xml @@ -1,19 +1,32 @@
+
- + class="btn-group btn-group-yesno" + > - + label="COM_BANNERS_FIELD_BASENAME_LABEL" + /> +
diff --git a/administrator/components/com_banners/models/forms/filter_banners.xml b/administrator/components/com_banners/models/forms/filter_banners.xml index e7f043db69cb8..76268022c7fec 100644 --- a/administrator/components/com_banners/models/forms/filter_banners.xml +++ b/administrator/components/com_banners/models/forms/filter_banners.xml @@ -1,6 +1,6 @@
- + + + + + JOPTION_SELECT_LANGUAGE + @@ -93,13 +98,14 @@ + diff --git a/administrator/components/com_banners/models/forms/filter_clients.xml b/administrator/components/com_banners/models/forms/filter_clients.xml index b692198ed5d9b..1552335b63704 100644 --- a/administrator/components/com_banners/models/forms/filter_clients.xml +++ b/administrator/components/com_banners/models/forms/filter_clients.xml @@ -8,6 +8,7 @@ description="COM_BANNERS_CLIENTS_FILTER_SEARCH_DESC" hint="JSEARCH_FILTER" /> + + @@ -55,13 +57,14 @@ + diff --git a/administrator/components/com_banners/models/forms/filter_tracks.xml b/administrator/components/com_banners/models/forms/filter_tracks.xml index 6f449bae9fb29..449c4e574b1f7 100644 --- a/administrator/components/com_banners/models/forms/filter_tracks.xml +++ b/administrator/components/com_banners/models/forms/filter_tracks.xml @@ -1,6 +1,6 @@ - + + + + COM_BANNERS_TYPE1 + + + JDATE_ASC + getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete($db->quoteName('#__banner_tracks')); @@ -374,7 +374,7 @@ protected function getCategoryName() if ($categoryId) { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('title') ->from($db->quoteName('#__categories')) @@ -411,7 +411,7 @@ protected function getClientName() if ($clientId) { - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('name') ->from($db->quoteName('#__banner_clients')) @@ -470,21 +470,21 @@ public function getContent() { if (!isset($this->content)) { - $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","' . - str_replace('"', '""', JText::_('JCATEGORY')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","' . - str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","' . - str_replace('"', '""', JText::_('JDATE')) . '"' . "\n"; + $this->content = '"' . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_NAME')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_CLIENT')) . '","' + . str_replace('"', '""', JText::_('JCATEGORY')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_TYPE')) . '","' + . str_replace('"', '""', JText::_('COM_BANNERS_HEADING_COUNT')) . '","' + . str_replace('"', '""', JText::_('JDATE')) . '"' . "\n"; foreach ($this->getItems() as $item) { - $this->content .= '"' . str_replace('"', '""', $item->name) . '","' . - str_replace('"', '""', $item->client_name) . '","' . - str_replace('"', '""', $item->category_title) . '","' . - str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","' . - str_replace('"', '""', $item->count) . '","' . - str_replace('"', '""', $item->track_date) . '"' . "\n"; + $this->content .= '"' . str_replace('"', '""', $item->name) . '","' + . str_replace('"', '""', $item->client_name) . '","' + . str_replace('"', '""', $item->category_title) . '","' + . str_replace('"', '""', ($item->track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION') : JText::_('COM_BANNERS_CLICK'))) . '","' + . str_replace('"', '""', $item->count) . '","' + . str_replace('"', '""', $item->track_date) . '"' . "\n"; } if ($this->getState('compressed')) diff --git a/administrator/components/com_banners/sql/install.mysql.utf8.sql b/administrator/components/com_banners/sql/install.mysql.utf8.sql index e123c0cc36f63..b74a76ddd798d 100644 --- a/administrator/components/com_banners/sql/install.mysql.utf8.sql +++ b/administrator/components/com_banners/sql/install.mysql.utf8.sql @@ -1,69 +1,85 @@ -CREATE TABLE `#__banners` ( - `id` INTEGER NOT NULL auto_increment, - `cid` INTEGER NOT NULL DEFAULT '0', - `type` INTEGER NOT NULL DEFAULT '0', - `name` VARCHAR(255) NOT NULL DEFAULT '', - `alias` VARCHAR(255) NOT NULL DEFAULT '', - `imptotal` INTEGER NOT NULL DEFAULT '0', - `impmade` INTEGER NOT NULL DEFAULT '0', - `clicks` INTEGER NOT NULL DEFAULT '0', - `clickurl` VARCHAR(200) NOT NULL DEFAULT '', - `state` TINYINT(3) NOT NULL DEFAULT '0', - `catid` INTEGER UNSIGNED NOT NULL DEFAULT 0, - `description` TEXT NOT NULL, - `custombannercode` VARCHAR(2048) NOT NULL, - `sticky` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - `ordering` INTEGER NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL, - `params` TEXT NOT NULL, - `own_prefix` TINYINT(1) NOT NULL DEFAULT '0', - `metakey_prefix` VARCHAR(255) NOT NULL DEFAULT '', - `purchase_type` TINYINT NOT NULL DEFAULT '-1', - `track_clicks` TINYINT NOT NULL DEFAULT '-1', - `track_impressions` TINYINT NOT NULL DEFAULT '-1', - `checked_out` INTEGER UNSIGNED NOT NULL DEFAULT '0', - `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `publish_up` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `publish_down` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `reset` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', +-- +-- Table structure for table `#__banners` +-- + +CREATE TABLE IF NOT EXISTS `#__banners` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` int(11) NOT NULL DEFAULT 0, + `type` int(11) NOT NULL DEFAULT 0, + `name` varchar(255) NOT NULL DEFAULT '', + `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', + `imptotal` int(11) NOT NULL DEFAULT 0, + `impmade` int(11) NOT NULL DEFAULT 0, + `clicks` int(11) NOT NULL DEFAULT 0, + `clickurl` varchar(200) NOT NULL DEFAULT '', + `state` tinyint(3) NOT NULL DEFAULT 0, + `catid` int(10) unsigned NOT NULL DEFAULT 0, + `description` text NOT NULL, + `custombannercode` varchar(2048) NOT NULL, + `sticky` tinyint(1) unsigned NOT NULL DEFAULT 0, + `ordering` int(11) NOT NULL DEFAULT 0, + `metakey` text NOT NULL, + `params` text NOT NULL, + `own_prefix` tinyint(1) NOT NULL DEFAULT 0, + `metakey_prefix` varchar(400) NOT NULL DEFAULT '', + `purchase_type` tinyint(4) NOT NULL DEFAULT -1, + `track_clicks` tinyint(4) NOT NULL DEFAULT -1, + `track_impressions` tinyint(4) NOT NULL DEFAULT -1, + `checked_out` int(10) unsigned NOT NULL DEFAULT 0, + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `reset` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `language` char(7) NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - INDEX `idx_state` (`state`), - INDEX `idx_own_prefix` (`own_prefix`), - INDEX `idx_metakey_prefix` (`metakey_prefix`), - INDEX `idx_banner_catid`(`catid`), - INDEX `idx_language` (`language`) -) DEFAULT CHARSET=utf8; + `created_by` int(10) unsigned NOT NULL DEFAULT 0, + `created_by_alias` varchar(255) NOT NULL DEFAULT '', + `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified_by` int(10) unsigned NOT NULL DEFAULT 0, + `version` int(10) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (`id`), + KEY `idx_state` (`state`), + KEY `idx_own_prefix` (`own_prefix`), + KEY `idx_metakey_prefix` (`metakey_prefix`(100)), + KEY `idx_banner_catid` (`catid`), + KEY `idx_language` (`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `#__banner_clients` +-- -CREATE TABLE `#__banner_clients` ( - `id` INTEGER NOT NULL auto_increment, - `name` VARCHAR(255) NOT NULL DEFAULT '', - `contact` VARCHAR(255) NOT NULL DEFAULT '', - `email` VARCHAR(255) NOT NULL DEFAULT '', - `extrainfo` TEXT NOT NULL, - `state` TINYINT(3) NOT NULL DEFAULT '0', - `checked_out` INTEGER UNSIGNED NOT NULL DEFAULT '0', - `checked_out_time` DATETIME NOT NULL default '0000-00-00 00:00:00', - `metakey` TEXT NOT NULL, - `own_prefix` TINYINT NOT NULL DEFAULT '0', - `metakey_prefix` VARCHAR(255) NOT NULL default '', - `purchase_type` TINYINT NOT NULL DEFAULT '-1', - `track_clicks` TINYINT NOT NULL DEFAULT '-1', - `track_impressions` TINYINT NOT NULL DEFAULT '-1', - PRIMARY KEY (`id`), - INDEX `idx_own_prefix` (`own_prefix`), - INDEX `idx_metakey_prefix` (`metakey_prefix`) -) DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `#__banner_clients` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `contact` varchar(255) NOT NULL DEFAULT '', + `email` varchar(255) NOT NULL DEFAULT '', + `extrainfo` text NOT NULL, + `state` tinyint(3) NOT NULL DEFAULT 0, + `checked_out` int(10) unsigned NOT NULL DEFAULT 0, + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `metakey` text NOT NULL, + `own_prefix` tinyint(4) NOT NULL DEFAULT 0, + `metakey_prefix` varchar(400) NOT NULL DEFAULT '', + `purchase_type` tinyint(4) NOT NULL DEFAULT -1, + `track_clicks` tinyint(4) NOT NULL DEFAULT -1, + `track_impressions` tinyint(4) NOT NULL DEFAULT -1, + PRIMARY KEY (`id`), + KEY `idx_own_prefix` (`own_prefix`), + KEY `idx_metakey_prefix` (`metakey_prefix`(100)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; -CREATE TABLE `#__banner_tracks` ( - `track_date` DATETIME NOT NULL, - `track_type` INTEGER UNSIGNED NOT NULL, - `banner_id` INTEGER UNSIGNED NOT NULL, - `count` INTEGER UNSIGNED NOT NULL DEFAULT '0', - PRIMARY KEY (`track_date`, `track_type`, `banner_id`), - INDEX `idx_track_date` (`track_date`), - INDEX `idx_track_type` (`track_type`), - INDEX `idx_banner_id` (`banner_id`) -) DEFAULT CHARSET=utf8; +-- +-- Table structure for table `#__banner_tracks` +-- +CREATE TABLE IF NOT EXISTS `#__banner_tracks` ( + `track_date` datetime NOT NULL, + `track_type` int(10) unsigned NOT NULL, + `banner_id` int(10) unsigned NOT NULL, + `count` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`track_date`,`track_type`,`banner_id`), + KEY `idx_track_date` (`track_date`), + KEY `idx_track_type` (`track_type`), + KEY `idx_banner_id` (`banner_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/administrator/components/com_banners/tables/banner.php b/administrator/components/com_banners/tables/banner.php index dfa2ab822cd05..ea85506acb206 100644 --- a/administrator/components/com_banners/tables/banner.php +++ b/administrator/components/com_banners/tables/banner.php @@ -129,8 +129,7 @@ public function bind($array, $ignore = array()) { if (isset($array['params']) && is_array($array['params'])) { - $registry = new Registry; - $registry->loadArray($array['params']); + $registry = new Registry($array['params']); if ((int) $registry->get('width', 0) < 0) { diff --git a/administrator/components/com_banners/tables/client.php b/administrator/components/com_banners/tables/client.php index ae0e62f1fe4b9..998e63d87855d 100644 --- a/administrator/components/com_banners/tables/client.php +++ b/administrator/components/com_banners/tables/client.php @@ -86,10 +86,10 @@ public function publish($pks = null, $state = 1, $userId = 0) // Update the publishing state for rows with the given primary keys. $this->_db->setQuery( - 'UPDATE ' . $this->_db->quoteName($this->_tbl) . - ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state . - ' WHERE (' . $where . ')' . - $checkin + 'UPDATE ' . $this->_db->quoteName($this->_tbl) + . ' SET ' . $this->_db->quoteName('state') . ' = ' . (int) $state + . ' WHERE (' . $where . ')' + . $checkin ); try diff --git a/administrator/components/com_banners/views/banner/tmpl/edit.php b/administrator/components/com_banners/views/banner/tmpl/edit.php index 86d692d1854fc..6e9a81075794e 100644 --- a/administrator/components/com_banners/views/banner/tmpl/edit.php +++ b/administrator/components/com_banners/views/banner/tmpl/edit.php @@ -10,6 +10,8 @@ defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); + +JHtml::_('jquery.framework'); JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0 )); @@ -23,12 +25,12 @@ }; jQuery(document).ready(function ($){ $("#jform_type").on("change", function (a, params) { - + var v = typeof(params) !== "object" ? $("#jform_type").val() : params.selected; - + var img_url = $("#image, #url"); var custom = $("#custom"); - + switch (v) { case "0": // Image @@ -56,16 +58,16 @@
- form->getControlGroup('type'); ?> + form->renderField('type'); ?>
- form->getControlGroups('image'); ?> + form->renderFieldset('image'); ?>
- form->getControlGroup('custombannercode'); ?> + form->renderField('custombannercode'); ?>
form->getControlGroup('clickurl'); - echo $this->form->getControlGroup('description'); + echo $this->form->renderField('clickurl'); + echo $this->form->renderField('description'); ?>
@@ -75,7 +77,7 @@ - form->getControlGroups('otherparams'); ?> + form->renderFieldset('otherparams'); ?> @@ -84,7 +86,7 @@
- form->getControlGroups('metadata'); ?> + form->renderFieldset('metadata'); ?>
diff --git a/administrator/components/com_banners/views/banner/view.html.php b/administrator/components/com_banners/views/banner/view.html.php index 3c522f4369a66..51fed3bba5bdd 100644 --- a/administrator/components/com_banners/views/banner/view.html.php +++ b/administrator/components/com_banners/views/banner/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php'); +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** * View to edit a banner. @@ -62,7 +62,6 @@ public function display($tpl = null) } $this->addToolbar(); - JHtml::_('jquery.framework'); return parent::display($tpl); } @@ -112,7 +111,7 @@ protected function addToolbar() } else { - if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) + if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) { JToolbarHelper::versions('com_banners.banner', $this->item->id); } diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php index f4eabd6ac8b5e..5f7804e9cf825 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default.php +++ b/administrator/components/com_banners/views/banners/tmpl/default.php @@ -97,6 +97,7 @@ clicks; ?> - impmade ? 100 * $item->clicks / $item->impmade : 0); ?> - - language == '*'): ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_banners/views/banners/tmpl/default_batch.php b/administrator/components/com_banners/views/banners/tmpl/default_batch.php deleted file mode 100644 index 133dfd5e13683..0000000000000 --- a/administrator/components/com_banners/views/banners/tmpl/default_batch.php +++ /dev/null @@ -1,53 +0,0 @@ -state->get('filter.published'); -?> - diff --git a/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php b/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php index 36609599d9bc0..e747dbb8ac062 100644 --- a/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php +++ b/administrator/components/com_banners/views/banners/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + diff --git a/administrator/components/com_banners/views/banners/view.html.php b/administrator/components/com_banners/views/banners/view.html.php index dc842b884bb39..7dceb56355d30 100644 --- a/administrator/components/com_banners/views/banners/view.html.php +++ b/administrator/components/com_banners/views/banners/view.html.php @@ -73,7 +73,6 @@ public function display($tpl = null) BannersHelper::addSubmenu('banners'); $this->addToolbar(); - require_once JPATH_COMPONENT . '/models/fields/bannerclient.php'; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -92,7 +91,7 @@ public function display($tpl = null) */ protected function addToolbar() { - require_once JPATH_COMPONENT . '/helpers/banners.php'; + JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); $canDo = JHelperContent::getActions('com_banners', 'category', $this->state->get('filter.category_id')); $user = JFactory::getUser(); diff --git a/administrator/components/com_banners/views/client/tmpl/edit.php b/administrator/components/com_banners/views/client/tmpl/edit.php index 267cb45d17c14..160bc7d893207 100644 --- a/administrator/components/com_banners/views/client/tmpl/edit.php +++ b/administrator/components/com_banners/views/client/tmpl/edit.php @@ -35,12 +35,12 @@
form->getControlGroup('contact'); - echo $this->form->getControlGroup('email'); - echo $this->form->getControlGroup('purchase_type'); - echo $this->form->getControlGroup('track_impressions'); - echo $this->form->getControlGroup('track_clicks'); - echo $this->form->getControlGroups('extra'); + echo $this->form->renderField('contact'); + echo $this->form->renderField('email'); + echo $this->form->renderField('purchase_type'); + echo $this->form->renderField('track_impressions'); + echo $this->form->renderField('track_clicks'); + echo $this->form->renderFieldset('extra'); ?>
@@ -50,7 +50,7 @@ - form->getControlGroups('metadata'); ?> + form->renderFieldset('metadata'); ?> diff --git a/administrator/components/com_banners/views/client/view.html.php b/administrator/components/com_banners/views/client/view.html.php index 2d03c7b037198..3ae6d6df856df 100644 --- a/administrator/components/com_banners/views/client/view.html.php +++ b/administrator/components/com_banners/views/client/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php'); +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** * View to edit a client. @@ -105,6 +105,7 @@ protected function addToolbar() { JToolbarHelper::save2new('client.save2new'); } + // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { @@ -117,7 +118,7 @@ protected function addToolbar() } else { - if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) + if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) { JToolbarHelper::versions('com_banners.client', $this->item->id); } diff --git a/administrator/components/com_banners/views/clients/tmpl/default.php b/administrator/components/com_banners/views/clients/tmpl/default.php index 44e5a495e9d92..255753bd27d4f 100644 --- a/administrator/components/com_banners/views/clients/tmpl/default.php +++ b/administrator/components/com_banners/views/clients/tmpl/default.php @@ -15,6 +15,14 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); +$purchaseTypes = array( + '1' => 'UNLIMITED', + '2' => 'YEARLY', + '3' => 'MONTHLY', + '4' => 'WEEKLY', + '5' => 'DAILY', +); + $user = JFactory::getUser(); $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); @@ -92,6 +100,7 @@
state, $i, 'clients.', $canChange); ?> state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'clients'); @@ -135,9 +144,9 @@ purchase_type < 0): ?> - get('purchase_type'))); ?> + get('purchase_type')])); ?> - purchase_type); ?> + purchase_type]); ?> diff --git a/administrator/components/com_banners/views/clients/view.html.php b/administrator/components/com_banners/views/clients/view.html.php index 295aa03a86358..5bde6f4d9bd5f 100644 --- a/administrator/components/com_banners/views/clients/view.html.php +++ b/administrator/components/com_banners/views/clients/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php'); +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** * View class for a list of clients. @@ -128,12 +128,12 @@ protected function addToolbar() protected function getSortFields() { return array( - 'a.status' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), - 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'), + 'a.status' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), + 'contact' => JText::_('COM_BANNERS_HEADING_CONTACT'), 'client_name' => JText::_('COM_BANNERS_HEADING_CLIENT'), - 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'nbanners' => JText::_('COM_BANNERS_HEADING_ACTIVE'), + 'a.id' => JText::_('JGRID_HEADING_ID') ); } } diff --git a/administrator/components/com_banners/views/download/tmpl/default.php b/administrator/components/com_banners/views/download/tmpl/default.php index 85277d11c0dc8..b14e9910659a5 100644 --- a/administrator/components/com_banners/views/download/tmpl/default.php +++ b/administrator/components/com_banners/views/download/tmpl/default.php @@ -8,25 +8,30 @@ */ defined('_JEXEC') or die; + +JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); ?> - -
- +
+ form->getFieldset() as $field) : ?> - hidden) : ?> - label; ?> - - input; ?> + form->renderField($field->fieldname); ?> -
- - -
- + + + +
diff --git a/administrator/components/com_banners/views/tracks/tmpl/default.php b/administrator/components/com_banners/views/tracks/tmpl/default.php index e32fdc47672cd..b3ef06d5e0c04 100644 --- a/administrator/components/com_banners/views/tracks/tmpl/default.php +++ b/administrator/components/com_banners/views/tracks/tmpl/default.php @@ -83,6 +83,26 @@ + + + JText::_('COM_BANNERS_TRACKS_DOWNLOAD'), + 'url' => JRoute::_('index.php?option=com_banners&view=download&tmpl=component'), + 'height' => '370px', + 'width' => '300px', + 'modalWidth' => '40', + 'footer' => '' + . JText::_("COM_BANNERS_CANCEL") . '' + . '', + ) + ); ?> + diff --git a/administrator/components/com_banners/views/tracks/view.html.php b/administrator/components/com_banners/views/tracks/view.html.php index f623d70ac5af1..28bd67efd90bd 100644 --- a/administrator/components/com_banners/views/tracks/view.html.php +++ b/administrator/components/com_banners/views/tracks/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('BannersHelper', JPATH_COMPONENT . '/helpers/banners.php'); +JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php'); /** * View class for a list of tracks. @@ -66,8 +66,6 @@ public function display($tpl = null) $this->addToolbar(); - require_once JPATH_COMPONENT . '/models/fields/bannerclient.php'; - $this->sidebar = JHtmlSidebar::render(); return parent::display($tpl); @@ -87,7 +85,19 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_BANNERS_MANAGER_TRACKS'), 'bookmark banners-tracks'); $bar = JToolbar::getInstance('toolbar'); - $bar->appendButton('Popup', 'download', 'JTOOLBAR_EXPORT', 'index.php?option=com_banners&view=download&tmpl=component', 600, 300); + + // Instantiate a new JLayoutFile instance and render the export button + $layout = new JLayoutFile('joomla.toolbar.modal'); + + $dhtml = $layout->render( + array( + 'selector' => 'downloadModal', + 'icon' => 'download', + 'text' => JText::_('JTOOLBAR_EXPORT'), + ) + ); + + $bar->appendButton('Custom', $dhtml, 'download'); if ($canDo->get('core.delete')) { @@ -104,7 +114,6 @@ protected function addToolbar() JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_TRACKS'); JHtmlSidebar::setAction('index.php?option=com_banners&view=tracks'); - } /** @@ -117,10 +126,10 @@ protected function addToolbar() protected function getSortFields() { return array( - 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'), - 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), + 'b.name' => JText::_('COM_BANNERS_HEADING_NAME'), + 'cl.name' => JText::_('COM_BANNERS_HEADING_CLIENT'), 'track_type' => JText::_('COM_BANNERS_HEADING_TYPE'), - 'count' => JText::_('COM_BANNERS_HEADING_COUNT'), + 'count' => JText::_('COM_BANNERS_HEADING_COUNT'), 'track_date' => JText::_('JDATE') ); } diff --git a/administrator/components/com_cache/cache.php b/administrator/components/com_cache/cache.php index 694adac16ccab..f42244702f049 100644 --- a/administrator/components/com_cache/cache.php +++ b/administrator/components/com_cache/cache.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_cache')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Cache'); diff --git a/administrator/components/com_cache/controller.php b/administrator/components/com_cache/controller.php index 24854f3407332..88d2f30e51ec9 100644 --- a/administrator/components/com_cache/controller.php +++ b/administrator/components/com_cache/controller.php @@ -28,7 +28,7 @@ class CacheController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/cache.php'; + JLoader::register('CacheHelper', JPATH_ADMINISTRATOR . '/components/com_cache/helpers/cache.php'); // Get the document object. $document = JFactory::getDocument(); @@ -93,6 +93,7 @@ public function delete() JFactory::getApplication()->enqueueMessage(JText::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_DELETED'), 'message'); } } + $this->setRedirect('index.php?option=com_cache'); } @@ -110,15 +111,21 @@ public function deleteAll() $app = JFactory::getApplication(); $model = $this->getModel('cache'); - $data = $model->getCache()->getAll(); $allCleared = true; + $clients = array(1, 0); - foreach ($data as $cache) + foreach ($clients as $client) { - if ((int) $model->clean($cache->group) !== 1) + $mCache = $model->getCache($client); + $clientStr = JText::_($client ? 'JADMINISTRATOR' : 'JSITE') .' > '; + + foreach ($mCache->getAll() as $cache) { - $app->enqueueMessage(JText::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', $cache->group), 'error'); - $allCleared = false; + if ((int) $mCache->clean($cache->group) !== 1) + { + $app->enqueueMessage(JText::sprintf('COM_CACHE_EXPIRED_ITEMS_DELETE_ERROR', $clientStr . $cache->group), 'error'); + $allCleared = false; + } } } @@ -152,6 +159,7 @@ public function purge() { JFactory::getApplication()->enqueueMessage(JText::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED'), 'message'); } + $this->setRedirect('index.php?option=com_cache&view=purge'); } } diff --git a/administrator/components/com_cache/models/cache.php b/administrator/components/com_cache/models/cache.php index 1b592e4a1935c..fd8b6b2e76ef7 100644 --- a/administrator/components/com_cache/models/cache.php +++ b/administrator/components/com_cache/models/cache.php @@ -165,15 +165,20 @@ public function getData() * * @return object */ - public function getCache() + public function getCache($client_id = null) { $conf = JFactory::getConfig(); + if (is_null($client_id)) + { + $client_id = $this->getState('client_id'); + } + $options = array( 'defaultgroup' => '', 'storage' => $conf->get('cache_handler', ''), 'caching' => true, - 'cachebase' => ($this->getState('client_id') === 1) ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache') + 'cachebase' => (int) $client_id === 1 ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache') ); $cache = JCache::getInstance('', $options); @@ -196,7 +201,7 @@ public function getClient() /** * Get the number of current Cache Groups. * - * @return int + * @return integer */ public function getTotal() { diff --git a/administrator/components/com_categories/categories.php b/administrator/components/com_categories/categories.php index 91219048d14de..b06ab6761a19b 100644 --- a/administrator/components/com_categories/categories.php +++ b/administrator/components/com_categories/categories.php @@ -18,7 +18,7 @@ if (!JFactory::getUser()->authorise('core.manage', $component)) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } JLoader::register('JHtmlCategoriesAdministrator', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/html/categoriesadministrator.php'); diff --git a/administrator/components/com_categories/controller.php b/administrator/components/com_categories/controller.php index ae7e2ce010b59..93468f2cd0293 100644 --- a/administrator/components/com_categories/controller.php +++ b/administrator/components/com_categories/controller.php @@ -89,7 +89,7 @@ public function display($cachable = false, $urlparams = array()) $view->document = $document; // Load the submenu. - require_once JPATH_COMPONENT . '/helpers/categories.php'; + JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); CategoriesHelper::addSubmenu($model->getState('filter.extension')); $view->display(); diff --git a/administrator/components/com_categories/controllers/category.php b/administrator/components/com_categories/controllers/category.php index c8d6c0d21a273..3837e1d867743 100644 --- a/administrator/components/com_categories/controllers/category.php +++ b/administrator/components/com_categories/controllers/category.php @@ -76,38 +76,25 @@ protected function allowEdit($data = array(), $key = 'parent_id') $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = JFactory::getUser(); - // Check general edit permission first. - if ($user->authorise('core.edit', $this->extension)) - { - return true; - } - - // Check specific edit permission. + // Check "edit" permission on record asset (explicit or inherited) if ($user->authorise('core.edit', $this->extension . '.category.' . $recordId)) { return true; } - // Fallback on edit.own. - // First test if the permission is available. - if ($user->authorise('core.edit.own', $this->extension . '.category.' . $recordId) || $user->authorise('core.edit.own', $this->extension)) + // Check "edit own" permission on record asset (explicit or inherited) + if ($user->authorise('core.edit.own', $this->extension . '.category.' . $recordId)) { - // Now test the owner is the user. - $ownerId = (int) isset($data['created_user_id']) ? $data['created_user_id'] : 0; + // Need to do a lookup from the model to get the owner + $record = $this->getModel()->getItem($recordId); - if (empty($ownerId) && $recordId) + if (empty($record)) { - // Need to do a lookup from the model. - $record = $this->getModel()->getItem($recordId); - - if (empty($record)) - { - return false; - } - - $ownerId = $record->created_user_id; + return false; } + $ownerId = $record->created_user_id; + // If the owner matches 'me' then do the test. if ($ownerId == $user->id) { @@ -190,15 +177,13 @@ protected function postSaveHook(JModelLegacy $model, $validData = array()) if (isset($item->params) && is_array($item->params)) { - $registry = new Registry; - $registry->loadArray($item->params); + $registry = new Registry($item->params); $item->params = (string) $registry; } if (isset($item->metadata) && is_array($item->metadata)) { - $registry = new Registry; - $registry->loadArray($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = (string) $registry; } } diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php index e4589f6704bbd..bb6b41a6d397c 100644 --- a/administrator/components/com_categories/helpers/categories.php +++ b/administrator/components/com_categories/helpers/categories.php @@ -47,11 +47,11 @@ public static function addSubmenu($extension) if (file_exists($file)) { - require_once $file; - $prefix = ucfirst(str_replace('com_', '', $component)); $cName = $prefix . 'Helper'; + JLoader::register($cName, $file); + if (class_exists($cName)) { if (is_callable(array($cName, 'addSubmenu'))) @@ -148,7 +148,7 @@ public static function createCategory($data) JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/models'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables'); - $categoryModel = JModelLegacy::getInstance('Category', 'CategoriesModel'); + $categoryModel = JModelLegacy::getInstance('Category', 'CategoriesModel', array('ignore_request' => true)); $categoryModel->save($data); $catid = $categoryModel->getState('category.id'); diff --git a/administrator/components/com_categories/helpers/html/categoriesadministrator.php b/administrator/components/com_categories/helpers/html/categoriesadministrator.php index 07aa6cd3d3f4a..9fdaef29d06de 100644 --- a/administrator/components/com_categories/helpers/html/categoriesadministrator.php +++ b/administrator/components/com_categories/helpers/html/categoriesadministrator.php @@ -46,6 +46,7 @@ public static function association($catid, $extension = 'com_content') $query = $db->getQuery(true) ->select('c.id, c.title') ->select('l.sef as lang_sef') + ->select('l.lang_code') ->from('#__categories as c') ->where('c.id IN (' . implode(',', array_values($associations)) . ')') ->join('LEFT', '#__languages as l ON c.language=l.lang_code') @@ -66,32 +67,18 @@ public static function association($catid, $extension = 'com_content') { foreach ($items as &$item) { - $text = strtoupper($item->lang_sef); - $url = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension); - $tooltipParts = array( - JHtml::_( - 'image', - 'mod_languages/' . $item->image . '.gif', - $item->language_title, - array('title' => $item->language_title), - true - ), - $item->title - ); + $text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX'; + $url = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension); + $classes = 'hasPopover label label-association label-' . $item->lang_sef; - $item->link = JHtml::_( - 'tooltip', - implode(' ', $tooltipParts), - null, - null, - $text, - $url, - null, - 'hasTooltip label label-association label-' . $item->lang_sef - ); + $item->link = '' + . $text . ''; } } + JHtml::_('bootstrap.popover'); + $html = JLayoutHelper::render('joomla.content.associations', $items); } diff --git a/administrator/components/com_categories/models/categories.php b/administrator/components/com_categories/models/categories.php index ec1246bd62d79..8a40d397e9c35 100644 --- a/administrator/components/com_categories/models/categories.php +++ b/administrator/components/com_categories/models/categories.php @@ -274,27 +274,27 @@ protected function getListQuery() } // Group by on Categories for JOIN with component tables to count items - $query->group('a.id, - a.title, - a.alias, - a.note, - a.published, - a.access, - a.checked_out, - a.checked_out_time, - a.created_user_id, - a.path, - a.parent_id, - a.level, - a.lft, - a.rgt, - a.language, + $query->group('a.id, + a.title, + a.alias, + a.note, + a.published, + a.access, + a.checked_out, + a.checked_out_time, + a.created_user_id, + a.path, + a.parent_id, + a.level, + a.lft, + a.rgt, + a.language, l.title, l.image, - uc.name, - ag.title, + uc.name, + ag.title, ua.name' - ); + ); return $query; } @@ -360,7 +360,7 @@ public function getItems() /** * Method to load the countItems method from the extensions - * + * * @param stdClass[] &$items The category items * @param string $extension The category extension * @@ -370,13 +370,19 @@ public function getItems() */ public function countItems(&$items, $extension) { - $parts = explode('.', $extension); + $parts = explode('.', $extension, 2); $component = $parts[0]; $section = null; if (count($parts) > 1) { $section = $parts[1]; + + // If the section ends with .fields, then the category belongs to com_fields + if (substr($section, -strlen('.fields')) === '.fields') + { + $component = 'com_fields'; + } } // Try to find the component helper. @@ -385,14 +391,14 @@ public function countItems(&$items, $extension) if (file_exists($file)) { - require_once $file; - - $prefix = ucfirst(str_replace('com_', '', $component)); + $prefix = ucfirst($eName); $cName = $prefix . 'Helper'; + JLoader::register($cName, $file); + if (class_exists($cName) && is_callable(array($cName, 'countItems'))) { - call_user_func(array($cName, 'countItems'), $items, $section); + $cName::countItems($items, $section); } } } diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 44d3d4c4df45b..bcfa757415394 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -69,15 +70,12 @@ public function __construct($config = array()) */ protected function canDelete($record) { - if (!empty($record->id)) + if (empty($record->id) || $record->published != -2) { - if ($record->published != -2) - { - return; - } - - return JFactory::getUser()->authorise('core.delete', $record->extension . '.category.' . (int) $record->id); + return false; } + + return JFactory::getUser()->authorise('core.delete', $record->extension . '.category.' . (int) $record->id); } /** @@ -181,8 +179,7 @@ public function getItem($pk = null) } // Convert the metadata field to an array. - $registry = new Registry; - $registry->loadString($result->metadata); + $registry = new Registry($result->metadata); $result->metadata = $registry->toArray(); // Convert the created and modified dates to local user time for display in the form. @@ -338,7 +335,10 @@ protected function loadFormData() ) ); $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); + $data->set( + 'access', + $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))) + ); } } @@ -398,9 +398,10 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') if (file_exists($path)) { - require_once $path; $cName = ucfirst($eName) . ucfirst($section) . 'HelperCategory'; + JLoader::register($cName, $path); + if (class_exists($cName) && is_callable(array($cName, 'onPrepareForm'))) { $lang->load($component, JPATH_BASE, null, false, false) @@ -424,38 +425,34 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $form->setFieldAttribute('rules', 'section', $name); // Association category items - $assoc = $this->getAssoc(); - - if ($assoc) + if ($this->getAssoc()) { - $languages = JLanguageHelper::getLanguages('lang_code'); - $addform = new SimpleXMLElement('
'); - $fields = $addform->addChild('fields'); - $fields->addAttribute('name', 'associations'); - $fieldset = $fields->addChild('fieldset'); - $fieldset->addAttribute('name', 'item_associations'); - $fieldset->addAttribute('description', 'COM_CATEGORIES_ITEM_ASSOCIATIONS_FIELDSET_DESC'); - $add = false; - - foreach ($languages as $tag => $language) + $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); + + if (count($languages) > 1) { - if (empty($data->language) || $tag != $data->language) + $addform = new SimpleXMLElement(''); + $fields = $addform->addChild('fields'); + $fields->addAttribute('name', 'associations'); + $fieldset = $fields->addChild('fieldset'); + $fieldset->addAttribute('name', 'item_associations'); + $fieldset->addAttribute('description', 'COM_CATEGORIES_ITEM_ASSOCIATIONS_FIELDSET_DESC'); + + foreach ($languages as $language) { - $add = true; $field = $fieldset->addChild('field'); - $field->addAttribute('name', $tag); + $field->addAttribute('name', $language->lang_code); $field->addAttribute('type', 'modal_category'); - $field->addAttribute('language', $tag); + $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); $field->addAttribute('extension', $extension); + $field->addAttribute('select', 'true'); + $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); } - } - if ($add) - { $form->load($addform, false); } } @@ -572,7 +569,7 @@ public function save($data) if ($assoc) { // Adding self to the association - $associations = $data['associations']; + $associations = isset($data['associations']) ? $data['associations'] : array(); // Unset any invalid associations $associations = Joomla\Utilities\ArrayHelper::toInteger($associations); @@ -593,14 +590,31 @@ public function save($data) JError::raiseNotice(403, JText::_('COM_CATEGORIES_ERROR_ALL_LANGUAGE_ASSOCIATED')); } - $associations[$table->language] = $table->id; - - // Deleting old association for these items - $db = $this->getDbo(); + // Get associationskey for edited item + $db = $this->getDbo(); $query = $db->getQuery(true) - ->delete('#__associations') + ->select($db->quoteName('key')) + ->from($db->quoteName('#__associations')) ->where($db->quoteName('context') . ' = ' . $db->quote($this->associationsContext)) - ->where($db->quoteName('id') . ' IN (' . implode(',', $associations) . ')'); + ->where($db->quoteName('id') . ' = ' . (int) $table->id); + $db->setQuery($query); + $old_key = $db->loadResult(); + + // Deleting old associations for the associated items + $query = $db->getQuery(true) + ->delete($db->quoteName('#__associations')) + ->where($db->quoteName('context') . ' = ' . $db->quote($this->associationsContext)); + + if ($associations) + { + $query->where('(' . $db->quoteName('id') . ' IN (' . implode(',', $associations) . ') OR ' + . $db->quoteName('key') . ' = ' . $db->quote($old_key) . ')'); + } + else + { + $query->where($db->quoteName('key') . ' = ' . $db->quote($old_key)); + } + $db->setQuery($query); try @@ -614,7 +628,13 @@ public function save($data) return false; } - if (!$all_language && count($associations)) + // Adding self to the association + if (!$all_language) + { + $associations[$table->language] = (int) $table->id; + } + + if (count($associations) > 1) { // Adding new association for these items $key = md5(json_encode($associations)); @@ -1213,8 +1233,8 @@ protected function generateNewTitle($parent_id, $alias, $title) while ($table->load(array('alias' => $alias, 'parent_id' => $parent_id))) { - $title = JString::increment($title); - $alias = JString::increment($alias, 'dash'); + $title = StringHelper::increment($title); + $alias = StringHelper::increment($alias, 'dash'); } return array($title, $alias); diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php index ad352f6d0083e..8adbe0508ea3b 100644 --- a/administrator/components/com_categories/models/fields/categoryedit.php +++ b/administrator/components/com_categories/models/fields/categoryedit.php @@ -11,19 +11,17 @@ use Joomla\Utilities\ArrayHelper; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldCategoryEdit extends JFormFieldList +class JFormFieldCategoryEdit extends JFormAbstractlist { /** * To allow creation of new categories. * - * @var int + * @var integer * @since 3.6 */ protected $allowAdd; @@ -161,7 +159,15 @@ protected function getOptions() // Filter language if (!empty($this->element['language'])) { - $subQuery->where('language = ' . $db->quote($this->element['language'])); + if (strpos($this->element['language'], ',') !== false) + { + $language = implode(',', $db->quote(explode(',', $this->element['language']))); + } + else + { + $language = $db->quote($this->element['language']); + } + $subQuery->where($db->quoteName('language') . ' IN (' . $language . ')'); } // Filter on the published state @@ -251,8 +257,8 @@ protected function getOptions() { foreach ($options as $i => $option) { - /* To take save or create in a category you need to have create rights for that category - * unless the item is already in that category. + /* + * To take save or create in a category you need to have create rights for that category unless the item is already in that category. * Unset the option if the user isn't authorised for it. In this field assets are always categories. */ if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true && $option->level != 0) @@ -264,7 +270,8 @@ protected function getOptions() // If you have an existing category id things are more complex. else { - /* If you are only allowed to edit in this category but not edit.state, you should not get any + /* + * If you are only allowed to edit in this category but not edit.state, you should not get any * option to change the category parent for a category or the category for a content item, * but you should be able to save in that category. */ @@ -285,8 +292,10 @@ protected function getOptions() unset($options[$i]); } - // However, if you can edit.state you can also move this to another category for which you have - // create permission and you should also still be able to save in the current category. + /* + * However, if you can edit.state you can also move this to another category for which you have + * create permission and you should also still be able to save in the current category. + */ if (($user->authorise('core.create', $extension . '.category.' . $option->value) != true) && ($option->value != $oldCat && !isset($oldParent))) { @@ -362,7 +371,10 @@ protected function getInput() $attr .= $this->autofocus ? ' autofocus' : ''; // To avoid user's confusion, readonly="true" should imply disabled="true". - if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true') + if ((string) $this->readonly == '1' + || (string) $this->readonly == 'true' + || (string) $this->disabled == '1' + || (string) $this->disabled == 'true') { $attr .= ' disabled="disabled"'; } diff --git a/administrator/components/com_categories/models/fields/categoryparent.php b/administrator/components/com_categories/models/fields/categoryparent.php index 438a663a931a5..67e36f0704bba 100644 --- a/administrator/components/com_categories/models/fields/categoryparent.php +++ b/administrator/components/com_categories/models/fields/categoryparent.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldCategoryParent extends JFormFieldList +class JFormFieldCategoryParent extends JFormAbstractlist { /** * The form field type. @@ -133,8 +131,8 @@ protected function getOptions() { foreach ($options as $i => $option) { - /* To take save or create in a category you need to have create rights for that category - * unless the item is already in that category. + /* + * To take save or create in a category you need to have create rights for that category unless the item is already in that category. * Unset the option if the user isn't authorised for it. In this field assets are always categories. */ if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true) @@ -148,7 +146,8 @@ protected function getOptions() { foreach ($options as $i => $option) { - /* If you are only allowed to edit in this category but not edit.state, you should not get any + /* + * If you are only allowed to edit in this category but not edit.state, you should not get any * option to change the category parent for a category or the category for a content item, * but you should be able to save in that category. */ @@ -160,8 +159,10 @@ protected function getOptions() unset($options[$i]); } } - // However, if you can edit.state you can also move this to another category for which you have - // create permission and you should also still be able to save in the current category. + /* + * However, if you can edit.state you can also move this to another category for which you have + * create permission and you should also still be able to save in the current category. + */ elseif (($user->authorise('core.create', $extension . '.category.' . $option->value) != true) && $option->value != $oldCat ) diff --git a/administrator/components/com_categories/models/fields/modal/category.php b/administrator/components/com_categories/models/fields/modal/category.php index c941a8c5cbda5..fa5b311d3a779 100644 --- a/administrator/components/com_categories/models/fields/modal/category.php +++ b/administrator/components/com_categories/models/fields/modal/category.php @@ -42,86 +42,63 @@ protected function getInput() $extension = (string) JFactory::getApplication()->input->get('extension', 'com_content'); } - $allowEdit = ((string) $this->element['edit'] == 'true') ? true : false; - $allowClear = ((string) $this->element['clear'] != 'false') ? true : false; + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); - // Load language + // Load language. JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR); // The active category id field. $value = (int) $this->value > 0 ? (int) $this->value : ''; - // Build the script. - $script = array(); + // Create the modal id. + $modalId = 'Category_' . $this->id; - // Select button script - $script[] = ' function jSelectCategory_' . $this->id . '(id, title, object) {'; - $script[] = ' document.getElementById("' . $this->id . '_id").value = id;'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = title;'; + // Add the modal field script to the document head. + JHtml::_('jquery.framework'); + JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true)); - if ($allowEdit) - { - $script[] = ' if (id == "' . (int) $this->value . '") {'; - $script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");'; - $script[] = ' } else {'; - $script[] = ' jQuery("#' . $this->id . '_edit").addClass("hidden");'; - $script[] = ' }'; - } - - if ($allowClear) + // Script to proxy the select modal function to the modal-fields.js file. + if ($allowSelect) { - $script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");'; - } + static $scriptSelect = null; - $script[] = ' jQuery("#categorySelect' . $this->id . 'Modal").modal("hide");'; - $script[] = ' }'; - - // Edit button script - $script[] = ' function jEditCategory_' . $value . '(title) {'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = title;'; - $script[] = ' }'; + if (is_null($scriptSelect)) + { + $scriptSelect = array(); + } - // Clear button script - static $scriptClear; + if (!isset($scriptSelect[$this->id])) + { + JFactory::getDocument()->addScriptDeclaration(" + function jSelectCategory_" . $this->id . "(id, title, object) { + window.processModalSelect('Category', '" . $this->id . "', id, title, '', object); + } + "); - if ($allowClear && !$scriptClear) - { - $scriptClear = true; - - $script[] = ' function jClearCategory(id) {'; - $script[] = ' document.getElementById(id + "_id").value = "";'; - $script[] = ' document.getElementById(id + "_name").value = "' - . htmlspecialchars(JText::_('COM_CATEGORIES_SELECT_A_CATEGORY', true), ENT_COMPAT, 'UTF-8') . '";'; - $script[] = ' jQuery("#"+id + "_clear").addClass("hidden");'; - $script[] = ' if (document.getElementById(id + "_edit")) {'; - $script[] = ' jQuery("#"+id + "_edit").addClass("hidden");'; - $script[] = ' }'; - $script[] = ' return false;'; - $script[] = ' }'; + $scriptSelect[$this->id] = true; + } } - // Add the script to the document head. - JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); - // Setup variables for display. - $html = array(); - - $linkCategories = 'index.php?option=com_categories&view=categories&layout=modal&tmpl=component' - . '&extension=' . $extension - . '&function=jSelectCategory_' . $this->id; - - $linkCategory = 'index.php?option=com_categories&view=category&layout=modal&tmpl=component' - . '&task=category.edit' - . '&function=jEditCategory_' . $value; + $linkCategories = 'index.php?option=com_categories&view=categories&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1' + . '&extension=' . $extension; + $linkCategory = 'index.php?option=com_categories&view=category&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1' + . '&extension=' . $extension; + $modalTitle = JText::_('COM_CATEGORIES_CHANGE_CATEGORY'); if (isset($this->element['language'])) { $linkCategories .= '&forcedLanguage=' . $this->element['language']; $linkCategory .= '&forcedLanguage=' . $this->element['language']; + $modalTitle .= ' — ' . $this->element['label']; } - $urlSelect = $linkCategories . '&' . JSession::getFormToken() . '=1'; - $urlEdit = $linkCategory . '&id=' . $value . '&' . JSession::getFormToken() . '=1'; + $urlSelect = $linkCategories . '&function=jSelectCategory_' . $this->id; + $urlEdit = $linkCategory . '&task=category.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \''; + $urlNew = $linkCategory . '&task=category.add'; if ($value) { @@ -142,100 +119,162 @@ protected function getInput() } } - if (empty($title)) + $title = empty($title) ? JText::_('COM_CATEGORIES_SELECT_A_CATEGORY') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); + + // The current category display field. + $html = ''; + $html .= ''; + + // Select category button. + if ($allowSelect) { - $title = JText::_('COM_CATEGORIES_SELECT_A_CATEGORY'); + $html .= '' + . ' ' . JText::_('JSELECT') + . ''; } - $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); + // New category button. + if ($allowNew) + { + $html .= '' + . ' ' . JText::_('JACTION_CREATE') + . ''; + } - // The current category display field. - $html[] = ''; - $html[] = ''; - - // Select category button - $html[] = '' - . ' ' . JText::_('JSELECT') - . ''; - - // Edit category button + // Edit category button. if ($allowEdit) { - $html[] = '' . ' ' . JText::_('JACTION_EDIT') . ''; } - // Clear category button + // Clear category button. if ($allowClear) { - $html[] = '' + . ' href="#"' + . ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">' . '' . JText::_('JCLEAR') - . ''; + . ''; + } + + $html .= ''; + + // Select category modal. + if ($allowSelect) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalSelect' . $modalId, + array( + 'title' => $modalTitle, + 'url' => $urlSelect, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '', + ) + ); + } + + // New category modal. + if ($allowNew) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalNew' . $modalId, + array( + 'title' => JText::_('COM_CATEGORIES_NEW_CATEGORY'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlNew, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); } - $html[] = ''; - - // Select category modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'categorySelect' . $this->id . 'Modal', - array( - 'url' => $urlSelect, - 'title' => JText::_('COM_CATEGORIES_SELECT_A_CATEGORY'), - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - ) - ); - - // Edit category modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'categoryEdit' . $value . 'Modal', - array( - 'url' => $urlEdit, - 'title' => JText::_('COM_CATEGORIES_EDIT_CATEGORY'), - 'backdrop' => 'static', - 'closeButton' => false, - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - . '' - . '' - ) - ); + // Edit category modal. + if ($allowEdit) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalEdit' . $modalId, + array( + 'title' => JText::_('COM_CATEGORIES_EDIT_CATEGORY'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlEdit, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } // Note: class='required' for client side validation $class = $this->required ? ' class="required modal-value"' : ''; - $html[] = ''; + $html .= ''; + + return $html; + } - return implode("\n", $html); + /** + * Method to get the field label markup. + * + * @return string The field label markup. + * + * @since __DEPLOY_VERSION__ + */ + protected function getLabel() + { + return str_replace($this->id, $this->id . '_id', parent::getLabel()); } } diff --git a/administrator/components/com_categories/tables/category.php b/administrator/components/com_categories/tables/category.php index 238c565bc4893..fdb16cd066d40 100644 --- a/administrator/components/com_categories/tables/category.php +++ b/administrator/components/com_categories/tables/category.php @@ -24,7 +24,6 @@ class CategoriesTableCategory extends JTableCategory * * @return boolean True on success. * - * @see https://docs.joomla.org/JTableNested/delete * @since 2.5 */ public function delete($pk = null, $children = false) diff --git a/administrator/components/com_categories/views/categories/tmpl/default.php b/administrator/components/com_categories/views/categories/tmpl/default.php index 4a4d02636c761..da9fec00f58da 100644 --- a/administrator/components/com_categories/views/categories/tmpl/default.php +++ b/administrator/components/com_categories/views/categories/tmpl/default.php @@ -25,7 +25,7 @@ $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc'); -$parts = explode('.', $extension); +$parts = explode('.', $extension, 2); $component = $parts[0]; $section = null; $columns = 7; @@ -40,6 +40,13 @@ { $section = $inflector->toPlural($section); } + + // If the section ends with .fields, then the category belongs to com_fields + if (substr($section, -strlen('.fields')) === '.fields') + { + $component = 'com_fields'; + $section = 'fields&context=' . str_replace('.fields', '', implode('.', $parts)); + } } if ($saveOrder) @@ -254,11 +261,7 @@ - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + diff --git a/administrator/components/com_categories/views/categories/tmpl/default_batch.php b/administrator/components/com_categories/views/categories/tmpl/default_batch.php deleted file mode 100644 index c2266fe9795c9..0000000000000 --- a/administrator/components/com_categories/views/categories/tmpl/default_batch.php +++ /dev/null @@ -1,74 +0,0 @@ -state->get('filter.published'); -$extension = $this->escape($this->state->get('filter.extension')); -?> - diff --git a/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php b/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php index 5f4d1005de53f..03e25cd5ea3dd 100644 --- a/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php +++ b/administrator/components/com_categories/views/categories/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_categories/views/categories/tmpl/modal.php b/administrator/components/com_categories/views/categories/tmpl/modal.php index b10924e8ae63c..468102d2aaf8a 100644 --- a/administrator/components/com_categories/views/categories/tmpl/modal.php +++ b/administrator/components/com_categories/views/categories/tmpl/modal.php @@ -16,7 +16,7 @@ JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } -require_once JPATH_ROOT . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_ROOT . '/components/com_content/helpers/route.php'); // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -119,11 +119,7 @@ escape($item->access_level); ?> - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_categories/views/categories/view.html.php b/administrator/components/com_categories/views/categories/view.html.php index 98539bb2750ae..68b39862d55d3 100644 --- a/administrator/components/com_categories/views/categories/view.html.php +++ b/administrator/components/com_categories/views/categories/view.html.php @@ -163,7 +163,7 @@ protected function addToolbar() || $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, true); // Load the category helper. - require_once JPATH_COMPONENT . '/helpers/categories.php'; + JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); // If a component categories title string is present, let's use it. if ($lang->hasKey($component_title_key = strtoupper($component . ($section ? "_$section" : '')) . '_CATEGORIES_TITLE')) @@ -182,7 +182,7 @@ protected function addToolbar() } // Load specific css component - JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true); + JHtml::_('stylesheet', $component . '/administrator/categories.css', array('version' => 'auto', 'relative' => true)); // Prepare the toolbar. JToolbarHelper::title($title, 'folder categories ' . substr($component, 4) . ($section ? "-$section" : '') . '-categories'); diff --git a/administrator/components/com_categories/views/category/tmpl/edit.php b/administrator/components/com_categories/views/category/tmpl/edit.php index 71086a67b1b98..10eeb20451bc1 100644 --- a/administrator/components/com_categories/views/category/tmpl/edit.php +++ b/administrator/components/com_categories/views/category/tmpl/edit.php @@ -32,6 +32,7 @@ ' . $this->form->getField("description")->save() . ' Joomla.submitform(task, document.getElementById("item-form")); + // @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__. if (task !== "category.apply") { window.parent.jQuery("#categoryEdit' . $this->item->id . 'Modal").modal("hide"); @@ -45,8 +46,8 @@ // In case of modal $isModal = $input->get('layout') == 'modal' ? true : false; -$layout = $isModal ? 'modal' : 'edit'; -$tmpl = $isModal ? '&tmpl=component' : ''; +$layout = $isModal ? 'modal' : 'edit'; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; ?> @@ -68,6 +69,8 @@
+ +
@@ -93,12 +96,11 @@ - - form->getInput('extension'); ?> +
diff --git a/administrator/components/com_categories/views/category/tmpl/modal.php b/administrator/components/com_categories/views/category/tmpl/modal.php index 28203343ec637..54256456f031c 100644 --- a/administrator/components/com_categories/views/category/tmpl/modal.php +++ b/administrator/components/com_categories/views/category/tmpl/modal.php @@ -11,6 +11,7 @@ JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); +// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__. $function = JFactory::getApplication()->input->getCmd('function', 'jEditCategory_' . (int) $this->item->id); // Function to update input title when changed diff --git a/administrator/components/com_categories/views/category/view.html.php b/administrator/components/com_categories/views/category/view.html.php index 37fe2c8fb2910..b96585e0aebc8 100644 --- a/administrator/components/com_categories/views/category/view.html.php +++ b/administrator/components/com_categories/views/category/view.html.php @@ -80,10 +80,18 @@ public function display($tpl = null) JFactory::getApplication()->input->set('hidemainmenu', true); - if ($this->getLayout() == 'modal') + // If we are forcing a language in modal (used for associations). + if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) { + // Set the language field to the forcedLanguage and disable changing it. + $this->form->setValue('language', null, $forcedLanguage); $this->form->setFieldAttribute('language', 'readonly', 'true'); - $this->form->setFieldAttribute('parent_id', 'readonly', 'true'); + + // Only allow to select categories with All language or with the forced language. + $this->form->setFieldAttribute('parent_id', 'language', '*,' . $forcedLanguage); + + // Only allow to select tags with All language or with the forced language. + $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } $this->addToolbar(); @@ -129,7 +137,7 @@ protected function addToolbar() || $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, true); // Load the category helper. - require_once JPATH_COMPONENT . '/helpers/categories.php'; + JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); // Get the results for each action. $canDo = $this->canDo; @@ -142,7 +150,9 @@ protected function addToolbar() // Else if the component section string exits, let's use it elseif ($lang->hasKey($component_section_key = $component . ($section ? "_$section" : ''))) { - $title = JText::sprintf('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE', $this->escape(JText::_($component_section_key))); + $title = JText::sprintf('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') + . '_TITLE', $this->escape(JText::_($component_section_key)) + ); } // Else use the base title else @@ -151,7 +161,7 @@ protected function addToolbar() } // Load specific css component - JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true); + JHtml::_('stylesheet', $component . '/administrator/categories.css', array('version' => 'auto', 'relative' => true)); // Prepare the toolbar. JToolbarHelper::title( @@ -166,33 +176,34 @@ protected function addToolbar() JToolbarHelper::apply('category.apply'); JToolbarHelper::save('category.save'); JToolbarHelper::save2new('category.save2new'); + JToolbarHelper::cancel('category.cancel'); } // If not checked out, can save the item. - elseif (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId))) + else { - JToolbarHelper::apply('category.apply'); - JToolbarHelper::save('category.save'); + // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. + $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId); - if ($canDo->get('core.create')) + // Can't save the record if it's checked out and editable + if (!$checkedOut && $itemEditable) { - JToolbarHelper::save2new('category.save2new'); + JToolbarHelper::apply('category.apply'); + JToolbarHelper::save('category.save'); + + if ($canDo->get('core.create')) + { + JToolbarHelper::save2new('category.save2new'); + } } - } - // If an existing item, can save to a copy. - if (!$isNew && $canDo->get('core.create')) - { - JToolbarHelper::save2copy('category.save2copy'); - } + // If an existing item, can save to a copy. + if ($canDo->get('core.create')) + { + JToolbarHelper::save2copy('category.save2copy'); + } - if (empty($this->item->id)) - { - JToolbarHelper::cancel('category.cancel'); - } - else - { - if ($componentParams->get('save_history', 0) && $user->authorise('core.edit')) + if ($componentParams->get('save_history', 0) && $itemEditable) { $typeAlias = $extension . '.category'; JToolbarHelper::versions($typeAlias, $this->item->id); @@ -203,13 +214,19 @@ protected function addToolbar() JToolbarHelper::divider(); - // Compute the ref_key if it does exist in the component - if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_$section" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_HELP_KEY')) + // Compute the ref_key + $ref_key = strtoupper($component . ($section ? "_$section" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_HELP_KEY'; + + // Check if thr computed ref_key does exist in the component + if (!$lang->hasKey($ref_key)) { - $ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_$section" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT'); + $ref_key = 'JHELP_COMPONENTS_' + . strtoupper(substr($component, 4) . ($section ? "_$section" : '')) + . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT'); } - /* Get help for the category/section view for the component by + /* + * Get help for the category/section view for the component by * -remotely searching in a language defined dedicated URL: *component*_HELP_URL * -locally searching in a component help file if helpURL param exists in the component and is set to '' * -remotely searching in a component URL if helpURL param exists in the component and is NOT set to '' diff --git a/administrator/components/com_checkin/checkin.php b/administrator/components/com_checkin/checkin.php index 911bb2603dc5d..9f7d1f7417495 100644 --- a/administrator/components/com_checkin/checkin.php +++ b/administrator/components/com_checkin/checkin.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_checkin')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Checkin'); diff --git a/administrator/components/com_checkin/checkin.xml b/administrator/components/com_checkin/checkin.xml index ac1b240d73955..c45959fbbd4d0 100644 --- a/administrator/components/com_checkin/checkin.xml +++ b/administrator/components/com_checkin/checkin.xml @@ -2,6 +2,7 @@ com_checkin Joomla! Project + April 2006 (C) 2005 - 2016 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org diff --git a/administrator/components/com_checkin/models/checkin.php b/administrator/components/com_checkin/models/checkin.php index 323bdb90e2e33..0237590168d3e 100644 --- a/administrator/components/com_checkin/models/checkin.php +++ b/administrator/components/com_checkin/models/checkin.php @@ -64,12 +64,12 @@ public function __construct($config = array()) * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'table', $direction = 'asc') { $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search')); // List state information. - parent::populateState('table', 'asc'); + parent::populateState($ordering, $direction); } /** @@ -238,6 +238,7 @@ public function getItems() // Pagination $limit = (int) $this->getState('list.limit'); + if ($limit !== 0) { $this->items = array_slice($results, $this->getState('list.start'), $limit); diff --git a/administrator/components/com_config/controller/application/sendtestmail.php b/administrator/components/com_config/controller/application/sendtestmail.php index fd70e3ca4b859..56070cc987955 100644 --- a/administrator/components/com_config/controller/application/sendtestmail.php +++ b/administrator/components/com_config/controller/application/sendtestmail.php @@ -24,22 +24,27 @@ class ConfigControllerApplicationSendtestmail extends JControllerBase */ public function execute() { + // Send json mime type. + $this->app->mimeType = 'application/json'; + $this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet); + $this->app->sendHeaders(); + + // Check if user token is valid. if (!JSession::checkToken('get')) { - $this->app->enqueueMessage(JText::_('JINVALID_TOKEN')); - $this->app->redirect('index.php'); + $this->app->enqueueMessage(JText::_('JINVALID_TOKEN'), 'error'); + echo new JResponseJson; + $this->app->close(); } + // Check if the user is authorized to do this. if (!JFactory::getUser()->authorise('core.admin')) { - $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR')); - $this->app->redirect('index.php'); + $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + echo new JResponseJson; + $this->app->close(); } - $this->app->mimeType = 'application/json'; - $this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet); - $this->app->sendHeaders(); - $model = new ConfigModelApplication; echo new JResponseJson($model->sendTestMail()); $this->app->close(); diff --git a/administrator/components/com_config/controller/application/store.php b/administrator/components/com_config/controller/application/store.php index c6b9fbfe3dea9..42b653695c6a8 100644 --- a/administrator/components/com_config/controller/application/store.php +++ b/administrator/components/com_config/controller/application/store.php @@ -24,33 +24,21 @@ class ConfigControllerApplicationStore extends JControllerBase */ public function execute() { - // Check if the user is authorized to do this. - if (!JFactory::getUser()->authorise('core.admin')) - { - $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR')); - $this->app->redirect('index.php'); - } + // Send json mime type. + $this->app->mimeType = 'application/json'; + $this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet); + $this->app->sendHeaders(); - // Get Post DATA - $permissions = array( - 'component' => $this->input->get->get('comp'), - 'action' => $this->input->get->get('action'), - 'rule' => $this->input->get->get('rule'), - 'value' => $this->input->get->get('value'), - 'title' => $this->input->get->get('title', '', 'RAW') - ); - - if (!(substr($permissions['component'], -6) == '.false')) + // Check if user token is valid. + if (!JSession::checkToken('get')) { - // Load Permissions from Session and send to Model - $model = new ConfigModelApplication; - $response = $model->storePermissions($permissions); - - echo new JResponseJson(json_encode($response)); - } - else - { - echo new JResponseJson(json_encode(false), 0); + $this->app->enqueueMessage(JText::_('JINVALID_TOKEN'), 'error'); + echo new JResponseJson; + $this->app->close(); } + + $model = new ConfigModelApplication; + echo new JResponseJson($model->storePermissions()); + $this->app->close(); } } diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php index ba9d509739d88..4d39b71995bb2 100644 --- a/administrator/components/com_config/model/application.php +++ b/administrator/components/com_config/model/application.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; /** * Model for the global configuration @@ -56,20 +57,20 @@ public function getData() { // Get the config data. $config = new JConfig; - $data = JArrayHelper::fromObject($config); + $data = ArrayHelper::fromObject($config); // Prime the asset_id for the rules. $data['asset_id'] = 1; // Get the text filter data $params = JComponentHelper::getParams('com_config'); - $data['filters'] = JArrayHelper::fromObject($params->get('filters')); + $data['filters'] = ArrayHelper::fromObject($params->get('filters')); // If no filter data found, get from com_content (update of 1.6/1.7 site) if (empty($data['filters'])) { $contentParams = JComponentHelper::getParams('com_content'); - $data['filters'] = JArrayHelper::fromObject($contentParams->get('filters')); + $data['filters'] = ArrayHelper::fromObject($contentParams->get('filters')); } // Check for data in the session. @@ -127,11 +128,20 @@ public function save($data) $host = JUri::getInstance()->getHost(); $options = new \Joomla\Registry\Registry; $options->set('userAgent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'); - $options->set('transport.curl', array(CURLOPT_SSL_VERIFYPEER => false)); + + // Do not check for valid server certificate here, leave this to the user, moreover disable using a proxy if any is configured. + $options->set('transport.curl', + array( + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_PROXY => null, + CURLOPT_PROXYUSERPWD => null, + ) + ); $response = JHttpFactory::getHttp($options)->get('https://' . $host . JUri::root(true) . '/', array('Host' => $host), 10); // If available in HTTPS check also the status code. - if (!in_array($response->code, array(200, 503, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310), true)) + if (!in_array($response->code, array(200, 503, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 401), true)) { throw new RuntimeException('HTTPS version of the site returned an invalid HTTP status code.'); } @@ -192,8 +202,7 @@ public function save($data) // Save the text filters if (isset($data['filters'])) { - $registry = new Registry; - $registry->loadArray(array('filters' => $data['filters'])); + $registry = new Registry(array('filters' => $data['filters'])); $extension = JTable::getInstance('extension'); @@ -223,7 +232,7 @@ public function save($data) // Get the previous configuration. $prev = new JConfig; - $prev = JArrayHelper::fromObject($prev); + $prev = ArrayHelper::fromObject($prev); // Merge the new data in. We do this to preserve values that were not in the form. $data = array_merge($prev, $data); @@ -245,6 +254,26 @@ public function save($data) $table->purge(-1); } + // Set the shared session configuration + if (isset($data['shared_session'])) + { + $currentShared = isset($prev['shared_session']) ? $prev['shared_session'] : '0'; + + // Has the user enabled shared sessions? + if ($data['shared_session'] == 1 && $currentShared == 0) + { + // Generate a random shared session name + $data['session_name'] = JUserHelper::genRandomPassword(16); + } + + // Has the user disabled shared sessions? + if ($data['shared_session'] == 0 && $currentShared == 1) + { + // Remove the session name value + unset($data['session_name']); + } + } + if (empty($data['cache_handler'])) { $data['caching'] = 0; @@ -267,8 +296,7 @@ public function save($data) } // Create the new configuration object. - $config = new Registry('config'); - $config->loadArray($data); + $config = new Registry($data); // Overwrite the old FTP credentials with the new ones. $temp = JFactory::getConfig(); @@ -301,12 +329,11 @@ public function removeroot() { // Get the previous configuration. $prev = new JConfig; - $prev = JArrayHelper::fromObject($prev); + $prev = ArrayHelper::fromObject($prev); // Create the new configuration object, and unset the root_user property - $config = new Registry('config'); unset($prev['root_user']); - $config->loadArray($prev); + $config = new Registry($prev); // Write the configuration file. return $this->writeConfigFile($config); @@ -366,15 +393,95 @@ private function writeConfigFile(Registry $config) * * @param string $permission Need an array with Permissions (component, rule, value and title) * - * @return boolean True on success, false on failure. + * @return array A list of result data. * * @since 3.5 */ - public function storePermissions($permission) + public function storePermissions($permission = null) { + $app = JFactory::getApplication(); + $user = JFactory::getUser(); + + if (is_null($permission)) + { + // Get data from input. + $permission = array( + 'component' => $app->input->get('comp'), + 'action' => $app->input->get('action'), + 'rule' => $app->input->get('rule'), + 'value' => $app->input->get('value'), + 'title' => $app->input->get('title', '', 'RAW') + ); + } + + // We are creating a new item so we don't have an item id so don't allow. + if (substr($permission['component'], -6) === '.false') + { + $app->enqueueMessage(JText::_('JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS'), 'error'); + + return false; + } + + // Check if the user is authorized to do this. + if (!$user->authorise('core.admin', $permission['component'])) + { + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); + + return false; + } + + $permission['component'] = empty($permission['component']) ? 'root.1' : $permission['component']; + + // Current view is global config? + $isGlobalConfig = $permission['component'] === 'root.1'; + + // Check if changed group has Super User permissions. + $isSuperUserGroupBefore = JAccess::checkGroup($permission['rule'], 'core.admin'); + + // Check if current user belongs to changed group. + $currentUserBelongsToGroup = in_array((int) $permission['rule'], $user->groups) ? true : false; + + // Get current user groups tree. + $currentUserGroupsTree = JAccess::getGroupsByUser($user->id, true); + + // Check if current user belongs to changed group. + $currentUserSuperUser = $user->authorise('core.admin'); + + // If user is not Super User cannot change the permissions of a group it belongs to. + if (!$currentUserSuperUser && $currentUserBelongsToGroup) + { + $app->enqueueMessage(JText::_('JLIB_USER_ERROR_CANNOT_CHANGE_OWN_GROUPS'), 'error'); + + return false; + } + + // If user is not Super User cannot change the permissions of a group it belongs to. + if (!$currentUserSuperUser && in_array((int) $permission['rule'], $currentUserGroupsTree)) + { + $app->enqueueMessage(JText::_('JLIB_USER_ERROR_CANNOT_CHANGE_OWN_PARENT_GROUPS'), 'error'); + + return false; + } + + // If user is not Super User cannot change the permissions of a Super User Group. + if (!$currentUserSuperUser && $isSuperUserGroupBefore && !$currentUserBelongsToGroup) + { + $app->enqueueMessage(JText::_('JLIB_USER_ERROR_CANNOT_CHANGE_SUPER_USER'), 'error'); + + return false; + } + + // If user is not Super User cannot change the Super User permissions in any group it belongs to. + if ($isSuperUserGroupBefore && $currentUserBelongsToGroup && $permission['action'] === 'core.admin') + { + $app->enqueueMessage(JText::_('JLIB_USER_ERROR_CANNOT_DEMOTE_SELF'), 'error'); + + return false; + } + try { - // Load the current settings for this component + // Load the current settings for this component. $query = $this->db->getQuery(true) ->select($this->db->quoteName(array('name', 'rules'))) ->from($this->db->quoteName('#__assets')) @@ -384,87 +491,291 @@ public function storePermissions($permission) // 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'); - if (empty($results)) - { - $data = array(); - $data[$permission['action']] = array(); - $data[$permission['action']] = array($permission['rule'] => $permission['value']); + return false; + } - $rules = new JAccessRules($data); - $asset = JTable::getInstance('asset'); - $asset->rules = (string) $rules; - $asset->name = (string) $permission['component']; - $asset->title = (string) $permission['title']; + // No record found, let's create one. + if (empty($results)) + { + $data = array(); + $data[$permission['action']] = array($permission['rule'] => $permission['value']); - if (!$asset->check() || !$asset->store()) - { - JFactory::getApplication()->enqueueMessage(JText::_('SOME_ERROR_CODE'), 'error'); + $rules = new JAccessRules($data); + $asset = JTable::getInstance('asset'); + $asset->rules = (string) $rules; + $asset->name = (string) $permission['component']; + $asset->title = (string) $permission['title']; - return false; - } + // Get the parent asset id so we have a correct tree. + $parentAsset = JTable::getInstance('Asset'); - return true; + if (strpos($asset->name, '.') !== false) + { + $assetParts = explode('.', $asset->name); + $parentAsset->loadByName($assetParts[0]); + $parentAssetId = $parentAsset->id; } else { - // Decode the rule settings - $temp = json_decode($results[0]['rules'], true); + $parentAssetId = $parentAsset->getRootId(); + } - // Check if a new value is to be set - if (isset($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). + */ + + $asset->setLocation($parentAssetId, 'last-child'); + + if (!$asset->check() || !$asset->store()) + { + $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error'); + + return false; + } + } + else + { + // Decode the rule settings. + $temp = json_decode($results[0]['rules'], true); + + // 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']])) { - // 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']] = intval($permission['value']); - - // Check if we have an inherited setting - if (strlen($permission['value']) == 0) - { - unset($temp[$permission['action']][$permission['rule']]); - } + $temp[$permission['action']] = array(); } - else + + // 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 (strlen($permission['value']) === 0) { - // There is no value so remove the action as it's not needed - unset($temp[$permission['action']]); + unset($temp[$permission['action']][$permission['rule']]); } + } + else + { + // There is no value so remove the action as it's not needed. + unset($temp[$permission['action']]); + } - // Store the new permissions - $temp = json_encode($temp); - $query = $this->db->getQuery(true) + // Store the new permissions. + try + { + $query->clear() ->update($this->db->quoteName('#__assets')) - ->set('rules = ' . $this->db->quote($temp)) + ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote(json_encode($temp))) ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); - $this->db->setQuery($query); + $this->db->setQuery($query)->execute(); + } + catch (Exception $e) + { + $app->enqueueMessage($e->getMessage(), 'error'); + + return false; + } + } + + // All checks done. + $result = array( + 'text' => '', + 'class' => '', + 'result' => true, + ); + + // Show the current effective calculated permission considering current group, path and cascade. + + try + { + // Get the asset id by the name of the component. + $query->clear() + ->select($this->db->quoteName('id')) + ->from($this->db->quoteName('#__assets')) + ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component'])); + + $this->db->setQuery($query); + + $assetId = (int) $this->db->loadResult(); + + // Fetch the parent asset id. + $parentAssetId = null; + + /** + * @to do: incorrect info + * When creating a new item (not saving) it uses the calculated permissions from the component (item <-> component <-> global config). + * But if we have a section too (item <-> section(s) <-> component <-> global config) this is not correct. + * Also, currently it uses the component permission, but should use the calculated permissions for achild of the component/section. + */ - $result = $this->db->execute(); + // If not in global config we need the parent_id asset to calculate permissions. + if (!$isGlobalConfig) + { + // In this case we need to get the component rules too. + $query->clear() + ->select($this->db->quoteName('parent_id')) + ->from($this->db->quoteName('#__assets')) + ->where($this->db->quoteName('id') . ' = ' . $assetId); + + $this->db->setQuery($query); - return (bool) $result; + $parentAssetId = (int) $this->db->loadResult(); } + + // Get the group parent id of the current group. + $query->clear() + ->select($this->db->quoteName('parent_id')) + ->from($this->db->quoteName('#__usergroups')) + ->where($this->db->quoteName('id') . ' = ' . (int) $permission['rule']); + + $this->db->setQuery($query); + + $parentGroupId = (int) $this->db->loadResult(); + + // Count the number of child groups of the current group. + $query->clear() + ->select('COUNT(' . $this->db->quoteName('id') . ')') + ->from($this->db->quoteName('#__usergroups')) + ->where($this->db->quoteName('parent_id') . ' = ' . (int) $permission['rule']); + + $this->db->setQuery($query); + + $totalChildGroups = (int) $this->db->loadResult(); } catch (Exception $e) { - return $e->getMessage(); + $app->enqueueMessage($e->getMessage(), 'error'); + + return false; + } + + // Clear access statistics. + JAccess::clearStatics(); + + // After current group permission is changed we need to check again if the group has Super User permissions. + $isSuperUserGroupAfter = JAccess::checkGroup($permission['rule'], 'core.admin'); + + // Get the rule for just this asset (non-recursive) and get the actual setting for the action for this group. + $assetRule = JAccess::getAssetRules($assetId, false, false)->allow($permission['action'], $permission['rule']); + + // Get the group, group parent id, and group global config recursive calculated permission for the chosen action. + $inheritedGroupRule = JAccess::checkGroup($permission['rule'], $permission['action'], $assetId); + + if (!empty($parentAssetId)) + { + $inheritedGroupParentAssetRule = JAccess::checkGroup($permission['rule'], $permission['action'], $parentAssetId); } + else + { + $inheritedGroupParentAssetRule = null; + } + + $inheritedParentGroupRule = !empty($parentGroupId) ? JAccess::checkGroup($parentGroupId, $permission['action'], $assetId) : null; + + // Current group is a Super User group, so calculated setting is "Allowed (Super User)". + if ($isSuperUserGroupAfter) + { + $result['class'] = 'label label-success'; + $result['text'] = '' . JText::_('JLIB_RULES_ALLOWED_ADMIN'); + } + // Not super user. + else + { + // First get the real recursive calculated setting and add (Inherited) to it. + + // If recursive calculated setting is "Denied" or null. Calculated permission is "Not Allowed (Inherited)". + if ($inheritedGroupRule === null || $inheritedGroupRule === false) + { + $result['class'] = 'label label-important'; + $result['text'] = JText::_('JLIB_RULES_NOT_ALLOWED_INHERITED'); + } + // If recursive calculated setting is "Allowed". Calculated permission is "Allowed (Inherited)". + else + { + $result['class'] = 'label label-success'; + $result['text'] = JText::_('JLIB_RULES_ALLOWED_INHERITED'); + } + + // Second part: Overwrite the calculated permissions labels if there is an explicity permission in the current group. + + /** + * @to do: incorect info + * If a component as a permission that doesn't exists in global config (ex: frontend editing in com_modules) by default + * we get "Not Allowed (Inherited)" when we should get "Not Allowed (Default)". + */ + + // If there is an explicity permission "Not Allowed". Calculated permission is "Not Allowed". + if ($assetRule === false) + { + $result['class'] = 'label label-important'; + $result['text'] = JText::_('JLIB_RULES_NOT_ALLOWED'); + } + // If there is an explicity permission is "Allowed". Calculated permission is "Allowed". + elseif ($assetRule === true) + { + $result['class'] = 'label label-success'; + $result['text'] = JText::_('JLIB_RULES_ALLOWED'); + } + + // Third part: Overwrite the calculated permissions labels for special cases. + + // Global configuration with "Not Set" permission. Calculated permission is "Not Allowed (Default)". + if (empty($parentGroupId) && $isGlobalConfig === true && $assetRule === null) + { + $result['class'] = 'label label-important'; + $result['text'] = JText::_('JLIB_RULES_NOT_ALLOWED_DEFAULT'); + } + + /** + * Component/Item with explicit "Denied" permission at parent Asset (Category, Component or Global config) configuration. + * Or some parent group has an explicit "Denied". + * Calculated permission is "Not Allowed (Locked)". + */ + elseif ($inheritedGroupParentAssetRule === false || $inheritedParentGroupRule === false) + { + $result['class'] = 'label label-important'; + $result['text'] = '' . JText::_('JLIB_RULES_NOT_ALLOWED_LOCKED'); + } + } + + // If removed or added super user from group, we need to refresh the page to recalculate all settings. + if ($isSuperUserGroupBefore != $isSuperUserGroupAfter) + { + $app->enqueueMessage(JText::_('JLIB_RULES_NOTICE_RECALCULATE_GROUP_PERMISSIONS'), 'notice'); + } + + // If this group has child groups, we need to refresh the page to recalculate the child settings. + if ($totalChildGroups > 0) + { + $app->enqueueMessage(JText::_('JLIB_RULES_NOTICE_RECALCULATE_GROUP_CHILDS_PERMISSIONS'), 'notice'); + } + + return $result; } /** * Method to send a test mail which is called via an AJAX request * - * @return bool + * @return boolean * * @since 3.5 * @throws Exception @@ -486,14 +797,25 @@ public function sendTestMail() $app->set('mailer', $input->get('mailer')); $app->set('mailonline', $input->get('mailonline')); + $mail = JFactory::getMailer(); + // Prepare email and send try to send it $mailSubject = JText::sprintf('COM_CONFIG_SENDMAIL_SUBJECT', $app->get('sitename')); - $mailBody = JText::sprintf('COM_CONFIG_SENDMAIL_BODY', JText::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($app->get('mailer')))); + $mailBody = JText::sprintf('COM_CONFIG_SENDMAIL_BODY', JText::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($mail->Mailer))); - if (JFactory::getMailer()->sendMail($app->get('mailfrom'), $app->get('fromname'), $app->get('mailfrom'), $mailSubject, $mailBody) === true) + if ($mail->sendMail($app->get('mailfrom'), $app->get('fromname'), $app->get('mailfrom'), $mailSubject, $mailBody) === true) { - $methodName = JText::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($app->get('mailer'))); - $app->enqueueMessage(JText::sprintf('COM_CONFIG_SENDMAIL_SUCCESS', $app->get('mailfrom'), $methodName), 'success'); + $methodName = JText::_('COM_CONFIG_SENDMAIL_METHOD_' . strtoupper($mail->Mailer)); + + // If JMail send the mail using PHP Mail as fallback. + if ($mail->Mailer != $app->get('mailer')) + { + $app->enqueueMessage(JText::sprintf('COM_CONFIG_SENDMAIL_SUCCESS_FALLBACK', $app->get('mailfrom'), $methodName), 'warning'); + } + else + { + $app->enqueueMessage(JText::sprintf('COM_CONFIG_SENDMAIL_SUCCESS', $app->get('mailfrom'), $methodName), 'message'); + } return true; } diff --git a/administrator/components/com_config/model/component.php b/administrator/components/com_config/model/component.php index 19c9e4511fd01..9afb0219ae6be 100644 --- a/administrator/components/com_config/model/component.php +++ b/administrator/components/com_config/model/component.php @@ -178,7 +178,7 @@ public function save($data) throw new RuntimeException($table->getError()); } - $result = $dispatcher->trigger('onExtensionBeforeSave', array($context, &$table, false)); + $result = $dispatcher->trigger('onExtensionBeforeSave', array($context, $table, false)); // Store the data. if (in_array(false, $result, true) || !$table->store()) @@ -187,7 +187,7 @@ public function save($data) } // Trigger the after save event. - $dispatcher->trigger('onExtensionAfterSave', array($context, &$table, false)); + $dispatcher->trigger('onExtensionAfterSave', array($context, $table, false)); // Clean the component cache. $this->cleanCache('_system', 0); diff --git a/administrator/components/com_config/model/field/filters.php b/administrator/components/com_config/model/field/filters.php index f3f776b392487..712000bb5f808 100644 --- a/administrator/components/com_config/model/field/filters.php +++ b/administrator/components/com_config/model/field/filters.php @@ -51,14 +51,16 @@ protected function getInput() $html[] = ' ' . JText::_('JGLOBAL_FILTER_GROUPS_LABEL') . ''; $html[] = ' '; $html[] = ' '; - $html[] = ' ' . JText::_('JGLOBAL_FILTER_TYPE_LABEL') . ''; + $html[] = ' ' + . JText::_('JGLOBAL_FILTER_TYPE_LABEL') . ''; $html[] = ' '; $html[] = ' '; - $html[] = ' ' . JText::_('JGLOBAL_FILTER_TAGS_LABEL') . ''; + $html[] = ' ' + . JText::_('JGLOBAL_FILTER_TAGS_LABEL') . ''; $html[] = ' '; $html[] = ' '; $html[] = ' ' - . JText::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL') . ''; + . JText::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL') . ''; $html[] = ' '; $html[] = ' '; $html[] = ' '; diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml index d68509812bbcd..d5387811c40d2 100644 --- a/administrator/components/com_config/model/form/application.xml +++ b/administrator/components/com_config/model/form/application.xml @@ -3,17 +3,7 @@
- - - - - + - - - - - - - - + /> + class="btn-group btn-group-yesno" + default="1" + showon="cache_handler:memcache" + filter="integer" + > @@ -66,12 +30,13 @@ + class="btn-group btn-group-yesno" + default="0" + showon="cache_handler:memcache" + filter="integer" + > @@ -79,32 +44,35 @@ + size="25" + /> + size="5" + /> + class="btn-group btn-group-yesno" + default="1" + showon="cache_handler:memcached" + filter="integer" + > @@ -112,12 +80,13 @@ + class="btn-group btn-group-yesno" + default="0" + showon="cache_handler:memcached" + filter="integer" + > @@ -125,32 +94,35 @@ + size="25" + /> + size="5" + /> + showon="cache_handler:redis" + > @@ -158,22 +130,24 @@ + showon="cache_handler:redis" + size="25" + /> + showon="cache_handler:redis" + size="5" + /> + size="30" + /> + + + + + + + + + + > + + + + +
+ + + + - + default="none" + filter="word" + /> + size="25" + /> + size="5" + /> + size="25" + /> + size="5" + /> + + + + + + + +
+
diff --git a/administrator/components/com_config/view/application/html.php b/administrator/components/com_config/view/application/html.php index 84588a2516e11..2cb2d56d15039 100644 --- a/administrator/components/com_config/view/application/html.php +++ b/administrator/components/com_config/view/application/html.php @@ -53,6 +53,7 @@ public function render() { $form->bind($data); } + // Get the params for com_users. $usersParams = JComponentHelper::getParams('com_users'); @@ -73,13 +74,6 @@ public function render() $this->userIsSuperAdmin = $user->authorise('core.admin'); - // Add strings for translations in Javascript. - JText::script('COM_CONFIG_SENDMAIL_JS_ERROR_CONNECTION_ABORT'); - JText::script('COM_CONFIG_SENDMAIL_JS_ERROR_NO_CONTENT'); - JText::script('COM_CONFIG_SENDMAIL_JS_ERROR_OTHER'); - JText::script('COM_CONFIG_SENDMAIL_JS_ERROR_PARSE'); - JText::script('COM_CONFIG_SENDMAIL_JS_ERROR_TIMEOUT'); - $this->addToolbar(); return parent::render(); diff --git a/administrator/components/com_config/view/application/tmpl/default.php b/administrator/components/com_config/view/application/tmpl/default.php index f3f39a8181bd2..458a6c3bf2d74 100644 --- a/administrator/components/com_config/view/application/tmpl/default.php +++ b/administrator/components/com_config/view/application/tmpl/default.php @@ -13,9 +13,16 @@ // Load tooltips behavior JHtml::_('behavior.formvalidator'); +JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); JHtml::_('formbehavior.chosen', 'select'); +// Load JS message titles +JText::script('ERROR'); +JText::script('WARNING'); +JText::script('NOTICE'); +JText::script('MESSAGE'); + JFactory::getDocument()->addScriptDeclaration(' Joomla.submitbutton = function(task) { @@ -40,8 +47,7 @@ foreach ($this->submenumodules as $submenumodule) { $output = JModuleHelper::renderModule($submenumodule); - $params = new Registry; - $params->loadString($submenumodule->params); + $params = new Registry($submenumodule->params); echo $output; } ?> diff --git a/administrator/components/com_config/view/application/tmpl/default_mail.php b/administrator/components/com_config/view/application/tmpl/default_mail.php index 002cdc3af5349..9a10a682631bb 100644 --- a/administrator/components/com_config/view/application/tmpl/default_mail.php +++ b/administrator/components/com_config/view/application/tmpl/default_mail.php @@ -9,15 +9,28 @@ defined('_JEXEC') or die; -JHtml::script('system/sendtestmail.js', false, true); -JFactory::getDocument()->addScriptDeclaration(' - var sendtestmail_url = "' . addslashes(JUri::base()) . 'index.php?option=com_config&task=config.sendtestmail.application&format=json&' . JSession::getFormToken() . '=1"; - '); +JHtml::_('script', 'system/sendtestmail.js', array('version' => 'auto', 'relative' => true)); + +// Load JavaScript message titles +JText::script('ERROR'); +JText::script('WARNING'); +JText::script('NOTICE'); +JText::script('MESSAGE'); + +// Add strings for JavaScript error translations. +JText::script('JLIB_JS_AJAX_ERROR_CONNECTION_ABORT'); +JText::script('JLIB_JS_AJAX_ERROR_NO_CONTENT'); +JText::script('JLIB_JS_AJAX_ERROR_OTHER'); +JText::script('JLIB_JS_AJAX_ERROR_PARSE'); +JText::script('JLIB_JS_AJAX_ERROR_TIMEOUT'); + +// Ajax request data. +$ajaxUri = JRoute::_('index.php?option=com_config&task=config.sendtestmail.application&format=json&' . JSession::getFormToken() . '=1'); $this->name = JText::_('COM_CONFIG_MAIL_SETTINGS'); $this->fieldsname = 'mail'; echo JLayoutHelper::render('joomla.content.options_default', $this); -echo ''; diff --git a/administrator/components/com_config/view/component/tmpl/default.php b/administrator/components/com_config/view/component/tmpl/default.php index b2f60afa5772b..279499e53fc5f 100644 --- a/administrator/components/com_config/view/component/tmpl/default.php +++ b/administrator/components/com_config/view/component/tmpl/default.php @@ -15,8 +15,15 @@ // Load the tooltip behavior. JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.formvalidator'); +JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); +// Load JS message titles +JText::script('ERROR'); +JText::script('WARNING'); +JText::script('NOTICE'); +JText::script('MESSAGE'); + JFactory::getDocument()->addScriptDeclaration( ' Joomla.submitbutton = function(task) @@ -37,23 +44,25 @@
+ -
+ + + + - JHIDE + + + + + + + + + +
JGLOBAL_LEAST_HITS + + + + JHIDE + + + + + + + + + + + + + + +
authorise('core.manage', 'com_content')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } JLoader::register('ContentHelper', __DIR__ . '/helpers/content.php'); diff --git a/administrator/components/com_content/controller.php b/administrator/components/com_content/controller.php index 065a54952d5f0..0795409348d67 100644 --- a/administrator/components/com_content/controller.php +++ b/administrator/components/com_content/controller.php @@ -17,8 +17,10 @@ class ContentController extends JControllerLegacy { /** - * @var string The default view. - * @since 1.6 + * The default view. + * + * @var string + * @since 1.6 */ protected $default_view = 'articles'; @@ -28,7 +30,7 @@ class ContentController extends JControllerLegacy * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * - * @return JController This object to support chaining. + * @return ContentController This object to support chaining. * * @since 1.5 */ diff --git a/administrator/components/com_content/controllers/article.php b/administrator/components/com_content/controllers/article.php index c633d649a11b5..e8618ebee9162 100644 --- a/administrator/components/com_content/controllers/article.php +++ b/administrator/components/com_content/controllers/article.php @@ -9,12 +9,12 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * The article controller * - * @package Joomla.Administrator - * @subpackage com_content - * @since 1.6 + * @since 1.6 */ class ContentControllerArticle extends JControllerForm { @@ -49,14 +49,13 @@ public function __construct($config = array()) */ protected function allowAdd($data = array()) { - $user = JFactory::getUser(); - $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); + $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); $allow = null; if ($categoryId) { // If the category has been passed in the data or URL check it. - $allow = $user->authorise('core.create', 'com_content.category.' . $categoryId); + $allow = JFactory::getUser()->authorise('core.create', 'com_content.category.' . $categoryId); } if ($allow === null) @@ -64,10 +63,8 @@ protected function allowAdd($data = array()) // In the absense of better information, revert to the component permissions. return parent::allowAdd(); } - else - { - return $allow; - } + + return $allow; } /** @@ -84,42 +81,35 @@ protected function allowEdit($data = array(), $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; $user = JFactory::getUser(); - $userId = $user->get('id'); - // Check general edit permission first. + // Zero record (id:0), return component edit permission by calling parent controller method + if (!$recordId) + { + return parent::allowEdit($data, $key); + } + + // Check edit on the record asset (explicit or inherited) if ($user->authorise('core.edit', 'com_content.article.' . $recordId)) { return true; } - // Fallback on edit.own. - // First test if the permission is available. + // Check edit own on the record asset (explicit or inherited) if ($user->authorise('core.edit.own', 'com_content.article.' . $recordId)) { - // Now test the owner is the user. - $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; - if (empty($ownerId) && $recordId) - { - // Need to do a lookup from the model. - $record = $this->getModel()->getItem($recordId); - - if (empty($record)) - { - return false; - } + // Existing record already has an owner, get it + $record = $this->getModel()->getItem($recordId); - $ownerId = $record->created_by; - } - - // If the owner matches 'me' then do the test. - if ($ownerId == $userId) + if (empty($record)) { - return true; + return false; } + + // Grant if current user is owner of the record + return $user->id == $record->created_by; } - // Since there is no asset tracking, revert to the component permissions. - return parent::allowEdit($data, $key); + return false; } /** @@ -136,6 +126,7 @@ public function batch($model = null) JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Set the model + /** @var ContentModelArticle $model */ $model = $this->getModel('Article', '', array()); // Preset the redirect @@ -143,20 +134,4 @@ public function batch($model = null) return parent::batch($model); } - - /** - * Function that allows child controller access to model data after the data has been saved. - * - * @param JModelLegacy $model The data model object. - * @param array $validData The validated data. - * - * @return void - * - * @since 3.1 - */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) - { - - return; - } } diff --git a/administrator/components/com_content/controllers/articles.php b/administrator/components/com_content/controllers/articles.php index 3e28c237ed5e1..e09d293812d47 100644 --- a/administrator/components/com_content/controllers/articles.php +++ b/administrator/components/com_content/controllers/articles.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Articles list controller class. * @@ -21,7 +23,7 @@ class ContentControllerArticles extends JControllerAdmin * * @param array $config An optional associative array of configuration settings. * - * @see JController + * @see JControllerLegacy * @since 1.6 */ public function __construct($config = array()) @@ -54,7 +56,7 @@ public function featured() $ids = $this->input->get('cid', array(), 'array'); $values = array('featured' => 1, 'unfeatured' => 0); $task = $this->getTask(); - $value = JArrayHelper::getValue($values, $task, 0, 'int'); + $value = ArrayHelper::getValue($values, $task, 0, 'int'); // Access checks. foreach ($ids as $i => $id) @@ -74,6 +76,7 @@ public function featured() else { // Get the model. + /** @var ContentModelArticle $model */ $model = $this->getModel(); // Publish the items. @@ -111,29 +114,12 @@ public function featured() * @param string $prefix The class prefix. Optional. * @param array $config The array of possible config values. Optional. * - * @return JModel + * @return JModelLegacy * * @since 1.6 */ public function getModel($name = 'Article', $prefix = 'ContentModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; - } - - /** - * Function that allows child controller access to model data - * after the item has been deleted. - * - * @param JModelLegacy $model The data model object. - * @param integer $ids The array of ids for items being deleted. - * - * @return void - * - * @since 12.2 - */ - protected function postDeleteHook(JModelLegacy $model, $ids = null) - { + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_content/controllers/featured.php b/administrator/components/com_content/controllers/featured.php index 089df321927db..eb8af65bbfb14 100644 --- a/administrator/components/com_content/controllers/featured.php +++ b/administrator/components/com_content/controllers/featured.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +JLoader::register('ContentControllerArticles', __DIR__ . '/articles.php'); /** * Featured content controller class. @@ -51,6 +51,7 @@ public function delete() else { // Get the model. + /** @var ContentModelFeature $model */ $model = $this->getModel(); // Remove the items. @@ -84,14 +85,12 @@ public function publish() * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * - * @return object The model. + * @return JModelLegacy The model. * * @since 1.6 */ public function getModel($name = 'Feature', $prefix = 'ContentModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_content/helpers/content.php b/administrator/components/com_content/helpers/content.php index e6ed1099741c5..8814dd3e2e866 100644 --- a/administrator/components/com_content/helpers/content.php +++ b/administrator/components/com_content/helpers/content.php @@ -37,7 +37,23 @@ public static function addSubmenu($vName) JHtmlSidebar::addEntry( JText::_('COM_CONTENT_SUBMENU_CATEGORIES'), 'index.php?option=com_categories&extension=com_content', - $vName == 'categories'); + $vName == 'categories' + ); + + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1')) + { + JHtmlSidebar::addEntry( + JText::_('JGLOBAL_FIELDS'), + 'index.php?option=com_fields&context=com_content.article', + $vName == 'fields.article' + ); + JHtmlSidebar::addEntry( + JText::_('JGLOBAL_FIELD_GROUPS'), + 'index.php?option=com_categories&extension=com_content.article.fields', + $vName == 'categories.article' + ); + } + JHtmlSidebar::addEntry( JText::_('COM_CONTENT_SUBMENU_FEATURED'), 'index.php?option=com_content&view=featured', @@ -114,4 +130,78 @@ public static function countItems(&$items) return $items; } + + /** + * Adds Count Items for Tag Manager. + * + * @param stdClass[] &$items The content objects + * @param string $extension The name of the active view. + * + * @return stdClass[] + * + * @since 3.6 + */ + public static function countTagItems(&$items, $extension) + { + $db = JFactory::getDbo(); + $parts = explode('.', $extension); + $component = $parts[0]; + $section = null; + + if (count($parts) > 1) + { + $section = $parts[1]; + } + + $join = $db->qn('#__content') . ' AS c ON ct.content_item_id=c.id'; + $state = 'state'; + + if ($section === 'category') + { + $join = $db->qn('#__categories') . ' AS c ON ct.content_item_id=c.id'; + $state = 'published as state'; + } + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + $query = $db->getQuery(true); + $query->select($state . ', count(*) AS count') + ->from($db->qn('#__contentitem_tag_map') . 'AS ct ') + ->where('ct.tag_id = ' . (int) $item->id) + ->where('ct.type_alias =' . $db->q($extension)) + ->join('LEFT', $join) + ->group('state'); + $db->setQuery($query); + $contents = $db->loadObjectList(); + + foreach ($contents as $content) + { + if ($content->state == 1) + { + $item->count_published = $content->count; + } + + if ($content->state == 0) + { + $item->count_unpublished = $content->count; + } + + if ($content->state == 2) + { + $item->count_archived = $content->count; + } + + if ($content->state == -2) + { + $item->count_trashed = $content->count; + } + } + } + + return $items; + } } diff --git a/administrator/components/com_content/helpers/html/contentadministrator.php b/administrator/components/com_content/helpers/html/contentadministrator.php index 8d25ff1198f7b..d2409b6e52028 100644 --- a/administrator/components/com_content/helpers/html/contentadministrator.php +++ b/administrator/components/com_content/helpers/html/contentadministrator.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php'); /** @@ -21,9 +23,11 @@ abstract class JHtmlContentAdministrator /** * Render the list of associated items * - * @param int $articleid The article item id + * @param integer $articleid The article item id * * @return string The language HTML + * + * @throws Exception */ public static function association($articleid) { @@ -43,6 +47,7 @@ public static function association($articleid) $query = $db->getQuery(true) ->select('c.*') ->select('l.sef as lang_sef') + ->select('l.lang_code') ->from('#__content as c') ->select('cat.title as category_title') ->join('LEFT', '#__categories as cat ON cat.id=c.catid') @@ -58,38 +63,27 @@ public static function association($articleid) } catch (RuntimeException $e) { - throw new Exception($e->getMessage(), 500); + throw new Exception($e->getMessage(), 500, $e); } if ($items) { foreach ($items as &$item) { - $text = strtoupper($item->lang_sef); - $url = JRoute::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id); - $tooltipParts = array( - JHtml::_('image', 'mod_languages/' . $item->image . '.gif', - $item->language_title, - array('title' => $item->language_title), - true - ), - $item->title, - '(' . $item->category_title . ')' - ); - - $item->link = JHtml::_( - 'tooltip', - implode(' ', $tooltipParts), - null, - null, - $text, - $url, - null, - 'hasTooltip label label-association label-' . $item->lang_sef - ); + $text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX'; + $url = JRoute::_('index.php?option=com_content&task=article.edit&id=' . (int) $item->id); + + $tooltip = $item->title . '
' . JText::sprintf('JCATEGORY_SPRINTF', $item->category_title); + $classes = 'hasPopover label label-association label-' . $item->lang_sef; + + $item->link = '' + . $text . ''; } } + JHtml::_('bootstrap.popover'); + $html = JLayoutHelper::render('joomla.content.associations', $items); } @@ -99,8 +93,8 @@ public static function association($articleid) /** * Show the feature/unfeature links * - * @param int $value The state value - * @param int $i Row number + * @param integer $value The state value + * @param integer $i Row number * @param boolean $canChange Is user allowed to change? * * @return string HTML code @@ -114,7 +108,7 @@ public static function featured($value = 0, $i, $canChange = true) 0 => array('unfeatured', 'articles.featured', 'COM_CONTENT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'), 1 => array('featured', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'JGLOBAL_TOGGLE_FEATURED'), ); - $state = JArrayHelper::getValue($states, (int) $value, $states[1]); + $state = ArrayHelper::getValue($states, (int) $value, $states[1]); $icon = $state[0]; if ($canChange) diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 01656c6429418..409c9de645d46 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php'); @@ -21,24 +22,26 @@ class ContentModelArticle extends JModelAdmin { /** - * @var string The prefix to use with controller messages. - * @since 1.6 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ protected $text_prefix = 'COM_CONTENT'; /** * The type alias for this content type (for example, 'com_content.article'). * - * @var string - * @since 3.2 + * @var string + * @since 3.2 */ public $typeAlias = 'com_content.article'; /** * The context used for the associations table * - * @var string - * @since 3.4.4 + * @var string + * @since 3.4.4 */ protected $associationsContext = 'com_content.item'; @@ -59,7 +62,7 @@ protected function batchCopy($value, $pks, $contexts) $newIds = array(); - if (!parent::checkCategoryId($categoryId)) + if (!$this->checkCategoryId($categoryId)) { return false; } @@ -121,7 +124,7 @@ protected function batchCopy($value, $pks, $contexts) return false; } - parent::createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); // Store the row. if (!$this->table->store()) @@ -173,9 +176,7 @@ protected function canDelete($record) return false; } - $user = JFactory::getUser(); - - return $user->authorise('core.delete', 'com_content.article.' . (int) $record->id); + return JFactory::getUser()->authorise('core.delete', 'com_content.article.' . (int) $record->id); } return false; @@ -199,16 +200,15 @@ protected function canEditState($record) { return $user->authorise('core.edit.state', 'com_content.article.' . (int) $record->id); } + // New article, so check against the category. - elseif (!empty($record->catid)) + if (!empty($record->catid)) { return $user->authorise('core.edit.state', 'com_content.category.' . (int) $record->catid); } + // Default to component settings if neither article nor category known. - else - { - return parent::canEditState('com_content'); - } + return parent::canEditState(); } /** @@ -223,8 +223,6 @@ protected function canEditState($record) protected function prepareTable($table) { // Set the publish date to now - $db = $this->getDbo(); - if ($table->state == 1 && (int) $table->publish_up == 0) { $table->publish_up = JFactory::getDate()->toSql(); @@ -232,7 +230,7 @@ protected function prepareTable($table) if ($table->state == 1 && intval($table->publish_down) == 0) { - $table->publish_down = $db->getNullDate(); + $table->publish_down = $this->getDbo()->getNullDate(); } // Increment the content version number. @@ -241,7 +239,7 @@ protected function prepareTable($table) // Reorder the articles within the category so the new article is first if (empty($table->id)) { - $table->ordering = $table->getNextOrder('catid = ' . (int) $table->catid . ' AND state >= 0'); + $table->reorder('catid = ' . (int) $table->catid . ' AND state >= 0'); } } @@ -271,23 +269,19 @@ public function getItem($pk = null) if ($item = parent::getItem($pk)) { // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($item->attribs); + $registry = new Registry($item->attribs); $item->attribs = $registry->toArray(); // Convert the metadata field to an array. - $registry = new Registry; - $registry->loadString($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); // Convert the images field to an array. - $registry = new Registry; - $registry->loadString($item->images); + $registry = new Registry($item->images); $item->images = $registry->toArray(); // Convert the urls field to an array. - $registry = new Registry; - $registry->loadString($item->urls); + $registry = new Registry($item->urls); $item->urls = $registry->toArray(); $item->articletext = trim($item->fulltext) != '' ? $item->introtext . "
" . $item->fulltext : $item->introtext; @@ -300,7 +294,6 @@ public function getItem($pk = null) } // Load associated content items - $app = JFactory::getApplication(); $assoc = JLanguageAssociations::isEnabled(); if ($assoc) @@ -327,7 +320,7 @@ public function getItem($pk = null) * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * - * @return mixed A JForm object on success, false on failure + * @return JForm|boolean A JForm object on success, false on failure * * @since 1.6 */ @@ -343,16 +336,11 @@ public function getForm($data = array(), $loadData = true) $jinput = JFactory::getApplication()->input; - // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. - if ($jinput->get('a_id')) - { - $id = $jinput->get('a_id', 0); - } - // The back end uses id so we use that the rest of the time and set it to 0 by default. - else - { - $id = $jinput->get('id', 0); - } + /* + * The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + * The back end uses id so we use that the rest of the time and set it to 0 by default. + */ + $id = $jinput->get('a_id', $jinput->get('id', 0)); // Determine correct permissions to check. if ($this->getState('article.id')) @@ -446,7 +434,9 @@ protected function loadFormData() ); $data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null))); $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); + $data->set('access', + $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))) + ); } } @@ -487,8 +477,7 @@ public function save($data) if (isset($data['images']) && is_array($data['images'])) { - $registry = new Registry; - $registry->loadArray($data['images']); + $registry = new Registry($data['images']); $data['images'] = (string) $registry; } @@ -504,8 +493,8 @@ public function save($data) $catid = CategoriesHelper::validateCategoryId($data['catid'], 'com_content'); } - // Save New Category - if ($catid == 0) + // Save New Categoryg + if ($catid == 0 && $this->canCreateCategory()) { $table = array(); $table['title'] = $data['catid']; @@ -539,8 +528,7 @@ public function save($data) unset($check); - $registry = new Registry; - $registry->loadArray($data['urls']); + $registry = new Registry($data['urls']); $data['urls'] = (string) $registry; } @@ -601,7 +589,6 @@ public function save($data) if (parent::save($data)) { - if (isset($data['featured'])) { $this->featured($this->getState($this->getName() . '.id'), $data['featured']); @@ -625,7 +612,7 @@ public function featured($pks, $value = 0) { // Sanitize the ids. $pks = (array) $pks; - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); if (empty($pks)) { @@ -640,9 +627,9 @@ public function featured($pks, $value = 0) { $db = $this->getDbo(); $query = $db->getQuery(true) - ->update($db->quoteName('#__content')) - ->set('featured = ' . (int) $value) - ->where('id IN (' . implode(',', $pks) . ')'); + ->update($db->quoteName('#__content')) + ->set('featured = ' . (int) $value) + ->where('id IN (' . implode(',', $pks) . ')'); $db->setQuery($query); $db->execute(); @@ -651,8 +638,8 @@ public function featured($pks, $value = 0) // Adjust the mapping table. // Clear the existing features settings. $query = $db->getQuery(true) - ->delete($db->quoteName('#__content_frontpage')) - ->where('content_id IN (' . implode(',', $pks) . ')'); + ->delete($db->quoteName('#__content_frontpage')) + ->where('content_id IN (' . implode(',', $pks) . ')'); $db->setQuery($query); $db->execute(); } @@ -672,17 +659,14 @@ public function featured($pks, $value = 0) // Featuring. $tuples = array(); - $ordering = $table->getNextOrder(); foreach ($new_featured as $pk) { - $tuples[] = $pk . ', ' . $ordering; - $ordering++; + $tuples[] = $pk . ', 0'; } if (count($tuples)) { - $db = $this->getDbo(); $columns = array('content_id', 'ordering'); $query = $db->getQuery(true) ->insert($db->quoteName('#__content_frontpage')) @@ -700,6 +684,8 @@ public function featured($pks, $value = 0) return false; } + $table->reorder(); + $this->cleanCache(); return true; @@ -716,16 +702,11 @@ public function featured($pks, $value = 0) */ protected function getReorderConditions($table) { - $condition = array(); - $condition[] = 'catid = ' . (int) $table->catid; - - return $condition; + return array('catid = ' . (int) $table->catid); } /** - * Auto-populate the model state. - * - * Note. Calling getState in this method will result in recursion. + * Allows preprocessing of the JForm object. * * @param JForm $form The form object * @param array $data The data to be merged into the form object @@ -733,43 +714,43 @@ protected function getReorderConditions($table) * * @return void * - * @since 3.0 + * @since 3.0 */ protected function preprocessForm(JForm $form, $data, $group = 'content') { - // Association content items - $app = JFactory::getApplication(); - $assoc = JLanguageAssociations::isEnabled(); + if ($this->canCreateCategory()) + { + $form->setFieldAttribute('catid', 'allowAdd', 'true'); + } - if ($assoc) + // Association content items + if (JLanguageAssociations::isEnabled()) { - $languages = JLanguageHelper::getLanguages('lang_code'); - $addform = new SimpleXMLElement(''); - $fields = $addform->addChild('fields'); - $fields->addAttribute('name', 'associations'); - $fieldset = $fields->addChild('fieldset'); - $fieldset->addAttribute('name', 'item_associations'); - $fieldset->addAttribute('description', 'COM_CONTENT_ITEM_ASSOCIATIONS_FIELDSET_DESC'); - $add = false; - - foreach ($languages as $tag => $language) + $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); + + if (count($languages) > 1) { - if (empty($data->language) || $tag != $data->language) + $addform = new SimpleXMLElement(''); + $fields = $addform->addChild('fields'); + $fields->addAttribute('name', 'associations'); + $fieldset = $fields->addChild('fieldset'); + $fieldset->addAttribute('name', 'item_associations'); + $fieldset->addAttribute('description', 'COM_CONTENT_ITEM_ASSOCIATIONS_FIELDSET_DESC'); + + foreach ($languages as $language) { - $add = true; $field = $fieldset->addChild('field'); - $field->addAttribute('name', $tag); + $field->addAttribute('name', $language->lang_code); $field->addAttribute('type', 'modal_article'); - $field->addAttribute('language', $tag); + $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); + $field->addAttribute('select', 'true'); + $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); } - } - if ($add) - { $form->load($addform, false); } } @@ -809,4 +790,16 @@ public function hit() { return; } + + /** + * Is the user allowed to create an on the fly category? + * + * @return boolean + * + * @since 3.6.1 + */ + private function canCreateCategory() + { + return JFactory::getUser()->authorise('core.create', 'com_content'); + } } diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index 5e525fed1236d..4d544639c262c 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Methods supporting a list of article records. * @@ -22,7 +24,7 @@ class ContentModelArticles extends JModelList * @param array $config An optional associative array of configuration settings. * * @since 1.6 - * @see JController + * @see JControllerLegacy */ public function __construct($config = array()) { @@ -166,7 +168,6 @@ protected function getListQuery() $db = $this->getDbo(); $query = $db->getQuery(true); $user = JFactory::getUser(); - $app = JFactory::getApplication(); // Select the required fields from the table. $query->select( @@ -199,13 +200,24 @@ protected function getListQuery() $query->select('ua.name AS author_name') ->join('LEFT', '#__users AS ua ON ua.id = a.created_by'); + // Join on voting table + $assogroup = 'a.id, l.title, l.image, uc.name, ag.title, c.title, ua.name'; + + if (JPluginHelper::isEnabled('content', 'vote')) + { + $assogroup .= ', v.rating_sum, v.rating_count'; + $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, + COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count') + ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); + } + // Join over the associations. if (JLanguageAssociations::isEnabled()) { $query->select('COUNT(asso2.id)>1 as association') ->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_content.item')) ->join('LEFT', '#__associations AS asso2 ON asso2.key = asso.key') - ->group('a.id, l.title, l.image, uc.name, ag.title, c.title, ua.name'); + ->group($assogroup); } // Filter by access level. @@ -249,9 +261,7 @@ protected function getListQuery() } elseif (is_array($categoryId)) { - JArrayHelper::toInteger($categoryId); - $categoryId = implode(',', $categoryId); - $query->where('a.catid IN (' . $categoryId . ')'); + $query->where('a.catid IN (' . implode(',', ArrayHelper::toInteger($categoryId)) . ')'); } // Filter on the level. @@ -303,7 +313,8 @@ protected function getListQuery() { $query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId) ->join( - 'LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap') + 'LEFT', + $db->quoteName('#__contentitem_tag_map', 'tagmap') . ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id') . ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article') ); @@ -313,23 +324,13 @@ protected function getListQuery() $orderCol = $this->state->get('list.ordering', 'a.id'); $orderDirn = $this->state->get('list.direction', 'desc'); - if ($orderCol == 'a.ordering' || $orderCol == 'category_title') + if (JPluginHelper::isEnabled('content', 'vote')) { - $orderCol = 'c.title ' . $orderDirn . ', a.ordering'; + $orderCol = $this->state->get('list.fullordering', 'a.id'); + $orderDirn = ''; } - // SQL server change - if ($orderCol == 'language') - { - $orderCol = 'l.title'; - } - - if ($orderCol == 'access_level') - { - $orderCol = 'ag.title'; - } - - $query->order($db->escape($orderCol . ' ' . $orderDirn)); + $query->order($db->escape($orderCol) . ' ' . $orderDirn); return $query; } @@ -337,7 +338,7 @@ protected function getListQuery() /** * Build a list of authors * - * @return JDatabaseQuery + * @return stdClass * * @since 1.6 */ @@ -375,8 +376,7 @@ public function getItems() if (JFactory::getApplication()->isSite()) { - $user = JFactory::getUser(); - $groups = $user->getAuthorisedViewLevels(); + $groups = JFactory::getUser()->getAuthorisedViewLevels(); for ($x = 0, $count = count($items); $x < $count; $x++) { diff --git a/administrator/components/com_content/models/feature.php b/administrator/components/com_content/models/feature.php index f3730034575d5..e9c5d4aa4909c 100644 --- a/administrator/components/com_content/models/feature.php +++ b/administrator/components/com_content/models/feature.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/article.php'; +JLoader::register('ContentModelArticle', __DIR__ . '/article.php'); /** * Feature model. @@ -45,8 +45,6 @@ public function getTable($type = 'Featured', $prefix = 'ContentTable', $config = */ protected function getReorderConditions($table) { - $condition = array(); - - return $condition; + return array(); } } diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 1292491004258..3c2200eca901a 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -9,10 +9,12 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +use Joomla\Utilities\ArrayHelper; + +JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); /** - * About Page Model + * Methods supporting a list of featured article records. * * @since 1.6 */ @@ -23,7 +25,7 @@ class ContentModelFeatured extends ContentModelArticles * * @param array $config An optional associative array of configuration settings. * - * @see JController + * @see JControllerLegacy * @since 1.6 */ public function __construct($config = array()) @@ -63,13 +65,11 @@ public function __construct($config = array()) /** * Build an SQL query to load the list data. * - * @param boolean $resolveFKs True to join selected foreign information - * - * @return string + * @return JDatabaseQuery * * @since 1.6 */ - protected function getListQuery($resolveFKs = true) + protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); @@ -109,6 +109,14 @@ protected function getListQuery($resolveFKs = true) $query->select('ua.name AS author_name') ->join('LEFT', '#__users AS ua ON ua.id = a.created_by'); + // Join on voting table + if (JPluginHelper::isEnabled('content', 'vote')) + { + $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, + COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count') + ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); + } + // Filter by access level. if ($access = $this->getState('filter.access')) { @@ -143,8 +151,7 @@ protected function getListQuery($resolveFKs = true) } elseif (is_array($categoryId)) { - JArrayHelper::toInteger($categoryId); - $categoryId = implode(',', $categoryId); + $categoryId = implode(',', ArrayHelper::toInteger($categoryId)); $query->where('a.catid IN (' . $categoryId . ')'); } @@ -156,6 +163,7 @@ protected function getListQuery($resolveFKs = true) // Filter by author $authorId = $this->getState('filter.author_id'); + if (is_numeric($authorId)) { $type = $this->getState('filter.author_id.include', true) ? '= ' : '<>'; @@ -196,7 +204,8 @@ protected function getListQuery($resolveFKs = true) { $query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId) ->join( - 'LEFT', $db->quoteName('#__contentitem_tag_map', 'tagmap') + 'LEFT', + $db->quoteName('#__contentitem_tag_map', 'tagmap') . ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id') . ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article') ); diff --git a/administrator/components/com_content/models/fields/modal/article.php b/administrator/components/com_content/models/fields/modal/article.php index 447e92e648555..8c4712078c4a2 100644 --- a/administrator/components/com_content/models/fields/modal/article.php +++ b/administrator/components/com_content/models/fields/modal/article.php @@ -14,13 +14,13 @@ * * @since 1.6 */ -class JFormFieldModal_Article extends JFormField +class JFormFieldModal_Article extends JFormField implements JFormDomfieldinterface { /** * The form field type. * - * @var string - * @since 1.6 + * @var string + * @since 1.6 */ protected $type = 'Modal_Article'; @@ -33,8 +33,10 @@ class JFormFieldModal_Article extends JFormField */ protected function getInput() { - $allowEdit = ((string) $this->element['edit'] == 'true') ? true : false; - $allowClear = ((string) $this->element['clear'] != 'false') ? true : false; + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language JFactory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); @@ -42,83 +44,53 @@ protected function getInput() // The active article id field. $value = (int) $this->value > 0 ? (int) $this->value : ''; - // Build the script. - $script = array(); - - // Select button script - $script[] = ' function jSelectArticle_' . $this->id . '(id, title, catid, object) {'; - $script[] = ' document.getElementById("' . $this->id . '_id").value = id;'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = title;'; - - if ($allowEdit) - { - $script[] = ' if (id == "' . $value . '") {'; - $script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");'; - $script[] = ' } else {'; - $script[] = ' jQuery("#' . $this->id . '_edit").addClass("hidden");'; - $script[] = ' }'; - } - - if ($allowClear) - { - $script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");'; - } + // Create the modal id. + $modalId = 'Article_' . $this->id; - $script[] = ' jQuery("#articleSelect' . $this->id . 'Modal").modal("hide");'; + // Add the modal field script to the document head. + JHtml::_('jquery.framework'); + JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true)); - if ($this->required) + // Script to proxy the select modal function to the modal-fields.js file. + if ($allowSelect) { - $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_id"));'; - $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_name"));'; - } - - $script[] = ' }'; + static $scriptSelect = null; - // Edit button script - $script[] = ' function jEditArticle_' . $value . '(title) {'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = title;'; - $script[] = ' }'; + if (is_null($scriptSelect)) + { + $scriptSelect = array(); + } - // Clear button script - static $scriptClear; + if (!isset($scriptSelect[$this->id])) + { + JFactory::getDocument()->addScriptDeclaration(" + function jSelectArticle_" . $this->id . "(id, title, catid, object, url, language) { + window.processModalSelect('Article', '" . $this->id . "', id, title, catid, object, url, language); + } + "); - if ($allowClear && !$scriptClear) - { - $scriptClear = true; - - $script[] = ' function jClearArticle(id) {'; - $script[] = ' document.getElementById(id + "_id").value = "";'; - $script[] = ' document.getElementById(id + "_name").value = "' . - htmlspecialchars(JText::_('COM_CONTENT_SELECT_AN_ARTICLE', true), ENT_COMPAT, 'UTF-8') . '";'; - $script[] = ' jQuery("#"+id + "_clear").addClass("hidden");'; - $script[] = ' if (document.getElementById(id + "_edit")) {'; - $script[] = ' jQuery("#"+id + "_edit").addClass("hidden");'; - $script[] = ' }'; - $script[] = ' return false;'; - $script[] = ' }'; + $scriptSelect[$this->id] = true; + } } - // Add the script to the document head. - JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); - // Setup variables for display. - $html = array(); - - $linkArticles = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component' - . '&function=jSelectArticle_' . $this->id; - - $linkArticle = 'index.php?option=com_content&view=article&layout=modal&tmpl=component' - . '&task=article.edit' - . '&function=jEditArticle_' . $value; + $linkArticles = 'index.php?option=com_content&view=articles&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $linkArticle = 'index.php?option=com_content&view=article&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; if (isset($this->element['language'])) { $linkArticles .= '&forcedLanguage=' . $this->element['language']; $linkArticle .= '&forcedLanguage=' . $this->element['language']; + $modalTitle = JText::_('COM_CONTENT_CHANGE_ARTICLE') . ' — ' . $this->element['label']; + } + else + { + $modalTitle = JText::_('COM_CONTENT_CHANGE_ARTICLE'); } - $urlSelect = $linkArticles . '&' . JSession::getFormToken() . '=1'; - $urlEdit = $linkArticle . '&id=' . $value . '&' . JSession::getFormToken() . '=1'; + $urlSelect = $linkArticles . '&function=jSelectArticle_' . $this->id; + $urlEdit = $linkArticle . '&task=article.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \''; + $urlNew = $linkArticle . '&task=article.add'; if ($value) { @@ -139,36 +111,49 @@ protected function getInput() } } - if (empty($title)) - { - $title = JText::_('COM_CONTENT_SELECT_AN_ARTICLE'); - } - - $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); + $title = empty($title) ? JText::_('COM_CONTENT_SELECT_AN_ARTICLE') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); // The current article display field. - $html[] = ''; - $html[] = ''; + $html = ''; + $html .= ''; // Select article button - $html[] = '' - . ' ' . JText::_('JSELECT') - . ''; + if ($allowSelect) + { + $html .= '' + . ' ' . JText::_('JSELECT') + . ''; + } + + // New article button + if ($allowNew) + { + $html .= '' + . ' ' . JText::_('JACTION_CREATE') + . ''; + } // Edit article button if ($allowEdit) { - $html[] = '' . ' ' . JText::_('JACTION_EDIT') . ''; @@ -177,63 +162,100 @@ protected function getInput() // Clear article button if ($allowClear) { - $html[] = '' + . ' href="#"' + . ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">' . '' . JText::_('JCLEAR') - . ''; + . ''; } - $html[] = ''; + $html .= ''; // Select article modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'articleSelect' . $this->id . 'Modal', - array( - 'url' => $urlSelect, - 'title' => JText::_('COM_CONTENT_CHANGE_ARTICLE'), - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - ) - ); + if ($allowSelect) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalSelect' . $modalId, + array( + 'title' => $modalTitle, + 'url' => $urlSelect, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '', + ) + ); + } + + // New article modal + if ($allowNew) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalNew' . $modalId, + array( + 'title' => JText::_('COM_CONTENT_NEW_ARTICLE'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlNew, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } // Edit article modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'articleEdit' . $value . 'Modal', - array( - 'url' => $urlEdit, - 'title' => JText::_('COM_CONTENT_EDIT_ARTICLE'), - 'backdrop' => 'static', - 'closeButton' => false, - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - . '' - . '' - ) - ); + if ($allowEdit) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalEdit' . $modalId, + array( + 'title' => JText::_('COM_CONTENT_EDIT_ARTICLE'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlEdit, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } // Note: class='required' for client side validation. $class = $this->required ? ' class="required modal-value"' : ''; - $html[] = ''; + $html .= ''; - return implode("\n", $html); + return $html; } /** diff --git a/administrator/components/com_content/models/forms/article.xml b/administrator/components/com_content/models/forms/article.xml index 056ec2d6739b9..d593758964067 100644 --- a/administrator/components/com_content/models/forms/article.xml +++ b/administrator/components/com_content/models/forms/article.xml @@ -47,7 +47,6 @@ label="JCATEGORY" description="JFIELD_CATEGORY_DESC" required="true" - allowAdd="true" default="" > @@ -67,8 +66,11 @@ type="spacer" /> + description="COM_CONTENT_FIELD_CREATED_DESC" + translateformat="true" + showtime="true" + size="22" + filter="user_utc" /> @@ -79,7 +81,11 @@ + translateformat="true" + showtime="true" + size="22" + readonly="true" + filter="user_utc" /> - + description="JGLOBAL_SHOW_TITLE_DESC" + useglobal="true" + > @@ -166,8 +177,9 @@ type="list" class="chzn-color" label="JGLOBAL_LINKED_TITLES_LABEL" - description="JGLOBAL_LINKED_TITLES_DESC"> - + description="JGLOBAL_LINKED_TITLES_DESC" + useglobal="true" + > @@ -177,8 +189,8 @@ class="chzn-color" label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL" description="COM_CONTENT_FIELD_SHOW_TAGS_DESC" - > - + useglobal="true" + > @@ -188,8 +200,8 @@ class="chzn-color" description="JGLOBAL_SHOW_INTRO_DESC" label="JGLOBAL_SHOW_INTRO_LABEL" + useglobal="true" > - @@ -198,20 +210,34 @@ type="list" default="" label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL" - description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"> - + description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC" + useglobal="true" + > + + + + + - + description="JGLOBAL_SHOW_CATEGORY_DESC" + useglobal="true" + > @@ -221,8 +247,9 @@ type="list" class="chzn-color" label="JGLOBAL_LINK_CATEGORY_LABEL" - description="JGLOBAL_LINK_CATEGORY_DESC"> - + description="JGLOBAL_LINK_CATEGORY_DESC" + useglobal="true" + > @@ -232,8 +259,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" - description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"> - + description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" + useglobal="true" + > @@ -243,19 +271,32 @@ type="list" class="chzn-color" label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" - description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"> - + description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" + useglobal="true" + > + + + + + + - + description="JGLOBAL_SHOW_AUTHOR_DESC" + useglobal="true" + > @@ -265,8 +306,9 @@ type="list" class="chzn-color" label="JGLOBAL_LINK_AUTHOR_LABEL" - description="JGLOBAL_LINK_AUTHOR_DESC"> - + description="JGLOBAL_LINK_AUTHOR_DESC" + useglobal="true" + > @@ -276,8 +318,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_CREATE_DATE_LABEL" - description="JGLOBAL_SHOW_CREATE_DATE_DESC"> - + description="JGLOBAL_SHOW_CREATE_DATE_DESC" + useglobal="true" + > @@ -287,8 +330,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_MODIFY_DATE_LABEL" - description="JGLOBAL_SHOW_MODIFY_DATE_DESC"> - + description="JGLOBAL_SHOW_MODIFY_DATE_DESC" + useglobal="true" + > @@ -298,8 +342,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL" - description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"> - + description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" + useglobal="true" + > @@ -309,8 +354,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_NAVIGATION_LABEL" - description="JGLOBAL_SHOW_NAVIGATION_DESC"> - + description="JGLOBAL_SHOW_NAVIGATION_DESC" + useglobal="true" + > @@ -320,8 +366,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_ICONS_LABEL" - description="JGLOBAL_SHOW_ICONS_DESC"> - + description="JGLOBAL_SHOW_ICONS_DESC" + useglobal="true" + > @@ -331,8 +378,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_PRINT_ICON_LABEL" - description="JGLOBAL_SHOW_PRINT_ICON_DESC"> - + description="JGLOBAL_SHOW_PRINT_ICON_DESC" + useglobal="true" + > @@ -342,8 +390,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_EMAIL_ICON_LABEL" - description="JGLOBAL_SHOW_EMAIL_ICON_DESC"> - + description="JGLOBAL_SHOW_EMAIL_ICON_DESC" + useglobal="true" + > @@ -354,8 +403,8 @@ class="chzn-color" label="JGLOBAL_SHOW_VOTE_LABEL" description="JGLOBAL_SHOW_VOTE_DESC" - > - + useglobal="true" + > @@ -365,8 +414,9 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_HITS_LABEL" - description="JGLOBAL_SHOW_HITS_DESC"> - + description="JGLOBAL_SHOW_HITS_DESC" + useglobal="true" + > @@ -376,10 +426,11 @@ type="list" class="chzn-color" label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL" - description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"> - - - + description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC" + useglobal="true" + > + + - + description="COM_CONTENT_FIELD_URLSPOSITION_DESC" + useglobal="true" + > @@ -404,6 +456,11 @@ description="JFIELD_READMORE_DESC" size="25" /> + + - - - - + + - - - - + + - - - - + + - - - + +
@@ -629,11 +683,12 @@ name="float_intro" type="list" label="COM_CONTENT_FLOAT_LABEL" - description="COM_CONTENT_FLOAT_DESC"> - - - - + description="COM_CONTENT_FLOAT_DESC" + useglobal="true" + > + + +
- - - - + description="COM_CONTENT_FLOAT_DESC" + useglobal="true" + > + + + - @@ -729,12 +785,12 @@ description="COM_CONTENT_URL_FIELD_BROWSERNAV_DESC" default="" filter="options" + useglobal="true" > - - - - - + + + + - - - - - + + + + diff --git a/administrator/components/com_content/models/forms/filter_articles.xml b/administrator/components/com_content/models/forms/filter_articles.xml index 8cd89df9d0ee3..f8afdfe735446 100644 --- a/administrator/components/com_content/models/forms/filter_articles.xml +++ b/administrator/components/com_content/models/forms/filter_articles.xml @@ -94,26 +94,30 @@ + + - - + + - - - - + + + + + + JDATE_DESC + + + + diff --git a/administrator/components/com_content/views/article/tmpl/edit.php b/administrator/components/com_content/views/article/tmpl/edit.php index a39fe36477b58..5b88d8dd4da7a 100644 --- a/administrator/components/com_content/views/article/tmpl/edit.php +++ b/administrator/components/com_content/views/article/tmpl/edit.php @@ -70,6 +70,7 @@ ' . $this->form->getField('articletext')->save() . ' Joomla.submitform(task, document.getElementById("item-form")); + // @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__. if (task !== "article.apply") { window.parent.jQuery("#articleEdit' . (int) $this->item->id . 'Modal").modal("hide"); @@ -80,8 +81,8 @@ // In case of modal $isModal = $input->get('layout') == 'modal' ? true : false; -$layout = $isModal ? 'modal' : 'edit'; -$tmpl = $isModal ? '&tmpl=component' : ''; +$layout = $isModal ? 'modal' : 'edit'; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; ?> @@ -104,39 +105,43 @@
- - show_publishing_options == 1) : ?> - + + show_urls_images_backend == 1) : ?> +
- + form->renderField('images'); ?> + form->getGroup('images') as $field) : ?> + renderField(); ?> +
- + form->getGroup('urls') as $field) : ?> + renderField(); ?> +
- - show_urls_images_backend == 1) : ?> - + show_options = $params->show_article_options; ?> + + + + show_publishing_options == 1) : ?> +
- form->getControlGroup('images'); ?> - form->getGroup('images') as $field) : ?> - getControlGroup(); ?> - +
- form->getGroup('urls') as $field) : ?> - getControlGroup(); ?> - +
+ loadTemplate('associations'); ?> @@ -145,9 +150,6 @@ - show_options = $params->show_article_options; ?> - - canDo->get('core.admin')) : ?> form->renderFieldset('editorConfig'); ?> @@ -164,6 +166,7 @@ + diff --git a/administrator/components/com_content/views/article/tmpl/modal.php b/administrator/components/com_content/views/article/tmpl/modal.php index 2352299cea96e..c1a1448d6feda 100644 --- a/administrator/components/com_content/views/article/tmpl/modal.php +++ b/administrator/components/com_content/views/article/tmpl/modal.php @@ -11,6 +11,7 @@ JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); +// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__. $function = JFactory::getApplication()->input->getCmd('function', 'jEditArticle_' . (int) $this->item->id); // Function to update input title when changed diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php index 9f58183127379..accbcc4ae9243 100644 --- a/administrator/components/com_content/views/article/view.html.php +++ b/administrator/components/com_content/views/article/view.html.php @@ -16,12 +16,34 @@ */ class ContentViewArticle extends JViewLegacy { + /** + * The JForm object + * + * @var JForm + */ protected $form; + /** + * The active item + * + * @var object + */ protected $item; + /** + * The model state + * + * @var object + */ protected $state; + /** + * The actions the user is authorised to perform + * + * @var JObject + */ + protected $canDo; + /** * Execute and display a template script. * @@ -36,14 +58,12 @@ public function display($tpl = null) if ($this->getLayout() == 'pagebreak') { // TODO: This is really dogy - should change this one day. - $input = JFactory::getApplication()->input; - $eName = $input->getCmd('e_name'); - $eName = preg_replace('#[^A-Z0-9\-\_\[\]]#i', '', $eName); - $document = JFactory::getDocument(); - $document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); + $eName = JFactory::getApplication()->input->getCmd('e_name'); + $eName = preg_replace('#[^A-Z0-9\-\_\[\]]#i', '', $eName); + $this->document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); $this->eName = &$eName; - parent::display($tpl); - return; + + return parent::display($tpl); } $this->form = $this->get('Form'); @@ -55,17 +75,27 @@ public function display($tpl = null) if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); + return false; } - if ($this->getLayout() == 'modal') + // If we are forcing a language in modal (used for associations). + if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) { + // Set the language field to the forcedLanguage and disable changing it. + $this->form->setValue('language', null, $forcedLanguage); $this->form->setFieldAttribute('language', 'readonly', 'true'); - $this->form->setFieldAttribute('catid', 'readonly', 'true'); + + // Only allow to select categories with All language or with the forced language. + $this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage); + + // Only allow to select tags with All language or with the forced language. + $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } $this->addToolbar(); - parent::display($tpl); + + return parent::display($tpl); } /** @@ -79,7 +109,7 @@ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); - $userId = $user->get('id'); + $userId = $user->id; $isNew = ($this->item->id == 0); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); @@ -101,20 +131,19 @@ protected function addToolbar() } else { - // Can't save the record if it's checked out. - if (!$checkedOut) + // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. + $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId); + + // Can't save the record if it's checked out and editable + if (!$checkedOut && $itemEditable) { - // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. - if ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId)) + JToolbarHelper::apply('article.apply'); + JToolbarHelper::save('article.save'); + + // We can save this record, but check the create permission to see if we can return to make a new one. + if ($canDo->get('core.create')) { - JToolbarHelper::apply('article.apply'); - JToolbarHelper::save('article.save'); - - // We can save this record, but check the create permission to see if we can return to make a new one. - if ($canDo->get('core.create')) - { - JToolbarHelper::save2new('article.save2new'); - } + JToolbarHelper::save2new('article.save2new'); } } @@ -124,7 +153,7 @@ protected function addToolbar() JToolbarHelper::save2copy('article.save2copy'); } - if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) + if ($this->state->params->get('save_history', 0) && $itemEditable) { JToolbarHelper::versions('com_content.article', $this->item->id); } diff --git a/administrator/components/com_content/views/articles/tmpl/default.php b/administrator/components/com_content/views/articles/tmpl/default.php index 9b2876b9a3760..93ff90241bf7a 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 = $this->escape($this->state->get('list.ordering')); +$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; $columns = 10; @@ -68,12 +68,12 @@ - - - - - - + + + + + + @@ -86,6 +86,16 @@ + vote) : ?> + + + + + + + + + @@ -189,18 +199,28 @@ - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + created, JText::_('DATE_FORMAT_LC4')); ?> - - hits; ?> + + + hits; ?> + + vote) : ?> + + + rating_count; ?> + + + + + rating; ?> + + + id; ?> diff --git a/administrator/components/com_content/views/articles/tmpl/default_batch.php b/administrator/components/com_content/views/articles/tmpl/default_batch.php deleted file mode 100644 index 5bff3050cc0b9..0000000000000 --- a/administrator/components/com_content/views/articles/tmpl/default_batch.php +++ /dev/null @@ -1,58 +0,0 @@ -state->get('filter.published'); -?> - diff --git a/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php b/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php index dbb91d518fad1..19d4fbd1a1a4a 100644 --- a/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php +++ b/administrator/components/com_content/views/articles/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_content/views/articles/tmpl/modal.php b/administrator/components/com_content/views/articles/tmpl/modal.php index 3748e2bb7e72b..3bf547948025b 100644 --- a/administrator/components/com_content/views/articles/tmpl/modal.php +++ b/administrator/components/com_content/views/articles/tmpl/modal.php @@ -16,7 +16,7 @@ JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } -require_once JPATH_ROOT . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_ROOT . '/components/com_content/helpers/route.php'); // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -55,7 +55,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -120,17 +120,13 @@ escape($item->access_level); ?> - - language == '*'): ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + + created, JText::_('DATE_FORMAT_LC4')); ?> - + id; ?> diff --git a/administrator/components/com_content/views/articles/view.html.php b/administrator/components/com_content/views/articles/view.html.php index f72919292456a..fa42e31ed8c3e 100644 --- a/administrator/components/com_content/views/articles/view.html.php +++ b/administrator/components/com_content/views/articles/view.html.php @@ -16,18 +16,61 @@ */ class ContentViewArticles extends JViewLegacy { + /** + * The item authors + * + * @var stdClass + */ + protected $authors; + + /** + * An array of items + * + * @var array + */ protected $items; + /** + * The pagination object + * + * @var JPagination + */ protected $pagination; + /** + * The model state + * + * @var object + */ protected $state; + /** + * Form object for search filters + * + * @var JForm + */ + public $filterForm; + + /** + * The active search filters + * + * @var array + */ + public $activeFilters; + + /** + * The sidebar markup + * + * @var string + */ + protected $sidebar; + /** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * - * @return void + * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { @@ -42,6 +85,7 @@ public function display($tpl = null) $this->authors = $this->get('Authors'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); + $this->vote = JPluginHelper::isEnabled('content', 'vote'); // Check for errors. if (count($errors = $this->get('Errors'))) @@ -51,20 +95,19 @@ public function display($tpl = null) return false; } - // Levels filter. - $options = array(); - $options[] = JHtml::_('select.option', '1', JText::_('J1')); - $options[] = JHtml::_('select.option', '2', JText::_('J2')); - $options[] = JHtml::_('select.option', '3', JText::_('J3')); - $options[] = JHtml::_('select.option', '4', JText::_('J4')); - $options[] = JHtml::_('select.option', '5', JText::_('J5')); - $options[] = JHtml::_('select.option', '6', JText::_('J6')); - $options[] = JHtml::_('select.option', '7', JText::_('J7')); - $options[] = JHtml::_('select.option', '8', JText::_('J8')); - $options[] = JHtml::_('select.option', '9', JText::_('J9')); - $options[] = JHtml::_('select.option', '10', JText::_('J10')); - - $this->f_levels = $options; + // Levels filter - Used in Hathor. + $this->f_levels = array( + JHtml::_('select.option', '1', JText::_('J1')), + JHtml::_('select.option', '2', JText::_('J2')), + JHtml::_('select.option', '3', JText::_('J3')), + JHtml::_('select.option', '4', JText::_('J4')), + JHtml::_('select.option', '5', JText::_('J5')), + JHtml::_('select.option', '6', JText::_('J6')), + JHtml::_('select.option', '7', JText::_('J7')), + JHtml::_('select.option', '8', JText::_('J8')), + JHtml::_('select.option', '9', JText::_('J9')), + JHtml::_('select.option', '10', JText::_('J10')), + ); // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -90,7 +133,7 @@ public function display($tpl = null) } } - parent::display($tpl); + return parent::display($tpl); } /** @@ -110,7 +153,7 @@ 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'); } @@ -135,7 +178,6 @@ protected function addToolbar() && $user->authorise('core.edit', 'com_content') && $user->authorise('core.edit.state', 'com_content')) { - $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php index cbc40e0bb0eef..198844f1a5a8b 100644 --- a/administrator/components/com_content/views/featured/tmpl/default.php +++ b/administrator/components/com_content/views/featured/tmpl/default.php @@ -17,10 +17,11 @@ $user = JFactory::getUser(); $userId = $user->get('id'); -$listOrder = $this->escape($this->state->get('list.ordering')); +$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_content.article'); $saveOrder = $listOrder == 'fp.ordering'; +$columns = 10; if ($saveOrder) { @@ -77,6 +78,16 @@ + vote) : ?> + + + + + + + + + @@ -84,7 +95,7 @@ - + pagination->getListFooter(); ?> @@ -149,7 +160,7 @@ language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + escape($item->title); ?> escape($item->title); ?> @@ -174,18 +185,28 @@ - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + created, JText::_('DATE_FORMAT_LC4')); ?> + hits; ?> + + vote) : ?> + + + rating_count; ?> + + + + + rating; ?> + + + id; ?> diff --git a/administrator/components/com_content/views/featured/view.html.php b/administrator/components/com_content/views/featured/view.html.php index d47b64a54b258..d7cb111775345 100644 --- a/administrator/components/com_content/views/featured/view.html.php +++ b/administrator/components/com_content/views/featured/view.html.php @@ -16,18 +16,61 @@ */ class ContentViewFeatured extends JViewLegacy { + /** + * The item authors + * + * @var stdClass + */ + protected $authors; + + /** + * An array of items + * + * @var array + */ protected $items; + /** + * The pagination object + * + * @var JPagination + */ protected $pagination; + /** + * The model state + * + * @var object + */ protected $state; + /** + * Form object for search filters + * + * @var JForm + */ + public $filterForm; + + /** + * The active search filters + * + * @var array + */ + public $activeFilters; + + /** + * The sidebar markup + * + * @var string + */ + protected $sidebar; + /** * Display the view * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * - * @return void + * @return mixed A string if successful, otherwise an Error object. */ public function display($tpl = null) { @@ -39,6 +82,7 @@ public function display($tpl = null) $this->authors = $this->get('Authors'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); + $this->vote = JPluginHelper::isEnabled('content', 'vote'); // Check for errors. if (count($errors = $this->get('Errors'))) @@ -48,24 +92,24 @@ public function display($tpl = null) return false; } - // Levels filter. - $options = array(); - $options[] = JHtml::_('select.option', '1', JText::_('J1')); - $options[] = JHtml::_('select.option', '2', JText::_('J2')); - $options[] = JHtml::_('select.option', '3', JText::_('J3')); - $options[] = JHtml::_('select.option', '4', JText::_('J4')); - $options[] = JHtml::_('select.option', '5', JText::_('J5')); - $options[] = JHtml::_('select.option', '6', JText::_('J6')); - $options[] = JHtml::_('select.option', '7', JText::_('J7')); - $options[] = JHtml::_('select.option', '8', JText::_('J8')); - $options[] = JHtml::_('select.option', '9', JText::_('J9')); - $options[] = JHtml::_('select.option', '10', JText::_('J10')); - - $this->f_levels = $options; + // Levels filter - Used in Hathor. + $this->f_levels = array( + JHtml::_('select.option', '1', JText::_('J1')), + JHtml::_('select.option', '2', JText::_('J2')), + JHtml::_('select.option', '3', JText::_('J3')), + JHtml::_('select.option', '4', JText::_('J4')), + JHtml::_('select.option', '5', JText::_('J5')), + JHtml::_('select.option', '6', JText::_('J6')), + JHtml::_('select.option', '7', JText::_('J7')), + JHtml::_('select.option', '8', JText::_('J8')), + JHtml::_('select.option', '9', JText::_('J9')), + JHtml::_('select.option', '10', JText::_('J10')), + ); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - parent::display($tpl); + + return parent::display($tpl); } /** @@ -86,6 +130,7 @@ protected function addToolbar() { JToolbarHelper::addNew('article.add'); } + if ($canDo->get('core.edit')) { JToolbarHelper::editList('article.edit'); diff --git a/administrator/components/com_contenthistory/contenthistory.php b/administrator/components/com_contenthistory/contenthistory.php index 5e76938a84ef3..58de68d98de01 100644 --- a/administrator/components/com_contenthistory/contenthistory.php +++ b/administrator/components/com_contenthistory/contenthistory.php @@ -12,7 +12,7 @@ // Disallow unauthenticated users if (JFactory::getUser()->guest) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Contenthistory', array('base_path' => JPATH_COMPONENT_ADMINISTRATOR)); diff --git a/administrator/components/com_contenthistory/controllers/history.php b/administrator/components/com_contenthistory/controllers/history.php index 2cd1108e441fc..d5670725a6579 100644 --- a/administrator/components/com_contenthistory/controllers/history.php +++ b/administrator/components/com_contenthistory/controllers/history.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Contenthistory list controller class. * @@ -40,8 +42,7 @@ public function delete() $model = $this->getModel(); // Make sure the item ids are integers - jimport('joomla.utilities.arrayhelper'); - JArrayHelper::toInteger($cid); + $cid = ArrayHelper::toInteger($cid); // Remove the items. if ($model->delete($cid)) @@ -103,8 +104,7 @@ public function keep() $model = $this->getModel(); // Make sure the item ids are integers - jimport('joomla.utilities.arrayhelper'); - JArrayHelper::toInteger($cid); + $cid = ArrayHelper::toInteger($cid); // Remove the items. if ($model->keep($cid)) diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php index f18da818c0fcd..e35a8033d4591 100644 --- a/administrator/components/com_contenthistory/helpers/contenthistory.php +++ b/administrator/components/com_contenthistory/helpers/contenthistory.php @@ -260,7 +260,7 @@ public static function loadLanguageFiles($typeAlias) $lang->load($component, JPATH_ADMINISTRATOR, null, false, true) || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true); - // Force loading of back-end global language file + // Force loading of backend global language file $lang->load('joomla', JPath::clean(JPATH_ADMINISTRATOR), null, false, true); } } diff --git a/administrator/components/com_contenthistory/helpers/html/textdiff.php b/administrator/components/com_contenthistory/helpers/html/textdiff.php index be001bf16cf18..8e63c6de8d58c 100644 --- a/administrator/components/com_contenthistory/helpers/html/textdiff.php +++ b/administrator/components/com_contenthistory/helpers/html/textdiff.php @@ -41,9 +41,9 @@ public static function textdiff($containerId) // Depends on jQuery UI JHtml::_('bootstrap.framework'); - JHtml::_('script', 'com_contenthistory/diff_match_patch.js', false, true); - JHtml::_('script', 'com_contenthistory/jquery.pretty-text-diff.min.js', false, true); - JHtml::_('stylesheet', 'com_contenthistory/jquery.pretty-text-diff.css', false, true, false); + JHtml::_('script', 'com_contenthistory/diff_match_patch.js', array('version' => 'auto', 'relative' => true)); + JHtml::_('script', 'com_contenthistory/jquery.pretty-text-diff.min.js', array('version' => 'auto', 'relative' => true)); + JHtml::_('stylesheet', 'com_contenthistory/jquery.pretty-text-diff.css', array('version' => 'auto', 'relative' => true)); // Attach diff to document JFactory::getDocument()->addScriptDeclaration(" diff --git a/administrator/components/com_contenthistory/models/compare.php b/administrator/components/com_contenthistory/models/compare.php index f1847762ae03c..662b429e558f7 100644 --- a/administrator/components/com_contenthistory/models/compare.php +++ b/administrator/components/com_contenthistory/models/compare.php @@ -52,8 +52,14 @@ public function getItems() return false; } + $user = JFactory::getUser(); + // Access check - if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table1->ucm_item_id)) + if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table1->ucm_item_id) || $this->canEdit($table1)) + { + $return = true; + } + else { $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); @@ -61,18 +67,85 @@ public function getItems() } // All's well, process the records - foreach (array($table1, $table2) as $table) + if ($return == true) { - $object = new stdClass; - $object->data = ContenthistoryHelper::prepareData($table); - $object->version_note = $table->version_note; - $object->save_date = $table->save_date; - $result[] = $object; - } + foreach (array($table1, $table2) as $table) + { + $object = new stdClass; + $object->data = ContenthistoryHelper::prepareData($table); + $object->version_note = $table->version_note; + + // Let's use custom calendars when present + $object->save_date = JHtml::_('date', $table->save_date, 'Y-m-d H:i:s'); + + $dateProperties = array ( + 'modified_time', + 'created_time', + 'modified', + 'created', + 'checked_out_time', + 'publish_up', + 'publish_down', + ); + + foreach ($dateProperties as $dateProperty) + { + if (array_key_exists($dateProperty, $object->data) && $object->data->$dateProperty->value != '0000-00-00 00:00:00') + { + $object->data->$dateProperty->value = JHtml::_('date', $object->data->$dateProperty->value, 'Y-m-d H:i:s'); + } + } + + $result[] = $object; + } - return $result; + return $result; + } } return false; } + + /** + * Method to test whether a record is editable + * + * @param JTableContenthistory $record A JTable object. + * + * @return boolean True if allowed to edit the record. Defaults to the permission set in the component. + * + * @since 3.6 + */ + protected function canEdit($record) + { + $result = false; + + if (!empty($record->ucm_type_id)) + { + // Check that the type id matches the type alias + $typeAlias = JFactory::getApplication()->input->get('type_alias'); + + /** @var JTableContenttype $contentTypeTable */ + $contentTypeTable = JTable::getInstance('Contenttype', 'JTable'); + + if ($contentTypeTable->getTypeId($typeAlias) == $record->ucm_type_id) + { + /** + * Make sure user has edit privileges for this content item. Note that we use edit permissions + * for the content item, not delete permissions for the content history row. + */ + $user = JFactory::getUser(); + $result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id); + } + + // Finally try session (this catches edit.own case too) + if (!$result) + { + $contentTypeTable->load($record->ucm_type_id); + $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); + $result = in_array((int) $record->ucm_item_id, $typeEditables); + } + } + + return $result; + } } diff --git a/administrator/components/com_contenthistory/models/history.php b/administrator/components/com_contenthistory/models/history.php index d91429362a167..f6db2c5f947fa 100644 --- a/administrator/components/com_contenthistory/models/history.php +++ b/administrator/components/com_contenthistory/models/history.php @@ -40,12 +40,11 @@ public function __construct($config = array()) } /** - * Method to test whether a history record can be deleted. Note that we check whether we have edit permissions - * for the content item row. + * Method to test whether a record is editable * * @param JTableContenthistory $record A JTable object. * - * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * @return boolean True if allowed to edit the record. Defaults to the permission set in the component. * * @since 3.2 */ @@ -70,11 +69,34 @@ protected function canEdit($record) $user = JFactory::getUser(); $result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id); } + + // Finally try session (this catches edit.own case too) + if (!$result) + { + $contentTypeTable->load($record->ucm_type_id); + $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); + $result = in_array((int) $record->ucm_item_id, $typeEditables); + } } return $result; } + /** + * Method to test whether a history record can be deleted. Note that we check whether we have edit permissions + * for the content item row. + * + * @param JTableContenthistory $record A JTable object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 3.6 + */ + protected function canDelete($record) + { + return canEdit($record); + } + /** * Method to delete one or more records from content history table. * @@ -147,6 +169,7 @@ public function delete(&$pks) public function getItems() { $items = parent::getItems(); + $user = JFactory::getUser(); if ($items === false) { @@ -171,15 +194,16 @@ public function getItems() } // Access check - if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $items[0]->ucm_item_id)) + if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $items[0]->ucm_item_id) || $this->canEdit($items[0])) + { + return $items; + } + else { $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); return false; } - - // All good, return the items array - return $items; } /** @@ -274,7 +298,7 @@ public function keep(&$pks) * * @since 3.2 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'h.save_date', $direction = 'DESC') { $input = JFactory::getApplication()->input; $itemId = $input->get('item_id', 0, 'integer'); @@ -291,7 +315,7 @@ protected function populateState($ordering = null, $direction = null) $this->setState('params', $params); // List state information. - parent::populateState('h.save_date', 'DESC'); + parent::populateState($ordering, $direction); } /** diff --git a/administrator/components/com_contenthistory/models/preview.php b/administrator/components/com_contenthistory/models/preview.php index c93e16bbfd205..b4d603fc197ac 100644 --- a/administrator/components/com_contenthistory/models/preview.php +++ b/administrator/components/com_contenthistory/models/preview.php @@ -46,8 +46,14 @@ public function getItem() return false; } + $user = JFactory::getUser(); + // Access check - if (!JFactory::getUser()->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table->ucm_item_id)) + if ($user->authorise('core.edit', $contentTypeTable->type_alias . '.' . (int) $table->ucm_item_id) || $this->canEdit($table)) + { + $return = true; + } + else { $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); @@ -55,10 +61,76 @@ public function getItem() } // Good to go, finish processing the data - $result = new stdClass; - $result->save_date = $table->save_date; - $result->version_note = $table->version_note; - $result->data = ContenthistoryHelper::prepareData($table); + if ($return == true) + { + $result = new stdClass; + $result->version_note = $table->version_note; + $result->data = ContenthistoryHelper::prepareData($table); + + // Let's use custom calendars when present + $result->save_date = JHtml::_('date', $table->save_date, 'Y-m-d H:i:s'); + + $dateProperties = array ( + 'modified_time', + 'created_time', + 'modified', + 'created', + 'checked_out_time', + 'publish_up', + 'publish_down', + ); + + foreach ($dateProperties as $dateProperty) + { + if (array_key_exists($dateProperty, $result->data) && $result->data->$dateProperty->value != '0000-00-00 00:00:00') + { + $result->data->$dateProperty->value = JHtml::_('date', $result->data->$dateProperty->value, 'Y-m-d H:i:s'); + } + } + + return $result; + } + } + + /** + * Method to test whether a record is editable + * + * @param JTableContenthistory $record A JTable object. + * + * @return boolean True if allowed to edit the record. Defaults to the permission set in the component. + * + * @since 3.6 + */ + protected function canEdit($record) + { + $result = false; + + if (!empty($record->ucm_type_id)) + { + // Check that the type id matches the type alias + $typeAlias = JFactory::getApplication()->input->get('type_alias'); + + /** @var JTableContenttype $contentTypeTable */ + $contentTypeTable = JTable::getInstance('Contenttype', 'JTable'); + + if ($contentTypeTable->getTypeId($typeAlias) == $record->ucm_type_id) + { + /** + * Make sure user has edit privileges for this content item. Note that we use edit permissions + * for the content item, not delete permissions for the content history row. + */ + $user = JFactory::getUser(); + $result = $user->authorise('core.edit', $typeAlias . '.' . (int) $record->ucm_item_id); + } + + // Finally try session (this catches edit.own case too) + if (!$result) + { + $contentTypeTable->load($record->ucm_type_id); + $typeEditables = (array) JFactory::getApplication()->getUserState(str_replace('.', '.edit.', $contentTypeTable->type_alias) . '.id'); + $result = in_array((int) $record->ucm_item_id, $typeEditables); + } + } return $result; } diff --git a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php index ef41c8eb86592..684a489fd19a6 100644 --- a/administrator/components/com_cpanel/views/cpanel/tmpl/default.php +++ b/administrator/components/com_cpanel/views/cpanel/tmpl/default.php @@ -56,8 +56,7 @@ foreach ($this->modules as $module) { // Get module parameters - $params = new Registry; - $params->loadString($module->params); + $params = new Registry($module->params); $bootstrapSize = $params->get('bootstrap_size'); if (!$bootstrapSize) { diff --git a/administrator/components/com_cpanel/views/cpanel/view.html.php b/administrator/components/com_cpanel/views/cpanel/view.html.php index 189ec63c6d47a..27d8b2399c58d 100644 --- a/administrator/components/com_cpanel/views/cpanel/view.html.php +++ b/administrator/components/com_cpanel/views/cpanel/view.html.php @@ -47,12 +47,6 @@ public function display($tpl = null) // Display the cpanel modules $this->modules = JModuleHelper::getModules('cpanel'); - // Load the RAD layer and count the number of post-installation messages - if (!defined('FOF_INCLUDED')) - { - require_once JPATH_LIBRARIES . '/fof/include.php'; - } - try { $messages_model = FOFModel::getTmpInstance('Messages', 'PostinstallModel')->eid(700); diff --git a/administrator/components/com_fields/access.xml b/administrator/components/com_fields/access.xml new file mode 100644 index 0000000000000..0a1ddce88d5ad --- /dev/null +++ b/administrator/components/com_fields/access.xml @@ -0,0 +1,19 @@ + + +
+ + + + + + +
+
+ + + + + + +
+
diff --git a/administrator/components/com_fields/controller.php b/administrator/components/com_fields/controller.php new file mode 100644 index 0000000000000..4dd5041903367 --- /dev/null +++ b/administrator/components/com_fields/controller.php @@ -0,0 +1,98 @@ +context)) + { + $this->context = $this->input->get('context', 'com_content'); + } + } + + /** + * Typical view method for MVC based architecture + * + * This function is provide as a default implementation, in most cases + * you will need to override it in your own controllers. + * + * @param boolean $cachable If true, the view output will be cached + * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. + * + * @return JControllerLegacy A JControllerLegacy object to support chaining. + * + * @since __DEPLOY_VERSION__ + */ + public function display($cachable = false, $urlparams = false) + { + // Get the document object. + $document = JFactory::getDocument(); + + // Set the default view name and format from the Request. + $vName = $this->input->get('view', 'fields'); + $vFormat = $document->getType(); + $lName = $this->input->get('layout', 'default', 'string'); + $id = $this->input->getInt('id'); + + // Check for edit form. + if ($vName == 'field' && $lName == 'edit' && !$this->checkEditId('com_fields.edit.field', $id)) + { + // Somehow the person just went to the form - we don't allow that. + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setMessage($this->getError(), 'error'); + $this->setRedirect(JRoute::_('index.php?option=com_fields&view=fields&context=' . $this->context, false)); + + return false; + } + + // Get and render the view. + if ($view = $this->getView($vName, $vFormat)) + { + // Get the model for the view. + $model = $this->getModel( + $vName, 'FieldsModel', array( + 'name' => $vName . '.' . substr($this->context, 4) + ) + ); + + // Push the model into the view (as default). + $view->setModel($model, true); + $view->setLayout($lName); + + // Push document object into the view. + $view->document = $document; + + FieldsHelperInternal::addSubmenu($model->getState('filter.context')); + $view->display(); + } + + return $this; + } +} diff --git a/administrator/components/com_fields/controllers/field.php b/administrator/components/com_fields/controllers/field.php new file mode 100644 index 0000000000000..b65977738a089 --- /dev/null +++ b/administrator/components/com_fields/controllers/field.php @@ -0,0 +1,214 @@ +internalContext = $this->input->getCmd('context', 'com_content.article'); + $parts = FieldsHelper::extract($this->internalContext); + $this->component = $parts ? $parts[0] : null; + } + + /** + * Stores the form data into the user state. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function storeform() + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + $app = JFactory::getApplication(); + $data = $this->input->get($this->input->get('formcontrol', 'jform'), array(), 'array'); + + $parts = FieldsHelper::extract($this->input->getCmd('context')); + + if ($parts) + { + $app->setUserState($parts[0] . '.edit.' . $parts[1] . '.data', $data); + } + + if ($this->input->get('userstatevariable')) + { + $app->setUserState($this->input->get('userstatevariable'), $data); + } + + $app->redirect(base64_decode($this->input->get->getBase64('return'))); + $app->close(); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + protected function allowAdd($data = array()) + { + return JFactory::getUser()->authorise('core.create', $this->component); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'parent_id') + { + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $user = JFactory::getUser(); + $userId = $user->get('id'); + + // Check general edit permission first. + if ($user->authorise('core.edit', $this->component)) + { + return true; + } + + // Check specific edit permission. + if ($user->authorise('core.edit', $this->internalContext . '.field.' . $recordId)) + { + return true; + } + + // Fallback on edit.own. + // First test if the permission is available. + if ($user->authorise('core.edit.own', $this->internalContext . '.field.' . $recordId) || $user->authorise('core.edit.own', $this->component)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_user_id']) ? $data['created_user_id'] : 0; + + if (empty($ownerId) && $recordId) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + + $ownerId = $record->created_user_id; + } + + // If the owner matches 'me' then do the test. + if ($ownerId == $userId) + { + return true; + } + } + + return false; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since __DEPLOY_VERSION__ + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Field'); + + // Preset the redirect + $this->setRedirect('index.php?option=com_fields&view=fields&context=' . $this->internalContext); + + return parent::batch($model); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since __DEPLOY_VERSION__ + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + return parent::getRedirectToItemAppend($recordId) . '&context=' . $this->internalContext; + } + + /** + * Gets the URL arguments to append to a list redirect. + * + * @return string The arguments to append to the redirect URL. + * + * @since __DEPLOY_VERSION__ + */ + protected function getRedirectToListAppend() + { + return parent::getRedirectToListAppend() . '&context=' . $this->internalContext; + } + + /** + * Function that allows child controller access to model data after the data has been saved. + * + * @param JModelLegacy $model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + $item = $model->getItem(); + + if (isset($item->params) && is_array($item->params)) + { + $registry = new Registry; + $registry->loadArray($item->params); + $item->params = (string) $registry; + } + + return; + } +} diff --git a/administrator/components/com_fields/controllers/fields.php b/administrator/components/com_fields/controllers/fields.php new file mode 100644 index 0000000000000..a7c7ca53d2880 --- /dev/null +++ b/administrator/components/com_fields/controllers/fields.php @@ -0,0 +1,93 @@ +setRedirect( + JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . + '&context=' . $this->input->getCmd('context', 'com_content.article'), false + ) + ); + + return $return; + } + + /** + * Removes an item + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function delete() + { + $return = parent::delete(); + + $this->setRedirect( + JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . + '&context=' . $this->input->getCmd('context', 'com_content.article'), false + ) + ); + + return $return; + } + + /** + * Method to publish a list of items + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function publish() + { + $return = parent::publish(); + + $this->setRedirect( + JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . + '&context=' . $this->input->getCmd('context', 'com_content.article'), false + ) + ); + + return $return; + } + + /** + * Proxy for getModel. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config The array of possible config values. Optional. + * + * @return JModel + * + * @since __DEPLOY_VERSION__ + */ + public function getModel($name = 'Field', $prefix = 'FieldsModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } +} diff --git a/administrator/components/com_fields/fields.php b/administrator/components/com_fields/fields.php new file mode 100644 index 0000000000000..13bb1ee6cc4a8 --- /dev/null +++ b/administrator/components/com_fields/fields.php @@ -0,0 +1,25 @@ +input; + +$parts = explode('.', $input->get('context')); +$component = $parts[0]; + +if (!JFactory::getUser()->authorise('core.manage', $component)) +{ + return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); +} + +JLoader::import('components.com_fields.helpers.internal', JPATH_ADMINISTRATOR); + +$controller = JControllerLegacy::getInstance('Fields'); +$controller->execute($input->get('task')); +$controller->redirect(); diff --git a/administrator/components/com_fields/fields.xml b/administrator/components/com_fields/fields.xml new file mode 100644 index 0000000000000..3036577069a21 --- /dev/null +++ b/administrator/components/com_fields/fields.xml @@ -0,0 +1,38 @@ + + + com_fields + Joomla! Project + March 2016 + (C) 2005 - 2016 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + __DEPLOY_VERSION__ + COM_FIELDS_XML_DESCRIPTION + + controller.php + fields.php + controllers + layouts + + + + access.xml + controller.php + fields.php + controllers + helpers + libraries + models + sql + tables + views + + + language/en-GB.com_fields.ini + language/en-GB.com_fields.sys.ini + + + + + diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php new file mode 100644 index 0000000000000..1246e4611e193 --- /dev/null +++ b/administrator/components/com_fields/helpers/fields.php @@ -0,0 +1,586 @@ + true) + ); + + self::$fieldsCache->setState('filter.published', 1); + self::$fieldsCache->setState('list.limit', 0); + } + + if (is_array($item)) + { + $item = (object) $item; + } + if (JLanguageMultilang::isEnabled() && isset($item->language) && $item->language !='*') + { + self::$fieldsCache->setState('filter.language', array('*', $item->language)); + } + self::$fieldsCache->setState('filter.context', $context); + + /* + * If item has assigned_cat_ids parameter display only fields which + * belong to the category + */ + if ($item && (isset($item->catid) || isset($item->fieldscatid))) + { + $assignedCatIds = isset($item->catid) ? $item->catid : $item->fieldscatid; + self::$fieldsCache->setState('filter.assigned_cat_ids', is_array($assignedCatIds) ? $assignedCatIds : explode(',', $assignedCatIds)); + } + + $fields = self::$fieldsCache->getItems(); + + if ($item && isset($item->id)) + { + if (self::$fieldCache === null) + { + self::$fieldCache = JModelLegacy::getInstance('Field', 'FieldsModel', array( + 'ignore_request' => true) + ); + } + + $new = array(); + + foreach ($fields as $key => $original) + { + /* + * Doing a clone, otherwise fields for different items will + * always reference to the same object + */ + $field = clone $original; + + if ($valuesToOverride && key_exists($field->alias, $valuesToOverride)) + { + $field->value = $valuesToOverride[$field->alias]; + } + elseif ($valuesToOverride && key_exists($field->id, $valuesToOverride)) + { + $field->value = $valuesToOverride[$field->id]; + } + else + { + $field->value = self::$fieldCache->getFieldValue($field->id, $field->context, $item->id); + } + + if (! $field->value) + { + $field->value = $field->default_value; + } + + $field->rawvalue = $field->value; + + if ($prepareValue) + { + $value = null; + + /* + * On before field prepare + * Event allow plugins to modfify the output of the field before it is prepared + */ + $dispatcher = JEventDispatcher::getInstance(); + $dispatcher->trigger('onFieldBeforePrepare', array($context, $item, &$field)); + + // Prepare the value from the type layout + $value = self::render($context, 'field.prepare.' . $field->type, array('field' => $field)); + + // If the value is empty, render the base layout + if (! $value) + { + $value = self::render($context, 'field.prepare.base', array('field' => $field)); + } + + /* + * On after field render + * Event allow plugins to modfify the output of the prepared field + */ + $dispatcher->trigger('onFieldAfterPrepare', array($context, $item, $field, &$value)); + $field->value = $value; + } + + $new[$key] = $field; + } + + $fields = $new; + } + + return $fields; + } + + /** + * Renders the layout file and data on the context and does a fall back to + * Fields afterwards. + * + * @param string $context The context of the content passed to the helper + * @param string $layoutFile layoutFile + * @param array $displayData displayData + * + * @return NULL|string + * + * @since __DEPLOY_VERSION__ + */ + public static function render($context, $layoutFile, $displayData) + { + $value = null; + + /* + * Because the layout refreshes the paths before the render function is + * called, so there is no way to load the layout overrides in the order + * template -> context -> fields. + * If there is no override in the context then we need to call the + * layout from Fields. + */ + if ($parts = self::extract($context)) + { + // Trying to render the layout on the component fom the context + $value = JLayoutHelper::render($layoutFile, $displayData, null, array('component' => $parts[0], 'client' => 0)); + } + + if (!$value) + { + // Trying to render the layout on Fields itself + $value = JLayoutHelper::render($layoutFile, $displayData, null, array('component' => 'com_fields','client' => 0)); + } + + if (!$value) + { + // Trying to render the layout of the plugins + foreach (JFolder::listFolderTree(JPATH_PLUGINS . '/fields', '.', 1) as $folder) + { + $value = JLayoutHelper::render($layoutFile, $displayData, $folder['fullname'] . '/layouts'); + } + } + + return $value; + } + + /** + * PrepareForm + * + * @param string $context The context of the content passed to the helper + * @param JForm $form form + * @param object $data data. + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public static function prepareForm($context, JForm $form, $data) + { + // Extracting the component and section + $parts = self::extract($context); + + if (! $parts) + { + return true; + } + + // When no fields available return here + $fields = self::getFields($parts[0] . '.' . $parts[1], new JObject); + + if (! $fields) + { + return true; + } + + $component = $parts[0]; + $section = $parts[1]; + + $assignedCatids = isset($data->catid) ? $data->catid : (isset($data->fieldscatid) ? $data->fieldscatid : null); + + if (!$assignedCatids && $form->getField('catid')) + { + // Choose the first category available + $xml = new DOMDocument; + $xml->loadHTML($form->getField('catid')->__get('input')); + $options = $xml->getElementsByTagName('option'); + + if ($firstChoice = $options->item(0)) + { + $assignedCatids = $firstChoice->getAttribute('value'); + $data->fieldscatid = $assignedCatids; + } + } + + /* + * If there is a catid field we need to reload the page when the catid + * is changed + */ + if ($form->getField('catid') && $parts[0] != 'com_fields') + { + // The uri to submit to + $uri = clone JUri::getInstance('index.php'); + + /* + * Removing the catid parameter from the actual url and set it as + * return + */ + $returnUri = clone JUri::getInstance(); + $returnUri->setVar('catid', null); + $uri->setVar('return', base64_encode($returnUri->toString())); + + // Setting the options + $uri->setVar('option', 'com_fields'); + $uri->setVar('task', 'field.storeform'); + $uri->setVar('context', $parts[0] . '.' . $parts[1]); + $uri->setVar('formcontrol', $form->getFormControl()); + $uri->setVar('view', null); + $uri->setVar('layout', null); + + /* + * Setting the onchange event to reload the page when the category + * has changed + */ + $form->setFieldAttribute('catid', 'onchange', "categoryHasChanged(this);"); + JFactory::getDocument()->addScriptDeclaration( + "function categoryHasChanged(element){ + var cat = jQuery(element); + if (cat.val() == '" . $assignedCatids . "')return; + jQuery('input[name=task]').val('field.storeform'); + element.form.action='" . $uri . "'; + element.form.submit(); + } + jQuery( document ).ready(function() { + var formControl = '#" . $form->getFormControl() . "_catid'; + if (!jQuery(formControl).val() != '" . $assignedCatids . "'){jQuery(formControl).val('" . $assignedCatids . "');} + });"); + } + + // Getting the fields + $fields = self::getFields($parts[0] . '.' . $parts[1], $data); + + if (!$fields) + { + return true; + } + + FieldsHelperInternal::loadPlugins(); + + // Creating the dom + $xml = new DOMDocument('1.0', 'UTF-8'); + $fieldsNode = $xml->appendChild(new DOMElement('form'))->appendChild(new DOMElement('fields')); + $fieldsNode->setAttribute('name', 'params'); + + // Organizing the fields according to their category + $fieldsPerCategory = array( + 0 => array() + ); + + foreach ($fields as $field) + { + if (! key_exists($field->catid, $fieldsPerCategory)) + { + $fieldsPerCategory[$field->catid] = array(); + } + + $fieldsPerCategory[$field->catid][] = $field; + } + + // On the front, sometimes the admin fields path is not included + JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/fields'); + + // Looping trough the categories + foreach ($fieldsPerCategory as $catid => $catFields) + { + if (! $catFields) + { + continue; + } + + // Defining the field set + $fieldset = $fieldsNode->appendChild(new DOMElement('fieldset')); + $fieldset->setAttribute('name', 'fields-' . $catid); + $fieldset->setAttribute('addfieldpath', '/administrator/components/' . $component . '/models/fields'); + $fieldset->setAttribute('addrulepath', '/administrator/components/' . $component . '/models/rules'); + + $label = ''; + $description = ''; + + if ($catid > 0) + { + /* + * JCategories can't handle com_content with a section, going + * directly to the table + */ + $category = JTable::getInstance('Category'); + $category->load($catid); + + if ($category->id) + { + $label = $category->title; + $description = $category->description; + } + } + + if (! $label || !$description) + { + $lang = JFactory::getLanguage(); + + if (!$label) + { + $key = strtoupper($component . '_FIELDS_' . $section . '_LABEL'); + + if (!$lang->hasKey($key)) + { + $key = 'JGLOBAL_FIELDS'; + } + + $label = JText::_($key); + } + + if (!$description) + { + $key = strtoupper($component . '_FIELDS_' . $section . '_DESC'); + + if ($lang->hasKey($key)) + { + $description = JText::_($key); + } + } + } + + $fieldset->setAttribute('label', $label); + $fieldset->setAttribute('description', strip_tags($description)); + + // Looping trough the fields for that context + foreach ($catFields as $field) + { + // Creating the XML form data + $type = JFormHelper::loadFieldType($field->type); + + if (!$type) + { + continue; + } + + try + { + // Rendering the type + $node = $type->appendXMLFieldTag($field, $fieldset, $form); + + if (!FieldsHelperInternal::canEditFieldValue($field)) + { + $node->setAttribute('disabled', 'true'); + } + + /* + *If the field belongs to a assigned_cat_ids but the + * assigned_cat_ids in the data is not known, set the + * required + * flag to false on any circumstance + */ + if (! $assignedCatids && $field->assigned_cat_ids) + { + $node->setAttribute('required', 'false'); + } + } + catch (Exception $e) + { + JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error'); + } + } + } + + // Loading the XML fields string into the form + $form->load($xml->saveXML()); + + $model = JModelLegacy::getInstance('Field', 'FieldsModel', array( + 'ignore_request' => true) + ); + + if ((!isset($data->id) || !$data->id) && JFactory::getApplication()->input->getCmd('controller') == 'config.display.modules' + && JFactory::getApplication()->isSite()) + { + // Modules on front end editing don't have data and an id set + $data->id = $input->getInt('id'); + } + + // Looping trough the fields again to set the value + if (isset($data->id) && $data->id) + { + foreach ($fields as $field) + { + $value = $model->getFieldValue($field->id, $field->context, $data->id); + + if ($value === null) + { + continue; + } + + // Setting the value on the field + $form->setValue($field->alias, 'params', $value); + } + } + + return true; + } + + /** + * Return a boolean if the actual logged in user can edit the given field value. + * + * @param stdClass $field The field + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public static function canEditFieldValue($field) + { + return JFactory::getUser()->authorise('core.edit.value', $field->context . '.field.' . (int) $field->id); + } + + /** + * Adds Count Items for Category Manager. + * + * @param stdClass[] &$items The field category objects + * + * @return stdClass[] + * + * @since __DEPLOY_VERSION__ + */ + public static function countItems(&$items) + { + $db = JFactory::getDbo(); + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + + $query = $db->getQuery(true); + $query->select('state, count(*) AS count') + ->from($db->quoteName('#__fields')) + ->where('catid = ' . (int) $item->id) + ->group('state'); + $db->setQuery($query); + + $fields = $db->loadObjectList(); + + foreach ($fields as $article) + { + if ($article->state == 1) + { + $item->count_published = $article->count; + } + + if ($article->state == 0) + { + $item->count_unpublished = $article->count; + } + + if ($article->state == 2) + { + $item->count_archived = $article->count; + } + + if ($article->state == -2) + { + $item->count_trashed = $article->count; + } + } + } + + return $items; + } + + /** + * Gets the fields system plugin extension id. + * + * @return int The fields system plugin extension id. + * + * @since __DEPLOY_VERSION__ + */ + public static function getFieldsPluginId() + { + $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('fields')); + $db->setQuery($query); + + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + + return $result; + } +} diff --git a/administrator/components/com_fields/helpers/internal.php b/administrator/components/com_fields/helpers/internal.php new file mode 100644 index 0000000000000..bb54b686eea68 --- /dev/null +++ b/administrator/components/com_fields/helpers/internal.php @@ -0,0 +1,116 @@ +load($component, JPATH_BASE, null, false, true) + || $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true); + + call_user_func(array($cName, 'addSubmenu'), 'fields' . (isset($section) ? '.' . $section : '')); + } + } + } + } + + /** + * Return a boolean if the actual logged in user can edit the given field value. + * + * @param stdClass $field The field + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public static function canEditFieldValue($field) + { + return JFactory::getUser()->authorise('core.edit.value', $field->context . '.field.' . (int) $field->id); + } + + /** + * Loads the fields plugins. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public static function loadPlugins() + { + jimport('joomla.filesystem.folder'); + + foreach (JFolder::listFolderTree(JPATH_PLUGINS . '/fields', '.', 1) as $folder) + { + if (!JPluginHelper::isEnabled('fields', $folder['name'])) + { + continue; + } + + JFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), JPATH_ADMINISTRATOR); + JFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), $folder['fullname']); + JFormHelper::addFieldPath($folder['fullname'] . '/fields'); + } + } +} diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php new file mode 100644 index 0000000000000..b1f56139d6063 --- /dev/null +++ b/administrator/components/com_fields/models/field.php @@ -0,0 +1,813 @@ +typeAlias = JFactory::getApplication()->input->getCmd('context', 'com_content.article') . '.field'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission for the component. + * + * @since __DEPLOY_VERSION__ + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->state != - 2) + { + return; + } + + return JFactory::getUser()->authorise('core.delete', $record->context . '.field.' . (int) $record->id); + } + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission for the component. + * + * @since __DEPLOY_VERSION__ + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + + // Check for existing field. + if (!empty($record->id)) + { + return $user->authorise('core.edit.state', $record->context . '.field.' . (int) $record->id); + } + else + { + return $user->authorise('core.edit.state', $record->context); + } + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success, False on error. + * + * @since __DEPLOY_VERSION__ + */ + public function save($data) + { + $field = null; + + if (isset($data['id']) && $data['id']) + { + $field = $this->getItem($data['id']); + } + + if (! isset($data['assigned_cat_ids'])) + { + $data['assigned_cat_ids'] = array(); + } + else + { + $cats = (array) $data['assigned_cat_ids']; + + foreach ($cats as $key => $c) + { + if (empty($c)) + { + unset($cats[$key]); + } + } + + $data['assigned_cat_ids'] = $cats; + } + + if (!isset($data['label']) && isset($data['params']['label'])) + { + $data['label'] = $data['params']['label']; + + unset($data['params']['label']); + } + + // Alter the title for save as copy + $input = JFactory::getApplication()->input; + + if ($input->get('task') == 'save2copy') + { + $origTable = clone $this->getTable(); + $origTable->load($input->getInt('id')); + + if ($data['title'] == $origTable->title) + { + list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']); + $data['title'] = $title; + $data['alias'] = $alias; + } + else + { + if ($data['alias'] == $origTable->alias) + { + $data['alias'] = ''; + } + } + + $data['state'] = 0; + } + + JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php'); + + // Cast catid to integer for comparison + $catid = (int) $data['catid']; + + // Check if New Category exists + if ($catid > 0) + { + $catid = CategoriesHelper::validateCategoryId($data['catid'], $data['context'] . '.fields'); + } + + // Save New Category + if ($catid === 0 && is_string($data['catid']) && $data['catid'] != '') + { + $table = array(); + $table['title'] = $data['catid']; + $table['parent_id'] = 1; + $table['extension'] = $data['context'] . '.fields'; + $table['language'] = $data['language']; + $table['published'] = 1; + + // Create new category and get catid back + $data['catid'] = CategoriesHelper::createCategory($table); + } + + if ($data['catid'] === '') + { + $data['catid'] = '0'; + } + + $success = parent::save($data); + + // If the options have changed delete the values + if ($success && $field && isset($data['fieldparams']['options']) && isset($field->fieldparams['options'])) + { + $oldParams = json_decode($field->fieldparams['options']); + $newParams = json_decode($data['fieldparams']['options']); + + if (is_object($oldParams) && is_object($newParams) && $oldParams->name != $newParams->name) + { + $query = $this->_db->getQuery(true); + $query->delete('#__fields_values')->where('field_id = ' . (int) $field->id) + ->where("value not in ('" . implode("','", $newParams->name) . "')"); + $this->_db->setQuery($query); + $this->_db->execute(); + } + } + + return $success; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since __DEPLOY_VERSION__ + */ + public function delete(&$pks) + { + $success = parent::delete($pks); + + if ($success) + { + $pks = (array) $pks; + $pks = ArrayHelper::toInteger($pks); + $pks = array_filter($pks); + + if (!empty($pks)) + { + $query = $this->getDbo()->getQuery(true); + + $query ->delete($query->qn('#__fields_values')) + ->where($query->qn('field_id') . ' IN(' . implode(',', $pks) . ')'); + + $this->getDbo()->setQuery($query)->execute(); + } + } + + return $success; + } + + /** + * Method to get a table object, load it if necessary. + * + * @param string $name The table name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $options Configuration array for model. Optional. + * + * @return JTable A JTable object + * + * @since __DEPLOY_VERSION__ + * @throws Exception + */ + public function getTable ($name = 'Field', $prefix = 'FieldsTable', $options = array()) + { + if (strpos(JPATH_COMPONENT, 'com_fields') === false) + { + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables'); + } + + return JTable::getInstance($name, $prefix, $options); + } + + /** + * Stock method to auto-populate the model state. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function populateState() + { + $app = JFactory::getApplication('administrator'); + + // Load the User state. + $pk = $app->input->getInt('id'); + $this->setState($this->getName() . '.id', $pk); + + $context = $app->input->get('context', 'com_content.article'); + $this->setState('field.context', $context); + $parts = FieldsHelper::extract($context); + + // Extract the component name + $this->setState('field.component', $parts[0]); + + // Extract the optional section name + $this->setState('field.section', (count($parts) > 1) ? $parts[1] : null); + + // Load the parameters. + $params = JComponentHelper::getParams('com_fields'); + $this->setState('params', $params); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since __DEPLOY_VERSION__ + */ + public function getItem($pk = null) + { + $result = parent::getItem($pk); + + if ($result) + { + // Prime required properties. + if (empty($result->id)) + { + $result->context = JFactory::getApplication()->input->getCmd('context', $this->getState('field.context')); + } + + if (property_exists($result, 'fieldparams')) + { + $registry = new Registry; + $registry->loadString($result->fieldparams); + $result->fieldparams = $registry->toArray(); + } + + if ($result->assigned_cat_ids) + { + $result->assigned_cat_ids = explode(',', $result->assigned_cat_ids); + } + + // Convert the created and modified dates to local user time for + // display in the form. + $tz = new DateTimeZone(JFactory::getApplication()->get('offset')); + + if ((int) $result->created_time) + { + $date = new JDate($result->created_time); + $date->setTimezone($tz); + + $result->created_time = $date->toSql(true); + } + else + { + $result->created_time = null; + } + + if ((int) $result->modified_time) + { + $date = new JDate($result->modified_time); + $date->setTimezone($tz); + + $result->modified_time = $date->toSql(true); + } + else + { + $result->modified_time = null; + } + } + + return $result; + } + + /** + * Abstract method for getting the form from the model. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * + * @return mixed A JForm object on success, false on failure + * + * @since __DEPLOY_VERSION__ + */ + public function getForm($data = array(), $loadData = true) + { + $context = $this->getState('field.context'); + $jinput = JFactory::getApplication()->input; + + // A workaround to get the context into the model for save requests. + if (empty($context) && isset($data['context'])) + { + $context = $data['context']; + $parts = explode('.', $context); + + $this->setState('field.context', $context); + $this->setState('field.component', $parts[0]); + $this->setState('field.section', isset($parts[1]) ? $parts[1] : ''); + } + + // Get the form. + $form = $this->loadForm( + 'com_fields.field' . $context, 'field', + array( + 'control' => 'jform', + 'load_data' => $loadData, + ) + ); + + if (empty($form)) + { + return false; + } + + // Modify the form based on Edit State access controls. + if (empty($data['context'])) + { + $data['context'] = $context; + } + + if (isset($data['type'])) + { + $parts = explode('.', $jinput->getCmd('context', $this->getState('field.context'))); + $component = $parts[0]; + $this->loadTypeForms($form, $data['type'], $component); + } + + if (!JFactory::getUser()->authorise('core.edit.state', $context . '.field.' . $jinput->get('id'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('state', 'disabled', 'true'); + + // Disable fields while saving. The controller has already verified this is a record you can edit. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('state', 'filter', 'unset'); + } + + return $form; + } + + /** + * A protected method to get a set of ordering conditions. + * + * @param JTable $table A JTable object. + * + * @return array An array of conditions to add to ordering queries. + * + * @since __DEPLOY_VERSION__ + */ + protected function getReorderConditions($table) + { + return 'context = ' . $this->_db->quote($table->context); + } + + /** + * Method to get the data that should be injected in the form. + * + * @return array The default data is an empty array. + * + * @since __DEPLOY_VERSION__ + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $app = JFactory::getApplication(); + $data = $app->getUserState('com_fields.edit.field.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + + // Pre-select some filters (Status, Language, Access) in edit form + // if those have been selected in Category Manager + if (!$data->id) + { + // Check for which context the Category Manager is used and + // get selected fields + $context = substr($app->getUserState('com_fields.fields.filter.context'), 4); + $component = FieldsHelper::extract($context); + $component = $component ? $component[0] : null; + + $filters = (array) $app->getUserState('com_fields.fields.' . $component . '.filter'); + + $data->set('published', $app->input->getInt('published', (! empty($filters['published']) ? $filters['published'] : null))); + $data->set('language', $app->input->getString('language', (! empty($filters['language']) ? $filters['language'] : null))); + $data->set( + 'access', + $app->input->getInt('access', (! empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))) + ); + + // Set the type if available from the request + $data->set('type', $app->input->getWord('type', $data->get('type'))); + } + + if ($data->label && !isset($data->params['label'])) + { + $data->params['label'] = $data->label; + } + } + + $this->preprocessData('com_fields.field', $data); + + return $data; + } + + /** + * Method to allow derived classes to preprocess the form. + * + * @param JForm $form A JForm object. + * @param mixed $data The data expected for the form. + * @param string $group The name of the plugin group to import (defaults to "content"). + * + * @return void + * + * @see JFormField + * @since __DEPLOY_VERSION__ + * @throws Exception if there is an error in the form event. + */ + protected function preprocessForm(JForm $form, $data, $group = 'content') + { + $parts = FieldsHelper::extract(JFactory::getApplication()->input->getCmd('context', $this->getState('field.context'))); + + if ($parts) + { + $component = $parts[0]; + + $dataObject = $data; + + if (is_array($dataObject)) + { + $dataObject = (object) $dataObject; + } + + if (isset($dataObject->type)) + { + $this->loadTypeForms($form, $dataObject->type, $component); + + $form->setFieldAttribute('type', 'component', $component); + + // Not alowed to change the type of an existing record + if ($dataObject->id) + { + $form->setFieldAttribute('type', 'readonly', 'true'); + } + } + + // Setting the context for the category field + $cat = JCategories::getInstance(str_replace('com_', '', $component)); + + if ($cat && $cat->get('root')->hasChildren()) + { + $form->setFieldAttribute('assigned_cat_ids', 'extension', $component); + } + else + { + $form->removeField('assigned_cat_ids'); + } + + $form->setFieldAttribute('type', 'component', $component); + $form->setFieldAttribute('catid', 'extension', $component . '.' . $parts[1] . '.fields'); + } + + // Trigger the default form events. + parent::preprocessForm($form, $data, $group); + } + + /** + * Returning the value for the given field id, context and item id. + * + * @param string $fieldId The field ID. + * @param string $context The context. + * @param string $itemId The ID of the item. + * + * @return NULL|string + * + * @since __DEPLOY_VERSION__ + */ + public function getFieldValue($fieldId, $context, $itemId) + { + $key = md5($fieldId . $context . $itemId); + + if (!key_exists($key, $this->valueCache)) + { + $this->valueCache[$key] = null; + + $query = $this->getDbo()->getQuery(true); + + $query->select($query->qn('value')) + ->from($query->qn('#__fields_values')) + ->where($query->qn('field_id') . ' = ' . (int) $fieldId) + ->where($query->qn('context') . ' = ' . $query->q($context)) + ->where($query->qn('item_id') . ' = ' . $query->q($itemId)); + + $rows = $this->getDbo()->setQuery($query)->loadObjectList(); + + if (count($rows) == 1) + { + $this->valueCache[$key] = array_shift($rows)->value; + } + elseif (count($rows) > 1) + { + $data = array(); + + foreach ($rows as $row) + { + $data[] = $row->value; + } + + $this->valueCache[$key] = $data; + } + } + + return $this->valueCache[$key]; + } + + /** + * Setting the value for the gven field id, context and item id. + * + * @param string $fieldId The field ID. + * @param string $context The context. + * @param string $itemId The ID of the item. + * @param string $value The value. + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + public function setFieldValue($fieldId, $context, $itemId, $value) + { + $field = $this->getItem($fieldId); + $params = $field->params; + + if (is_array($params)) + { + $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) || ! FieldsHelperInternal::canEditFieldValue($field)) + { + return false; + } + + $needsDelete = false; + $needsInsert = false; + $needsUpdate = false; + + if ($field->default_value == $value) + { + $needsDelete = true; + } + else + { + $oldValue = $this->getFieldValue($fieldId, $context, $itemId); + $value = (array) $value; + + if ($oldValue === null) + { + // No records available, doing normal insert + $needsInsert = true; + } + elseif (count($value) == 1 && count((array) $oldValue) == 1) + { + // Only a single row value update can be done + $needsUpdate = true; + } + else + { + // Multiple values, we need to purge the data and do a new + // insert + $needsDelete = true; + $needsInsert = true; + } + } + + if ($needsDelete) + { + // Deleting the existing record as it is a reset + $query = $this->getDbo()->getQuery(true); + + $query ->delete($query->qn('#__fields_values')) + ->where($query->qn('field_id') . ' = ' . (int) $fieldId) + ->where($query->qn('context') . ' = ' . $query->q($context)) + ->where($query->qn('item_id') . ' = ' . $query->q($itemId)); + + $this->getDbo()->setQuery($query)->execute(); + } + + if ($needsInsert) + { + $newObj = new stdClass; + + $newObj->field_id = (int) $fieldId; + $newObj->context = $context; + $newObj->item_id = $itemId; + + foreach ($value as $v) + { + $newObj->value = $v; + + $this->getDbo()->insertObject('#__fields_values', $newObj); + } + } + + if ($needsUpdate) + { + $updateObj = new stdClass; + + $updateObj->field_id = (int) $fieldId; + $updateObj->context = $context; + $updateObj->item_id = $itemId; + $updateObj->value = reset($value); + + $this->getDbo()->updateObject('#__fields_values', $updateObj, array('field_id', 'context', 'item_id')); + } + + $this->valueCache = array(); + + return true; + } + + /** + * Cleaning up the values for the given item on the context. + * + * @param string $context The context. + * @param string $itemId The Item ID. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function cleanupValues($context, $itemId) + { + $query = $this->getDbo()->getQuery(true); + + $query->delete($query->qn('#__fields_values')) + ->where($query->qn('context') . ' = ' . $query->q($context)) + ->where($query->qn('item_id') . ' = ' . $query->q($itemId)); + + $this->getDbo()->setQuery($query)->execute(); + } + + /** + * Clean the cache + * + * @param string $group The cache group + * @param integer $client_id The ID of the client + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function cleanCache($group = null, $client_id = 0) + { + $context = JFactory::getApplication()->input->get('context'); + + switch ($context) + { + case 'com_content': + parent::cleanCache('com_content'); + parent::cleanCache('mod_articles_archive'); + parent::cleanCache('mod_articles_categories'); + parent::cleanCache('mod_articles_category'); + parent::cleanCache('mod_articles_latest'); + parent::cleanCache('mod_articles_news'); + parent::cleanCache('mod_articles_popular'); + break; + default: + parent::cleanCache($context); + break; + } + } + + /** + * Method to change the title & alias. + * + * @param integer $category_id The id of the category. + * @param string $alias The alias. + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + * @since __DEPLOY_VERSION__ + */ + protected function generateNewTitle($category_id, $alias, $title) + { + // Alter the title & alias + $table = $this->getTable(); + + while ($table->load(array('alias' => $alias))) + { + $title = StringHelper::increment($title); + $alias = StringHelper::increment($alias, 'dash'); + } + + return array( + $title, + $alias, + ); + } + + /** + * Load the form declaration for the type. + * + * @param JForm &$form The form + * @param string $type The type + * @param string $component The component + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + private function loadTypeForms(JForm &$form, $type, $component) + { + FieldsHelperInternal::loadPlugins(); + + $type = JFormHelper::loadFieldType($type); + + // Load all children that's why we need to define the xpath + if (!($type instanceof JFormDomfieldinterface)) + { + return; + } + + $form->load($type->getFormParameters(), true, '/form/*'); + } +} diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php new file mode 100644 index 0000000000000..1799e78fceb32 --- /dev/null +++ b/administrator/components/com_fields/models/fields.php @@ -0,0 +1,414 @@ +context; + + $context = $app->getUserStateFromRequest('com_fields.fields.filter.context', 'context', 'com_content.article', 'cmd'); + + $this->setState('filter.context', $context); + $parts = explode('.', $context); + + // Extract the component name + $this->setState('filter.component', $parts[0]); + + // Extract the optional section name + $this->setState('filter.section', (count($parts) > 1) ? $parts[1] : null); + + $search = $this->getUserStateFromRequest($context . '.search', 'filter_search'); + $this->setState('filter.search', $search); + + $level = $this->getUserStateFromRequest($context . '.filter.level', 'filter_level'); + $this->setState('filter.level', $level); + + $access = $this->getUserStateFromRequest($context . '.filter.access', 'filter_access'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'); + $this->setState('filter.category_id', $categoryId); + + $language = $this->getUserStateFromRequest($context . '.filter.language', 'filter_language', ''); + $this->setState('filter.language', $language); + + // List state information. + parent::populateState('a.ordering', 'asc'); + + // Force a language + $forcedLanguage = $app->input->get('forcedLanguage'); + + if (! empty($forcedLanguage)) + { + $this->setState('filter.language', $forcedLanguage); + $this->setState('filter.forcedLanguage', $forcedLanguage); + } + } + + /** + * Method to get a store id based on the model configuration state. + * + * This is necessary because the model is used by the component and + * different modules that might need different sets of data or different + * ordering requirements. + * + * @param string $id An identifier string to generate the store id. + * + * @return string A store id. + * + * @since __DEPLOY_VERSION__ + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.context'); + $id .= ':' . serialize($this->getState('filter.assigned_cat_ids')); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.category_id'); + $id .= ':' . print_r($this->getState('filter.language'), true); + + return parent::getStoreId($id); + } + + /** + * Method to get a JDatabaseQuery object for retrieving the data set from a database. + * + * @return JDatabaseQuery A JDatabaseQuery object to retrieve the data set. + * + * @since __DEPLOY_VERSION__ + */ + protected function getListQuery() + { + // Create a new query object. + $db = $this->getDbo(); + $query = $db->getQuery(true); + $user = JFactory::getUser(); + + // Select the required fields from the table. + $query->select($this->getState('list.select', 'a.*')); + $query->from('#__fields AS a'); + + // Join over the language + $query->select('l.title AS language_title, l.image AS language_image') + ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); + + // Join over the users for the checked out user. + $query->select('uc.name AS editor')->join('LEFT', '#__users AS uc ON uc.id=a.checked_out'); + + // Join over the asset groups. + $query->select('ag.title AS access_level')->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + + // Join over the users for the author. + $query->select('ua.name AS author_name')->join('LEFT', '#__users AS ua ON ua.id = a.created_user_id'); + + // Join over the categories. + $query->select('c.title as category_title, c.access, c.published')->join('LEFT', '#__categories AS c ON c.id = a.catid'); + + // Filter by context + if ($context = $this->getState('filter.context')) + { + $query->where('a.context = ' . $db->quote($context)); + } + + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + if (is_array($access)) + { + $access = ArrayHelper::toInteger($access); + $query->where('a.access in (' . implode(',', $access) . ')'); + } + else + { + $query->where('a.access = ' . (int) $access); + } + } + + if (($categories = $this->getState('filter.assigned_cat_ids')) && $context) + { + $categories = (array) $categories; + $condition = "a.assigned_cat_ids = '' or find_in_set(0, a.assigned_cat_ids) "; + $parts = FieldsHelper::extract($context); + + if ($parts) + { + // Get the category + $cat = JCategories::getInstance(str_replace('com_', '', $parts[0])); + + if ($cat) + { + foreach ($categories as $assignedCatIds) + { + // Check if we have the actual category + $parent = $cat->get($assignedCatIds); + + if ($parent) + { + $condition .= 'or find_in_set(' . (int) $parent->id . ',a.assigned_cat_ids) '; + + // Traverse the tree up to get all the fields which + // are attached to a parent + while ($parent->getParent() && $parent->getParent()->id != 'root') + { + $parent = $parent->getParent(); + $condition .= 'or find_in_set(' . (int) $parent->id . ',a.assigned_cat_ids) '; + } + } + } + } + } + + $query->where('(' . $condition . ')'); + } + + // Implement View Level Access + if (!$user->authorise('core.admin')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ') AND (c.id IS NULL OR c.access IN (' . $groups . '))'); + } + + // Filter by published state + $published = $this->getState('filter.published'); + + if (is_numeric($published)) + { + $query->where('a.state = ' . (int) $published); + + if (JFactory::getApplication()->isSite()) + { + $query->where('(c.id IS NULL OR c.published = ' . (int) $published . ')', 'AND'); + } + } + elseif ($published === '') + { + $query->where('a.state IN (0, 1)'); + + if (JFactory::getApplication()->isSite()) + { + $query->where('(c.id IS NULL OR c.published IN (0, 1)', 'AND'); + } + } + + // Filter by a single or group of categories. + $baselevel = 1; + $categoryId = $this->getState('filter.category_id'); + + if (is_numeric($categoryId)) + { + $cat_tbl = JTable::getInstance('Category', 'JTable'); + $cat_tbl->load($categoryId); + $rgt = $cat_tbl->rgt; + $lft = $cat_tbl->lft; + $baselevel = (int) $cat_tbl->level; + $query->where('c.lft >= ' . (int) $lft) + ->where('c.rgt <= ' . (int) $rgt); + } + elseif (is_array($categoryId)) + { + $categoryId = ArrayHelper::toInteger($categoryId); + $categoryId = implode(',', $categoryId); + $query->where('a.catid IN (' . $categoryId . ')'); + } + + // Filter by search in title + $search = $this->getState('filter.search'); + + if (! empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + elseif (stripos($search, 'author:') === 0) + { + $search = $db->quote('%' . $db->escape(substr($search, 7), true) . '%'); + $query->where('(ua.name LIKE ' . $search . ' OR ua.username LIKE ' . $search . ')'); + } + else + { + $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); + $query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ' OR a.note LIKE ' . $search . ')'); + } + } + + // Filter on the language. + if ($language = $this->getState('filter.language')) + { + $language = (array) $language; + + foreach ($language as $key => $l) + { + $language[$key] = $db->quote($l); + } + + $query->where('a.language in (' . implode(',', $language) . ')'); + } + + // Add the list ordering clause + $listOrdering = $this->getState('list.ordering', 'a.ordering'); + $listDirn = $db->escape($this->getState('list.direction', 'ASC')); + + if ($listOrdering == 'a.access') + { + $query->order('a.access ' . $listDirn); + } + else + { + $query->order($db->escape($listOrdering) . ' ' . $listDirn); + } + + return $query; + } + + /** + * Gets an array of objects from the results of database query. + * + * @param string $query The query. + * @param integer $limitstart Offset. + * @param integer $limit The number of records. + * + * @return array An array of results. + * + * @since __DEPLOY_VERSION__ + * @throws RuntimeException + */ + protected function _getList($query, $limitstart = 0, $limit = 0) + { + $result = parent::_getList($query, $limitstart, $limit); + + if (is_array($result)) + { + foreach ($result as $field) + { + $field->fieldparams = new Registry($field->fieldparams); + $field->params = new Registry($field->params); + } + } + + return $result; + } + + /** + * Get the filter form + * + * @param array $data data + * @param boolean $loadData load current data + * + * @return JForm/false the JForm object or false + * + * @since __DEPLOY_VERSION__ + */ + public function getFilterForm($data = array(), $loadData = true) + { + $form = parent::getFilterForm($data, $loadData); + + if ($form) + { + $path = JPATH_ADMINISTRATOR . '/components/' . $this->getState('filter.component') . '/models/forms/filter_fields.xml'; + + if (file_exists($path)) + { + // Load all children that's why we need to define the xpath + if (!$form->loadFile($path, true, '/form/*')) + { + throw new Exception(JText::_('JERROR_LOADFILE_FAILED')); + } + } + + $context = JFactory::getApplication()->input->getCmd('context'); + + // If the context has multiple sections, this is the input field + // to display them + $form->setValue('section', 'custom', $context); + + $form->setFieldAttribute('category_id', 'extension', $context . '.fields', 'filter'); + } + + return $form; + } +} diff --git a/administrator/components/com_fields/models/fields/section.php b/administrator/components/com_fields/models/fields/section.php new file mode 100644 index 0000000000000..0ba0b68e0729a --- /dev/null +++ b/administrator/components/com_fields/models/fields/section.php @@ -0,0 +1,65 @@ +` 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. + * 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]". + * + * @return boolean True on success. + * + * @since __DEPLOY_VERSION__ + */ + public function setup(SimpleXMLElement $element, $value, $group = null) + { + $return = parent::setup($element, $value, $group); + + // Onchange must always be the change context function + $this->onchange = 'fieldsChangeContext(jQuery(this).val());'; + + return $return; + } + + /** + * Method to get the field input markup for a generic list. + * Use the multiple attribute to enable multiselect. + * + * @return string The field input markup. + * + * @since __DEPLOY_VERSION__ + */ + protected function getInput () + { + // Add the change context function to the document + JFactory::getDocument()->addScriptDeclaration( + "function fieldsChangeContext(context) + { + var regex = new RegExp(\"([?;&])context[^&;]*[;&]?\"); + var url = window.location.href; + var query = url.replace(regex, \"$1\").replace(/&$/, ''); + window.location.href = (query.length > 2 ? query + \"&\" : \"?\") + (context ? \"context=\" + context : ''); + }"); + + return parent::getInput(); + } +} diff --git a/administrator/components/com_fields/models/fields/type.php b/administrator/components/com_fields/models/fields/type.php new file mode 100644 index 0000000000000..ff60851b3c356 --- /dev/null +++ b/administrator/components/com_fields/models/fields/type.php @@ -0,0 +1,191 @@ +` 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. + * 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]". + * + * @return boolean True on success. + * + * @since __DEPLOY_VERSION__ + */ + public function setup(SimpleXMLElement $element, $value, $group = null) + { + $return = parent::setup($element, $value, $group); + + $this->onchange = "typeHasChanged(this);"; + + return $return; + } + + /** + * Method to get the field options. + * + * @return array The field option objects. + * + * @since __DEPLOY_VERSION__ + */ + protected function getOptions() + { + $options = parent::getOptions(); + + FieldsHelperInternal::loadPlugins(); + JFormHelper::addFieldPath(JPATH_LIBRARIES . '/cms/form/field'); + $paths = JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_fields/models/fields'); + + $component = null; + + $parts = FieldsHelper::extract(JFactory::getApplication()->input->get('context')); + + if ($parts) + { + $component = $parts[0]; + $paths[] = JPATH_ADMINISTRATOR . '/components/' . $component . '/models/fields'; + JFactory::getLanguage()->load($component, JPATH_ADMINISTRATOR); + JFactory::getLanguage()->load($component, JPATH_ADMINISTRATOR . '/components/' . $component); + } + + foreach ($paths as $path) + { + if (!JFolder::exists($path)) + { + continue; + } + // Looping trough the types + foreach (JFolder::files($path, 'php', true, true) as $filePath) + { + $name = str_replace('.php', '', basename($filePath)); + + if (in_array(strtolower($name), self::$BLACKLIST)) + { + continue; + } + + $className = JFormHelper::loadFieldClass($name); + + if ($className === false) + { + continue; + } + + // Check if the field implements JFormField and JFormDomFieldInterface + if (!is_subclass_of($className, 'JFormField') || !is_subclass_of($className, 'JFormDomfieldinterface')) + { + continue; + } + + // Adjust the name + $name = strtolower(str_replace('JFormField', '', $className)); + + $label = StringHelper::ucfirst($name); + + if (JFactory::getLanguage()->hasKey('COM_FIELDS_TYPE_' . strtoupper($name))) + { + $label = 'COM_FIELDS_TYPE_' . strtoupper($name); + } + + if ($component && JFactory::getLanguage()->hasKey(strtoupper($component) . '_FIELDS_TYPE_' . strtoupper($name))) + { + $label = strtoupper($component) . '_FIELDS_TYPE_' . strtoupper($name); + } + + $options[] = JHtml::_('select.option', $name, JText::_($label)); + } + } + + // Sorting the fields based on the text which is displayed + usort( + $options, + function ($a, $b) + { + return strcmp($a->text, $b->text); + } + ); + + // Reload the page when the type changes + $uri = clone JUri::getInstance('index.php'); + + // Removing the catid parameter from the actual url and set it as + // return + $returnUri = clone JUri::getInstance(); + $returnUri->setVar('catid', null); + $uri->setVar('return', base64_encode($returnUri->toString())); + + // Setting the options + $uri->setVar('option', 'com_fields'); + $uri->setVar('task', 'field.storeform'); + $uri->setVar('context', 'com_fields.field'); + $uri->setVar('formcontrol', $this->form->getFormControl()); + $uri->setVar('userstatevariable', 'com_fields.edit.field.data'); + $uri->setVar('view', null); + $uri->setVar('layout', null); + + JFactory::getDocument()->addScriptDeclaration( + "function typeHasChanged(element){ + var cat = jQuery(element); + jQuery('input[name=task]').val('field.storeform'); + element.form.action='" . $uri . "'; + element.form.submit(); + }"); + + return $options; + } + + /** + * Parses the file with the given path. If it is a class starting with the + * name JFormField and implementing JFormDomfieldinterface, then the class name is returned. + * + * @param string $path The path. + * + * @return string|boolean + * + * @since __DEPLOY_VERSION__ + */ + private function getClassNameFromFile($path) + { + $tokens = token_get_all(JFile::read($path)); + $className = null; + + for ($i = 2; $i < count($tokens); $i ++) + { + if ($tokens[$i - 2][0] == T_CLASS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING + && strpos($tokens[$i][1], 'JFormField') !== false) + { + $className = $tokens[$i][1]; + } + + if ($tokens[$i - 2][0] == T_IMPLEMENTS && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][1] == 'JFormDomfieldinterface') + { + return $className; + } + } + + return false; + } +} diff --git a/administrator/components/com_fields/models/forms/field.xml b/administrator/components/com_fields/models/forms/field.xml new file mode 100644 index 0000000000000..661ce4d8db896 --- /dev/null +++ b/administrator/components/com_fields/models/forms/field.xml @@ -0,0 +1,322 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/administrator/components/com_fields/models/forms/filter_fields.xml b/administrator/components/com_fields/models/forms/filter_fields.xml new file mode 100644 index 0000000000000..0a564a8ab5c08 --- /dev/null +++ b/administrator/components/com_fields/models/forms/filter_fields.xml @@ -0,0 +1,92 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/administrator/components/com_fields/tables/field.php b/administrator/components/com_fields/tables/field.php new file mode 100644 index 0000000000000..a6301b8cf865d --- /dev/null +++ b/administrator/components/com_fields/tables/field.php @@ -0,0 +1,251 @@ +setColumnAlias('published', 'state'); + } + + /** + * Method to bind an associative array or object to the JTable instance.This + * method only binds properties that are publicly accessible and optionally + * takes an array of properties to ignore when binding. + * + * @param mixed $src An associative array or object to bind to the JTable instance. + * @param mixed $ignore An optional array or space separated list of properties to ignore while binding. + * + * @return boolean True on success. + * + * @since __DEPLOY_VERSION__ + * @throws InvalidArgumentException + */ + public function bind($src, $ignore = '') + { + if (isset($src['params']) && is_array($src['params'])) + { + $registry = new Registry; + $registry->loadArray($src['params']); + $src['params'] = (string) $registry; + } + + if (isset($src['fieldparams']) && is_array($src['fieldparams'])) + { + $registry = new Registry; + $registry->loadArray($src['fieldparams']); + $src['fieldparams'] = (string) $registry; + } + + // Bind the rules. + if (isset($src['rules']) && is_array($src['rules'])) + { + $rules = new JRules($src['rules']); + $this->setRules($rules); + } + + return parent::bind($src, $ignore); + } + + /** + * Method to perform sanity checks on the JTable instance properties to ensure + * they are safe to store in the database. Child classes should override this + * method to make sure the data they are storing in the database is safe and + * as expected before storage. + * + * @return boolean True if the instance is sane and able to be stored in the database. + * + * @link https://docs.joomla.org/JTable/check + * @since __DEPLOY_VERSION__ + */ + public function check() + { + // Check for valid name + if (trim($this->title) == '') + { + $this->setError(JText::_('COM_FIELDS_LOCATION_ERR_TABLES_TITLE')); + + return false; + } + + if (empty($this->alias)) + { + $this->alias = $this->title; + } + + $this->alias = JApplication::stringURLSafe($this->alias); + + if (trim(str_replace('-', '', $this->alias)) == '') + { + $this->alias = JString::increment($alias, 'dash'); + } + + $this->alias = str_replace(',', '-', $this->alias); + + if (empty($this->type)) + { + $this->type = 'text'; + } + + if (is_array($this->assigned_cat_ids)) + { + $this->assigned_cat_ids = implode(',', $this->assigned_cat_ids); + } + + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified_time = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + if (! (int) $this->created_time) + { + $this->created_time = $date->toSql(); + } + + if (empty($this->created_user_id)) + { + $this->created_user_id = $user->get('id'); + } + } + + return true; + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form table_name.id + * where id is the value of the primary key of the table. + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + + return $this->context . '.field.' . (int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. In + * tracking the assets a title is kept for each asset so that there is some + * context available in a unified access manager. Usually this would just + * return $this->title or $this->name or whatever is being used for the + * primary name of the row. If this method is not overridden, the asset name is used. + * + * @return string The string to use as the title in the asset table. + * + * @link https://docs.joomla.org/JTable/getAssetTitle + * @since __DEPLOY_VERSION__ + */ + protected function _getAssetTitle() + { + return $this->title; + } + + /** + * Method to get the parent asset under which to register this one. + * By default, all assets are registered to the ROOT node with ID, + * which will default to 1 if none exists. + * The extended class can define a table and id to lookup. If the + * asset does not exist it will be created. + * + * @param JTable $table A JTable object for the asset parent. + * @param integer $id Id to look up + * + * @return integer + * + * @since __DEPLOY_VERSION__ + */ + protected function _getAssetParentId(JTable $table = null, $id = null) + { + $parts = FieldsHelper::extract($this->context); + $component = $parts ? $parts[0] : null; + + if ($parts && $this->catid) + { + $assetId = $this->getAssetId($parts[0] . '.' . $parts[1] . '.fields.category.' . $this->catid); + + if ($assetId !== false) + { + return $assetId; + } + } + elseif ($component) + { + $assetId = $this->getAssetId($component); + + if ($assetId !== false) + { + return $assetId; + } + } + + return parent::_getAssetParentId($table, $id); + } + + /** + * Returns an asset id for the given name or false. + * + * @param string $name The asset name + * + * @return number|boolean + * + * since __DEPLOY_VERSION__ + */ + private function getAssetId($name) + { + // Build the query to get the asset id for the name. + $query = $this->_db->getQuery(true) + ->select($this->_db->quoteName('id')) + ->from($this->_db->quoteName('#__assets')) + ->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote($name)); + + // Get the asset id from the database. + $this->_db->setQuery($query); + + $assetId = null; + + if ($result = $this->_db->loadResult()) + { + $assetId = (int) $result; + + if ($assetId) + { + return $assetId; + } + } + + return false; + } +} diff --git a/administrator/components/com_fields/views/field/tmpl/edit.php b/administrator/components/com_fields/views/field/tmpl/edit.php new file mode 100644 index 0000000000000..1692a3efef247 --- /dev/null +++ b/administrator/components/com_fields/views/field/tmpl/edit.php @@ -0,0 +1,105 @@ + 0 )); + +$app = JFactory::getApplication(); +$input = $app->input; + +JFactory::getDocument()->addScriptDeclaration(' + Joomla.submitbutton = function(task) + { + if (task == "field.cancel" || document.formvalidator.isValid(document.getElementById("item-form"))) + { + Joomla.submitform(task, document.getElementById("item-form")); + } + }; + jQuery(document).ready(function() { + jQuery("#jform_title").data("dp-old-value", jQuery("#jform_title").val()); + jQuery("#jform_title").change(function(data, handler) { + if(jQuery("#jform_title").data("dp-old-value") == jQuery("#jform_params_label").val()) { + jQuery("#jform_params_label").val(jQuery("#jform_title").val()); + } + + jQuery("#jform_title").data("dp-old-value", jQuery("#jform_title").val()); + }); + }); +'); + +?> + +
+ +
+ 'general')); ?> + +
+
+ form->renderField('type'); ?> + form->renderField('label'); ?> + form->renderField('description'); ?> + form->renderField('required'); ?> + form->renderField('default_value'); ?> + + form->getFieldsets('fieldparams') as $name => $fieldSet) : ?> + form->getFieldset($name) as $field) : ?> + renderField(); ?> + + + +
+
+ set('fields', + array( + array( + 'published', + 'state', + 'enabled', + ), + 'catid', + 'assigned_cat_ids', + 'access', + 'language', + 'note', + ) + ); ?> + + set('fields', null); ?> +
+
+ + +
+
+ +
+
+
+
+ + set('ignore_fieldsets', array('fieldparams')); ?> + + canDo->get('core.admin')) : ?> + + form->getInput('rules'); ?> + + + + form->getInput('context'); ?> + + +
+
diff --git a/administrator/components/com_fields/views/field/view.html.php b/administrator/components/com_fields/views/field/view.html.php new file mode 100644 index 0000000000000..3ab1fafa6cf41 --- /dev/null +++ b/administrator/components/com_fields/views/field/view.html.php @@ -0,0 +1,202 @@ +form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->state = $this->get('State'); + + $section = $this->state->get('field.section') ? $this->state->get('field.section') . '.' : ''; + $this->canDo = JHelperContent::getActions($this->state->get('field.component'), $section . 'field', $this->item->id); + + $input = JFactory::getApplication()->input; + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode("\n", $errors)); + + return false; + } + + $input->set('hidemainmenu', true); + + if ($this->getLayout() == 'modal') + { + $this->form->setFieldAttribute('language', 'readonly', 'true'); + $this->form->setFieldAttribute('parent_id', 'readonly', 'true'); + } + + $this->addToolbar(); + parent::display($tpl); + } + + /** + * Adds the toolbar. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function addToolbar() + { + $input = JFactory::getApplication()->input; + $context = $input->get('context'); + $user = JFactory::getUser(); + $userId = $user->get('id'); + + $isNew = ($this->item->id == 0); + $checkedOut = ! ($this->item->checked_out == 0 || $this->item->checked_out == $userId); + + // Check to see if the type exists + $ucmType = new JUcmType; + $this->typeId = $ucmType->getTypeId($context . '.field'); + + // Avoid nonsense situation. + if ($context == 'com_fields') + { + return; + } + + // The context can be in the form com_foo.section + $parts = explode('.', $context); + $component = $parts[0]; + $section = (count($parts) > 1) ? $parts[1] : null; + $componentParams = JComponentHelper::getParams($component); + + // Need to load the menu language file as mod_menu hasn't been loaded yet. + $lang = JFactory::getLanguage(); + $lang->load($component, JPATH_BASE, null, false, true) || + $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, true); + + // Load the field helper. + require_once JPATH_COMPONENT . '/helpers/fields.php'; + + // Get the results for each action. + $canDo = $this->canDo; + + // If a component fields title string is present, let's use it. + if ($lang->hasKey( + $component_title_key = $component . '_FIELDS_' . ($section ? $section : '') . '_FIELD_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE')) + { + $title = JText::_($component_title_key); + } + // Else if the component section string exits, let's use it + elseif ($lang->hasKey($component_section_key = $component . '_FIELDS_SECTION_' . ($section ? $section : ''))) + { + $title = JText::sprintf( + 'COM_FIELDS_VIEW_FIELD_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE', + $this->escape(JText::_($component_section_key)) + ); + } + // Else use the base title + else + { + $title = JText::_('COM_FIELDS_VIEW_FIELD_BASE_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE'); + } + + // Load specific component css + JHtml::_('stylesheet', $component . '/administrator/fields.css', array('version' => 'auto', 'relative' => true)); + + // Prepare the toolbar. + JToolbarHelper::title( + $title, + 'puzzle field-' . ($isNew ? 'add' : 'edit') . ' ' . substr($component, 4) . ($section ? "-$section" : '') . '-field-' . + ($isNew ? 'add' : 'edit') + ); + + // For new records, check the create permission. + if ($isNew) + { + JToolbarHelper::apply('field.apply'); + JToolbarHelper::save('field.save'); + JToolbarHelper::save2new('field.save2new'); + } + + // If not checked out, can save the item. + elseif (! $checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId))) + { + JToolbarHelper::apply('field.apply'); + JToolbarHelper::save('field.save'); + + if ($canDo->get('core.create')) + { + JToolbarHelper::save2new('field.save2new'); + } + } + + // If an existing item, can save to a copy. + if (! $isNew && $canDo->get('core.create')) + { + JToolbarHelper::save2copy('field.save2copy'); + } + + if (empty($this->item->id)) + { + JToolbarHelper::cancel('field.cancel'); + } + else + { + JToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); + } + + JToolbarHelper::divider(); + + // Compute the ref_key if it does exist in the component + if (! $lang->hasKey($ref_key = strtoupper($component . ($section ? "_$section" : '')) . '_FIELD_' . ($isNew ? 'ADD' : 'EDIT') . '_HELP_KEY')) + { + $ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_$section" : '')) . '_FIELD_' . ($isNew ? 'ADD' : 'EDIT'); + } + + /* + * Get help for the field/section view for the component by + * -remotely searching in a language defined dedicated URL: + * *component*_HELP_URL + * -locally searching in a component help file if helpURL param exists + * in the component and is set to '' + * -remotely searching in a component URL if helpURL param exists in the + * component and is NOT set to '' + */ + if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) + { + $debug = $lang->setDebug(false); + $url = JText::_($lang_help_url); + $lang->setDebug($debug); + } + else + { + $url = null; + } + } +} diff --git a/administrator/components/com_fields/views/fields/tmpl/default.php b/administrator/components/com_fields/views/fields/tmpl/default.php new file mode 100644 index 0000000000000..dca255ad29c3e --- /dev/null +++ b/administrator/components/com_fields/views/fields/tmpl/default.php @@ -0,0 +1,219 @@ +get('id'); +$context = $this->escape($this->state->get('filter.context')); +$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'); + +if ($saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_fields&task=fields.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true); +} +?> + +
+
+ sidebar; ?> +
+
+
+
+ filterForm->getFieldsets('custom'); ?> + $fieldSet) : ?> + filterForm->getFieldset($name) as $field) : ?> + input; ?> + + +
  +
+ $this)); ?> + items)) : ?> +
+ +
+ + + + + + + + + + + + + + + + + + + + + + items as $i => $item) : ?> + + authorise('core.edit', $context . '.field.' . $item->id); ?> + authorise('core.admin', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; ?> + authorise('core.edit.own', $context . '.field.' . $item->id) && $item->created_user_id == $userId; ?> + authorise('core.edit.state', $context . '.field.' . $item->id) && $canCheckin; ?> + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + state->get('list.direction'), $this->state->get('list.ordering')); ?> + + +
+ pagination->getListFooter(); ?> +
+ + + + + + + + + + + + + + id); ?> + +
+ state, $i, 'fields.', $canChange, 'cb'); ?> + + + state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'fields'); ?> + state === -2 ? 'un' : '') . 'trash', 'cb' . $i, 'fields'); ?> + escape($item->title)); ?> + +
+
+
+ checked_out) : ?> + editor, $item->checked_out_time, 'fields.', $canCheckin); ?> + + + + escape($item->title); ?> + + escape($item->title); ?> + + + note)) : ?> + escape($item->alias)); ?> + + escape($item->alias), $this->escape($item->note)); ?> + + +
+ component)); ?> + + + assigned_cat_ids)); ?> + + + + + + + + get($cat); ?> + id == 'root') : ?> + + + title . ','; ?> + + + +
+
+
+ type); ?> + hasKey($label)) : ?> + type); ?> + + escape(JText::_($label)); ?> + + escape($item->category_title); ?> + + escape($item->access_level); ?> + + language == '*') : ?> + + + language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> + + + id; ?> +
+ + authorise('core.create', $context) + && $user->authorise('core.edit', $context) + && $user->authorise('core.edit.state', $context)) : ?> + JText::_('COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + + + + +
+
diff --git a/administrator/components/com_fields/views/fields/tmpl/default_batch_body.php b/administrator/components/com_fields/views/fields/tmpl/default_batch_body.php new file mode 100644 index 0000000000000..f54cf1e92e85c --- /dev/null +++ b/administrator/components/com_fields/views/fields/tmpl/default_batch_body.php @@ -0,0 +1,35 @@ +state->get('filter.published'); +$context = $this->escape($this->state->get('filter.context')); +?> + +
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
diff --git a/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php b/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php new file mode 100644 index 0000000000000..d7865e9ec4543 --- /dev/null +++ b/administrator/components/com_fields/views/fields/tmpl/default_batch_footer.php @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/administrator/components/com_fields/views/fields/view.html.php b/administrator/components/com_fields/views/fields/view.html.php new file mode 100644 index 0000000000000..eec1dfbd86b2f --- /dev/null +++ b/administrator/components/com_fields/views/fields/view.html.php @@ -0,0 +1,233 @@ +state = $this->get('State'); + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->filterForm = $this->get('FilterForm'); + $this->activeFilters = $this->get('ActiveFilters'); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode("\n", $errors)); + + return false; + } + + // Display a warning if the fields system plugin is disabled + if (!JPluginHelper::isEnabled('system', 'fields')) + { + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . FieldsHelper::getFieldsPluginId()); + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_FIELDS_SYSTEM_PLUGIN_NOT_ENABLED', $link), 'warning'); + } + + $this->context = JFactory::getApplication()->input->getCmd('context'); + $parts = FieldsHelper::extract($this->context); + + if (!$parts) + { + JError::raiseError(500, 'Invalid context!!'); + + return; + } + + $this->component = $parts[0]; + $this->section = $parts[1]; + + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + parent::display($tpl); + } + + /** + * Adds the toolbar. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function addToolbar() + { + $fieldId = $this->state->get('filter.field_id'); + $user = JFactory::getUser(); + $component = $this->component; + $section = $this->section; + $canDo = new JObject; + + if (JFile::exists(JPATH_ADMINISTRATOR . '/components/' . $component . '/access.xml')) + { + $canDo = JHelperContent::getActions($component, 'field', $fieldId); + } + + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + + // Avoid nonsense situation. + if ($component == 'com_fields') + { + return; + } + + // Need to load the menu language file as mod_menu hasn't been loaded yet. + $lang = JFactory::getLanguage(); + $lang->load($component, JPATH_BASE, null, false, true) || + $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, true); + + // If a component categories title string is present, let's use it. + if ($lang->hasKey($component_title_key = strtoupper($component . '_FIELDS_' . ($section ? $section : '')) . '_FIELDS_TITLE')) + { + $title = JText::_($component_title_key); + } + elseif ($lang->hasKey($component_section_key = strtoupper($component . '_FIELDS_SECTION_' . ($section ? $section : '')))) + { + // Else if the component section string exits, let's use it + $title = JText::sprintf('COM_FIELDS_VIEW_FIELDS_TITLE', $this->escape(JText::_($component_section_key))); + } + else + { + $title = JText::_('COM_FIELDS_VIEW_FIELDS_BASE_TITLE'); + } + + // Load specific component css + JHtml::_('stylesheet', $component . '/administrator/fields.css', array('version' => 'auto', 'relative' => true)); + + // Prepare the toolbar. + JToolbarHelper::title($title, 'puzzle fields ' . substr($component, 4) . ($section ? "-$section" : '') . '-fields'); + + if ($canDo->get('core.create')) + { + JToolbarHelper::addNew('field.add'); + } + + if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) + { + JToolbarHelper::editList('field.edit'); + } + + if ($canDo->get('core.edit.state')) + { + JToolbarHelper::publish('fields.publish', 'JTOOLBAR_PUBLISH', true); + JToolbarHelper::unpublish('fields.unpublish', 'JTOOLBAR_UNPUBLISH', true); + JToolbarHelper::archiveList('fields.archive'); + } + + if (JFactory::getUser()->authorise('core.admin')) + { + JToolbarHelper::checkin('fields.checkin'); + } + + // Add a batch button + if ($user->authorise('core.create', $this->context) && $user->authorise('core.edit', $this->context) + && $user->authorise('core.edit.state', $this->context)) + { + $title = JText::_('JTOOLBAR_BATCH'); + + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + + $dhtml = $layout->render( + array( + 'title' => $title, + ) + ); + + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($canDo->get('core.admin') || $canDo->get('core.options')) + { + JToolbarHelper::preferences($component); + } + + if ($this->state->get('filter.published') == - 2 && $canDo->get('core.delete', $component)) + { + JToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($canDo->get('core.edit.state')) + { + JToolbarHelper::trash('fields.trash'); + } + + // Compute the ref_key if it does exist in the component + if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_$section" : '')) . '_FIELDS_HELP_KEY')) + { + $ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_$section" : '')) . '_FIELDS'; + } + + /* + * Get help for the fields view for the component by + * -remotely searching in a language defined dedicated URL: + * *component*_HELP_URL + * -locally searching in a component help file if helpURL param exists + * in the component and is set to '' + * -remotely searching in a component URL if helpURL param exists in the + * component and is NOT set to '' + */ + if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) + { + $debug = $lang->setDebug(false); + $url = JText::_($lang_help_url); + $lang->setDebug($debug); + } + else + { + $url = null; + } + + } + + /** + * Returns the sort fields. + * + * @return array + * + * @since __DEPLOY_VERSION__ + */ + protected function getSortFields() + { + return array( + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.title' => JText::_('JGLOBAL_TITLE'), + 'a.type' => JText::_('COM_FIELDS_FIELD_TYPE_LABEL'), + 'a.access' => JText::_('JGRID_HEADING_ACCESS'), + 'language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.id' => JText::_('JGRID_HEADING_ID'), + ); + } +} diff --git a/administrator/components/com_finder/controller.php b/administrator/components/com_finder/controller.php index 502775321d565..51b897015dbfc 100644 --- a/administrator/components/com_finder/controller.php +++ b/administrator/components/com_finder/controller.php @@ -17,7 +17,9 @@ class FinderController extends JControllerLegacy { /** - * @var string The default view. + * The default view. + * + * @var string * @since 2.5 */ protected $default_view = 'index'; @@ -28,13 +30,13 @@ class FinderController extends JControllerLegacy * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * - * @return JController A JController object to support chaining. + * @return FinderController A JControllerLegacy object to support chaining. * * @since 2.5 */ public function display($cachable = false, $urlparams = array()) { - include_once JPATH_COMPONENT . '/helpers/finder.php'; + JLoader::register('FinderHelper', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/finder.php'); $view = $this->input->get('view', 'index', 'word'); $layout = $this->input->get('layout', 'index', 'word'); @@ -51,8 +53,6 @@ public function display($cachable = false, $urlparams = array()) return false; } - parent::display(); - - return $this; + return parent::display(); } } diff --git a/administrator/components/com_finder/controllers/filter.php b/administrator/components/com_finder/controllers/filter.php index 4432466220ca8..67f370547afb1 100644 --- a/administrator/components/com_finder/controllers/filter.php +++ b/administrator/components/com_finder/controllers/filter.php @@ -35,7 +35,6 @@ public function save($key = null, $urlVar = null) $app = JFactory::getApplication(); $input = $app->input; - $lang = JFactory::getLanguage(); $model = $this->getModel(); $table = $model->getTable(); $data = $input->post->get('jform', array(), 'array'); @@ -186,7 +185,7 @@ public function save($key = null, $urlVar = null) $this->setMessage( JText::_( - ($lang->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS') + (JFactory::getLanguage()->hasKey($this->text_prefix . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS') ? $this->text_prefix : 'JLIB_APPLICATION') . ($recordId == 0 && $app->isSite() ? '_SUBMIT' : '') . '_SAVE_SUCCESS' ) ); diff --git a/administrator/components/com_finder/controllers/filters.php b/administrator/components/com_finder/controllers/filters.php index 0d68b8e06efc8..b5e7d24e0f259 100644 --- a/administrator/components/com_finder/controllers/filters.php +++ b/administrator/components/com_finder/controllers/filters.php @@ -23,14 +23,12 @@ class FinderControllerFilters extends JControllerAdmin * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * - * @return object The model. + * @return JModelLegacy The model. * * @since 2.5 */ public function getModel($name = 'Filter', $prefix = 'FinderModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_finder/controllers/index.php b/administrator/components/com_finder/controllers/index.php index 411bc7115460f..a21f31575969b 100644 --- a/administrator/components/com_finder/controllers/index.php +++ b/administrator/components/com_finder/controllers/index.php @@ -23,15 +23,13 @@ class FinderControllerIndex extends JControllerAdmin * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * - * @return object The model. + * @return JModelLegacy The model. * * @since 2.5 */ public function getModel($name = 'Index', $prefix = 'FinderModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** diff --git a/administrator/components/com_finder/controllers/indexer.json.php b/administrator/components/com_finder/controllers/indexer.json.php index 31e8215a632b5..c233fcc35dccd 100644 --- a/administrator/components/com_finder/controllers/indexer.json.php +++ b/administrator/components/com_finder/controllers/indexer.json.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Register dependent classes. -JLoader::register('FinderIndexer', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/indexer/indexer.php'); +JLoader::register('FinderIndexer', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/indexer.php'); /** * Indexer controller class for Finder. @@ -28,27 +28,24 @@ class FinderControllerIndexer extends JControllerLegacy */ public function start() { - static $log; - $params = JComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - if ($log == null) - { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; - $options['text_file'] = 'indexer.php'; - $log = JLog::addLogger($options); - } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['text_file'] = 'indexer.php'; + JLog::addLogger($options); } // Log the start JLog::add('Starting the indexer', JLog::INFO); // We don't want this form to be cached. - header('Pragma: no-cache'); - header('Cache-Control: no-cache'); - header('Expires: -1'); + $app = JFactory::getApplication(); + $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true); + $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); + $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); + $app->setHeader('Pragma', 'no-cache'); // Check for a valid token. If invalid, send a 403 with the error message. JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403)); @@ -95,27 +92,24 @@ public function start() */ public function batch() { - static $log; - $params = JComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - if ($log == null) - { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; - $options['text_file'] = 'indexer.php'; - $log = JLog::addLogger($options); - } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['text_file'] = 'indexer.php'; + JLog::addLogger($options); } // Log the start JLog::add('Starting the indexer batch process', JLog::INFO); // We don't want this form to be cached. - header('Pragma: no-cache'); - header('Cache-Control: no-cache'); - header('Expires: -1'); + $app = JFactory::getApplication(); + $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true); + $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); + $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); + $app->setHeader('Pragma', 'no-cache'); // Check for a valid token. If invalid, send a 403 with the error message. JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403)); @@ -216,9 +210,11 @@ public function batch() public function optimize() { // We don't want this form to be cached. - header('Pragma: no-cache'); - header('Cache-Control: no-cache'); - header('Expires: -1'); + $app = JFactory::getApplication(); + $app->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true); + $app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true); + $app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false); + $app->setHeader('Pragma', 'no-cache'); // Check for a valid token. If invalid, send a 403 with the error message. JSession::checkToken('request') or $this->sendResponse(new Exception(JText::_('JINVALID_TOKEN'), 403)); @@ -262,27 +258,24 @@ public function optimize() */ public static function sendResponse($data = null) { - static $log; + // This method always sends a JSON response + $app = JFactory::getApplication(); + $app->mimeType = 'application/json'; $params = JComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - if ($log == null) - { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; - $options['text_file'] = 'indexer.php'; - $log = JLog::addLogger($options); - } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['text_file'] = 'indexer.php'; + JLog::addLogger($options); } // Send the assigned error code if we are catching an exception. if ($data instanceof Exception) { - $app = JFactory::getApplication(); JLog::add($data->getMessage(), JLog::ERROR); $app->setHeader('status', $data->getCode()); - $app->sendHeaders(); } // Create the response object. @@ -292,10 +285,12 @@ public static function sendResponse($data = null) $response->buffer = JDEBUG ? ob_get_contents() : ob_end_clean(); // Send the JSON response. + $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet); + $app->sendHeaders(); echo json_encode($response); // Close the application. - JFactory::getApplication()->close(); + $app->close(); } } @@ -315,18 +310,13 @@ class FinderIndexerResponse */ public function __construct($state) { - static $log; - $params = JComponentHelper::getParams('com_finder'); if ($params->get('enable_logging', '0')) { - if ($log == null) - { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; - $options['text_file'] = 'indexer.php'; - $log = JLog::addLogger($options); - } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['text_file'] = 'indexer.php'; + JLog::addLogger($options); } // The old token is invalid so send a new one. diff --git a/administrator/components/com_finder/controllers/maps.php b/administrator/components/com_finder/controllers/maps.php index 6e0cb859e60c5..aed0950692548 100644 --- a/administrator/components/com_finder/controllers/maps.php +++ b/administrator/components/com_finder/controllers/maps.php @@ -23,14 +23,12 @@ class FinderControllerMaps extends JControllerAdmin * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional. * - * @return object The model. + * @return JModelLegacy The model. * * @since 1.6 */ public function getModel($name = 'Maps', $prefix = 'FinderModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_finder/finder.php b/administrator/components/com_finder/finder.php index ad1107f561c0a..49f37bc9b2cac 100644 --- a/administrator/components/com_finder/finder.php +++ b/administrator/components/com_finder/finder.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_finder')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Finder'); diff --git a/administrator/components/com_finder/finder.xml b/administrator/components/com_finder/finder.xml index 81b231ca67754..5967bc0b2ef04 100644 --- a/administrator/components/com_finder/finder.xml +++ b/administrator/components/com_finder/finder.xml @@ -21,7 +21,6 @@ js - images css diff --git a/administrator/components/com_finder/helpers/finder.php b/administrator/components/com_finder/helpers/finder.php index f8e389be7909b..9a0f44d727ad3 100644 --- a/administrator/components/com_finder/helpers/finder.php +++ b/administrator/components/com_finder/helpers/finder.php @@ -17,8 +17,10 @@ class FinderHelper { /** - * @var string The extension name. - * @since 2.5 + * The extension name. + * + * @var string + * @since 2.5 */ public static $extension = 'com_finder'; @@ -50,6 +52,35 @@ public static function addSubmenu($vName) ); } + /** + * Gets the finder system plugin extension id. + * + * @return int The finder system plugin extension id. + * + * @since 3.6.0 + */ + public static function getFinderPluginId() + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('content')) + ->where($db->quoteName('element') . ' = ' . $db->quote('finder')); + $db->setQuery($query); + + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + + return $result; + } + /** * Gets a list of the actions that can be performed. * @@ -64,8 +95,6 @@ public static function getActions() JLog::add(__METHOD__ . '() is deprecated, use JHelperContent::getActions() with new arguments order instead.', JLog::WARNING, 'deprecated'); // Get list of actions - $result = JHelperContent::getActions('com_finder'); - - return $result; + return JHelperContent::getActions('com_finder'); } } diff --git a/administrator/components/com_finder/helpers/html/finder.php b/administrator/components/com_finder/helpers/html/finder.php index 00731fff5da1a..0e5e8993b3ec3 100644 --- a/administrator/components/com_finder/helpers/html/finder.php +++ b/administrator/components/com_finder/helpers/html/finder.php @@ -29,8 +29,6 @@ abstract class JHtmlFinder */ public static function typeslist() { - $lang = JFactory::getLanguage(); - // Load the finder types. $db = JFactory::getDbo(); $query = $db->getQuery(true) @@ -46,18 +44,18 @@ public static function typeslist() } catch (RuntimeException $e) { - return; + return array(); } // Compile the options. $options = array(); + $lang = JFactory::getLanguage(); + foreach ($rows as $row) { - $key = $lang->hasKey(FinderHelperLanguage::branchPlural($row->text)) - ? FinderHelperLanguage::branchPlural($row->text) : $row->text; - $string = JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_($key)); - $options[] = JHtml::_('select.option', $row->value, $string); + $key = $lang->hasKey(FinderHelperLanguage::branchPlural($row->text)) ? FinderHelperLanguage::branchPlural($row->text) : $row->text; + $options[] = JHtml::_('select.option', $row->value, JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_($key))); } return $options; @@ -72,8 +70,6 @@ public static function typeslist() */ public static function mapslist() { - $lang = JFactory::getLanguage(); - // Load the finder types. $db = JFactory::getDbo(); $query = $db->getQuery(true) @@ -93,6 +89,8 @@ public static function mapslist() } // Translate. + $lang = JFactory::getLanguage(); + foreach ($branches as $branch) { $key = FinderHelperLanguage::branchPlural($branch->text); @@ -124,10 +122,9 @@ public static function mapslist() */ public static function statelist() { - $options = array(); - $options[] = JHtml::_('select.option', '1', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JPUBLISHED'))); - $options[] = JHtml::_('select.option', '0', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JUNPUBLISHED'))); - - return $options; + return array( + JHtml::_('select.option', '1', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JPUBLISHED'))), + JHtml::_('select.option', '0', JText::sprintf('COM_FINDER_ITEM_X_ONLY', JText::_('JUNPUBLISHED'))) + ); } } diff --git a/administrator/components/com_finder/helpers/indexer/adapter.php b/administrator/components/com_finder/helpers/indexer/adapter.php index c822d30343ada..6314ebece649c 100644 --- a/administrator/components/com_finder/helpers/indexer/adapter.php +++ b/administrator/components/com_finder/helpers/indexer/adapter.php @@ -163,7 +163,7 @@ public function __construct(&$subject, $config) * @return boolean True on success. * * @since 2.5 - * @throws Exception on error. + * @throws Exception on error. */ public function onStartIndex() { @@ -271,7 +271,7 @@ public function onBuildIndex() * @return boolean True on success. * * @since 2.5 - * @throws Exception on database error. + * @throws Exception on database error. */ protected function change($id, $property, $value) { @@ -527,9 +527,8 @@ protected function getContentCount() // Get the total number of content items to index. $this->db->setQuery($query); - $return = (int) $this->db->loadResult(); - return $return; + return (int) $this->db->loadResult(); } /** @@ -624,9 +623,7 @@ protected function getItems($offset, $limit, $query = null) protected function getListQuery($query = null) { // Check if we can use the supplied SQL query. - $query = $query instanceof JDatabaseQuery ? $query : $this->db->getQuery(true); - - return $query; + return $query instanceof JDatabaseQuery ? $query : $this->db->getQuery(true); } /** @@ -646,9 +643,8 @@ protected function getPluginType($id) ->from($this->db->quoteName('#__extensions')) ->where($this->db->quoteName('extension_id') . ' = ' . (int) $id); $this->db->setQuery($query); - $type = $this->db->loadResult(); - return $type; + return $this->db->loadResult(); } /** @@ -729,9 +725,8 @@ protected function getTypeId() ->from($this->db->quoteName('#__finder_types')) ->where($this->db->quoteName('title') . ' = ' . $this->db->quote($this->type_title)); $this->db->setQuery($query); - $result = (int) $this->db->loadResult(); - return $result; + return (int) $this->db->loadResult(); } /** diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php index 79d501ae9c769..84ed6b7879181 100644 --- a/administrator/components/com_finder/helpers/indexer/helper.php +++ b/administrator/components/com_finder/helpers/indexer/helper.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; JLoader::register('FinderIndexerParser', __DIR__ . '/parser.php'); JLoader::register('FinderIndexerStemmer', __DIR__ . '/stemmer.php'); @@ -62,7 +63,7 @@ public static function parse($input, $format = 'html') public static function tokenize($input, $lang, $phrase = false) { static $cache; - $store = JString::strlen($input) < 128 ? md5($input . '::' . $lang . '::' . $phrase) : null; + $store = StringHelper::strlen($input) < 128 ? md5($input . '::' . $lang . '::' . $phrase) : null; // Check if the string has been tokenized already. if ($store && isset($cache[$store])) @@ -74,7 +75,7 @@ public static function tokenize($input, $lang, $phrase = false) $quotes = html_entity_decode('‘’'', ENT_QUOTES, 'UTF-8'); // Get the simple language key. - $lang = self::getPrimaryLanguage($lang); + $lang = static::getPrimaryLanguage($lang); /* * Parsing the string input into terms is a multi-step process. @@ -89,7 +90,7 @@ public static function tokenize($input, $lang, $phrase = false) * 7. Replace the assorted single quotation marks with the ASCII standard single quotation. * 8. Remove multiple space characters and replaces with a single space. */ - $input = JString::strtolower($input); + $input = StringHelper::strtolower($input); $input = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,]+#mui', ' ', $input); $input = preg_replace('#(^|\s)[+-.,]+([\pL\pM]+)#mui', ' $1', $input); $input = preg_replace('#([\pL\pM\pN]+)[+-.,]+(\s|$)#mui', '$1 ', $input); @@ -98,7 +99,7 @@ public static function tokenize($input, $lang, $phrase = false) $input = preg_replace('#(^|\s)[\p{Pi}\p{Pf}]+(\s|$)#mui', ' ', $input); $input = preg_replace('#[' . $quotes . ']+#mui', '\'', $input); $input = preg_replace('#\s+#mui', ' ', $input); - $input = JString::trim($input); + $input = StringHelper::trim($input); // Explode the normalized string to get the terms. $terms = explode(' ', $input); @@ -120,7 +121,7 @@ public static function tokenize($input, $lang, $phrase = false) // Split apart any groups of Chinese characters. for ($j = 0; $j < $charCount; $j++) { - $tSplit = JString::str_ireplace($charMatches[0][$j], '', $terms[$i], false); + $tSplit = StringHelper::str_ireplace($charMatches[0][$j], '', $terms[$i], false); if (!empty($tSplit)) { @@ -215,23 +216,21 @@ public static function tokenize($input, $lang, $phrase = false) public static function stem($token, $lang) { // Trim apostrophes at either end of the token. - $token = JString::trim($token, '\''); + $token = StringHelper::trim($token, '\''); // Trim everything after any apostrophe in the token. - if (($pos = JString::strpos($token, '\'')) !== false) + if (($pos = StringHelper::strpos($token, '\'')) !== false) { - $token = JString::substr($token, 0, $pos); + $token = StringHelper::substr($token, 0, $pos); } // Stem the token if we have a valid stemmer to use. - if (self::$stemmer instanceof FinderIndexerStemmer) + if (static::$stemmer instanceof FinderIndexerStemmer) { - return self::$stemmer->stem($token, $lang); - } - else - { - return $token; + return static::$stemmer->stem($token, $lang); } + + return $token; } /** @@ -303,14 +302,7 @@ public static function isCommon($token, $lang) } // Check if the token is in the common array. - if (in_array($token, $data[$lang])) - { - return true; - } - else - { - return false; - } + return in_array($token, $data[$lang]); } /** @@ -335,9 +327,8 @@ public static function getCommonWords($lang) // Load all of the common terms for the language. $db->setQuery($query); - $results = $db->loadColumn(); - return $results; + return $db->loadColumn(); } /** @@ -384,7 +375,7 @@ public static function getPrimaryLanguage($lang) else { // Get the language key using string position. - $data[$lang] = JString::substr($lang, 0, JString::strpos($lang, '-')); + $data[$lang] = StringHelper::substr($lang, 0, StringHelper::strpos($lang, '-')); } } @@ -440,22 +431,14 @@ public static function getContentExtras(FinderIndexerResult &$item) // Load the finder plugin group. JPluginHelper::importPlugin('finder'); - try - { - // Trigger the event. - $results = $dispatcher->trigger('onPrepareFinderContent', array(&$item)); + // Trigger the event. + $results = $dispatcher->trigger('onPrepareFinderContent', array(&$item)); - // Check the returned results. This is for plugins that don't throw - // exceptions when they encounter serious errors. - if (in_array(false, $results)) - { - throw new Exception($dispatcher->getError(), 500); - } - } - catch (Exception $e) + // Check the returned results. This is for plugins that don't throw + // exceptions when they encounter serious errors. + if (in_array(false, $results)) { - // Handle a caught exception. - throw $e; + throw new Exception($dispatcher->getError(), 500); } return true; @@ -488,8 +471,7 @@ public static function prepareContent($text, $params = null) // Instantiate the parameter object if necessary. if (!($params instanceof Registry)) { - $registry = new Registry; - $registry->loadString($params); + $registry = new Registry($params); $params = $registry; } diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php index 4da8fbc310635..25644852c0296 100644 --- a/administrator/components/com_finder/helpers/indexer/indexer.php +++ b/administrator/components/com_finder/helpers/indexer/indexer.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + JLoader::register('FinderIndexerHelper', __DIR__ . '/helper.php'); JLoader::register('FinderIndexerParser', __DIR__ . '/parser.php'); JLoader::register('FinderIndexerStemmer', __DIR__ . '/stemmer.php'); @@ -75,7 +77,7 @@ abstract class FinderIndexer /** * The indexer state object. * - * @var object + * @var JObject * @since 2.5 */ public static $state; @@ -83,7 +85,7 @@ abstract class FinderIndexer /** * The indexer profiler object. * - * @var object + * @var JProfiler * @since 2.5 */ public static $profiler; @@ -117,15 +119,13 @@ public static function getInstance() if (file_exists($path)) { // Instantiate the parser. - include_once $path; + JLoader::register($class, $path); return new $class; } - else - { - // Throw invalid format exception. - throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $format)); - } + + // Throw invalid format exception. + throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $format)); } /** @@ -138,9 +138,9 @@ public static function getInstance() public static function getState() { // First, try to load from the internal state. - if (!empty(self::$state)) + if (!empty(static::$state)) { - return self::$state; + return static::$state; } // If we couldn't load from the internal state, try the session. @@ -177,7 +177,7 @@ public static function getState() // Setup the profiler if debugging is enabled. if (JFactory::getApplication()->get('debug')) { - self::$profiler = JProfiler::getInstance('FinderIndexer'); + static::$profiler = JProfiler::getInstance('FinderIndexer'); } // Setup the stemmer. @@ -187,9 +187,9 @@ public static function getState() } // Set the state. - self::$state = $data; + static::$state = $data; - return self::$state; + return static::$state; } /** @@ -210,11 +210,10 @@ public static function setState($data) } // Set the new internal state. - self::$state = $data; + static::$state = $data; // Set the new session state. - $session = JFactory::getSession(); - $session->set('_finder.state', $data); + JFactory::getSession()->set('_finder.state', $data); return true; } @@ -232,8 +231,7 @@ public static function resetState() self::$state = null; // Reset the session state to null. - $session = JFactory::getSession(); - $session->set('_finder.state', null); + JFactory::getSession()->set('_finder.state', null); } /** @@ -284,13 +282,14 @@ abstract public function optimize(); protected static function getSignature($item) { // Get the indexer state. - $state = self::getState(); + $state = static::getState(); // Get the relevant configuration variables. - $config = array(); - $config[] = $state->weights; - $config[] = $state->options->get('stem', 1); - $config[] = $state->options->get('stemmer', 'porter_en'); + $config = array( + $state->weights, + $state->options->get('stem', 1), + $state->options->get('stemmer', 'porter_en') + ); return md5(serialize(array($item, $config))); } @@ -298,10 +297,8 @@ protected static function getSignature($item) /** * Method to parse input, tokenize it, and then add it to the database. * - * @param mixed $input String or resource to use as input. A resource - * input will automatically be chunked to conserve - * memory. Strings will be chunked if longer than - * 2K in size. + * @param mixed $input String or resource to use as input. A resource input will automatically be chunked to conserve + * memory. Strings will be chunked if longer than 2K in size. * @param integer $context The context of the input. See context constants. * @param string $lang The language of the input. * @param string $format The format of the input. @@ -343,7 +340,7 @@ protected function tokenizeToDb($input, $context, $lang, $format) $string = substr($buffer, 0, $ls); // Adjust the buffer based on the last space for the next iteration and trim. - $buffer = JString::trim(substr($buffer, $ls)); + $buffer = StringHelper::trim(substr($buffer, $ls)); } // No space character was found. else @@ -373,7 +370,7 @@ protected function tokenizeToDb($input, $context, $lang, $format) $count += $this->addTokensToDb($tokens, $context); // Check if we're approaching the memory limit of the token table. - if ($count > self::$state->options->get('memory_table_limit', 30000)) + if ($count > static::$state->options->get('memory_table_limit', 30000)) { $this->toggleTables(false); } @@ -428,7 +425,7 @@ protected function tokenizeToDb($input, $context, $lang, $format) $count += $this->addTokensToDb($tokens, $context); // Check if we're approaching the memory limit of the token table. - if ($count > self::$state->options->get('memory_table_limit', 30000)) + if ($count > static::$state->options->get('memory_table_limit', 30000)) { $this->toggleTables(false); } diff --git a/administrator/components/com_finder/helpers/indexer/parser.php b/administrator/components/com_finder/helpers/indexer/parser.php index d52023af23315..ccf578a6a1129 100644 --- a/administrator/components/com_finder/helpers/indexer/parser.php +++ b/administrator/components/com_finder/helpers/indexer/parser.php @@ -48,18 +48,16 @@ public static function getInstance($format) $class = 'FinderIndexerParser' . ucfirst($format); // Check if a parser exists for the format. - if (file_exists($path)) - { - // Instantiate the parser. - include_once $path; - $instances[$format] = new $class; - } - else + if (!file_exists($path)) { // Throw invalid format exception. throw new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_PARSER', $format)); } + // Instantiate the parser. + JLoader::register($class, $path); + $instances[$format] = new $class; + return $instances[$format]; } diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php index 44dc4db3d4df3..16bbe283a7e3d 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/html.php +++ b/administrator/components/com_finder/helpers/indexer/parser/html.php @@ -80,9 +80,7 @@ public function parse($input) protected function process($input) { // Replace any amount of white space with a single space. - $input = preg_replace('#\s+#u', ' ', $input); - - return $input; + return preg_replace('#\s+#u', ' ', $input); } /** @@ -102,7 +100,6 @@ protected function process($input) private function removeBlocks($input, $startTag, $endTag) { $return = ''; - $blocks = array(); $offset = 0; $startTagLength = strlen($startTag); $endTagLength = strlen($endTag); diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php index 2e530888a8c86..98db5dd4512af 100644 --- a/administrator/components/com_finder/helpers/indexer/query.php +++ b/administrator/components/com_finder/helpers/indexer/query.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; JLoader::register('FinderIndexerHelper', __DIR__ . '/helper.php'); @@ -290,8 +291,7 @@ public function toUri($base = null) } // Get the filters in the request. - $input = JFactory::getApplication()->input; - $t = $input->request->get('t', array(), 'array'); + $t = JFactory::getApplication()->input->request->get('t', array(), 'array'); // Add the dynamic taxonomy filters if present. if (!empty($this->filters)) @@ -380,9 +380,8 @@ public function getExcludedTermIds() // Sanitize the terms. $results = array_unique($results); - $results = ArrayHelper::toInteger($results); - return $results; + return ArrayHelper::toInteger($results); } /** @@ -487,8 +486,7 @@ protected function processStaticTaxonomy($filterId) $db = JFactory::getDbo(); // Initialize user variables - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); + $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); // Load the predefined filter. $query = $db->getQuery(true) @@ -509,8 +507,7 @@ protected function processStaticTaxonomy($filterId) $this->filter = (int) $filterId; // Get a parameter object for the filter date options. - $registry = new Registry; - $registry->loadString($return->params); + $registry = new Registry($return->params); $params = $registry; // Set the dates if not already set. @@ -581,8 +578,7 @@ protected function processStaticTaxonomy($filterId) protected function processDynamicTaxonomy($filters) { // Initialize user variables - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); + $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); // Remove duplicates and sanitize. $filters = array_unique($filters); @@ -669,10 +665,10 @@ protected function processDynamicTaxonomy($filters) protected function processDates($date1, $date2, $when1, $when2) { // Clean up the inputs. - $date1 = JString::trim(JString::strtolower($date1)); - $date2 = JString::trim(JString::strtolower($date2)); - $when1 = JString::trim(JString::strtolower($when1)); - $when2 = JString::trim(JString::strtolower($when2)); + $date1 = StringHelper::trim(StringHelper::strtolower($date1)); + $date2 = StringHelper::trim(StringHelper::strtolower($date2)); + $when1 = StringHelper::trim(StringHelper::strtolower($when1)); + $when2 = StringHelper::trim(StringHelper::strtolower($when2)); // Get the time offset. $offset = JFactory::getApplication()->get('offset'); @@ -681,10 +677,9 @@ protected function processDates($date1, $date2, $when1, $when2) $whens = array('before', 'after', 'exact'); // The value of 'today' is a special case that we need to handle. - if ($date1 === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) + if ($date1 === StringHelper::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) { - $today = JFactory::getDate('now', $offset); - $date1 = $today->format('%Y-%m-%d'); + $date1 = JFactory::getDate('now', $offset)->format('%Y-%m-%d'); } // Try to parse the date string. @@ -699,10 +694,9 @@ protected function processDates($date1, $date2, $when1, $when2) } // The value of 'today' is a special case that we need to handle. - if ($date2 === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) + if ($date2 === StringHelper::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) { - $today = JFactory::getDate('now', $offset); - $date2 = $today->format('%Y-%m-%d'); + $date2 = JFactory::getDate('now', $offset)->format('%Y-%m-%d'); } // Try to parse the date string. @@ -736,9 +730,9 @@ protected function processString($input, $lang, $mode) { // Clean up the input string. $input = html_entity_decode($input, ENT_QUOTES, 'UTF-8'); - $input = JString::strtolower($input); + $input = StringHelper::strtolower($input); $input = preg_replace('#\s+#mi', ' ', $input); - $input = JString::trim($input); + $input = StringHelper::trim($input); $debug = JFactory::getConfig()->get('debug_lang'); /* @@ -755,7 +749,7 @@ protected function processString($input, $lang, $mode) foreach (FinderIndexerTaxonomy::getBranchTitles() as $branch) { // Add the pattern. - $patterns[$branch] = JString::strtolower(JText::_(FinderHelperLanguage::branchSingular($branch))); + $patterns[$branch] = StringHelper::strtolower(JText::_(FinderHelperLanguage::branchSingular($branch))); } // Container for search terms and phrases. @@ -807,10 +801,9 @@ protected function processString($input, $lang, $mode) $whens = array('before', 'after', 'exact'); // The value of 'today' is a special case that we need to handle. - if ($value === JString::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) + if ($value === StringHelper::strtolower(JText::_('COM_FINDER_QUERY_FILTER_TODAY'))) { - $today = JFactory::getDate('now', $offset); - $value = $today->format('%Y-%m-%d'); + $value = JFactory::getDate('now', $offset)->format('%Y-%m-%d'); } // Try to parse the date string. @@ -857,7 +850,7 @@ protected function processString($input, $lang, $mode) // Clean up the input string again. $input = str_replace($matches[0], '', $input); $input = preg_replace('#\s+#mi', ' ', $input); - $input = JString::trim($input); + $input = StringHelper::trim($input); } } @@ -865,7 +858,7 @@ protected function processString($input, $lang, $mode) * Extract the tokens enclosed in double quotes so that we can handle * them as phrases. */ - if (JString::strpos($input, '"') !== false) + if (StringHelper::strpos($input, '"') !== false) { $matches = array(); @@ -880,21 +873,21 @@ protected function processString($input, $lang, $mode) foreach ($matches[1] as $key => $match) { // Find the complete phrase in the input string. - $pos = JString::strpos($input, $matches[0][$key]); - $len = JString::strlen($matches[0][$key]); + $pos = StringHelper::strpos($input, $matches[0][$key]); + $len = StringHelper::strlen($matches[0][$key]); // Add any terms that are before this phrase to the stack. - if (JString::trim(JString::substr($input, 0, $pos))) + if (StringHelper::trim(StringHelper::substr($input, 0, $pos))) { - $terms = array_merge($terms, explode(' ', JString::trim(JString::substr($input, 0, $pos)))); + $terms = array_merge($terms, explode(' ', StringHelper::trim(StringHelper::substr($input, 0, $pos)))); } // Strip out everything up to and including the phrase. - $input = JString::substr($input, $pos + $len); + $input = StringHelper::substr($input, $pos + $len); // Clean up the input string again. $input = preg_replace('#\s+#mi', ' ', $input); - $input = JString::trim($input); + $input = StringHelper::trim($input); // Get the number of words in the phrase. $parts = explode(' ', $match); @@ -970,9 +963,9 @@ protected function processString($input, $lang, $mode) // An array of our boolean operators. $operator => $translation $operators = array( - 'AND' => JString::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_AND')), - 'OR' => JString::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_OR')), - 'NOT' => JString::strtolower(JText::_('COM_FINDER_QUERY_OPERATOR_NOT')) + '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')) ); // 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 ef7ad089c8488..78bcb6addde6d 100644 --- a/administrator/components/com_finder/helpers/indexer/result.php +++ b/administrator/components/com_finder/helpers/indexer/result.php @@ -207,12 +207,11 @@ public function __construct() */ public function __set($name, $value) { - $this->elements[$name] = $value; + $this->setElement($name, $value); } /** - * The magic get method is used to retrieve additional element values - * from the elements array. + * The magic get method is used to retrieve additional element values from the elements array. * * @param string $name The name of the element. * @@ -222,20 +221,11 @@ public function __set($name, $value) */ public function __get($name) { - // Get the element value if set. - if (array_key_exists($name, $this->elements)) - { - return $this->elements[$name]; - } - else - { - return null; - } + return $this->getElement($name); } /** - * The magic isset method is used to check the state of additional element - * values in the elements array. + * The magic isset method is used to check the state of additional element values in the elements array. * * @param string $name The name of the element. * @@ -249,8 +239,7 @@ public function __isset($name) } /** - * The magic unset method is used to unset additional element values in the - * elements array. + * The magic unset method is used to unset additional element values in the elements array. * * @param string $name The name of the element. * @@ -279,10 +268,8 @@ public function getElement($name) { return $this->elements[$name]; } - else - { - return null; - } + + return null; } /** diff --git a/administrator/components/com_finder/helpers/indexer/stemmer.php b/administrator/components/com_finder/helpers/indexer/stemmer.php index 1629c2bc4ff90..3061a2de9b2b5 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer.php @@ -56,18 +56,16 @@ public static function getInstance($adapter) $class = 'FinderIndexerStemmer' . ucfirst($adapter); // Check if a stemmer exists for the adapter. - if (file_exists($path)) - { - // Instantiate the stemmer. - include_once $path; - $instances[$adapter] = new $class; - } - else + if (!file_exists($path)) { // Throw invalid adapter exception. throw new Exception(JText::sprintf('COM_FINDER_INDEXER_INVALID_STEMMER', $adapter)); } + // Instantiate the stemmer. + JLoader::register($class, $path); + $instances[$adapter] = new $class; + return $instances[$adapter]; } diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php index 1ce973c626a5d..7f40a5ed832ef 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php @@ -27,7 +27,7 @@ class FinderIndexerStemmerFr extends FinderIndexerStemmer * @var array * @since 3.0 */ - private static $_stemRules = null; + private static $stemRules = null; /** * Method to stem a token and return the root. @@ -57,7 +57,7 @@ public function stem($token, $lang) if (!isset($this->cache[$lang][$token])) { // Stem the token. - $result = static::_getStem($token); + $result = self::getStem($token); // Add the token to the cache. $this->cache[$lang][$token] = $result; @@ -75,9 +75,9 @@ public function stem($token, $lang) */ protected static function getStemRules() { - if (static::$_stemRules) + if (self::$stemRules) { - return static::$_stemRules; + return self::$stemRules; } $vars = array(); @@ -134,9 +134,9 @@ protected static function getStemRules() 'eya2i.', 'ya1i.', 'yo1i.', 'esu1.', 'ugi1.', 'tt1.', 'end0.' ); - static::$_stemRules = $vars; + self::$stemRules = $vars; - return static::$_stemRules; + return self::$stemRules; } /** @@ -151,7 +151,7 @@ protected static function getStemRules() * * @since 3.0 */ - private static function _getFirstRule($reversed_input, $rule_number) + private static function getFirstRule($reversed_input, $rule_number) { $vars = static::getStemRules(); @@ -181,7 +181,7 @@ private static function _getFirstRule($reversed_input, $rule_number) * * @since 3.0 */ - private static function _check($reversed_stem) + private static function check($reversed_stem) { $vars = static::getStemRules(); @@ -212,7 +212,7 @@ private static function _check($reversed_stem) * * @since 3.0 */ - private static function _getStem($input) + private static function getStem($input) { $vars = static::getStemRules(); @@ -223,7 +223,7 @@ private static function _getStem($input) // This loop goes through the rules' array until it finds an ending one (ending by '.') or the last one ('end0.') while (true) { - $rule_number = static::_getFirstRule($reversed_input, $rule_number); + $rule_number = self::getFirstRule($reversed_input, $rule_number); if ($rule_number == -1) { @@ -238,7 +238,7 @@ private static function _getStem($input) { $reversed_stem = utf8_decode($matches[4]) . substr($reversed_input, $matches[3], strlen($reversed_input) - $matches[3]); - if (self::_check($reversed_stem)) + if (self::check($reversed_stem)) { $reversed_input = $reversed_stem; 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 3963243854ba6..340a82d1e3f07 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php @@ -27,7 +27,7 @@ class FinderIndexerStemmerPorter_En extends FinderIndexerStemmer * @var string * @since 2.5 */ - private static $_regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)'; + private static $regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)'; /** * Regex for matching a vowel @@ -35,7 +35,7 @@ class FinderIndexerStemmerPorter_En extends FinderIndexerStemmer * @var string * @since 2.5 */ - private static $_regex_vowel = '(?:[aeiou]|(?cache[$lang][$token] = $result; @@ -89,37 +89,37 @@ public function stem($token, $lang) * * @since 2.5 */ - private static function _step1ab($word) + private static function step1ab($word) { // Part a if (substr($word, -1) == 's') { - self::_replace($word, 'sses', 'ss') - or self::_replace($word, 'ies', 'i') - or self::_replace($word, 'ss', 'ss') - or self::_replace($word, 's', ''); + self::replace($word, 'sses', 'ss') + or self::replace($word, 'ies', 'i') + or self::replace($word, 'ss', 'ss') + or self::replace($word, 's', ''); } // Part b - if (substr($word, -2, 1) != 'e' or !self::_replace($word, 'eed', 'ee', 0)) + if (substr($word, -2, 1) != 'e' or !self::replace($word, 'eed', 'ee', 0)) { // First rule - $v = self::$_regex_vowel; + $v = self::$regex_vowel; // Words ending with ing and ed // Note use of && and OR, for precedence reasons - if (preg_match("#$v+#", substr($word, 0, -3)) && self::_replace($word, 'ing', '') - or preg_match("#$v+#", substr($word, 0, -2)) && self::_replace($word, 'ed', '')) + if (preg_match("#$v+#", substr($word, 0, -3)) && self::replace($word, 'ing', '') + or preg_match("#$v+#", substr($word, 0, -2)) && self::replace($word, 'ed', '')) { // If one of above two test successful - if (!self::_replace($word, 'at', 'ate') and !self::_replace($word, 'bl', 'ble') and !self::_replace($word, 'iz', 'ize')) + if (!self::replace($word, 'at', 'ate') and !self::replace($word, 'bl', 'ble') and !self::replace($word, 'iz', 'ize')) { // Double consonant ending - if (self::_doubleConsonant($word) and substr($word, -2) != 'll' and substr($word, -2) != 'ss' and substr($word, -2) != 'zz') + if (self::doubleConsonant($word) and substr($word, -2) != 'll' and substr($word, -2) != 'ss' and substr($word, -2) != 'zz') { $word = substr($word, 0, -1); } - elseif (self::_m($word) == 1 and self::_cvc($word)) + elseif (self::m($word) == 1 and self::cvc($word)) { $word .= 'e'; } @@ -139,13 +139,13 @@ private static function _step1ab($word) * * @since 2.5 */ - private static function _step1c($word) + private static function step1c($word) { - $v = self::$_regex_vowel; + $v = self::$regex_vowel; if (substr($word, -1) == 'y' && preg_match("#$v+#", substr($word, 0, -1))) { - self::_replace($word, 'y', 'i'); + self::replace($word, 'y', 'i'); } return $word; @@ -160,46 +160,46 @@ private static function _step1c($word) * * @since 2.5 */ - private static function _step2($word) + private static function step2($word) { switch (substr($word, -2, 1)) { case 'a': - self::_replace($word, 'ational', 'ate', 0) - or self::_replace($word, 'tional', 'tion', 0); + self::replace($word, 'ational', 'ate', 0) + or self::replace($word, 'tional', 'tion', 0); break; case 'c': - self::_replace($word, 'enci', 'ence', 0) - or self::_replace($word, 'anci', 'ance', 0); + self::replace($word, 'enci', 'ence', 0) + or self::replace($word, 'anci', 'ance', 0); break; case 'e': - self::_replace($word, 'izer', 'ize', 0); + self::replace($word, 'izer', 'ize', 0); break; case 'g': - self::_replace($word, 'logi', 'log', 0); + self::replace($word, 'logi', 'log', 0); break; case 'l': - self::_replace($word, 'entli', 'ent', 0) - or self::_replace($word, 'ousli', 'ous', 0) - or self::_replace($word, 'alli', 'al', 0) - or self::_replace($word, 'bli', 'ble', 0) - or self::_replace($word, 'eli', 'e', 0); + self::replace($word, 'entli', 'ent', 0) + or self::replace($word, 'ousli', 'ous', 0) + or self::replace($word, 'alli', 'al', 0) + or self::replace($word, 'bli', 'ble', 0) + or self::replace($word, 'eli', 'e', 0); break; case 'o': - self::_replace($word, 'ization', 'ize', 0) - or self::_replace($word, 'ation', 'ate', 0) - or self::_replace($word, 'ator', 'ate', 0); + self::replace($word, 'ization', 'ize', 0) + or self::replace($word, 'ation', 'ate', 0) + or self::replace($word, 'ator', 'ate', 0); break; case 's': - self::_replace($word, 'iveness', 'ive', 0) - or self::_replace($word, 'fulness', 'ful', 0) - or self::_replace($word, 'ousness', 'ous', 0) - or self::_replace($word, 'alism', 'al', 0); + self::replace($word, 'iveness', 'ive', 0) + or self::replace($word, 'fulness', 'ful', 0) + or self::replace($word, 'ousness', 'ous', 0) + or self::replace($word, 'alism', 'al', 0); break; case 't': - self::_replace($word, 'biliti', 'ble', 0) - or self::_replace($word, 'aliti', 'al', 0) - or self::_replace($word, 'iviti', 'ive', 0); + self::replace($word, 'biliti', 'ble', 0) + or self::replace($word, 'aliti', 'al', 0) + or self::replace($word, 'iviti', 'ive', 0); break; } @@ -215,28 +215,28 @@ private static function _step2($word) * * @since 2.5 */ - private static function _step3($word) + private static function step3($word) { switch (substr($word, -2, 1)) { case 'a': - self::_replace($word, 'ical', 'ic', 0); + self::replace($word, 'ical', 'ic', 0); break; case 's': - self::_replace($word, 'ness', '', 0); + self::replace($word, 'ness', '', 0); break; case 't': - self::_replace($word, 'icate', 'ic', 0) - or self::_replace($word, 'iciti', 'ic', 0); + self::replace($word, 'icate', 'ic', 0) + or self::replace($word, 'iciti', 'ic', 0); break; case 'u': - self::_replace($word, 'ful', '', 0); + self::replace($word, 'ful', '', 0); break; case 'v': - self::_replace($word, 'ative', '', 0); + self::replace($word, 'ative', '', 0); break; case 'z': - self::_replace($word, 'alize', 'al', 0); + self::replace($word, 'alize', 'al', 0); break; } @@ -252,58 +252,58 @@ private static function _step3($word) * * @since 2.5 */ - private static function _step4($word) + private static function step4($word) { switch (substr($word, -2, 1)) { case 'a': - self::_replace($word, 'al', '', 1); + self::replace($word, 'al', '', 1); break; case 'c': - self::_replace($word, 'ance', '', 1) - or self::_replace($word, 'ence', '', 1); + self::replace($word, 'ance', '', 1) + or self::replace($word, 'ence', '', 1); break; case 'e': - self::_replace($word, 'er', '', 1); + self::replace($word, 'er', '', 1); break; case 'i': - self::_replace($word, 'ic', '', 1); + self::replace($word, 'ic', '', 1); break; case 'l': - self::_replace($word, 'able', '', 1) - or self::_replace($word, 'ible', '', 1); + self::replace($word, 'able', '', 1) + or self::replace($word, 'ible', '', 1); break; case 'n': - self::_replace($word, 'ant', '', 1) - or self::_replace($word, 'ement', '', 1) - or self::_replace($word, 'ment', '', 1) - or self::_replace($word, 'ent', '', 1); + self::replace($word, 'ant', '', 1) + or self::replace($word, 'ement', '', 1) + or self::replace($word, 'ment', '', 1) + or self::replace($word, 'ent', '', 1); break; case 'o': if (substr($word, -4) == 'tion' or substr($word, -4) == 'sion') { - self::_replace($word, 'ion', '', 1); + self::replace($word, 'ion', '', 1); } else { - self::_replace($word, 'ou', '', 1); + self::replace($word, 'ou', '', 1); } break; case 's': - self::_replace($word, 'ism', '', 1); + self::replace($word, 'ism', '', 1); break; case 't': - self::_replace($word, 'ate', '', 1) - or self::_replace($word, 'iti', '', 1); + self::replace($word, 'ate', '', 1) + or self::replace($word, 'iti', '', 1); break; case 'u': - self::_replace($word, 'ous', '', 1); + self::replace($word, 'ous', '', 1); break; case 'v': - self::_replace($word, 'ive', '', 1); + self::replace($word, 'ive', '', 1); break; case 'z': - self::_replace($word, 'ize', '', 1); + self::replace($word, 'ize', '', 1); break; } @@ -319,26 +319,26 @@ private static function _step4($word) * * @since 2.5 */ - private static function _step5($word) + private static function step5($word) { // Part a if (substr($word, -1) == 'e') { - if (self::_m(substr($word, 0, -1)) > 1) + if (self::m(substr($word, 0, -1)) > 1) { - self::_replace($word, 'e', ''); + self::replace($word, 'e', ''); } - elseif (self::_m(substr($word, 0, -1)) == 1) + elseif (self::m(substr($word, 0, -1)) == 1) { - if (!self::_cvc(substr($word, 0, -1))) + if (!self::cvc(substr($word, 0, -1))) { - self::_replace($word, 'e', ''); + self::replace($word, 'e', ''); } } } // Part b - if (self::_m($word) > 1 and self::_doubleConsonant($word) and substr($word, -1) == 'l') + if (self::m($word) > 1 and self::doubleConsonant($word) and substr($word, -1) == 'l') { $word = substr($word, 0, -1); } @@ -361,7 +361,7 @@ private static function _step5($word) * * @since 2.5 */ - private static function _replace(&$str, $check, $repl, $m = null) + private static function replace(&$str, $check, $repl, $m = null) { $len = 0 - strlen($check); @@ -369,7 +369,7 @@ private static function _replace(&$str, $check, $repl, $m = null) { $substr = substr($str, 0, $len); - if (is_null($m) or self::_m($substr) > $m) + if (is_null($m) or self::m($substr) > $m) { $str = $substr . $repl; } @@ -396,10 +396,10 @@ private static function _replace(&$str, $check, $repl, $m = null) * * @since 2.5 */ - private static function _m($str) + private static function m($str) { - $c = self::$_regex_consonant; - $v = self::$_regex_vowel; + $c = self::$regex_consonant; + $v = self::$regex_vowel; $str = preg_replace("#^$c+#", '', $str); $str = preg_replace("#$v+$#", '', $str); @@ -419,9 +419,9 @@ private static function _m($str) * * @since 2.5 */ - private static function _doubleConsonant($str) + private static function doubleConsonant($str) { - $c = self::$_regex_consonant; + $c = self::$regex_consonant; return preg_match("#$c{2}$#", $str, $matches) and $matches[0]{0} == $matches[0]{1}; } @@ -435,10 +435,10 @@ private static function _doubleConsonant($str) * * @since 2.5 */ - private static function _cvc($str) + private static function cvc($str) { - $c = self::$_regex_consonant; - $v = self::$_regex_vowel; + $c = self::$regex_consonant; + $v = self::$regex_vowel; return preg_match("#($c$v$c)$#", $str, $matches) and strlen($matches[1]) == 3 and $matches[1]{2} != 'w' and $matches[1]{2} != 'x' and $matches[1]{2} != 'y'; diff --git a/administrator/components/com_finder/helpers/indexer/taxonomy.php b/administrator/components/com_finder/helpers/indexer/taxonomy.php index 447829d49f518..9a9c9a831a87e 100644 --- a/administrator/components/com_finder/helpers/indexer/taxonomy.php +++ b/administrator/components/com_finder/helpers/indexer/taxonomy.php @@ -47,9 +47,9 @@ class FinderIndexerTaxonomy public static function addBranch($title, $state = 1, $access = 1) { // Check to see if the branch is in the cache. - if (isset(self::$branches[$title])) + if (isset(static::$branches[$title])) { - return self::$branches[$title]->id; + return static::$branches[$title]->id; } // Check to see if the branch is in the table. @@ -68,9 +68,9 @@ public static function addBranch($title, $state = 1, $access = 1) if (!empty($result) && $result->state == $state && $result->access == $access) { // The data matches, add the item to the cache. - self::$branches[$title] = $result; + static::$branches[$title] = $result; - return self::$branches[$title]->id; + return static::$branches[$title]->id; } /* @@ -100,12 +100,12 @@ public static function addBranch($title, $state = 1, $access = 1) } // Store the branch. - self::storeNode($branch); + static::storeNode($branch); // Add the branch to the cache. - self::$branches[$title] = $branch; + static::$branches[$title] = $branch; - return self::$branches[$title]->id; + return static::$branches[$title]->id; } /** @@ -124,13 +124,13 @@ public static function addBranch($title, $state = 1, $access = 1) public static function addNode($branch, $title, $state = 1, $access = 1) { // Check to see if the node is in the cache. - if (isset(self::$nodes[$branch][$title])) + if (isset(static::$nodes[$branch][$title])) { - return self::$nodes[$branch][$title]->id; + return static::$nodes[$branch][$title]->id; } // Get the branch id, insert it if it does not exist. - $branchId = self::addBranch($branch); + $branchId = static::addBranch($branch); // Check to see if the node is in the table. $db = JFactory::getDbo(); @@ -148,9 +148,9 @@ public static function addNode($branch, $title, $state = 1, $access = 1) if (!empty($result) && $result->state == $state && $result->access == $access) { // The data matches, add the item to the cache. - self::$nodes[$branch][$title] = $result; + static::$nodes[$branch][$title] = $result; - return self::$nodes[$branch][$title]->id; + return static::$nodes[$branch][$title]->id; } /* @@ -180,12 +180,12 @@ public static function addNode($branch, $title, $state = 1, $access = 1) } // Store the node. - self::storeNode($node); + static::storeNode($node); // Add the node to the cache. - self::$nodes[$branch][$title] = $node; + static::$nodes[$branch][$title] = $node; - return self::$nodes[$branch][$title]->id; + return static::$nodes[$branch][$title]->id; } /** @@ -242,8 +242,7 @@ public static function getBranchTitles() $db = JFactory::getDbo(); // Set user variables - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); + $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); // Create a query to get the taxonomy branch titles. $query = $db->getQuery(true) @@ -255,9 +254,8 @@ public static function getBranchTitles() // Get the branch titles. $db->setQuery($query); - $results = $db->loadColumn(); - return $results; + return $db->loadColumn(); } /** @@ -276,8 +274,7 @@ public static function getNodeByTitle($branch, $title) $db = JFactory::getDbo(); // Set user variables - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); + $groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); // Create a query to get the node. $query = $db->getQuery(true) @@ -293,9 +290,8 @@ public static function getNodeByTitle($branch, $title) // Get the node. $db->setQuery($query, 0, 1); - $result = $db->loadObject(); - return $result; + return $db->loadObject(); } /** diff --git a/administrator/components/com_finder/helpers/indexer/token.php b/administrator/components/com_finder/helpers/indexer/token.php index 12fcfdd5fca05..2b1f3edadbfe9 100644 --- a/administrator/components/com_finder/helpers/indexer/token.php +++ b/administrator/components/com_finder/helpers/indexer/token.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + /** * Token class for the Finder indexer package. * @@ -107,7 +109,7 @@ public function __construct($term, $lang, $spacer = ' ') $this->numeric = false; $this->common = false; $this->phrase = true; - $this->length = JString::strlen($this->term); + $this->length = StringHelper::strlen($this->term); /* * Calculate the weight of the token. @@ -126,7 +128,7 @@ public function __construct($term, $lang, $spacer = ' ') $this->numeric = (is_numeric($this->term) || (bool) preg_match('#^[0-9,.\-\+]+$#', $this->term)); $this->common = $this->numeric ? false : FinderIndexerHelper::isCommon($this->term, $lang); $this->phrase = false; - $this->length = JString::strlen($this->term); + $this->length = StringHelper::strlen($this->term); /* * Calculate the weight of the token. diff --git a/administrator/components/com_finder/helpers/language.php b/administrator/components/com_finder/helpers/language.php index b738729acc102..3cacfce8bfdfb 100644 --- a/administrator/components/com_finder/helpers/language.php +++ b/administrator/components/com_finder/helpers/language.php @@ -33,10 +33,8 @@ public static function branchPlural($branchName) { return 'PLG_FINDER_QUERY_FILTER_BRANCH_P_' . $return; } - else - { - return $branchName; - } + + return $branchName; } /** @@ -93,12 +91,11 @@ public static function branchLanguageTitle($branchName) */ public static function loadComponentLanguage() { - $lang = JFactory::getLanguage(); - $lang->load('com_finder', JPATH_SITE); + JFactory::getLanguage()->load('com_finder', JPATH_SITE); } /** - * Method to load Smart Search plug-in language files. + * Method to load Smart Search plugin language files. * * @return void * @@ -116,10 +113,10 @@ public static function loadPluginLanguage() $loaded = true; - // Get array of all the enabled Smart Search plug-in names. + // Get array of all the enabled Smart Search plugin names. $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('name') + ->select(array($db->qn('name'), $db->qn('element'))) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) ->where($db->quoteName('folder') . ' = ' . $db->quote('finder')) @@ -136,10 +133,11 @@ public static function loadPluginLanguage() $lang = JFactory::getLanguage(); $lang->load('plg_content_finder', JPATH_ADMINISTRATOR); - // Load language file for each plug-in. + // Load language file for each plugin. foreach ($plugins as $plugin) { - $lang->load($plugin->name, JPATH_ADMINISTRATOR); + $lang->load($plugin->name, JPATH_ADMINISTRATOR) + || $lang->load($plugin->name, JPATH_PLUGINS . '/finder/' . $plugin->element); } } } diff --git a/administrator/components/com_finder/models/fields/branches.php b/administrator/components/com_finder/models/fields/branches.php index ae6f63e2d4ea0..1451cc358403e 100644 --- a/administrator/components/com_finder/models/fields/branches.php +++ b/administrator/components/com_finder/models/fields/branches.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die(); -JFormHelper::loadFieldClass('list'); - /** * Search Filter field for the Finder package. * * @since 3.5 */ -class JFormFieldBranches extends JFormFieldList +class JFormFieldBranches extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_finder/models/fields/contenttypes.php b/administrator/components/com_finder/models/fields/contenttypes.php index a14ebf5afc5b2..a8c37a2ea9e11 100644 --- a/administrator/components/com_finder/models/fields/contenttypes.php +++ b/administrator/components/com_finder/models/fields/contenttypes.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die(); -JFormHelper::loadFieldClass('list'); - use Joomla\Utilities\ArrayHelper; JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php'); @@ -20,7 +18,7 @@ * * @since 3.6.0 */ -class JFormFieldContentTypes extends JFormFieldList +class JFormFieldContentTypes extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_finder/models/fields/directories.php b/administrator/components/com_finder/models/fields/directories.php index 2ccb80d9d952f..c9905536e98d5 100644 --- a/administrator/components/com_finder/models/fields/directories.php +++ b/administrator/components/com_finder/models/fields/directories.php @@ -9,17 +9,15 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - // Load the base adapter. -require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; +JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'); /** * Renders a list of directories. * * @since 2.5 */ -class JFormFieldDirectories extends JFormFieldList +class JFormFieldDirectories extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_finder/models/fields/searchfilter.php b/administrator/components/com_finder/models/fields/searchfilter.php index 4e5a034213606..e56213efe101b 100644 --- a/administrator/components/com_finder/models/fields/searchfilter.php +++ b/administrator/components/com_finder/models/fields/searchfilter.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die(); -JFormHelper::loadFieldClass('list'); - /** * Search Filter field for the Finder package. * * @since 2.5 */ -class JFormFieldSearchFilter extends JFormFieldList +class JFormFieldSearchFilter extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_finder/models/filter.php b/administrator/components/com_finder/models/filter.php index db7ff44ffd79b..9322e019a6ff2 100644 --- a/administrator/components/com_finder/models/filter.php +++ b/administrator/components/com_finder/models/filter.php @@ -50,7 +50,7 @@ protected function cleanCache($group = 'com_finder', $client_id = 1) /** * Method to get the filter data. * - * @return mixed The filter data. + * @return FinderTableFilter|boolean The filter data or false on a failure. * * @since 2.5 */ @@ -99,7 +99,7 @@ public function getFilter() * @param array $data Data for the form. [optional] * @param boolean $loadData True if the form is to load its own data (default case), false if not. [optional] * - * @return mixed A JForm object on success, false on failure + * @return JForm|boolean A JForm object on success, false on failure * * @since 2.5 */ diff --git a/administrator/components/com_finder/models/filters.php b/administrator/components/com_finder/models/filters.php index 0a0dd21cab37a..ab1ee4c7d0229 100644 --- a/administrator/components/com_finder/models/filters.php +++ b/administrator/components/com_finder/models/filters.php @@ -22,7 +22,7 @@ class FinderModelFilters extends JModelList * @param array $config An associative array of configuration settings. [optional] * * @since 2.5 - * @see JController + * @see JControllerLegacy */ public function __construct($config = array()) { diff --git a/administrator/components/com_finder/models/index.php b/administrator/components/com_finder/models/index.php index 2690f8376cbf2..efd359e9702cc 100644 --- a/administrator/components/com_finder/models/index.php +++ b/administrator/components/com_finder/models/index.php @@ -38,7 +38,7 @@ class FinderModelIndex extends JModelList * @param array $config An associative array of configuration settings. [optional] * * @since 2.5 - * @see JController + * @see JControllerLegacy */ public function __construct($config = array()) { @@ -69,9 +69,7 @@ public function __construct($config = array()) */ protected function canDelete($record) { - $user = JFactory::getUser(); - - return $user->authorise('core.delete', $this->option); + return JFactory::getUser()->authorise('core.delete', $this->option); } /** @@ -85,9 +83,7 @@ protected function canDelete($record) */ protected function canEditState($record) { - $user = JFactory::getUser(); - - return $user->authorise('core.edit.state', $this->option); + return JFactory::getUser()->authorise('core.edit.state', $this->option); } /** @@ -244,9 +240,9 @@ protected function getListQuery() } /** - * Method to get the state of the Smart Search plug-ins. + * Method to get the state of the Smart Search Plugins. * - * @return array Array of relevant plug-ins and whether they are enabled or not. + * @return array Array of relevant plugins and whether they are enabled or not. * * @since 2.5 */ @@ -260,10 +256,8 @@ public function getPluginState() ->where($db->quoteName('folder') . ' IN (' . $db->quote('system') . ',' . $db->quote('content') . ')') ->where($db->quoteName('element') . ' = ' . $db->quote('finder')); $db->setQuery($query); - $db->execute(); - $plugins = $db->loadObjectList('name'); - return $plugins; + return $db->loadObjectList('name'); } /** diff --git a/administrator/components/com_finder/models/maps.php b/administrator/components/com_finder/models/maps.php index c60e7383a4945..bd194b823cb06 100644 --- a/administrator/components/com_finder/models/maps.php +++ b/administrator/components/com_finder/models/maps.php @@ -22,7 +22,7 @@ class FinderModelMaps extends JModelList * @param array $config An associative array of configuration settings. [optional] * * @since 2.5 - * @see JController + * @see JControllerLegacy */ public function __construct($config = array()) { @@ -51,9 +51,7 @@ public function __construct($config = array()) */ protected function canDelete($record) { - $user = JFactory::getUser(); - - return $user->authorise('core.delete', $this->option); + return JFactory::getUser()->authorise('core.delete', $this->option); } /** @@ -67,9 +65,7 @@ protected function canDelete($record) */ protected function canEditState($record) { - $user = JFactory::getUser(); - - return $user->authorise('core.edit.state', $this->option); + return JFactory::getUser()->authorise('core.edit.state', $this->option); } /** diff --git a/administrator/components/com_finder/models/statistics.php b/administrator/components/com_finder/models/statistics.php index 045081d6579ae..6ef5f71df0342 100644 --- a/administrator/components/com_finder/models/statistics.php +++ b/administrator/components/com_finder/models/statistics.php @@ -19,7 +19,7 @@ class FinderModelStatistics extends JModelLegacy /** * Method to get the component statistics * - * @return object The component statistics + * @return JObject The component statistics * * @since 2.5 */ @@ -60,7 +60,7 @@ public function getData() ->from($db->quoteName('#__finder_links') . ' AS a') ->join('INNER', $db->quoteName('#__finder_types') . ' AS t ON t.id = a.type_id') ->group('a.type_id, t.title') - ->order($db->quoteName('type_title'), 'ASC'); + ->order($db->quoteName('type_title') . ' ASC'); $db->setQuery($query); $data->type_list = $db->loadObjectList(); diff --git a/administrator/components/com_finder/sql/install.mysql.sql b/administrator/components/com_finder/sql/install.mysql.sql index d00b529c51eef..c8f060220e6ae 100644 --- a/administrator/components/com_finder/sql/install.mysql.sql +++ b/administrator/components/com_finder/sql/install.mysql.sql @@ -3,59 +3,55 @@ -- CREATE TABLE IF NOT EXISTS `#__finder_filters` ( - `filter_id` int(10) unsigned NOT NULL auto_increment, + `filter_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `alias` varchar(255) NOT NULL, - `state` tinyint(1) NOT NULL default '1', - `created` datetime NOT NULL default '0000-00-00 00:00:00', + `state` tinyint(1) NOT NULL DEFAULT 1, + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created_by` int(10) unsigned NOT NULL, `created_by_alias` varchar(255) NOT NULL, - `modified` datetime NOT NULL default '0000-00-00 00:00:00', - `modified_by` int(10) unsigned NOT NULL default '0', - `checked_out` int(10) unsigned NOT NULL default '0', - `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', - `map_count` int(10) unsigned NOT NULL default '0', + `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified_by` int(10) unsigned NOT NULL DEFAULT 0, + `checked_out` int(10) unsigned NOT NULL DEFAULT 0, + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `map_count` int(10) unsigned NOT NULL DEFAULT 0, `data` text NOT NULL, `params` mediumtext, - PRIMARY KEY (`filter_id`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- + PRIMARY KEY (`filter_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links` -- CREATE TABLE IF NOT EXISTS `#__finder_links` ( - `link_id` int(10) unsigned NOT NULL auto_increment, + `link_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(255) NOT NULL, `route` varchar(255) NOT NULL, - `title` varchar(255) default NULL, - `description` varchar(255) default NULL, - `indexdate` datetime NOT NULL default '0000-00-00 00:00:00', - `md5sum` varchar(32) default NULL, - `published` tinyint(1) NOT NULL default '1', - `state` int(5) default '1', - `access` int(5) default '0', + `title` varchar(400) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `indexdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `md5sum` varchar(32) DEFAULT NULL, + `published` tinyint(1) NOT NULL DEFAULT 1, + `state` int(5) DEFAULT 1, + `access` int(5) DEFAULT 0, `language` varchar(8) NOT NULL, - `publish_start_date` datetime NOT NULL default '0000-00-00 00:00:00', - `publish_end_date` datetime NOT NULL default '0000-00-00 00:00:00', - `start_date` datetime NOT NULL default '0000-00-00 00:00:00', - `end_date` datetime NOT NULL default '0000-00-00 00:00:00', - `list_price` double unsigned NOT NULL default '0', - `sale_price` double unsigned NOT NULL default '0', + `publish_start_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_end_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `start_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `list_price` double unsigned NOT NULL DEFAULT 0, + `sale_price` double unsigned NOT NULL DEFAULT 0, `type_id` int(11) NOT NULL, `object` mediumblob NOT NULL, - PRIMARY KEY (`link_id`), + PRIMARY KEY (`link_id`), KEY `idx_type` (`type_id`), - KEY `idx_title` (`title`), + KEY `idx_title` (`title`(100)), KEY `idx_md5` (`md5sum`), KEY `idx_url` (`url`(75)), KEY `idx_published_list` (`published`,`state`,`access`,`publish_start_date`,`publish_end_date`,`list_price`), KEY `idx_published_sale` (`published`,`state`,`access`,`publish_start_date`,`publish_end_date`,`sale_price`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms0` @@ -65,12 +61,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms0` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms1` @@ -80,12 +74,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms1` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms2` @@ -95,12 +87,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms2` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms3` @@ -110,13 +100,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms3` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms4` @@ -126,12 +113,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms4` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms5` @@ -141,12 +126,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms5` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms6` @@ -156,12 +139,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms6` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms7` @@ -171,12 +152,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms7` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms8` @@ -186,12 +165,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms8` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_terms9` @@ -201,12 +178,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_terms9` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termsa` @@ -216,12 +191,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termsa` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termsb` @@ -231,12 +204,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termsb` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termsc` @@ -246,12 +217,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termsc` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termsd` @@ -261,12 +230,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termsd` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termse` @@ -276,12 +243,10 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termse` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_links_termsf` @@ -291,31 +256,29 @@ CREATE TABLE IF NOT EXISTS `#__finder_links_termsf` ( `link_id` int(10) unsigned NOT NULL, `term_id` int(10) unsigned NOT NULL, `weight` float unsigned NOT NULL, - PRIMARY KEY (`link_id`,`term_id`), + PRIMARY KEY (`link_id`,`term_id`), KEY `idx_term_weight` (`term_id`,`weight`), KEY `idx_link_term_weight` (`link_id`,`term_id`,`weight`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_taxonomy` -- CREATE TABLE IF NOT EXISTS `#__finder_taxonomy` ( - `id` int(10) unsigned NOT NULL auto_increment, - `parent_id` int(10) unsigned NOT NULL default '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parent_id` int(10) unsigned NOT NULL DEFAULT 0, `title` varchar(255) NOT NULL, - `state` tinyint(1) unsigned NOT NULL default '1', - `access` tinyint(1) unsigned NOT NULL default '0', - `ordering` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`id`), + `state` tinyint(1) unsigned NOT NULL DEFAULT 1, + `access` tinyint(1) unsigned NOT NULL DEFAULT 0, + `ordering` tinyint(1) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), KEY `parent_id` (`parent_id`), KEY `state` (`state`), KEY `ordering` (`ordering`), KEY `access` (`access`), KEY `idx_parent_published` (`parent_id`,`state`,`access`) -) DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Dumping data for table `#__finder_taxonomy` @@ -324,8 +287,6 @@ CREATE TABLE IF NOT EXISTS `#__finder_taxonomy` ( REPLACE INTO `#__finder_taxonomy` (`id`, `parent_id`, `title`, `state`, `access`, `ordering`) VALUES (1, 0, 'ROOT', 0, 0, 0); --- -------------------------------------------------------- - -- -- Table structure for table `#__finder_taxonomy_map` -- @@ -333,34 +294,31 @@ REPLACE INTO `#__finder_taxonomy` (`id`, `parent_id`, `title`, `state`, `access` CREATE TABLE IF NOT EXISTS `#__finder_taxonomy_map` ( `link_id` int(10) unsigned NOT NULL, `node_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`link_id`,`node_id`), + PRIMARY KEY (`link_id`,`node_id`), KEY `link_id` (`link_id`), KEY `node_id` (`node_id`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_terms` -- CREATE TABLE IF NOT EXISTS `#__finder_terms` ( - `term_id` int(10) unsigned NOT NULL auto_increment, + `term_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `term` varchar(75) NOT NULL, `stem` varchar(75) NOT NULL, - `common` tinyint(1) unsigned NOT NULL default '0', - `phrase` tinyint(1) unsigned NOT NULL default '0', - `weight` float unsigned NOT NULL default '0', + `common` tinyint(1) unsigned NOT NULL DEFAULT 0, + `phrase` tinyint(1) unsigned NOT NULL DEFAULT 0, + `weight` float unsigned NOT NULL DEFAULT 0, `soundex` varchar(75) NOT NULL, - `links` int(10) NOT NULL default '0', - PRIMARY KEY (`term_id`), + `links` int(10) NOT NULL DEFAULT 0, + `language` char(3) NOT NULL DEFAULT '', + PRIMARY KEY (`term_id`), UNIQUE KEY `idx_term` (`term`), KEY `idx_term_phrase` (`term`,`phrase`), KEY `idx_stem_phrase` (`stem`,`phrase`), KEY `idx_soundex_phrase` (`soundex`,`phrase`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_terms_common` @@ -371,7 +329,7 @@ CREATE TABLE IF NOT EXISTS `#__finder_terms_common` ( `language` varchar(3) NOT NULL, KEY `idx_word_lang` (`term`,`language`), KEY `idx_lang` (`language`) -) DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Dumping data for table `#__finder_terms_common` @@ -494,8 +452,6 @@ REPLACE INTO `#__finder_terms_common` (`term`, `language`) VALUES ('your', 'en'), ('yours', 'en'); --- -------------------------------------------------------- - -- -- Table structure for table `#__finder_tokens` -- @@ -503,15 +459,14 @@ REPLACE INTO `#__finder_terms_common` (`term`, `language`) VALUES CREATE TABLE IF NOT EXISTS `#__finder_tokens` ( `term` varchar(75) NOT NULL, `stem` varchar(75) NOT NULL, - `common` tinyint(1) unsigned NOT NULL default '0', - `phrase` tinyint(1) unsigned NOT NULL default '0', - `weight` float unsigned NOT NULL default '1', - `context` tinyint(1) unsigned NOT NULL default '2', + `common` tinyint(1) unsigned NOT NULL DEFAULT 0, + `phrase` tinyint(1) unsigned NOT NULL DEFAULT 0, + `weight` float unsigned NOT NULL DEFAULT 1, + `context` tinyint(1) unsigned NOT NULL DEFAULT 2, + `language` char(3) NOT NULL DEFAULT '', KEY `idx_word` (`term`), KEY `idx_context` (`context`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_tokens_aggregate` @@ -522,26 +477,25 @@ CREATE TABLE IF NOT EXISTS `#__finder_tokens_aggregate` ( `map_suffix` char(1) NOT NULL, `term` varchar(75) NOT NULL, `stem` varchar(75) NOT NULL, - `common` tinyint(1) unsigned NOT NULL default '0', - `phrase` tinyint(1) unsigned NOT NULL default '0', + `common` tinyint(1) unsigned NOT NULL DEFAULT 0, + `phrase` tinyint(1) unsigned NOT NULL DEFAULT 0, `term_weight` float unsigned NOT NULL, - `context` tinyint(1) unsigned NOT NULL default '2', + `context` tinyint(1) unsigned NOT NULL DEFAULT 2, `context_weight` float unsigned NOT NULL, `total_weight` float unsigned NOT NULL, + `language` char(3) NOT NULL DEFAULT '', KEY `token` (`term`), KEY `keyword_id` (`term_id`) -) DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- +) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Table structure for table `#__finder_types` -- CREATE TABLE IF NOT EXISTS `#__finder_types` ( - `id` int(10) unsigned NOT NULL auto_increment, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL, `mime` varchar(100) NOT NULL, - PRIMARY KEY (`id`), + PRIMARY KEY (`id`), UNIQUE KEY `title` (`title`) -) DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; diff --git a/administrator/components/com_finder/tables/filter.php b/administrator/components/com_finder/tables/filter.php index 9b1ed5606faa7..c1e53d432d88a 100644 --- a/administrator/components/com_finder/tables/filter.php +++ b/administrator/components/com_finder/tables/filter.php @@ -48,8 +48,7 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new Registry; - $registry->loadArray($array['params']); + $registry = new Registry($array['params']); $array['params'] = (string) $registry; } @@ -204,15 +203,15 @@ public function publish($pks = null, $state = 1, $userId = 0) */ public function store($updateNulls = false) { - $date = JFactory::getDate(); - $user = JFactory::getUser(); + $date = JFactory::getDate()->toSql(); + $userId = JFactory::getUser()->id; - $this->modified = $date->toSql(); + $this->modified = $date; if ($this->filter_id) { // Existing item - $this->modified_by = $user->get('id'); + $this->modified_by = $userId; } else { @@ -220,12 +219,12 @@ public function store($updateNulls = false) // so we don't touch it if it is set. if (!(int) $this->created) { - $this->created = $date->toSql(); + $this->created = $date; } if (empty($this->created_by)) { - $this->created_by = $user->get('id'); + $this->created_by = $userId; } } diff --git a/administrator/components/com_finder/views/filter/tmpl/edit.php b/administrator/components/com_finder/views/filter/tmpl/edit.php index 81ae0ae53594b..359ff96ea2dc8 100644 --- a/administrator/components/com_finder/views/filter/tmpl/edit.php +++ b/administrator/components/com_finder/views/filter/tmpl/edit.php @@ -21,7 +21,7 @@ Joomla.submitform(task, document.getElementById("adminForm")); } }; - + jQuery(document).ready(function($) { $("#rightbtn").on("click", function() { if($(this).text() == "' . JText::_('COM_FINDER_FILTER_SHOW_ALL') . '") { @@ -70,7 +70,7 @@
total > 0) : ?>
- form->getControlGroup('map_count'); ?> + 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 2bd7166cc32c2..9e860095282ff 100644 --- a/administrator/components/com_finder/views/filter/view.html.php +++ b/administrator/components/com_finder/views/filter/view.html.php @@ -16,6 +16,34 @@ */ class FinderViewFilter extends JViewLegacy { + /** + * The filter object + * + * @var FinderTableFilter + */ + protected $filter; + + /** + * The JForm object + * + * @var JForm + */ + protected $form; + + /** + * The active item + * + * @var object + */ + protected $item; + + /** + * The model state + * + * @var object + */ + protected $state; + /** * Method to display the view. * @@ -48,7 +76,7 @@ public function display($tpl = null) // Configure the toolbar. $this->addToolbar(); - parent::display($tpl); + return parent::display($tpl); } /** @@ -62,10 +90,8 @@ protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); - $userId = $user->get('id'); $isNew = ($this->item->filter_id == 0); - $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId); + $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == JFactory::getUser()->id); $canDo = JHelperContent::getActions('com_finder'); // Configure the toolbar. diff --git a/administrator/components/com_finder/views/filters/view.html.php b/administrator/components/com_finder/views/filters/view.html.php index c08a3269cf08d..1132f206a5f6c 100644 --- a/administrator/components/com_finder/views/filters/view.html.php +++ b/administrator/components/com_finder/views/filters/view.html.php @@ -16,6 +16,41 @@ */ class FinderViewFilters extends JViewLegacy { + /** + * An array of items + * + * @var array + */ + protected $items; + + /** + * The pagination object + * + * @var JPagination + */ + protected $pagination; + + /** + * The HTML markup for the sidebar + * + * @var string + */ + protected $sidebar; + + /** + * The model state + * + * @var object + */ + protected $state; + + /** + * The total number of items + * + * @var object + */ + protected $total; + /** * Method to display the view. * @@ -50,7 +85,8 @@ public function display($tpl = null) // Configure the toolbar. $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - parent::display($tpl); + + return parent::display($tpl); } /** diff --git a/administrator/components/com_finder/views/index/tmpl/default.php b/administrator/components/com_finder/views/index/tmpl/default.php index 5d9d5017a1db2..c8613f3a02ceb 100644 --- a/administrator/components/com_finder/views/index/tmpl/default.php +++ b/administrator/components/com_finder/views/index/tmpl/default.php @@ -60,11 +60,6 @@
$this)); ?> - items)) : ?> -
- -
- @@ -135,7 +130,6 @@
- diff --git a/administrator/components/com_finder/views/index/view.html.php b/administrator/components/com_finder/views/index/view.html.php index 99e6c724e8dec..b0448c7437c18 100644 --- a/administrator/components/com_finder/views/index/view.html.php +++ b/administrator/components/com_finder/views/index/view.html.php @@ -18,6 +18,48 @@ */ class FinderViewIndex extends JViewLegacy { + /** + * An array of items + * + * @var array + */ + protected $items; + + /** + * The pagination object + * + * @var JPagination + */ + protected $pagination; + + /** + * The state of core Smart Search plugins + * + * @var array + */ + protected $pluginState; + + /** + * The HTML markup for the sidebar + * + * @var string + */ + protected $sidebar; + + /** + * The model state + * + * @var object + */ + protected $state; + + /** + * The total number of items + * + * @var object + */ + protected $total; + /** * Method to display the view. * @@ -29,7 +71,7 @@ class FinderViewIndex extends JViewLegacy */ public function display($tpl = null) { - // Load plug-in language files. + // Load plugin language files. FinderHelperLanguage::loadPluginLanguage(); $this->items = $this->get('Items'); @@ -52,7 +94,8 @@ public function display($tpl = null) if (!$this->pluginState['plg_content_finder']->enabled) { - JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning'); + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . FinderHelper::getFinderPluginId()); + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED', $link), 'warning'); } elseif ($this->get('TotalIndexed') === 0) { @@ -64,7 +107,8 @@ public function display($tpl = null) // Configure the toolbar. $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - parent::display($tpl); + + return parent::display($tpl); } /** diff --git a/administrator/components/com_finder/views/indexer/tmpl/default.php b/administrator/components/com_finder/views/indexer/tmpl/default.php index f69c07bb19f1a..417cb6e7788b3 100644 --- a/administrator/components/com_finder/views/indexer/tmpl/default.php +++ b/administrator/components/com_finder/views/indexer/tmpl/default.php @@ -12,7 +12,7 @@ JHtml::_('behavior.keepalive'); JHtml::_('behavior.core'); JHtml::_('jquery.framework'); -JHtml::_('script', 'com_finder/indexer.js', false, true); +JHtml::_('script', 'com_finder/indexer.js', array('version' => 'auto', 'relative' => true)); JFactory::getDocument()->addScriptDeclaration('var msg = "' . JText::_('COM_FINDER_INDEXER_MESSAGE_COMPLETE') . '";'); ?> diff --git a/administrator/components/com_finder/views/maps/view.html.php b/administrator/components/com_finder/views/maps/view.html.php index f14f475eca76d..4e2c1cb305e8d 100644 --- a/administrator/components/com_finder/views/maps/view.html.php +++ b/administrator/components/com_finder/views/maps/view.html.php @@ -18,6 +18,41 @@ */ class FinderViewMaps extends JViewLegacy { + /** + * An array of items + * + * @var array + */ + protected $items; + + /** + * The pagination object + * + * @var JPagination + */ + protected $pagination; + + /** + * The HTML markup for the sidebar + * + * @var string + */ + protected $sidebar; + + /** + * The model state + * + * @var object + */ + protected $state; + + /** + * The total number of items + * + * @var object + */ + protected $total; + /** * Method to display the view. * @@ -29,7 +64,7 @@ class FinderViewMaps extends JViewLegacy */ public function display($tpl = null) { - // Load plug-in language files. + // Load plugin language files. FinderHelperLanguage::loadPluginLanguage(); // Load the view data. @@ -55,7 +90,8 @@ public function display($tpl = null) // Prepare the view. $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - parent::display($tpl); + + return parent::display($tpl); } /** @@ -70,7 +106,6 @@ protected function addToolbar() $canDo = JHelperContent::getActions('com_finder'); JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder'); - $toolbar = JToolbar::getInstance('toolbar'); if ($canDo->get('core.edit.state')) { @@ -85,7 +120,14 @@ protected function addToolbar() } JToolbarHelper::divider(); - $toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350); + JToolbar::getInstance('toolbar')->appendButton( + 'Popup', + 'bars', + 'COM_FINDER_STATISTICS', + 'index.php?option=com_finder&view=statistics&tmpl=component', + 550, + 350 + ); JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS'); diff --git a/administrator/components/com_finder/views/statistics/view.html.php b/administrator/components/com_finder/views/statistics/view.html.php index 46271af2585fc..6f72e5d0aa81d 100644 --- a/administrator/components/com_finder/views/statistics/view.html.php +++ b/administrator/components/com_finder/views/statistics/view.html.php @@ -16,6 +16,13 @@ */ class FinderViewStatistics extends JViewLegacy { + /** + * The index statistics + * + * @var JObject + */ + protected $data; + /** * Method to display the view. * @@ -38,6 +45,6 @@ public function display($tpl = null) return false; } - parent::display($tpl); + return parent::display($tpl); } } diff --git a/administrator/components/com_installer/controller.php b/administrator/components/com_installer/controller.php index 6d4e23659050d..e7484b522e8fd 100644 --- a/administrator/components/com_installer/controller.php +++ b/administrator/components/com_installer/controller.php @@ -28,7 +28,7 @@ class InstallerController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'; + JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'); // Get the document object. $document = JFactory::getDocument(); diff --git a/administrator/components/com_installer/controllers/languages.php b/administrator/components/com_installer/controllers/languages.php index 934385052adee..80653629053de 100644 --- a/administrator/components/com_installer/controllers/languages.php +++ b/administrator/components/com_installer/controllers/languages.php @@ -8,6 +8,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Languages Installer Controller * @@ -81,13 +83,12 @@ public function install() // Get array of selected languages $lids = $this->input->get('cid', array(), 'array'); - JArrayHelper::toInteger($lids, array()); + $lids = ArrayHelper::toInteger($lids, array()); if (!$lids) { // No languages have been selected - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED')); + JFactory::getApplication()->enqueueMessage(JText::_('COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED')); } else { diff --git a/administrator/components/com_installer/controllers/manage.php b/administrator/components/com_installer/controllers/manage.php index 15049b7965cc0..c76649eed19e5 100644 --- a/administrator/components/com_installer/controllers/manage.php +++ b/administrator/components/com_installer/controllers/manage.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Installer Manage Controller * @@ -47,7 +49,7 @@ public function publish() $ids = $this->input->get('cid', array(), 'array'); $values = array('publish' => 1, 'unpublish' => 0); $task = $this->getTask(); - $value = JArrayHelper::getValue($values, $task, 0, 'int'); + $value = ArrayHelper::getValue($values, $task, 0, 'int'); if (empty($ids)) { @@ -96,7 +98,7 @@ public function remove() $eid = $this->input->get('cid', array(), 'array'); $model = $this->getModel('manage'); - JArrayHelper::toInteger($eid, array()); + $eid = ArrayHelper::toInteger($eid, array()); $model->remove($eid); $this->setRedirect(JRoute::_('index.php?option=com_installer&view=manage', false)); } @@ -118,7 +120,7 @@ public function refresh() $uid = $this->input->get('cid', array(), 'array'); $model = $this->getModel('manage'); - JArrayHelper::toInteger($uid, array()); + $uid = ArrayHelper::toInteger($uid, array()); $model->refresh($uid); $this->setRedirect(JRoute::_('index.php?option=com_installer&view=manage', false)); } diff --git a/administrator/components/com_installer/controllers/update.php b/administrator/components/com_installer/controllers/update.php index 36290c57d4896..983dc16f853d2 100644 --- a/administrator/components/com_installer/controllers/update.php +++ b/administrator/components/com_installer/controllers/update.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Installer Update Controller * @@ -32,7 +34,7 @@ public function update() $model = $this->getModel('update'); $uid = $this->input->get('cid', array(), 'array'); - JArrayHelper::toInteger($uid, array()); + $uid = ArrayHelper::toInteger($uid, array()); // Get the minimum stability. $component = JComponentHelper::getComponent('com_installer'); @@ -43,8 +45,7 @@ public function update() if ($model->getState('result', false)) { - $cache = JFactory::getCache('mod_menu'); - $cache->clean(); + JFactory::getCache('mod_menu')->clean(); } $app = JFactory::getApplication(); diff --git a/administrator/components/com_installer/controllers/updatesites.php b/administrator/components/com_installer/controllers/updatesites.php index 81b9e50cccdf6..d82355d9d0248 100644 --- a/administrator/components/com_installer/controllers/updatesites.php +++ b/administrator/components/com_installer/controllers/updatesites.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Installer Update Sites Controller * @@ -53,7 +55,7 @@ public function publish() $ids = $this->input->get('cid', array(), 'array'); $values = array('publish' => 1, 'unpublish' => 0); $task = $this->getTask(); - $value = JArrayHelper::getValue($values, $task, 0, 'int'); + $value = ArrayHelper::getValue($values, $task, 0, 'int'); if (empty($ids)) { diff --git a/administrator/components/com_installer/installer.php b/administrator/components/com_installer/installer.php index 5d00e11e4a9a7..a8726ed99b2ee 100644 --- a/administrator/components/com_installer/installer.php +++ b/administrator/components/com_installer/installer.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_installer')) { - return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Installer'); diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php index 808991ea4615e..07daf72ba011c 100644 --- a/administrator/components/com_installer/models/database.php +++ b/administrator/components/com_installer/models/database.php @@ -35,7 +35,7 @@ class InstallerModelDatabase extends InstallerModel * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'name', $direction = 'asc') { $app = JFactory::getApplication(); $this->setState('message', $app->getUserState('com_installer.message')); @@ -46,7 +46,7 @@ protected function populateState($ordering = null, $direction = null) // Prepare the utf8mb4 conversion check table $this->prepareUtf8mb4StatusTable(); - parent::populateState('name', 'asc'); + parent::populateState($ordering, $direction); } /** @@ -167,7 +167,11 @@ public function fixSchemaVersion($changeSet) ->values('700, ' . $db->quote($schema)); $db->setQuery($query); - if (!$db->execute()) + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) { return false; } diff --git a/administrator/components/com_installer/models/discover.php b/administrator/components/com_installer/models/discover.php index 2b02c55e4925b..b3ca41282bf67 100644 --- a/administrator/components/com_installer/models/discover.php +++ b/administrator/components/com_installer/models/discover.php @@ -9,7 +9,9 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/extension.php'; +use Joomla\Utilities\ArrayHelper; + +JLoader::register('InstallerModel', __DIR__ . '/extension.php'); /** * Installer Discover Model @@ -189,7 +191,7 @@ public function discover_install() $eid = array($eid); } - JArrayHelper::toInteger($eid); + $eid = ArrayHelper::toInteger($eid); $failed = false; foreach ($eid as $id) @@ -237,7 +239,11 @@ public function purge() ->where($db->quoteName('state') . ' = -1'); $db->setQuery($query); - if (!$db->execute()) + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) { $this->_message = JText::_('COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS'); diff --git a/administrator/components/com_installer/models/extension.php b/administrator/components/com_installer/models/extension.php index f9b17cc68298c..4630a0a856c6a 100644 --- a/administrator/components/com_installer/models/extension.php +++ b/administrator/components/com_installer/models/extension.php @@ -209,10 +209,8 @@ protected function translate(&$items) break; } - if (!in_array($item->type, array('language', 'template', 'library'))) - { - $item->name = JText::_($item->name); - } + // Translate the extension name if possible + $item->name = JText::_($item->name); settype($item->description, 'string'); diff --git a/administrator/components/com_installer/models/fields/extensionstatus.php b/administrator/components/com_installer/models/fields/extensionstatus.php index f9965d5eb5a5b..425367cee0dab 100644 --- a/administrator/components/com_installer/models/fields/extensionstatus.php +++ b/administrator/components/com_installer/models/fields/extensionstatus.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/installer.php'; +JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'); /** * Status Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldExtensionStatus extends JFormFieldList +class JFormFieldExtensionStatus extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_installer/models/fields/folder.php b/administrator/components/com_installer/models/fields/folder.php index c73d8007c5493..48878e49d921c 100644 --- a/administrator/components/com_installer/models/fields/folder.php +++ b/administrator/components/com_installer/models/fields/folder.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/installer.php'; +JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'); /** * Folder Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldFolder extends JFormFieldList +class JFormFieldFolder extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_installer/models/fields/location.php b/administrator/components/com_installer/models/fields/location.php index cf440c2a1cdea..25c541add72f0 100644 --- a/administrator/components/com_installer/models/fields/location.php +++ b/administrator/components/com_installer/models/fields/location.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/installer.php'; +JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'); /** * Location Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldLocation extends JFormFieldList +class JFormFieldLocation extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_installer/models/fields/type.php b/administrator/components/com_installer/models/fields/type.php index bb2e72b2d65dc..456f47c3f7c3e 100644 --- a/administrator/components/com_installer/models/fields/type.php +++ b/administrator/components/com_installer/models/fields/type.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/installer.php'; +JLoader::register('InstallerHelper', JPATH_ADMINISTRATOR . '/components/com_installer/helpers/installer.php'); /** * Type Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldType extends JFormFieldList +class JFormFieldType extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_installer/models/install.php b/administrator/components/com_installer/models/install.php index e5bf0b642d69c..8412cb9b576ff 100644 --- a/administrator/components/com_installer/models/install.php +++ b/administrator/components/com_installer/models/install.php @@ -135,6 +135,41 @@ public function install() return false; } + // Get an installer instance. + $installer = JInstaller::getInstance(); + + /* + * Check for a Joomla core package. + * To do this we need to set the source path to find the manifest (the same first step as JInstaller::install()) + * + * This must be done before the unpacked check because JInstallerHelper::detectType() returns a boolean false since the manifest + * can't be found in the expected location. + */ + if (is_array($package) && isset($package['dir']) && is_dir($package['dir'])) + { + $installer->setPath('source', $package['dir']); + + if (!$installer->findManifest()) + { + // If a manifest isn't found at the source, this may be a Joomla package; check the package directory for the Joomla manifest + if (file_exists($package['dir'] . '/administrator/manifests/files/joomla.xml')) + { + // We have a Joomla package + if (in_array($installType, array('upload', 'url'))) + { + JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']); + } + + $app->enqueueMessage( + JText::sprintf('COM_INSTALLER_UNABLE_TO_INSTALL_JOOMLA_PACKAGE', JRoute::_('index.php?option=com_joomlaupdate')), + 'warning' + ); + + return false; + } + } + } + // Was the package unpacked? if (!$package || !$package['type']) { @@ -148,9 +183,6 @@ public function install() return false; } - // Get an installer instance. - $installer = JInstaller::getInstance(); - // Install the package. if (!$installer->install($package['dir'])) { @@ -161,7 +193,7 @@ public function install() } else { - // Package installed sucessfully. + // Package installed successfully. $msg = JText::sprintf('COM_INSTALLER_INSTALL_SUCCESS', JText::_('COM_INSTALLER_TYPE_TYPE_' . strtoupper($package['type']))); $result = true; $msgType = 'message'; diff --git a/administrator/components/com_installer/models/languages.php b/administrator/components/com_installer/models/languages.php index 3cd4661cfc8ca..08df19317f2d3 100644 --- a/administrator/components/com_installer/models/languages.php +++ b/administrator/components/com_installer/models/languages.php @@ -18,19 +18,23 @@ class InstallerModelLanguages extends JModelList { /** - * @var integer Extension ID of the en-GB language pack. + * Extension ID of the en-GB language pack. + * + * @var integer * @since 3.4 */ private $enGbExtensionId = 0; /** - * @var integer Upate Site ID of the en-GB language pack. + * Upate Site ID of the en-GB language pack. + * + * @var integer * @since 3.4 */ private $updateSiteId = 0; /** - * Constructor override, defines a white list of column filters. + * Constructor override, defines a whitelist of column filters. * * @param array $config An optional associative array of configuration settings. * @@ -271,7 +275,8 @@ public function install($lids) // Could not find the url, the information in the update server may be corrupt. $message = JText::sprintf('COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_MANIFEST', $language->name); $message .= ' ' . JText::_('COM_INSTALLER_MSG_LANGUAGES_TRY_LATER'); - $app->enqueueMessage($message); + $app->enqueueMessage($message, 'warning'); + continue; } @@ -283,7 +288,8 @@ public function install($lids) // Could not find the url , maybe the url is wrong in the update server, or there is not internet access $message = JText::sprintf('COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_PACKAGE', $language->name); $message .= ' ' . JText::_('COM_INSTALLER_MSG_LANGUAGES_TRY_LATER'); - $app->enqueueMessage($message); + $app->enqueueMessage($message, 'warning'); + continue; } @@ -296,7 +302,8 @@ public function install($lids) // There was an error installing the package. $message = JText::sprintf('COM_INSTALLER_INSTALL_ERROR', $language->name); $message .= ' ' . JText::_('COM_INSTALLER_MSG_LANGUAGES_TRY_LATER'); - $app->enqueueMessage($message); + $app->enqueueMessage($message, 'error'); + continue; } @@ -306,8 +313,7 @@ public function install($lids) // Cleanup the install files in tmp folder. if (!is_file($package['packagefile'])) { - $config = JFactory::getConfig(); - $package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile']; + $package['packagefile'] = JFactory::getConfig()->get('tmp_path') . '/' . $package['packagefile']; } JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']); @@ -343,13 +349,18 @@ protected function _getLanguageManifest($uid) * * @since 2.5.7 */ - protected function _getPackageUrl( $remote_manifest ) + protected function _getPackageUrl($remote_manifest) { $update = new JUpdate; $update->loadFromXml($remote_manifest); - $package_url = trim($update->get('downloadurl', false)->_data); + $downloadUrlElement = $update->get('downloadurl', false); + + if ($downloadUrlElement === false) + { + return false; + } - return $package_url; + return trim($downloadUrlElement->_data); } /** diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php index cdd9b0486bf5f..f5bb8238daa04 100644 --- a/administrator/components/com_installer/models/manage.php +++ b/administrator/components/com_installer/models/manage.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/extension.php'; +JLoader::register('InstallerModel', __DIR__ . '/extension.php'); /** * Installer Manage Model @@ -243,7 +243,7 @@ public function remove($eid = array()) continue; } - // Package uninstalled sucessfully + // Package uninstalled successfully $msgs[] = JText::sprintf('COM_INSTALLER_UNINSTALL_SUCCESS', $rowtype); $result = true; diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php index f75fe9c3868ac..6da398fb846bd 100644 --- a/administrator/components/com_installer/models/update.php +++ b/administrator/components/com_installer/models/update.php @@ -277,7 +277,11 @@ public function purge() // This may or may not mean depending on your database $db->setQuery('TRUNCATE TABLE #__updates'); - if (!$db->execute()) + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) { $this->_message = JText::_('JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES'); @@ -311,7 +315,11 @@ public function enableSites() ->where($db->quoteName('enabled') . ' = 0'); $db->setQuery($query); - if (!$db->execute()) + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) { $this->_message .= JText::_('COM_INSTALLER_FAILED_TO_ENABLE_UPDATES'); diff --git a/administrator/components/com_installer/models/updatesites.php b/administrator/components/com_installer/models/updatesites.php index d806da9bcf8fe..a53d55c9f406f 100644 --- a/administrator/components/com_installer/models/updatesites.php +++ b/administrator/components/com_installer/models/updatesites.php @@ -9,14 +9,12 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/extension.php'; +JLoader::register('InstallerModel', __DIR__ . '/extension.php'); /** * Installer Update Sites Model * - * @package Joomla.Administrator - * @subpackage com_installer - * @since 3.4 + * @since 3.4 */ class InstallerModelUpdatesites extends InstallerModel { @@ -86,9 +84,7 @@ protected function populateState($ordering = 'name', $direction = 'asc') */ public function publish(&$eid = array(), $value = 1) { - $user = JFactory::getUser(); - - if (!$user->authorise('core.edit.state', 'com_installer')) + if (!JFactory::getUser()->authorise('core.edit.state', 'com_installer')) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 403); } @@ -133,9 +129,7 @@ public function publish(&$eid = array(), $value = 1) */ public function delete($ids = array()) { - $user = JFactory::getUser(); - - if (!$user->authorise('core.delete', 'com_installer')) + if (!JFactory::getUser()->authorise('core.delete', 'com_installer')) { throw new Exception(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 403); } @@ -160,7 +154,7 @@ public function delete($ids = array()) $updateSitesNames = $db->loadObjectList('update_site_id'); // Gets Joomla core update sites Ids. - $joomlaUpdateSitesIds = $this->getJoomlaUpdateSitesIds(); + $joomlaUpdateSitesIds = $this->getJoomlaUpdateSitesIds(0); // Enable the update site in the table and store it in the database foreach ($ids as $i => $id) @@ -218,9 +212,7 @@ public function delete($ids = array()) */ public function rebuild() { - $user = JFactory::getUser(); - - if (!$user->authorise('core.admin', 'com_installer')) + if (!JFactory::getUser()->authorise('core.admin', 'com_installer')) { throw new Exception(JText::_('COM_INSTALLER_MSG_UPDATESITES_REBUILD_NOT_PERMITTED'), 403); } @@ -228,6 +220,25 @@ public function rebuild() $db = JFactory::getDbo(); $app = JFactory::getApplication(); + // Check if Joomla Extension plugin is enabled. + if (!JPluginHelper::isEnabled('extension', 'joomla')) + { + $query = $db->getQuery(true) + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) + ->where($db->quoteName('element') . ' = ' . $db->quote('joomla')) + ->where($db->quoteName('folder') . ' = ' . $db->quote('extension')); + $db->setQuery($query); + + $pluginId = (int) $db->loadResult(); + + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $pluginId); + $app->enqueueMessage(JText::sprintf('COM_INSTALLER_MSG_UPDATESITES_REBUILD_EXTENSION_PLUGIN_NOT_ENABLED', $link), 'error'); + + return; + } + $clients = array(JPATH_SITE, JPATH_ADMINISTRATOR); $extensionGroupFolders = array('components', 'modules', 'plugins', 'templates', 'language', 'manifests'); @@ -262,29 +273,32 @@ public function rebuild() } // Gets Joomla core update sites Ids. - $joomlaUpdateSitesIds = implode(', ', $this->getJoomlaUpdateSitesIds()); + $joomlaUpdateSitesIds = implode(', ', $this->getJoomlaUpdateSitesIds(0)); // Delete from all tables (except joomla core update sites). $query = $db->getQuery(true) - ->delete($db->qn('#__update_sites')) - ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); + ->delete($db->quoteName('#__update_sites')) + ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); $db->setQuery($query); $db->execute(); $query = $db->getQuery(true) - ->delete($db->qn('#__update_sites_extensions')) - ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); + ->delete($db->quoteName('#__update_sites_extensions')) + ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); $db->setQuery($query); $db->execute(); $query = $db->getQuery(true) - ->delete($db->qn('#__updates')) - ->where($db->qn('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); + ->delete($db->quoteName('#__updates')) + ->where($db->quoteName('update_site_id') . ' NOT IN (' . $joomlaUpdateSitesIds . ')'); $db->setQuery($query); $db->execute(); $count = 0; + // Gets Joomla core extension Ids. + $joomlaCoreExtensionIds = implode(', ', $this->getJoomlaUpdateSitesIds(1)); + // Search for updateservers in manifest files inside the folders to search. foreach ($pathsToSearch as $extensionFolderPath) { @@ -310,13 +324,16 @@ public function rebuild() if (!is_null($manifest)) { + // Search if the extension exists in the extensions table. Excluding joomla core extensions (id < 10000) and discovered extensions. $query = $db->getQuery(true) - ->select($db->qn('extension_id')) - ->from($db->qn('#__extensions')) - ->where($db->qn('name') . ' = ' . $db->q($manifest->name)) - ->where($db->qn('type') . ' = ' . $db->q($manifest['type'])) - ->where($db->qn('state') . ' != -1'); + ->select($db->quoteName('extension_id')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('name') . ' = ' . $db->quote($manifest->name)) + ->where($db->quoteName('type') . ' = ' . $db->quote($manifest['type'])) + ->where($db->quoteName('extension_id') . ' NOT IN (' . $joomlaCoreExtensionIds . ')') + ->where($db->quoteName('state') . ' != -1'); $db->setQuery($query); + $eid = (int) $db->loadResult(); if ($eid && $manifest->updateservers) @@ -344,29 +361,38 @@ public function rebuild() } else { - $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_UPDATESITES_REBUILD_WARNING'), 'warning'); + $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_UPDATESITES_REBUILD_MESSAGE'), 'message'); } } /** * Fetch the Joomla update sites ids. * + * @param integer $column Column to return. 0 for update site ids, 1 for extension ids. + * * @return array Array with joomla core update site ids. * - * @since 3.6 + * @since 3.6.0 */ - protected function getJoomlaUpdateSitesIds() + protected function getJoomlaUpdateSitesIds($column = 0) { $db = JFactory::getDbo(); - // Fetch the Joomla core Joomla update sites ids. - $query = $db->getQuery(true); - $query->select($db->qn('update_site_id')) - ->from($db->qn('#__update_sites')) - ->where($db->qn('location') . ' LIKE \'%update.joomla.org%\''); + // Fetch the Joomla core update sites ids and their extension ids. We search for all except the core joomla extension with update sites. + $query = $db->getQuery(true) + ->select($db->quoteName(array('use.update_site_id', 'e.extension_id'))) + ->from($db->quoteName('#__update_sites_extensions', 'use')) + ->join('LEFT', $db->quoteName('#__update_sites', 'us') . ' ON ' . $db->qn('us.update_site_id') . ' = ' . $db->qn('use.update_site_id')) + ->join('LEFT', $db->quoteName('#__extensions', 'e') . ' ON ' . $db->qn('e.extension_id') . ' = ' . $db->qn('use.extension_id')) + ->where('(' + . '(' . $db->qn('e.type') . ' = ' . $db->quote('file') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('joomla') . ')' + . ' OR (' . $db->qn('e.type') . ' = ' . $db->quote('package') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('pkg_en-GB') . ')' + . ' OR (' . $db->qn('e.type') . ' = ' . $db->quote('component') . ' AND ' . $db->qn('e.element') . ' = ' . $db->quote('com_joomlaupdate') . ')' + . ')'); + $db->setQuery($query); - return $db->loadColumn(); + return $db->loadColumn($column); } /** diff --git a/administrator/components/com_installer/views/database/tmpl/default.php b/administrator/components/com_installer/views/database/tmpl/default.php index 71f16004412f9..e8ad84cd23882 100644 --- a/administrator/components/com_installer/views/database/tmpl/default.php +++ b/administrator/components/com_installer/views/database/tmpl/default.php @@ -22,20 +22,12 @@
errorCount === 0) : ?> -
- × - -
'other')); ?> -
- × - -
'problems')); ?> errorCount)); ?>
-
    +
      filterParams) : ?>
    • @@ -58,9 +50,8 @@ $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 690ceb89f0c84..935b82ca0496a 100644 --- a/administrator/components/com_installer/views/database/view.html.php +++ b/administrator/components/com_installer/views/database/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Manage View @@ -29,6 +29,9 @@ class InstallerViewDatabase extends InstallerViewDefault */ public function display($tpl = null) { + // Set variables + $app = JFactory::getApplication(); + // Get data from the model. $this->state = $this->get('State'); $this->changeSet = $this->get('Items'); @@ -57,6 +60,15 @@ public function display($tpl = null) $this->errorCount++; } + if ($this->errorCount === 0) + { + $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DATABASE_OK'), 'notice'); + } + else + { + $app->enqueueMessage(JText::_('COM_INSTALLER_MSG_DATABASE_ERRORS'), 'warning'); + } + parent::display($tpl); } diff --git a/administrator/components/com_installer/views/discover/view.html.php b/administrator/components/com_installer/views/discover/view.html.php index 4600284f17159..c7b312583a29f 100644 --- a/administrator/components/com_installer/views/discover/view.html.php +++ b/administrator/components/com_installer/views/discover/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Discover View diff --git a/administrator/components/com_installer/views/install/tmpl/default.php b/administrator/components/com_installer/views/install/tmpl/default.php index 1ec3d949a5132..31dd50f68985f 100644 --- a/administrator/components/com_installer/views/install/tmpl/default.php +++ b/administrator/components/com_installer/views/install/tmpl/default.php @@ -64,12 +64,6 @@ filter: alpha(opacity = 80); overflow: hidden; } - - .j-jed-message { - margin-bottom: 40px; - line-height: 2em; - color:#333333; - } ' ); @@ -79,7 +73,7 @@ // Set the first tab to active if there is no other active tab jQuery(document).ready(function($) { var hasTab = function(href){ - return $('a[data-toggle="tab"]a[href*=' + href + ']').length; + return $('a[data-toggle="tab"]a[href*="' + href + '"]').length; }; if (!hasTab(localStorage.getItem('tab-href'))) { @@ -110,12 +104,12 @@

-   

+

@@ -126,6 +120,13 @@ trigger('onInstallerViewBeforeFirstTab', array()); ?> trigger('onInstallerAddInstallationTab', array()); ?> + + +
+ +
+ + trigger('onInstallerViewAfterLastTab', array()); ?> diff --git a/administrator/components/com_installer/views/install/view.html.php b/administrator/components/com_installer/views/install/view.html.php index c61c838919232..1ede88a5fc87d 100644 --- a/administrator/components/com_installer/views/install/view.html.php +++ b/administrator/components/com_installer/views/install/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Install View diff --git a/administrator/components/com_installer/views/languages/view.html.php b/administrator/components/com_installer/views/languages/view.html.php index 0ffb1b9e836c8..59cb4b5113543 100644 --- a/administrator/components/com_installer/views/languages/view.html.php +++ b/administrator/components/com_installer/views/languages/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Language installer view diff --git a/administrator/components/com_installer/views/manage/view.html.php b/administrator/components/com_installer/views/manage/view.html.php index 95807df3a5a30..7bfa0b6bfd55e 100644 --- a/administrator/components/com_installer/views/manage/view.html.php +++ b/administrator/components/com_installer/views/manage/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Manage View diff --git a/administrator/components/com_installer/views/update/tmpl/default.php b/administrator/components/com_installer/views/update/tmpl/default.php index 31fbdd6763a69..b9cac616aabe3 100644 --- a/administrator/components/com_installer/views/update/tmpl/default.php +++ b/administrator/components/com_installer/views/update/tmpl/default.php @@ -23,116 +23,116 @@ sidebar; ?>
- -
- - showMessage) : ?> - loadTemplate('message'); ?> - + +
+ + showMessage) : ?> + loadTemplate('message'); ?> + - ftp) : ?> - loadTemplate('ftp'); ?> - + ftp) : ?> + loadTemplate('ftp'); ?> + - $this)); ?> -
- items)) : ?> -
- -
- - - - - - - - - - - - - - - - - - - - - - items as $i => $item) : ?> - client_id ? JText::_('JADMINISTRATOR') : JText::_('JSITE'); - $manifest = json_decode($item->manifest_cache); - $current_version = isset($manifest->version) ? $manifest->version : JText::_('JLIB_UNKNOWN'); - ?> - - - + + + +
- - - - - - - - - - - - - - - - - -
- pagination->getListFooter(); ?> -
- update_id); ?> - -
+ + + + +
diff --git a/administrator/components/com_installer/views/update/view.html.php b/administrator/components/com_installer/views/update/view.html.php index 325e3a5a91b8a..00559a1a7c76b 100644 --- a/administrator/components/com_installer/views/update/view.html.php +++ b/administrator/components/com_installer/views/update/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Update View diff --git a/administrator/components/com_installer/views/updatesites/view.html.php b/administrator/components/com_installer/views/updatesites/view.html.php index 66087e240c031..5b377d4d9af7d 100644 --- a/administrator/components/com_installer/views/updatesites/view.html.php +++ b/administrator/components/com_installer/views/updatesites/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Update Sites View diff --git a/administrator/components/com_installer/views/warnings/view.html.php b/administrator/components/com_installer/views/warnings/view.html.php index 5cee0fc778fa7..b8370dbb11845 100644 --- a/administrator/components/com_installer/views/warnings/view.html.php +++ b/administrator/components/com_installer/views/warnings/view.html.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -include_once __DIR__ . '/../default/view.php'; +JLoader::register('InstallerViewDefault', dirname(__DIR__) . '/default/view.php'); /** * Extension Manager Templates View diff --git a/administrator/components/com_joomlaupdate/controller.php b/administrator/components/com_joomlaupdate/controller.php index 1040f51a948f9..bbc6d79e5aa59 100644 --- a/administrator/components/com_joomlaupdate/controller.php +++ b/administrator/components/com_joomlaupdate/controller.php @@ -22,9 +22,9 @@ class JoomlaupdateController extends JControllerLegacy * @param boolean $cachable If true, the view output will be cached. * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * - * @return JController This object to support chaining. + * @return JController This object to support chaining. * - * @since 2.5.4 + * @since 2.5.4 */ public function display($cachable = false, $urlparams = false) { @@ -47,10 +47,7 @@ public function display($cachable = false, $urlparams = false) $model = $this->getModel('default'); // Push the Installer Warnings model into the view, if we can load it - if (!class_exists('InstallerModelWarnings')) - { - @include_once JPATH_ADMINISTRATOR . '/components/com_installer/models/warnings.php'; - } + static::addModelPath(JPATH_ADMINISTRATOR . '/components/com_installer/models', 'InstallerModel'); $warningsModel = $this->getModel('warnings', 'InstallerModel'); diff --git a/administrator/components/com_joomlaupdate/controllers/update.php b/administrator/components/com_joomlaupdate/controllers/update.php index 7e18a68bf49ac..e7c25d324e608 100644 --- a/administrator/components/com_joomlaupdate/controllers/update.php +++ b/administrator/components/com_joomlaupdate/controllers/update.php @@ -25,6 +25,8 @@ class JoomlaupdateControllerUpdate extends JControllerLegacy */ public function download() { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); @@ -43,7 +45,7 @@ public function download() if ($file) { JFactory::getApplication()->setUserState('com_joomlaupdate.file', $file); - $url = 'index.php?option=com_joomlaupdate&task=update.install'; + $url = 'index.php?option=com_joomlaupdate&task=update.install&' . JFactory::getSession()->getFormToken() . '=1'; JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_FILE', $file), JLog::INFO, 'Update'); } else @@ -51,6 +53,7 @@ public function download() JFactory::getApplication()->setUserState('com_joomlaupdate.file', null); $url = 'index.php?option=com_joomlaupdate'; $message = JText::_('COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED'); + $messageType = 'error'; } $this->setRedirect($url, $message, $messageType); @@ -65,6 +68,8 @@ public function download() */ public function install() { + JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN')); + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); @@ -90,6 +95,17 @@ public function install() */ public function finalise() { + /* + * Finalize with login page. Used for pre-token check versions + * to allow updates without problems but with a maximum of security. + */ + if (!JSession::checkToken('get')) + { + $this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm'); + + return false; + } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); @@ -101,7 +117,7 @@ public function finalise() $model->finaliseUpgrade(); - $url = 'index.php?option=com_joomlaupdate&task=update.cleanup'; + $url = 'index.php?option=com_joomlaupdate&task=update.cleanup&' . JFactory::getSession()->getFormToken() . '=1'; $this->setRedirect($url); } @@ -114,6 +130,17 @@ public function finalise() */ public function cleanup() { + /* + * Cleanup with login page. Used for pre-token check versions to be able to update + * from =< 3.2.7 to allow updates without problems but with a maximum of security. + */ + if (!JSession::checkToken('get')) + { + $this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm'); + + return false; + } + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); @@ -273,7 +300,7 @@ public function confirm() JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_FILE', $tempFile), JLog::INFO, 'Update'); // Redirect to the actual update page - $url = 'index.php?option=com_joomlaupdate&task=update.install'; + $url = 'index.php?option=com_joomlaupdate&task=update.install&' . JFactory::getSession()->getFormToken() . '=1'; $this->setRedirect($url); } @@ -342,4 +369,52 @@ protected function _applyCredentials() } } } + + /** + * Checks the admin has super administrator privileges and then proceeds with the final & cleanup steps. + * + * @return array + * + * @since 3.6.3 + */ + public function finaliseconfirm() + { + // Check for request forgeries + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Did a non Super User try do this? + if (!JFactory::getUser()->authorise('core.admin')) + { + throw new RuntimeException(JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403); + } + + // Get the model + /** @var JoomlaupdateModelDefault $model */ + $model = $this->getModel('default'); + + // Try to log in + $credentials = array( + 'username' => $this->input->post->get('username', '', 'username'), + 'password' => $this->input->post->get('passwd', '', 'raw'), + 'secretkey' => $this->input->post->get('secretkey', '', 'raw'), + ); + + $result = $model->captiveLogin($credentials); + + // The login fails? + if (!$result) + { + JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_CONFIRM_FINALISE_FAIL'), JLog::INFO, 'Update'); + + JFactory::getApplication()->enqueueMessage(JText::_('JGLOBAL_AUTH_INVALID_PASS'), 'warning'); + $this->setRedirect('index.php?option=com_joomlaupdate&view=update&layout=finaliseconfirm'); + + return false; + } + + JLog::add(JText::sprintf('COM_JOOMLAUPDATE_UPDATE_LOG_CONFIRM_FINALISE'), JLog::INFO, 'Update'); + + // Redirect back to the actual finalise page + $this->setRedirect('index.php?option=com_joomlaupdate&task=update.finalise&' . JFactory::getSession()->getFormToken() . '=1'); + } } diff --git a/administrator/components/com_joomlaupdate/joomlaupdate.php b/administrator/components/com_joomlaupdate/joomlaupdate.php index 939760c3830b0..55cd7f8bb65d8 100644 --- a/administrator/components/com_joomlaupdate/joomlaupdate.php +++ b/administrator/components/com_joomlaupdate/joomlaupdate.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_joomlaupdate')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Joomlaupdate'); diff --git a/administrator/components/com_joomlaupdate/joomlaupdate.xml b/administrator/components/com_joomlaupdate/joomlaupdate.xml index 71604e6a54547..85c467c9eaf35 100644 --- a/administrator/components/com_joomlaupdate/joomlaupdate.xml +++ b/administrator/components/com_joomlaupdate/joomlaupdate.xml @@ -7,7 +7,7 @@ GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org - 3.6.0 + 3.6.2 COM_JOOMLAUPDATE_XML_DESCRIPTION js diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index 4f9af0181bdf3..b3a2be07f9245 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -228,13 +228,13 @@ public function purge() if ($db->execute()) { - $this->_message = JText::_('JLIB_INSTALLER_PURGED_UPDATES'); + $this->_message = JText::_('COM_JOOMLAUPDATE_CHECKED_UPDATES'); return true; } else { - $this->_message = JText::_('JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES'); + $this->_message = JText::_('COM_JOOMLAUPDATE_FAILED_TO_CHECK_UPDATES'); return false; } @@ -251,7 +251,20 @@ public function download() { $updateInfo = $this->getUpdateInformation(); $packageURL = $updateInfo['object']->downloadurl->_data; - $basename = basename($packageURL); + $headers = get_headers($packageURL, 1); + + // Follow the Location headers until the actual download URL is known + while (isset($headers['Location'])) + { + $packageURL = $headers['Location']; + $headers = get_headers($packageURL, 1); + } + // Remove protocol, path and query string from URL + $basename = basename($packageURL); + if (strpos($basename, '?') !== false) + { + $basename = substr($basename, 0, strpos($basename, '?')); + } // Find the path to the temp directory and the local package. $config = JFactory::getConfig(); @@ -389,7 +402,7 @@ public function createRestorationFile($basename = null) $ftp_host = $app->input->get('ftp_host', ''); $ftp_port = $app->input->get('ftp_port', '21'); $ftp_user = $app->input->get('ftp_user', ''); - $ftp_pass = $app->input->get('ftp_pass', '', 'raw'); + $ftp_pass = addcslashes($app->input->get('ftp_pass', '', 'raw'), "'\\"); $ftp_root = $app->input->get('ftp_root', ''); // Is the tempdir really writable? @@ -415,7 +428,7 @@ public function createRestorationFile($basename = null) if (!$writable) { $FTPOptions = JClientHelper::getCredentials('ftp'); - $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], null, $FTPOptions['user'], $FTPOptions['pass']); + $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); $dest = JPath::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $tempdir . '/admintools'), '/'); if (!@mkdir($tempdir . '/admintools')) @@ -450,7 +463,7 @@ public function createRestorationFile($basename = null) if (!is_writable($tempdir)) { $FTPOptions = JClientHelper::getCredentials('ftp'); - $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], null, $FTPOptions['user'], $FTPOptions['pass']); + $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); $dest = JPath::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $tempdir . '/admintools'), '/'); if (!@mkdir($tempdir . '/admintools')) @@ -913,8 +926,6 @@ public function captiveLogin($credentials) } // Get the global JAuthentication object. - jimport('joomla.user.authentication'); - $authenticate = JAuthentication::getInstance(); $response = $authenticate->authenticate($credentials); diff --git a/administrator/components/com_joomlaupdate/restore.php b/administrator/components/com_joomlaupdate/restore.php index 71b248d3658a2..ae58f2d727161 100644 --- a/administrator/components/com_joomlaupdate/restore.php +++ b/administrator/components/com_joomlaupdate/restore.php @@ -2056,14 +2056,14 @@ protected abstract function readArchiveHeader(); /** * Concrete classes must use this method to read the file header - * @return bool True if reading the file was successful, false if an error occured or we reached end of archive + * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive */ protected abstract function readFileHeader(); /** * Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when * it's finished processing the file data. - * @return bool True if processing the file data was successful, false if an error occured + * @return bool True if processing the file data was successful, false if an error occurred */ protected abstract function processFileData(); @@ -4323,7 +4323,7 @@ protected function readArchiveHeader() /** * Concrete classes must use this method to read the file header - * @return bool True if reading the file was successful, false if an error occured or we reached end of archive + * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive */ protected function readFileHeader() { @@ -4576,7 +4576,7 @@ protected function readFileHeader() /** * Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when * it's finished processing the file data. - * @return bool True if processing the file data was successful, false if an error occured + * @return bool True if processing the file data was successful, false if an error occurred */ protected function processFileData() { @@ -4632,7 +4632,7 @@ private function processTypeFileUncompressed() // Can we write to the file? if( ($outfp === false) && (!$ignore) ) { - // An error occured + // An error occurred debugMsg('Could not write to output file'); $this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) ); return false; @@ -4714,7 +4714,7 @@ private function processTypeFileCompressedSimple() // Can we write to the file? $ignore = AKFactory::get('kickstart.setup.ignoreerrors', false) || $this->isIgnoredDirectory($this->fileHeader->file); if( ($outfp === false) && (!$ignore) ) { - // An error occured + // An error occurred debugMsg('Could not write to output file'); $this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) ); return false; @@ -4964,7 +4964,7 @@ protected function readArchiveHeader() /** * Concrete classes must use this method to read the file header - * @return bool True if reading the file was successful, false if an error occured or we reached end of archive + * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive */ protected function readFileHeader() { @@ -5260,7 +5260,7 @@ protected function readArchiveHeader() /** * Concrete classes must use this method to read the file header - * @return bool True if reading the file was successful, false if an error occured or we reached end of archive + * @return bool True if reading the file was successful, false if an error occurred or we reached end of archive */ protected function readFileHeader() { @@ -5485,7 +5485,7 @@ protected function readFileHeader() /** * Concrete classes must use this method to process file data. It must set $runState to AK_STATE_DATAREAD when * it's finished processing the file data. - * @return bool True if processing the file data was successful, false if an error occured + * @return bool True if processing the file data was successful, false if an error occurred */ protected function processFileData() { @@ -5537,7 +5537,7 @@ private function processTypeFileUncompressed() // Can we write to the file? if( ($outfp === false) && (!$ignore) ) { - // An error occured + // An error occurred $this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) ); return false; } @@ -5580,7 +5580,7 @@ private function processTypeFileCompressedSimple() // Can we write to the file? $ignore = AKFactory::get('kickstart.setup.ignoreerrors', false) || $this->isIgnoredDirectory($this->fileHeader->file); if( ($outfp === false) && (!$ignore) ) { - // An error occured + // An error occurred $this->setError( AKText::sprintf('COULDNT_WRITE_FILE', $this->fileHeader->realFile) ); return false; } @@ -6205,10 +6205,10 @@ class AKText extends AKAbstractObject 'RESTACLEANUP' => 'Restoration and Clean Up', 'BTN_RUNINSTALLER' => 'Run the Installer', 'BTN_CLEANUP' => 'Clean Up', - 'BTN_SITEFE' => 'Visit your site\'s front-end', - 'BTN_SITEBE' => 'Visit your site\'s back-end', + 'BTN_SITEFE' => 'Visit your site\'s frontend', + 'BTN_SITEBE' => 'Visit your site\'s backend', 'WARNINGS' => 'Extraction Warnings', - 'ERROR_OCCURED' => 'An error occured', + 'ERROR_OCCURED' => 'An error occurred', 'STEALTH_MODE' => 'Stealth mode', 'STEALTH_URL' => 'HTML file to show to web visitors', 'ERR_NOT_A_JPS_FILE' => 'The file is not a JPA archive', diff --git a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php index eae06982fc9e6..1336556d60eed 100644 --- a/administrator/components/com_joomlaupdate/views/default/tmpl/default.php +++ b/administrator/components/com_joomlaupdate/views/default/tmpl/default.php @@ -14,7 +14,7 @@ JHtml::_('jquery.framework'); JHtml::_('bootstrap.tooltip'); JHtml::_('formbehavior.chosen', 'select'); -JHtml::script('com_joomlaupdate/default.js', false, true, false); +JHtml::_('script', 'com_joomlaupdate/default.js', array('version' => 'auto', 'relative' => true)); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($) { @@ -39,15 +39,21 @@ - updateInfo['object']->downloadurl->_data) && $this->updateInfo['installed'] < $this->updateInfo['latest']) : ?> - - loadTemplate('nodownload'); ?> - updateInfo['hasUpdate']) : ?> - - loadTemplate('reinstall'); ?> + selfUpdate) : ?> + + enqueueMessage(JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST'), 'error'); ?> + loadTemplate('updatemefirst'); ?> - - loadTemplate('update'); ?> + updateInfo['object']->downloadurl->_data) && $this->updateInfo['installed'] < $this->updateInfo['latest']) : ?> + + loadTemplate('nodownload'); ?> + updateInfo['hasUpdate']) : ?> + + loadTemplate('reinstall'); ?> + + + loadTemplate('update'); ?> + @@ -56,14 +62,14 @@ - - showUploadAndUpdate) : ?> - - - loadTemplate('upload'); ?> - - - + + showUploadAndUpdate) : ?> + + + loadTemplate('upload'); ?> + + +
- - +
@@ -65,7 +89,7 @@
-
+
@@ -91,7 +115,7 @@
state->get('field.id')):?> -
+
@@ -109,7 +133,7 @@
-
+
@@ -150,8 +174,12 @@
- -

config->get('upload_maxsize') == '0' ? JText::_('COM_MEDIA_UPLOAD_FILES_NOLIMIT') : JText::sprintf('COM_MEDIA_UPLOAD_FILES', $this->config->get('upload_maxsize')); ?>

+ +

+ config->get('upload_maxsize'); ?> + + +

diff --git a/administrator/components/com_media/views/imageslist/tmpl/default.php b/administrator/components/com_media/views/imageslist/tmpl/default.php index 8bbe21a3c4c11..9b850963bdfe0 100644 --- a/administrator/components/com_media/views/imageslist/tmpl/default.php +++ b/administrator/components/com_media/views/imageslist/tmpl/default.php @@ -11,11 +11,11 @@ $lang = JFactory::getLanguage(); -JHtml::_('stylesheet', 'media/popup-imagelist.css', array(), true); +JHtml::_('stylesheet', 'media/popup-imagelist.css', array('version' => 'auto', 'relative' => true)); if ($lang->isRtl()) { - JHtml::_('stylesheet', 'media/popup-imagelist_rtl.css', array(), true); + JHtml::_('stylesheet', 'media/popup-imagelist_rtl.css', array('version' => 'auto', 'relative' => true)); } JFactory::getDocument()->addScriptDeclaration("var ImageManager = window.parent.ImageManager;"); diff --git a/administrator/components/com_media/views/media/tmpl/default.php b/administrator/components/com_media/views/media/tmpl/default.php index bcf405961f0ab..8a08f8f8100be 100644 --- a/administrator/components/com_media/views/media/tmpl/default.php +++ b/administrator/components/com_media/views/media/tmpl/default.php @@ -32,14 +32,14 @@ JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.framework'); -JHtml::_('script', 'media/mediamanager.min.js', false, true); -JHtml::_('script', 'media/mediaelement-and-player.js', false, true); -JHtml::_('stylesheet', 'media/mediaelementplayer.css', array(), true); -JHtml::_('stylesheet', 'system/mootree.css', array(), true); +JHtml::_('script', 'media/mediamanager.min.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('script', 'media/mediaelement-and-player.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('stylesheet', 'media/mediaelementplayer.css', array('version' => 'auto', 'relative' => true)); +JHtml::_('stylesheet', 'system/mootree.css', array('version' => 'auto', 'relative' => true)); if ($lang->isRtl()) { - JHtml::_('stylesheet', 'media/mootree_rtl.css', array(), true); + JHtml::_('stylesheet', 'system/mootree_rtl.css', array('version' => 'auto', 'relative' => true)); } ?>
@@ -87,8 +87,12 @@
- -

config->get('upload_maxsize') == '0' ? JText::_('COM_MEDIA_UPLOAD_FILES_NOLIMIT') : JText::sprintf('COM_MEDIA_UPLOAD_FILES', $this->config->get('upload_maxsize')); ?>

+ +

+ config->get('upload_maxsize'); ?> + + +

set('com_media.return_url', 'index.php?option=com_media'); ?> @@ -99,7 +103,7 @@
- +
@@ -124,8 +128,8 @@ 'imagePreview', array( 'title' => JText::_('COM_MEDIA_PREVIEW'), - 'footer' => '' + 'footer' => '' ), '
preview
' ); @@ -135,8 +139,8 @@ 'videoPreview', array( 'title' => JText::_('COM_MEDIA_PREVIEW'), - 'footer' => '' + 'footer' => '' ), '
' ); diff --git a/administrator/components/com_media/views/medialist/tmpl/details.php b/administrator/components/com_media/views/medialist/tmpl/details.php index c17b907deaa58..fa6cd1fa9b91b 100644 --- a/administrator/components/com_media/views/medialist/tmpl/details.php +++ b/administrator/components/com_media/views/medialist/tmpl/details.php @@ -8,13 +8,46 @@ */ defined('_JEXEC') or die; -$user = JFactory::getUser(); $params = JComponentHelper::getParams('com_media'); $path = 'file_path'; JHtml::_('jquery.framework'); +JHtml::_('behavior.core'); -JFactory::getDocument()->addScriptDeclaration( +$doc = JFactory::getDocument(); + +// Need to override this core function because we use a different form id +$doc->addScriptDeclaration( + " + Joomla.isChecked = function( isitchecked, form ) { + if ( typeof form === 'undefined' ) { + form = document.getElementById( 'mediamanager-form' ); + } + + form.boxchecked.value += isitchecked ? 1 : -1; + + // If we don't have a checkall-toggle, done. + if ( !form.elements[ 'checkall-toggle' ] ) return; + + // Toggle main toggle checkbox depending on checkbox selection + var c = true, + i, e, n; + + for ( i = 0, n = form.elements.length; i < n; i++ ) { + e = form.elements[ i ]; + + if ( e.type == 'checkbox' && e.name != 'checkall-toggle' && !e.checked ) { + c = false; + break; + } + } + + form.elements[ 'checkall-toggle' ].checked = c; + }; + " +); + +$doc->addScriptDeclaration( " jQuery(document).ready(function($){ window.parent.document.updateUploader(); @@ -52,55 +85,46 @@

- state->folder != '') : ?> - get($path, 'images') . '/' . $this->state->folder; ?> - - get($path, 'images'); ?> - + get($path, 'images'), + ($this->state->folder != '') ? '/' . $this->state->folder : ''; + ?>

- - - - - - - - authorise('core.delete', 'com_media')):?> - - - - - - loadTemplate('up'); ?> - - folders); $i < $n; $i++) : - $this->setFolder($i); - echo $this->loadTemplate('folder'); - endfor; ?> - - documents); $i < $n; $i++) : - $this->setDoc($i); - echo $this->loadTemplate('doc'); - endfor; ?> - - videos); $i < $n; $i++) : - $this->setVideo($i); - echo $this->loadTemplate('video'); - endfor; ?> - - images); $i < $n; $i++) : - $this->setImage($i); - echo $this->loadTemplate('img'); - endfor; ?> - - -
+ + + + + + + + + canDelete) : ?> + + + + + + loadTemplate('up'), + $this->loadTemplate('folders'), + $this->loadTemplate('docs'), + $this->loadTemplate('videos'), + $this->loadTemplate('imgs'); + ?> + +
+ + +
+
+ + -
diff --git a/administrator/components/com_media/views/medialist/tmpl/details_doc.php b/administrator/components/com_media/views/medialist/tmpl/details_doc.php deleted file mode 100644 index f75420636886b..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/details_doc.php +++ /dev/null @@ -1,42 +0,0 @@ -trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); -?> - - - - - _tmp_doc->icon_16, $this->_tmp_doc->title, null, true, true) ? JHtml::_('image', $this->_tmp_doc->icon_16, $this->_tmp_doc->title, array('width' => 16, 'height' => 16), true) : JHtml::_('image', 'media/con_info.png', $this->_tmp_doc->title, array('width' => 16, 'height' => 16), true);?> - - - _tmp_doc->title; ?> - -   - - - - _tmp_doc->size); ?> - -authorise('core.delete', 'com_media')):?> - - - - - - -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_docs.php b/administrator/components/com_media/views/medialist/tmpl/details_docs.php new file mode 100644 index 0000000000000..7a126f00d9462 --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/details_docs.php @@ -0,0 +1,49 @@ + + +documents as $i => $doc) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params)); ?> + + + + icon_16, $doc->title, null, true, true) ? JHtml::_('image', $doc->icon_16, $doc->title, array('width' => 16, 'height' => 16), true) : JHtml::_('image', 'media/con_info.png', $doc->title, array('width' => 16, 'height' => 16), true); ?> + + + + + title; ?> + + +   + + + size); ?> + + + canDelete) : ?> + + + + + name, false, 'rm', 'cb-document'); ?> + + + + + trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/tmpl/details_folder.php b/administrator/components/com_media/views/medialist/tmpl/details_folder.php deleted file mode 100644 index 8f2467c9699fe..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/details_folder.php +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - _tmp_folder->name; ?> - -   - - -   - - - authorise('core.delete', 'com_media')):?> - - - - - - diff --git a/administrator/components/com_media/views/medialist/tmpl/details_folders.php b/administrator/components/com_media/views/medialist/tmpl/details_folders.php new file mode 100644 index 0000000000000..526286fbfbb99 --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/details_folders.php @@ -0,0 +1,38 @@ + + +folders as $i => $folder) : ?> + path_relative; ?> + + + + + + + name; ?> + + +   + +   + + canDelete) : ?> + + + + + name, false, 'rm', 'cb-folder'); ?> + + + + diff --git a/administrator/components/com_media/views/medialist/tmpl/details_img.php b/administrator/components/com_media/views/medialist/tmpl/details_img.php deleted file mode 100644 index fab73ddd9d32f..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/details_img.php +++ /dev/null @@ -1,42 +0,0 @@ -trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params)); -?> - - - - _tmp_img->path_relative, JText::sprintf('COM_MEDIA_IMAGE_TITLE', $this->_tmp_img->title, JHtml::_('number.bytes', $this->_tmp_img->size)), array('width' => $this->_tmp_img->width_16, 'height' => $this->_tmp_img->height_16)); ?> - - - escape($this->_tmp_img->title); ?> - - - _tmp_img->width, $this->_tmp_img->height); ?> - - - _tmp_img->size); ?> - - authorise('core.delete', 'com_media')):?> - - - - - - -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_imgs.php b/administrator/components/com_media/views/medialist/tmpl/details_imgs.php new file mode 100644 index 0000000000000..1f2727542db41 --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/details_imgs.php @@ -0,0 +1,54 @@ + + +images as $i => $image) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$image, &$params)); ?> + + + + path_relative, JText::sprintf('COM_MEDIA_IMAGE_TITLE', $image->title, JHtml::_('number.bytes', $image->size)), array('width' => $image->width_16, 'height' => $image->height_16)); ?> + + + + + + escape($image->title); ?> + + + + + width, $image->height); ?> + + + + size); ?> + + + canDelete) : ?> + + + + + name, false, 'rm', 'cb-image'); ?> + + + + trigger('onContentAfterDisplay', array('com_media.file', &$image, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/tmpl/details_video.php b/administrator/components/com_media/views/medialist/tmpl/details_video.php deleted file mode 100644 index 7cc7e71f1177e..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/details_video.php +++ /dev/null @@ -1,54 +0,0 @@ -trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_video, &$params)); - -JFactory::getDocument()->addScriptDeclaration(" -jQuery(document).ready(function($){ - window.parent.jQuery('#videoPreview').on('hidden', function () { - window.parent.jQuery('#mejsPlayer')[0].player.pause(); - }); -}); -"); -?> - - - - _tmp_video->icon_16, $this->_tmp_video->title, null, true); ?> - - - - _tmp_video->name, 10, false); ?> - - - - - - - _tmp_video->size); ?> - - authorise('core.delete', 'com_media')):?> - - - - - - - -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_video, &$params)); diff --git a/administrator/components/com_media/views/medialist/tmpl/details_videos.php b/administrator/components/com_media/views/medialist/tmpl/details_videos.php new file mode 100644 index 0000000000000..a7980c0bac40b --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/details_videos.php @@ -0,0 +1,62 @@ +addScriptDeclaration(" +jQuery(document).ready(function($){ + window.parent.jQuery('#videoPreview').on('hidden', function () { + window.parent.jQuery('#mejsPlayer')[0].player.pause(); + }); +}); +"); +?> + +videos as $i => $video) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params)); ?> + + + + icon_16, $video->title, null, true); ?> + + + + + + name, 10, false); ?> + + + + + + + + + size); ?> + + + canDelete) : ?> + + + + + name, false, 'rm', 'cb-video'); ?> + + + + + trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs.php b/administrator/components/com_media/views/medialist/tmpl/thumbs.php index 7a2de699ad51d..a3eefc89de627 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs.php @@ -12,8 +12,42 @@ $path = 'file_path'; JHtml::_('jquery.framework'); +JHtml::_('behavior.core'); -JFactory::getDocument()->addScriptDeclaration( +$doc = JFactory::getDocument(); + +// Need to override this core function because we use a different form id +$doc->addScriptDeclaration( + " + Joomla.isChecked = function( isitchecked, form ) { + if ( typeof form === 'undefined' ) { + form = document.getElementById( 'mediamanager-form' ); + } + + form.boxchecked.value += isitchecked ? 1 : -1; + + // If we don't have a checkall-toggle, done. + if ( !form.elements[ 'checkall-toggle' ] ) return; + + // Toggle main toggle checkbox depending on checkbox selection + var c = true, + i, e, n; + + for ( i = 0, n = form.elements.length; i < n; i++ ) { + e = form.elements[ i ]; + + if ( e.type == 'checkbox' && e.name != 'checkall-toggle' && !e.checked ) { + c = false; + break; + } + } + + form.elements[ 'checkall-toggle' ].checked = c; + }; + " +); + +$doc->addScriptDeclaration( " jQuery(document).ready(function($){ window.parent.document.updateUploader(); @@ -51,42 +85,34 @@

- state->folder != '') : ?> - get($path, 'images') . '/' . $this->state->folder; ?> - - get($path, 'images'); ?> - + get($path, 'images'), + ($this->state->folder != '') ? '/' . $this->state->folder : ''; + ?>

+
+ +
+
    loadTemplate('up'); + echo $this->loadTemplate('up'), + $this->loadTemplate('folders'), + $this->loadTemplate('docs'), + $this->loadTemplate('videos'), + $this->loadTemplate('imgs'); ?> - folders); $i < $n; $i++) : - $this->setFolder($i); - echo $this->loadTemplate('folder'); - endfor; ?> - - documents); $i < $n; $i++) : - $this->setDoc($i); - echo $this->loadTemplate('doc'); - endfor; ?> - - videos); $i < $n; $i++) : - $this->setVideo($i); - echo $this->loadTemplate('video'); - endfor; ?> - - images); $i < $n; $i++) : - $this->setImage($i); - echo $this->loadTemplate('img'); - endfor; ?> - +
diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_doc.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_doc.php deleted file mode 100644 index 146f250cbcc56..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_doc.php +++ /dev/null @@ -1,34 +0,0 @@ -trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); -?> - -
  • - authorise('core.delete', 'com_media')):?> - × - -
    - - -
    - _tmp_doc->name, 10, false); ?> -
    -
  • -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_doc, &$params)); diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php new file mode 100644 index 0000000000000..3c9c4940ea8a4 --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_docs.php @@ -0,0 +1,40 @@ + + +documents as $i => $doc) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$doc, &$params)); ?> +
  • + canDelete) : ?> + × +
    + name, false, 'rm', 'cb-document'); ?> +
    +
    + + + + +
    + name, 10, false); ?> +
    +
  • + trigger('onContentAfterDisplay', array('com_media.file', &$doc, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_folder.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_folder.php deleted file mode 100644 index 113073dd5430c..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_folder.php +++ /dev/null @@ -1,28 +0,0 @@ - -
  • - authorise('core.delete', 'com_media')):?> - × - -
    - -
    - - - -
    - -
  • diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_folders.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_folders.php new file mode 100644 index 0000000000000..31cf6eb08b20c --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_folders.php @@ -0,0 +1,35 @@ + +folders as $i => $folder) : ?> +
  • + canDelete):?> + × +
    + name, false, 'rm', 'cb-folder'); ?> +
    +
    + + +
    + + + +
    + + +
  • + diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_img.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_img.php deleted file mode 100644 index 7206239e652e4..0000000000000 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_img.php +++ /dev/null @@ -1,37 +0,0 @@ -trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params)); -?> - -
  • - authorise('core.delete', 'com_media')):?> - × - -
    - - - -
  • -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_img, &$params)); diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php new file mode 100644 index 0000000000000..8a06417c52ea9 --- /dev/null +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_imgs.php @@ -0,0 +1,44 @@ + + +images as $i => $img) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$img, &$params)); ?> +
  • + canDelete):?> + × +
    + name, false, 'rm', 'cb-image'); ?> +
    +
    + + + + + +
  • + trigger('onContentAfterDisplay', array('com_media.file', &$img, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_video.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php similarity index 51% rename from administrator/components/com_media/views/medialist/tmpl/thumbs_video.php rename to administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php index e479e50687e8a..4676a5837116b 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_video.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php @@ -11,10 +11,8 @@ use Joomla\Registry\Registry; -$user = JFactory::getUser(); $params = new Registry; $dispatcher = JEventDispatcher::getInstance(); -$dispatcher->trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_video, &$params)); JFactory::getDocument()->addScriptDeclaration(" jQuery(document).ready(function($){ @@ -24,22 +22,26 @@ }); "); ?> - +videos as $i => $video) : ?> + trigger('onContentBeforeDisplay', array('com_media.file', &$video, &$params)); ?>
  • - authorise('core.delete', 'com_media')):?> - × - + canDelete):?> + × +
    + name, false, 'rm', 'cb-video'); ?> +
    +
    - _tmp_video->icon_32, $this->_tmp_video->title, null, true); ?> + icon_32, $video->title, null, true); ?>
    +
  • -trigger('onContentAfterDisplay', array('com_media.file', &$this->_tmp_video, &$params)); + trigger('onContentAfterDisplay', array('com_media.file', &$video, &$params)); ?> + diff --git a/administrator/components/com_media/views/medialist/view.html.php b/administrator/components/com_media/views/medialist/view.html.php index ae897dcd061c8..bb6e86b7b9347 100644 --- a/administrator/components/com_media/views/medialist/view.html.php +++ b/administrator/components/com_media/views/medialist/view.html.php @@ -37,14 +37,14 @@ public function display($tpl = null) // Do not allow cache $app->allowCache(false); - $images = $this->get('images'); - $documents = $this->get('documents'); - $folders = $this->get('folders'); - $videos = $this->get('videos'); - $state = $this->get('state'); + $this->images = $this->get('images'); + $this->documents = $this->get('documents'); + $this->folders = $this->get('folders'); + $this->videos = $this->get('videos'); + $this->state = $this->get('state'); // Check for invalid folder name - if (empty($state->folder)) + if (empty($this->state->folder)) { $dirname = JFactory::getApplication()->input->getPath('folder', ''); @@ -55,97 +55,9 @@ public function display($tpl = null) } } - $this->baseURL = JUri::root(); - $this->images = &$images; - $this->documents = &$documents; - $this->folders = &$folders; - $this->state = &$state; - $this->videos = &$videos; + $user = JFactory::getUser(); + $this->canDelete = $user->authorise('core.delete', 'com_media'); parent::display($tpl); } - - /** - * Set the active folder - * - * @param integer $index Folder position - * - * @return void - * - * @since 1.0 - */ - public function setFolder($index = 0) - { - if (isset($this->folders[$index])) - { - $this->_tmp_folder = &$this->folders[$index]; - } - else - { - $this->_tmp_folder = new JObject; - } - } - - /** - * Set the active image - * - * @param integer $index Image position - * - * @return void - * - * @since 1.0 - */ - public function setImage($index = 0) - { - if (isset($this->images[$index])) - { - $this->_tmp_img = &$this->images[$index]; - } - else - { - $this->_tmp_img = new JObject; - } - } - - /** - * Set the active doc - * - * @param integer $index Doc position - * - * @return void - * - * @since 1.0 - */ - public function setDoc($index = 0) - { - if (isset($this->documents[$index])) - { - $this->_tmp_doc = &$this->documents[$index]; - } - else - { - $this->_tmp_doc = new JObject; - } - } - - /** - * Set the active video - * - * @param integer $index Doc position - * - * @return void - * - * @since 3.5 - */ - public function setVideo($index = 0) - { - if (isset($this->videos[$index])) - { - $this->_tmp_video = &$this->videos[$index]; - } - else - { - $this->_tmp_video = new JObject; - } - } } diff --git a/administrator/components/com_menus/controller.php b/administrator/components/com_menus/controller.php index 18aa9a4a9a8be..2d903fc27d082 100644 --- a/administrator/components/com_menus/controller.php +++ b/administrator/components/com_menus/controller.php @@ -28,10 +28,8 @@ class MenusController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/menus.php'; + JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); - parent::display(); - - return $this; + return parent::display(); } } diff --git a/administrator/components/com_menus/controllers/item.php b/administrator/components/com_menus/controllers/item.php index f1dc269786836..a6ed2e49ef24a 100644 --- a/administrator/components/com_menus/controllers/item.php +++ b/administrator/components/com_menus/controllers/item.php @@ -388,7 +388,7 @@ public function save($key = null, $urlVar = null) // Redirect back to the edit screen. $editUrl = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($recordId); - $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'warning'); + $this->setMessage(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error'); $this->setRedirect(JRoute::_($editUrl, false)); return false; diff --git a/administrator/components/com_menus/controllers/items.php b/administrator/components/com_menus/controllers/items.php index 420f9b8da488b..6cca36ba32f18 100644 --- a/administrator/components/com_menus/controllers/items.php +++ b/administrator/components/com_menus/controllers/items.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * The Menu Item Controller * @@ -126,7 +128,7 @@ public function setDefault() $cid = $this->input->get('cid', array(), 'array'); $data = array('setDefault' => 1, 'unsetDefault' => 0); $task = $this->getTask(); - $value = JArrayHelper::getValue($data, $task, 0, 'int'); + $value = ArrayHelper::getValue($data, $task, 0, 'int'); if (empty($cid)) { @@ -138,7 +140,7 @@ public function setDefault() $model = $this->getModel(); // Make sure the item ids are integers - JArrayHelper::toInteger($cid); + $cid = ArrayHelper::toInteger($cid); // Publish the items. if (!$model->setHome($cid, $value)) @@ -184,7 +186,7 @@ public function publish() $cid = JFactory::getApplication()->input->get('cid', array(), 'array'); $data = array('publish' => 1, 'unpublish' => 0, 'trash' => -2, 'report' => -3); $task = $this->getTask(); - $value = JArrayHelper::getValue($data, $task, 0, 'int'); + $value = ArrayHelper::getValue($data, $task, 0, 'int'); if (empty($cid)) { @@ -196,7 +198,7 @@ public function publish() $model = $this->getModel(); // Make sure the item ids are integers - JArrayHelper::toInteger($cid); + $cid = ArrayHelper::toInteger($cid); // Publish the items. try diff --git a/administrator/components/com_menus/controllers/menu.php b/administrator/components/com_menus/controllers/menu.php index 068fd78652c19..8ef083144995f 100644 --- a/administrator/components/com_menus/controllers/menu.php +++ b/administrator/components/com_menus/controllers/menu.php @@ -63,7 +63,7 @@ public function save($key = null, $urlVar = null) return false; } - // Prevent using 'menu' or 'main' as menutype as this is reserved for back-end menus + // Prevent using 'menu' or 'main' as menutype as this is reserved for backend menus if (strtolower($data['menutype']) == 'menu' || strtolower($data['menutype']) == 'main') { $msg = JText::_('COM_MENUS_ERROR_MENUTYPE'); diff --git a/administrator/components/com_menus/controllers/menus.php b/administrator/components/com_menus/controllers/menus.php index d2020e731816b..a7743bfeef0b1 100644 --- a/administrator/components/com_menus/controllers/menus.php +++ b/administrator/components/com_menus/controllers/menus.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * The Menu List Controller * @@ -43,9 +45,7 @@ public function display($cachable = false, $urlparams = false) */ public function getModel($name = 'Menu', $prefix = 'MenusModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** @@ -60,30 +60,44 @@ public function delete() // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); - // Get items to remove from the request. - $cid = $this->input->get('cid', array(), 'array'); + $user = JFactory::getUser(); + $app = JFactory::getApplication(); + $cids = (array) $this->input->get('cid', array(), 'array'); - if (!is_array($cid) || count($cid) < 1) + if (count($cids) < 1) { - JError::raiseWarning(500, JText::_('COM_MENUS_NO_MENUS_SELECTED')); + $app->enqueueMessage(JText::_('COM_MENUS_NO_MENUS_SELECTED'), 'notice'); } else { - // Get the model. - $model = $this->getModel(); - - // Make sure the item ids are integers - jimport('joomla.utilities.arrayhelper'); - JArrayHelper::toInteger($cid); - - // Remove the items. - if (!$model->delete($cid)) + // Access checks. + foreach ($cids as $i => $id) { - $this->setMessage($model->getError()); + if (!$user->authorise('core.delete', 'com_menus.menu.' . (int) $id)) + { + // Prune items that you can't change. + unset($cids[$i]); + $app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'error'); + } } - else + + if (count($cids) > 0) { - $this->setMessage(JText::plural('COM_MENUS_N_MENUS_DELETED', count($cid))); + // Get the model. + $model = $this->getModel(); + + // Make sure the item ids are integers + $cids = ArrayHelper::toInteger($cids); + + // Remove the items. + if (!$model->delete($cids)) + { + $this->setMessage($model->getError()); + } + else + { + $this->setMessage(JText::plural('COM_MENUS_N_MENUS_DELETED', count($cids))); + } } } @@ -124,9 +138,9 @@ public function rebuild() /** * Temporary method. This should go into the 1.5 to 1.6 upgrade routines. * - * @return void + * @return JException|void JException instance on error * - * @since 1.6 + * @since 1.6 */ public function resync() { diff --git a/administrator/components/com_menus/helpers/html/menus.php b/administrator/components/com_menus/helpers/html/menus.php index e2e3e8e711e24..353ef838f325e 100644 --- a/administrator/components/com_menus/helpers/html/menus.php +++ b/administrator/components/com_menus/helpers/html/menus.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Registry\Registry; + JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** @@ -43,7 +45,7 @@ public static function association($itemid) $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('m.id, m.title') - ->select('l.sef as lang_sef') + ->select('l.sef as lang_sef, l.lang_code') ->select('mt.title as menu_title') ->from('#__menu as m') ->join('LEFT', '#__menu_types as mt ON mt.menutype=m.menutype') @@ -69,20 +71,18 @@ public static function association($itemid) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_menus&task=item.edit&id=' . (int) $item->id); - $tooltipParts = array( - JHtml::_('image', 'mod_languages/' . $item->image . '.gif', - $item->language_title, - array('title' => $item->language_title), - true - ), - $item->title, - '(' . $item->menu_title . ')' - ); - $class = 'hasTooltip label label-association label-' . $item->lang_sef; - $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, $class); + + $tooltip = $item->title . '
    ' . JText::sprintf('COM_MENUS_MENU_SPRINTF', $item->menu_title); + $classes = 'hasPopover label label-association label-' . $item->lang_sef; + + $item->link = '' + . $text . ''; } } + JHtml::_('bootstrap.popover'); + $html = JLayoutHelper::render('joomla.content.associations', $items); } @@ -227,4 +227,31 @@ public static function state($value, $i, $enabled = true, $checkbox = 'cb') return JHtml::_('jgrid.state', $states, $value, $i, 'items.', $enabled, true, $checkbox); } + + /** + * Returns a visibility state on a grid + * + * @param integer $params Params of item. + * + * @return string The Html code + * + * @since __DEPLOY_VERSION__ + */ + public static function visibility($params) + { + $registry = new Registry; + + try + { + $registry->loadString($params); + } + catch (Exception $e) + { + // Invalid JSON + } + + $show_menu = $registry->get('menu_show'); + + return ($show_menu === 0) ? '' . JText::_('COM_MENUS_LABEL_HIDDEN') . '' : ''; + } } diff --git a/administrator/components/com_menus/helpers/menus.php b/administrator/components/com_menus/helpers/menus.php index 38488fd790167..b324004e9b253 100644 --- a/administrator/components/com_menus/helpers/menus.php +++ b/administrator/components/com_menus/helpers/menus.php @@ -159,12 +159,11 @@ public static function getMenuLinks($menuType = null, $parentId = 0, $mode = 0, a.checked_out, a.language, a.lft') - ->from('#__menu AS a') - ->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); + ->from('#__menu AS a'); if (JLanguageMultilang::isEnabled()) { - $query->select('l.title AS language_title, l.image AS language_image') + $query->select('l.title AS language_title, l.image AS language_image, l.sef AS language_sef') ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); } diff --git a/administrator/components/com_menus/menus.php b/administrator/components/com_menus/menus.php index d65440794e602..e4453e9202066 100644 --- a/administrator/components/com_menus/menus.php +++ b/administrator/components/com_menus/menus.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_menus')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Menus'); diff --git a/administrator/components/com_menus/models/fields/menuordering.php b/administrator/components/com_menus/models/fields/menuordering.php index d78d8e19252e5..2e25df45651ae 100644 --- a/administrator/components/com_menus/models/fields/menuordering.php +++ b/administrator/components/com_menus/models/fields/menuordering.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldMenuOrdering extends JFormFieldList +class JFormFieldMenuOrdering extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_menus/models/fields/menuparent.php b/administrator/components/com_menus/models/fields/menuparent.php index 6f247e912c7ae..fe25a5591b2b9 100644 --- a/administrator/components/com_menus/models/fields/menuparent.php +++ b/administrator/components/com_menus/models/fields/menuparent.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldMenuParent extends JFormFieldList +class JFormFieldMenuParent extends JFormAbstractlist { /** * The form field type. @@ -39,10 +37,10 @@ protected function getOptions() $db = JFactory::getDbo(); $query = $db->getQuery(true) - ->select('a.id AS value, a.title AS text, a.level') - ->from('#__menu AS a') - ->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); + ->select('DISTINCT(a.id) AS value, a.title AS text, a.level, a.lft') + ->from('#__menu AS a'); + // Filter by menu type. if ($menuType = $this->form->getValue('menutype')) { $query->where('a.menutype = ' . $db->quote($menuType)); @@ -52,6 +50,14 @@ protected function getOptions() $query->where('a.menutype != ' . $db->quote('')); } + // Filter by client id. + $clientId = $this->getAttribute('clientid'); + + if (!is_null($clientId)) + { + $query->where($db->quoteName('a.client_id') . ' = ' . (int) $clientId); + } + // Prevent parenting to children of this item. if ($id = $this->form->getValue('id')) { @@ -60,7 +66,6 @@ protected function getOptions() } $query->where('a.published != -2') - ->group('a.id, a.title, a.level, a.lft, a.rgt, a.menutype, a.parent_id, a.published') ->order('a.lft ASC'); // Get the options. diff --git a/administrator/components/com_menus/models/fields/menutype.php b/administrator/components/com_menus/models/fields/menutype.php index 078b599126b5d..4bc104fc59485 100644 --- a/administrator/components/com_menus/models/fields/menutype.php +++ b/administrator/components/com_menus/models/fields/menutype.php @@ -9,19 +9,19 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); +use Joomla\Utilities\ArrayHelper; /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldMenutype extends JFormFieldList +class JFormFieldMenutype extends JFormAbstractlist { /** * The form field type. * - * @var string + * @var string * @since 1.6 */ protected $type = 'menutype'; @@ -29,7 +29,7 @@ class JFormFieldMenutype extends JFormFieldList /** * Method to get the field input markup. * - * @return string The field input markup. + * @return string The field input markup. * * @since 1.6 */ @@ -67,7 +67,7 @@ protected function getInput() $link = $this->form->getValue('link'); // Clean the link back to the option, view and layout - $value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link))); + $value = JText::_(ArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link))); break; } // Include jQuery @@ -96,8 +96,8 @@ function jSelectPosition_' . $this->id . '(name) { 'height' => '300px', 'modalWidth' => '80', 'bodyHeight' => '70', - 'footer' => '' + 'footer' => '' ) ); $html[] = 'id . "(id, title, object) { + window.processModalSelect('Item', '" . $this->id . "', id, title, '', object); + } + "); + + $scriptSelect[$this->id] = true; + } + } + + // Setup variables for display. + $linkItems = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $linkItem = 'index.php?option=com_menus&view=item&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $modalTitle = JText::_('COM_MENUS_CHANGE_MENUITEM'); + + if (isset($this->element['language'])) + { + $linkItems .= '&forcedLanguage=' . $this->element['language']; + $linkItem .= '&forcedLanguage=' . $this->element['language']; + $modalTitle .= ' — ' . $this->element['label']; + } + + $urlSelect = $linkItems . '&function=jSelectMenu_' . $this->id; + $urlEdit = $linkItem . '&task=item.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \''; + $urlNew = $linkItem . '&task=item.add'; + + if ($value) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('title')) + ->from($db->quoteName('#__menu')) + ->where($db->quoteName('id') . ' = ' . (int) $value); + + $db->setQuery($query); + + try + { + $title = $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + } + + $title = empty($title) ? JText::_('COM_MENUS_SELECT_A_MENUITEM') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); + + // The current menu item display field. + $html = ''; + $html .= ''; + + // Select menu item button + if ($allowSelect) + { + $html .= '' + . ' ' . JText::_('JSELECT') + . ''; + } + + // New menu item button + if ($allowNew) + { + $html .= '' + . ' ' . JText::_('JACTION_CREATE') + . ''; + } + + // Edit menu item button + if ($allowEdit) + { + $html .= '' + . ' ' . JText::_('JACTION_EDIT') + . ''; + } + + // Clear menu item button + if ($allowClear) + { + $html .= '' + . '' . JText::_('JCLEAR') + . ''; + } + + $html .= ''; + + // Select menu item modal + if ($allowSelect) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalSelect' . $modalId, + array( + 'title' => $modalTitle, + 'url' => $urlSelect, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '', + ) + ); + } + + // New menu item modal + if ($allowNew) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalNew' . $modalId, + array( + 'title' => JText::_('COM_MENUS_NEW_MENUITEM'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlNew, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } + + // Edit menu item modal + if ($allowEdit) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalEdit' . $modalId, + array( + 'title' => JText::_('COM_MENUS_EDIT_MENUITEM'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlEdit, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } + + // Note: class='required' for client side validation. + $class = $this->required ? ' class="required modal-value"' : ''; + + $html .= ''; + + return $html; + } + + /** + * Method to get the field label markup. + * + * @return string The field label markup. + * + * @since __DEPLOY_VERSION__ + */ + protected function getLabel() + { + return str_replace($this->id, $this->id . '_id', parent::getLabel()); + } +} diff --git a/administrator/components/com_menus/models/forms/filter_items.xml b/administrator/components/com_menus/models/forms/filter_items.xml index dd6d8fcc5cfe6..d9d407a746c3f 100644 --- a/administrator/components/com_menus/models/forms/filter_items.xml +++ b/administrator/components/com_menus/models/forms/filter_items.xml @@ -8,7 +8,7 @@ onchange="this.form.submit();" accesstype="manage" > - + JSTATUS_DESC - - + + diff --git a/administrator/components/com_menus/models/forms/item.xml b/administrator/components/com_menus/models/forms/item.xml index e11df1bfbe2ff..04eb44dcb9204 100644 --- a/administrator/components/com_menus/models/forms/item.xml +++ b/administrator/components/com_menus/models/forms/item.xml @@ -3,13 +3,14 @@
    + readonly="true" + /> - - @@ -137,7 +135,6 @@ id="access" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" - default="1" filter="integer"/> diff --git a/administrator/components/com_menus/models/forms/item_alias.xml b/administrator/components/com_menus/models/forms/item_alias.xml index cc5586dbcf540..c184b2a675ed6 100644 --- a/administrator/components/com_menus/models/forms/item_alias.xml +++ b/administrator/components/com_menus/models/forms/item_alias.xml @@ -5,10 +5,15 @@
    - + required="true" + select="true" + new="true" + edit="true" + clear="true" + />
    - + useglobal="true" + > @@ -86,7 +86,7 @@ type="list" label="JFIELD_METADATA_ROBOTS_LABEL" description="JFIELD_METADATA_ROBOTS_DESC" - > + > diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 378d1b00339ff..248df42b9035a 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -10,9 +10,11 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; jimport('joomla.filesystem.path'); -require_once JPATH_COMPONENT . '/helpers/menus.php'; +JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); /** * Menu Item Model for Menus. @@ -149,7 +151,7 @@ protected function batchCopy($value, $pks, $contexts) // $value comes as {menutype}.{parent_id} $parts = explode('.', $value); $menuType = $parts[0]; - $parentId = (int) JArrayHelper::getValue($parts, 1, 0); + $parentId = ArrayHelper::getValue($parts, 1, 0, 'int'); $table = $this->getTable(); $db = $this->getDbo(); @@ -354,7 +356,7 @@ protected function batchMove($value, $pks, $contexts) // $value comes as {menutype}.{parent_id} $parts = explode('.', $value); $menuType = $parts[0]; - $parentId = (int) JArrayHelper::getValue($parts, 1, 0); + $parentId = ArrayHelper::getValue($parts, 1, 0, 'int'); $table = $this->getTable(); $db = $this->getDbo(); @@ -472,7 +474,7 @@ protected function batchMove($value, $pks, $contexts) { // Remove any duplicates and sanitize ids. $children = array_unique($children); - JArrayHelper::toInteger($children); + $children = ArrayHelper::toInteger($children); // Update the menutype field in all nodes where necessary. $query->clear() @@ -536,8 +538,8 @@ public function getForm($data = array(), $loadData = true) } else { - $this->setState('item.link', JArrayHelper::getValue($data, 'link')); - $this->setState('item.type', JArrayHelper::getValue($data, 'type')); + $this->setState('item.link', ArrayHelper::getValue($data, 'link')); + $this->setState('item.type', ArrayHelper::getValue($data, 'type')); } // Get the form. @@ -593,7 +595,7 @@ protected function loadFormData() $filters = JFactory::getApplication()->getUserState('com_menus.items.filter'); $data['published'] = (isset($filters['published']) ? $filters['published'] : null); $data['language'] = (isset($filters['language']) ? $filters['language'] : null); - $data['access'] = (isset($filters['access']) ? $filters['access'] : null); + $data['access'] = (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')); } if (isset($data['menutype']) && !$this->getState('item.menutypeid')) @@ -725,11 +727,10 @@ public function getItem($pk = null) // Convert to the JObject before adding the params. $properties = $table->getProperties(1); - $result = JArrayHelper::toObject($properties); + $result = ArrayHelper::toObject($properties); // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($table->params); + $registry = new Registry($table->params); $result->params = $registry->toArray(); // Merge the request arguments in to the params for a component. @@ -923,9 +924,12 @@ protected function populateState() $menuType = $app->getUserState('com_menus.edit.item.menutype'); - if ($app->input->getString('menutype', false)) + if ($forcedMenuType = $app->input->get('menutype', '', 'string')) { - $menuType = $app->input->getString('menutype', 'mainmenu'); + $menuType = $forcedMenuType; + + // Set the menu type on the list view state, so we return to this menu after saving. + $app->setUserState('com_menus.items.menutype', $forcedMenuType); } $this->setState('item.menutype', $menuType); @@ -1138,40 +1142,35 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') } // Association menu items - $app = JFactory::getApplication(); - $assoc = JLanguageAssociations::isEnabled(); - - if ($assoc) + if (JLanguageAssociations::isEnabled()) { - $languages = JLanguageHelper::getLanguages('lang_code'); - - $addform = new SimpleXMLElement('
    '); - $fields = $addform->addChild('fields'); - $fields->addAttribute('name', 'associations'); - $fieldset = $fields->addChild('fieldset'); - $fieldset->addAttribute('name', 'item_associations'); - $fieldset->addAttribute('description', 'COM_MENUS_ITEM_ASSOCIATIONS_FIELDSET_DESC'); - $add = false; + $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); - foreach ($languages as $tag => $language) + if (count($languages) > 1) { - if ($tag != $data['language']) + $addform = new SimpleXMLElement(''); + $fields = $addform->addChild('fields'); + $fields->addAttribute('name', 'associations'); + $fieldset = $fields->addChild('fieldset'); + $fieldset->addAttribute('name', 'item_associations'); + $fieldset->addAttribute('description', 'COM_MENUS_ITEM_ASSOCIATIONS_FIELDSET_DESC'); + + foreach ($languages as $language) { - $add = true; $field = $fieldset->addChild('field'); - $field->addAttribute('name', $tag); - $field->addAttribute('type', 'menuitem'); - $field->addAttribute('language', $tag); - $field->addAttribute('disable', 'separator,alias,heading,url'); + $field->addAttribute('name', $language->lang_code); + $field->addAttribute('type', 'modal_menu'); + $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); + $field->addAttribute('select', 'true'); + $field->addAttribute('new', 'true'); + $field->addAttribute('edit', 'true'); + $field->addAttribute('clear', 'true'); $option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE'); $option->addAttribute('value', ''); } - } - if ($add) - { $form->load($addform, false); } } @@ -1183,7 +1182,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') /** * Method rebuild the entire nested set tree. * - * @return boolean False on failure or error, true otherwise. + * @return boolean|JException Boolean true on success, boolean false or JException instance on error * * @since 1.6 */ @@ -1229,8 +1228,7 @@ public function rebuild() foreach ($items as &$item) { - $registry = new Registry; - $registry->loadString($item->params); + $registry = new Registry($item->params); $params = (string) $registry; $query->clear(); @@ -1378,7 +1376,7 @@ public function save($data) if ($assoc) { // Adding self to the association - $associations = $data['associations']; + $associations = isset($data['associations']) ? $data['associations'] : array(); // Unset any invalid associations $associations = Joomla\Utilities\ArrayHelper::toInteger($associations); @@ -1399,14 +1397,31 @@ public function save($data) JError::raiseNotice(403, JText::_('COM_MENUS_ERROR_ALL_LANGUAGE_ASSOCIATED')); } - $associations[$table->language] = $table->id; + // Get associationskey for edited item + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('key')) + ->from($db->quoteName('#__associations')) + ->where($db->quoteName('context') . ' = ' . $db->quote($this->associationsContext)) + ->where($db->quoteName('id') . ' = ' . (int) $table->id); + $db->setQuery($query); + $old_key = $db->loadResult(); - // Deleting old association for these items - $db = $this->getDbo(); + // Deleting old associations for the associated items $query = $db->getQuery(true) - ->delete('#__associations') - ->where('context=' . $db->quote($this->associationsContext)) - ->where('id IN (' . implode(',', $associations) . ')'); + ->delete($db->quoteName('#__associations')) + ->where($db->quoteName('context') . ' = ' . $db->quote($this->associationsContext)); + + if ($associations) + { + $query->where('(' . $db->quoteName('id') . ' IN (' . implode(',', $associations) . ') OR ' + . $db->quoteName('key') . ' = ' . $db->quote($old_key) . ')'); + } + else + { + $query->where($db->quoteName('key') . ' = ' . $db->quote($old_key)); + } + $db->setQuery($query); try @@ -1420,7 +1435,13 @@ public function save($data) return false; } - if (!$all_language && count($associations) > 1) + // Adding self to the association + if (!$all_language) + { + $associations[$table->language] = (int) $table->id; + } + + if (count($associations) > 1) { // Adding new association for these items $key = md5(json_encode($associations)); @@ -1636,10 +1657,10 @@ protected function generateNewTitle($parent_id, $alias, $title) { if ($title == $table->title) { - $title = JString::increment($title); + $title = StringHelper::increment($title); } - $alias = JString::increment($alias, 'dash'); + $alias = StringHelper::increment($alias, 'dash'); } return array($title, $alias); @@ -1657,6 +1678,7 @@ protected function generateNewTitle($parent_id, $alias, $title) */ protected function cleanCache($group = null, $client_id = 0) { + parent::cleanCache('com_menus', 0); parent::cleanCache('com_modules'); parent::cleanCache('mod_menu'); } diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index 22ec7906ca2d1..c1681fbca446d 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -30,7 +30,7 @@ public function __construct($config = array()) { $config['filter_fields'] = array( 'id', 'a.id', - 'menutype', 'a.menutype', + 'menutype', 'a.menutype', 'menutype_title', 'title', 'a.title', 'alias', 'a.alias', 'published', 'a.published', @@ -71,11 +71,25 @@ public function __construct($config = array()) * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'a.lft', $direction = 'asc') { $app = JFactory::getApplication('administrator'); $user = JFactory::getUser(); + $forcedLanguage = $app->input->get('forcedLanguage', '', 'cmd'); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + + // Adjust the context to support forced languages. + if ($forcedLanguage) + { + $this->context .= '.' . $forcedLanguage; + } + $parentId = $this->getUserStateFromRequest($this->context . '.filter.parent_id', 'filter_parent_id'); $this->setState('filter.parent_id', $parentId); @@ -94,8 +108,14 @@ protected function populateState($ordering = null, $direction = null) $level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level'); $this->setState('filter.level', $level); - $menuType = $app->input->getString('menutype', $app->getUserState($this->context . '.menutype', '*')); - $menuId = 0; + $currentMenuType = $app->getUserState($this->context . '.menutype', ''); + $menuType = $app->input->getString('menutype', $currentMenuType); + + // If selected menu type different from current menu type reset pagination to 0 + if ($menuType != $currentMenuType) + { + $app->input->set('limitstart', 0); + } if ($menuType) { @@ -103,22 +123,26 @@ protected function populateState($ordering = null, $direction = null) $query = $db->getQuery(true) ->select($db->qn(array('id', 'title'))) ->from($db->qn('#__menu_types')) - ->where($db->qn('menutype') . '=' . $db->q($menuType)); + ->where($db->qn('menutype') . ' = ' . $db->q($menuType)); $menuTypeItem = $db->setQuery($query)->loadObject(); - // Check if menu type was changed and if valid agains ACL - "*" needs no validation - if (($menuType == '*' || $user->authorise('core.manage', 'com_menus.menu.' . $menuTypeItem->id))) + // Check if menu type exists. + if (!$menuTypeItem) + { + $this->setError(JText::_('COM_MENUS_ERROR_MENUTYPE_NOT_FOUND')); + } + // Check if menu type was changed and if valid agains ACL + elseif ($user->authorise('core.manage', 'com_menus.menu.' . $menuTypeItem->id)) { $app->setUserState($this->context . '.menutype', $menuType); - $app->input->set('limitstart', 0); $this->setState('menutypetitle', !empty($menuTypeItem->title) ? $menuTypeItem->title : ''); $this->setState('menutypeid', !empty($menuTypeItem->id) ? $menuTypeItem->id : ''); } // Nope, not valid else { - $menuType = ''; + $this->setError(JText::_('JERROR_ALERTNOAUTHOR')); } } else @@ -138,7 +162,13 @@ protected function populateState($ordering = null, $direction = null) $this->setState('params', $params); // List state information. - parent::populateState('a.lft', 'asc'); + parent::populateState($ordering, $direction); + + // Force a language. + if (!empty($forcedLanguage)) + { + $this->setState('filter.language', $forcedLanguage); + } } /** @@ -216,7 +246,7 @@ protected function getListQuery() $query->from($db->quoteName('#__menu') . ' AS a'); // Join over the language - $query->select('l.title AS language_title, l.image AS language_image') + $query->select('l.title AS language_title, l.image AS language_image, l.sef AS language_sef') ->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language'); // Join over the users. @@ -231,6 +261,10 @@ protected function getListQuery() $query->select('ag.title AS access_level') ->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Join over the menu types. + $query->select($db->quoteName('mt.title', 'menutype_title')) + ->join('LEFT', $db->quoteName('#__menu_types', 'mt') . ' ON ' . $db->qn('mt.menutype') . ' = ' . $db->qn('a.menutype')); + // Join over the associations. $assoc = JLanguageAssociations::isEnabled(); @@ -239,7 +273,7 @@ protected function getListQuery() $query->select('COUNT(asso2.id)>1 as association') ->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_menus.item')) ->join('LEFT', '#__associations AS asso2 ON asso2.key = asso.key') - ->group('a.id, e.enabled, l.title, l.image, u.name, c.element, ag.title, e.name'); + ->group('a.id, e.enabled, l.title, l.image, u.name, c.element, ag.title, e.name, mt.title'); } // Join over the extensions @@ -289,14 +323,14 @@ protected function getListQuery() if (!empty($parentId)) { - $query->where('p.id = ' . (int) $parentId); + $query->where('a.parent_id = ' . (int) $parentId); } // Filter the items over the menu id if set. $menuType = $this->getState('filter.menutype'); - // "*" means all - if ($menuType == '*') + // "" means all + if ($menuType == '') { // Load all menu types we have manage access $query2 = $this->getDbo()->getQuery(true) @@ -316,7 +350,10 @@ protected function getListQuery() } } - $query->where('a.menutype IN(' . implode(',', $types) . ')'); + if (!empty($types)) + { + $query->where('a.menutype IN(' . implode(',', $types) . ')'); + } } // Default behavior => load all items from a specific menu elseif (strlen($menuType)) @@ -326,7 +363,7 @@ protected function getListQuery() // Empty menu type => error else { - $query->where('1!=1'); + $query->where('1 != 1'); } // Filter on the access level. @@ -338,8 +375,12 @@ protected function getListQuery() // Implement View Level Access if (!$user->authorise('core.admin')) { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); + $groups = $user->getAuthorisedViewLevels(); + + if (!empty($groups)) + { + $query->where('a.access IN (' . implode(',', $groups) . ')'); + } } // Filter on the level. diff --git a/administrator/components/com_menus/models/menu.php b/administrator/components/com_menus/models/menu.php index facb74f037fd4..eca43d0259b97 100644 --- a/administrator/components/com_menus/models/menu.php +++ b/administrator/components/com_menus/models/menu.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; /** * Menu Item Model for Menus. @@ -131,7 +132,7 @@ public function &getItem($itemId = null) } $properties = $table->getProperties(1); - $value = JArrayHelper::toObject($properties, 'JObject'); + $value = ArrayHelper::toObject($properties, 'JObject'); return $value; } @@ -261,8 +262,7 @@ public function delete($itemIds) $dispatcher = JEventDispatcher::getInstance(); // Sanitize the ids. - $itemIds = (array) $itemIds; - JArrayHelper::toInteger($itemIds); + $itemIds = ArrayHelper::toInteger((array) $itemIds); // Get a group row instance. $table = $this->getTable(); @@ -323,8 +323,7 @@ public function &getModules() foreach ($modules as &$module) { - $params = new Registry; - $params->loadString($module->params); + $params = new Registry($module->params); $menuType = $params->get('menutype'); @@ -351,6 +350,7 @@ public function &getModules() */ protected function cleanCache($group = null, $client_id = 0) { + parent::cleanCache('com_menus', 0); parent::cleanCache('com_modules'); parent::cleanCache('mod_menu'); } diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index 62d0b913c91d8..f89741ec00d56 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Menu List Model for Menus. * @@ -70,7 +72,7 @@ public function getItems() // Get the menu types of menus in the list. $db = $this->getDbo(); - $menuTypes = JArrayHelper::getColumn($items, 'menutype'); + $menuTypes = ArrayHelper::getColumn((array) $items, 'menutype'); // Quote the strings. $menuTypes = implode( @@ -190,13 +192,13 @@ protected function getListQuery() * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'a.title', $direction = 'asc') { $search = $this->getUserStateFromRequest($this->context . '.search', 'filter_search'); $this->setState('filter.search', $search); // List state information. - parent::populateState('a.title', 'asc'); + parent::populateState($ordering, $direction); } /** diff --git a/administrator/components/com_menus/tables/menu.php b/administrator/components/com_menus/tables/menu.php index 96f536878cecd..afed442e3587f 100644 --- a/administrator/components/com_menus/tables/menu.php +++ b/administrator/components/com_menus/tables/menu.php @@ -25,7 +25,6 @@ class MenusTableMenu extends JTableMenu * @return boolean True on success. * * @since 2.5 - * @see https://docs.joomla.org/JTableNested/delete */ public function delete($pk = null, $children = false) { diff --git a/administrator/components/com_menus/views/item/tmpl/edit.php b/administrator/components/com_menus/views/item/tmpl/edit.php index fe0df318d2d76..169f313ed3e3f 100644 --- a/administrator/components/com_menus/views/item/tmpl/edit.php +++ b/administrator/components/com_menus/views/item/tmpl/edit.php @@ -16,6 +16,7 @@ JHtml::_('behavior.tabstate'); JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); JText::script('ERROR'); JText::script('JGLOBAL_VALIDATION_FORM_FAILED'); @@ -60,6 +61,12 @@ } else if (task == 'item.cancel' || document.formvalidator.isValid(document.getElementById('item-form'))) { Joomla.submitform(task, document.getElementById('item-form')); + + // @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__. + if (task !== 'item.apply') + { + window.parent.jQuery('#menuEdit" . (int) $this->item->id . "Modal').modal('hide'); + } } else { @@ -75,12 +82,17 @@ }; "; +$input = JFactory::getApplication()->input; + // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration($script); - +// In case of modal +$isModal = $input->get('layout') == 'modal' ? true : false; +$layout = $isModal ? 'modal' : 'edit'; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; ?> - + @@ -92,35 +104,31 @@
    item->type == 'alias') - { - echo $this->form->getControlGroup('aliastip'); - } - - echo $this->form->getControlGroup('type'); + echo $this->form->renderField('type'); if ($this->item->type == 'alias') { - echo $this->form->getControlGroups('aliasoptions'); + echo $this->form->renderFieldset('aliasoptions'); } - echo $this->form->getControlGroups('request'); + echo $this->form->renderFieldset('request'); if ($this->item->type == 'url') { $this->form->setFieldAttribute('link', 'readonly', 'false'); } - echo $this->form->getControlGroup('link'); + echo $this->form->renderField('link'); - echo $this->form->getControlGroup('browserNav'); - echo $this->form->getControlGroup('template_style_id'); + echo $this->form->renderField('browserNav'); + echo $this->form->renderField('template_style_id'); ?>
    fields = array( + 'id', 'menutype', 'parent_id', 'menuordering', @@ -128,8 +136,7 @@ 'home', 'access', 'language', - 'note' - + 'note', ); if ($this->item->type != 'component') @@ -148,13 +155,15 @@ echo JLayoutHelper::render('joomla.edit.params', $this); ?> - + item->type !== 'alias' && $this->item->type !== 'url' && $this->item->type !== 'separator' && $this->item->type !== 'heading') : ?> loadTemplate('associations'); ?> + + modules)) : ?> @@ -167,6 +176,7 @@
    + form->getInput('component_id'); ?> diff --git a/administrator/components/com_menus/views/item/tmpl/edit_modules.php b/administrator/components/com_menus/views/item/tmpl/edit_modules.php index 00166260b6f6d..235f8935d76d0 100644 --- a/administrator/components/com_menus/views/item/tmpl/edit_modules.php +++ b/administrator/components/com_menus/views/item/tmpl/edit_modules.php @@ -86,7 +86,7 @@ id . '&tmpl=component&view=module&layout=modal'; ?> - + escape($module->title); ?> @@ -133,22 +133,26 @@ id . 'Modal', + 'moduleEdit' . $module->id . 'Modal', array( - 'url' => $link, 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), 'backdrop' => 'static', + 'keyboard' => false, 'closeButton' => false, + 'url' => $link, 'height' => '400px', 'width' => '800px', - 'modalWidth' => '80', 'bodyHeight' => '70', - 'footer' => '' - . '' + . '', ) ); ?> diff --git a/administrator/components/com_menus/views/item/tmpl/modal.php b/administrator/components/com_menus/views/item/tmpl/modal.php new file mode 100644 index 0000000000000..601b697378e59 --- /dev/null +++ b/administrator/components/com_menus/views/item/tmpl/modal.php @@ -0,0 +1,33 @@ + 'bottom')); + +// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__. +$function = JFactory::getApplication()->input->getCmd('function', 'jEditMenu_' . (int) $this->item->id); + +// Function to update input title when changed +JFactory::getDocument()->addScriptDeclaration(' + function jEditMenuModal() { + if (window.parent && document.formvalidator.isValid(document.getElementById("item-form"))) { + return window.parent.' . $this->escape($function) . '(document.getElementById("jform_title").value); + } + } +'); +?> + + + + +
    + setLayout('edit'); ?> + loadTemplate(); ?> +
    diff --git a/administrator/components/com_categories/views/category/tmpl/edit_extrafields.php b/administrator/components/com_menus/views/item/tmpl/modal_associations.php similarity index 73% rename from administrator/components/com_categories/views/category/tmpl/edit_extrafields.php rename to administrator/components/com_menus/views/item/tmpl/modal_associations.php index 5f3b6e5115efa..2d249134c3e99 100644 --- a/administrator/components/com_categories/views/category/tmpl/edit_extrafields.php +++ b/administrator/components/com_menus/views/item/tmpl/modal_associations.php @@ -1,12 +1,12 @@ + 'collapse0')); + $fieldSets = $this->form->getFieldsets('params'); + $i = 0; + + foreach ($fieldSets as $name => $fieldSet) : + if (!(($this->item->link == 'index.php?option=com_wrapper&view=wrapper') && $fieldSet->name == 'request') + && !($this->item->link == 'index.php?Itemid=' && $fieldSet->name == 'aliasoptions')) : + $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_MENUS_' . $name . '_FIELDSET_LABEL'; + echo JHtml::_('bootstrap.addSlide', 'menuOptions', JText::_($label), 'collapse' . ($i++)); + if (isset($fieldSet->description) && trim($fieldSet->description)) : + echo '

    ' . $this->escape(JText::_($fieldSet->description)) . '

    '; + endif; + ?> + form->getFieldset($name) as $field) : ?> + +
    + +
    + label; ?> +
    +
    + input; ?> +
    + +
    + +getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) + { + // Set the language field to the forcedLanguage and disable changing it. + $this->form->setValue('language', null, $forcedLanguage); + $this->form->setFieldAttribute('language', 'readonly', 'true'); + + // Only allow to select categories with All language or with the forced language. + $this->form->setFieldAttribute('parent_id', 'language', '*,' . $forcedLanguage); + } + parent::display($tpl); $this->addToolbar(); } diff --git a/administrator/components/com_menus/views/items/tmpl/default.php b/administrator/components/com_menus/views/items/tmpl/default.php index dd6688a549ab6..7105784d2751e 100644 --- a/administrator/components/com_menus/views/items/tmpl/default.php +++ b/administrator/components/com_menus/views/items/tmpl/default.php @@ -16,18 +16,18 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$user = JFactory::getUser(); -$app = JFactory::getApplication(); -$userId = $user->get('id'); -$listOrder = $this->escape($this->state->get('list.ordering')); -$listDirn = $this->escape($this->state->get('list.direction')); -$ordering = ($listOrder == 'a.lft'); -$canOrder = $user->authorise('core.edit.state', 'com_menus'); -$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc'); -$menutypeid = (int) $this->state->get('menutypeid'); -$menuType = (array) $app->getUserState('com_menus.items.menutype'); +$user = JFactory::getUser(); +$app = JFactory::getApplication(); +$userId = $user->get('id'); +$listOrder = $this->escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); +$ordering = ($listOrder == 'a.lft'); +$canOrder = $user->authorise('core.edit.state', 'com_menus'); +$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc'); +$menuTypeId = (int) $this->state->get('menutypeid'); +$menuType = (string) $app->getUserState('com_menus.items.menutype', '', 'string'); -if ($saveOrder && $menuType != '*') +if ($saveOrder && $menuType) { $saveOrderingUrl = 'index.php?option=com_menus&task=items.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'itemList', 'adminForm', strtolower($listDirn), $saveOrderingUrl, false, true); @@ -35,9 +35,14 @@ $assoc = JLanguageAssociations::isEnabled(); $colSpan = ($assoc) ? 10 : 9; + +if ($menuType == '') +{ + $colSpan--; +} ?> - + sidebar)) : ?>
    sidebar; ?> @@ -58,7 +63,7 @@ - + @@ -73,7 +78,7 @@ - + @@ -223,13 +238,7 @@ items as $i => $item) : - $canCreate = $user->authorise('core.create', 'com_menus'); - $canEdit = $user->authorise('core.edit', 'com_menus'); - $canChange = $user->authorise('core.edit.state', 'com_menus'); + $canEdit = $user->authorise('core.edit', 'com_menus.menu.' . (int) $item->id); $canManageItems = $user->authorise('core.manage', 'com_menus.menu.' . (int) $item->id); ?> @@ -126,16 +124,31 @@ + + @@ -78,7 +82,7 @@ - @@ -137,7 +141,9 @@ ?> - + @@ -174,21 +180,16 @@ + - + @@ -140,7 +139,7 @@ checked_out) : ?> editor, $item->checked_out_time, 'newsfeeds.', $canCheckin); ?> - + escape($item->name); ?> @@ -171,11 +170,7 @@ - diff --git a/administrator/components/com_search/views/searches/view.html.php b/administrator/components/com_search/views/searches/view.html.php index 7faf547589bcd..91a0f7bacd915 100644 --- a/administrator/components/com_search/views/searches/view.html.php +++ b/administrator/components/com_search/views/searches/view.html.php @@ -33,6 +33,7 @@ class SearchViewSearches extends JViewLegacy */ public function display($tpl = null) { + $app = JFactory::getApplication(); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); @@ -49,13 +50,14 @@ public function display($tpl = null) return false; } + // Check if plugin is enabled if ($this->enabled) { - JFactory::getApplication()->enqueueMessage(JText::_('COM_SEARCH_LOGGING_ENABLED'), 'notice'); + $app->enqueueMessage(JText::_('COM_SEARCH_LOGGING_ENABLED'), 'notice'); } else { - JFactory::getApplication()->enqueueMessage(JText::_('COM_SEARCH_LOGGING_DISABLED'), 'warning'); + $app->enqueueMessage(JText::_('COM_SEARCH_LOGGING_DISABLED'), 'warning'); } $this->addToolbar(); diff --git a/administrator/components/com_tags/config.xml b/administrator/components/com_tags/config.xml index 0344ac0f113e4..b9e4da017754f 100644 --- a/administrator/components/com_tags/config.xml +++ b/administrator/components/com_tags/config.xml @@ -121,8 +121,8 @@ type="radio" class="btn-group btn-group-yesno" default="1" - description="JGLOBAL_SHOW_HEADINGS_DESC" - label="JGLOBAL_SHOW_HEADINGS_LABEL" + description="COM_TAGS_TAG_LIST_SHOW_HEADINGS_DESC" + label="COM_TAGS_TAG_LIST_SHOW_HEADINGS_LABEL" > @@ -132,8 +132,8 @@ name="tag_list_show_date" type="list" default="0" - label="JGLOBAL_SHOW_DATE_LABEL" - description="JGLOBAL_SHOW_DATE_DESC" + description="COM_TAGS_TAG_LIST_SHOW_DATE_LABEL" + label="COM_TAGS_TAG_LIST_SHOW_DATE_DESC" > diff --git a/administrator/components/com_tags/controllers/tags.php b/administrator/components/com_tags/controllers/tags.php index e31a91f9782aa..c2458a458609b 100644 --- a/administrator/components/com_tags/controllers/tags.php +++ b/administrator/components/com_tags/controllers/tags.php @@ -29,9 +29,7 @@ class TagsControllerTags extends JControllerAdmin */ public function getModel($name = 'Tag', $prefix = 'TagsModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** @@ -59,7 +57,7 @@ public function rebuild() else { // Rebuild failed. - $this->setMessage(JText::_('COM_TAGSS_REBUILD_FAILURE')); + $this->setMessage(JText::_('COM_TAGS_REBUILD_FAILURE')); return false; } diff --git a/administrator/components/com_tags/helpers/tags.php b/administrator/components/com_tags/helpers/tags.php index f85140698f789..23ac2cb2de165 100644 --- a/administrator/components/com_tags/helpers/tags.php +++ b/administrator/components/com_tags/helpers/tags.php @@ -43,10 +43,10 @@ public static function addSubmenu($extension) if (file_exists($file)) { - require_once $file; - $cName = 'TagsHelper'; + JLoader::register($cName, $file); + if (class_exists($cName)) { if (is_callable(array($cName, 'addSubmenu'))) diff --git a/administrator/components/com_tags/models/forms/filter_tags.xml b/administrator/components/com_tags/models/forms/filter_tags.xml index 96d3292c9e965..63d08d839488a 100644 --- a/administrator/components/com_tags/models/forms/filter_tags.xml +++ b/administrator/components/com_tags/models/forms/filter_tags.xml @@ -46,8 +46,17 @@ step="1" onchange="this.form.submit();" > - + + + + @@ -191,7 +193,9 @@ type="calendar" class="readonly" label="JGLOBAL_FIELD_MODIFIED_LABEL" - filter="unset" + format="%Y-%m-%d %H:%M:%S" + filter="user_utc" + description="COM_TAGS_FIELD_MODIFIED_DESC" readonly="true" /> @@ -260,7 +264,7 @@ label="COM_TAGS_FLOAT_LABEL" description="COM_TAGS_FLOAT_DESC" > - + @@ -305,7 +309,7 @@ label="COM_TAGS_FLOAT_LABEL" description="COM_TAGS_FLOAT_DESC" > - + diff --git a/administrator/components/com_tags/models/tag.php b/administrator/components/com_tags/models/tag.php index 480f4b4a231aa..08d42e44a3be7 100644 --- a/administrator/components/com_tags/models/tag.php +++ b/administrator/components/com_tags/models/tag.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; /** * Tags Component Tag Model @@ -127,18 +128,15 @@ public function getItem($pk = null) } // Convert the metadata field to an array. - $registry = new Registry; - $registry->loadString($result->metadata); + $registry = new Registry($result->metadata); $result->metadata = $registry->toArray(); // Convert the images field to an array. - $registry = new Registry; - $registry->loadString($result->images); + $registry = new Registry($result->images); $result->images = $registry->toArray(); // Convert the urls field to an array. - $registry = new Registry; - $registry->loadString($result->urls); + $registry = new Registry($result->urls); $result->urls = $registry->toArray(); // Convert the created and modified dates to local user time for display in the form. @@ -286,15 +284,13 @@ public function save($data) if (isset($data['images']) && is_array($data['images'])) { - $registry = new Registry; - $registry->loadArray($data['images']); + $registry = new Registry($data['images']); $data['images'] = (string) $registry; } if (isset($data['urls']) && is_array($data['urls'])) { - $registry = new Registry; - $registry->loadArray($data['urls']); + $registry = new Registry($data['urls']); $data['urls'] = (string) $registry; } @@ -447,8 +443,8 @@ protected function generateNewTitle($parent_id, $alias, $title) while ($table->load(array('alias' => $alias, 'parent_id' => $parent_id))) { - $title = ($table->title != $title) ? $title : JString::increment($title); - $alias = JString::increment($alias, 'dash'); + $title = ($table->title != $title) ? $title : StringHelper::increment($title); + $alias = StringHelper::increment($alias, 'dash'); } return array($title, $alias); diff --git a/administrator/components/com_tags/models/tags.php b/administrator/components/com_tags/models/tags.php index 09755efefa8be..1bc6020bcb7d9 100644 --- a/administrator/components/com_tags/models/tags.php +++ b/administrator/components/com_tags/models/tags.php @@ -78,6 +78,17 @@ protected function populateState($ordering = 'a.lft', $direction = 'asc') $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''); $this->setState('filter.language', $language); + $extension = $this->getUserStateFromRequest($this->context . '.filter.extension', 'extension', 'com_content', 'cmd'); + + $this->setState('filter.extension', $extension); + $parts = explode('.', $extension); + + // Extract the component name + $this->setState('filter.component', $parts[0]); + + // Extract the optional section name + $this->setState('filter.section', (count($parts) > 1) ? $parts[1] : null); + // Load the parameters. $params = JComponentHelper::getParams('com_tags'); $this->setState('params', $params); @@ -102,6 +113,7 @@ protected function populateState($ordering = 'a.lft', $direction = 'asc') protected function getStoreId($id = '') { // Compile the store id. + $id .= ':' . $this->getState('filter.extension'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.level'); $id .= ':' . $this->getState('filter.access'); @@ -310,4 +322,66 @@ public function getTable($type = 'Tag', $prefix = 'TagsTable', $config = array() { return JTable::getInstance($type, $prefix, $config); } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * + * @since 12.2 + */ + public function getItems() + { + $items = parent::getItems(); + + if ($items != false) + { + $extension = $this->getState('filter.extension'); + + $this->countItems($items, $extension); + } + + return $items; + } + + /** + * Method to load the countItems method from the extensions + * + * @param stdClass[] &$items The category items + * @param string $extension The category extension + * + * @return void + * + * @since 3.5 + */ + public function countItems(&$items, $extension) + { + $parts = explode('.', $extension); + $component = $parts[0]; + $section = null; + + if (count($parts) < 2) + { + return; + } + + $section = $parts[1]; + + // Try to find the component helper. + $eName = str_replace('com_', '', $component); + $file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php'); + + if (file_exists($file)) + { + $prefix = ucfirst(str_replace('com_', '', $component)); + $cName = $prefix . 'Helper'; + + JLoader::register($cName, $file); + + if (class_exists($cName) && is_callable(array($cName, 'countTagItems'))) + { + call_user_func(array($cName, 'countTagItems'), $items, $extension); + } + } + } } diff --git a/administrator/components/com_tags/tables/tag.php b/administrator/components/com_tags/tables/tag.php index 85bfa970ddd81..2344ab6b9b4f6 100644 --- a/administrator/components/com_tags/tables/tag.php +++ b/administrator/components/com_tags/tables/tag.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; /** * Tags table @@ -46,29 +47,25 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new Registry; - $registry->loadArray($array['params']); + $registry = new Registry($array['params']); $array['params'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { - $registry = new Registry; - $registry->loadArray($array['metadata']); + $registry = new Registry($array['metadata']); $array['metadata'] = (string) $registry; } if (isset($array['urls']) && is_array($array['urls'])) { - $registry = new Registry; - $registry->loadArray($array['urls']); + $registry = new Registry($array['urls']); $array['urls'] = (string) $registry; } if (isset($array['images']) && is_array($array['images'])) { - $registry = new Registry; - $registry->loadArray($array['images']); + $registry = new Registry($array['images']); $array['images'] = (string) $registry; } @@ -118,7 +115,7 @@ public function check() $bad_characters = array("\n", "\r", "\"", "<", ">"); // Remove bad characters - $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + $after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey); // Create array using commas as delimiter $keys = explode(',', $after_clean); @@ -142,7 +139,7 @@ public function check() { // Only process if not empty $bad_characters = array("\"", "<", ">"); - $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); } // Not Null sanity check $date = JFactory::getDate(); @@ -263,7 +260,6 @@ public function store($updateNulls = false) * @return boolean True on success. * * @since 3.1 - * @see https://docs.joomla.org/JTableNested/delete */ public function delete($pk = null, $children = false) { diff --git a/administrator/components/com_tags/tags.php b/administrator/components/com_tags/tags.php index 59cd7365ef457..e2867634b723e 100644 --- a/administrator/components/com_tags/tags.php +++ b/administrator/components/com_tags/tags.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_tags')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Tags'); diff --git a/administrator/components/com_tags/views/tag/tmpl/edit.php b/administrator/components/com_tags/views/tag/tmpl/edit.php index b6379950b6629..e61a493b2aeee 100644 --- a/administrator/components/com_tags/views/tag/tmpl/edit.php +++ b/administrator/components/com_tags/views/tag/tmpl/edit.php @@ -38,7 +38,7 @@
    - form->getControlGroup('description'); ?> + form->renderField('description'); ?>
    @@ -47,6 +47,8 @@
    + +
    @@ -58,7 +60,6 @@
    -
    diff --git a/administrator/components/com_tags/views/tag/view.html.php b/administrator/components/com_tags/views/tag/view.html.php index 7cc5411f91c81..2315fe51a2c2f 100644 --- a/administrator/components/com_tags/views/tag/view.html.php +++ b/administrator/components/com_tags/views/tag/view.html.php @@ -90,33 +90,34 @@ protected function addToolbar() JToolbarHelper::apply('tag.apply'); JToolbarHelper::save('tag.save'); JToolbarHelper::save2new('tag.save2new'); + JToolbarHelper::cancel('tag.cancel'); } // If not checked out, can save the item. - elseif (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId))) + else { - JToolbarHelper::apply('tag.apply'); - JToolbarHelper::save('tag.save'); + // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. + $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_user_id == $userId); - if ($canDo->get('core.create')) + // Can't save the record if it's checked out and editable + if (!$checkedOut && $itemEditable) { - JToolbarHelper::save2new('tag.save2new'); + JToolbarHelper::apply('tag.apply'); + JToolbarHelper::save('tag.save'); + + if ($canDo->get('core.create')) + { + JToolbarHelper::save2new('tag.save2new'); + } } - } - // If an existing item, can save to a copy. - if (!$isNew && $canDo->get('core.create')) - { - JToolbarHelper::save2copy('tag.save2copy'); - } + // If an existing item, can save to a copy. + if ($canDo->get('core.create')) + { + JToolbarHelper::save2copy('tag.save2copy'); + } - if (empty($this->item->id)) - { - JToolbarHelper::cancel('tag.cancel'); - } - else - { - if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) + if ($this->state->params->get('save_history', 0) && $itemEditable) { JToolbarHelper::versions('com_tags.tag', $this->item->id); } diff --git a/administrator/components/com_tags/views/tags/tmpl/default.php b/administrator/components/com_tags/views/tags/tmpl/default.php index 4c84c6c4995d1..4fda0ed2487a5 100644 --- a/administrator/components/com_tags/views/tags/tmpl/default.php +++ b/administrator/components/com_tags/views/tags/tmpl/default.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\Inflector; + // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -23,6 +25,30 @@ $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_tags'); $saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc'); +$extension = $this->escape($this->state->get('filter.extension')); +$parts = explode('.', $extension); +$component = $parts[0]; +$section = null; +$mode = false; + +if (count($parts) > 1) +{ + $section = $parts[1]; + $inflector = Inflector::getInstance(); + + if (!$inflector->isPlural($section)) + { + $section = $inflector->toPlural($section); + } + +} + +if ($section === 'categories') +{ + $mode = true; + $section = $component; + $component = 'com_categories'; +} if ($saveOrder) { @@ -63,6 +89,28 @@
    + + items[0]) && property_exists($this->items[0], 'count_published')) :?> + + + items[0]) && property_exists($this->items[0], 'count_unpublished')) :?> + + + items[0]) && property_exists($this->items[0], 'count_archived')) :?> + + + items[0]) && property_exists($this->items[0], 'count_trashed')) :?> + + + @@ -157,7 +205,7 @@ checked_out) : ?> editor, $item->checked_out_time, 'tags.', $canCheckin); ?> - + escape($item->title); ?> @@ -171,22 +219,45 @@ + + items[0]) && property_exists($this->items[0], 'count_published')) : ?> + + + items[0]) && property_exists($this->items[0], 'count_unpublished')) : ?> + + + items[0]) && property_exists($this->items[0], 'count_archived')) : ?> + + + items[0]) && property_exists($this->items[0], 'count_trashed')) : ?> + + + + + - - - + + + +
    - + @@ -106,10 +111,10 @@ items as $i => $item) : $orderkey = array_search($item->id, $this->ordering[$item->parent_id]); - $canCreate = $user->authorise('core.create', 'com_menus.menu.' . $menutypeid); - $canEdit = $user->authorise('core.edit', 'com_menus.menu.' . $menutypeid); + $canCreate = $user->authorise('core.create', 'com_menus.menu.' . $menuTypeId); + $canEdit = $user->authorise('core.edit', 'com_menus.menu.' . $menuTypeId); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id')|| $item->checked_out == 0; - $canChange = $user->authorise('core.edit.state', 'com_menus.menu.' . $menutypeid) && $canCheckin; + $canChange = $user->authorise('core.edit.state', 'com_menus.menu.' . $menuTypeId) && $canCheckin; // Get the parents of item for sorting if ($item->level > 1) @@ -140,7 +145,7 @@ } ?>
    published, $i, $canChange, 'cb'); ?> - |—', $item->level - 1) ?> + $item->level)); ?> + checked_out) : ?> editor, $item->checked_out_time, 'items.', $canCheckin); ?> @@ -190,14 +196,15 @@ escape($item->note));?> -
    - —', $item->level - 1) ?> - + params); ?> +
    + + escape($item->item_type); ?>
    - escape($item->menutype); ?> + escape($item->menutype_title); ?> type == 'component') : ?> @@ -205,10 +212,18 @@ home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange); ?> - language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> + language_image) : ?> + language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> + + language_sef; ?> + - language_image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> + language_image) : ?> + language_image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> + + language_sef; ?> + - language == ''):?> - - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + diff --git a/administrator/components/com_menus/views/items/tmpl/default_batch.php b/administrator/components/com_menus/views/items/tmpl/default_batch.php deleted file mode 100644 index 438efaa8b7047..0000000000000 --- a/administrator/components/com_menus/views/items/tmpl/default_batch.php +++ /dev/null @@ -1,66 +0,0 @@ -state->get('filter.published'); -?> - diff --git a/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php b/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php index 0ee724dbbaca7..76ff589d8e5c0 100644 --- a/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php +++ b/administrator/components/com_menus/views/items/tmpl/default_batch_footer.php @@ -10,9 +10,9 @@ $menuType = JFactory::getApplication()->getUserState('com_menus.items.menutype'); ?> - +
    - - count_published; ?> + + + count_published; ?> + + + count_published; ?> + - - count_unpublished; ?> + + + count_unpublished; ?> + + + count_unpublished; ?> + - - count_trashed; ?> + + + count_trashed; ?> + + + count_trashed; ?> + modules[$item->menutype])) : ?> @@ -149,7 +162,7 @@
  • id . '&return=' . $return . '&tmpl=component&layout=modal'); ?> - + escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?> escape($module->title), $this->escape($module->access_title), $this->escape($module->position)); ?> @@ -163,34 +176,55 @@ id . '&return=' . $return . '&tmpl=component&layout=modal'); ?> id . 'Modal', + 'moduleEdit' . $module->id . 'Modal', array( - 'url' => $link, - 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), - 'height' => '300px', - 'width' => '800px', - 'footer' => '' - . '' + 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $link, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', ) ); ?> - menutype); ?> - + menutype . '&tmpl=component&layout=modal'); ?> + $link, - 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), - 'height' => '500px', - 'width' => '800px', - 'footer' => '' + 'title' => JText::_('COM_MENUS_ADD_MENU_MODULE'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $link, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', ) ); ?> diff --git a/administrator/components/com_messages/controller.php b/administrator/components/com_messages/controller.php index 447aab4285f9f..b732abc0deb04 100644 --- a/administrator/components/com_messages/controller.php +++ b/administrator/components/com_messages/controller.php @@ -28,7 +28,7 @@ class MessagesController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/messages.php'; + JLoader::register('MessagesHelper', JPATH_ADMINISTRATOR . '/components/com_messages/helpers/messages.php'); $view = $this->input->get('view', 'messages'); $layout = $this->input->get('layout', 'default'); diff --git a/administrator/components/com_messages/controllers/messages.php b/administrator/components/com_messages/controllers/messages.php index 94f2813d94724..48db0ffec4798 100644 --- a/administrator/components/com_messages/controllers/messages.php +++ b/administrator/components/com_messages/controllers/messages.php @@ -29,8 +29,6 @@ class MessagesControllerMessages extends JControllerAdmin */ public function getModel($name = 'Message', $prefix = 'MessagesModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_messages/helpers/html/messages.php b/administrator/components/com_messages/helpers/html/messages.php index eb0650a295ed5..dc793b974130e 100644 --- a/administrator/components/com_messages/helpers/html/messages.php +++ b/administrator/components/com_messages/helpers/html/messages.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * JHtml administrator messages class. * @@ -73,7 +75,7 @@ public static function status($i, $value = 0, $canChange = false) 0 => array('unpublish', 'messages.publish', 'COM_MESSAGES_OPTION_UNREAD', 'COM_MESSAGES_MARK_AS_READ'), ); - $state = JArrayHelper::getValue($states, (int) $value, $states[0]); + $state = ArrayHelper::getValue($states, (int) $value, $states[0]); $icon = $state[0]; if ($canChange) diff --git a/administrator/components/com_messages/messages.php b/administrator/components/com_messages/messages.php index fb1f846665b88..d58ad6d569ccc 100644 --- a/administrator/components/com_messages/messages.php +++ b/administrator/components/com_messages/messages.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_messages')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $task = JFactory::getApplication()->input->get('task'); diff --git a/administrator/components/com_messages/models/fields/messagestates.php b/administrator/components/com_messages/models/fields/messagestates.php index b505fe4550ad8..68d3f8863af53 100644 --- a/administrator/components/com_messages/models/fields/messagestates.php +++ b/administrator/components/com_messages/models/fields/messagestates.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - JLoader::register('MessagesHelper', JPATH_ADMINISTRATOR . '/components/com_messages/helpers/messages.php'); /** @@ -18,7 +16,7 @@ * * @since 3.6.0 */ -class JFormFieldMessageStates extends JFormFieldList +class JFormFieldMessageStates extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_messages/tables/message.php b/administrator/components/com_messages/tables/message.php index 3fdd1b1ed5d87..387153cee18e8 100644 --- a/administrator/components/com_messages/tables/message.php +++ b/administrator/components/com_messages/tables/message.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Message Table class * @@ -79,7 +81,7 @@ public function check() * to checkin rows that it can after adjustments are made. * * @param mixed $pks An optional array of primary key values to update. If not - * set the instance property value is used. + * set the instance property value is used. * @param integer $state The publishing state. eg. [0 = unpublished, 1 = published] * @param integer $userId The user id of the user performing the operation. * @@ -92,7 +94,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $k = $this->_tbl_key; // Sanitize input. - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); $state = (int) $state; // If there are no primary keys set check to see if the instance key is set. diff --git a/administrator/components/com_modules/config.xml b/administrator/components/com_modules/config.xml index 035823ffa7ea5..4f7f55b2ea54f 100644 --- a/administrator/components/com_modules/config.xml +++ b/administrator/components/com_modules/config.xml @@ -1,25 +1,27 @@ -
    - - - - -
    +
    + + + + +
    - + section="component" + />
    diff --git a/administrator/components/com_modules/controller.php b/administrator/components/com_modules/controller.php index 7f277519ba48e..ea6d201cc3452 100644 --- a/administrator/components/com_modules/controller.php +++ b/administrator/components/com_modules/controller.php @@ -57,7 +57,7 @@ public function display($cachable = false, $urlparams = false) return $view->display(); } - require_once JPATH_COMPONENT . '/helpers/modules.php'; + JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php'); $layout = $this->input->get('layout', 'edit'); $id = $this->input->getInt('id'); diff --git a/administrator/components/com_modules/controllers/module.php b/administrator/components/com_modules/controllers/module.php index 84524f9d76ad3..d6927b6e5e62a 100644 --- a/administrator/components/com_modules/controllers/module.php +++ b/administrator/components/com_modules/controllers/module.php @@ -224,4 +224,79 @@ public function save($key = null, $urlVar = null) } + /** + * Method to get the other modules in the same position + * + * @return string The data for the Ajax request. + * + * @since 3.6.3 + */ + public function orderPosition() + { + $app = JFactory::getApplication(); + + // Send json mime type. + $app->mimeType = 'application/json'; + $app->setHeader('Content-Type', $app->mimeType . '; charset=' . $app->charSet); + $app->sendHeaders(); + + // Check if user token is valid. + if (!JSession::checkToken('get')) + { + $app->enqueueMessage(JText::_('JINVALID_TOKEN'), 'error'); + echo new JResponseJson; + $app->close(); + } + + $jinput = $app->input; + $clientId = $jinput->getValue('client_id'); + $position = $jinput->getValue('position'); + + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('position, ordering, title') + ->from('#__modules') + ->where('client_id = ' . (int) $clientId . ' AND position = ' . $db->q($position)) + ->order('ordering'); + + $db->setQuery($query); + + try + { + $orders = $db->loadObjectList(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + + return ''; + } + + $orders2 = array(); + $n = count($orders); + + if ($n > 0) + { + for ($i = 0, $n; $i < $n; $i++) + { + if (!isset($orders2[$orders[$i]->position])) + { + $orders2[$orders[$i]->position] = 0; + } + + $orders2[$orders[$i]->position]++; + $ord = $orders2[$orders[$i]->position]; + $title = JText::sprintf('COM_MODULES_OPTION_ORDER_POSITION', $ord, htmlspecialchars($orders[$i]->title, ENT_QUOTES, 'UTF-8')); + + $html[] = $orders[$i]->position . ',' . $ord . ',' . $title; + } + } + else + { + $html[] = $position . ',' . 1 . ',' . JText::_('JNONE'); + } + + echo new JResponseJson($html); + $app->close(); + } } diff --git a/administrator/components/com_modules/controllers/modules.php b/administrator/components/com_modules/controllers/modules.php index bafb6c2dff3ac..cc2514724a74e 100644 --- a/administrator/components/com_modules/controllers/modules.php +++ b/administrator/components/com_modules/controllers/modules.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Modules list controller class. * @@ -29,7 +31,7 @@ public function duplicate() JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $pks = $this->input->post->get('cid', array(), 'array'); - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); try { @@ -63,8 +65,6 @@ public function duplicate() */ public function getModel($name = 'Module', $prefix = 'ModulesModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_modules/helpers/html/modules.php b/administrator/components/com_modules/helpers/html/modules.php index 14e68d8185d2f..fd054b03cf868 100644 --- a/administrator/components/com_modules/helpers/html/modules.php +++ b/administrator/components/com_modules/helpers/html/modules.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * JHtml module helper class. * @@ -136,7 +138,8 @@ public static function state($value, $i, $enabled = true, $checkbox = 'cb') public static function positions($clientId, $state = 1, $selectedPosition = '') { - require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php'; + JLoader::register('TemplatesHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php'); + $templates = array_keys(ModulesHelper::getTemplates($clientId, $state)); $templateGroups = array(); @@ -166,7 +169,7 @@ public static function positions($clientId, $state = 1, $selectedPosition = '') } } - $options = JArrayHelper::sortObjects($options, 'text'); + $options = ArrayHelper::sortObjects($options, 'text'); } $templateGroups[$template] = ModulesHelper::createOptionGroup(ucfirst($template), $options); diff --git a/administrator/components/com_modules/helpers/modules.php b/administrator/components/com_modules/helpers/modules.php index a7bb33ea497e2..c8ae66a175257 100644 --- a/administrator/components/com_modules/helpers/modules.php +++ b/administrator/components/com_modules/helpers/modules.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Modules component helper. * @@ -125,7 +127,7 @@ public static function getPositions($clientId, $editPositions = false) { if (!$position && !$editPositions) { - $options[] = JHtml::_('select.option', 'none', ':: ' . JText::_('JNONE') . ' ::'); + $options[] = JHtml::_('select.option', 'none', JText::_('COM_MODULES_NONE')); } else { @@ -208,7 +210,7 @@ public static function getModules($clientId) $modules[$i]->text = JText::_($module->text); } - JArrayHelper::sortObjects($modules, 'text', 1, true, true); + $modules = ArrayHelper::sortObjects($modules, 'text', 1, true, true); return $modules; } diff --git a/administrator/components/com_modules/models/fields/modulesmodule.php b/administrator/components/com_modules/models/fields/modulesmodule.php index 05727c2f13a08..eab6425da0651 100644 --- a/administrator/components/com_modules/models/fields/modulesmodule.php +++ b/administrator/components/com_modules/models/fields/modulesmodule.php @@ -9,16 +9,14 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/modules.php'; +JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php'); /** - * ModulesPosition Field class for the Joomla Framework. + * ModulesModule Field class for the Joomla Framework. * * @since 3.4.2 */ -class JFormFieldModulesModule extends JFormFieldList +class JFormFieldModulesModule extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_modules/models/fields/modulesposition.php b/administrator/components/com_modules/models/fields/modulesposition.php index fd00ef4e787a2..fef92bce13f35 100644 --- a/administrator/components/com_modules/models/fields/modulesposition.php +++ b/administrator/components/com_modules/models/fields/modulesposition.php @@ -9,16 +9,14 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/modules.php'; +JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php'); /** * ModulesPosition Field class for the Joomla Framework. * * @since 3.4.2 */ -class JFormFieldModulesPosition extends JFormFieldList +class JFormFieldModulesPosition extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_modules/models/forms/filter_modules.xml b/administrator/components/com_modules/models/forms/filter_modules.xml index c0a5b534a0362..bf193091c0905 100644 --- a/administrator/components/com_modules/models/forms/filter_modules.xml +++ b/administrator/components/com_modules/models/forms/filter_modules.xml @@ -6,7 +6,7 @@ name="client_id" type="list" label="" - onchange="jQuery('#filter_position, #filter_module, #filter_language').val('');this.form.submit();" + onchange="jQuery('#filter_position, #filter_module, #filter_language, #filter_menuitem').val('');this.form.submit();" > @@ -44,6 +44,17 @@ > + + + + diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php index b7af812801f55..39a19fabeb607 100644 --- a/administrator/components/com_modules/models/module.php +++ b/administrator/components/com_modules/models/module.php @@ -10,6 +10,8 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; /** * Module model. @@ -375,7 +377,7 @@ public function delete(&$pks) * * @param array &$pks An array of primary key IDs. * - * @return boolean True if successful. + * @return boolean|JException Boolean true on success, JException instance on error * * @since 1.6 * @throws Exception @@ -482,7 +484,7 @@ protected function generateNewTitle($category_id, $title, $position) while ($table->load(array('position' => $position, 'title' => $title))) { - $title = JString::increment($title); + $title = StringHelper::increment($title); } return array($title); @@ -522,9 +524,9 @@ public function getForm($data = array(), $loadData = true) } else { - $clientId = JArrayHelper::getValue($data, 'client_id'); - $module = JArrayHelper::getValue($data, 'module'); - $id = JArrayHelper::getValue($data, 'id'); + $clientId = ArrayHelper::getValue($data, 'client_id'); + $module = ArrayHelper::getValue($data, 'module'); + $id = ArrayHelper::getValue($data, 'id'); } // Add the default fields directory @@ -693,11 +695,10 @@ public function getItem($pk = null) // Convert to the JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = JArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($table->params); + $registry = new Registry($table->params); $this->_cache[$pk]->params = $registry->toArray(); // Determine the page assignment mode. @@ -872,7 +873,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') */ public function validate($form, $data, $group = null) { - require_once JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php'; + JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php'); return parent::validate($form, $data, $group); } diff --git a/administrator/components/com_modules/models/modules.php b/administrator/components/com_modules/models/modules.php index 0f44d2b4278eb..9be3631314073 100644 --- a/administrator/components/com_modules/models/modules.php +++ b/administrator/components/com_modules/models/modules.php @@ -48,6 +48,7 @@ public function __construct($config = array()) 'position', 'a.position', 'pages', 'name', 'e.name', + 'menuitem', ); } @@ -82,6 +83,7 @@ protected function populateState($ordering = 'a.position', $direction = 'asc') $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); $this->setState('filter.position', $this->getUserStateFromRequest($this->context . '.filter.position', 'filter_position', '', 'string')); $this->setState('filter.module', $this->getUserStateFromRequest($this->context . '.filter.module', 'filter_module', '', 'string')); + $this->setState('filter.menuitem', $this->getUserStateFromRequest($this->context . '.filter.menuitem', 'filter_menuitem', '', 'cmd')); $this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd')); // If in modal layout on the frontend, state and language are always forced. @@ -136,6 +138,7 @@ protected function getStoreId($id = '') $id .= ':' . $this->getState('filter.state'); $id .= ':' . $this->getState('filter.position'); $id .= ':' . $this->getState('filter.module'); + $id .= ':' . $this->getState('filter.menuitem'); $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.language'); @@ -331,6 +334,44 @@ protected function getListQuery() $query->where($db->quoteName('a.module') . ' = ' . $db->quote($module)); } + // Filter by menuitem id (only for site client). + if ((int) $clientId === 0 && $menuItemId = $this->getState('filter.menuitem')) + { + // If user selected the modules not assigned to any page (menu item). + if ((int) $menuItemId === -1) + { + $query->having('MIN(' . $db->quoteName('mm.menuid') . ') IS NULL'); + } + // If user selected the modules assigned to some particlar page (menu item). + else + { + // Modules in "All" pages. + $subQuery1 = $db->getQuery(true); + $subQuery1->select('MIN(' . $db->quoteName('menuid') . ')') + ->from($db->quoteName('#__modules_menu')) + ->where($db->quoteName('moduleid') . ' = ' . $db->quoteName('a.id')); + + // Modules in "Selected" pages that have the chosen menu item id. + $subQuery2 = $db->getQuery(true); + $subQuery2->select($db->quoteName('moduleid')) + ->from($db->quoteName('#__modules_menu')) + ->where($db->quoteName('menuid') . ' = ' . (int) $menuItemId); + + // Modules in "All except selected" pages that doesn't have the chosen menu item id. + $subQuery3 = $db->getQuery(true); + $subQuery3->select($db->quoteName('moduleid')) + ->from($db->quoteName('#__modules_menu')) + ->where($db->quoteName('menuid') . ' = -' . (int) $menuItemId); + + // Filter by modules assigned to the selected menu item. + $query->where('( + (' . $subQuery1 . ') = 0 + OR ((' . $subQuery1 . ') > 0 AND ' . $db->quoteName('a.id') . ' IN (' . $subQuery2 . ')) + OR ((' . $subQuery1 . ') < 0 AND ' . $db->quoteName('a.id') . ' NOT IN (' . $subQuery3 . ')) + )'); + } + } + // Filter by search in title or note or id:. $search = $this->getState('filter.search'); if (!empty($search)) diff --git a/administrator/components/com_modules/models/positions.php b/administrator/components/com_modules/models/positions.php index 4f247cb86f5fa..59d92fffbfef4 100644 --- a/administrator/components/com_modules/models/positions.php +++ b/administrator/components/com_modules/models/positions.php @@ -49,7 +49,7 @@ public function __construct($config = array()) * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'value', $direction = 'asc') { $app = JFactory::getApplication('administrator'); @@ -60,21 +60,23 @@ protected function populateState($ordering = null, $direction = null) $state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'); $this->setState('filter.state', $state); - $clientId = $app->input->getInt('client_id', 0); - $this->setState('filter.client_id', $clientId); - $template = $this->getUserStateFromRequest($this->context . '.filter.template', 'filter_template', '', 'string'); $this->setState('filter.template', $template); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'string'); $this->setState('filter.type', $type); + // Special case for the client id. + $clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int'); + $clientId = (!in_array((int) $clientId, array (0, 1))) ? 0 : (int) $clientId; + $this->setState('client_id', $clientId); + // Load the parameters. $params = JComponentHelper::getParams('com_modules'); $this->setState('params', $params); // List state information. - parent::populateState('value', 'asc'); + parent::populateState($ordering, $direction); } /** @@ -91,7 +93,7 @@ public function getItems() $lang = JFactory::getLanguage(); $search = $this->getState('filter.search'); $state = $this->getState('filter.state'); - $clientId = $this->getState('filter.client_id'); + $clientId = $this->getState('client_id'); $filter_template = $this->getState('filter.template'); $type = $this->getState('filter.type'); $ordering = $this->getState('list.ordering'); diff --git a/administrator/components/com_modules/models/select.php b/administrator/components/com_modules/models/select.php index d421aea9c70fa..6389c41e4b39f 100644 --- a/administrator/components/com_modules/models/select.php +++ b/administrator/components/com_modules/models/select.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Module model. * @@ -146,7 +148,7 @@ public function getItems() } } - $items = JArrayHelper::sortObjects($items, 'name', 1, true, true); + $items = ArrayHelper::sortObjects($items, 'name', 1, true, true); // TODO: Use the cached XML from the extensions table? diff --git a/administrator/components/com_modules/modules.php b/administrator/components/com_modules/modules.php index 759313fc8ebd2..5a0cd0caeb553 100644 --- a/administrator/components/com_modules/modules.php +++ b/administrator/components/com_modules/modules.php @@ -10,9 +10,13 @@ defined('_JEXEC') or die; JHtml::_('behavior.tabstate'); -if (!JFactory::getUser()->authorise('core.manage', 'com_modules')) +$user = JFactory::getUser(); +$input = JFactory::getApplication()->input; + +if (($input->get('layout') !== 'modal' && $input->get('view') !== 'modules') + && !$user->authorise('core.manage', 'com_modules')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Modules'); diff --git a/administrator/components/com_modules/views/module/tmpl/edit.php b/administrator/components/com_modules/views/module/tmpl/edit.php index e39011fe7297a..7f99529e3928b 100644 --- a/administrator/components/com_modules/views/module/tmpl/edit.php +++ b/administrator/components/com_modules/views/module/tmpl/edit.php @@ -13,6 +13,7 @@ JHtml::_('behavior.formvalidator'); JHtml::_('behavior.combobox'); +JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select', null, array('disable_search_threshold' => 0)); $hasContent = empty($this->item->module) || isset($this->item->xml->customContent); @@ -129,22 +130,35 @@ if (!tmpRow.hasClass('unpublished') || tmpRow.hasClass('')) { tmpRow.addClass('unpublished'); } } if (updStatus == -2) { - tmpStatus.html('" . JText::_("JTrashed") . "'); + tmpStatus.html('" . JText::_("JTRASHED") . "'); if (!tmpRow.hasClass('unpublished') || tmpRow.hasClass('')) { tmpRow.addClass('unpublished'); } } + if (document.formvalidator.isValid(document.getElementById('module-form'))) { jQuery('#title-" . $this->item->id . "', parent.document).text(updTitle); jQuery('#position-" . $this->item->id . "', parent.document).text(updPosition); jQuery('#access-" . $this->item->id . "', parent.document).html(parent.viewLevels[updAccess]); + } } - window.parent.jQuery('#module" . $this->item->id . "Modal').modal('hide'); + } + + if (task !== 'module.apply') + { + window.parent.jQuery('#module" . ((int) $this->item->id == 0 ? 'Add' : 'Edit' . (int) $this->item->id) . "Modal').modal('hide'); } } };"; JFactory::getDocument()->addScriptDeclaration($script); +$input = JFactory::getApplication()->input; + +// In case of modal +$isModal = $input->get('layout') == 'modal' ? true : false; +$layout = $isModal ? 'modal' : 'edit'; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; ?> - + + @@ -193,7 +207,7 @@

    - +

    @@ -215,7 +229,7 @@
    - form->getControlGroup('showtitle'); ?> + form->renderField('showtitle'); ?>
    form->getLabel('position'); ?> diff --git a/administrator/components/com_modules/views/module/tmpl/edit_assignment.php b/administrator/components/com_modules/views/module/tmpl/edit_assignment.php index d1c1594f81708..ecc5b084cd3ea 100644 --- a/administrator/components/com_modules/views/module/tmpl/edit_assignment.php +++ b/administrator/components/com_modules/views/module/tmpl/edit_assignment.php @@ -9,11 +9,11 @@ defined('_JEXEC') or die; -// Initiasile related data. -require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'; +// Initialise related data. +JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); $menuTypes = MenusHelper::getMenuLinks(); -JHtml::_('script', 'jui/treeselectmenu.jquery.min.js', false, true); +JHtml::_('script', 'jui/treeselectmenu.jquery.min.js', array('version' => 'auto', 'relative' => true)); $script = " jQuery(document).ready(function() @@ -110,15 +110,16 @@ function menuHide(val) />
    item->client_id; diff --git a/administrator/components/com_modules/views/module/tmpl/modal.php b/administrator/components/com_modules/views/module/tmpl/modal.php index a8a8c60b69a45..2c38f757c2719 100644 --- a/administrator/components/com_modules/views/module/tmpl/modal.php +++ b/administrator/components/com_modules/views/module/tmpl/modal.php @@ -11,6 +11,7 @@ JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); ?> + diff --git a/administrator/components/com_modules/views/modules/tmpl/default.php b/administrator/components/com_modules/views/modules/tmpl/default.php index 433acbe99e9f2..a6391755f575f 100644 --- a/administrator/components/com_modules/views/modules/tmpl/default.php +++ b/administrator/components/com_modules/views/modules/tmpl/default.php @@ -13,6 +13,7 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); +$clientId = (int) $this->state->get('client_id', 0); $user = JFactory::getUser(); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); @@ -22,6 +23,7 @@ $saveOrderingUrl = 'index.php?option=com_modules&task=modules.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'moduleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl); } +$colSpan = $clientId === 1 ? 9 : 10; ?> sidebar)) : ?> @@ -62,9 +64,11 @@
  • + pagination->getListFooter(); ?>
    name;?> pages; ?> escape($item->access_level); ?> - language == '') : ?> - - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_modules/views/modules/tmpl/default_batch.php b/administrator/components/com_modules/views/modules/tmpl/default_batch.php deleted file mode 100644 index 454bd01c185d9..0000000000000 --- a/administrator/components/com_modules/views/modules/tmpl/default_batch.php +++ /dev/null @@ -1,80 +0,0 @@ -state->get('client_id'); - -// Show only Module Positions of published Templates -$published = 1; -$positions = JHtml::_('modules.positions', $clientId, $published); -$positions['']['items'][] = ModulesHelper::createOption('nochange', JText::_('COM_MODULES_BATCH_POSITION_NOCHANGE')); -$positions['']['items'][] = ModulesHelper::createOption('noposition', JText::_('COM_MODULES_BATCH_POSITION_NOPOSITION')); - -// Add custom position to options -$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION'); - -// Build field -$attr = array( - 'id' => 'batch-position-id', - 'list.attr' => 'class="chzn-custom-value input-xlarge" ' - . 'data-custom_group_text="' . $customGroupText . '" ' - . 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" ' - . 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" ' -); - -?> - diff --git a/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php b/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php index 5cb1859b7236c..eb1279f5b4902 100644 --- a/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php +++ b/administrator/components/com_modules/views/modules/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_modules/views/modules/tmpl/modal.php b/administrator/components/com_modules/views/modules/tmpl/modal.php index 6027d681841b9..1812f577b5e9e 100644 --- a/administrator/components/com_modules/views/modules/tmpl/modal.php +++ b/administrator/components/com_modules/views/modules/tmpl/modal.php @@ -28,15 +28,11 @@ JFactory::getDocument()->addScriptDeclaration(' moduleIns = function(type, name) { - var extraVal ,fieldExtra = jQuery("#extra_class"); - extraVal = (fieldExtra.length && fieldExtra.val().length) ? "," + fieldExtra.val() : ""; - window.parent.jInsertEditorText("{loadmodule " + type + "," + name + extraVal + "}", "' . $editor . '"); + window.parent.jInsertEditorText("{loadmodule " + type + "," + name + "}", "' . $editor . '"); window.parent.jModalClose(); }; modulePosIns = function(position) { - var extraVal ,fieldExtra = jQuery("#extra_class"); - extraVal = (fieldExtra.length && fieldExtra.val().length) ? "," + fieldExtra.val() : ""; - window.parent.jInsertEditorText("{loadposition " + position + extraVal + "}", "' . $editor . '"); + window.parent.jInsertEditorText("{loadposition " + position + "}", "' . $editor . '"); window.parent.jModalClose(); };'); ?> @@ -44,19 +40,6 @@ -
    -
    -
    - -
    -
    - -
    -
    -
    - $this)); ?>
    @@ -136,13 +119,7 @@ escape($item->access_level); ?>
    - language == '') : ?> - - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_modules/views/modules/view.html.php b/administrator/components/com_modules/views/modules/view.html.php index 36fe5b63b633a..7b840f4b13e2f 100644 --- a/administrator/components/com_modules/views/modules/view.html.php +++ b/administrator/components/com_modules/views/modules/view.html.php @@ -126,7 +126,7 @@ protected function addToolbar() if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules')) { - JHtml::_('bootstrap.modal', 'collapseModal'); + JHtml::_('bootstrap.renderModal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button @@ -151,6 +151,11 @@ protected function addToolbar() } JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER'); + + if (JHtmlSidebar::getEntries()) + { + $this->sidebar = JHtmlSidebar::render(); + } } /** diff --git a/administrator/components/com_modules/views/positions/tmpl/modal.php b/administrator/components/com_modules/views/positions/tmpl/modal.php index e0b013860b573..fd61b3770e649 100644 --- a/administrator/components/com_modules/views/positions/tmpl/modal.php +++ b/administrator/components/com_modules/views/positions/tmpl/modal.php @@ -17,7 +17,7 @@ $lang = JFactory::getLanguage(); $ordering = $this->escape($this->state->get('list.ordering')); $direction = $this->escape($this->state->get('list.direction')); -$clientId = $this->state->get('filter.client_id'); +$clientId = $this->state->get('client_id'); $state = $this->state->get('filter.state'); $template = $this->state->get('filter.template'); $type = $this->state->get('filter.type'); @@ -26,7 +26,7 @@
    diff --git a/administrator/components/com_newsfeeds/config.xml b/administrator/components/com_newsfeeds/config.xml index 3091aff7bc7e0..418e10e336d75 100644 --- a/administrator/components/com_newsfeeds/config.xml +++ b/administrator/components/com_newsfeeds/config.xml @@ -102,7 +102,7 @@ @@ -113,7 +113,7 @@ @@ -424,6 +424,38 @@
    +
    + + + + + + + + + + + +
    +
    input->get('view', 'newsfeeds'); $layout = $this->input->get('layout', 'default'); diff --git a/administrator/components/com_newsfeeds/controllers/newsfeed.php b/administrator/components/com_newsfeeds/controllers/newsfeed.php index f5d5d86adf59d..6059c50ffbb01 100644 --- a/administrator/components/com_newsfeeds/controllers/newsfeed.php +++ b/administrator/components/com_newsfeeds/controllers/newsfeed.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Newsfeed controller class. * @@ -27,14 +29,13 @@ class NewsfeedsControllerNewsfeed extends JControllerForm */ protected function allowAdd($data = array()) { - $user = JFactory::getUser(); - $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); + $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int'); $allow = null; if ($categoryId) { // If the category has been passed in the URL check it. - $allow = $user->authorise('core.create', $this->option . '.category.' . $categoryId); + $allow = JFactory::getUser()->authorise('core.create', $this->option . '.category.' . $categoryId); } if ($allow === null) @@ -60,25 +61,30 @@ protected function allowAdd($data = array()) */ protected function allowEdit($data = array(), $key = 'id') { - $user = JFactory::getUser(); $recordId = (int) isset($data[$key]) ? $data[$key] : 0; - $categoryId = 0; - if ($recordId) + // Since there is no asset tracking, fallback to the component permissions. + if (!$recordId) { - $categoryId = (int) $this->getModel()->getItem($recordId)->catid; + return parent::allowEdit($data, $key); } - if ($categoryId) - { - // The category has been set. Check the category permissions. - return $user->authorise('core.edit', $this->option . '.category.' . $categoryId); - } - else + // Get the item. + $item = $this->getModel()->getItem($recordId); + + // Since there is no item, return false. + if (empty($item)) { - // Since there is no asset tracking, revert to the component permissions. - return parent::allowEdit($data, $key); + return false; } + + $user = JFactory::getUser(); + + // Check if can edit own core.edit.own. + $canEditOwn = $user->authorise('core.edit.own', $this->option . '.category.' . (int) $item->catid) && $item->created_by == $user->id; + + // Check the category core.edit permissions. + return $canEditOwn || $user->authorise('core.edit', $this->option . '.category.' . (int) $item->catid); } /** diff --git a/administrator/components/com_newsfeeds/controllers/newsfeeds.php b/administrator/components/com_newsfeeds/controllers/newsfeeds.php index b5d1042af7a8f..45a6c27464b29 100644 --- a/administrator/components/com_newsfeeds/controllers/newsfeeds.php +++ b/administrator/components/com_newsfeeds/controllers/newsfeeds.php @@ -29,8 +29,7 @@ class NewsfeedsControllerNewsfeeds extends JControllerAdmin */ public function getModel($name = 'Newsfeed', $prefix = 'NewsfeedsModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - return $model; + return parent::getModel($name, $prefix, $config); } /** diff --git a/administrator/components/com_newsfeeds/helpers/html/newsfeed.php b/administrator/components/com_newsfeeds/helpers/html/newsfeed.php index 5d0720003e47e..b400cfa0fc0a4 100644 --- a/administrator/components/com_newsfeeds/helpers/html/newsfeed.php +++ b/administrator/components/com_newsfeeds/helpers/html/newsfeed.php @@ -44,7 +44,7 @@ public static function association($newsfeedid) $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('c.id, c.name as title') - ->select('l.sef as lang_sef') + ->select('l.sef as lang_sef, lang_code') ->from('#__newsfeeds as c') ->select('cat.title as category_title') ->join('LEFT', '#__categories as cat ON cat.id=c.catid') @@ -69,28 +69,17 @@ public static function association($newsfeedid) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_newsfeeds&task=newsfeed.edit&id=' . (int) $item->id); - $tooltipParts = array( - JHtml::_('image', 'mod_languages/' . $item->image . '.gif', - $item->language_title, - array('title' => $item->language_title), - true - ), - $item->title, - '(' . $item->category_title . ')' - ); - $item->link = JHtml::_( - 'tooltip', - implode(' ', $tooltipParts), - null, - null, - $text, - $url, - null, - 'hasTooltip label label-association label-' . $item->lang_sef - ); + $tooltip = $item->title . '
    ' . JText::sprintf('JCATEGORY_SPRINTF', $item->category_title); + $classes = 'hasPopover label label-association label-' . $item->lang_sef; + + $item->link = '' + . $text . ''; } } + JHtml::_('bootstrap.popover'); + $html = JLayoutHelper::render('joomla.content.associations', $items); } diff --git a/administrator/components/com_newsfeeds/helpers/newsfeeds.php b/administrator/components/com_newsfeeds/helpers/newsfeeds.php index 897800e9e4122..583cf74a770b2 100644 --- a/administrator/components/com_newsfeeds/helpers/newsfeeds.php +++ b/administrator/components/com_newsfeeds/helpers/newsfeeds.php @@ -93,4 +93,74 @@ public static function countItems(&$items) return $items; } + + /** + * Adds Count Items for Tag Manager. + * + * @param stdClass[] &$items The newsfeed tag objects + * @param string $extension The name of the active view. + * + * @return stdClass[] + * + * @since 3.6 + */ + public static function countTagItems(&$items, $extension) + { + $db = JFactory::getDbo(); + $parts = explode('.', $extension); + $component = $parts[0]; + $section = null; + if (count($parts) > 1) + { + $section = $parts[1]; + } + $join = $db->qn('#__newsfeeds') . ' AS c ON ct.content_item_id=c.id'; + if ($section === 'category') + { + $join = $db->qn('#__categories') . ' AS c ON ct.content_item_id=c.id'; + } + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + $query = $db->getQuery(true); + $query->select('published AS state, count(*) AS count') + ->from($db->qn('#__contentitem_tag_map') . 'AS ct ') + ->where('ct.tag_id = ' . (int) $item->id) + ->where('ct.type_alias =' . $db->q($extension)) + ->join('LEFT', $join) + ->group('state'); + + $db->setQuery($query); + $newsfeeds = $db->loadObjectList(); + + foreach ($newsfeeds as $newsfeed) + { + if ($newsfeed->state == 1) + { + $item->count_published = $newsfeed->count; + } + + if ($newsfeed->state == 0) + { + $item->count_unpublished = $newsfeed->count; + } + + if ($newsfeed->state == 2) + { + $item->count_archived = $newsfeed->count; + } + + if ($newsfeed->state == -2) + { + $item->count_trashed = $newsfeed->count; + } + } + } + + return $items; + } } diff --git a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php index 0c9c5311bbe97..904812fd67c53 100644 --- a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php @@ -33,8 +33,10 @@ class JFormFieldModal_Newsfeed extends JFormField */ protected function getInput() { - $allowEdit = ((string) $this->element['edit'] == 'true') ? true : false; - $allowClear = ((string) $this->element['clear'] != 'false') ? true : false; + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language JFactory::getLanguage()->load('com_newsfeeds', JPATH_ADMINISTRATOR); @@ -42,83 +44,50 @@ protected function getInput() // The active newsfeed id field. $value = (int) $this->value > 0 ? (int) $this->value : ''; - // Build the script. - $script = array(); + // Create the modal id. + $modalId = 'Newsfeed_' . $this->id; - // Select button script - $script[] = ' function jSelectNewsfeed_' . $this->id . '(id, name, object) {'; - $script[] = ' document.getElementById("' . $this->id . '_id").value = id;'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = name;'; + // Add the modal field script to the document head. + JHtml::_('jquery.framework'); + JHtml::_('script', 'system/modal-fields.js', array('version' => 'auto', 'relative' => true)); - if ($allowEdit) - { - $script[] = ' if (id == "' . (int) $this->value . '") {'; - $script[] = ' jQuery("#' . $this->id . '_edit").removeClass("hidden");'; - $script[] = ' } else {'; - $script[] = ' jQuery("#' . $this->id . '_edit").addClass("hidden");'; - $script[] = ' }'; - } - - if ($allowClear) + // Script to proxy the select modal function to the modal-fields.js file. + if ($allowSelect) { - $script[] = ' jQuery("#' . $this->id . '_clear").removeClass("hidden");'; - } - - $script[] = ' jQuery("#newsfeedSelect' . $this->id . 'Modal").modal("hide");'; - - if ($this->required) - { - $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_id"));'; - $script[] = ' document.formvalidator.validate(document.getElementById("' . $this->id . '_name"));'; - } - - $script[] = ' }'; + static $scriptSelect = null; - // Edit button script - $script[] = ' function jEditNewsfeed_' . $value . '(name) {'; - $script[] = ' document.getElementById("' . $this->id . '_name").value = name;'; - $script[] = ' }'; + if (is_null($scriptSelect)) + { + $scriptSelect = array(); + } - // Clear button script - static $scriptClear; + if (!isset($scriptSelect[$this->id])) + { + JFactory::getDocument()->addScriptDeclaration(" + function jSelectNewsfeed_" . $this->id . "(id, title, object) { + window.processModalSelect('Newsfeed', '" . $this->id . "', id, title, '', object); + } + "); - if ($allowClear && !$scriptClear) - { - $scriptClear = true; - - $script[] = ' function jClearNewsfeed(id) {'; - $script[] = ' document.getElementById(id + "_id").value = "";'; - $script[] = ' document.getElementById(id + "_name").value = "' - . htmlspecialchars(JText::_('COM_NEWSFEEDS_SELECT_A_FEED', true), ENT_COMPAT, 'UTF-8') . '";'; - $script[] = ' jQuery("#"+id + "_clear").addClass("hidden");'; - $script[] = ' if (document.getElementById(id + "_edit")) {'; - $script[] = ' jQuery("#"+id + "_edit").addClass("hidden");'; - $script[] = ' }'; - $script[] = ' return false;'; - $script[] = ' }'; + $scriptSelect[$this->id] = true; + } } - // Add the script to the document head. - JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); - // Setup variables for display. - $html = array(); - - $linkNewsfeeds = 'index.php?option=com_newsfeeds&view=newsfeeds&layout=modal&tmpl=component' - . '&function=jSelectNewsfeed_' . $this->id; - - $linkNewsfeed = 'index.php?option=com_newsfeeds&view=newsfeed&layout=modal&tmpl=component' - . '&task=newsfeed.edit' - . '&function=jEditNewsfeed_' . $value; + $linkNewsfeeds = 'index.php?option=com_newsfeeds&view=newsfeeds&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $linkNewsfeed = 'index.php?option=com_newsfeeds&view=newsfeed&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; + $modalTitle = JText::_('COM_NEWSFEEDS_CHANGE_FEED'); if (isset($this->element['language'])) { $linkNewsfeeds .= '&forcedLanguage=' . $this->element['language']; $linkNewsfeed .= '&forcedLanguage=' . $this->element['language']; + $modalTitle .= ' — ' . $this->element['label']; } - $urlSelect = $linkNewsfeeds . '&' . JSession::getFormToken() . '=1'; - $urlEdit = $linkNewsfeed . '&id=' . $value . '&' . JSession::getFormToken() . '=1'; + $urlSelect = $linkNewsfeeds . '&function=jSelectNewsfeed_' . $this->id; + $urlEdit = $linkNewsfeed . '&task=newsfeed.edit&id=\' + document.getElementById("' . $this->id . '_id").value + \''; + $urlNew = $linkNewsfeed . '&task=newsfeed.add'; if ($value) { @@ -139,36 +108,49 @@ protected function getInput() } } - if (empty($title)) - { - $title = JText::_('COM_NEWSFEEDS_SELECT_A_FEED'); - } - - $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); + $title = empty($title) ? JText::_('COM_NEWSFEEDS_SELECT_A_FEED') : htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); // The current newsfeed display field. - $html[] = ''; - $html[] = ''; + $html = ''; + $html .= ''; // Select newsfeed button - $html[] = '' - . ' ' . JText::_('JSELECT') - . ''; + if ($allowSelect) + { + $html .= '' + . ' ' . JText::_('JSELECT') + . ''; + } + + // New newsfeed button + if ($allowNew) + { + $html .= '' + . ' ' . JText::_('JACTION_CREATE') + . ''; + } // Edit newsfeed button if ($allowEdit) { - $html[] = '' . ' ' . JText::_('JACTION_EDIT') . ''; @@ -177,63 +159,106 @@ protected function getInput() // Clear newsfeed button if ($allowClear) { - $html[] = '' + . ' href="#"' + . ' onclick="window.processModalParent(\'' . $this->id . '\'); return false;">' . '' . JText::_('JCLEAR') - . ''; + . ''; } - $html[] = ''; + $html .= ''; // Select newsfeed modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'newsfeedSelect' . $this->id . 'Modal', - array( - 'url' => $urlSelect, - 'title' => JText::_('COM_NEWSFEEDS_SELECT_A_FEED'), - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - ) - ); - - // Edit newsfeed modal - $html[] = JHtml::_( - 'bootstrap.renderModal', - 'newsfeedEdit' . $value . 'Modal', - array( - 'url' => $urlEdit, - 'title' => JText::_('COM_NEWSFEEDS_EDIT_NEWSFEED'), - 'backdrop' => 'static', - 'closeButton' => false, - 'width' => '800px', - 'height' => '400px', - 'modalWidth' => '80', - 'bodyHeight' => '70', - 'footer' => '' - . '' - . '' - ) - ); + if ($allowSelect) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalSelect' . $modalId, + array( + 'title' => $modalTitle, + 'url' => $urlSelect, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '', + ) + ); + } + + // New newsfeed modal + if ($allowNew) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalNew' . $modalId, + array( + 'title' => JText::_('COM_NEWSFEEDS_NEW_NEWSFEED'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlNew, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } + + // Edit newsfeed modal. + if ($allowEdit) + { + $html .= JHtml::_( + 'bootstrap.renderModal', + 'ModalEdit' . $modalId, + array( + 'title' => JText::_('COM_NEWSFEEDS_EDIT_NEWSFEED'), + 'backdrop' => 'static', + 'keyboard' => false, + 'closeButton' => false, + 'url' => $urlEdit, + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '' + . '' + . '', + ) + ); + } // Add class='required' for client side validation $class = $this->required ? ' class="required modal-value"' : ''; - $html[] = ''; + $html .= ''; - return implode("\n", $html); + return $html; } /** diff --git a/administrator/components/com_newsfeeds/models/fields/newsfeeds.php b/administrator/components/com_newsfeeds/models/fields/newsfeeds.php index 53f65997dfedb..f6691c667137c 100644 --- a/administrator/components/com_newsfeeds/models/fields/newsfeeds.php +++ b/administrator/components/com_newsfeeds/models/fields/newsfeeds.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldNewsfeeds extends JFormFieldList +class JFormFieldNewsfeeds extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_newsfeeds/models/forms/newsfeed.xml b/administrator/components/com_newsfeeds/models/forms/newsfeed.xml index a712d04783465..49444229a3684 100644 --- a/administrator/components/com_newsfeeds/models/forms/newsfeed.xml +++ b/administrator/components/com_newsfeeds/models/forms/newsfeed.xml @@ -54,7 +54,6 @@ description="COM_NEWSFEEDS_FIELD_CATEGORY_DESC" extension="com_newsfeeds" required="true" - allowAdd="true" default="" /> @@ -177,6 +176,7 @@ name="modified_by" type="user" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" + description="COM_NEWSFEEDS_FIELD_MODIFIED_BY_DESC" class="readonly" readonly="true" filter="unset" diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index 728a90dfe9e3b..ab0c9fec96a4e 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; JLoader::register('NewsfeedsHelper', JPATH_ADMINISTRATOR . '/components/com_newsfeeds/helpers/newsfeeds.php'); @@ -314,7 +315,7 @@ public function save($data) } // Save New Category - if ($catid == 0) + if ($catid == 0 && $this->canCreateCategory()) { $table = array(); $table['title'] = $data['catid']; @@ -366,13 +367,11 @@ public function getItem($pk = null) if ($item = parent::getItem($pk)) { // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($item->metadata); + $registry = new Registry($item->metadata); $item->metadata = $registry->toArray(); // Convert the images field to an array. - $registry = new Registry; - $registry->loadString($item->images); + $registry = new Registry($item->images); $item->images = $registry->toArray(); } @@ -503,38 +502,39 @@ protected function getReorderConditions($table) */ protected function preprocessForm(JForm $form, $data, $group = 'content') { + if ($this->canCreateCategory()) + { + $form->setFieldAttribute('catid', 'allowAdd', 'true'); + } + // Association newsfeeds items - $app = JFactory::getApplication(); - $assoc = JLanguageAssociations::isEnabled(); - if ($assoc) + if (JLanguageAssociations::isEnabled()) { - $languages = JLanguageHelper::getLanguages('lang_code'); - $addform = new SimpleXMLElement(''); - $fields = $addform->addChild('fields'); - $fields->addAttribute('name', 'associations'); - $fieldset = $fields->addChild('fieldset'); - $fieldset->addAttribute('name', 'item_associations'); - $fieldset->addAttribute('description', 'COM_NEWSFEEDS_ITEM_ASSOCIATIONS_FIELDSET_DESC'); - $add = false; - - foreach ($languages as $tag => $language) + $languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc'); + + if (count($languages) > 1) { - if (empty($data->language) || $tag != $data->language) + $addform = new SimpleXMLElement(''); + $fields = $addform->addChild('fields'); + $fields->addAttribute('name', 'associations'); + $fieldset = $fields->addChild('fieldset'); + $fieldset->addAttribute('name', 'item_associations'); + $fieldset->addAttribute('description', 'COM_NEWSFEEDS_ITEM_ASSOCIATIONS_FIELDSET_DESC'); + + foreach ($languages as $language) { - $add = true; $field = $fieldset->addChild('field'); - $field->addAttribute('name', $tag); + $field->addAttribute('name', $language->lang_code); $field->addAttribute('type', 'modal_newsfeed'); - $field->addAttribute('language', $tag); + $field->addAttribute('language', $language->lang_code); $field->addAttribute('label', $language->title); $field->addAttribute('translate_label', 'false'); + $field->addAttribute('select', 'true'); + $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); } - } - if ($add) - { $form->load($addform, false); } } @@ -561,11 +561,23 @@ protected function generateNewTitle($category_id, $alias, $name) { if ($name == $table->name) { - $name = JString::increment($name); + $name = StringHelper::increment($name); } - $alias = JString::increment($alias, 'dash'); + $alias = StringHelper::increment($alias, 'dash'); } return array($name, $alias); } + + /** + * Is the user allowed to create an on the fly category? + * + * @return bool + * + * @since 3.6.1 + */ + private function canCreateCategory() + { + return JFactory::getUser()->authorise('core.create', 'com_newsfeeds'); + } } diff --git a/administrator/components/com_newsfeeds/models/newsfeeds.php b/administrator/components/com_newsfeeds/models/newsfeeds.php index fb5ca49e8e8a6..b93423fb7771f 100644 --- a/administrator/components/com_newsfeeds/models/newsfeeds.php +++ b/administrator/components/com_newsfeeds/models/newsfeeds.php @@ -144,37 +144,38 @@ protected function getStoreId($id = '') protected function getListQuery() { // Create a new query object. - $db = $this->getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true); - $user = JFactory::getUser(); - $app = JFactory::getApplication(); + $user = JFactory::getUser(); + $app = JFactory::getApplication(); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.id, a.name, a.alias, a.checked_out, a.checked_out_time, a.catid,' . - ' a.numarticles, a.cache_time,' . + ' a.numarticles, a.cache_time, a.created_by,' . ' a.published, a.access, a.ordering, a.language, a.publish_up, a.publish_down' ) ); $query->from($db->quoteName('#__newsfeeds', 'a')); // Join over the language - $query->select('l.title AS language_title, l.image AS language_image') - ->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON l.lang_code = a.language'); + $query->select($db->quoteName('l.title', 'language_title')) + ->select($db->quoteName('l.image', 'language_image')) + ->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON ' . $db->qn('l.lang_code') . ' = ' . $db->qn('a.language')); // Join over the users for the checked out user. - $query->select('uc.name AS editor') - ->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON uc.id=a.checked_out'); + $query->select($db->quoteName('uc.name', 'editor')) + ->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON ' . $db->qn('uc.id') . ' = ' . $db->qn('a.checked_out')); // Join over the asset groups. - $query->select('ag.title AS access_level') - ->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ag.id = a.access'); + $query->select($db->quoteName('ag.title', 'access_level')) + ->join('LEFT', $db->quoteName('#__viewlevels', 'ag') . ' ON ' . $db->qn('ag.id') . ' = ' . $db->qn('a.access')); // Join over the categories. - $query->select('c.title AS category_title') - ->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON c.id = a.catid'); + $query->select($db->quoteName('c.title', 'category_title')) + ->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid')); // Join over the associations. $assoc = JLanguageAssociations::isEnabled(); @@ -182,8 +183,8 @@ protected function getListQuery() if ($assoc) { $query->select('COUNT(asso2.id)>1 AS association') - ->join('LEFT', '#__associations AS asso ON asso.id = a.id AND asso.context=' . $db->quote('com_newsfeeds.item')) - ->join('LEFT', '#__associations AS asso2 ON asso2.key = asso.key') + ->join('LEFT', $db->quoteName('#__associations', 'asso') . ' ON asso.id = a.id AND asso.context = ' . $db->quote('com_newsfeeds.item')) + ->join('LEFT', $db->quoteName('#__associations', 'asso2') . ' ON asso2.key = asso.key') ->group('a.id, l.title, l.image, uc.name, ag.title, c.title'); } @@ -196,8 +197,7 @@ protected function getListQuery() // Implement View Level Access if (!$user->authorise('core.admin')) { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where($db->quoteName('a.access') . ' IN (' . $groups . ')'); + $query->where($db->quoteName('a.access') . ' IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'); } // Filter by published state. diff --git a/administrator/components/com_newsfeeds/newsfeeds.php b/administrator/components/com_newsfeeds/newsfeeds.php index d7b025bff0fe7..d98f6e2a740eb 100644 --- a/administrator/components/com_newsfeeds/newsfeeds.php +++ b/administrator/components/com_newsfeeds/newsfeeds.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_newsfeeds')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Newsfeeds'); diff --git a/administrator/components/com_newsfeeds/sql/install.mysql.utf8.sql b/administrator/components/com_newsfeeds/sql/install.mysql.utf8.sql index 6c53324a62c40..da029c00d6067 100644 --- a/administrator/components/com_newsfeeds/sql/install.mysql.utf8.sql +++ b/administrator/components/com_newsfeeds/sql/install.mysql.utf8.sql @@ -1,33 +1,39 @@ -CREATE TABLE `#__newsfeeds` ( - `catid` integer NOT NULL default '0', - `id` integer(10) UNSIGNED NOT NULL auto_increment, - `name` varchar(100) NOT NULL DEFAULT '', - `alias` varchar(100) NOT NULL default '', - `link` varchar(200) NOT NULL DEFAULT '', - `filename` varchar(200) default NULL, - `published` tinyint(1) NOT NULL default '0', - `numarticles` integer unsigned NOT NULL default '1', - `cache_time` integer unsigned NOT NULL default '3600', - `checked_out` integer(10) unsigned NOT NULL default '0', - `checked_out_time` datetime NOT NULL default '0000-00-00 00:00:00', - `ordering` integer NOT NULL default '0', - `rtl` tinyint(4) NOT NULL default '0', - `access` tinyint UNSIGNED NOT NULL DEFAULT '0', +-- +-- Table structure for table `#__newsfeeds` +-- + +CREATE TABLE IF NOT EXISTS `#__newsfeeds` ( + `catid` int(11) NOT NULL DEFAULT 0, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', + `link` varchar(2048) NOT NULL DEFAULT '', + `published` tinyint(1) NOT NULL DEFAULT 0, + `numarticles` int(10) unsigned NOT NULL DEFAULT 1, + `cache_time` int(10) unsigned NOT NULL DEFAULT 3600, + `checked_out` int(10) unsigned NOT NULL DEFAULT 0, + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ordering` int(11) NOT NULL DEFAULT 0, + `rtl` tinyint(4) NOT NULL DEFAULT 0, + `access` int(10) unsigned NOT NULL DEFAULT 0, `language` char(7) NOT NULL DEFAULT '', `params` text NOT NULL, - `created` datetime NOT NULL default '0000-00-00 00:00:00', - `created_by` int(10) unsigned NOT NULL default '0', - `created_by_alias` varchar(255) NOT NULL default '', - `modified` datetime NOT NULL default '0000-00-00 00:00:00', - `modified_by` int(10) unsigned NOT NULL default '0', + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `created_by` int(10) unsigned NOT NULL DEFAULT 0, + `created_by_alias` varchar(255) NOT NULL DEFAULT '', + `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified_by` int(10) unsigned NOT NULL DEFAULT 0, `metakey` text NOT NULL, `metadesc` text NOT NULL, `metadata` text NOT NULL, `xreference` varchar(50) NOT NULL COMMENT 'A reference to enable linkages to external data sets.', - `publish_up` datetime NOT NULL default '0000-00-00 00:00:00', - `publish_down` datetime NOT NULL default '0000-00-00 00:00:00', - - PRIMARY KEY (`id`), + `publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `description` text NOT NULL, + `version` int(10) unsigned NOT NULL DEFAULT 1, + `hits` int(10) unsigned NOT NULL DEFAULT 0, + `images` text NOT NULL, + PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), KEY `idx_state` (`published`), @@ -35,6 +41,4 @@ CREATE TABLE `#__newsfeeds` ( KEY `idx_createdby` (`created_by`), KEY `idx_language` (`language`), KEY `idx_xreference` (`xreference`) - -) DEFAULT CHARSET=utf8; - +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/administrator/components/com_newsfeeds/tables/newsfeed.php b/administrator/components/com_newsfeeds/tables/newsfeed.php index a982e6a45fb43..5db8254748c9e 100644 --- a/administrator/components/com_newsfeeds/tables/newsfeed.php +++ b/administrator/components/com_newsfeeds/tables/newsfeed.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + /** * Newsfeed Table class. * @@ -79,7 +81,7 @@ public function check() $bad_characters = array("\n", "\r", "\"", "<", ">"); // Remove bad characters - $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + $after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey); // Create array using commas as delimiter $keys = explode(',', $after_clean); @@ -103,7 +105,7 @@ public function check() { // Only process if not empty $bad_characters = array("\"", "<", ">"); - $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); } return true; diff --git a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php index 59ac6d09167c1..78fd13d327ce6 100644 --- a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php +++ b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/edit.php @@ -27,6 +27,7 @@ if (task == "newsfeed.cancel" || document.formvalidator.isValid(document.getElementById("newsfeed-form"))) { Joomla.submitform(task, document.getElementById("newsfeed-form")); + // @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__. if (task !== "newsfeed.apply") { window.parent.jQuery("#newsfeedEdit' . $this->item->id . 'Modal").modal("hide"); @@ -41,7 +42,7 @@ // In case of modal $isModal = $input->get('layout') == 'modal' ? true : false; $layout = $isModal ? 'modal' : 'edit'; -$tmpl = $isModal ? '&tmpl=component' : ''; +$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : ''; ?> @@ -55,8 +56,8 @@
    - form->getControlGroup('link'); ?> - form->getControlGroup('description'); ?> + form->renderField('link'); ?> + form->renderField('description'); ?>
    @@ -68,14 +69,20 @@
    - form->getControlGroup('images'); ?> + form->renderField('images'); ?> form->getGroup('images') as $field) : ?> - getControlGroup(); ?> + renderField(); ?>
    + + loadTemplate('display'); ?> + + + +
    @@ -87,12 +94,6 @@
    - - loadTemplate('display'); ?> - - - - loadTemplate('associations'); ?> @@ -104,5 +105,6 @@
    + diff --git a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/modal.php b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/modal.php index f709c15db2c9c..0e19a65106d5f 100644 --- a/administrator/components/com_newsfeeds/views/newsfeed/tmpl/modal.php +++ b/administrator/components/com_newsfeeds/views/newsfeed/tmpl/modal.php @@ -11,6 +11,7 @@ JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom')); +// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__. $function = JFactory::getApplication()->input->getCmd('function', 'jEditNewsfeed_' . (int) $this->item->id); // Function to update input title when changed diff --git a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php index 9e94b7e558f7c..5b9c5322d1515 100644 --- a/administrator/components/com_newsfeeds/views/newsfeed/view.html.php +++ b/administrator/components/com_newsfeeds/views/newsfeed/view.html.php @@ -63,10 +63,18 @@ public function display($tpl = null) return false; } - if ($this->getLayout() == 'modal') + // If we are forcing a language in modal (used for associations). + if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) { + // Set the language field to the forcedLanguage and disable changing it. + $this->form->setValue('language', null, $forcedLanguage); $this->form->setFieldAttribute('language', 'readonly', 'true'); - $this->form->setFieldAttribute('catid', 'readonly', 'true'); + + // Only allow to select categories with All language or with the forced language. + $this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage); + + // Only allow to select tags with All language or with the forced language. + $this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage); } $this->addToolbar(); @@ -115,7 +123,7 @@ protected function addToolbar() } else { - if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) + if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) { JToolbarHelper::versions('com_newsfeeds.newsfeed', $this->item->id); } diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php index 959d6ba920c5e..301af16ffb89f 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default.php @@ -16,9 +16,7 @@ JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); -$app = JFactory::getApplication(); $user = JFactory::getUser(); -$userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $canOrder = $user->authorise('core.edit.state', 'com_newsfeeds.category'); @@ -97,6 +95,7 @@ $canCreate = $user->authorise('core.create', 'com_newsfeeds.category.' . $item->catid); $canEdit = $user->authorise('core.edit', 'com_newsfeeds.category.' . $item->catid); $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || $item->checked_out == 0; + $canEditOwn = $user->authorise('core.edit.own', 'com_newsfeeds.category.' . $item->catid) && $item->created_by == $user->id; $canChange = $user->authorise('core.edit.state', 'com_newsfeeds.category.' . $item->catid) && $canCheckin; ?>
    - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch.php deleted file mode 100644 index ba9a12a7ef085..0000000000000 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch.php +++ /dev/null @@ -1,58 +0,0 @@ -state->get('filter.published'); -?> - diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php index 2d01f8dee3ea3..1edf0e9827274 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php index 139db4d59c164..65e19402e2689 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_ROOT . '/components/com_newsfeeds/helpers/route.php'; +JLoader::register('NewsfeedsHelperRoute', JPATH_ROOT . '/components/com_newsfeeds/helpers/route.php'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -110,11 +110,7 @@ escape($item->access_level); ?> - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php b/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php index 8cf3e3bbe101d..b0ae720d2b11c 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/view.html.php @@ -119,7 +119,7 @@ protected function addToolbar() JToolbarHelper::addNew('newsfeed.add'); } - if ($canDo->get('core.edit')) + if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolbarHelper::editList('newsfeed.edit'); } diff --git a/administrator/components/com_plugins/controller.php b/administrator/components/com_plugins/controller.php index 725b064e86c7c..55966d9696072 100644 --- a/administrator/components/com_plugins/controller.php +++ b/administrator/components/com_plugins/controller.php @@ -28,7 +28,7 @@ class PluginsController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/plugins.php'; + JLoader::register('PluginsHelper', JPATH_ADMINISTRATOR . '/components/com_plugins/helpers/plugins.php'); // Load the submenu. PluginsHelper::addSubmenu($this->input->get('view', 'plugins')); diff --git a/administrator/components/com_plugins/controllers/plugins.php b/administrator/components/com_plugins/controllers/plugins.php index 4615766b2c75d..a10bc9be3493a 100644 --- a/administrator/components/com_plugins/controllers/plugins.php +++ b/administrator/components/com_plugins/controllers/plugins.php @@ -29,8 +29,6 @@ class PluginsControllerPlugins extends JControllerAdmin */ public function getModel($name = 'Plugin', $prefix = 'PluginsModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } } diff --git a/administrator/components/com_plugins/models/fields/plugintype.php b/administrator/components/com_plugins/models/fields/plugintype.php index abfc25a69ab69..ec4cadf358080 100644 --- a/administrator/components/com_plugins/models/fields/plugintype.php +++ b/administrator/components/com_plugins/models/fields/plugintype.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/plugins.php'; +JLoader::register('PluginsHelper', JPATH_ADMINISTRATOR . '/components/com_plugins/helpers/plugins.php'); /** * Plugin Type Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldPluginType extends JFormFieldList +class JFormFieldPluginType extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_plugins/models/plugin.php b/administrator/components/com_plugins/models/plugin.php index 8acc1e79d34f8..906df1a340435 100644 --- a/administrator/components/com_plugins/models/plugin.php +++ b/administrator/components/com_plugins/models/plugin.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; /** * Plugin model. @@ -62,7 +63,7 @@ public function __construct($config = array()) * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * - * @return JForm A JForm object on success, false on failure. + * @return JForm A JForm object on success, false on failure. * * @since 1.6 */ @@ -77,8 +78,8 @@ public function getForm($data = array(), $loadData = true) } else { - $folder = JArrayHelper::getValue($data, 'folder', '', 'cmd'); - $element = JArrayHelper::getValue($data, 'element', '', 'cmd'); + $folder = ArrayHelper::getValue($data, 'folder', '', 'cmd'); + $element = ArrayHelper::getValue($data, 'element', '', 'cmd'); } // Add the default fields directory @@ -163,11 +164,10 @@ public function getItem($pk = null) // Convert to the JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = JArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($table->params); + $registry = new Registry($table->params); $this->_cache[$pk]->params = $registry->toArray(); // Get the plugin XML. diff --git a/administrator/components/com_plugins/models/plugins.php b/administrator/components/com_plugins/models/plugins.php index 421bf26d982b0..f8564b9396aa3 100644 --- a/administrator/components/com_plugins/models/plugins.php +++ b/administrator/components/com_plugins/models/plugins.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Methods supporting a list of plugin records. * @@ -58,7 +60,7 @@ public function __construct($config = array()) * * @since 1.6 */ - protected function populateState($ordering = null, $direction = null) + protected function populateState($ordering = 'folder', $direction = 'asc') { // Load the filter state. $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'); @@ -81,7 +83,7 @@ protected function populateState($ordering = null, $direction = null) $this->setState('params', $params); // List state information. - parent::populateState('folder', 'asc'); + parent::populateState($ordering, $direction); } /** @@ -146,8 +148,9 @@ protected function _getList($query, $limitstart = 0, $limit = 0) } } - $direction = ($this->getState('list.direction') == 'desc') ? -1 : 1; - JArrayHelper::sortObjects($result, $ordering, $direction, true, true); + $orderingDirection = strtolower($this->getState('list.direction')); + $direction = ($orderingDirection == 'desc') ? -1 : 1; + $result = ArrayHelper::sortObjects($result, $ordering, $direction, true, true); $total = count($result); $this->cache[$this->getStoreId('getTotal')] = $total; diff --git a/administrator/components/com_plugins/plugins.php b/administrator/components/com_plugins/plugins.php index c156f89929700..5c77e033cdc04 100644 --- a/administrator/components/com_plugins/plugins.php +++ b/administrator/components/com_plugins/plugins.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_plugins')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Plugins'); diff --git a/administrator/components/com_plugins/views/plugin/tmpl/edit.php b/administrator/components/com_plugins/views/plugin/tmpl/edit.php index 91e612b5fc18b..c024d28dc3aa1 100644 --- a/administrator/components/com_plugins/views/plugin/tmpl/edit.php +++ b/administrator/components/com_plugins/views/plugin/tmpl/edit.php @@ -12,7 +12,9 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.formvalidator'); +JHtml::_('behavior.keepalive'); JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('bootstrap.tooltip'); $this->fieldsets = $this->form->getFieldsets('params'); JFactory::getDocument()->addScriptDeclaration(" @@ -75,7 +77,7 @@

    - +

    diff --git a/administrator/components/com_plugins/views/plugin/tmpl/edit_options.php b/administrator/components/com_plugins/views/plugin/tmpl/edit_options.php index 9b51e06571682..5606f5475d074 100644 --- a/administrator/components/com_plugins/views/plugin/tmpl/edit_options.php +++ b/administrator/components/com_plugins/views/plugin/tmpl/edit_options.php @@ -13,7 +13,7 @@ { if (!isset($fieldset->repeat) || isset($fieldset->repeat) && $fieldset->repeat == false) { - $label = !empty($fieldset->label) ? JText::_($fieldset->label, true) : JText::_('COM_PLUGINS_' . $fieldset->name . '_FIELDSET_LABEL', true); + $label = !empty($fieldset->label) ? JText::_($fieldset->label) : JText::_('COM_PLUGINS_' . $fieldset->name . '_FIELDSET_LABEL', true); $optionsname = 'options-' . $fieldset->name; echo JHtml::_('bootstrap.addTab', 'myTab', $optionsname, $label); diff --git a/administrator/components/com_plugins/views/plugins/tmpl/default.php b/administrator/components/com_plugins/views/plugins/tmpl/default.php index ae3c4418c9779..05d77ccbac543 100644 --- a/administrator/components/com_plugins/views/plugins/tmpl/default.php +++ b/administrator/components/com_plugins/views/plugins/tmpl/default.php @@ -118,7 +118,7 @@ editor, $item->checked_out_time, 'plugins.', $canCheckin); ?> - + name; ?> name; ?> diff --git a/administrator/components/com_postinstall/models/messages.php b/administrator/components/com_postinstall/models/messages.php index 1f5ec09d6d9b2..dd8e0e5c0fc28 100644 --- a/administrator/components/com_postinstall/models/messages.php +++ b/administrator/components/com_postinstall/models/messages.php @@ -82,7 +82,7 @@ public function getExtensionName($eid) $lang->load($extension->element, $basePath); // Return the localised name - return JText::_($extension->name); + return JText::_(strtoupper($extension->name)); } /** @@ -174,7 +174,7 @@ protected function onProcessList(&$resultArray) } /** - * Get the drop-down options for the list of component with post-installation messages + * Get the dropdown options for the list of component with post-installation messages * * @since 3.4 * @@ -193,16 +193,11 @@ public function getComponentOptions() $options = array(); + JFactory::getLanguage()->load('files_joomla.sys', JPATH_SITE, null, false, false); + foreach ($extension_ids as $eid) { - $extension_name = $this->getExtensionName($eid); - - if ($extension_name == 'files_joomla') - { - $extension_name = JText::_('COM_POSTINSTALL_TITLE_JOOMLA'); - } - - $options[] = JHtml::_('select.option', $eid, $extension_name); + $options[] = JHtml::_('select.option', $eid, $this->getExtensionName($eid)); } return $options; @@ -230,13 +225,13 @@ public function getComponentOptions() * description_key The JText language key for the main body (description) of this PIM * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_DESCRIPTION * - * action_key The JText language key for the action button. Ignored and not required when type=message - * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_ACTION + * action_key The JText language key for the action button. Ignored and not required when type=message + * Example: COM_FOOBAR_POSTINSTALL_MESSAGEONE_ACTION * * language_extension The extension name which holds the language keys used above. * For example, com_foobar, mod_something, plg_system_whatever, tpl_mytemplate * - * language_client_id Should we load the front-end (0) or back-end (1) language keys? + * language_client_id Should we load the frontend (0) or backend (1) language keys? * * version_introduced Which was the version of your extension where this message appeared for the first time? * Example: 3.2.1 diff --git a/administrator/components/com_postinstall/postinstall.php b/administrator/components/com_postinstall/postinstall.php index 38bd2f398f22b..1745aa617b165 100644 --- a/administrator/components/com_postinstall/postinstall.php +++ b/administrator/components/com_postinstall/postinstall.php @@ -9,11 +9,5 @@ defined('_JEXEC') or die; -// Load the RAD layer. -if (!defined('FOF_INCLUDED')) -{ - require_once JPATH_LIBRARIES . '/fof/include.php'; -} - // Dispatch the component. FOFDispatcher::getTmpInstance('com_postinstall')->dispatch(); diff --git a/administrator/components/com_postinstall/views/messages/view.html.php b/administrator/components/com_postinstall/views/messages/view.html.php index 726482bc1b178..e004cf1917459 100644 --- a/administrator/components/com_postinstall/views/messages/view.html.php +++ b/administrator/components/com_postinstall/views/messages/view.html.php @@ -40,14 +40,7 @@ protected function onBrowse($tpl = null) $this->token = JFactory::getSession()->getFormToken(); $this->extension_options = $model->getComponentOptions(); - $extension_name = JText::_('COM_POSTINSTALL_TITLE_JOOMLA'); - - if ($this->eid != 700) - { - $extension_name = $model->getExtensionName($this->eid); - } - - JToolBarHelper::title(JText::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $extension_name)); + JToolBarHelper::title(JText::sprintf('COM_POSTINSTALL_MESSAGES_TITLE', $model->getExtensionName($this->eid))); return parent::onBrowse($tpl); } diff --git a/administrator/components/com_redirect/controller.php b/administrator/components/com_redirect/controller.php index edba4e74f4c25..4cef71f97c069 100644 --- a/administrator/components/com_redirect/controller.php +++ b/administrator/components/com_redirect/controller.php @@ -34,7 +34,7 @@ class RedirectController extends JControllerLegacy */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/redirect.php'; + JLoader::register('RedirectHelper', JPATH_ADMINISTRATOR . '/components/com_redirect/helpers/redirect.php'); // Load the submenu. RedirectHelper::addSubmenu($this->input->get('view', 'links')); diff --git a/administrator/components/com_redirect/controllers/links.php b/administrator/components/com_redirect/controllers/links.php index 823d8daed4deb..0cd78816e755c 100644 --- a/administrator/components/com_redirect/controllers/links.php +++ b/administrator/components/com_redirect/controllers/links.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Redirect link list controller class. * @@ -41,7 +43,7 @@ public function activate() // Get the model. $model = $this->getModel(); - JArrayHelper::toInteger($ids); + $ids = ArrayHelper::toInteger($ids); // Remove the items. if (!$model->activate($ids, $newUrl, $comment)) @@ -82,7 +84,7 @@ public function duplicateUrls() // Get the model. $model = $this->getModel(); - JArrayHelper::toInteger($ids); + $ids = ArrayHelper::toInteger($ids); // Remove the items. if (!$model->duplicateUrls($ids, $newUrl, $comment)) @@ -111,9 +113,7 @@ public function duplicateUrls() */ public function getModel($name = 'Link', $prefix = 'RedirectModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** diff --git a/administrator/components/com_redirect/helpers/html/redirect.php b/administrator/components/com_redirect/helpers/html/redirect.php index 9c8cd27372c58..f50376671e35d 100644 --- a/administrator/components/com_redirect/helpers/html/redirect.php +++ b/administrator/components/com_redirect/helpers/html/redirect.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Utility class for creating HTML Grids. * @@ -45,7 +47,7 @@ public static function published($value = 0, $i = null, $canChange = true) -2 => array('trash', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'), ); - $state = JArrayHelper::getValue($states, (int) $value, $states[0]); + $state = ArrayHelper::getValue($states, (int) $value, $states[0]); $icon = $state[0]; if ($canChange) diff --git a/administrator/components/com_redirect/helpers/redirect.php b/administrator/components/com_redirect/helpers/redirect.php index 6e7297bb2b5c4..624f14aa36433 100644 --- a/administrator/components/com_redirect/helpers/redirect.php +++ b/administrator/components/com_redirect/helpers/redirect.php @@ -84,7 +84,7 @@ public static function isEnabled() $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('enabled')) - ->from('#__extensions') + ->from($db->quoteName('#__extensions')) ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) ->where($db->quoteName('element') . ' = ' . $db->quote('redirect')); $db->setQuery($query); @@ -101,6 +101,35 @@ public static function isEnabled() return $result; } + /** + * Gets the redirect system plugin extension id. + * + * @return int The redirect system plugin extension id. + * + * @since 3.6.0 + */ + public static function getRedirectPluginId() + { + $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('redirect')); + $db->setQuery($query); + + try + { + $result = (int) $db->loadResult(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + } + + return $result; + } + /** * Checks whether the option "Collect URLs" is enabled for the output message * diff --git a/administrator/components/com_redirect/models/fields/redirect.php b/administrator/components/com_redirect/models/fields/redirect.php index 2752d4d7f690f..54dcf55378b1b 100644 --- a/administrator/components/com_redirect/models/fields/redirect.php +++ b/administrator/components/com_redirect/models/fields/redirect.php @@ -9,16 +9,14 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** - * A drop down containing all valid HTTP 1.1 response codes. + * A dropdown containing all valid HTTP 1.1 response codes. * * @package Joomla.Administrator * @subpackage com_redirect * @since 3.4 */ -class JFormFieldRedirect extends JFormFieldList +class JFormFieldRedirect extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_redirect/models/link.php b/administrator/components/com_redirect/models/link.php index d27c1412189ea..3bc6b52131d36 100644 --- a/administrator/components/com_redirect/models/link.php +++ b/administrator/components/com_redirect/models/link.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Redirect link model. * @@ -158,7 +160,7 @@ public function activate(&$pks, $url, $comment = null) // Sanitize the ids. $pks = (array) $pks; - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Populate default comment if necessary. $comment = (!empty($comment)) ? $comment : JText::sprintf('COM_REDIRECT_REDIRECTED_ON', JHtml::_('date', time())); @@ -199,7 +201,7 @@ public function activate(&$pks, $url, $comment = null) } /** - * Method to duplicate URL links. + * Method to batch update URLs to have new redirect urls and comments. Note will publish any unpublished URLs. * * @param array &$pks An array of link ids. * @param string $url The new URL to set for the redirect. @@ -216,7 +218,7 @@ public function duplicateUrls(&$pks, $url, $comment = null) // Sanitize the ids. $pks = (array) $pks; - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Access checks. if (!$user->authorise('core.edit', 'com_redirect')) @@ -236,6 +238,7 @@ public function duplicateUrls(&$pks, $url, $comment = null) ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('new_url') . ' = ' . $db->quote($url)) ->set($db->quoteName('modified_date') . ' = ' . $db->quote($date)) + ->set($db->quoteName('published') . ' = ' . 1) ->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')'); if (!empty($comment)) diff --git a/administrator/components/com_redirect/redirect.php b/administrator/components/com_redirect/redirect.php index e2088de15b80e..ebe62f846009c 100644 --- a/administrator/components/com_redirect/redirect.php +++ b/administrator/components/com_redirect/redirect.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_redirect')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Redirect'); diff --git a/administrator/components/com_redirect/views/links/tmpl/default.php b/administrator/components/com_redirect/views/links/tmpl/default.php index 1e94b7ae46822..90db97b13a1bc 100755 --- a/administrator/components/com_redirect/views/links/tmpl/default.php +++ b/administrator/components/com_redirect/views/links/tmpl/default.php @@ -23,7 +23,6 @@
    $this)); ?> -
    items)) : ?>
    diff --git a/administrator/components/com_redirect/views/links/tmpl/default_batch.php b/administrator/components/com_redirect/views/links/tmpl/default_batch.php deleted file mode 100644 index e2812e5bd42c3..0000000000000 --- a/administrator/components/com_redirect/views/links/tmpl/default_batch.php +++ /dev/null @@ -1,37 +0,0 @@ - - diff --git a/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php b/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php index 8d2c6deef7d71..c7446dbc0a74c 100644 --- a/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php +++ b/administrator/components/com_redirect/views/links/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file + diff --git a/administrator/components/com_redirect/views/links/view.html.php b/administrator/components/com_redirect/views/links/view.html.php index ca6d8f30af6f8..a815511fe6b72 100644 --- a/administrator/components/com_redirect/views/links/view.html.php +++ b/administrator/components/com_redirect/views/links/view.html.php @@ -37,6 +37,8 @@ class RedirectViewLinks extends JViewLegacy */ public function display($tpl = null) { + // Set variables + $app = JFactory::getApplication(); $this->enabled = RedirectHelper::isEnabled(); $this->collect_urls_enabled = RedirectHelper::collectUrlsEnabled(); $this->items = $this->get('Items'); @@ -53,20 +55,20 @@ public function display($tpl = null) return false; } - if ($this->enabled) + // Show messages about the enabled plugin and if the plugin should collect URLs + if ($this->enabled && $this->collect_urls_enabled) { - if ($this->collect_urls_enabled) - { - JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice'); - } - else - { - JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_COLLECT_URLS_DISABLED'), 'warning'); - } + $app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . ' ' . JText::_('COM_REDIRECT_COLLECT_URLS_ENABLED'), 'notice'); + } + elseif ($this->enabled && !$this->collect_urls_enabled) + { + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); + $app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice'); } else { - JFactory::getApplication()->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_DISABLED'), 'error'); + $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); + $app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error'); } $this->addToolbar(); diff --git a/administrator/components/com_search/controller.php b/administrator/components/com_search/controller.php index 4b94a2f3b3379..5aa407396e0f9 100644 --- a/administrator/components/com_search/controller.php +++ b/administrator/components/com_search/controller.php @@ -28,17 +28,17 @@ class SearchController extends JControllerLegacy * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * - * @return JController This object to support chaining. + * @return SearchController This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { - require_once JPATH_COMPONENT . '/helpers/search.php'; + JLoader::register('SearchHelper', JPATH_ADMINISTRATOR . '/components/com_search/helpers/search.php'); // Load the submenu. SearchHelper::addSubmenu($this->input->get('view', 'searches')); - parent::display(); + return parent::display(); } } diff --git a/administrator/components/com_search/helpers/search.php b/administrator/components/com_search/helpers/search.php index b1cf69ecee58c..1769e1f3bb391 100644 --- a/administrator/components/com_search/helpers/search.php +++ b/administrator/components/com_search/helpers/search.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + /** * Search component helper. * @@ -73,10 +75,10 @@ public static function santiseSearchWord(&$searchword, $searchphrase) } // Check for words to ignore. - $aterms = explode(' ', JString::strtolower($searchword)); + $aterms = explode(' ', StringHelper::strtolower($searchword)); // First case is single ignored word. - if (count($aterms) == 1 && in_array(JString::strtolower($searchword), $search_ignore)) + if (count($aterms) == 1 && in_array(StringHelper::strtolower($searchword), $search_ignore)) { $ignored = true; } @@ -86,7 +88,7 @@ public static function santiseSearchWord(&$searchword, $searchphrase) foreach ($aterms as $aterm) { - if (JString::strlen($aterm) < $lower_limit) + if (StringHelper::strlen($aterm) < $lower_limit) { $search_ignore[] = $aterm; } @@ -120,14 +122,14 @@ public static function limitSearchWord(&$searchword) // Limit searchword to a maximum of characters. $upper_limit = $lang->getUpperLimitSearchWord(); - if (JString::strlen($searchword) > $upper_limit) + if (StringHelper::strlen($searchword) > $upper_limit) { - $searchword = JString::substr($searchword, 0, $upper_limit - 1); + $searchword = StringHelper::substr($searchword, 0, $upper_limit - 1); $restriction = true; } // Searchword must contain a minimum of characters. - if ($searchword && JString::strlen($searchword) < $lang->getLowerLimitSearchWord()) + if ($searchword && StringHelper::strlen($searchword) < $lang->getLowerLimitSearchWord()) { $searchword = ''; $restriction = true; @@ -219,7 +221,7 @@ public static function checkNoHtml($object, $searchTerm, $fields) { $term = self::remove_accents($term); - if (JString::stristr($text, $term) !== false) + if (StringHelper::stristr($text, $term) !== false) { return true; } @@ -261,14 +263,14 @@ public static function _smartSubstr($text, $searchword) $lang = JFactory::getLanguage(); $length = $lang->getSearchDisplayedCharactersNumber(); $ltext = self::remove_accents($text); - $textlen = JString::strlen($ltext); - $lsearchword = JString::strtolower(self::remove_accents($searchword)); + $textlen = StringHelper::strlen($ltext); + $lsearchword = StringHelper::strtolower(self::remove_accents($searchword)); $wordfound = false; $pos = 0; while ($wordfound === false && $pos < $textlen) { - if (($wordpos = @JString::strpos($ltext, ' ', $pos + $length)) !== false) + if (($wordpos = @StringHelper::strpos($ltext, ' ', $pos + $length)) !== false) { $chunk_size = $wordpos - $pos; } @@ -277,8 +279,8 @@ public static function _smartSubstr($text, $searchword) $chunk_size = $length; } - $chunk = JString::substr($ltext, $pos, $chunk_size); - $wordfound = JString::strpos(JString::strtolower($chunk), $lsearchword); + $chunk = StringHelper::substr($ltext, $pos, $chunk_size); + $wordfound = StringHelper::strpos(StringHelper::strtolower($chunk), $lsearchword); if ($wordfound === false) { @@ -288,17 +290,17 @@ public static function _smartSubstr($text, $searchword) if ($wordfound !== false) { - return (($pos > 0) ? '... ' : '') . JString::substr($text, $pos, $chunk_size) . ' ...'; + return (($pos > 0) ? '... ' : '') . StringHelper::substr($text, $pos, $chunk_size) . ' ...'; } else { - if (($wordpos = @JString::strpos($text, ' ', $length)) !== false) + if (($wordpos = @StringHelper::strpos($text, ' ', $length)) !== false) { - return JString::substr($text, 0, $wordpos) . ' ...'; + return StringHelper::substr($text, 0, $wordpos) . ' ...'; } else { - return JString::substr($text, 0, $length); + return StringHelper::substr($text, 0, $length); } } } diff --git a/administrator/components/com_search/models/searches.php b/administrator/components/com_search/models/searches.php index 6484490d44307..43b0de054e15a 100644 --- a/administrator/components/com_search/models/searches.php +++ b/administrator/components/com_search/models/searches.php @@ -143,7 +143,7 @@ public function getItems() if (!class_exists('JSite')) { // This fools the routers in the search plugins into thinking it's in the frontend - JLoader::register('JSite', JPATH_COMPONENT . '/helpers/site.php'); + JLoader::register('JSite', JPATH_ADMINISTRATOR . '/components/com_search/helpers/site.php'); } foreach ($items as &$item) diff --git a/administrator/components/com_search/search.php b/administrator/components/com_search/search.php index feaecdde7b1bb..98b57a9c128c4 100644 --- a/administrator/components/com_search/search.php +++ b/administrator/components/com_search/search.php @@ -11,7 +11,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_search')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } $controller = JControllerLegacy::getInstance('Search'); diff --git a/administrator/components/com_search/views/searches/tmpl/default.php b/administrator/components/com_search/views/searches/tmpl/default.php index eb9ad83aff8dd..d2e2a811d8a2d 100644 --- a/administrator/components/com_search/views/searches/tmpl/default.php +++ b/administrator/components/com_search/views/searches/tmpl/default.php @@ -68,15 +68,14 @@ state->get('show_results')) : ?>
    - " href="index.php?option=com_search&view=search&searchword=search_term); ?>"> - returns; ?> + " target="_blank" href="index.php?option=com_search&view=search&searchword=search_term); ?>"> + returns; ?>
    + + + + + + + + + " title="" href="id . '&filter[published]=1');?>"> + count_published; ?> + + " title="" href="id . '&filter[published]=0');?>"> + count_unpublished; ?> + + " title="" href="id . '&filter[published]=2');?>"> + count_archived; ?> + + " title="" href="id . '&filter[published]=-2');?>"> + count_trashed; ?> + escape($item->access_title); ?> - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - - - - id; ?> -
    + + id; ?> +
    diff --git a/administrator/components/com_tags/views/tags/tmpl/default_batch.php b/administrator/components/com_tags/views/tags/tmpl/default_batch.php deleted file mode 100644 index 85dd17fa1168b..0000000000000 --- a/administrator/components/com_tags/views/tags/tmpl/default_batch.php +++ /dev/null @@ -1,44 +0,0 @@ -state->get('filter.published'); -?> - diff --git a/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php b/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php index 37e2be26b8c1f..64a27ee2a4314 100644 --- a/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php +++ b/administrator/components/com_tags/views/tags/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_templates/config.xml b/administrator/components/com_templates/config.xml index 9e4fd325a9254..c8da44ed46351 100644 --- a/administrator/components/com_templates/config.xml +++ b/administrator/components/com_templates/config.xml @@ -20,7 +20,7 @@ name="upload_limit" type="text" label="COM_TEMPLATES_CONFIG_UPLOAD_LABEL" description="COM_TEMPLATES_CONFIG_UPLOAD_DESC" - default="2" + default="10" extension="com_templates" /> diff --git a/administrator/components/com_templates/controllers/styles.php b/administrator/components/com_templates/controllers/styles.php index 073ab86986364..819cfe35f3522 100644 --- a/administrator/components/com_templates/controllers/styles.php +++ b/administrator/components/com_templates/controllers/styles.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Template styles list controller class. * @@ -35,7 +37,7 @@ public function duplicate() throw new Exception(JText::_('COM_TEMPLATES_NO_TEMPLATE_SELECTED')); } - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); $model = $this->getModel(); $model->duplicate($pks); @@ -62,9 +64,7 @@ public function duplicate() */ public function getModel($name = 'Style', $prefix = 'TemplatesModel', $config = array()) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, array('ignore_request' => true)); } /** @@ -88,7 +88,7 @@ public function setDefault() throw new Exception(JText::_('COM_TEMPLATES_NO_TEMPLATE_SELECTED')); } - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Pop off the first element. $id = array_shift($pks); @@ -117,7 +117,7 @@ public function unsetDefault() JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); $pks = $this->input->get->get('cid', array(), 'array'); - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); try { diff --git a/administrator/components/com_templates/controllers/template.php b/administrator/components/com_templates/controllers/template.php index 5f0f5a7f2a0be..52a42d5b5c903 100644 --- a/administrator/components/com_templates/controllers/template.php +++ b/administrator/components/com_templates/controllers/template.php @@ -167,9 +167,7 @@ public function copy() */ public function getModel($name = 'Template', $prefix = 'TemplatesModel', $config = array()) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** @@ -218,7 +216,7 @@ public function save() // Access check. if (!$this->allowSave()) { - $app->enqueueMessage(JText::_('JERROR_SAVE_NOT_PERMITTED'), 'error'); + $app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error'); return false; } diff --git a/administrator/components/com_templates/models/fields/templatelocation.php b/administrator/components/com_templates/models/fields/templatelocation.php index 0c8c67774e25f..74fd97ddfddbd 100644 --- a/administrator/components/com_templates/models/fields/templatelocation.php +++ b/administrator/components/com_templates/models/fields/templatelocation.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/templates.php'; +JLoader::register('TemplatesHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php'); /** * Template Style Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldTemplateLocation extends JFormFieldList +class JFormFieldTemplateLocation extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_templates/models/fields/templatename.php b/administrator/components/com_templates/models/fields/templatename.php index 00e7522445551..df238437ff893 100644 --- a/administrator/components/com_templates/models/fields/templatename.php +++ b/administrator/components/com_templates/models/fields/templatename.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -JFormHelper::loadFieldClass('list'); - -require_once __DIR__ . '/../../helpers/templates.php'; +JLoader::register('TemplatesHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php'); /** * Template Style Field class for the Joomla Framework. * * @since 3.5 */ -class JFormFieldTemplateName extends JFormFieldList +class JFormFieldTemplateName extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_templates/models/style.php b/administrator/components/com_templates/models/style.php index 422f15661d0f5..dbc2398a16c7f 100644 --- a/administrator/components/com_templates/models/style.php +++ b/administrator/components/com_templates/models/style.php @@ -10,6 +10,8 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; /** * Template style model. @@ -237,7 +239,7 @@ protected function generateNewTitle($category_id, $alias, $title) while ($table->load(array('title' => $title))) { - $title = JString::increment($title); + $title = StringHelper::increment($title); } return $title; @@ -264,8 +266,8 @@ public function getForm($data = array(), $loadData = true) } else { - $clientId = JArrayHelper::getValue($data, 'client_id'); - $template = JArrayHelper::getValue($data, 'template'); + $clientId = ArrayHelper::getValue($data, 'client_id'); + $template = ArrayHelper::getValue($data, 'template'); } // Add the default fields directory @@ -349,11 +351,10 @@ public function getItem($pk = null) // Convert to the JObject before adding other data. $properties = $table->getProperties(1); - $this->_cache[$pk] = JArrayHelper::toObject($properties, 'JObject'); + $this->_cache[$pk] = ArrayHelper::toObject($properties, 'JObject'); // Convert the params field to an array. - $registry = new Registry; - $registry->loadString($table->params); + $registry = new Registry($table->params); $this->_cache[$pk]->params = $registry->toArray(); // Get the template XML. @@ -540,7 +541,7 @@ public function save($data) if (!empty($data['assigned']) && is_array($data['assigned'])) { - JArrayHelper::toInteger($data['assigned']); + $data['assigned'] = ArrayHelper::toInteger($data['assigned']); // Update the mapping for menu items that this style IS assigned to. $query = $db->getQuery(true) diff --git a/administrator/components/com_templates/models/styles.php b/administrator/components/com_templates/models/styles.php index 9d984ebf8e8d3..f37e7b9ef5a83 100644 --- a/administrator/components/com_templates/models/styles.php +++ b/administrator/components/com_templates/models/styles.php @@ -111,7 +111,7 @@ protected function getListQuery() $query->select( $this->getState( 'list.select', - 'a.id, a.template, a.title, a.home, a.client_id, l.title AS language_title, l.image as image' + 'a.id, a.template, a.title, a.home, a.client_id, l.title AS language_title, l.image as image, l.sef AS language_sef' ) ); $query->from($db->quoteName('#__template_styles', 'a')) diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php index 582d4f478f58d..94650451fb30c 100644 --- a/administrator/components/com_templates/models/template.php +++ b/administrator/components/com_templates/models/template.php @@ -496,7 +496,7 @@ public function save($data) if (!is_writable($filePath)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_FILE_NOT_WRITABLE'), 'warning'); - $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_PERMISSIONS' . JPath::getPermissions($filePath)), 'warning'); + $app->enqueueMessage(JText::sprintf('COM_TEMPLATES_FILE_PERMISSIONS', JPath::getPermissions($filePath)), 'warning'); if (!JPath::isOwner($filePath)) { @@ -706,7 +706,7 @@ public function createTemplateOverride($overridePath, $htmlPath) { $return = false; - if (empty($htmlPath) || empty($htmlPath)) + if (empty($overridePath) || empty($htmlPath)) { return $return; } @@ -888,7 +888,7 @@ public function uploadFile($file, $location) $fileName = JFile::makeSafe($file['name']); $err = null; - JLoader::register('TemplateHelper', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/template.php'); + JLoader::register('TemplateHelper', JPATH_ADMINISTRATOR . '/components/com_templates/helpers/template.php'); if (!TemplateHelper::canUpload($file, $err)) { diff --git a/administrator/components/com_templates/tables/style.php b/administrator/components/com_templates/tables/style.php index 9783c8a931ab7..af34bcd7b3ab9 100644 --- a/administrator/components/com_templates/tables/style.php +++ b/administrator/components/com_templates/tables/style.php @@ -44,8 +44,7 @@ public function bind($array, $ignore = '') { if (isset($array['params']) && is_array($array['params'])) { - $registry = new Registry; - $registry->loadArray($array['params']); + $registry = new Registry($array['params']); $array['params'] = (string) $registry; } diff --git a/administrator/components/com_templates/templates.php b/administrator/components/com_templates/templates.php index cac1b8ff0a5b4..24fcef4e62a45 100644 --- a/administrator/components/com_templates/templates.php +++ b/administrator/components/com_templates/templates.php @@ -10,14 +10,9 @@ defined('_JEXEC') or die; JHtml::_('behavior.tabstate'); -$app = JFactory::getApplication(); -$user = JFactory::getUser(); - -if (!$user->authorise('core.manage', 'com_templates')) +if (!JFactory::getUser()->authorise('core.manage', 'com_templates')) { - $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); - - return false; + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } JLoader::register('TemplatesHelper', __DIR__ . '/helpers/templates.php'); diff --git a/administrator/components/com_templates/views/style/tmpl/edit.php b/administrator/components/com_templates/views/style/tmpl/edit.php index d7a965e266ec2..f09d53d3d98da 100644 --- a/administrator/components/com_templates/views/style/tmpl/edit.php +++ b/administrator/components/com_templates/views/style/tmpl/edit.php @@ -53,7 +53,7 @@ ?>

    - +

    diff --git a/administrator/components/com_templates/views/style/tmpl/edit_assignment.php b/administrator/components/com_templates/views/style/tmpl/edit_assignment.php index 6fb4ee775f974..8e33453613b8e 100644 --- a/administrator/components/com_templates/views/style/tmpl/edit_assignment.php +++ b/administrator/components/com_templates/views/style/tmpl/edit_assignment.php @@ -10,9 +10,9 @@ defined('_JEXEC') or die; // Initiasile related data. -require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'; +JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); $menuTypes = MenusHelper::getMenuLinks(); -$user = JFactory::getUser(); +$user = JFactory::getUser(); ?>
    @@ -26,19 +26,21 @@
  • - -
    title ? $type->title : $type->menutype; ?>
    + +
    title ? $type->title : $type->menutype; ?>
    + + links as $link) : ?> + + - links as $link) : ?> - -
  • +
    diff --git a/administrator/components/com_templates/views/styles/tmpl/default.php b/administrator/components/com_templates/views/styles/tmpl/default.php index 6872368f4ccc8..e2d4751c395ea 100644 --- a/administrator/components/com_templates/views/styles/tmpl/default.php +++ b/administrator/components/com_templates/views/styles/tmpl/default.php @@ -82,7 +82,7 @@ preview && $item->client_id == '0') : ?> - + client_id == '1') : ?> @@ -101,10 +101,18 @@ home != '0', $i, 'styles.', $canChange && $item->home != '1');?> - image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> + image) : ?> + image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_TEMPLATES_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> + + language_sef; ?> + - image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> + image) : ?> + image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> + + language_sef; ?> + diff --git a/administrator/components/com_templates/views/template/tmpl/default.php b/administrator/components/com_templates/views/template/tmpl/default.php index 4e7d98c7b72a4..a164b3b6ebd1f 100644 --- a/administrator/components/com_templates/views/template/tmpl/default.php +++ b/administrator/components/com_templates/views/template/tmpl/default.php @@ -28,8 +28,8 @@ if ($this->type == 'image') { - JHtml::_('script', 'system/jquery.Jcrop.min.js', false, true); - JHtml::_('stylesheet', 'system/jquery.Jcrop.min.css', array(), true); + JHtml::_('script', 'system/jquery.Jcrop.min.js', array('version' => 'auto', 'relative' => true)); + JHtml::_('stylesheet', 'system/jquery.Jcrop.min.css', array('version' => 'auto', 'relative' => true)); } JFactory::getDocument()->addScriptDeclaration(" @@ -194,7 +194,7 @@ function clearCoords()

    - +

    diff --git a/administrator/components/com_templates/views/template/tmpl/default_modal_file_body.php b/administrator/components/com_templates/views/template/tmpl/default_modal_file_body.php index cc5de0f5d8e5b..c86e830e0fecd 100644 --- a/administrator/components/com_templates/views/template/tmpl/default_modal_file_body.php +++ b/administrator/components/com_templates/views/template/tmpl/default_modal_file_body.php @@ -40,7 +40,10 @@ - +
    + state->get('params')->get('upload_limit'); ?> + +
    type != 'home'): ?> diff --git a/administrator/components/com_templates/views/template/tmpl/default_modal_rename_body.php b/administrator/components/com_templates/views/template/tmpl/default_modal_rename_body.php index f2991415ddbd8..ea08f943a4253 100644 --- a/administrator/components/com_templates/views/template/tmpl/default_modal_rename_body.php +++ b/administrator/components/com_templates/views/template/tmpl/default_modal_rename_body.php @@ -8,6 +8,7 @@ */ defined('_JEXEC') or die; + ?>
    @@ -17,7 +18,10 @@
    - +
    + + .fileName); ?> +
    diff --git a/administrator/components/com_templates/views/template/view.html.php b/administrator/components/com_templates/views/template/view.html.php index 637723aa0343b..38a02092354cf 100644 --- a/administrator/components/com_templates/views/template/view.html.php +++ b/administrator/components/com_templates/views/template/view.html.php @@ -180,7 +180,7 @@ protected function addToolbar() $explodeArray = explode('.', $this->fileName); $ext = end($explodeArray); - JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'eye thememanager'); + JToolbarHelper::title(JText::sprintf('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE', ucfirst($this->template->name)), 'eye thememanager'); // Only show file edit buttons for global SuperUser if ($isSuperUser) diff --git a/administrator/components/com_templates/views/templates/tmpl/default.php b/administrator/components/com_templates/views/templates/tmpl/default.php index b52fd467a4b4d..eda140525885d 100644 --- a/administrator/components/com_templates/views/templates/tmpl/default.php +++ b/administrator/components/com_templates/views/templates/tmpl/default.php @@ -36,10 +36,10 @@ - - @@ -107,6 +123,7 @@ + diff --git a/administrator/components/com_users/views/users/view.html.php b/administrator/components/com_users/views/users/view.html.php index 24b148a156719..16b598668d098 100644 --- a/administrator/components/com_users/views/users/view.html.php +++ b/administrator/components/com_users/views/users/view.html.php @@ -39,6 +39,38 @@ class UsersViewUsers extends JViewLegacy * @since 1.6 */ protected $state; + + /** + * A JForm instance with filter fields. + * + * @var JForm + * @since 3.6.3 + */ + public $filterForm; + + /** + * An array with active filters. + * + * @var array + * @since 3.6.3 + */ + public $activeFilters; + + /** + * An ACL object to verify user rights. + * + * @var JObject + * @since 3.6.3 + */ + protected $canDo; + + /** + * An instance of JDatabaseDriver. + * + * @var JDatabaseDriver + * @since 3.6.3 + */ + protected $db; /** * Display the view @@ -55,6 +87,7 @@ public function display($tpl = null) $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); $this->canDo = JHelperContent::getActions('com_users'); + $this->db = JFactory::getDbo(); UsersHelper::addSubmenu('users'); diff --git a/administrator/help/helpsites.xml b/administrator/help/helpsites.xml index 70e6964388da0..f47417e61112b 100644 --- a/administrator/help/helpsites.xml +++ b/administrator/help/helpsites.xml @@ -1,7 +1,7 @@ - + - English (GB) - Joomla help wiki - Français (FR) - Aide de Joomla! + English (GB) - Joomla help wiki + Français (FR) - Aide de Joomla! diff --git a/administrator/includes/framework.php b/administrator/includes/framework.php index 6227ccd661f02..29be6ccf7db4e 100644 --- a/administrator/includes/framework.php +++ b/administrator/includes/framework.php @@ -96,5 +96,6 @@ // System profiler if (JDEBUG) { + // @deprecated 4.0 - The $_PROFILER global will be removed $_PROFILER = JProfiler::getInstance('Application'); } diff --git a/administrator/includes/toolbar.php b/administrator/includes/toolbar.php index a90ab4b75c272..9b27e2a4b35da 100644 --- a/administrator/includes/toolbar.php +++ b/administrator/includes/toolbar.php @@ -174,7 +174,7 @@ public static function link($url, $text, $name = 'link') /** * Writes a media_manager button. * - * @param string $directory The sub-directory to upload the media to. + * @param string $directory The subdirectory to upload the media to. * @param string $alt An override for the alt text. * * @return void diff --git a/administrator/index.php b/administrator/index.php index 765bcf2ced3cc..0bf6627140c69 100644 --- a/administrator/index.php +++ b/administrator/index.php @@ -42,7 +42,7 @@ require_once JPATH_BASE . '/includes/toolbar.php'; // Set profiler start time and memory usage and mark afterLoad in the profiler. -JDEBUG ? $_PROFILER->setStart($startTime, $startMem)->mark('afterLoad') : null; +JDEBUG ? JProfiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad') : null; // Instantiate the application. $app = JFactory::getApplication('administrator'); diff --git a/administrator/language/en-GB/en-GB.com_banners.ini b/administrator/language/en-GB/en-GB.com_banners.ini index 39f2baf179de6..470575e84a907 100644 --- a/administrator/language/en-GB/en-GB.com_banners.ini +++ b/administrator/language/en-GB/en-GB.com_banners.ini @@ -121,6 +121,7 @@ COM_BANNERS_FIELD_LANGUAGE_DESC="Assign a language to this banner." COM_BANNERS_FIELD_METAKEYWORDPREFIX_DESC="When matching Meta keywords, only search for Meta keywords with this prefix (improves performance)." COM_BANNERS_FIELD_METAKEYWORDPREFIX_LABEL="Meta Keyword Prefix" COM_BANNERS_FIELD_METAKEYWORDS_DESC="Enter the meta keywords for the banner." +COM_BANNERS_FIELD_MODIFIED_BY_DESC="Name of the user who modified this banner." COM_BANNERS_FIELD_NAME_DESC="Enter a name for the banner." COM_BANNERS_FIELD_NAME_LABEL="Name" COM_BANNERS_FIELD_PUBLISH_DOWN_DESC="An optional date to Finish Publishing the banner." diff --git a/administrator/language/en-GB/en-GB.com_banners.sys.ini b/administrator/language/en-GB/en-GB.com_banners.sys.ini index 6f2af863b976f..9a93c924f2376 100644 --- a/administrator/language/en-GB/en-GB.com_banners.sys.ini +++ b/administrator/language/en-GB/en-GB.com_banners.sys.ini @@ -12,5 +12,6 @@ COM_BANNERS_CONTENT_TYPE_BANNER="Banner" COM_BANNERS_CONTENT_TYPE_CLIENT="Banner Client" COM_BANNERS_CONTENT_TYPE_CATEGORY="Banner Category" COM_BANNERS_CLIENTS="Clients" +COM_BANNERS_TAGS_CATEGORY="Banner Category" COM_BANNERS_TRACKS="Tracks" COM_BANNERS_XML_DESCRIPTION="This component manages banners and banner clients." diff --git a/administrator/language/en-GB/en-GB.com_categories.ini b/administrator/language/en-GB/en-GB.com_categories.ini index 0885078d3e984..b7d66ef649b81 100644 --- a/administrator/language/en-GB/en-GB.com_categories.ini +++ b/administrator/language/en-GB/en-GB.com_categories.ini @@ -9,6 +9,7 @@ COM_CATEGORIES_ACCESS_CREATE_DESC="New setting for create actions%s" -COM_CONFIG_SENDMAIL_JS_ERROR_TIMEOUT="A timeout has occured while fetching the JSON data." COM_CONFIG_SENDMAIL_METHOD_MAIL="PHP Mail" COM_CONFIG_SENDMAIL_METHOD_SENDMAIL="Sendmail" COM_CONFIG_SENDMAIL_METHOD_SMTP="SMTP" COM_CONFIG_SENDMAIL_SUBJECT="Test mail from %s" COM_CONFIG_SENDMAIL_SUCCESS="The email was sent successfully to %s using %s. You should check that you've received the test email." +COM_CONFIG_SENDMAIL_SUCCESS_FALLBACK="The email was sent successfully to %s but using %s as fallback. You should check that you've received the test email." COM_CONFIG_SEO_SETTINGS="SEO Settings" COM_CONFIG_SERVER="Server" COM_CONFIG_SERVER_SETTINGS="Server Settings" @@ -249,6 +252,6 @@ COM_CONFIG_SYSTEM="System" COM_CONFIG_SYSTEM_SETTINGS="System Settings" COM_CONFIG_TEXT_FILTER_SETTINGS="Text Filter Settings" COM_CONFIG_TEXT_FILTERS="Text Filters" -COM_CONFIG_TEXT_FILTERS_DESC="These text filter settings will be applied to all text editor fields submitted by users in the selected groups.
    These filtering options give more control over the HTML your content providers submit. You can be as strict or as liberal as you require to suit your site needs. The filtering is opt-in and the default settings provide good protection against markup commonly associated with website attacks." +COM_CONFIG_TEXT_FILTERS_DESC="These text filter settings will be applied to all text editor fields in the selected groups.
    These filtering options give more control over the HTML your content providers submit. You can be as strict or as liberal as you require to suit your site's needs. The filtering is opt-in and the default settings provide good protection against markup commonly associated with website attacks." COM_CONFIG_XML_DESCRIPTION="Configuration Manager" JLIB_RULES_SETTING_NOTES="If you change the setting, it will apply to this and all child groups, components and content. Note that:
    Inherited means that the permissions from the parent group will be used.
    Denied means that no matter what the parent group's setting is, the group being edited can't take this action.
    Allowed means that the group being edited will be able to take this action (but if this is in conflict with the parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    Not Set is used only for the Public group in global configuration. The Public group is the parent of all other groups. If a permission is not set, it is treated as deny but can be changed for child groups, components, categories and items." diff --git a/administrator/language/en-GB/en-GB.com_contact.ini b/administrator/language/en-GB/en-GB.com_contact.ini index 9ca44bdf4f0bb..e58d9bdb19fd9 100644 --- a/administrator/language/en-GB/en-GB.com_contact.ini +++ b/administrator/language/en-GB/en-GB.com_contact.ini @@ -11,7 +11,8 @@ COM_CONTACT_BATCH_OPTIONS="Batch process the selected contacts" COM_CONTACT_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved contacts. Otherwise, all actions are applied to the selected contacts." COM_CONTACT_CATEGORIES_VIEW_DEFAULT_DESC="Shows a list of contact categories within a category." COM_CONTACT_CATEGORY_VIEW_DEFAULT_DESC="This view lists the contacts in a category." -COM_CONTACT_CHANGE_CONTACT="Change Contact" +COM_CONTACT_CHANGE_CONTACT="Select or Change Contact" +; COM_CONTACT_CHANGE_CONTACT_BUTTON deprecated, use COM_CONTACT_CHANGE_CONTACT instead. COM_CONTACT_CHANGE_CONTACT_BUTTON="Change Contact" COM_CONTACT_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Contact Component will integrate with other extensions." COM_CONTACT_CONFIGURATION="Contacts: Options" @@ -38,11 +39,11 @@ COM_CONTACT_FIELD_CATEGORY_DESC="Select a contact category to display." COM_CONTACT_FIELD_CATEGORY_LABEL="Select a Category" COM_CONTACT_FIELD_CONFIG_ALLOW_VCARD_DESC="Allow vCard to be displayed." COM_CONTACT_FIELD_CONFIG_ALLOW_VCARD_LABEL="Allow vCard" -COM_CONTACT_FIELD_CONFIG_BANNED_EMAIL_DESC="Email addresses not allowed to submit contact form. Separate multiple email addresses with a semi-colon." +COM_CONTACT_FIELD_CONFIG_BANNED_EMAIL_DESC="Email addresses not allowed to submit contact form. Separate multiple email addresses with a semicolon." COM_CONTACT_FIELD_CONFIG_BANNED_EMAIL_LABEL="Banned Email" -COM_CONTACT_FIELD_CONFIG_BANNED_SUBJECT_DESC="Subjects not allowed in contact form. Separate multiple subjects with a semi-colon." +COM_CONTACT_FIELD_CONFIG_BANNED_SUBJECT_DESC="Subjects not allowed in contact form. Separate multiple subjects with a semicolon." COM_CONTACT_FIELD_CONFIG_BANNED_SUBJECT_LABEL="Banned Subject" -COM_CONTACT_FIELD_CONFIG_BANNED_TEXT_DESC="Text not allowed in contact form body. Separate multiple words with a semi-colon." +COM_CONTACT_FIELD_CONFIG_BANNED_TEXT_DESC="Text not allowed in contact form body. Separate multiple words with a semicolon." COM_CONTACT_FIELD_CONFIG_BANNED_TEXT_LABEL="Banned Text" COM_CONTACT_FIELD_CONFIG_CATEGORIES_DESC="These settings apply for Contact Categories Options unless they are changed for a specific menu item." COM_CONTACT_FIELD_CONFIG_CATEGORY_DESC="These settings apply for Contact Category Options unless they are changed for a specific menu item." @@ -56,7 +57,7 @@ COM_CONTACT_FIELD_CONFIG_FAX_DESC="Show or hide a Fax column in the list of Cont COM_CONTACT_FIELD_CONFIG_FAX_LABEL="Fax" COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DESC="These settings apply for single Contact unless they are changed for a specific menu item or Contact." COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DISPLAY="Contact" -COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL="Image" +COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL="Image" COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_DESC="Show or hide an Image column in the list of Contacts." COM_CONTACT_FIELD_CONFIG_MOBILE_DESC="Show or hide show a Mobile column in the list of Contacts." COM_CONTACT_FIELD_CONFIG_MOBILE_LABEL="Mobile" @@ -82,7 +83,7 @@ COM_CONTACT_FIELD_CONTACT_SHOW_LIST_LABEL="Show Contact List" COM_CONTACT_FIELD_CREATED_BY_ALIAS_DESC="Enter an alias to be displayed instead of the name of the user who created the contact." COM_CONTACT_FIELD_CREATED_BY_ALIAS_LABEL="Created By Alias" COM_CONTACT_FIELD_CREATED_BY_DESC="Select the name of the user who created the contact." -COM_CONTACT_FIELD_CREATED_DESC="Date contact was created." +COM_CONTACT_FIELD_CREATED_DESC="Date when the contact was created." COM_CONTACT_FIELD_CREATED_LABEL="Created Date" COM_CONTACT_FIELD_EMAIL_BANNED_EMAIL_DESC="Email addresses not allowed to submit contact form." COM_CONTACT_FIELD_EMAIL_BANNED_EMAIL_LABEL="Banned Email" @@ -92,8 +93,8 @@ COM_CONTACT_FIELD_EMAIL_BANNED_TEXT_DESC="Text not allowed in contact form body. COM_CONTACT_FIELD_EMAIL_BANNED_TEXT_LABEL="Banned Text" COM_CONTACT_FIELD_EMAIL_EMAIL_COPY_DESC="Hide or Show checkbox to allow copy of email to be sent to submitter." COM_CONTACT_FIELD_EMAIL_EMAIL_COPY_LABEL="Send Copy to Submitter" -COM_CONTACT_FIELD_EMAIL_SHOW_FORM_DESC="Show or hide contact form." -COM_CONTACT_FIELD_EMAIL_SHOW_FORM_LABEL="Show Contact Form" +COM_CONTACT_FIELD_EMAIL_SHOW_FORM_DESC="Show or hide the contact form." +COM_CONTACT_FIELD_EMAIL_SHOW_FORM_LABEL="Contact Form" COM_CONTACT_FIELD_FEATURED_DESC="If marked yes, will be displayed in featured view." COM_CONTACT_FIELD_FEEDLINK_DESC="Show or hide a feed link for this contact category." COM_CONTACT_FIELD_FEEDLINK_LABEL="Feed Link" @@ -107,7 +108,7 @@ COM_CONTACT_FIELD_ICONS_MISC_DESC="Select or upload an image for the Misc icon. COM_CONTACT_FIELD_ICONS_MISC_LABEL="Misc Icon" COM_CONTACT_FIELD_ICONS_MOBILE_DESC="Select or upload an image for the Mobile icon. If none selected, the default icon will be displayed." COM_CONTACT_FIELD_ICONS_MOBILE_LABEL="Mobile Icon" -COM_CONTACT_FIELD_ICONS_SETTINGS_DESC="Choose whether to display icons, text or nothing next to the information." +COM_CONTACT_FIELD_ICONS_SETTINGS_DESC="Show icons, text or nothing next to the information." COM_CONTACT_FIELD_ICONS_SETTINGS_LABEL="Settings" COM_CONTACT_FIELD_ICONS_TELEPHONE_DESC="Select or upload an image for the Telephone icon. If none selected, the default icon will be displayed." COM_CONTACT_FIELD_ICONS_TELEPHONE_LABEL="Telephone Icon" @@ -161,6 +162,7 @@ COM_CONTACT_FIELD_LINKED_USER_DESC="Linked Joomla User." COM_CONTACT_FIELD_LINKED_USER_LABEL="Linked User" COM_CONTACT_FIELD_LINKED_USER_LABEL_ASC="Linked User ascending" COM_CONTACT_FIELD_LINKED_USER_LABEL_DESC="Linked User descending" +COM_CONTACT_FIELD_MODIFIED_BY_DESC="Name of the user who modified this contact." COM_CONTACT_FIELD_MODIFIED_DESC="The date and time that the contact was last modified." COM_CONTACT_FIELD_NAME_DESC="Contact name." COM_CONTACT_FIELD_NAME_LABEL="Name" @@ -176,10 +178,10 @@ COM_CONTACT_FIELD_PARAMS_FAX_LABEL="Fax" COM_CONTACT_FIELD_PARAMS_IMAGE_DESC="Select or upload the contact image." COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL="Image" COM_CONTACT_FIELD_PARAMS_MISC_INFO_DESC="Show or hide miscellaneous information." -COM_CONTACT_FIELD_PARAMS_MISC_INFO_LABEL="Misc. Information" +COM_CONTACT_FIELD_PARAMS_MISC_INFO_LABEL="Miscellaneous Information" COM_CONTACT_FIELD_PARAMS_MOBILE_DESC="Show or hide mobile number." COM_CONTACT_FIELD_PARAMS_MOBILE_LABEL="Mobile Phone" -COM_CONTACT_FIELD_PARAMS_NAME_DESC="Show name of the contact." +COM_CONTACT_FIELD_PARAMS_NAME_DESC="Show or hide name of the contact." COM_CONTACT_FIELD_PARAMS_NAME_LABEL="Name" COM_CONTACT_FIELD_PARAMS_POST-ZIP_CODE_DESC="Show or hide postal or zip code." COM_CONTACT_FIELD_PARAMS_POST-ZIP_CODE_LABEL="Postal Code" @@ -193,14 +195,16 @@ COM_CONTACT_FIELD_PARAMS_TELEPHONE_DESC="Show or hide telephone number." COM_CONTACT_FIELD_PARAMS_TELEPHONE_LABEL="Telephone" COM_CONTACT_FIELD_PARAMS_TOWN-SUBURB_DESC="Show or hide city or suburb." COM_CONTACT_FIELD_PARAMS_TOWN-SUBURB_LABEL="City or Suburb" -COM_CONTACT_FIELD_PARAMS_VCARD_DESC="Whether or not to allow export to vCard format." +COM_CONTACT_FIELD_PARAMS_VCARD_DESC="Show or hide a link to allow export to vCard format." COM_CONTACT_FIELD_PARAMS_VCARD_LABEL="vCard" COM_CONTACT_FIELD_PARAMS_WEBPAGE_DESC="Show or hide webpage." COM_CONTACT_FIELD_PARAMS_WEBPAGE_LABEL="Webpage" COM_CONTACT_FIELD_PRESENTATION_DESC="Determines the style used to display sections of the contact form." COM_CONTACT_FIELD_PRESENTATION_LABEL="Display Format" -COM_CONTACT_FIELD_PROFILE_SHOW_DESC="If this contact is mapped to a user, and if this is set to Show, then the profile of this user will show." -COM_CONTACT_FIELD_PROFILE_SHOW_LABEL="Show Profile" +COM_CONTACT_FIELD_PROFILE_SHOW_DESC="If the contact is mapped to a user and this option is set to Show, then the profile of the user will be shown in the contact details." +COM_CONTACT_FIELD_PROFILE_SHOW_LABEL="User Profile" +COM_CONTACT_FIELD_USER_CUSTOM_FIELDS_SHOW_LABEL="Show User Custom Fields" +COM_CONTACT_FIELD_USER_CUSTOM_FIELDS_SHOW_DESC="Show user custom fields which belong to all or only selected field groups." COM_CONTACT_FIELD_PUBLISH_DOWN_DESC="An optional date to Finish Publishing the contact." COM_CONTACT_FIELD_PUBLISH_DOWN_LABEL="Finish Publishing" COM_CONTACT_FIELD_PUBLISH_UP_DESC="An optional date to Start Publishing the contact." @@ -208,12 +212,14 @@ COM_CONTACT_FIELD_PUBLISH_UP_LABEL="Start Publishing" COM_CONTACT_FIELD_SHOW_CAT_ITEMS_DESC="Show or hide the number of contacts in category." COM_CONTACT_FIELD_SHOW_CAT_ITEMS_LABEL="# Contacts in Category" COM_CONTACT_FIELD_SHOW_CATEGORY_DESC="Displays the category." -COM_CONTACT_FIELD_SHOW_LINKS_DESC="Show or hide the links." -COM_CONTACT_FIELD_SHOW_LINKS_LABEL="Show Links" -COM_CONTACT_FIELD_SHOW_CAT_TAGS_DESC="Show the tags for a contact category." -COM_CONTACT_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags" -COM_CONTACT_FIELD_SHOW_TAGS_DESC="Show the tags for a contact." -COM_CONTACT_FIELD_SHOW_TAGS_LABEL="Show Tags" +COM_CONTACT_FIELD_SHOW_LINKS_DESC="Show or hide the contact links." +COM_CONTACT_FIELD_SHOW_LINKS_LABEL="Contact Links" +COM_CONTACT_FIELD_SHOW_CAT_TAGS_DESC="Show or hide the tags for a contact category." +COM_CONTACT_FIELD_SHOW_CAT_TAGS_LABEL="Category Tags" +COM_CONTACT_FIELD_SHOW_TAGS_DESC="Show or hide the tags for a contact." +COM_CONTACT_FIELD_SHOW_TAGS_LABEL="Tags" +COM_CONTACT_FIELD_SHOW_INFO_LABEL="Contact Information" +COM_CONTACT_FIELD_SHOW_INFO_DESC="Show or hide the contact information." COM_CONTACT_FIELD_SORTNAME1_DESC="The part of the name to use as the first sort field." COM_CONTACT_FIELD_SORTNAME1_LABEL="First Sort Field" COM_CONTACT_FIELD_SORTNAME2_DESC="The part of the name to use as the second sort field." @@ -234,6 +240,9 @@ COM_CONTACT_FIELD_VALUE_USE_CONTACT_SETTINGS="Use Contact Settings" COM_CONTACT_FIELD_VALUE_WITH_LINK="Show With Link" COM_CONTACT_FIELD_VERSION_LABEL="Revision" COM_CONTACT_FIELD_VERSION_DESC="A count of the number of times this contact has been revised." +COM_CONTACT_FIELDS_CONTACT_FIELDS_TITLE="Contacts: Fields" +COM_CONTACT_FIELDS_CONTACT_FIELD_ADD_TITLE="Contacts: New Field" +COM_CONTACT_FIELDS_CONTACT_FIELD_EDIT_TITLE="Contacts: Edit Field" COM_CONTACT_FIELDSET_CONTACT_FORM="Contact form" COM_CONTACT_FIELDSET_CONTACT_LABEL="Form" COM_CONTACT_FIELDSET_CONTACTFORM_LABEL="Mail Options" @@ -295,3 +304,11 @@ JGLOBAL_FIELDSET_MISCELLANEOUS="Miscellaneous Information" JGLOBAL_NEWITEMSLAST_DESC="New Contacts default to the last position. Ordering can be changed after this Contact is saved." JLIB_HTML_BATCH_USER_LABEL="Set Linked User" JLIB_RULES_SETTING_NOTES="Changes apply to this component only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." + +COM_CONTACT_FIELDS_CONTEXT_CONTACT="Contact" +COM_CONTACT_FIELDS_CONTEXT_MAIL="Mail" + +; Fields overrides +COM_CONTACT_CONTACT_CATEGORIES_TITLE="Contacts: Field Groups" +COM_CONTACT_CONTACT_CATEGORY_ADD_TITLE="Contacts: New Field Group" +COM_CONTACT_CONTACT_CATEGORY_EDIT_TITLE="Contacts: Edit Field Group" diff --git a/administrator/language/en-GB/en-GB.com_contact.sys.ini b/administrator/language/en-GB/en-GB.com_contact.sys.ini index 6651282393085..b7cc5e980d5f4 100644 --- a/administrator/language/en-GB/en-GB.com_contact.sys.ini +++ b/administrator/language/en-GB/en-GB.com_contact.sys.ini @@ -22,4 +22,6 @@ COM_CONTACT_FEATURED_VIEW_DEFAULT_DESC="This view lists the featured contacts." COM_CONTACT_FEATURED_VIEW_DEFAULT_OPTION="Default" COM_CONTACT_FEATURED_VIEW_DEFAULT_TITLE="Featured Contacts" COM_CONTACT_CONTACTS="Contacts" +COM_CONTACT_TAGS_CONTACT="Contact" +COM_CONTACT_TAGS_CATEGORY="Contact Category" COM_CONTACT_XML_DESCRIPTION="This component shows a listing of Contact Information." diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index 0609253f0b751..86296617eabda 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -7,6 +7,7 @@ COM_CONTENT="Articles" COM_CONTENT_ACCESS_DELETE_DESC="New setting for delete actions on this article and the calculated setting based on the parent category and group permissions." COM_CONTENT_ACCESS_EDIT_DESC="New setting for edit actions on this article and the calculated setting based on the parent category and group permissions." COM_CONTENT_ACCESS_EDITSTATE_DESC="New setting for edit state actions on this article and the calculated setting based on the parent category and group permissions." +COM_CONTENT_ACCESS_EDITVALUE_DESC="New setting for edit value actions on this article and the calculated setting based on the parent category and group permissions." COM_CONTENT_ARTICLE_CONTENT="Content" COM_CONTENT_ARTICLE_DETAILS="Article Details" COM_CONTENT_ARTICLES_TITLE="Articles" @@ -31,7 +32,7 @@ COM_CONTENT_CONFIGURATION="Articles: Options" COM_CONTENT_CREATE_ARTICLE_CATEGORY_LABEL="Default Category" COM_CONTENT_CREATE_ARTICLE_CATEGORY_DESC="If set to 'Yes', this page will only let you create articles in the category selected below." COM_CONTENT_DRILL_CATEGORIES_LABEL="List or Blog: after choosing the display,
    make sure you define the Options in the desired layout." -COM_CONTENT_DRILL_DOWN_LAYOUT_DESC="When drilling down to a category, whether to show articles in a list or blog layout." +COM_CONTENT_DRILL_DOWN_LAYOUT_DESC="When drilling down to a category, show articles in a list or blog layout." COM_CONTENT_DRILL_DOWN_LAYOUT_LABEL="List or Blog Layout" COM_CONTENT_EDIT_ARTICLE="Edit Article" COM_CONTENT_EDITORCONFIG_FIELDSET_LABEL="Configure Edit Screen" @@ -43,8 +44,12 @@ COM_CONTENT_FEATURED_CATEGORIES_DESC="Optional list of categories. If selected, COM_CONTENT_FEATURED_CATEGORIES_LABEL="Select Categories" COM_CONTENT_FEATURED_ORDER="Featured Articles Order" COM_CONTENT_FEATURED_TITLE="Articles: Featured" +COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_DESC="Optional text for the "Browser page title" element to be used when the article is viewed with a non-article menu item. If blank, the article's title is used instead." +COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_LABEL="Browser Page Title" COM_CONTENT_FIELD_ARTICLETEXT_DESC="Enter the article content in the text area." COM_CONTENT_FIELD_ARTICLETEXT_LABEL="Article Text" +COM_CONTENT_FIELD_CAPTCHA_DESC="Select the captcha plugin that will be used in the article submit form. You may need to enter required information for your captcha plugin in the Plugin Manager.
    If 'Use Default' is selected, make sure a captcha plugin is selected in Global Configuration." +COM_CONTENT_FIELD_CAPTCHA_LABEL="Allow Captcha on submit" COM_CONTENT_FIELD_CREATED_BY_ALIAS_DESC="Enter an alias to be displayed instead of the name of the user who created the article." COM_CONTENT_FIELD_CREATED_BY_ALIAS_LABEL="Created by Alias" COM_CONTENT_FIELD_CREATED_BY_DESC="Select the name of the user who created the article." @@ -57,13 +62,15 @@ COM_CONTENT_FIELD_FULL_LABEL="Full Article Image" COM_CONTENT_FIELD_FULLTEXT="Full text" COM_CONTENT_FIELD_HITS_DESC="Number of hits for this article." COM_CONTENT_FIELD_IMAGE_DESC="The image to be displayed." -COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present." +COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images." COM_CONTENT_FIELD_IMAGE_ALT_LABEL="Alt Text" COM_CONTENT_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image." COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL="Caption" COM_CONTENT_FIELD_IMAGE_OPTIONS="Image Options" COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC="Puts the article information block above or below the text or splits it into two separate blocks, one above and the other below." COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL="Position of Article Info" +COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC="Displays the 'Article Info' title on top of the article information block." +COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL="Article Info Title" COM_CONTENT_FIELD_INTRO_DESC="Image for the intro text layouts such as blogs and featured." COM_CONTENT_FIELD_INTRO_LABEL="Intro Image" COM_CONTENT_FIELD_INTROTEXT="Intro Text" @@ -99,9 +106,12 @@ COM_CONTENT_FIELD_VERSION_DESC="A count of the number of times this article has COM_CONTENT_FIELD_VERSION_LABEL="Revision" COM_CONTENT_FIELD_XREFERENCE_DESC="An optional reference used to link to external data sources." COM_CONTENT_FIELD_XREFERENCE_LABEL="External Reference" +COM_CONTENT_FIELDS_ARTICLE_FIELDS_TITLE="Articles: Fields" +COM_CONTENT_FIELDS_ARTICLE_FIELD_ADD_TITLE="Articles: New Field" +COM_CONTENT_FIELDS_ARTICLE_FIELD_EDIT_TITLE="Articles: Edit Field" COM_CONTENT_FIELDSET_PUBLISHING="Publishing" COM_CONTENT_FIELDSET_RULES="Permissions" -COM_CONTENT_FIELDSET_URLS_AND_IMAGES="Images and links" +COM_CONTENT_FIELDSET_URLS_AND_IMAGES="Images and Links" COM_CONTENT_FILTER_SEARCH_DESC="Search in title and alias. Prefix with ID: or AUTHOR: to search for an article ID or article author." COM_CONTENT_FILTER_SEARCH_LABEL="Search Articles" COM_CONTENT_FLOAT_DESC="Controls placement of the image." @@ -169,7 +179,7 @@ COM_CONTENT_TOGGLE_TO_FEATURE="Toggle to change article state to 'Featured'" COM_CONTENT_TOGGLE_TO_UNFEATURE="Toggle to change article state to 'Unfeatured'" COM_CONTENT_UNFEATURED="Unfeatured Article" COM_CONTENT_URL_FIELD_BROWSERNAV_LABEL="URL Target Window" -COM_CONTENT_URL_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is selected." +COM_CONTENT_URL_FIELD_BROWSERNAV_DESC="Target browser window when the link is selected." COM_CONTENT_URL_FIELD_A_BROWSERNAV_LABEL="URL A Target Window" COM_CONTENT_URL_FIELD_B_BROWSERNAV_LABEL="URL B Target Window" COM_CONTENT_URL_FIELD_C_BROWSERNAV_LABEL="URL C Target Window" @@ -181,3 +191,10 @@ JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new ar JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these articles." JLIB_RULES_SETTING_NOTES="Changes apply to this component only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." JLIB_RULES_SETTING_NOTES_ITEM="Changes apply to this article only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." + +COM_CONTENT_FIELDS_TYPE_MODAL_ARTICLE="Article" + +; Fields overrides +COM_CONTENT_ARTICLE_CATEGORIES_TITLE="Articles: Field Groups" +COM_CONTENT_ARTICLE_CATEGORY_ADD_TITLE="Articles: New Field Group" +COM_CONTENT_ARTICLE_CATEGORY_EDIT_TITLE="Articles: Edit Field Group" diff --git a/administrator/language/en-GB/en-GB.com_content.sys.ini b/administrator/language/en-GB/en-GB.com_content.sys.ini index a2ce20275dce3..79592a4bb86ea 100644 --- a/administrator/language/en-GB/en-GB.com_content.sys.ini +++ b/administrator/language/en-GB/en-GB.com_content.sys.ini @@ -36,4 +36,6 @@ COM_CONTENT_FEATURED_VIEW_DEFAULT_TITLE="Featured Articles" COM_CONTENT_FORM_VIEW_DEFAULT_DESC="Create a new article." COM_CONTENT_FORM_VIEW_DEFAULT_OPTION="Create" COM_CONTENT_FORM_VIEW_DEFAULT_TITLE="Create Article" +COM_CONTENT_TAGS_ARTICLE="Article" +COM_CONTENT_TAGS_CATEGORY="Article Category" COM_CONTENT_XML_DESCRIPTION="Article management component." diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index dab01e9af8d8c..863fcd5a4f6e3 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -21,14 +21,16 @@ COM_CPANEL_MSG_EACCELERATOR_BUTTON="Change to File." COM_CPANEL_MSG_EACCELERATOR_TITLE="eAccelerator is not compatible with Joomla!" COM_CPANEL_MSG_HTACCESS_BODY="A change to the default .htaccess and web.config files was made in Joomla! 3.4 to disallow folder listings by default. Users are recommended to implement this change in their files. Please see this page for more information." COM_CPANEL_MSG_HTACCESS_TITLE=".htaccess & web.config Update" +COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE="Prepare for the next Major Release of Joomla" +COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_BODY="Beginning with Joomla! 4.0 we are raising the minimum server requirements. If you are seeing this message then your current configuration does not meet these new minimum requirements.
    The minimum requirements are the following:
    • PHP 5.5.9
    • MySQL 5.5.3
    • PostgreSQL 9.2
    • MS SQL will not be supported

    Please contact your hosting provider to ask how you can meet these raised server requirements - it is usually a very simple change. If you already meet these new requirements then this message will not be displayed." COM_CPANEL_MSG_LANGUAGEACCESS340_TITLE="You have possible issues with your multilingual settings" -COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla! 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." -COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least PHP version 5.3.10 in order to provide enhanced security features to its users." +COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla! 3.4.0 you may have issues with the System - Language Filter plugin on your website. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." +COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least PHP version 5.3.10 in order to provide enhanced security features to its users." COM_CPANEL_MSG_PHPVERSION_TITLE="Your PHP Version Will Be Unsupported in Joomla! 3.3" COM_CPANEL_MSG_ROBOTS_TITLE="robots.txt Update" COM_CPANEL_MSG_ROBOTS_BODY="A change to the default robots.txt files was made in Joomla! 3.3 to allow Google to access templates and media files by default to improve SEO. This change is not applied automatically on upgrades and users are recommended to review the changes in the robots.txt.dist file and implement these changes in their own robots.txt file." COM_CPANEL_MSG_STATS_COLLECTION_BODY="Since Joomla! 3.5 a statistics plugin will submit anonymous data to the Joomla Project. This will only submit the Joomla version, PHP version, database engine and version, and server operating system.

    This data is collected to ensure that future versions of Joomla can take advantage of the latest database and PHP features without affecting significant numbers of users. The need for this became clear when a minimum of PHP 5.3.10 was required when Joomla! 3.3 implemented the more secure Bcrypt passwords.

    In the interest of full transparency and to help developers this data is publicly available. An API and graphs will show the Joomla version, PHP versions and database engines in use.

    If you do not wish to provide the Joomla Project with this information you can disable the plugin called System - Joomla Statistics." COM_CPANEL_MSG_STATS_COLLECTION_TITLE="Stats Collection in Joomla" -COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

    Community resources are available for new users

    " +COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

    Community resources are available for new users

    " COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!" COM_CPANEL_XML_DESCRIPTION="Control Panel component" diff --git a/administrator/language/en-GB/en-GB.com_fields.ini b/administrator/language/en-GB/en-GB.com_fields.ini new file mode 100644 index 0000000000000..aef4636b11083 --- /dev/null +++ b/administrator/language/en-GB/en-GB.com_fields.ini @@ -0,0 +1,103 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +COM_FIELDS="Fields" +COM_FIELDS_FIELD_CLASS_DESC="The class attributes of the field in the edit form. If different classes are needed, list them with spaces." +COM_FIELDS_FIELD_CLASS_LABEL="Class" +COM_FIELDS_FIELD_DEFAULT_VALUE_DESC="The default value of the field." +COM_FIELDS_FIELD_DEFAULT_VALUE_LABEL="Default Value" +COM_FIELDS_FIELD_DESCRIPTION_DESC="The description of the field." +COM_FIELDS_FIELD_DISABLED_DESC="Is the field disabled in the edit form." +COM_FIELDS_FIELD_DISABLED_LABEL="Disabled" +COM_FIELDS_FIELD_DISPLAY_AFTER_DISPLAY="After Display" +COM_FIELDS_FIELD_DISPLAY_AFTER_TITLE="After Title" +COM_FIELDS_FIELD_DISPLAY_BEFORE_DISPLAY="Before Display" +COM_FIELDS_FIELD_DISPLAY_DESC="Joomla offers some content events which are triggered during the content creation process. This is the place to define how the custom fields should be integrated into content." +COM_FIELDS_FIELD_DISPLAY_LABEL="Automatic Display" +COM_FIELDS_FIELD_GROUP_DESC="The group this field belongs to." +COM_FIELDS_FIELD_GROUP_LABEL="Field Group" +COM_FIELDS_FIELD_HINT_DESC="The hint of the field, also called placeholder." +COM_FIELDS_FIELD_HINT_LABEL="Hint" +COM_FIELDS_FIELD_IMAGE_ALT_DESC="The alternate text for the image." +COM_FIELDS_FIELD_IMAGE_ALT_LABEL="Image Alternate Text" +COM_FIELDS_FIELD_IMAGE_DESC="Image label." +COM_FIELDS_FIELD_IMAGE_LABEL="Image" +COM_FIELDS_FIELD_LABEL_DESC="The label of the field to display." +COM_FIELDS_FIELD_LABEL_LABEL="Label" +COM_FIELDS_FIELD_LANGUAGE_DESC="Assign a language to this field." +COM_FIELDS_FIELD_NOTE_DESC="An optional note for the field." +COM_FIELDS_FIELD_NOTE_LABEL="Note" +COM_FIELDS_FIELD_PERMISSION_CREATE_DESC="New setting for create actions in this field and the calculated setting based on the parent extension and group permissions." +COM_FIELDS_FIELD_PERMISSION_DELETE_DESC="New setting for delete actions on this field and the calculated setting based on the parent extension and group permissions." +COM_FIELDS_FIELD_PERMISSION_EDITOWN_DESC="New setting for edit own actions on this field and the calculated setting based on the parent extension and group permissions." +COM_FIELDS_FIELD_PERMISSION_EDITSTATE_DESC="New setting for edit state actions on this field and the calculated setting based on the parent extension and group permissions." +COM_FIELDS_FIELD_PERMISSION_EDITVALUE_DESC="Who can edit the field value in the form editor." +COM_FIELDS_FIELD_PERMISSION_EDIT_DESC="New setting for edit actions on this field and the calculated setting based on the parent extension and group permissions." +COM_FIELDS_FIELD_PERMISSION_EDIT_VALUE_LABEL="Edit Field Value" +COM_FIELDS_FIELD_READONLY_DESC="Is the field read-only in the edit form." +COM_FIELDS_FIELD_READONLY_LABEL="Read-Only" +COM_FIELDS_FIELD_RENDER_CLASS_DESC="The class attributes of the field when the field is rendered. If different classes are needed, list them with spaces." +COM_FIELDS_FIELD_RENDER_CLASS_LABEL="Render Class" +COM_FIELDS_FIELD_REQUIRED_DESC="Is this a mandatory field?" +COM_FIELDS_FIELD_REQUIRED_LABEL="Required" +COM_FIELDS_FIELD_SHOW_ON_ADMIN="Administrator" +COM_FIELDS_FIELD_SHOW_ON_BOTH="Both" +COM_FIELDS_FIELD_SHOW_ON_DESC="On which part of the site should the field be shown." +COM_FIELDS_FIELD_SHOW_ON_LABEL="Show On" +COM_FIELDS_FIELD_SHOW_ON_SITE="Site" +COM_FIELDS_FIELD_TYPE_DESC="The type of the field." +COM_FIELDS_FIELD_TYPE_LABEL="Type" +COM_FIELDS_N_ITEMS_ARCHIVED="%d fields successfully archived" +COM_FIELDS_N_ITEMS_ARCHIVED_1="%d field successfully archived" +COM_FIELDS_N_ITEMS_CHECKED_IN_0="No field successfully checked in" +COM_FIELDS_N_ITEMS_CHECKED_IN_1="%d field successfully checked in" +COM_FIELDS_N_ITEMS_CHECKED_IN_MORE="%d fields successfully checked in" +COM_FIELDS_N_ITEMS_CREATED="%d fields successfully created in calendar %s" +COM_FIELDS_N_ITEMS_DELETED="%d fields successfully deleted" +COM_FIELDS_N_ITEMS_DELETED_1="%d field successfully deleted" +COM_FIELDS_N_ITEMS_PUBLISHED="%d fields successfully published" +COM_FIELDS_N_ITEMS_PUBLISHED_1="%d field successfully published" +COM_FIELDS_N_ITEMS_TRASHED="%d fields successfully trashed" +COM_FIELDS_N_ITEMS_TRASHED_1="%d field successfully trashed" +COM_FIELDS_N_ITEMS_UNPUBLISHED="%d fields successfully unpublished" +COM_FIELDS_N_ITEMS_UNPUBLISHED_1="%d field successfully unpublished" +COM_FIELDS_N_ITEMS_UPDATED="%d fields successfully updated in calendar %s" +COM_FIELDS_SYSTEM_PLUGIN_NOT_ENABLED="The Fields System Plugin is disabled. The custom fields will not display if you do not enable this plugin." +COM_FIELDS_TYPE_CALENDAR="Calendar" +COM_FIELDS_TYPE_CAPTCHA="CAPTCHA" +COM_FIELDS_TYPE_CHECKBOXES="Checkboxes" +COM_FIELDS_TYPE_COLOR="Colour" +COM_FIELDS_TYPE_EDITOR="Editor" +COM_FIELDS_TYPE_EMAIL="Email" +COM_FIELDS_TYPE_IMAGELIST="Image" +COM_FIELDS_TYPE_INTEGER="Integer" +COM_FIELDS_TYPE_LIST="List" +COM_FIELDS_TYPE_MEDIA="Media" +COM_FIELDS_TYPE_RADIO="Radio" +COM_FIELDS_TYPE_SQL="SQL" +COM_FIELDS_TYPE_TEL="Telephone" +COM_FIELDS_TYPE_TEXT="Text" +COM_FIELDS_TYPE_TEXTAREA="Textarea" +COM_FIELDS_TYPE_TIMEZONE="Timezone" +COM_FIELDS_TYPE_URL="URL" +COM_FIELDS_TYPE_USER="User" +COM_FIELDS_TYPE_USERGROUPLIST="Usergroup" +COM_FIELDS_VIEW_FIELDS_BASE_TITLE="Fields" +COM_FIELDS_VIEW_FIELDS_BATCH_OPTIONS="Batch process the selected fields." +COM_FIELDS_VIEW_FIELDS_SELECT_GROUP="- Select Field Group -" +COM_FIELDS_VIEW_FIELDS_SORT_TYPE_ASC="Type ascending" +COM_FIELDS_VIEW_FIELDS_SORT_TYPE_DESC="Type descending" +COM_FIELDS_VIEW_FIELDS_TITLE="%s Fields" +COM_FIELDS_VIEW_FIELD_ADD_TITLE="%s Fields: New" +COM_FIELDS_VIEW_FIELD_BASE_ADD_TITLE="Fields: New" +COM_FIELDS_VIEW_FIELD_BASE_EDIT_TITLE="Fields: Edit" +COM_FIELDS_VIEW_FIELD_EDIT_TITLE="%s Fields: Edit" +COM_FIELDS_VIEW_FIELD_FIELDSET_GENERAL="General" +COM_FIELDS_VIEW_FIELD_FIELDSET_PUBLISHING="Publishing" +COM_FIELDS_VIEW_FIELD_FIELDSET_RULES="Permissions" +COM_FIELDS_XML_DESCRIPTION="Component to manage custom fields." +JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Group " +JGLOBAL_TYPE_OR_SELECT_CATEGORY="Type or select a Group" +JLIB_HTML_BATCH_MENU_LABEL="To Move or Copy your selection please select a Group." diff --git a/administrator/language/en-GB/en-GB.com_fields.sys.ini b/administrator/language/en-GB/en-GB.com_fields.sys.ini new file mode 100644 index 0000000000000..078f1cf37c1d3 --- /dev/null +++ b/administrator/language/en-GB/en-GB.com_fields.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +COM_FIELDS="Fields" +COM_FIELDS_XML_DESCRIPTION="Component to manage custom fields." diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index 79eab3daf5373..35217113c4187 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -16,8 +16,8 @@ COM_FINDER_CONFIG_DESCRIPTION_LENGTH_DESCRIPTION="Description text for search re COM_FINDER_CONFIG_DESCRIPTION_LENGTH_LABEL="Description Length" COM_FINDER_CONFIG_ENABLE_LOGGING_DESCRIPTION="Enable this option to create a log file in your site's logs folder during the index process. This file is useful for troubleshooting issues with the index process. It is recommended that logging be disabled unless necessary." COM_FINDER_CONFIG_ENABLE_LOGGING_LABEL="Enable Logging" -COM_FINDER_CONFIG_EXPAND_ADVANCED_DESC="Toggle whether the advanced search options should be expanded by default." -COM_FINDER_CONFIG_EXPAND_ADVANCED_DESCRIPTION="Toggle whether the advanced search options should be expanded by default." +COM_FINDER_CONFIG_EXPAND_ADVANCED_DESC="Toggle if the advanced search options should be expanded by default." +COM_FINDER_CONFIG_EXPAND_ADVANCED_DESCRIPTION="Toggle if the advanced search options should be expanded by default." COM_FINDER_CONFIG_EXPAND_ADVANCED_LABEL="Expand Advanced Search" COM_FINDER_CONFIG_FIELD_OPENSEARCH_DESCRIPTON_DESCRIPTION="Description displayed for this site as a search provider." COM_FINDER_CONFIG_FIELD_OPENSEARCH_DESCRIPTON_LABEL="OpenSearch Description" @@ -25,7 +25,7 @@ COM_FINDER_CONFIG_FIELD_OPENSEARCH_NAME_DESCRIPTION="Name displayed for this sit COM_FINDER_CONFIG_FIELD_OPENSEARCH_NAME_LABEL="OpenSearch Name" COM_FINDER_CONFIG_GATHER_SEARCH_STATISTICS_DESCRIPTION="Record the search phrases submitted by visitors." COM_FINDER_CONFIG_GATHER_SEARCH_STATISTICS_LABEL="Gather Search Statistics" -COM_FINDER_CONFIG_HILIGHT_CONTENT_SEARCH_TERMS_DESCRIPTION="Toggle whether search terms should be highlighted in search results." +COM_FINDER_CONFIG_HILIGHT_CONTENT_SEARCH_TERMS_DESCRIPTION="Toggle if search terms should be highlighted in search results." COM_FINDER_CONFIG_HILIGHT_CONTENT_SEARCH_TERMS_LABEL="Highlight Search Terms" COM_FINDER_CONFIG_IMPORT_EXPORT="Import/Export" COM_FINDER_CONFIG_IMPORT_EXPORT_HELP="Help" @@ -38,30 +38,30 @@ COM_FINDER_CONFIG_MEMORY_TABLE_LIMIT_LABEL="Memory Table Limit" COM_FINDER_CONFIG_META_MULTIPLIER_DESCRIPTION="The multiplier is used to control how much influence matching text has on the overall relevance score of a search result. A multiplier is considered in relationship to the other multipliers. The meta data comes from a number of sources including the meta keywords and meta description, author names, etc." COM_FINDER_CONFIG_META_MULTIPLIER_LABEL="Meta Data Weight Multiplier" COM_FINDER_CONFIG_MISC_MULTIPLIER_DESCRIPTION="The multiplier is used to control how much influence matching text has on the overall relevance score of a search result. A multiplier is considered in relationship to the other multipliers. The miscellaneous text comes from a number of sources including comments and other associated data." -COM_FINDER_CONFIG_MISC_MULTIPLIER_LABEL="Miscellaneous Text Weight Multiplier" +COM_FINDER_CONFIG_MISC_MULTIPLIER_LABEL="Misc. Text Weight Multiplier" COM_FINDER_CONFIG_PATH_MULTIPLIER_DESCRIPTION="The multiplier is used to control how much influence matching text has on the overall relevance score of a search result. A multiplier is considered in relationship to the other multipliers. The path text comes from the SEF URL of the content." COM_FINDER_CONFIG_PATH_MULTIPLIER_LABEL="Path Text Weight Multiplier" -COM_FINDER_CONFIG_SHOW_ADVANCED_DESC="Toggle whether users should be able to see advanced search options." -COM_FINDER_CONFIG_SHOW_ADVANCED_DESCRIPTION="Toggle whether users should be able to see advanced search options." +COM_FINDER_CONFIG_SHOW_ADVANCED_DESC="Toggle if users should be able to see advanced search options." +COM_FINDER_CONFIG_SHOW_ADVANCED_DESCRIPTION="Toggle if users should be able to see advanced search options." COM_FINDER_CONFIG_SHOW_ADVANCED_LABEL="Advanced Search" -COM_FINDER_CONFIG_SHOW_ADVANCED_TIPS_DESCRIPTION="Toggle whether users should be able to see advanced search tips." +COM_FINDER_CONFIG_SHOW_ADVANCED_TIPS_DESCRIPTION="Toggle if users should be able to see advanced search tips." COM_FINDER_CONFIG_SHOW_ADVANCED_TIPS_LABEL="Advanced Tips" -COM_FINDER_CONFIG_SHOW_AUTOSUGGEST_DESCRIPTION="Toggle whether automatic search suggestions should be displayed." +COM_FINDER_CONFIG_SHOW_AUTOSUGGEST_DESCRIPTION="Toggle if automatic search suggestions should be displayed." COM_FINDER_CONFIG_SHOW_AUTOSUGGEST_LABEL="Search Suggestions" COM_FINDER_CONFIG_SHOW_DATE_FILTERS_DESC="Show the start and end date filters in the advanced search." COM_FINDER_CONFIG_SHOW_DATE_FILTERS_DESCRIPTION="Show the start and end date filters in the advanced search." COM_FINDER_CONFIG_SHOW_DATE_FILTERS_LABEL="Date Filters" -COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESC="Toggle whether the description should be displayed with search results." -COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESCRIPTION="Toggle whether the description should be displayed with search results." +COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESC="Toggle if the description should be displayed with search results." +COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESCRIPTION="Toggle if the description should be displayed with search results." COM_FINDER_CONFIG_SHOW_DESCRIPTION_LABEL="Result Description" -COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_DESC="Whether to show a detailed explanation of the search requested." +COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_DESC="Show or hide a detailed explanation of the search requested." COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_LABEL="Query Explanation" COM_FINDER_CONFIG_SHOW_FEED_DESC="Show the syndication feed link." COM_FINDER_CONFIG_SHOW_FEED_LABEL="Show Feed" COM_FINDER_CONFIG_SHOW_FEED_TEXT_DESC="Show the associated text with the feed, otherwise just the title is shown in the feed." COM_FINDER_CONFIG_SHOW_FEED_TEXT_LABEL="Show Feed Text" COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_DESC="Whether to suggest alternative search terms when a search produces no results." -COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_LABEL="Did you mean" +COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_LABEL="Did You Mean" COM_FINDER_CONFIG_SHOW_URL_DESC="Show the associated URL that for the item." COM_FINDER_CONFIG_SHOW_URL_DESCRIPTION="Show the associated URL for the item." COM_FINDER_CONFIG_SHOW_URL_LABEL="Result URL" @@ -161,8 +161,8 @@ COM_FINDER_INDEX_HEADING_LINK_URL_ASC="Raw URL ascending" COM_FINDER_INDEX_HEADING_LINK_URL_DESC="Raw URL descending" COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria." COM_FINDER_INDEX_NO_DATA="No content has been indexed." -; Change 'Content%20-%20Smart%20Search' to the value for PLG_CONTENT_FINDER in plg_content_finder.sys.ini for your language -COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="Smart Search content plugin is not enabled. Changes to content will not update the Smart Search index if you do not enable this plugin." +COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index if you do not enable this plugin." +COM_FINDER_INDEX_PURGE_FAILED="Failed to delete selected items." COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully deleted." COM_FINDER_INDEX_SEARCH_DESC="Search in title, url and last updated date." COM_FINDER_INDEX_SEARCH_LABEL="Search Indexed Content" @@ -191,7 +191,7 @@ COM_FINDER_MAP_UNPUBLISH_SUCCESS="The selected map(s) were successfully unpublis COM_FINDER_MAPS="Maps" COM_FINDER_MAPS_BRANCH_LINK="Select to show the children in this branch." COM_FINDER_MAPS_BRANCHES="Branches Only" -COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT="Are you sure you want to delete the selected maps(s)?" +COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT="Are you sure you want to delete the selected map(s)?" COM_FINDER_MAPS_COUNT_PUBLISHED_ITEMS="Published Indexed Content" COM_FINDER_MAPS_COUNT_UNPUBLISHED_ITEMS="Unpublished Indexed Content" COM_FINDER_MAPS_MULTILANG="Note: Language filter system plugin has been enabled, so this branch will not be used." diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index 0b9d90b3da2b1..2ecc30f0f67a0 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -5,7 +5,7 @@ COM_INSTALLER="Installer" COM_INSTALLER_AUTHOR_INFORMATION="Author Information" -COM_INSTALLER_CACHETIMEOUT_DESC="For how many hours should Joomla cache extension update information." +COM_INSTALLER_CACHETIMEOUT_DESC="For how many hours should Joomla cache update information. This is also the cache time for the Update Notification Plugin, if enabled" COM_INSTALLER_CACHETIMEOUT_LABEL="Updates Caching (in hours)" COM_INSTALLER_CONFIGURATION="Installer: Options" COM_INSTALLER_CONFIRM_UNINSTALL="Are you sure you want to uninstall? Confirming will permanently delete the selected item(s)!" @@ -67,8 +67,8 @@ COM_INSTALLER_INSTALL_FROM_DIRECTORY="Install from Folder" COM_INSTALLER_INSTALL_FROM_URL="Install from URL" COM_INSTALLER_INSTALL_FROM_WEB="Install from Web" COM_INSTALLER_INSTALL_FROM_WEB_ADD_TAB="Add "Install from Web" tab" -COM_INSTALLER_INSTALL_FROM_WEB_INFO="Joomla! Extensions Directory™ (JED) now available with Install from Web on this page." -COM_INSTALLER_INSTALL_FROM_WEB_TOS="By selecting "_QQ_"Add Install from Web tab"_QQ_" below, you agree to the JED Terms of Service and all applicable third party license terms." +COM_INSTALLER_INSTALL_FROM_WEB_INFO="Joomla! Extensions Directory™ (JED) now available with Install from Web on this page." +COM_INSTALLER_INSTALL_FROM_WEB_TOS="By selecting "_QQ_"Add Install from Web tab"_QQ_" below, you agree to the JED Terms of Service and all applicable third party license terms." COM_INSTALLER_INSTALL_LANGUAGE_SUCCESS="Installation of the %s language was successful." COM_INSTALLER_INSTALL_SUCCESS="Installation of the %s was successful." COM_INSTALLER_INSTALL_URL="Install URL" @@ -129,7 +129,7 @@ COM_INSTALLER_MSG_INSTALL_WARNINSTALLZLIB="The installer can't continue until Zl COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_MANIFEST="The installer can't get the URL to the XML manifest file of the %s language." COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_PACKAGE="The installer can't get the URL to the remote %s language." COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES="There are no available languages to install at the moment. Please select the "Find languages" button to check for updates on the Joomla! Languages server. You will need an internet connection for this to work." -COM_INSTALLER_MSG_LANGUAGES_TRY_LATER="Try again later or contact the language team coordinator" +COM_INSTALLER_MSG_LANGUAGES_TRY_LATER="Try again later or contact the language team coordinator." COM_INSTALLER_MSG_MANAGE_NOEXTENSION="There are no extensions installed matching your query." COM_INSTALLER_MSG_MANAGE_NOUPDATESITE="There are no update sites matching your query." COM_INSTALLER_MSG_N_DATABASE_ERROR_PANEL="%d Database Problems Found." @@ -140,10 +140,12 @@ COM_INSTALLER_MSG_UPDATE_NOUPDATES="There are no updates available at the moment COM_INSTALLER_MSG_UPDATE_SITES_COUNT_CHECK="Some update sites are disabled. You may want to check the Update Sites Manager." COM_INSTALLER_MSG_UPDATE_SUCCESS="Updating %s was successful." COM_INSTALLER_MSG_UPDATE_UPDATE="Update" -COM_INSTALLER_MSG_UPDATESITES_DELETE_ERROR="An error has occured while trying to delete "_QQ_"%s"_QQ_" update site: %s." +COM_INSTALLER_MSG_UPDATESITES_DELETE_ERROR="An error has occurred while trying to delete "_QQ_"%s"_QQ_" update site: %s." COM_INSTALLER_MSG_UPDATESITES_DELETE_CANNOT_DELETE="%s update site cannot be deleted." COM_INSTALLER_MSG_UPDATESITES_N_DELETE_UPDATESITES_DELETED="%s update sites have been deleted." COM_INSTALLER_MSG_UPDATESITES_N_DELETE_UPDATESITES_DELETED_1="1 update site has been deleted." +COM_INSTALLER_MSG_UPDATESITES_REBUILD_EXTENSION_PLUGIN_NOT_ENABLED="The Joomla Extension Plugin is disabled. This plugin must be enabled to rebuild the update sites." +COM_INSTALLER_MSG_UPDATESITES_REBUILD_MESSAGE="Update sites have been rebuilt. No extension with an update site has been discovered." COM_INSTALLER_MSG_UPDATESITES_REBUILD_NOT_PERMITTED="Rebuilding update sites is not permitted." COM_INSTALLER_MSG_UPDATESITES_REBUILD_WARNING="Update sites have been rebuilt. No extension with updates sites discovered." COM_INSTALLER_MSG_UPDATESITES_REBUILD_SUCCESS="Update sites have been rebuilt from manifest files." @@ -167,9 +169,9 @@ COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC="The PHP temporary folder is the COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE="The PHP temporary folder is not writeable." COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC="The PHP temporary folder is not writeable by the Joomla! instance, which may cause issues when attempting to upload extensions to Joomla. If you are having issues uploading extensions, check the '%s' and set it to be writeable and see if this fixes the issue." COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE="Small PHP maximum POST size." -COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC="The maximum POST size sets the most amount of data that can be sent via POST to the server. This includes form submissions for articles, media (images, videos) and extensions. This value is less than 8MB which may impact on uploading large extensions. This is set in the php.ini under post_max_size." +COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC="The maximum POST size sets the most amount of data that can be sent via POST to the server. This includes form submissions for articles, media (images, videos) and packages. This value is less than 8MB which may impact on uploading large packages. This is set in the php.ini under post_max_size." COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE="Maximum PHP file upload size is too small: This is set in php.ini in both upload_max_filesize and post_max_size settings of your PHP settings (located in php.ini and/or .htaccess file)." -COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC="The maximum file size for uploads is set to less than 8MB which may impact on uploading large extensions." +COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC="The maximum file size for uploads is set to less than 8MB which may impact on uploading large packages." COM_INSTALLER_MSG_WARNINGS_UPDATE_NOTICE="Before updating ensure that the update is compatible with your Joomla! installation." COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST="PHP Upload Size bigger than POST size." COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC="The value of the upload_max_filesize in the php.ini file is greater than the post_max_size variable. The post_max_size variable will take precedence and block requests larger than it. This is generally a server misconfiguration when trying to increase upload sizes. Please increase the upload_max_filesize to at least match the post_max_size variable or vice versa." @@ -236,6 +238,7 @@ COM_INSTALLER_TYPE_TYPE_PACKAGE="package" COM_INSTALLER_TYPE_TYPE_PLUGIN="plugin" COM_INSTALLER_TYPE_TYPE_TEMPLATE="template" COM_INSTALLER_UNABLE_TO_FIND_INSTALL_PACKAGE="Unable to find install package" +COM_INSTALLER_UNABLE_TO_INSTALL_JOOMLA_PACKAGE="The Joomla package cannot be installed through the Extension Manager. Please use the Joomla! Update component to update Joomla." COM_INSTALLER_UNINSTALL_ERROR="Error uninstalling %s." COM_INSTALLER_UNINSTALL_LANGUAGE="A language should always have been installed as a package.
    To uninstall a language, filter type by package and uninstall the package." COM_INSTALLER_UNINSTALL_SUCCESS="Uninstalling the %s was successful." @@ -255,7 +258,7 @@ COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE="N/A" COM_INSTALLER_VALUE_FOLDER_SELECT="- Select Folder -" COM_INSTALLER_VALUE_STATE_SELECT="- Select Status -" COM_INSTALLER_VALUE_TYPE_SELECT="- Select Type -" -COM_INSTALLER_WEBINSTALLER_INSTALL_OBSOLETE="The Install from Web plugin has become obsolete and needs to be updated." +COM_INSTALLER_WEBINSTALLER_INSTALL_OBSOLETE="The Install from Web plugin needs to be updated." COM_INSTALLER_WEBINSTALLER_INSTALL_UPDATE_AVAILABLE="There is a new update available for the Install from Web plugin. It is advisable that you update as soon as possible." COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM="Please confirm the installation by selecting the Install button" COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM_NAME="Extension Name" diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini index 11ac6e90031c8..ded8bf033633d 100644 --- a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini +++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini @@ -3,6 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +COM_JOOMLAUPDATE_CHECKED_UPDATES="Checked for updates." COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_DESC="This is a custom XML update source URL, used only when the "Update Source" option is set to "Custom URL"." COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_LABEL="Custom URL" COM_JOOMLAUPDATE_CONFIG_SOURCES_DESC="Configure where Joomla gets its update information from." @@ -15,9 +16,13 @@ COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_LABEL="Update Channel" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT="Joomla Next" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING="Testing" COM_JOOMLAUPDATE_CONFIGURATION="Joomla Update: Options" +COM_JOOMLAUPDATE_FAILED_TO_CHECK_UPDATES="Failed to check for updates." +COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates" COM_JOOMLAUPDATE_OVERVIEW="Joomla Update" COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP="Cleaning up after installation." COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE="Update to version %s is complete." +COM_JOOMLAUPDATE_UPDATE_LOG_CONFIRM_FINALISE="The confirm for the finalise step has successfully passed." +COM_JOOMLAUPDATE_UPDATE_LOG_CONFIRM_FINALISE_FAIL="The confirm of the finalise step has failed" COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES="Deleting removed files and folders." COM_JOOMLAUPDATE_UPDATE_LOG_FILE="File %s successfully downloaded." COM_JOOMLAUPDATE_UPDATE_LOG_FINALISE="Finalising installation." @@ -28,13 +33,16 @@ COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING="Joomla Version Update Status" COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been successfully updated. Your Joomla version is now %s." COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS="Downloading update file. Please wait ..." COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL" -COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. There are two possibilities why this happens:
    - Your host doesn't support the minimum requirements for Joomla %1$s and there is no alternative download for your configuration available.
    - There is a problem with Joomla Update Server.

    Please try to download the update package from the official Joomla download page and use the Upload and Update tab." +COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. There are two possibilities why this happens:
    - Your host doesn't support the minimum requirements for Joomla %1$s and there is no alternative download for your configuration available.
    - There is a problem with the Joomla Update Server.

    Please try to download the update package from the official Joomla download page and use the Upload and Update tab." +COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="Live Update is not available" +COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="There is a new version of the Joomla Update Component that needs to be installed first. Click here to update the component." COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP Root" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_HOSTNAME="FTP Host" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PASSWORD="FTP Password" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PORT="FTP Port" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_USERNAME="FTP Username" COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL="Additional Information" +COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST="You must update to the latest version of the Joomla Update Component before you can install the Joomla Core Update!" COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLAGAIN="Reinstall Joomla core files" COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version" COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Install the Update" @@ -55,12 +63,15 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM="You are on the "%s" COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT="You are on the "%s" update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (3.x)" COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the "%s" update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (3.x) and you will also be notified when the future major release (4.x) will be available. Before upgrading to 4.x you'll need to assess its compatibility with your environment." COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the "%s" update channel. This channel is designed for testing new releases and fixes in Joomla.
    It is only intended for JBS (Joomla Bug Squad™) members and others within the Joomla community who are testing. Do not use this setting on a production site." -COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla Upgrade Package in ZIP format from the official Joomla download page. Then use the fields below to upload and install it." +COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla Upgrade Package in ZIP format from the official Joomla download page. Then use the fields below to upload and install it." COM_JOOMLAUPDATE_VIEW_PROGRESS="Update progress" COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted" COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESREAD="Bytes read" COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED="Download of update package failed." COM_JOOMLAUPDATE_VIEW_UPDATE_FILESEXTRACTED="Files extracted" +COM_JOOMLAUPDATE_VIEW_UPDATE_FINALISE_CONFIRM_AND_CONTINUE="Confirm & Continue" +COM_JOOMLAUPDATE_VIEW_UPDATE_FINALISE_HEAD="Joomla Update is finishing and cleaning up" +COM_JOOMLAUPDATE_VIEW_UPDATE_FINALISE_HEAD_DESC="To complete the update Process please confirm your identity by re-entering the login information for your site "%s" below." COM_JOOMLAUPDATE_VIEW_UPDATE_INPROGRESS="Updating your Joomla files. Please wait ..." COM_JOOMLAUPDATE_VIEW_UPDATE_PERCENT="Percent complete" COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY="Make sure that the update file you have uploaded comes from the official Joomla download page. Afterwards, please confirm that you want to install it by re-entering the login information for your site "%s" below." diff --git a/administrator/language/en-GB/en-GB.com_languages.ini b/administrator/language/en-GB/en-GB.com_languages.ini index c7ff29c010079..d58d7470a9af7 100644 --- a/administrator/language/en-GB/en-GB.com_languages.ini +++ b/administrator/language/en-GB/en-GB.com_languages.ini @@ -11,30 +11,30 @@ COM_LANGUAGES_ERROR_LANG_TAG="
    The Language Tag should contain 2 or 3 lower COM_LANGUAGES_ERROR_LANGUAGE_METAFILE_MISSING="Could not load %s language meta XML file from %s." COM_LANGUAGES_ERR_PUBLISH="Select a language to publish." COM_LANGUAGES_FIELD_DESCRIPTION_DESC="Enter a description for the language." -COM_LANGUAGES_FIELD_IMAGE_DESC="Prefix of the image file for this language when using the "Use image flags" Language Switcher basic option. Example: if 'en' is chosen, then the image will be en.gif. Images and CSS for this module are in media/mod_languages/." -COM_LANGUAGES_FIELD_IMAGE_LABEL="Image Prefix" -COM_LANGUAGES_FIELD_LANG_TAG_DESC="Enter the language tag – example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed." +COM_LANGUAGES_FIELD_IMAGE_DESC="Name of the image file for this language when using the "Use image flags" Language Switcher basic option. Example: if 'en' is chosen, then the image will be en.gif. Images and CSS for this module are in media/mod_languages/." +COM_LANGUAGES_FIELD_IMAGE_LABEL="Image" +COM_LANGUAGES_FIELD_LANG_TAG_DESC="Enter the language tag – example: en-GB for English (en-GB). This should be the exact prefix used for the language installed or to be installed." COM_LANGUAGES_FIELD_LANG_TAG_LABEL="Language Tag" COM_LANGUAGES_INSTALL="Install Languages" COM_LANGUAGES_INSTALLED_FILTER_SEARCH_DESC="Search in title and language tag." COM_LANGUAGES_INSTALLED_FILTER_SEARCH_LABEL="Search Installed Languages" COM_LANGUAGES_OVERRIDE_ERROR_RESERVED_WORDS="YES, NO, NULL, FALSE, ON, OFF, NONE, TRUE are reserved words and can't be used as language constants." -COM_LANGUAGES_OVERRIDE_FIELD_BOTH_LABEL="For both locations" +COM_LANGUAGES_OVERRIDE_FIELD_BOTH_LABEL="For Both Locations" COM_LANGUAGES_OVERRIDE_FIELD_BOTH_DESC="If this box is checked the override will be stored for both administrator (Backend) and site (Frontend). This is essential for creating language overrides for some plugins because their language files, while stored in backend, are also used in frontend (example: plg_content_vote).
    Please note that the two overrides will be completely independent from each other after storing them." COM_LANGUAGES_OVERRIDE_FIELD_CLIENT_LABEL="Location" -COM_LANGUAGES_OVERRIDE_FIELD_CLIENT_DESC="Indicates whether the override is created for the site (Frontend) or Administrator (Backend) client." +COM_LANGUAGES_OVERRIDE_FIELD_CLIENT_DESC="Indicates if the override is created for the site (Frontend) or Administrator (Backend) client." COM_LANGUAGES_OVERRIDE_FIELD_FILE_LABEL="File" COM_LANGUAGES_OVERRIDE_FIELD_FILE_DESC="Language overrides are stored in a specific INI file (as it's the case for the original texts, too). Here you can see in which file the current override is stored." COM_LANGUAGES_OVERRIDE_FIELD_LANGUAGE_LABEL="Language" COM_LANGUAGES_OVERRIDE_FIELD_LANGUAGE_DESC="Language for which the constant is overridden." COM_LANGUAGES_OVERRIDE_FIELD_KEY_LABEL="Language Constant" -COM_LANGUAGES_OVERRIDE_FIELD_KEY_DESC="The language constant of the string you want to override.
    All text on your site is identified by a specific language constant which you have to use for creating an override of the text.
    If you don't know the corresponding constant you can search for text you want to change on the right. By selecting the desired result the correct constant will automatically be inserted into the form." +COM_LANGUAGES_OVERRIDE_FIELD_KEY_DESC="The language constant of the string you want to override." COM_LANGUAGES_OVERRIDE_FIELD_OVERRIDE_LABEL="Text" COM_LANGUAGES_OVERRIDE_FIELD_OVERRIDE_DESC="Enter the text that you want to be displayed instead of the original one.
    Please note that there may be placeholders (eg %s, %d or %1$s) in the text which could be important (they will be replaced by other texts before displaying), so you should leave them in there." COM_LANGUAGES_OVERRIDE_FIELD_SEARCHSTRING_LABEL="Search Text" COM_LANGUAGES_OVERRIDE_FIELD_SEARCHSTRING_DESC="Please enter the text to search for here. It may be in any of the language files." COM_LANGUAGES_OVERRIDE_FIELD_SEARCHTYPE_LABEL="Search For" -COM_LANGUAGES_OVERRIDE_FIELD_SEARCHTYPE_DESC="Select whether you want to search for constant names or the values (the actual text)." +COM_LANGUAGES_OVERRIDE_FIELD_SEARCHTYPE_DESC="Select if you want to search for constant names or the values (the actual text)." COM_LANGUAGES_OVERRIDE_FIELD_SEARCHTYPE_CONSTANT="Constant" COM_LANGUAGES_OVERRIDE_FIELD_SEARCHTYPE_TEXT="Value" COM_LANGUAGES_FIELD_PUBLISHED_DESC="Whether this content language is published or not. If published, it will display as a choice in the Language Switcher module in Frontend." @@ -70,9 +70,9 @@ COM_LANGUAGES_HEADING_LANGUAGE_DESC="Language descending" COM_LANGUAGES_HEADING_LANG_CODE="URL Language Code" COM_LANGUAGES_HEADING_LANG_CODE_ASC="URL Language Code ascending" COM_LANGUAGES_HEADING_LANG_CODE_DESC="URL Language Code descending" -COM_LANGUAGES_HEADING_LANG_IMAGE="Image Prefix" -COM_LANGUAGES_HEADING_LANG_IMAGE_ASC="Image Prefix ascending" -COM_LANGUAGES_HEADING_LANG_IMAGE_DESC="Image Prefix descending" +COM_LANGUAGES_HEADING_LANG_IMAGE="Image" +COM_LANGUAGES_HEADING_LANG_IMAGE_ASC="Image ascending" +COM_LANGUAGES_HEADING_LANG_IMAGE_DESC="Image descending" COM_LANGUAGES_HEADING_LANG_TAG="Language Tag" COM_LANGUAGES_HEADING_LANG_TAG_ASC="Language Tag ascending" COM_LANGUAGES_HEADING_LANG_TAG_DESC="Language Tag descending" @@ -83,21 +83,21 @@ COM_LANGUAGES_HEADING_TITLE_NATIVE="Native Title" COM_LANGUAGES_HEADING_TITLE_NATIVE_ASC="Native Title ascending" COM_LANGUAGES_HEADING_TITLE_NATIVE_DESC="Native Title descending" COM_LANGUAGES_HOMEPAGE="Home" -COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED="Default Language Saved. This does not affect users that have chosen a specific language on their profile or on the login page.
    Warning! When using the multilingual functionality (ie when the plugin System - Languagefilter is enabled) the Site Default Language has to also be a published Content language." +COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED="Default Language Saved. This does not affect users that have chosen a specific language on their profile or on the login page.
    Warning! When using the multilingual functionality (ie when the plugin System - Language Filter is enabled) the Site Default Language also has to be a published Content language." COM_LANGUAGES_MSG_SWITCH_ADMIN_LANGUAGE_SUCCESS="The Administrator Language has been successfully switched to "%s"." COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR="Some of the contacts linked to the user %s are incorrect." COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR_TIP="Warning! A user/author should have only one contact to which is assigned language 'All' OR one contact for each published Content Language." COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_PUBLISHED="Published Content Languages" COM_LANGUAGES_MULTILANGSTATUS_ERROR_CONTENT_LANGUAGE="A Default Home page is assigned to the %s Content Language although a Site Language for this Content Language is not installed or published AND/OR the Content Language is not published." -COM_LANGUAGES_MULTILANGSTATUS_ERROR_LANGUAGE_TAG="The Content Language tag %s does not match the Site Language tag. Check that the Site Language is installed and published and the correct language tag is used for the Content Language. Example: for English(UK) both tags should be 'en-GB'." -COM_LANGUAGES_MULTILANGSTATUS_HOMES_MISSING="This site is set as a multilingual site. One or more of the Default Home pages for the published Content languages are missing although the Language Filter plugin is enabled OR/AND one or more Language Switcher modules are published." +COM_LANGUAGES_MULTILANGSTATUS_ERROR_LANGUAGE_TAG="The Content Language tag %s does not match the Site Language tag. Check that the Site Language is installed and published and the correct language tag is used for the Content Language. Example: for English (en-GB) both tags should be 'en-GB'." +COM_LANGUAGES_MULTILANGSTATUS_HOMES_MISSING="This site is set as a multilingual site. One or more of the Default Home pages for the published Content languages are missing although the Language Filter plugin is enabled AND/OR one or more Language Switcher modules are published." COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED="Published Default Home pages" COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_ALL="1 assigned to language 'All'." COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_INCLUDING_ALL="Published Default Home pages (including 1 assigned to language "All")." COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_PUBLISHED="Published Language Switcher Modules." COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_UNPUBLISHED="This site is set as a multilingual site, at least one Language Switcher module set to language "All" has to be published. Disregard this message if you do not use a language switcher module but direct links." COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER="Language Filter Plugin" -COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED="This site is set as a multilingual site. The Language Filter plugin is not enabled although one or more Language Switcher modules OR/AND one or more specific Content language Default Home pages are published." +COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED="This site is set as a multilingual site. The Language Filter plugin is not enabled although one or more Language Switcher modules AND/OR one or more specific Content language Default Home pages are published." COM_LANGUAGES_MULTILANGSTATUS_NONE="This site is not set as a multilingual site." COM_LANGUAGES_MULTILANGSTATUS_SITE_LANG_PUBLISHED="Published Site Languages" COM_LANGUAGES_MULTILANGSTATUS_USELESS_HOMES="This site is not set as a multilingual site.
    Note: at least one Default Home page is assigned to a Content Language. This will not break a monolingual site but is useless." @@ -107,8 +107,8 @@ COM_LANGUAGES_N_ITEMS_PUBLISHED="%d Content Languages successfully published." COM_LANGUAGES_N_ITEMS_PUBLISHED_1="%d Content Language successfully published." COM_LANGUAGES_N_ITEMS_TRASHED="%d Content Languages successfully trashed." COM_LANGUAGES_N_ITEMS_TRASHED_1="%d Content Language successfully trashed." -COM_LANGUAGES_N_ITEMS_UNPUBLISHED="%d Content Languages successfully unpublished.
    Warning! When using the multilingual functionality (ie when the plugin System - Languagefilter is enabled) the Site Default Language has to also be a published Content language." -COM_LANGUAGES_N_ITEMS_UNPUBLISHED_1="%d Content Language successfully unpublished.
    Warning! When using the multilingual functionality (ie when the plugin System - Languagefilter is enabled) the Site Default Language has to also be a published Content language." +COM_LANGUAGES_N_ITEMS_UNPUBLISHED="%d Content Languages successfully unpublished.
    Warning! When using the multilingual functionality (ie when the plugin System - Language Filter is enabled) the Site Default Language also has to be a published Content language." +COM_LANGUAGES_N_ITEMS_UNPUBLISHED_1="%d Content Language successfully unpublished.
    Warning! When using the multilingual functionality (ie when the plugin System - Language Filter is enabled) the Site Default Language also has to be a published Content language." COM_LANGUAGES_NO_ITEM_SELECTED="No languages selected." COM_LANGUAGES_SAVE_SUCCESS="Content Language successfully saved." COM_LANGUAGES_SEARCH_IN_TITLE="Search in title." diff --git a/administrator/language/en-GB/en-GB.com_media.ini b/administrator/language/en-GB/en-GB.com_media.ini index dea460eac939e..f9cb7e3fca0ce 100644 --- a/administrator/language/en-GB/en-GB.com_media.ini +++ b/administrator/language/en-GB/en-GB.com_media.ini @@ -91,8 +91,6 @@ COM_MEDIA_START_UPLOAD="Start Upload" COM_MEDIA_THUMBNAIL_VIEW="Thumbnail View" COM_MEDIA_TITLE="Image Title" COM_MEDIA_UPLOAD_COMPLETE="Upload Complete: %s" -COM_MEDIA_UPLOAD_FILES_NOLIMIT="Upload files (No maximum size)" -COM_MEDIA_UPLOAD_FILES="Upload files (Maximum Size: %s MB)" COM_MEDIA_UPLOAD_FILE="Upload file" COM_MEDIA_UPLOAD_SUCCESSFUL="Upload Successful" COM_MEDIA_UPLOAD="Upload" diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index f241d10363b6d..a5cc19b933338 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -4,7 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 COM_MENUS="Menus" -COM_MENUS_ADD_MENU_MODULE="Add a module for this menu." +COM_MENUS_ADD_MENU_MODULE="Add a module for this menu" COM_MENUS_ADVANCED_FIELDSET_LABEL="Advanced" COM_MENUS_BASIC_FIELDSET_LABEL="Options" COM_MENUS_BATCH_MENU_ITEM_CANNOT_CREATE="You are not allowed to create new menu items." @@ -12,11 +12,14 @@ COM_MENUS_BATCH_MENU_ITEM_CANNOT_EDIT="You are not allowed to edit menu items." COM_MENUS_BATCH_MENU_LABEL="To Move or Copy your selection please select a Menu or parent item." COM_MENUS_BATCH_OPTIONS="Batch process the selected menu items" COM_MENUS_BATCH_TIP="If a menu or parent is selected for move/copy, any actions selected will be applied to the copied or moved menu items. Otherwise, all actions are applied to the selected menu items." +COM_MENUS_CHANGE_MENUITEM="Select or Change Menu Item" COM_MENUS_CONFIGURATION="Menus: Options" +COM_MENUS_EDIT_MENUITEM="Edit Menu Item" COM_MENUS_EDIT_MODULE_SETTINGS="Edit module settings" COM_MENUS_ERROR_ALL_LANGUAGE_ASSOCIATED="A menu item set to All languages can't be associated. Associations have not been set." COM_MENUS_ERROR_ALREADY_HOME="Menu item already set to home." COM_MENUS_ERROR_MENUTYPE="Please change the Menu type. The terms 'menu' and 'main' are reserved for Backend usage." +COM_MENUS_ERROR_MENUTYPE_NOT_FOUND="The Menu type doesn't exist." COM_MENUS_ERROR_ONE_HOME="Only one menu item can be a home link for each language." COM_MENUS_EXTENSION_PUBLISHED_DISABLED="Component disabled and menu item published." COM_MENUS_EXTENSION_PUBLISHED_ENABLED="Component enabled and menu item published." @@ -108,7 +111,7 @@ COM_MENUS_ITEM_FIELD_PAGE_TITLE_DESC="Optional text for the "Browser page t COM_MENUS_ITEM_FIELD_PAGE_TITLE_LABEL="Browser Page Title" COM_MENUS_ITEM_FIELD_PARENT_DESC="Select a parent item." COM_MENUS_ITEM_FIELD_PARENT_LABEL="Parent Item" -COM_MENUS_ITEM_FIELD_SECURE_DESC="Selects whether or not this link should use HTTPS (encrypted HTTP connections with the https:// protocol prefix). Note, you must have HTTPS enabled on your server to utilise this option." +COM_MENUS_ITEM_FIELD_SECURE_DESC="Selects if this link should use HTTPS (encrypted HTTP connections with the https:// protocol prefix). Note, you must have HTTPS enabled on your server to utilise this option." COM_MENUS_ITEM_FIELD_SECURE_LABEL="Secure" COM_MENUS_ITEM_FIELD_SHOW_PAGE_HEADING_DESC="Show or hide the Browser Page Title in the heading of the page ( If no optional text entered - will default to value based on the Menu Item Title ). The Page heading is usually displayed inside the "H1" tag." COM_MENUS_ITEM_FIELD_SHOW_PAGE_HEADING_LABEL="Show Page Heading" @@ -141,12 +144,14 @@ COM_MENUS_MENU_MENUTYPE_DESC="The system name of the menu." COM_MENUS_MENU_MENUTYPE_LABEL="Menu Type" COM_MENUS_MENU_SAVE_SUCCESS="Menu successfully saved" COM_MENUS_MENU_SEARCH_FILTER="Search in Title or Menu type" +COM_MENUS_MENU_SPRINTF="Menu: %s" COM_MENUS_TYPE_SYSTEM="System Links" COM_MENUS_MENU_TITLE_DESC="The title of the menu to display in the Administrator Menubar and lists." COM_MENUS_MENU_TYPE_NOT_ALLOWED="This is a reserved menutype." COM_MENUS_MENUS_FILTER_SEARCH_DESC="Search in title and menu type." COM_MENUS_MENUS_FILTER_SEARCH_LABEL="Search Menus" COM_MENUS_PAGE_OPTIONS_LABEL="Page Display" +COM_MENUS_LABEL_HIDDEN="Hidden" ; in the following string ; %1$s is for module title, %2$s is for access-title, %3$s is for position COM_MENUS_MODULE_ACCESS_POSITION="%1$s (%2$s in %3$s)" @@ -167,11 +172,13 @@ COM_MENUS_N_ITEMS_UNPUBLISHED="%d menu items successfully unpublished." COM_MENUS_N_ITEMS_UNPUBLISHED_1="%d menu item successfully unpublished." COM_MENUS_N_MENUS_DELETED="%d menu types successfully deleted." COM_MENUS_N_MENUS_DELETED_1="Menu type successfully deleted." +COM_MENUS_NEW_MENUITEM="New Menu Item" COM_MENUS_NO_ITEM_SELECTED="No menu items selected." COM_MENUS_NO_MENUS_SELECTED="No menu selected." COM_MENUS_OPTION_SELECT_LEVEL="- Select Max Levels -" COM_MENUS_REQUEST_FIELDSET_LABEL="Required Settings" COM_MENUS_SAVE_SUCCESS="Menu item successfully saved." +COM_MENUS_SELECT_A_MENUITEM="Select a Menu Item" COM_MENUS_SELECT_MENU="- Select Menu -" COM_MENUS_SELECT_MENU_FIRST="To use batch processing, please first select a Menu in the manager." COM_MENUS_SUBMENU_ITEMS="Menu Items" diff --git a/administrator/language/en-GB/en-GB.com_modules.ini b/administrator/language/en-GB/en-GB.com_modules.ini index 43ed668a74796..ca8ec8179c06a 100644 --- a/administrator/language/en-GB/en-GB.com_modules.ini +++ b/administrator/language/en-GB/en-GB.com_modules.ini @@ -34,7 +34,7 @@ COM_MODULES_FIELD_AUTOMATIC_TITLE_LABEL="Automatic Title" COM_MODULES_FIELD_AUTOMATIC_TITLE_DESC="Set yes if you want an automatic translated title. Its use depends on the Administrator template." COM_MODULES_FIELD_CACHE_TIME_DESC="The time in seconds before the module is recached." COM_MODULES_FIELD_CACHE_TIME_LABEL="Cache Time" -COM_MODULES_FIELD_CACHING_DESC="Select whether to cache the content of this module." +COM_MODULES_FIELD_CACHING_DESC="Use the global cache setting to cache the content of this module or disable caching for this module." COM_MODULES_FIELD_CACHING_LABEL="Caching" COM_MODULES_FIELD_CLIENT_ID_DESC="The location of the module, Frontend or Backend. You can't change this value." COM_MODULES_FIELD_CLIENT_ID_LABEL="Module Location" @@ -69,6 +69,7 @@ COM_MODULES_FIELD_MODULE_STYLE_LABEL="Module Style" COM_MODULES_FIELD_MODULE_STYLE_DESC="Use this option to override the template style for it's position." COM_MODULES_FIELDSET_RULES="Module Permissions" COM_MODULES_FILTER_SEARCH_DESC="Filter by position name." +COM_MODULES_GENERAL_FIELDSET_DESC="Configure module edit interface settings." COM_MODULES_HEADING_MODULE="Type" COM_MODULES_HEADING_MODULE_ASC="Type ascending" COM_MODULES_HEADING_MODULE_DESC="Type descending" @@ -116,6 +117,7 @@ COM_MODULES_N_MODULES_DUPLICATED="%d modules successfully duplicated." COM_MODULES_N_MODULES_DUPLICATED_1="%d module successfully duplicated." COM_MODULES_NO_ITEM_SELECTED="No modules selected." COM_MODULES_NODESCRIPTION="No description available." +COM_MODULES_NONE=":: None ::" COM_MODULES_OPTION_MENU_ALL="On all pages" COM_MODULES_OPTION_MENU_EXCLUDE="On all pages except those selected" COM_MODULES_OPTION_MENU_INCLUDE="Only on the pages selected" @@ -125,6 +127,7 @@ COM_MODULES_OPTION_POSITION_TEMPLATE_DEFINED="Template" COM_MODULES_OPTION_POSITION_USER_DEFINED="User" COM_MODULES_OPTION_SELECT_CLIENT="- Select Type -" COM_MODULES_OPTION_SELECT_MODULE="- Select Type -" +COM_MODULES_OPTION_SELECT_PAGE="- Select Page -" COM_MODULES_OPTION_SELECT_POSITION="- Select Position -" COM_MODULES_OPTION_SELECT_TYPE="- Select type -" COM_MODULES_POSITION_ANALYTICS="Analytics" diff --git a/administrator/language/en-GB/en-GB.com_modules.sys.ini b/administrator/language/en-GB/en-GB.com_modules.sys.ini index 108ccf04c7a5e..5d8ca27a4317d 100644 --- a/administrator/language/en-GB/en-GB.com_modules.sys.ini +++ b/administrator/language/en-GB/en-GB.com_modules.sys.ini @@ -6,5 +6,5 @@ COM_MODULES="Modules" COM_MODULES_GENERAL="General" COM_MODULES_REDIRECT_EDIT_DESC="Select if module editing should be opened in the site or administration interface." -COM_MODULES_REDIRECT_EDIT_LABEL="Edit module" +COM_MODULES_REDIRECT_EDIT_LABEL="Edit Module" COM_MODULES_XML_DESCRIPTION="Component for module management on the Backend." diff --git a/administrator/language/en-GB/en-GB.com_newsfeeds.ini b/administrator/language/en-GB/en-GB.com_newsfeeds.ini index 31d002c1a052d..3012b23de7b58 100644 --- a/administrator/language/en-GB/en-GB.com_newsfeeds.ini +++ b/administrator/language/en-GB/en-GB.com_newsfeeds.ini @@ -12,7 +12,10 @@ COM_NEWSFEEDS_CACHE_TIME_HEADING="Cache Time" COM_NEWSFEEDS_CACHE_TIME_HEADING_ASC="Cache Time ascending" COM_NEWSFEEDS_CACHE_TIME_HEADING_DESC="Cache Time descending" COM_NEWSFEEDS_CATEGORIES_DESC="These settings apply for News Feeds Categories Options unless they are changed for a specific menu item." +COM_NEWSFEEDS_CHANGE_FEED="Select or Change News Feed" +; COM_NEWSFEEDS_CHANGE_FEED_BUTTON is deprecated, use COM_NEWSFEEDS_CHANGE_FEED instead; COM_NEWSFEEDS_CHANGE_FEED_BUTTON="Select Feed" +COM_NEWSFEEDS_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Newsfeeds Component will integrate with other extensions." COM_NEWSFEEDS_CONFIGURATION="News Feed: Options" COM_NEWSFEEDS_EDIT_NEWSFEED="Edit News Feed" COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS="Another News feed from this category has the same alias (remember it may be a trashed item)." @@ -44,6 +47,7 @@ COM_NEWSFEEDS_FIELD_IMAGE_CAPTION_LABEL="Caption" COM_NEWSFEEDS_FIELD_LANGUAGE_DESC="Assign a language to this news feed." COM_NEWSFEEDS_FIELD_LINK_DESC="Link to the news feed. IDN (International) Links are converted to punycode when they are saved." COM_NEWSFEEDS_FIELD_LINK_LABEL="Link" +COM_NEWSFEEDS_FIELD_MODIFIED_BY_DESC="Name of the user who modified this news feed." COM_NEWSFEEDS_FIELD_MODIFIED_DESC="The date and time the news feed was last modified." COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_DESC="Show or hide the Number of Articles in each Feed (You can set this value in each News feed)." COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL="# Articles" @@ -86,7 +90,9 @@ COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL="Feed Display Options" COM_NEWSFEEDS_FILTER_SEARCH_DESC="Search in news feed title and alias. Prefix with ID: to search for a news feed ID." COM_NEWSFEEDS_FILTER_SEARCH_LABEL="Search News Feeds" COM_NEWSFEEDS_FLOAT_DESC="Controls placement of the image." +COM_NEWSFEEDS_FLOAT_FIRST_LABEL="First Image Float" COM_NEWSFEEDS_FLOAT_LABEL="Image Float" +COM_NEWSFEEDS_FLOAT_SECOND_LABEL="Second Image Float" COM_NEWSFEEDS_HEADING_ASSOCIATION="Association" COM_NEWSFEEDS_ITEM_ASSOCIATIONS_FIELDSET_LABEL="News Feed Item Association" COM_NEWSFEEDS_ITEM_ASSOCIATIONS_FIELDSET_DESC="Multilingual only! This choice will only display if the Language Filter parameter 'Item Associations' is set to 'Yes'. Choose a news feed item for the target language. This association will let the Language Switcher module redirect to the associated news feed item in another language. If used, make sure to display the Language switcher module on the concerned pages. A news feed item set to language 'All' can't be associated." @@ -118,7 +124,7 @@ COM_NEWSFEEDS_PUBLISH_ITEM="Publish News Feed" COM_NEWSFEEDS_RIGHT="Right" COM_NEWSFEEDS_SAVE_SUCCESS="News feed successfully saved." COM_NEWSFEEDS_SEARCH_IN_TITLE="Search" -COM_NEWSFEEDS_SELECT_A_FEED="Select feed" +COM_NEWSFEEDS_SELECT_A_FEED="Select a News Feed" COM_NEWSFEEDS_SELECT_FEED="Select feed" COM_NEWSFEEDS_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty - if it has no news feeds or subcategories." COM_NEWSFEEDS_SUBMENU_CATEGORIES="Categories" @@ -129,4 +135,4 @@ COM_NEWSFEEDS_UNPUBLISH_ITEM="Unpublish News Feed" COM_NEWSFEEDS_WARNING_PROVIDE_VALID_NAME="Please provide a valid name." COM_NEWSFEEDS_XML_DESCRIPTION="This component manages RSS and Atom news feeds." JGLOBAL_NEWITEMSLAST_DESC="New news feeds default to the last position. The ordering can be changed after this news feed has been saved." -JLIB_RULES_SETTING_NOTES="Changes apply to this component only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." \ No newline at end of file +JLIB_RULES_SETTING_NOTES="Changes apply to this component only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." diff --git a/administrator/language/en-GB/en-GB.com_newsfeeds.sys.ini b/administrator/language/en-GB/en-GB.com_newsfeeds.sys.ini index fa06b078d9e87..c14d1f3fe58b2 100644 --- a/administrator/language/en-GB/en-GB.com_newsfeeds.sys.ini +++ b/administrator/language/en-GB/en-GB.com_newsfeeds.sys.ini @@ -19,4 +19,6 @@ COM_NEWSFEEDS_FEEDS="Feeds" COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_DESC="Show a single news feed." COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_OPTION="Default" COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_TITLE="Single News Feed" +COM_NEWSFEEDS_TAGS_NEWSFEED="News Feed" +COM_NEWSFEEDS_TAGS_CATEGORY="News Feed Category" COM_NEWSFEEDS_XML_DESCRIPTION="This component manages RSS and Atom news feeds." diff --git a/administrator/language/en-GB/en-GB.com_plugins.ini b/administrator/language/en-GB/en-GB.com_plugins.ini index 0f6bb627acbc5..cd521451c0df7 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.ini @@ -38,7 +38,7 @@ COM_PLUGINS_OPTION_FOLDER="- Select Type -" COM_PLUGINS_PLUGIN="Plugin" COM_PLUGINS_PLUGINS="Plugins" COM_PLUGINS_SAVE_SUCCESS="Plugin successfully saved." -COM_PLUGINS_SEARCH_IN_TITLE="Search in plugin name. Prefix with ID: to search for a plugin ID" +COM_PLUGINS_SEARCH_IN_TITLE="Search in plugin name. Prefix with ID: to search for a plugin ID." COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla plugins." COM_PLUGINS_XML_ERR="Plugins XML data not available." JLIB_HTML_PUBLISH_ITEM="Enable plugin" diff --git a/administrator/language/en-GB/en-GB.com_postinstall.ini b/administrator/language/en-GB/en-GB.com_postinstall.ini index f1bf3195556c5..256f33b8fc9f0 100644 --- a/administrator/language/en-GB/en-GB.com_postinstall.ini +++ b/administrator/language/en-GB/en-GB.com_postinstall.ini @@ -14,5 +14,4 @@ COM_POSTINSTALL_LBL_RELEASENEWS="Release news Redirect System Plugin is disabled. Error page URLs will not be collected by this component." COM_REDIRECT_CONFIGURATION="Redirect: Options" COM_REDIRECT_DISABLE_LINK="Disable Link" COM_REDIRECT_EDIT_LINK="Edit Link #%d" @@ -78,8 +78,7 @@ COM_REDIRECT_N_LINKS_UPDATED_1="1 link has been updated." COM_REDIRECT_NEW_LINK="New Link" COM_REDIRECT_NO_ITEM_ADDED="No links added." COM_REDIRECT_NO_ITEM_SELECTED="No links selected." -; Change 'System%20-%20Redirect' to the value in plg_system_redirect.sys.ini for your language -COM_REDIRECT_PLUGIN_DISABLED="The Redirect Plugin is disabled. Enable it in the Plugin Manager." +COM_REDIRECT_PLUGIN_DISABLED="The Redirect System Plugin is disabled. It needs to be enabled for this component to work." COM_REDIRECT_PLUGIN_ENABLED="The Redirect Plugin is enabled." COM_REDIRECT_REDIRECTED_ON="Redirected on: %s." COM_REDIRECT_SAVE_SUCCESS="Link successfully saved." diff --git a/administrator/language/en-GB/en-GB.com_search.ini b/administrator/language/en-GB/en-GB.com_search.ini index 8e694c7eac871..e6e2fa125ed13 100644 --- a/administrator/language/en-GB/en-GB.com_search.ini +++ b/administrator/language/en-GB/en-GB.com_search.ini @@ -4,9 +4,9 @@ ; Note : All ini files need to be saved as UTF-8 COM_SEARCH="Search" -COM_SEARCH_ALL_WORDS="All words" +COM_SEARCH_ALL_WORDS="All Words" COM_SEARCH_ALPHABETICAL="Alphabetical" -COM_SEARCH_ANY_WORDS="Any words" +COM_SEARCH_ANY_WORDS="Any Words" COM_SEARCH_CONFIG_FIELD_CREATED_DATE_DESC="Show created date." COM_SEARCH_CONFIG_FIELD_CREATED_DATE_LABEL="Created Date" COM_SEARCH_CONFIG_GATHER_SEARCH_STATISTICS_DESC="Record the search phrases submitted by visitors." @@ -39,8 +39,8 @@ COM_SEARCH_NEWEST_FIRST="Newest First" COM_SEARCH_NO_RESULTS="Off" COM_SEARCH_OLDEST_FIRST="Oldest First" COM_SEARCH_ORDERING_DESC="Defines what ordering results are listed in." -COM_SEARCH_ORDERING_LABEL="Results ordering" -COM_SEARCH_SAVED_SEARCH_OPTIONS="Saved search options" +COM_SEARCH_ORDERING_LABEL="Results Ordering" +COM_SEARCH_SAVED_SEARCH_OPTIONS="Default Search Options" COM_SEARCH_SEARCH_IN_PHRASE="Search in phrases." COM_SEARCH_SHOW_SEARCH_RESULTS="Show Search Results" COM_SEARCH_XML_DESCRIPTION="Component for search functions." diff --git a/administrator/language/en-GB/en-GB.com_tags.ini b/administrator/language/en-GB/en-GB.com_tags.ini index 41cea0401ce5a..20d264ab81f7e 100644 --- a/administrator/language/en-GB/en-GB.com_tags.ini +++ b/administrator/language/en-GB/en-GB.com_tags.ini @@ -37,6 +37,10 @@ COM_TAGS_CONFIG_TAG_SETTINGS_LABEL="Tagged Items" COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_DESC="Choose a default layout for tagged items. This layout will be used when a user selects a tag that doesn't have a menu item defined." COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_LABEL="Default Tagged Items Layout" COM_TAGS_CONFIGURATION="Tags: Options" +COM_TAGS_COUNT_ARCHIVED_ITEMS="Archived items" +COM_TAGS_COUNT_PUBLISHED_ITEMS="Published items" +COM_TAGS_COUNT_TRASHED_ITEMS="Trashed items" +COM_TAGS_COUNT_UNPUBLISHED_ITEMS="Unpublished items" COM_TAGS_DELETE_NOT_ALLOWED="Delete not allowed for tag %s." COM_TAGS_DESCRIPTION_DESC="Enter an optional tag description in the text area." COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)." @@ -46,6 +50,7 @@ COM_TAGS_FIELD_CONFIG_TAGDESCRIPTION_DESC="Configure com_tags." COM_TAGS_FIELD_CONFIG_TAGDESCRIPTION_LABEL="Tags" COM_TAGS_FIELD_CONTENT_TYPE_DESC="Only tagged items of these types will be displayed." COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types" +COM_TAGS_FIELD_CREATED_DATE_DESC="The date and time that the tag was created." COM_TAGS_FIELD_FULL_DESC="Select or upload an image that will be displayed in the single tag view." COM_TAGS_FIELD_FULL_LABEL="Full Image" COM_TAGS_FIELD_HITS_DESC="Number of hits for this tag." @@ -61,6 +66,7 @@ COM_TAGS_FIELD_ITEM_BODY_DESC="Show the body for each item." COM_TAGS_FIELD_LANGUAGE_DESC="Assign a language to this tag." COM_TAGS_FIELD_LANGUAGE_FILTER_DESC="Optionally filter the list of tags based on language." COM_TAGS_FIELD_LANGUAGE_FILTER_LABEL="Language Filter" +COM_TAGS_FIELD_MODIFIED_DESC="The date and time that the tag was last modified." COM_TAGS_FIELD_NOTE_DESC="An optional note to display in the tag list." COM_TAGS_FIELD_NOTE_LABEL="Note" COM_TAGS_FIELD_NUMBER_ITEMS_LIST_DESC="Default number of tagged items to list on a page." @@ -129,6 +135,7 @@ COM_TAGS_RIGHT="Right" COM_TAGS_SAVE_SUCCESS="Tag successfully saved." COM_TAGS_SEARCH_TYPE_DESC="All will return items that have all of the tags. Any will return items that have at least one of the tags." COM_TAGS_SEARCH_TYPE_LABEL="Match Type" +COM_TAGS_SELECT_TAGTYPE="- Select Tag Type -" COM_TAGS_SHOW_ALL_TAGS_DESCRIPTION_DESC="Optional description to show at the top of the all tags list." COM_TAGS_SHOW_ALL_TAGS_DESCRIPTION_LABEL="Heading Description" COM_TAGS_SHOW_ALL_TAGS_IMAGE_DESC="Shows an image at the heading of the tags list." @@ -161,11 +168,15 @@ COM_TAGS_TAG_LIST_ITEM_DESCRIPTION_DESC="Shows the body text for the individual COM_TAGS_TAG_LIST_ITEM_HITS_DESC="Shows the number of hits for each individual item." COM_TAGS_TAG_LIST_MEDIA_DESC="Select or upload the tag image (full image)." COM_TAGS_TAG_LIST_MEDIA_LABEL="Image" +COM_TAGS_TAG_LIST_SHOW_DATE_DESC="Show Date" +COM_TAGS_TAG_LIST_SHOW_DATE_LABEL="Show or hide a date column in the compact list layout. Select Hide to hide the date, or select which date you wish to show." +COM_TAGS_TAG_LIST_SHOW_HEADINGS_DESC="Show or hide the headings in the compact list layout." +COM_TAGS_TAG_LIST_SHOW_HEADINGS_LABEL="Table Headings" COM_TAGS_TAG_LIST_SHOW_ITEM_IMAGE_DESC="Shows the image for each item." COM_TAGS_TAG_LIST_SHOW_ITEM_IMAGE_LABEL="Item Image" -COM_TAGS_TAG_LIST_SHOW_ITEM_DESCRIPTION_DESC="Whether to show or hide the description for each item in the list. The length may be limited using the Maximum Characters option." +COM_TAGS_TAG_LIST_SHOW_ITEM_DESCRIPTION_DESC="Show or hide the description for each item in the list. The length may be limited using the Maximum Characters option." COM_TAGS_TAG_LIST_SHOW_ITEM_DESCRIPTION_LABEL="Item Description" -COM_TAGS_TAG_VIEW_LIST_DESC="Displays a compact list of items that have been tagged with the selected tags." +COM_TAGS_TAG_VIEW_LIST_DESC="Displays a compact list of items with the selected tags." COM_TAGS_TAG_VIEW_LIST_OPTION="List view options" COM_TAGS_TAG_VIEW_LIST_TITLE="Tagged items list" COM_TAGS_TAGGED_ITEMS_ACCESS="Access" diff --git a/administrator/language/en-GB/en-GB.com_templates.ini b/administrator/language/en-GB/en-GB.com_templates.ini index 9c68bfb3e07fe..c93edfa3a2f50 100644 --- a/administrator/language/en-GB/en-GB.com_templates.ini +++ b/administrator/language/en-GB/en-GB.com_templates.ini @@ -31,13 +31,13 @@ COM_TEMPLATES_COMPILE_ERROR="An error occurred. Failed to compile." COM_TEMPLATES_COMPILE_LESS="You should compile %s to generate a CSS file." COM_TEMPLATES_COMPILE_SUCCESS="Successfully compiled LESS." COM_TEMPLATES_CONFIG_FIELDSET_DESC="Global configuration for templates." -COM_TEMPLATES_CONFIG_POSITIONS_DESC="Enable the preview of the module positions in the template by appending tp=1 to the web address. Also enables the Preview button in the list of templates. Please refresh the page after changing this setting." +COM_TEMPLATES_CONFIG_POSITIONS_DESC="Enable the preview of the module positions in the template by appending tp=1 to the web address. Also enables the Preview button in the list of templates." COM_TEMPLATES_CONFIG_POSITIONS_LABEL="Preview Module Positions" COM_TEMPLATES_CONFIG_FONT_DESC="These file types will be available for font preview." COM_TEMPLATES_CONFIG_FONT_LABEL="Valid Font Formats" COM_TEMPLATES_CONFIG_IMAGE_DESC="These file types will be available for cropping and resizing." COM_TEMPLATES_CONFIG_IMAGE_LABEL="Valid Image Formats" -COM_TEMPLATES_CONFIG_SOURCE_DESC="These file types will be available for editing in editor." +COM_TEMPLATES_CONFIG_SOURCE_DESC="These file types will be available for editing." COM_TEMPLATES_CONFIG_SOURCE_LABEL="Valid Source Formats" COM_TEMPLATES_CONFIG_SUPPORTED_DESC="Be careful before changing the file types. Read the tool tips before editing." COM_TEMPLATES_CONFIG_SUPPORTED_LABEL="Supported File Formats" @@ -116,7 +116,7 @@ COM_TEMPLATES_FILE_NEW_NAME_LABEL="Copied File Name" COM_TEMPLATES_FILE_EXISTS="File with the same name already exists." COM_TEMPLATES_FILE_INFO="File Information" COM_TEMPLATES_FILE_NAME="File Name" -COM_TEMPLATES_FILE_PERMISSIONS="The File Permissions are " +COM_TEMPLATES_FILE_PERMISSIONS="The File Permissions are %s" COM_TEMPLATES_FILE_RENAME_ERROR="An error occurred renaming the file." COM_TEMPLATES_FILE_RENAME_SUCCESS="File renamed successfully." COM_TEMPLATES_FILE_RESIZE_ERROR="Failed to resize image." @@ -165,15 +165,15 @@ COM_TEMPLATES_MANAGER_EDIT_FILE="Templates: Edit File" COM_TEMPLATES_MANAGER_EDIT_STYLE="Templates: Edit Style" COM_TEMPLATES_MANAGE_FOLDERS="Manage Folders" COM_TEMPLATES_MANAGER_STYLES="Templates: Styles" -COM_TEMPLATES_MANAGER_STYLES_ADMIN="Templates: Styles (Admin)" +COM_TEMPLATES_MANAGER_STYLES_ADMIN="Templates: Styles (Administrator)" COM_TEMPLATES_MANAGER_STYLES_SITE="Templates: Styles (Site)" COM_TEMPLATES_MANAGER_TEMPLATES="Templates" -COM_TEMPLATES_MANAGER_TEMPLATES_ADMIN="Templates: Templates (Admin)" +COM_TEMPLATES_MANAGER_TEMPLATES_ADMIN="Templates: Templates (Administrator)" COM_TEMPLATES_MANAGER_TEMPLATES_SITE="Templates: Templates (Site)" -COM_TEMPLATES_MANAGER_VIEW_TEMPLATE="Templates: Customise" +COM_TEMPLATES_MANAGER_VIEW_TEMPLATE="Templates: Customise (%s)" COM_TEMPLATES_MENU_CHANGED_1="1 menu item has been assigned or unassigned to this style." COM_TEMPLATES_MENU_CHANGED_MORE="%d menu items have been assigned or unassigned to this style." -COM_TEMPLATES_MENUS_ASSIGNMENT="Menus assignment" +COM_TEMPLATES_MENUS_ASSIGNMENT="Menu Assignment" COM_TEMPLATES_MODAL_FILE_DELETE="The file %s will be deleted." COM_TEMPLATES_MSG_MANAGE_NO_STYLES="There are no styles installed matching your query." COM_TEMPLATES_MSG_MANAGE_NO_TEMPLATES="There are no templates installed matching your query." diff --git a/administrator/language/en-GB/en-GB.com_users.ini b/administrator/language/en-GB/en-GB.com_users.ini index 5e1bc4f4c7ec5..933b516f5b32d 100644 --- a/administrator/language/en-GB/en-GB.com_users.ini +++ b/administrator/language/en-GB/en-GB.com_users.ini @@ -32,14 +32,14 @@ COM_USERS_CONFIG_FIELD_ALLOWREGISTRATION_DESC="If set to Yes, new Users are allo COM_USERS_CONFIG_FIELD_ALLOWREGISTRATION_LABEL="Allow User Registration" COM_USERS_CONFIG_FIELD_CAPTCHA_DESC="Select the captcha plugin that will be used in the registration, password and username reminder forms. You may need to enter required information for your captcha plugin in the Plugin Manager.
    If 'Use Default' is selected, make sure a captcha plugin is selected in Global Configuration." COM_USERS_CONFIG_FIELD_CAPTCHA_LABEL="Captcha" -COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_DESC="Allow users to change their Login name when editing their profile." -COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_LABEL="Change Login Name" +COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_DESC="Allow users to change their Username when editing their profile." +COM_USERS_CONFIG_FIELD_CHANGEUSERNAME_LABEL="Change Username" COM_USERS_CONFIG_FIELD_FRONTEND_LANG_DESC="If 'Frontend User Parameters' is set to 'Show', users will be able to select their Frontend language preference when registering." COM_USERS_CONFIG_FIELD_FRONTEND_LANG_LABEL="Frontend Language" COM_USERS_CONFIG_FIELD_FRONTEND_RESET_COUNT_DESC="The maximum number of password resets allowed within the time period. Zero indicates no limit." COM_USERS_CONFIG_FIELD_FRONTEND_RESET_COUNT_LABEL="Maximum Reset Count" COM_USERS_CONFIG_FIELD_FRONTEND_RESET_TIME_DESC="The time period, in hours, for the reset counter." -COM_USERS_CONFIG_FIELD_FRONTEND_RESET_TIME_LABEL="Time in Hours" +COM_USERS_CONFIG_FIELD_FRONTEND_RESET_TIME_LABEL="Reset Time" COM_USERS_CONFIG_FIELD_FRONTEND_USERPARAMS_DESC="If set to Show, Users will be able to select their language, editor and Help Site preferences on their details screen when logged-in to the Frontend." COM_USERS_CONFIG_FIELD_FRONTEND_USERPARAMS_LABEL="Frontend User Parameters" COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_DESC="The default Group that will be applied to Guest (not logged-in) Users." @@ -47,15 +47,15 @@ COM_USERS_CONFIG_FIELD_GUEST_USER_GROUP_LABEL="Guest User Group" COM_USERS_CONFIG_FIELD_MAILBODY_SUFFIX_DESC="This is added after the mail text." COM_USERS_CONFIG_FIELD_MAILBODY_SUFFIX_LABEL="Mailbody Suffix" COM_USERS_CONFIG_FIELD_MAILTOADMIN_DESC="If set to Yes then a notification mail will be sent to administrators if 'New User Account Activation' is set to 'None' or 'Self'." -COM_USERS_CONFIG_FIELD_MAILTOADMIN_LABEL="Notification Mail to Administrators" -COM_USERS_CONFIG_FIELD_MINIMUM_INTEGERS="Password Minimum Integers" +COM_USERS_CONFIG_FIELD_MAILTOADMIN_LABEL="Send Mail to Administrators" +COM_USERS_CONFIG_FIELD_MINIMUM_INTEGERS="Minimum Integers" COM_USERS_CONFIG_FIELD_MINIMUM_INTEGERS_DESC="Set the minimum number of integers that must be included in a password." -COM_USERS_CONFIG_FIELD_MINIMUM_PASSWORD_LENGTH="Password Minimum Length" +COM_USERS_CONFIG_FIELD_MINIMUM_PASSWORD_LENGTH="Minimum Length" COM_USERS_CONFIG_FIELD_MINIMUM_PASSWORD_LENGTH_DESC="Set the minimum length for a password." -COM_USERS_CONFIG_FIELD_MINIMUM_SYMBOLS="Password Minimum Symbols" +COM_USERS_CONFIG_FIELD_MINIMUM_SYMBOLS="Minimum Symbols" COM_USERS_CONFIG_FIELD_MINIMUM_SYMBOLS_DESC="Set the minimum number of symbols (such as !@#$) required in a password." -COM_USERS_CONFIG_FIELD_MINIMUM_UPPERCASE="Password Minimum Upper Case" -COM_USERS_CONFIG_FIELD_MINIMUM_UPPERCASE_DESC="Set the minimum number of upper case ASCII characters required for a password." +COM_USERS_CONFIG_FIELD_MINIMUM_UPPERCASE="Minimum Upper Case" +COM_USERS_CONFIG_FIELD_MINIMUM_UPPERCASE_DESC="Set the minimum number of upper case alphabetical characters required for a password." COM_USERS_CONFIG_FIELD_NEW_USER_TYPE_DESC="The default group that will be applied to New Users Registering via the Frontend." COM_USERS_CONFIG_FIELD_NEW_USER_TYPE_LABEL="New User Registration Group" COM_USERS_CONFIG_FIELD_NOTES_HISTORY="User Notes History" @@ -68,7 +68,10 @@ COM_USERS_CONFIG_FIELD_USERACTIVATION_LABEL="New User Account Activation" COM_USERS_CONFIG_FIELD_USERACTIVATION_OPTION_ADMINACTIVATION="Administrator" COM_USERS_CONFIG_FIELD_USERACTIVATION_OPTION_SELFACTIVATION="Self" COM_USERS_CONFIG_IMPORT_FAILED="An error was encountered while importing the configuration: %s." +COM_USERS_CONFIG_INTEGRATION_SETTINGS_DESC="These settings determine how the Users Component will integrate with other extensions." +COM_USERS_CONFIG_PASSWORD_OPTIONS="Password Options" COM_USERS_CONFIG_SAVE_FAILED="An error was encountered while saving the configuration: %s." +COM_USERS_CONFIG_USER_OPTIONS="User Options" COM_USERS_CONFIGURATION="Users: Options" COM_USERS_COUNT_ENABLED_USERS="Enabled users" COM_USERS_COUNT_DISABLED_USERS="Disabled users" @@ -112,6 +115,9 @@ COM_USERS_FIELD_STATE_DESC="Set publication status." COM_USERS_FIELD_SUBJECT_DESC="The subject line for the note." COM_USERS_FIELD_SUBJECT_LABEL="Subject" COM_USERS_FIELD_USER_ID_LABEL="User" +COM_USERS_FIELDS_USER_FIELDS_TITLE="Users: Fields" +COM_USERS_FIELDS_USER_FIELD_ADD_TITLE="Users: New Field" +COM_USERS_FIELDS_USER_FIELD_EDIT_TITLE="Users: Edit Field" COM_USERS_FILTER_ACTIVE="- Select Active State -" COM_USERS_FILTER_COMPONENT_LABEL="Component" COM_USERS_FILTER_COMPONENT_DESC="Component to debug." @@ -214,7 +220,7 @@ COM_USERS_MAIL_PLEASE_FILL_IN_THE_MESSAGE="Please enter a message" COM_USERS_MAIL_PLEASE_FILL_IN_THE_SUBJECT="Please enter a subject" COM_USERS_MAIL_PLEASE_SELECT_A_GROUP="Please select a Group" COM_USERS_MAIL_THE_MAIL_COULD_NOT_BE_SENT="The mail could not be sent." -COM_USERS_MASS_MAIL="Mass Mail" +COM_USERS_MASS_MAIL="Mass Mail Users" COM_USERS_MASS_MAIL_DESC="Mass Mail options." COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N="Password does not contain enough digits. At least %s digits are required." COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N_1="Password does not contain enough digits. At least 1 digit is required." @@ -273,7 +279,7 @@ COM_USERS_SEARCH_ASSETS="Search Assets" COM_USERS_SEARCH_GROUPS_LABEL="Search User Groups" COM_USERS_SEARCH_IN_GROUPS="Search in group title. Prefix with ID: to search for a group ID." COM_USERS_SEARCH_IN_NAME="Search in name, username or email. Prefix with ID: to search for a user ID." -COM_USERS_SEARCH_IN_NOTE_TITLE="Search in subject, name or username. Prefix with ID: or UID: to search for a note ID or user ID" +COM_USERS_SEARCH_IN_NOTE_TITLE="Search in subject, name or username. Prefix with ID: or UID: to search for a note ID or user ID." COM_USERS_SEARCH_IN_LEVEL_NAME="Search in level name. Prefix with ID: to search for an access level ID." COM_USERS_SEARCH_IN_ASSETS="Search in asset name or title." COM_USERS_SEARCH_TITLE_LEVELS="Search Access Levels" @@ -298,11 +304,13 @@ COM_USERS_USER_FIELD_BACKEND_LANGUAGE_DESC="Select the Language for the Administ COM_USERS_USER_FIELD_BACKEND_LANGUAGE_LABEL="Backend Language" COM_USERS_USER_FIELD_BACKEND_TEMPLATE_DESC="Select the template style for the Administrator Backend interface. This will only affect this User." COM_USERS_USER_FIELD_BACKEND_TEMPLATE_LABEL="Backend Template Style" -COM_USERS_USER_FIELD_BLOCK_DESC="Block this user." -COM_USERS_USER_FIELD_BLOCK_LABEL="Block this User" +COM_USERS_USER_FIELD_BLOCK="Blocked" +COM_USERS_USER_FIELD_BLOCK_DESC="Enable or Block this user." +COM_USERS_USER_FIELD_BLOCK_LABEL="User Status" COM_USERS_USER_FIELD_EDITOR_DESC="Editor for this user." COM_USERS_USER_FIELD_EDITOR_LABEL="Editor" COM_USERS_USER_FIELD_EMAIL_DESC="Enter an email address for the user." +COM_USERS_USER_FIELD_ENABLE="Enabled" COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_DESC="Select the Language for the Frontend interface. This will only affect this User." COM_USERS_USER_FIELD_FRONTEND_LANGUAGE_LABEL="Frontend Language" COM_USERS_USER_FIELD_HELPSITE_DESC="Help site for this user." @@ -341,6 +349,7 @@ COM_USERS_USER_SAVE_SUCCESS="User successfully saved." COM_USERS_USER_TWO_FACTOR_AUTH="Two Factor Authentication" COM_USERS_USERGROUP_DETAILS="User Group Details" COM_USERS_USERS_ERROR_CANNOT_BLOCK_SELF="You can't block yourself." +COM_USERS_USERS_ERROR_CANNOT_EDIT_OWN_GROUP="You can't edit your own user groups. User groups saving was skipped." COM_USERS_USERS_ERROR_CANNOT_DELETE_SELF="You can't delete yourself." COM_USERS_USERS_ERROR_CANNOT_DEMOTE_SELF="You can't remove your own Super User permissions." COM_USERS_USERS_ERROR_CANNOT_REQUIRERESET_SELF="You can't require a Password reset for yourself." @@ -363,3 +372,8 @@ COM_USERS_VIEW_NOTES_TITLE="User Notes" COM_USERS_VIEW_USERS_TITLE="Users" COM_USERS_XML_DESCRIPTION="Component for managing users" JLIB_RULES_SETTING_NOTES="Changes apply to this component only.
    Inherited - a Global Configuration setting or higher level setting is applied.
    Denied always wins - whatever is set at the Global or higher level and applies to all child elements.
    Allowed will enable the action for this component unless it is overruled by a Global Configuration setting." + +; Fields overrides +COM_USERS_USER_CATEGORIES_TITLE="Users: Field Groups" +COM_USERS_USER_CATEGORY_ADD_TITLE="Users: New Field Group" +COM_USERS_USER_CATEGORY_EDIT_TITLE="Users: Edit Field Group" diff --git a/administrator/language/en-GB/en-GB.com_users.sys.ini b/administrator/language/en-GB/en-GB.com_users.sys.ini index 7dd47064a906c..8e5a8e9f21e8e 100644 --- a/administrator/language/en-GB/en-GB.com_users.sys.ini +++ b/administrator/language/en-GB/en-GB.com_users.sys.ini @@ -28,4 +28,5 @@ COM_USER_RESET_VIEW_DEFAULT_DESC="Displays a request to reset password." COM_USER_RESET_VIEW_DEFAULT_OPTION="Default" COM_USER_RESET_VIEW_DEFAULT_TITLE="Password Reset" COM_USERS="Users" +COM_USERS_TAGS_CATEGORY="User Note Category" COM_USERS_XML_DESCRIPTION="Component for managing users." diff --git a/administrator/language/en-GB/en-GB.com_wrapper.ini b/administrator/language/en-GB/en-GB.com_wrapper.ini index e96db3eb0b0de..034c0e8358a68 100644 --- a/administrator/language/en-GB/en-GB.com_wrapper.ini +++ b/administrator/language/en-GB/en-GB.com_wrapper.ini @@ -7,12 +7,12 @@ COM_WRAPPER="Wrapper" COM_WRAPPER_FIELD_ADD_DESC="By default, http:// will be added unless it detects http:// or https:// in the URL you provide. This allows you to switch off this functionality." COM_WRAPPER_FIELD_ADD_LABEL="Auto Add" COM_WRAPPER_FIELD_FRAME_DESC="Show frame border which wrap the iframe." -COM_WRAPPER_FIELD_FRAME_LABEL="Frame border" +COM_WRAPPER_FIELD_FRAME_LABEL="Frame Border" COM_WRAPPER_FIELD_HEIGHT_DESC="Height of the iframe window in pixels." COM_WRAPPER_FIELD_HEIGHT_LABEL="Height" COM_WRAPPER_FIELD_HEIGHTAUTO_DESC="If height is set to auto, the height will automatically be set to the size of the external page. This will only work for pages on your own domain. If you see a JavaScript error, make sure this parameter is disabled. This will break XHTML compatibility for this page." COM_WRAPPER_FIELD_HEIGHTAUTO_LABEL="Auto Height" -COM_WRAPPER_FIELD_LABEL_SCROLLBARSPARAMS="Scroll bars parameters" +COM_WRAPPER_FIELD_LABEL_SCROLLBARSPARAMS="Scroll Bar Parameters" COM_WRAPPER_FIELD_SCROLLBARS_DESC="Show or hide the horizontal & vertical scrollbars. If you choose 'Auto', make sure the Auto advanced parameter is set." COM_WRAPPER_FIELD_SCROLLBARS_LABEL="Scroll Bars" COM_WRAPPER_FIELD_URL_DESC="URL to site/file you wish to display within the iframe." diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index a6335f740df2c..e66f89cbdf8d4 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -61,6 +61,7 @@ JCATEGORIES="Categories" JCATEGORY="Category" JCATEGORY_ASC="Category ascending" JCATEGORY_DESC="Category descending" +JCATEGORY_SPRINTF="Category: %s" JCLEAR="Clear" JCLIENT="Location" JCONFIG_PERMISSIONS_DESC="Default permissions used for all content in this component." @@ -84,6 +85,7 @@ JUNFEATURE="Unfeature" JHELP="Help" JHIDE="Hide" JINVALID_TOKEN="The most recent request was denied because it contained an invalid security token. Please refresh the page and try again." +JINVALID_TOKEN_NOTICE="The security token did not match. The request was aborted to prevent any security breach. Please try again." JLOGIN="Log in" JLOGOUT="Log out" JMODIFY="Modify" @@ -137,6 +139,8 @@ JACTION_EDIT="Edit" JACTION_EDIT_COMPONENT_DESC="Allows users in the group to edit any content in this extension." JACTION_EDITOWN="Edit Own" JACTION_EDITOWN_COMPONENT_DESC="Allows users in the group to edit any content they submitted in this extension." +JACTION_EDITVALUE="Edit Value" +JACTION_EDITVALUE_COMPONENT_DESC="Allows users in the group to edit any value of the item they submitted in this extension." JACTION_EDITSTATE="Edit State" JACTION_EDITSTATE_COMPONENT_DESC="Allows users in the group to change the state of any content in this extension." JACTION_LOGIN_ADMIN="Administrator Login" @@ -160,6 +164,7 @@ JERROR_CORE_DELETE_NOT_PERMITTED="Delete not permitted." JERROR_COULD_NOT_FIND_TEMPLATE="Could not find template "_QQ_"%s"_QQ_"." JERROR_INVALID_CONTROLLER="Invalid controller" JERROR_INVALID_CONTROLLER_CLASS="Invalid controller class" +JERROR_LAYOUT_PREVIOUS_ERROR="Previous Error" JERROR_LOADFILE_FAILED="Error loading form file" JERROR_LOADING_MENUS="Error loading Menus: %s" JERROR_LOGIN_DENIED="You do not have access to the Administrator section of this site." @@ -187,7 +192,7 @@ JFIELD_BASIS_LOGIN_DESCRIPTION_SHOW_LABEL="Login Description" JFIELD_BASIS_LOGOUT_DESCRIPTION_DESC="Text for logout page." JFIELD_BASIS_LOGOUT_DESCRIPTION_LABEL="Logout Description Text" JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_DESC="Show or hide logout description." -JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_LABEL="Logout Text" +JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_LABEL="Logout Description" JFIELD_CATEGORY_DESC="The category that this item is assigned to. You may select an existing category or enter a new category by typing the name in the field and pressing enter." JFIELD_ENABLED_DESC="The enabled status of this item." JFIELD_KEY_REFERENCE_DESC="Used to store information referring to an external resource." @@ -224,9 +229,9 @@ JFIELD_OPTION_NONE="None" JFIELD_ORDERING_DESC="Select the ordering." JFIELD_ORDERING_LABEL="Ordering" JFIELD_PARAMS_LABEL="Options" -JFIELD_PLG_SEARCH_ALL_DESC="Indicate whether to include published items in the search." +JFIELD_PLG_SEARCH_ALL_DESC="Include published items in the search." JFIELD_PLG_SEARCH_ALL_LABEL="Search Published" -JFIELD_PLG_SEARCH_ARCHIVED_DESC="Indicate whether to include archived items in the search." +JFIELD_PLG_SEARCH_ARCHIVED_DESC="Include archived items in the search." JFIELD_PLG_SEARCH_ARCHIVED_LABEL="Search Archived" JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC="Sets the maximum number of results to return." JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL="Search Limit" @@ -253,12 +258,14 @@ JGLOBAL_ALLOW_RATINGS_LABEL="Allow Ratings" JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC="Please enter in a numeric character limit value. The introtext will be trimmed to the number of characters you enter." JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL="Intro text Limit" JGLOBAL_ARCHIVE_OPTIONS="Archive" -JGLOBAL_ARTICLE_COUNT_DESC="Whether to show or hide a count of articles in each category." +JGLOBAL_ARTICLE_COUNT_DESC="Show or hide a count of articles in each category." JGLOBAL_ARTICLE_COUNT_LABEL="Article Count" JGLOBAL_ARTICLE_MANAGER_ORDER="Ordering" JGLOBAL_ARTICLE_ORDER_DESC="The order that articles will show in." JGLOBAL_ARTICLE_ORDER_LABEL="Article Order" JGLOBAL_ARTICLES="Articles" +JGLOBAL_ASSOC_NOT_POSSIBLE="To define associations, please make sure the item language is not set to 'All'." +JGLOBAL_ASSOCIATIONS_RESET_WARNING="The language has been changed. If you save this item again it will reset the available associations. If this was not intended, just close the item." JGLOBAL_AUTH_ACCESS_DENIED="Access Denied" JGLOBAL_AUTH_ACCESS_GRANTED="Access Granted" JGLOBAL_AUTH_BIND_FAILED="Failed binding to LDAP server" @@ -283,6 +290,7 @@ JGLOBAL_AUTHOR_ALPHABETICAL="Author Alphabetical" JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL="Author Reverse Alphabetical" JGLOBAL_AUTO="Auto" JGLOBAL_BATCH_MOVE_PARENT_NOT_FOUND="Can't find the destination parent for this move." +JGLOBAL_BATCH_MOVE_ROW_NOT_FOUND="Can't find the destination row for this move." JGLOBAL_BATCH_PROCESS="Process" JGLOBAL_BLOG="Blog" JGLOBAL_BLOG_LAYOUT_OPTIONS="Blog Layout" @@ -309,23 +317,25 @@ JGLOBAL_DATE_FORMAT_DESC="Optional format string for showing the date. For examp JGLOBAL_DATE_FORMAT_LABEL="Date Format" JGLOBAL_DESCRIPTION="Description" JGLOBAL_DISPLAY_NUM="Display #" -JGLOBAL_DISPLAY_SELECT_DESC="Whether to show or hide the Display Select dropdown listbox." +JGLOBAL_DISPLAY_SELECT_DESC="Show or hide the Display Select dropdown listbox." JGLOBAL_DISPLAY_SELECT_LABEL="Display Select" JGLOBAL_DOWN="Down" JGLOBAL_EDIT_ITEM="Edit item" JGLOBAL_EDIT_PREFERENCES="Edit Preferences" JGLOBAL_EMAIL="Email" -JGLOBAL_EMPTY_CATEGORIES_DESC="Whether to show or hide categories that contain no articles and no subcategories." +JGLOBAL_EMPTY_CATEGORIES_DESC="Show or hide categories that contain no articles and no subcategories." JGLOBAL_EMPTY_CATEGORIES_LABEL="Empty Categories" JGLOBAL_ERROR_INSUFFICIENT_BATCH_INFORMATION="Insufficient information to perform the batch operation" JGLOBAL_FEED_SHOW_READMORE_DESC="Displays a "Read More" link in the news feeds if Intro Text is set to Show." JGLOBAL_FEED_SHOW_READMORE_LABEL="Show "Read More"" JGLOBAL_FEED_SUMMARY_DESC="If set to Intro Text, only the Intro Text of each article will show in the news feed. If set to Full Text, the whole article will show in the news feed." JGLOBAL_FEED_SUMMARY_LABEL="For each feed item show" +JGLOBAL_FIELDS="Fields" +JGLOBAL_FIELD_GROUPS="Field Groups" JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC="Categories that are within this category will be displayed." JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL="Select a Top Level Category" -JGLOBAL_FIELD_CATEGORIES_DESC_DESC="If you enter some text in this field, it will override the Top Level Category Description, if it has one." -JGLOBAL_FIELD_CATEGORIES_DESC_LABEL="Top Level Category Description" +JGLOBAL_FIELD_CATEGORIES_DESC_DESC="If you enter some text in this field, it will replace the Top Level Category Description, if it has one." +JGLOBAL_FIELD_CATEGORIES_DESC_LABEL="Alternative Description" JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC="Uses another name than the author's for display." JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL="Author's Alias" JGLOBAL_FIELD_CREATED_BY_DESC="The user who created this." @@ -348,7 +358,7 @@ JGLOBAL_FIELD_PUBLISH_DOWN_DESC="An optional date to stop publishing." JGLOBAL_FIELD_PUBLISH_DOWN_LABEL="Finish Publishing" JGLOBAL_FIELD_PUBLISH_UP_DESC="An optional date to start publishing." JGLOBAL_FIELD_PUBLISH_UP_LABEL="Start Publishing" -JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC="Show description of the top level category or optionally override with the text from the description field found in menu item. If using Root as top level category, the description field has to be filled." +JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC="Show description of the top level category or alternatively replace with the text from the description field found in the menu item. If using Root as a top level category, the description field has to be filled." JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL="Top Level Category Description" JGLOBAL_FIELD_VERSION_NOTE_DESC="Enter an optional note for this version of the item." JGLOBAL_FIELD_VERSION_NOTE_LABEL="Version Note" @@ -366,13 +376,13 @@ JGLOBAL_FIELDSET_BASIC="Options" JGLOBAL_FILTER_ATTRIBUTES_DESC="3. List additional attributes, separating each attribute name with a space or comma. For example: class,title,id." JGLOBAL_FILTER_ATTRIBUTES_LABEL="Filter Attributes3" JGLOBAL_FILTER_CLIENT="- Select Location -" -JGLOBAL_FILTER_FIELD_DESC="Whether to show a Filter field for the list. Select Hide to hide the filter field." +JGLOBAL_FILTER_FIELD_DESC="Show or hide a filter field for the list." JGLOBAL_FILTER_FIELD_LABEL="Filter Field" JGLOBAL_FILTER_GROUPS_DESC="This sets the user groups that you want filters applied to. Other groups will have no filtering performed." JGLOBAL_FILTER_GROUPS_LABEL="Filter Groups" JGLOBAL_FILTER_TAGS_DESC="2. List additional tags, separating each tag name with a space or comma. For example: p,div,span." JGLOBAL_FILTER_TAGS_LABEL="Filter Tags2" -JGLOBAL_FILTER_TYPE_DESC="1. Black List allows all tags and attributes except for those in the black list.
    -- Tags for the Default Black List include: 'applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml'
    -- Attributes for the Default Black List include: 'action', 'background', 'codebase', 'dynsrc', 'lowsrc'
    -- You can black list additional tags and attributes by adding to the Filter Tags and Filter Attributes fields, separating each tag or attribute name with a comma.
    -- Custom Black List allows you to override the Default Black List. Add the tags and attributes to be black listed in the Filter Tags and Filter Attributes fields.

    White List allows only the tags listed in the Filter Tags and Filter Attributes fields.

    No HTML removes all HTML tags from the content when it is saved.

    Please note that these settings work regardless of the editor that you are using.
    Even if you are using a WYSIWYG editor, the filtering settings may strip additional tags and attributes prior to saving information in the database." +JGLOBAL_FILTER_TYPE_DESC="1. Blacklist allows all tags and attributes except for those in the blacklist.
    -- Tags for the Default Blacklist include: 'applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml'
    -- Attributes for the Default Blacklist include: 'action', 'background', 'codebase', 'dynsrc', 'lowsrc'
    -- You can blacklist additional tags and attributes by adding to the Filter Tags and Filter Attributes fields, separating each tag or attribute name with a comma.
    -- Custom Blacklist allows you to override the Default Blacklist. Add the tags and attributes to be blacklisted in the Filter Tags and Filter Attributes fields.

    Whitelist allows only the tags listed in the Filter Tags and Filter Attributes fields.

    No HTML removes all HTML tags from the content when it is saved.

    Please note that these settings work regardless of the editor that you are using.
    Even if you are using a WYSIWYG editor, the filtering settings may strip additional tags and attributes prior to saving information in the database." JGLOBAL_FILTER_TYPE_LABEL="Filter Type1" JGLOBAL_FULL_TEXT="Full Text" JGLOBAL_GT=">" @@ -389,10 +399,10 @@ JGLOBAL_INTEGRATION_LABEL="Integration" JGLOBAL_INTRO_TEXT="Intro Text" JGLOBAL_ISFREESOFTWARE="%s is free software released under the GNU General Public License." JGLOBAL_KEEP_TYPING="Keep typing ..." -JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Language pack does not match this Joomla! version. Some strings may be missing." +JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Language pack does not match this Joomla! version. Some strings may be missing and will be displayed in English." JGLOBAL_LEAST_HITS="Least Hits" JGLOBAL_LEFT="Left" -JGLOBAL_LINK_AUTHOR_DESC="If set to Yes, the Name of the article's Author will be linked to its contact page. You must create a contact linked to the author's user record, and the "Content - Contact" plugin must be enabled, for this to be in effect. This is a global setting but can be changed at the Category, Menu and Article levels." +JGLOBAL_LINK_AUTHOR_DESC="If set to Yes, the Name of the article's Author will be linked to its contact page. You must create a contact linked to the author's user record, and the "Content - Contact" plugin must be enabled, for this to be in effect." JGLOBAL_LINK_AUTHOR_LABEL="Link Author" JGLOBAL_LINK_CATEGORY_DESC="If set to Yes, and if Show Category is set to 'Show', the Category Title will link to a layout showing articles in that Category." JGLOBAL_LINK_CATEGORY_LABEL="Link Category" @@ -403,25 +413,30 @@ JGLOBAL_LINKED_TITLES_LABEL="Linked Titles" JGLOBAL_LIST="List" JGLOBAL_LIST_ALIAS="(Alias: %s)" JGLOBAL_LIST_ALIAS_NOTE="(Alias: %s, Note: %s)" -JGLOBAL_LIST_AUTHOR_DESC="Whether to show article author in the list of articles." +JGLOBAL_LIST_AUTHOR_DESC="Show or hide the article author in the list of articles." JGLOBAL_LIST_AUTHOR_LABEL="Show Author in List" -JGLOBAL_LIST_HITS_DESC="Whether to show article hits in the list of articles." +JGLOBAL_LIST_HITS_DESC="Show or hide article hits in the list of articles." JGLOBAL_LIST_HITS_LABEL="Show Hits in List" JGLOBAL_LIST_LAYOUT_OPTIONS="List Layouts" JGLOBAL_LIST_NOTE="(Note: %s)" +JGLOBAL_LIST_RATINGS_DESC="Whether to show article ratings in the list of articles." +JGLOBAL_LIST_RATINGS_LABEL="Show Ratings in List" JGLOBAL_LIST_TITLE_DESC="If Show, Category Title will show in the list of categories." JGLOBAL_LIST_TITLE_LABEL="Category Title" +JGLOBAL_LIST_VOTES_DESC="Whether to show article votes in the list of articles." +JGLOBAL_LIST_VOTES_LABEL="Show Votes in List" JGLOBAL_LOOKING_FOR="Looking for" JGLOBAL_LT="<" JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC="The number of subcategory levels to display." JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL="Subcategory Levels" +JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT="Maximum upload size: %s" JGLOBAL_MAXLEVEL_DESC="Maximum number of levels of subcategories to show." JGLOBAL_MAXLEVEL_LABEL="Subcategory Levels" JGLOBAL_MENU_SELECTION="Menu Selection:" JGLOBAL_MODIFIED="Modified" JGLOBAL_MODIFIED_DATE="Modified Date" JGLOBAL_MOST_HITS="Most Hits" -JGLOBAL_MOST_RECENT_FIRST="Most recent first" +JGLOBAL_MOST_RECENT_FIRST="Most Recent First" JGLOBAL_MULTI_COLUMN_ORDER_DESC="Order articles down or across columns." JGLOBAL_MULTI_COLUMN_ORDER_LABEL="Multi Column Order" JGLOBAL_MULTI_LEVEL="Multi Level" @@ -444,7 +459,7 @@ JGLOBAL_NUMBER_CATEGORY_ITEMS_LABEL="Show Article Count" JGLOBAL_NUMBER_ITEMS_LIST_DESC="Default number of articles to list on a page." JGLOBAL_NUMBER_ITEMS_LIST_LABEL="# Articles to List" JGLOBAL_NO_MATCHING_RESULTS="No Matching Results" -JGLOBAL_OLDEST_FIRST="Oldest first" +JGLOBAL_OLDEST_FIRST="Oldest First" JGLOBAL_ORDER_ASCENDING="Ascending" JGLOBAL_ORDER_DESCENDING="Descending" JGLOBAL_ORDER_DIRECTION_LABEL="Direction" @@ -463,15 +478,26 @@ JGLOBAL_PERMISSIONS_ANCHOR="Set Permissions" JGLOBAL_PREVIEW="Preview" JGLOBAL_PUBLISHED_DATE="Published Date" JGLOBAL_RANDOM_ORDER="Random Order" +JGLOBAL_RATINGS="Ratings" +JGLOBAL_RATINGS_ASC="Ratings ascending" +JGLOBAL_RATINGS_DESC="Ratings descending" JGLOBAL_RECORD_NUMBER="Record ID: %d" JGLOBAL_REMEMBER_ME="Remember Me" JGLOBAL_RIGHT="Right" JGLOBAL_ROOT="Root" JGLOBAL_ROOT_PARENT="- No parent -" -JGLOBAL_SAVE_HISTORY_OPTIONS_DESC="Whether to automatically save old versions of an item. If set to Yes, old versions of items are saved automatically. When editing, you may restore from a previous version of the item." +JGLOBAL_SAVE_HISTORY_OPTIONS_DESC="Automatically save old versions of an item. If set to Yes, old versions of items are saved automatically. When editing, you may restore from a previous version of the item." JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL="Enable Versions" JGLOBAL_SECRETKEY="Secret Key" JGLOBAL_SECRETKEY_HELP="If you have enabled two factor authentication in your user account please enter your secret key. If you do not know what this means, you can leave this field blank." +JGLOBAL_SEF_ADVANCED_DESC="Modern Routing enables advanced features but may change your URLs. Legacy routing ensures full compatibility for existing sites. This is configured per component." +JGLOBAL_SEF_ADVANCED_LABEL="URL Routing" +JGLOBAL_SEF_ADVANCED_LEGACY="Legacy" +JGLOBAL_SEF_ADVANCED_MODERN="Modern" +JGLOBAL_SEF_NOIDS_DESC="Remove the IDs from the URLs of this component." +JGLOBAL_SEF_NOIDS_LABEL="Remove IDs from URLs" +JGLOBAL_CUSTOM_FIELDS_ENABLE_DESC="Enable the creation of custom fields." +JGLOBAL_CUSTOM_FIELDS_ENABLE_LABEL="Create Custom Fields" JGLOBAL_SELECT_ALLOW_DENY_GROUP="Change %s permission for %s group." JGLOBAL_SELECT_AN_OPTION="Select an option" JGLOBAL_SELECT_NO_RESULTS_MATCH="No results match" @@ -480,7 +506,9 @@ JGLOBAL_SELECTION_ALL="Select All" JGLOBAL_SELECTION_INVERT="Toggle Selection" JGLOBAL_SELECTION_INVERT_ALL="Toggle All Selections" JGLOBAL_SELECTION_NONE="Clear Selection" -JGLOBAL_SHOW_AUTHOR_DESC="If set to Show, the Name of the article's Author will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." +JGLOBAL_SHOW_ASSOCIATIONS_DESC="Multilingual only. If set to Show, the associated articles flags or URL Language Code will be displayed." +JGLOBAL_SHOW_ASSOCIATIONS_LABEL="Show Associations" +JGLOBAL_SHOW_AUTHOR_DESC="If set to Show, the Name of the article's Author will be displayed." JGLOBAL_SHOW_AUTHOR_LABEL="Show Author" JGLOBAL_SHOW_CATEGORY_DESC="If set to Show, the title of the article’s category will show." JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC="Show or hide the description of the selected Category." @@ -494,33 +522,35 @@ JGLOBAL_SHOW_CATEGORY_TITLE="Category Title" JGLOBAL_SHOW_CATEGORY_TITLE_DESC="If Show, the Category Title will show as a subheading on the page. The subheading is usually displayed inside the "H2" tag." JGLOBAL_SHOW_CREATE_DATE_DESC="If set to Show, the date and time an Article was created will be displayed. This a global setting but can be changed at Menu and Article levels." JGLOBAL_SHOW_CREATE_DATE_LABEL="Show Create Date" -JGLOBAL_SHOW_DATE_DESC="Whether to show a date column in the list of articles. Select Hide to hide the date, or select which date you wish to show." +JGLOBAL_SHOW_DATE_DESC="Show or hide a date column in the list of articles, or select which date you wish to show." JGLOBAL_SHOW_DATE_LABEL="Show Date" -JGLOBAL_SHOW_EMAIL_ICON_DESC="Show or hide the email icon. This allows you to email an article." -JGLOBAL_SHOW_EMAIL_ICON_LABEL="Show Email Icon" +JGLOBAL_SHOW_EMAIL_ICON_DESC="Show or hide the email link. This allows you to email an article." +JGLOBAL_SHOW_EMAIL_ICON_LABEL="Show Email" JGLOBAL_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty - if it has no items or subcategories." JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL="Empty Categories" JGLOBAL_SHOW_FEATURED_ARTICLES_DESC="Select to show, hide or only display featured articles." JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL="Featured Articles" JGLOBAL_SHOW_FEED_LINK_DESC="Show or hide an RSS Feed Link. (A Feed Link will show up as a feed icon in the address bar of most modern browsers)." JGLOBAL_SHOW_FEED_LINK_LABEL="Show Feed Link" +JGLOBAL_SHOW_FLAG_DESC="If set to 'Yes', will display language choice as image flags. Otherwise will use the content language URL Language Code." +JGLOBAL_SHOW_FLAG_LABEL="Use Image Flags" JGLOBAL_SHOW_FULL_DESCRIPTION="Show full description ..." JGLOBAL_SHOW_HEADINGS_DESC="Show or hide the headings in list layouts." JGLOBAL_SHOW_HEADINGS_LABEL="Table Headings" -JGLOBAL_SHOW_HITS_DESC="If set to Show, the number of Hits on a particular Article will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." +JGLOBAL_SHOW_HITS_DESC="If set to Show, the number of Hits on a particular Article will be displayed." JGLOBAL_SHOW_HITS_LABEL="Show Hits" JGLOBAL_SHOW_ICONS_DESC="Print and email will utilise icons or text." JGLOBAL_SHOW_ICONS_LABEL="Show Icons" JGLOBAL_SHOW_INTRO_DESC="If set to Show, the Intro Text of the article will show when you drill down to the article. If set to Hide, only the part of the article after the "Read More" break will show." JGLOBAL_SHOW_INTRO_LABEL="Show Intro Text" -JGLOBAL_SHOW_MODIFY_DATE_DESC="If set to Show, the date and time an Article was last modified will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." +JGLOBAL_SHOW_MODIFY_DATE_DESC="If set to Show, the date and time an Article was last modified will be displayed." JGLOBAL_SHOW_MODIFY_DATE_LABEL="Show Modify Date" JGLOBAL_SHOW_NAVIGATION_DESC="If set to Show, shows a navigation link (Next, Previous) between articles." JGLOBAL_SHOW_NAVIGATION_LABEL="Show Navigation" JGLOBAL_SHOW_PARENT_CATEGORY_DESC="If set to Show, the title of the article’s parent category will show." JGLOBAL_SHOW_PARENT_CATEGORY_LABEL="Show Parent" -JGLOBAL_SHOW_PRINT_ICON_DESC="Show or hide the Item Print button." -JGLOBAL_SHOW_PRINT_ICON_LABEL="Show Print Icon" +JGLOBAL_SHOW_PRINT_ICON_DESC="Show or hide the print. This allows you to print an article." +JGLOBAL_SHOW_PRINT_ICON_LABEL="Show Print" JGLOBAL_SHOW_PUBLISH_DATE_DESC="If set to Show, the date and time an Article was published will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." JGLOBAL_SHOW_PUBLISH_DATE_LABEL="Show Publish Date" JGLOBAL_SHOW_READMORE_DESC="If set to Show, the Read more ...Link will show if Main text has been provided for the Article." @@ -560,12 +590,17 @@ JGLOBAL_TITLE_REVERSE_ALPHABETICAL="Title Reverse Alphabetical" JGLOBAL_TOGGLE_FEATURED="Toggle featured status." JGLOBAL_TOP="Top" JGLOBAL_TPL_CPANEL_LINK_TEXT="Return to Control Panel" -JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS="Type or select some options" JGLOBAL_TYPE_OR_SELECT_CATEGORY="Type or Select a Category" +JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS="Type or select some options" JGLOBAL_USE_GLOBAL="Use Global" +JGLOBAL_USE_GLOBAL_VALUE="Use Global (%s)" +JGLOBAL_USE_GLOBAL_VALUE_NOT_FOUND="Unfortunately there was no global value found for at least one field. Saving the options may help to remedy this issue." JGLOBAL_USERNAME="Username" JGLOBAL_VALIDATION_FORM_FAILED="Invalid form" JGLOBAL_VIEW_SITE="View Site" +JGLOBAL_VOTES="Votes" +JGLOBAL_VOTES_ASC="Votes ascending" +JGLOBAL_VOTES_DESC="Votes descending" JGLOBAL_WARNJAVASCRIPT="Warning! JavaScript must be enabled for proper operation of the Administrator Backend." JGLOBAL_WIDTH="Width" @@ -608,7 +643,7 @@ JHELP_COMPONENTS_COM_MENUS_OPTIONS="Components_Menus_Configuration" JHELP_COMPONENTS_COM_MESSAGES_OPTIONS="Components_Messages_Configuration" JHELP_COMPONENTS_COM_MODULES_OPTIONS="Components_Module_Manager_Options" JHELP_COMPONENTS_COM_NEWSFEEDS_OPTIONS="Components_News_Feed_Manager_Options" -JHELP_COMPONENTS_COM_PLUGINS_OPTIONS="Components_Plug-in_Manager_Options" +JHELP_COMPONENTS_COM_PLUGINS_OPTIONS="Components_Plugin_Manager_Options" JHELP_COMPONENTS_COM_POSTINSTALL_OPTIONS="Components_Post_installation_Messages_Configuration" JHELP_COMPONENTS_COM_REDIRECT_OPTIONS="Components_Redirect_Manager_Options" JHELP_COMPONENTS_COM_SEARCH_OPTIONS="Components_Search_Manager_Options" @@ -898,7 +933,12 @@ DATE_FORMAT_LC1="l, d F Y" DATE_FORMAT_LC2="l, d F Y H:i" DATE_FORMAT_LC3="d F Y" DATE_FORMAT_LC4="Y-m-d" +DATE_FORMAT_LC5="Y-m-d H:i" DATE_FORMAT_JS1="y-m-d" +DATE_FORMAT_CALENDAR_DATE="%Y-%m-%d" +DATE_FORMAT_CALENDAR_DATETIME="%Y-%m-%d %H:%M:%S" +DATE_FORMAT_FILTER_DATETIME="Y-m-d H:i:s" +DATE_FORMAT_FILTER_DATE="Y-m-d" ; Months diff --git a/administrator/language/en-GB/en-GB.lib_joomla.ini b/administrator/language/en-GB/en-GB.lib_joomla.ini index 02aa03f027ab4..c279f8dfa9217 100644 --- a/administrator/language/en-GB/en-GB.lib_joomla.ini +++ b/administrator/language/en-GB/en-GB.lib_joomla.ini @@ -38,6 +38,7 @@ JLIB_APPLICATION_ERROR_INVALID_CONTROLLER="Invalid controller: name='%s', format JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND="Layout %s not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_FOUND="Library not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_LOADING="Error loading library: %1$s, %2$s" +JLIB_APPLICATION_ERROR_MENU_LOAD="Error loading menu: %s" JLIB_APPLICATION_ERROR_MODEL_GET_NAME="JModel: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_MODULE_LOAD="Error loading module %s" JLIB_APPLICATION_ERROR_PATHWAY_LOAD="Unable to load pathway: %s" @@ -145,6 +146,8 @@ JLIB_CLIENT_ERROR_JFTP_MODE_ASCII="JFTP: :_mode: Bad response. Server response: JLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED="Looks like User's credentials are no good." JLIB_CLIENT_ERROR_LDAP_ADDRESS_NOT_AVAILABLE="Address not available." +JLIB_CMS_WARNING_PROVIDE_VALID_NAME="Please provide a valid, non-blank title." + JLIB_DATABASE_ERROR_ADAPTER_MYSQL="The MySQL adapter 'mysql' is not available." JLIB_DATABASE_ERROR_ADAPTER_MYSQLI="The MySQL adapter 'mysqli' is not available." JLIB_DATABASE_ERROR_BIND_FAILED_INVALID_SOURCE_ARGUMENT="%s: :bind failed. Invalid source argument." @@ -176,7 +179,7 @@ JLIB_DATABASE_ERROR_INVALID_LOCATION="%s: :setLocation - Invalid location." JLIB_DATABASE_ERROR_INVALID_NODE_RECURSION="%s: :move Failed - Can't move the node to be a child of itself." JLIB_DATABASE_ERROR_INVALID_PARENT_ID="Invalid parent ID." JLIB_DATABASE_ERROR_LANGUAGE_NO_TITLE="The language should have a title." -JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE="A content language already exists with this Image Prefix." +JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE="A content language already exists with this Image." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_LANG_CODE="A content language already exists with this Language Tag." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_SEF="A content language already exists with this URL Language Code." JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Unable to load Database Driver: %s" @@ -188,7 +191,7 @@ JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT="The Language parameter for this m JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT="At least one menu item has to be set as Default." JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME="Can't unpublish default home." JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH="The current home menu for this language is checked out." -JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="Another menu item with the same parent has this alias (remember it may be a trashed item)." +JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="The alias %1$s is already being used by %2$s menu item in the %3$s menu (remember it may be a trashed item)." JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_ROOT="Another menu item has the same alias in Root (remember it may be a trashed item). Root is the top level parent." JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a component." JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should contain only one Default home." @@ -229,6 +232,8 @@ JLIB_DATABASE_QUERY_FAILED="Database query failed (error # %s): %s" JLIB_DOCUMENT_ERROR_UNABLE_LOAD_DOC_CLASS="Unable to load document class." JLIB_ENVIRONMENT_SESSION_EXPIRED="Your session has expired. Please log in again." +JLIB_ENVIRONMENT_SESSION_INVALID="Invalid session cookie. Please check that you have cookies enabled in your web browser." +JLIB_ERROR_COMPONENTS_ACL_CONFIGURATION_FILE_MISSING_OR_IMPROPERLY_STRUCTURED="The %s component's ACL configuration file is either missing or improperly structured." JLIB_ERROR_INFINITE_LOOP="Infinite loop detected in JError." JLIB_EVENT_ERROR_DISPATCHER="JEventDispatcher: :register: Event handler not recognised. Handler: %s" JLIB_FILESYSTEM_BZIP_NOT_SUPPORTED="BZip2 Not Supported." @@ -258,7 +263,7 @@ JLIB_FILESYSTEM_UNABLE_TO_LOAD_ARCHIVE="Unable to load archive." JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY="JFile: :copy: Can't find or read file: $%s" JLIB_FILESYSTEM_ERROR_JFILE_STREAMS="JFile: :copy(%1$s, %2$s): %3$s" JLIB_FILESYSTEM_ERROR_COPY_FAILED="Copy failed." -JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01="Copy failed: %1s to %2s" +JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01="Copy failed: %1$s to %2$s" JLIB_FILESYSTEM_DELETE_FAILED="Failed deleting %s" JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE="Can't find source file." JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS="JFile: :move: %s" @@ -269,7 +274,7 @@ JLIB_FILESYSTEM_ERROR_UPLOAD="JFile: :upload: %s" JLIB_FILESYSTEM_ERROR_WARNFS_ERR01="Warning: Failed to change file permissions!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR02="Warning: Failed to move file!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR03="Warning: File %s not uploaded for security reasons!" -JLIB_FILESYSTEM_ERROR_WARNFS_ERR04="Warning: Failed to move file: %1s to %2s" +JLIB_FILESYSTEM_ERROR_WARNFS_ERR04="Warning: Failed to move file: %1$s to %2$s" JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER="Can't find source folder." JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS="Folder already exists." JLIB_FILESYSTEM_ERROR_FOLDER_CREATE="Unable to create target folder." @@ -302,6 +307,60 @@ JLIB_FORM_ERROR_NO_DATA="No data." JLIB_FORM_ERROR_VALIDATE_FIELD="Invalid xml field." JLIB_FORM_ERROR_XML_FILE_DID_NOT_LOAD="XML file did not load." JLIB_FORM_FIELD_INVALID="Invalid field: " +JLIB_FORM_FIELD_PARAM_CALENDAR_FORMAT_DESC="The date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, '%Y-%m-%d' is assumed (giving dates like '2008-04-16')." +JLIB_FORM_FIELD_PARAM_CALENDAR_FORMAT_LABEL="Format" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_DESC="The options of the checkbox list" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_LABEL="Checkbox options" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_EDITOR_BUTTONS_HIDE_DESC="Hide the buttons in the comma separated list." +JLIB_FORM_FIELD_PARAM_EDITOR_BUTTONS_HIDE_LABEL="Hide Buttons" +JLIB_FORM_FIELD_PARAM_EDITOR_HEIGHT_DESC="Defines the height (in pixels) of the WYSIWYG editor and defaults to 250px." +JLIB_FORM_FIELD_PARAM_EDITOR_HEIGHT_LABEL="Height" +JLIB_FORM_FIELD_PARAM_EDITOR_SHOW_BUTTONS_DESC="Should the buttons being shown." +JLIB_FORM_FIELD_PARAM_EDITOR_SHOW_BUTTONS_LABEL="Show Buttons" +JLIB_FORM_FIELD_PARAM_EDITOR_WIDTH_DESC="Defines the width (in pixels) of the WYSIWYG editor and defaults to 100%." +JLIB_FORM_FIELD_PARAM_EDITOR_WIDTH_LABEL="Width" +JLIB_FORM_FIELD_PARAM_IMAGELIST_DIRECTORY_DESC="The filesystem path to the directory containing the image files to be listed." +JLIB_FORM_FIELD_PARAM_IMAGELIST_DIRECTORY_LABEL="Directory" +JLIB_FORM_FIELD_PARAM_INTEGER_FIRST_DESC="This value is the lowest on the list." +JLIB_FORM_FIELD_PARAM_INTEGER_FIRST_LABEL="First" +JLIB_FORM_FIELD_PARAM_INTEGER_LAST_DESC="This value is the highest on the list." +JLIB_FORM_FIELD_PARAM_INTEGER_LAST_LABEL="Last" +JLIB_FORM_FIELD_PARAM_INTEGER_STEP_DESC="Each option will be the previous option incremented by this integer, starting with the first value until the last value is reached." +JLIB_FORM_FIELD_PARAM_INTEGER_STEP_LABEL="Step" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_DESC="The options of the list." +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_LABEL="List options" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_MEDIA_IMAGE_CLASS_DESC="The class which is added to the image (src tag)." +JLIB_FORM_FIELD_PARAM_MEDIA_IMAGE_CLASS_LABEL="Image Class" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_DESC="Shows or hides the preview of the selected image." +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_INLINE="Inline" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_LABEL="Preview" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_TOOLTIP="Tooltip" +JLIB_FORM_FIELD_PARAM_MEDIA_HOME_LABEL="Home Directory" +JLIB_FORM_FIELD_PARAM_MEDIA_HOME_DESC="Should the directory with the files point to a user directory." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_DESC="The options of the radio list." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_LABEL="Radio options" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_SQL_QUERY_DESC="The SQL query which will provide the data for the drop-down list. The query must return two columns; one called 'value' which will hold the values of the list items; the other called 'text' containing the text in the drop-down list." +JLIB_FORM_FIELD_PARAM_SQL_QUERY_LABEL="Query" +JLIB_FORM_FIELD_PARAM_TEXTAREA_COLS_DESC="The number of columns of the field." +JLIB_FORM_FIELD_PARAM_TEXTAREA_COLS_LABEL="Columns" +JLIB_FORM_FIELD_PARAM_TEXTAREA_ROWS_DESC="The number of rows of the field." +JLIB_FORM_FIELD_PARAM_TEXTAREA_ROWS_LABEL="Rows" +JLIB_FORM_FIELD_PARAM_URL_RELATIVE_DESC="Are relative URLs allowed." +JLIB_FORM_FIELD_PARAM_URL_RELATIVE_LABEL="Relative" +JLIB_FORM_FIELD_PARAM_URL_SCHEMES_DESC="The allowed schemes." +JLIB_FORM_FIELD_PARAM_URL_SCHEMES_LABEL="Schemes" JLIB_FORM_INPUTMODE="latin" JLIB_FORM_INVALID_FORM_OBJECT="Invalid Form Object: :%s" JLIB_FORM_INVALID_FORM_RULE="Invalid Form Rule: :%s" @@ -309,7 +368,7 @@ JLIB_FORM_MEDIA_PREVIEW_ALT="Selected image." JLIB_FORM_MEDIA_PREVIEW_EMPTY="No image selected." JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE="Selected image." JLIB_FORM_MEDIA_PREVIEW_TIP_TITLE="Preview" -JLIB_FORM_SELECT_USER="Select a User." +JLIB_FORM_SELECT_USER="Select a User" JLIB_FORM_VALIDATE_FIELD_INVALID="Invalid field: %s" JLIB_FORM_VALIDATE_FIELD_REQUIRED="Field required: %s" JLIB_FORM_VALIDATE_FIELD_RULE_MISSING="Validation Rule missing: %s" @@ -458,6 +517,7 @@ JLIB_INSTALLER_ABORT_CREATE_DIRECTORY="Extension %1$s: Failed to create folder: JLIB_INSTALLER_ABORT_DEBUG="Installation unexpectedly terminated:" JLIB_INSTALLER_ABORT_DETECTMANIFEST="Unable to detect manifest file." JLIB_INSTALLER_ABORT_DIRECTORY="Extension %1$s: Another %2$s is already using the named folder: %3$s. Are you trying to install the same extension again?" +JLIB_INSTALLER_ABORT_ERROR_DELETING_EXTENSIONS_RECORD="Could not delete the extension's record from the database." JLIB_INSTALLER_ABORT_EXTENSIONNOTVALID="Extension is not valid." JLIB_INSTALLER_ABORT_FILE_INSTALL_COPY_SETUP="Files Install: Could not copy setup file." JLIB_INSTALLER_ABORT_FILE_INSTALL_CUSTOM_INSTALL_FAILURE="Files Install: Custom install routine failure." @@ -522,6 +582,8 @@ JLIB_INSTALLER_ABORT_TPL_INSTALL_FAILED_CREATE_DIRECTORY="Template Install: Fail JLIB_INSTALLER_ABORT_TPL_INSTALL_ROLLBACK="Template Install: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT="Template Install: Unknown client type [%s]" JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION="For the extension %1$s version %2$s is available, but it requires at least PHP version %3$s while your system only has %4$s" +JLIB_INSTALLER_AVAILABLE_UPDATE_DB_MINIMUM="For the extension %1$s version %2$s is available, but your current database %3$s is version %4$s and is not supported. Please contact your web host to update your Database version to at least version %5$s." +JLIB_INSTALLER_AVAILABLE_UPDATE_DB_TYPE="For the extension %1$s version %2$s is available, but your current database %3$s is not supported anymore." JLIB_INSTALLER_PURGED_UPDATES="Cleared updates" JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to clear updates." JLIB_INSTALLER_DEFAULT_STYLE="%s - Default" @@ -571,6 +633,7 @@ JLIB_INSTALLER_ERROR_LANG_UNINSTALL_ELEMENT_EMPTY="Language Uninstall: Element i JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PATH_EMPTY="Language Uninstall: Language path is empty, can't uninstall files." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PROTECTED="This language can't be uninstalled. It is protected in the database (usually en-GB)." JLIB_INSTALLER_ERROR_LIB_DISCOVER_STORE_DETAILS="Library Discover install: Failed to store library details." +JLIB_INSTALLER_ERROR_LIB_REFRESH_MANIFEST_CACHE="Library Refresh manifest cache: Failed to store library details." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_MANIFEST="Library Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Library Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_LOAD_MANIFEST="Library Uninstall: Could not load manifest file." @@ -588,6 +651,7 @@ JLIB_INSTALLER_ERROR_NO_FILE="JInstaller: :Install: File does not exist %s" JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG="The package did not specify a language tag. Are you trying to install an old language package?" JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE="JInstaller: :Install: Can't find Joomla XML setup file." JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE="JInstaller: :Install: Can't find XML setup file." +JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE="Package Refresh manifest cache: Failed to store package details." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_MANIFEST="Package Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Package Uninstall: Manifest file invalid or not found: %s" JLIB_INSTALLER_ERROR_PACK_UNINSTALL_LOAD_MANIFEST="Package Uninstall: Could not load manifest file." @@ -607,6 +671,7 @@ JLIB_INSTALLER_ERROR_SQL_ERROR="JInstaller: :Install: Error SQL %s" JLIB_INSTALLER_ERROR_SQL_FILENOTFOUND="JInstaller: :Install: SQL File not found %s" JLIB_INSTALLER_ERROR_SQL_READBUFFER="JInstaller: :Install: SQL File Buffer Read Error." JLIB_INSTALLER_ERROR_TPL_DISCOVER_STORE_DETAILS="Template Discover install: Failed to store template details." +JLIB_INSTALLER_ERROR_TPL_REFRESH_MANIFEST_CACHE="Template Refresh manifest cache: Failed to store template details." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION="Template Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT="Template Uninstall: Invalid client." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Template Uninstall: Manifest file invalid or not found." @@ -616,6 +681,7 @@ JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY="Template Uninstall: Templa JLIB_INSTALLER_ERROR_TPL_UNINSTALL_WARNCORETEMPLATE="Template Uninstall: Trying to uninstall a core template: %s" JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE="Unknown Client Type [%s]" JLIB_INSTALLER_FILE_ERROR_MOVE="Error on moving file %s" +JLIB_INSTALLER_INCORRECT_SEQUENCE="Downgrading from version %1$s to version %2$s is not allowed." JLIB_INSTALLER_INSTALL="Install" JLIB_INSTALLER_MINIMUM_JOOMLA="You don't have the minimum Joomla version requirement of J%s" JLIB_INSTALLER_MINIMUM_PHP="Your server doesn't meet the minimum PHP version requirement of %s" @@ -627,9 +693,16 @@ JLIB_INSTALLER_ERROR_EXTENSION_INVALID_CLIENT_IDENTIFIER="Invalid client identif JLIB_INSTALLER_ERROR_PACK_UNINSTALL_UNKNOWN_EXTENSION="Attempting to uninstall unknown extension from package. This extension may have already been removed earlier." JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE language files it has no effect on the installation of the language(s). Some language packs created prior to Joomla! 3.2.0 may try to install separate TinyMCE language files. As these are now included in the core they no longer need to be installed." JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s." +JLIB_INSTALLER_WARNING_UNABLE_TO_INSTALL_CONTENT_LANGUAGE="Unable to create a content language for %s language: %s" + +JLIB_JS_AJAX_ERROR_CONNECTION_ABORT="A connection abort has occurred while fetching the JSON data." +JLIB_JS_AJAX_ERROR_NO_CONTENT="No content was returned." +JLIB_JS_AJAX_ERROR_OTHER="An error has occurred while fetching the JSON data: HTTP %s status code." +JLIB_JS_AJAX_ERROR_PARSE="A parse error has occurred while processing the following JSON data:
    %s" +JLIB_JS_AJAX_ERROR_TIMEOUT="A timeout has occurred while fetching the JSON data." JLIB_MAIL_FUNCTION_DISABLED="The mail() function has been disabled and the mail can't be sent." -JLIB_MAIL_FUNCTION_OFFLINE="The mail function has been temporarily disabled on this site, please try again later." +JLIB_MAIL_FUNCTION_OFFLINE="The mail function has been disabled by an administrator." JLIB_MAIL_INVALID_EMAIL_SENDER="JMail: : Invalid email Sender: %s, JMail: :setSender(%s)." JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file." @@ -649,6 +722,7 @@ JLIB_REGISTRY_EXCEPTION_LOAD_FORMAT_CLASS="Unable to load format class." JLIB_RULES_ACTION="Action" JLIB_RULES_ALLOWED="Allowed" JLIB_RULES_ALLOWED_ADMIN="Allowed (Super User)" +JLIB_RULES_ALLOWED_INHERITED="Allowed (Inherited)" JLIB_RULES_CALCULATED_SETTING="Calculated Setting" JLIB_RULES_CONFLICT="Conflict" JLIB_RULES_DATABASE_FAILURE="Failed storing the data to the database." @@ -659,16 +733,22 @@ JLIB_RULES_INHERIT="Inherit" JLIB_RULES_INHERITED="Inherited" JLIB_RULES_NOT_ALLOWED="Not Allowed" JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT="Conflict" +JLIB_RULES_NOT_ALLOWED_DEFAULT="Not Allowed (Default)" +JLIB_RULES_NOT_ALLOWED_INHERITED="Not Allowed (Inherited)" JLIB_RULES_NOT_ALLOWED_LOCKED="Not Allowed (Locked)" JLIB_RULES_NOT_SET="Not Set" +JLIB_RULES_NOTICE_RECALCULATE_GROUP_PERMISSIONS="Super User permissions changed. Save or reload to recalculate this group permissions." +JLIB_RULES_NOTICE_RECALCULATE_GROUP_CHILDS_PERMISSIONS="Permissions changed in a group with child groups. Save or reload to recalculate the child groups permissions." JLIB_RULES_REQUEST_FAILURE="Failed sending the data to server." JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS="Please save before changing permissions." JLIB_RULES_SELECT_ALLOW_DENY_GROUP="Allow or deny %s for users in the %s group." JLIB_RULES_SELECT_SETTING="Select New Setting" JLIB_RULES_SETTING_NOTES="If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content." -JLIB_RULES_SETTING_NOTES_ITEM="If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings)." +JLIB_RULES_SETTING_NOTES_ITEM="If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Inherited) under Calculated Settings)." JLIB_RULES_SETTINGS_DESC="Manage the permission settings for the user groups below. See notes at the bottom." +JLIB_STEMMER_INVALID_STEMMER="Invalid stemmer type %s" + JLIB_UNKNOWN="Unknown" JLIB_UPDATER_ERROR_COLLECTION_FOPEN="The PHP allow_url_fopen setting is disabled. This setting must be enabled for the updater to work." JLIB_UPDATER_ERROR_COLLECTION_OPEN_URL="Update: :Collection: Could not open %s" @@ -679,6 +759,9 @@ JLIB_UPDATER_ERROR_OPEN_UPDATE_SITE="Update: Could not open update site #%d &quo JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN="JAuthentication: :authenticate: Failed to load plugin: %s" JLIB_USER_ERROR_AUTHENTICATION_LIBRARIES="JAuthentication: :__construct: Could not load authentication libraries." JLIB_USER_ERROR_BIND_ARRAY="Unable to bind array to user object." +JLIB_USER_ERROR_CANNOT_CHANGE_SUPER_USER="A user is not allowed to change permissions of a Super User group." +JLIB_USER_ERROR_CANNOT_CHANGE_OWN_GROUPS="A user is not allowed to change permissions of their own group(s)." +JLIB_USER_ERROR_CANNOT_CHANGE_OWN_PARENT_GROUPS="A user is not allowed to change permissions of their own group(s) parent group(s)." JLIB_USER_ERROR_CANNOT_DEMOTE_SELF="You can't remove your own Super User permissions." JLIB_USER_ERROR_CANNOT_REUSE_PASSWORD="You can't reuse your current password, please enter a new password." JLIB_USER_ERROR_ID_NOT_EXISTS="JUser: :_load: User %s does not exist." diff --git a/administrator/language/en-GB/en-GB.mod_menu.ini b/administrator/language/en-GB/en-GB.mod_menu.ini index 2d9f155e507cd..3daab0d814d09 100644 --- a/administrator/language/en-GB/en-GB.mod_menu.ini +++ b/administrator/language/en-GB/en-GB.mod_menu.ini @@ -42,6 +42,8 @@ MOD_MENU_FIELD_SHOWHELP="Help Menu" MOD_MENU_FIELD_SHOWHELP_DESC="Show or hide the Help menu which includes links to various joomla.org sites useful to users." MOD_MENU_FIELD_SHOWNEW="Add New Shortcuts" MOD_MENU_FIELD_SHOWNEW_DESC="Show or hide various 'Add New ...' shortcuts against users, groups, access levels, articles and categories." +MOD_MENU_FIELDS="Fields" +MOD_MENU_FIELDS_GROUP="Field Groups" MOD_MENU_GLOBAL_CHECKIN="Global Check-in" MOD_MENU_HELP="Help" MOD_MENU_HELP_COMMUNITY="Community Portal" @@ -57,7 +59,7 @@ MOD_MENU_HELP_SHOP="Joomla! Shop" MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM="Official Support Forum" ; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module contains a URL MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum" -; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in forum.joomla.org. Use something like 'Official english forum'. +; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'. MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM="Official Language Forums" MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE="511" MOD_MENU_HELP_TRANSLATIONS="Joomla! Translations" diff --git a/administrator/language/en-GB/en-GB.mod_status.ini b/administrator/language/en-GB/en-GB.mod_status.ini index 6fba34e42cefa..869259fdd98b6 100644 --- a/administrator/language/en-GB/en-GB.mod_status.ini +++ b/administrator/language/en-GB/en-GB.mod_status.ini @@ -8,7 +8,7 @@ MOD_STATUS_BACKEND_USERS_0="Administrators" MOD_STATUS_BACKEND_USERS_1="Administrator" MOD_STATUS_BACKEND_USERS_MORE="Administrators" MOD_STATUS_FIELD_SHOW_VIEWSITE_LABEL="Show View Site" -MOD_STATUS_FIELD_SHOW_VIEWSITE_DESC="Show a link to the website homepage." +MOD_STATUS_FIELD_SHOW_VIEWSITE_DESC="Show a link to the website home page." MOD_STATUS_FIELD_LINK_VIEWADMIN_LABEL="Show Admin" MOD_STATUS_FIELD_SHOW_VIEWADMIN_LABEL="Show View Administrator" MOD_STATUS_FIELD_SHOW_VIEWADMIN_DESC="Show a link to open a new Administrator window." @@ -21,7 +21,13 @@ MOD_STATUS_FIELD_SHOW_MESSAGES_LABEL="Show Messages" MOD_STATUS_LOG_OUT="Log out" MOD_STATUS_MESSAGES_0="%d Messages" MOD_STATUS_MESSAGES_1="%d Message" +MOD_STATUS_MESSAGES_LABEL_0="Messages" +MOD_STATUS_MESSAGES_LABEL_1="Message" +MOD_STATUS_MESSAGES_LABEL_MORE="Messages" MOD_STATUS_MESSAGES_MORE="%d Messages" +MOD_STATUS_TOTAL_USERS_0="Users" +MOD_STATUS_TOTAL_USERS_1="User" +MOD_STATUS_TOTAL_USERS_MORE="Users" MOD_STATUS_USERS_0="Visitors" MOD_STATUS_USERS_1="Visitor" MOD_STATUS_USERS_MORE="Visitors" diff --git a/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini b/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini index fe797151c5b34..bc45dc0ec3997 100644 --- a/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini +++ b/administrator/language/en-GB/en-GB.plg_captcha_recaptcha.ini @@ -15,9 +15,9 @@ PLG_RECAPTCHA_VERSION_1="1.0" PLG_RECAPTCHA_VERSION_2="2.0" PLG_RECAPTCHA_VERSION_V1="1.0" PLG_RECAPTCHA_VERSION_V2="2.0" -PLG_RECAPTCHA_PUBLIC_KEY_LABEL="Site key" +PLG_RECAPTCHA_PUBLIC_KEY_LABEL="Site Key" PLG_RECAPTCHA_PUBLIC_KEY_DESC="Used in the JavaScript code that is served to your users. See the plugin description for instructions on getting a site key." -PLG_RECAPTCHA_PRIVATE_KEY_LABEL="Secret key" +PLG_RECAPTCHA_PRIVATE_KEY_LABEL="Secret Key" PLG_RECAPTCHA_PRIVATE_KEY_DESC="Used in the communication between your server and the reCAPTCHA server. Be sure to keep it a secret. See the plugin description for instructions on getting a secret key." PLG_RECAPTCHA_THEME_LABEL="Theme" PLG_RECAPTCHA_THEME_DESC="Defines which theme to use for reCAPTCHA." diff --git a/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini b/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini index 0cafce1ad890e..e2ac4d842d970 100644 --- a/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini +++ b/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini @@ -19,7 +19,7 @@ PLG_CONTENT_PAGEBREAK_SITE_ARTICLEINDEX_LABEL="Article Index Heading" PLG_CONTENT_PAGEBREAK_SITE_TITLE_DESC="Title and heading attributes from Plugin added to Site Title tag." PLG_CONTENT_PAGEBREAK_SITE_TITLE_LABEL="Show Site Title" PLG_CONTENT_PAGEBREAK_SLIDERS="Sliders" -PLG_CONTENT_PAGEBREAK_STYLE_DESC="Choose whether to layout the article with separate pages, tabs or sliders." +PLG_CONTENT_PAGEBREAK_STYLE_DESC="Display the article with separate pages, tabs or sliders." PLG_CONTENT_PAGEBREAK_STYLE_LABEL="Presentation Style" PLG_CONTENT_PAGEBREAK_TABS="Tabs" PLG_CONTENT_PAGEBREAK_TOC_DESC="Display a table of contents on multipage Articles." diff --git a/administrator/language/en-GB/en-GB.plg_content_vote.ini b/administrator/language/en-GB/en-GB.plg_content_vote.ini index 434f00780e871..542ea9bcc5011 100644 --- a/administrator/language/en-GB/en-GB.plg_content_vote.ini +++ b/administrator/language/en-GB/en-GB.plg_content_vote.ini @@ -4,10 +4,14 @@ ; Note : All ini files need to be saved as UTF-8 PLG_CONTENT_VOTE="Content - Vote" +PLG_VOTE_BOTTOM="Bottom" PLG_VOTE_LABEL="Please Rate" +PLG_VOTE_POSITION_DESC="Set where the voting is displayed." +PLG_VOTE_POSITION_LABEL="Position" PLG_VOTE_RATE="Rate" PLG_VOTE_STAR_ACTIVE="Star Active" PLG_VOTE_STAR_INACTIVE="Star Inactive" +PLG_VOTE_TOP="Top" PLG_VOTE_USER_RATING="User Rating: %1$s / %2$s" PLG_VOTE_VOTE="Vote %s" PLG_VOTE_XML_DESCRIPTION="Add Voting functionality to Articles." diff --git a/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.ini b/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.ini new file mode 100644 index 0000000000000..cf3172dff486e --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.ini @@ -0,0 +1,8 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_CONTACT="Button - Contact" +PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT="Contact" +PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION="Displays a button to make it possible to insert links to Contacts in an article. Displays a popup allowing you to choose the contact." diff --git a/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.sys.ini b/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.sys.ini new file mode 100644 index 0000000000000..66b51d8cd8c6f --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_editors-xtd_contact.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_CONTACT="Button - Contact" +PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION="Displays a button to make it possible to insert links to Contacts in an article. Displays a popup allowing you to choose the contact." diff --git a/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.ini b/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.ini new file mode 100644 index 0000000000000..6b7b401d46179 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.ini @@ -0,0 +1,8 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_MENU="Button - Menu" +PLG_EDITORS-XTD_MENU_BUTTON_MENU="Menu" +PLG_EDITORS-XTD_MENU_XML_DESCRIPTION="Displays a button to make it possible to insert menu item links into an Article. Displays a popup allowing you to choose the menu item." diff --git a/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.sys.ini b/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.sys.ini new file mode 100644 index 0000000000000..145342aba1837 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_editors-xtd_menu.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_MENU="Button - Menu" +PLG_EDITORS-XTD_MENU_XML_DESCRIPTION="Displays a button to make it possible to insert menu item links into an Article. Displays a popup allowing you to choose the menu item." diff --git a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini index 89f4c1ac13442..2ac4f0327bb12 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini @@ -22,9 +22,9 @@ PLG_CODEMIRROR_FIELD_FONT_SIZE_LABEL="Font Size (px)" PLG_CODEMIRROR_FIELD_FULLSCREEN_DESC="Select the function key to use to toggle fullscreen mode." PLG_CODEMIRROR_FIELD_FULLSCREEN_LABEL="Toggle Fullscreen" PLG_CODEMIRROR_FIELD_FULLSCREEN_MOD_DESC="Select any modifier keys to use with the fullscreen toggle key." -PLG_CODEMIRROR_FIELD_FULLSCREEN_MOD_LABEL="Use modifiers" +PLG_CODEMIRROR_FIELD_FULLSCREEN_MOD_LABEL="Use Modifiers" PLG_CODEMIRROR_FIELD_HIGHLIGHT_MATCH_COLOR_DESC="The background colour to use for highlighting matching tags. Will be displayed at 50% opacity." -PLG_CODEMIRROR_FIELD_HIGHLIGHT_MATCH_COLOR_LABEL="Matching tag colour" +PLG_CODEMIRROR_FIELD_HIGHLIGHT_MATCH_COLOR_LABEL="Matching Tag Colour" PLG_CODEMIRROR_FIELD_LINE_HEIGHT_DESC="The height of one line of text. This is in ems, meaning that 1.0 is equal to the font size and 2.0 is equal to 2x the font size." PLG_CODEMIRROR_FIELD_LINE_HEIGHT_LABEL="Line Height (em)" PLG_CODEMIRROR_FIELD_LINENUMBERS_DESC="Display line numbers." diff --git a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini index 15a490d36f0ba..71ab2a85d282d 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini @@ -6,7 +6,7 @@ PLG_EDITORS_TINYMCE="Editor - TinyMCE" PLG_TINY_BUTTON_TOGGLE_EDITOR="Toggle editor" PLG_TINY_CONFIG_TEXTFILTER_ACL_DESC="If on, the text filter from the Joomla Global Configuration for every user group is applied.
    If off, the filters as defined here are used for all user groups." -PLG_TINY_CONFIG_TEXTFILTER_ACL_LABEL="Use Joomla text filter" +PLG_TINY_CONFIG_TEXTFILTER_ACL_LABEL="Use Joomla Text Filter" PLG_TINY_ERR_CUSTOMCSSFILENOTPRESENT="The file name %s was entered in the TinyMCE Custom CSS field. This file could not be found in the default template folder. No styles are available." PLG_TINY_ERR_EDITORCSSFILENOTPRESENT="Could not find the file 'editor.css' in the template or templates/system folder. No styles are available." PLG_TINY_ERR_UNSUPPORTEDBROWSER="Drag and drop image upload is not available for your browser. Please consider using a fully HTML5 compatible browser" @@ -20,8 +20,8 @@ PLG_TINY_FIELD_BLOCKQUOTE_DESC="Turn on/off blockquotes." PLG_TINY_FIELD_BLOCKQUOTE_LABEL="Blockquote" PLG_TINY_FIELD_CODESAMPLE_DESC="Turn on/off code highlighting" PLG_TINY_FIELD_CODESAMPLE_LABEL="Code Sample" -PLG_TINY_FIELD_COLORS_DESC="Show or hide the Colors control buttons." -PLG_TINY_FIELD_COLORS_LABEL="Colors" +PLG_TINY_FIELD_COLORS_DESC="Show or hide the Colours control buttons." +PLG_TINY_FIELD_COLORS_LABEL="Colours" PLG_TINY_FIELD_CONTEXTMENU_DESC="Turn on/off Context Menu." PLG_TINY_FIELD_CONTEXTMENU_LABEL="Context Menu" PLG_TINY_FIELD_CSS_DESC="By default the Plugin looks for an editor.css file. If it can't find one in the default template CSS folder, it loads the editor.css file from the system template." @@ -33,13 +33,13 @@ PLG_TINY_FIELD_CUSTOMPLUGIN_LABEL="Custom Plugin" PLG_TINY_FIELD_CUSTOM_CSS_DESC="Optional CSS file that will override the standard editor.css file. Enter a file name to point to a file in the CSS folder of the default template (for example, templates/beez3/css/). Or enter a full URL path to the custom CSS file. If you enter a value in this field, this file will be used instead of the editor.css file." PLG_TINY_FIELD_CUSTOM_CSS_LABEL="Custom CSS Classes" PLG_TINY_FIELD_CUSTOM_PATH_DESC="Provide a directory where the images are to be uploaded to. If nothing is provided the images will be uploaded to /images." -PLG_TINY_FIELD_CUSTOM_PATH_LABEL="Images directory" +PLG_TINY_FIELD_CUSTOM_PATH_LABEL="Images Directory" PLG_TINY_FIELD_DATE_DESC="Show or hide the Insert Date button." PLG_TINY_FIELD_DATE_LABEL="Insert Date" PLG_TINY_FIELD_DIRECTION_DESC="Choose default text direction." PLG_TINY_FIELD_DIRECTION_LABEL="Text Direction" PLG_TINY_FIELD_DRAG_DROP_DESC="Enable drag and drop for uploading images" -PLG_TINY_FIELD_DRAG_DROP_LABEL="Images drag&drop" +PLG_TINY_FIELD_DRAG_DROP_LABEL="Images Drag & Drop" PLG_TINY_FIELD_ELEMENTS_DESC="Allows the addition of specific valid elements to the existing rule set." PLG_TINY_FIELD_ELEMENTS_LABEL="Extended Valid Elements" PLG_TINY_FIELD_ENCODING_DESC="Controls how HTML entities are encoded. Recommended setting is 'raw'. 'named' = used named entity encoding (for example, '<'). 'numeric' = use numeric HTML encoding (for example, '%03c'). raw = Do not encode HTML entities. Note that searching content may not work properly if setting is not 'raw'." @@ -83,10 +83,10 @@ PLG_TINY_FIELD_PRINT_LABEL="Print/Preview" PLG_TINY_FIELD_PROHIBITED_DESC="Elements that will be cleaned from the text. Do not leave empty - if you do not want to prohibit anything enter dummy text eg cms." PLG_TINY_FIELD_PROHIBITED_LABEL="Prohibited Elements" PLG_TINY_FIELD_RESIZE_HORIZONTAL_DESC="Enable/disable the horizontal resizing." -PLG_TINY_FIELD_RESIZE_HORIZONTAL_LABEL="Horizontal resizing" +PLG_TINY_FIELD_RESIZE_HORIZONTAL_LABEL="Horizontal Resizing" PLG_TINY_FIELD_RESIZING_DESC="Enable/disable the resizing of the editor area (vertically and also horizontally if 'Horizontal Resizing' is enabled)." PLG_TINY_FIELD_RESIZING_LABEL="Resizing" -PLG_TINY_FIELD_RTL_DESC="Select whether to display the RTL button." +PLG_TINY_FIELD_RTL_DESC="Show or hide the RTL button." PLG_TINY_FIELD_RTL_LABEL="Directionality" PLG_TINY_FIELD_SAVEWARNING_DESC="Save Warning: gives warning if you cancel without saving changes." PLG_TINY_FIELD_SAVEWARNING_LABEL="Save Warning" diff --git a/administrator/language/en-GB/en-GB.plg_fields_gallery.ini b/administrator/language/en-GB/en-GB.plg_fields_gallery.ini new file mode 100644 index 0000000000000..cd23998a6e6b1 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_fields_gallery.ini @@ -0,0 +1,22 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +COM_FIELDS_TYPE_GALLERY="Gallery" + +PLG_FIELDS_GALLERY="Fields - Gallery" +PLG_FIELDS_GALLERY_DIRECTORY_LABEL="Directory" +PLG_FIELDS_GALLERY_DIRECTORY_DESC="The filesystem path to the directory containing the image files to be listed." +PLG_FIELDS_GALLERY_IMAGE_ERROR="Error precessing the image %s: %s" +PLG_FIELDS_GALLERY_MAX_WIDTH_LABEL="Max Width" +PLG_FIELDS_GALLERY_MAX_WIDTH_DESC="The maximum width of the image. The image will be resized on the fly." +PLG_FIELDS_GALLERY_MAX_HEIGHT_LABEL="Max Height" +PLG_FIELDS_GALLERY_MAX_HEIGHT_DESC="The maximum height of the image. The image will be resized on the fly." +PLG_FIELDS_GALLERY_MULTIPLE_LABEL="Multiple" +PLG_FIELDS_GALLERY_MULTIPLE_DESC="Allow multiple values to be selected." +PLG_FIELDS_GALLERY_RECURSIVE_LABEL="Recursive" +PLG_FIELDS_GALLERY_RECURSIVE_DESC="Should the images from the subfolders also be included." +PLG_FIELDS_GALLERY_THUMBNAIL_WIDTH_LABEL="Thumbnail Width" +PLG_FIELDS_GALLERY_THUMBNAIL_WIDTH_DESC="The width of the thumbnails. The thumbnails will be resized on the fly." +PLG_FIELDS_GALLERY_XML_DESCRIPTION="The Gallery Fields plugin." diff --git a/administrator/language/en-GB/en-GB.plg_fields_gallery.sys.ini b/administrator/language/en-GB/en-GB.plg_fields_gallery.sys.ini new file mode 100644 index 0000000000000..714683dc737b4 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_fields_gallery.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_FIELDS_GALLERY="Fields - Gallery" +PLG_FIELDS_GALLERY_XML_DESCRIPTION="The Gallery Fields plugin." diff --git a/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.ini b/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.ini index d203854d85b18..33717a14ca278 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.ini @@ -6,4 +6,4 @@ PLG_INSTALLER_FOLDERINSTALLER_TEXT="Install from Folder" PLG_INSTALLER_FOLDERINSTALLER_BUTTON="Check and Install" PLG_INSTALLER_FOLDERINSTALLER_NO_INSTALL_PATH="Please enter a Folder." -PLG_INSTALLER_FOLDERINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from a folder." +PLG_INSTALLER_FOLDERINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from a folder." diff --git a/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.sys.ini b/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.sys.ini index 58ba8bf180746..c6469ca6aa73f 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.sys.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_folderinstaller.sys.ini @@ -4,4 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 PLG_INSTALLER_FOLDERINSTALLER="Installer - Install from Folder" -PLG_INSTALLER_FOLDERINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from a folder." +PLG_INSTALLER_FOLDERINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from a folder." diff --git a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini index 92251fe7f894b..221bae256bbe7 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.ini @@ -5,7 +5,7 @@ PLG_INSTALLER_PACKAGEINSTALLER_EXTENSION_PACKAGE_FILE="Extension package file" PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE="Please select a package to upload" -PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from your local computer." +PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from your local computer." PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_INSTALL_JOOMLA_EXTENSION="Upload & Install Joomla Extension" PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_PACKAGE_FILE="Upload Package File" PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_AND_INSTALL="Upload & Install" diff --git a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.sys.ini b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.sys.ini index aa605893f7eaa..590d917568759 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.sys.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_packageinstaller.sys.ini @@ -4,4 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 PLG_INSTALLER_PACKAGEINSTALLER="Installer - Install from Upload" -PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from your local computer." +PLG_INSTALLER_PACKAGEINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from your local computer." diff --git a/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.ini b/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.ini index a01fabc915422..00f4e63edd301 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.ini @@ -6,5 +6,5 @@ PLG_INSTALLER_URLINSTALLER_BUTTON="Check and Install" PLG_INSTALLER_URLINSTALLER_INSTALLER_URLFOLDERINSTALLER="Installer - Install from URL." PLG_INSTALLER_URLINSTALLER_NO_URL="Please enter a URL." -PLG_INSTALLER_URLINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from a URL." +PLG_INSTALLER_URLINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from a URL." PLG_INSTALLER_URLINSTALLER_TEXT="Install from URL" diff --git a/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.sys.ini b/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.sys.ini index 9b9d9d79f8a85..908f3648f0f2e 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.sys.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_urlinstaller.sys.ini @@ -3,5 +3,5 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -PLG_INSTALLER_URLINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows to install packages from a URL." +PLG_INSTALLER_URLINSTALLER_PLUGIN_XML_DESCRIPTION="This plugin allows you to install packages from a URL." PLG_INSTALLER_URLINSTALLER="Installer - Install from URL" diff --git a/administrator/language/en-GB/en-GB.plg_installer_webinstaller.ini b/administrator/language/en-GB/en-GB.plg_installer_webinstaller.ini index a87e44031ab82..97e91f7d91f53 100644 --- a/administrator/language/en-GB/en-GB.plg_installer_webinstaller.ini +++ b/administrator/language/en-GB/en-GB.plg_installer_webinstaller.ini @@ -5,7 +5,7 @@ PLG_INSTALLER_WEBINSTALLER="Installer - Install from Web" PLG_INSTALLER_WEBINSTALLER_LOAD_APPS="Display the extensions" -PLG_INSTALLER_WEBINSTALLER_TAB_POSITION_DESC="Indicate whether to place the Install from Web tab first or last." +PLG_INSTALLER_WEBINSTALLER_TAB_POSITION_DESC="Place the Install from Web tab first or last." PLG_INSTALLER_WEBINSTALLER_TAB_POSITION_LABEL="Tab Position" PLG_INSTALLER_WEBINSTALLER_TAB_POSITION_FIRST="First" PLG_INSTALLER_WEBINSTALLER_TAB_POSITION_LAST="Last" diff --git a/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.ini b/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.ini new file mode 100644 index 0000000000000..9a3280f80f7ad --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.ini @@ -0,0 +1,11 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_QUICKICON_PHPVERSIONCHECK="Quick Icon - PHP Version Check" +; Key 1 is the server's current PHP version, key 2 is the date at which support will end for the current PHP version +PLG_QUICKICON_PHPVERSIONCHECK_SECURITY_ONLY="Your PHP version, %1$s, is only receiving security fixes at this time from the PHP project. This means your PHP version will soon no longer be supported. We recommend planning to upgrade to a newer PHP version before it reaches end of support on %2$s. Joomla will be faster and more secure if you upgrade to a newer PHP version (PHP 7.x is recommended). Please contact your host for upgrade instructions." +; Key 1 is the server's current PHP version, key 2 is the recommended PHP version, and key 3 is the date at which support will end for the recommended PHP version +PLG_QUICKICON_PHPVERSIONCHECK_UNSUPPORTED="We have detected that your server is using PHP %1$s which is obsolete and no longer receives official security updates by its developers. The Joomla project recommends upgrading your site to PHP %2$s or later which will receive security updates at least until %3$s. Please ask your host to make PHP %2$s or a later version the default version for your site. If your host is already PHP %2$s ready please enable PHP %2$s on your site's root and 'administrator' directories – typically you can do this yourself through a tool in your hosting control panel, but it's best to ask your host if you are unsure." +PLG_QUICKICON_PHPVERSIONCHECK_XML_DESCRIPTION="Checks the support status of your installation's PHP version and raises a warning if not fully supported." diff --git a/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.sys.ini b/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.sys.ini new file mode 100644 index 0000000000000..bae32945de9e0 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_quickicon_phpversioncheck.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_QUICKICON_PHPVERSIONCHECK="Quick Icon - PHP Version Check" +PLG_QUICKICON_PHPVERSIONCHECK_XML_DESCRIPTION="Checks the support status of your installation's PHP version and raises a warning if not fully supported." diff --git a/administrator/language/en-GB/en-GB.plg_search_content.ini b/administrator/language/en-GB/en-GB.plg_search_content.ini index 786665b3fd976..6b0070441d20b 100644 --- a/administrator/language/en-GB/en-GB.plg_search_content.ini +++ b/administrator/language/en-GB/en-GB.plg_search_content.ini @@ -4,7 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 PLG_SEARCH_CONTENT="Search - Content" -PLG_SEARCH_CONTENT_FIELD_ARCHIVED_DESC="Enables searching of Archived Articles?" +PLG_SEARCH_CONTENT_FIELD_ARCHIVED_DESC="Enables searching of Archived Articles." PLG_SEARCH_CONTENT_FIELD_ARCHIVED_LABEL="Archived Articles" PLG_SEARCH_CONTENT_FIELD_CONTENT_DESC="Enables searching of all Articles." PLG_SEARCH_CONTENT_FIELD_CONTENT_LABEL="Articles" diff --git a/administrator/language/en-GB/en-GB.plg_system_debug.ini b/administrator/language/en-GB/en-GB.plg_system_debug.ini index 1b1fcd3359fe6..d7cbd165eb224 100644 --- a/administrator/language/en-GB/en-GB.plg_system_debug.ini +++ b/administrator/language/en-GB/en-GB.plg_system_debug.ini @@ -24,7 +24,7 @@ PLG_DEBUG_FIELD_LOGS_DESC="Display a list of logged messages." PLG_DEBUG_FIELD_LOGS_LABEL="Show Log Entries" PLG_DEBUG_FIELD_LOG_CATEGORIES_DESC="A comma separated list of log categories to include. Common log categories include but are not limited to: database, databasequery, database-error, deprecated and jerror. If empty, all categories will be shown." PLG_DEBUG_FIELD_LOG_CATEGORIES_LABEL="Log Categories" -PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_DESC="Select whether the listed categories should be included or excluded." +PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_DESC="Select if the listed categories should be included or excluded." PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_EXCLUDE="Exclude" PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_INCLUDE="Include" PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_LABEL="Log Category Mode" @@ -51,6 +51,8 @@ PLG_DEBUG_FIELD_QUERIES_DESC="Display a list of the queries executed while displ PLG_DEBUG_FIELD_QUERIES_LABEL="Show Queries" PLG_DEBUG_FIELD_QUERY_TYPES_DESC="Display a list of unique query types and their number of occurrences for the current page. Useful for finding out about repeated queries that are either redundant or which can be grouped into a single, more efficient query." PLG_DEBUG_FIELD_QUERY_TYPES_LABEL="Show Query Types" +PLG_DEBUG_FIELD_SESSION_DESC="Display the session data." +PLG_DEBUG_FIELD_SESSION_LABEL="Show Session Data" PLG_DEBUG_FIELD_STRIP_FIRST_DESC="In multi-word strings, always strip the first word." PLG_DEBUG_FIELD_STRIP_FIRST_LABEL="Strip First Word" PLG_DEBUG_FIELD_STRIP_PREFIX_DESC="Strip words from the beginning of the string. For multiple words, use the format: (word1|word2)." diff --git a/administrator/language/en-GB/en-GB.plg_system_fields.ini b/administrator/language/en-GB/en-GB.plg_system_fields.ini new file mode 100644 index 0000000000000..356d897e3331e --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_system_fields.ini @@ -0,0 +1,14 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_FIELDS="System - Fields" +PLG_SYSTEM_FIELDS_CONFIG_DISPLAY_AFTER_DISPLAY="After Display" +PLG_SYSTEM_FIELDS_CONFIG_DISPLAY_AFTER_TITLE="After Title" +PLG_SYSTEM_FIELDS_CONFIG_DISPLAY_BEFORE_DISPLAY="Before Display" +PLG_SYSTEM_FIELDS_CONFIG_DISPLAY_DESC="Joomla offers several content events which are triggered during content creation process. Here you can define how the custom fields should be integrated into content." +PLG_SYSTEM_FIELDS_CONFIG_DISPLAY_LABEL="Automatic Display" +PLG_SYSTEM_FIELDS_CONFIG_PREPARE_CONTENT_DESC="Should the content be parsed for commands like {{#fields}}?" +PLG_SYSTEM_FIELDS_CONFIG_PREPARE_CONTENT_LABEL="Prepare Content" +PLG_SYSTEM_FIELDS_XML_DESCRIPTION="The system fields plugin lets display the custom fields." diff --git a/administrator/language/en-GB/en-GB.plg_system_fields.sys.ini b/administrator/language/en-GB/en-GB.plg_system_fields.sys.ini new file mode 100644 index 0000000000000..1ae5ca86e4de0 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_system_fields.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_FIELDS="System - Fields" +PLG_SYSTEM_FIELDS_XML_DESCRIPTION="The system fields plugin lets display the custom fields." diff --git a/administrator/language/en-GB/en-GB.plg_system_languagefilter.ini b/administrator/language/en-GB/en-GB.plg_system_languagefilter.ini index 6e1cf8ead6995..d6e765e41adfb 100644 --- a/administrator/language/en-GB/en-GB.plg_system_languagefilter.ini +++ b/administrator/language/en-GB/en-GB.plg_system_languagefilter.ini @@ -5,15 +5,15 @@ PLG_SYSTEM_LANGUAGEFILTER="System - Language Filter" PLG_SYSTEM_LANGUAGEFILTER_BROWSER_SETTINGS="Browser Settings" -PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_DESC="Add alternative meta tags for menu items with associated menu items in other languages." +PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_DESC="Add alternative meta tags for items with associated items in other languages." PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_LABEL="Add Alternate Meta Tags" PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_DESC="This option will automatically change the content language used in the Frontend when a user site language is changed." PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_LABEL="Automatic Language Change" PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_DESC="Language cookies can be set to expire at the end of the session or after a year. Default is session." PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_LABEL="Cookie Lifetime" PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_DESC="Choose site default language or try to detect the browser settings language. It will default to site language if browser settings can't be found." -PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_LABEL="Language Selection for new Visitors." -PLG_SYSTEM_LANGUAGEFILTER_FIELD_ITEM_ASSOCIATIONS_DESC="This option will allow item associations when switching from one language to another." +PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_LABEL="Language Selection for new Visitors" +PLG_SYSTEM_LANGUAGEFILTER_FIELD_ITEM_ASSOCIATIONS_DESC="This option will allow item associations when switching from one language to another. Default home menu items are always associated." PLG_SYSTEM_LANGUAGEFILTER_FIELD_ITEM_ASSOCIATIONS_LABEL="Item Associations" PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_DESC="This option will add x-default meta tag to improve SEO." PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_LABEL="Add x-default Meta Tag" diff --git a/administrator/language/en-GB/en-GB.plg_system_logout.ini b/administrator/language/en-GB/en-GB.plg_system_logout.ini index 7437d006b83fc..132d8fcb5a5ba 100644 --- a/administrator/language/en-GB/en-GB.plg_system_logout.ini +++ b/administrator/language/en-GB/en-GB.plg_system_logout.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -PLG_SYSTEM_LOGOUT_XML_DESCRIPTION="The system logout plugin enables Joomla to redirect the user to the home page if he chooses to logout while he is on a protected access page." +PLG_SYSTEM_LOGOUT_XML_DESCRIPTION="The system logout plugin enables Joomla to redirect the user to the home page if they choose to logout while they are on a protected access page." PLG_SYSTEM_LOGOUT="System - Logout" PLG_SYSTEM_LOGOUT_REDIRECT="You have been redirected to the home page following logout." diff --git a/administrator/language/en-GB/en-GB.plg_system_logout.sys.ini b/administrator/language/en-GB/en-GB.plg_system_logout.sys.ini index 9a4604228e968..b41e59ff830e3 100644 --- a/administrator/language/en-GB/en-GB.plg_system_logout.sys.ini +++ b/administrator/language/en-GB/en-GB.plg_system_logout.sys.ini @@ -3,5 +3,5 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -PLG_SYSTEM_LOGOUT_XML_DESCRIPTION="The system logout plugin enables Joomla to redirect the user to the home page if he chooses to logout while he is on a protected access page." +PLG_SYSTEM_LOGOUT_XML_DESCRIPTION="The system logout plugin enables Joomla to redirect the user to the home page if they choose to logout while they are on a protected access page." PLG_SYSTEM_LOGOUT="System - Logout" diff --git a/administrator/language/en-GB/en-GB.plg_system_sef.ini b/administrator/language/en-GB/en-GB.plg_system_sef.ini index 3ebd7be2fdc94..2af8f4f1f81ea 100644 --- a/administrator/language/en-GB/en-GB.plg_system_sef.ini +++ b/administrator/language/en-GB/en-GB.plg_system_sef.ini @@ -6,4 +6,4 @@ PLG_SEF_XML_DESCRIPTION="Adds SEF support to links in the document. It operates directly on the HTML and does not require a special tag." PLG_SYSTEM_SEF="System - SEF" PLG_SEF_DOMAIN_LABEL="Site Domain" -PLG_SEF_DOMAIN_DESCRIPTION="If your site can be accessed through more than one domain enter the canonical one here." +PLG_SEF_DOMAIN_DESCRIPTION="If your site can be accessed through more than one domain enter the preferred (sometimes referred to as canonical) domain here.
    Note: https://example.com and https://www.example.com are different domains." \ No newline at end of file diff --git a/administrator/language/en-GB/en-GB.plg_system_updatenotification.ini b/administrator/language/en-GB/en-GB.plg_system_updatenotification.ini index afef0caa199be..94227ed393176 100644 --- a/administrator/language/en-GB/en-GB.plg_system_updatenotification.ini +++ b/administrator/language/en-GB/en-GB.plg_system_updatenotification.ini @@ -6,16 +6,19 @@ PLG_SYSTEM_UPDATENOTIFICATION="System - Joomla! Update Notification" PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_LBL="Super User Emails" PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_DESC="A comma separated list of the email addresses which will receive the update notification emails. The addresses in the list MUST belong to existing users of your site who have the Super User privilege. If none of the listed emails belongs to Super Users, or if it's left blank, all Super Users of this site will receive the update notification email." -PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL="Email language" -PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC="If you choose Auto (default), the update notification email to Super Users will be in the site language at the time the plugin is triggered. By selecting a language here you are forcing the update notification emails to be sent in this specific language." -PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE="Auto" ; You can use the following merge codes: ; [NEWVERSION] New Joomla! version, e.g. 1.2.3 ; [CURVERSION] Currently installed Joomla! version, e.g. 1.2.0 ; [SITENAME] Site name, as set in Global Configuration. -; [URL] URL of the site's front-end page. +; [URL] URL of the site's frontend page. ; [LINK] Update URL (link to com_joomlaupdate, will request login if the Super User isn't already logged in). ; \n Newline character. Use it to start a new line in the email. PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT="Joomla! Update available for [SITENAME] – [URL]" -PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by Joomla.org. It is sent automatically by your own site,\n[SITENAME]\n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: [CURVERSION]\nJoomla! version available for installation: [NEWVERSION]\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on [SITENAME] please click the following link. (If the URL is not a link, simply copy & paste it to your browser).\n\nUpdate link: [LINK]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]" +PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY="This email IS NOT sent by Joomla.org. It is sent automatically by your own site,\n[SITENAME] - [URL] \n\n================================================================================\nUPDATE INFORMATION\n================================================================================\n\nYour site has discovered that there is an updated version of Joomla! available for download.\n\nJoomla! version currently installed: [CURVERSION]\nJoomla! version available for installation: [NEWVERSION]\n\nThis email is sent to you by your site to remind you of this fact.\nThe Joomla! project will never contact you directly about available updates of Joomla! on your site.\n\n================================================================================\nUPDATE INSTRUCTIONS\n================================================================================\n\nTo install the update on [SITENAME] please click the following link. (If the URL is not a link, simply copy & paste it to your browser).\n\nUpdate link: [LINK]\n\n================================================================================\nWHY AM I RECEIVING THIS EMAIL?\n================================================================================\n\nThis email has been automatically sent by a plugin provided by Joomla!, the software which powers your site.\nThis plugin looks for updated versions of Joomla! and sends an email notification to its administrators.\nYou will receive several similar emails from your site until you either update the software or disable these emails.\n\nTo disable these emails, please unpublish the 'System - Joomla! Update Notification' plugin in the Plugin Manager on your site.\n\nIf you do not understand what Joomla! is and what you need to do please do not contact the Joomla! project.\nThey are NOT sending you this email and they cannot help you. Instead, please contact the person who built or manages your site.\n\nIf you are the person who built or manages your website, please note that this plugin may have been activated automatically when you installed or updated Joomla! on your site.\n\n================================================================================\nWHO SENT ME THIS EMAIL?\n================================================================================\n\nThis email is sent to you by your own site, [SITENAME]" +PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_LBL="Email Language" +PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_DESC="If you choose Auto (default), the update notification email to Super Users will be in the site language at the time the plugin is triggered. By selecting a language here you are forcing the update notification emails to be sent in this specific language." +PLG_SYSTEM_UPDATENOTIFICATION_LANGUAGE_OVERRIDE_NONE="Auto" +PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME="The Joomla! Update Notification will not run in this configuration" +PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_BODY="In your Installer Configuration you have set the Option Update Cache (in Hours) to 0 this means that Joomla is not caching the Update. This means an email should be sent on every page visit but this is not possible. Please increase the value (6 is default) or confirm that the Joomla! Update Notification will never send you mails." +PLG_SYSTEM_UPDATENOTIFICATION_POSTINSTALL_UPDATECACHETIME_ACTION="Set it back to the default setting (6 Hours)" PLG_SYSTEM_UPDATENOTIFICATION_XML_DESCRIPTION="This plugin periodically checks for the availability of new Joomla! versions. When one is found it will send you an email, reminding you to update Joomla!. Pro Tip: You can customise the email message by overriding the language string keys PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_SUBJECT and PLG_SYSTEM_UPDATENOTIFICATION_EMAIL_BODY." diff --git a/administrator/language/en-GB/en-GB.plg_user_profile.ini b/administrator/language/en-GB/en-GB.plg_user_profile.ini index e3401e50b2ac6..e3f4ff3b90222 100644 --- a/administrator/language/en-GB/en-GB.plg_user_profile.ini +++ b/administrator/language/en-GB/en-GB.plg_user_profile.ini @@ -40,5 +40,6 @@ PLG_USER_PROFILE_FIELD_WEB_SITE_LABEL="Website:" PLG_USER_PROFILE_FILL_FIELD_DESC_SITE="If required, please fill this field." PLG_USER_PROFILE_OPTION_AGREE="Agree" PLG_USER_PROFILE_SLIDER_LABEL="User Profile" +; Adapt the following string to the format you entered in the 'DATE_FORMAT_CALENDAR_DATE' PLG_USER_PROFILE_SPACER_DOB="The date of birth entered should use the format Year-Month-Day, ie 0000-00-00" PLG_USER_PROFILE_XML_DESCRIPTION="User Profile Plugin" diff --git a/administrator/language/en-GB/en-GB.tpl_isis.ini b/administrator/language/en-GB/en-GB.tpl_isis.ini index 947b399303655..f5e1994bb9382 100644 --- a/administrator/language/en-GB/en-GB.tpl_isis.ini +++ b/administrator/language/en-GB/en-GB.tpl_isis.ini @@ -15,6 +15,7 @@ TPL_ISIS_COLOR_SIDEBAR_DESC="Choose a colour for the Sidebar Background. If left TPL_ISIS_COLOR_SIDEBAR_LABEL="Sidebar Colour" TPL_ISIS_COLOR_LINK_DESC="Choose a colour for the Link. If left blank, the default value will be used." TPL_ISIS_COLOR_LINK_LABEL="Link Colour" +TPL_ISIS_CONTROL_PANEL="Control Panel" TPL_ISIS_EDIT_ACCOUNT="Edit Account" TPL_ISIS_FIELD_ADMIN_MENUS_DESC="If you intend to use Joomla Administrator on a monitor, set this to 'No'. It will prevent the collapse of the Administrator menus when reducing the width of the window. Default is 'Yes'." TPL_ISIS_FIELD_ADMIN_MENUS_LABEL="Collapse Administrator Menu" @@ -28,11 +29,15 @@ TPL_ISIS_LOGO_DESC="Upload a custom logo for the administrator template." TPL_ISIS_LOGO_LABEL="Logo" TPL_ISIS_LOGOUT="Logout" TPL_ISIS_PREVIEW="Preview %s" +TPL_ISIS_SKIP_TO_MAIN_CONTENT="Skip to Main Content" +TPL_ISIS_SKIP_TO_MAIN_CONTENT_HERE="Main content begins here" TPL_ISIS_STATUS_BOTTOM="Fixed bottom" TPL_ISIS_STATUS_DESC="Choose the location of the status module." TPL_ISIS_STATUS_LABEL="Status Module Position" TPL_ISIS_STATUS_TOP="Top" TPL_ISIS_STICKY_DESC="Optionally set the toolbar to a fixed (pinned) location." TPL_ISIS_STICKY_LABEL="Pinned Toolbar" +TPL_ISIS_TOGGLE_MENU="Toggle Navigation" TPL_ISIS_TOOLBAR="Toolbar" +TPL_ISIS_USERMENU="User Menu" TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap and the launch of the Joomla User Interface library (JUI)." diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index c28e318aa845f..4ec7884662b53 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -1,21 +1,23 @@ English (en-GB) - 3.6.0 - April 2016 + 3.6.4 + October 2016 Joomla! Project admin@joomla.org www.joomla.org Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - en-GB administrator language + English (en-GB) + English (United Kingdom) en-GB 0 en_GB.utf8, en_GB.UTF-8, en_GB, eng_GB, en, english, english-uk, uk, gbr, britain, england, great britain, uk, united kingdom, united-kingdom 0 0,6 + gregorian diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 1a9f91cbbca5a..65d1b79e98c20 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -1,9 +1,9 @@ - English (United Kingdom) + English (en-GB) en-GB - 3.6.0 - April 2016 + 3.6.4 + October 2016 Joomla! Project admin@joomla.org www.joomla.org @@ -139,8 +139,12 @@ en-GB.plg_editors_tinymce.sys.ini en-GB.plg_editors-xtd_article.ini en-GB.plg_editors-xtd_article.sys.ini + en-GB.plg_editors-xtd_contact.ini + en-GB.plg_editors-xtd_contact.sys.ini en-GB.plg_editors-xtd_image.ini en-GB.plg_editors-xtd_image.sys.ini + en-GB.plg_editors-xtd_menu.ini + en-GB.plg_editors-xtd_menu.sys.ini en-GB.plg_editors-xtd_module.ini en-GB.plg_editors-xtd_module.sys.ini en-GB.plg_editors-xtd_pagebreak.ini @@ -173,6 +177,8 @@ en-GB.plg_quickicon_extensionupdate.sys.ini en-GB.plg_quickicon_joomlaupdate.ini en-GB.plg_quickicon_joomlaupdate.sys.ini + en-GB.plg_quickicon_phpversioncheck.ini + en-GB.plg_quickicon_phpversioncheck.sys.ini en-GB.plg_search_categories.ini en-GB.plg_search_categories.sys.ini en-GB.plg_search_contacts.ini diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index cdcc742530805..9b84fb3a3707c 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2005 - 2016 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.6.0-dev - May 2016 + 3.7.0-dev + October 2016 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php @@ -47,7 +47,7 @@ - https://update.joomla.org/core/list.xml - https://update.joomla.org/jed/list.xml + https://update.joomla.org/core/list.xml + https://update.joomla.org/jed/list.xml diff --git a/administrator/manifests/libraries/fof.xml b/administrator/manifests/libraries/fof.xml index 80dc1d82aa9e7..1b91bb7f6018e 100644 --- a/administrator/manifests/libraries/fof.xml +++ b/administrator/manifests/libraries/fof.xml @@ -1,6 +1,6 @@ - FOF + FOF fof LIB_FOF_XML_DESCRIPTION 2015-04-22 13:15:32 diff --git a/administrator/manifests/libraries/idna_convert.xml b/administrator/manifests/libraries/idna_convert.xml index 8c5d29d5cb73c..4b1d9909e916f 100644 --- a/administrator/manifests/libraries/idna_convert.xml +++ b/administrator/manifests/libraries/idna_convert.xml @@ -1,6 +1,6 @@ - IDNA Convert + LIB_IDNA idna_convert 0.8.0 LIB_IDNA_XML_DESCRIPTION diff --git a/administrator/manifests/libraries/joomla.xml b/administrator/manifests/libraries/joomla.xml index d6711dee765c0..a104b07487cbc 100644 --- a/administrator/manifests/libraries/joomla.xml +++ b/administrator/manifests/libraries/joomla.xml @@ -1,6 +1,6 @@ - Joomla! Platform + LIB_JOOMLA joomla 13.1 LIB_JOOMLA_XML_DESCRIPTION diff --git a/administrator/manifests/libraries/phpass.xml b/administrator/manifests/libraries/phpass.xml index b4551de6d77a9..55bb9d50383bf 100644 --- a/administrator/manifests/libraries/phpass.xml +++ b/administrator/manifests/libraries/phpass.xml @@ -1,6 +1,6 @@ - PHPass + LIB_PHPASS phpass LIB_PHPASS_XML_DESCRIPTION 2004-2006 diff --git a/administrator/manifests/libraries/phputf8.xml b/administrator/manifests/libraries/phputf8.xml index 2f10b0b6eb622..cbf41bb387b1b 100644 --- a/administrator/manifests/libraries/phputf8.xml +++ b/administrator/manifests/libraries/phputf8.xml @@ -1,6 +1,6 @@ - phputf8 + LIB_PHPUTF8 phputf8 0.5 LIB_PHPUTF8_XML_DESCRIPTION diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index b5fdec094cf3e..f54deffd38c69 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -2,8 +2,8 @@ English (en-GB) Language Pack en-GB - 3.6.0.1 - 2016-05-01 + 3.6.4.1 + October 2016 Joomla! Project admin@joomla.org www.joomla.org @@ -12,7 +12,7 @@ https://github.com/joomla/joomla-cms Joomla! Project www.joomla.org - en-GB language pack + site_en-GB admin_en-GB diff --git a/administrator/modules/mod_feed/mod_feed.php b/administrator/modules/mod_feed/mod_feed.php index 274246033913f..d2e1755a65f4e 100644 --- a/administrator/modules/mod_feed/mod_feed.php +++ b/administrator/modules/mod_feed/mod_feed.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the feed functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModFeedHelper', __DIR__ . '/helper.php'); $rssurl = $params->get('rssurl', ''); $rssrtl = $params->get('rssrtl', 0); diff --git a/administrator/modules/mod_latest/helper.php b/administrator/modules/mod_latest/helper.php index ea59efc5b8946..9dc0a0172b821 100644 --- a/administrator/modules/mod_latest/helper.php +++ b/administrator/modules/mod_latest/helper.php @@ -40,13 +40,13 @@ public static function getList(&$params) switch ($params->get('ordering')) { case 'm_dsc': - $model->setState('list.ordering', 'modified DESC, created'); + $model->setState('list.fullordering', 'modified DESC, created'); $model->setState('list.direction', 'DESC'); break; case 'c_dsc': default: - $model->setState('list.ordering', 'created'); + $model->setState('list.fullordering', 'created'); $model->setState('list.direction', 'DESC'); break; } diff --git a/administrator/modules/mod_latest/mod_latest.php b/administrator/modules/mod_latest/mod_latest.php index fd15cee9ee4ee..e6dab1c4d911a 100644 --- a/administrator/modules/mod_latest/mod_latest.php +++ b/administrator/modules/mod_latest/mod_latest.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include dependencies. -require_once __DIR__ . '/helper.php'; +JLoader::register('ModLatestHelper', __DIR__ . '/helper.php'); $list = ModLatestHelper::getList($params); diff --git a/administrator/modules/mod_latest/mod_latest.xml b/administrator/modules/mod_latest/mod_latest.xml index e41cd43c21452..3ae826324e519 100644 --- a/administrator/modules/mod_latest/mod_latest.xml +++ b/administrator/modules/mod_latest/mod_latest.xml @@ -79,15 +79,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - $item) : ?>

    -
    +
    state, $i, '', false); ?> checked_out) : ?> editor, $item->checked_out_time); ?> @@ -34,10 +34,10 @@ author_name; ?>
    -
    - - created, JText::_('DATE_FORMAT_LC4')); ?> - +
    +
    + created, JText::_('DATE_FORMAT_LC5')); ?> +
    diff --git a/administrator/modules/mod_logged/mod_logged.php b/administrator/modules/mod_logged/mod_logged.php index fb0c9b12d1f83..983d0d726ee4e 100644 --- a/administrator/modules/mod_logged/mod_logged.php +++ b/administrator/modules/mod_logged/mod_logged.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include dependencies. -require_once __DIR__ . '/helper.php'; +JLoader::register('ModLoggedHelper', __DIR__ . '/helper.php'); $users = ModLoggedHelper::getList($params); diff --git a/administrator/modules/mod_logged/mod_logged.xml b/administrator/modules/mod_logged/mod_logged.xml index cc81fd4310f17..19bc80b0c33bb 100644 --- a/administrator/modules/mod_logged/mod_logged.xml +++ b/administrator/modules/mod_logged/mod_logged.xml @@ -53,15 +53,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - -
    -
    +
    client_id == 0) : ?> - + @@ -31,17 +31,19 @@ - client_id) : ?> + client_id === null) : ?> + + client_id) : ?>
    -
    - - time, JText::_('DATE_FORMAT_LC2')); ?> - +
    +
    + time, JText::_('DATE_FORMAT_LC5')); ?> +
    diff --git a/administrator/modules/mod_login/helper.php b/administrator/modules/mod_login/helper.php index 906c2a59986f1..8191d4922087a 100644 --- a/administrator/modules/mod_login/helper.php +++ b/administrator/modules/mod_login/helper.php @@ -77,11 +77,13 @@ public static function getReturnUri() * on user view * * @return array + * + * @deprecated 4.0 Use JAuthenticationHelper::getTwoFactorMethods() instead. */ public static function getTwoFactorMethods() { - require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; + JLog::add(__METHOD__ . ' is deprecated, use JAuthenticationHelper::getTwoFactorMethods() instead.', JLog::WARNING, 'deprecated'); - return UsersHelper::getTwoFactorMethods(); + return JAuthenticationHelper::getTwoFactorMethods(); } } diff --git a/administrator/modules/mod_login/mod_login.php b/administrator/modules/mod_login/mod_login.php index 435226c9abc4b..a972336b4ff38 100644 --- a/administrator/modules/mod_login/mod_login.php +++ b/administrator/modules/mod_login/mod_login.php @@ -10,10 +10,10 @@ defined('_JEXEC') or die; // Include the login functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModLoginHelper', __DIR__ . '/helper.php'); $langs = ModLoginHelper::getLanguageList(); -$twofactormethods = ModLoginHelper::getTwoFactorMethods(); +$twofactormethods = JAuthenticationHelper::getTwoFactorMethods(); $return = ModLoginHelper::getReturnUri(); require JModuleHelper::getLayoutPath('mod_login', $params->get('layout', 'default')); diff --git a/administrator/modules/mod_login/mod_login.xml b/administrator/modules/mod_login/mod_login.xml index 5b2ad77da2ed5..4ed549e79a62f 100644 --- a/administrator/modules/mod_login/mod_login.xml +++ b/administrator/modules/mod_login/mod_login.xml @@ -47,15 +47,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_login/tmpl/default.php b/administrator/modules/mod_login/tmpl/default.php index cf0b435eb2f28..7384869c9d5a4 100644 --- a/administrator/modules/mod_login/tmpl/default.php +++ b/administrator/modules/mod_login/tmpl/default.php @@ -11,8 +11,12 @@ JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); -JHtml::_('formbehavior.chosen'); +// Load chosen if we have language selector, ie, more than one administrator language installed and enabled. +if ($langs) +{ + JHtml::_('formbehavior.chosen', '.advancedSelect'); +} ?>
    diff --git a/administrator/modules/mod_menu/helper.php b/administrator/modules/mod_menu/helper.php index bcd8bdcfc5fef..7dcc925d1d0e2 100644 --- a/administrator/modules/mod_menu/helper.php +++ b/administrator/modules/mod_menu/helper.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Helper for mod_menu * @@ -149,8 +151,6 @@ public static function getComponents($authCheck = true) } } - $result = JArrayHelper::sortObjects($result, 'text', 1, false, true); - - return $result; + return ArrayHelper::sortObjects($result, 'text', 1, false, true); } } diff --git a/administrator/modules/mod_menu/menu.php b/administrator/modules/mod_menu/menu.php index 56f0a7d5efd82..0f4ce184550d1 100644 --- a/administrator/modules/mod_menu/menu.php +++ b/administrator/modules/mod_menu/menu.php @@ -49,12 +49,12 @@ public function __construct() /** * Method to add a child * - * @param JMenuNode &$node The node to process + * @param JMenuNode $node The node to process * @param boolean $setCurrent True to set as current working node * * @return void */ - public function addChild(JMenuNode &$node, $setCurrent = false) + public function addChild(JMenuNode $node, $setCurrent = false) { $this->_current->addChild($node); diff --git a/administrator/modules/mod_menu/mod_menu.php b/administrator/modules/mod_menu/mod_menu.php index f1a9092ef935b..5f2e811c19006 100644 --- a/administrator/modules/mod_menu/mod_menu.php +++ b/administrator/modules/mod_menu/mod_menu.php @@ -10,20 +10,13 @@ defined('_JEXEC') or die; // Include the module helper classes. -if (!class_exists('ModMenuHelper')) -{ - require __DIR__ . '/helper.php'; -} - -if (!class_exists('JAdminCssMenu')) -{ - require __DIR__ . '/menu.php'; -} +JLoader::register('ModMenuHelper', __DIR__ . '/helper.php'); +JLoader::register('JAdminCssMenu', __DIR__ . '/menu.php'); $lang = JFactory::getLanguage(); $user = JFactory::getUser(); $input = JFactory::getApplication()->input; -$menu = new JAdminCSSMenu; +$menu = new JAdminCssMenu; $enabled = $input->getBool('hidemainmenu') ? false : true; // Render the module layout diff --git a/administrator/modules/mod_menu/mod_menu.xml b/administrator/modules/mod_menu/mod_menu.xml index 391cc99acd50a..982ec2de78ff7 100644 --- a/administrator/modules/mod_menu/mod_menu.xml +++ b/administrator/modules/mod_menu/mod_menu.xml @@ -66,15 +66,6 @@ description="MOD_MENU_FIELD_FORUMURL_DESC" /> - - -
    diff --git a/administrator/modules/mod_menu/tmpl/default.php b/administrator/modules/mod_menu/tmpl/default.php index 15299b57dcd3c..5bbf3dbb11128 100644 --- a/administrator/modules/mod_menu/tmpl/default.php +++ b/administrator/modules/mod_menu/tmpl/default.php @@ -9,8 +9,8 @@ defined('_JEXEC') or die; -$document = JFactory::getDocument(); -$direction = $document->direction == 'rtl' ? 'pull-right' : ''; +$direction = JFactory::getDocument()->direction == 'rtl' ? 'pull-right' : ''; + require JModuleHelper::getLayoutPath('mod_menu', $enabled ? 'default_enabled' : 'default_disabled'); $menu->renderMenu('menu', $enabled ? 'nav ' . $direction : 'nav disabled ' . $direction); diff --git a/administrator/modules/mod_menu/tmpl/default_disabled.php b/administrator/modules/mod_menu/tmpl/default_disabled.php index 30e0d0a3dc689..750ff5678012c 100644 --- a/administrator/modules/mod_menu/tmpl/default_disabled.php +++ b/administrator/modules/mod_menu/tmpl/default_disabled.php @@ -9,16 +9,14 @@ defined('_JEXEC') or die; -$showhelp = $params->get('showhelp', 1); - /** * Site SubMenu -**/ + */ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), null, 'disabled')); /** * Users Submenu -**/ + */ if ($user->authorise('core.manage', 'com_users')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_USERS'), null, 'disabled')); @@ -26,7 +24,7 @@ /** * Menus Submenu -**/ + */ if ($user->authorise('core.manage', 'com_menus')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS'), null, 'disabled')); @@ -34,7 +32,7 @@ /** * Content Submenu -**/ + */ if ($user->authorise('core.manage', 'com_content')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), null, 'disabled')); @@ -42,7 +40,7 @@ /** * Components Submenu -**/ + */ // Get the authorised components and sub-menus. $components = ModMenuHelper::getComponents(true); @@ -55,7 +53,7 @@ /** * Extensions Submenu -**/ + */ $im = $user->authorise('core.manage', 'com_installer'); $mm = $user->authorise('core.manage', 'com_modules'); $pm = $user->authorise('core.manage', 'com_plugins'); @@ -69,7 +67,8 @@ /** * Help Submenu -**/ -if ($showhelp == 1) { -$menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled')); + */ +if ($params->get('showhelp', 1)) +{ + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP'), null, 'disabled')); } diff --git a/administrator/modules/mod_menu/tmpl/default_enabled.php b/administrator/modules/mod_menu/tmpl/default_enabled.php index 766ab65a7573d..213c8f8800e38 100644 --- a/administrator/modules/mod_menu/tmpl/default_enabled.php +++ b/administrator/modules/mod_menu/tmpl/default_enabled.php @@ -9,14 +9,16 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /* @var $menu JAdminCSSMenu */ -$shownew = (boolean) $params->get('shownew', 1); -$showhelp = $params->get('showhelp', 1); -$user = JFactory::getUser(); -$lang = JFactory::getLanguage(); +$shownew = (boolean) $params->get('shownew', 1); +$showhelp = (boolean) $params->get('showhelp', 1); +$user = JFactory::getUser(); +$lang = JFactory::getLanguage(); -/* +/** * Site Submenu */ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_SYSTEM'), '#'), true); @@ -48,7 +50,7 @@ $menu->getParent(); -/* +/** * Users Submenu */ if ($user->authorise('core.manage', 'com_users')) @@ -110,6 +112,19 @@ $menu->getParent(); } + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_users')->get('custom_fields_enable', '1')) + { + $menu->addChild( + new JMenuNode( + JText::_('MOD_MENU_FIELDS'), 'index.php?option=com_fields&context=com_users.user', 'class:fields') + ); + + $menu->addChild( + new JMenuNode( + JText::_('MOD_MENU_FIELDS_GROUP'), 'index.php?option=com_categories&extension=com_users.user.fields', 'class:category') + ); + } + if (JFactory::getApplication()->get('massmailoff') != 1) { $menu->addSeparator(); @@ -119,7 +134,7 @@ $menu->getParent(); } -/* +/** * Menus Submenu */ if ($user->authorise('core.manage', 'com_menus')) @@ -137,13 +152,12 @@ $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS_ALL_ITEMS'), 'index.php?option=com_menus&view=items&menutype=*', 'class:menumgr'), $createMenu); - $menu->getParent(); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_MENUS_ALL_ITEMS'), 'index.php?option=com_menus&view=items&menutype=', 'class:allmenu')); $menu->addSeparator(); // Menu Types $menuTypes = ModMenuHelper::getMenus(); - $menuTypes = JArrayHelper::sortObjects($menuTypes, 'title', 1, false); + $menuTypes = ArrayHelper::sortObjects($menuTypes, 'title', 1, false); foreach ($menuTypes as $menuType) { @@ -168,20 +182,13 @@ . JHtml::_('image', 'mod_languages/icon-16-language.png', $menuType->home, array('title' => JText::_('MOD_MENU_HOME_MULTIPLE')), true) . ''; } + elseif ($menuType->image && JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true)) + { + $titleicon = ' ' . JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true) . ''; + } else { - $image = JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', null, null, true, true); - - if (!$image) - { - $image = JHtml::_('image', 'mod_languages/icon-16-language.png', $alt, array('title' => $menuType->title_native), true); - } - else - { - $image = JHtml::_('image', 'mod_languages/' . $menuType->image . '.gif', $alt, array('title' => $menuType->title_native), true); - } - - $titleicon = ' ' . $image . ''; + $titleicon = ' ' . $menuType->sef . ''; } $menu->addChild( @@ -206,13 +213,14 @@ $menu->getParent(); } -/* +/** * Content Submenu */ if ($user->authorise('core.manage', 'com_content')) { $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT'), '#'), true); $createContent = $shownew && $user->authorise('core.create', 'com_content'); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_ARTICLE_MANAGER'), 'index.php?option=com_content', 'class:article'), $createContent); if ($createContent) @@ -237,6 +245,19 @@ $menu->getParent(); } + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1')) + { + $menu->addChild( + new JMenuNode( + JText::_('MOD_MENU_FIELDS'), 'index.php?option=com_fields&context=com_content.article', 'class:fields') + ); + + $menu->addChild( + new JMenuNode( + JText::_('MOD_MENU_FIELDS_GROUP'), 'index.php?option=com_categories&extension=com_content.article.fields', 'class:category') + ); + } + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_COM_CONTENT_FEATURED'), 'index.php?option=com_content&view=featured', 'class:featured')); if ($user->authorise('core.manage', 'com_media')) @@ -248,7 +269,7 @@ $menu->getParent(); } -/* +/** * Components Submenu */ @@ -283,7 +304,7 @@ $menu->getParent(); } -/* +/** * Extensions Submenu */ $im = $user->authorise('core.manage', 'com_installer'); @@ -348,7 +369,7 @@ $menu->getParent(); } -/* +/** * Help Submenu */ if ($showhelp == 1) @@ -357,7 +378,7 @@ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_JOOMLA'), 'index.php?option=com_admin&view=help', 'class:help')); $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'http://forum.joomla.org', 'class:help-forum', false, '_blank')); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM'), 'https://forum.joomla.org/', 'class:help-forum', false, '_blank')); if ($forum_url = $params->get('forum_url')) { @@ -368,7 +389,7 @@ if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '') { - $forum_url = 'http://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE'); + $forum_url = 'https://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE'); $lang->setDebug($debug); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')); } @@ -377,17 +398,17 @@ $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DOCUMENTATION'), 'https://docs.joomla.org', 'class:help-docs', false, '_blank')); $menu->addSeparator(); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'http://extensions.joomla.org', 'class:help-jed', false, '_blank')); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_EXTENSIONS'), 'https://extensions.joomla.org', 'class:help-jed', false, '_blank')); $menu->addChild( - new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'http://community.joomla.org/translations.html', 'class:help-trans', false, '_blank') + new JMenuNode(JText::_('MOD_MENU_HELP_TRANSLATIONS'), 'https://community.joomla.org/translations.html', 'class:help-trans', false, '_blank') ); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_RESOURCES'), 'http://resources.joomla.org', 'class:help-jrd', false, '_blank')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'http://community.joomla.org', 'class:help-community', false, '_blank')); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_COMMUNITY'), 'https://community.joomla.org', 'class:help-community', false, '_blank')); $menu->addChild( new JMenuNode(JText::_('MOD_MENU_HELP_SECURITY'), 'https://developer.joomla.org/security-centre.html', 'class:help-security', false, '_blank') ); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_DEVELOPER'), 'https://developer.joomla.org', 'class:help-dev', false, '_blank')); $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_XCHANGE'), 'https://joomla.stackexchange.com', 'class:help-dev', false, '_blank')); - $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'https://shop.joomla.org', 'class:help-shop', false, '_blank')); + $menu->addChild(new JMenuNode(JText::_('MOD_MENU_HELP_SHOP'), 'https://community.joomla.org/the-joomla-shop.html', 'class:help-shop', false, '_blank')); $menu->getParent(); } diff --git a/administrator/modules/mod_multilangstatus/mod_multilangstatus.xml b/administrator/modules/mod_multilangstatus/mod_multilangstatus.xml index c6e600b32f694..3258571e75fe5 100644 --- a/administrator/modules/mod_multilangstatus/mod_multilangstatus.xml +++ b/administrator/modules/mod_multilangstatus/mod_multilangstatus.xml @@ -9,6 +9,7 @@ www.joomla.org 3.0.0 MOD_MULTILANGSTATUS_XML_DESCRIPTION + mod_multilangstatus.php tmpl @@ -19,31 +20,29 @@ language/en-GB/en-GB.mod_multilangstatus.ini language/en-GB/en-GB.mod_multilangstatus.sys.ini + + + +
    + + description="JFIELD_ALT_MODULE_LAYOUT_DESC" + /> + description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" + /> - - -
    diff --git a/administrator/modules/mod_multilangstatus/tmpl/default.php b/administrator/modules/mod_multilangstatus/tmpl/default.php index 2a7bc117b8ef7..0bea98048f108 100644 --- a/administrator/modules/mod_multilangstatus/tmpl/default.php +++ b/administrator/modules/mod_multilangstatus/tmpl/default.php @@ -14,32 +14,35 @@ // Use javascript to remove the modal added below from the current div and add it to the end of html body tag. JFactory::getDocument()->addScriptDeclaration(" -jQuery(document).ready(function($) { - var multilangueModal = $('#multiLangModal').clone(); - $('#multiLangModal').remove(); - $('body').append(multilangueModal); -});"); - -$link = JRoute::_('index.php?option=com_languages&view=multilangstatus&tmpl=component'); -$footer = ''; + jQuery(document).ready(function($) { + var multilangueModal = $('#multiLangModal').clone(); + $('#multiLangModal').remove(); + $('body').append(multilangueModal); + }); +"); ?> +
    - + +
    JText::_('MOD_MULTILANGSTATUS'), - 'backdrop' => 'static', - 'keyboard' => true, - 'closeButton' => true, - 'footer' => $footer, - 'url' => $link, - 'height' => '300px', - 'width' => '500px' - ) - ); + 'title' => JText::_('MOD_MULTILANGSTATUS'), + 'url' => JRoute::_('index.php?option=com_languages&view=multilangstatus&tmpl=component'), + 'height' => '400px', + 'width' => '800px', + 'bodyHeight' => '70', + 'modalWidth' => '80', + 'footer' => '', + ) +); diff --git a/administrator/modules/mod_popular/helper.php b/administrator/modules/mod_popular/helper.php index 9a72c4b740aa0..8591798606892 100644 --- a/administrator/modules/mod_popular/helper.php +++ b/administrator/modules/mod_popular/helper.php @@ -37,7 +37,7 @@ public static function getList(&$params) ' a.created, a.hits'); // Set Ordering filter - $model->setState('list.ordering', 'a.hits'); + $model->setState('list.fullordering', 'a.hits DESC'); $model->setState('list.direction', 'DESC'); // Set Category Filter diff --git a/administrator/modules/mod_popular/mod_popular.php b/administrator/modules/mod_popular/mod_popular.php index 114a5a3e065aa..24462df1d0883 100644 --- a/administrator/modules/mod_popular/mod_popular.php +++ b/administrator/modules/mod_popular/mod_popular.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the mod_popular functions only once. -require_once __DIR__ . '/helper.php'; +JLoader::register('ModPopularHelper', __DIR__ . '/helper.php'); // Get module data. $list = ModPopularHelper::getList($params); diff --git a/administrator/modules/mod_popular/mod_popular.xml b/administrator/modules/mod_popular/mod_popular.xml index eb18da8ff5786..cec812974518c 100644 --- a/administrator/modules/mod_popular/mod_popular.xml +++ b/administrator/modules/mod_popular/mod_popular.xml @@ -68,15 +68,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - hits; ?> = 10000 ? 'important' : ($hits >= 1000 ? 'warning' : ($hits >= 100 ? 'info' : ''))); ?>
    -
    +
    hits; ?> checked_out) : ?> editor, $item->checked_out_time); ?> @@ -33,11 +33,10 @@
    -
    - - - created, JText::_('DATE_FORMAT_LC4')); ?> - +
    +
    + created, JText::_('DATE_FORMAT_LC5')); ?> +
    diff --git a/administrator/modules/mod_quickicon/mod_quickicon.php b/administrator/modules/mod_quickicon/mod_quickicon.php index b52bf4525dab1..52cbe3838842d 100644 --- a/administrator/modules/mod_quickicon/mod_quickicon.php +++ b/administrator/modules/mod_quickicon/mod_quickicon.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/helper.php'; +JLoader::register('ModQuickIconHelper', __DIR__ . '/helper.php'); $buttons = ModQuickIconHelper::getButtons($params); diff --git a/administrator/modules/mod_stats_admin/helper.php b/administrator/modules/mod_stats_admin/helper.php index 1217dfd9c182a..f156f70c78360 100644 --- a/administrator/modules/mod_stats_admin/helper.php +++ b/administrator/modules/mod_stats_admin/helper.php @@ -131,6 +131,7 @@ public static function getStats(&$params) ->from('#__weblinks') ->where('state = 1'); $db->setQuery($query); + try { $links = $db->loadResult(); @@ -158,6 +159,7 @@ public static function getStats(&$params) ->from('#__content') ->where('state = 1'); $db->setQuery($query); + try { $hits = $db->loadResult(); @@ -172,7 +174,30 @@ public static function getStats(&$params) $rows[$i] = new stdClass; $rows[$i]->title = JText::_('MOD_STATS_ARTICLES_VIEW_HITS'); $rows[$i]->icon = 'eye'; - $rows[$i]->data = $hits + $increase; + $rows[$i]->data = number_format($hits + $increase, 0, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR')); + $i++; + } + } + + // Include additional data defined by published system plugins + JPluginHelper::importPlugin('system'); + + $app = JFactory::getApplication(); + $arrays = (array) $app->triggerEvent('onGetStats', array('mod_stats_admin')); + + foreach ($arrays as $response) + { + foreach ($response as $row) + { + // We only add a row if the title and data are given + if (isset($row['title']) && isset($row['data'])) + { + $rows[$i] = new stdClass; + $rows[$i]->title = $row['title']; + $rows[$i]->icon = isset($row['icon']) ? $row['icon'] : 'info'; + $rows[$i]->data = $row['data']; + $i++; + } } } diff --git a/administrator/modules/mod_stats_admin/mod_stats_admin.php b/administrator/modules/mod_stats_admin/mod_stats_admin.php index 20624106c09cc..d66d624e410f6 100644 --- a/administrator/modules/mod_stats_admin/mod_stats_admin.php +++ b/administrator/modules/mod_stats_admin/mod_stats_admin.php @@ -10,7 +10,7 @@ defined('_JEXEC') or die; // Include the mod_stats functions only once -require_once __DIR__ . '/helper.php'; +JLoader::register('ModStatsHelper', __DIR__ . '/helper.php'); $serverinfo = $params->get('serverinfo'); $siteinfo = $params->get('siteinfo'); diff --git a/administrator/modules/mod_status/mod_status.php b/administrator/modules/mod_status/mod_status.php index 9b0d97347c158..5f8ab5a48f138 100644 --- a/administrator/modules/mod_status/mod_status.php +++ b/administrator/modules/mod_status/mod_status.php @@ -24,14 +24,19 @@ $db->setQuery($query); $unread = (int) $db->loadResult(); -// Get the number of back-end logged in users. -$query->clear() - ->select('COUNT(session_id)') - ->from('#__session') - ->where('guest = 0 AND client_id = 1'); +$count = 0; -$db->setQuery($query); -$count = (int) $db->loadResult(); +// Get the number of backend logged in users if shared sessions is not enabled. +if (!$config->get('shared_session', '0')) +{ + $query->clear() + ->select('COUNT(session_id)') + ->from('#__session') + ->where('guest = 0 AND client_id = 1'); + + $db->setQuery($query); + $count = (int) $db->loadResult(); +} // Set the inbox link. if ($input->getBool('hidemainmenu')) @@ -53,13 +58,32 @@ $inboxClass = 'no-unread-messages'; } -// Get the number of frontend logged in users. -$query->clear() - ->select('COUNT(session_id)') - ->from('#__session') - ->where('guest = 0 AND client_id = 0'); +$online_num = 0; -$db->setQuery($query); -$online_num = (int) $db->loadResult(); +// Get the number of frontend logged in users if shared sessions is not enabled. +if (!$config->get('shared_session', '0')) +{ + $query->clear() + ->select('COUNT(session_id)') + ->from('#__session') + ->where('guest = 0 AND client_id = 0'); + + $db->setQuery($query); + $online_num = (int) $db->loadResult(); +} + +$total_users = 0; + +// Get the number of logged in users if shared sessions is enabled. +if ($config->get('shared_session', '0')) +{ + $query->clear() + ->select('COUNT(session_id)') + ->from('#__session') + ->where('guest = 0'); + + $db->setQuery($query); + $total_users = (int) $db->loadResult(); +} require JModuleHelper::getLayoutPath('mod_status', $params->get('layout', 'default')); diff --git a/administrator/modules/mod_status/mod_status.xml b/administrator/modules/mod_status/mod_status.xml index d4fc9c8417cca..f37c212fb951c 100644 --- a/administrator/modules/mod_status/mod_status.xml +++ b/administrator/modules/mod_status/mod_status.xml @@ -85,15 +85,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_status/tmpl/default.php b/administrator/modules/mod_status/tmpl/default.php index 4385f1757f454..1dfa42fb48eab 100644 --- a/administrator/modules/mod_status/tmpl/default.php +++ b/administrator/modules/mod_status/tmpl/default.php @@ -16,12 +16,16 @@ // Print the Preview link to Main site. if ($params->get('show_viewsite', 1)) { + // Gets the FrontEnd Main page Uri + $frontEndUri = JUri::getInstance(JUri::root()); + $frontEndUri->setScheme(((int) JFactory::getApplication()->get('force_ssl', 0) === 2) ? 'https' : 'http'); + $output[] = '' - . '
    '; + . '' + . '
    '; } // Print the link to open a new Administrator window. @@ -31,39 +35,56 @@ . '' . '' . JText::_('MOD_STATUS_FIELD_LINK_VIEWADMIN_LABEL') . '' - . '
    ' - . '
    '; + . '' + . '
    '; } -// Print the frontend logged in users. -if ($params->get('show_loggedin_users', 1)) +// Print logged in user count based on the shared session state +if (JFactory::getConfig()->get('shared_session', '0')) { - $output[] = '
    ' - . '' . $online_num . ' ' - . JText::plural('MOD_STATUS_USERS', $online_num) - . '
    '; + // Print the frontend logged in users. + if ($params->get('show_loggedin_users', 1)) + { + $output[] = '
    ' + . '' . $total_users . '' + . JText::plural('MOD_STATUS_TOTAL_USERS', $total_users) + . '' + . '
    '; + } } - -// Print the back-end logged in users. -if ($params->get('show_loggedin_users_admin', 1)) +else { - $output[] = '
    ' - . '' . $count . ' ' - . JText::plural('MOD_STATUS_BACKEND_USERS', $count) - . '
    '; + // Print the frontend logged in users. + if ($params->get('show_loggedin_users', 1)) + { + $output[] = '
    ' + . '' . $online_num . '' + . JText::plural('MOD_STATUS_USERS', $online_num) + . '' + . '
    '; + } + + // Print the backend logged in users. + if ($params->get('show_loggedin_users_admin', 1)) + { + $output[] = '
    ' + . '' . $count . '' + . JText::plural('MOD_STATUS_BACKEND_USERS', $count) + . '' + . '
    '; + } } // Print the inbox message. if ($params->get('show_messages', 1)) { $active = $unread ? ' badge-warning' : ''; - $output[] = '
    ' + $output[] = ''; } diff --git a/administrator/modules/mod_submenu/mod_submenu.xml b/administrator/modules/mod_submenu/mod_submenu.xml index 50a14ac61777b..5f4a88eb52d4c 100644 --- a/administrator/modules/mod_submenu/mod_submenu.xml +++ b/administrator/modules/mod_submenu/mod_submenu.xml @@ -33,15 +33,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_title/mod_title.xml b/administrator/modules/mod_title/mod_title.xml index 54245917a7bef..d0013a6f244db 100644 --- a/administrator/modules/mod_title/mod_title.xml +++ b/administrator/modules/mod_title/mod_title.xml @@ -33,15 +33,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_toolbar/mod_toolbar.xml b/administrator/modules/mod_toolbar/mod_toolbar.xml index 948d5474cc070..ed7ce50fbbc51 100644 --- a/administrator/modules/mod_toolbar/mod_toolbar.xml +++ b/administrator/modules/mod_toolbar/mod_toolbar.xml @@ -33,15 +33,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_version/mod_version.php b/administrator/modules/mod_version/mod_version.php index 15a2858a98340..d2848caa4ec84 100644 --- a/administrator/modules/mod_version/mod_version.php +++ b/administrator/modules/mod_version/mod_version.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/helper.php'; +JLoader::register('ModVersionHelper', __DIR__ . '/helper.php'); $version = ModVersionHelper::getVersion($params); diff --git a/administrator/modules/mod_version/mod_version.xml b/administrator/modules/mod_version/mod_version.xml index 5cb752a55074b..6ef8e0017e041 100644 --- a/administrator/modules/mod_version/mod_version.xml +++ b/administrator/modules/mod_version/mod_version.xml @@ -60,15 +60,6 @@ label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" /> - - - diff --git a/administrator/modules/mod_version/tmpl/default.php b/administrator/modules/mod_version/tmpl/default.php index 00719a2b48247..f854a8fb161cc 100644 --- a/administrator/modules/mod_version/tmpl/default.php +++ b/administrator/modules/mod_version/tmpl/default.php @@ -10,5 +10,5 @@ defined('_JEXEC') or die; ?> -

    +

    diff --git a/administrator/templates/hathor/component.php b/administrator/templates/hathor/component.php index 110799b8fef24..71f2ef6bec923 100644 --- a/administrator/templates/hathor/component.php +++ b/administrator/templates/hathor/component.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +/** @var JDocumentHtml $this */ + // Get additional language strings prefixed with TPL_HATHOR // @todo: Do we realy need this? $lang = JFactory::getLanguage(); @@ -16,19 +18,27 @@ || $lang->load('tpl_hathor', JPATH_ADMINISTRATOR . '/templates/hathor/language'); $app = JFactory::getApplication(); -$doc = JFactory::getDocument(); + +// Output as HTML5 +$this->setHtml5(true); // jQuery needed by template.js JHtml::_('jquery.framework'); +// Add template js +JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true)); + +// Add html5 shiv +JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); + // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); // Load system style CSS -$doc->addStyleSheet($this->baseurl . '/templates/system/css/system.css'); +JHtml::_('stylesheet', 'templates/system/css/system.css', array('version' => 'auto')); // Loadtemplate CSS -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css'); +JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true)); // Load additional CSS styles for colors if (!$this->params->get('colourChoice')) @@ -40,39 +50,30 @@ $colour = htmlspecialchars($this->params->get('colourChoice')); } -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '.css'); - -// Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; - -if (is_file($file)) -{ - $doc->addStyleSheet($file); -} +JHtml::_('stylesheet', 'colour_' . $colour . '.css', array('version' => 'auto', 'relative' => true)); // Load additional CSS styles for rtl sites -if ($this->direction == 'rtl') +if ($this->direction === 'rtl') { - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css'); - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '_rtl.css'); -} - -// Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag().'.css'; - -if (JFile::exists($file)) -{ - $doc->addStyleSheet($file); + JHtml::_('stylesheet', 'template_rtl.css', array('version' => 'auto', 'relative' => true)); + JHtml::_('stylesheet', 'colour_' . $colour . '_rtl.css', array('version' => 'auto', 'relative' => true)); } // Load additional CSS styles for bold Text if ($this->params->get('boldText')) { - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css'); + JHtml::_('stylesheet', 'boldtext.css', array('version' => 'auto', 'relative' => true)); } -// Load template javascript -$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/template.js', 'text/javascript'); +// Load specific language related CSS +JHtml::_('stylesheet', 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto', 'relative' => true)); + +// Load custom.css +JHtml::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); + +// IE specific +JHtml::_('stylesheet', 'ie8.css', array('version' => 'auto', 'relative' => true, 'conditional' => 'IE 8')); +JHtml::_('stylesheet', 'ie7.css', array('version' => 'auto', 'relative' => true, 'conditional' => 'IE 7')); // Logo file if ($this->params->get('logoFile')) @@ -85,14 +86,10 @@ } ?> - - - + + - - + diff --git a/administrator/templates/hathor/cpanel.php b/administrator/templates/hathor/cpanel.php index bde56a0554396..152f6b2c8b3d4 100644 --- a/administrator/templates/hathor/cpanel.php +++ b/administrator/templates/hathor/cpanel.php @@ -9,20 +9,28 @@ defined('_JEXEC') or die; +/** @var JDocumentHtml $this */ + $app = JFactory::getApplication(); -$doc = JFactory::getDocument(); $lang = JFactory::getLanguage(); -$input = $app->input; -$user = JFactory::getUser(); + +// Output as HTML5 +$this->setHtml5(true); + +// Add template js +JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true)); + +// Add html5 shiv +JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); // Load system style CSS -$doc->addStyleSheet($this->baseurl . '/templates/system/css/system.css'); +JHtml::_('stylesheet', 'templates/system/css/system.css', array('version' => 'auto')); -// Loadtemplate CSS -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css'); +// Load template CSS +JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true)); // Load additional CSS styles for colors if (!$this->params->get('colourChoice')) @@ -34,39 +42,30 @@ $colour = htmlspecialchars($this->params->get('colourChoice')); } -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '.css'); - -// Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; - -if (is_file($file)) -{ - $doc->addStyleSheet($file); -} +JHtml::_('stylesheet', 'colour_' . $colour . '.css', array('version' => 'auto', 'relative' => true)); // Load additional CSS styles for rtl sites -if ($this->direction == 'rtl') +if ($this->direction === 'rtl') { - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template_rtl.css'); - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/colour_' . $colour . '_rtl.css'); -} - -// Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; - -if (JFile::exists($file)) -{ - $doc->addStyleSheet($file); + JHtml::_('stylesheet', 'template_rtl.css', array('version' => 'auto', 'relative' => true)); + JHtml::_('stylesheet', 'colour_' . $colour . '_rtl.css', array('version' => 'auto', 'relative' => true)); } // Load additional CSS styles for bold Text if ($this->params->get('boldText')) { - $doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/boldtext.css'); + JHtml::_('stylesheet', 'boldtext.css', array('version' => 'auto', 'relative' => true)); } -// Load template javascript -$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/template.js', 'text/javascript'); +// Load specific language related CSS +JHtml::_('stylesheet', 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto', 'relative' => true)); + +// Load custom.css +JHtml::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); + +// IE specific +JHtml::_('stylesheet', 'ie8.css', array('version' => 'auto', 'relative' => true, 'conditional' => 'IE 8')); +JHtml::_('stylesheet', 'ie7.css', array('version' => 'auto', 'relative' => true, 'conditional' => 'IE 7')); // Logo file if ($this->params->get('logoFile')) @@ -79,20 +78,10 @@ } ?> - - + + - - - - - +
    @@ -153,7 +142,7 @@
    @@ -37,7 +39,24 @@

    error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

    debug) : ?> - renderBacktrace(); ?> +
    + renderBacktrace(); ?> + + error->getPrevious()) : ?> + + _error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> + + setError($this->_error->getPrevious()); ?> + +

    +

    _error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

    + renderBacktrace(); ?> + setError($this->_error->getPrevious()); ?> + + + setError($this->error); ?> + +
    diff --git a/administrator/templates/hathor/html/com_banners/banner/edit.php b/administrator/templates/hathor/html/com_banners/banner/edit.php index 0d6e49ed5301d..8b0fad49f0a85 100644 --- a/administrator/templates/hathor/html/com_banners/banner/edit.php +++ b/administrator/templates/hathor/html/com_banners/banner/edit.php @@ -11,6 +11,7 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); +JHtml::_('jquery.framework'); JHtml::_('behavior.formvalidator'); JFactory::getDocument()->addScriptDeclaration(" diff --git a/administrator/templates/hathor/html/com_banners/banners/default.php b/administrator/templates/hathor/html/com_banners/banners/default.php index 59092f41f63e3..5692585b9b2aa 100644 --- a/administrator/templates/hathor/html/com_banners/banners/default.php +++ b/administrator/templates/hathor/html/com_banners/banners/default.php @@ -33,7 +33,7 @@ @@ -198,11 +198,7 @@
    @@ -214,13 +222,7 @@ - - - - -
    + + @@ -71,7 +71,9 @@ name)); ?>
    preview && $item->client_id == '0') : ?> - + + + client_id == '1') : ?> diff --git a/administrator/components/com_users/access.xml b/administrator/components/com_users/access.xml index b10b8fe446277..591aeb52bbc75 100644 --- a/administrator/components/com_users/access.xml +++ b/administrator/components/com_users/access.xml @@ -8,6 +8,7 @@ +
    diff --git a/administrator/components/com_users/config.xml b/administrator/components/com_users/config.xml index a2c325002d3a8..0579569c52d72 100644 --- a/administrator/components/com_users/config.xml +++ b/administrator/components/com_users/config.xml @@ -1,6 +1,8 @@ -
    +
    JYES + +
    + +
    + + +
    + + + + + + + + + + + +
    +
    getModel(); - JArrayHelper::toInteger($ids); + $ids = ArrayHelper::toInteger($ids); // Remove the items. if (!$model->delete($ids)) diff --git a/administrator/components/com_users/controllers/profile.json.php b/administrator/components/com_users/controllers/profile.json.php index b9390f4a97786..eed7aba5eaddf 100644 --- a/administrator/components/com_users/controllers/profile.json.php +++ b/administrator/components/com_users/controllers/profile.json.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_users/controllers/profile_base_json.php'; +JLoader::register('UsersControllerProfile_Base_Json', JPATH_SITE . '/components/com_users/controllers/profile_base_json.php'); /** * Profile controller class for Users. diff --git a/administrator/components/com_users/controllers/users.php b/administrator/components/com_users/controllers/users.php index 52d5ec0df4819..998b3653744b5 100644 --- a/administrator/components/com_users/controllers/users.php +++ b/administrator/components/com_users/controllers/users.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Users list controller class. * @@ -69,7 +71,7 @@ public function changeBlock() $ids = $this->input->get('cid', array(), 'array'); $values = array('block' => 1, 'unblock' => 0); $task = $this->getTask(); - $value = JArrayHelper::getValue($values, $task, 0, 'int'); + $value = ArrayHelper::getValue($values, $task, 0, 'int'); if (empty($ids)) { diff --git a/administrator/components/com_users/helpers/debug.php b/administrator/components/com_users/helpers/debug.php index 61f6780306576..18dd519d80ff6 100644 --- a/administrator/components/com_users/helpers/debug.php +++ b/administrator/components/com_users/helpers/debug.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Users component debugging helper. * @@ -52,7 +54,7 @@ public static function getComponents() } // Sort by component name - JArrayHelper::sortObjects($items, 'text', 1, true, true); + $items = ArrayHelper::sortObjects($items, 'text', 1, true, true); } return $items; diff --git a/administrator/components/com_users/helpers/users.php b/administrator/components/com_users/helpers/users.php index 90e76467d7ecf..594fdec2fe158 100644 --- a/administrator/components/com_users/helpers/users.php +++ b/administrator/components/com_users/helpers/users.php @@ -67,6 +67,20 @@ public static function addSubmenu($vName) $vName == 'categories' || $extension == 'com_users' ); } + + if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_users')->get('custom_fields_enable', '1')) + { + JHtmlSidebar::addEntry( + JText::_('JGLOBAL_FIELDS'), + 'index.php?option=com_fields&context=com_users.user', + $vName == 'fields.user' + ); + JHtmlSidebar::addEntry( + JText::_('JGLOBAL_FIELD_GROUPS'), + 'index.php?option=com_categories&extension=com_users.user.fields', + $vName == 'categories.user' + ); + } } /** @@ -130,31 +144,12 @@ public static function getActiveOptions() */ public static function getGroups() { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select('a.id AS value') - ->select('a.title AS text') - ->select('COUNT(DISTINCT b.id) AS level') - ->from('#__usergroups as a') - ->join('LEFT', '#__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt') - ->group('a.id, a.title, a.lft, a.rgt') - ->order('a.lft ASC'); - $db->setQuery($query); - - try - { - $options = $db->loadObjectList(); - } - catch (RuntimeException $e) - { - JError::raiseNotice(500, $e->getMessage()); - - return null; - } + $options = JHelperUsergroups::getInstance()->getAll(); foreach ($options as &$option) { - $option->text = str_repeat('- ', $option->level) . $option->text; + $option->value = $option->id; + $option->text = str_repeat('- ', $option->level) . $option->title; } return $options; @@ -193,12 +188,6 @@ public static function getRangeOptions() */ public static function getTwoFactorMethods() { - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - FOFPlatform::getInstance()->importPlugin('twofactorauth'); $identities = FOFPlatform::getInstance()->runPlugins('onUserTwofactorIdentify', array()); @@ -254,4 +243,62 @@ public static function getVisibleByGroups($rules) return $groups; } + + /** + * Adds Count Items for Tag Manager. + * + * @param stdClass[] &$items The user note tag objects + * @param string $extension The name of the active view. + * + * @return stdClass[] + * + * @since 3.6 + */ + public static function countTagItems(&$items, $extension) + { + $db = JFactory::getDbo(); + + foreach ($items as $item) + { + $item->count_trashed = 0; + $item->count_archived = 0; + $item->count_unpublished = 0; + $item->count_published = 0; + $query = $db->getQuery(true); + $query->select('published as state, count(*) AS count') + ->from($db->qn('#__contentitem_tag_map') . 'AS ct ') + ->where('ct.tag_id = ' . (int) $item->id) + ->where('ct.type_alias =' . $db->q($extension)) + ->join('LEFT', $db->qn('#__categories') . ' AS c ON ct.content_item_id=c.id') + ->group('c.published'); + + $db->setQuery($query); + $users = $db->loadObjectList(); + + foreach ($users as $user) + { + if ($user->state == 1) + { + $item->count_published = $user->count; + } + + if ($user->state == 0) + { + $item->count_unpublished = $user->count; + } + + if ($user->state == 2) + { + $item->count_archived = $user->count; + } + + if ($user->state == -2) + { + $item->count_trashed = $user->count; + } + } + } + + return $items; + } } diff --git a/administrator/components/com_users/models/debuggroup.php b/administrator/components/com_users/models/debuggroup.php index dd9ed7526d218..dd085870950eb 100644 --- a/administrator/components/com_users/models/debuggroup.php +++ b/administrator/components/com_users/models/debuggroup.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/debug.php'; +JLoader::register('UsersHelperDebug', JPATH_ADMINISTRATOR . '/components/com_users/helpers/debug.php'); /** * Methods supporting a list of user records. diff --git a/administrator/components/com_users/models/debuguser.php b/administrator/components/com_users/models/debuguser.php index 94e155af43f0c..2b41aee566091 100644 --- a/administrator/components/com_users/models/debuguser.php +++ b/administrator/components/com_users/models/debuguser.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/debug.php'; +JLoader::register('UsersHelperDebug', JPATH_ADMINISTRATOR . '/components/com_users/helpers/debug.php'); /** * Methods supporting a list of user records. diff --git a/administrator/components/com_users/models/fields/components.php b/administrator/components/com_users/models/fields/components.php index 80372bc387b57..ef606dd9cd62a 100644 --- a/administrator/components/com_users/models/fields/components.php +++ b/administrator/components/com_users/models/fields/components.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 3.6.0 */ -class JFormFieldComponents extends JFormFieldList +class JFormFieldComponents extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_users/models/fields/groupparent.php b/administrator/components/com_users/models/fields/groupparent.php index b8469533b41ef..47f88050f7a7c 100644 --- a/administrator/components/com_users/models/fields/groupparent.php +++ b/administrator/components/com_users/models/fields/groupparent.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 1.6 */ -class JFormFieldGroupParent extends JFormFieldList +class JFormFieldGroupParent extends JFormAbstractlist { /** * The form field type. @@ -35,36 +33,17 @@ class JFormFieldGroupParent extends JFormFieldList */ protected function getOptions() { - $options = array(); + $options = JHelperUsergroups::getInstance()->getAll(); - $db = JFactory::getDbo(); $user = JFactory::getUser(); - $query = $db->getQuery(true) - ->select('a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level') - ->from('#__usergroups AS a') - ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); // Prevent parenting to children of this item. if ($id = $this->form->getValue('id')) { - $query->join('LEFT', $db->quoteName('#__usergroups') . ' AS p ON p.id = ' . (int) $id) - ->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)'); + unset($options[$id]); } - $query->group('a.id, a.title, a.lft, a.rgt') - ->order('a.lft ASC'); - - // Get the options. - $db->setQuery($query); - - try - { - $options = $db->loadObjectList(); - } - catch (RuntimeException $e) - { - JError::raiseWarning(500, $e->getMessage()); - } + $options = array_values($options); // Pad the option text with spaces using depth level as a multiplier. for ($i = 0, $n = count($options); $i < $n; $i++) @@ -72,7 +51,8 @@ protected function getOptions() // Show groups only if user is super admin or group is not super admin if ($user->authorise('core.admin') || (!JAccess::checkGroup($options[$i]->value, 'core.admin'))) { - $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text; + $options[$i]->value = $options[$i]->id; + $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title; } else { diff --git a/administrator/components/com_users/models/fields/levels.php b/administrator/components/com_users/models/fields/levels.php index a3b9a9bf10eb1..6ee98fd5cc228 100644 --- a/administrator/components/com_users/models/fields/levels.php +++ b/administrator/components/com_users/models/fields/levels.php @@ -9,14 +9,12 @@ defined('JPATH_BASE') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 3.6.0 */ -class JFormFieldLevels extends JFormFieldList +class JFormFieldLevels extends JFormAbstractlist { /** * The form field type. diff --git a/administrator/components/com_users/models/forms/note.xml b/administrator/components/com_users/models/forms/note.xml index b3260eb5f35b4..60e54f27d293d 100644 --- a/administrator/components/com_users/models/forms/note.xml +++ b/administrator/components/com_users/models/forms/note.xml @@ -1,6 +1,8 @@
    -
    +
    + > - + description="JFIELD_CATEGORY_DESC" + extension="com_users" + required="true" + select="true" + new="true" + edit="true" + clear="true" + /> - - + + parent_id) && $obj->parent_id == 0 && $obj->id > 0) { @@ -317,7 +320,7 @@ protected function generateGroupTitle($parentId, $title) { if ($title == $table->title) { - $title = JString::increment($title); + $title = StringHelper::increment($title); } } diff --git a/administrator/components/com_users/models/groups.php b/administrator/components/com_users/models/groups.php index b49999cb757cc..52e293cd73040 100644 --- a/administrator/components/com_users/models/groups.php +++ b/administrator/components/com_users/models/groups.php @@ -93,8 +93,6 @@ protected function getStoreId($id = '') */ public function getItems() { - $db = $this->getDbo(); - // Get a storage key. $store = $this->getStoreId(); @@ -111,60 +109,17 @@ public function getItems() return $items; } - // First pass: get list of the group id's and reset the counts. - $groupIds = array(); - - foreach ($items as $item) - { - $groupIds[] = (int) $item->id; - } - - // Get total enabled users in group. - $query = $db->getQuery(true); - - // Count the objects in the user group. - $query->select('map.group_id, COUNT(DISTINCT map.user_id) AS user_count') - ->from($db->quoteName('#__user_usergroup_map', 'map')) - ->join('LEFT', $db->quoteName('#__users', 'u') . ' ON ' . $db->quoteName('u.id') . ' = ' . $db->quoteName('map.user_id')) - ->where($db->quoteName('map.group_id') . ' IN (' . implode(',', $groupIds) . ')') - ->where($db->quoteName('u.block') . ' = 0') - ->group($db->quoteName('map.group_id')); - $db->setQuery($query); - try { - $countEnabled = $db->loadAssocList('group_id', 'count_enabled'); + $items = $this->populateExtraData($items); } catch (RuntimeException $e) { $this->setError($e->getMessage()); - return false; - } - - // Get total disabled users in group. - $query->clear('where') - ->where('map.group_id IN (' . implode(',', $groupIds) . ')') - ->where('u.block = 1'); - $db->setQuery($query); - try - { - $countDisabled = $db->loadAssocList('group_id', 'count_disabled'); - } - catch (RuntimeException $e) - { - $this->setError($e->getMessage()); return false; } - // Inject the values back into the array. - foreach ($items as $item) - { - $item->count_enabled = isset($countEnabled[$item->id]) ? (int) $countEnabled[$item->id]['user_count'] : 0; - $item->count_disabled = isset($countDisabled[$item->id]) ? (int) $countDisabled[$item->id]['user_count'] : 0; - $item->user_count = $item->count_enabled + $item->count_disabled; - } - // Add the items to the internal cache. $this->cache[$store] = $items; } @@ -192,11 +147,6 @@ protected function getListQuery() ); $query->from($db->quoteName('#__usergroups') . ' AS a'); - // Add the level in the tree. - $query->select('COUNT(DISTINCT c2.id) AS level') - ->join('LEFT OUTER', $db->quoteName('#__usergroups') . ' AS c2 ON a.lft > c2.lft AND a.rgt < c2.rgt') - ->group('a.id, a.lft, a.rgt, a.parent_id, a.title'); - // Filter the comments over the search string if set. $search = $this->getState('filter.search'); @@ -218,4 +168,80 @@ protected function getListQuery() return $query; } + + /** + * Populate level & path for items. + * + * @param array $items Array of stdClass objects + * + * @return array + * + * @since 3.6.3 + */ + private function populateExtraData(array $items) + { + // First pass: get list of the group id's and reset the counts. + $groupsByKey = array(); + + foreach ($items as $item) + { + $groupsByKey[(int) $item->id] = $item; + } + + $groupIds = array_keys($groupsByKey); + + $db = $this->getDbo(); + + // Get total enabled users in group. + $query = $db->getQuery(true); + + // Count the objects in the user group. + $query->select('map.group_id, COUNT(DISTINCT map.user_id) AS user_count') + ->from($db->quoteName('#__user_usergroup_map', 'map')) + ->join('LEFT', $db->quoteName('#__users', 'u') . ' ON ' . $db->quoteName('u.id') . ' = ' . $db->quoteName('map.user_id')) + ->where($db->quoteName('map.group_id') . ' IN (' . implode(',', $groupIds) . ')') + ->where($db->quoteName('u.block') . ' = 0') + ->group($db->quoteName('map.group_id')); + $db->setQuery($query); + + try + { + $countEnabled = $db->loadAssocList('group_id', 'count_enabled'); + } + catch (RuntimeException $e) + { + $this->setError($e->getMessage()); + + return false; + } + + // Get total disabled users in group. + $query->clear('where') + ->where('map.group_id IN (' . implode(',', $groupIds) . ')') + ->where('u.block = 1'); + $db->setQuery($query); + + try + { + $countDisabled = $db->loadAssocList('group_id', 'count_disabled'); + } + catch (RuntimeException $e) + { + $this->setError($e->getMessage()); + + return false; + } + + // Inject the values back into the array. + foreach ($groupsByKey as &$item) + { + $item->count_enabled = isset($countEnabled[$item->id]) ? (int) $countEnabled[$item->id]['user_count'] : 0; + $item->count_disabled = isset($countDisabled[$item->id]) ? (int) $countDisabled[$item->id]['user_count'] : 0; + $item->user_count = $item->count_enabled + $item->count_disabled; + } + + $groups = new JHelperUsergroups($groupsByKey); + + return array_values($groups->getAll()); + } } diff --git a/administrator/components/com_users/models/levels.php b/administrator/components/com_users/models/levels.php index d837fae8aa0e0..9aa2368986744 100644 --- a/administrator/components/com_users/models/levels.php +++ b/administrator/components/com_users/models/levels.php @@ -177,7 +177,7 @@ public function reorder($pk, $direction = 0) * @param array $pks An array of primary key ids. * @param integer $order Order position * - * @return boolean + * @return boolean|JException Boolean true on success, boolean false or JException instance on error */ public function saveorder($pks, $order) { diff --git a/administrator/components/com_users/models/user.php b/administrator/components/com_users/models/user.php index a94e48399790b..8a8242bc49c3c 100644 --- a/administrator/components/com_users/models/user.php +++ b/administrator/components/com_users/models/user.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; /** * User model. @@ -33,17 +34,11 @@ public function __construct($config = array()) 'event_after_save' => 'onUserAfterSave', 'event_before_delete' => 'onUserBeforeDelete', 'event_before_save' => 'onUserBeforeSave', - 'events_map' => array('save' => 'user', 'delete' => 'user') + 'events_map' => array('save' => 'user', 'delete' => 'user', 'validate' => 'user') ), $config ); parent::__construct($config); - - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } } /** @@ -205,6 +200,19 @@ public function save($data) $user = JUser::getInstance($pk); $my = JFactory::getUser(); + $iAmSuperAdmin = $my->authorise('core.admin'); + + // User cannot modify own user groups + if ((int) $user->id == (int) $my->id && !$iAmSuperAdmin) + { + if ($data['groups'] != null) + { + // Form was probably tampered with + JFactory::getApplication()->enqueueMessage(JText::_('COM_USERS_USERS_ERROR_CANNOT_EDIT_OWN_GROUP'), 'warning'); + + $data['groups'] = null; + } + } if ($data['block'] && $pk == $my->id && !$my->block) { @@ -214,8 +222,6 @@ public function save($data) } // Make sure that we are not removing ourself from Super Admin group - $iAmSuperAdmin = $my->authorise('core.admin'); - if ($iAmSuperAdmin && $my->get('id') == $pk) { // Check that at least one of our new groups is Super Admin @@ -607,7 +613,7 @@ public function batch($commands, $pks, $contexts) { // Sanitize user ids. $pks = array_unique($pks); - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Remove any values of zero. if (array_search(0, $pks, true)) @@ -626,7 +632,7 @@ public function batch($commands, $pks, $contexts) if (!empty($commands['group_id'])) { - $cmd = JArrayHelper::getValue($commands, 'group_action', 'add'); + $cmd = ArrayHelper::getValue($commands, 'group_action', 'add'); if (!$this->batchUser((int) $commands['group_id'], $pks, $cmd)) { @@ -694,7 +700,7 @@ public function batchReset($user_ids, $action) // Get the DB object $db = $this->getDbo(); - JArrayHelper::toInteger($user_ids); + $user_ids = ArrayHelper::toInteger($user_ids); $query = $db->getQuery(true); @@ -735,7 +741,7 @@ public function batchUser($group_id, $user_ids, $action) // Get the DB object $db = $this->getDbo(); - JArrayHelper::toInteger($user_ids); + $user_ids = ArrayHelper::toInteger($user_ids); // Non-super admin cannot work with super-admin group if ((!JFactory::getUser()->get('isRoot') && JAccess::checkGroup($group_id, 'core.admin')) || $group_id < 1) @@ -955,15 +961,50 @@ public function getOtpConfig($user_id = null) } // Get the encrypted data - list($method, $encryptedConfig) = explode(':', $item->otpKey, 2); + list($method, $config) = explode(':', $item->otpKey, 2); $encryptedOtep = $item->otep; - - // Create an encryptor class + + // Get the secret key, yes the thing that is saved in the configuration file $key = $this->getOtpConfigEncryptionKey(); + + if (strpos($config, '{') === false) + { + $openssl = new FOFEncryptAes($key, 256); + $mcrypt = new FOFEncryptAes($key, 256, 'cbc', null, 'mcrypt'); + + $decryptedConfig = $mcrypt->decryptString($config); + + if (strpos($decryptedConfig, '{') !== false) + { + // Data encrypted with mcrypt + $decryptedOtep = $mcrypt->decryptString($encryptedOtep); + $encryptedOtep = $openssl->encryptString($decryptedOtep); + } + else + { + // Config data seems to be save encrypted, this can happen with 3.6.3 and openssl, lets get the data + $decryptedConfig = $openssl->decryptString($config); + } + + $otpKey = $method . ':' . $decryptedConfig; + + $query = $db->getQuery(true) + ->update($db->qn('#__users')) + ->set($db->qn('otep') . '=' . $db->q($encryptedOtep)) + ->set($db->qn('otpKey') . '=' . $db->q($otpKey)) + ->where($db->qn('id') . ' = ' . $db->q($user_id)); + $db->setQuery($query); + $db->execute(); + } + else + { + $decryptedConfig = $config; + } + + // Create an encryptor class $aes = new FOFEncryptAes($key, 256); // Decrypt the data - $decryptedConfig = $aes->decryptString($encryptedConfig); $decryptedOtep = $aes->decryptString($encryptedOtep); // Remove the null padding added during encryption @@ -1003,7 +1044,7 @@ public function getOtpConfig($user_id = null) // Return the configuration object return $otpConfig; } - + /** * Sets the one time password (OTP) – a.k.a. two factor authentication – * configuration for a particular user. The $otpConfig object is the same as @@ -1035,7 +1076,7 @@ public function setOtpConfig($user_id, $otpConfig) { $decryptedConfig = json_encode($otpConfig->config); $decryptedOtep = json_encode($otpConfig->otep); - $updates->otpKey = $otpConfig->method . ':' . $aes->encryptString($decryptedConfig); + $updates->otpKey = $otpConfig->method . ':' . $decryptedConfig; $updates->otep = $aes->encryptString($decryptedOtep); } @@ -1196,8 +1237,8 @@ public function isValidSecretKey($user_id, $secretkey, $options = array()) $warnMessage = $options['warn_irq_msg']; } - // Warn the user if he's using a secret code but he has not - // enabled two factor auth in his account. + // Warn the user if they are using a secret code but they have not + // enabled two factor auth in their account. if (!empty($secretkey) && $warn) { try @@ -1220,12 +1261,6 @@ public function isValidSecretKey($user_id, $secretkey, $options = array()) 'secretkey' => $secretkey, ); - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } - // Try to validate the OTP FOFPlatform::getInstance()->importPlugin('twofactorauth'); @@ -1289,7 +1324,7 @@ public function isValidOtep($user_id, $otep, $otpConfig = null) { /** * Two factor authentication enabled and no OTEPs defined. The - * user has used them all up. Therefore anything he enters is + * user has used them all up. Therefore anything they enter is * an invalid OTEP. */ return false; diff --git a/administrator/components/com_users/tables/note.php b/administrator/components/com_users/tables/note.php index 5f828d271a80e..b926236fd0d8c 100644 --- a/administrator/components/com_users/tables/note.php +++ b/administrator/components/com_users/tables/note.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * User notes table class * @@ -75,7 +77,6 @@ public function store($updateNulls = false) * * @return boolean True on success. * - * @link https://docs.joomla.org/JTable/publish * @since 2.5 */ public function publish($pks = null, $state = 1, $userId = 0) @@ -83,7 +84,7 @@ public function publish($pks = null, $state = 1, $userId = 0) $k = $this->_tbl_key; // Sanitize input. - JArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); $userId = (int) $userId; $state = (int) $state; diff --git a/administrator/components/com_users/users.php b/administrator/components/com_users/users.php index 6aa00c34e5deb..4c3ca532f0425 100644 --- a/administrator/components/com_users/users.php +++ b/administrator/components/com_users/users.php @@ -12,7 +12,7 @@ if (!JFactory::getUser()->authorise('core.manage', 'com_users')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } JLoader::register('UsersHelper', __DIR__ . '/helpers/users.php'); diff --git a/administrator/components/com_users/views/debuggroup/view.html.php b/administrator/components/com_users/views/debuggroup/view.html.php index 67c11249fc491..581696713eab6 100644 --- a/administrator/components/com_users/views/debuggroup/view.html.php +++ b/administrator/components/com_users/views/debuggroup/view.html.php @@ -52,7 +52,7 @@ class UsersViewDebuggroup extends JViewLegacy public function display($tpl = null) { // Access check. - if (!JFactory::getUser()->authorise('core.manage', 'com_users') || !JFactory::getConfig()->get('debug')) + if (!JFactory::getUser()->authorise('core.manage', 'com_users')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } diff --git a/administrator/components/com_users/views/debuguser/view.html.php b/administrator/components/com_users/views/debuguser/view.html.php index 31b55e58f93d4..aed352292ebf8 100644 --- a/administrator/components/com_users/views/debuguser/view.html.php +++ b/administrator/components/com_users/views/debuguser/view.html.php @@ -52,7 +52,7 @@ class UsersViewDebuguser extends JViewLegacy public function display($tpl = null) { // Access check. - if (!JFactory::getUser()->authorise('core.manage', 'com_users') || !JFactory::getConfig()->get('debug')) + if (!JFactory::getUser()->authorise('core.manage', 'com_users')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } diff --git a/administrator/components/com_users/views/level/tmpl/edit.php b/administrator/components/com_users/views/level/tmpl/edit.php index 82fb60d21cedb..c088aa88c37e4 100644 --- a/administrator/components/com_users/views/level/tmpl/edit.php +++ b/administrator/components/com_users/views/level/tmpl/edit.php @@ -23,71 +23,6 @@ } }; "); -/* -window.addEvent('domready', function(){ - document.id('user-groups').getElements('input').each(function(i){ - // Event to check all child groups. - i.addEvent('check', function(e){ - // Check the child groups. - document.id('user-groups').getElements('input').each(function(c){ - if (this.getProperty('rel') == c.id) - { - c.setProperty('checked', true); - c.setProperty('disabled', true); - c.fireEvent('check'); - } - }.bind(this)); - }.bind(i)); - - // Event to uncheck all the parent groups. - i.addEvent('uncheck', function(e){ - // Uncheck the parent groups. - document.id('user-groups').getElements('input').each(function(c){ - if (c.getProperty('rel') == this.id) - { - c.setProperty('checked', false); - c.setProperty('disabled', false); - c.fireEvent('uncheck'); - } - }.bind(this)); - }.bind(i)); - - // Bind to the click event to check/uncheck child/parent groups. - i.addEvent('click', function(e){ - // Check the child groups. - document.id('user-groups').getElements('input').each(function(c){ - if (this.getProperty('rel') == c.id) - { - c.setProperty('checked', true); - if (this.getProperty('checked')) - { - c.setProperty('disabled', true); - } else { - c.setProperty('disabled', false); - } - c.fireEvent('check'); - } - }.bind(this)); - - // Uncheck the parent groups. - document.id('user-groups').getElements('input').each(function(c){ - if (c.getProperty('rel') == this.id) - { - c.setProperty('checked', false); - c.setProperty('disabled', false); - c.fireEvent('uncheck'); - } - }.bind(this)); - }.bind(i)); - - // Initialise the widget. - if (i.getProperty('checked')) - { - i.fireEvent('click'); - } - }); -}); -*/ ?> diff --git a/administrator/components/com_users/views/mail/tmpl/default.php b/administrator/components/com_users/views/mail/tmpl/default.php index 0c4ef4fbf23c8..5425010b59a87 100644 --- a/administrator/components/com_users/views/mail/tmpl/default.php +++ b/administrator/components/com_users/views/mail/tmpl/default.php @@ -39,11 +39,13 @@
    form->getLabel('subject'); ?>
    -
    form->getInput('subject'); ?>
    +
    get('mailSubjectPrefix'); ?> + form->getInput('subject'); ?>
    form->getLabel('message'); ?>
    -
    form->getInput('message'); ?>
    +
    form->getInput('message'); ?>
    + get('mailBodySuffix'); ?>
    diff --git a/administrator/components/com_users/views/note/view.html.php b/administrator/components/com_users/views/note/view.html.php index 5d1968488d391..37476dcbe54e6 100644 --- a/administrator/components/com_users/views/note/view.html.php +++ b/administrator/components/com_users/views/note/view.html.php @@ -114,7 +114,7 @@ protected function addToolbar() } else { - if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) + if ($this->state->params->get('save_history', 0) && $canDo->get('core.edit')) { JToolbarHelper::versions('com_users.note', $this->item->id); } diff --git a/administrator/components/com_users/views/notes/tmpl/default.php b/administrator/components/com_users/views/notes/tmpl/default.php index 74069b8f16f4a..be6ce1d00cbee 100644 --- a/administrator/components/com_users/views/notes/tmpl/default.php +++ b/administrator/components/com_users/views/notes/tmpl/default.php @@ -91,7 +91,7 @@ checked_out) : ?> editor, $item->checked_out_time, 'notes.', $canCheckin); ?> - subject ? $this->escape($item->subject) : JText::_('COM_USERS_EMPTY_SUBJECT'); ?> + subject ? $item->subject : JText::_('COM_USERS_EMPTY_SUBJECT'); ?> escape($subject); ?> diff --git a/administrator/components/com_users/views/notes/view.html.php b/administrator/components/com_users/views/notes/view.html.php index 3cdfc3e18dd04..f6c74d6055c43 100644 --- a/administrator/components/com_users/views/notes/view.html.php +++ b/administrator/components/com_users/views/notes/view.html.php @@ -83,8 +83,7 @@ public function display($tpl = null) // Turn parameters into registry objects foreach ($this->items as $item) { - $item->cparams = new Registry; - $item->cparams->loadString($item->category_params); + $item->cparams = new Registry($item->category_params); } $this->addToolbar(); diff --git a/administrator/components/com_users/views/user/tmpl/edit.php b/administrator/components/com_users/views/user/tmpl/edit.php index 62514b7fceb4f..f0b678dbb2744 100644 --- a/administrator/components/com_users/views/user/tmpl/edit.php +++ b/administrator/components/com_users/views/user/tmpl/edit.php @@ -75,32 +75,9 @@ name == 'user_details') : - continue; - endif; + $this->ignore_fieldsets = array('user_details'); + echo JLayoutHelper::render('joomla.edit.params', $this); ?> - name, JText::_($fieldset->label)); ?> - form->getFieldset($fieldset->name) as $field) : ?> - hidden) : ?> -
    -
    - input; ?> -
    -
    - -
    -
    - label; ?> -
    -
    - input; ?> -
    -
    - - - - tfaform) && $this->item->id): ?> @@ -153,4 +130,4 @@ - \ No newline at end of file + diff --git a/administrator/components/com_users/views/user/view.html.php b/administrator/components/com_users/views/user/view.html.php index 97666917e6f1a..60d07cc20a03d 100644 --- a/administrator/components/com_users/views/user/view.html.php +++ b/administrator/components/com_users/views/user/view.html.php @@ -11,7 +11,7 @@ /** * User view class. - * + * * @since 1.5 */ class UsersViewUser extends JViewLegacy @@ -39,8 +39,6 @@ public function display($tpl = null) { $this->form = $this->get('Form'); $this->item = $this->get('Item'); - $this->grouplist = $this->get('Groups'); - $this->groups = $this->get('AssignedGroups'); $this->state = $this->get('State'); $this->tfaform = $this->get('Twofactorform'); $this->otpConfig = $this->get('otpConfig'); @@ -53,6 +51,15 @@ public function display($tpl = null) return false; } + // Prevent user from modifying own group(s) + $user = JFactory::getUser(); + + if ((int) $user->id != (int) $this->item->id || $user->authorise('core.admin')) + { + $this->grouplist = $this->get('Groups'); + $this->groups = $this->get('AssignedGroups'); + } + $this->form->setValue('password', null); $this->form->setValue('password2', null); diff --git a/administrator/components/com_users/views/users/tmpl/default.php b/administrator/components/com_users/views/users/tmpl/default.php index 4cd8e18400177..31e796c557303 100644 --- a/administrator/components/com_users/views/users/tmpl/default.php +++ b/administrator/components/com_users/views/users/tmpl/default.php @@ -148,7 +148,7 @@ escape($item->email)); ?>
    - lastvisitDate != '0000-00-00 00:00:00'):?> + lastvisitDate != $this->db->getNullDate()):?> lastvisitDate, 'Y-m-d H:i:s'); ?> diff --git a/administrator/components/com_users/views/users/tmpl/default_batch.php b/administrator/components/com_users/views/users/tmpl/default_batch.php deleted file mode 100644 index a063a003a785f..0000000000000 --- a/administrator/components/com_users/views/users/tmpl/default_batch.php +++ /dev/null @@ -1,66 +0,0 @@ - - diff --git a/administrator/components/com_users/views/users/tmpl/default_batch_body.php b/administrator/components/com_users/views/users/tmpl/default_batch_body.php index af6f6ec886f59..374a5545f30e3 100644 --- a/administrator/components/com_users/views/users/tmpl/default_batch_body.php +++ b/administrator/components/com_users/views/users/tmpl/default_batch_body.php @@ -45,4 +45,4 @@
    -
    \ No newline at end of file + diff --git a/administrator/components/com_users/views/users/tmpl/default_batch_footer.php b/administrator/components/com_users/views/users/tmpl/default_batch_footer.php index 03d54793c73e0..b9912df0a3a1b 100644 --- a/administrator/components/com_users/views/users/tmpl/default_batch_footer.php +++ b/administrator/components/com_users/views/users/tmpl/default_batch_footer.php @@ -9,9 +9,9 @@ defined('_JEXEC') or die; ?> - + \ No newline at end of file diff --git a/administrator/components/com_users/views/users/tmpl/modal.php b/administrator/components/com_users/views/users/tmpl/modal.php index 9baf6fe79c014..bb5e494f69122 100644 --- a/administrator/components/com_users/views/users/tmpl/modal.php +++ b/administrator/components/com_users/views/users/tmpl/modal.php @@ -27,13 +27,29 @@ $enabledStates = array(0 => 'icon-publish', 1 => 'icon-unpublish'); $activatedStates = array(0 => 'icon-publish', 1 => 'icon-unpublish'); $userRequired = (int) $input->get('required', 0, 'int'); + +/** + * Mootools compatibility + * + * There is an extra option passed in the url for the iframe &ismoo=0 for the bootstraped field. + * By default the value will be 1 or defaults to mootools behaviour using function jSelectUser() + * + * This should be removed when mootools won't be shipped by Joomla. + */ +$isMoo = $input->getInt('ismoo', 1); + +if ($isMoo) +{ + $onClick = "window.parent.jSelectUser(this);window.parent.jQuery('.modal.in').modal('hide');"; +} + ?>
      + data-user-field="escape($field);?>" value="" onclick="window.parent.jSelectUser(this)"> 
    $this)); ?> @@ -79,7 +95,7 @@
    + data-user-field="escape($field);?>" onclick=""> escape($item->name); ?> - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/templates/hathor/html/com_banners/download/default.php b/administrator/templates/hathor/html/com_banners/download/default.php new file mode 100644 index 0000000000000..22fdafc1f6a37 --- /dev/null +++ b/administrator/templates/hathor/html/com_banners/download/default.php @@ -0,0 +1,44 @@ + 'bottom')); +?> +
    + + +
    +
      + form->getFieldset() as $field) : ?> +
    • + form->getLabel($field->fieldname); ?> + form->getInput($field->fieldname); ?> +
    • + +
    +
    + + + + +
    diff --git a/administrator/templates/hathor/html/com_banners/tracks/default.php b/administrator/templates/hathor/html/com_banners/tracks/default.php index fc11820122862..4fd208b58f02e 100644 --- a/administrator/templates/hathor/html/com_banners/tracks/default.php +++ b/administrator/templates/hathor/html/com_banners/tracks/default.php @@ -19,112 +19,131 @@ $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> -
    + sidebar)) : ?> -
    +
    sidebar; ?>
    -
    +
    -
    - - - -
    - - - - - state->get('filter.category_id');?> - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - items as $i => $item) :?> - - - - - - - - - - -
    - - - - - - - - - - - -
    - banner_name;?> - - client_name;?> - - category_title;?> - - track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION'): JText::_('COM_BANNERS_CLICK');?> - - count;?> - - track_date, JText::_('DATE_FORMAT_LC4').' H:i');?> -
    - - pagination->getListFooter(); ?> - - - - - - -
    + +
    + + + +
    + + + + + state->get('filter.category_id');?> + + + + + + +
    +
    + +
    + + + + + + + + + + + + + + + items as $i => $item) :?> + + + + + + + + + + +
    + + + + + + + + + + + +
    + banner_name;?> + + client_name;?> + + category_title;?> + + track_type == 1 ? JText::_('COM_BANNERS_IMPRESSION'): JText::_('COM_BANNERS_CLICK');?> + + count;?> + + track_date, JText::_('DATE_FORMAT_LC4').' H:i');?> +
    + + + JText::_('COM_BANNERS_TRACKS_DOWNLOAD'), + 'url' => JRoute::_('index.php?option=com_banners&view=download&tmpl=component'), + 'width' => '100%', + 'height' => '300px', + 'footer' => '' + . JText::_("COM_BANNERS_CANCEL") . '' + . '', + ) + ); ?> + + pagination->getListFooter(); ?> + + + + + + +
    diff --git a/administrator/templates/hathor/html/com_categories/categories/default.php b/administrator/templates/hathor/html/com_categories/categories/default.php index d7c9e8dde2a2d..197eb40551072 100644 --- a/administrator/templates/hathor/html/com_categories/categories/default.php +++ b/administrator/templates/hathor/html/com_categories/categories/default.php @@ -218,11 +218,7 @@
    - language == '*'): ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + diff --git a/administrator/templates/hathor/html/com_config/application/default_mail.php b/administrator/templates/hathor/html/com_config/application/default_mail.php index 21163c5d35b61..369bf61d707cf 100644 --- a/administrator/templates/hathor/html/com_config/application/default_mail.php +++ b/administrator/templates/hathor/html/com_config/application/default_mail.php @@ -8,7 +8,9 @@ */ defined('_JEXEC') or die; -JHtml::script('system/sendtestmail.js', false, true); + +JHtml::_('script', 'system/sendtestmail.js', array('version' => 'auto', 'relative' => true)); + JFactory::getDocument()->addScriptDeclaration(' var sendtestmail_url = "' . addslashes(JUri::base()) . 'index.php?option=com_config&task=config.sendtestmail.application&format=json&' . JSession::getFormToken() . '=1"; '); diff --git a/administrator/templates/hathor/html/com_contact/contacts/default.php b/administrator/templates/hathor/html/com_contact/contacts/default.php index 694e52df26fec..d41828189930b 100644 --- a/administrator/templates/hathor/html/com_contact/contacts/default.php +++ b/administrator/templates/hathor/html/com_contact/contacts/default.php @@ -203,11 +203,7 @@ - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/templates/hathor/html/com_contact/contacts/modal.php b/administrator/templates/hathor/html/com_contact/contacts/modal.php index b700639a33eaf..9b66b93bc4f41 100644 --- a/administrator/templates/hathor/html/com_contact/contacts/modal.php +++ b/administrator/templates/hathor/html/com_contact/contacts/modal.php @@ -114,11 +114,7 @@ escape($item->category_title); ?> - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/templates/hathor/html/com_content/articles/default.php b/administrator/templates/hathor/html/com_content/articles/default.php index bc33b2f746b7c..40cfe911a2513 100644 --- a/administrator/templates/hathor/html/com_content/articles/default.php +++ b/administrator/templates/hathor/html/com_content/articles/default.php @@ -218,11 +218,7 @@ hits; ?> - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/templates/hathor/html/com_content/articles/modal.php b/administrator/templates/hathor/html/com_content/articles/modal.php index 7a03a43a507ba..d11adcf0011c7 100644 --- a/administrator/templates/hathor/html/com_content/articles/modal.php +++ b/administrator/templates/hathor/html/com_content/articles/modal.php @@ -16,7 +16,7 @@ JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } -require_once JPATH_ROOT . '/components/com_content/helpers/route.php'; +JLoader::register('ContentHelperRoute', JPATH_ROOT . '/components/com_content/helpers/route.php'); JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); @@ -111,11 +111,7 @@ escape($item->category_title); ?> - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + created, JText::_('DATE_FORMAT_LC4')); ?> diff --git a/administrator/templates/hathor/html/com_content/featured/default.php b/administrator/templates/hathor/html/com_content/featured/default.php index f7baa18bf7939..f7a752f8d7c43 100644 --- a/administrator/templates/hathor/html/com_content/featured/default.php +++ b/administrator/templates/hathor/html/com_content/featured/default.php @@ -188,11 +188,7 @@ hits; ?> - language == '*') : ?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/templates/hathor/html/com_installer/database/default.php b/administrator/templates/hathor/html/com_installer/database/default.php index 50e20b785e83e..ea1a8b00da5f7 100644 --- a/administrator/templates/hathor/html/com_installer/database/default.php +++ b/administrator/templates/hathor/html/com_installer/database/default.php @@ -21,11 +21,9 @@
    errorCount === 0) : ?> -

    1)); ?> -

    1)); ?> errorCount); ?> diff --git a/administrator/templates/hathor/html/com_installer/install/default_form.php b/administrator/templates/hathor/html/com_installer/install/default_form.php index 86ae4b184b6ba..e2b485cbe4915 100644 --- a/administrator/templates/hathor/html/com_installer/install/default_form.php +++ b/administrator/templates/hathor/html/com_installer/install/default_form.php @@ -81,8 +81,8 @@ showJedAndWebInstaller && !$this->showMessage) : ?>
    - ">× -

      

    + "> +

     

    @@ -92,29 +92,23 @@
    - trigger('onInstallerViewBeforeFirstTab', array()); ?> - -
    - - - - -
    -
    -
    - - - -
    -
    -
    - - - - -
    - - trigger('onInstallerViewAfterLastTab', array()); ?> + trigger('onInstallerViewBeforeFirstTab', array()); ?> + + + trigger('onInstallerAddInstallationTab', array()); ?> + +
    + +
    + + + trigger('onInstallerViewAfterLastTab', array()); ?> + + + + enqueueMessage(JText::_('COM_INSTALLER_NO_INSTALLATION_PLUGINS_FOUND'), 'warning'); ?> + + diff --git a/administrator/templates/hathor/html/com_languages/languages/default.php b/administrator/templates/hathor/html/com_languages/languages/default.php index 62d364268111f..537e0dc701109 100644 --- a/administrator/templates/hathor/html/com_languages/languages/default.php +++ b/administrator/templates/hathor/html/com_languages/languages/default.php @@ -36,7 +36,7 @@ @@ -126,7 +126,11 @@ escape($item->sef); ?>
    - escape($item->image); ?> image.'.gif', $item->image, array('title' => $item->image), true); ?> + image) : ?> + image . '.gif', $item->image, null, true); ?> escape($item->image); ?> + + + published, $i, 'languages.', $canChange);?> diff --git a/administrator/templates/hathor/html/com_menus/item/edit.php b/administrator/templates/hathor/html/com_menus/item/edit.php index 88e1a25aa8f81..9e2f10ebb6c96 100644 --- a/administrator/templates/hathor/html/com_menus/item/edit.php +++ b/administrator/templates/hathor/html/com_menus/item/edit.php @@ -95,10 +95,6 @@ form->getInput('link'); ?> - item->type == 'alias') : ?> -
  • form->getLabel('aliastip'); ?>
  • - - item->type != 'url') : ?>
  • form->getLabel('alias'); ?> form->getInput('alias'); ?>
  • diff --git a/administrator/templates/hathor/html/com_menus/items/default.php b/administrator/templates/hathor/html/com_menus/items/default.php index cf461aa1bc026..f9581265ad92c 100644 --- a/administrator/templates/hathor/html/com_menus/items/default.php +++ b/administrator/templates/hathor/html/com_menus/items/default.php @@ -196,11 +196,19 @@ language == '*' || $item->home == '0'):?> home, $i, 'items.', ($item->language != '*' || !$item->home) && $canChange);?> - - language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);?> + + language_image) : ?> + language_image . '.gif', $item->language_title, array('title' => JText::sprintf('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true); ?> + + language_sef; ?> + - language_image . '.gif', $item->language_title, array('title' => $item->language_title), true);?> + language_image) : ?> + language_image . '.gif', $item->language_title, array('title' => $item->language_title), true); ?> + + language_sef; ?> +
    - language == ''):?> - - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + diff --git a/administrator/templates/hathor/html/com_menus/menus/default.php b/administrator/templates/hathor/html/com_menus/menus/default.php index f500642b3ae74..1fd85bb9753f6 100644 --- a/administrator/templates/hathor/html/com_menus/menus/default.php +++ b/administrator/templates/hathor/html/com_menus/menus/default.php @@ -161,8 +161,8 @@ 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), 'height' => '300px', 'width' => '800px', - 'footer' => '' + 'footer' => '' . '' @@ -181,8 +181,8 @@ 'title' => JText::_('COM_MENUS_EDIT_MODULE_SETTINGS'), 'height' => '500px', 'width' => '800px', - 'footer' => '' + 'footer' => '' ) ); ?> diff --git a/administrator/templates/hathor/html/com_menus/menutypes/default.php b/administrator/templates/hathor/html/com_menus/menutypes/default.php index da0fa0b95564b..f617be97300ef 100644 --- a/administrator/templates/hathor/html/com_menus/menutypes/default.php +++ b/administrator/templates/hathor/html/com_menus/menutypes/default.php @@ -12,6 +12,7 @@ $input = JFactory::getApplication()->input; // Checking if loaded via index.php or component.php $tmpl = ($input->getCmd('tmpl') != '') ? '1' : ''; + JFactory::getDocument()->addScriptDeclaration( ' setmenutype = function(type) { @@ -38,7 +39,7 @@
    diff --git a/administrator/templates/hathor/html/com_modules/module/edit_assignment.php b/administrator/templates/hathor/html/com_modules/module/edit_assignment.php index 174fe4d4163aa..b05b23c1dacca 100644 --- a/administrator/templates/hathor/html/com_modules/module/edit_assignment.php +++ b/administrator/templates/hathor/html/com_modules/module/edit_assignment.php @@ -9,8 +9,8 @@ defined('_JEXEC') or die; -// Initiasile related data. -require_once JPATH_ADMINISTRATOR.'/components/com_menus/helpers/menus.php'; +// Initialise related data. +JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); $menuTypes = MenusHelper::getMenuLinks(); JFactory::getDocument()->addScriptDeclaration(" diff --git a/administrator/templates/hathor/html/com_modules/modules/default.php b/administrator/templates/hathor/html/com_modules/modules/default.php index 207ca24c4e1a1..ee0cfb78fbfbd 100644 --- a/administrator/templates/hathor/html/com_modules/modules/default.php +++ b/administrator/templates/hathor/html/com_modules/modules/default.php @@ -49,7 +49,7 @@ state->get('client_id'));?> -
    + + items, 'filesave.png', 'modules.saveorder'); ?> @@ -120,7 +120,7 @@ + @@ -162,13 +162,13 @@ escape($item->note));?>

    -
    + published, $i, $canChange, 'cb'); ?> position; ?> + @@ -185,7 +185,7 @@ ordering; ?> + name;?> @@ -196,13 +196,7 @@ escape($item->access_level); ?> - language == ''):?> - - language == '*'):?> - - - language_title ? JHtml::_('image', 'mod_languages/' . $item->language_image . '.gif', $item->language_title, array('title' => $item->language_title), true) . ' ' . $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> @@ -212,10 +206,20 @@
    - - authorise('core.create', 'com_modules') || $user->authorise('core.edit', 'com_modules')) : ?> - loadTemplate('batch'); ?> - + + authorise('core.create', 'com_modules') + && $user->authorise('core.edit', 'com_modules') + && $user->authorise('core.edit.state', 'com_modules')) : ?> + JText::_('COM_MODULES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + pagination->getListFooter(); ?> diff --git a/administrator/templates/hathor/html/com_modules/positions/modal.php b/administrator/templates/hathor/html/com_modules/positions/modal.php index 9aad317f52834..883412d76944d 100644 --- a/administrator/templates/hathor/html/com_modules/positions/modal.php +++ b/administrator/templates/hathor/html/com_modules/positions/modal.php @@ -15,7 +15,7 @@ $lang = JFactory::getLanguage(); $ordering = $this->escape($this->state->get('list.ordering')); $direction = $this->escape($this->state->get('list.direction')); -$clientId = $this->state->get('filter.client_id'); +$clientId = $this->state->get('client_id'); $state = $this->state->get('filter.state'); $template = $this->state->get('filter.template'); $type = $this->state->get('filter.type'); @@ -25,7 +25,7 @@ -
    +
    + + +
    @@ -269,11 +293,6 @@ function colorIsLight($color)
    - -

    JComponentTitle, 0, false, false); ?>

    -
    @@ -285,7 +304,7 @@ function colorIsLight($color) countModules('status') || (!$statusFixed && $this->countModules('status'))) : ?>
    -

    +

    ©

    diff --git a/administrator/templates/isis/js/template.js b/administrator/templates/isis/js/template.js index 28eb4ffa762c5..5eb58683c8620 100644 --- a/administrator/templates/isis/js/template.js +++ b/administrator/templates/isis/js/template.js @@ -10,23 +10,60 @@ { $(document).ready(function() { + var $w = $(window); + $('*[rel=tooltip]').tooltip(); // Turn radios into btn-group $('.radio.btn-group label').addClass('btn'); + + $('fieldset.btn-group').each(function() { + // Handle disabled, prevent clicks on the container, and add disabled style to each button + if ($(this).prop('disabled')) { + $(this).css('pointer-events', 'none').off('click'); + $(this).find('.btn').addClass('disabled'); + } + }); + $('.btn-group label:not(.active)').click(function() { var label = $(this); var input = $('#' + label.attr('for')); - if (!input.prop('checked')) { + if (!input.prop('checked')) + { label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); - if (input.val() == '') { - label.addClass('active btn-primary'); - } else if (input.val() == 0) { - label.addClass('active btn-danger'); - } else { - label.addClass('active btn-success'); + + if (label.closest('.btn-group').hasClass('btn-group-reversed')) + { + if (input.val() == '') + { + label.addClass('active btn-primary'); + } + else if (input.val() == 0) + { + label.addClass('active btn-success'); + } + else + { + label.addClass('active btn-danger'); + } + } + else + { + if (input.val() == '') + { + label.addClass('active btn-primary'); + } + else if (input.val() == 0) + { + label.addClass('active btn-danger'); + } + else + { + label.addClass('active btn-success'); + } + } input.prop('checked', true); input.trigger('change'); @@ -34,12 +71,38 @@ }); $('.btn-group input[checked=checked]').each(function() { - if ($(this).val() == '') { - $('label[for=' + $(this).attr('id') + ']').addClass('active btn-primary'); - } else if ($(this).val() == 0) { - $('label[for=' + $(this).attr('id') + ']').addClass('active btn-danger'); - } else { - $('label[for=' + $(this).attr('id') + ']').addClass('active btn-success'); + var $self = $(this); + var attrId = $self.attr('id'); + + if ($self.parent().hasClass('btn-group-reversed')) + { + if ($self.val() == '') + { + $('label[for=' + attrId + ']').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for=' + attrId + ']').addClass('active btn-success'); + } + else + { + $('label[for=' + attrId + ']').addClass('active btn-danger'); + } + } + else + { + if ($self.val() == '') + { + $('label[for=' + attrId + ']').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for=' + attrId + ']').addClass('active btn-danger'); + } + else + { + $('label[for=' + attrId + ']').addClass('active btn-success'); + } } }); // add color classes to chosen field based on value @@ -58,56 +121,129 @@ /** * Append submenu items to empty UL on hover allowing a scrollable dropdown */ - var menuScroll = $('#menu > li > ul') - var emptyMenu = $('#nav-empty'); - var menuWidth; + if ($w.width() > 767) + { + var menuScroll = $('#menu > li > ul'), + emptyMenu = $('#nav-empty'); + + $('#menu > li').on('click mouseenter', function() { + + // Set max-height (and width if scroll) for dropdown menu, depending of window height + var $dropdownMenu = $(this).children('ul'), + windowHeight = $w.height(), + linkHeight = $(this).outerHeight(true), + statusHeight = $('#status').outerHeight(true), + menuHeight = $dropdownMenu.height(), + menuOuterHeight = $dropdownMenu.outerHeight(true), + scrollMenuWidth = $dropdownMenu.width() + 15, + maxHeight = windowHeight - (linkHeight + statusHeight + (menuOuterHeight - menuHeight) + 20); + + if (maxHeight < menuHeight) + { + $dropdownMenu.css('width', scrollMenuWidth); + } + else if (maxHeight > menuHeight) + { + $dropdownMenu.css('width', 'auto'); + } - $('#menu > li > a').on('click mouseenter', function() { + $dropdownMenu.css('max-height', maxHeight); - menuWidth = $(this).next('ul').outerWidth(); - emptyMenu.empty().hide(); + // Get the submenu position + linkWidth = $(this).outerWidth(true); + menuWidth = $dropdownMenu.width(); + linkPaddingLeft = $(this).children('a').css('padding-left'); + offsetLeft = Math.round($(this).offset().left) - parseInt(linkPaddingLeft); - }); + emptyMenu.empty().hide(); - menuScroll.find('.dropdown-submenu > a').on('mouseenter', function() { + }); - var $self = $(this); - var dropdown = $self.next('.dropdown-menu'); - var offset = $self.offset(); - var scroll = $(window).scrollTop() + 5; - var width = menuWidth - 13; + menuScroll.find('.dropdown-submenu > a').on('mouseover', function() { - // Set the submenu position - if ($('html').attr('dir') == 'rtl') - { - emptyMenu.css({ - top : offset.top - scroll, - left: offset.left - width - }); - } - else - { - emptyMenu.css({ - top : offset.top - scroll, - left: offset.left + width + var $self = $(this), + dropdown = $self.next('ul'), + submenuWidth = dropdown.outerWidth(), + offsetTop = $self.offset().top, + linkPaddingTop = parseInt(dropdown.css('padding-top')) + parseInt($(this).css('padding-top')), + scroll = $w.scrollTop() + linkPaddingTop; + + // Set the submenu position + if ($('html').attr('dir') == 'rtl') + { + emptyMenu.css({ + top : offsetTop - scroll, + left: offsetLeft - (menuWidth - linkWidth) - submenuWidth + }); + } + else + { + emptyMenu.css({ + top : offsetTop - scroll, + left: offsetLeft + menuWidth + }); + } + + // Append items to empty
      and show it + dropdown.hide(); + emptyMenu.show().html(dropdown.html()); + + // Check if the full element is visible. If not, adjust the position + if (emptyMenu.Jvisible() !== true) + { + emptyMenu.css({ + top : ($w.height() - emptyMenu.outerHeight()) - $('#status').height() + }); + } + + }); + + menuScroll.find('a.no-dropdown').on('mouseenter', function() { + + emptyMenu.empty().hide(); + + }); + + // obtain a reference to the original handler + var _clearMenus = $._data(document, 'events').click.filter(function (el) { + return el.namespace === 'data-api.dropdown' && el.selector === undefined + })[0].handler; + + // disable the old listener + $(document) + .off('click.data-api.dropdown', _clearMenus) + .on('click.data-api.dropdown', function(e) { + e.button === 2 || _clearMenus(); + + if (!$('#menu').find('> li').hasClass('open')) + { + emptyMenu.empty().hide(); + } }); - } - // Append items to empty
        and show it - dropdown.hide(); - emptyMenu.show().html(dropdown.html()); + $.fn.Jvisible = function(partial,hidden) + { + if (this.length < 1) + { + return; + } - }); - menuScroll.find('a.no-dropdown').on('mouseenter', function() { + var $t = this.length > 1 ? this.eq(0) : this, + t = $t.get(0) - emptyMenu.empty().hide(); + var viewTop = $w.scrollTop(), + viewBottom = (viewTop + $w.height()) - $('#status').height(), + offset = $t.offset(), + _top = offset.top, + _bottom = _top + $t.height(), + compareTop = partial === true ? _bottom : _top, + compareBottom = partial === true ? _top : _bottom; - }); - $(document).on('click', function() { + return !!t.offsetWidth * t.offsetHeight && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); + }; - emptyMenu.empty().hide(); + } - }); /** * USED IN: All views with toolbar and sticky bar enabled diff --git a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini index 29cfccfd8caa3..8381b86c329ef 100644 --- a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini +++ b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini @@ -15,6 +15,7 @@ TPL_ISIS_COLOR_SIDEBAR_DESC="Choose a colour for the Sidebar Background." TPL_ISIS_COLOR_SIDEBAR_LABEL="Sidebar Colour" TPL_ISIS_COLOR_LINK_DESC="Choose a colour for the Link." TPL_ISIS_COLOR_LINK_LABEL="Link Colour" +TPL_ISIS_CONTROL_PANEL="Control Panel" TPL_ISIS_EDIT_ACCOUNT="Edit Account" TPL_ISIS_FIELD_ADMIN_MENUS_DESC="If you intend to use Joomla Administrator on a monitor, set this to 'No'. It will prevent the collapse of the Administrator menus when reducing the width of the window. Default is 'Yes'." TPL_ISIS_FIELD_ADMIN_MENUS_LABEL="Collapse Administrator Menu" @@ -28,11 +29,15 @@ TPL_ISIS_LOGO_DESC="Upload a custom logo for the administrator template." TPL_ISIS_LOGO_LABEL="Logo" TPL_ISIS_LOGOUT="Logout" TPL_ISIS_PREVIEW="Preview %s" +TPL_ISIS_SKIP_TO_MAIN_CONTENT="Skip to Main Content" +TPL_ISIS_SKIP_TO_MAIN_CONTENT_HERE="Main content begins here" TPL_ISIS_STATUS_BOTTOM="Fixed bottom" TPL_ISIS_STATUS_DESC="Choose the location of the status module." TPL_ISIS_STATUS_LABEL="Status Module Position" TPL_ISIS_STATUS_TOP="Top" TPL_ISIS_STICKY_DESC="Optionally set the toolbar to a fixed (pinned) location." TPL_ISIS_STICKY_LABEL="Pinned Toolbar" +TPL_ISIS_TOGGLE_MENU="Toggle Navigation" TPL_ISIS_TOOLBAR="Toolbar" +TPL_ISIS_USERMENU="User Menu" TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap and the launch of the Joomla User Interface library (JUI)." diff --git a/administrator/templates/isis/less/bootstrap/button-groups.less b/administrator/templates/isis/less/bootstrap/button-groups.less new file mode 100644 index 0000000000000..7fd4fe73d8788 --- /dev/null +++ b/administrator/templates/isis/less/bootstrap/button-groups.less @@ -0,0 +1,236 @@ +// +// Button groups +// -------------------------------------------------- + + +// Make the div behave like a button +.btn-group { + position: relative; + display: inline-block; + .ie7-inline-block(); + font-size: 0; // remove as part 1 of font-size inline-block hack + vertical-align: middle; // match .btn alignment given font-size hack above + white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page) + .ie7-restore-left-whitespace(); +} + +// Space out series of button groups +.btn-group + .btn-group { + margin-left: 5px; +} + +// Optional: Group multiple button groups together for a toolbar +.btn-toolbar { + font-size: 0; // Hack to remove whitespace that results from using inline-block + margin-top: @baseLineHeight / 2; + margin-bottom: @baseLineHeight / 2; + > .btn + .btn, + > .btn-group + .btn, + > .btn + .btn-group { + margin-left: 5px; + } +} + +// Float them, remove border radius, then re-add to first and last elements +.btn-group > .btn { + position: relative; + .border-radius(0); +} +.btn-group > .btn + .btn { + // margin-left: -1px; +} +.btn-group > .btn-micro { + margin-left: -1px; +} +.btn-group > .btn, +.btn-group > .dropdown-menu, +.btn-group > .popover { + font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack +} + +// Reset fonts for other sizes +.btn-group > .btn-mini { + font-size: @fontSizeMini; +} +.btn-group > .btn-small { + font-size: @fontSizeSmall; +} +.btn-group > .btn-large { + font-size: @fontSizeLarge; +} + +// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match +.btn-group > .btn:first-child { + margin-left: 0; + .border-top-left-radius(@baseBorderRadius); + .border-bottom-left-radius(@baseBorderRadius); +} +// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + .border-top-right-radius(@baseBorderRadius); + .border-bottom-right-radius(@baseBorderRadius); +} +// Reset corners for large buttons +.btn-group > .btn.large:first-child { + margin-left: 0; + .border-top-left-radius(@borderRadiusLarge); + .border-bottom-left-radius(@borderRadiusLarge); +} +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + .border-top-right-radius(@borderRadiusLarge); + .border-bottom-right-radius(@borderRadiusLarge); +} + +// On hover/focus/active, bring the proper btn to front +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} + +// On active and open, don't show outline +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + + + +// Split button dropdowns +// ---------------------- + +// Give the line between buttons some depth +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; + *padding-top: 5px; + *padding-bottom: 5px; +} +.btn-group > .btn-mini + .dropdown-toggle { + padding-left: 5px; + padding-right: 5px; + *padding-top: 2px; + *padding-bottom: 2px; +} +.btn-group > .btn-small + .dropdown-toggle { + *padding-top: 5px; + *padding-bottom: 4px; +} +.btn-group > .btn-large + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; + *padding-top: 7px; + *padding-bottom: 7px; +} + +.btn-group.open { + + // The clickable button for toggling the menu + // Remove the gradient and set the same inset shadow as the :active state + .dropdown-toggle { + background-image: none; + } + + // Keep the hover's background when dropdown is open + .btn.dropdown-toggle { + background-color: @btnBackgroundHighlight; + } + .btn-primary.dropdown-toggle { + background-color: @btnPrimaryBackgroundHighlight; + } + .btn-warning.dropdown-toggle { + background-color: @btnWarningBackgroundHighlight; + } + .btn-danger.dropdown-toggle { + background-color: @btnDangerBackgroundHighlight; + } + .btn-success.dropdown-toggle { + background-color: @btnSuccessBackgroundHighlight; + } + .btn-info.dropdown-toggle { + background-color: @btnInfoBackgroundHighlight; + } + .btn-inverse.dropdown-toggle { + background-color: @btnInverseBackgroundHighlight; + } +} + + +// Reposition the caret +.btn .caret { + margin-top: 8px; + margin-left: 0; +} +// Carets in other button sizes +.btn-large .caret { + margin-top: 6px; +} +.btn-large .caret { + border-left-width: 5px; + border-right-width: 5px; + border-top-width: 5px; +} +.btn-mini .caret, +.btn-small .caret { + margin-top: 8px; +} +// Upside down carets for .dropup +.dropup .btn-large .caret { + border-bottom-width: 5px; +} + + + +// Account for other colors +.btn-primary { + .caret { + border-top-color: @linkColorHover; + border-bottom-color: @linkColorHover; + } +} +.btn-warning, +.btn-danger, +.btn-info, +.btn-success, +.btn-inverse { + .caret { + border-top-color: @white; + border-bottom-color: @white; + } +} + + + +// Vertical button groups +// ---------------------- + +.btn-group-vertical { + display: inline-block; // makes buttons only take up the width they need + .ie7-inline-block(); +} +.btn-group-vertical > .btn { + display: block; + float: none; + max-width: 100%; + .border-radius(0); +} +.btn-group-vertical > .btn + .btn { + margin-left: 0; + margin-top: -1px; +} +.btn-group-vertical > .btn:first-child { + .border-radius(@baseBorderRadius @baseBorderRadius 0 0); +} +.btn-group-vertical > .btn:last-child { + .border-radius(0 0 @baseBorderRadius @baseBorderRadius); +} +.btn-group-vertical > .btn-large:first-child { + .border-radius(@borderRadiusLarge @borderRadiusLarge 0 0); +} +.btn-group-vertical > .btn-large:last-child { + .border-radius(0 0 @borderRadiusLarge @borderRadiusLarge); +} + diff --git a/administrator/templates/isis/less/bootstrap/buttons.less b/administrator/templates/isis/less/bootstrap/buttons.less new file mode 100644 index 0000000000000..e6714d250fe91 --- /dev/null +++ b/administrator/templates/isis/less/bootstrap/buttons.less @@ -0,0 +1,285 @@ +// +// Buttons +// -------------------------------------------------- + + +// Base styles +// -------------------------------------------------- + +// Core +.btn { + display: inline-block; + .ie7-inline-block(); + padding: 4px 12px; + margin-bottom: 0; // For input.btn + font-size: @baseFontSize; + line-height: @baseLineHeight; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-color: @btnBackground; + color: #333; + // .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75)); + border: 1px solid @btnBorder; + .border-radius(@baseBorderRadius); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + &:hover, + &:focus { + background-color: @btnBackgroundHighlight; + text-decoration: none; + text-shadow: none; + } + + // Focus state for keyboard and accessibility + &:focus { + .tab-focus(); + } + + // Active state + &.active, + &:active { + background-image: none; + outline: 0; + // .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)"); + } + + // Disabled state + &.disabled, + &[disabled] { + cursor: default; + background-image: none; + .opacity(65); + .box-shadow(none); + } + +} + + + +// Button Sizes +// -------------------------------------------------- + +// Large +.btn-large { + padding: @paddingLarge; + font-size: @fontSizeLarge; + .border-radius(30px); +} +.btn-large [class^="icon-"], +.btn-large [class*=" icon-"] { + margin-top: 4px; +} + +// Small +.btn-small { + padding: @paddingSmall; + font-size: @fontSizeSmall; + .border-radius(@borderRadiusSmall); +} +.btn-small [class^="icon-"], +.btn-small [class*=" icon-"] { + margin-top: 0; +} +.btn-mini [class^="icon-"], +.btn-mini [class*=" icon-"] { + margin-top: -1px; +} + +// Mini +.btn-mini { + padding: @paddingMini; + font-size: @fontSizeMini; + .border-radius(@borderRadiusSmall); +} + + +// Block button +// ------------------------- + +.btn-block { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; + .box-sizing(border-box); +} + +// Vertically space out multiple block buttons +.btn-block + .btn-block { + margin-top: 5px; +} + +// Specificity overrides +input[type="submit"], +input[type="reset"], +input[type="button"] { + &.btn-block { + width: 100%; + } +} + + + +// Alternate buttons +// -------------------------------------------------- + +.btn-primary, +.btn-warning, +.btn-danger, +.btn-success, +.btn-info, +.btn-inverse { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} + +// Provide *some* extra contrast for those who can get it +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + // color: rgba(255,255,255,.75); +} + +// Set the backgrounds +// ------------------------- +.btn-primary { + border: 1px solid @btnPrimaryBackgroundHighlight; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnPrimaryBackground; + &:hover, + &:focus { + background-color: darken(@btnPrimaryBackground, 15%); + color: #fff; + text-decoration: none; + } +} +// Warning appears are orange +.btn-warning { + border: 1px solid @btnWarningBackground; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnWarningBackground; + &:hover, + &:focus { + background-color: darken(@btnWarningBackground, 15%); + color: #fff; + text-decoration: none; + text-shadow: none; + } +} +// Danger and error appear as red +.btn-danger { + border: 1px solid @btnDangerBackground; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnDangerBackground; + &:hover, + &:focus { + background-color: darken(@btnDangerBackground, 15%); + color: #fff; + text-decoration: none; + } +} +// Success appears as green +.btn-success { + border: 1px solid @btnSuccessBackgroundHighlight; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnSuccessBackground; + &:hover, + &:focus { + background-color: darken(@btnSuccessBackground, 15%); + color: #fff; + text-decoration: none; + } +} +// Info appears as a neutral blue +.btn-info { + border: 1px solid @btnInfoBackground; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnInfoBackground; + &:hover, + &:focus { + background-color: darken(@btnInfoBackground, 15%); + color: #fff; + text-decoration: none; + } +} +// Inverse appears as dark gray +.btn-inverse { + border: 1px solid @btnInverseBackground; + border: 1px solid rgba(0, 0, 0, 0.2); + color: #fff; + background-color: @btnInverseBackground; + &:hover, + &:focus { + background-color: darken(@btnInverseBackground, 15%); + color: #fff; + text-decoration: none; + } +} + + +// Cross-browser Jank +// -------------------------------------------------- + +button.btn, +input[type="submit"].btn { + + // Firefox 3.6 only I believe + &::-moz-focus-inner { + padding: 0; + border: 0; + } + + // IE7 has some default padding on button controls + *padding-top: 3px; + *padding-bottom: 3px; + + &.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; + } + &.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; + } + &.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; + } +} + + +// Link buttons +// -------------------------------------------------- + +// Make a button look and behave like a link +.btn-link, +.btn-link:active, +.btn-link[disabled] { + background-color: transparent; + background-image: none; + .box-shadow(none); +} +.btn-link { + border-color: transparent; + cursor: pointer; + color: @linkColor; + .border-radius(0); +} +.btn-link:hover, +.btn-link:focus { + color: @linkColorHover; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +.btn-link[disabled]:focus { + color: @grayDark; + text-decoration: none; +} diff --git a/administrator/templates/isis/less/bootstrap/mixins.less b/administrator/templates/isis/less/bootstrap/mixins.less new file mode 100644 index 0000000000000..5ecf2cea980b7 --- /dev/null +++ b/administrator/templates/isis/less/bootstrap/mixins.less @@ -0,0 +1,708 @@ +// +// Mixins +// -------------------------------------------------- + + +// UTILITY MIXINS +// -------------------------------------------------- + +// Clearfix +// -------- +// For clearing floats like a boss h5bp.com/q +.clearfix { + *zoom: 1; + &:before, + &:after { + display: table; + content: ""; + // Fixes Opera/contenteditable bug: + // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952 + line-height: 0; + } + &:after { + clear: both; + } +} + +// Webkit-style focus +// ------------------ +.tab-focus() { + // Default + outline: thin dotted #333; + // Webkit + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +// Center-align a block level element +// ---------------------------------- +.center-block() { + display: block; + margin-left: auto; + margin-right: auto; +} + +// IE7 inline-block +// ---------------- +.ie7-inline-block() { + *display: inline; /* IE7 inline-block hack */ + *zoom: 1; +} + +// IE7 likes to collapse whitespace on either side of the inline-block elements. +// Ems because we're attempting to match the width of a space character. Left +// version is for form buttons, which typically come after other elements, and +// right version is for icons, which come before. Applying both is ok, but it will +// mean that space between those elements will be .6em (~2 space characters) in IE7, +// instead of the 1 space in other browsers. +.ie7-restore-left-whitespace() { + *margin-left: .3em; + + &:first-child { + *margin-left: 0; + } +} + +.ie7-restore-right-whitespace() { + *margin-right: .3em; +} + +// Sizing shortcuts +// ------------------------- +.size(@height, @width) { + width: @width; + height: @height; +} +.square(@size) { + .size(@size, @size); +} + +// Placeholder text +// ------------------------- +.placeholder(@color: @placeholderText) { + &:-moz-placeholder { + color: @color; + } + &:-ms-input-placeholder { + color: @color; + } + &::-webkit-input-placeholder { + color: @color; + } +} + +// Text overflow +// ------------------------- +// Requires inline-block or block for proper styling +.text-overflow() { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +// CSS image replacement +// ------------------------- +// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + + +// FONTS +// -------------------------------------------------- + +#font { + #family { + .serif() { + font-family: @serifFontFamily; + } + .sans-serif() { + font-family: @sansFontFamily; + } + .monospace() { + font-family: @monoFontFamily; + } + } + .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { + font-size: @size; + font-weight: @weight; + line-height: @lineHeight; + } + .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { + #font > #family > .serif; + #font > .shorthand(@size, @weight, @lineHeight); + } + .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { + #font > #family > .sans-serif; + #font > .shorthand(@size, @weight, @lineHeight); + } + .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { + #font > #family > .monospace; + #font > .shorthand(@size, @weight, @lineHeight); + } +} + + +// FORMS +// -------------------------------------------------- + +// Block level inputs +.input-block-level { + display: block; + width: 100%; + min-height: @inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border) + .box-sizing(border-box); // Makes inputs behave like true block-level elements +} + + + +// Mixin for form field states +.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) { + // Set the text color + .control-label, + .help-block, + .help-inline { + color: @textColor; + } + // Style inputs accordingly + .checkbox, + .radio, + input, + select, + textarea { + color: @textColor; + } + input, + select, + textarea { + border-color: @borderColor; + //.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work + &:focus { + border-color: darken(@borderColor, 10%); + @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%); + //.box-shadow(@shadow); + } + } + // Give a small background color for input-prepend/-append + .input-prepend .add-on, + .input-append .add-on { + color: @textColor; + background-color: @backgroundColor; + border-color: @textColor; + } +} + + + +// CSS3 PROPERTIES +// -------------------------------------------------- + +// Border Radius +.border-radius(@radius) { + -webkit-border-radius: @radius; + -moz-border-radius: @radius; + border-radius: @radius; +} + +// Single Corner Border Radius +.border-top-left-radius(@radius) { + -webkit-border-top-left-radius: @radius; + -moz-border-radius-topleft: @radius; + border-top-left-radius: @radius; +} +.border-top-right-radius(@radius) { + -webkit-border-top-right-radius: @radius; + -moz-border-radius-topright: @radius; + border-top-right-radius: @radius; +} +.border-bottom-right-radius(@radius) { + -webkit-border-bottom-right-radius: @radius; + -moz-border-radius-bottomright: @radius; + border-bottom-right-radius: @radius; +} +.border-bottom-left-radius(@radius) { + -webkit-border-bottom-left-radius: @radius; + -moz-border-radius-bottomleft: @radius; + border-bottom-left-radius: @radius; +} + +// Single Side Border Radius +.border-top-radius(@radius) { + .border-top-right-radius(@radius); + .border-top-left-radius(@radius); +} +.border-right-radius(@radius) { + .border-top-right-radius(@radius); + .border-bottom-right-radius(@radius); +} +.border-bottom-radius(@radius) { + .border-bottom-right-radius(@radius); + .border-bottom-left-radius(@radius); +} +.border-left-radius(@radius) { + .border-top-left-radius(@radius); + .border-bottom-left-radius(@radius); +} + +// Drop shadows +.box-shadow(@shadow) { + -webkit-box-shadow: @shadow; + -moz-box-shadow: @shadow; + box-shadow: @shadow; +} + +// Transitions +.transition(@transition) { + -webkit-transition: @transition; + -moz-transition: @transition; + -o-transition: @transition; + transition: @transition; +} +.transition-delay(@transition-delay) { + -webkit-transition-delay: @transition-delay; + -moz-transition-delay: @transition-delay; + -o-transition-delay: @transition-delay; + transition-delay: @transition-delay; +} +.transition-duration(@transition-duration) { + -webkit-transition-duration: @transition-duration; + -moz-transition-duration: @transition-duration; + -o-transition-duration: @transition-duration; + transition-duration: @transition-duration; +} + +// Transformations +.rotate(@degrees) { + -webkit-transform: rotate(@degrees); + -moz-transform: rotate(@degrees); + -ms-transform: rotate(@degrees); + -o-transform: rotate(@degrees); + transform: rotate(@degrees); +} +.scale(@ratio) { + -webkit-transform: scale(@ratio); + -moz-transform: scale(@ratio); + -ms-transform: scale(@ratio); + -o-transform: scale(@ratio); + transform: scale(@ratio); +} +.translate(@x, @y) { + -webkit-transform: translate(@x, @y); + -moz-transform: translate(@x, @y); + -ms-transform: translate(@x, @y); + -o-transform: translate(@x, @y); + transform: translate(@x, @y); +} +.skew(@x, @y) { + -webkit-transform: skew(@x, @y); + -moz-transform: skew(@x, @y); + -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885 + -o-transform: skew(@x, @y); + transform: skew(@x, @y); + -webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319 +} +.translate3d(@x, @y, @z) { + -webkit-transform: translate3d(@x, @y, @z); + -moz-transform: translate3d(@x, @y, @z); + -o-transform: translate3d(@x, @y, @z); + transform: translate3d(@x, @y, @z); +} + +// Backface visibility +// Prevent browsers from flickering when using CSS 3D transforms. +// Default value is `visible`, but can be changed to `hidden +// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples +.backface-visibility(@visibility){ + -webkit-backface-visibility: @visibility; + -moz-backface-visibility: @visibility; + backface-visibility: @visibility; +} + +// Background clipping +// Heads up: FF 3.6 and under need "padding" instead of "padding-box" +.background-clip(@clip) { + -webkit-background-clip: @clip; + -moz-background-clip: @clip; + background-clip: @clip; +} + +// Background sizing +.background-size(@size) { + -webkit-background-size: @size; + -moz-background-size: @size; + -o-background-size: @size; + background-size: @size; +} + + +// Box sizing +.box-sizing(@boxmodel) { + -webkit-box-sizing: @boxmodel; + -moz-box-sizing: @boxmodel; + box-sizing: @boxmodel; +} + +// User select +// For selecting text on the page +.user-select(@select) { + -webkit-user-select: @select; + -moz-user-select: @select; + -ms-user-select: @select; + -o-user-select: @select; + user-select: @select; +} + +// Resize anything +.resizable(@direction) { + resize: @direction; // Options: horizontal, vertical, both + overflow: auto; // Safari fix +} + +// CSS3 Content Columns +.content-columns(@columnCount, @columnGap: @gridGutterWidth) { + -webkit-column-count: @columnCount; + -moz-column-count: @columnCount; + column-count: @columnCount; + -webkit-column-gap: @columnGap; + -moz-column-gap: @columnGap; + column-gap: @columnGap; +} + +// Optional hyphenation +.hyphens(@mode: auto) { + word-wrap: break-word; + -webkit-hyphens: @mode; + -moz-hyphens: @mode; + -ms-hyphens: @mode; + -o-hyphens: @mode; + hyphens: @mode; +} + +// Opacity +.opacity(@opacity) { + opacity: @opacity / 100; + filter: ~"alpha(opacity=@{opacity})"; +} + + + +// BACKGROUNDS +// -------------------------------------------------- + +// Add an alphatransparency value to any background or border color (via Elyse Holladay) +#translucent { + .background(@color: @white, @alpha: 1) { + background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha); + } + .border(@color: @white, @alpha: 1) { + border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha); + .background-clip(padding-box); + } +} + +// Gradient Bar Colors for buttons and alerts +.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { + color: @textColor; + text-shadow: @textShadow; + #gradient > .vertical(@primaryColor, @secondaryColor); + border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%); + // No idea why this is here, as it makes the border grey instead of the given colors + // border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%); +} + +// Gradients +#gradient { + .horizontal(@startColor: #555, @endColor: #333) { + background-color: @endColor; + background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ + background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10 + background-repeat: repeat-x; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down + } + .vertical(@startColor: #555, @endColor: #333) { + background-color: mix(@startColor, @endColor, 60%); + background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ + background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10 + background-repeat: repeat-x; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down + } + .directional(@startColor: #555, @endColor: #333, @deg: 45deg) { + background-color: @endColor; + background-repeat: repeat-x; + background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+ + background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+ + background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10 + background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10 + } + .horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) { + background-color: mix(@midColor, @endColor, 80%); + background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor)); + background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor); + background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor); + background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor); + background-image: linear-gradient(to right, @startColor, @midColor @colorStop, @endColor); + background-repeat: no-repeat; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback + } + + .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) { + background-color: mix(@midColor, @endColor, 80%); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor)); + background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor); + background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor); + background-repeat: no-repeat; + filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback + } + .radial(@innerColor: #555, @outerColor: #333) { + background-color: @outerColor; + background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor)); + background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor); + background-image: -moz-radial-gradient(circle, @innerColor, @outerColor); + background-image: -o-radial-gradient(circle, @innerColor, @outerColor); + // > Joomla JUI + /* Joomla JUI NOTE: makes radial gradient IE 10+, also confirmed in Bootstrap, https://github.com/twbs/bootstrap/issues/7462 */ + background-image: radial-gradient(circle, @innerColor, @outerColor); + // < Joomla JUI + background-repeat: no-repeat; + } + .striped(@color: #555, @angle: 45deg) { + background-color: @color; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); + } +} +// Reset filters for IE +.reset-filter() { + filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); +} + + + +// COMPONENT MIXINS +// -------------------------------------------------- + +// Horizontal dividers +// ------------------------- +// Dividers (basically an hr) within dropdowns and nav lists +.nav-divider(@top: #e5e5e5, @bottom: @white) { + // IE7 needs a set width since we gave a height. Restricting just + // to IE7 to keep the 1px left/right space in other browsers. + // It is unclear where IE is getting the extra space that we need + // to negative-margin away, but so it goes. + *width: 100%; + height: 1px; + margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px + *margin: -5px 0 5px; + overflow: hidden; + background-color: @top; + border-bottom: 1px solid @bottom; +} + +// Button backgrounds +// ------------------ +.buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { + // gradientBar will set the background to a pleasing blend of these, to support IE<=9 + //.gradientBar(@startColor, @endColor, @textColor, @textShadow); + background-color: @startColor; + *background-color: @startColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + //.reset-filter(); + + // in these cases the gradient won't cover the background, so we override + &:hover, &:focus, &:active, &.active, &.disabled, &[disabled] { + color: @textColor; + background-color: darken(@endColor, 5%); + *background-color: darken(@endColor, 5%); + } + + // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves + &:active, + &.active { + background-color: @startColor; + } +} + +// Navbar vertical align +// ------------------------- +// Vertically center elements in the navbar. +// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin. +.navbarVerticalAlign(@elementHeight) { + margin-top: (@navbarHeight - @elementHeight) / 2; +} + + + +// Grid System +// ----------- + +// Centered container element +.container-fixed() { + margin-right: auto; + margin-left: auto; + .clearfix(); +} + +// Table columns +.tableColumns(@columnSpan: 1) { + float: none; // undo default grid column styles + width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells + margin-left: 0; // undo default grid column styles +} + +// Make a Grid +// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior +.makeRow() { + margin-left: @gridGutterWidth * -1; + .clearfix(); +} +.makeColumn(@columns: 1, @offset: 0) { + float: left; + margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2); + width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); +} + +// The Grid +#grid { + + .core (@gridColumnWidth, @gridGutterWidth) { + + .spanX (@index) when (@index > 0) { + .span@{index} { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + + .offsetX (@index) when (@index > 0) { + .offset@{index} { .offset(@index); } + .offsetX(@index - 1); + } + .offsetX (0) {} + + .offset (@columns) { + margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1)); + } + + .span (@columns) { + width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); + } + + .row { + margin-left: @gridGutterWidth * -1; + .clearfix(); + } + + [class*="span"] { + float: left; + min-height: 1px; // prevent collapsing columns + margin-left: @gridGutterWidth; + } + + // Set the container width, and override it for fixed navbars in media queries + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { .span(@gridColumns); } + + // generate .spanX and .offsetX + .spanX (@gridColumns); + .offsetX (@gridColumns); + + } + + .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) { + + .spanX (@index) when (@index > 0) { + .span@{index} { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + + .offsetX (@index) when (@index > 0) { + .offset@{index} { .offset(@index); } + .offset@{index}:first-child { .offsetFirstChild(@index); } + .offsetX(@index - 1); + } + .offsetX (0) {} + + .offset (@columns) { + margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2); + *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%); + } + + .offsetFirstChild (@columns) { + margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth); + *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); + } + + .span (@columns) { + width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); + *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%); + } + + .row-fluid { + width: 100%; + .clearfix(); + [class*="span"] { + .input-block-level(); + float: left; + margin-left: @fluidGridGutterWidth; + *margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); + } + [class*="span"]:first-child { + margin-left: 0; + } + + // Space grid-sized controls properly if multiple per line + .controls-row [class*="span"] + [class*="span"] { + margin-left: @fluidGridGutterWidth; + } + + // generate .spanX and .offsetX + .spanX (@gridColumns); + .offsetX (@gridColumns); + } + + } + + .input(@gridColumnWidth, @gridGutterWidth) { + + .spanX (@index) when (@index > 0) { + input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); } + .spanX(@index - 1); + } + .spanX (0) {} + + .span(@columns) { + width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14; + } + + input, + textarea, + .uneditable-input { + margin-left: 0; // override margin-left from core grid system + } + + // Space grid-sized controls properly if multiple per line + .controls-row [class*="span"] + [class*="span"] { + margin-left: @gridGutterWidth; + } + + // generate .spanX + .spanX (@gridColumns); + + } +} diff --git a/administrator/templates/isis/less/bootstrap/wells.less b/administrator/templates/isis/less/bootstrap/wells.less new file mode 100644 index 0000000000000..41aea38030da7 --- /dev/null +++ b/administrator/templates/isis/less/bootstrap/wells.less @@ -0,0 +1,29 @@ +// +// Wells +// -------------------------------------------------- + + +// Base class +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: @wellBackground; + border: 1px solid @wellBackground; + .border-radius(@baseBorderRadius); + //.box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); + blockquote { + border-color: #f0f0f0; + border-color: rgba(0,0,0,.15); + } +} + +// Sizes +.well-large { + padding: 24px; + .border-radius(@borderRadiusLarge); +} +.well-small { + padding: 9px; + .border-radius(@borderRadiusSmall); +} diff --git a/administrator/templates/isis/less/chzn-override.less b/administrator/templates/isis/less/chzn-override.less new file mode 100644 index 0000000000000..371c91ceaca44 --- /dev/null +++ b/administrator/templates/isis/less/chzn-override.less @@ -0,0 +1,173 @@ +.chzn-container { + .chzn-drop { + border-radius: 0 0 3px 3px; + } +} +.chzn-container-single { + .chzn-single { + background-color: @white; + background-clip: inherit; + background-image: none; + border: 1px solid @inputBorder; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 3px; + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); + height: auto; + line-height: 26px; + div { + background-color: @btnBackground; + border-left: 1px solid @inputBorder; + bottom: 0; + height: auto; + text-align: center; + width: 28px; + b { + background-image: none; + display: inline-block; + &:after { + content: '\E011'; + font-family: IcoMoon; + } + } + } + abbr { + background: none; + right: 36px; + top: 0; + &:before { + font-family: IcoMoon; + content: '\0049'; + font-size: 10px; + line-height: 26px; + } + &:hover { + color: #000; + } + } + } + .chzn-search { + &:after { + content: '\0053'; + font-family: IcoMoon; + position: relative; + right: 20px; + top: 2px; + } + input[type="text"] { + background: none; + border-radius: @inputBorderRadius; + border: 1px solid @inputBorder; + box-shadow: none; + height: 25px; + &:focus { + border-color: @inputBorderHighlight; + } + } + } + .chzn-drop { + background-clip: padding-box; + border-color: @inputBorderHighlight; + border-radius: 0 0 3px 3px; + } +} +.chzn-container-active { + .chzn-single { + color: @inputBorderHighlight; + } + &.chzn-with-drop { + .chzn-single { + background-image: none; + border: 1px solid @inputBorderHighlight; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + div { + background-color: @btnBackground; + border-bottom: 1px solid @inputBorder; + border-bottom-left-radius: @inputBorderRadius; + border-left: 1px solid @inputBorder; + b { + &:after { + content: '\E00F'; + font-family: IcoMoon; + } + } + } + } + } + &.chzn-container-multi { + .chzn-choices { + border: 1px solid @inputBorderHighlight; + box-shadow: none; + } + } +} +.chzn-container .chzn-results { + background-color: @white; + border-radius: 0 0 @inputBorderRadius @inputBorderRadius; + margin: 0; + padding: 0; + li.highlighted { + background-color: @inputBorderHighlight; + background-image: none; + } +} +.chzn-color[rel="value_"] div { + background-color: @btnBackground; + border-left: 1px solid @inputBorder; +} +.chzn-color-state.chzn-single, +.chzn-color.chzn-single[rel="value_0"], +.chzn-color.chzn-single[rel="value_1"], +.chzn-color-state.chzn-single[rel="value_-1"], +.chzn-color-state.chzn-single[rel="value_-2"], +.chzn-color.chzn-single[rel="value_hide"], +.chzn-color.chzn-single[rel="value_show_no_link"], +.chzn-color.chzn-single[rel="value_show_with_link"] { + div { + background-color: transparent !important; + border: none !important; + } +} +.chzn-container-active .chzn-choices { + border: 1px solid @inputBorderHighlight; +} +.chzn-container-multi { + .chzn-choices { + background-image: none; + border-radius: @inputBorderRadius; + border: 1px solid @inputBorder; + li.search-choice { + background-color: @inputBorderHighlight; + background-image: none; + border: 0; + box-shadow: none; + color: #fff; + line-height: 20px; + padding: 0 7px; + .search-choice-close { + color: #f5f5f5; + display: inline-block; + margin-left: 5px; + position: relative; + top: 0; + left: 0; + background-image: none; + font-size: inherit; + &:hover { + text-decoration: none; + } + &:before { + font-family: IcoMoon; + content: '\004A'; + position: relative; + right: 1px; + top: 0; + } + } + } + } +} +.js-stools .js-stools-container-bar .js-stools-field-filter .chzn-container { + margin: 1px 0; + padding: 0 !important; +} \ No newline at end of file diff --git a/administrator/templates/isis/less/icomoon.less b/administrator/templates/isis/less/icomoon.less index ad0b61ed50cc5..46f801b4214b3 100644 --- a/administrator/templates/isis/less/icomoon.less +++ b/administrator/templates/isis/less/icomoon.less @@ -36,4 +36,4 @@ } .icon-back:before { content: "\e008"; -} +} \ No newline at end of file diff --git a/administrator/templates/isis/less/template-rtl.less b/administrator/templates/isis/less/template-rtl.less index 160404e8f1f83..1937b50077fbf 100644 --- a/administrator/templates/isis/less/template-rtl.less +++ b/administrator/templates/isis/less/template-rtl.less @@ -37,11 +37,59 @@ } } } + .nav > .dropdown.open:after { + right: 10px; + width: 0; + } .empty-nav { display: none; } } +#toolbar { + .btn { + padding: 0 10px; + } + [class^="icon-"], [class*=" icon-"] { + border-radius: 0 3px 3px 0; + border-right: 0; + border-left: 1px solid #b3b3b3; + margin: 0 -10px 0 6px; + } +} +.chzn-container-single .chzn-single { + padding-left: 8px; + div { + border-left: 0; + border-right: 1px solid #cccccc; + } + abbr { + left: 36px; + } +} +.chzn-container-active.chzn-with-drop .chzn-single div { + background-color: #f3f3f3; + border-bottom: 1px solid #cccccc; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 3px; + border-left: 1px solid #cccccc; +} +.chzn-container-multi .chzn-choices .search-choice { + padding-left: 7px; + .search-choice-close { + margin-left: 0; + margin-right: 3px; + } +} +.chzn-container .chzn-single.chzn-color[rel="value_0"] div, +.chzn-container .chzn-single.chzn-color[rel="value_1"] div { + border-right: none; +} +.chzn-container-single .chzn-search::after { + left: 20px; + right: auto; +} + .container-logo { padding-top: 0; float: left; @@ -87,8 +135,25 @@ } /* Status module */ -#status .badge { - margin-left: 0; +#status { + padding: 4px 10px; + + .btn-group { + margin: 0; + } + .btn-group.separator:after { + content: ' '; + display: block; + float: left; + background: #ADADAD; + margin: 0 10px; + height: 15px; + width: 1px; + } + .badge { + margin-left: .25em; + margin-right: 0; + } } /* Menus */ @@ -274,4 +339,14 @@ a.grid_true { /* Stats plugin */ .js-pstats-data-details dd { margin-right: 240px; -} \ No newline at end of file +} + +/* Modal footer */ +.modal-footer button { + float: left; +} + +/* Modal Header text align right even if parent container centered */ +.modal-header { + text-align: right; +} diff --git a/administrator/templates/isis/less/template.less b/administrator/templates/isis/less/template.less index c550f2310e000..4cbabcea87b5a 100644 --- a/administrator/templates/isis/less/template.less +++ b/administrator/templates/isis/less/template.less @@ -3,7 +3,14 @@ // Core variables and mixins @import "variables.less"; // Custom for this template -@import "../../../../media/jui/less/mixins.less"; +@import "bootstrap/mixins.less"; +#grid { + .core { + .span(@gridColumns) { + width: (@gridColumnWidth * @gridColumns) + (@gridGutterWidth * (@gridColumns - 1)); + } + } +}; // Grid system and page structure @import "../../../../media/jui/less/scaffolding.less"; @import "../../../../media/jui/less/grid.less"; @@ -16,12 +23,12 @@ // Components: common // @import "../../../../media/jui/less/sprites.less"; @import "../../../../media/jui/less/dropdowns.less"; -@import "../../../../media/jui/less/wells.less"; +@import "bootstrap/wells.less"; @import "../../../../media/jui/less/component-animations.less"; @import "../../../../media/jui/less/close.less"; // Components: Buttons & Alerts -@import "../../../../media/jui/less/buttons.less"; -@import "../../../../media/jui/less/button-groups.less"; +@import "bootstrap/buttons.less"; +@import "bootstrap/button-groups.less"; @import "../../../../media/jui/less/alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less // Components: Nav @@ -67,6 +74,8 @@ @import "../../../../media/jui/less/responsive-767px-max.joomla.less"; // Icon Font @import "icomoon.less"; +// Chosen.css Flat Override +@import "chzn-override.less"; /* Body */ html { height: 100%; @@ -127,6 +136,15 @@ a:focus { .input-medium { width: 176px; } + #lang_chzn { + width: 233px !important; + .chzn-single div { + width:43px; + } + } + .input-prepend .add-on, .controls .btn-group > .btn { + margin-left:0; + } } .navbar-inverse { @@ -134,14 +152,6 @@ a:focus { } .login { - .chzn-single { - width: 222px !important; - } - .chzn-container, - .chzn-drop { - width: 230px !important; - max-width: 230px !important; - } .btn-large { margin-top: 15px; } @@ -221,6 +231,13 @@ body .navbar-fixed-top { } .nav > li > a { padding: 6px 10px; + &:hover { + color: white; + } + &:hover span.carot { + border-bottom-color: #fff; + border-top-color: #fff; + } } .dropdown-menu, .nav-user { @@ -247,6 +264,23 @@ body .navbar-fixed-top { -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5); } } + .nav > li > a:focus { + outline: none; + } + .nav > li > .dropdown-menu:after { + display: none; + } + .nav > .dropdown.open:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + position: absolute; + top: 25px; + left: 10px; + z-index: 1001; + } .empty-nav { display: none; } @@ -258,6 +292,9 @@ body .navbar-fixed-top { .box-shadow(none); } } +.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-submenu:hover > a, .dropdown-submenu:focus > a { + background-image: none; +} // Fixed to bottom .navbar-fixed-bottom { @@ -271,7 +308,7 @@ body .navbar-fixed-top { .header { background-color: @headerBackground; border-top: 1px solid rgba(255, 255, 255, 0.2); - padding: 5px 25px; + padding: 8px 25px; } .navbar .btn-navbar { @@ -413,15 +450,50 @@ body .navbar-fixed-top { } /* Toolbar */ -#toolbar .btn-success { - width: 148px; -} - -#toolbar #toolbar-options, -#toolbar #toolbar-help { - float: right; -} - +#toolbar { + margin-bottom: 6px; + margin-top: 12px; + .btn { + line-height: 24px; + margin-right: 4px; + padding: 0 10px; + } + .btn-success { + width: 148px; + border-color: @btnPrimaryBackground; + border-color: rgba(0, 0, 0, 0.2); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + &:hover { + background-color: #378137; + } + [class^="icon-"], [class*=" icon-"] { + background-color: transparent; + border-right: 0; + border-left: 0; + width: 16px; + margin-left: 0; + margin-right: 0; + } + } + #toolbar-options, #toolbar-help { + float: right; + } + [class^="icon-"], [class*=" icon-"] { + background-color: @btnBackgroundHighlight; + border-radius: 3px 0 0 3px; + border-right: 1px solid @btnBorder; + height: auto; + line-height: inherit; + margin: 0 6px 0 -10px; + opacity: 1; + text-shadow: none; + width: 28px; + z-index: -1; + } + iframe .btn-group .btn { + margin-left: -1px !important; + } +} html[dir=rtl] #toolbar #toolbar-options, html[dir=rtl] #toolbar #toolbar-help { float: left; @@ -482,14 +554,22 @@ h6 { .sidebar-nav .nav-list > li > a { color: #555; padding: 3px 25px; - margin-left: -25px; - margin-right: -25px; + margin-left: -26px; + margin-right: -26px; } .sidebar-nav .nav-list > li.active > a { color: #fff; margin-right: -26px; } +.sidebar-nav .nav-list > li > a:focus, +.sidebar-nav .nav-list > li > a:hover { + text-decoration: none; + color: #fff; + background-color: #2d6ca2; + text-shadow: none; +} + /* Quick-icons */ .quick-icons .nav li + .nav-header { margin-top: 12px; @@ -552,10 +632,22 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon #status { background: #ebebeb; border-top: 1px solid #d4d4d4; - padding: 2px 10px 4px 10px; + padding: 4px 10px; .box-shadow(~"0px 1px 0px rgba(255, 255, 255, 0.8) inset, 0px -15px 15px rgba(255, 255, 255, 0.6)"); color: #626262; + .btn-group { + margin: 0; + } + .btn-group.separator:after { + content: ' '; + display: block; + float: left; + background: #ADADAD; + margin: 0 10px; + height: 15px; + width: 1px; + } .btn-toolbar, p { margin: 0px; } @@ -565,6 +657,9 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon a { color: #626262; } + .badge { + margin-right: .25em; + } } /* Status Module in top position */ #status.status-top { @@ -607,15 +702,6 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon #assignment.tab-pane { min-height: 500px; } -// Button color -.btn-primary.active, -.btn-warning.active, -.btn-danger.active, -.btn-success.active, -.btn-info.active, -.btn-inverse.active { - color: rgba(255, 255, 255, .95); -} /* Chosen Max Width */ .chzn-container, .chzn-drop { @@ -771,6 +857,11 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon .login .chzn-drop { width: 230px !important; } + #toolbar [class^="icon-"], #toolbar [class*=" icon-"] { + background-color: transparent; + border-right: medium none; + width: 10px; + } } @media (max-width: 320px) { @@ -779,7 +870,7 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon } .btn-toolbar .btn-wrapper .btn { - width: 100% !important; + width: 100% !important; } } // Navbar @@ -890,6 +981,10 @@ html[dir=rtl] .quick-icons .nav-list [class^="icon-"], html[dir=rtl] .quick-icon vertical-align: baseline; } } +.j-jed-message { + line-height: 2em; + color:#333333; +} // Normalize LTR Label (JBS request) // -------------------------- @@ -1106,8 +1201,14 @@ th .tooltip-inner { opacity: 1; } /* Permissions dropdown display */ -#permissions-sliders .chzn-container { - position: absolute; +#permissions-sliders { + .chzn-container { + margin-top: -5px; + position: absolute; + } + .table td { + padding: 8px 8px 9px; + } } /* Component pop-up */ .container-popup { @@ -1116,6 +1217,7 @@ th .tooltip-inner { /* Min-width on buttons */ .controls .btn-group > .btn { min-width: 50px; + margin-left: -1px; } .controls .btn-group.btn-group-yesno > .btn { @@ -1127,6 +1229,7 @@ th .tooltip-inner { } /* Help site refresh button*/ #helpsite-refresh { + padding: 4px 12px; vertical-align: top; } .alert-no-items { @@ -1152,25 +1255,39 @@ input.input-large-text { margin-bottom: 10px; } /* Chosen color styles */ -[class^="chzn-color"].chzn-single, -[class*=" chzn-color"].chzn-single, -[class^="chzn-color"].chzn-single .chzn-single-with-drop, -[class*=" chzn-color"].chzn-single .chzn-single-with-drop { - .box-shadow(none); -} - .chzn-color.chzn-single[rel="value_1"], .chzn-color-reverse.chzn-single[rel="value_0"], -.chzn-color-state.chzn-single[rel="value_1"] { +.chzn-color-state.chzn-single[rel="value_1"], +.chzn-color.chzn-single[rel="value_show_no_link"], +.chzn-color.chzn-single[rel="value_show_with_link"] { .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + color: #ffffff; } .chzn-color.chzn-single[rel="value_0"], .chzn-color-reverse.chzn-single[rel="value_1"], .chzn-color-state.chzn-single[rel="value_0"], .chzn-color-state.chzn-single[rel="value_-1"], -.chzn-color-state.chzn-single[rel="value_-2"] { +.chzn-color-state.chzn-single[rel="value_-2"], +.chzn-color.chzn-single[rel="value_hide"] { .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + color: #ffffff; +} + +.chzn-color-state { + color: #fff; + div { + background-color: transparent; + border-bottom: none; + } +} +.chzn-color[rel="value_"] { + div { + background-color: #f3f3f3; + border-left: 1px solid #cccccc; + } } /* Widen the drop downs for the Permissions Field */ #permissions-sliders .input-small { @@ -1321,6 +1438,15 @@ a.grid_true { word-wrap: break-word; } +/* Box-shadow from focused fields */ +textarea, input, .uneditable-input { + box-shadow: none !important; +} +textarea:focus, input:focus, .uneditable-input:focus { + box-shadow: none; + border: 1px solid @inputBorderHighlight !important; +} + /* Customize Textarea Resizing */ textarea { resize: both; @@ -1336,8 +1462,8 @@ textarea.noResize { /* Prevent scrolling on the parent window of a modal */ body.modal-open { - overflow: hidden; - -ms-overflow-style: none; + overflow: hidden; + -ms-overflow-style: none; } /* Corrects the modals padding */ @@ -1358,3 +1484,62 @@ body.modal-open { .modal-footer { clear: both; } + +/* Modal Header text align left even if parent container centered */ +.modal-header { + text-align: left; +} + +/* ACL Permission page */ +#permissions, +#page-permissions { + table { + td { + vertical-align: middle; + } + select { + margin-bottom: 0; + } + } +} + +.js-stools-container-bar .btn-primary .caret { + border-bottom: 4px solid @white; +} + +.input-append .add-on, .input-append .btn, .input-append .btn-group > .dropdown-toggle, .input-prepend .add-on, .input-prepend .btn, .input-prepend .btn-group > .dropdown-toggle { + -webkit-border-radius: 0 @inputBorderRadius @inputBorderRadius 0; + -moz-border-radius: 0 @inputBorderRadius @inputBorderRadius 0; + border-radius: 0 @inputBorderRadius @inputBorderRadius 0; +} + +/* Removes Text Shadows */ +.alert, +.alert-options, +.badge, +.breadcrumb > li, +.close, +.input-append .add-on, +.input-prepend .add-on, +.label, +.nav-header, +.nav-list .nav-header, +.nav-list > .active > a, +.nav-list > .active > a:focus, +.nav-list > .active > a:hover, +.nav-list > li > a, +.nav-tabs.nav-dark, +.navbar .brand, +.navbar .nav > li > a, +.navbar-inverse .brand, +.navbar-inverse .nav > li > a, +.navbar-inverse .navbar-search .search-query.focused, +.navbar-inverse .navbar-search .search-query:focus, +.progress .bar, +.subhead { + text-shadow: none; +} +/* Popover minimum height - overwrite bootstrap default */ +.popover-content { + min-height: 33px; +} \ No newline at end of file diff --git a/administrator/templates/isis/less/variables.less b/administrator/templates/isis/less/variables.less index 80eb86acc553c..217eba695d75d 100644 --- a/administrator/templates/isis/less/variables.less +++ b/administrator/templates/isis/less/variables.less @@ -75,7 +75,7 @@ @paddingSmall: 2px 10px; // 26px @paddingMini: 0 6px; // 22px -@baseBorderRadius: 4px; +@baseBorderRadius: 3px; @borderRadiusLarge: 6px; @borderRadiusSmall: 3px; @@ -84,14 +84,14 @@ // ------------------------- @tableBackground: transparent; // overall background-color @tableBackgroundAccent: #f9f9f9; // for striping -@tableBackgroundHover: #f5f5f5; // for hover +@tableBackgroundHover: #F0F0F0; // for hover @tableBorder: #ddd; // table and cell border // Buttons // ------------------------- -@btnBackground: @white; -@btnBackgroundHighlight: darken(@white, 10%); -@btnBorder: #bbb; +@btnBackground: #f3f3f3; +@btnBackgroundHighlight: darken(@grayLighter, 3%); +@btnBorder: lighten(@grayLight, 10%); // > Joomla JUI @btnPrimaryBackground: #2384d3; @@ -118,9 +118,10 @@ // ------------------------- @inputBackground: @white; @inputBorder: #ccc; +@inputBorderHighlight: #3071A9; @inputBorderRadius: 3px; @inputDisabledBackground: @grayLighter; -@formActionsBackground: #f5f5f5; +@formActionsBackground: #F0F0F0; @inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border @@ -128,7 +129,7 @@ // ------------------------- @dropdownBackground: @white; @dropdownBorder: rgba(0,0,0,.2); -@dropdownDividerTop: #e5e5e5; +@dropdownDividerTop: #F0F0F0; @dropdownDividerBottom: @white; @dropdownLinkColor: @grayDark; @@ -149,11 +150,11 @@ // Used for a bird's eye view of components dependent on the z-axis // Try to avoid customizing these :) @zindexDropdown: 1000; -@zindexPopover: 1010; @zindexTooltip: 1030; @zindexFixedNavbar: 1030; @zindexModalBackdrop: 1040; @zindexModal: 1050; +@zindexPopover: 1060; // Sprite icons path @@ -179,7 +180,7 @@ // Wells // ------------------------- -@wellBackground: #f5f5f5; +@wellBackground: #F0F0F0; // Navbar @@ -229,7 +230,7 @@ // ------------------------- @paginationBackground: #fff; @paginationBorder: #ddd; -@paginationActiveBackground: #f5f5f5; +@paginationActiveBackground: #F0F0F0; // Hero unit @@ -321,4 +322,4 @@ // ------------------------- @headerBackground: #1a3867; @headerBackgroundHighlight: #17568c; -// < Joomla JUI +// < Joomla JUI \ No newline at end of file diff --git a/administrator/templates/isis/login.php b/administrator/templates/isis/login.php index 50caffda18f03..749399f212716 100644 --- a/administrator/templates/isis/login.php +++ b/administrator/templates/isis/login.php @@ -9,10 +9,18 @@ defined('_JEXEC') or die; +/** @var JDocumentHtml $this */ + $app = JFactory::getApplication(); -$doc = JFactory::getDocument(); $lang = JFactory::getLanguage(); +// Output as HTML5 +$this->setHtml5(true); + +// Gets the FrontEnd Main page Uri +$frontEndUri = JUri::getInstance(JUri::root()); +$frontEndUri->setScheme(((int) $app->get('force_ssl', 0) === 2) ? 'https' : 'http'); + // Color Params $background_color = $this->params->get('loginBackgroundColor') ? $this->params->get('loginBackgroundColor') : ''; $color_is_light = ($background_color && colorIsLight($background_color)); @@ -21,27 +29,20 @@ JHtml::_('bootstrap.framework'); JHtml::_('bootstrap.tooltip'); +// Add html5 shiv +JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); + // Add Stylesheets -$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template' . ($this->direction == 'rtl' ? '-rtl' : '') . '.css'); +JHtml::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', array('version' => 'auto', 'relative' => true)); // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); // Load specific language related CSS -$file = 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css'; - -if (is_file($file)) -{ - $doc->addStyleSheet($file); -} +JHtml::_('stylesheet', 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto', 'relative' => true)); // Load custom.css -$file = 'templates/' . $this->template . '/css/custom.css'; - -if (is_file($file)) -{ - $doc->addStyleSheetVersion($file); -} +JHtml::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); // Detecting Active Variables $option = $app->input->getCmd('option', ''); @@ -60,48 +61,50 @@ function colorIsLight($color) return $yiq >= 200; } + +// Background color +if ($background_color) +{ + $this->addStyleDeclaration(" + .view-login { + background-color: " . $background_color . "; + }"); +} + +// Responsive Styles +$this->addStyleDeclaration(" + @media (max-width: 480px) { + .view-login .container { + margin-top: -170px; + } + .btn { + font-size: 13px; + padding: 4px 10px 4px; + } + }"); + +// Check if debug is on +if (JPluginHelper::isEnabled('system', 'debug') && ($app->get('debug_lang', 0) || $app->get('debug', 0))) +{ + $this->addStyleDeclaration(" + .view-login .container { + position: static; + margin-top: 20px; + margin-left: auto; + margin-right: auto; + } + .view-login .navbar-fixed-bottom { + display: none; + }"); +} ?> - + - - - ">
        @@ -128,7 +131,7 @@ function colorIsLight($color) ©

        - +
        diff --git a/administrator/templates/system/component.php b/administrator/templates/system/component.php index d00116333dd59..6a0f54da1869e 100644 --- a/administrator/templates/system/component.php +++ b/administrator/templates/system/component.php @@ -8,9 +8,17 @@ */ defined('_JEXEC') or die; + +/** @var JDocumentHtml $this */ + +// Output as HTML5 +$this->setHtml5(true); + +// Add html5 shiv +JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); ?> - - + + diff --git a/administrator/templates/system/error.php b/administrator/templates/system/error.php index efa211d41ec97..73b90a8342c70 100644 --- a/administrator/templates/system/error.php +++ b/administrator/templates/system/error.php @@ -8,34 +8,51 @@ */ defined('_JEXEC') or die; + +/** @var JDocumentError $this */ + ?> - - + + - + <?php echo $this->error->getCode(); ?> - <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> - + + - - - - - - - +
        -

        - error->getCode() ?> - -

        -
        -

        error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

        -

        -

        - debug) : - echo $this->renderBacktrace(); - endif; ?> -

        -
        + + + + + +
        +

        error->getCode() ?> -

        +
        +

        error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

        +

        + debug) : ?> +
        + renderBacktrace(); ?> + + error->getPrevious()) : ?> + + _error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?> + + setError($this->_error->getPrevious()); ?> + +

        +

        _error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>

        + renderBacktrace(); ?> + setError($this->_error->getPrevious()); ?> + + + setError($this->error); ?> + +
        + +
        diff --git a/bin/keychain.php b/bin/keychain.php index bfb40b7ebd28e..7c609ea793bca 100644 --- a/bin/keychain.php +++ b/bin/keychain.php @@ -5,8 +5,11 @@ * * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE + * */ +// @deprecated 4.0 Deprecated without replacement + // Make sure we're being called from the command line, not a web interface if (PHP_SAPI !== 'cli') { diff --git a/build.xml b/build.xml index 8cbd45ca6efb3..da677b2c98078 100644 --- a/build.xml +++ b/build.xml @@ -17,7 +17,7 @@ - + @@ -88,7 +88,7 @@ - + diff --git a/build/build.php b/build/build.php index f607ec7c481fd..985831381d278 100644 --- a/build/build.php +++ b/build/build.php @@ -24,15 +24,7 @@ // Set path to git binary (e.g., /usr/local/git/bin/git or /usr/bin/git) ob_start(); passthru('which git', $systemGit); -$systemGit = ob_get_clean(); -$gitPath = '/usr/bin/git'; - -// Sanity check - Make sure $gitPath is the same path the system recognizes -if (substr($systemGit, 0, -1) != $gitPath) -{ - echo '$gitPath does not match path to local git executable, please set $gitPath to: ' . substr($systemGit, 0, -1) . "\n"; - exit; -} +$systemGit = trim(ob_get_clean()); // Make sure file and folder permissions are set correctly umask(022); @@ -63,7 +55,7 @@ echo "Copy the files from the git repository.\n"; chdir($repo); -system($gitPath . ' archive ' . $fullVersion . ' | tar -x -C ' . $fullpath); +system($systemGit . ' archive ' . $fullVersion . ' | tar -x -C ' . $fullpath); chdir($tmp); system('mkdir diffdocs'); @@ -107,17 +99,24 @@ * These paths are from the repository root without the leading slash */ $doNotPackage = array( + '.drone.yml', '.github', '.gitignore', + '.php_cs', '.travis.yml', 'README.md', 'build', 'build.xml', 'composer.json', 'composer.lock', + 'karma.conf.js', 'phpunit.xml.dist', 'tests', 'travisci-phpunit.xml', + // Remove the testing sample data from all packages + 'installation/sql/mysql/sample_testing.sql', + 'installation/sql/postgresql/sample_testing.sql', + 'installation/sql/sqlazure/sample_testing.sql', ); /* @@ -140,7 +139,7 @@ // Here we get a list of all files that have changed between the two tags ($previousTag and $fullVersion) and save in diffdocs $previousTag = $version . '.' . $num; - $command = $gitPath . ' diff tags/' . $previousTag . ' tags/' . $fullVersion . ' --name-status > diffdocs/' . $version . '.' . $num; + $command = $systemGit . ' diff tags/' . $previousTag . ' tags/' . $fullVersion . ' --name-status > diffdocs/' . $version . '.' . $num; system($command); @@ -165,15 +164,33 @@ continue; } - // Don't add deleted files to the list - if (substr($file, 0, 1) != 'D') + // Act on the file based on the action + switch (substr($file, 0, 1)) { - $filesArray[$fileName] = true; - } - else - { - // Add deleted files to the deleted files list - $deletedFiles[] = $fileName; + // This is a new case with git 2.9 to handle renamed files + case 'R': + // Explode the file on the tab character; key 0 is the action (rename), key 1 is the old filename, and key 2 is the new filename + $renamedFileData = explode("\t", $file); + + // Add the new file for packaging + $filesArray[$renamedFileData[2]] = true; + + // And flag the old file as deleted + $deletedFiles[] = $renamedFileData[1]; + + break; + + // Deleted files + case 'D': + $deletedFiles[] = $fileName; + + break; + + // Regular additions and modifications + default: + $filesArray[$fileName] = true; + + break; } } diff --git a/build/bump.php b/build/bump.php index 9416737b2136c..a243d705e894a 100644 --- a/build/bump.php +++ b/build/bump.php @@ -54,6 +54,24 @@ function usage($command) $antJobFile = '/build.xml'; +$readMeFiles = array( + '/README.md', + '/README.txt', + ); + +// Change copyright date exclusions. +$directoryLoopExcludeDirectories = array( + '/libraries/vendor/', + '/libraries/phputf8/', + '/libraries/php-encryption/', + '/libraries/phpass/', + '/libraries/idna_convert/', + '/libraries/fof/', + ); + +$directoryLoopExcludeFiles = array( + ); + // Check arguments (exit if incorrect cli arguments). $opts = getopt("v:c:"); @@ -228,4 +246,100 @@ function usage($command) file_put_contents($rootPath . $antJobFile, $fileContents); } +// Updates the version in readme files. +foreach ($readMeFiles as $readMeFile) +{ + if (file_exists($rootPath . $readMeFile)) + { + $fileContents = file_get_contents($rootPath . $readMeFile); + $fileContents = preg_replace('#Joomla! [0-9]+\.[0-9]+ (|\[)version#', 'Joomla! ' . $version['main'] . ' $1version', $fileContents); + $fileContents = preg_replace('#Joomla_[0-9]+\.[0-9]+_version#', 'Joomla_' . $version['main'] . '_version', $fileContents); + file_put_contents($rootPath . $readMeFile, $fileContents); + } +} + +// Updates the copyright date in core files. +$changedFilesCopyrightDate = 0; +$changedFilesSinceVersion = 0; +$year = date('Y'); +$directory = new \RecursiveDirectoryIterator($rootPath); +$iterator = new \RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST); + +foreach ($iterator as $file) +{ + if ($file->isFile()) + { + $filePath = $file->getPathname(); + $relativePath = str_replace($rootPath, '', $filePath); + + // Exclude certain extensions. + if (preg_match('#\.(png|jpeg|jpg|gif|bmp|ico|webp|svg|woff|woff2|ttf|eot)$#', $filePath)) + { + continue; + } + + // Exclude certain files. + if (in_array($relativePath, $directoryLoopExcludeFiles)) + { + continue; + } + + // Exclude certain directories. + $continue = true; + + foreach ($directoryLoopExcludeDirectories as $excludeDirectory) + { + if (preg_match('#^' . preg_quote($excludeDirectory) . '#', $relativePath)) + { + $continue = false; + break; + } + } + + if ($continue) + { + $changeSinceVersion = false; + $changeCopyrightDate = false; + + // Load the file. + $fileContents = file_get_contents($filePath); + + // Check if need to change the copyright date. + if (preg_match('#2005\s+-\s+[0-9]{4}\s+Open\s+Source\s+Matters#', $fileContents) && !preg_match('#2005\s+-\s+' . $year. '\s+Open\s+Source\s+Matters#', $fileContents)) + { + $changeCopyrightDate = true; + $fileContents = preg_replace('#2005\s+-\s+[0-9]{4}\s+Open\s+Source\s+Matters#', '2005 - ' . $year. ' Open Source Matters', $fileContents); + $changedFilesCopyrightDate++; + } + + // Check if need to change the since version. + if ($relativePath !== '/build/bump.php' && preg_match('#__DEPLOY_VERSION__#', $fileContents)) + { + $changeSinceVersion = true; + $fileContents = preg_replace('#__DEPLOY_VERSION__#', $version['release'], $fileContents); + $changedFilesSinceVersion++; + } + + // Save the file. + if ($changeCopyrightDate || $changeSinceVersion) + { + file_put_contents($filePath, $fileContents); + } + } + } +} + +if ($changedFilesCopyrightDate > 0 || $changedFilesSinceVersion > 0) +{ + if ($changedFilesCopyrightDate > 0) + { + echo '- Copyright Date changed in ' . $changedFilesCopyrightDate . ' files.' . PHP_EOL; + } + if ($changedFilesSinceVersion > 0) + { + echo '- Since Version changed in ' . $changedFilesSinceVersion . ' files.' . PHP_EOL; + } + echo PHP_EOL; +} + echo 'Version bump complete!' . PHP_EOL; diff --git a/build/helpTOC.php b/build/helpTOC.php index 342d6aa4615f8..fec7f797776ce 100644 --- a/build/helpTOC.php +++ b/build/helpTOC.php @@ -56,7 +56,7 @@ public function doExecute() $namespace = 'Help' . $helpVersion . ':'; // Set up options for JMediawiki - $options = new JRegistry; + $options = new Joomla\Registry\Registry; $options->set('api.url', 'https://docs.joomla.org'); $mediawiki = new JMediawiki($options); diff --git a/build/phpcs/Joomla/Sniffs/ControlStructures/ControlSignatureSniff.php b/build/phpcs/Joomla/Sniffs/ControlStructures/ControlSignatureSniff.php index 748314d051ddc..c077459e37448 100644 --- a/build/phpcs/Joomla/Sniffs/ControlStructures/ControlSignatureSniff.php +++ b/build/phpcs/Joomla/Sniffs/ControlStructures/ControlSignatureSniff.php @@ -75,7 +75,7 @@ protected function getPatterns() * * @param array $patternInfo Information about the pattern used for checking, which includes are * parsed token representation of the pattern. - * @param PHP_CodeSniffer_File $phpcsFile The PHP_CodeSniffer file where the token occured. + * @param PHP_CodeSniffer_File $phpcsFile The PHP_CodeSniffer file where the token occurred. * @param integer $stackPtr The postion in the tokens stack where the listening token type was found. * * @return return_type diff --git a/build/phpcs/Joomla/Sniffs/ControlStructures/ElseIfDeclarationSniff.php b/build/phpcs/Joomla/Sniffs/ControlStructures/ElseIfDeclarationSniff.php deleted file mode 100644 index eac2653545512..0000000000000 --- a/build/phpcs/Joomla/Sniffs/ControlStructures/ElseIfDeclarationSniff.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: ElseIfDeclarationSniff.php 301632 2010-07-28 01:57:56Z squiz $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Squiz_Sniffs_ControlStructures_ElseIfDeclarationSniff. - * - * Verifies that there are no "else if" statements. The else and the if should - * be a single word "elseif". - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.3.0 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_ControlStructures_ElseIfDeclarationSniff implements PHP_CodeSniffer_Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array(T_ELSE); - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $nextNonWhiteSpace = $phpcsFile->findNext( - T_WHITESPACE, - $stackPtr + 1, - null, - true, - null, - true - ); - - if($tokens[$nextNonWhiteSpace]['code'] == T_IF) - { - $error = 'Usage of ELSE IF is not allowed; use ELSEIF instead'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); - } - - }//end process() - - -}//end class diff --git a/build/phpcs/Joomla/Sniffs/PHP/LowerCaseConstantSniff.php b/build/phpcs/Joomla/Sniffs/PHP/LowerCaseConstantSniff.php deleted file mode 100644 index 87fec75b9d090..0000000000000 --- a/build/phpcs/Joomla/Sniffs/PHP/LowerCaseConstantSniff.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: LowerCaseConstantSniff.php 301632 2010-07-28 01:57:56Z squiz $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Generic_Sniffs_PHP_LowerCaseConstantSniff. - * - * Checks that all uses of true, false and null are lowerrcase. - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.3.0RC2 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_PHP_LowerCaseConstantSniff implements PHP_CodeSniffer_Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = array( - 'PHP', - 'JS', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array( - T_TRUE, - T_FALSE, - T_NULL, - ); - - }//end register() - - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $keyword = $tokens[$stackPtr]['content']; - // AJE Added check for class property names, eg $obj->Null. - $before = $tokens[$stackPtr-1]['type']; - if (strtolower($keyword) !== $keyword && $before != 'T_OBJECT_OPERATOR') { - $error = 'TRUE, FALSE and NULL must be lowercase; expected "%s" but found "%s"'; - $data = array( - strtolower($keyword), - $keyword, - ); - $phpcsFile->addError($error, $stackPtr, 'Found', $data); - } - - }//end process() - - -}//end class - -?> diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/CastSpacingSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/CastSpacingSniff.php deleted file mode 100644 index f61b4ccada829..0000000000000 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/CastSpacingSniff.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: CastSpacingSniff.php 301632 2010-07-28 01:57:56Z squiz $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Squiz_Sniffs_WhiteSpace_CastSpacingSniff. - * - * Ensure cast statements dont contain whitespace. - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.3.0 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_WhiteSpace_CastSpacingSniff implements PHP_CodeSniffer_Sniff -{ - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return PHP_CodeSniffer_Tokens::$castTokens; - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $content = $tokens[$stackPtr]['content']; - $expected = str_replace(' ', '', $content); - $expected = str_replace("\t", '', $expected); - - if ($content !== $expected) { - $error = 'Cast statements must not contain whitespace; expected "%s" but found "%s"'; - $data = array( - $expected, - $content, - ); - $phpcsFile->addError($error, $stackPtr, 'ContainsWhiteSpace', $data); - } - - }//end process() - - -}//end class - -?> diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php deleted file mode 100644 index 1ac582e6db3c0..0000000000000 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id$ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Generic_Sniffs_WhiteSpace_DisallowSpaceIndentSniff. - * - * Throws errors if spaces are used for indentation. - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: @package_version@ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_WhiteSpace_DisallowSpaceIndentSniff implements PHP_CodeSniffer_Sniff -{ - - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = array( - 'PHP', - 'JS', - 'CSS', - ); - - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array(T_WHITESPACE); - - }//end register() - - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document. - * @param int $stackPtr The position of the current token in - * the stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Make sure this is whitespace used for indentation. - $line = $tokens[$stackPtr]['line']; - if ($stackPtr > 0 && $tokens[($stackPtr - 1)]['line'] === $line) { - return; - } - - if (strpos($tokens[$stackPtr]['content'], " ") !== false) { - $error = 'Tabs must be used to indent lines; spaces are not allowed'; - $phpcsFile->addError($error, $stackPtr, 'SpaceUsed'); - } - - }//end process() - - -}//end class - -?> diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php index 60872fb87760a..f8ce71eb404f5 100644 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +++ b/build/phpcs/Joomla/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php @@ -165,5 +165,3 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) }//end class - -?> diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/OperatorSpacingSniff.php deleted file mode 100644 index 40d49df6f5293..0000000000000 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ /dev/null @@ -1,228 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: OperatorSpacingSniff.php 8 2010-11-06 00:40:23Z elkuku $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Verifies that operators have valid spacing surrounding them. - * - * Example: - * $a=$b+$c; - * $a = $b + $c; - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.3.0RC1 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_WhiteSpace_OperatorSpacingSniff implements PHP_CodeSniffer_Sniff -{ - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = array( - 'PHP', - 'JS', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - $comparison = PHP_CodeSniffer_Tokens::$comparisonTokens; - $operators = PHP_CodeSniffer_Tokens::$operators; - $assignment = PHP_CodeSniffer_Tokens::$assignmentTokens; - - return array_unique(array_merge($comparison, $operators, $assignment)); - }//function - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The current file being checked. - * @param integer $stackPtr The position of the current token in the - * stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - // Skip default values in function declarations. - if($tokens[$stackPtr]['code'] === T_EQUAL - || $tokens[$stackPtr]['code'] === T_MINUS - ) - { - if(isset($tokens[$stackPtr]['nested_parenthesis']) === true) - { - $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']); - $bracket = array_pop($parenthesis); - if(isset($tokens[$bracket]['parenthesis_owner']) === true) - { - $function = $tokens[$bracket]['parenthesis_owner']; - if($tokens[$function]['code'] === T_FUNCTION - || $tokens[$function]['code'] === T_CLOSURE - ) - { - return; - } - } - } - } - - if($tokens[$stackPtr]['code'] === T_EQUAL) - { - // Skip for '=&' case. - if(isset($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)]['code'] === T_BITWISE_AND) - { - return; - } - } - - if($tokens[$stackPtr]['code'] === T_BITWISE_AND) - { - // If it's not a reference, then we expect one space either side of the - // bitwise operator. - if($phpcsFile->isReference($stackPtr) === true) - { - return; - } - - // Check there is one space before the & operator. - if($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) - { - $error = 'Expected 1 space before "&" operator; 0 found'; - $phpcsFile->addError($error, $stackPtr, 'NoSpaceBeforeAmp'); - } - else - { - if(strlen($tokens[($stackPtr - 1)]['content']) !== 1) - { - $error = 'Expected 1 space before "&" operator; %s found'; - $phpcsFile->addError($error, $stackPtr, 'SpacingBeforeAmp'); - } - } - - // Check there is one space after the & operator. - if($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) - { - $error = 'Expected 1 space after "&" operator; 0 found'; - $phpcsFile->addError($error, $stackPtr, 'NoSpaceAfterAmp'); - } - else - { - if(strlen($tokens[($stackPtr + 1)]['content']) !== 1) - { - $error = 'Expected 1 space after "&" operator; %s found'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfterAmp'); - } - } - - return; - }//end if - - if($tokens[$stackPtr]['code'] === T_MINUS) - { - // Check minus spacing, but make sure we aren't just assigning - // a minus value or returning one. - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if($tokens[$prev]['code'] === T_RETURN) - { - // Just returning a negative value; eg. (return -1). - return; - } - - if(in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$operators) === true) - { - // Just trying to operate on a negative value; eg. ($var * -1). - return; - } - - if(in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$comparisonTokens) === true) - { - // Just trying to compare a negative value; eg. ($var === -1). - return; - } - - if(in_array($tokens[$prev]['code'], PHP_CodeSniffer_Tokens::$assignmentTokens) === true) - { - // Just trying to assign a negative value; eg. ($var = -1). - return; - } - - // A list of tokens that indicate that the token is not - // part of an arithmetic operation. - $invalidTokens = array( - T_COMMA, - T_OPEN_PARENTHESIS, - T_OPEN_SQUARE_BRACKET, - T_DOUBLE_ARROW, - T_COLON, - T_INLINE_THEN, - T_INLINE_ELSE, - T_CASE, - ); - - if(in_array($tokens[$prev]['code'], $invalidTokens) === true) - { - // Just trying to use a negative value; eg. myFunction($var, -2). - return; - } - }//end if - - $operator = $tokens[$stackPtr]['content']; - - if($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) - { - $error = "Expected 1 space before \"$operator\"; 0 found"; - $phpcsFile->addError($error, $stackPtr, 'NoSpaceBefore'); - } - else if (strlen($tokens[($stackPtr - 1)]['content']) !== 1) - { - // Don't throw an error for assignments, because other standards allow - // multiple spaces there to align multiple assignments. - if (in_array($tokens[$stackPtr]['code'], PHP_CodeSniffer_Tokens::$assignmentTokens) === false) { - $error = 'Expected 1 space before "%s"; %s found'; - $phpcsFile->addError($error, $stackPtr, 'SpacingBefore'); - } - } - - if($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) - { - // Error downgraded to Warning due to code needing review - $error = "Expected 1 space after \"$operator\"; 0 found"; - $phpcsFile->addWarning($error, $stackPtr, 'NoSpaceAfter'); - } - else if (strlen($tokens[($stackPtr + 1)]['content']) !== 1) - { - $error = 'Expected 1 space after "%s"; %s found'; - $phpcsFile->addError($error, $stackPtr, 'SpacingAfter'); - } - - }//end process() - - -}//end class - -?> diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/SemicolonSpacingSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/SemicolonSpacingSniff.php deleted file mode 100644 index e15848910e33d..0000000000000 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/SemicolonSpacingSniff.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: SemicolonSpacingSniff.php 8 2010-11-06 00:40:23Z elkuku $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Ensure there is no whitespace before a semicolon ;. - * - * Example: - * echo $a ; - * echo $a; - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.3.0RC1 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_WhiteSpace_SemicolonSpacingSniff implements PHP_CodeSniffer_Sniff -{ - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = array( - 'PHP', - 'JS', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array(T_SEMICOLON); - }//function - - /** - * Processes this test, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token - * in the stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - $prevType = $tokens[($stackPtr - 1)]['code']; - - if(in_array($prevType, PHP_CodeSniffer_Tokens::$emptyTokens) === true) - { - $nonSpace = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 2), null, true); - $expected = $tokens[$nonSpace]['content'].';'; - $found = $phpcsFile->getTokensAsString($nonSpace, ($stackPtr - $nonSpace)).';'; - - $error = sprintf('Space found before semicolon; expected "%s" but found "%s"' - , $expected, $found); - - $phpcsFile->addError($error, $stackPtr, 'Incorrect'); - } - }//function -}//class diff --git a/build/phpcs/Joomla/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php b/build/phpcs/Joomla/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php deleted file mode 100644 index d590104597c3d..0000000000000 --- a/build/phpcs/Joomla/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php +++ /dev/null @@ -1,258 +0,0 @@ - - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version CVS: $Id: SuperfluousWhitespaceSniff.php 509 2011-08-30 02:21:56Z elkuku $ - * @link http://pear.php.net/package/PHP_CodeSniffer - */ - -/** - * Checks for whitespace. - * - * Checks that. - *
          - *
        • No whitespace proceeds the first content of the file.
        • - *
        • No whitespace resides after content on any line.
        • - *
        • There are not two or more empty lines in functions and classes.
        • - *
        • There is exactly one empty line after the last content of the file.
        • - *
        - * - * @category PHP - * @package PHP_CodeSniffer - * @author Greg Sherwood - * @author Marc McIntyre - * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600) - * @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence - * @version Release: 1.2.2 - * @link http://pear.php.net/package/PHP_CodeSniffer - */ -class Joomla_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff implements PHP_CodeSniffer_Sniff -{ - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = array( - 'PHP', - 'JS', - 'CSS', - ); - - /** - * Returns an array of tokens this test wants to listen for. - * - * @return array - */ - public function register() - { - return array( - T_OPEN_TAG, - T_CLOSE_TAG, - T_WHITESPACE, - T_COMMENT, - T_CLOSE_CURLY_BRACKET, - ); - }//function - - /** - * Processes this sniff, when one of its tokens is encountered. - * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param integer $stackPtr The position of the current token in the stack passed in $tokens. - * - * @return void - */ - public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) - { - $tokens = $phpcsFile->getTokens(); - - if($stackPtr == $phpcsFile->numTokens - 1) - { - //-- We reached the end of the file - without a closing tag - if($tokens[$stackPtr]['code'] == T_WHITESPACE) - { - $lastCode = $tokens[$stackPtr - 1]['code']; - - if($lastCode != T_CLOSE_CURLY_BRACKET - && $lastCode !== T_SEMICOLON) - { - //-- If the second last is not a curly bracket or a semicolon - $phpcsFile->addError('Additional whitespace found at end of file', $stackPtr); - } - } - else if(strpos($tokens[$stackPtr]['content'], $phpcsFile->eolChar) === false) - { - //-- Files must end with an empty line - $phpcsFile->addError('Please end your files with an empty line.', $stackPtr); - } - } - - if($tokens[$stackPtr]['code'] === T_OPEN_TAG) - { - /* - Check for start of file whitespace. - */ - - if($phpcsFile->tokenizerType !== 'PHP') - { - // The first token is always the open tag inserted when tokenizsed - // and the second token is always the first piece of content in - // the file. If the second token is whitespace, there was - // whitespace at the start of the file. - if($tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) - { - return; - } - } - else - { - // If its the first token, then there is no space. - if($stackPtr === 0) - { - return; - } - - for($i = ($stackPtr - 1); $i >= 0; $i--) - { - // If we find something that isn't inline html - // then there is something previous in the file. - if($tokens[$i]['type'] !== 'T_INLINE_HTML') - { - return; - } - - // If we have ended up with inline html make sure it isn't just whitespace. - $tokenContent = trim($tokens[$i]['content']); - - if($tokenContent !== '') - { - return; - } - }//for - }//end if - - $phpcsFile->addError('Additional whitespace found at start of file', $stackPtr); - } - else if($phpcsFile->numTokens == ($stackPtr - 1)) - { - //-- Wereached the end of the file - without a closing tag - die('BB'); - } - else if($tokens[$stackPtr]['code'] === T_CLOSE_TAG) - { - /* - Check for end of file whitespace. - */ - - if($phpcsFile->tokenizerType === 'JS') - { - // The last token is always the close tag inserted when tokenizsed - // and the second last token is always the last piece of content in - // the file. If the second last token is whitespace, there was - // whitespace at the end of the file. - if($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) - { - return; - } - } - else if($phpcsFile->tokenizerType === 'CSS') - { - // The last two tokens are always the close tag and whitespace - // inserted when tokenizsed and the third last token is always the - // last piece of content in the file. If the third last token is - // whitespace, there was whitespace at the end of the file. - if($tokens[($stackPtr - 3)]['code'] !== T_WHITESPACE) - { - return; - } - - // Adjust the pointer to give the correct line number for the error. - $stackPtr -= 2; - } - else - { - if(isset($tokens[($stackPtr + 1)]) === false) - { - // The close PHP token is the last in the file. - return; - } - - for($i = ($stackPtr + 1); $i < $phpcsFile->numTokens; $i++) - { - // If we find something that isn't inline html then there - // is more to the file. - if($tokens[$i]['type'] !== 'T_INLINE_HTML') - { - return; - } - - // If we have ended up with inline html make sure it - // isn't just whitespace. - $tokenContent = trim($tokens[$i]['content']); - - if(empty($tokenContent) === false) - { - return; - } - }//for - } - - $phpcsFile->addError('Additional whitespace found at end of file', $stackPtr); - } - else - { - /* - Check for end of line whitespace. - */ - - if(strpos($tokens[$stackPtr]['content'], $phpcsFile->eolChar) === false) - { - return; - } - - $tokenContent = rtrim($tokens[$stackPtr]['content'], $phpcsFile->eolChar); - - if(empty($tokenContent) === false) - { - if(preg_match('|^.*\s+$|', $tokenContent) !== 0) - { - $phpcsFile->addError('Whitespace found at end of line', $stackPtr); - } - } - - /* - Check for multiple blanks lines in a function or class. - */ - - if($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true - || $phpcsFile->hasCondition($stackPtr, T_CLASS) === true) - { - if($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line'] - && $tokens[($stackPtr - 2)]['line'] === $tokens[($stackPtr - 1)]['line']) - { - // This is an empty line and the line before this one is not - // empty, so this could be the start of a multiple empty - // line block. - $next = $phpcsFile->findNext(T_WHITESPACE, $stackPtr, null, true); - $lines = $tokens[$next]['line'] - $tokens[$stackPtr]['line']; - - if($lines > 1) - { - $error = 'Functions and classes must not contain multiple empty lines in a row;' - ." found $lines empty lines"; - $phpcsFile->addError($error, $stackPtr); - } - } - } - }//end if - }//function -}//class diff --git a/build/phpcs/Joomla/ruleset.xml b/build/phpcs/Joomla/ruleset.xml index 481cc24271358..868db95586e7d 100644 --- a/build/phpcs/Joomla/ruleset.xml +++ b/build/phpcs/Joomla/ruleset.xml @@ -1,155 +1,181 @@ - The Joomla coding standard. - - - build/* - docs/* - tests/* - cache/* - tmp/* - logs/* - - - libraries/compat/password/* - libraries/fof/* - libraries/idna_convert/* - libraries/php-encryption/* - libraries/phputf8/* - libraries/simplepie/* - libraries/phpass/* - libraries/vendor/* - - administrator/components/com_joomlaupdate/restore_finalisation.php - administrator/components/com_joomlaupdate/restore.php - configuration.php - plugins/captcha/recaptcha/recaptchalib.php - - - - - - - - - - - - - - - - - - */tmpl/* - templates/* - layouts/* - installation/template/index.php - - - */tmpl/* - templates/* - layouts/* - - - - */tmpl/* - templates/* - layouts/* - installation/template/index.php - - - - - - - administrator/components/* - components/* - modules/* - libraries/cms/* - - - - - installation/controller/install/database_* - - - - - - - - - - - - - - - - templates/* - layouts/* - */tmpl/* - - - - - - - - - - - - 0 - - - - - - - - - templates/* - layouts/* - - - - - */tmpl/* - templates/* - layouts/* - - - - - - - templates/* - layouts/* - - - - - */tmpl/* - templates/* - layouts/* - installation/template/index.php - - - - - */tmpl/* - templates/* - layouts/* - installation/template/index.php - - - - - */tmpl/* - templates/* - layouts/* - installation/template/index.php - + The Joomla coding standard. + + + build/* + docs/* + tests/* + cache/* + tmp/* + logs/* + + + libraries/compat/password/* + libraries/fof/* + libraries/idna_convert/* + libraries/php-encryption/* + libraries/phputf8/* + libraries/simplepie/* + libraries/phpass/* + libraries/vendor/* + + administrator/components/com_joomlaupdate/restore_finalisation.php + administrator/components/com_joomlaupdate/restore.php + configuration.php + installation/template/index.php + plugins/captcha/recaptcha/recaptchalib.php + + + + + */tmpl/* + templates/* + layouts/* + + + + + + + + + + + + + + + + + */tmpl/* + templates/* + layouts/* + + + + */tmpl/* + templates/* + layouts/* + + + + + + 0 + + + + + + + + + + administrator/components/* + components/* + libraries/cms/* + + + + + + + + + administrator/components/* + components/* + modules/mod_articles_category/helper.php + libraries/cms/* + + + + installation/controller/install/database_* + + + + + + + + + + + + + + + + + + + + templates/* + layouts/* + */tmpl/* + + + + + + + + + error + + + + + */tmpl/* + templates/* + layouts/* + + + + + + + + + templates/* + layouts/* + + + + + */tmpl/* + templates/* + layouts/* + + + + + + + */tmpl/* + templates/* + layouts/* + + + + + */tmpl/* + templates/* + layouts/* + + + + + */tmpl/* + templates/* + layouts/* + + + + + templates/* + layouts/* + + + diff --git a/build/travis/javascript-tests.sh b/build/travis/javascript-tests.sh new file mode 100644 index 0000000000000..e44bfa7d40f1c --- /dev/null +++ b/build/travis/javascript-tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Script for installing firefox and fluxbox and preparing JavaScript tests + +BASE="$1" + +set -e + +# Xvfb +sh -e /etc/init.d/xvfb start +sleep 3 # give xvfb some time to start + +# Fluxbox +sudo apt-get update -qq +sudo apt-get install -y --force-yes firefox fluxbox +fluxbox & +sleep 3 # give fluxbox some time to start + +# Install node modules for tests +cd tests/javascript +npm install diff --git a/build/travis/phpenv/apcu-7.1.ini b/build/travis/phpenv/apcu-7.1.ini new file mode 100644 index 0000000000000..019901d1ba62c --- /dev/null +++ b/build/travis/phpenv/apcu-7.1.ini @@ -0,0 +1,2 @@ +apc.enabled=true +apc.enable_cli=true diff --git a/build/travis/unit-tests.sh b/build/travis/unit-tests.sh new file mode 100644 index 0000000000000..fa360cb682b3d --- /dev/null +++ b/build/travis/unit-tests.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Script for preparing the unit tests in Joomla! + +# Path to the Joomla! installation +BASE="$1" + +# Abort travis execution if setup fails +set -e + +# Disable xdebug on php 7.0.* and lower. +if [[ ( $TRAVIS_PHP_VERSION = 5.* ) || ( $TRAVIS_PHP_VERSION = 7.0 ) ]]; then phpenv config-rm xdebug.ini; fi + +# Disable xdebug in hhvm. +if [[ $TRAVIS_PHP_VERSION = hhv* ]]; then echo 'xdebug.enable = 0' >> /etc/hhvm/php.ini; fi + +# Make sure all dev dependencies are installed +composer install + +# Setup databases for testing +mysql -u root -e 'create database joomla_ut;' +mysql -u root joomla_ut < "$BASE/tests/unit/schema/mysql.sql" +psql -c 'create database joomla_ut;' -U postgres +psql -d joomla_ut -a -f "$BASE/tests/unit/schema/postgresql.sql" + +# Set up Apache +# - ./build/travis/php-apache.sh +# Enable additional PHP extensions + +if [[ $INSTALL_MEMCACHE == "yes" ]]; then phpenv config-add "$BASE/build/travis/phpenv/memcache.ini"; fi +if [[ $INSTALL_MEMCACHED == "yes" ]]; then phpenv config-add "$BASE/build/travis/phpenv/memcached.ini"; fi +if [[ $INSTALL_APC == "yes" ]]; then phpenv config-add "$BASE/build/travis/phpenv/apc-$TRAVIS_PHP_VERSION.ini"; fi +if [[ $INSTALL_APCU == "yes" && $TRAVIS_PHP_VERSION = 5.* ]]; then printf "\n" | pecl install apcu-4.0.10 && phpenv config-add "$BASE/build/travis/phpenv/apcu-$TRAVIS_PHP_VERSION.ini"; fi +if [[ $INSTALL_APCU == "yes" && $TRAVIS_PHP_VERSION = 7.* ]]; then printf "\n" | pecl install apcu-beta && phpenv config-add "$BASE/build/travis/phpenv/apcu-$TRAVIS_PHP_VERSION.ini"; fi +if [[ $INSTALL_APCU_BC_BETA == "yes" ]]; then printf "\n" | pecl install apcu_bc-beta; fi +if [[ $INSTALL_REDIS == "yes" && $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-add "$BASE/build/travis/phpenv/redis.ini"; fi +if [[ $INSTALL_REDIS == "yes" && $TRAVIS_PHP_VERSION = hhvm ]]; then cat "$BASE/build/travis/phpenv/redis.ini" >> /etc/hhvm/php.ini; fi diff --git a/cli/finder_indexer.php b/cli/finder_indexer.php index bc05c9a705f7a..d7bb1c39e08d8 100644 --- a/cli/finder_indexer.php +++ b/cli/finder_indexer.php @@ -156,7 +156,7 @@ public function doExecute() */ private function index() { - require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/indexer.php'; + JLoader::register('FinderIndexer', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/indexer.php'); // Disable caching. $config = JFactory::getConfig(); @@ -286,7 +286,7 @@ private function putFilters() $query ->select('t.id') ->from($db->qn('#__finder_taxonomy') . ' AS t') - ->leftjoin($db->qn('#__finder_taxonomy') . ' AS p ON p.id = t.parent_id') + ->leftJoin($db->qn('#__finder_taxonomy') . ' AS p ON p.id = t.parent_id') ->where($db->qn('t.title') . ' = ' . $db->q($element['title'])) ->where($db->qn('p.title') . ' = ' . $db->q($element['parent'])); $taxonomy = $db->setQuery($query)->loadResult(); @@ -355,7 +355,7 @@ private function getFilters() $query ->select('t.title, p.title AS parent') ->from($db->qn('#__finder_taxonomy') . ' AS t') - ->leftjoin($db->qn('#__finder_taxonomy') . ' AS p ON p.id = t.parent_id') + ->leftJoin($db->qn('#__finder_taxonomy') . ' AS p ON p.id = t.parent_id') ->where($db->qn('t.id') . ' IN (' . $filter->data . ')'); $taxonomies = $db->setQuery($query)->loadObjectList(); diff --git a/components/com_ajax/ajax.php b/components/com_ajax/ajax.php index 6c469cf2f2686..1de04eb77cb9b 100644 --- a/components/com_ajax/ajax.php +++ b/components/com_ajax/ajax.php @@ -86,7 +86,7 @@ if (is_file($helperFile)) { - require_once $helperFile; + JLoader::register($class, $helperFile); if (method_exists($class, $method . 'Ajax')) { diff --git a/components/com_banners/models/banner.php b/components/com_banners/models/banner.php index 149da0c17cce6..1bba5df67f7bb 100644 --- a/components/com_banners/models/banner.php +++ b/components/com_banners/models/banner.php @@ -155,9 +155,9 @@ public function &getItem() $db = $this->getDbo(); $query = $db->getQuery(true) ->select( - 'a.clickurl as clickurl,' . - 'a.cid as cid,' . - 'a.track_clicks as track_clicks' + 'a.clickurl as clickurl,' + . 'a.cid as cid,' + . 'a.track_clicks as track_clicks' ) ->from('#__banners as a') ->where('a.id = ' . (int) $id) diff --git a/components/com_banners/models/banners.php b/components/com_banners/models/banners.php index 7b597feae4cce..6aea1f3ac8d72 100644 --- a/components/com_banners/models/banners.php +++ b/components/com_banners/models/banners.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); @@ -54,33 +55,34 @@ protected function getStoreId($id = '') */ protected function getListQuery() { - $db = $this->getDbo(); - $query = $db->getQuery(true); - $ordering = $this->getState('filter.ordering'); - $tagSearch = $this->getState('filter.tag_search'); - $cid = $this->getState('filter.client_id'); + $db = $this->getDbo(); + $query = $db->getQuery(true); + $ordering = $this->getState('filter.ordering'); + $tagSearch = $this->getState('filter.tag_search'); + $cid = $this->getState('filter.client_id'); $categoryId = $this->getState('filter.category_id'); - $keywords = $this->getState('filter.keywords'); - $randomise = ($ordering == 'random'); - $nullDate = $db->quote($db->getNullDate()); + $keywords = $this->getState('filter.keywords'); + $randomise = ($ordering == 'random'); + $nullDate = $db->quote($db->getNullDate()); + $nowDate = $db->quote(JFactory::getDate()->toSql()); $query->select( - 'a.id as id,' . - 'a.type as type,' . - 'a.name as name,' . - 'a.clickurl as clickurl,' . - 'a.cid as cid,' . - 'a.description as description,' . - 'a.params as params,' . - 'a.custombannercode as custombannercode,' . - 'a.track_impressions as track_impressions,' . - 'cl.track_impressions as client_track_impressions' + 'a.id as id,' + . 'a.type as type,' + . 'a.name as name,' + . 'a.clickurl as clickurl,' + . 'a.cid as cid,' + . 'a.description as description,' + . 'a.params as params,' + . 'a.custombannercode as custombannercode,' + . 'a.track_impressions as track_impressions,' + . 'cl.track_impressions as client_track_impressions' ) ->from('#__banners as a') ->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid') ->where('a.state=1') - ->where('(' . $query->currentTimestamp() . ' >= a.publish_up OR a.publish_up = ' . $nullDate . ')') - ->where('(' . $query->currentTimestamp() . ' <= a.publish_down OR a.publish_down = ' . $nullDate . ')') + ->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')') + ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')') ->where('(a.imptotal = 0 OR a.impmade <= a.imptotal)'); if ($cid) @@ -120,7 +122,7 @@ protected function getListQuery() } elseif ((is_array($categoryId)) && (count($categoryId) > 0)) { - JArrayHelper::toInteger($categoryId); + $categoryId = ArrayHelper::toInteger($categoryId); $categoryId = implode(',', $categoryId); if ($categoryId != '0') @@ -138,7 +140,7 @@ protected function getListQuery() } else { - $temp = array(); + $temp = array(); $config = JComponentHelper::getParams('com_banners'); $prefix = $config->get('metakey_prefix'); @@ -204,9 +206,7 @@ public function getItems() foreach ($this->cache['items'] as &$item) { - $parameters = new Registry; - $parameters->loadString($item->params); - $item->params = $parameters; + $item->params = new Registry($item->params); } } @@ -223,29 +223,38 @@ public function getItems() public function impress() { $trackDate = JFactory::getDate()->format('Y-m-d H'); - $items = $this->getItems(); - $db = $this->getDbo(); - $query = $db->getQuery(true); + $items = $this->getItems(); + $db = $this->getDbo(); + $query = $db->getQuery(true); + if (!count($items)) + { + return; + } + foreach ($items as $item) { - // Increment impression made - $id = $item->id; - $query->clear() - ->update('#__banners') - ->set('impmade = (impmade + 1)') - ->where('id = ' . (int) $id); - $db->setQuery($query); - - try - { - $db->execute(); - } - catch (RuntimeException $e) - { - JError::raiseError(500, $e->getMessage()); - } + $bid[] = (int) $item->id; + } + + // Increment impression made + $query->clear() + ->update('#__banners') + ->set('impmade = (impmade + 1)') + ->where('id IN (' . implode(',', $bid) . ')'); + $db->setQuery($query); + + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) + { + JError::raiseError(500, $e->getMessage()); + } + foreach ($items as $item) + { // Track impressions $trackImpressions = $item->track_impressions; @@ -256,18 +265,19 @@ public function impress() if ($trackImpressions < 0) { - $config = JComponentHelper::getParams('com_banners'); + $config = JComponentHelper::getParams('com_banners'); $trackImpressions = $config->get('track_impressions'); } if ($trackImpressions > 0) { // Is track already created? - $query->clear() - ->select($db->quoteName('count')) - ->from('#__banner_tracks') + // Update count + $query->clear(); + $query->update('#__banner_tracks') + ->set($db->quoteName('count') . ' = (' . $db->quoteName('count') . ' + 1)') ->where('track_type=1') - ->where('banner_id=' . (int) $id) + ->where('banner_id=' . (int) $item->id) ->where('track_date=' . $db->quote($trackDate)); $db->setQuery($query); @@ -276,27 +286,16 @@ public function impress() { $db->execute(); } - catch (RuntimeException $e) + catch (JDatabaseExceptionExecuting $e) { JError::raiseError(500, $e->getMessage()); } - $count = $db->loadResult(); - - $query->clear(); - - if ($count) - { - // Update count - $query->update('#__banner_tracks') - ->set($db->quoteName('count') . ' = (' . $db->quoteName('count') . ' + 1)') - ->where('track_type=1') - ->where('banner_id=' . (int) $id) - ->where('track_date=' . $db->quote($trackDate)); - } - else + if ($db->getAffectedRows() == 0) { // Insert new count + $query->clear(); + $query->insert('#__banner_tracks') ->columns( array( @@ -304,18 +303,18 @@ public function impress() $db->quoteName('banner_id'), $db->quoteName('track_date') ) ) - ->values('1, 1, ' . (int) $id . ', ' . $db->quote($trackDate)); - } + ->values('1, 1, ' . (int) $item->id . ', ' . $db->quote($trackDate)); - $db->setQuery($query); + $db->setQuery($query); - try - { - $db->execute(); - } - catch (RuntimeException $e) - { - JError::raiseError(500, $e->getMessage()); + try + { + $db->execute(); + } + catch (JDatabaseExceptionExecuting $e) + { + JError::raiseError(500, $e->getMessage()); + } } } } diff --git a/components/com_config/controller/config/display.php b/components/com_config/controller/config/display.php index 64f9fbb7c0978..05ce1d580a6e9 100644 --- a/components/com_config/controller/config/display.php +++ b/components/com_config/controller/config/display.php @@ -35,15 +35,15 @@ public function execute() $viewFormat = $document->getType(); $layoutName = $this->input->getWord('layout', 'default'); - // Access back-end com_config + // Access backend com_config JLoader::registerPrefix(ucfirst($viewName), JPATH_ADMINISTRATOR . '/components/com_config'); $displayClass = new ConfigControllerApplicationDisplay; - // Set back-end required params + // Set backend required params $document->setType('json'); $app->input->set('view', 'application'); - // Execute back-end controller + // Execute backend controller $serviceData = json_decode($displayClass->execute(), true); // Reset params back after requesting from service diff --git a/components/com_config/controller/config/save.php b/components/com_config/controller/config/save.php index 470fa06c3e5be..47689a6b4446c 100644 --- a/components/com_config/controller/config/save.php +++ b/components/com_config/controller/config/save.php @@ -74,17 +74,17 @@ public function execute() // Attempt to save the configuration. $data = $return; - // Access back-end com_config + // Access backend com_config JLoader::registerPrefix('Config', JPATH_ADMINISTRATOR . '/components/com_config'); $saveClass = new ConfigControllerApplicationSave; // Get a document object $document = JFactory::getDocument(); - // Set back-end required params + // Set backend required params $document->setType('json'); - // Execute back-end controller + // Execute backend controller $return = $saveClass->execute(); // Reset params back after requesting from service diff --git a/components/com_config/controller/modules/cancel.php b/components/com_config/controller/modules/cancel.php index f72f782b53878..4bf7520ab386a 100644 --- a/components/com_config/controller/modules/cancel.php +++ b/components/com_config/controller/modules/cancel.php @@ -52,7 +52,7 @@ public function execute() $id = $this->input->getInt('id'); - // Access back-end com_module + // Access backend com_module JLoader::register('ModulesControllerModule', JPATH_ADMINISTRATOR . '/components/com_modules/controllers/module.php'); JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR . '/components/com_modules/views/module/view.json.php'); JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR . '/components/com_modules/models/module.php'); diff --git a/components/com_config/controller/modules/display.php b/components/com_config/controller/modules/display.php index 3ac7459bb71b9..3152897fd8929 100644 --- a/components/com_config/controller/modules/display.php +++ b/components/com_config/controller/modules/display.php @@ -55,7 +55,7 @@ public function execute() $redirect = JUri::base(); } - // Access back-end com_module + // Access backend com_module JLoader::register('ModulesController', JPATH_ADMINISTRATOR . '/components/com_modules/controller.php'); JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR . '/components/com_modules/views/module/view.json.php'); JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR . '/components/com_modules/models/module.php'); @@ -65,7 +65,7 @@ public function execute() // Get the parameters of the module with Id $document->setType('json'); - // Execute back-end controller + // Execute backend controller if (!($serviceData = json_decode($displayClass->display(), true))) { $app->redirect($redirect); diff --git a/components/com_config/controller/modules/save.php b/components/com_config/controller/modules/save.php index d3af38184b9f9..763937da7ee60 100644 --- a/components/com_config/controller/modules/save.php +++ b/components/com_config/controller/modules/save.php @@ -59,7 +59,7 @@ public function execute() $redirect = '&return=' . $returnUri; } - // Access back-end com_modules to be done + // Access backend com_modules to be done JLoader::register('ModulesControllerModule', JPATH_ADMINISTRATOR . '/components/com_modules/controllers/module.php'); JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR . '/components/com_modules/models/module.php'); @@ -68,10 +68,10 @@ public function execute() // Get a document object $document = JFactory::getDocument(); - // Set back-end required params + // Set backend required params $document->setType('json'); - // Execute back-end controller + // Execute backend controller $return = $controllerClass->save(); // Reset params back after requesting from service diff --git a/components/com_config/controller/templates/display.php b/components/com_config/controller/templates/display.php index dd4bf9b9932d5..ddd610247d2d2 100644 --- a/components/com_config/controller/templates/display.php +++ b/components/com_config/controller/templates/display.php @@ -35,18 +35,18 @@ public function execute() $viewFormat = $document->getType(); $layoutName = $this->input->getWord('layout', 'default'); - // Access back-end com_config + // Access backend com_config JLoader::register('TemplatesController', JPATH_ADMINISTRATOR . '/components/com_templates/controller.php'); JLoader::register('TemplatesViewStyle', JPATH_ADMINISTRATOR . '/components/com_templates/views/style/view.json.php'); JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR . '/components/com_templates/models/style.php'); $displayClass = new TemplatesController; - // Set back-end required params + // Set backend required params $document->setType('json'); $this->input->set('id', $app->getTemplate('template')->id); - // Execute back-end controller + // Execute backend controller $serviceData = json_decode($displayClass->display(), true); // Reset params back after requesting from service diff --git a/components/com_config/controller/templates/save.php b/components/com_config/controller/templates/save.php index df81af1334cc1..ee7e02dcc35b3 100644 --- a/components/com_config/controller/templates/save.php +++ b/components/com_config/controller/templates/save.php @@ -44,7 +44,7 @@ public function execute() $app = JFactory::getApplication(); - // Access back-end com_templates + // Access backend com_templates JLoader::register('TemplatesControllerStyle', JPATH_ADMINISTRATOR . '/components/com_templates/controllers/style.php'); JLoader::register('TemplatesModelStyle', JPATH_ADMINISTRATOR . '/components/com_templates/models/style.php'); JLoader::register('TemplatesTableStyle', JPATH_ADMINISTRATOR . '/components/com_templates/tables/style.php'); @@ -53,11 +53,11 @@ public function execute() // Get a document object $document = JFactory::getDocument(); - // Set back-end required params + // Set backend required params $document->setType('json'); $this->input->set('id', $app->getTemplate('template')->id); - // Execute back-end controller + // Execute backend controller $return = $controllerClass->save(); // Reset params back after requesting from service diff --git a/components/com_config/model/form.php b/components/com_config/model/form.php index a0537d2d403ce..18f0f41c7c82f 100644 --- a/components/com_config/model/form.php +++ b/components/com_config/model/form.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Prototype form model. * @@ -137,7 +139,7 @@ abstract public function getForm($data = array(), $loadData = true); protected function loadForm($name, $source = null, $options = array(), $clear = false, $xpath = false) { // Handle the optional arguments. - $options['control'] = JArrayHelper::getValue($options, 'control', false); + $options['control'] = ArrayHelper::getValue($options, 'control', false); // Create a signature hash. $hash = sha1($source . serialize($options)); diff --git a/components/com_config/model/modules.php b/components/com_config/model/modules.php index 6bbc2635a9a0e..ec397003a2522 100644 --- a/components/com_config/model/modules.php +++ b/components/com_config/model/modules.php @@ -12,13 +12,10 @@ /** * Config Module model. * - * @package Joomla.Site - * @subpackage com_config - * @since 3.2 + * @since 3.2 */ class ConfigModelModules extends ConfigModelForm { - /** * Method to auto-populate the model state. * @@ -120,18 +117,18 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') /** * Method to get list of module positions in current template * - * @return array + * @return array * - * @since 3.2 + * @since 3.2 */ public function getPositions() { - $lang = JFactory::getLanguage(); + $lang = JFactory::getLanguage(); $templateName = JFactory::getApplication()->getTemplate(); // Load templateDetails.xml file $path = JPath::clean(JPATH_BASE . '/templates/' . $templateName . '/templateDetails.xml'); - $currentPositions = array(); + $currentTemplatePositions = array(); if (file_exists($path)) { @@ -139,21 +136,131 @@ public function getPositions() if (isset($xml->positions[0])) { + // Load language files + $lang->load('tpl_' . $templateName . '.sys', JPATH_BASE, null, false, true) + || $lang->load('tpl_' . $templateName . '.sys', JPATH_BASE . '/templates/' . $templateName, null, false, true); + foreach ($xml->positions[0] as $position) { - // Load language files - $lang->load('tpl_' . $templateName . '.sys', JPATH_BASE, null, false, true) - || $lang->load('tpl_' . $templateName . '.sys', JPATH_BASE . '/templates/' . $templateName, null, false, true); - - $key = (string) $position; - $value = preg_replace('/[^a-zA-Z0-9_\-]/', '_', 'TPL_' . strtoupper($templateName) . '_POSITION_' . strtoupper($key)); + $value = (string) $position; + $text = preg_replace('/[^a-zA-Z0-9_\-]/', '_', 'TPL_' . strtoupper($templateName) . '_POSITION_' . strtoupper($value)); // Construct list of positions - $currentPositions[$key] = JText::_($value) . ' [' . $key . ']'; + $currentTemplatePositions[] = self::createOption($value, JText::_($text) . ' [' . $value . ']'); } } } - return $currentPositions; + $templateGroups = array(); + + // Add an empty value to be able to deselect a module position + $option = self::createOption(); + $templateGroups[''] = self::createOptionGroup('', array($option)); + + $templateGroups[$templateName] = self::createOptionGroup($templateName, $currentTemplatePositions); + + // Add custom position to options + $customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION'); + + $editPositions = true; + $customPositions = self::getActivePositions(0, $editPositions); + $templateGroups[$customGroupText] = self::createOptionGroup($customGroupText, $customPositions); + + return $templateGroups; + } + + /** + * Get a list of modules positions + * + * @param integer $clientId Client ID + * @param boolean $editPositions Allow to edit the positions + * + * @return array A list of positions + * + * @since 3.6.3 + */ + public static function getActivePositions($clientId, $editPositions = false) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('DISTINCT position') + ->from($db->quoteName('#__modules')) + ->where($db->quoteName('client_id') . ' = ' . (int) $clientId) + ->order($db->quoteName('position')); + + $db->setQuery($query); + + try + { + $positions = $db->loadColumn(); + $positions = is_array($positions) ? $positions : array(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + + return; + } + + // Build the list + $options = array(); + + foreach ($positions as $position) + { + if (!$position && !$editPositions) + { + $options[] = JHtml::_('select.option', 'none', ':: ' . JText::_('JNONE') . ' ::'); + } + else + { + $options[] = JHtml::_('select.option', $position, $position); + } + } + + return $options; + } + + /** + * Create and return a new Option + * + * @param string $value The option value [optional] + * @param string $text The option text [optional] + * + * @return object The option as an object (stdClass instance) + * + * @since 3.6.3 + */ + private static function createOption($value = '', $text = '') + { + if (empty($text)) + { + $text = $value; + } + + $option = new stdClass; + $option->value = $value; + $option->text = $text; + + return $option; + } + + /** + * Create and return a new Option Group + * + * @param string $label Value and label for group [optional] + * @param array $options Array of options to insert into group [optional] + * + * @return array Return the new group as an array + * + * @since 3.6.3 + */ + private static function createOptionGroup($label = '', $options = array()) + { + $group = array(); + $group['value'] = $label; + $group['text'] = $label; + $group['items'] = $options; + + return $group; } } diff --git a/components/com_config/view/modules/tmpl/default_positions.php b/components/com_config/view/modules/tmpl/default_positions.php index 69bf0cbf1f532..30082b134327d 100644 --- a/components/com_config/view/modules/tmpl/default_positions.php +++ b/components/com_config/view/modules/tmpl/default_positions.php @@ -8,7 +8,19 @@ */ defined('_JEXEC') or die; - $positions = $this->model->getPositions(); -echo JHtml::_('select.genericlist', $positions, 'jform[position]', '', '', '', $this->item['position']); +// Add custom position to options +$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION'); + +// Build field +$attr = array( + 'id' => 'jform_position', + 'list.select' => $this->item['position'], + 'list.attr' => 'class="chzn-custom-value" ' + . 'data-custom_group_text="' . $customGroupText . '" ' + . 'data-no_results_text="' . JText::_('COM_MODULES_ADD_CUSTOM_POSITION') . '" ' + . 'data-placeholder="' . JText::_('COM_MODULES_TYPE_OR_SELECT_POSITION') . '" ' +); + +echo JHtml::_('select.groupedlist', $positions, 'jform[position]', $attr); diff --git a/components/com_contact/contact.php b/components/com_contact/contact.php index 5458f082450d9..fd6a908af80bf 100644 --- a/components/com_contact/contact.php +++ b/components/com_contact/contact.php @@ -9,7 +9,20 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('ContactHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); + +$input = JFactory::getApplication()->input; + +if ($input->get('view') === 'contacts' && $input->get('layout') === 'modal') +{ + if (!JFactory::getUser()->authorise('core.create', 'com_contact')) + { + JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); + return; + } + + JFactory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR); +} $controller = JControllerLegacy::getInstance('Contact'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_contact/controller.php b/components/com_contact/controller.php index de91f092984e1..26cc51c440f56 100644 --- a/components/com_contact/controller.php +++ b/components/com_contact/controller.php @@ -16,6 +16,29 @@ */ class ContactController extends JControllerLegacy { + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * + * @since __DEPLOY_VERSION__ + */ + public function __construct($config = array()) + { + $this->input = JFactory::getApplication()->input; + + // Contact frontpage Editor contacts proxying: + if ($this->input->get('view') === 'contacts' && $this->input->get('layout') === 'modal') + { + JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; + } + + parent::__construct($config); + } + /** * Method to display a view. * diff --git a/components/com_contact/controllers/contact.php b/components/com_contact/controllers/contact.php index 1983264f6a798..9dfba0bee2546 100644 --- a/components/com_contact/controllers/contact.php +++ b/components/com_contact/controllers/contact.php @@ -42,7 +42,7 @@ public function getModel($name = '', $prefix = '', $config = array('ignore_reque public function submit() { // Check for request forgeries. - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken(); $app = JFactory::getApplication(); $model = $this->getModel('contact'); @@ -59,9 +59,9 @@ public function submit() // Check for a valid session cookie if ($params->get('validate_session', 0)) { - if (JFactory::getSession()->getState() != 'active') + if (JFactory::getSession()->getState() !== 'active') { - JError::raiseWarning(403, JText::_('COM_CONTACT_SESSION_INVALID')); + JError::raiseWarning(403, JText::_('JLIB_ENVIRONMENT_SESSION_INVALID')); // Save the data in the session. $app->setUserState('com_contact.contact.data', $data); @@ -198,6 +198,20 @@ private function _sendEmail($data, $contact, $copy_email_activated) $prefix = JText::sprintf('COM_CONTACT_ENQUIRY_TEXT', JUri::base()); $body = $prefix . "\n" . $name . ' <' . $email . '>' . "\r\n\r\n" . stripslashes($body); + // Load the custom fields + if ($data['params'] && $fields = FieldsHelper::getFields('com_contact.mail', $contact, true, $data['params'])) + { + $output = FieldsHelper::render( + 'com_contact.mail', + 'fields.render', + array('context' => 'com_contact.mail', 'item' => $contact, 'fields' => $fields) + ); + if ($output) + { + $body .= "\r\n\r\n" . $output; + } + } + $mail = JFactory::getMailer(); $mail->addRecipient($contact->email_to); $mail->addReplyTo($email, $name); diff --git a/components/com_contact/helpers/association.php b/components/com_contact/helpers/association.php index fecb1810ab0a7..a3b8ad9338a39 100644 --- a/components/com_contact/helpers/association.php +++ b/components/com_contact/helpers/association.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; JLoader::register('ContactHelper', JPATH_ADMINISTRATOR . '/components/com_contact/helpers/contact.php'); +JLoader::register('ContactHelperRoute', JPATH_SITE . '/components/com_contact/helpers/route.php'); JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php'); /** @@ -29,17 +30,13 @@ abstract class ContactHelperAssociation extends CategoryHelperAssociation * * @since 3.0 */ - public static function getAssociations($id = 0, $view = null) { - jimport('helper.route', JPATH_COMPONENT_SITE); - - $app = JFactory::getApplication(); - $jinput = $app->input; - $view = is_null($view) ? $jinput->get('view') : $view; - $id = empty($id) ? $jinput->getInt('id') : $id; + $jinput = JFactory::getApplication()->input; + $view = $view === null ? $jinput->get('view') : $view; + $id = empty($id) ? $jinput->getInt('id') : $id; - if ($view == 'contact') + if ($view === 'contact') { if ($id) { @@ -56,7 +53,7 @@ public static function getAssociations($id = 0, $view = null) } } - if ($view == 'category' || $view == 'categories') + if ($view === 'category' || $view === 'categories') { return self::getCategoryAssociations($id, 'com_contact'); } diff --git a/components/com_contact/helpers/legacyrouter.php b/components/com_contact/helpers/legacyrouter.php new file mode 100644 index 0000000000000..a18c9e03cac85 --- /dev/null +++ b/components/com_contact/helpers/legacyrouter.php @@ -0,0 +1,273 @@ +router = $router; + } + + /** + * Preprocess the route for the com_contact component + * + * @param array &$query An array of URL arguments + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function preprocess(&$query) + { + } + + /** + * Build the route for the com_contact component + * + * @param array &$query An array of URL arguments + * @param array &$segments The URL arguments to use to assemble the subsequent URL. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function build(&$query, &$segments) + { + // Get a menu item based on Itemid or currently active + $params = JComponentHelper::getParams('com_contact'); + $advanced = $params->get('sef_advanced_link', 0); + + if (empty($query['Itemid'])) + { + $menuItem = $this->router->menu->getActive(); + } + else + { + $menuItem = $this->router->menu->getItem($query['Itemid']); + } + + $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; + $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; + + if (isset($query['view'])) + { + $view = $query['view']; + + if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_contact') + { + $segments[] = $query['view']; + } + + unset($query['view']); + } + + // Are we dealing with a contact that is attached to a menu item? + if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id'])) + { + unset($query['view']); + unset($query['catid']); + unset($query['id']); + return; + } + + if (isset($view) and ($view == 'category' or $view == 'contact')) + { + if ($mId != (int) $query['id'] || $mView != $view) + { + if ($view == 'contact' && isset($query['catid'])) + { + $catid = $query['catid']; + } + elseif (isset($query['id'])) + { + $catid = $query['id']; + } + + $menuCatid = $mId; + $categories = JCategories::getInstance('Contact'); + $category = $categories->get($catid); + + if ($category) + { + // TODO Throw error that the category either not exists or is unpublished + $path = array_reverse($category->getPath()); + + $array = array(); + + foreach ($path as $id) + { + if ((int) $id == (int) $menuCatid) + { + break; + } + + if ($advanced) + { + list($tmp, $id) = explode(':', $id, 2); + } + + $array[] = $id; + } + + $segments = array_merge($segments, array_reverse($array)); + } + + if ($view == 'contact') + { + if ($advanced) + { + list($tmp, $id) = explode(':', $query['id'], 2); + } + else + { + $id = $query['id']; + } + + $segments[] = $id; + } + } + + unset($query['id']); + unset($query['catid']); + } + + if (isset($query['layout'])) + { + if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) + { + if ($query['layout'] == $menuItem->query['layout']) + { + + unset($query['layout']); + } + } + else + { + if ($query['layout'] == 'default') + { + unset($query['layout']); + } + } + } + + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = str_replace(':', '-', $segments[$i]); + } + } + + /** + * Parse the segments of a URL. + * + * @param array &$segments The segments of the URL to parse. + * @param array &$vars The URL attributes to be used by the application. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function parse(&$segments, &$vars) + { + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + } + + // Get the active menu item. + $item = $this->router->menu->getActive(); + $params = JComponentHelper::getParams('com_contact'); + $advanced = $params->get('sef_advanced_link', 0); + + // Count route segments + $count = count($segments); + + // Standard routing for newsfeeds. + if (!isset($item)) + { + $vars['view'] = $segments[0]; + $vars['id'] = $segments[$count - 1]; + return; + } + + // From the categories view, we can only jump to a category. + $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; + + $contactCategory = JCategories::getInstance('Contact')->get($id); + + $categories = ($contactCategory) ? $contactCategory->getChildren() : array(); + $vars['catid'] = $id; + $vars['id'] = $id; + $found = 0; + + foreach ($segments as $segment) + { + $segment = $advanced ? str_replace(':', '-', $segment) : $segment; + + foreach ($categories as $category) + { + if ($category->slug == $segment || $category->alias == $segment) + { + $vars['id'] = $category->id; + $vars['catid'] = $category->id; + $vars['view'] = 'category'; + $categories = $category->getChildren(); + $found = 1; + break; + } + } + + if ($found == 0) + { + if ($advanced) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from('#__contact_details') + ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) + ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); + $db->setQuery($query); + $nid = $db->loadResult(); + } + else + { + $nid = $segment; + } + + $vars['id'] = $nid; + $vars['view'] = 'contact'; + } + + $found = 0; + } + } +} diff --git a/components/com_contact/helpers/route.php b/components/com_contact/helpers/route.php index 6b3f210238c14..c78ec6e5df4a4 100644 --- a/components/com_contact/helpers/route.php +++ b/components/com_contact/helpers/route.php @@ -19,8 +19,6 @@ */ abstract class ContactHelperRoute { - protected static $lookup; - /** * Get the URL route for a contact from a contact ID, contact category ID and language * @@ -34,35 +32,17 @@ abstract class ContactHelperRoute */ public static function getContactRoute($id, $catid, $language = 0) { - $needles = array( - 'contact' => array((int) $id) - ); - // Create the link $link = 'index.php?option=com_contact&view=contact&id=' . $id; if ($catid > 1) { - $categories = JCategories::getInstance('Contact'); - $category = $categories->get($catid); - - if ($category) - { - $needles['category'] = array_reverse($category->getPath()); - $needles['categories'] = $needles['category']; - $link .= '&catid=' . $catid; - } + $link .= '&catid=' . $catid; } - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) + if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } return $link; @@ -82,131 +62,28 @@ public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { - $id = $catid->id; - $category = $catid; + $id = $catid->id; } else { $id = (int) $catid; - $category = JCategories::getInstance('Contact')->get($id); } - if ($id < 1 || !($category instanceof JCategoryNode)) + if ($id < 1) { $link = ''; } else { - $needles = array(); - // Create the link $link = 'index.php?option=com_contact&view=category&id=' . $id; - $catids = array_reverse($category->getPath()); - $needles['category'] = $catids; - $needles['categories'] = $catids; - - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) + if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } } return $link; } - - /** - * Find an item ID. - * - * @param array $needles An array of language codes. - * - * @return mixed The ID found or null otherwise. - * - * @since 1.6 - */ - protected static function _findItem($needles = null) - { - $app = JFactory::getApplication(); - $menus = $app->getMenu('site'); - $language = isset($needles['language']) ? $needles['language'] : '*'; - - // Prepare the reverse lookup array. - if (!isset(self::$lookup[$language])) - { - self::$lookup[$language] = array(); - - $component = JComponentHelper::getComponent('com_contact'); - $attributes = array('component_id'); - $values = array($component->id); - - if ($language != '*') - { - $attributes[] = 'language'; - $values[] = array($needles['language'], '*'); - } - - $items = $menus->getItems($attributes, $values); - - foreach ($items as $item) - { - if (isset($item->query) && isset($item->query['view'])) - { - $view = $item->query['view']; - - if (!isset(self::$lookup[$language][$view])) - { - self::$lookup[$language][$view] = array(); - } - - if (isset($item->query['id'])) - { - /** - * Here it will become a bit tricky - * language != * can override existing entries - * language == * cannot override existing entries - */ - if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') - { - self::$lookup[$language][$view][$item->query['id']] = $item->id; - } - } - } - } - } - - if ($needles) - { - foreach ($needles as $view => $ids) - { - if (isset(self::$lookup[$language][$view])) - { - foreach ($ids as $id) - { - if (isset(self::$lookup[$language][$view][(int) $id])) - { - return self::$lookup[$language][$view][(int) $id]; - } - } - } - } - } - - // Check if the active menuitem matches the requested language - $active = $menus->getActive(); - if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) - { - return $active->id; - } - - // If not found, return language specific home link - $default = $menus->getDefault($language); - - return !empty($default->id) ? $default->id : null; - } } diff --git a/components/com_contact/layouts/field/render.php b/components/com_contact/layouts/field/render.php new file mode 100644 index 0000000000000..7d1cd2772a6b6 --- /dev/null +++ b/components/com_contact/layouts/field/render.php @@ -0,0 +1,40 @@ +label; +$value = $field->value; +$class = $field->params->get('render_class'); + +if (!$value) +{ + return; +} + +if ($field->context == 'com_contact.mail') +{ + // Prepare the value for the contact form mail + echo $label . ': ' . $value . "\r\n"; + return; +} + +?> + +
        + : +
        +
        + +
        diff --git a/components/com_contact/layouts/fields/render.php b/components/com_contact/layouts/fields/render.php new file mode 100644 index 0000000000000..aaaf94543d317 --- /dev/null +++ b/components/com_contact/layouts/fields/render.php @@ -0,0 +1,92 @@ +fields ? $item->fields : FieldsHelper::getFields($context, $item, true); +} + +if (!$fields) +{ + return; +} + +// Check if we have mail context in first element +$isMail = (reset($fields)->context == 'com_contact.mail'); + +// Load some output definitions +$container = 'dl'; + +if (key_exists('container', $displayData) && $displayData['container']) +{ + $container = $displayData['container']; +} + +$class = 'contact-fields dl-horizontal'; + +if (key_exists('container-class', $displayData) && $displayData['container-class']) +{ + $class = $displayData['container-class']; +} + +if (!$isMail) +{ + // Print the container tag + echo '<' . $container . ' class="fields-container ' . $class . '">'; +} + +// Loop through the fields and print them +foreach ($fields as $field) +{ + // If the value is empty dp nothing + if (!isset($field->value) || !$field->value) + { + continue; + } + + echo FieldsHelper::render($context, 'field.render', array('field' => $field)); +} + +if (!$isMail) +{ + // Close the container + echo ''; +} diff --git a/components/com_contact/layouts/joomla/form/renderfield.php b/components/com_contact/layouts/joomla/form/renderfield.php index 45fe6684a1db2..8c6097e21a2dd 100644 --- a/components/com_contact/layouts/joomla/form/renderfield.php +++ b/components/com_contact/layouts/joomla/form/renderfield.php @@ -22,7 +22,7 @@ if (!empty($options['showonEnabled'])) { JHtml::_('jquery.framework'); - JHtml::_('script', 'jui/cms.js', false, true); + JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); } $class = empty($options['class']) ? '' : ' ' . $options['class']; diff --git a/components/com_contact/metadata.xml b/components/com_contact/metadata.xml deleted file mode 100644 index 487e89d868c73..0000000000000 --- a/components/com_contact/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/components/com_contact/models/category.php b/components/com_contact/models/category.php index 044d42b783d74..590e956d47c3d 100644 --- a/components/com_contact/models/category.php +++ b/components/com_contact/models/category.php @@ -96,9 +96,7 @@ public function getItems() $item = & $items[$i]; if (!isset($this->_params)) { - $params = new Registry; - $params->loadString($item->params); - $item->params = $params; + $item->params = new Registry($item->params); } $this->tags = new JHelperTags; $this->tags->getItemTags('com_contact.contact', $item->id); @@ -159,7 +157,7 @@ protected function getListQuery() // Join over the users for the author and modified_by names. $query->select("CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author") - ->select("ua.email AS author_email") + ->select('ua.email AS author_email') ->join('LEFT', '#__users AS ua ON ua.id = a.created_by') ->join('LEFT', '#__users AS uam ON uam.id = a.modified_by'); @@ -201,7 +199,7 @@ protected function getListQuery() } // Set sortname ordering if selected - if ($this->getState('list.ordering') == 'sortname') + if ($this->getState('list.ordering') === 'sortname') { $query->order($db->escape('a.sortname1') . ' ' . $db->escape($this->getState('list.direction', 'ASC'))) ->order($db->escape('a.sortname2') . ' ' . $db->escape($this->getState('list.direction', 'ASC'))) @@ -235,7 +233,7 @@ protected function populateState($ordering = null, $direction = null) // List state information $format = $app->input->getWord('format'); - if ($format == 'feed') + if ($format === 'feed') { $limit = $app->get('feed_limit'); } diff --git a/components/com_contact/models/contact.php b/components/com_contact/models/contact.php index b594ddaff51f1..6b0c235863919 100644 --- a/components/com_contact/models/contact.php +++ b/components/com_contact/models/contact.php @@ -85,7 +85,7 @@ protected function populateState() public function getForm($data = array(), $loadData = true) { // Get the form. - $form = $this->loadForm('com_contact.contact', 'contact', array('control' => 'jform', 'load_data' => true)); + $form = $this->loadForm('com_contact.mail', 'contact', array('control' => 'jform', 'load_data' => true)); if (empty($form)) { @@ -199,19 +199,17 @@ public function &getItem($pk = null) } // Check for published state if filter set. - if (((is_numeric($published)) || (is_numeric($archived))) && (($data->published != $published) && ($data->published != $archived))) + if ((is_numeric($published) || is_numeric($archived)) && (($data->published != $published) && ($data->published != $archived))) { JError::raiseError(404, JText::_('COM_CONTACT_ERROR_CONTACT_NOT_FOUND')); } // Convert parameter fields to objects. - $registry = new Registry; - $registry->loadString($data->params); + $registry = new Registry($data->params); $data->params = clone $this->getState('params'); $data->params->merge($registry); - $registry = new Registry; - $registry->loadString($data->metadata); + $registry = new Registry($data->metadata); $data->metadata = $registry; $data->tags = new JHelperTags; @@ -273,8 +271,7 @@ protected function buildContactExtendedData($contact) $groups = implode(',', $user->getAuthorisedViewLevels()); $published = $this->getState('filter.published'); - $contactParams = new Registry; - $contactParams->loadString($contact->params); + $contactParams = new Registry($contact->params); // If we are showing a contact list, then the contact parameters take priority // So merge the contact parameters with the merged parameters @@ -359,7 +356,7 @@ protected function buildContactExtendedData($contact) } // Get the profile information for the linked user - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); $userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); $data = $userModel->getItem((int) $contact->user_id); @@ -459,8 +456,7 @@ protected function getContactQuery($pk = null) if ($result) { - $contactParams = new Registry; - $contactParams->loadString($result->params); + $contactParams = new Registry($result->params); // If we are showing a contact list, then the contact parameters take priority // So merge the contact parameters with the merged parameters @@ -542,7 +538,7 @@ protected function getContactQuery($pk = null) } // Get the profile information for the linked user - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; + JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_users/models', 'UsersModel'); $userModel = JModelLegacy::getInstance('User', 'UsersModel', array('ignore_request' => true)); $data = $userModel->getItem((int) $result->user_id); diff --git a/components/com_contact/models/featured.php b/components/com_contact/models/featured.php index d235d7b461ed7..2a981d31043b3 100644 --- a/components/com_contact/models/featured.php +++ b/components/com_contact/models/featured.php @@ -122,9 +122,7 @@ public function getItems() $item = & $items[$i]; if (!isset($this->_params)) { - $params = new Registry; - $params->loadString($item->params); - $item->params = $params; + $item->params = new Registry($item->params); } } diff --git a/components/com_contact/models/forms/filter_contacts.xml b/components/com_contact/models/forms/filter_contacts.xml new file mode 100644 index 0000000000000..6272238fbadd7 --- /dev/null +++ b/components/com_contact/models/forms/filter_contacts.xml @@ -0,0 +1,136 @@ + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/com_contact/models/forms/form.xml b/components/com_contact/models/forms/form.xml index e271905182e86..236fe0978862c 100644 --- a/components/com_contact/models/forms/form.xml +++ b/components/com_contact/models/forms/form.xml @@ -265,6 +265,28 @@
        + + + + + + + + + + + + JSHOW - - - - - - JSHOW + + + + + + JHIDE + + + + tag for the form field object. * @param mixed $value The form field value to validate. @@ -47,7 +48,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry { foreach (explode(';', $banned) as $item) { - if ($item != '' && JString::stristr($value, $item) !== false) + if ($item != '' && StringHelper::stristr($value, $item) !== false) { return false; } diff --git a/components/com_contact/models/rules/contactemailmessage.php b/components/com_contact/models/rules/contactemailmessage.php index b869f4f7c056e..f7c619b99aeec 100644 --- a/components/com_contact/models/rules/contactemailmessage.php +++ b/components/com_contact/models/rules/contactemailmessage.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; /** * JFormRule for com_contact to make sure the message body contains no banned word. @@ -40,7 +41,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry { foreach (explode(';', $banned) as $item) { - if ($item != '' && JString::stristr($value, $item) !== false) + if ($item != '' && StringHelper::stristr($value, $item) !== false) { return false; } diff --git a/components/com_contact/models/rules/contactemailsubject.php b/components/com_contact/models/rules/contactemailsubject.php index acfe05a498e95..cf1349d62cf51 100644 --- a/components/com_contact/models/rules/contactemailsubject.php +++ b/components/com_contact/models/rules/contactemailsubject.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; /** * JFormRule for com_contact to make sure the subject contains no banned word. @@ -40,7 +41,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry { foreach (explode(';', $banned) as $item) { - if ($item != '' && JString::stristr($value, $item) !== false) + if ($item != '' && StringHelper::stristr($value, $item) !== false) { return false; } diff --git a/components/com_contact/router.php b/components/com_contact/router.php index 3de9dc7910d1c..597569cd0a201 100644 --- a/components/com_contact/router.php +++ b/components/com_contact/router.php @@ -14,236 +14,202 @@ * * @since 3.3 */ -class ContactRouter extends JComponentRouterBase +class ContactRouter extends JComponentRouterView { + protected $noIDs = false; + /** - * Build the route for the com_contact component - * - * @param array &$query An array of URL arguments + * Search Component router constructor * - * @return array The URL arguments to use to assemble the subsequent URL. - * - * @since 3.3 + * @param JApplicationCms $app The application object + * @param JMenu $menu The menu object to work with */ - public function build(&$query) + public function __construct($app = null, $menu = null) { - $segments = array(); - - // Get a menu item based on Itemid or currently active $params = JComponentHelper::getParams('com_contact'); - $advanced = $params->get('sef_advanced_link', 0); - - if (empty($query['Itemid'])) - { - $menuItem = $this->menu->getActive(); - } - else - { - $menuItem = $this->menu->getItem($query['Itemid']); - } + $this->noIDs = (bool) $params->get('sef_ids'); + $categories = new JComponentRouterViewconfiguration('categories'); + $categories->setKey('id'); + $this->registerView($categories); + $category = new JComponentRouterViewconfiguration('category'); + $category->setKey('id')->setParent($categories, 'catid')->setNestable(); + $this->registerView($category); + $contact = new JComponentRouterViewconfiguration('contact'); + $contact->setKey('id')->setParent($category, 'catid'); + $this->registerView($contact); + $this->registerView(new JComponentRouterViewconfiguration('featured')); - $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; - $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; + parent::__construct($app, $menu); - if (isset($query['view'])) - { - $view = $query['view']; - - if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_contact') - { - $segments[] = $query['view']; - } + $this->attachRule(new JComponentRouterRulesMenu($this)); - unset($query['view']); - } + $params = JComponentHelper::getParams('com_content'); - // Are we dealing with a contact that is attached to a menu item? - if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id'])) + if ($params->get('sef_advanced', 0)) { - unset($query['view']); - unset($query['catid']); - unset($query['id']); - return $segments; + $this->attachRule(new JComponentRouterRulesStandard($this)); + $this->attachRule(new JComponentRouterRulesNomenu($this)); } - - if (isset($view) and ($view == 'category' or $view == 'contact')) + else { - if ($mId != (int) $query['id'] || $mView != $view) - { - if ($view == 'contact' && isset($query['catid'])) - { - $catid = $query['catid']; - } - elseif (isset($query['id'])) - { - $catid = $query['id']; - } - - $menuCatid = $mId; - $categories = JCategories::getInstance('Contact'); - $category = $categories->get($catid); - - if ($category) - { - // TODO Throw error that the category either not exists or is unpublished - $path = array_reverse($category->getPath()); - - $array = array(); - - foreach ($path as $id) - { - if ((int) $id == (int) $menuCatid) - { - break; - } - - if ($advanced) - { - list($tmp, $id) = explode(':', $id, 2); - } - - $array[] = $id; - } - - $segments = array_merge($segments, array_reverse($array)); - } - - if ($view == 'contact') - { - if ($advanced) - { - list($tmp, $id) = explode(':', $query['id'], 2); - } - else - { - $id = $query['id']; - } - - $segments[] = $id; - } - } - - unset($query['id']); - unset($query['catid']); + JLoader::register('ContactRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php'); + $this->attachRule(new ContactRouterRulesLegacy($this)); } + } - if (isset($query['layout'])) + /** + * Method to get the segment(s) for a category + * + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getCategorySegment($id, $query) + { + $category = JCategories::getInstance($this->getName())->get($id); + + if ($category) { - if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) + if ($this->noIDs) { - if ($query['layout'] == $menuItem->query['layout']) + $path = array_reverse($category->getPath(), true); + foreach ($path as &$segment) { - - unset($query['layout']); + list($id, $segment) = explode(':', $segment, 2); } + + return $path; } else { - if ($query['layout'] == 'default') - { - unset($query['layout']); - } + return array_reverse($category->getPath(), true); } } - $total = count($segments); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = str_replace(':', '-', $segments[$i]); - } - - return $segments; + return array(); } /** - * Parse the segments of a URL. - * - * @param array &$segments The segments of the URL to parse. + * Method to get the segment(s) for a category * - * @return array The URL attributes to be used by the application. + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now * - * @since 3.3 + * @return array|string The segments of this item */ - public function parse(&$segments) + public function getCategoriesSegment($id, $query) { - $total = count($segments); - $vars = array(); + return $this->getCategorySegment($id, $query); + } - for ($i = 0; $i < $total; $i++) + /** + * Method to get the segment(s) for a contact + * + * @param string $id ID of the contact to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getContactSegment($id, $query) + { + if ($this->noIDs) { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); - } - - // Get the active menu item. - $item = $this->menu->getActive(); - $params = JComponentHelper::getParams('com_contact'); - $advanced = $params->get('sef_advanced_link', 0); - - // Count route segments - $count = count($segments); + if (strpos($id, ':')) + { + list($void, $segment) = explode(':', $id, 2); - // Standard routing for newsfeeds. - if (!isset($item)) - { - $vars['view'] = $segments[0]; - $vars['id'] = $segments[$count - 1]; - return $vars; + return array($void => $segment); + } + else + { + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('alias')) + ->from($dbquery->qn('#__contact_details')) + ->where('id = ' . $dbquery->q((int) $id)); + $db->setQuery($dbquery); + + return array($id => $id . ':' . $db->loadResult()); + } } - // From the categories view, we can only jump to a category. - $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; - - $contactCategory = JCategories::getInstance('Contact')->get($id); - - $categories = ($contactCategory) ? $contactCategory->getChildren() : array(); - $vars['catid'] = $id; - $vars['id'] = $id; - $found = 0; + return array((int) $id => $id); + } - foreach ($segments as $segment) + /** + * Method to get the id for a category + * + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getCategoryId($segment, $query) + { + if (isset($query['id'])) { - $segment = $advanced ? str_replace(':', '-', $segment) : $segment; + $category = JCategories::getInstance($this->getName())->get($query['id']); - foreach ($categories as $category) + foreach ($category->getChildren() as $child) { - if ($category->slug == $segment || $category->alias == $segment) + if ($this->noIDs) { - $vars['id'] = $category->id; - $vars['catid'] = $category->id; - $vars['view'] = 'category'; - $categories = $category->getChildren(); - $found = 1; - break; - } - } - - if ($found == 0) - { - if ($advanced) - { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from('#__contact_details') - ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) - ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); - $db->setQuery($query); - $nid = $db->loadResult(); + if ($child->alias == $segment) + { + return $child->id; + } } else { - $nid = $segment; + if ($child->id == (int) $segment) + { + return $child->id; + } } - - $vars['id'] = $nid; - $vars['view'] = 'contact'; } + } + + return false; + } - $found = 0; + /** + * Method to get the segment(s) for a category + * + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getCategoriesId($segment, $query) + { + return $this->getCategoryId($segment, $query); + } + + /** + * Method to get the segment(s) for a contact + * + * @param string $segment Segment of the contact to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getContactId($segment, $query) + { + if ($this->noIDs) + { + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('id')) + ->from($dbquery->qn('#__contact_details')) + ->where('alias = ' . $dbquery->q($segment)) + ->where('catid = ' . $dbquery->q($query['id'])); + $db->setQuery($dbquery); + + return (int) $db->loadResult(); } - return $vars; + return (int) $segment; } } @@ -261,7 +227,8 @@ public function parse(&$segments) */ function ContactBuildRoute(&$query) { - $router = new ContactRouter; + $app = JFactory::getApplication(); + $router = new ContactRouter($app, $app->getMenu()); return $router->build($query); } @@ -280,7 +247,8 @@ function ContactBuildRoute(&$query) */ function ContactParseRoute($segments) { - $router = new ContactRouter; + $app = JFactory::getApplication(); + $router = new ContactRouter($app, $app->getMenu()); return $router->parse($segments); } diff --git a/components/com_contact/views/categories/tmpl/default.xml b/components/com_contact/views/categories/tmpl/default.xml index 93ce1d6524447..b9a9c67c7d052 100644 --- a/components/com_contact/views/categories/tmpl/default.xml +++ b/components/com_contact/views/categories/tmpl/default.xml @@ -325,6 +325,28 @@ + + + + + + + + + + + + JSHOW - - - - - - JSHOW + + + + + + items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) : +if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) : ?> items[$this->parent->id] as $id => $item) : ?> numitems; ?> - getChildren()) > 0 && $this->maxLevelcat > 1) : ?> + maxLevelcat > 1 && count($item->getChildren()) > 0) : ?> @@ -46,7 +46,7 @@ - getChildren()) > 0 && $this->maxLevelcat > 1) :?> + maxLevelcat > 1 && count($item->getChildren()) > 0) :?>
        items[$item->id] = $item->getChildren(); diff --git a/components/com_contact/views/category/metadata.xml b/components/com_contact/views/category/metadata.xml deleted file mode 100644 index 657cd43e42a03..0000000000000 --- a/components/com_contact/views/category/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_contact/views/category/tmpl/default.xml b/components/com_contact/views/category/tmpl/default.xml index c59cc3a5f7cb0..a2f4db16250eb 100644 --- a/components/com_contact/views/category/tmpl/default.xml +++ b/components/com_contact/views/category/tmpl/default.xml @@ -10,16 +10,23 @@ - +
        - -
        @@ -291,6 +298,28 @@ + + + + + + + + + + + + JSHOW - - - - - - JSHOW + + + + + + JSHOW + + + + children[$this->category->id]) > 0 && $this->maxLevel != 0) : +if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>
          children[$this->category->id] as $id => $child) : ?> diff --git a/components/com_contact/views/category/tmpl/default_items.php b/components/com_contact/views/category/tmpl/default_items.php index 01359ce81d4fe..3bf9a80a96147 100644 --- a/components/com_contact/views/category/tmpl/default_items.php +++ b/components/com_contact/views/category/tmpl/default_items.php @@ -39,26 +39,29 @@
        -
        @@ -63,10 +65,23 @@ - + > + + + + + + @@ -193,16 +208,6 @@ - - - - - - JSHOW + + + + + + JALL + + + + params->get('show_articles')) : ?> diff --git a/components/com_contact/views/contact/tmpl/default_form.php b/components/com_contact/views/contact/tmpl/default_form.php index 243c562e750b5..ef21ae02405cd 100644 --- a/components/com_contact/views/contact/tmpl/default_form.php +++ b/components/com_contact/views/contact/tmpl/default_form.php @@ -12,29 +12,17 @@ JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidator'); -$captchaEnabled = false; - -$captchaSet = $this->params->get('captcha', JFactory::getApplication()->get('captcha', '0')); - -foreach (JPluginHelper::getPlugin('captcha') as $plugin) -{ - if ($captchaSet === $plugin->name) - { - $captchaEnabled = true; - break; - } -} ?>
        form->getFieldsets() as $fieldset): ?> - name === 'captcha' && !$captchaEnabled) : ?> + name === 'captcha' && !$this->captchaEnabled) : ?> form->getFieldset($fieldset->name); ?>
        - label) && strlen($legend = trim(JText::_($fieldset->label)))) : ?> + label) && ($legend = trim(JText::_($fieldset->label))) !== '') : ?> diff --git a/components/com_contact/views/contact/tmpl/default_links.php b/components/com_contact/views/contact/tmpl/default_links.php index 4a38c96c5f9d1..8f7ecddb9171b 100644 --- a/components/com_contact/views/contact/tmpl/default_links.php +++ b/components/com_contact/views/contact/tmpl/default_links.php @@ -10,13 +10,13 @@ defined('_JEXEC') or die; ?> -params->get('presentation_style') == 'sliders') : ?> +params->get('presentation_style') === 'sliders') : ?> -params->get('presentation_style') == 'tabs') : ?> +params->get('presentation_style') === 'tabs') : ?> -params->get('presentation_style') == 'plain'):?> +params->get('presentation_style') === 'plain'):?> ' . JText::_('COM_CONTACT_LINKS') . ''; ?> @@ -36,7 +36,7 @@ $link = (0 === strpos($link, 'http')) ? $link : 'http://' . $link; // If no label is present, take the link - $label = ($label) ? $label : $link; + $label = $label ?: $link; ?>
    ' . JStringPunycode::urlToUTF8($profile->text) . '
    '; else : echo '
    ' . JStringPunycode::urlToUTF8($profile->text) . '
    '; endif; break; - case "profile_dob": + case 'profile_dob': echo '
    ' . JHtml::_('date', $profile->text, JText::_('DATE_FORMAT_LC4'), false) . '
    '; break; diff --git a/components/com_contact/views/contact/tmpl/default_user_custom_fields.php b/components/com_contact/views/contact/tmpl/default_user_custom_fields.php new file mode 100644 index 0000000000000..076c6f803c28e --- /dev/null +++ b/components/com_contact/views/contact/tmpl/default_user_custom_fields.php @@ -0,0 +1,61 @@ +params; +$presentation_style = $params->get('presentation_style'); + +$displayGroups = $params->get('show_user_custom_fields'); +$userFieldGroups = array(); +?> + +contactUser) : ?> + + + +contactUser->fields as $field) :?> + catid, $displayGroups)) : ?> + + + category_title, $userFieldGroups)) : ?> + category_title] = array();?> + + category_title][] = $field;?> + + + $fields) :?> + + + + + + + ' . ($categoryTitle ? $categoryTitle : JText::_('COM_CONTACT_USER_FIELDS')) . ''; ?> + + +
    +
    + + value) : ?> + + + + ' . $field->label . ''; ?> + ' . $field->value . ''; ?> + +
    +
    + + + + + + + diff --git a/components/com_contact/views/contact/view.html.php b/components/com_contact/views/contact/view.html.php index eba83e7f4bb6d..5189b34f53604 100644 --- a/components/com_contact/views/contact/view.html.php +++ b/components/com_contact/views/contact/view.html.php @@ -9,8 +9,6 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/models/category.php'; - /** * HTML Contact View class for the Contact component * @@ -51,6 +49,14 @@ class ContactViewContact extends JViewLegacy */ protected $return_page; + /** + * Should we show a captcha form for the submission of the contact request? + * + * @var bool + * @since 3.6.3 + */ + protected $captchaEnabled = false; + /** * Execute and display a template script. * @@ -132,12 +138,12 @@ public function display($tpl = null) { case 1 : // Text - $params->set('marker_address', JText::_('COM_CONTACT_ADDRESS') . ": "); - $params->set('marker_email', JText::_('JGLOBAL_EMAIL') . ": "); - $params->set('marker_telephone', JText::_('COM_CONTACT_TELEPHONE') . ": "); - $params->set('marker_fax', JText::_('COM_CONTACT_FAX') . ": "); - $params->set('marker_mobile', JText::_('COM_CONTACT_MOBILE') . ": "); - $params->set('marker_misc', JText::_('COM_CONTACT_OTHER_INFORMATION') . ": "); + $params->set('marker_address', JText::_('COM_CONTACT_ADDRESS') . ': '); + $params->set('marker_email', JText::_('JGLOBAL_EMAIL') . ': '); + $params->set('marker_telephone', JText::_('COM_CONTACT_TELEPHONE') . ': '); + $params->set('marker_fax', JText::_('COM_CONTACT_FAX') . ': '); + $params->set('marker_mobile', JText::_('COM_CONTACT_MOBILE') . ': '); + $params->set('marker_misc', JText::_('COM_CONTACT_OTHER_INFORMATION') . ': '); $params->set('marker_class', 'jicons-text'); break; @@ -155,60 +161,60 @@ public function display($tpl = null) default : if ($params->get('icon_address')) { - $image1 = JHtml::_('image', $params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS') . ": ", null, false); + $image1 = JHtml::_('image', $params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS') . ': ', null, false); } else { - $image1 = JHtml::_('image', 'contacts/' . $params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS') . ": ", null, true); + $image1 = JHtml::_('image', 'contacts/' . $params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS') . ': ', null, true); } if ($params->get('icon_email')) { - $image2 = JHtml::_('image', $params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL') . ": ", null, false); + $image2 = JHtml::_('image', $params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL') . ': ', null, false); } else { - $image2 = JHtml::_('image', 'contacts/' . $params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL') . ": ", null, true); + $image2 = JHtml::_('image', 'contacts/' . $params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL') . ': ', null, true); } if ($params->get('icon_telephone')) { - $image3 = JHtml::_('image', $params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE') . ": ", null, false); + $image3 = JHtml::_('image', $params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE') . ': ', null, false); } else { - $image3 = JHtml::_('image', 'contacts/' . $params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE') . ": ", null, true); + $image3 = JHtml::_('image', 'contacts/' . $params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE') . ': ', null, true); } if ($params->get('icon_fax')) { - $image4 = JHtml::_('image', $params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX') . ": ", null, false); + $image4 = JHtml::_('image', $params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX') . ': ', null, false); } else { - $image4 = JHtml::_('image', 'contacts/' . $params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX') . ": ", null, true); + $image4 = JHtml::_('image', 'contacts/' . $params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX') . ': ', null, true); } if ($params->get('icon_misc')) { - $image5 = JHtml::_('image', $params->get('icon_misc', 'con_info.png'), JText::_('COM_CONTACT_OTHER_INFORMATION') . ": ", null, false); + $image5 = JHtml::_('image', $params->get('icon_misc', 'con_info.png'), JText::_('COM_CONTACT_OTHER_INFORMATION') . ': ', null, false); } else { $image5 = JHtml::_( 'image', 'contacts/' . $params->get('icon_misc', 'con_info.png'), - JText::_('COM_CONTACT_OTHER_INFORMATION') . ": ", null, true + JText::_('COM_CONTACT_OTHER_INFORMATION') . ': ', null, true ); } if ($params->get('icon_mobile')) { - $image6 = JHtml::_('image', $params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE') . ": ", null, false); + $image6 = JHtml::_('image', $params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE') . ': ', null, false); } else { - $image6 = JHtml::_('image', 'contacts/' . $params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE') . ": ", null, true); + $image6 = JHtml::_('image', 'contacts/' . $params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE') . ': ', null, true); } $params->set('marker_address', $image1); @@ -238,7 +244,7 @@ public function display($tpl = null) $offset = $state->get('list.offset'); // Fix for where some plugins require a text attribute - !empty($item->description)? $item->text = $item->description : $item->text = null; + !empty($item->misc)? $item->text = $item->misc : $item->text = null; $dispatcher->trigger('onContentPrepare', array ('com_contact.contact', &$item, &$this->params, $offset)); // Store the events for later @@ -254,19 +260,32 @@ public function display($tpl = null) if ($item->text) { - $item->description = $item->text; + $item->misc = $item->text; + } + + $contactUser = null; + if ($params->get('show_user_custom_fields') && $item->user_id && $contactUser = JFactory::getUser($item->user_id)) + { + $contactUser->text = ''; + JEventDispatcher::getInstance()->trigger('onContentPrepare', array ('com_users.user', &$contactUser, &$item->params, 0)); + + if (!isset($contactUser->fields)) + { + $contactUser->fields = array(); + } } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); - $this->contact = &$item; - $this->params = &$params; - $this->return = &$return; - $this->state = &$state; - $this->item = &$item; - $this->user = &$user; - $this->contacts = &$contacts; + $this->contact = &$item; + $this->params = &$params; + $this->return = &$return; + $this->state = &$state; + $this->item = &$item; + $this->user = &$user; + $this->contacts = &$contacts; + $this->contactUser = $contactUser; $item->tags = new JHelperTags; $item->tags->getItemTags('com_contact.contact', $this->item->id); @@ -290,8 +309,19 @@ public function display($tpl = null) $model = $this->getModel(); $model->hit(); - $this->_prepareDocument(); + $captchaSet = $params->get('captcha', JFactory::getApplication()->get('captcha', '0')); + + foreach (JPluginHelper::getPlugin('captcha') as $plugin) + { + if ($captchaSet === $plugin->name) + { + $this->captchaEnabled = true; + break; + } + } + + $this->_prepareDocument(); return parent::display($tpl); } @@ -327,7 +357,7 @@ protected function _prepareDocument() $id = (int) @$menu->query['id']; // If the menu item does not concern this contact - if ($menu && ($menu->query['option'] != 'com_contact' || $menu->query['view'] != 'contact' || $id != $this->item->id)) + if ($menu && ($menu->query['option'] !== 'com_contact' || $menu->query['view'] !== 'contact' || $id != $this->item->id)) { // If this is not a single contact menu item, set the page title to the contact title if ($this->item->name) @@ -338,7 +368,7 @@ protected function _prepareDocument() $path = array(array('title' => $this->contact->name, 'link' => '')); $category = JCategories::getInstance('Contact')->get($this->contact->catid); - while ($category && ($menu->query['option'] != 'com_contact' || $menu->query['view'] == 'contact' || $id != $category->id) && $category->id > 1) + while ($category && ($menu->query['option'] !== 'com_contact' || $menu->query['view'] === 'contact' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($this->contact->catid)); $category = $category->getParent(); diff --git a/components/com_contact/views/featured/metadata.xml b/components/com_contact/views/featured/metadata.xml deleted file mode 100644 index d4da281b51af3..0000000000000 --- a/components/com_contact/views/featured/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_contact/views/featured/tmpl/default.xml b/components/com_contact/views/featured/tmpl/default.xml index 9e49616774b6a..be17fb9136832 100644 --- a/components/com_contact/views/featured/tmpl/default.xml +++ b/components/com_contact/views/featured/tmpl/default.xml @@ -151,6 +151,29 @@ + + + + + + + + + + + + + JSHOW - - - - - - JSHOW + + + + + + items as $i => $item) : ?> - " itemscope itemtype="https://schema.org/Person"> + diff --git a/components/com_contact/views/featured/view.html.php b/components/com_contact/views/featured/view.html.php index 3c815cde3d26f..4df2786df1949 100644 --- a/components/com_contact/views/featured/view.html.php +++ b/components/com_contact/views/featured/view.html.php @@ -96,9 +96,7 @@ public function display($tpl = null) { $item = &$items[$i]; $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $temp = new Registry; - - $temp->loadString($item->params); + $temp = new Registry($item->params); $item->params = clone $params; $item->params->merge($temp); diff --git a/components/com_content/content.php b/components/com_content/content.php index ddf20c2528d6d..850b1ba40fd98 100644 --- a/components/com_content/content.php +++ b/components/com_content/content.php @@ -9,15 +9,16 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; -require_once JPATH_COMPONENT . '/helpers/query.php'; +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); +JLoader::register('ContentHelperQuery', JPATH_SITE . '/components/com_content/helpers/query.php'); +JLoader::register('ContentHelperAssociation', JPATH_SITE . '/components/com_content/helpers/association.php'); $input = JFactory::getApplication()->input; $user = JFactory::getUser(); if ($input->get('view') === 'article' && $input->get('layout') === 'pagebreak') { - if (!$user->authorise('core.edit', 'com_content')) + if (!$user->authorise('core.create', 'com_content')) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); @@ -26,7 +27,7 @@ } elseif ($input->get('view') === 'articles' && $input->get('layout') === 'modal') { - if (!$user->authorise('core.edit', 'com_content')) + if (!$user->authorise('core.create', 'com_content')) { JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); @@ -35,5 +36,5 @@ } $controller = JControllerLegacy::getInstance('Content'); -$controller->execute($input->get('task')); +$controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect(); diff --git a/components/com_content/controller.php b/components/com_content/controller.php index ae86b40a271b4..5a92a7f5beb58 100644 --- a/components/com_content/controller.php +++ b/components/com_content/controller.php @@ -37,7 +37,7 @@ public function __construct($config = array()) // Article frontpage Editor article proxying: elseif ($this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal') { - JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true)); $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; } diff --git a/components/com_content/controllers/article.php b/components/com_content/controllers/article.php index b7b76bb395c26..c28a71d7237a0 100644 --- a/components/com_content/controllers/article.php +++ b/components/com_content/controllers/article.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Content article class. * @@ -68,7 +70,7 @@ public function add() protected function allowAdd($data = array()) { $user = JFactory::getUser(); - $categoryId = JArrayHelper::getValue($data, 'catid', $this->input->getInt('catid'), 'int'); + $categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('catid'), 'int'); $allow = null; if ($categoryId) @@ -101,45 +103,36 @@ protected function allowAdd($data = array()) protected function allowEdit($data = array(), $key = 'id') { $recordId = (int) isset($data[$key]) ? $data[$key] : 0; - $user = JFactory::getUser(); - $userId = $user->get('id'); - $asset = 'com_content.article.' . $recordId; + $user = JFactory::getUser(); - // Check general edit permission first. - if ($user->authorise('core.edit', $asset)) + // Zero record (id:0), return component edit permission by calling parent controller method + if (!$recordId) + { + return parent::allowEdit($data, $key); + } + + // Check edit on the record asset (explicit or inherited) + if ($user->authorise('core.edit', 'com_content.article.' . $recordId)) { return true; } - // Fallback on edit.own. - // First test if the permission is available. - if ($user->authorise('core.edit.own', $asset)) + // Check edit own on the record asset (explicit or inherited) + if ($user->authorise('core.edit.own', 'com_content.article.' . $recordId)) { - // Now test the owner is the user. - $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + // Existing record already has an owner, get it + $record = $this->getModel()->getItem($recordId); - if (empty($ownerId) && $recordId) + if (empty($record)) { - // Need to do a lookup from the model. - $record = $this->getModel()->getItem($recordId); - - if (empty($record)) - { - return false; - } - - $ownerId = $record->created_by; + return false; } - // If the owner matches 'me' then do the test. - if ($ownerId == $userId) - { - return true; - } + // Grant if current user is owner of the record + return $user->get('id') == $record->created_by; } - // Since there is no asset tracking, revert to the component permissions. - return parent::allowEdit($data, $key); + return false; } /** @@ -195,9 +188,7 @@ public function edit($key = null, $urlVar = 'a_id') */ public function getModel($name = 'form', $prefix = '', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, $config); - - return $model; + return parent::getModel($name, $prefix, $config); } /** @@ -331,7 +322,7 @@ public function save($key = null, $urlVar = 'a_id') public function vote() { // Check for request forgeries. - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken(); $user_rating = $this->input->getInt('user_rating', -1); diff --git a/components/com_content/helpers/association.php b/components/com_content/helpers/association.php index 806e5db6090e3..fb63138702a43 100644 --- a/components/com_content/helpers/association.php +++ b/components/com_content/helpers/association.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php'); +JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php'); /** @@ -29,17 +30,13 @@ abstract class ContentHelperAssociation extends CategoryHelperAssociation * * @since 3.0 */ - public static function getAssociations($id = 0, $view = null) { - jimport('helper.route', JPATH_COMPONENT_SITE); - - $app = JFactory::getApplication(); - $jinput = $app->input; - $view = is_null($view) ? $jinput->get('view') : $view; - $id = empty($id) ? $jinput->getInt('id') : $id; + $jinput = JFactory::getApplication()->input; + $view = is_null($view) ? $jinput->get('view') : $view; + $id = empty($id) ? $jinput->getInt('id') : $id; - if ($view == 'article') + if ($view == 'article' || $view == 'category' || $view == 'featured') { if ($id) { @@ -63,4 +60,55 @@ public static function getAssociations($id = 0, $view = null) return array(); } + + /** + * Method to display in frontend the associations for a given article + * + * @param integer $id Id of the article + * + * @return array An array containing the association URL and the related language object + * + * @since __DEPLOY_VERSION__ + */ + public static function displayAssociations($id) + { + $return = array(); + + if ($associations = self::getAssociations($id)) + { + $levels = JFactory::getUser()->getAuthorisedViewLevels(); + $languages = JLanguageHelper::getLanguages(); + + foreach ($languages as $language) + { + // Do not display language when no association + if (empty($associations[$language->lang_code])) + { + continue; + } + + // Do not display language without frontend UI + if (!array_key_exists($language->lang_code, JLanguageMultilang::getSiteLangs())) + { + continue; + } + + // Do not display language without specific home menu + if (!array_key_exists($language->lang_code, JLanguageMultilang::getSiteHomePages())) + { + continue; + } + + // Do not display language without authorized access level + if (isset($language->access) && $language->access && !in_array($language->access, $levels)) + { + continue; + } + + $return[$language->lang_code] = array('item' => $associations[$language->lang_code], 'language' => $language); + } + } + + return $return; + } } diff --git a/components/com_content/helpers/icon.php b/components/com_content/helpers/icon.php index e54dfc43f74e2..4ae58d9c01a6a 100644 --- a/components/com_content/helpers/icon.php +++ b/components/com_content/helpers/icon.php @@ -30,27 +30,11 @@ abstract class JHtmlIcon */ public static function create($category, $params, $attribs = array(), $legacy = false) { - JHtml::_('bootstrap.tooltip'); - $uri = JUri::getInstance(); $url = 'index.php?option=com_content&task=article.add&return=' . base64_encode($uri) . '&a_id=0&catid=' . $category->id; - if ($params->get('show_icons')) - { - if ($legacy) - { - $text = JHtml::_('image', 'system/new.png', JText::_('JNEW'), null, true); - } - else - { - $text = '' . JText::_('JNEW'); - } - } - else - { - $text = JText::_('JNEW') . ' '; - } + $text = JLayoutHelper::render('joomla.content.icons.create', array('params' => $params, 'legacy' => $legacy)); // Add the button classes to the attribs array if (isset($attribs['class'])) @@ -81,31 +65,17 @@ public static function create($category, $params, $attribs = array(), $legacy = */ public static function email($article, $params, $attribs = array(), $legacy = false) { - require_once JPATH_SITE . '/components/com_mailto/helpers/mailto.php'; + JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php'); $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'host', 'port')); $template = JFactory::getApplication()->getTemplate(); $link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false); - $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailToHelper::addLink($link); + $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; - if ($params->get('show_icons')) - { - if ($legacy) - { - $text = JHtml::_('image', 'system/emailButton.png', JText::_('JGLOBAL_EMAIL'), null, true); - } - else - { - $text = '' . JText::_('JGLOBAL_EMAIL'); - } - } - else - { - $text = JText::_('JGLOBAL_EMAIL'); - } + $text = JLayoutHelper::render('joomla.content.icons.email', array('params' => $params, 'legacy' => $legacy)); $attribs['title'] = JText::_('JGLOBAL_EMAIL_TITLE'); $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;"; @@ -148,8 +118,6 @@ public static function edit($article, $params, $attribs = array(), $legacy = fal return; } - JHtml::_('bootstrap.tooltip'); - // Show checked_out icon if the article is checked out by a different user if (property_exists($article, 'checked_out') && property_exists($article, 'checked_out_time') @@ -161,16 +129,7 @@ public static function edit($article, $params, $attribs = array(), $legacy = fal $tooltip = JText::_('JLIB_HTML_CHECKED_OUT') . ' :: ' . JText::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name) . '
    ' . $date; - if ($legacy) - { - $button = JHtml::_('image', 'system/checked_out.png', null, null, true); - $text = '' - . $button . ' ' . JText::_('JLIB_HTML_CHECKED_OUT'); - } - else - { - $text = ' ' . JText::_('JLIB_HTML_CHECKED_OUT'); - } + $text = JLayoutHelper::render('joomla.content.icons.edit_lock', array('tooltip' => $tooltip, 'legacy' => $legacy)); $output = JHtml::_('link', '#', $text, $attribs); @@ -197,32 +156,7 @@ public static function edit($article, $params, $attribs = array(), $legacy = fal $overlib .= '<br />'; $overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8')); - if ($legacy) - { - $icon = $article->state ? 'edit.png' : 'edit_unpublished.png'; - - if (strtotime($article->publish_up) > strtotime(JFactory::getDate()) - || ((strtotime($article->publish_down) < strtotime(JFactory::getDate())) && $article->publish_down != JFactory::getDbo()->getNullDate())) - { - $icon = 'edit_unpublished.png'; - } - - $text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), null, true); - } - else - { - $icon = $article->state ? 'edit' : 'eye-close'; - - if (strtotime($article->publish_up) > strtotime(JFactory::getDate()) - || ((strtotime($article->publish_down) < strtotime(JFactory::getDate())) && $article->publish_down != JFactory::getDbo()->getNullDate())) - { - $icon = 'eye-close'; - } - - $text = '' - . JText::_('JGLOBAL_EDIT'); - } + $text = JLayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'overlib' => $overlib, 'legacy' => $legacy)); $attribs['title'] = JText::_('JGLOBAL_EDIT_TITLE'); $output = JHtml::_('link', JRoute::_($url), $text, $attribs); @@ -251,22 +185,7 @@ public static function print_popup($article, $params, $attribs = array(), $legac $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; - // Checks template image directory for image, if non found default are loaded - if ($params->get('show_icons')) - { - if ($legacy) - { - $text = JHtml::_('image', 'system/printButton.png', JText::_('JGLOBAL_PRINT'), null, true); - } - else - { - $text = '' . JText::_('JGLOBAL_PRINT'); - } - } - else - { - $text = JText::_('JGLOBAL_PRINT'); - } + $text = JLayoutHelper::render('joomla.content.icons.print_popup', array('params' => $params, 'legacy' => $legacy)); $attribs['title'] = JText::sprintf('JGLOBAL_PRINT_TITLE', htmlspecialchars($article->title, ENT_QUOTES, 'UTF-8')); $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;"; @@ -287,22 +206,7 @@ public static function print_popup($article, $params, $attribs = array(), $legac */ public static function print_screen($article, $params, $attribs = array(), $legacy = false) { - // Checks template image directory for image, if none found default are loaded - if ($params->get('show_icons')) - { - if ($legacy) - { - $text = JHtml::_('image', 'system/printButton.png', JText::_('JGLOBAL_PRINT'), null, true); - } - else - { - $text = '' . JText::_('JGLOBAL_PRINT'); - } - } - else - { - $text = JText::_('JGLOBAL_PRINT'); - } + $text = JLayoutHelper::render('joomla.content.icons.print_screen', array('params' => $params, 'legacy' => $legacy)); return '' . $text . ''; } diff --git a/components/com_content/helpers/legacyrouter.php b/components/com_content/helpers/legacyrouter.php new file mode 100644 index 0000000000000..b1fea26fd6589 --- /dev/null +++ b/components/com_content/helpers/legacyrouter.php @@ -0,0 +1,479 @@ +router = $router; + } + + /** + * Preprocess the route for the com_content component + * + * @param array &$query An array of URL arguments + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function preprocess(&$query) + { + } + + /** + * Build the route for the com_content component + * + * @param array &$query An array of URL arguments + * @param array &$segments The URL arguments to use to assemble the subsequent URL. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function build(&$query, &$segments) + { + // Get a menu item based on Itemid or currently active + $params = JComponentHelper::getParams('com_content'); + $advanced = $params->get('sef_advanced_link', 0); + + // We need a menu item. Either the one specified in the query, or the current active one if none specified + if (empty($query['Itemid'])) + { + $menuItem = $this->router->menu->getActive(); + $menuItemGiven = false; + } + else + { + $menuItem = $this->router->menu->getItem($query['Itemid']); + $menuItemGiven = true; + } + + // Check again + if (!empty($menuItem) && $menuItem->component != 'com_content') + { + // Clear active menu item, because later code uses it without checking: $menuItemGiven + $menuItem = null; + $menuItemGiven = false; + unset($query['Itemid']); + } + + if (isset($query['view'])) + { + $view = $query['view']; + } + else + { + // We need to have a view in the query or it is an invalid URL + return; + } + + // Are we dealing with an article or category that is attached to a menu item? + if (($menuItem instanceof stdClass) + && $menuItem->query['view'] == $query['view'] + && isset($query['id']) + && $menuItem->query['id'] == (int) $query['id']) + { + unset($query['view']); + + if (isset($query['catid'])) + { + unset($query['catid']); + } + + if (isset($query['layout'])) + { + unset($query['layout']); + } + + unset($query['id']); + + return; + } + + if ($view == 'category' || $view == 'article') + { + if (!$menuItemGiven) + { + $segments[] = $view; + } + + unset($query['view']); + + if ($view == 'article') + { + if (isset($query['id']) && isset($query['catid']) && $query['catid']) + { + $catid = $query['catid']; + + // Make sure we have the id and the alias + if (strpos($query['id'], ':') === false) + { + $db = JFactory::getDbo(); + $dbQuery = $db->getQuery(true) + ->select('alias') + ->from('#__content') + ->where('id=' . (int) $query['id']); + $db->setQuery($dbQuery); + $alias = $db->loadResult(); + $query['id'] = $query['id'] . ':' . $alias; + } + } + else + { + // We should have these two set for this view. If we don't, it is an error + return; + } + } + else + { + if (isset($query['id'])) + { + $catid = $query['id']; + } + else + { + // We should have id set for this view. If we don't, it is an error + return; + } + } + + if ($menuItemGiven && isset($menuItem->query['id'])) + { + $mCatid = $menuItem->query['id']; + } + else + { + $mCatid = 0; + } + + $categories = JCategories::getInstance('Content'); + $category = $categories->get($catid); + + if (!$category) + { + // We couldn't find the category we were given. Bail. + return; + } + + $path = array_reverse($category->getPath()); + + $array = array(); + + foreach ($path as $id) + { + if ((int) $id == (int) $mCatid) + { + break; + } + + list($tmp, $id) = explode(':', $id, 2); + + $array[] = $id; + } + + $array = array_reverse($array); + + if (!$advanced && count($array)) + { + $array[0] = (int) $catid . ':' . $array[0]; + } + + $segments = array_merge($segments, $array); + + if ($view == 'article') + { + if ($advanced) + { + list($tmp, $id) = explode(':', $query['id'], 2); + } + else + { + $id = $query['id']; + } + + $segments[] = $id; + } + + unset($query['id']); + unset($query['catid']); + } + + if ($view == 'archive') + { + if (!$menuItemGiven) + { + $segments[] = $view; + unset($query['view']); + } + + if (isset($query['year'])) + { + if ($menuItemGiven) + { + $segments[] = $query['year']; + unset($query['year']); + } + } + + if (isset($query['year']) && isset($query['month'])) + { + if ($menuItemGiven) + { + $segments[] = $query['month']; + unset($query['month']); + } + } + } + + if ($view == 'featured') + { + if (!$menuItemGiven) + { + $segments[] = $view; + } + + unset($query['view']); + } + + /* + * If the layout is specified and it is the same as the layout in the menu item, we + * unset it so it doesn't go into the query string. + */ + if (isset($query['layout'])) + { + if ($menuItemGiven && isset($menuItem->query['layout'])) + { + if ($query['layout'] == $menuItem->query['layout']) + { + unset($query['layout']); + } + } + else + { + if ($query['layout'] == 'default') + { + unset($query['layout']); + } + } + } + + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = str_replace(':', '-', $segments[$i]); + } + } + + /** + * Parse the segments of a URL. + * + * @param array &$segments The segments of the URL to parse. + * @param array &$vars The URL attributes to be used by the application. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function parse(&$segments, &$vars) + { + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + } + + // Get the active menu item. + $item = $this->router->menu->getActive(); + $params = JComponentHelper::getParams('com_content'); + $advanced = $params->get('sef_advanced_link', 0); + $db = JFactory::getDbo(); + + // Count route segments + $count = count($segments); + + /* + * Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments + * the first segment is the view and the last segment is the id of the article or category. + */ + if (!isset($item)) + { + $vars['view'] = $segments[0]; + $vars['id'] = $segments[$count - 1]; + + return; + } + + /* + * If there is only one segment, then it points to either an article or a category. + * We test it first to see if it is a category. If the id and alias match a category, + * then we assume it is a category. If they don't we assume it is an article + */ + if ($count == 1) + { + // We check to see if an alias is given. If not, we assume it is an article + if (strpos($segments[0], ':') === false) + { + $vars['view'] = 'article'; + $vars['id'] = (int) $segments[0]; + + return; + } + + list($id, $alias) = explode(':', $segments[0], 2); + + // First we check if it is a category + $category = JCategories::getInstance('Content')->get($id); + + if ($category && $category->alias == $alias) + { + $vars['view'] = 'category'; + $vars['id'] = $id; + + return; + } + else + { + $query = $db->getQuery(true) + ->select($db->quoteName(array('alias', 'catid'))) + ->from($db->quoteName('#__content')) + ->where($db->quoteName('id') . ' = ' . (int) $id); + $db->setQuery($query); + $article = $db->loadObject(); + + if ($article) + { + if ($article->alias == $alias) + { + $vars['view'] = 'article'; + $vars['catid'] = (int) $article->catid; + $vars['id'] = (int) $id; + + return; + } + } + } + } + + /* + * If there was more than one segment, then we can determine where the URL points to + * because the first segment will have the target category id prepended to it. If the + * last segment has a number prepended, it is an article, otherwise, it is a category. + */ + if (!$advanced) + { + $cat_id = (int) $segments[0]; + + $article_id = (int) $segments[$count - 1]; + + if ($article_id > 0) + { + $vars['view'] = 'article'; + $vars['catid'] = $cat_id; + $vars['id'] = $article_id; + } + else + { + $vars['view'] = 'category'; + $vars['id'] = $cat_id; + } + + return; + } + + // We get the category id from the menu item and search from there + $id = $item->query['id']; + $category = JCategories::getInstance('Content')->get($id); + + if (!$category) + { + JError::raiseError(404, JText::_('COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND')); + + return; + } + + $categories = $category->getChildren(); + $vars['catid'] = $id; + $vars['id'] = $id; + $found = 0; + + foreach ($segments as $segment) + { + $segment = str_replace(':', '-', $segment); + + foreach ($categories as $category) + { + if ($category->alias == $segment) + { + $vars['id'] = $category->id; + $vars['catid'] = $category->id; + $vars['view'] = 'category'; + $categories = $category->getChildren(); + $found = 1; + break; + } + } + + if ($found == 0) + { + if ($advanced) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from('#__content') + ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) + ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); + $db->setQuery($query); + $cid = $db->loadResult(); + } + else + { + $cid = $segment; + } + + $vars['id'] = $cid; + + if ($item->query['view'] == 'archive' && $count != 1) + { + $vars['year'] = $count >= 2 ? $segments[$count - 2] : null; + $vars['month'] = $segments[$count - 1]; + $vars['view'] = 'archive'; + } + else + { + $vars['view'] = 'article'; + } + } + + $found = 0; + } + } +} diff --git a/components/com_content/helpers/query.php b/components/com_content/helpers/query.php index bcb789bc03142..e7f11a50a5354 100644 --- a/components/com_content/helpers/query.php +++ b/components/com_content/helpers/query.php @@ -109,6 +109,38 @@ public static function orderbySecondary($orderby, $orderDate = 'created') $orderby = JFactory::getDbo()->getQuery(true)->Rand(); break; + case 'vote' : + $orderby = 'a.id DESC '; + if (JPluginHelper::isEnabled('content', 'vote')) + { + $orderby = 'rating_count DESC '; + } + break; + + case 'rvote' : + $orderby = 'a.id ASC '; + if (JPluginHelper::isEnabled('content', 'vote')) + { + $orderby = 'rating_count ASC '; + } + break; + + case 'rank' : + $orderby = 'a.id DESC '; + if (JPluginHelper::isEnabled('content', 'vote')) + { + $orderby = 'rating DESC '; + } + break; + + case 'rrank' : + $orderby = 'a.id ASC '; + if (JPluginHelper::isEnabled('content', 'vote')) + { + $orderby = 'rating ASC '; + } + break; + default : $orderby = 'a.ordering'; break; diff --git a/components/com_content/helpers/route.php b/components/com_content/helpers/route.php index 5dece4143a292..835aa243d358e 100644 --- a/components/com_content/helpers/route.php +++ b/components/com_content/helpers/route.php @@ -16,8 +16,6 @@ */ abstract class ContentHelperRoute { - protected static $lookup = array(); - /** * Get the article route. * @@ -31,35 +29,17 @@ abstract class ContentHelperRoute */ public static function getArticleRoute($id, $catid = 0, $language = 0) { - $needles = array( - 'article' => array((int) $id) - ); - // Create the link $link = 'index.php?option=com_content&view=article&id=' . $id; if ((int) $catid > 1) { - $categories = JCategories::getInstance('Content'); - $category = $categories->get((int) $catid); - - if ($category) - { - $needles['category'] = array_reverse($category->getPath()); - $needles['categories'] = $needles['category']; - $link .= '&catid=' . $catid; - } + $link .= '&catid=' . $catid; } if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } return $link; @@ -79,36 +59,24 @@ public static function getCategoryRoute($catid, $language = 0) { if ($catid instanceof JCategoryNode) { - $id = $catid->id; - $category = $catid; + $id = $catid->id; } else { - $id = (int) $catid; - $category = JCategories::getInstance('Content')->get($id); + $id = (int) $catid; } - if ($id < 1 || !($category instanceof JCategoryNode)) + if ($id < 1) { $link = ''; } else { - $needles = array(); - $link = 'index.php?option=com_content&view=category&id=' . $id; - $catids = array_reverse($category->getPath()); - $needles['category'] = $catids; - $needles['categories'] = $catids; + $link = 'index.php?option=com_content&view=category&id=' . $id; if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } } @@ -126,109 +94,6 @@ public static function getCategoryRoute($catid, $language = 0) */ public static function getFormRoute($id) { - // Create the link - if ($id) - { - $link = 'index.php?option=com_content&task=article.edit&a_id=' . $id; - } - else - { - $link = 'index.php?option=com_content&task=article.edit&a_id=0'; - } - - return $link; - } - - /** - * Find an item ID. - * - * @param array $needles An array of language codes. - * - * @return mixed The ID found or null otherwise. - * - * @since 1.5 - */ - protected static function _findItem($needles = null) - { - $app = JFactory::getApplication(); - $menus = $app->getMenu('site'); - $language = isset($needles['language']) ? $needles['language'] : '*'; - - // Prepare the reverse lookup array. - if (!isset(self::$lookup[$language])) - { - self::$lookup[$language] = array(); - - $component = JComponentHelper::getComponent('com_content'); - - $attributes = array('component_id'); - $values = array($component->id); - - if ($language != '*') - { - $attributes[] = 'language'; - $values[] = array($needles['language'], '*'); - } - - $items = $menus->getItems($attributes, $values); - - foreach ($items as $item) - { - if (isset($item->query) && isset($item->query['view'])) - { - $view = $item->query['view']; - - if (!isset(self::$lookup[$language][$view])) - { - self::$lookup[$language][$view] = array(); - } - - if (isset($item->query['id'])) - { - /** - * Here it will become a bit tricky - * language != * can override existing entries - * language == * cannot override existing entries - */ - if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') - { - self::$lookup[$language][$view][$item->query['id']] = $item->id; - } - } - } - } - } - - if ($needles) - { - foreach ($needles as $view => $ids) - { - if (isset(self::$lookup[$language][$view])) - { - foreach ($ids as $id) - { - if (isset(self::$lookup[$language][$view][(int) $id])) - { - return self::$lookup[$language][$view][(int) $id]; - } - } - } - } - } - - // Check if the active menuitem matches the requested language - $active = $menus->getActive(); - - if ($active - && $active->component == 'com_content' - && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) - { - return $active->id; - } - - // If not found, return language specific home link - $default = $menus->getDefault($language); - - return !empty($default->id) ? $default->id : null; + return 'index.php?option=com_content&task=article.edit&a_id=' . (int) $id; } } diff --git a/components/com_content/layouts/field/prepare/modal_article.php b/components/com_content/layouts/field/prepare/modal_article.php new file mode 100644 index 0000000000000..f8e22cfea0a56 --- /dev/null +++ b/components/com_content/layouts/field/prepare/modal_article.php @@ -0,0 +1,47 @@ +value; + +if (!$value) +{ + return; +} + +JLoader::import('joomla.application.component.model'); +JModelLegacy::addIncludePath(JPATH_BASE . '/components/com_content/models', 'ContentModel'); +$model = JModelLegacy::getInstance('Article', 'ContentModel'); + +// If the article is not found an error is thrown we need to hold the +// old error handler +$errorHandler = JError::getErrorHandling(E_ERROR); + +// Ignoring all errors +JError::setErrorHandling(E_ERROR, 'ignore'); + +// Fetching the article +$article = $model->getItem($value); + +// Restoreing the old error handler +JError::setErrorHandling(E_ERROR, $errorHandler['mode'], $errorHandler['options']); + +if ($article instanceof JException) +{ + return; +} + +echo htmlentities($article->title); diff --git a/components/com_content/metadata.xml b/components/com_content/metadata.xml deleted file mode 100644 index 487e89d868c73..0000000000000 --- a/components/com_content/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/components/com_content/models/archive.php b/components/com_content/models/archive.php index 09bbcbb762c93..78c00a52e81b2 100644 --- a/components/com_content/models/archive.php +++ b/components/com_content/models/archive.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); /** * Content Component Archive Model @@ -60,6 +60,16 @@ protected function populateState($ordering = null, $direction = null) $itemid = $app->input->get('Itemid', 0, 'int'); $limit = $app->getUserStateFromRequest('com_content.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); $this->setState('list.limit', $limit); + + // Set the archive ordering + $articleOrderby = $params->get('orderby_sec', 'rdate'); + $articleOrderDate = $params->get('order_date'); + + // No category ordering + $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); + + $this->setState('list.ordering', $secondary . ', a.created DESC'); + $this->setState('list.direction', ''); } /** @@ -71,20 +81,9 @@ protected function populateState($ordering = null, $direction = null) */ protected function getListQuery() { - // Set the archive ordering $params = $this->state->params; - $articleOrderby = $params->get('orderby_sec', 'rdate'); $articleOrderDate = $params->get('order_date'); - // No category ordering - $categoryOrderby = ''; - $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', '; - $primary = ContentHelperQuery::orderbyPrimary($categoryOrderby); - - $orderby = $primary . ' ' . $secondary . ' a.created DESC '; - $this->setState('list.ordering', $orderby); - $this->setState('list.direction', ''); - // Create a new query object. $query = parent::getListQuery(); diff --git a/components/com_content/models/article.php b/components/com_content/models/article.php index a59567a5379aa..e944c87ab59e8 100644 --- a/components/com_content/models/article.php +++ b/components/com_content/models/article.php @@ -66,7 +66,7 @@ protected function populateState() * * @param integer $pk The id of the article. * - * @return mixed Menu item data object on success, false on failure. + * @return object|boolean|JException Menu item data object on success, boolean false or JException instance on error */ public function getItem($pk = null) { @@ -170,15 +170,12 @@ public function getItem($pk = null) } // Convert parameter fields to objects. - $registry = new Registry; - $registry->loadString($data->attribs); + $registry = new Registry($data->attribs); $data->params = clone $this->getState('params'); $data->params->merge($registry); - $registry = new Registry; - $registry->loadString($data->metadata); - $data->metadata = $registry; + $data->metadata = new Registry($data->metadata); // Technically guest could edit an article, but lets not check that to improve performance a little. if (!$user->get('guest')) diff --git a/components/com_content/models/articles.php b/components/com_content/models/articles.php index beaf681d3ec26..1b9652b00323d 100644 --- a/components/com_content/models/articles.php +++ b/components/com_content/models/articles.php @@ -10,6 +10,8 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; /** * This models supports retrieving lists of articles. @@ -232,7 +234,7 @@ protected function getListQuery() $query->where('a.featured = 1'); } } - elseif ($orderby_sec == 'front') + elseif ($orderby_sec == 'front' || $this->getState('list.ordering') == 'fp.ordering') { $query->join('LEFT', '#__content_frontpage AS fp ON fp.content_id = a.id'); } @@ -252,9 +254,13 @@ protected function getListQuery() $query->select('parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias') ->join('LEFT', '#__categories as parent ON parent.id = c.parent_id'); - // Join on voting table - $query->select('ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count') - ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); + if (JPluginHelper::isEnabled('content', 'vote')) + { + // Join on voting table + $query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, + COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count') + ->join('LEFT', '#__content_rating AS v ON a.id = v.content_id'); + } // Join to check for category published state in parent categories up the tree $query->select('c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published'); @@ -301,7 +307,7 @@ protected function getListQuery() } elseif (is_array($published)) { - JArrayHelper::toInteger($published); + $published = ArrayHelper::toInteger($published); $published = implode(',', $published); // Use article state if badcats.id is null, otherwise, force 0 for unpublished @@ -338,7 +344,7 @@ protected function getListQuery() } elseif (is_array($articleId)) { - JArrayHelper::toInteger($articleId); + $articleId = ArrayHelper::toInteger($articleId); $articleId = implode(',', $articleId); $type = $this->getState('filter.article_id.include', true) ? 'IN' : 'NOT IN'; $query->where('a.id ' . $type . ' (' . $articleId . ')'); @@ -381,7 +387,7 @@ protected function getListQuery() } elseif (is_array($categoryId) && (count($categoryId) > 0)) { - JArrayHelper::toInteger($categoryId); + $categoryId = ArrayHelper::toInteger($categoryId); $categoryId = implode(',', $categoryId); if (!empty($categoryId)) @@ -402,7 +408,7 @@ protected function getListQuery() } elseif (is_array($authorId)) { - JArrayHelper::toInteger($authorId); + $authorId = ArrayHelper::toInteger($authorId); $authorId = implode(',', $authorId); if ($authorId) @@ -427,8 +433,6 @@ protected function getListQuery() if (!empty($first)) { - JArrayHelper::toString($authorAlias); - foreach ($authorAlias as $key => $alias) { $authorAlias[$key] = $db->quote($alias); @@ -502,7 +506,7 @@ protected function getListQuery() if ((is_object($params)) && ($params->get('filter_field') != 'hide') && ($filter = $this->getState('list.filter'))) { // Clean filter variable - $filter = JString::strtolower($filter); + $filter = StringHelper::strtolower($filter); $hitsFilter = (int) $filter; $filter = $db->quote('%' . $db->escape($filter, true) . '%', false); @@ -576,8 +580,7 @@ public function getItems() // Convert the parameter fields into objects. foreach ($items as &$item) { - $articleParams = new Registry; - $articleParams->loadString($item->attribs); + $articleParams = new Registry($item->attribs); // Unpack readmore and layout params $item->alternative_readmore = $articleParams->get('alternative_readmore'); @@ -616,8 +619,7 @@ public function getItems() // Merge the selected article params if (count($articleArray) > 0) { - $articleParams = new Registry; - $articleParams->loadArray($articleArray); + $articleParams = new Registry($articleArray); $item->params->merge($articleParams); } } @@ -693,6 +695,11 @@ public function getItems() $item->tags = new JHelperTags; $item->tags->getItemTags('com_content.article', $item->id); } + + if ($item->params->get('show_associations')) + { + $item->associations = ContentHelperAssociation::displayAssociations($item->id); + } } return $items; diff --git a/components/com_content/models/category.php b/components/com_content/models/category.php index f92f90400efa2..20d1204f81d04 100644 --- a/components/com_content/models/category.php +++ b/components/com_content/models/category.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; /** * This models supports retrieving a category, the articles associated with the category, @@ -343,6 +344,7 @@ public function getCategory() $params = $this->state->params; $options = array(); $options['countItems'] = $params->get('show_cat_num_articles', 1) || !$params->get('show_empty_categories_cat', 0); + $options['access'] = $params->get('check_access_rights', 1); } else { @@ -458,8 +460,7 @@ public function &getChildren() if ($params->get('orderby_pri') == 'alpha' || $params->get('orderby_pri') == 'ralpha') { - jimport('joomla.utilities.arrayhelper'); - JArrayHelper::sortObjects($this->_children, 'title', ($params->get('orderby_pri') == 'alpha') ? 1 : (-1)); + $this->_children = ArrayHelper::sortObjects($this->_children, 'title', ($params->get('orderby_pri') == 'alpha') ? 1 : (-1)); } } diff --git a/components/com_content/models/featured.php b/components/com_content/models/featured.php index b72824598bc68..e8381e887bdaf 100644 --- a/components/com_content/models/featured.php +++ b/components/com_content/models/featured.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once __DIR__ . '/articles.php'; +JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); /** * Frontpage Component Model @@ -71,6 +71,16 @@ protected function populateState($ordering = null, $direction = null) $featuredCategories = $params->get('featured_categories'); $this->setState('filter.frontpage.categories', $featuredCategories); } + + $articleOrderby = $params->get('orderby_sec', 'rdate'); + $articleOrderDate = $params->get('order_date'); + $categoryOrderby = $params->def('orderby_pri', ''); + + $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); + $primary = ContentHelperQuery::orderbyPrimary($categoryOrderby); + + $this->setState('list.ordering', $primary . $secondary . ', a.created DESC'); + $this->setState('list.direction', ''); } /** @@ -119,18 +129,6 @@ protected function getStoreId($id = '') */ protected function getListQuery() { - // Set the blog ordering - $params = $this->state->params; - $articleOrderby = $params->get('orderby_sec', 'rdate'); - $articleOrderDate = $params->get('order_date'); - $categoryOrderby = $params->def('orderby_pri', ''); - $secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', '; - $primary = ContentHelperQuery::orderbyPrimary($categoryOrderby); - - $orderby = $primary . ' ' . $secondary . ' a.created DESC '; - $this->setState('list.ordering', $orderby); - $this->setState('list.direction', ''); - // Create a new query object. $query = parent::getListQuery(); diff --git a/components/com_content/models/form.php b/components/com_content/models/form.php index e8a653057a8ed..f8301e312381d 100644 --- a/components/com_content/models/form.php +++ b/components/com_content/models/form.php @@ -10,9 +10,10 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\Utilities\ArrayHelper; // Base this model on the backend version. -require_once JPATH_ADMINISTRATOR . '/components/com_content/models/article.php'; +JLoader::register('ContentModelArticle', JPATH_ADMINISTRATOR . '/components/com_content/models/article.php'); /** * Content Component Article Model @@ -83,11 +84,10 @@ public function getItem($itemId = null) } $properties = $table->getProperties(1); - $value = JArrayHelper::toObject($properties, 'JObject'); + $value = ArrayHelper::toObject($properties, 'JObject'); // Convert attrib field to Registry. - $value->params = new Registry; - $value->params->loadString($value->attribs); + $value->params = new Registry($value->attribs); // Compute selected asset permissions. $user = JFactory::getUser(); @@ -140,8 +140,7 @@ public function getItem($itemId = null) } // Convert the metadata field to an array. - $registry = new Registry; - $registry->loadString($value->metadata); + $registry = new Registry($value->metadata); $value->metadata = $registry->toArray(); if ($itemId) diff --git a/components/com_content/models/forms/article.xml b/components/com_content/models/forms/article.xml index 3708ed76454e5..e1a522d6a6127 100644 --- a/components/com_content/models/forms/article.xml +++ b/components/com_content/models/forms/article.xml @@ -203,6 +203,15 @@ description="JFIELD_ACCESS_DESC" class="inputbox" size="1" /> + +
    diff --git a/components/com_content/router.php b/components/com_content/router.php index f180678ccb72c..3abd5d0266ac9 100644 --- a/components/com_content/router.php +++ b/components/com_content/router.php @@ -3,468 +3,215 @@ * @package Joomla.Site * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** - * Routing class from com_content + * Routing class of com_content * * @since 3.3 */ -class ContentRouter extends JComponentRouterBase +class ContentRouter extends JComponentRouterView { + protected $noIDs = false; + /** - * Build the route for the com_content component - * - * @param array &$query An array of URL arguments + * Content Component router constructor * - * @return array The URL arguments to use to assemble the subsequent URL. - * - * @since 3.3 + * @param JApplicationCms $app The application object + * @param JMenu $menu The menu object to work with */ - public function build(&$query) + public function __construct($app = null, $menu = null) { - $segments = array(); - - // Get a menu item based on Itemid or currently active $params = JComponentHelper::getParams('com_content'); - $advanced = $params->get('sef_advanced_link', 0); - - // Unset limitstart=0 since it's pointless - if (isset($query['limitstart']) && $query['limitstart'] == 0) - { - unset($query['limitstart']); - } - - // We need a menu item. Either the one specified in the query, or the current active one if none specified - if (empty($query['Itemid'])) - { - $menuItem = $this->menu->getActive(); - $menuItemGiven = false; - } - else - { - $menuItem = $this->menu->getItem($query['Itemid']); - $menuItemGiven = true; - } + $this->noIDs = (bool) $params->get('sef_ids'); + $categories = new JComponentRouterViewconfiguration('categories'); + $categories->setKey('id'); + $this->registerView($categories); + $category = new JComponentRouterViewconfiguration('category'); + $category->setKey('id')->setParent($categories, 'catid')->setNestable()->addLayout('blog'); + $this->registerView($category); + $article = new JComponentRouterViewconfiguration('article'); + $article->setKey('id')->setParent($category, 'catid'); + $this->registerView($article); + $this->registerView(new JComponentRouterViewconfiguration('archive')); + $this->registerView(new JComponentRouterViewconfiguration('featured')); + $this->registerView(new JComponentRouterViewconfiguration('form')); + + parent::__construct($app, $menu); + + $this->attachRule(new JComponentRouterRulesMenu($this)); - // Check again - if ($menuItemGiven && isset($menuItem) && $menuItem->component != 'com_content') - { - $menuItemGiven = false; - unset($query['Itemid']); - } + $params = JComponentHelper::getParams('com_content'); - if (isset($query['view'])) + if ($params->get('sef_advanced', 0)) { - $view = $query['view']; + $this->attachRule(new JComponentRouterRulesStandard($this)); + $this->attachRule(new JComponentRouterRulesNomenu($this)); } else { - // We need to have a view in the query or it is an invalid URL - return $segments; + JLoader::register('ContentRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php'); + $this->attachRule(new ContentRouterRulesLegacy($this)); } + } - // Are we dealing with an article or category that is attached to a menu item? - if (($menuItem instanceof stdClass) - && $menuItem->query['view'] == $query['view'] - && isset($query['id']) - && $menuItem->query['id'] == (int) $query['id']) - { - unset($query['view']); - - if (isset($query['catid'])) - { - unset($query['catid']); - } - - if (isset($query['layout'])) - { - unset($query['layout']); - } - - unset($query['id']); - - return $segments; - } + /** + * Method to get the segment(s) for a category + * + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getCategorySegment($id, $query) + { + $category = JCategories::getInstance($this->getName())->get($id); - if ($view == 'category' || $view == 'article') + if ($category) { - if (!$menuItemGiven) + if ($this->noIDs) { - $segments[] = $view; - } - - unset($query['view']); - - if ($view == 'article') - { - if (isset($query['id']) && isset($query['catid']) && $query['catid']) - { - $catid = $query['catid']; - - // Make sure we have the id and the alias - if (strpos($query['id'], ':') === false) - { - $db = JFactory::getDbo(); - $dbQuery = $db->getQuery(true) - ->select('alias') - ->from('#__content') - ->where('id=' . (int) $query['id']); - $db->setQuery($dbQuery); - $alias = $db->loadResult(); - $query['id'] = $query['id'] . ':' . $alias; - } - } - else - { - // We should have these two set for this view. If we don't, it is an error - return $segments; - } - } - else - { - if (isset($query['id'])) - { - $catid = $query['id']; - } - else + $path = array_reverse($category->getPath(), true); + foreach ($path as &$segment) { - // We should have id set for this view. If we don't, it is an error - return $segments; + list($id, $segment) = explode(':', $segment, 2); } - } - if ($menuItemGiven && isset($menuItem->query['id'])) - { - $mCatid = $menuItem->query['id']; + return $path; } else { - $mCatid = 0; + return array_reverse($category->getPath(), true); } - - $categories = JCategories::getInstance('Content'); - $category = $categories->get($catid); - - if (!$category) - { - // We couldn't find the category we were given. Bail. - return $segments; - } - - $path = array_reverse($category->getPath()); - - $array = array(); - - foreach ($path as $id) - { - if ((int) $id == (int) $mCatid) - { - break; - } - - list($tmp, $id) = explode(':', $id, 2); - - $array[] = $id; - } - - $array = array_reverse($array); - - if (!$advanced && count($array)) - { - $array[0] = (int) $catid . ':' . $array[0]; - } - - $segments = array_merge($segments, $array); - - if ($view == 'article') - { - if ($advanced) - { - list($tmp, $id) = explode(':', $query['id'], 2); - } - else - { - $id = $query['id']; - } - - $segments[] = $id; - } - - unset($query['id']); - unset($query['catid']); } - if ($view == 'archive') - { - if (!$menuItemGiven || $menuItem->query['view'] != 'archive') - { - // Did not work without removing Itemid - if (isset($menuItem)) - { - unset($query['Itemid']); - } - - $segments[] = $view; - } - - unset($query['view']); - - if (isset($query['year'])) - { - $segments[] = $query['year']; - unset($query['year']); - } + return array(); + } - if (isset($query['month'])) - { - $segments[] = $query['month']; - unset($query['month']); - } - } + /** + * Method to get the segment(s) for a category + * + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getCategoriesSegment($id, $query) + { + return $this->getCategorySegment($id, $query); + } - if ($view == 'featured') + /** + * Method to get the segment(s) for an article + * + * @param string $id ID of the article to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getArticleSegment($id, $query) + { + if ($this->noIDs) { - if (!$menuItemGiven) + if (strpos($id, ':')) { - $segments[] = $view; - } + list($void, $segment) = explode(':', $id, 2); - unset($query['view']); - } - - /* - * If the layout is specified and it is the same as the layout in the menu item, we - * unset it so it doesn't go into the query string. - */ - if (isset($query['layout'])) - { - if ($menuItemGiven && isset($menuItem->query['layout'])) - { - if ($query['layout'] == $menuItem->query['layout']) - { - unset($query['layout']); - } + return array($void => $segment); } else { - if ($query['layout'] == 'default') - { - unset($query['layout']); - } + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('alias')) + ->from($dbquery->qn('#__content')) + ->where('id = ' . $dbquery->q($id)); + $db->setQuery($dbquery); + + return array($id => $id . ':' . $db->loadResult()); } } - $total = count($segments); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = str_replace(':', '-', $segments[$i]); - } - - return $segments; + return array((int) $id => $id); } /** - * Parse the segments of a URL. + * Method to get the id for a category * - * @param array &$segments The segments of the URL to parse. + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now * - * @return array The URL attributes to be used by the application. - * - * @since 3.3 + * @return mixed The id of this item or false */ - public function parse(&$segments) + public function getCategoryId($segment, $query) { - $total = count($segments); - $vars = array(); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); - } - - // Get the active menu item. - $item = $this->menu->getActive(); - $params = JComponentHelper::getParams('com_content'); - $advanced = $params->get('sef_advanced_link', 0); - $db = JFactory::getDbo(); - - // Count route segments - $count = count($segments); - - /* - * Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments - * the first segment is the view and the last segment is the id of the article or category. - */ - if (!isset($item)) + if (isset($query['id'])) { - $vars['view'] = $segments[0]; + $category = JCategories::getInstance($this->getName())->get($query['id']); - // Called if no menu item created - if ($vars['view'] == 'archive') - { - $vars['year'] = $count >= 2 ? $segments[$count - 2] : null; - $vars['month'] = $segments[$count - 1]; - } - else - { - $vars['id'] = $segments[$count - 1]; - } - - return $vars; - } - - // First handle archive view - if ($item->query['view'] == 'archive') - { - $vars['year'] = $count >= 2 ? $segments[$count - 2] : null; - $vars['month'] = $segments[$count - 1]; - $vars['view'] = 'archive'; - - return $vars; - } - - /* - * If there is only one segment, then it points to either an article or a category. - * We test it first to see if it is a category. If the id and alias match a category, - * then we assume it is a category. If they don't we assume it is an article - */ - if ($count == 1) - { - // We check to see if an alias is given. If not, we assume it is an article - if (strpos($segments[0], ':') === false) - { - $vars['view'] = 'article'; - $vars['id'] = (int) $segments[0]; - - return $vars; - } - - list($id, $alias) = explode(':', $segments[0], 2); - - // First we check if it is a category - $category = JCategories::getInstance('Content')->get($id); - - if ($category && $category->alias == $alias) - { - $vars['view'] = 'category'; - $vars['id'] = $id; - - return $vars; - } - else + foreach ($category->getChildren() as $child) { - $query = $db->getQuery(true) - ->select($db->quoteName(array('alias', 'catid'))) - ->from($db->quoteName('#__content')) - ->where($db->quoteName('id') . ' = ' . (int) $id); - $db->setQuery($query); - $article = $db->loadObject(); - - if ($article) + if ($this->noIDs) { - if ($article->alias == $alias) + if ($child->alias == $segment) { - $vars['view'] = 'article'; - $vars['catid'] = (int) $article->catid; - $vars['id'] = (int) $id; - - return $vars; + return $child->id; } } - } - } - - /* - * If there was more than one segment, then we can determine where the URL points to - * because the first segment will have the target category id prepended to it. If the - * last segment has a number prepended, it is an article, otherwise, it is a category. - */ - if (!$advanced) - { - $cat_id = (int) $segments[0]; - - $article_id = (int) $segments[$count - 1]; - - if ($article_id > 0) - { - $vars['view'] = 'article'; - $vars['catid'] = $cat_id; - $vars['id'] = $article_id; - } - else - { - $vars['view'] = 'category'; - $vars['id'] = $cat_id; - } - - return $vars; - } - - // We get the category id from the menu item and search from there - $id = $item->query['id']; - $category = JCategories::getInstance('Content')->get($id); - - if (!$category) - { - JError::raiseError(404, JText::_('COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND')); - - return $vars; - } - - $categories = $category->getChildren(); - $vars['catid'] = $id; - $vars['id'] = $id; - $found = 0; - - foreach ($segments as $segment) - { - $segment = str_replace(':', '-', $segment); - - foreach ($categories as $category) - { - if ($category->alias == $segment) + else { - $vars['id'] = $category->id; - $vars['catid'] = $category->id; - $vars['view'] = 'category'; - $categories = $category->getChildren(); - $found = 1; - break; + if ($child->id == (int) $segment) + { + return $child->id; + } } } + } - if ($found == 0) - { - if ($advanced) - { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from('#__content') - ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) - ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); - $db->setQuery($query); - $cid = $db->loadResult(); - } - else - { - $cid = $segment; - } + return false; + } - $vars['id'] = $cid; - $vars['view'] = 'article'; - } + /** + * Method to get the segment(s) for a category + * + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getCategoriesId($segment, $query) + { + return $this->getCategoryId($segment, $query); + } - $found = 0; + /** + * Method to get the segment(s) for an article + * + * @param string $segment Segment of the article to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getArticleId($segment, $query) + { + if ($this->noIDs) + { + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('id')) + ->from($dbquery->qn('#__content')) + ->where('alias = ' . $dbquery->q($segment)) + ->where('catid = ' . $dbquery->q($query['id'])); + $db->setQuery($dbquery); + + return (int) $db->loadResult(); } - return $vars; + return (int) $segment; } } @@ -482,7 +229,8 @@ public function parse(&$segments) */ function contentBuildRoute(&$query) { - $router = new ContentRouter; + $app = JFactory::getApplication(); + $router = new ContentRouter($app, $app->getMenu()); return $router->build($query); } @@ -502,7 +250,8 @@ function contentBuildRoute(&$query) */ function contentParseRoute($segments) { - $router = new ContentRouter; + $app = JFactory::getApplication(); + $router = new ContentRouter($app, $app->getMenu()); return $router->parse($segments); } diff --git a/components/com_content/views/archive/metadata.xml b/components/com_content/views/archive/metadata.xml deleted file mode 100644 index ada38453e32f9..0000000000000 --- a/components/com_content/views/archive/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_content/views/archive/tmpl/default.xml b/components/com_content/views/archive/tmpl/default.xml index ad05ab6e58b94..a7be50a835d73 100644 --- a/components/com_content/views/archive/tmpl/default.xml +++ b/components/com_content/views/archive/tmpl/default.xml @@ -20,7 +20,7 @@ default="alpha" description="JGLOBAL_ARTICLE_ORDER_DESC" label="JGLOBAL_ARTICLE_ORDER_LABEL" - > + > @@ -30,6 +30,10 @@ + + + + - + useglobal="true" + > @@ -84,8 +88,8 @@ - + useglobal="true" + > @@ -95,19 +99,31 @@ type="list" default="" label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL" - description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"> - + description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC" + useglobal="true" + > + + + + + - + useglobal="true" + > @@ -115,8 +131,8 @@ - + useglobal="true" + > @@ -125,8 +141,9 @@ name="show_parent_category" type="list" label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" - description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"> - + description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" + useglobal="true" + > @@ -135,8 +152,9 @@ name="link_parent_category" type="list" label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" - description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"> - + description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" + useglobal="true" + > @@ -144,8 +162,8 @@ - + useglobal="true" + > @@ -153,19 +171,19 @@ - + useglobal="true" + > - + name="link_author" + type="list" + label="JGLOBAL_LINK_AUTHOR_LABEL" + description="JGLOBAL_LINK_AUTHOR_DESC" + useglobal="true" + > @@ -173,8 +191,8 @@ - + useglobal="true" + > @@ -182,8 +200,8 @@ - + useglobal="true" + > @@ -191,8 +209,8 @@ - + useglobal="true" + > @@ -201,8 +219,8 @@ - + useglobal="true" + > @@ -210,8 +228,8 @@ - + useglobal="true" + > diff --git a/components/com_content/views/archive/tmpl/default_items.php b/components/com_content/views/archive/tmpl/default_items.php index 3b901f91097ec..5ffaaedddd253 100644 --- a/components/com_content/views/archive/tmpl/default_items.php +++ b/components/com_content/views/archive/tmpl/default_items.php @@ -18,7 +18,7 @@ params->get('info_block_position', 0); ?>
    escape($item->title); ?> params->get('show_cat_num_articles_cat') == 1) :?> - + +   numitems; ?> diff --git a/components/com_content/views/category/metadata.xml b/components/com_content/views/category/metadata.xml deleted file mode 100644 index 32fe404c76f44..0000000000000 --- a/components/com_content/views/category/metadata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_content/views/category/tmpl/blog.xml b/components/com_content/views/category/tmpl/blog.xml index 76f7484f8541e..23593e16dc064 100644 --- a/components/com_content/views/category/tmpl/blog.xml +++ b/components/com_content/views/category/tmpl/blog.xml @@ -9,14 +9,20 @@ -
    +
    @@ -35,8 +41,8 @@ type="list" label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL" description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC" - > - + useglobal="true" + > @@ -46,8 +52,8 @@ type="list" label="JGLOBAL_SHOW_CATEGORY_TITLE" description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC" - > - + useglobal="true" + > @@ -57,8 +63,8 @@ type="list" description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC" label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL" - > - + useglobal="true" + > @@ -68,8 +74,8 @@ type="list" description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC" label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL" - > - + useglobal="true" + > @@ -79,8 +85,8 @@ type="list" description="JGLOBAL_MAXLEVEL_DESC" label="JGLOBAL_MAXLEVEL_LABEL" - > - + useglobal="true" + > @@ -95,8 +101,8 @@ type="list" label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL" description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC" - > - + useglobal="true" + > @@ -106,8 +112,8 @@ type="list" label="COM_CONTENT_NO_ARTICLES_LABEL" description="COM_CONTENT_NO_ARTICLES_DESC" - > - + useglobal="true" + > @@ -117,8 +123,8 @@ type="list" label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL" description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC" - > - + useglobal="true" + > @@ -128,8 +134,8 @@ type="list" label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL" description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC" - > - + useglobal="true" + > @@ -138,8 +144,8 @@ type="list" label="COM_CONTENT_FIELD_SHOW_CAT_TAGS_LABEL" description="COM_CONTENT_FIELD_SHOW_CAT_TAGS_DESC" - > - + useglobal="true" + > @@ -166,6 +172,7 @@ type="text" description="JGLOBAL_NUM_LEADING_ARTICLES_DESC" label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL" + useglobal="true" size="3" /> @@ -174,6 +181,7 @@ type="text" description="JGLOBAL_NUM_INTRO_ARTICLES_DESC" label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL" + useglobal="true" size="3" /> @@ -182,6 +190,7 @@ type="text" description="JGLOBAL_NUM_COLUMNS_DESC" label="JGLOBAL_NUM_COLUMNS_LABEL" + useglobal="true" size="3" /> @@ -190,6 +199,7 @@ type="text" description="JGLOBAL_NUM_LINKS_DESC" label="JGLOBAL_NUM_LINKS_LABEL" + useglobal="true" size="3" /> @@ -198,26 +208,19 @@ type="list" description="JGLOBAL_MULTI_COLUMN_ORDER_DESC" label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL" - > - + useglobal="true" + > - - - + useglobal="true" + > @@ -238,8 +241,8 @@ type="list" description="JGLOBAL_CATEGORY_ORDER_DESC" label="JGLOBAL_CATEGORY_ORDER_LABEL" - > - + useglobal="true" + > @@ -251,8 +254,8 @@ type="list" description="JGLOBAL_ARTICLE_ORDER_DESC" label="JGLOBAL_ARTICLE_ORDER_LABEL" - > - + useglobal="true" + > @@ -264,6 +267,10 @@ + + + + - + useglobal="true" + > @@ -283,8 +290,8 @@ type="list" description="JGLOBAL_PAGINATION_DESC" label="JGLOBAL_PAGINATION_LABEL" - > - + useglobal="true" + > @@ -295,8 +302,8 @@ type="list" label="JGLOBAL_PAGINATION_RESULTS_LABEL" description="JGLOBAL_PAGINATION_RESULTS_DESC" - > - + useglobal="true" + > @@ -307,8 +314,8 @@ default="" label="JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL" description="JGLOBAL_SHOW_FEATURED_ARTICLES_DESC" - > - + useglobal="true" + > @@ -321,8 +328,8 @@ type="list" description="JGLOBAL_SHOW_TITLE_DESC" label="JGLOBAL_SHOW_TITLE_LABEL" - > - + useglobal="true" + > @@ -333,8 +340,8 @@ type="list" description="JGLOBAL_LINKED_TITLES_DESC" label="JGLOBAL_LINKED_TITLES_LABEL" - > - + useglobal="true" + > @@ -345,8 +352,8 @@ type="list" description="JGLOBAL_SHOW_INTRO_DESC" label="JGLOBAL_SHOW_INTRO_LABEL" - > - + useglobal="true" + > @@ -357,21 +364,34 @@ type="list" default="" label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL" - description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"> - + description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC" + useglobal="true" + > + + + + + + - + useglobal="true" + > @@ -382,8 +402,8 @@ type="list" description="JGLOBAL_LINK_CATEGORY_DESC" label="JGLOBAL_LINK_CATEGORY_LABEL" - > - + useglobal="true" + > @@ -394,8 +414,8 @@ type="list" description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" - > - + useglobal="true" + > @@ -406,20 +426,32 @@ type="list" description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" - > - + useglobal="true" + > + + + + + + - + useglobal="true" + > @@ -430,11 +462,11 @@ type="list" description="JGLOBAL_LINK_AUTHOR_DESC" label="JGLOBAL_LINK_AUTHOR_LABEL" - > - + useglobal="true" + > - - + + - + useglobal="true" + > @@ -454,8 +486,8 @@ type="list" description="JGLOBAL_SHOW_MODIFY_DATE_DESC" label="JGLOBAL_SHOW_MODIFY_DATE_LABEL" - > - + useglobal="true" + > @@ -466,8 +498,8 @@ type="list" description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL" - > - + useglobal="true" + > @@ -478,8 +510,8 @@ type="list" description="JGLOBAL_SHOW_NAVIGATION_DESC" label="JGLOBAL_SHOW_NAVIGATION_LABEL" - > - + useglobal="true" + > @@ -490,8 +522,8 @@ type="list" label="JGLOBAL_SHOW_VOTE_LABEL" description="JGLOBAL_SHOW_VOTE_DESC" - > - + useglobal="true" + > @@ -502,8 +534,8 @@ type="list" description="JGLOBAL_SHOW_READMORE_DESC" label="JGLOBAL_SHOW_READMORE_LABEL" - > - + useglobal="true" + > @@ -513,8 +545,8 @@ type="list" label="JGLOBAL_SHOW_READMORE_TITLE_LABEL" description="JGLOBAL_SHOW_READMORE_TITLE_DESC" - > - + useglobal="true" + > @@ -524,8 +556,8 @@ type="list" description="JGLOBAL_SHOW_ICONS_DESC" label="JGLOBAL_SHOW_ICONS_LABEL" - > - + useglobal="true" + > @@ -536,8 +568,8 @@ type="list" description="JGLOBAL_SHOW_PRINT_ICON_DESC" label="JGLOBAL_SHOW_PRINT_ICON_LABEL" - > - + useglobal="true" + > @@ -548,8 +580,8 @@ type="list" description="JGLOBAL_Show_Email_Icon_Desc" label="JGLOBAL_Show_Email_Icon_Label" - > - + useglobal="true" + > @@ -560,8 +592,8 @@ type="list" description="JGLOBAL_SHOW_HITS_DESC" label="JGLOBAL_SHOW_HITS_LABEL" - > - + useglobal="true" + > @@ -572,8 +604,8 @@ type="list" label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL" description="COM_CONTENT_FIELD_SHOW_TAGS_DESC" - > - + useglobal="true" + > @@ -584,8 +616,8 @@ type="list" description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC" label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL" - > - + useglobal="true" + > @@ -598,8 +630,8 @@ type="list" description="JGLOBAL_SHOW_FEED_LINK_DESC" label="JGLOBAL_SHOW_FEED_LINK_LABEL" - > - + useglobal="true" + > @@ -609,11 +641,11 @@ type="list" description="JGLOBAL_FEED_SUMMARY_DESC" label="JGLOBAL_FEED_SUMMARY_LABEL" - > - + useglobal="true" + >
    - \ No newline at end of file + diff --git a/components/com_content/views/category/tmpl/blog_children.php b/components/com_content/views/category/tmpl/blog_children.php index 432a1086fb1cd..52b9486ed6866 100644 --- a/components/com_content/views/category/tmpl/blog_children.php +++ b/components/com_content/views/category/tmpl/blog_children.php @@ -28,7 +28,7 @@ isRtl()) : ?>
    - -
    -
    - form->renderField('title'); ?> - - item->id)) : ?> - form->renderField('alias'); ?> - - - form->getInput('articletext'); ?> -
    - get('show_urls_images_frontend')): ?> -
    - form->renderField('image_intro', 'images'); ?> - form->renderField('image_intro_alt', 'images'); ?> - form->renderField('image_intro_caption', 'images'); ?> - form->renderField('float_intro', 'images'); ?> - form->renderField('image_fulltext', 'images'); ?> - form->renderField('image_fulltext_alt', 'images'); ?> - form->renderField('image_fulltext_caption', 'images'); ?> - form->renderField('float_fulltext', 'images'); ?> - form->renderField('urla', 'urls'); ?> - form->renderField('urlatext', 'urls'); ?> -
    -
    - form->getInput('targeta', 'urls'); ?> -
    -
    - form->renderField('urlb', 'urls'); ?> - form->renderField('urlbtext', 'urls'); ?> -
    -
    - form->getInput('targetb', 'urls'); ?> -
    -
    - form->renderField('urlc', 'urls'); ?> - form->renderField('urlctext', 'urls'); ?> -
    -
    - form->getInput('targetc', 'urls'); ?> -
    -
    -
    - - form->getFieldsets('params') as $name => $fieldSet) : ?> -
    - form->getFieldset($name) as $field) : ?> - renderField(); ?> - -
    - -
    - form->renderField('catid'); ?> - form->renderField('tags'); ?> - get('save_history', 0)) : ?> - form->renderField('version_note'); ?> - - form->renderField('created_by_alias'); ?> - item->params->get('access-change')) : ?> - form->renderField('state'); ?> - form->renderField('featured'); ?> - form->renderField('publish_up'); ?> - form->renderField('publish_down'); ?> - - form->renderField('access'); ?> - item->id)):?> -
    -
    -
    -
    - -
    -
    - -
    -
    - form->renderField('language'); ?> -
    -
    - form->renderField('metadesc'); ?> - form->renderField('metakey'); ?> - - - -
    -
    - -
    diff --git a/components/com_content/views/form/tmpl/edit.xml b/components/com_content/views/form/tmpl/edit.xml index 61bb377278f5b..c82a1aa6e1c98 100644 --- a/components/com_content/views/form/tmpl/edit.xml +++ b/components/com_content/views/form/tmpl/edit.xml @@ -23,7 +23,8 @@ type="category" label="JGLOBAL_CHOOSE_CATEGORY_LABEL" extension="com_content" - description="JGLOBAL_CHOOSE_CATEGORY_DESC" /> + description="JGLOBAL_CHOOSE_CATEGORY_DESC" + showon="enable_category:1" /> \ No newline at end of file diff --git a/components/com_content/views/form/view.html.php b/components/com_content/views/form/view.html.php index ee55e577a3223..e456f4c291025 100644 --- a/components/com_content/views/form/view.html.php +++ b/components/com_content/views/form/view.html.php @@ -24,6 +24,14 @@ class ContentViewForm extends JViewLegacy protected $state; + /** + * Should we show a captcha form for the submission of the article? + * + * @var bool + * @since __DEPLOY_VERSION__ + */ + protected $captchaEnabled = false; + /** * Execute and display a template script. * @@ -110,6 +118,17 @@ public function display($tpl = null) $this->form->setFieldAttribute('language', 'default', $lang); } + $captchaSet = $params->get('captcha', JFactory::getApplication()->get('captcha', '0')); + + foreach (JPluginHelper::getPlugin('captcha') as $plugin) + { + if ($captchaSet === $plugin->name) + { + $this->captchaEnabled = true; + break; + } + } + $this->_prepareDocument(); parent::display($tpl); } diff --git a/components/com_fields/controller.php b/components/com_fields/controller.php new file mode 100644 index 0000000000000..e5632f402f6bd --- /dev/null +++ b/components/com_fields/controller.php @@ -0,0 +1,18 @@ +input->get($this->input->get('formcontrol', 'jform'), array(), 'array'); + $parts = FieldsHelper::extract($this->input->getCmd('context')); + + if ($parts) + { + $app->setUserState($parts[0] . '.edit.' . $parts[1] . '.data', $data); + } + + $app->redirect(base64_decode($this->input->get->getBase64('return'))); + $app->close(); + } +} diff --git a/components/com_fields/fields.php b/components/com_fields/fields.php new file mode 100644 index 0000000000000..9226ce51142f4 --- /dev/null +++ b/components/com_fields/fields.php @@ -0,0 +1,15 @@ +execute(JFactory::getApplication()->input->get('task')); +$controller->redirect(); diff --git a/components/com_fields/layouts/field/prepare/base.php b/components/com_fields/layouts/field/prepare/base.php new file mode 100644 index 0000000000000..6af8b844a2d0c --- /dev/null +++ b/components/com_fields/layouts/field/prepare/base.php @@ -0,0 +1,29 @@ +value; + +if (!$value) +{ + return; +} + +if (is_array($value)) +{ + $value = implode(', ', $value); +} + +echo htmlentities($value); diff --git a/administrator/components/com_categories/views/category/tmpl/edit_options.php b/components/com_fields/layouts/field/prepare/captcha.php similarity index 68% rename from administrator/components/com_categories/views/category/tmpl/edit_options.php rename to components/com_fields/layouts/field/prepare/captcha.php index 5f3b6e5115efa..331fb288d1e18 100644 --- a/administrator/components/com_categories/views/category/tmpl/edit_options.php +++ b/components/com_fields/layouts/field/prepare/captcha.php @@ -1,12 +1,11 @@ value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$texts = array(); +$options = JFormAbstractlist::getOptionsFromField($field); + +foreach ($options as $optionValue => $optionText) +{ + if (in_array($optionValue, $value)) + { + $texts[] = JText::_($optionText); + } +} + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/prepare/editor.php b/components/com_fields/layouts/field/prepare/editor.php new file mode 100644 index 0000000000000..5a68253c2a72c --- /dev/null +++ b/components/com_fields/layouts/field/prepare/editor.php @@ -0,0 +1,24 @@ +value; + +if (!$value) +{ + return; +} + +echo JHTML::_('content.prepare', $value); diff --git a/components/com_fields/layouts/field/prepare/imagelist.php b/components/com_fields/layouts/field/prepare/imagelist.php new file mode 100644 index 0000000000000..85dec1cd10c15 --- /dev/null +++ b/components/com_fields/layouts/field/prepare/imagelist.php @@ -0,0 +1,38 @@ +value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$buffer = ''; + +foreach ($value as $path) +{ + if (!$path || $path == '-1') + { + continue; + } + + $buffer .= ''; +} + +echo $buffer; diff --git a/components/com_fields/layouts/field/prepare/list.php b/components/com_fields/layouts/field/prepare/list.php new file mode 100644 index 0000000000000..bf76d56e950a6 --- /dev/null +++ b/components/com_fields/layouts/field/prepare/list.php @@ -0,0 +1,37 @@ +value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$texts = array(); +$options = JFormAbstractlist::getOptionsFromField($field); + +foreach ($options as $optionValue => $optionText) +{ + if (in_array($optionValue, $value)) + { + $texts[] = JText::_($optionText); + } +} + + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/prepare/media.php b/components/com_fields/layouts/field/prepare/media.php new file mode 100644 index 0000000000000..a758a21f653f2 --- /dev/null +++ b/components/com_fields/layouts/field/prepare/media.php @@ -0,0 +1,37 @@ +value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$buffer = ''; + +foreach ($value as $path) +{ + if (!$path) + { + continue; + } + + $buffer .= ''; +} + +echo $buffer; diff --git a/components/com_fields/layouts/field/prepare/radio.php b/components/com_fields/layouts/field/prepare/radio.php new file mode 100644 index 0000000000000..bf76d56e950a6 --- /dev/null +++ b/components/com_fields/layouts/field/prepare/radio.php @@ -0,0 +1,37 @@ +value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$texts = array(); +$options = JFormAbstractlist::getOptionsFromField($field); + +foreach ($options as $optionValue => $optionText) +{ + if (in_array($optionValue, $value)) + { + $texts[] = JText::_($optionText); + } +} + + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/prepare/sql.php b/components/com_fields/layouts/field/prepare/sql.php new file mode 100644 index 0000000000000..f53cc691937a8 --- /dev/null +++ b/components/com_fields/layouts/field/prepare/sql.php @@ -0,0 +1,64 @@ +value; + +if (!$value) +{ + return; +} + +$db = JFactory::getDbo(); +$value = (array) $value; +$condition = ''; + +foreach ($value as $v) +{ + if (!$v) + { + continue; + } + + $condition .= ', ' . $db->q($v); +} + +$query = $field->fieldparams->get('query', 'select id as value, name as text from #__users'); + +// Run the query with a having condition because it supports aliases +$db->setQuery($query . ' having value in (' . trim($condition, ',') . ')'); + +try +{ + $items = $db->loadObjectlist(); +} +catch (Exception $e) +{ + // If the query failed, we fetch all elements + $db->setQuery($query); + $items = $db->loadObjectlist(); +} + +$texts = array(); + +foreach ($items as $item) +{ + if (in_array($item->value, $value)) + { + $texts[] = $item->text; + } +} + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/prepare/textarea.php b/components/com_fields/layouts/field/prepare/textarea.php new file mode 100644 index 0000000000000..5a68253c2a72c --- /dev/null +++ b/components/com_fields/layouts/field/prepare/textarea.php @@ -0,0 +1,24 @@ +value; + +if (!$value) +{ + return; +} + +echo JHTML::_('content.prepare', $value); diff --git a/components/com_fields/layouts/field/prepare/url.php b/components/com_fields/layouts/field/prepare/url.php new file mode 100644 index 0000000000000..32ab25cda21cf --- /dev/null +++ b/components/com_fields/layouts/field/prepare/url.php @@ -0,0 +1,31 @@ +value; + +if (!$value) +{ + return; +} + +$attributes = ''; + +if (!JUri::isInternal($value)) +{ + $attributes = 'rel="nofollow" target="_blank"'; +} + +echo '' . $value . ''; diff --git a/components/com_fields/layouts/field/prepare/user.php b/components/com_fields/layouts/field/prepare/user.php new file mode 100644 index 0000000000000..27047ee6f3f6b --- /dev/null +++ b/components/com_fields/layouts/field/prepare/user.php @@ -0,0 +1,47 @@ +value; + +if (!$value) +{ + return; +} + +$value = (array) $value; +$texts = array(); + +foreach ($value as $userId) +{ + if (!$userId) + { + continue; + } + + $user = JFactory::getUser($userId); + + if ($user) + { + // Use the Username + $texts[] = $user->name; + continue; + } + + // Fallback and add the User ID if we get no JUser Object + $texts[] = $userId; +} + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/prepare/usergrouplist.php b/components/com_fields/layouts/field/prepare/usergrouplist.php new file mode 100644 index 0000000000000..925343ba5066e --- /dev/null +++ b/components/com_fields/layouts/field/prepare/usergrouplist.php @@ -0,0 +1,38 @@ +value; + +if (!$value) +{ + return; +} + +JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'); + +$value = (array) $value; +$texts = array(); +$groups = UsersHelper::getGroups(); + +foreach ($groups as $group) +{ + if (in_array($group->value, $value)) + { + $texts[] = htmlentities(trim($group->text, '- ')); + } +} + +echo htmlentities(implode(', ', $texts)); diff --git a/components/com_fields/layouts/field/render.php b/components/com_fields/layouts/field/render.php new file mode 100644 index 0000000000000..cfcc338d0a919 --- /dev/null +++ b/components/com_fields/layouts/field/render.php @@ -0,0 +1,31 @@ +label; +$value = $field->value; +$class = $field->params->get('render_class'); + +if (!$value) +{ + return; +} + +?> + +
    + : + +
    diff --git a/components/com_fields/layouts/fields/render.php b/components/com_fields/layouts/fields/render.php new file mode 100644 index 0000000000000..bd37bba14cbe8 --- /dev/null +++ b/components/com_fields/layouts/fields/render.php @@ -0,0 +1,83 @@ +fields ? $item->fields : FieldsHelper::getFields($context, $item, true); +} + +if (!$fields) +{ + return; +} + +// Load some output definitions +$container = 'dl'; + +if (key_exists('container', $displayData) && $displayData['container']) +{ + $container = $displayData['container']; +} + +$class = 'article-info muted'; + +if (key_exists('container-class', $displayData) && $displayData['container-class']) +{ + $class = $displayData['container-class']; +} + +// Print the container tag +echo '<' . $container . ' class="fields-container ' . $class . '">'; + +// Loop through the fields and print them +foreach ($fields as $field) +{ + // If the value is empty dp nothing + if (!isset($field->value) || !$field->value) + { + continue; + } + + echo FieldsHelper::render($context, 'field.render', array('field' => $field)); +} + +// Close the container +echo ''; diff --git a/components/com_finder/controller.php b/components/com_finder/controller.php index 734cfbb9f6690..2ceae7ab6c610 100644 --- a/components/com_finder/controller.php +++ b/components/com_finder/controller.php @@ -34,7 +34,7 @@ public function display($cachable = false, $urlparams = array()) $input = JFactory::getApplication()->input; $cachable = true; - // Load plug-in language files. + // Load plugin language files. FinderHelperLanguage::loadPluginLanguage(); // Set the default view name and format from the Request. diff --git a/components/com_finder/finder.php b/components/com_finder/finder.php index 264fdcea9e5b1..eea5a49bcefa3 100644 --- a/components/com_finder/finder.php +++ b/components/com_finder/finder.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('FinderHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Finder'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_finder/helpers/html/filter.php b/components/com_finder/helpers/html/filter.php index 58e41fb97b397..af578f5298050 100644 --- a/components/com_finder/helpers/html/filter.php +++ b/components/com_finder/helpers/html/filter.php @@ -66,9 +66,7 @@ public static function slider($options = array()) // Initialize the filter parameters. if ($filter) { - $registry = new Registry; - $registry->loadString($filter->params); - $filter->params = $registry; + $filter->params = new Registry($filter->params); } } @@ -111,13 +109,13 @@ public static function slider($options = array()) $html .= JHtml::_('bootstrap.startAccordion', 'accordion', array('parent' => true, 'active' => 'accordion-' . $branch_keys[0]) ); - // Load plug-in language files. + // Load plugin language files. FinderHelperLanguage::loadPluginLanguage(); // Iterate through the branches and build the branch groups. foreach ($branches as $bk => $bv) { - // If the multi-lang plug-in is enabled then drop the language branch. + // If the multi-lang plugin is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; @@ -204,7 +202,7 @@ public static function slider($options = array()) } /** - * Method to generate filters using select box drop down controls. + * Method to generate filters using select box dropdown controls. * * @param FinderIndexerQuery $idxQuery A FinderIndexerQuery object. * @param array $options An array of options. @@ -255,9 +253,7 @@ public static function select($idxQuery, $options) // Initialize the filter parameters. if ($filter) { - $registry = new Registry; - $registry->loadString($filter->params); - $filter->params = $registry; + $filter->params = new Registry($filter->params); } } @@ -301,7 +297,7 @@ public static function select($idxQuery, $options) // Iterate through the branches and build the branch groups. foreach ($branches as $bk => $bv) { - // If the multi-lang plug-in is enabled then drop the language branch. + // If the multi-lang plugin is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; @@ -374,7 +370,7 @@ public static function select($idxQuery, $options) // Iterate through all branches and build code. foreach ($branches as $bk => $bv) { - // If the multi-lang plug-in is enabled then drop the language branch. + // If the multi-lang plugin is enabled then drop the language branch. if ($bv->title == 'Language' && JLanguageMultilang::isEnabled()) { continue; @@ -441,7 +437,7 @@ public static function dates($idxQuery, $options) // Load the CSS/JS resources. if ($loadMedia) { - JHtml::stylesheet('com_finder/dates.css', false, true, false); + JHtml::_('stylesheet', 'com_finder/dates.css', array('version' => 'auto', 'relative' => true)); } // Open the widget. diff --git a/components/com_finder/models/search.php b/components/com_finder/models/search.php index 2e0dd7f9bb2b0..4d1ad66d611d6 100644 --- a/components/com_finder/models/search.php +++ b/components/com_finder/models/search.php @@ -9,6 +9,7 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; // Register dependent classes. @@ -376,7 +377,7 @@ protected function getResultsTotal() foreach ($this->includedTerms as $token => $ids) { // Get the mapping table suffix. - $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); + $suffix = StringHelper::substr(md5(StringHelper::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) @@ -523,7 +524,7 @@ protected function getResultsTotal() do { // Get the map table suffix. - $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); + $suffix = StringHelper::substr(md5(StringHelper::substr($token, 0, 1)), 0, 1); // Adjust the query to join on the appropriate mapping table. $query = clone($base); @@ -654,7 +655,7 @@ protected function getResultsData() foreach ($this->includedTerms as $token => $ids) { // Get the mapping table suffix. - $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); + $suffix = StringHelper::substr(md5(StringHelper::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) @@ -844,7 +845,7 @@ protected function getResultsData() do { // Get the map table suffix. - $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); + $suffix = StringHelper::substr(md5(StringHelper::substr($token, 0, 1)), 0, 1); // Adjust the query to join on the appropriate mapping table. $query = clone($base); @@ -942,7 +943,7 @@ protected function getExcludedLinkIds() foreach ($this->excludedTerms as $token => $id) { // Get the mapping table suffix. - $suffix = JString::substr(md5(JString::substr($token, 0, 1)), 0, 1); + $suffix = StringHelper::substr(md5(StringHelper::substr($token, 0, 1)), 0, 1); // Initialize the mapping group. if (!array_key_exists($suffix, $maps)) @@ -1125,7 +1126,7 @@ protected function populateState($ordering = null, $direction = null) * Also, we allow this parameter to be passed in either case (lower/upper). */ $order = $input->getWord('filter_order', $params->get('sort_order', 'relevance')); - $order = JString::strtolower($order); + $order = StringHelper::strtolower($order); switch ($order) { case 'date': @@ -1156,7 +1157,7 @@ protected function populateState($ordering = null, $direction = null) * Also, we allow this parameter to be passed in either case (lower/upper). */ $dirn = $input->getWord('filter_order_Dir', $params->get('sort_direction', 'desc')); - $dirn = JString::strtolower($dirn); + $dirn = StringHelper::strtolower($dirn); switch ($dirn) { case 'asc': diff --git a/components/com_finder/views/search/metadata.xml b/components/com_finder/views/search/metadata.xml deleted file mode 100644 index 5c0525632b10a..0000000000000 --- a/components/com_finder/views/search/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_finder/views/search/tmpl/default.php b/components/com_finder/views/search/tmpl/default.php index 592636ee80d4d..77e1826ba0bbf 100644 --- a/components/com_finder/views/search/tmpl/default.php +++ b/components/com_finder/views/search/tmpl/default.php @@ -12,7 +12,7 @@ JHtml::_('behavior.core'); JHtml::_('formbehavior.chosen'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); -JHtml::stylesheet('com_finder/finder.css', false, true, false); +JHtml::_('stylesheet', 'com_finder/finder.css', array('version' => 'auto', 'relative' => true)); ?>
    diff --git a/components/com_finder/views/search/tmpl/default.xml b/components/com_finder/views/search/tmpl/default.xml index 053ce8f45ad5c..ce5a6784a579d 100644 --- a/components/com_finder/views/search/tmpl/default.xml +++ b/components/com_finder/views/search/tmpl/default.xml @@ -126,7 +126,7 @@ @@ -136,7 +136,7 @@ diff --git a/components/com_finder/views/search/tmpl/default_form.php b/components/com_finder/views/search/tmpl/default_form.php index 150edd0945ab9..56184a69e29ed 100644 --- a/components/com_finder/views/search/tmpl/default_form.php +++ b/components/com_finder/views/search/tmpl/default_form.php @@ -38,11 +38,11 @@ */ if ($this->params->get('show_autosuggest', 1)) { - JHtml::_('script', 'media/jui/js/jquery.autocomplete.min.js', false, false, false, false, true); + JHtml::_('script', 'jui/jquery.autocomplete.min.js', array('version' => 'auto', 'relative' => true)); $script .= " var suggest = jQuery('#q').autocomplete({ - serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component', false) . "', + serviceUrl: '" . JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component') . "', paramName: 'q', minChars: 1, maxHeight: 400, diff --git a/components/com_finder/views/search/tmpl/default_result.php b/components/com_finder/views/search/tmpl/default_result.php index 6893e9114841b..df4704bec2a8e 100644 --- a/components/com_finder/views/search/tmpl/default_result.php +++ b/components/com_finder/views/search/tmpl/default_result.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\String\StringHelper; + // Get the mime type class. $mime = !empty($this->result->mime) ? 'mime-' . $this->result->mime : null; @@ -17,21 +19,21 @@ if ($show_description) { // Calculate number of characters to display around the result - $term_length = JString::strlen($this->query->input); + $term_length = StringHelper::strlen($this->query->input); $desc_length = $this->params->get('description_length', 255); $pad_length = $term_length < $desc_length ? (int) floor(($desc_length - $term_length) / 2) : 0; // Find the position of the search term - $pos = $term_length ? JString::strpos(JString::strtolower($this->result->description), JString::strtolower($this->query->input)) : false; + $pos = $term_length ? StringHelper::strpos(StringHelper::strtolower($this->result->description), StringHelper::strtolower($this->query->input)) : false; // Find a potential start point $start = ($pos && $pos > $pad_length) ? $pos - $pad_length : 0; // Find a space between $start and $pos, start right after it. - $space = JString::strpos($this->result->description, ' ', $start > 0 ? $start - 1 : 0); + $space = StringHelper::strpos($this->result->description, ' ', $start > 0 ? $start - 1 : 0); $start = ($space && $space < $pos) ? $space + 1 : $start; - $description = JHtml::_('string.truncate', JString::substr($this->result->description, $start), $desc_length, true); + $description = JHtml::_('string.truncate', StringHelper::substr($this->result->description, $start), $desc_length, true); } $route = $this->result->route; diff --git a/components/com_finder/views/search/view.html.php b/components/com_finder/views/search/view.html.php index b890fd7545ced..ba725b9830a4d 100644 --- a/components/com_finder/views/search/view.html.php +++ b/components/com_finder/views/search/view.html.php @@ -41,13 +41,13 @@ public function display($tpl = null) // Get view data. $state = $this->get('State'); $query = $this->get('Query'); - JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderQuery') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('afterFinderQuery') : null; $results = $this->get('Results'); - JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderResults') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('afterFinderResults') : null; $total = $this->get('Total'); - JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderTotal') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('afterFinderTotal') : null; $pagination = $this->get('Pagination'); - JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderPagination') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('afterFinderPagination') : null; // Check for errors. if (count($errors = $this->get('Errors'))) @@ -105,11 +105,11 @@ public function display($tpl = null) $this->prepareDocument($query); - JDEBUG ? $GLOBALS['_PROFILER']->mark('beforeFinderLayout') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('beforeFinderLayout') : null; parent::display($tpl); - JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderLayout') : null; + JDEBUG ? JProfiler::getInstance('Application')->mark('afterFinderLayout') : null; } /** diff --git a/components/com_mailto/controller.php b/components/com_mailto/controller.php index 0be4ae9dd4b7a..cd136ce602cae 100644 --- a/components/com_mailto/controller.php +++ b/components/com_mailto/controller.php @@ -43,7 +43,7 @@ public function mailto() public function send() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken(); $app = JFactory::getApplication(); $session = JFactory::getSession(); diff --git a/components/com_mailto/mailto.php b/components/com_mailto/mailto.php index a9341da1dc05e..2b889057b30a8 100644 --- a/components/com_mailto/mailto.php +++ b/components/com_mailto/mailto.php @@ -9,8 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/mailto.php'; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('MailtoHelper', JPATH_COMPONENT . '/helpers/mailto.php'); $controller = JControllerLegacy::getInstance('Mailto'); $controller->registerDefaultTask('mailto'); diff --git a/components/com_mailto/views/mailto/metadata.xml b/components/com_mailto/views/mailto/metadata.xml deleted file mode 100644 index 46e304a85394f..0000000000000 --- a/components/com_mailto/views/mailto/metadata.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/components/com_mailto/views/mailto/tmpl/default.php b/components/com_mailto/views/mailto/tmpl/default.php index 3b4f31aab9b90..25e35b2a08579 100644 --- a/components/com_mailto/views/mailto/tmpl/default.php +++ b/components/com_mailto/views/mailto/tmpl/default.php @@ -66,7 +66,7 @@

    - + diff --git a/components/com_mailto/views/sent/metadata.xml b/components/com_mailto/views/sent/metadata.xml deleted file mode 100644 index cb62c415a622b..0000000000000 --- a/components/com_mailto/views/sent/metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - Mailto - Andrew Eddie - 13 Mar 2006 - Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. - GNU General Public License version 2 or later; see LICENSE.txt - admin@joomla.org - www.joomla.org - COM_MAILTO_XML_DESCRIPTION - diff --git a/components/com_menus/controller.php b/components/com_menus/controller.php new file mode 100644 index 0000000000000..2a9d60630aea7 --- /dev/null +++ b/components/com_menus/controller.php @@ -0,0 +1,41 @@ +input = JFactory::getApplication()->input; + + // Menus frontpage Editor Menu proxying: + if ($this->input->get('view') === 'items' && $this->input->get('layout') === 'modal') + { + JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; + } + + parent::__construct($config); + } +} diff --git a/components/com_menus/menus.php b/components/com_menus/menus.php new file mode 100644 index 0000000000000..c9d2ecd9c81a0 --- /dev/null +++ b/components/com_menus/menus.php @@ -0,0 +1,31 @@ +input->get('view') === 'items' && $app->input->get('layout') === 'modal') +{ + if (!JFactory::getUser()->authorise('core.create', 'com_menus')) + { + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); + return; + } +} + +$lang->load('joomla', JPATH_ADMINISTRATOR); +$lang->load('com_menus', JPATH_ADMINISTRATOR); + +// Trigger the controller +$controller = JControllerLegacy::getInstance('Menus'); +$controller->execute($app->input->get('task')); +$controller->redirect(); diff --git a/components/com_menus/models/forms/filter_items.xml b/components/com_menus/models/forms/filter_items.xml new file mode 100644 index 0000000000000..f6179f04b9c9a --- /dev/null +++ b/components/com_menus/models/forms/filter_items.xml @@ -0,0 +1,95 @@ + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/com_modules/controller.php b/components/com_modules/controller.php index 8b19da7d10d81..c76faff8e7b80 100644 --- a/components/com_modules/controller.php +++ b/components/com_modules/controller.php @@ -32,7 +32,7 @@ public function __construct($config = array()) // Modules frontpage Editor Module proxying: if ($this->input->get('view') === 'modules' && $this->input->get('layout') === 'modal') { - JHtml::_('stylesheet', 'system/adminlist.css', array(), true); + JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true)); $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; } diff --git a/components/com_modules/modules.php b/components/com_modules/modules.php index 7543157e50899..e71b22770455d 100644 --- a/components/com_modules/modules.php +++ b/components/com_modules/modules.php @@ -10,11 +10,28 @@ defined('_JEXEC') or die; // Load the required admin language files -$lang = JFactory::getLanguage(); +$lang = JFactory::getLanguage(); +$app = JFactory::getApplication(); +$config = array(); $lang->load('joomla', JPATH_ADMINISTRATOR); $lang->load('com_modules', JPATH_ADMINISTRATOR); +if ($app->input->get('view') === 'modules' && $app->input->get('layout') === 'modal') +{ + if (!JFactory::getUser()->authorise('core.create', 'com_modules')) + { + $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning'); + + return; + } +} + +if ($app->input->get('task') === 'module.orderPosition') +{ + $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; +} + // Trigger the controller -$controller = JControllerLegacy::getInstance('Modules'); -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller = JControllerLegacy::getInstance('Modules', $config); +$controller->execute($app->input->get('task')); $controller->redirect(); diff --git a/components/com_newsfeeds/controller.php b/components/com_newsfeeds/controller.php index 7c23405771f02..910094bad49af 100644 --- a/components/com_newsfeeds/controller.php +++ b/components/com_newsfeeds/controller.php @@ -36,7 +36,7 @@ public function display($cachable = false, $urlparams = false) $user = JFactory::getUser(); - if ($user->get('id') || ($this->input->getMethod() == 'POST' && $vName = 'category' )) + if ($user->get('id') || ($this->input->getMethod() == 'POST' && $vName == 'category' )) { $cachable = false; } diff --git a/components/com_newsfeeds/helpers/association.php b/components/com_newsfeeds/helpers/association.php index 7517875963cd7..48f0ea4f8c467 100644 --- a/components/com_newsfeeds/helpers/association.php +++ b/components/com_newsfeeds/helpers/association.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; JLoader::register('NewsfeedsHelper', JPATH_ADMINISTRATOR . '/components/com_newsfeeds/helpers/newsfeeds.php'); +JLoader::register('NewsfeedsHelperRoute', JPATH_SITE . '/components/com_newsfeeds/helpers/route.php'); JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php'); /** @@ -29,15 +30,11 @@ abstract class NewsfeedsHelperAssociation extends CategoryHelperAssociation * * @since 3.0 */ - public static function getAssociations($id = 0, $view = null) { - jimport('helper.route', JPATH_COMPONENT_SITE); - - $app = JFactory::getApplication(); - $jinput = $app->input; - $view = is_null($view) ? $jinput->get('view') : $view; - $id = empty($id) ? $jinput->getInt('id') : $id; + $jinput = JFactory::getApplication()->input; + $view = is_null($view) ? $jinput->get('view') : $view; + $id = empty($id) ? $jinput->getInt('id') : $id; if ($view == 'newsfeed') { diff --git a/components/com_newsfeeds/helpers/legacyrouter.php b/components/com_newsfeeds/helpers/legacyrouter.php new file mode 100644 index 0000000000000..12f61adedaa7e --- /dev/null +++ b/components/com_newsfeeds/helpers/legacyrouter.php @@ -0,0 +1,271 @@ +router = $router; + } + + /** + * Preprocess the route for the com_newsfeeds component + * + * @param array &$query An array of URL arguments + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function preprocess(&$query) + { + } + + /** + * Build the route for the com_newsfeeds component + * + * @param array &$query An array of URL arguments + * @param array &$segments The URL arguments to use to assemble the subsequent URL. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function build(&$query, &$segments) + { + // Get a menu item based on Itemid or currently active + $params = JComponentHelper::getParams('com_newsfeeds'); + $advanced = $params->get('sef_advanced_link', 0); + + if (empty($query['Itemid'])) + { + $menuItem = $this->router->menu->getActive(); + } + else + { + $menuItem = $this->router->menu->getItem($query['Itemid']); + } + + $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; + $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; + + if (isset($query['view'])) + { + $view = $query['view']; + + if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_newsfeeds') + { + $segments[] = $query['view']; + } + + unset($query['view']); + } + + // Are we dealing with an newsfeed that is attached to a menu item? + if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id'])) + { + unset($query['view']); + unset($query['catid']); + unset($query['id']); + + return; + } + + if (isset($view) and ($view == 'category' or $view == 'newsfeed')) + { + if ($mId != (int) $query['id'] || $mView != $view) + { + if ($view == 'newsfeed' && isset($query['catid'])) + { + $catid = $query['catid']; + } + elseif (isset($query['id'])) + { + $catid = $query['id']; + } + + $menuCatid = $mId; + $categories = JCategories::getInstance('Newsfeeds'); + $category = $categories->get($catid); + + if ($category) + { + $path = $category->getPath(); + $path = array_reverse($path); + + $array = array(); + + foreach ($path as $id) + { + if ((int) $id == (int) $menuCatid) + { + break; + } + + if ($advanced) + { + list($tmp, $id) = explode(':', $id, 2); + } + + $array[] = $id; + } + + $segments = array_merge($segments, array_reverse($array)); + } + + if ($view == 'newsfeed') + { + if ($advanced) + { + list($tmp, $id) = explode(':', $query['id'], 2); + } + else + { + $id = $query['id']; + } + + $segments[] = $id; + } + } + + unset($query['id']); + unset($query['catid']); + } + + if (isset($query['layout'])) + { + if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) + { + if ($query['layout'] == $menuItem->query['layout']) + { + unset($query['layout']); + } + } + else + { + if ($query['layout'] == 'default') + { + unset($query['layout']); + } + } + } + + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = str_replace(':', '-', $segments[$i]); + } + } + + /** + * Parse the segments of a URL. + * + * @param array &$segments The segments of the URL to parse. + * @param array &$vars The URL attributes to be used by the application. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function parse(&$segments, &$vars) + { + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + } + + // Get the active menu item. + $item = $this->router->menu->getActive(); + $params = JComponentHelper::getParams('com_newsfeeds'); + $advanced = $params->get('sef_advanced_link', 0); + + // Count route segments + $count = count($segments); + + // Standard routing for newsfeeds. + if (!isset($item)) + { + $vars['view'] = $segments[0]; + $vars['id'] = $segments[$count - 1]; + + return; + } + + // From the categories view, we can only jump to a category. + $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; + $categories = JCategories::getInstance('Newsfeeds')->get($id)->getChildren(); + $vars['catid'] = $id; + $vars['id'] = $id; + $found = 0; + + foreach ($segments as $segment) + { + $segment = $advanced ? str_replace(':', '-', $segment) : $segment; + + foreach ($categories as $category) + { + if ($category->slug == $segment || $category->alias == $segment) + { + $vars['id'] = $category->id; + $vars['catid'] = $category->id; + $vars['view'] = 'category'; + $categories = $category->getChildren(); + $found = 1; + break; + } + } + + if ($found == 0) + { + if ($advanced) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from('#__newsfeeds') + ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) + ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); + $db->setQuery($query); + $nid = $db->loadResult(); + } + else + { + $nid = $segment; + } + + $vars['id'] = $nid; + $vars['view'] = 'newsfeed'; + } + + $found = 0; + } + } +} diff --git a/components/com_newsfeeds/helpers/route.php b/components/com_newsfeeds/helpers/route.php index 6ad2c5bdc386d..9e50b1f05a907 100644 --- a/components/com_newsfeeds/helpers/route.php +++ b/components/com_newsfeeds/helpers/route.php @@ -16,8 +16,6 @@ */ abstract class NewsfeedsHelperRoute { - protected static $lookup; - /** * getNewsfeedRoute * @@ -29,36 +27,17 @@ abstract class NewsfeedsHelperRoute */ public static function getNewsfeedRoute($id, $catid, $language = 0) { - $needles = array( - 'newsfeed' => array((int) $id) - ); - // Create the link $link = 'index.php?option=com_newsfeeds&view=newsfeed&id=' . $id; if ((int) $catid > 1) { - $categories = JCategories::getInstance('Newsfeeds'); - $category = $categories->get((int) $catid); - - if ($category) - { - // TODO Throw error that the category either not exists or is unpublished - $needles['category'] = array_reverse($category->getPath()); - $needles['categories'] = $needles['category']; - $link .= '&catid=' . $catid; - } + $link .= '&catid=' . $catid; } if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } return $link; @@ -77,130 +56,27 @@ public static function getCategoryRoute($catid, $language = 0) if ($catid instanceof JCategoryNode) { $id = $catid->id; - $category = $catid; } else { $id = (int) $catid; - $category = JCategories::getInstance('Newsfeeds')->get($id); } - if ($id < 1 || !($category instanceof JCategoryNode)) + if ($id < 1) { $link = ''; } else { - $needles = array(); - // Create the link $link = 'index.php?option=com_newsfeeds&view=category&id=' . $id; - $catids = array_reverse($category->getPath()); - $needles['category'] = $catids; - $needles['categories'] = $catids; - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) { $link .= '&lang=' . $language; - $needles['language'] = $language; - } - - if ($item = self::_findItem($needles)) - { - $link .= '&Itemid=' . $item; } } return $link; } - - /** - * finditem - * - * @param null $needles what we are searching for - * - * @return int menu itemid - * - * @throws Exception - */ - protected static function _findItem($needles = null) - { - $app = JFactory::getApplication(); - $menus = $app->getMenu('site'); - $language = isset($needles['language']) ? $needles['language'] : '*'; - - // Prepare the reverse lookup array. - if (!isset(self::$lookup[$language])) - { - self::$lookup[$language] = array(); - - $component = JComponentHelper::getComponent('com_newsfeeds'); - - $attributes = array('component_id'); - $values = array($component->id); - - if ($language != '*') - { - $attributes[] = 'language'; - $values[] = array($needles['language'], '*'); - } - - $items = $menus->getItems($attributes, $values); - - foreach ($items as $item) - { - if (isset($item->query) && isset($item->query['view'])) - { - $view = $item->query['view']; - - if (!isset(self::$lookup[$language][$view])) - { - self::$lookup[$language][$view] = array(); - } - - if (isset($item->query['id'])) - { - /* Here it will become a bit tricky - language != * can override existing entries - language == * cannot override existing entries */ - if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') - { - self::$lookup[$language][$view][$item->query['id']] = $item->id; - } - } - } - } - } - - if ($needles) - { - foreach ($needles as $view => $ids) - { - if (isset(self::$lookup[$language][$view])) - { - foreach ($ids as $id) - { - if (isset(self::$lookup[$language][$view][(int) $id])) - { - return self::$lookup[$language][$view][(int) $id]; - } - } - } - } - } - - // Check if the active menuitem matches the requested language - $active = $menus->getActive(); - - if ($active && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) - { - return $active->id; - } - - // If not found, return language specific home link - $default = $menus->getDefault($language); - - return !empty($default->id) ? $default->id : null; - } } diff --git a/components/com_newsfeeds/metadata.xml b/components/com_newsfeeds/metadata.xml deleted file mode 100644 index 9205b30529a2a..0000000000000 --- a/components/com_newsfeeds/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/components/com_newsfeeds/models/newsfeed.php b/components/com_newsfeeds/models/newsfeed.php index f5a7e93703a43..0b85d31983afc 100644 --- a/components/com_newsfeeds/models/newsfeed.php +++ b/components/com_newsfeeds/models/newsfeed.php @@ -133,14 +133,11 @@ public function &getItem($pk = null) } // Convert parameter fields to objects. - $registry = new Registry; - $registry->loadString($data->params); + $registry = new Registry($data->params); $data->params = clone $this->getState('params'); $data->params->merge($registry); - $registry = new Registry; - $registry->loadString($data->metadata); - $data->metadata = $registry; + $data->metadata = new Registry($data->metadata); // Compute access permissions. diff --git a/components/com_newsfeeds/newsfeeds.php b/components/com_newsfeeds/newsfeeds.php index bcd559c0e093e..890e60efa8067 100644 --- a/components/com_newsfeeds/newsfeeds.php +++ b/components/com_newsfeeds/newsfeeds.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('NewsfeedsHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables'); $controller = JControllerLegacy::getInstance('Newsfeeds'); diff --git a/components/com_newsfeeds/router.php b/components/com_newsfeeds/router.php index 5db14446a76ef..e2dc64728225f 100644 --- a/components/com_newsfeeds/router.php +++ b/components/com_newsfeeds/router.php @@ -14,235 +14,200 @@ * * @since 3.3 */ -class NewsfeedsRouter extends JComponentRouterBase +class NewsfeedsRouter extends JComponentRouterView { + protected $noIDs = false; + /** - * Build the route for the com_newsfeeds component - * - * @param array &$query An array of URL arguments + * Newsfeeds Component router constructor * - * @return array The URL arguments to use to assemble the subsequent URL. - * - * @since 3.3 + * @param JApplicationCms $app The application object + * @param JMenu $menu The menu object to work with */ - public function build(&$query) + public function __construct($app = null, $menu = null) { - $segments = array(); - - // Get a menu item based on Itemid or currently active $params = JComponentHelper::getParams('com_newsfeeds'); - $advanced = $params->get('sef_advanced_link', 0); - - if (empty($query['Itemid'])) - { - $menuItem = $this->menu->getActive(); - } - else - { - $menuItem = $this->menu->getItem($query['Itemid']); - } + $this->noIDs = (bool) $params->get('sef_ids'); + $categories = new JComponentRouterViewconfiguration('categories'); + $categories->setKey('id'); + $this->registerView($categories); + $category = new JComponentRouterViewconfiguration('category'); + $category->setKey('id')->setParent($categories, 'catid')->setNestable(); + $this->registerView($category); + $newsfeed = new JComponentRouterViewconfiguration('newsfeed'); + $newsfeed->setKey('id')->setParent($category, 'catid'); + $this->registerView($newsfeed); - $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view']; - $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id']; + parent::__construct($app, $menu); - if (isset($query['view'])) - { - $view = $query['view']; + $this->attachRule(new JComponentRouterRulesMenu($this)); - if (empty($query['Itemid']) || empty($menuItem) || $menuItem->component != 'com_newsfeeds') - { - $segments[] = $query['view']; - } + $params = JComponentHelper::getParams('com_content'); - unset($query['view']); - } - - // Are we dealing with a newsfeed that is attached to a menu item? - if (isset($query['view']) && ($mView == $query['view']) and (isset($query['id'])) and ($mId == (int) $query['id'])) + if ($params->get('sef_advanced', 0)) { - unset($query['view']); - unset($query['catid']); - unset($query['id']); - - return $segments; + $this->attachRule(new JComponentRouterRulesStandard($this)); + $this->attachRule(new JComponentRouterRulesNomenu($this)); } - - if (isset($view) and ($view == 'category' or $view == 'newsfeed')) + else { - if ($mId != (int) $query['id'] || $mView != $view) - { - if ($view == 'newsfeed' && isset($query['catid'])) - { - $catid = $query['catid']; - } - elseif (isset($query['id'])) - { - $catid = $query['id']; - } - - $menuCatid = $mId; - $categories = JCategories::getInstance('Newsfeeds'); - $category = $categories->get($catid); - - if ($category) - { - $path = $category->getPath(); - $path = array_reverse($path); - - $array = array(); - - foreach ($path as $id) - { - if ((int) $id == (int) $menuCatid) - { - break; - } - - if ($advanced) - { - list($tmp, $id) = explode(':', $id, 2); - } - - $array[] = $id; - } - - $segments = array_merge($segments, array_reverse($array)); - } - - if ($view == 'newsfeed') - { - if ($advanced) - { - list($tmp, $id) = explode(':', $query['id'], 2); - } - else - { - $id = $query['id']; - } - - $segments[] = $id; - } - } - - unset($query['id']); - unset($query['catid']); + JLoader::register('NewsfeedsRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php'); + $this->attachRule(new NewsfeedsRouterRulesLegacy($this)); } + } - if (isset($query['layout'])) + /** + * Method to get the segment(s) for a category + * + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getCategorySegment($id, $query) + { + $category = JCategories::getInstance($this->getName())->get($id); + if ($category) { - if (!empty($query['Itemid']) && isset($menuItem->query['layout'])) + if ($this->noIDs) { - if ($query['layout'] == $menuItem->query['layout']) + $path = array_reverse($category->getPath(), true); + foreach ($path as &$segment) { - unset($query['layout']); + list($id, $segment) = explode(':', $segment, 2); } + + return $path; } else { - if ($query['layout'] == 'default') - { - unset($query['layout']); - } + return array_reverse($category->getPath(), true); } } - $total = count($segments); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = str_replace(':', '-', $segments[$i]); - } - - return $segments; + return array(); } /** - * Parse the segments of a URL. - * - * @param array &$segments The segments of the URL to parse. + * Method to get the segment(s) for a category * - * @return array The URL attributes to be used by the application. + * @param string $id ID of the category to retrieve the segments for + * @param array $query The request that is build right now * - * @since 3.3 + * @return array|string The segments of this item */ - public function parse(&$segments) + public function getCategoriesSegment($id, $query) { - $total = count($segments); - $vars = array(); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); - } - - // Get the active menu item. - $item = $this->menu->getActive(); - $params = JComponentHelper::getParams('com_newsfeeds'); - $advanced = $params->get('sef_advanced_link', 0); - - // Count route segments - $count = count($segments); + return $this->getCategorySegment($id, $query); + } - // Standard routing for newsfeeds. - if (!isset($item)) + /** + * Method to get the segment(s) for a newsfeed + * + * @param string $id ID of the newsfeed to retrieve the segments for + * @param array $query The request that is build right now + * + * @return array|string The segments of this item + */ + public function getNewsfeedSegment($id, $query) + { + if ($this->noIDs) { - $vars['view'] = $segments[0]; - $vars['id'] = $segments[$count - 1]; + if (strpos($id, ':')) + { + list($void, $segment) = explode(':', $id, 2); - return $vars; + return array($void => $segment); + } + else + { + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('alias')) + ->from($dbquery->qn('#__newsfeeds')) + ->where('id = ' . $dbquery->q((int) $id)); + $db->setQuery($dbquery); + + return array($id => $id . ':' . $db->loadResult()); + } } - // From the categories view, we can only jump to a category. - $id = (isset($item->query['id']) && $item->query['id'] > 1) ? $item->query['id'] : 'root'; - $categories = JCategories::getInstance('Newsfeeds')->get($id)->getChildren(); - $vars['catid'] = $id; - $vars['id'] = $id; - $found = 0; + return array((int) $id => $id); + } - foreach ($segments as $segment) + /** + * Method to get the id for a category + * + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getCategoryId($segment, $query) + { + if (isset($query['id'])) { - $segment = $advanced ? str_replace(':', '-', $segment) : $segment; + $category = JCategories::getInstance($this->getName())->get($query['id']); - foreach ($categories as $category) + foreach ($category->getChildren() as $child) { - if ($category->slug == $segment || $category->alias == $segment) + if ($this->noIDs) { - $vars['id'] = $category->id; - $vars['catid'] = $category->id; - $vars['view'] = 'category'; - $categories = $category->getChildren(); - $found = 1; - - break; - } - } - - if ($found == 0) - { - if ($advanced) - { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from('#__newsfeeds') - ->where($db->quoteName('catid') . ' = ' . (int) $vars['catid']) - ->where($db->quoteName('alias') . ' = ' . $db->quote($segment)); - $db->setQuery($query); - $nid = $db->loadResult(); + if ($child->alias == $segment) + { + return $child->id; + } } else { - $nid = $segment; + if ($child->id == (int) $segment) + { + return $child->id; + } } - - $vars['id'] = $nid; - $vars['view'] = 'newsfeed'; } + } + + return false; + } - $found = 0; + /** + * Method to get the segment(s) for a category + * + * @param string $segment Segment to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getCategoriesId($segment, $query) + { + return $this->getCategoryId($segment, $query); + } + + /** + * Method to get the segment(s) for a newsfeed + * + * @param string $segment Segment of the newsfeed to retrieve the ID for + * @param array $query The request that is parsed right now + * + * @return mixed The id of this item or false + */ + public function getNewsfeedId($segment, $query) + { + if ($this->noIDs) + { + $db = JFactory::getDbo(); + $dbquery = $db->getQuery(true); + $dbquery->select($dbquery->qn('id')) + ->from($dbquery->qn('#__newsfeeds')) + ->where('alias = ' . $dbquery->q($segment)) + ->where('catid = ' . $dbquery->q($query['id'])); + $db->setQuery($dbquery); + + return (int) $db->loadResult(); } - return $vars; + return (int) $segment; } } @@ -260,7 +225,8 @@ public function parse(&$segments) */ function newsfeedsBuildRoute(&$query) { - $router = new NewsfeedsRouter; + $app = JFactory::getApplication(); + $router = new NewsfeedsRouter($app, $app->getMenu()); return $router->build($query); } @@ -276,7 +242,8 @@ function newsfeedsBuildRoute(&$query) */ function newsfeedsParseRoute($segments) { - $router = new NewsfeedsRouter; + $app = JFactory::getApplication(); + $router = new NewsfeedsRouter($app, $app->getMenu()); return $router->parse($segments); } diff --git a/components/com_newsfeeds/views/category/metadata.xml b/components/com_newsfeeds/views/category/metadata.xml deleted file mode 100644 index 31a1eeadf570d..0000000000000 --- a/components/com_newsfeeds/views/category/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/components/com_newsfeeds/views/category/tmpl/default.xml b/components/com_newsfeeds/views/category/tmpl/default.xml index 82b7208aa70df..a1cee53f43edf 100644 --- a/components/com_newsfeeds/views/category/tmpl/default.xml +++ b/components/com_newsfeeds/views/category/tmpl/default.xml @@ -10,17 +10,23 @@ - +
    - -
    diff --git a/components/com_newsfeeds/views/category/view.html.php b/components/com_newsfeeds/views/category/view.html.php index 1fbd85f4d6771..c8bf962946761 100644 --- a/components/com_newsfeeds/views/category/view.html.php +++ b/components/com_newsfeeds/views/category/view.html.php @@ -52,8 +52,7 @@ public function display($tpl = null) foreach ($this->items as $item) { $item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id; - $temp = new Registry; - $temp->loadString($item->params); + $temp = new Registry($item->params); $item->params = clone $this->params; $item->params->merge($temp); } @@ -70,9 +69,8 @@ protected function prepareDocument() { parent::prepareDocument(); - $id = (int) @$menu->query['id']; - $menu = $this->menu; + $id = (int) @$menu->query['id']; if ($menu && ($menu->query['option'] != 'com_newsfeeds' || $menu->query['view'] == 'newsfeed' || $id != $this->category->id)) { diff --git a/components/com_newsfeeds/views/newsfeed/metadata.xml b/components/com_newsfeeds/views/newsfeed/metadata.xml deleted file mode 100644 index ccc504b9a4854..0000000000000 --- a/components/com_newsfeeds/views/newsfeed/metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/components/com_newsfeeds/views/newsfeed/tmpl/default.php b/components/com_newsfeeds/views/newsfeed/tmpl/default.php index c78c818117fd5..7bb18bd4ac9d1 100644 --- a/components/com_newsfeeds/views/newsfeed/tmpl/default.php +++ b/components/com_newsfeeds/views/newsfeed/tmpl/default.php @@ -102,20 +102,28 @@ rssDoc[0])) { ?>
      - item->numarticles; $i++) { ?> - rssDoc[$i])) { break; } ?> - rssDoc[$i]->guid) || !is_null($this->rssDoc[$i]->guid) ? $this->rssDoc[$i]->guid : $this->rssDoc[$i]->uri; - $uri = substr($uri, 0, 4) != 'http' ? $this->item->link : $uri; - $text = !empty($this->rssDoc[$i]->content) || !is_null($this->rssDoc[$i]->content) ? $this->rssDoc[$i]->content : $this->rssDoc[$i]->description; - ?> + item->numarticles; $i++) + { + if (empty($this->rssDoc[$i])) + { + break; + } + ?> + rssDoc[$i]->guid) || !is_null($this->rssDoc[$i]->guid) ? trim($this->rssDoc[$i]->guid) : trim($this->rssDoc[$i]->uri); + $uri = substr($uri, 0, 4) != 'http' ? $this->item->link : $uri; + $text = !empty($this->rssDoc[$i]->content) || !is_null($this->rssDoc[$i]->content) ? trim($this->rssDoc[$i]->content) : trim($this->rssDoc[$i]->description); + $title = trim($this->rssDoc[$i]->title); + ?>
    1. - rssDoc[$i]->uri)) : ?> - - rssDoc[$i]->title; ?> + + -

      rssDoc[$i]->uri . '">' . $this->rssDoc[$i]->title . ''; ?>

      + + params->get('show_item_description') && !empty($text)) : ?>
      params->get('show_feed_image', 0) == 0) diff --git a/components/com_newsfeeds/views/newsfeed/tmpl/default.xml b/components/com_newsfeeds/views/newsfeed/tmpl/default.xml index 490c50b747f0c..422010aaeb08d 100644 --- a/components/com_newsfeeds/views/newsfeed/tmpl/default.xml +++ b/components/com_newsfeeds/views/newsfeed/tmpl/default.xml @@ -19,8 +19,10 @@ description="COM_NEWSFEEDS_FIELD_SELECT_FEED_DESC" label="COM_NEWSFEEDS_FIELD_SELECT_FEED_LABEL" required="true" + select="true" + new="true" edit="true" - clear="false" + clear="true" />
    diff --git a/components/com_newsfeeds/views/newsfeed/view.html.php b/components/com_newsfeeds/views/newsfeed/view.html.php index f11d73dcb68b9..ae163264506ed 100644 --- a/components/com_newsfeeds/views/newsfeed/view.html.php +++ b/components/com_newsfeeds/views/newsfeed/view.html.php @@ -83,16 +83,6 @@ public function display($tpl = null) $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; $item->parent_slug = $item->category_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; - // Check if cache directory is writeable - $cacheDir = JPATH_CACHE . '/'; - - if (!is_writable($cacheDir)) - { - JError::raiseNotice('0', JText::_('COM_NEWSFEEDS_CACHE_DIRECTORY_UNWRITABLE')); - - return; - } - // Merge newsfeed params. If this is single-newsfeed view, menu params override newsfeed params // Otherwise, newsfeed params override menu item params $params = $state->get('params'); @@ -163,8 +153,7 @@ public function display($tpl = null) // Get the newsfeed $newsfeed = $item; - $temp = new Registry; - $temp->loadString($item->params); + $temp = new Registry($item->params); $params->merge($temp); try @@ -195,15 +184,15 @@ public function display($tpl = null) // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); - $this->assignRef('params', $params); - $this->assignRef('newsfeed', $newsfeed); - $this->assignRef('state', $state); - $this->assignRef('item', $item); - $this->assignRef('user', $user); + $this->params = $params; + $this->newsfeed = $newsfeed; + $this->state = $state; + $this->item = $item; + $this->user = $user; if (!empty($msg)) { - $this->assignRef('msg', $msg); + $this->msg = $msg; } $this->print = $print; diff --git a/components/com_search/views/search/metadata.xml b/components/com_search/views/search/metadata.xml deleted file mode 100644 index 789b933a1dcac..0000000000000 --- a/components/com_search/views/search/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_search/views/search/view.html.php b/components/com_search/views/search/view.html.php index 1556490a688d7..1859fa8d636c1 100644 --- a/components/com_search/views/search/view.html.php +++ b/components/com_search/views/search/view.html.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; use Joomla\Registry\Registry; +use Joomla\String\StringHelper; /** * HTML View class for the search component @@ -27,7 +28,7 @@ class SearchViewSearch extends JViewLegacy */ public function display($tpl = null) { - require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/search.php'; + JLoader::register('SearchHelper', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/search.php'); $app = JFactory::getApplication(); $uri = JUri::getInstance(); @@ -48,8 +49,7 @@ public function display($tpl = null) // Because the application sets a default page title, we need to get it right from the menu item itself if (is_object($menu)) { - $menu_params = new Registry; - $menu_params->loadString($menu->params); + $menu_params = new Registry($menu->params); if (!$menu_params->get('page_title')) { @@ -140,7 +140,7 @@ public function display($tpl = null) $total = $this->get('total'); $pagination = $this->get('pagination'); - require_once JPATH_SITE . '/components/com_content/helpers/route.php'; + JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php'); for ($i = 0, $count = count($results); $i < $count; $i++) { @@ -177,8 +177,8 @@ public function display($tpl = null) { // E.g. german umlauts like ä are converted to ae and so // $pos calculated with $srow desn't match for $row - $correctPos = (JString::strlen($srow) > JString::strlen($row)); - $highlighterLen = JString::strlen($hl1 . $hl2); + $correctPos = (StringHelper::strlen($srow) > StringHelper::strlen($row)); + $highlighterLen = StringHelper::strlen($hl1 . $hl2); } foreach ($searchwords as $hlword) @@ -209,7 +209,7 @@ public function display($tpl = null) } else { - if (($pos = JString::strpos($srow, strtolower(SearchHelper::remove_accents($hlword)))) !== false) + if (($pos = StringHelper::strpos($srow, strtolower(SearchHelper::remove_accents($hlword)))) !== false) { // Iconv transliterates '€' to 'EUR' // TODO: add other expanding translations? @@ -219,9 +219,9 @@ public function display($tpl = null) if ($correctPos) { // Calculate necessary corrections from 0 to current $pos - $ChkRow = JString::substr($row, 0, $pos); - $sChkRowLen = JString::strlen(strtolower(SearchHelper::remove_accents($ChkRow))); - $ChkRowLen = JString::strlen($ChkRow); + $ChkRow = StringHelper::substr($row, 0, $pos); + $sChkRowLen = StringHelper::strlen(strtolower(SearchHelper::remove_accents($ChkRow))); + $ChkRowLen = StringHelper::strlen($ChkRow); // Correct $pos $pos -= ($sChkRowLen - $ChkRowLen); @@ -260,9 +260,9 @@ public function display($tpl = null) } else { - $hlwordLen = JString::strlen($hlword); - $row = JString::substr($row, 0, $pos) . $hl1 . JString::substr($row, $pos, JString::strlen($hlword)) - . $hl2 . JString::substr($row, $pos + JString::strlen($hlword)); + $hlwordLen = StringHelper::strlen($hlword); + $row = StringHelper::substr($row, 0, $pos) . $hl1 . StringHelper::substr($row, $pos, StringHelper::strlen($hlword)) + . $hl2 . StringHelper::substr($row, $pos + StringHelper::strlen($hlword)); } $cnt++; diff --git a/components/com_tags/controller.php b/components/com_tags/controller.php index 7103451f42fda..4aaed0864c0aa 100644 --- a/components/com_tags/controller.php +++ b/components/com_tags/controller.php @@ -26,7 +26,7 @@ class TagsController extends JControllerLegacy * * @since 3.1 */ - public function display($cachable = true, $urlparams = false) + public function display($cachable = false, $urlparams = false) { $user = JFactory::getUser(); @@ -34,7 +34,7 @@ public function display($cachable = true, $urlparams = false) $vName = $this->input->get('view', 'tags'); $this->input->set('view', $vName); - if ($user->get('id') ||($this->input->getMethod() == 'POST' && $vName = 'tags')) + if ($user->get('id') || ($this->input->getMethod() == 'POST' && $vName == 'tags')) { $cachable = false; } diff --git a/components/com_tags/metadata.xml b/components/com_tags/metadata.xml deleted file mode 100644 index 9205b30529a2a..0000000000000 --- a/components/com_tags/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 4c1bfd3299495..433000b8d8850 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Tags Component Tag Model * @@ -175,9 +177,7 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC') $this->setState('params', $params); // Load state from the request. - $ids = $app->input->get('id', array(), 'array'); - - JArrayHelper::toInteger($ids); + $ids = ArrayHelper::toInteger($app->input->get('id', array(), 'array')); $pkString = implode(',', $ids); @@ -193,7 +193,7 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC') // Sanitise $typesr = explode(',', $typesr); - JArrayHelper::toInteger($typesr); + $typesr = ArrayHelper::toInteger($typesr); $this->setState('tag.typesr', $typesr); } @@ -290,7 +290,7 @@ public function getItem($pk = null) // Convert the JTable to a clean JObject. $properties = $table->getProperties(1); - $this->item[] = JArrayHelper::toObject($properties, 'JObject'); + $this->item[] = ArrayHelper::toObject($properties, 'JObject'); } catch (RuntimeException $e) { diff --git a/components/com_tags/router.php b/components/com_tags/router.php index bcbb4babd3c28..9bec71e8c2bd2 100644 --- a/components/com_tags/router.php +++ b/components/com_tags/router.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Routing class from com_tags * @@ -47,7 +49,7 @@ public function build(&$query) if (is_array($mId)) { - JArrayHelper::toInteger($mId); + $mId = ArrayHelper::toInteger($mId); } $view = ''; diff --git a/components/com_tags/tags.php b/components/com_tags/tags.php index 6ebe271eb8c61..55d66b036a738 100644 --- a/components/com_tags/tags.php +++ b/components/com_tags/tags.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('TagsHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Tags'); $controller->execute(JFactory::getApplication()->input->get('task')); diff --git a/components/com_tags/views/tag/metadata.xml b/components/com_tags/views/tag/metadata.xml deleted file mode 100644 index 2b643b6396912..0000000000000 --- a/components/com_tags/views/tag/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/components/com_tags/views/tag/tmpl/default.xml b/components/com_tags/views/tag/tmpl/default.xml index c927d38bf419f..99c5ba81562ab 100644 --- a/components/com_tags/views/tag/tmpl/default.xml +++ b/components/com_tags/views/tag/tmpl/default.xml @@ -253,15 +253,6 @@
    - - - diff --git a/components/com_tags/views/tag/view.html.php b/components/com_tags/views/tag/view.html.php index a1a08487354e6..faf4826270b41 100644 --- a/components/com_tags/views/tag/view.html.php +++ b/components/com_tags/views/tag/view.html.php @@ -76,8 +76,7 @@ public function display($tpl = null) // Prepare the data. if (!empty($itemElement)) { - $temp = new Registry; - $temp->loadString($itemElement->params); + $temp = new Registry($itemElement->params); $itemElement->params = clone $params; $itemElement->params->merge($temp); $itemElement->params = (array) json_decode($itemElement->params); @@ -206,7 +205,12 @@ protected function _prepareDocument() // we need to get it from the menu item itself $menu = $menus->getActive(); - if ($menu) + if ($this->tags_title) + { + $this->params->def('page_heading', $this->tags_title); + $title = $this->tags_title; + } + elseif ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); $title = $this->params->get('page_title', $menu->title); @@ -216,11 +220,6 @@ protected function _prepareDocument() $this->params->set('page_subheading', $menu->title); } } - else - { - $this->params->def('page_heading', $this->tags_title); - $title = $this->tags_title; - } if (empty($title)) { diff --git a/components/com_tags/views/tags/view.html.php b/components/com_tags/views/tags/view.html.php index 2a828390f21fa..dc8a7d1e23725 100644 --- a/components/com_tags/views/tags/view.html.php +++ b/components/com_tags/views/tags/view.html.php @@ -68,8 +68,7 @@ public function display($tpl = null) } // Prepare the data. - $temp = new Registry; - $temp->loadString($itemElement->params); + $temp = new Registry($itemElement->params); $itemElement->params = clone $params; $itemElement->params->merge($temp); $itemElement->params = (array) json_decode($itemElement->params); @@ -262,6 +261,22 @@ protected function _prepareDocument() } } + // Respect configuration Sitename Before/After for TITLE in views All Tags. + if (!$title && ($pos = $app->get('sitename_pagetitles', 0))) + { + $title = $this->document->getTitle(); + + if ($pos == 1) + { + $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); + } + else + { + $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); + } + $this->document->setTitle($title); + } + // Add alternative feed link if ($this->params->get('show_feed_link', 1) == 1) { diff --git a/components/com_users/controllers/profile.json.php b/components/com_users/controllers/profile.json.php index 6426a222b064e..380fe3287f1b8 100644 --- a/components/com_users/controllers/profile.json.php +++ b/components/com_users/controllers/profile.json.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_SITE . '/components/com_users/controllers/profile_base_json.php'; +JLoader::register('UsersControllerProfile_Base_Json', __DIR__ . '/profile_base_json.php'); /** * Profile controller class for Users. diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index c9efdc6e835b8..5b13244b89ec2 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Profile controller class for Users. @@ -90,7 +90,7 @@ public function edit() public function save() { // Check for request forgeries. - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken(); $app = JFactory::getApplication(); $model = $this->getModel('Profile', 'UsersModel'); @@ -98,10 +98,10 @@ public function save() $userId = (int) $user->get('id'); // Get the user data. - $data = $app->input->post->get('jform', array(), 'array'); + $requestData = $app->input->post->get('jform', array(), 'array'); // Force the ID to this user. - $data['id'] = $userId; + $requestData['id'] = $userId; // Validate the posted data. $form = $model->getForm(); @@ -114,7 +114,7 @@ public function save() } // Validate the posted data. - $data = $model->validate($form, $data); + $data = $model->validate($form, $requestData); // Check for errors. if ($data === false) @@ -135,8 +135,12 @@ public function save() } } + // Unset the passwords. + unset($requestData['password1']); + unset($requestData['password2']); + // Save the data in the session. - $app->setUserState('com_users.edit.profile.data', $data); + $app->setUserState('com_users.edit.profile.data', $requestData); // Redirect back to the edit screen. $userId = (int) $app->getUserState('com_users.edit.profile.id'); diff --git a/components/com_users/controllers/registration.php b/components/com_users/controllers/registration.php index b2c17c6616616..92eaccb3a1118 100644 --- a/components/com_users/controllers/registration.php +++ b/components/com_users/controllers/registration.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Registration controller class for Users. @@ -64,7 +64,7 @@ public function activate() // Check for errors. if ($return === false) { - // Redirect back to the homepage. + // Redirect back to the home page. $this->setMessage(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()), 'warning'); $this->setRedirect('index.php'); @@ -108,7 +108,7 @@ public function activate() public function register() { // Check for request forgeries. - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken(); // If registration is disabled - Redirect to login page. if (JComponentHelper::getParams('com_users')->get('allowUserRegistration') == 0) diff --git a/components/com_users/controllers/remind.php b/components/com_users/controllers/remind.php index 7c297d022291a..32c71fe8c7cba 100644 --- a/components/com_users/controllers/remind.php +++ b/components/com_users/controllers/remind.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Reset controller class for Users. @@ -28,40 +28,30 @@ class UsersControllerRemind extends UsersController public function remind() { // Check the request token. - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('post'); $model = $this->getModel('Remind', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Submit the password reset request. - $return = $model->processRemindRequest($data); + $return = $model->processRemindRequest($data); // Check for a hard error. if ($return == false) { // The request failed. - // Get the route to the next page. - $itemid = UsersHelperRoute::getRemindRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=remind' . $itemid; - // Go back to the request form. $message = JText::sprintf('COM_USERS_REMIND_REQUEST_FAILED', $model->getError()); - $this->setRedirect(JRoute::_($route, false), $message, 'notice'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=remind', false), $message, 'notice'); return false; } else { // The request succeeded. - // Get the route to the next page. - $itemid = UsersHelperRoute::getRemindRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=login' . $itemid; - // Proceed to step two. $message = JText::_('COM_USERS_REMIND_REQUEST_SUCCESS'); - $this->setRedirect(JRoute::_($route, false), $message); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false), $message); return true; } diff --git a/components/com_users/controllers/reset.php b/components/com_users/controllers/reset.php index cca19ef6cfe8e..68ea60f3ef11e 100644 --- a/components/com_users/controllers/reset.php +++ b/components/com_users/controllers/reset.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Reset controller class for Users. @@ -28,14 +28,14 @@ class UsersControllerReset extends UsersController public function request() { // Check the request token. - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('post'); $app = JFactory::getApplication(); $model = $this->getModel('Reset', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Submit the password reset request. - $return = $model->processResetRequest($data); + $return = $model->processResetRequest($data); // Check for a hard error. if ($return instanceof Exception) @@ -50,40 +50,25 @@ public function request() $message = JText::_('COM_USERS_RESET_REQUEST_ERROR'); } - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset' . $itemid; - // Go back to the request form. - $this->setRedirect(JRoute::_($route, false), $message, 'error'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $message, 'error'); return false; } elseif ($return === false) { // The request failed. - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset' . $itemid; - // Go back to the request form. $message = JText::sprintf('COM_USERS_RESET_REQUEST_FAILED', $model->getError()); - $this->setRedirect(JRoute::_($route, false), $message, 'notice'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset', false), $message, 'notice'); return false; } else { // The request succeeded. - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=confirm' . $itemid; - // Proceed to step two. - $this->setRedirect(JRoute::_($route, false)); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false)); return true; } @@ -100,14 +85,14 @@ public function request() public function confirm() { // Check the request token. - JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('request'); $app = JFactory::getApplication(); $model = $this->getModel('Reset', 'UsersModel'); $data = $this->input->get('jform', array(), 'array'); // Confirm the password reset request. - $return = $model->processResetConfirm($data); + $return = $model->processResetConfirm($data); // Check for a hard error. if ($return instanceof Exception) @@ -122,40 +107,25 @@ public function confirm() $message = JText::_('COM_USERS_RESET_CONFIRM_ERROR'); } - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=confirm' . $itemid; - // Go back to the confirm form. - $this->setRedirect(JRoute::_($route, false), $message, 'error'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false), $message, 'error'); return false; } elseif ($return === false) { // Confirm failed. - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=confirm' . $itemid; - // Go back to the confirm form. $message = JText::sprintf('COM_USERS_RESET_CONFIRM_FAILED', $model->getError()); - $this->setRedirect(JRoute::_($route, false), $message, 'notice'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=confirm', false), $message, 'notice'); return false; } else { // Confirm succeeded. - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=complete' . $itemid; - // Proceed to step three. - $this->setRedirect(JRoute::_($route, false)); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false)); return true; } @@ -171,14 +141,14 @@ public function confirm() public function complete() { // Check for request forgeries - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('post'); $app = JFactory::getApplication(); $model = $this->getModel('Reset', 'UsersModel'); $data = $this->input->post->get('jform', array(), 'array'); // Complete the password reset request. - $return = $model->processResetComplete($data); + $return = $model->processResetComplete($data); // Check for a hard error. if ($return instanceof Exception) @@ -193,41 +163,26 @@ public function complete() $message = JText::_('COM_USERS_RESET_COMPLETE_ERROR'); } - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=complete' . $itemid; - // Go back to the complete form. - $this->setRedirect(JRoute::_($route, false), $message, 'error'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false), $message, 'error'); return false; } elseif ($return === false) { // Complete failed. - // Get the route to the next page. - $itemid = UsersHelperRoute::getResetRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=reset&layout=complete' . $itemid; - // Go back to the complete form. $message = JText::sprintf('COM_USERS_RESET_COMPLETE_FAILED', $model->getError()); - $this->setRedirect(JRoute::_($route, false), $message, 'notice'); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=reset&layout=complete', false), $message, 'notice'); return false; } else { // Complete succeeded. - // Get the route to the next page. - $itemid = UsersHelperRoute::getLoginRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $route = 'index.php?option=com_users&view=login' . $itemid; - // Proceed to the login form. $message = JText::_('COM_USERS_RESET_COMPLETE_SUCCESS'); - $this->setRedirect(JRoute::_($route, false), $message); + $this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false), $message); return true; } diff --git a/components/com_users/controllers/user.php b/components/com_users/controllers/user.php index 2b9d1c52d9bb0..9aa27bd68e525 100644 --- a/components/com_users/controllers/user.php +++ b/components/com_users/controllers/user.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/controller.php'; +JLoader::register('UsersController', JPATH_COMPONENT . '/controller.php'); /** * Registration controller class for Users. @@ -27,7 +27,7 @@ class UsersControllerUser extends UsersController */ public function login() { - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('post'); $app = JFactory::getApplication(); $input = $app->input; @@ -142,7 +142,7 @@ public function login() */ public function logout() { - JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('request'); $app = JFactory::getApplication(); @@ -204,9 +204,9 @@ public function logout() else { // Don't redirect to an external URL. - if (!JUri::isInternal($data['return'])) + if (!JUri::isInternal($return)) { - $data['return'] = ''; + $return = ''; } } @@ -217,7 +217,7 @@ public function logout() /** * Method to logout directly and redirect to page. * - * @return boolean + * @return void * * @since 3.5 */ @@ -284,88 +284,7 @@ public function menulogout() } /** - * Method to register a user. - * - * @return boolean - * - * @since 1.6 - */ - public function register() - { - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); - - // Get the application - $app = JFactory::getApplication(); - - // Get the form data. - $data = $this->input->post->get('user', array(), 'array'); - - // Get the model and validate the data. - $model = $this->getModel('Registration', 'UsersModel'); - - $form = $model->getForm(); - - if (!$form) - { - JError::raiseError(500, $model->getError()); - - return false; - } - - $return = $model->validate($form, $data); - - // Check for errors. - if ($return === false) - { - // Get the validation messages. - $errors = $model->getErrors(); - - // 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) - { - $app->enqueueMessage($errors[$i]->getMessage(), 'notice'); - - continue; - } - - $app->enqueueMessage($errors[$i], 'notice'); - } - - // Save the data in the session. - $app->setUserState('users.registration.form.data', $data); - - // Redirect back to the registration form. - $this->setRedirect('index.php?option=com_users&view=registration'); - - return false; - } - - // Finish the registration. - $return = $model->register($data); - - // Check for errors. - if ($return === false) - { - // Save the data in the session. - $app->setUserState('users.registration.form.data', $data); - - // Redirect back to the registration form. - $message = JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $model->getError()); - $this->setRedirect('index.php?option=com_users&view=registration', $message, 'error'); - - return false; - } - - // Flush the data from the session. - $app->setUserState('users.registration.form.data', null); - - return true; - } - - /** - * Method to login a user. + * Method to request a username reminder. * * @return boolean * @@ -374,7 +293,7 @@ public function register() public function remind() { // Check the request token. - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + $this->checkToken('post'); $app = JFactory::getApplication(); $model = $this->getModel('User', 'UsersModel'); @@ -431,7 +350,7 @@ public function remind() } /** - * Method to login a user. + * Method to resend a user. * * @return void * @@ -440,6 +359,6 @@ public function remind() public function resend() { // Check for request forgeries - JSession::checkToken('post') or jexit(JText::_('JINVALID_TOKEN')); + // $this->checkToken('post'); } } diff --git a/components/com_users/helpers/legacyrouter.php b/components/com_users/helpers/legacyrouter.php new file mode 100644 index 0000000000000..0bb6eaa6f540e --- /dev/null +++ b/components/com_users/helpers/legacyrouter.php @@ -0,0 +1,294 @@ +router = $router; + } + + /** + * Preprocess the route for the com_users component + * + * @param array &$query An array of URL arguments + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function preprocess(&$query) + { + } + + /** + * Build the route for the com_users component + * + * @param array &$query An array of URL arguments + * @param array &$segments The URL arguments to use to assemble the subsequent URL. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function build(&$query, &$segments) + { + // Declare static variables. + static $items; + static $default; + static $registration; + static $profile; + static $login; + static $remind; + static $resend; + static $reset; + + // Get the relevant menu items if not loaded. + if (empty($items)) + { + // Get all relevant menu items. + $items = $this->router->menu->getItems('component', 'com_users'); + + // Build an array of serialized query strings to menu item id mappings. + for ($i = 0, $n = count($items); $i < $n; $i++) + { + // Check to see if we have found the resend menu item. + if (empty($resend) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'resend')) + { + $resend = $items[$i]->id; + } + + // Check to see if we have found the reset menu item. + if (empty($reset) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'reset')) + { + $reset = $items[$i]->id; + } + + // Check to see if we have found the remind menu item. + if (empty($remind) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'remind')) + { + $remind = $items[$i]->id; + } + + // Check to see if we have found the login menu item. + if (empty($login) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'login')) + { + $login = $items[$i]->id; + } + + // Check to see if we have found the registration menu item. + if (empty($registration) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'registration')) + { + $registration = $items[$i]->id; + } + + // Check to see if we have found the profile menu item. + if (empty($profile) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'profile')) + { + $profile = $items[$i]->id; + } + } + + // Set the default menu item to use for com_users if possible. + if ($profile) + { + $default = $profile; + } + elseif ($registration) + { + $default = $registration; + } + elseif ($login) + { + $default = $login; + } + } + + if (!empty($query['view'])) + { + switch ($query['view']) + { + case 'reset': + if ($query['Itemid'] = $reset) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + break; + + case 'resend': + if ($query['Itemid'] = $resend) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + break; + + case 'remind': + if ($query['Itemid'] = $remind) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + break; + + case 'login': + if ($query['Itemid'] = $login) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + break; + + case 'registration': + if ($query['Itemid'] = $registration) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + break; + + default: + case 'profile': + if (!empty($query['view'])) + { + $segments[] = $query['view']; + } + + unset ($query['view']); + + if ($query['Itemid'] = $profile) + { + unset ($query['view']); + } + else + { + $query['Itemid'] = $default; + } + + // Only append the user id if not "me". + $user = JFactory::getUser(); + + if (!empty($query['user_id']) && ($query['user_id'] != $user->id)) + { + $segments[] = $query['user_id']; + } + + unset ($query['user_id']); + + break; + } + } + + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = str_replace(':', '-', $segments[$i]); + } + } + + /** + * Parse the segments of a URL. + * + * @param array &$segments The segments of the URL to parse. + * @param array &$vars The URL attributes to be used by the application. + * + * @return void + * + * @since 3.6 + * @deprecated 4.0 + */ + public function parse(&$segments, &$vars) + { + $total = count($segments); + + for ($i = 0; $i < $total; $i++) + { + $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); + } + + // Only run routine if there are segments to parse. + if (count($segments) < 1) + { + return; + } + + // Get the package from the route segments. + $userId = array_pop($segments); + + if (!is_numeric($userId)) + { + $vars['view'] = 'profile'; + + return; + } + + if (is_numeric($userId)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__users')) + ->where($db->quoteName('id') . ' = ' . (int) $userId); + $db->setQuery($query); + $userId = $db->loadResult(); + } + + // Set the package id if present. + if ($userId) + { + // Set the package id. + $vars['user_id'] = (int) $userId; + + // Set the view to package if not already set. + if (empty($vars['view'])) + { + $vars['view'] = 'profile'; + } + } + else + { + JError::raiseError(404, JText::_('JGLOBAL_RESOURCE_NOT_FOUND')); + } + } +} diff --git a/components/com_users/helpers/route.php b/components/com_users/helpers/route.php index cdca8373d3f1c..5a9fa797f0ab1 100644 --- a/components/com_users/helpers/route.php +++ b/components/com_users/helpers/route.php @@ -12,7 +12,8 @@ /** * Users Route Helper * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ class UsersHelperRoute { @@ -21,7 +22,8 @@ class UsersHelperRoute * * @return array An array of menu items. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function &getItems() { @@ -50,8 +52,8 @@ public static function &getItems() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 - * @static + * @since 1.6 + * @deprecated 4.0 */ public static function getLoginRoute() { @@ -77,7 +79,8 @@ public static function getLoginRoute() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function getProfileRoute() { @@ -105,7 +108,8 @@ public static function getProfileRoute() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function getRegistrationRoute() { @@ -131,7 +135,8 @@ public static function getRegistrationRoute() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function getRemindRoute() { @@ -157,7 +162,8 @@ public static function getRemindRoute() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function getResendRoute() { @@ -183,7 +189,8 @@ public static function getResendRoute() * * @return mixed Integer menu id on success, null on failure. * - * @since 1.6 + * @since 1.6 + * @deprecated 4.0 */ public static function getResetRoute() { diff --git a/components/com_users/metadata.xml b/components/com_users/metadata.xml deleted file mode 100644 index 9205b30529a2a..0000000000000 --- a/components/com_users/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/components/com_users/models/profile.php b/components/com_users/models/profile.php index 6fb8bbc708fbe..d880d469170b8 100644 --- a/components/com_users/models/profile.php +++ b/components/com_users/models/profile.php @@ -35,17 +35,17 @@ class UsersModelProfile extends JModelForm */ public function __construct($config = array()) { - parent::__construct($config); + $config = array_merge( + array( + 'events_map' => array('validate' => 'user') + ), $config + ); - // Load the Joomla! RAD layer - if (!defined('FOF_INCLUDED')) - { - include_once JPATH_LIBRARIES . '/fof/include.php'; - } + parent::__construct($config); // Load the helper and model used for two factor authentication - require_once JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'; - require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; + JLoader::register('UsersModelUser', JPATH_ADMINISTRATOR . '/components/com_users/models/user.php'); + JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'); } /** @@ -192,6 +192,10 @@ public function getForm($data = array(), $loadData = true) return false; } + // For com_fields the context is com_users.user + JLoader::import('components.com_fields.helpers.fields', JPATH_ADMINISTRATOR); + FieldsHelper::prepareForm('com_users.user', $form, $data); + // Check for username compliance and parameter set $isUsernameCompliant = true; diff --git a/components/com_users/models/registration.php b/components/com_users/models/registration.php index f7951d698483b..64c3d5d897b2d 100644 --- a/components/com_users/models/registration.php +++ b/components/com_users/models/registration.php @@ -22,6 +22,26 @@ class UsersModelRegistration extends JModelForm */ protected $data; + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * + * @since 3.6 + * + * @throws Exception + */ + public function __construct($config = array()) + { + $config = array_merge( + array( + 'events_map' => array('validate' => 'user') + ), $config + ); + + parent::__construct($config); + } + /** * Method to activate a user account. * diff --git a/components/com_users/models/remind.php b/components/com_users/models/remind.php index c6238558e9026..fd96b0944d797 100644 --- a/components/com_users/models/remind.php +++ b/components/com_users/models/remind.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\Utilities\ArrayHelper; + /** * Remind model class for Users. * @@ -158,13 +160,11 @@ public function processRemindRequest($data) $config = JFactory::getConfig(); // Assemble the login link. - $itemid = UsersHelperRoute::getLoginRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $link = 'index.php?option=com_users&view=login' . $itemid; + $link = 'index.php?option=com_users&view=login'; $mode = $config->get('force_ssl', 0) == 2 ? 1 : (-1); // Put together the email template data. - $data = JArrayHelper::fromObject($user); + $data = ArrayHelper::fromObject($user); $data['fromname'] = $config->get('fromname'); $data['mailfrom'] = $config->get('mailfrom'); $data['sitename'] = $config->get('sitename'); diff --git a/components/com_users/models/reset.php b/components/com_users/models/reset.php index eef0d87187639..ed37b3191e364 100644 --- a/components/com_users/models/reset.php +++ b/components/com_users/models/reset.php @@ -447,9 +447,7 @@ public function processResetRequest($data) // Assemble the password reset confirmation link. $mode = $config->get('force_ssl', 0) == 2 ? 1 : (-1); - $itemid = UsersHelperRoute::getLoginRoute(); - $itemid = $itemid !== null ? '&Itemid=' . $itemid : ''; - $link = 'index.php?option=com_users&view=reset&layout=confirm&token=' . $token . $itemid; + $link = 'index.php?option=com_users&view=reset&layout=confirm&token=' . $token; // Put together the email template data. $data = $user->getProperties(); diff --git a/components/com_users/router.php b/components/com_users/router.php index 082b73e90532a..84d5d1c6740c1 100644 --- a/components/com_users/router.php +++ b/components/com_users/router.php @@ -14,257 +14,40 @@ * * @since 3.2 */ -class UsersRouter extends JComponentRouterBase +class UsersRouter extends JComponentRouterView { /** - * Build the route for the com_users component + * Users Component router constructor * - * @param array &$query An array of URL arguments - * - * @return array The URL arguments to use to assemble the subsequent URL. - * - * @since 3.3 + * @param JApplicationCms $app The application object + * @param JMenu $menu The menu object to work with */ - public function build(&$query) + public function __construct($app = null, $menu = null) { - // Declare static variables. - static $items; - static $default; - static $registration; - static $profile; - static $login; - static $remind; - static $resend; - static $reset; - - $segments = array(); - - // Get the relevant menu items if not loaded. - if (empty($items)) - { - // Get all relevant menu items. - $items = $this->menu->getItems('component', 'com_users'); - - // Build an array of serialized query strings to menu item id mappings. - for ($i = 0, $n = count($items); $i < $n; $i++) - { - // Check to see if we have found the resend menu item. - if (empty($resend) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'resend')) - { - $resend = $items[$i]->id; - } - - // Check to see if we have found the reset menu item. - if (empty($reset) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'reset')) - { - $reset = $items[$i]->id; - } + $this->registerView(new JComponentRouterViewconfiguration('login')); + $profile = new JComponentRouterViewconfiguration('profile'); + $profile->addLayout('edit'); + $this->registerView($profile); + $this->registerView(new JComponentRouterViewconfiguration('registration')); + $this->registerView(new JComponentRouterViewconfiguration('remind')); + $this->registerView(new JComponentRouterViewconfiguration('reset')); - // Check to see if we have found the remind menu item. - if (empty($remind) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'remind')) - { - $remind = $items[$i]->id; - } + parent::__construct($app, $menu); - // Check to see if we have found the login menu item. - if (empty($login) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'login')) - { - $login = $items[$i]->id; - } + $this->attachRule(new JComponentRouterRulesMenu($this)); - // Check to see if we have found the registration menu item. - if (empty($registration) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'registration')) - { - $registration = $items[$i]->id; - } + $params = JComponentHelper::getParams('com_content'); - // Check to see if we have found the profile menu item. - if (empty($profile) && !empty($items[$i]->query['view']) && ($items[$i]->query['view'] == 'profile')) - { - $profile = $items[$i]->id; - } - } - - // Set the default menu item to use for com_users if possible. - if ($profile) - { - $default = $profile; - } - elseif ($registration) - { - $default = $registration; - } - elseif ($login) - { - $default = $login; - } - } - - if (!empty($query['view'])) + if ($params->get('sef_advanced', 0)) { - switch ($query['view']) - { - case 'reset': - if ($query['Itemid'] = $reset) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - break; - - case 'resend': - if ($query['Itemid'] = $resend) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - break; - - case 'remind': - if ($query['Itemid'] = $remind) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - break; - - case 'login': - if ($query['Itemid'] = $login) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - break; - - case 'registration': - if ($query['Itemid'] = $registration) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - break; - - default: - case 'profile': - if (!empty($query['view'])) - { - $segments[] = $query['view']; - } - - unset ($query['view']); - - if ($query['Itemid'] = $profile) - { - unset ($query['view']); - } - else - { - $query['Itemid'] = $default; - } - - // Only append the user id if not "me". - $user = JFactory::getUser(); - - if (!empty($query['user_id']) && ($query['user_id'] != $user->id)) - { - $segments[] = $query['user_id']; - } - - unset ($query['user_id']); - - break; - } - } - - $total = count($segments); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = str_replace(':', '-', $segments[$i]); - } - - return $segments; - } - - /** - * Parse the segments of a URL. - * - * @param array &$segments The segments of the URL to parse. - * - * @return array The URL attributes to be used by the application. - * - * @since 3.3 - */ - public function parse(&$segments) - { - $total = count($segments); - $vars = array(); - - for ($i = 0; $i < $total; $i++) - { - $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1); - } - - // Only run routine if there are segments to parse. - if (count($segments) < 1) - { - return; - } - - // Get the package from the route segments. - $userId = array_pop($segments); - - if (!is_numeric($userId)) - { - $vars['view'] = 'profile'; - - return $vars; - } - - if (is_numeric($userId)) - { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from($db->quoteName('#__users')) - ->where($db->quoteName('id') . ' = ' . (int) $userId); - $db->setQuery($query); - $userId = $db->loadResult(); - } - - // Set the package id if present. - if ($userId) - { - // Set the package id. - $vars['user_id'] = (int) $userId; - - // Set the view to package if not already set. - if (empty($vars['view'])) - { - $vars['view'] = 'profile'; - } + $this->attachRule(new JComponentRouterRulesStandard($this)); + $this->attachRule(new JComponentRouterRulesNomenu($this)); } else { - JError::raiseError(404, JText::_('JGLOBAL_RESOURCE_NOT_FOUND')); + JLoader::register('UsersRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php'); + $this->attachRule(new UsersRouterRulesLegacy($this)); } - - return $vars; } } @@ -282,7 +65,8 @@ public function parse(&$segments) */ function usersBuildRoute(&$query) { - $router = new UsersRouter; + $app = JFactory::getApplication(); + $router = new UsersRouter($app, $app->getMenu()); return $router->build($query); } @@ -298,7 +82,8 @@ function usersBuildRoute(&$query) */ function usersParseRoute($segments) { - $router = new UsersRouter; + $app = JFactory::getApplication(); + $router = new UsersRouter($app, $app->getMenu()); return $router->parse($segments); } diff --git a/components/com_users/users.php b/components/com_users/users.php index 99cbdc522d16c..2138d06f84b0c 100644 --- a/components/com_users/users.php +++ b/components/com_users/users.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -require_once JPATH_COMPONENT . '/helpers/route.php'; +JLoader::register('UsersHelperRoute', JPATH_COMPONENT . '/helpers/route.php'); $controller = JControllerLegacy::getInstance('Users'); $controller->execute(JFactory::getApplication()->input->get('task', 'display')); diff --git a/components/com_users/views/login/metadata.xml b/components/com_users/views/login/metadata.xml deleted file mode 100644 index a2b688144ca65..0000000000000 --- a/components/com_users/views/login/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_users/views/login/tmpl/default.xml b/components/com_users/views/login/tmpl/default.xml index 7093be4bcaeec..75d3b25983ae2 100644 --- a/components/com_users/views/login/tmpl/default.xml +++ b/components/com_users/views/login/tmpl/default.xml @@ -42,11 +42,15 @@ @@ -111,11 +115,15 @@ diff --git a/components/com_users/views/login/tmpl/logout.xml b/components/com_users/views/login/tmpl/logout.xml index b30f9cf04c51e..d82b092b92c8e 100644 --- a/components/com_users/views/login/tmpl/logout.xml +++ b/components/com_users/views/login/tmpl/logout.xml @@ -23,10 +23,14 @@
    diff --git a/components/com_users/views/login/view.html.php b/components/com_users/views/login/view.html.php index 884f7a63fe938..753e89e9ab565 100644 --- a/components/com_users/views/login/view.html.php +++ b/components/com_users/views/login/view.html.php @@ -57,8 +57,7 @@ public function display($tpl = null) $this->setLayout($active->query['layout']); } - require_once JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php'; - $tfa = UsersHelper::getTwoFactorMethods(); + $tfa = JAuthenticationHelper::getTwoFactorMethods(); $this->tfa = is_array($tfa) && count($tfa) > 1; // Escape strings for HTML output diff --git a/components/com_users/views/profile/metadata.xml b/components/com_users/views/profile/metadata.xml deleted file mode 100644 index 27d48370f6eb1..0000000000000 --- a/components/com_users/views/profile/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_users/views/profile/tmpl/default_core.php b/components/com_users/views/profile/tmpl/default_core.php index a98637b65e57c..299ac0c25c19d 100644 --- a/components/com_users/views/profile/tmpl/default_core.php +++ b/components/com_users/views/profile/tmpl/default_core.php @@ -38,7 +38,7 @@ - data->lastvisitDate != '0000-00-00 00:00:00') : ?> + data->lastvisitDate != $this->db->getNullDate()) : ?>
    data->lastvisitDate); ?>
    diff --git a/components/com_users/views/profile/tmpl/default_custom.php b/components/com_users/views/profile/tmpl/default_custom.php index edd13c0c93bd5..8876039cd5ec0 100644 --- a/components/com_users/views/profile/tmpl/default_custom.php +++ b/components/com_users/views/profile/tmpl/default_custom.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php'); +JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::register('users.spacer', array('JHtmlUsers', 'spacer')); $fieldsets = $this->form->getFieldsets(); @@ -23,6 +23,14 @@ { unset($fieldsets['params']); } + +$tmp = isset($this->data->fields) ? $this->data->fields : array(); +$customFields = array(); + +foreach ($tmp as $customField) +{ + $customFields[$customField->alias] = $customField; +} ?> $fieldset) : ?> form->getFieldset($group); ?> @@ -36,7 +44,9 @@ hidden && $field->type !== 'Spacer') : ?>
    title; ?>
    - id)) : ?> + fieldname, $customFields)) : ?> + fieldname]->value; ?> + id)) : ?> id, $field->value); ?> fieldname)) : ?> fieldname, $field->value); ?> diff --git a/components/com_users/views/profile/tmpl/default_params.php b/components/com_users/views/profile/tmpl/default_params.php index 53bd37efefa11..2b254503e0f31 100644 --- a/components/com_users/views/profile/tmpl/default_params.php +++ b/components/com_users/views/profile/tmpl/default_params.php @@ -9,13 +9,7 @@ defined('_JEXEC') or die; -JLoader::register('JHtmlUsers', JPATH_COMPONENT . '/helpers/html/users.php'); -JHtml::register('users.spacer', array('JHtmlUsers', 'spacer')); -JHtml::register('users.helpsite', array('JHtmlUsers', 'helpsite')); -JHtml::register('users.templatestyle', array('JHtmlUsers', 'templatestyle')); -JHtml::register('users.admin_language', array('JHtmlUsers', 'admin_language')); -JHtml::register('users.language', array('JHtmlUsers', 'language')); -JHtml::register('users.editor', array('JHtmlUsers', 'editor')); +JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); ?> form->getFieldset('params'); ?> diff --git a/components/com_users/views/profile/tmpl/edit.php b/components/com_users/views/profile/tmpl/edit.php index 668cbda9072c8..01e06f4ba0fe4 100644 --- a/components/com_users/views/profile/tmpl/edit.php +++ b/components/com_users/views/profile/tmpl/edit.php @@ -55,6 +55,9 @@ label); ?> + description) && trim($fieldset->description)): ?> + ' . $this->escape(JText::_($fieldset->description)) . '

    '; ?> + diff --git a/components/com_users/views/profile/view.html.php b/components/com_users/views/profile/view.html.php index 4a755fb9bf4b9..8b4e76512e053 100644 --- a/components/com_users/views/profile/view.html.php +++ b/components/com_users/views/profile/view.html.php @@ -24,6 +24,14 @@ class UsersViewProfile extends JViewLegacy protected $state; + /** + * An instance of JDatabaseDriver. + * + * @var JDatabaseDriver + * @since 3.6.3 + */ + protected $db; + /** * Execute and display a template script. * @@ -35,14 +43,17 @@ class UsersViewProfile extends JViewLegacy */ public function display($tpl = null) { + $user = JFactory::getUser(); + // Get the view data. $this->data = $this->get('Data'); - $this->form = $this->get('Form'); + $this->form = $this->getModel()->getForm(new JObject(array('id' => $user->id))); $this->state = $this->get('State'); $this->params = $this->state->get('params'); $this->twofactorform = $this->get('Twofactorform'); $this->twofactormethods = UsersHelper::getTwoFactorMethods(); $this->otpConfig = $this->get('OtpConfig'); + $this->db = JFactory::getDbo(); // Check for errors. if (count($errors = $this->get('Errors'))) @@ -53,7 +64,6 @@ public function display($tpl = null) } // View also takes responsibility for checking if the user logged in with remember me. - $user = JFactory::getUser(); $cookieLogin = $user->get('cookieLogin'); if (!empty($cookieLogin)) @@ -78,6 +88,11 @@ public function display($tpl = null) $this->data->tags = new JHelperTags; $this->data->tags->getItemTags('com_users.user.', $this->data->id); + JPluginHelper::importPlugin('content'); + $this->data->text = ''; + JEventDispatcher::getInstance()->trigger('onContentPrepare', array ('com_users.user', &$this->data, &$this->data->params, 0)); + unset($this->data->text); + // Check for layout override $active = JFactory::getApplication()->getMenu()->getActive(); diff --git a/components/com_users/views/registration/metadata.xml b/components/com_users/views/registration/metadata.xml deleted file mode 100644 index 413d796845c8c..0000000000000 --- a/components/com_users/views/registration/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_users/views/remind/metadata.xml b/components/com_users/views/remind/metadata.xml deleted file mode 100644 index 6d0f32112bc20..0000000000000 --- a/components/com_users/views/remind/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_users/views/reset/metadata.xml b/components/com_users/views/reset/metadata.xml deleted file mode 100644 index f266c03d566a9..0000000000000 --- a/components/com_users/views/reset/metadata.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/components/com_wrapper/metadata.xml b/components/com_wrapper/metadata.xml deleted file mode 100644 index 9205b30529a2a..0000000000000 --- a/components/com_wrapper/metadata.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/components/com_wrapper/views/wrapper/tmpl/default.php b/components/com_wrapper/views/wrapper/tmpl/default.php index 6bf79cbe27c61..252117a44d88f 100644 --- a/components/com_wrapper/views/wrapper/tmpl/default.php +++ b/components/com_wrapper/views/wrapper/tmpl/default.php @@ -8,7 +8,7 @@ */ defined('_JEXEC') or die; -JHtml::script('com_wrapper/iframe-height.min.js', false, true); +JHtml::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true)); ?>
    params->get('show_page_heading')) : ?> diff --git a/components/com_wrapper/views/wrapper/tmpl/default.xml b/components/com_wrapper/views/wrapper/tmpl/default.xml index 5f8ef043b9f23..eb9b0085a81de 100644 --- a/components/com_wrapper/views/wrapper/tmpl/default.xml +++ b/components/com_wrapper/views/wrapper/tmpl/default.xml @@ -80,6 +80,7 @@ type="radio" class="btn-group btn-group-yesno" default="1" + description="COM_WRAPPER_FIELD_FRAME_DESC" label="COM_WRAPPER_FIELD_FRAME_LABEL" > diff --git a/components/com_wrapper/views/wrapper/view.html.php b/components/com_wrapper/views/wrapper/view.html.php index 312ac1e6fd99a..84b7cac7001a3 100644 --- a/components/com_wrapper/views/wrapper/view.html.php +++ b/components/com_wrapper/views/wrapper/view.html.php @@ -80,18 +80,25 @@ public function display($tpl = null) if ($params->def('add_scheme', 1)) { - // Adds 'http://' if none is set - if (substr($url, 0, 1) == '/') + // Adds 'http://' or 'https://' if none is set + if (substr($url, 0, 2) == '//') { - // Relative url in component. Use server http_host. - $wrapper->url = 'http://' . $_SERVER['HTTP_HOST'] . $url; + // Url without scheme in component. Prepend current scheme. + $wrapper->url = JUri::getInstance()->toString(array('scheme')) . substr($url, 2); } - elseif (!strstr($url, 'http') && !strstr($url, 'https')) + elseif (substr($url, 0, 1) == '/') { - $wrapper->url = 'http://' . $url; + // Relative url in component. Use scheme + host + port. + $wrapper->url = JUri::getInstance()->toString(array('scheme', 'host', 'port')) . $url; + } + elseif (strpos($url, 'http://') !== 0 && strpos($url, 'https://') !== 0) + { + // Url doesn't start with either 'http://' or 'https://'. Add current scheme. + $wrapper->url = JUri::getInstance()->toString(array('scheme')) . $url; } else { + // Url starts with either 'http://' or 'https://'. Do not change it. $wrapper->url = $url; } } diff --git a/composer.json b/composer.json index 9cd4f3b8f4faa..9a1b071c37550 100644 --- a/composer.json +++ b/composer.json @@ -14,12 +14,13 @@ "support": { "issues":"https://issues.joomla.org", "irc":"http://irc.lc/freenode/joomla/", - "forum":"http://forum.joomla.org/", + "forum":"https://forum.joomla.org/", "docs":"https://docs.joomla.org" }, "require": { "php": ">=5.3.10", "joomla/application": "~1.5", + "joomla/data": "~1.2", "joomla/di": "~1.2", "joomla/event": "~1.1", "joomla/registry": "~1.4 >=1.4.5", @@ -30,7 +31,8 @@ "ircmaxell/password-compat": "1.*", "leafo/lessphp": "0.5.0", "paragonie/random_compat": "~1.0", - "phpmailer/phpmailer": "5.2.14", + "phpmailer/phpmailer": "5.2.16", + "symfony/polyfill-php55": "~1.2", "symfony/polyfill-php56": "~1.0", "symfony/yaml": "2.*", "simplepie/simplepie": "1.3.1" @@ -38,6 +40,7 @@ "require-dev": { "phpunit/phpunit": "4.*", "phpunit/dbunit": "~1.3", + "friendsofphp/php-cs-fixer": "~1.11", "squizlabs/php_codesniffer": "~1.5", "pear/cache_lite": "1.7.16" } diff --git a/composer.lock b/composer.lock index 2aeafac6df79a..771aebbbe422a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b8580537987ab8119df6ccd016ec6b4d", - "content-hash": "2de13e5ec63c2fbca5143fd4f857600b", + "hash": "15ae8f9ee2aa080639758e0925fa9b45", + "content-hash": "ea772882d62aa0ce41eaaa27dcb93653", "packages": [ { "name": "ircmaxell/password-compat", @@ -141,6 +141,55 @@ ], "time": "2015-02-24 00:21:06" }, + { + "name": "joomla/data", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/data.git", + "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/data/zipball/57ee292ba23307a6a6059e69b7b19ca5b624ab80", + "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80", + "shasum": "" + }, + "require": { + "joomla/compat": "~1.0", + "joomla/registry": "~1.0", + "php": ">=5.3.10|>=7.0" + }, + "require-dev": { + "joomla/test": "~1.0", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Data\\": "src/", + "Joomla\\Data\\Tests\\": "Tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Joomla Data Package", + "homepage": "https://github.com/joomla-framework/data", + "keywords": [ + "data", + "framework", + "joomla" + ], + "time": "2016-04-02 22:20:43" + }, { "name": "joomla/di", "version": "1.3.1", @@ -337,22 +386,23 @@ }, { "name": "joomla/registry", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", - "reference": "b9fd1812e19619bb4722a0711b691dbfefff8ee9" + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/b9fd1812e19619bb4722a0711b691dbfefff8ee9", - "reference": "b9fd1812e19619bb4722a0711b691dbfefff8ee9", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/bd3592c6f0554a72811df52aeaea98c7815f6e5a", + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a", "shasum": "" }, "require": { "joomla/compat": "~1.0", "joomla/utilities": "~1.0", - "php": ">=5.3.10|>=7.0" + "php": ">=5.3.10|>=7.0", + "symfony/polyfill-php55": "~1.0" }, "require-dev": { "joomla/test": "~1.0", @@ -385,7 +435,7 @@ "joomla", "registry" ], - "time": "2016-04-18 23:57:43" + "time": "2016-05-14 20:42:05" }, { "name": "joomla/session", @@ -675,16 +725,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v5.2.14", + "version": "v5.2.16", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "e774bc9152de85547336e22b8926189e582ece95" + "reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e774bc9152de85547336e22b8926189e582ece95", - "reference": "e774bc9152de85547336e22b8926189e582ece95", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a", + "reference": "1d85f9ef3ecfc42bbc4f3c70d5e37ca9a65f629a", "shasum": "" }, "require": { @@ -695,8 +745,7 @@ "phpunit/phpunit": "4.7.*" }, "suggest": { - "league/oauth2-client": "Needed for XOAUTH2 authentication", - "league/oauth2-google": "Needed for Gmail XOAUTH2" + "league/oauth2-google": "Needed for Google XOAUTH2 authentication" }, "type": "library", "autoload": { @@ -732,7 +781,7 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2015-11-01 10:15:28" + "time": "2016-06-06 09:09:37" }, { "name": "psr/log", @@ -826,18 +875,74 @@ ], "time": "2012-10-30 17:54:03" }, + { + "name": "symfony/polyfill-php55", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "shasum": "" + }, + "require": { + "ircmaxell/password-compat": "~1.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php55\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, { "name": "symfony/polyfill-php56", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9" + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/4d891fff050101a53a4caabb03277284942d1ad9", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", "shasum": "" }, "require": { @@ -847,7 +952,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -880,20 +985,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-util", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4" + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", "shasum": "" }, "require": { @@ -902,7 +1007,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -932,20 +1037,20 @@ "polyfill", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/yaml", - "version": "v2.8.4", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb" + "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb", - "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb", + "url": "https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8", + "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8", "shasum": "" }, "require": { @@ -981,7 +1086,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:54:35" + "time": "2016-06-29 05:29:29" } ], "packages-dev": [ @@ -1039,6 +1144,64 @@ ], "time": "2015-06-14 21:17:01" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v1.11.6", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "41dc93abd2937a85a3889e28765231d574d2bac8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/41dc93abd2937a85a3889e28765231d574d2bac8", + "reference": "41dc93abd2937a85a3889e28765231d574d2bac8", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.6", + "sebastian/diff": "~1.1", + "symfony/console": "~2.3|~3.0", + "symfony/event-dispatcher": "~2.1|~3.0", + "symfony/filesystem": "~2.1|~3.0", + "symfony/finder": "~2.1|~3.0", + "symfony/process": "~2.3|~3.0", + "symfony/stopwatch": "~2.5|~3.0" + }, + "conflict": { + "hhvm": "<3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4.5|^5", + "satooshi/php-coveralls": "^0.7.1" + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "Symfony\\CS\\": "Symfony/CS/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "time": "2016-07-22 06:46:28" + }, { "name": "pear/cache_lite", "version": "v1.7.16", @@ -1140,32 +1303,32 @@ }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -1198,7 +1361,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/dbunit", @@ -1411,21 +1574,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -1448,7 +1614,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", @@ -1501,16 +1667,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.24", + "version": "4.8.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -1524,7 +1690,7 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -1569,7 +1735,7 @@ "testing", "xunit" ], - "time": "2016-03-14 06:16:08" + "time": "2016-07-21 06:48:14" }, { "name": "phpunit/phpunit-mock-objects", @@ -1745,16 +1911,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.6", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "2292b116f43c272ff4328083096114f84ea46a56" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/2292b116f43c272ff4328083096114f84ea46a56", - "reference": "2292b116f43c272ff4328083096114f84ea46a56", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -1791,20 +1957,20 @@ "environment", "hhvm" ], - "time": "2016-05-04 07:59:13" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -1812,12 +1978,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1857,7 +2024,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -2072,6 +2239,381 @@ "standards" ], "time": "2014-12-04 22:32:15" + }, + { + "name": "symfony/console", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "36e62335caca8a6e909c5c5bac4a8128149911c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/36e62335caca8a6e909c5c5bac4a8128149911c9", + "reference": "36e62335caca8a6e909c5c5bac4a8128149911c9", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2016-07-30 07:20:35" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8", + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2016-07-28 16:56:28" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "ab4c3f085c8f5a56536845bf985c4cef30bf75fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ab4c3f085c8f5a56536845bf985c4cef30bf75fd", + "reference": "ab4c3f085c8f5a56536845bf985c4cef30bf75fd", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2016-07-20 05:41:28" + }, + { + "name": "symfony/finder", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "60804d88691e4a73bbbb3035eb1d9f075c5c2c10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/60804d88691e4a73bbbb3035eb1d9f075c5c2c10", + "reference": "60804d88691e4a73bbbb3035eb1d9f075c5c2c10", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2016-07-26 08:02:44" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-05-18 14:26:46" + }, + { + "name": "symfony/process", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d20332e43e8774ff8870b394f3dd6020cc7f8e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d20332e43e8774ff8870b394f3dd6020cc7f8e0c", + "reference": "d20332e43e8774ff8870b394f3dd6020cc7f8e0c", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2016-07-28 11:13:19" + }, + { + "name": "symfony/stopwatch", + "version": "v2.8.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "35bae476693150728b0eb51647faac82faf9aaca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/35bae476693150728b0eb51647faac82faf9aaca", + "reference": "35bae476693150728b0eb51647faac82faf9aaca", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 05:29:29" } ], "aliases": [], diff --git a/htaccess.txt b/htaccess.txt index b5a1e910ed6d3..c9aaf3667c68a 100644 --- a/htaccess.txt +++ b/htaccess.txt @@ -7,12 +7,13 @@ ## # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE! # -# The line just below this section: 'Options +FollowSymLinks' may cause problems -# with some server configurations. It is required for use of mod_rewrite, but may already -# be set by your server administrator in a way that disallows changing it in -# your .htaccess file. If using it causes your server to error out, comment it out (add # to -# beginning of line), reload your site in your browser and test your sef url's. If they work, -# it has been set by your server administrator and you do not need it set here. +# The line 'Options +FollowSymLinks' may cause problems with some server configurations. +# It is required for the use of mod_rewrite, but it may have already been set by your +# server administrator in a way that disallows changing it in this .htaccess file. +# If using it causes your site to produce an error, comment it out (add # to the +# beginning of the line), reload your site in your browser and test your sef urls. If +# they work, then it has been set by your server administrator and you do not need to +# set it here. ## ## No directory listings @@ -27,18 +28,19 @@ Options -Indexes RewriteEngine On ## Begin - Rewrite rules to block out some common exploits. -# If you experience problems on your site block out the operations listed below -# This attempts to block the most common type of exploit `attempts` to Joomla! +# If you experience problems on your site then comment out the operations listed +# below by adding a # to the beginning of the line. +# This attempts to block the most common type of exploit `attempts` on Joomla! # -# Block out any script trying to base64_encode data within the URL. +# Block any script trying to base64_encode data within the URL. RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] -# Block out any script that includes a + - +
    - Joomla + Joomla
    - isRtl()) - { - $joomla = 'Joomla!®‎'; - } - else - { - $joomla = 'Joomla!®'; - } - $license = '' . JText::_('INSTL_GNU_GPL_LICENSE') . ''; - echo JText::sprintf('JGLOBAL_ISFREESOFTWARE', $joomla, $license); - ?> + + Joomla!' . (JFactory::getLanguage()->isRtl() ? '‎' : '') . ''; ?> + ' . JText::_('INSTL_GNU_GPL_LICENSE') . ''; ?> +
    @@ -78,55 +84,5 @@

    - diff --git a/installation/template/js/installation.js b/installation/template/js/installation.js index c343b0a33c630..0e09c554b4754 100644 --- a/installation/template/js/installation.js +++ b/installation/template/js/installation.js @@ -372,3 +372,125 @@ var Installation = function(_container, _base) { toggle : toggle } } + +/** + * Initializes the elements + */ +function initElements() +{ + (function($){ + $('.hasTooltip').tooltip(); + + // Chosen select boxes + $('select').chosen({ + disable_search_threshold : 10, + allow_single_deselect : true + }); + + // Turn radios into btn-group + $('.radio.btn-group label').addClass('btn'); + + $('fieldset.btn-group').each(function() { + var $self = $(this); + // Handle disabled, prevent clicks on the container, and add disabled style to each button + if ($self.prop('disabled')) + { + $self.css('pointer-events', 'none').off('click'); + $self.find('.btn').addClass('disabled'); + } + }); + + $('.btn-group label:not(.active)').click(function() + { + var label = $(this); + var input = $('#' + label.attr('for')); + + if (!input.prop('checked')) + { + label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); + + if (label.closest('.btn-group').hasClass('btn-group-reverse')) + { + if (input.val() == '') + { + label.addClass('active btn-primary'); + } + else if (input.val() == 0) + { + label.addClass('active btn-danger'); + } + else + { + label.addClass('active btn-success'); + } + } + else + { + if (input.val() == '') + { + label.addClass('active btn-primary'); + } + else if (input.val() == 0) + { + label.addClass('active btn-success'); + } + else + { + label.addClass('active btn-danger'); + } + } + input.prop('checked', true); + } + }); + + $('.btn-group input[checked="checked"]').each(function() + { + var $self = $(this); + var attrId = $self.attr('id'); + + if ($self.hasClass('btn-group-reverse')) + { + if ($self.val() == '') + { + $('label[for="' + attrId + '"]').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for="' + attrId + '"]').addClass('active btn-danger'); + } + else + { + $('label[for="' + attrId + '"]').addClass('active btn-success'); + } + } + else + { + if ($self.val() == '') + { + $('label[for="' + attrId + '"]').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for="' + attrId + '"]').addClass('active btn-success'); + } + else + { + $('label[for="' + attrId + '"]').addClass('active btn-danger'); + } + } + }); + })(jQuery); +} + +// Init on dom content loaded event +document.addEventListener('DOMContentLoaded', function() { + + // Init the elements + initElements(); + + // Init installation + var installOptions = Joomla.getOptions('system.installation'), + installurl = installOptions.url ? installOptions.url.replace(/&/g, '&') : 'index.php'; + + window.Install = new Installation('container-installation', installurl); +}); diff --git a/installation/view/complete/tmpl/default.php b/installation/view/complete/tmpl/default.php index e619e0f24f203..9ff05038d5ab5 100644 --- a/installation/view/complete/tmpl/default.php +++ b/installation/view/complete/tmpl/default.php @@ -19,19 +19,34 @@ class="form-validate form-horizontal">

    -
    -

    - -
    -
    -
    - +
    +

    +
    +
    +
    +

    +

    +
    +
    +

    +
    -
    - +
    +
    +
    +

    +
    +
    +
    + +
    +
    + +
    +


    @@ -61,13 +76,6 @@ class="form-validate form-horizontal">
    -
    -

    -
    -

    -

    -

    -
    config) : ?>
    diff --git a/installation/view/site/tmpl/default.php b/installation/view/site/tmpl/default.php index 43e157fd5e38e..f8133078c5ad4 100644 --- a/installation/view/site/tmpl/default.php +++ b/installation/view/site/tmpl/default.php @@ -54,6 +54,9 @@
    +
    +

    +
    form->getLabel('admin_email'); ?> diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000000000..cdc97b4ba7ade --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,86 @@ +// Karma configuration + +module.exports = function (config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine-ajax', 'jasmine', 'requirejs'], + + // list of files / patterns to load in the browser + files: [ + {pattern: 'tests/javascript/node_modules/jquery/dist/jquery.min.js', included: false}, + {pattern: 'tests/javascript/node_modules/jasmine-jquery/lib/jasmine-jquery.js', included: false}, + {pattern: 'tests/javascript/node_modules/text/text.js', included: false}, + {pattern: 'media/jui/js/bootstrap.min.js', included: false}, + {pattern: 'media/jui/js/jquery.ui.core.min.js', included: false}, + {pattern: 'media/jui/js/jquery.ui.sortable.min.js', included: false}, + {pattern: 'media/system/js/*.js', included: false}, + {pattern: 'tests/javascript/**/fixture.html', included: false}, + {pattern: 'tests/javascript/**/spec.js', included: false}, + {pattern: 'tests/javascript/**/spec-setup.js', included: false}, + {pattern: 'images/*.png', included: false}, + + 'tests/javascript/test-main.js' + ], + + // list of files to exclude + exclude: [ + 'media/system/js/*uncompressed.js' + ], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + '**/system/js/*!(uncompressed).js': ['coverage'] + }, + + // coverage reporter configuration + coverageReporter: { + type : 'text' + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['verbose', 'coverage'], + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Firefox'], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // list of plugins + plugins: [ + 'karma-jasmine', + 'karma-jasmine-ajax', + 'karma-firefox-launcher', + 'karma-coverage', + 'karma-requirejs', + 'karma-verbose-reporter' + ], + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }); +}; diff --git a/language/en-GB/en-GB.com_config.ini b/language/en-GB/en-GB.com_config.ini index a4ca606796d74..08dd94b00fa81 100644 --- a/language/en-GB/en-GB.com_config.ini +++ b/language/en-GB/en-GB.com_config.ini @@ -14,16 +14,16 @@ COM_CONFIG_FIELD_METADESC_DESC="Enter a description of the overall website that COM_CONFIG_FIELD_METADESC_LABEL="Site Meta Description" COM_CONFIG_FIELD_METAKEYS_DESC="Enter the keywords and phrases that best describe your website. Separate keywords and phrases with a comma." COM_CONFIG_FIELD_METAKEYS_LABEL="Site Meta Keywords" -COM_CONFIG_FIELD_SEF_URL_DESC="Select whether or not the URLs are optimised for Search Engines." +COM_CONFIG_FIELD_SEF_URL_DESC="Select if the URLs are optimised for Search Engines." COM_CONFIG_FIELD_SEF_URL_LABEL="Search Engine Friendly URLs" COM_CONFIG_FIELD_SITE_NAME_DESC="Enter the name of your website. This will be used in various locations (eg the Backend browser title bar and Site Offline pages)." COM_CONFIG_FIELD_SITE_NAME_LABEL="Site Name" COM_CONFIG_FIELD_VALUE_AFTER="After" COM_CONFIG_FIELD_VALUE_BEFORE="Before" -COM_CONFIG_FIELD_SITE_OFFLINE_DESC="Select whether access to the Site Frontend is available. If Yes, the Frontend will display a message if set such in Backend." +COM_CONFIG_FIELD_SITE_OFFLINE_DESC="Select if access to the Site Frontend is available. If Yes, the Frontend will display a message if set such in Backend." COM_CONFIG_FIELD_SITE_OFFLINE_LABEL="Site Offline" COM_CONFIG_FIELD_SITENAME_PAGETITLES_DESC="Begin or end all Page Titles with the site name (for example, My Site Name - My Article Name)." -COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL="Include Site Name in Page Titles" +COM_CONFIG_FIELD_SITENAME_PAGETITLES_LABEL="Site Name in Page Titles" COM_CONFIG_METADATA_SETTINGS="Metadata Settings" COM_CONFIG_MODULES_MODULE_NAME="Module Name" COM_CONFIG_MODULES_MODULE_TYPE="Module Type" diff --git a/language/en-GB/en-GB.com_contact.ini b/language/en-GB/en-GB.com_contact.ini index f70b12754503b..8197b5745f4a4 100644 --- a/language/en-GB/en-GB.com_contact.ini +++ b/language/en-GB/en-GB.com_contact.ini @@ -6,11 +6,11 @@ COM_CONTACT_ADDRESS="Address" COM_CONTACT_ARTICLES_HEADING="Contact's articles" COM_CONTACT_CAPTCHA_LABEL="Captcha" -COM_CONTACT_CAPTCHA_DESC="Type in the textbox what you see in the image." +COM_CONTACT_CAPTCHA_DESC="Please complete the security check." COM_CONTACT_CAT_NUM="# of Contacts :" COM_CONTACT_CONTACT_DEFAULT_LABEL="Send an Email" COM_CONTACT_CONTACT_EMAIL_A_COPY_DESC="Sends a copy of the message to the address you have supplied." -COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL="Send copy to yourself" +COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL="Send a copy to yourself" COM_CONTACT_CONTACT_EMAIL_NAME_DESC="Your name." COM_CONTACT_CONTACT_EMAIL_NAME_LABEL="Name" COM_CONTACT_CONTACT_ENTER_MESSAGE_DESC="Enter your message here." @@ -56,8 +56,10 @@ COM_CONTACT_POSITION="Position" COM_CONTACT_PROFILE="Profile" COM_CONTACT_PROFILE_HEADING="Contact profile" COM_CONTACT_SELECT_CONTACT="Select a contact:" +COM_CONTACT_SESSION_INVALID="Invalid session cookie. Please check that you have cookies enabled in your web browser." COM_CONTACT_STATE="State" COM_CONTACT_SUBURB="Suburb" COM_CONTACT_TELEPHONE="Phone" COM_CONTACT_TELEPHONE_NUMBER="Phone: %s" +COM_CONTACT_USER_FIELDS="Fields" COM_CONTACT_VCARD="vCard" diff --git a/language/en-GB/en-GB.com_content.ini b/language/en-GB/en-GB.com_content.ini index 9ce909fdf7b7a..178035d2e54d5 100644 --- a/language/en-GB/en-GB.com_content.ini +++ b/language/en-GB/en-GB.com_content.ini @@ -12,6 +12,8 @@ COM_CONTENT_ARTICLE_INFO="Details" COM_CONTENT_ARTICLE_VOTE_SUCCESS="Thank You for rating this Article." COM_CONTENT_ARTICLE_VOTE_FAILURE="You already rated this Article today!" COM_CONTENT_AUTHOR_FILTER_LABEL="Author Filter" +COM_CONTENT_CAPTCHA_LABEL="Captcha" +COM_CONTENT_CAPTCHA_DESC="Please complete the security check." COM_CONTENT_CATEGORY="Category: %s" COM_CONTENT_CHECKED_OUT_BY="Checked out by %s" COM_CONTENT_CONTENT_TYPE_ARTICLE="Article" @@ -26,6 +28,9 @@ COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND="Parent category not found" COM_CONTENT_FEED_READMORE="Read More ..." COM_CONTENT_FILTER_SEARCH_DESC="Content Filter Search" COM_CONTENT_FORM_EDIT_ARTICLE="Edit an article" +COM_CONTENT_FORM_FILTER_LEGEND="Filters" +COM_CONTENT_FORM_FILTER_SUBMIT="Filter" +COM_CONTENT_CATEGORY_LIST_TABLE_CAPTION="List of articles in category %s" COM_CONTENT_HEADING_TITLE="Title" COM_CONTENT_HITS_FILTER_LABEL="Hits Filter" COM_CONTENT_INTROTEXT="Article must have some content." @@ -41,6 +46,7 @@ COM_CONTENT_NEW_ARTICLE="New Article" COM_CONTENT_NO_ARTICLES="There are no articles in this category. If subcategories display on this page, they may contain articles." COM_CONTENT_NONE="None" COM_CONTENT_NUM_ITEMS="Article Count:" +COM_CONTENT_NUM_ITEMS_TIP="Article Count" COM_CONTENT_ON_NEW_CONTENT="A new Article has been submitted by '%1$s' entitled '%2$s'." COM_CONTENT_ORDERING="Ordering:
    New articles default to the first position in the Category. The ordering can be changed in Backend." COM_CONTENT_PAGEBREAK_DOC_TITLE="Page Break" @@ -63,7 +69,7 @@ COM_CONTENT_WRITTEN_BY="Written by %s" COM_CONTENT_FIELD_FULL_DESC="Select or upload an image for the single article display." COM_CONTENT_FIELD_FULL_LABEL="Full Article Image" COM_CONTENT_FIELD_IMAGE_DESC="The image to be displayed." -COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images. Replaced with caption text if it is present." +COM_CONTENT_FIELD_IMAGE_ALT_DESC="Alternative text used for visitors without access to images." COM_CONTENT_FIELD_IMAGE_ALT_LABEL="Alt Text" COM_CONTENT_FIELD_IMAGE_CAPTION_DESC="Caption attached to the image." COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL="Caption" @@ -85,3 +91,7 @@ COM_CONTENT_LEFT="Left" COM_CONTENT_RIGHT="Right" COM_CONTENT_FIELD_URL_LINK_TEXT_LABEL="Link Text" COM_CONTENT_IMAGES_AND_URLS="Images and Links" +COM_CONTENT_RATINGS="Rating" +COM_CONTENT_RATINGS_COUNT="Rating: %s" +COM_CONTENT_VOTES="Vote" +COM_CONTENT_VOTES_COUNT="Vote: %s" diff --git a/language/en-GB/en-GB.com_media.ini b/language/en-GB/en-GB.com_media.ini index 6734833c394ef..5befff0ce864a 100644 --- a/language/en-GB/en-GB.com_media.ini +++ b/language/en-GB/en-GB.com_media.ini @@ -71,6 +71,4 @@ COM_MEDIA_UP="Up" COM_MEDIA_UPLOAD="Upload" COM_MEDIA_UPLOAD_COMPLETE="Upload Complete" COM_MEDIA_UPLOAD_FILE="Upload file" -COM_MEDIA_UPLOAD_FILES="Upload files (Maximum Size: %s MB)" -COM_MEDIA_UPLOAD_FILES_NOLIMIT="Upload files (No maximum size)" COM_MEDIA_UPLOAD_SUCCESSFUL="Upload Successful" diff --git a/language/en-GB/en-GB.com_tags.ini b/language/en-GB/en-GB.com_tags.ini index a629e6f4b98aa..3876cb20b8be2 100644 --- a/language/en-GB/en-GB.com_tags.ini +++ b/language/en-GB/en-GB.com_tags.ini @@ -4,6 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 COM_TAGS_CREATED_DATE="Created Date" +COM_TAGS_DEFAULT_PAGE_TITLE="Tags" COM_TAGS_FILTER_SEARCH_DESC="Enter all or part of the title to search for." COM_TAGS_MODIFIED_DATE="Modified Date" COM_TAGS_NO_ITEMS="No matching items were found." diff --git a/language/en-GB/en-GB.com_users.ini b/language/en-GB/en-GB.com_users.ini index 018ee97f90ef6..ecd22d3b91415 100644 --- a/language/en-GB/en-GB.com_users.ini +++ b/language/en-GB/en-GB.com_users.ini @@ -5,13 +5,13 @@ COM_USERS_ACTIVATION_TOKEN_NOT_FOUND="Verification code not found." COM_USERS_CAPTCHA_LABEL="Captcha" -COM_USERS_CAPTCHA_DESC="Type in the textbox what you see in the image." +COM_USERS_CAPTCHA_DESC="Please complete the security check." COM_USERS_DATABASE_ERROR="Error getting the user from the database: %s" COM_USERS_DESIRED_PASSWORD="Enter your desired password." COM_USERS_DESIRED_USERNAME="Enter your desired username." COM_USERS_EDIT_PROFILE="Edit Profile" COM_USERS_EMAIL_ACCOUNT_DETAILS="Account Details for %s at %s" -COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified his email address and requests that you approve his account.\nThis email contains their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by selecting on the link below:\n %s \n" +COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified their email address and requests that you approve their account.\nThis email contains their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by selecting on the link below:\n %s \n" COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of %s at %s" COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering." COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for %s at %s" @@ -70,7 +70,7 @@ COM_USERS_PROFILE_EMAIL1_DESC="Enter your email address." COM_USERS_PROFILE_EMAIL1_LABEL="Email Address" COM_USERS_PROFILE_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address." COM_USERS_PROFILE_EMAIL2_DESC="Confirm your email address." -COM_USERS_PROFILE_EMAIL2_LABEL="Confirm email Address" +COM_USERS_PROFILE_EMAIL2_LABEL="Confirm Email Address" COM_USERS_PROFILE_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field." COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL="Last Visited Date" COM_USERS_PROFILE_MY_PROFILE="My Profile" @@ -101,7 +101,7 @@ COM_USERS_REGISTER_EMAIL1_DESC="Enter your email address." COM_USERS_REGISTER_EMAIL1_LABEL="Email Address" COM_USERS_REGISTER_EMAIL1_MESSAGE="The email address you entered is already in use or invalid. Please enter another email address." COM_USERS_REGISTER_EMAIL2_DESC="Confirm your email address." -COM_USERS_REGISTER_EMAIL2_LABEL="Confirm email Address" +COM_USERS_REGISTER_EMAIL2_LABEL="Confirm Email Address" COM_USERS_REGISTER_EMAIL2_MESSAGE="The email addresses you entered do not match. Please enter your email address in the email address field and confirm your entry by entering it in the confirm email address field." COM_USERS_REGISTER_NAME_DESC="Enter your full name." COM_USERS_REGISTER_NAME_LABEL="Name" @@ -131,6 +131,7 @@ COM_USERS_REMIND_DEFAULT_LABEL="Please enter the email address associated with y COM_USERS_REMIND_EMAIL_LABEL="Your Email" COM_USERS_REMIND_LIMIT_ERROR_N_HOURS="You have exceeded the maximum number of password resets allowed. Please try again in %s hours." COM_USERS_REMIND_LIMIT_ERROR_N_HOURS_1="You have exceeded the maximum number of password resets allowed. Please try again in one hour." +COM_USERS_REMIND_REQUEST_ERROR="Error requesting password reminder." COM_USERS_REMIND_REQUEST_FAILED="Reminder failed: %s" COM_USERS_REMIND_REQUEST_SUCCESS="Reminder successfully sent. Please check your mail." COM_USERS_REMIND_SUPERADMIN_ERROR="A Super User can't request a password reminder. Please contact another Super User or use an alternative method." diff --git a/language/en-GB/en-GB.ini b/language/en-GB/en-GB.ini index e95066b85a96a..bf45f1e88cc6f 100644 --- a/language/en-GB/en-GB.ini +++ b/language/en-GB/en-GB.ini @@ -52,9 +52,11 @@ JALL="All" JALL_LANGUAGE="All" JAPPLY="Save" JARCHIVED="Archived" +JASSOCIATIONS="Also available:" JAUTHOR="Author" JCANCEL="Cancel" JCATEGORY="Category" +JCLEAR="Clear" JDATE="Date" JDEFAULT="Default" JDETAILS="Details" @@ -66,6 +68,7 @@ JFALSE="False" JFEATURED="Featured" JHIDE="Hide" JINVALID_TOKEN="The most recent request was denied because it contained an invalid security token. Please refresh the page and try again." +JINVALID_TOKEN_NOTICE="The security token did not match. The request was aborted to prevent any security breach. Please try again." JLOGIN="Log in" JLOGOUT="Log out" JNEW="New" @@ -85,6 +88,7 @@ JPUBLISHED="Published" JREGISTER="Register" JREQUIRED="Required" JSAVE="Save" +JSELECT="Select" JSHOW="Show" JSITE="Site" JSTATUS="Status" @@ -118,6 +122,7 @@ JERROR_LAYOUT_NOT_ABLE_TO_VISIT="You may not be able to visit this page because JERROR_LAYOUT_PAGE_NOT_FOUND="The requested page can't be found." JERROR_LAYOUT_PLEASE_CONTACT_THE_SYSTEM_ADMINISTRATOR="If difficulties persist, please contact the System Administrator of this site and report the error below." JERROR_LAYOUT_PLEASE_TRY_ONE_OF_THE_FOLLOWING_PAGES="Please try one of the following pages:" +JERROR_LAYOUT_PREVIOUS_ERROR="Previous Error" JERROR_LAYOUT_REQUESTED_RESOURCE_WAS_NOT_FOUND="The requested resource was not found." JERROR_LAYOUT_SEARCH="You may wish to search the site or visit the home page." JERROR_LAYOUT_SEARCH_ENGINE_OUT_OF_DATE_LISTING="a search engine that has an out-of-date listing for this site" @@ -153,6 +158,7 @@ JFIELD_TITLE_DESC="Title for the article." JGLOBAL_ADD_CUSTOM_CATEGORY="Add new Category" JGLOBAL_ARTICLES="Articles" +JGLOBAL_FIELDS="Fields" JGLOBAL_AUTH_ACCESS_DENIED="Access Denied" JGLOBAL_AUTH_ACCESS_GRANTED="Access Granted" JGLOBAL_AUTH_BIND_FAILED="Failed binding to LDAP server" @@ -188,8 +194,8 @@ JGLOBAL_EMAIL="Email" JGLOBAL_EMAIL_TITLE="Email this link to a friend" JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC="Categories that are within this category will be displayed." JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL="Select a Top Level Category" -JGLOBAL_FIELD_CATEGORIES_DESC_DESC="If you enter some text in this field, it will override the Top Level Category Description, if it has one." -JGLOBAL_FIELD_CATEGORIES_DESC_LABEL="Top Level Category Description" +JGLOBAL_FIELD_CATEGORIES_DESC_DESC="If you enter some text in this field, it will replace the Top Level Category Description, if it has one." +JGLOBAL_FIELD_CATEGORIES_DESC_LABEL="Alternative Description" JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC="Uses another name than the author's for display." JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL="Author's Alias" JGLOBAL_FIELD_CREATED_BY_DESC="The user who created this." @@ -214,7 +220,7 @@ JGLOBAL_FIELD_PUBLISH_DOWN_DESC="An optional date to stop publishing." JGLOBAL_FIELD_PUBLISH_DOWN_LABEL="Finish Publishing" JGLOBAL_FIELD_PUBLISH_UP_DESC="An optional date to start publishing." JGLOBAL_FIELD_PUBLISH_UP_LABEL="Start Publishing" -JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC="Show description of the top level category or optionally override with the text from the description field found in menu item. If using Root as top level category, the description field has to be filled." +JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC="Show description of the top level category or alternatively replace with the text from the description field found in the menu item. If using Root as a top level category, the description field has to be filled." JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL="Top Level Category Description" JGLOBAL_FIELD_VERSION_NOTE_DESC="Enter an optional note for this version of the item." JGLOBAL_FIELD_VERSION_NOTE_LABEL="Version Note" @@ -232,6 +238,7 @@ JGLOBAL_KEEP_TYPING="Keep typing ..." JGLOBAL_LEFT="Left" JGLOBAL_LOOKING_FOR="Looking for" JGLOBAL_LT="<" +JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT="Maximum upload size: %s" JGLOBAL_NEWITEMSLAST_DESC="New items default to the last position. Ordering can be changed after this item has been saved." JGLOBAL_NO_MATCHING_RESULTS="No Matching Results" JGLOBAL_NUM="#" @@ -255,9 +262,11 @@ JGLOBAL_START_PUBLISH_AFTER_FINISH="Item start publishing date must be before fi JGLOBAL_SUBCATEGORIES="Subcategories" JGLOBAL_SUBHEADING_DESC="Optional text to show as a subheading." JGLOBAL_TITLE="Title" -JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS="Type or select some options" JGLOBAL_TYPE_OR_SELECT_CATEGORY="Type or Select a Category" +JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS="Type or select some options" JGLOBAL_USE_GLOBAL="Use Global" +JGLOBAL_USE_GLOBAL_VALUE="Use Global (%s)" +JGLOBAL_USE_GLOBAL_VALUE_NOT_FOUND="Unfortunately there was no global value found for at least one field. Saving the options may help to remedy this issue." JGLOBAL_USERNAME="Username" JGLOBAL_VALIDATION_FORM_FAILED="Invalid form" JGLOBAL_YOU_MUST_LOGIN_FIRST="Please login first" @@ -277,6 +286,7 @@ JLIB_DATABASE_ERROR_DATABASE_CONNECT="Could not connect to database" JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Unable to load Database Driver: %s" JLIB_ERROR_INFINITE_LOOP="Infinite loop detected in JError" +JOPTION_DO_NOT_USE="- None Selected -" JOPTION_SELECT_ACCESS="- Select Access -" JOPTION_SELECT_AUTHOR="- Select Author -" JOPTION_SELECT_CATEGORY="- Select Category -" @@ -296,7 +306,10 @@ DATE_FORMAT_LC1="l, d F Y" DATE_FORMAT_LC2="l, d F Y H:i" DATE_FORMAT_LC3="d F Y" DATE_FORMAT_LC4="Y-m-d" +DATE_FORMAT_LC5="Y-m-d H:i" DATE_FORMAT_JS1="y-m-d" +DATE_FORMAT_CALENDAR_DATE="%Y-%m-%d" +DATE_FORMAT_CALENDAR_DATETIME="%Y-%m-%d %H:%M:%S" ; Months diff --git a/language/en-GB/en-GB.lib_idna_convert.sys.ini b/language/en-GB/en-GB.lib_idna_convert.sys.ini index 18a9dc63ac233..cd02e8ba591be 100644 --- a/language/en-GB/en-GB.lib_idna_convert.sys.ini +++ b/language/en-GB/en-GB.lib_idna_convert.sys.ini @@ -3,5 +3,6 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +LIB_IDNA="IDNA Convert" LIB_IDNA_XML_DESCRIPTION="The class idna_convert allows to convert internationalised domain names (see RFC 3490, 3491, 3492 and 3454 for details) as they can be used with various registries worldwide to be translated between their original (localised) form and their encoded form as it will be used in the DNS (Domain Name System)." diff --git a/language/en-GB/en-GB.lib_joomla.ini b/language/en-GB/en-GB.lib_joomla.ini index 0e9c5cd1e9d0b..9a79a6e3d1e47 100644 --- a/language/en-GB/en-GB.lib_joomla.ini +++ b/language/en-GB/en-GB.lib_joomla.ini @@ -38,6 +38,7 @@ JLIB_APPLICATION_ERROR_INVALID_CONTROLLER="Invalid controller: name='%s', format JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND="Layout %s not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_FOUND="Library not found." JLIB_APPLICATION_ERROR_LIBRARY_NOT_LOADING="Error loading library: %1$s, %2$s" +JLIB_APPLICATION_ERROR_MENU_LOAD="Error loading menu: %s" JLIB_APPLICATION_ERROR_MODEL_GET_NAME="JModel: :getName() : Can't get or parse class name." JLIB_APPLICATION_ERROR_MODULE_LOAD="Error loading module %s" JLIB_APPLICATION_ERROR_PATHWAY_LOAD="Unable to load pathway: %s" @@ -145,6 +146,8 @@ JLIB_CLIENT_ERROR_JFTP_MODE_ASCII="JFTP: :_mode: Bad response. Server response: JLIB_CLIENT_ERROR_HELPER_SETCREDENTIALSFROMREQUEST_FAILED="Looks like User's credentials are no good." JLIB_CLIENT_ERROR_LDAP_ADDRESS_NOT_AVAILABLE="Address not available." +JLIB_CMS_WARNING_PROVIDE_VALID_NAME="Please provide a valid, non-blank title." + JLIB_DATABASE_ERROR_ADAPTER_MYSQL="The MySQL adapter 'mysql' is not available." JLIB_DATABASE_ERROR_ADAPTER_MYSQLI="The MySQL adapter 'mysqli' is not available." JLIB_DATABASE_ERROR_BIND_FAILED_INVALID_SOURCE_ARGUMENT="%s: :bind failed. Invalid source argument." @@ -176,7 +179,7 @@ JLIB_DATABASE_ERROR_INVALID_LOCATION="%s: :setLocation - Invalid location." JLIB_DATABASE_ERROR_INVALID_NODE_RECURSION="%s: :move Failed - Can't move the node to be a child of itself." JLIB_DATABASE_ERROR_INVALID_PARENT_ID="Invalid parent ID." JLIB_DATABASE_ERROR_LANGUAGE_NO_TITLE="The language should have a title." -JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE="A content language already exists with this Image Prefix." +JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_IMAGE="A content language already exists with this Image." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_LANG_CODE="A content language already exists with this Language Tag." JLIB_DATABASE_ERROR_LANGUAGE_UNIQUE_SEF="A content language already exists with this URL Language Code." JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Unable to load Database Driver: %s" @@ -188,7 +191,7 @@ JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT="The Language parameter for this m JLIB_DATABASE_ERROR_MENU_CANNOT_UNSET_DEFAULT_DEFAULT="At least one menu item has to be set as Default." JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME="Can't unpublish default home." JLIB_DATABASE_ERROR_MENU_DEFAULT_CHECKIN_USER_MISMATCH="The current home menu for this language is checked out." -JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="Another menu item with the same parent has this alias (remember it may be a trashed item)." +JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="The alias %1$s is already being used by %2$s menu item in the %3$s menu (remember it may be a trashed item)." JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_ROOT="Another menu item has the same alias in Root (remember it may be a trashed item). Root is the top level parent." JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a component." JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should contain only one Default home." @@ -229,6 +232,8 @@ JLIB_DATABASE_QUERY_FAILED="Database query failed (error # %s): %s" JLIB_DOCUMENT_ERROR_UNABLE_LOAD_DOC_CLASS="Unable to load document class." JLIB_ENVIRONMENT_SESSION_EXPIRED="Your session has expired. Please log in again." +JLIB_ENVIRONMENT_SESSION_INVALID="Invalid session cookie. Please check that you have cookies enabled in your web browser." +JLIB_ERROR_COMPONENTS_ACL_CONFIGURATION_FILE_MISSING_OR_IMPROPERLY_STRUCTURED="The %s component's ACL configuration file is either missing or improperly structured." JLIB_ERROR_INFINITE_LOOP="Infinite loop detected in JError." JLIB_EVENT_ERROR_DISPATCHER="JEventDispatcher: :register: Event handler not recognised. Handler: %s" JLIB_FILESYSTEM_BZIP_NOT_SUPPORTED="BZip2 Not Supported." @@ -258,7 +263,7 @@ JLIB_FILESYSTEM_UNABLE_TO_LOAD_ARCHIVE="Unable to load archive." JLIB_FILESYSTEM_ERROR_JFILE_FIND_COPY="JFile: :copy: Can't find or read file: $%s" JLIB_FILESYSTEM_ERROR_JFILE_STREAMS="JFile: :copy(%1$s, %2$s): %3$s" JLIB_FILESYSTEM_ERROR_COPY_FAILED="Copy failed." -JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01="Copy failed: %1s to %2s" +JLIB_FILESYSTEM_ERROR_COPY_FAILED_ERR01="Copy failed: %1$s to %2$s" JLIB_FILESYSTEM_DELETE_FAILED="Failed deleting %s" JLIB_FILESYSTEM_CANNOT_FIND_SOURCE_FILE="Can't find source file." JLIB_FILESYSTEM_ERROR_JFILE_MOVE_STREAMS="JFile: :move: %s" @@ -269,7 +274,7 @@ JLIB_FILESYSTEM_ERROR_UPLOAD="JFile: :upload: %s" JLIB_FILESYSTEM_ERROR_WARNFS_ERR01="Warning: Failed to change file permissions!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR02="Warning: Failed to move file!" JLIB_FILESYSTEM_ERROR_WARNFS_ERR03="Warning: File %s not uploaded for security reasons!" -JLIB_FILESYSTEM_ERROR_WARNFS_ERR04="Warning: Failed to move file: %1s to %2s" +JLIB_FILESYSTEM_ERROR_WARNFS_ERR04="Warning: Failed to move file: %1$s to %2$s" JLIB_FILESYSTEM_ERROR_FIND_SOURCE_FOLDER="Can't find source folder." JLIB_FILESYSTEM_ERROR_FOLDER_EXISTS="Folder already exists." JLIB_FILESYSTEM_ERROR_FOLDER_CREATE="Unable to create target folder." @@ -302,6 +307,60 @@ JLIB_FORM_ERROR_NO_DATA="No data." JLIB_FORM_ERROR_VALIDATE_FIELD="Invalid xml field." JLIB_FORM_ERROR_XML_FILE_DID_NOT_LOAD="XML file did not load." JLIB_FORM_FIELD_INVALID="Invalid field: " +JLIB_FORM_FIELD_PARAM_CALENDAR_FORMAT_DESC="The date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, '%Y-%m-%d' is assumed (giving dates like '2008-04-16')." +JLIB_FORM_FIELD_PARAM_CALENDAR_FORMAT_LABEL="Format" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_DESC="The options of the list." +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_LABEL="Checkbox Values" +JLIB_FORM_FIELD_PARAM_CHECKBOX_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_EDITOR_BUTTONS_HIDE_DESC="Hide the buttons in the comma separated list." +JLIB_FORM_FIELD_PARAM_EDITOR_BUTTONS_HIDE_LABEL="Hide Buttons" +JLIB_FORM_FIELD_PARAM_EDITOR_HEIGHT_DESC="Defines the height (in pixels) of the WYSIWYG editor and defaults to 250px." +JLIB_FORM_FIELD_PARAM_EDITOR_HEIGHT_LABEL="Height" +JLIB_FORM_FIELD_PARAM_EDITOR_SHOW_BUTTONS_DESC="Should the buttons being shown." +JLIB_FORM_FIELD_PARAM_EDITOR_SHOW_BUTTONS_LABEL="Show Buttons" +JLIB_FORM_FIELD_PARAM_EDITOR_WIDTH_DESC="Defines the width (in pixels) of the WYSIWYG editor and defaults to 100%." +JLIB_FORM_FIELD_PARAM_EDITOR_WIDTH_LABEL="Width" +JLIB_FORM_FIELD_PARAM_IMAGELIST_DIRECTORY_DESC="The filesystem path to the directory containing the image files to be listed." +JLIB_FORM_FIELD_PARAM_IMAGELIST_DIRECTORY_LABEL="Directory" +JLIB_FORM_FIELD_PARAM_INTEGER_FIRST_DESC="This value is the lowest on the list." +JLIB_FORM_FIELD_PARAM_INTEGER_FIRST_LABEL="First" +JLIB_FORM_FIELD_PARAM_INTEGER_LAST_DESC="This value is the highest on the list." +JLIB_FORM_FIELD_PARAM_INTEGER_LAST_LABEL="Last" +JLIB_FORM_FIELD_PARAM_INTEGER_STEP_DESC="Each option will be the previous option incremented by this integer, starting with the first value until the last value is reached." +JLIB_FORM_FIELD_PARAM_INTEGER_STEP_LABEL="Step" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_DESC="The options of the list." +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_LABEL="List Values" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_MEDIA_IMAGE_CLASS_DESC="The class which is added to the image (src tag)." +JLIB_FORM_FIELD_PARAM_MEDIA_IMAGE_CLASS_LABEL="Image Class" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_DESC="Shows or hides the preview of the selected image." +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_INLINE="Inline" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_LABEL="Preview" +JLIB_FORM_FIELD_PARAM_MEDIA_PREVIEW_TOOLTIP="Tooltip" +JLIB_FORM_FIELD_PARAM_MEDIA_HOME_LABEL="Home Directory" +JLIB_FORM_FIELD_PARAM_MEDIA_HOME_DESC="Should the directory with the files point to a user directory." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_DESC="Allow multiple values to be selected." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_LABEL="Multiple" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_DESC="The options of the list." +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_NAME_LABEL="Text" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_LABEL="Radio Values" +JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_VALUE_LABEL="Value" +JLIB_FORM_FIELD_PARAM_SQL_QUERY_DESC="The SQL query which will provide the data for the drop-down list. The query must return two columns; one called 'value' which will hold the values of the list items; the other called 'text' containing the text in the drop-down list." +JLIB_FORM_FIELD_PARAM_SQL_QUERY_LABEL="Query" +JLIB_FORM_FIELD_PARAM_TEXTAREA_COLS_DESC="The number of columns of the field." +JLIB_FORM_FIELD_PARAM_TEXTAREA_COLS_LABEL="Columns" +JLIB_FORM_FIELD_PARAM_TEXTAREA_ROWS_DESC="The number of rows of the field." +JLIB_FORM_FIELD_PARAM_TEXTAREA_ROWS_LABEL="Rows" +JLIB_FORM_FIELD_PARAM_URL_RELATIVE_DESC="Are relative URLs allowed." +JLIB_FORM_FIELD_PARAM_URL_RELATIVE_LABEL="Relative" +JLIB_FORM_FIELD_PARAM_URL_SCHEMES_DESC="The allowed schemes." +JLIB_FORM_FIELD_PARAM_URL_SCHEMES_LABEL="Schemes" JLIB_FORM_INPUTMODE="latin" JLIB_FORM_INVALID_FORM_OBJECT="Invalid Form Object: :%s" JLIB_FORM_INVALID_FORM_RULE="Invalid Form Rule: :%s" @@ -309,7 +368,7 @@ JLIB_FORM_MEDIA_PREVIEW_ALT="Selected image." JLIB_FORM_MEDIA_PREVIEW_EMPTY="No image selected." JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE="Selected image." JLIB_FORM_MEDIA_PREVIEW_TIP_TITLE="Preview" -JLIB_FORM_SELECT_USER="Select a User." +JLIB_FORM_SELECT_USER="Select a User" JLIB_FORM_VALIDATE_FIELD_INVALID="Invalid field: %s" JLIB_FORM_VALIDATE_FIELD_REQUIRED="Field required: %s" JLIB_FORM_VALIDATE_FIELD_RULE_MISSING="Validation Rule missing: %s" @@ -458,6 +517,7 @@ JLIB_INSTALLER_ABORT_CREATE_DIRECTORY="Extension %1$s: Failed to create folder: JLIB_INSTALLER_ABORT_DEBUG="Installation unexpectedly terminated:" JLIB_INSTALLER_ABORT_DETECTMANIFEST="Unable to detect manifest file." JLIB_INSTALLER_ABORT_DIRECTORY="Extension %1$s: Another %2$s is already using the named folder: %3$s. Are you trying to install the same extension again?" +JLIB_INSTALLER_ABORT_ERROR_DELETING_EXTENSIONS_RECORD="Could not delete the extension's record from the database." JLIB_INSTALLER_ABORT_EXTENSIONNOTVALID="Extension is not valid." JLIB_INSTALLER_ABORT_FILE_INSTALL_COPY_SETUP="Files Install: Could not copy setup file." JLIB_INSTALLER_ABORT_FILE_INSTALL_CUSTOM_INSTALL_FAILURE="Files Install: Custom install routine failure." @@ -522,6 +582,8 @@ JLIB_INSTALLER_ABORT_TPL_INSTALL_FAILED_CREATE_DIRECTORY="Template Install: Fail JLIB_INSTALLER_ABORT_TPL_INSTALL_ROLLBACK="Template Install: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT="Template Install: Unknown client type [%s]" JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION="For the extension %1$s version %2$s is available, but it requires at least PHP version %3$s while your system only has %4$s" +JLIB_INSTALLER_AVAILABLE_UPDATE_DB_MINIMUM="For the extension %1$s version %2$s is available, but your current database %3$s is version %4$s and is not supported. Please contact your web host to update your Database version to at least version %5$s." +JLIB_INSTALLER_AVAILABLE_UPDATE_DB_TYPE="For the extension %1$s version %2$s is available, but your current database %3$s is not supported anymore." JLIB_INSTALLER_PURGED_UPDATES="Cleared updates" JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to clear updates." JLIB_INSTALLER_DEFAULT_STYLE="%s - Default" @@ -571,6 +633,7 @@ JLIB_INSTALLER_ERROR_LANG_UNINSTALL_ELEMENT_EMPTY="Language Uninstall: Element i JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PATH_EMPTY="Language Uninstall: Language path is empty, can't uninstall files." JLIB_INSTALLER_ERROR_LANG_UNINSTALL_PROTECTED="This language can't be uninstalled. It is protected in the database (usually en-GB)." JLIB_INSTALLER_ERROR_LIB_DISCOVER_STORE_DETAILS="Library Discover install: Failed to store library details." +JLIB_INSTALLER_ERROR_LIB_REFRESH_MANIFEST_CACHE="Library Refresh manifest cache: Failed to store library details." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_MANIFEST="Library Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Library Uninstall: Manifest file invalid or not found." JLIB_INSTALLER_ERROR_LIB_UNINSTALL_LOAD_MANIFEST="Library Uninstall: Could not load manifest file." @@ -588,6 +651,7 @@ JLIB_INSTALLER_ERROR_NO_FILE="JInstaller: :Install: File does not exist %s" JLIB_INSTALLER_ERROR_NO_LANGUAGE_TAG="The package did not specify a language tag. Are you trying to install an old language package?" JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE="JInstaller: :Install: Can't find Joomla XML setup file." JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE="JInstaller: :Install: Can't find XML setup file." +JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE="Package Refresh manifest cache: Failed to store package details." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_MANIFEST="Package Uninstall: Invalid manifest file." JLIB_INSTALLER_ERROR_PACK_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Package Uninstall: Manifest file invalid or not found: %s" JLIB_INSTALLER_ERROR_PACK_UNINSTALL_LOAD_MANIFEST="Package Uninstall: Could not load manifest file." @@ -607,6 +671,7 @@ JLIB_INSTALLER_ERROR_SQL_ERROR="JInstaller: :Install: Error SQL %s" JLIB_INSTALLER_ERROR_SQL_FILENOTFOUND="JInstaller: :Install: SQL File not found %s" JLIB_INSTALLER_ERROR_SQL_READBUFFER="JInstaller: :Install: SQL File Buffer Read Error." JLIB_INSTALLER_ERROR_TPL_DISCOVER_STORE_DETAILS="Template Discover install: Failed to store template details." +JLIB_INSTALLER_ERROR_TPL_REFRESH_MANIFEST_CACHE="Template Refresh manifest cache: Failed to store template details." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION="Template Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT="Template Uninstall: Invalid client." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Template Uninstall: Manifest file invalid or not found." @@ -616,6 +681,7 @@ JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY="Template Uninstall: Templa JLIB_INSTALLER_ERROR_TPL_UNINSTALL_WARNCORETEMPLATE="Template Uninstall: Trying to uninstall a core template: %s" JLIB_INSTALLER_ERROR_UNKNOWN_CLIENT_TYPE="Unknown Client Type [%s]" JLIB_INSTALLER_FILE_ERROR_MOVE="Error on moving file %s" +JLIB_INSTALLER_INCORRECT_SEQUENCE="Downgrading from version %1$s to version %2$s is not allowed." JLIB_INSTALLER_INSTALL="Install" JLIB_INSTALLER_MINIMUM_JOOMLA="You don't have the minimum Joomla version requirement of J%s" JLIB_INSTALLER_MINIMUM_PHP="Your server doesn't meet the minimum PHP version requirement of %s" @@ -627,9 +693,16 @@ JLIB_INSTALLER_ERROR_EXTENSION_INVALID_CLIENT_IDENTIFIER="Invalid client identif JLIB_INSTALLER_ERROR_PACK_UNINSTALL_UNKNOWN_EXTENSION="Attempting to uninstall unknown extension from package. This extension may have already been removed earlier." JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE language files it has no effect on the installation of the language(s). Some language packs created prior to Joomla! 3.2.0 may try to install separate TinyMCE language files. As these are now included in the core they no longer need to be installed." JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s." +JLIB_INSTALLER_WARNING_UNABLE_TO_INSTALL_CONTENT_LANGUAGE="Unable to create a content language for %s language: %s" + +JLIB_JS_AJAX_ERROR_CONNECTION_ABORT="A connection abort has occurred while fetching the JSON data." +JLIB_JS_AJAX_ERROR_NO_CONTENT="No content was returned." +JLIB_JS_AJAX_ERROR_OTHER="An error has occurred while fetching the JSON data: HTTP %s status code." +JLIB_JS_AJAX_ERROR_PARSE="A parse error has occurred while processing the following JSON data:
    %s" +JLIB_JS_AJAX_ERROR_TIMEOUT="A timeout has occurred while fetching the JSON data." JLIB_MAIL_FUNCTION_DISABLED="The mail() function has been disabled and the mail can't be sent." -JLIB_MAIL_FUNCTION_OFFLINE="The mail function has been temporarily disabled on this site, please try again later." +JLIB_MAIL_FUNCTION_OFFLINE="The mail function has been disabled by an administrator." JLIB_MAIL_INVALID_EMAIL_SENDER="JMail: : Invalid email Sender: %s, JMail: :setSender(%s)." JLIB_MEDIA_ERROR_UPLOAD_INPUT="Unable to upload file." @@ -649,6 +722,7 @@ JLIB_REGISTRY_EXCEPTION_LOAD_FORMAT_CLASS="Unable to load format class." JLIB_RULES_ACTION="Action" JLIB_RULES_ALLOWED="Allowed" JLIB_RULES_ALLOWED_ADMIN="Allowed (Super User)" +JLIB_RULES_ALLOWED_INHERITED="Allowed (Inherited)" JLIB_RULES_CALCULATED_SETTING="Calculated Setting" JLIB_RULES_CONFLICT="Conflict" JLIB_RULES_DATABASE_FAILURE="Failed storing the data to the database." @@ -659,16 +733,22 @@ JLIB_RULES_INHERIT="Inherit" JLIB_RULES_INHERITED="Inherited" JLIB_RULES_NOT_ALLOWED="Not Allowed" JLIB_RULES_NOT_ALLOWED_ADMIN_CONFLICT="Conflict" +JLIB_RULES_NOT_ALLOWED_DEFAULT="Not Allowed (Default)" +JLIB_RULES_NOT_ALLOWED_INHERITED="Not Allowed (Inherited)" JLIB_RULES_NOT_ALLOWED_LOCKED="Not Allowed (Locked)" JLIB_RULES_NOT_SET="Not Set" +JLIB_RULES_NOTICE_RECALCULATE_GROUP_PERMISSIONS="Super User permissions changed. Save or reload to recalculate this group permissions." +JLIB_RULES_NOTICE_RECALCULATE_GROUP_CHILDS_PERMISSIONS="Permissions changed in a group with child groups. Save or reload to recalculate the child groups permissions." JLIB_RULES_REQUEST_FAILURE="Failed sending the data to server." JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS="Please save before changing permissions." JLIB_RULES_SELECT_ALLOW_DENY_GROUP="Allow or deny %s for users in the %s group." JLIB_RULES_SELECT_SETTING="Select New Setting" -JLIB_RULES_SETTING_NOTES="If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content." -JLIB_RULES_SETTING_NOTES_ITEM="If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings)." +JLIB_RULES_SETTING_NOTES="If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content." +JLIB_RULES_SETTING_NOTES_ITEM="If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Inherited) under Calculated Settings)." JLIB_RULES_SETTINGS_DESC="Manage the permission settings for the user groups below. See notes at the bottom." +JLIB_STEMMER_INVALID_STEMMER="Invalid stemmer type %s" + JLIB_UNKNOWN="Unknown" JLIB_UPDATER_ERROR_COLLECTION_FOPEN="The PHP allow_url_fopen setting is disabled. This setting must be enabled for the updater to work." JLIB_UPDATER_ERROR_COLLECTION_OPEN_URL="Update: :Collection: Could not open %s" @@ -679,6 +759,9 @@ JLIB_UPDATER_ERROR_OPEN_UPDATE_SITE="Update: Could not open update site #%d &quo JLIB_USER_ERROR_AUTHENTICATION_FAILED_LOAD_PLUGIN="JAuthentication: :authenticate: Failed to load plugin: %s" JLIB_USER_ERROR_AUTHENTICATION_LIBRARIES="JAuthentication: :__construct: Could not load authentication libraries." JLIB_USER_ERROR_BIND_ARRAY="Unable to bind array to user object." +JLIB_USER_ERROR_CANNOT_CHANGE_SUPER_USER="A user is not allowed to change permissions of a Super User group." +JLIB_USER_ERROR_CANNOT_CHANGE_OWN_GROUPS="A user is not allowed to change permissions of their own group(s)." +JLIB_USER_ERROR_CANNOT_CHANGE_OWN_PARENT_GROUPS="A user is not allowed to change permissions of their own group(s) parent group(s)." JLIB_USER_ERROR_CANNOT_DEMOTE_SELF="You can't remove your own Super User permissions." JLIB_USER_ERROR_CANNOT_REUSE_PASSWORD="You can't reuse your current password, please enter a new password." JLIB_USER_ERROR_ID_NOT_EXISTS="JUser: :_load: User %s does not exist." diff --git a/language/en-GB/en-GB.lib_joomla.sys.ini b/language/en-GB/en-GB.lib_joomla.sys.ini index 63bf3fe67b3f8..07feae72f54ec 100644 --- a/language/en-GB/en-GB.lib_joomla.sys.ini +++ b/language/en-GB/en-GB.lib_joomla.sys.ini @@ -3,5 +3,6 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +LIB_JOOMLA="Joomla! Platform" LIB_JOOMLA_XML_DESCRIPTION="The Joomla! Platform is the Core of the Joomla! Content Management System." diff --git a/language/en-GB/en-GB.lib_phpass.sys.ini b/language/en-GB/en-GB.lib_phpass.sys.ini index 0a71e680b2e8b..55d5af7a7f27c 100644 --- a/language/en-GB/en-GB.lib_phpass.sys.ini +++ b/language/en-GB/en-GB.lib_phpass.sys.ini @@ -3,4 +3,5 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +LIB_PHPASS="phpass" LIB_PHPASS_XML_DESCRIPTION="phpass is a portable password hashing framework for use in PHP applications. The preferred (most secure) hashing method supported by phpass is the OpenBSD-style bcrypt (known in PHP as CRYPT_BLOWFISH), with a fallback to BSDI-style extended DES-based hashes (known in PHP as CRYPT_EXT_DES) and a last resort fallback to an MD5-based variable iteration count password hashing method implemented in phpass itself." diff --git a/language/en-GB/en-GB.lib_phputf8.sys.ini b/language/en-GB/en-GB.lib_phputf8.sys.ini index 731abfd2b36de..58e4f5031311f 100644 --- a/language/en-GB/en-GB.lib_phputf8.sys.ini +++ b/language/en-GB/en-GB.lib_phputf8.sys.ini @@ -3,5 +3,6 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 +LIB_PHPUTF8="phputf8" LIB_PHPUTF8_XML_DESCRIPTION="Classes for UTF-8." diff --git a/language/en-GB/en-GB.mod_articles_category.ini b/language/en-GB/en-GB.mod_articles_category.ini index ecd90f1b6e4d9..35d717c65bb15 100644 --- a/language/en-GB/en-GB.mod_articles_category.ini +++ b/language/en-GB/en-GB.mod_articles_category.ini @@ -48,7 +48,7 @@ MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_DESC="Please enter in a numeric chara MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_LABEL="Introtext Limit" MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_LABEL="Linked Titles" MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_DESC="Linked titles." -MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC="Please select the mode you would like to use. If Normal Mode is chosen, then simply configure the module and it will display a static list of Articles on the menu items you assign the module to. If Dynamic Mode is chosen, then you can still configure the module normally, however now the Category option will no longer be used. Instead, the module will dynamically detect whether or not you are on a Category view and will display the list of articles within that Category accordingly. When Dynamic Mode is chosen, it is best to leave the module set to display on all pages, as it will decide whether or not to display anything dynamically." +MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC="Please select the mode you would like to use. If Normal Mode is chosen, then simply configure the module and it will display a static list of Articles on the menu items you assign the module to. If Dynamic Mode is chosen, then you can still configure the module normally, however now the Category option will no longer be used. Instead, the module will dynamically detect if you are on a Category view and will display the list of articles within that Category accordingly. When Dynamic Mode is chosen, it is best to leave the module set to display on all pages, as it will decide to display anything dynamically." MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL="Mode" MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC="Please enter in a valid date format. See: http://php.net/date for formatting information." MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL="Month and Year Display Format" @@ -88,9 +88,11 @@ MOD_ARTICLES_CATEGORY_OPTION_ONLYFEATURED_VALUE="Only" MOD_ARTICLES_CATEGORY_OPTION_ORDERING_VALUE="Article Order" MOD_ARTICLES_CATEGORY_OPTION_ORDERINGFEATURED_VALUE="Featured Articles Order" MOD_ARTICLES_CATEGORY_OPTION_RANDOM_VALUE="Random" +MOD_ARTICLES_CATEGORY_OPTION_RATING_VALUE="Rating" MOD_ARTICLES_CATEGORY_OPTION_RELATIVEDAY_VALUE="Relative Date" MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE="Start Publishing Date" MOD_ARTICLES_CATEGORY_OPTION_FINISHPUBLISHING_VALUE="Finish Publishing Date" +MOD_ARTICLES_CATEGORY_OPTION_VOTE_VALUE="Vote" MOD_ARTICLES_CATEGORY_OPTION_YEAR_VALUE="Year" MOD_ARTICLES_CATEGORY_READ_MORE="Read more: " MOD_ARTICLES_CATEGORY_READ_MORE_TITLE="Read More ..." diff --git a/language/en-GB/en-GB.mod_articles_news.ini b/language/en-GB/en-GB.mod_articles_news.ini index e48458414ea89..ef321d16c03ae 100644 --- a/language/en-GB/en-GB.mod_articles_news.ini +++ b/language/en-GB/en-GB.mod_articles_news.ini @@ -14,6 +14,7 @@ MOD_ARTICLES_NEWS_FIELD_LINKTITLE_LABEL="Linked Titles" MOD_ARTICLES_NEWS_FIELD_ORDERING_DESC="Select the order in which you want query results presented." MOD_ARTICLES_NEWS_FIELD_ORDERING_LABEL="Order Results" MOD_ARTICLES_NEWS_FIELD_ORDERING_CREATED_DATE="Created Date" +MOD_ARTICLES_NEWS_FIELD_ORDERING_MODIFIED_DATE="Modified Date" MOD_ARTICLES_NEWS_FIELD_ORDERING_PUBLISHED_DATE="Published Date" MOD_ARTICLES_NEWS_FIELD_ORDERING_ORDERING="Ordering" MOD_ARTICLES_NEWS_FIELD_ORDERING_RANDOM="Random" @@ -23,8 +24,10 @@ MOD_ARTICLES_NEWS_FIELD_SEPARATOR_DESC="Show separator after last Article." MOD_ARTICLES_NEWS_FIELD_SEPARATOR_LABEL="Show Last Separator" MOD_ARTICLES_NEWS_FIELD_TITLE_DESC="Show or hide the Article title." MOD_ARTICLES_NEWS_FIELD_TITLE_LABEL="Show Article Title" +MOD_ARTICLES_NEWS_FIELD_SHOWINTROTEXT_DESC="Show or hide the article intro text." +MOD_ARTICLES_NEWS_FIELD_SHOWINTROTEXT_LABEL="Show Intro Text" MOD_ARTICLES_NEWS_READMORE="Read more ..." MOD_ARTICLES_NEWS_READMORE_REGISTER="Register to Read More" MOD_ARTICLES_NEWS_TITLE_HEADING="Header Level" MOD_ARTICLES_NEWS_TITLE_HEADING_DESCRIPTION="Select the desired HTML header level for the Article titles." -MOD_ARTICLES_NEWS_XML_DESCRIPTION="The Article Newsflash Module will display a fixed number of Articles from a specific Category or a set of Categories." \ No newline at end of file +MOD_ARTICLES_NEWS_XML_DESCRIPTION="The Article Newsflash Module will display a fixed number of Articles from a specific Category or a set of Categories." diff --git a/language/en-GB/en-GB.mod_finder.ini b/language/en-GB/en-GB.mod_finder.ini index 990d7c0030787..fbcab5eeb4210 100644 --- a/language/en-GB/en-GB.mod_finder.ini +++ b/language/en-GB/en-GB.mod_finder.ini @@ -23,15 +23,15 @@ MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_DESCRIPTION="The position of the search l MOD_FINDER_FIELDSET_ADVANCED_LABEL_POS_LABEL="Label Position" MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_DESCRIPTION="Assign an ItemID by selecting a menu item in the list for the display of the search results if there is no com_finder menu item and a specific display is desired. If you do not know what this means, you may not need it." MOD_FINDER_FIELDSET_ADVANCED_SETITEMID_LABEL="Set ItemID" -MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_DESCRIPTION="Toggle whether a button should be displayed for the search form." +MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_DESCRIPTION="Show or hide a button for the search form." MOD_FINDER_FIELDSET_ADVANCED_SHOW_BUTTON_LABEL="Search Button" -MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_DESCRIPTION="Toggle whether a label should be displayed for the search field." +MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_DESCRIPTION="Show or hide a label for the search field." MOD_FINDER_FIELDSET_ADVANCED_SHOW_LABEL_LABEL="Search Field Label" -MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_DESCRIPTION="Toggle whether automatic search suggestions should be displayed." +MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_DESCRIPTION="Show or hide automatic search suggestions." MOD_FINDER_FIELDSET_BASIC_AUTOSUGGEST_LABEL="Search Suggestions" MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_DESCRIPTION="Selecting a Search Filter will limit any searches submitted through this module to use the selected filter." MOD_FINDER_FIELDSET_BASIC_SEARCHFILTER_LABEL="Search Filter" -MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_DESCRIPTION="Toggle whether users should be able to see advanced search options. If set to Link to Component option creates a Smart Search link which redirects to the smart search view. If set to show, the advanced search options will be displayed inline." +MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_DESCRIPTION="Show or hide advanced search options. If set to Link to Component option creates a Smart Search link which redirects to the smart search view. If set to show, the advanced search options will be displayed inline." MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_LABEL="Advanced Search" MOD_FINDER_FIELDSET_BASIC_SHOW_ADVANCED_OPTION_LINK="Link to Component" MOD_FINDER_FIELD_OPENSEARCH_DESCRIPTION="Some browsers can add support for your site's search if this option is enabled." diff --git a/language/en-GB/en-GB.mod_languages.ini b/language/en-GB/en-GB.mod_languages.ini index 81b043ad332ca..66a2347329393 100644 --- a/language/en-GB/en-GB.mod_languages.ini +++ b/language/en-GB/en-GB.mod_languages.ini @@ -6,7 +6,7 @@ MOD_LANGUAGES="Language Switcher" MOD_LANGUAGES_FIELD_ACTIVE_DESC="Display or not the active language. If displayed, the class 'lang-active' will be added to the element." MOD_LANGUAGES_FIELD_ACTIVE_LABEL="Active Language" -MOD_LANGUAGES_FIELD_CACHING_DESC="Select whether to cache or not the content of this module.
    This should be set to 'No caching' when using Items Associations." +MOD_LANGUAGES_FIELD_CACHING_DESC="Use the global cache setting to cache the content of this module or disable caching for this module.
    This should be set to 'No caching' when using Items Associations." MOD_LANGUAGES_FIELD_DROPDOWN_DESC="If set to 'Yes', the content languages native names will display in a dropdown." MOD_LANGUAGES_FIELD_DROPDOWN_LABEL="Use Dropdown" MOD_LANGUAGES_FIELD_DROPDOWN_IMAGE_DESC="Add image flags to the dropdown." diff --git a/language/en-GB/en-GB.mod_login.ini b/language/en-GB/en-GB.mod_login.ini index 8933d1ed59420..7103258635f54 100644 --- a/language/en-GB/en-GB.mod_login.ini +++ b/language/en-GB/en-GB.mod_login.ini @@ -16,6 +16,8 @@ MOD_LOGIN_FIELD_POST_TEXT_DESC="This is the text or HTML that is displayed below MOD_LOGIN_FIELD_POST_TEXT_LABEL="Post-text" MOD_LOGIN_FIELD_PRE_TEXT_DESC="This is the text or HTML that is displayed above the login form." MOD_LOGIN_FIELD_PRE_TEXT_LABEL="Pre-text" +MOD_LOGIN_FIELD_PROFILE_LABEL="Show Profile Link" +MOD_LOGIN_FIELD_PROFILE_DESC="Show a link to the User Profile page after logging in." MOD_LOGIN_FIELD_USESECURE_DESC="Submit encrypted login data using HTTPS (encrypted HTTP connections with the https:// protocol prefix). Note, you must have HTTPS enabled on your server to utilise this option." MOD_LOGIN_FIELD_USESECURE_LABEL="Encrypt Login Form" MOD_LOGIN_FIELD_USETEXT_DESC="Choose text or icons to display the field labels. Default is icons." @@ -23,6 +25,7 @@ MOD_LOGIN_FIELD_USETEXT_LABEL="Display Labels" MOD_LOGIN_FORGOT_YOUR_PASSWORD="Forgot your password?" MOD_LOGIN_FORGOT_YOUR_USERNAME="Forgot your username?" MOD_LOGIN_HINAME="Hi %s," +MOD_LOGIN_PROFILE="View Profile" MOD_LOGIN_REGISTER="Create an account" MOD_LOGIN_REMEMBER_ME="Remember Me" MOD_LOGIN_VALUE_ICONS="Icons" diff --git a/language/en-GB/en-GB.mod_menu.ini b/language/en-GB/en-GB.mod_menu.ini index 550b176282e33..4d4ab0230ebfd 100644 --- a/language/en-GB/en-GB.mod_menu.ini +++ b/language/en-GB/en-GB.mod_menu.ini @@ -18,6 +18,6 @@ MOD_MENU_FIELD_STARTLEVEL_DESC="Level to start rendering the menu at. Setting th MOD_MENU_FIELD_STARTLEVEL_LABEL="Start Level" MOD_MENU_FIELD_TAG_ID_DESC="An ID attribute to assign to the root ul tag of the menu (optional)." MOD_MENU_FIELD_TAG_ID_LABEL="Menu Tag ID" -MOD_MENU_FIELD_TARGET_DESC="JavaScript values to position a popup window, eg top=50,left=50,width=200,height=300." +MOD_MENU_FIELD_TARGET_DESC="JavaScript values to position a popup window, eg top=50, left=50, width=200, height=300." MOD_MENU_FIELD_TARGET_LABEL="Target Position" MOD_MENU_XML_DESCRIPTION="This module displays a menu on the Frontend." diff --git a/language/en-GB/en-GB.mod_tags_popular.ini b/language/en-GB/en-GB.mod_tags_popular.ini index ea73f1b1b9d4f..a117e30380b66 100644 --- a/language/en-GB/en-GB.mod_tags_popular.ini +++ b/language/en-GB/en-GB.mod_tags_popular.ini @@ -29,6 +29,6 @@ MOD_TAGS_POPULAR_FIELD_TIMEFRAME_DESC="Sets the time period for which to calcula MOD_TAGS_POPULAR_FIELD_TIMEFRAME_LABEL="Time Period" MOD_TAGS_POPULAR_FIELDSET_CLOUD_LABEL="Cloud Layout" MOD_TAGS_POPULAR_MAX_DESC="Sets the maximum number of tags to display in the module." -MOD_TAGS_POPULAR_MAX_LABEL="Maximum tags" +MOD_TAGS_POPULAR_MAX_LABEL="Maximum Tags" MOD_TAGS_POPULAR_NO_ITEMS_FOUND="No Tags found." MOD_TAGS_POPULAR_XML_DESCRIPTION="This module displays tags used on the site in a list or a cloud layout. Tags can be ordered by title or by the number of tagged items and limited to a specific time period." diff --git a/language/en-GB/en-GB.mod_whosonline.ini b/language/en-GB/en-GB.mod_whosonline.ini index 0160ff6ea9b5c..14ae2ca8623bf 100644 --- a/language/en-GB/en-GB.mod_whosonline.ini +++ b/language/en-GB/en-GB.mod_whosonline.ini @@ -4,7 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 MOD_WHOSONLINE="Who's Online" MOD_WHOSONLINE_FIELD_FILTER_GROUPS_DESC="Choose to filter by groups of the connected user" -MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL="Filter groups" +MOD_WHOSONLINE_FIELD_FILTER_GROUPS_LABEL="Filter Groups" MOD_WHOSONLINE_FIELD_LINKTOWHAT_DESC="Choose the type of information to display" MOD_WHOSONLINE_FIELD_LINKTOWHAT_LABEL="Information" MOD_WHOSONLINE_FIELD_VALUE_BOTH="Both" @@ -21,7 +21,7 @@ MOD_WHOSONLINE_MEMBERS_0="no members" MOD_WHOSONLINE_SAME_GROUP_MESSAGE="List of Users who belong to your user groups or your user groups' child groups" MOD_WHOSONLINE_SHOWMODE_DESC="Select what will be shown" MOD_WHOSONLINE_SHOWMODE_LABEL="Display" -MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the Web site." +MOD_WHOSONLINE_XML_DESCRIPTION="The Who's Online Module displays the number of Anonymous Users (e.g. Guests) and Registered Users (ones logged-in) that are currently accessing the website." ; frontend display ; in the following string ; %1$s is for guests and %2$s for members diff --git a/language/en-GB/en-GB.mod_wrapper.ini b/language/en-GB/en-GB.mod_wrapper.ini index f2453602ecb74..90adc963020b2 100644 --- a/language/en-GB/en-GB.mod_wrapper.ini +++ b/language/en-GB/en-GB.mod_wrapper.ini @@ -21,5 +21,5 @@ MOD_WRAPPER_FIELD_WIDTH_DESC="Width of the iframe window. You can enter an absol MOD_WRAPPER_FIELD_WIDTH_LABEL="Width" MOD_WRAPPER_NO_IFRAMES="No iframes" MOD_WRAPPER_XML_DESCRIPTION="This module shows an iframe window to specified location." -MOD_WRAPPER_FIELD_FRAME_LABEL="Frame border" +MOD_WRAPPER_FIELD_FRAME_LABEL="Frame Border" MOD_WRAPPER_FIELD_FRAME_DESC="Show frame border which wraps the iframe." \ No newline at end of file diff --git a/language/en-GB/en-GB.tpl_protostar.ini b/language/en-GB/en-GB.tpl_protostar.ini index 0d7ec7e1e582d..15697fbd53ee6 100644 --- a/language/en-GB/en-GB.tpl_protostar.ini +++ b/language/en-GB/en-GB.tpl_protostar.ini @@ -20,4 +20,5 @@ TPL_PROTOSTAR_FONT_NAME_DESC="Example: Open+Sans or Source+Sans+Pro." TPL_PROTOSTAR_LOGO_LABEL="Logo" TPL_PROTOSTAR_LOGO_DESC="Select or upload a custom logo for the site template." TPL_PROTOSTAR_STATIC="Static" +TPL_PROTOSTAR_TOGGLE_MENU="Toggle Navigation" diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index 704e120625e59..ae53d68e42998 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -1,21 +1,23 @@ English (en-GB) - 3.6.0 - April 2016 + 3.6.4 + October 2016 Joomla! Project admin@joomla.org www.joomla.org Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - en-GB site language + English (en-GB) + English (United Kingdom) en-GB 0 en_GB.utf8, en_GB.UTF-8, en_GB, eng_GB, en, english, english-uk, uk, gbr, britain, england, great britain, uk, united kingdom, united-kingdom 0 0,6 + gregorian diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index f31dc9182aa32..2c11420eca3d0 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -1,9 +1,9 @@ - English (United Kingdom) + English (en-GB) en-GB - 3.6.0 - 2013-03-07 + 3.6.4 + October 2016 Joomla! Project admin@joomla.org www.joomla.org diff --git a/layouts/joomla/content/associations.php b/layouts/joomla/content/associations.php index 9da0b950063d7..578d161317f1d 100644 --- a/layouts/joomla/content/associations.php +++ b/layouts/joomla/content/associations.php @@ -14,9 +14,9 @@ if (!empty($items)) : ?>
      $item) : ?> -
    • - link; ?> -
    • +
    • + link; ?> +
    - diff --git a/layouts/joomla/content/blog_style_default_item_title.php b/layouts/joomla/content/blog_style_default_item_title.php index 28fbb5c12e40a..524f77b078f0b 100644 --- a/layouts/joomla/content/blog_style_default_item_title.php +++ b/layouts/joomla/content/blog_style_default_item_title.php @@ -15,29 +15,34 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); ?> - get('show_title') || $displayData->state == 0 || ($params->get('show_author') && !empty($displayData->author ))) : ?> - - +
    + diff --git a/layouts/joomla/content/blog_style_default_links.php b/layouts/joomla/content/blog_style_default_links.php index a4bb9b5d31569..abf7a2c60d63c 100644 --- a/layouts/joomla/content/blog_style_default_links.php +++ b/layouts/joomla/content/blog_style_default_links.php @@ -12,8 +12,7 @@ diff --git a/layouts/joomla/content/categories_default.php b/layouts/joomla/content/categories_default.php index ea581fdd4b494..00ed399b6b4fd 100644 --- a/layouts/joomla/content/categories_default.php +++ b/layouts/joomla/content/categories_default.php @@ -17,17 +17,17 @@ params->get('show_base_description')) : ?> - - params->get('categories_description')) : ?> -
    + + params->get('categories_description')) : ?> +
    params->get('categories_description'), '', $displayData->get('extension') . '.categories'); ?> +
    + + + parent->description) : ?> +
    + parent->description, '', $displayData->parent->extension . '.categories'); ?>
    - - - parent->description) : ?> -
    - parent->description, '', $displayData->parent->extension . '.categories'); ?> -
    - + diff --git a/layouts/joomla/content/categories_default_items.php b/layouts/joomla/content/categories_default_items.php index 972c8ae960be6..e87c181bad1bf 100644 --- a/layouts/joomla/content/categories_default_items.php +++ b/layouts/joomla/content/categories_default_items.php @@ -19,7 +19,7 @@ $className = substr($extension, 4); // This will work for the core components but not necessarily for other components // that may have different pluralisation rules. -if (substr($className, -1) == 's') +if (substr($className, -1) === 's') { $className = rtrim($className, 's'); } diff --git a/layouts/joomla/content/category_default.php b/layouts/joomla/content/category_default.php index 7fe72394aa99e..8f53e7e19f0b6 100644 --- a/layouts/joomla/content/category_default.php +++ b/layouts/joomla/content/category_default.php @@ -22,7 +22,7 @@ * This will work for the core components but not necessarily for other components * that may have different pluralisation rules. */ -if (substr($className, -1) == 's') +if (substr($className, -1) === 's') { $className = rtrim($className, 's'); } @@ -59,7 +59,7 @@ loadTemplate($displayData->subtemplatename); ?> - get('children') && $displayData->maxLevel != 0) : ?> + maxLevel != 0 && $displayData->get('children')) : ?>
    get('show_category_heading_title_text', 1) == 1) : ?>

    diff --git a/layouts/joomla/content/icons/create.php b/layouts/joomla/content/icons/create.php new file mode 100644 index 0000000000000..64ea4b2360bf9 --- /dev/null +++ b/layouts/joomla/content/icons/create.php @@ -0,0 +1,27 @@ + +get('show_icons')) : ?> + + + + + + + + + diff --git a/layouts/joomla/content/icons/edit.php b/layouts/joomla/content/icons/edit.php new file mode 100644 index 0000000000000..bff0fd8f25f8a --- /dev/null +++ b/layouts/joomla/content/icons/edit.php @@ -0,0 +1,45 @@ +state ? 'edit.png' : 'edit_unpublished.png'; + + if (strtotime($article->publish_up) > strtotime(JFactory::getDate()) + || ((strtotime($article->publish_down) < strtotime(JFactory::getDate())) && $article->publish_down != JFactory::getDbo()->getNullDate())) + { + $icon = 'edit_unpublished.png'; + } +} +else +{ + $icon = $article->state ? 'edit' : 'eye-close'; + + if (strtotime($article->publish_up) > strtotime(JFactory::getDate()) + || ((strtotime($article->publish_down) < strtotime(JFactory::getDate())) && $article->publish_down != JFactory::getDbo()->getNullDate())) + { + $icon = 'eye-close'; + } +} + +?> + + + + + + diff --git a/layouts/joomla/content/icons/edit_lock.php b/layouts/joomla/content/icons/edit_lock.php new file mode 100644 index 0000000000000..cb1c08cdc9bd8 --- /dev/null +++ b/layouts/joomla/content/icons/edit_lock.php @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/layouts/joomla/content/icons/email.php b/layouts/joomla/content/icons/email.php new file mode 100644 index 0000000000000..ec3b7358f2697 --- /dev/null +++ b/layouts/joomla/content/icons/email.php @@ -0,0 +1,25 @@ + +get('show_icons')) : ?> + + + + + + + + + diff --git a/layouts/joomla/content/icons/print_popup.php b/layouts/joomla/content/icons/print_popup.php new file mode 100644 index 0000000000000..fff72b9b3fbf8 --- /dev/null +++ b/layouts/joomla/content/icons/print_popup.php @@ -0,0 +1,26 @@ + +get('show_icons')) : ?> + + + + + + + + + + diff --git a/layouts/joomla/content/icons/print_screen.php b/layouts/joomla/content/icons/print_screen.php new file mode 100644 index 0000000000000..fff72b9b3fbf8 --- /dev/null +++ b/layouts/joomla/content/icons/print_screen.php @@ -0,0 +1,26 @@ + +get('show_icons')) : ?> + + + + + + + + + + diff --git a/layouts/joomla/content/info_block/associations.php b/layouts/joomla/content/info_block/associations.php new file mode 100644 index 0000000000000..37f65bc022518 --- /dev/null +++ b/layouts/joomla/content/info_block/associations.php @@ -0,0 +1,26 @@ + +associations)) : ?> +associations; ?> +
    + + + params->get('flags', 1) && $association['language']->image) : ?> + image . '.gif', $association['language']->title_native, array('title' => $association['language']->title_native), true); ?> +    + + sef; ?> +  sef); ?>  + + +
    + diff --git a/layouts/joomla/content/info_block/author.php b/layouts/joomla/content/info_block/author.php index 8c8d332e92b0d..29a2d5363699d 100644 --- a/layouts/joomla/content/info_block/author.php +++ b/layouts/joomla/content/info_block/author.php @@ -11,7 +11,7 @@ ?>

    + getForm()->renderField('published'); ?> getForm()->renderField('state'); ?> + getForm()->renderField('access'); ?> getForm()->renderField('featured'); ?> getForm()->renderField('language'); ?> - + + getForm()->renderField('tags'); ?> getForm()->renderField('version_note'); ?> diff --git a/layouts/joomla/edit/frontediting_modules.php b/layouts/joomla/edit/frontediting_modules.php index a2e9dbb45e3f8..477d7a0180612 100644 --- a/layouts/joomla/edit/frontediting_modules.php +++ b/layouts/joomla/edit/frontediting_modules.php @@ -28,7 +28,7 @@ // Add css class jmoddiv and data attributes for module-editing URL and for the tooltip: $editUrl = JUri::base() . 'administrator/index.php?option=com_modules&task=module.edit&id=' . (int) $mod->id; -if ($parameters->get('redirect_edit', 'site') == 'site') +if ($parameters->get('redirect_edit', 'site') === 'site') { $editUrl = JUri::base() . 'index.php?option=com_config&controller=config.display.modules&id=' . (int) $mod->id . $redirectUri; $target = '_self'; @@ -38,7 +38,7 @@ $count = 0; $moduleHtml = preg_replace( // Replace first tag of module with a class - '/^(\s*<(?:div|span|nav|ul|ol|h\d) [^>]*class="[^"]*)"/', + '/^(\s*<(?:div|span|nav|ul|ol|h\d|section|aside|nav|address|article) [^>]*class="[^"]*)"/', // By itself, adding class jmoddiv and data attributes for the url and tooltip: '\\1 jmoddiv" data-jmodediturl="' . $editUrl . '" data-target="' . $target . '" data-jmodtip="' . JHtml::tooltipText( @@ -48,7 +48,7 @@ ) . '"' // And if menu editing is enabled and allowed and it's a menu module, add data attributes for menu editing: - . ($menusEditing && $mod->module == 'mod_menu' ? + . ($menusEditing && $mod->module === 'mod_menu' ? '" data-jmenuedittip="' . JHtml::tooltipText('JLIB_HTML_EDIT_MENU_ITEM', 'JLIB_HTML_EDIT_MENU_ITEM_ID') . '"' : '' @@ -64,6 +64,6 @@ JHtml::_('bootstrap.tooltip'); JHtml::_('bootstrap.popover'); - JHtml::_('stylesheet', 'system/frontediting.css', array(), true); - JHtml::_('script', 'system/frontediting.js', false, true); + JHtml::_('stylesheet', 'system/frontediting.css', array('version' => 'auto', 'relative' => true)); + JHtml::_('script', 'system/frontediting.js', array('version' => 'auto', 'relative' => true)); } diff --git a/layouts/joomla/edit/global.php b/layouts/joomla/edit/global.php index a88ed84c74152..0abcfc5986511 100644 --- a/layouts/joomla/edit/global.php +++ b/layouts/joomla/edit/global.php @@ -14,7 +14,7 @@ $input = $app->input; $component = $input->getCmd('option', 'com_content'); -if ($component == 'com_categories') +if ($component === 'com_categories') { $extension = $input->getCmd('extension', 'com_content'); $parts = explode('.', $extension); diff --git a/layouts/joomla/edit/metadata.php b/layouts/joomla/edit/metadata.php index b1cc161d5b4c0..67f8fc349dfe3 100644 --- a/layouts/joomla/edit/metadata.php +++ b/layouts/joomla/edit/metadata.php @@ -22,7 +22,7 @@ renderField('metadesc'); echo $form->renderField('metakey'); @@ -31,7 +31,7 @@ foreach ($form->getFieldset($name) as $field) { - if ($field->name != 'jform[metadata][tags][]') + if ($field->name !== 'jform[metadata][tags][]') { echo $field->renderField(); } diff --git a/layouts/joomla/edit/params.php b/layouts/joomla/edit/params.php index fb49b5418cc12..69f6a545b3d57 100644 --- a/layouts/joomla/edit/params.php +++ b/layouts/joomla/edit/params.php @@ -39,9 +39,10 @@ foreach ($fieldSets as $name => $fieldSet) { // Ensure any fieldsets we don't want to show are skipped (including repeating formfield fieldsets) - if (in_array($name, $ignoreFieldsets) || (!empty($configFieldsets) && in_array($name, $configFieldsets)) - || !empty($hiddenFieldsets) && in_array($name, $hiddenFieldsets) - || (isset($fieldSet->repeat) && $fieldSet->repeat == true) + if ((isset($fieldSet->repeat) && $fieldSet->repeat == true) + || in_array($name, $ignoreFieldsets) + || (!empty($configFieldsets) && in_array($name, $configFieldsets)) + || (!empty($hiddenFieldsets) && in_array($name, $hiddenFieldsets)) ) { continue; @@ -49,16 +50,16 @@ if (!empty($fieldSet->label)) { - $label = JText::_($fieldSet->label, true); + $label = JText::_($fieldSet->label); } else { $label = strtoupper('JGLOBAL_FIELDSET_' . $name); - if (JText::_($label, true) == $label) + if (JText::_($label) === $label) { $label = strtoupper($app->input->get('option') . '_' . $name . '_FIELDSET_LABEL'); } - $label = JText::_($label, true); + $label = JText::_($label); } echo JHtml::_('bootstrap.addTab', 'myTab', 'attrib-' . $name, $label); diff --git a/layouts/joomla/editors/buttons/button.php b/layouts/joomla/editors/buttons/button.php index 43c3ef278f35d..c8a989724c7aa 100644 --- a/layouts/joomla/editors/buttons/button.php +++ b/layouts/joomla/editors/buttons/button.php @@ -14,11 +14,11 @@ ?> get('name')) : ?> get('class')) ? $button->get('class') : null; - $class .= ($button->get('modal')) ? ' modal-button' : null; - $href = ($button->get('link')) ? ' href="' . JUri::base() . $button->get('link') . '"' : null; - $onclick = ($button->get('onclick')) ? ' onclick="' . $button->get('onclick') . '"' : ''; - $title = ($button->get('title')) ? $button->get('title') : $button->get('text'); + $class = $button->get('class') ?: null; + $class .= $button->get('modal') ? ' modal-button' : null; + $href = $button->get('link') ? ' href="' . JUri::base() . $button->get('link') . '"' : null; + $onclick = $button->get('onclick') ? ' onclick="' . $button->get('onclick') . '"' : ''; + $title = $button->get('title') ?: $button->get('text'); // Load modal popup behavior if ($button->get('modal')) diff --git a/layouts/joomla/form/field/checkboxes.php b/layouts/joomla/form/field/checkboxes.php index 4ce445a66e514..2779bf68879c3 100644 --- a/layouts/joomla/form/field/checkboxes.php +++ b/layouts/joomla/form/field/checkboxes.php @@ -34,7 +34,7 @@ * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. - * @var boolean $spellchec Spellcheck state for the form field. + * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * @var array $checkedOptions Options that will be set as checked. @@ -44,7 +44,7 @@ // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); -JHtml::_('script', 'system/html5fallback.js', false, true); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); /** * The format of the input tag to be filled in using sprintf. diff --git a/layouts/joomla/form/field/color/advanced.php b/layouts/joomla/form/field/color/advanced.php new file mode 100644 index 0000000000000..b5b6a6681f0c8 --- /dev/null +++ b/layouts/joomla/form/field/color/advanced.php @@ -0,0 +1,81 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellchec Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $checked Is this field checked? + * @var array $position Is this field checked? + * @var array $control Is this field checked? + */ + +if (in_array($format, array('rgb', 'rgba')) && $validate != 'color') +{ + $alpha = ($format == 'rgba') ? true : false; + $placeholder = $alpha ? 'rgba(0, 0, 0, 0.5)' : 'rgb(0, 0, 0)'; +} +else +{ + $placeholder = '#rrggbb'; +} + +$inputclass = ($keywords && ! in_array($format, array('rgb', 'rgba'))) ? ' keywords' : ' ' . $format; +$class = ' class="' . trim('minicolors ' . $class) . ($validate == 'color' ? '' : $inputclass) . '"'; +$control = $control ? ' data-control="' . $control . '"' : ''; +$format = $format ? ' data-format="' . $format . '"' : ''; +$keywords = $keywords ? ' data-keywords="' . $keywords . '"' : ''; +$readonly = $readonly ? ' readonly' : ''; +$hint = strlen($hint) ? ' placeholder="' . $hint . '"' : ' placeholder="' . $placeholder . '"'; +$autocomplete = ! $autocomplete ? ' autocomplete="off"' : ''; + +// Force LTR input value in RTL, due to display issues with rgba/hex colors +$direction = $lang->isRTL() ? ' dir="ltr" style="text-align:right"' : ''; + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('script', 'jui/jquery.minicolors.min.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('stylesheet', 'jui/jquery.minicolors.css', array('version' => 'auto', 'relative' => true)); +JHtml::_('script', 'system/color-field-adv-init.min.js', array('version' => 'auto', 'relative' => true)); +?> +/> diff --git a/layouts/joomla/form/field/color/simple.php b/layouts/joomla/form/field/color/simple.php new file mode 100644 index 0000000000000..f686d351293c0 --- /dev/null +++ b/layouts/joomla/form/field/color/simple.php @@ -0,0 +1,66 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellchec Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $checked Is this field checked? + * @var array $position Is this field checked? + * @var array $control Is this field checked? + */ + +$class = ' class="' . trim('simplecolors chzn-done ' . $class) . '"'; + +// Include jQuery +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('script', 'jui/jquery.simplecolors.min.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('stylesheet', 'jui/jquery.simplecolors.css', array('version' => 'auto', 'relative' => true)); +JHtml::_('script', 'system/color-field-init.min.js', array('version' => 'auto', 'relative' => true)); +?> + diff --git a/layouts/joomla/form/field/email.php b/layouts/joomla/form/field/email.php new file mode 100644 index 0000000000000..a5795ebf5e145 --- /dev/null +++ b/layouts/joomla/form/field/email.php @@ -0,0 +1,75 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var array $spellcheck Options available for this field. + * @var string $accept File types that are accepted. + */ + +$autocomplete = !$autocomplete ? 'autocomplete="off"' : 'autocomplete="' . $autocomplete . '"'; +$autocomplete = $autocomplete == 'autocomplete="on"' ? '' : $autocomplete; + +$attributes = array( + $spellcheck ? '' : 'spellcheck="false"', + !empty($size) ? 'size="' . $size . '"' : '', + $disabled ? 'disabled' : '', + $readonly ? 'readonly' : '', + $onchange ? 'onchange="' . $onchange . '"' : '', + $autocomplete, + $multiple ? 'multiple' : '', + !empty($maxLength) ? 'maxlength="' . $maxLength . '"' : '', + strlen($hint) ? 'placeholder="' . $hint . '"' : '', + $required ? 'required aria-required="true"' : '', + $autofocus ? 'autofocus' : '', +); + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +?> + id="" value="" + /> diff --git a/layouts/joomla/form/field/file.php b/layouts/joomla/form/field/file.php index 4100a3ad501b7..8633188b27467 100644 --- a/layouts/joomla/form/field/file.php +++ b/layouts/joomla/form/field/file.php @@ -47,7 +47,9 @@ // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); -JHtml::_('script', 'system/html5fallback.js', false, true); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +$maxSize = JHtml::_('number.bytes', JUtility::getMaxUploadSize()); ?> - /> + />
    + diff --git a/layouts/joomla/form/field/hidden.php b/layouts/joomla/form/field/hidden.php new file mode 100644 index 0000000000000..feaf316ee7af6 --- /dev/null +++ b/layouts/joomla/form/field/hidden.php @@ -0,0 +1,54 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + */ + +// Initialize some field attributes. +$class = !empty($class) ? ' class="' . $class . '"' : ''; +$disabled = $disabled ? ' disabled' : ''; +$onchange = $onchange ? ' onchange="' . $onchange . '"' : ''; +?> + /> diff --git a/layouts/joomla/form/field/media.php b/layouts/joomla/form/field/media.php index b44d7eca36186..aabf80d63fbae 100644 --- a/layouts/joomla/form/field/media.php +++ b/layouts/joomla/form/field/media.php @@ -54,7 +54,7 @@ // Include jQuery JHtml::_('jquery.framework'); -JHtml::_('script', 'media/mediafield-mootools.min.js', true, true, false, false, true); +JHtml::_('script', 'media/mediafield-mootools.min.js', array('version' => 'auto', 'relative' => true, 'framework' => true)); // Tooltip for INPUT showing whole image path $options = array( @@ -170,8 +170,7 @@ ?> > diff --git a/layouts/joomla/form/field/meter.php b/layouts/joomla/form/field/meter.php new file mode 100644 index 0000000000000..e7f6277d0aa1a --- /dev/null +++ b/layouts/joomla/form/field/meter.php @@ -0,0 +1,80 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + * @var string $animated Is it animated. + * @var string $active Is it active. + * @var string $min The minimum value. + * @var string $max The maximum value. + * @var string $step The step value. + */ + +// Initialize some field attributes. +$class = 'progress ' . $class; +$class .= $animated ? ' progress-striped' : ''; +$class .= $active ? ' active' : ''; +$class = 'class="' . $class . '"'; + +$value = (float) $value; +$value = $value < $min ? $min : $value; +$value = $value > $max ? $max : $value; + +$data = ''; +$data .= 'data-max="' . $max . '"'; +$data .= ' data-min="' . $min . '"'; +$data .= ' data-step="' . $step . '"'; +$data .= ' data-value="' . $value . '"'; + +$attributes = array( + $class, + !empty($width) ? ' style="width:' . $width . ';"' : '', + $data +); + +$value = ((float) ($value - $min) * 100) / ($max - $min); +?> +
    > +
    +
    diff --git a/layouts/joomla/form/field/moduleorder.php b/layouts/joomla/form/field/moduleorder.php new file mode 100644 index 0000000000000..a1e6aa9b8e90b --- /dev/null +++ b/layouts/joomla/form/field/moduleorder.php @@ -0,0 +1,65 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var array $spellcheck Options available for this field. + * @var string $accept File types that are accepted. + */ + +$attr = ''; + +// Initialize some field attributes. +$attr .= !empty($class) ? ' class="module-ajax-ordering ' . $class . '"' : 'class="module-ajax-ordering"'; +$attr .= $disabled ? ' disabled' : ''; +$attr .= !empty($size) ? ' size="' . $size . '"' : ''; + +// Initialize JavaScript field attributes. +$attr .= !empty($onchange) ? ' onchange="' . $onchange . '"' : ''; + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('behavior.core'); +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/moduleorder.js', array('version' => 'auto', 'relative' => true)); +?> +
    data-url="" data-element="" data-ordering="" data-position-element ="" data-client-id="" data-name="">
    diff --git a/layouts/joomla/form/field/number.php b/layouts/joomla/form/field/number.php new file mode 100644 index 0000000000000..4b8c9d4bf5d72 --- /dev/null +++ b/layouts/joomla/form/field/number.php @@ -0,0 +1,84 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var array $spellcheck Options available for this field. + * @var string $accept File types that are accepted. + */ + +$autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"'; +$autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; + +$attributes = array( + !empty($class) ? 'class="' . $class . '"' : '', + !empty($size) ? 'size="' . $size . '"' : '', + $disabled ? 'disabled' : '', + $readonly ? 'readonly' : '', + strlen($hint) ? 'placeholder="' . $hint . '"' : '', + !empty($onchange) ? 'onchange="' . $onchange . '"' : '', + isset($max) ? 'max="' . $max . '"' : '', + !empty($step) ? 'step="' . $step . '"' : '', + isset($min) ? 'min="' . $min . '"' : '', + $required ? 'required aria-required="true"' : '', + $autocomplete, + $autofocus ? 'autofocus' : '' +); + +if (is_numeric($value)) +{ + $value = (float) $value; +} +else +{ + $value = ""; + $value = (isset($min)) ? $min : $value; +} + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +?> + /> diff --git a/layouts/joomla/form/field/password.php b/layouts/joomla/form/field/password.php new file mode 100644 index 0000000000000..55757c795fb2d --- /dev/null +++ b/layouts/joomla/form/field/password.php @@ -0,0 +1,85 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + */ + +if ($meter) +{ + // Load script on document load. + JFactory::getDocument()->addScriptDeclaration( + " + jQuery(document).ready(function() { + new Form.PasswordStrength('" . $id . "', + { + threshold: " . $threshold . ", + onUpdate: function(element, strength, threshold) { + element.set('data-passwordstrength', strength); + } + }); + });" + ); +} + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +$attributes = array( + strlen($hint) ? 'placeholder="' . $hint . '"' : '', + !$autocomplete ? 'autocomplete="off"' : '', + !empty($class) ? 'class="' . $class . '"' : '', + $readonly ? 'readonly' : '', + $disabled ? 'disabled' : '', + !empty($size) ? 'size="' . $size . '"' : '', + !empty($maxLength) ? 'maxlength="' . $maxLength . '"' : '', + $required ? 'required aria-required="true"' : '', + $autofocus ? 'autofocus' : '', +); + +?> + /> diff --git a/layouts/joomla/form/field/radio.php b/layouts/joomla/form/field/radio.php index ea965c1a3c106..960660d88cc33 100644 --- a/layouts/joomla/form/field/radio.php +++ b/layouts/joomla/form/field/radio.php @@ -34,7 +34,7 @@ * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. - * @var boolean $spellchec Spellcheck state for the form field. + * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * @var array $options Options available for this field. @@ -42,7 +42,7 @@ // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); -JHtml::_('script', 'system/html5fallback.js', false, true); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); /** * The format of the input tag to be filled in using sprintf. @@ -63,7 +63,7 @@ $option) : ?> value == $value) ? 'checked="checked"' : ''; + $checked = ((string) $option->value === $value) ? 'checked="checked"' : ''; $optionClass = !empty($option->class) ? 'class="' . $option->class . '"' : ''; $disabled = !empty($option->disable) || ($disabled && !$checked) ? 'disabled' : ''; diff --git a/layouts/joomla/form/field/range.php b/layouts/joomla/form/field/range.php new file mode 100644 index 0000000000000..fd8f46749f00d --- /dev/null +++ b/layouts/joomla/form/field/range.php @@ -0,0 +1,71 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + */ + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +// Initialize some field attributes. +$attributes = array( + $class ? 'class="' . $class . '"' : '', + $disabled ? 'disabled' : '', + $readonly ? 'readonly' : '', + !empty($onchange) ? 'onchange="' . $onchange . '"' : '', + !empty($max) ? 'max="' . $max . '"' : '', + !empty($step) ? 'step="' . $step . '"' : '', + !empty($min) ? 'min="' . $min . '"' : '', + $autofocus ? 'autofocus' : '', +); + +$value = (float) $value; +$value = empty($value) ? $min : $value; + +?> + /> diff --git a/layouts/joomla/form/field/subform/repeatable-table.php b/layouts/joomla/form/field/subform/repeatable-table.php index 8d368a975feff..d5babf2df7d26 100644 --- a/layouts/joomla/form/field/subform/repeatable-table.php +++ b/layouts/joomla/form/field/subform/repeatable-table.php @@ -30,7 +30,7 @@ if ($multiple) { JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/subform-repeatable.js', false, true); + JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); } // Build heading diff --git a/layouts/joomla/form/field/subform/repeatable.php b/layouts/joomla/form/field/subform/repeatable.php index ae5bd369edb37..d465b129eb1cd 100644 --- a/layouts/joomla/form/field/subform/repeatable.php +++ b/layouts/joomla/form/field/subform/repeatable.php @@ -30,7 +30,7 @@ if ($multiple) { JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/subform-repeatable.js', false, true); + JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); } $sublayout = empty($groupByFieldset) ? 'section' : 'section-byfieldsets'; diff --git a/layouts/joomla/form/field/text.php b/layouts/joomla/form/field/text.php new file mode 100644 index 0000000000000..7188f01e97cba --- /dev/null +++ b/layouts/joomla/form/field/text.php @@ -0,0 +1,92 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + */ + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +$list = ''; + +if ($options) +{ + $list = 'list="' . $id . '_datalist"'; +} + +$autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"'; +$autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; + +$attributes = array( + !empty($class) ? 'class="' . $class . '"' : '', + !empty($size) ? 'size="' . $size . '"' : '', + $disabled ? 'disabled' : '', + $readonly ? 'readonly' : '', + $list, + strlen($hint) ? 'placeholder="' . $hint . '"' : '', + $onchange ? ' onchange="' . $onchange . '"' : '', + !empty($maxLength) ? $maxLength : '', + $required ? 'required aria-required="true"' : '', + $autocomplete, + $autofocus ? ' autofocus' : '', + $spellcheck ? '' : 'spellcheck="false"', + !empty($inputmode) ? 'inputmode="' . $inputmode . '"' : '', + !empty($pattern) ? 'pattern="' . $pattern . '"' : '', +); +?> + value="" /> + + + + value) : ?> + + + + + + diff --git a/layouts/joomla/form/field/textarea.php b/layouts/joomla/form/field/textarea.php new file mode 100644 index 0000000000000..e518e01724f1c --- /dev/null +++ b/layouts/joomla/form/field/textarea.php @@ -0,0 +1,76 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + */ + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +// Initialize some field attributes. +$autocomplete = !$autocomplete ? 'autocomplete="off"' : 'autocomplete="' . $autocomplete . '"'; +$autocomplete = $autocomplete == 'autocomplete="on"' ? '' : $autocomplete; + +$attributes = array( + $columns ? $columns : '', + $rows ? $rows : '', + !empty($class) ? 'class="' . $class . '"' : '', + strlen($hint) ? 'placeholder="' . $hint . '"' : '', + $disabled ? 'disabled' : '', + $readonly ? 'readonly' : '', + $onchange ? 'onchange="' . $onchange . '"' : '', + $onclick ? 'onclick="' . $onclick . '"' : '', + $required ? 'required aria-required="true"' : '', + $autocomplete, + $autofocus ? 'autofocus' : '', + $spellcheck ? '' : 'spellcheck="false"', + $maxlength ? 'maxlength="' . $maxlength . '"' : '' + +); +?> + + diff --git a/layouts/joomla/form/field/url.php b/layouts/joomla/form/field/url.php new file mode 100644 index 0000000000000..361d7555ffaca --- /dev/null +++ b/layouts/joomla/form/field/url.php @@ -0,0 +1,73 @@ + section in form XML. + * @var boolean $hidden Is this field hidden in the form? + * @var string $hint Placeholder for the field. + * @var string $id DOM id of the field. + * @var string $label Label of the field. + * @var string $labelclass Classes to apply to the label. + * @var boolean $multiple Does this field support multiple values? + * @var string $name Name of the input field. + * @var string $onchange Onchange attribute for the field. + * @var string $onclick Onclick attribute for the field. + * @var string $pattern Pattern (Reg Ex) of value of the form field. + * @var boolean $readonly Is this field read only? + * @var boolean $repeat Allows extensions to duplicate elements. + * @var boolean $required Is this field required? + * @var integer $size Size attribute of the input. + * @var boolean $spellcheck Spellcheck state for the form field. + * @var string $validate Validation rules to apply. + * @var string $value Value attribute of the field. + * @var array $checkedOptions Options that will be set as checked. + * @var boolean $hasValue Has this field a value assigned? + * @var array $options Options available for this field. + * @var array $inputType Options available for this field. + * @var string $accept File types that are accepted. + */ + +// Including fallback code for HTML5 non supported browsers. +JHtml::_('jquery.framework'); +JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); + +$autocomplete = !$autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $autocomplete . '"'; +$autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; + +$attributes = array( + !empty($size) ? ' size="' . $size . '"' : '', + $disabled ? ' disabled' : '', + $readonly ? ' readonly' : '', + strlen($hint) ? ' placeholder="' . $hint . '"' : '', + $autocomplete, + $autofocus ? ' autofocus' : '', + $spellcheck ? '' : ' spellcheck="false"', + $onchange ? ' onchange="' . $onchange . '"' : '', + !empty($maxLength) ? $maxLength : '', + $required ? ' required aria-required="true"' : '', +); +?> + name="" id="" value="" /> diff --git a/layouts/joomla/form/field/user.php b/layouts/joomla/form/field/user.php index 01b4d399d6f30..6bf3a3041bc60 100644 --- a/layouts/joomla/form/field/user.php +++ b/layouts/joomla/form/field/user.php @@ -3,7 +3,7 @@ * @package Joomla.Site * @subpackage Layout * - * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -52,15 +52,15 @@ . (isset($excluded) ? ('&excluded=' . base64_encode(json_encode($excluded))) : ''); // Invalidate the input value if no user selected -if (JText::_('JLIB_FORM_SELECT_USER') == htmlspecialchars($userName, ENT_COMPAT, 'UTF-8')) +if (JText::_('JLIB_FORM_SELECT_USER') === htmlspecialchars($userName, ENT_COMPAT, 'UTF-8')) { - $userName = ""; + $userName = ''; } // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal_' . $id); -JHtml::script('jui/fielduser.min.js', false, true, false, false, true); +JHtml::_('script', 'jui/fielduser.min.js', array('version' => 'auto', 'relative' => true)); ?>
    diff --git a/layouts/joomla/form/renderfield.php b/layouts/joomla/form/renderfield.php index d94a35741f834..c17bb9b33f15b 100644 --- a/layouts/joomla/form/renderfield.php +++ b/layouts/joomla/form/renderfield.php @@ -22,7 +22,7 @@ if (!empty($options['showonEnabled'])) { JHtml::_('jquery.framework'); - JHtml::_('script', 'jui/cms.js', false, true); + JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); } $class = empty($options['class']) ? '' : ' ' . $options['class']; diff --git a/layouts/joomla/form/renderlabel.php b/layouts/joomla/form/renderlabel.php index 73d9238824853..05ee30100d2cf 100644 --- a/layouts/joomla/form/renderlabel.php +++ b/layouts/joomla/form/renderlabel.php @@ -29,9 +29,24 @@ if (!empty($description)) { - JHtml::_('bootstrap.tooltip'); - $classes[] = 'hasTooltip'; - $title = ' title="' . JHtml::tooltipText(trim($text, ':'), $description, 0) . '"'; + if ($text && $text !== $description) + { + JHtml::_('bootstrap.popover'); + $classes[] = 'hasPopover'; + $title = ' title="' . htmlspecialchars(trim($text, ':')) . '"' + . ' data-content="'. htmlspecialchars($description) . '"'; + + if (!$position && JFactory::getLanguage()->isRtl()) + { + $position = ' data-placement="left" '; + } + } + else + { + JHtml::_('bootstrap.tooltip'); + $classes[] = 'hasTooltip'; + $title = ' title="' . JHtml::tooltipText(trim($text, ':'), $description, 0) . '"'; + } } if ($required) diff --git a/layouts/joomla/html/formbehavior/ajaxchosen.php b/layouts/joomla/html/formbehavior/ajaxchosen.php index 4ab80379b9ad4..6d74a537476e7 100644 --- a/layouts/joomla/html/formbehavior/ajaxchosen.php +++ b/layouts/joomla/html/formbehavior/ajaxchosen.php @@ -31,7 +31,7 @@ // Include jQuery JHtml::_('jquery.framework'); -JHtml::_('script', 'jui/ajax-chosen.min.js', false, true, false, false, $debug); +JHtml::_('script', 'jui/ajax-chosen.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug)); JFactory::getDocument()->addScriptDeclaration( " diff --git a/layouts/joomla/html/formbehavior/chosen.php b/layouts/joomla/html/formbehavior/chosen.php index ecf59023c9cbe..71f14519e5407 100644 --- a/layouts/joomla/html/formbehavior/chosen.php +++ b/layouts/joomla/html/formbehavior/chosen.php @@ -22,8 +22,8 @@ // Include jQuery JHtml::_('jquery.framework'); -JHtml::_('script', 'jui/chosen.jquery.min.js', false, true, false, false, $debug); -JHtml::_('stylesheet', 'jui/chosen.css', false, true); +JHtml::_('script', 'jui/chosen.jquery.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug)); +JHtml::_('stylesheet', 'jui/chosen.css', array('version' => 'auto', 'relative' => true)); // Options array to json options string $options_str = json_encode($options, ($debug && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false)); diff --git a/layouts/joomla/html/sortablelist.php b/layouts/joomla/html/sortablelist.php index b7815ba27f62e..ce8137c1d83dc 100644 --- a/layouts/joomla/html/sortablelist.php +++ b/layouts/joomla/html/sortablelist.php @@ -26,8 +26,8 @@ // Depends on jQuery UI JHtml::_('jquery.ui', array('core', 'sortable')); -JHtml::_('script', 'jui/sortablelist.js', false, true); -JHtml::_('stylesheet', 'jui/sortablelist.css', false, true, false); +JHtml::_('script', 'jui/sortablelist.js', array('version' => 'auto', 'relative' => true)); +JHtml::_('stylesheet', 'jui/sortablelist.css', array('version' => 'auto', 'relative' => true)); // Attach sortable to document JFactory::getDocument()->addScriptDeclaration( diff --git a/layouts/joomla/modal/main.php b/layouts/joomla/modal/main.php index a24fbc3cee487..b3fc5f61b835e 100644 --- a/layouts/joomla/modal/main.php +++ b/layouts/joomla/modal/main.php @@ -25,12 +25,12 @@ * - keyboard boolean Closes the modal when escape key is pressed (default = true) * - closeButton boolean Display modal close button (default = true) * - animation boolean Fade in from the top of the page (default = true) - * - footer string Optional markup for the modal footer * - url string URL of a resource to be inserted as an '; } + /** + * Include version with MD5SUM file in path. + * + * @param string $path Folder name to search into (images, css, js, ...). + * + * @return string Query string to add. + * + * @since __DEPLOY_VERSION__ + * + * @deprecated 4.0 Usage of MD5SUM files is deprecated, use version instead. + */ + protected static function getMd5Version($path) + { + $md5 = dirname($path) . '/MD5SUM'; + + if (file_exists($md5)) + { + JLog::add('Usage of MD5SUM files is deprecated, use version instead.', JLog::WARNING, 'deprecated'); + + return '?' . file_get_contents($md5); + } + + return ''; + } + /** * Compute the files to be included * - * @param string $folder folder name to search into (images, css, js, ...). - * @param string $file path to file. - * @param boolean $relative path to file is relative to /media folder (and searches in template). - * @param boolean $detect_browser detect browser to include specific browser files. - * @param boolean $detect_debug detect debug to include compressed files if debug is on. + * @param string $folder Folder name to search in (i.e. images, css, js). + * @param string $file Path to file. + * @param boolean $relative Flag if the path to the file is relative to the /media folder (and searches in template). + * @param boolean $detect_browser Flag if the browser should be detected to include specific browser files. + * @param boolean $detect_debug Flag if debug mode is enabled to include uncompressed files if debug is on. * * @return array files to be included. * @@ -295,252 +317,230 @@ public static function iframe($url, $name, $attribs = null, $noFrames = '') */ protected static function includeRelativeFiles($folder, $file, $relative, $detect_browser, $detect_debug) { - // If http is present in filename + // If http is present in filename just return it as an array if (strpos($file, 'http') === 0 || strpos($file, '//') === 0) { - $includes = array($file); + return array($file); + } + + // Extract extension and strip the file + $strip = JFile::stripExt($file); + $ext = JFile::getExt($file); + + // Prepare array of files + $includes = array(); + + // Detect browser and compute potential files + if ($detect_browser) + { + $navigator = JBrowser::getInstance(); + $browser = $navigator->getBrowser(); + $major = $navigator->getMajor(); + $minor = $navigator->getMinor(); + + // Try to include files named filename.ext, filename_browser.ext, filename_browser_major.ext, filename_browser_major_minor.ext + // where major and minor are the browser version names + $potential = array( + $strip, + $strip . '_' . $browser, + $strip . '_' . $browser . '_' . $major, + $strip . '_' . $browser . '_' . $major . '_' . $minor, + ); } else { - // Extract extension and strip the file - $strip = JFile::stripExt($file); - $ext = JFile::getExt($file); - - // Prepare array of files - $includes = array(); + $potential = array($strip); + } - // Detect browser and compute potential files - if ($detect_browser) - { - $navigator = JBrowser::getInstance(); - $browser = $navigator->getBrowser(); - $major = $navigator->getMajor(); - $minor = $navigator->getMinor(); - - // Try to include files named filename.ext, filename_browser.ext, filename_browser_major.ext, filename_browser_major_minor.ext - // where major and minor are the browser version names - $potential = array($strip, $strip . '_' . $browser, $strip . '_' . $browser . '_' . $major, - $strip . '_' . $browser . '_' . $major . '_' . $minor); - } - else - { - $potential = array($strip); - } + // If relative search in template directory or media directory + if ($relative) + { + // Get the template + $template = JFactory::getApplication()->getTemplate(); - // If relative search in template directory or media directory - if ($relative) + // For each potential files + foreach ($potential as $strip) { - // Get the template - $template = JFactory::getApplication()->getTemplate(); + $files = array(); - // For each potential files - foreach ($potential as $strip) + // Detect debug mode + if ($detect_debug && JFactory::getConfig()->get('debug')) { - $files = array(); - - // Detect debug mode - if ($detect_debug && JFactory::getConfig()->get('debug')) + /* + * Detect if we received a file in the format name.min.ext + * If so, strip the .min part out, otherwise append -uncompressed + */ + if (strlen($strip) > 4 && preg_match('#\.min$#', $strip)) { - /* - * Detect if we received a file in the format name.min.ext - * If so, strip the .min part out, otherwise append -uncompressed - */ - if (strrpos($strip, '.min', '-4')) - { - $position = strrpos($strip, '.min', '-4'); - $filename = str_replace('.min', '.', $strip, $position); - $files[] = $filename . $ext; - } - else - { - $files[] = $strip . '-uncompressed.' . $ext; - } + $files[] = preg_replace('#\.min$#', '.', $strip) . $ext; + } + else + { + $files[] = $strip . '-uncompressed.' . $ext; } + } - $files[] = $strip . '.' . $ext; + $files[] = $strip . '.' . $ext; - /* - * Loop on 1 or 2 files and break on first found. - * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh - * This MD5SUM file must represent the signature of the folder content - */ - foreach ($files as $file) + /* + * Loop on 1 or 2 files and break on first found. + * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh + * This MD5SUM file must represent the signature of the folder content + */ + foreach ($files as $file) + { + // If the file is in the template folder + $path = JPATH_THEMES . "/$template/$folder/$file"; + + if (file_exists($path)) { - // If the file is in the template folder - $path = JPATH_THEMES . "/$template/$folder/$file"; + $includes[] = JUri::base(true) . "/templates/$template/$folder/$file" . static::getMd5Version($path); - if (file_exists($path)) + break; + } + else + { + // If the file contains any /: it can be in an media extension subfolder + if (strpos($file, '/')) { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::base(true) . "/templates/$template/$folder/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + // Divide the file extracting the extension as the first part before / + list($extension, $file) = explode('/', $file, 2); - break; - } - else - { - // If the file contains any /: it can be in an media extension subfolder + // If the file yet contains any /: it can be a plugin if (strpos($file, '/')) { - // Divide the file extracting the extension as the first part before / - list($extension, $file) = explode('/', $file, 2); - - // If the file yet contains any /: it can be a plugin - if (strpos($file, '/')) - { - // Divide the file extracting the element as the first part before / - list($element, $file) = explode('/', $file, 2); - - // Try to deal with plugins group in the media folder - $path = JPATH_ROOT . "/media/$extension/$element/$folder/$file"; - - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/$extension/$element/$folder/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + // Divide the file extracting the element as the first part before / + list($element, $file) = explode('/', $file, 2); - break; - } + // Try to deal with plugins group in the media folder + $path = JPATH_ROOT . "/media/$extension/$element/$folder/$file"; - // Try to deal with classical file in a media subfolder called element - $path = JPATH_ROOT . "/media/$extension/$folder/$element/$file"; - - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/$extension/$folder/$element/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/media/$extension/$element/$folder/$file" . static::getMd5Version($path); - break; - } + break; + } - // Try to deal with system files in the template folder - $path = JPATH_THEMES . "/$template/$folder/system/$element/$file"; + // Try to deal with classical file in a media subfolder called element + $path = JPATH_ROOT . "/media/$extension/$folder/$element/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$element/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/media/$extension/$folder/$element/$file" . static::getMd5Version($path); - break; - } + break; + } - // Try to deal with system files in the media folder - $path = JPATH_ROOT . "/media/system/$folder/$element/$file"; + // Try to deal with system files in the template folder + $path = JPATH_THEMES . "/$template/$folder/system/$element/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/system/$folder/$element/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$element/$file" . static::getMd5Version($path); - break; - } + break; } - else - { - // Try to deals in the extension media folder - $path = JPATH_ROOT . "/media/$extension/$folder/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/$extension/$folder/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + // Try to deal with system files in the media folder + $path = JPATH_ROOT . "/media/system/$folder/$element/$file"; - break; - } + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/media/system/$folder/$element/$file" . static::getMd5Version($path); - // Try to deal with system files in the template folder - $path = JPATH_THEMES . "/$template/$folder/system/$file"; + break; + } + } + else + { + // Try to deals in the extension media folder + $path = JPATH_ROOT . "/media/$extension/$folder/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/media/$extension/$folder/$file" . static::getMd5Version($path); - break; - } + break; + } - // Try to deal with system files in the media folder - $path = JPATH_ROOT . "/media/system/$folder/$file"; + // Try to deal with system files in the template folder + $path = JPATH_THEMES . "/$template/$folder/system/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/system/$folder/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/templates/$template/$folder/system/$file" . static::getMd5Version($path); - break; - } + break; } - } - // Try to deal with system files in the media folder - else - { + + // Try to deal with system files in the media folder $path = JPATH_ROOT . "/media/system/$folder/$file"; if (file_exists($path)) { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/media/system/$folder/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + $includes[] = JUri::root(true) . "/media/system/$folder/$file" . static::getMd5Version($path); break; } } } + // Try to deal with system files in the media folder + else + { + $path = JPATH_ROOT . "/media/system/$folder/$file"; + + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/media/system/$folder/$file" . static::getMd5Version($path); + + break; + } + } } } } - // If not relative and http is not present in filename - else + } + // If not relative and http is not present in filename + else + { + foreach ($potential as $strip) { - foreach ($potential as $strip) - { - $files = array(); + $files = array(); - // Detect debug mode - if ($detect_debug && JFactory::getConfig()->get('debug')) + // Detect debug mode + if ($detect_debug && JFactory::getConfig()->get('debug')) + { + /* + * Detect if we received a file in the format name.min.ext + * If so, strip the .min part out, otherwise append -uncompressed + */ + if (strlen($strip) > 4 && preg_match('#\.min$#', $strip)) { - /* - * Detect if we received a file in the format name.min.ext - * If so, strip the .min part out, otherwise append -uncompressed - */ - if (strrpos($strip, '.min', '-4')) - { - $position = strrpos($strip, '.min', '-4'); - $filename = str_replace('.min', '.', $strip, $position); - $files[] = $filename . $ext; - } - else - { - $files[] = $strip . '-uncompressed.' . $ext; - } + $files[] = preg_replace('#\.min$#', '.', $strip) . $ext; + } + else + { + $files[] = $strip . '-uncompressed.' . $ext; } + } - $files[] = $strip . '.' . $ext; + $files[] = $strip . '.' . $ext; - /* - * Loop on 1 or 2 files and break on first found. - * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh - * This MD5SUM file must represent the signature of the folder content - */ - foreach ($files as $file) - { - $path = JPATH_ROOT . "/$file"; + /* + * Loop on 1 or 2 files and break on first found. + * Add the content of the MD5SUM file located in the same folder to url to ensure cache browser refresh + * This MD5SUM file must represent the signature of the folder content + */ + foreach ($files as $file) + { + $path = JPATH_ROOT . "/$file"; - if (file_exists($path)) - { - $md5 = dirname($path) . '/MD5SUM'; - $includes[] = JUri::root(true) . "/$file" . - (file_exists($md5) ? ('?' . file_get_contents($md5)) : ''); + if (file_exists($path)) + { + $includes[] = JUri::root(true) . "/$file" . static::getMd5Version($path); - break; - } + break; } } } @@ -552,157 +552,187 @@ protected static function includeRelativeFiles($folder, $file, $relative, $detec /** * Write a `` element * - * @param string $file The relative or absolute URL to use for the src attribute. - * @param string $alt The alt text. - * @param mixed $attribs String or associative array of attribute(s) to use. - * @param boolean $relative Path to file is relative to /media folder (and searches in template). - * @param mixed $path_rel Return html tag without (-1) or with file computing(false). Return computed path only (true). + * @param string $file The relative or absolute URL to use for the src attribute. + * @param string $alt The alt text. + * @param array|string $attribs Attributes to be added to the `` element + * @param boolean $relative Flag if the path to the file is relative to the /media folder (and searches in template). + * @param integer $returnPath Defines the return value for the method: + * -1: Returns a `` tag without looking for relative files + * 0: Returns a `` tag while searching for relative files + * 1: Returns the file path to the image while searching for relative files * * @return string * * @since 1.5 */ - public static function image($file, $alt, $attribs = null, $relative = false, $path_rel = false) + public static function image($file, $alt, $attribs = null, $relative = false, $returnPath = 0) { - if ($path_rel !== -1) + $returnPath = (int) $returnPath; + + if ($returnPath !== -1) { $includes = static::includeRelativeFiles('images', $file, $relative, false, false); $file = count($includes) ? $includes[0] : null; } // If only path is required - if ($path_rel) + if ($returnPath) { return $file; } - else - { - return '' . $alt . ''; - } + + return '' . $alt . ''; } /** * Write a `` element to load a CSS file * - * @param string $file path to file - * @param array $attribs attributes to be added to the stylesheet - * @param boolean $relative path to file is relative to /media folder - * @param boolean $path_only return the path to the file only - * @param boolean $detect_browser detect browser to include specific browser css files - * will try to include file, `file_*browser*`, `file_*browser*_*major*`, `file_*browser*_*major*_*minor*` - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    Navigator browser major.minor
    Safari 3.0.x konqueror 522.x
    Safari 3.1.x and 3.2.x konqueror 525.x
    Safari 4.0 to 4.0.2 konqueror 530.x
    Safari 4.0.3 to 4.0.4 konqueror 531.x
    iOS 4.0 Safari konqueror 532.x
    Safari 5.0 konqueror 533.x
    Google Chrome 1.0 konqueror 528.x
    Google Chrome 2.0 konqueror 530.x
    Google Chrome 3.0 and 4.x konqueror 532.x
    Google Chrome 5.0 konqueror 533.x
    Internet Explorer 5.5 msie 5.5
    Internet Explorer 6.x msie 6.x
    Internet Explorer 7.x msie 7.x
    Internet Explorer 8.x msie 8.x
    Firefox mozilla 5.0
    - * @param boolean $detect_debug detect debug to search for compressed files if debug is on - * - * @return mixed nothing if $path_only is false, null, path or array of path if specific css browser files were detected + * @param string $file Path to file + * @param array $options Array of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9') + * @param array $attribs Array of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1) + * + * @return array|string|null nothing if $returnPath is false, null, path or array of path if specific CSS browser files were detected * * @see JBrowser * @since 1.5 + * @deprecated 4.0 The (file, attribs, relative, pathOnly, detectBrowser, detectDebug) method signature is deprecated, + * use (file, options, attributes) instead. */ - public static function stylesheet($file, $attribs = array(), $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) + public static function stylesheet($file, $options = array(), $attribs = array()) { - $includes = static::includeRelativeFiles('css', $file, $relative, $detect_browser, $detect_debug); + // B/C before __DEPLOY_VERSION__ + if (!is_array($attribs)) + { + JLog::add('The stylesheet method signature used has changed, use (file, options, attributes) instead.', JLog::WARNING, 'deprecated'); + + $argList = func_get_args(); + $options = array(); + + // Old parameters. + $attribs = isset($argList[1]) ? $argList[1] : array(); + $options['relative'] = isset($argList[2]) ? $argList[2] : false; + $options['pathOnly'] = isset($argList[3]) ? $argList[3] : false; + $options['detectBrowser'] = isset($argList[4]) ? $argList[4] : true; + $options['detectDebug'] = isset($argList[5]) ? $argList[5] : true; + } + else + { + $options['relative'] = isset($options['relative']) ? $options['relative'] : false; + $options['pathOnly'] = isset($options['pathOnly']) ? $options['pathOnly'] : false; + $options['detectBrowser'] = isset($options['detectBrowser']) ? $options['detectBrowser'] : true; + $options['detectDebug'] = isset($options['detectDebug']) ? $options['detectDebug'] : true; + } + + $includes = static::includeRelativeFiles('css', $file, $options['relative'], $options['detectBrowser'], $options['detectDebug']); // If only path is required - if ($path_only) + if ($options['pathOnly']) { - if (count($includes) == 0) + if (count($includes) === 0) { - return null; + return; } - elseif (count($includes) == 1) + + if (count($includes) === 1) { return $includes[0]; } - else - { - return $includes; - } + + return $includes; } + // If inclusion is required - else - { - $document = JFactory::getDocument(); + $document = JFactory::getDocument(); - foreach ($includes as $include) + foreach ($includes as $include) + { + // If there is already a version hash in the script reference (by using deprecated MD5SUM). + if ($pos = strpos($include, '?') !== false) { - $document->addStylesheet($include, 'text/css', null, $attribs); + $options['version'] = substr($include, $pos + 1); } + + $document->addStyleSheet($include, $options, $attribs); } } /** * Write a `' . $lnEnd; + } + + $defaultJsMimes = array('text/javascript', 'application/javascript', 'text/x-javascript', 'application/x-javascript'); + $html5NoValueAttributes = array('defer', 'async'); // Generate script file links - foreach ($document->_scripts as $strSrc => $strAttr) + foreach ($document->_scripts as $src => $attribs) { - $buffer .= $tab . '' . $lnEnd; + $buffer .= $lnEnd; } // Generate script declarations @@ -268,35 +347,6 @@ public function fetchHead($document) $buffer .= $tab . '' . $lnEnd; } - // Generate script language declarations. - if (count(JText::script())) - { - $buffer .= $tab . 'isHtml5()) - { - $buffer .= ' type="text/javascript"'; - } - - $buffer .= '>' . $lnEnd; - - if ($document->_mime != 'text/html') - { - $buffer .= $tab . $tab . '//_mime != 'text/html') - { - $buffer .= $tab . $tab . '//]]>' . $lnEnd; - } - - $buffer .= $tab . '' . $lnEnd; - } - // Output the custom tags - array_unique makes sure that we don't output the same tags twice foreach (array_unique($document->_custom) as $custom) { diff --git a/libraries/joomla/document/renderer/html/message.php b/libraries/joomla/document/renderer/html/message.php index a914707fca108..9f7dd5d04528f 100644 --- a/libraries/joomla/document/renderer/html/message.php +++ b/libraries/joomla/document/renderer/html/message.php @@ -34,7 +34,7 @@ public function render($name, $params = array(), $content = null) 'msgList' => $msgList, 'name' => $name, 'params' => $params, - 'content' => $content + 'content' => $content, ); $app = JFactory::getApplication(); diff --git a/libraries/joomla/document/renderer/html/modules.php b/libraries/joomla/document/renderer/html/modules.php index 6780a8e8eca16..fb50cb5a4eff9 100644 --- a/libraries/joomla/document/renderer/html/modules.php +++ b/libraries/joomla/document/renderer/html/modules.php @@ -50,6 +50,8 @@ public function render($position, $params = array(), $content = null) $buffer .= $moduleHtml; } + JEventDispatcher::getInstance()->trigger('onAfterRenderModules', array(&$buffer, &$params)); + return $buffer; } } diff --git a/libraries/joomla/environment/browser.php b/libraries/joomla/environment/browser.php index 1867ea057e0aa..9c739e2078b62 100644 --- a/libraries/joomla/environment/browser.php +++ b/libraries/joomla/environment/browser.php @@ -121,7 +121,8 @@ class JBrowser 'ViolaBot', 'webbandit', 'www.almaden.ibm.com/cs/crawler', - 'ZyBorg'); + 'ZyBorg', + ); /** * @var boolean Is this a mobile browser? @@ -559,7 +560,7 @@ public function getHTTPProtocol() } } - return null; + return; } /** @@ -616,7 +617,7 @@ public function isViewable($mimetype) return false; } - return (in_array($subtype, $this->images)); + return in_array($subtype, $this->images); } /** @@ -630,7 +631,7 @@ public function isViewable($mimetype) */ public function isBrowser($browser) { - return ($this->browser === $browser); + return $this->browser === $browser; } /** @@ -675,9 +676,12 @@ public function isMobile() */ public function isSSLConnection() { - JLog::add('JBrowser::isSSLConnection() is deprecated. Use the isSSLConnection method on the application object instead.', - JLog::WARNING, 'deprecated'); + JLog::add( + 'JBrowser::isSSLConnection() is deprecated. Use the isSSLConnection method on the application object instead.', + JLog::WARNING, + 'deprecated' + ); - return ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) || getenv('SSL_PROTOCOL_VERSION')); + return (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) || getenv('SSL_PROTOCOL_VERSION'); } } diff --git a/libraries/joomla/event/dispatcher.php b/libraries/joomla/event/dispatcher.php index 60aee704a135c..fcca4a8de4a53 100644 --- a/libraries/joomla/event/dispatcher.php +++ b/libraries/joomla/event/dispatcher.php @@ -15,7 +15,6 @@ * This is the Observable part of the Observer design pattern * for the event architecture. * - * @link https://docs.joomla.org/Tutorial:Plugins Plugin tutorials * @see JPlugin * @since 12.1 */ diff --git a/libraries/joomla/event/event.php b/libraries/joomla/event/event.php index 5dfe5f7cbbdd8..e053530d6bf33 100644 --- a/libraries/joomla/event/event.php +++ b/libraries/joomla/event/event.php @@ -68,9 +68,5 @@ public function update(&$args) { return call_user_func_array(array($this, $event), $args); } - else - { - return null; - } } } diff --git a/libraries/joomla/facebook/album.php b/libraries/joomla/facebook/album.php index 370b90d3f606e..813dac3fc37d9 100644 --- a/libraries/joomla/facebook/album.php +++ b/libraries/joomla/facebook/album.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Album class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/album/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/album/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookAlbum extends JFacebookObject { diff --git a/libraries/joomla/facebook/checkin.php b/libraries/joomla/facebook/checkin.php index 7dddd693d623b..11b43379d8f6c 100644 --- a/libraries/joomla/facebook/checkin.php +++ b/libraries/joomla/facebook/checkin.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Checkin class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/checkin/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/checkin/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookCheckin extends JFacebookObject { diff --git a/libraries/joomla/facebook/comment.php b/libraries/joomla/facebook/comment.php index d722b80bd6807..ba85b4b20dc3b 100644 --- a/libraries/joomla/facebook/comment.php +++ b/libraries/joomla/facebook/comment.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Comment class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/Comment/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/Comment/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookComment extends JFacebookObject { diff --git a/libraries/joomla/facebook/event.php b/libraries/joomla/facebook/event.php index 6604433674672..c404d2cfe5044 100644 --- a/libraries/joomla/facebook/event.php +++ b/libraries/joomla/facebook/event.php @@ -9,12 +9,12 @@ defined('JPATH_PLATFORM') or die(); - /** * Facebook API User class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/event/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/event/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookEvent extends JFacebookObject { diff --git a/libraries/joomla/facebook/facebook.php b/libraries/joomla/facebook/facebook.php index 5481b6e1c311a..aff940deb8004 100644 --- a/libraries/joomla/facebook/facebook.php +++ b/libraries/joomla/facebook/facebook.php @@ -14,7 +14,8 @@ /** * Joomla Platform class for interacting with a Facebook API instance. * - * @since 13.1 + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebook { diff --git a/libraries/joomla/facebook/group.php b/libraries/joomla/facebook/group.php index 544d39253580e..2b3ba953635f8 100644 --- a/libraries/joomla/facebook/group.php +++ b/libraries/joomla/facebook/group.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Group class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/group/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/group/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookGroup extends JFacebookObject { diff --git a/libraries/joomla/facebook/link.php b/libraries/joomla/facebook/link.php index b53c72f753b5c..2457b93cdbca3 100644 --- a/libraries/joomla/facebook/link.php +++ b/libraries/joomla/facebook/link.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Link class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/link/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/link/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookLink extends JFacebookObject { diff --git a/libraries/joomla/facebook/note.php b/libraries/joomla/facebook/note.php index 58cc0af53f8c0..eed231f28c528 100644 --- a/libraries/joomla/facebook/note.php +++ b/libraries/joomla/facebook/note.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Note class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/note/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/note/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookNote extends JFacebookObject { diff --git a/libraries/joomla/facebook/oauth.php b/libraries/joomla/facebook/oauth.php index b05a00ec650ce..74139f73493d3 100644 --- a/libraries/joomla/facebook/oauth.php +++ b/libraries/joomla/facebook/oauth.php @@ -14,7 +14,8 @@ /** * Joomla Platform class for generating Facebook API access token. * - * @since 13.1 + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookOAuth extends JOAuth2Client { diff --git a/libraries/joomla/facebook/object.php b/libraries/joomla/facebook/object.php index 75d9b9afaac9f..3e0df2e7836e2 100644 --- a/libraries/joomla/facebook/object.php +++ b/libraries/joomla/facebook/object.php @@ -14,7 +14,8 @@ /** * Facebook API object class for the Joomla Platform. * - * @since 13.1 + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ abstract class JFacebookObject { diff --git a/libraries/joomla/facebook/photo.php b/libraries/joomla/facebook/photo.php index fd4870a0657f1..8b8d6eaa2e679 100644 --- a/libraries/joomla/facebook/photo.php +++ b/libraries/joomla/facebook/photo.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Photo class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/photo/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/photo/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookPhoto extends JFacebookObject { diff --git a/libraries/joomla/facebook/post.php b/libraries/joomla/facebook/post.php index 87aae31929168..a1e81493fb70a 100644 --- a/libraries/joomla/facebook/post.php +++ b/libraries/joomla/facebook/post.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Post class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/post/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/post/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookPost extends JFacebookObject { diff --git a/libraries/joomla/facebook/status.php b/libraries/joomla/facebook/status.php index c668644ca5d59..4ed4dd74196ea 100644 --- a/libraries/joomla/facebook/status.php +++ b/libraries/joomla/facebook/status.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Status class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/status/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/status/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookStatus extends JFacebookObject { diff --git a/libraries/joomla/facebook/user.php b/libraries/joomla/facebook/user.php index 076bf51fcad78..5f8b61534bd14 100644 --- a/libraries/joomla/facebook/user.php +++ b/libraries/joomla/facebook/user.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API User class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/user/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/user/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookUser extends JFacebookObject { diff --git a/libraries/joomla/facebook/video.php b/libraries/joomla/facebook/video.php index 8d2d762925e67..cd55f53c683a2 100644 --- a/libraries/joomla/facebook/video.php +++ b/libraries/joomla/facebook/video.php @@ -7,15 +7,14 @@ * @license GNU General Public License version 2 or later; see LICENSE */ - defined('JPATH_PLATFORM') or die(); - /** * Facebook API Video class for the Joomla Platform. * - * @see http://developers.facebook.com/docs/reference/api/video/ - * @since 13.1 + * @see http://developers.facebook.com/docs/reference/api/video/ + * @since 13.1 + * @deprecated 4.0 Use the `joomla/facebook` package via Composer instead */ class JFacebookVideo extends JFacebookObject { diff --git a/libraries/joomla/factory.php b/libraries/joomla/factory.php index bee833037ab48..1f4403a1f4e50 100644 --- a/libraries/joomla/factory.php +++ b/libraries/joomla/factory.php @@ -742,17 +742,17 @@ protected static function createDocument() $lang = self::getLanguage(); $input = self::getApplication()->input; - $type = $input->get('format', 'html', 'word'); + $type = $input->get('format', 'html', 'cmd'); $version = new JVersion; $attributes = array( - 'charset' => 'utf-8', - 'lineend' => 'unix', - 'tab' => ' ', - 'language' => $lang->getTag(), - 'direction' => $lang->isRtl() ? 'rtl' : 'ltr', - 'mediaversion' => $version->getMediaVersion() + 'charset' => 'utf-8', + 'lineend' => 'unix', + 'tab' => "\t", + 'language' => $lang->getTag(), + 'direction' => $lang->isRtl() ? 'rtl' : 'ltr', + 'mediaversion' => $version->getMediaVersion(), ); return JDocument::getInstance($type, $attributes); diff --git a/libraries/joomla/feed/entry.php b/libraries/joomla/feed/entry.php index 31e244842e56a..b00b1618240a4 100644 --- a/libraries/joomla/feed/entry.php +++ b/libraries/joomla/feed/entry.php @@ -39,7 +39,7 @@ class JFeedEntry 'content' => '', 'categories' => array(), 'contributors' => array(), - 'links' => array() + 'links' => array(), ); /** diff --git a/libraries/joomla/feed/feed.php b/libraries/joomla/feed/feed.php index 7669901b5cff2..7bc00b7f506bb 100644 --- a/libraries/joomla/feed/feed.php +++ b/libraries/joomla/feed/feed.php @@ -38,7 +38,7 @@ class JFeed implements ArrayAccess 'updatedDate' => '', 'description' => '', 'categories' => array(), - 'contributors' => array() + 'contributors' => array(), ); /** @@ -327,9 +327,12 @@ public function setAuthor($name, $email, $uri = null, $type = null) return $this; } - /** Method to reverse the items if display is set to 'oldest first' + /** + * Method to reverse the items if display is set to 'oldest first' + * + * @return JFeed * - * @return JFeed + * @since 12.3 */ public function reverseItems() { @@ -337,6 +340,7 @@ public function reverseItems() { $this->entries = array_reverse($this->entries); } + return $this; } } diff --git a/libraries/joomla/feed/parser/rss/itunes.php b/libraries/joomla/feed/parser/rss/itunes.php index 705a237ec09ae..74427645f4c79 100644 --- a/libraries/joomla/feed/parser/rss/itunes.php +++ b/libraries/joomla/feed/parser/rss/itunes.php @@ -12,7 +12,7 @@ /** * RSS Feed Parser Namespace handler for iTunes. * - * @see http://www.apple.com/itunes/podcasts/specs.html + * @see https://itunespartner.apple.com/en/podcasts/overview * @since 12.3 */ class JFeedParserRssItunes implements JFeedParserNamespace diff --git a/libraries/joomla/filesystem/file.php b/libraries/joomla/filesystem/file.php index 9240fc9ebfa4c..eed31d2204d40 100644 --- a/libraries/joomla/filesystem/file.php +++ b/libraries/joomla/filesystem/file.php @@ -27,9 +27,14 @@ class JFile */ public static function getExt($file) { - $dot = strrpos($file, '.') + 1; + $dot = strrpos($file, '.'); - return substr($file, $dot); + if ($dot === false) + { + return ''; + } + + return (string) substr($file, $dot + 1); } /** @@ -377,14 +382,14 @@ public static function read($filename, $incpath = false, $amount = 0, $chunksize * Write contents to a file * * @param string $file The full file path - * @param string &$buffer The buffer to write + * @param string $buffer The buffer to write * @param boolean $use_streams Use streams * * @return boolean True on success * * @since 11.1 */ - public static function write($file, &$buffer, $use_streams = false) + public static function write($file, $buffer, $use_streams = false) { @set_time_limit(ini_get('max_execution_time')); @@ -443,14 +448,14 @@ public static function write($file, &$buffer, $use_streams = false) * Append contents to a file * * @param string $file The full file path - * @param string &$buffer The buffer to write + * @param string $buffer The buffer to write * @param boolean $use_streams Use streams * * @return boolean True on success * * @since 3.6.0 */ - public static function append($file, &$buffer, $use_streams = false) + public static function append($file, $buffer, $use_streams = false) { @set_time_limit(ini_get('max_execution_time')); @@ -484,8 +489,7 @@ public static function append($file, &$buffer, $use_streams = false) if ($FTPOptions['enabled'] == 1) { // Connect the FTP client - jimport('joomla.client.ftp'); - $ftp = JFTP::getInstance($FTPOptions['host'], $FTPOptions['port'], null, $FTPOptions['user'], $FTPOptions['pass']); + $ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']); // Translate path for the FTP account and use FTP write buffer to file $file = JPath::clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $file), '/'); diff --git a/libraries/joomla/filesystem/folder.php b/libraries/joomla/filesystem/folder.php index 65890455cc60b..ad41f636c79f9 100644 --- a/libraries/joomla/filesystem/folder.php +++ b/libraries/joomla/filesystem/folder.php @@ -444,7 +444,7 @@ public static function move($src, $dest, $path = '', $use_streams = false) // Use FTP rename to simulate move if (!$ftp->rename($src, $dest)) { - return JText::_('Rename failed'); + return JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'); } $ret = true; @@ -453,7 +453,7 @@ public static function move($src, $dest, $path = '', $use_streams = false) { if (!@rename($src, $dest)) { - return JText::_('Rename failed'); + return JText::_('JLIB_FILESYSTEM_ERROR_RENAME_FILE'); } $ret = true; @@ -689,8 +689,13 @@ public static function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, { $id = ++$GLOBALS['_JFolder_folder_tree_index']; $fullName = $pathObject->clean($path . '/' . $name); - $dirs[] = array('id' => $id, 'parent' => $parent, 'name' => $name, 'fullname' => $fullName, - 'relname' => str_replace(JPATH_ROOT, '', $fullName)); + $dirs[] = array( + 'id' => $id, + 'parent' => $parent, + 'name' => $name, + 'fullname' => $fullName, + 'relname' => str_replace(JPATH_ROOT, '', $fullName), + ); $dirs2 = self::listFolderTree($fullName, $filter, $maxLevel, $level + 1, $id); $dirs = array_merge($dirs, $dirs2); } diff --git a/libraries/joomla/filesystem/helper.php b/libraries/joomla/filesystem/helper.php index 2b968ab5f3a72..72df1f5cc09d9 100644 --- a/libraries/joomla/filesystem/helper.php +++ b/libraries/joomla/filesystem/helper.php @@ -25,7 +25,7 @@ class JFilesystemHelper * * @return mixed * - * @see http://www.php.net/manual/en/function.filesize.php#71098 + * @see https://secure.php.net/manual/en/function.filesize.php#71098 * @since 11.1 */ public static function remotefsize($url) @@ -120,7 +120,7 @@ public static function remotefsize($url) * * @return mixed * - * @see http://www.php.net/manual/en/function.ftp-chmod.php + * @see https://secure.php.net/manual/en/function.ftp-chmod.php * @since 11.1 */ public static function ftpChmod($url, $mode) diff --git a/libraries/joomla/filesystem/patcher.php b/libraries/joomla/filesystem/patcher.php index 248fa6bf7ea8c..990cca7ea9d6d 100644 --- a/libraries/joomla/filesystem/patcher.php +++ b/libraries/joomla/filesystem/patcher.php @@ -238,7 +238,7 @@ public function add($udiff, $root = JPATH_BASE, $strip = 0) $this->patches[] = array( 'udiff' => $udiff, 'root' => isset($root) ? rtrim($root, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : '', - 'strip' => $strip + 'strip' => $strip, ); return $this; @@ -410,7 +410,7 @@ protected function applyHunk(&$lines, $src, $dst, $src_line, $src_size, $dst_lin { if ($src_left == 0) { - throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_REMOVE_LINE', key($lines))); + throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_REMOVE_LINE', key($lines))); } $source[] = substr($line, 1); @@ -420,7 +420,7 @@ protected function applyHunk(&$lines, $src, $dst, $src_line, $src_size, $dst_lin { if ($dst_left == 0) { - throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_ADD_LINE', key($lines))); + throw new RuntimeException(JText::sprintf('JLIB_FILESYSTEM_PATCHER_UNEXPECTED_ADD_LINE', key($lines))); } $destin[] = substr($line, 1); diff --git a/libraries/joomla/filesystem/stream.php b/libraries/joomla/filesystem/stream.php index 346eb091e9575..ac2d647e1c69f 100644 --- a/libraries/joomla/filesystem/stream.php +++ b/libraries/joomla/filesystem/stream.php @@ -17,11 +17,11 @@ * atomic manner. * * @note This class adheres to the stream wrapper operations: - * @see http://php.net/manual/en/function.stream-get-wrappers.php - * @see http://php.net/manual/en/intro.stream.php PHP Stream Manual - * @see http://php.net/manual/en/wrappers.php Stream Wrappers - * @see http://php.net/manual/en/filters.php Stream Filters - * @see http://php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy) + * @see https://secure.php.net/manual/en/function.stream-get-wrappers.php + * @see https://secure.php.net/manual/en/intro.stream.php PHP Stream Manual + * @see https://secure.php.net/manual/en/wrappers.php Stream Wrappers + * @see https://secure.php.net/manual/en/filters.php Stream Filters + * @see https://secure.php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy) * @since 11.1 */ class JStream extends JObject @@ -533,7 +533,7 @@ public function gets($length = 0) * * @return mixed * - * @see http://php.net/manual/en/function.fread.php + * @see https://secure.php.net/manual/en/function.fread.php * @since 11.1 */ public function read($length = 0) @@ -636,7 +636,7 @@ public function read($length = 0) * * @return boolean True on success, false on failure * - * @see http://php.net/manual/en/function.fseek.php + * @see https://secure.php.net/manual/en/function.fseek.php * @since 11.1 */ public function seek($offset, $whence = SEEK_SET) @@ -749,7 +749,7 @@ public function tell() * * @return boolean * - * @see http://php.net/manual/en/function.fwrite.php + * @see https://secure.php.net/manual/en/function.fwrite.php * @since 11.1 */ public function write(&$string, $length = 0, $chunk = 0) @@ -891,7 +891,7 @@ public function chmod($filename = '', $mode = 0) * * @return array header/metadata * - * @see http://php.net/manual/en/function.stream-get-meta-data.php + * @see https://secure.php.net/manual/en/function.stream-get-meta-data.php * @since 11.1 */ public function get_meta_data() @@ -936,7 +936,7 @@ public function _buildContext() * * @return void * - * @see http://php.net/stream_context_create + * @see https://secure.php.net/stream_context_create * @since 11.1 */ public function setContextOptions($context) @@ -954,8 +954,8 @@ public function setContextOptions($context) * * @return void * - * @see http://php.net/stream_context_create Stream Context Creation - * @see http://php.net/manual/en/context.php Context Options for various streams + * @see https://secure.php.net/stream_context_create Stream Context Creation + * @see https://secure.php.net/manual/en/context.php Context Options for various streams * @since 11.1 */ public function addContextEntry($wrapper, $name, $value) @@ -972,7 +972,7 @@ public function addContextEntry($wrapper, $name, $value) * * @return void * - * @see http://php.net/stream_context_create + * @see https://secure.php.net/stream_context_create * @since 11.1 */ public function deleteContextEntry($wrapper, $name) @@ -1042,7 +1042,7 @@ public function applyContextToStream() * * @return mixed * - * @see http://php.net/manual/en/function.stream-filter-append.php + * @see https://secure.php.net/manual/en/function.stream-filter-append.php * @since 11.1 */ public function appendFilter($filtername, $read_write = STREAM_FILTER_READ, $params = array()) @@ -1083,7 +1083,7 @@ public function appendFilter($filtername, $read_write = STREAM_FILTER_READ, $par * * @return mixed * - * @see http://php.net/manual/en/function.stream-filter-prepend.php + * @see https://secure.php.net/manual/en/function.stream-filter-prepend.php * @since 11.1 */ public function prependFilter($filtername, $read_write = STREAM_FILTER_READ, $params = array()) diff --git a/libraries/joomla/filesystem/streams/string.php b/libraries/joomla/filesystem/streams/string.php index ce9b12a894edb..8c38bd8a05c2d 100644 --- a/libraries/joomla/filesystem/streams/string.php +++ b/libraries/joomla/filesystem/streams/string.php @@ -30,7 +30,6 @@ class JStreamString protected $currentString; /** - * * The path * * @var string @@ -39,7 +38,6 @@ class JStreamString protected $path; /** - * * The mode * * @var string @@ -48,19 +46,17 @@ class JStreamString protected $mode; /** - * * Enter description here ... - * @var string * + * @var string * @since 12.1 */ protected $options; /** - * * Enter description here ... - * @var string * + * @var string * @since 12.1 */ protected $openedPath; @@ -68,7 +64,7 @@ class JStreamString /** * Current position * - * @var integer + * @var integer * @since 12.1 */ protected $pos; @@ -76,8 +72,7 @@ class JStreamString /** * Length of the string * - * @var string - * + * @var string * @since 12.1 */ protected $len; @@ -127,7 +122,7 @@ public function stream_open($path, $mode, $options, &$opened_path) * * @return array * - * @see http://www.php.net/manual/en/streamwrapper.stream-stat.php + * @see https://secure.php.net/manual/en/streamwrapper.stream-stat.php * @since 11.1 */ public function stream_stat() @@ -143,7 +138,7 @@ public function stream_stat() * * @return array * - * @see http://php.net/manual/en/streamwrapper.url-stat.php + * @see https://secure.php.net/manual/en/streamwrapper.url-stat.php * @since 11.1 */ public function url_stat($path, $flags = 0) @@ -163,7 +158,8 @@ public function url_stat($path, $flags = 0) 'mtime' => $now, 'ctime' => $now, 'blksize' => '512', - 'blocks' => ceil(strlen($string) / 512)); + 'blocks' => ceil(strlen($string) / 512), + ); return $stat; } @@ -179,7 +175,7 @@ public function url_stat($path, $flags = 0) * * @since 11.1 * - * @see http://www.php.net/manual/en/streamwrapper.stream-read.php + * @see https://secure.php.net/manual/en/streamwrapper.stream-read.php */ public function stream_read($count) { diff --git a/libraries/joomla/filter/input.php b/libraries/joomla/filter/input.php index 45ca32254adf6..dbb67d7e402c2 100644 --- a/libraries/joomla/filter/input.php +++ b/libraries/joomla/filter/input.php @@ -507,7 +507,7 @@ public static function isSafeFile($file, $options = array()) // Forbidden string in extension (e.g. php matched .php, .xxx.php, .php.xxx and so on) 'forbidden_extensions' => array( - 'php', 'phps', 'php5', 'php3', 'php4', 'inc', 'pl', 'cgi', 'fcgi', 'java', 'jar', 'py' + 'php', 'phps', 'php5', 'php3', 'php4', 'inc', 'pl', 'cgi', 'fcgi', 'java', 'jar', 'py', ), // array( - 'inc', 'phps', 'class', 'php3', 'php4', 'php5', 'txt', 'dat', 'tpl', 'tmpl' + 'inc', 'phps', 'class', 'php3', 'php4', 'php5', 'txt', 'dat', 'tpl', 'tmpl', ), // Forbidden extensions anywhere in the content @@ -541,7 +541,7 @@ public static function isSafeFile($file, $options = array()) $file['type'], $file['tmp_name'], $file['error'], - $file['size'] + $file['size'], ) ); } @@ -642,7 +642,7 @@ public static function isSafeFile($file, $options = array()) if (empty($suspiciousExtensions)) { $suspiciousExtensions = array( - 'inc', 'phps', 'class', 'php3', 'php4', 'txt', 'dat', 'tpl', 'tmpl' + 'inc', 'phps', 'class', 'php3', 'php4', 'txt', 'dat', 'tpl', 'tmpl', ); } @@ -679,7 +679,7 @@ public static function isSafeFile($file, $options = array()) if (empty($suspiciousExtensions)) { $suspiciousExtensions = array( - 'zip', 'rar', 'tar', 'gz', 'tgz', 'bz2', 'tbz', 'jpa' + 'zip', 'rar', 'tar', 'gz', 'tgz', 'bz2', 'tbz', 'jpa', ); } diff --git a/libraries/joomla/filter/output.php b/libraries/joomla/filter/output.php index d107f99c1195a..07e8025f59b21 100644 --- a/libraries/joomla/filter/output.php +++ b/libraries/joomla/filter/output.php @@ -10,6 +10,7 @@ defined('JPATH_PLATFORM') or die; use Joomla\Filter\OutputFilter; +use Joomla\String\StringHelper; /** * JFilterOutput @@ -47,6 +48,7 @@ public static function stringJSSafe($string) { $new_str .= (ord(substr($string, $i, 1)) < 16 ? '\\x0' : '\\x') . dechex(ord(substr($string, $i, 1))); } + return $new_str; } @@ -71,7 +73,7 @@ public static function stringURLSafe($string, $language = '') $str = $lang->transliterate($str); // Trim white spaces at beginning and end of alias and make lowercase - $str = trim(JString::strtolower($str)); + $str = trim(StringHelper::strtolower($str)); // Remove any duplicate whitespace, and ensure all characters are alphanumeric $str = preg_replace('/(\s|[^A-Za-z0-9\-])+/', '-', $str); diff --git a/libraries/joomla/form/abstractlist.php b/libraries/joomla/form/abstractlist.php new file mode 100644 index 0000000000000..dc3c842dbe373 --- /dev/null +++ b/libraries/joomla/form/abstractlist.php @@ -0,0 +1,262 @@ +class) ? ' class="' . $this->class . '"' : ''; + $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; + $attr .= $this->multiple ? ' multiple' : ''; + $attr .= $this->required ? ' required aria-required="true"' : ''; + $attr .= $this->autofocus ? ' autofocus' : ''; + + // To avoid user's confusion, readonly="true" should imply disabled="true". + if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true') + { + $attr .= ' disabled="disabled"'; + } + + // Initialize JavaScript field attributes. + $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; + + // Get the field options. + $options = (array) $this->getOptions(); + + // Create a read-only list (no name) with hidden input(s) to store the value(s). + if ((string) $this->readonly == '1' || (string) $this->readonly == 'true') + { + $html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id); + + // E.g. form field type tag sends $this->value as array + if ($this->multiple && is_array($this->value)) + { + if (!count($this->value)) + { + $this->value[] = ''; + } + + foreach ($this->value as $value) + { + $html[] = ''; + } + } + else + { + $html[] = ''; + } + } + else + // Create a regular list. + { + $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); + } + + return implode($html); + } + + /** + * Method to get the field options. + * + * @return array The field option objects. + * + * @since __DEPLOY_VERSION__ + */ + protected function getOptions() + { + $fieldname = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname); + $options = array(); + + foreach ($this->element->xpath('option') as $option) + { + // Filter requirements + if ($requires = explode(',', (string) $option['requires'])) + { + // Requires multilanguage + if (in_array('multilanguage', $requires) && !JLanguageMultilang::isEnabled()) + { + continue; + } + + // Requires associations + if (in_array('associations', $requires) && !JLanguageAssociations::isEnabled()) + { + continue; + } + + // Requires vote plugin enabled + if (in_array('vote', $requires) && !JPluginHelper::isEnabled('content', 'vote')) + { + continue; + } + } + + $value = (string) $option['value']; + $text = trim((string) $option) != '' ? trim((string) $option) : $value; + + $disabled = (string) $option['disabled']; + $disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1'); + $disabled = $disabled || ($this->readonly && $value != $this->value); + + $checked = (string) $option['checked']; + $checked = ($checked == 'true' || $checked == 'checked' || $checked == '1'); + + $selected = (string) $option['selected']; + $selected = ($selected == 'true' || $selected == 'selected' || $selected == '1'); + + $tmp = array( + 'value' => $value, + 'text' => JText::alt($text, $fieldname), + 'disable' => $disabled, + 'class' => (string) $option['class'], + 'selected' => ($checked || $selected), + 'checked' => ($checked || $selected), + ); + + // Set some event handler attributes. But really, should be using unobtrusive js. + $tmp['onclick'] = (string) $option['onclick']; + $tmp['onchange'] = (string) $option['onchange']; + + // Add the option object to the result set. + $options[] = (object) $tmp; + } + + if ($this->element['useglobal']) + { + $tmp = new stdClass; + $tmp->value = ''; + $tmp->text = JText::_('JGLOBAL_USE_GLOBAL'); + $component = JFactory::getApplication()->input->getCmd('option'); + + // Get correct component for menu items + if ($component == 'com_menus') + { + $link = $this->form->getData()->get('link'); + $uri = new JUri($link); + $component = $uri->getVar('option', 'com_menus'); + } + + $params = JComponentHelper::getParams($component); + $value = $params->get($this->fieldname); + + // Try with global configuration + if (is_null($value)) + { + $value = JFactory::getConfig()->get($this->fieldname); + } + + // Try with menu configuration + if (is_null($value) && JFactory::getApplication()->input->getCmd('option') == 'com_menus') + { + $value = JComponentHelper::getParams('com_menus')->get($this->fieldname); + } + + if (!is_null($value)) + { + $value = (string) $value; + + foreach ($options as $option) + { + if ($option->value === $value) + { + $value = $option->text; + + break; + } + } + + $tmp->text = JText::sprintf('JGLOBAL_USE_GLOBAL_VALUE', $value); + } + else + { + JFactory::getApplication()->enqueueMessage(JText::_('JGLOBAL_USE_GLOBAL_VALUE_NOT_FOUND'), 'notice'); + } + + array_unshift($options, $tmp); + } + + reset($options); + + return $options; + } + + /** + * Returns an array of key values to put in a list from the given field. + * + * @param stdClass $field The field. + * + * @return array + * + * @since __DEPLOY_VERSION__ + */ + public static function getOptionsFromField($field) + { + $options = $field->fieldparams->get('options', array()); + + if (!is_array($options)) + { + $options = json_decode($options); + } + + $data = array(); + + if (isset($options->name)) + { + foreach ($options->value as $index => $key) + { + $data[$key] = $options->name[$index]; + } + } + + return $data; + } + + /** + * Function to manipulate the DOM element of the field. The form can be + * manipulated at that point. + * + * @param stdClass $field The field. + * @param DOMElement $fieldNode The field node. + * @param JForm $form The form. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form) + { + foreach (self::getOptionsFromField($field) as $index => $name) + { + $element = $fieldNode->appendChild(new DOMElement('option', $name)); + $element->setAttribute('value', $index); + } + + return parent::postProcessDomNode($field, $fieldNode, $form); + } +} diff --git a/libraries/joomla/form/domfieldinterface.php b/libraries/joomla/form/domfieldinterface.php new file mode 100644 index 0000000000000..e903512966aeb --- /dev/null +++ b/libraries/joomla/form/domfieldinterface.php @@ -0,0 +1,41 @@ +type)) { - $parts = JStringNormalise::fromCamelCase(get_called_class(), true); + $parts = Normalise::fromCamelCase(get_called_class(), true); if ($parts[0] == 'J') { - $this->type = JString::ucfirst($parts[count($parts) - 1], '_'); + $this->type = StringHelper::ucfirst($parts[count($parts) - 1], '_'); } else { - $this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_'); + $this->type = StringHelper::ucfirst($parts[0], '_') . StringHelper::ucfirst($parts[count($parts) - 1], '_'); } } } @@ -417,7 +420,7 @@ public function __get($name) return $this->getTitle(); } - return null; + return; } /** @@ -568,11 +571,9 @@ public function setup(SimpleXMLElement $element, $value, $group = null) $this->group = $group; $attributes = array( - 'multiple', 'name', 'id', 'hint', 'class', 'description', 'labelclass', 'onchange', - 'onclick', 'validate', 'pattern', 'default', 'required', - 'disabled', 'readonly', 'autofocus', 'hidden', 'autocomplete', 'spellcheck', - 'translateHint', 'translateLabel','translate_label', 'translateDescription', - 'translate_description' ,'size'); + 'multiple', 'name', 'id', 'hint', 'class', 'description', 'labelclass', 'onchange', 'onclick', 'validate', 'pattern', 'default', + 'required', 'disabled', 'readonly', 'autofocus', 'hidden', 'autocomplete', 'spellcheck', 'translateHint', 'translateLabel', + 'translate_label', 'translateDescription', 'translate_description', 'size'); $this->default = isset($element['value']) ? (string) $element['value'] : $this->default; @@ -742,7 +743,7 @@ protected function getLabel() 'text' => $data['label'], 'for' => $this->id, 'classes' => explode(' ', $data['labelclass']), - 'position' => $position + 'position' => $position, ); return $this->getRenderer($this->renderLabelLayout)->render(array_merge($data, $extraData)); @@ -950,7 +951,7 @@ public function renderField($options = array()) $showonarr[] = array( 'field' => str_replace('[]', '', $this->getName($showon[0])), 'values' => explode(',', $showon[1]), - 'op' => (preg_match('%\[(AND|OR)\]' . $showonfield . '%', $showonstring, $matches)) ? $matches[1] : '' + 'op' => (preg_match('%\[(AND|OR)\]' . $showonfield . '%', $showonstring, $matches)) ? $matches[1] : '', ); } @@ -961,7 +962,7 @@ public function renderField($options = array()) $data = array( 'input' => $this->getInput(), 'label' => $this->getLabel(), - 'options' => $options + 'options' => $options, ); return $this->getRenderer($this->renderLayout)->render($data); @@ -1010,7 +1011,7 @@ protected function getLayoutData() 'size' => $this->size, 'spellcheck' => $this->spellcheck, 'validate' => $this->validate, - 'value' => $this->value + 'value' => $this->value, ); } @@ -1060,6 +1061,106 @@ protected function getRenderer($layoutId = 'default') */ protected function isDebugEnabled() { - return ($this->getAttribute('debug', 'false') === 'true'); + return $this->getAttribute('debug', 'false') === 'true'; + } + + /** + * Transforms the field into an XML element and appends it as child on the given parent. This + * is the default implementation of a field. Form fields which do support to be transformed into + * an XML Element mut implemet the JFormDomfieldinterface. + * + * @param stdClass $field The field. + * @param DOMElement $parent The field node parent. + * @param JForm $form The form. + * + * @return DOMElement + * + * @since __DEPLOY_VERSION__ + * @see JFormDomfieldinterface::appendXMLFieldTag + */ + public function appendXMLFieldTag($field, DOMElement $parent, JForm $form) + { + $app = JFactory::getApplication(); + + if ($field->params->get('show_on') == 1 && $app->isAdmin()) + { + return; + } + elseif ($field->params->get('show_on') == 2 && $app->isSite()) + { + return; + } + + $node = $parent->appendChild(new DOMElement('field')); + + $node->setAttribute('name', $field->alias); + $node->setAttribute('type', $field->type); + $node->setAttribute('default', $field->default_value); + $node->setAttribute('label', $field->label); + $node->setAttribute('description', $field->description); + $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'); + } + + foreach ($field->fieldparams->toArray() as $key => $param) + { + if (is_array($param)) + { + $param = implode(',', $param); + } + + $node->setAttribute($key, $param); + } + + $this->postProcessDomNode($field, $node, $form); + + return $node; + } + + /** + * Function to manipulate the DOM element of the field. The form can be + * manipulated at that point. + * + * @param stdClass $field The field. + * @param DOMElement $fieldNode The field node. + * @param JForm $form The form. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function postProcessDomNode ($field, DOMElement $fieldNode, JForm $form) + { + } + + /** + * Returns the attributes of the field as an XML string which can be loaded + * into JForm. + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + public function getFormParameters() + { + jimport('joomla.filesystem.file'); + + $reflectionClass = new ReflectionClass($this); + $fileName = dirname($reflectionClass->getFileName()) . '/../parameters/'; + $fileName .= str_replace('.php', '.xml', basename($reflectionClass->getFileName())); + + if (JFile::exists($fileName)) + { + return JFile::read($fileName); + } + + return ''; } } diff --git a/libraries/joomla/form/fields/accesslevel.php b/libraries/joomla/form/fields/accesslevel.php index 7634b53976619..4abd822bc3ac0 100644 --- a/libraries/joomla/form/fields/accesslevel.php +++ b/libraries/joomla/form/fields/accesslevel.php @@ -9,8 +9,6 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Provides a list of access levels. Access levels control what users in specific @@ -19,7 +17,7 @@ * @see JAccess * @since 11.1 */ -class JFormFieldAccessLevel extends JFormFieldList +class JFormFieldAccessLevel extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/aliastag.php b/libraries/joomla/form/fields/aliastag.php new file mode 100644 index 0000000000000..9a95df745d623 --- /dev/null +++ b/libraries/joomla/form/fields/aliastag.php @@ -0,0 +1,72 @@ +getQuery(true) + ->select('Distinct type_alias AS value, type_alias AS text') + ->from('#__contentitem_tag_map'); + $db->setQuery($query); + + $options = $db->loadObjectList(); + + $lang = JFactory::getLanguage(); + + foreach ($options as $i => $item) + { + $parts = explode('.', $item->value); + $extension = $parts[0]; + $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, true) + || $lang->load($extension, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $extension), null, false, true); + $options[$i]->text = JText::_(strtoupper($extension) . '_TAGS_' . strtoupper($parts[1])); + } + + // Merge any additional options in the XML definition. + $options = array_merge(parent::getOptions(), $options); + + // Sort by language value + usort( + $options, + function($a, $b) + { + return $a->text > $b->text; + } + ); + + return $options; + } +} diff --git a/libraries/joomla/form/fields/cachehandler.php b/libraries/joomla/form/fields/cachehandler.php index 7323be59d021e..aab972895c94a 100644 --- a/libraries/joomla/form/fields/cachehandler.php +++ b/libraries/joomla/form/fields/cachehandler.php @@ -9,8 +9,6 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Provides a list of available cache handlers @@ -18,7 +16,7 @@ * @see JCache * @since 11.1 */ -class JFormFieldCacheHandler extends JFormFieldList +class JFormFieldCacheHandler extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/calendar.php b/libraries/joomla/form/fields/calendar.php index 032d9d654811d..610ca29cc6044 100644 --- a/libraries/joomla/form/fields/calendar.php +++ b/libraries/joomla/form/fields/calendar.php @@ -17,7 +17,7 @@ * * @since 11.1 */ -class JFormFieldCalendar extends JFormField +class JFormFieldCalendar extends JFormField implements JFormDomfieldinterface { /** * The form field type. @@ -140,7 +140,25 @@ protected function getInput() $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. - $format = $this->format; + $translateFormat = (string) $this->element['translateformat']; + + if ($translateFormat && $translateFormat != 'false') + { + $showTime = (string) $this->element['showtime']; + + if ($showTime && $showTime != 'false') + { + $format = JText::_('DATE_FORMAT_CALENDAR_DATETIME'); + } + else + { + $format = JText::_('DATE_FORMAT_CALENDAR_DATE'); + } + } + else + { + $format = $this->format; + } // Build the attributes array. $attributes = array(); @@ -151,7 +169,7 @@ protected function getInput() !$this->readonly ? null : $attributes['readonly'] = 'readonly'; !$this->disabled ? null : $attributes['disabled'] = 'disabled'; empty($this->onchange) ? null : $attributes['onchange'] = $this->onchange; - empty($hint) ? null : $attributes['placeholder'] = $hint; + !strlen($hint) ? null : $attributes['placeholder'] = $hint; $this->autocomplete ? null : $attributes['autocomplete'] = 'off'; !$this->autofocus ? null : $attributes['autofocus'] = ''; @@ -206,7 +224,7 @@ protected function getInput() // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); return JHtml::_('calendar', $this->value, $this->name, $this->id, $format, $attributes); } diff --git a/libraries/joomla/form/fields/checkbox.php b/libraries/joomla/form/fields/checkbox.php index f72507478f976..657a5e2b0f3c8 100644 --- a/libraries/joomla/form/fields/checkbox.php +++ b/libraries/joomla/form/fields/checkbox.php @@ -11,7 +11,7 @@ /** * Form Field class for the Joomla Platform. - * Single check box field. + * Single checkbox field. * This is a boolean field with null for false and the specified option for true * * @link http://www.w3.org/TR/html-markup/input.checkbox.html#input.checkbox @@ -96,6 +96,16 @@ public function __set($name, $value) */ public function setup(SimpleXMLElement $element, $value, $group = null) { + // Handle the default attribute + $default = (string) $element['default']; + + if ($default) + { + $test = $this->form->getValue((string) $element['name'], $group); + + $value = ($test == $default) ? $default : null; + } + $return = parent::setup($element, $value, $group); if ($return) @@ -133,7 +143,7 @@ protected function getInput() // Including fallback code for HTML5 non supported browsers. JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true)); return ' is_array($checkedOptions) ? $checkedOptions : explode(',', (string) $checkedOptions), 'hasValue' => $hasValue, - 'options' => $this->getOptions() + 'options' => $this->getOptions(), ); return array_merge($data, $extraData); diff --git a/libraries/joomla/form/fields/color.php b/libraries/joomla/form/fields/color.php index 3db4b1212b80e..a21de15e797b3 100644 --- a/libraries/joomla/form/fields/color.php +++ b/libraries/joomla/form/fields/color.php @@ -16,7 +16,7 @@ * @link http://www.w3.org/TR/html-markup/input.color.html * @since 11.3 */ -class JFormFieldColor extends JFormField +class JFormFieldColor extends JFormField implements JFormDomfieldinterface { /** * The form field type. @@ -74,6 +74,14 @@ class JFormFieldColor extends JFormField */ protected $split = 3; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.5 + */ + protected $layout = 'joomla.form.field.color'; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -172,140 +180,125 @@ public function setup(SimpleXMLElement $element, $value, $group = null) */ protected function getInput() { - $lang = JFactory::getLanguage(); + // Switch the layouts + $this->layout = $this->control === 'simple' ? $this->layout . '.simple' : $this->layout . '.advanced'; - // Translate placeholder text - $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } - // Control value can be: hue (default), saturation, brightness, wheel or simple - $control = $this->control; + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.5 + */ + protected function getLayoutData() + { + $lang = JFactory::getLanguage(); + $data = parent::getLayoutData(); + $color = strtolower($this->value); + $color = ! $color ? '' : $color; // Position of the panel can be: right (default), left, top or bottom (default RTL is left) $position = ' data-position="' . (($lang->isRTL() && $this->position == 'default') ? 'left' : $this->position) . '"'; - // Validation of data can be: color (hex color value). Keep for B/C (minicolors.js already auto-validates color) - $validate = $this->validate ? ' data-validate="' . $this->validate . '"' : ''; - - $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; - $class = $this->class; - $required = $this->required ? ' required aria-required="true"' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - $autofocus = $this->autofocus ? ' autofocus' : ''; - - $color = strtolower($this->value); - $color = ! $color ? '' : $color; - - if ($control == 'simple') + if (!$color || in_array($color, array('none', 'transparent'))) { - $class = ' class="' . trim('simplecolors chzn-done ' . $class) . '"'; - JHtml::_('behavior.simplecolorpicker'); - - if (in_array($color, array('none', 'transparent'))) - { - $color = 'none'; - } - elseif ($color['0'] != '#') - { - $color = '#' . $color; - } - - $colors = strtolower($this->colors); - - if (empty($colors)) - { - $colors = array( - 'none', - '#049cdb', - '#46a546', - '#9d261d', - '#ffc40d', - '#f89406', - '#c3325f', - '#7a43b6', - '#ffffff', - '#999999', - '#555555', - '#000000' - ); - } - else - { - $colors = explode(',', $colors); - } - - $split = $this->split; - - if (!$split) - { - $count = count($colors); - - if ($count % 5 == 0) - { - $split = 5; - } - else - { - if ($count % 4 == 0) - { - $split = 4; - } - } - } - - $split = $split ? $split : 3; + $color = 'none'; + } + elseif ($color['0'] != '#') + { + $color = '#' . $color; + } - $html = array(); - $html[] = ''; + /** + * Method to get the data for the simple mode to be passed to the layout for rendering. + * + * @return array + * + * @since 3.5 + */ + protected function getSimpleModeLayoutData() + { + $colors = strtolower($this->colors); - return implode('', $html); + if (empty($colors)) + { + $colors = array( + 'none', + '#049cdb', + '#46a546', + '#9d261d', + '#ffc40d', + '#f89406', + '#c3325f', + '#7a43b6', + '#ffffff', + '#999999', + '#555555', + '#000000', + ); } else { - if (in_array($this->format, array('rgb', 'rgba')) && $this->validate != 'color') + $colors = explode(',', $colors); + } + + if (!$this->split) + { + $count = count($colors); + if ($count % 5 == 0) { - $alpha = ($this->format == 'rgba') ? true : false; - $placeholder = $alpha ? 'rgba(0, 0, 0, 0.5)' : 'rgb(0, 0, 0)'; + $split = 5; } else { - $placeholder = '#rrggbb'; + if ($count % 4 == 0) + { + $split = 4; + } } + } - $inputclass = ($this->keywords && ! in_array($this->format, array('rgb', 'rgba'))) ? ' keywords' : ' ' . $this->format; - $class = ' class="' . trim('minicolors ' . $class) . ($this->validate == 'color' ? '' : $inputclass) . '"'; - $control = $control ? ' data-control="' . $control . '"' : ''; - $format = $this->format ? ' data-format="' . $this->format . '"' : ''; - $keywords = $this->keywords ? ' data-keywords="' . $this->keywords . '"' : ''; - $readonly = $this->readonly ? ' readonly' : ''; - $hint = $hint ? ' placeholder="' . $hint . '"' : ' placeholder="' . $placeholder . '"'; - $autocomplete = ! $this->autocomplete ? ' autocomplete="off"' : ''; - - // Force LTR input value in RTL, due to display issues with rgba/hex colors - $direction = $lang->isRTL() ? ' dir="ltr" style="text-align:right"' : ''; - - // Including fallback code for HTML5 non supported browsers. - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + $split = $this->split ? $this->split : 3; - JHtml::_('behavior.colorpicker'); + return array( + 'colors' => $colors, + 'split' => $split, + ); + } - return ''; - } + /** + * Method to get the data for the advanced mode to be passed to the layout for rendering. + * + * @param object $lang The language object + * + * @return array + * + * @since 3.5 + */ + protected function getAdvancedModeLayoutData($lang) + { + return array( + 'colors' => $this->colors, + 'control' => $this->control, + 'lang' => $lang, + ); } } diff --git a/libraries/joomla/form/fields/combo.php b/libraries/joomla/form/fields/combo.php index 25d52ba5426c9..8bed141d2c7ab 100644 --- a/libraries/joomla/form/fields/combo.php +++ b/libraries/joomla/form/fields/combo.php @@ -9,15 +9,13 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Implements a combo box field. * * @since 11.1 */ -class JFormFieldCombo extends JFormFieldList +class JFormFieldCombo extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/databaseconnection.php b/libraries/joomla/form/fields/databaseconnection.php index ca9ecb672e679..e01d1e14fa327 100644 --- a/libraries/joomla/form/fields/databaseconnection.php +++ b/libraries/joomla/form/fields/databaseconnection.php @@ -9,8 +9,6 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Provides a list of available database connections, optionally limiting to @@ -19,7 +17,7 @@ * @see JDatabaseDriver * @since 11.3 */ -class JFormFieldDatabaseConnection extends JFormFieldList +class JFormFieldDatabaseConnection extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/email.php b/libraries/joomla/form/fields/email.php index 2d21c25b44d33..0e933c5c2bb8c 100644 --- a/libraries/joomla/form/fields/email.php +++ b/libraries/joomla/form/fields/email.php @@ -13,13 +13,13 @@ /** * Form Field class for the Joomla Platform. - * Provides and input field for e-mail addresses + * Provides and input field for email addresses * * @link http://www.w3.org/TR/html-markup/input.email.html#input.email * @see JFormRuleEmail * @since 11.1 */ -class JFormFieldEMail extends JFormFieldText +class JFormFieldEMail extends JFormFieldText implements JFormDomfieldinterface { /** * The form field type. @@ -30,7 +30,15 @@ class JFormFieldEMail extends JFormFieldText protected $type = 'Email'; /** - * Method to get the field input markup for e-mail addresses. + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.email'; + + /** + * Method to get the field input markup for email addresses. * * @return string The field input markup. * @@ -38,32 +46,44 @@ class JFormFieldEMail extends JFormFieldText */ protected function getInput() { - // Translate placeholder text - $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.5 + */ + protected function getLayoutData() + { + $data = parent::getLayoutData(); - // Initialize some field attributes. - $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; - $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; - $class = !empty($this->class) ? ' class="validate-email ' . $this->class . '"' : ' class="validate-email"'; - $readonly = $this->readonly ? ' readonly' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - $required = $this->required ? ' required aria-required="true"' : ''; - $hint = $hint ? ' placeholder="' . $hint . '"' : ''; - $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; - $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; - $autofocus = $this->autofocus ? ' autofocus' : ''; - $multiple = $this->multiple ? ' multiple' : ''; - $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; + $extraData = array( + 'maxLength' => $this->maxLength, + 'multiple' => $this->multiple, + ); - // Initialize JavaScript field attributes. - $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; + return array_merge($data, $extraData); + } - // Including fallback code for HTML5 non supported browsers. - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + /** + * Function to manipulate the DOM element of the field. The form can be + * manipulated at that point. + * + * @param stdClass $field The field. + * @param DOMElement $fieldNode The field node. + * @param JForm $form The form. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form) + { + $fieldNode->setAttribute('validate', 'email'); - return ''; + return parent::postProcessDomNode($field, $fieldNode, $form); } } diff --git a/libraries/joomla/form/fields/file.php b/libraries/joomla/form/fields/file.php index dd686d17350bb..0f629491e6ea4 100644 --- a/libraries/joomla/form/fields/file.php +++ b/libraries/joomla/form/fields/file.php @@ -132,7 +132,7 @@ protected function getInput() * * @return array * - * @since 3.6 + * @since 3.6 */ protected function getLayoutData() { diff --git a/libraries/joomla/form/fields/filelist.php b/libraries/joomla/form/fields/filelist.php index 4c8a42e5e4f85..a3627c9c1d096 100644 --- a/libraries/joomla/form/fields/filelist.php +++ b/libraries/joomla/form/fields/filelist.php @@ -11,14 +11,12 @@ jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); -JFormHelper::loadFieldClass('list'); - /** * Supports an HTML select list of files * * @since 11.1 */ -class JFormFieldFileList extends JFormFieldList +class JFormFieldFileList extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/folderlist.php b/libraries/joomla/form/fields/folderlist.php index 0d02c74966ca8..659e483f0a7f7 100644 --- a/libraries/joomla/form/fields/folderlist.php +++ b/libraries/joomla/form/fields/folderlist.php @@ -10,14 +10,12 @@ defined('JPATH_PLATFORM') or die; jimport('joomla.filesystem.folder'); -JFormHelper::loadFieldClass('list'); - /** * Supports an HTML select list of folder * * @since 11.1 */ -class JFormFieldFolderList extends JFormFieldList +class JFormFieldFolderList extends JFormAbstractlist { /** * The form field type. @@ -43,6 +41,14 @@ class JFormFieldFolderList extends JFormFieldList */ protected $exclude; + /** + * The recursive. + * + * @var string + * @since 3.6 + */ + protected $recursive; + /** * The hideNone. * @@ -82,6 +88,7 @@ public function __get($name) { case 'filter': case 'exclude': + case 'recursive': case 'hideNone': case 'hideDefault': case 'directory': @@ -108,6 +115,7 @@ public function __set($name, $value) case 'filter': case 'directory': case 'exclude': + case 'recursive': $this->$name = (string) $value; break; @@ -145,6 +153,9 @@ public function setup(SimpleXMLElement $element, $value, $group = null) $this->filter = (string) $this->element['filter']; $this->exclude = (string) $this->element['exclude']; + $recursive = (string) $this->element['recursive']; + $this->recursive = ($recursive == 'true' || $recursive == 'recursive' || $recursive == '1'); + $hideNone = (string) $this->element['hide_none']; $this->hideNone = ($hideNone == 'true' || $hideNone == 'hideNone' || $hideNone == '1'); @@ -188,7 +199,7 @@ protected function getOptions() } // Get a list of folders in the search path with the given filter. - $folders = JFolder::folders($path, $this->filter); + $folders = JFolder::folders($path, $this->filter, $this->recursive, true); // Build the options list from the list of folders. if (is_array($folders)) @@ -204,6 +215,9 @@ protected function getOptions() } } + // Remove the root part and the leading / + $folder = trim(str_replace($path, '', $folder), '/'); + $options[] = JHtml::_('select.option', $folder, $folder); } } diff --git a/libraries/joomla/form/fields/groupedlist.php b/libraries/joomla/form/fields/groupedlist.php index 765bf77033ccc..643ab8cf9c8f1 100644 --- a/libraries/joomla/form/fields/groupedlist.php +++ b/libraries/joomla/form/fields/groupedlist.php @@ -168,7 +168,7 @@ protected function getInput() 'select.groupedlist', $groups, null, array( 'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false, - 'option.text.toHtml' => false + 'option.text.toHtml' => false, ) ); @@ -198,7 +198,7 @@ protected function getInput() 'select.groupedlist', $groups, $this->name, array( 'list.attr' => $attr, 'id' => $this->id, 'list.select' => $this->value, 'group.items' => null, 'option.key.toHtml' => false, - 'option.text.toHtml' => false + 'option.text.toHtml' => false, ) ); } diff --git a/libraries/joomla/form/fields/hidden.php b/libraries/joomla/form/fields/hidden.php index 1b72afef6d151..e4834b646e49c 100644 --- a/libraries/joomla/form/fields/hidden.php +++ b/libraries/joomla/form/fields/hidden.php @@ -26,6 +26,14 @@ class JFormFieldHidden extends JFormField */ protected $type = 'Hidden'; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.hidden'; + /** * Method to get the field input markup. * @@ -35,14 +43,19 @@ class JFormFieldHidden extends JFormField */ protected function getInput() { - // Initialize some field attributes. - $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - - // Initialize JavaScript field attributes. - $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } - return ''; + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.7 + */ + protected function getLayoutData() + { + return parent::getLayoutData(); } } diff --git a/libraries/joomla/form/fields/imagelist.php b/libraries/joomla/form/fields/imagelist.php index 04b14171ec983..64212f86ff965 100644 --- a/libraries/joomla/form/fields/imagelist.php +++ b/libraries/joomla/form/fields/imagelist.php @@ -16,7 +16,7 @@ * * @since 11.1 */ -class JFormFieldImageList extends JFormFieldFileList +class JFormFieldImageList extends JFormFieldFileList implements JFormDomfieldinterface { /** * The form field type. @@ -42,4 +42,24 @@ protected function getOptions() // Get the field options. return parent::getOptions(); } + + /** + * Function to manipulate the DOM element of the field. The form can be + * manipulated at that point. + * + * @param stdClass $field The field. + * @param DOMElement $fieldNode The field node. + * @param JForm $form The form. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function postProcessDomNode($field, DOMElement $fieldNode, JForm $form) + { + $fieldNode->setAttribute('hide_default', 'true'); + $fieldNode->setAttribute('directory', '/images/' . $fieldNode->getAttribute('directory')); + + return parent::postProcessDomNode($field, $fieldNode, $form); + } } diff --git a/libraries/joomla/form/fields/integer.php b/libraries/joomla/form/fields/integer.php index 88b16915a7479..a5039ae10d12d 100644 --- a/libraries/joomla/form/fields/integer.php +++ b/libraries/joomla/form/fields/integer.php @@ -9,15 +9,13 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Provides a select list of integers with specified first, last and step values. * * @since 11.1 */ -class JFormFieldInteger extends JFormFieldList +class JFormFieldInteger extends JFormAbstractlist implements JFormDomfieldinterface { /** * The form field type. diff --git a/libraries/joomla/form/fields/language.php b/libraries/joomla/form/fields/language.php index 55a79d4c90eef..862799ed064ca 100644 --- a/libraries/joomla/form/fields/language.php +++ b/libraries/joomla/form/fields/language.php @@ -9,8 +9,6 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Supports a list of installed application languages @@ -18,7 +16,7 @@ * @see JFormFieldContentLanguage for a select list of content languages. * @since 11.1 */ -class JFormFieldLanguage extends JFormFieldList +class JFormFieldLanguage extends JFormAbstractlist { /** * The form field type. diff --git a/libraries/joomla/form/fields/list.php b/libraries/joomla/form/fields/list.php index 6b7659f03b0b6..9d2da628739b4 100644 --- a/libraries/joomla/form/fields/list.php +++ b/libraries/joomla/form/fields/list.php @@ -15,7 +15,7 @@ * * @since 11.1 */ -class JFormFieldList extends JFormField +class JFormFieldList extends JFormAbstractlist implements JFormDomfieldinterface { /** * The form field type. @@ -24,133 +24,4 @@ class JFormFieldList extends JFormField * @since 11.1 */ protected $type = 'List'; - - /** - * Method to get the field input markup for a generic list. - * Use the multiple attribute to enable multiselect. - * - * @return string The field input markup. - * - * @since 11.1 - */ - protected function getInput() - { - $html = array(); - $attr = ''; - - // Initialize some field attributes. - $attr .= !empty($this->class) ? ' class="' . $this->class . '"' : ''; - $attr .= !empty($this->size) ? ' size="' . $this->size . '"' : ''; - $attr .= $this->multiple ? ' multiple' : ''; - $attr .= $this->required ? ' required aria-required="true"' : ''; - $attr .= $this->autofocus ? ' autofocus' : ''; - - // To avoid user's confusion, readonly="true" should imply disabled="true". - if ((string) $this->readonly == '1' || (string) $this->readonly == 'true' || (string) $this->disabled == '1'|| (string) $this->disabled == 'true') - { - $attr .= ' disabled="disabled"'; - } - - // Initialize JavaScript field attributes. - $attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; - - // Get the field options. - $options = (array) $this->getOptions(); - - // Create a read-only list (no name) with hidden input(s) to store the value(s). - if ((string) $this->readonly == '1' || (string) $this->readonly == 'true') - { - $html[] = JHtml::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id); - - // E.g. form field type tag sends $this->value as array - if ($this->multiple && is_array($this->value)) - { - if (!count($this->value)) - { - $this->value[] = ''; - } - - foreach ($this->value as $value) - { - $html[] = ''; - } - } - else - { - $html[] = ''; - } - } - else - // Create a regular list. - { - $html[] = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id); - } - - return implode($html); - } - - /** - * Method to get the field options. - * - * @return array The field option objects. - * - * @since 11.1 - */ - protected function getOptions() - { - $fieldname = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname); - $options = array(); - - foreach ($this->element->xpath('option') as $option) - { - // Filter requirements - if ($requires = explode(',', (string) $option['requires'])) - { - // Requires multilanguage - if (in_array('multilanguage', $requires) && !JLanguageMultilang::isEnabled()) - { - continue; - } - - // Requires associations - if (in_array('associations', $requires) && !JLanguageAssociations::isEnabled()) - { - continue; - } - } - - $value = (string) $option['value']; - $text = trim((string) $option) ? trim((string) $option) : $value; - - $disabled = (string) $option['disabled']; - $disabled = ($disabled == 'true' || $disabled == 'disabled' || $disabled == '1'); - $disabled = $disabled || ($this->readonly && $value != $this->value); - - $checked = (string) $option['checked']; - $checked = ($checked == 'true' || $checked == 'checked' || $checked == '1'); - - $selected = (string) $option['selected']; - $selected = ($selected == 'true' || $selected == 'selected' || $selected == '1'); - - $tmp = array( - 'value' => $value, - 'text' => JText::alt($text, $fieldname), - 'disable' => $disabled, - 'class' => (string) $option['class'], - 'selected' => ($checked || $selected), - 'checked' => ($checked || $selected) - ); - - // Set some event handler attributes. But really, should be using unobtrusive js. - $tmp['onclick'] = (string) $option['onclick']; - $tmp['onchange'] = (string) $option['onchange']; - - // Add the option object to the result set. - $options[] = (object) $tmp; - } - - reset($options); - - return $options; - } } diff --git a/libraries/joomla/form/fields/meter.php b/libraries/joomla/form/fields/meter.php index e0a19387b3496..5061c3f3e9345 100644 --- a/libraries/joomla/form/fields/meter.php +++ b/libraries/joomla/form/fields/meter.php @@ -60,6 +60,14 @@ class JFormFieldMeter extends JFormFieldNumber */ protected $color; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.meter'; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -159,32 +167,32 @@ public function setup(SimpleXMLElement $element, $value, $group = null) */ protected function getInput() { - // Initialize some field attributes. - $width = !empty($this->width) ? ' style="width:' . $this->width . ';"' : ''; - $color = !empty($this->color) ? ' background-color:' . $this->color . ';' : ''; - - $data = ''; - $data .= ' data-max="' . $this->max . '"'; - $data .= ' data-min="' . $this->min . '"'; - $data .= ' data-step="' . $this->step . '"'; - - $class = 'progress ' . $this->class; - $class .= $this->animated ? ' progress-striped' : ''; - $class .= $this->active ? ' active' : ''; - $class = ' class="' . $class . '"'; - - $value = (float) $this->value; - $value = $value < $this->min ? $this->min : $value; - $value = $value > $this->max ? $this->max : $value; - - $data .= ' data-value="' . $this->value . '"'; - - $value = ((float) ($value - $this->min) * 100) / ($this->max - $this->min); + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } - $html[] = '
    '; - $html[] = '
    '; - $html[] = '
    '; + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.5 + */ + protected function getLayoutData() + { + $data = parent::getLayoutData(); - return implode('', $html); + // Initialize some field attributes. + $extraData = array( + 'width' => $this->width, + 'color' => $this->color, + 'animated' => $this->animated, + 'active' => $this->active, + 'max' => $this->max, + 'min' => $this->min, + 'step' => $this->step, + ); + + return array_merge($data, $extraData); } } diff --git a/libraries/joomla/form/fields/number.php b/libraries/joomla/form/fields/number.php index 1ec34ee6256a7..77e400a1b1631 100644 --- a/libraries/joomla/form/fields/number.php +++ b/libraries/joomla/form/fields/number.php @@ -50,6 +50,14 @@ class JFormFieldNumber extends JFormField */ protected $step = 0; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.number'; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -135,47 +143,29 @@ public function setup(SimpleXMLElement $element, $value, $group = null) */ protected function getInput() { - // Translate placeholder text - $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; - - // Initialize some field attributes. - $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; - - // Must use isset instead of !empty for max/min because "zero" boundaries are always acceptable - $max = isset($this->max) ? ' max="' . $this->max . '"' : ''; - $min = isset($this->min) ? ' min="' . $this->min . '"' : ''; - - $step = !empty($this->step) ? ' step="' . $this->step . '"' : ''; - $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; - $readonly = $this->readonly ? ' readonly' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - $required = $this->required ? ' required aria-required="true"' : ''; - $hint = $hint ? ' placeholder="' . $hint . '"' : ''; - - $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; - $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; - - $autofocus = $this->autofocus ? ' autofocus' : ''; - - if (is_numeric($this->value)) - { - $value = (float) $this->value; - } - else - { - $value = ""; - $value = (isset($this->min)) ? $this->min : $value; - } - - // Initialize JavaScript field attributes. - $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } - // Including fallback code for HTML5 non supported browsers. - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.7 + */ + protected function getLayoutData() + { + $data = parent::getLayoutData(); - return ''; + // Initialize some field attributes. + $extraData = array( + 'max' => $this->max, + 'min' => $this->min, + 'step' => $this->step, + 'value' => $this->value, + ); + + return array_merge($data, $extraData); } } diff --git a/libraries/joomla/form/fields/password.php b/libraries/joomla/form/fields/password.php index e55de506210ad..b54c298c9a177 100644 --- a/libraries/joomla/form/fields/password.php +++ b/libraries/joomla/form/fields/password.php @@ -51,6 +51,14 @@ class JFormFieldPassword extends JFormField */ protected $meter = false; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.password'; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -142,44 +150,29 @@ public function setup(SimpleXMLElement $element, $value, $group = null) */ protected function getInput() { - // Translate placeholder text - $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; - - // Initialize some field attributes. - $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; - $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; - $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; - $readonly = $this->readonly ? ' readonly' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - $required = $this->required ? ' required aria-required="true"' : ''; - $hint = $hint ? ' placeholder="' . $hint . '"' : ''; - $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ''; - $autofocus = $this->autofocus ? ' autofocus' : ''; - - if ($this->meter) - { - JHtml::_('script', 'system/passwordstrength.js', true, true); - $script = 'new Form.PasswordStrength("' . $this->id . '", - { - threshold: ' . $this->threshold . ', - onUpdate: function(element, strength, threshold) { - element.set("data-passwordstrength", strength); - } - } - );'; - - // Load script on document load. - JFactory::getDocument()->addScriptDeclaration( - "jQuery(document).ready(function(){" . $script . "});" - ); - } + // Trim the trailing line in the layout file + return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL); + } - // Including fallback code for HTML5 non supported browsers. - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.7 + */ + protected function getLayoutData() + { + $data = parent::getLayoutData(); - return ''; + // Initialize some field attributes. + $extraData = array( + 'maxLength' => $this->maxLength, + 'meter' => $this->meter, + 'threshold' => $this->threshold, + 'meter' => $this->meter, + ); + + return array_merge($data, $extraData); } } diff --git a/libraries/joomla/form/fields/plugins.php b/libraries/joomla/form/fields/plugins.php index b3ca9ee7704b0..9587e5f5001c3 100644 --- a/libraries/joomla/form/fields/plugins.php +++ b/libraries/joomla/form/fields/plugins.php @@ -9,14 +9,12 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Framework. * * @since 11.4 */ -class JFormFieldPlugins extends JFormFieldList +class JFormFieldPlugins extends JFormAbstractlist { /** * The field type. diff --git a/libraries/joomla/form/fields/predefinedlist.php b/libraries/joomla/form/fields/predefinedlist.php index d25437a92cd54..b88a4693f7e5d 100644 --- a/libraries/joomla/form/fields/predefinedlist.php +++ b/libraries/joomla/form/fields/predefinedlist.php @@ -9,14 +9,12 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field to load a list of predefined values * * @since 3.2 */ -abstract class JFormFieldPredefinedList extends JFormFieldList +abstract class JFormFieldPredefinedList extends JFormAbstractlist { /** * The form field type. @@ -80,7 +78,7 @@ protected function getOptions() $options[] = (object) array( 'value' => $value, - 'text' => $text + 'text' => $text, ); } } diff --git a/libraries/joomla/form/fields/radio.php b/libraries/joomla/form/fields/radio.php index 4e450c46148c3..d41a1f6f763fd 100644 --- a/libraries/joomla/form/fields/radio.php +++ b/libraries/joomla/form/fields/radio.php @@ -9,8 +9,6 @@ defined('JPATH_PLATFORM') or die; -JFormHelper::loadFieldClass('list'); - /** * Form Field class for the Joomla Platform. * Provides radio button inputs @@ -18,7 +16,7 @@ * @link http://www.w3.org/TR/html-markup/command.radio.html#command.radio * @since 11.1 */ -class JFormFieldRadio extends JFormFieldList +class JFormFieldRadio extends JFormAbstractlist implements JFormDomfieldinterface { /** * The form field type. @@ -66,7 +64,7 @@ protected function getLayoutData() $extraData = array( 'options' => $this->getOptions(), - 'value' => (string) $this->value + 'value' => (string) $this->value, ); return array_merge($data, $extraData); diff --git a/libraries/joomla/form/fields/range.php b/libraries/joomla/form/fields/range.php index 7c53eb82eb1e0..9fb5afb58ef48 100644 --- a/libraries/joomla/form/fields/range.php +++ b/libraries/joomla/form/fields/range.php @@ -28,6 +28,14 @@ class JFormFieldRange extends JFormFieldNumber */ protected $type = 'Range'; + /** + * Name of the layout being used to render the field + * + * @var string + * @since 3.7 + */ + protected $layout = 'joomla.form.field.range'; + /** * Method to get the field input markup. * @@ -37,28 +45,27 @@ class JFormFieldRange extends JFormFieldNumber */ protected function getInput() { - // Initialize some field attributes. - $max = !empty($this->max) ? ' max="' . $this->max . '"' : ''; - $min = !empty($this->min) ? ' min="' . $this->min . '"' : ''; - $step = !empty($this->step) ? ' step="' . $this->step . '"' : ''; - $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; - $readonly = $this->readonly ? ' readonly' : ''; - $disabled = $this->disabled ? ' disabled' : ''; - - $autofocus = $this->autofocus ? ' autofocus' : ''; - - $value = (float) $this->value; - $value = empty($value) ? $this->min : $value; + return $this->getRenderer($this->layout)->render($this->getLayoutData()); + } - // Initialize JavaScript field attributes. - $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; + /** + * Method to get the data to be passed to the layout for rendering. + * + * @return array + * + * @since 3.7 + */ + protected function getLayoutData() + { + $data = parent::getLayoutData(); - // Including fallback code for HTML5 non supported browsers. - JHtml::_('jquery.framework'); - JHtml::_('script', 'system/html5fallback.js', false, true); + // Initialize some field attributes. + $extraData = array( + 'max' => $this->max, + 'min' => $this->min, + 'step' => $this->step, + ); - return ''; + return array_merge($data, $extraData); } } diff --git a/libraries/joomla/form/fields/repeatable.php b/libraries/joomla/form/fields/repeatable.php index c0d5b03095dab..f6f26b9536b4a 100644 --- a/libraries/joomla/form/fields/repeatable.php +++ b/libraries/joomla/form/fields/repeatable.php @@ -56,6 +56,8 @@ protected function getInput() // Build a Table $head_row_str = array(); $body_row_str = array(); + $head_row_str[] = ''; + $body_row_str[] = ''; foreach ($subForm->getFieldset() as $field) { // Reset name to simple @@ -131,7 +133,17 @@ protected function getInput() // Add scripts JHtml::_('bootstrap.framework'); - JHtml::_('script', 'system/repeatable.js', true, true); + + // Depends on jQuery UI + JHtml::_('jquery.ui', array('core', 'sortable')); + + JHtml::_('script', 'jui/sortablelist.js', array('version' => 'auto', 'relative' => true)); + JHtml::_('stylesheet', 'jui/sortablelist.css', array('version' => 'auto', 'relative' => true)); + JHtml::_('script', 'system/repeatable.js', array('framework' => true, 'version' => 'auto', 'relative' => true)); + + $javascript = 'jQuery(document).ready(function($) { $("#' . $this->id . '_table tbody").sortable(); });'; + + JFactory::getDocument()->addScriptDeclaration($javascript); return implode("\n", $str); } diff --git a/libraries/joomla/form/fields/rules.php b/libraries/joomla/form/fields/rules.php index 546761d3fb7f3..bb6ec93e6c8f9 100644 --- a/libraries/joomla/form/fields/rules.php +++ b/libraries/joomla/form/fields/rules.php @@ -139,19 +139,28 @@ protected function getInput() JHtml::_('bootstrap.tooltip'); // Add Javascript for permission change - JHtml::_('script', 'media/system/js/permissions.min.js', false, false, false, false, true); + JHtml::_('script', 'system/permissions.js', array('version' => 'auto', 'relative' => true)); - // Add JText for error messages - JText::script('JLIB_RULES_REQUEST_FAILURE'); - JText::script('JLIB_RULES_SAVE_BEFORE_CHANGE_PERMISSIONS'); - JText::script('JLIB_RULES_REQUEST_FAILURE'); - JText::script('JLIB_RULES_NOT_ALLOWED'); - JText::script('JLIB_RULES_ALLOWED'); + // Load JavaScript message titles + JText::script('ERROR'); + JText::script('WARNING'); + JText::script('NOTICE'); + JText::script('MESSAGE'); + + // Add strings for JavaScript error translations. + JText::script('JLIB_JS_AJAX_ERROR_CONNECTION_ABORT'); + JText::script('JLIB_JS_AJAX_ERROR_NO_CONTENT'); + JText::script('JLIB_JS_AJAX_ERROR_OTHER'); + JText::script('JLIB_JS_AJAX_ERROR_PARSE'); + JText::script('JLIB_JS_AJAX_ERROR_TIMEOUT'); // Initialise some field attributes. - $section = $this->section; - $component = $this->component; + $section = $this->section; $assetField = $this->assetField; + $component = empty($this->component) ? 'root.1' : $this->component; + + // Current view is global config? + $isGlobalConfig = $component === 'root.1'; // Get the actions for the asset. $actions = JAccess::getActions($component, $section); @@ -161,38 +170,69 @@ protected function getInput() { if ($el->getName() == 'action') { - $actions[] = (object) array('name' => (string) $el['name'], 'title' => (string) $el['title'], - 'description' => (string) $el['description']); + $actions[] = (object) array( + 'name' => (string) $el['name'], + 'title' => (string) $el['title'], + 'description' => (string) $el['description'], + ); } } - // Get the explicit rules for this asset. - if ($section == 'component') + // Get the asset id. + // Note that for global configuration, com_config injects asset_id = 1 into the form. + $assetId = $this->form->getValue($assetField); + $newItem = empty($assetId) && $isGlobalConfig === false && $section !== 'component'; + $parentAssetId = null; + + // If the asset id is empty (component or new item). + if (empty($assetId)) { - // Need to find the asset id by the name of the component. + // Get the component asset id as fallback. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $assetId = (int) $db->loadResult(); + + /** + * @to do: incorrect info + * When creating a new item (not saving) it uses the calculated permissions from the component (item <-> component <-> global config). + * But if we have a section too (item <-> section(s) <-> component <-> global config) this is not correct. + * Also, currently it uses the component permission, but should use the calculated permissions for achild of the component/section. + */ } - else + + // If not in global config we need the parent_id asset to calculate permissions. + if (!$isGlobalConfig) { - // Find the asset id of the content. - // Note that for global configuration, com_config injects asset_id = 1 into the form. - $assetId = $this->form->getValue($assetField); + // In this case we need to get the component rules too. + $db = JFactory::getDbo(); + + $query = $db->getQuery(true) + ->select($db->quoteName('parent_id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('id') . ' = ' . $assetId); + + $db->setQuery($query); + + $parentAssetId = (int) $db->loadResult(); } // Full width format. // Get the rules for just this asset (non-recursive). - $assetRules = JAccess::getAssetRules($assetId); + $assetRules = JAccess::getAssetRules($assetId, false, false); // Get the available user groups. $groups = $this->getUserGroups(); + // Ajax request data. + $ajaxUri = JRoute::_('index.php?option=com_config&task=config.store&format=json&' . JSession::getFormToken() . '=1'); + // Prepare output $html = array(); @@ -200,7 +240,7 @@ protected function getInput() $html[] = '

    ' . JText::_('JLIB_RULES_SETTINGS_DESC') . '

    '; // Begin tabs - $html[] = '
    '; + $html[] = '
    '; // Building tab nav $html[] = '
    "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ht,[g,ge,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('
    '),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Ot,[_e,Pt,Ht,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(It,[Lt,Ot],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(Wt,[Ae],function(e){function t(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Vt,[Ae,Ce,fe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Ut,[Ae],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
    '}})}),r($t,[Lt,fe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(qt,[St],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(jt,[we,g,fe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Yt,[Ae,m,fe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Xt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,M,L,P,H,I,F,j,Y,J,Q,re,ie,oe,ae,le,ue,de,me,ge,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Me,He,Ie,Ge,Je,Qe,Ze,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Mt,Lt,Pt,Ht,Ot,It,Ft,zt,Wt,Vt,Ut,$t,qt,jt,Yt])}(this); \ No newline at end of file +// 4.4.3 (2016-09-01) +!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;i=r.x&&o.x+o.w<=r.w+r.x&&o.y>=r.y&&o.y+o.h<=r.h+r.y)return i[a];return null}function n(e,t,n){return o(e.x-t,e.y-n,e.w+2*t,e.h+2*n)}function r(e,t){var n,r,i,a;return n=l(e.x,t.x),r=l(e.y,t.y),i=s(e.x+e.w,t.x+t.w),a=s(e.y+e.h,t.y+t.h),0>i-n||0>a-r?null:o(n,r,i-n,a-r)}function i(e,t,n){var r,i,a,s,c,u,d,f,h,p;return c=e.x,u=e.y,d=e.x+e.w,f=e.y+e.h,h=t.x+t.w,p=t.y+t.h,r=l(0,t.x-c),i=l(0,t.y-u),a=l(0,d-h),s=l(0,f-p),c+=r,u+=i,n&&(d+=r,f+=i,c-=a,u-=s),d-=a,f-=s,o(c,u,d-c,f-u)}function o(e,t,n,r){return{x:e,y:t,w:n,h:r}}function a(e){return o(e.left,e.top,e.width,e.height)}var s=Math.min,l=Math.max,c=Math.round;return{inflate:n,relativePosition:e,findBestRelativePosition:t,intersect:r,clamp:i,create:o,fromClientRect:a}}),r(c,[],function(){function e(e,t){return function(){e.apply(t,arguments)}}function t(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(t,e(r,this),e(i,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(i){return void e.reject(i)}e.resolve(r)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void s(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,o.call(this)}catch(a){i.call(this,a)}}function i(e){this._state=!1,this._value=e,o.call(this)}function o(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function s(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(i){if(r)return;r=!0,n(i)}}if(window.Promise)return window.Promise;var l=t.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,r){var i=this;return new t(function(t,o){n.call(i,new a(e,r,t,o))})},t.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new t(function(t,n){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},n)}e[o]=a,0===--i&&t(e)}catch(l){n(l)}}if(0===e.length)return t([]);for(var i=e.length,o=0;or;r++)e[r].then(t,n)})},t}),r(u,[c],function(e){function t(e,t){function n(e){window.setTimeout(e,0)}var r,i=window.requestAnimationFrame,o=["ms","moz","webkit"];for(r=0;r=534;return{opera:r,webkit:i,ie:o,gecko:l,mac:c,iOS:u,android:d,contentEditable:g,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=o,range:window.getSelection&&"Range"in window,documentMode:o&&!s?document.documentMode||7:10,fileApi:f,ceFalse:o===!1||o>8,canHaveCSP:o===!1||o>11,desktop:!h&&!p,windowsPhone:m}}),r(f,[u,d],function(e,t){function n(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)}function r(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)}function i(e,t){var n,r=t;return n=e.path,n&&n.length>0&&(r=n[0]),e.deepPath&&(n=e.deepPath(),n&&n.length>0&&(r=n[0])),r}function o(e,n){function r(){return!1}function o(){return!0}var a,s=n||{},l;for(a in e)u[a]||(s[a]=e[a]);if(s.target||(s.target=s.srcElement||document),t.experimentalShadowDom&&(s.target=i(e,s.target)),e&&c.test(e.type)&&e.pageX===l&&e.clientX!==l){var d=s.target.ownerDocument||document,f=d.documentElement,h=d.body;s.pageX=e.clientX+(f&&f.scrollLeft||h&&h.scrollLeft||0)-(f&&f.clientLeft||h&&h.clientLeft||0),s.pageY=e.clientY+(f&&f.scrollTop||h&&h.scrollTop||0)-(f&&f.clientTop||h&&h.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=o,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=o,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=o,s.stopPropagation()},s.isDefaultPrevented||(s.isDefaultPrevented=r,s.isPropagationStopped=r,s.isImmediatePropagationStopped=r),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s}function a(t,i,o){function a(){o.domLoaded||(o.domLoaded=!0,i(u))}function s(){("complete"===c.readyState||"interactive"===c.readyState&&c.body)&&(r(c,"readystatechange",s),a())}function l(){try{c.documentElement.doScroll("left")}catch(t){return void e.setTimeout(l)}a()}var c=t.document,u={type:"ready"};return o.domLoaded?void i(u):(c.addEventListener?"complete"===c.readyState?a():n(t,"DOMContentLoaded",a):(n(c,"readystatechange",s),c.documentElement.doScroll&&t.self===t.top&&l()),void n(t,"load",a))}function s(){function e(e,t){var n,r,o,a,s=i[t];if(n=s&&s[e.type])for(r=0,o=n.length;o>r;r++)if(a=n[r],a&&a.func.call(a.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var t=this,i={},s,c,u,d,f;c=l+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},s=1,t.domLoaded=!1,t.events=i,t.bind=function(r,l,h,p){function m(t){e(o(t||N.event),g)}var g,v,y,b,C,x,w,N=window;if(r&&3!==r.nodeType&&8!==r.nodeType){for(r[c]?g=r[c]:(g=s++,r[c]=g,i[g]={}),p=p||r,l=l.split(" "),y=l.length;y--;)b=l[y],x=m,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),t.domLoaded&&"ready"===b&&"complete"==r.readyState?h.call(p,o({type:b})):(d||(C=f[b],C&&(x=function(t){var n,r;if(n=t.currentTarget,r=t.relatedTarget,r&&n.contains)r=n.contains(r);else for(;r&&r!==n;)r=r.parentNode;r||(t=o(t||N.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=n,e(t,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(t){t=o(t||N.event),t.type="focus"===t.type?"focusin":"focusout",e(t,g)}),v=i[g][b],v?"ready"===b&&t.domLoaded?h({type:b}):v.push({func:h,scope:p}):(i[g][b]=v=[{func:h,scope:p}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?a(r,x,t):n(r,C||b,x,w)));return r=v=0,h}},t.unbind=function(e,n,o){var a,s,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return t;if(a=e[c]){if(f=i[a],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],s=f[d]){if(o)for(u=s.length;u--;)if(s[u].func===o){var h=s.nativeHandler,p=s.fakeName,m=s.capture;s=s.slice(0,u).concat(s.slice(u+1)),s.nativeHandler=h,s.fakeName=p,s.capture=m,f[d]=s}o&&0!==s.length||(delete f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture))}}else{for(d in f)s=f[d],r(e,s.fakeName||d,s.nativeHandler,s.capture);f={}}for(d in f)return t;delete i[a];try{delete e[c]}catch(g){e[c]=null}}return t},t.fire=function(n,r,i){var a;if(!n||3===n.nodeType||8===n.nodeType)return t;i=o(null,i),i.type=r,i.target=n;do a=n[c],a&&e(i,a),n=n.parentNode||n.ownerDocument||n.defaultView||n.parentWindow;while(n&&!i.isPropagationStopped());return t},t.clean=function(e){var n,r,i=t.unbind;if(!e||3===e.nodeType||8===e.nodeType)return t;if(e[c]&&i(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(i(e),r=e.getElementsByTagName("*"),n=r.length;n--;)e=r[n],e[c]&&i(e);return t},t.destroy=function(){i={}},t.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var l="mce-data-",c=/^(?:mouse|contextmenu)|click/,u={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1};return s.Event=new s,s.Event.bind(window,"ready",function(){}),s}),r(h,[],function(){function e(e,t,n,r){var i,o,a,s,l,c,d,h,p,m;if((t?t.ownerDocument||t:z)!==D&&B(t),t=t||D,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!r){if(i=ve.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&x.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(x.qsa&&(!P||!P.test(e))){if(h=d=F,p=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=_(e),(d=t.getAttribute("id"))?h=d.replace(be,"\\$&"):t.setAttribute("id",h),h="[id='"+h+"'] ",l=c.length;l--;)c[l]=h+f(c[l]);p=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return Z.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{d||t.removeAttribute("id")}}}return k(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[F]=!0,e}function i(e){var t=D.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=e.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e){return e&&typeof e.getElementsByTagName!==Y&&e}function d(){}function f(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=W++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c=[U,o];if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(l=t[F]||(t[F]={}),(s=l[r])&&s[0]===U&&s[1]===o)return c[2]=s[2];if(l[r]=c,c[2]=e(t,n,a))return!0}}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function v(e,t,n,i,o,a){return i&&!i[F]&&(i=v(i)),o&&!o[F]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,f=[],h=[],p=a.length,v=r||m(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,f,e,s,l),b=n?o||(r?e:p||i)?[]:a:y;if(n&&n(y,b,s,l),i)for(c=g(b,h),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[h[u]]=!(y[h[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?te.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=g(b===a?b.splice(p,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function y(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return te.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=w.relative[e[s].type])u=[h(p(u),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return v(s>1&&p(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&f(e))}u.push(n)}return p(u)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,c){var u,d,f,h=0,p="0",m=r&&[],v=[],y=T,b=r||o&&w.find.TAG("*",c),C=U+=null==y?1:Math.random()||.1,x=b.length;for(c&&(T=a!==D&&a);p!==x&&null!=(u=b[p]);p++){if(o&&u){for(d=0;f=t[d++];)if(f(u,a,s)){l.push(u);break}c&&(U=C)}i&&((u=!f&&u)&&h--,r&&m.push(u))}if(h+=p,i&&p!==h){for(d=0;f=n[d++];)f(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(l));v=g(v)}Z.apply(l,v),c&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(l)}return c&&(U=C,T=y),m};return i?r(a):a}var C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F="sizzle"+-new Date,z=window.document,U=0,W=0,V=n(),$=n(),q=n(),j=function(e,t){return e===t&&(A=!0),0},Y=typeof t,X=1<<31,K={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,Z=G.push,ee=G.slice,te=G.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},ne="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",re="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",oe="\\["+re+"*("+ie+")(?:"+re+"*([*^$|!~]?=)"+re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+re+"*\\]",ae=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",se=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g"),le=new RegExp("^"+re+"*,"+re+"*"),ce=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),ue=new RegExp("="+re+"*([^\\]'\"]*?)"+re+"*\\]","g"),de=new RegExp(ae),fe=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ne+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+re+"?|("+re+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Z.apply(G=ee.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(we){Z={apply:G.length?function(e,t){Q.apply(e,ee.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=e.support={},E=e.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},B=e.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:z,o=r.defaultView;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,L=r.documentElement,M=!E(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){B()},!1):o.attachEvent&&o.attachEvent("onunload",function(){B()})),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ge.test(r.getElementsByClassName),x.getById=i(function(e){return L.appendChild(e).id=F,!r.getElementsByName||!r.getElementsByName(F).length}),x.getById?(w.find.ID=function(e,t){if(typeof t.getElementById!==Y&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){return e.getAttribute("id")===t}}):(delete w.find.ID,w.filter.ID=function(e){var t=e.replace(Ce,xe);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),w.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=x.getElementsByClassName&&function(e,t){return M?t.getElementsByClassName(e):void 0},O=[],P=[],(x.qsa=ge.test(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+re+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+re+"*(?:value|"+ne+")"),e.querySelectorAll(":checked").length||P.push(":checked")}),i(function(e){var t=r.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+re+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(x.matchesSelector=ge.test(H=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){x.disconnectedMatch=H.call(e,"div"),H.call(e,"[s!='']:x"),O.push("!=",ae)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),n=ge.test(L.compareDocumentPosition),I=n||ge.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=n?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===z&&I(z,e)?-1:t===r||t.ownerDocument===z&&I(z,t)?1:R?te.call(R,e)-te.call(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:R?te.call(R,e)-te.call(R,t):0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===z?-1:c[i]===z?1:0},r):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&B(t),n=n.replace(ue,"='$1']"),x.matchesSelector&&M&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var r=H.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,D,null,[t]).length>0},e.contains=function(e,t){return(e.ownerDocument||e)!==D&&B(e),I(e,t)},e.attr=function(e,n){(e.ownerDocument||e)!==D&&B(e);var r=w.attrHandle[n.toLowerCase()],i=r&&K.call(w.attrHandle,n.toLowerCase())?r(e,n,!M):t;return i!==t?i:x.attributes||!M?e.getAttribute(n):(i=e.getAttributeNode(n))&&i.specified?i.value:null},e.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},e.uniqueSort=function(e){var t,n=[],r=0,i=0;if(A=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(j),A){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},N=e.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=N(t);return n},w=e.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=_(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+re+")"+e+"("+re+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,h,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(u=g[F]||(g[F]={}),c=u[e]||[],h=c[0]===U&&c[1],f=c[0]===U&&c[2],d=h&&g.childNodes[h];d=++h&&d&&d[m]||(f=h=0)||p.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[U,h,f];break}}else if(y&&(c=(t[F]||(t[F]={}))[e])&&c[0]===U)f=c[1];else for(;(d=++h&&d&&d[m]||(f=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[F]||(d[F]={}))[e]=[U,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(t,n){var i,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(i=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=te.call(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(se,"$1"));return i[F]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(e){return e=e.replace(Ce,xe),function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(t){return fe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(Ce,xe).toLowerCase(),function(e){var n;do if(n=M?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&x.getById&&9===t.nodeType&&M&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(Ce,xe),t)||[])[0], +!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((l=w.find[s])&&(r=l(a.matches[0].replace(Ce,xe),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&f(o),!e)return Z.apply(n,r),n;break}}return(c||S(e,d))(r,t,!M,n,ye.test(e)&&u(t.parentNode)||t),n},x.sortStable=F.split("").sort(j).join("")===F,x.detectDuplicates=!!A,B(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(ne,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),e}),r(p,[],function(){function e(e){var t=e,n,r;if(!u(e))for(t=[],n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function n(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function r(e,t){var r=[];return n(e,function(n,i){r.push(t(n,i,e))}),r}function i(e,t){var r=[];return n(e,function(n,i){t&&!t(n,i,e)||r.push(n)}),r}function o(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function a(e,t,n,r){var i=0;for(arguments.length<3&&(n=e[0]);ir;r++)if(t.call(n,e[r],r,e))return r;return-1}function l(e,n,r){var i=s(e,n,r);return-1!==i?e[i]:t}function c(e){return e[e.length-1]}var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{isArray:u,toArray:e,each:n,map:r,filter:i,indexOf:o,reduce:a,findIndex:s,find:l,last:c}}),r(m,[d,p],function(e,n){function r(e){return null===e||e===t?"":(""+e).replace(h,"")}function i(e,r){return r?"array"==r&&n.isArray(e)?!0:typeof e==r:e!==t}function o(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function a(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],c?o[a]=function(){return i[s].apply(this,arguments)}:o[a]=function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function s(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function l(e,t,r,i){i=i||this,e&&(r&&(e=e[r]),n.each(e,function(e,n){return t.call(i,e,n,r)===!1?!1:void l(e,t,r,i)}))}function c(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function d(e,t){return!e||i(e,"array")?e:n.map(e.split(t||","),r)}function f(t){var n=e.cacheSuffix;return n&&(t+=(-1===t.indexOf("?")?"?":"&")+n),t}var h=/^\s*|\s*$/g;return{trim:r,isArray:n.isArray,is:i,toArray:n.toArray,makeMap:o,each:n.each,map:n.map,grep:n.filter,inArray:n.indexOf,extend:s,create:a,walk:l,createNS:c,resolve:u,explode:d,_addCacheSuffix:f}}),r(g,[f,h,m,d],function(e,n,r,i){function o(e){return"undefined"!=typeof e}function a(e){return"string"==typeof e}function s(e){return e&&e==e.window}function l(e,t){var n,r,i;for(t=t||w,i=t.createElement("div"),n=t.createDocumentFragment(),i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return n}function c(e,t,n,r){var i;if(a(t))t=l(t,v(e[0]));else if(t.length&&!t.nodeType){if(t=f.makeArray(t),r)for(i=t.length-1;i>=0;i--)c(e,t[i],n,r);else for(i=0;ii&&(a=e[i],t.call(a,i,a)!==!1);i++);return e}function g(e,t){var n=[];return m(e,function(e,r){t(r,e)&&n.push(r)}),n}function v(e){return e?9==e.nodeType?e:e.ownerDocument:w}function y(e,n,r){var i=[],o=e[n];for("string"!=typeof r&&r instanceof f&&(r=r[0]);o&&9!==o.nodeType;){if(r!==t){if(o===r)break;if("string"==typeof r&&f(o).is(r))break}1===o.nodeType&&i.push(o),o=o[n]}return i}function b(e,n,r,i){var o=[];for(i instanceof f&&(i=i[0]);e;e=e[n])if(!r||e.nodeType===r){if(i!==t){if(e===i)break;if("string"==typeof i&&f(e).is(i))break}o.push(e)}return o}function C(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType==n)return e;return null}function x(e,t,n){m(n,function(n,r){e[n]=e[n]||{},e[n][t]=r})}var w=document,N=Array.prototype.push,E=Array.prototype.slice,_=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,S=e.Event,k,T=r.makeMap("children,contents,next,prev"),R=r.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),A=r.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),B={"for":"htmlFor","class":"className",readonly:"readOnly"},D={"float":"cssFloat"},L={},M={},P=/^\s*|\s*$/g;return f.fn=f.prototype={constructor:f,selector:"",context:null,length:0,init:function(e,t){var n=this,r,i;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(t&&t.nodeType)n.context=t;else{if(t)return f(e).attr(t);n.context=t=document}if(a(e)){if(n.selector=e,r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:_.exec(e),!r)return f(t).find(e);if(r[1])for(i=l(e,v(t)).firstChild;i;)N.call(n,i),i=i.nextSibling;else{if(i=v(t).getElementById(r[2]),!i)return n;if(i.id!==r[2])return n.find(e);n.length=1,n[0]=i}}else this.add(e,!1);return n},toArray:function(){return r.toArray(this)},add:function(e,t){var n=this,r,i;if(a(e))return n.add(f(e));if(t!==!1)for(r=f.unique(n.toArray().concat(f.makeArray(e))),n.length=r.length,i=0;it;t++)f.find(e,this[t],r);return f(r)},filter:function(e){return f("function"==typeof e?g(this.toArray(),function(t,n){return e(n,t)}):f.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof f&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&f(r).is(e)){t.push(r);break}if(r==e){t.push(r);break}r=r.parentNode}}),f(t)},offset:function(e){var t,n,r,i=0,o=0,a;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(a=t.getBoundingClientRect(),i=a.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,o=a.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:o})},push:N,sort:[].sort,splice:[].splice},r.extend(f,{extend:r.extend,makeArray:function(e){return s(e)||e.nodeType?[e]:r.toArray(e)},inArray:h,isArray:r.isArray,each:m,trim:p,grep:g,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,contains:n.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!=t[r].nodeType&&t.splice(r,1);return t=1===t.length?f.find.matchesSelector(t[0],e)?[t[0]]:[]:f.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return y(e,"parentNode")},next:function(e){return C(e,"nextSibling",1)},prev:function(e){return C(e,"previousSibling",1)},children:function(e){return b(e.firstChild,"nextSibling",1)},contents:function(e){return r.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){f.fn[e]=function(n){var r=this,i=[];return r.each(function(){var e=t.call(i,this,n,i);e&&(f.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(T[e]||(i=f.unique(i)),0===e.indexOf("parents")&&(i=i.reverse())),i=f(i),n?i.filter(n):i}}),m({parentsUntil:function(e,t){return y(e,"parentNode",t)},nextUntil:function(e,t){return b(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return b(e,"previousSibling",1,t).slice(1)}},function(e,t){f.fn[e]=function(n,r){var i=this,o=[];return i.each(function(){var e=t.call(o,this,n,o);e&&(f.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=f.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse())),o=f(o),r?o.filter(r):o}}),f.fn.is=function(e){return!!e&&this.filter(e).length>0},f.fn.init.prototype=f.fn,f.overrideDefaults=function(e){function t(r,i){return n=n||e(),0===arguments.length&&(r=n.element),i||(i=n.context),new t.fn.init(r,i)}var n;return f.extend(t,this),t},i.ie&&i.ie<8&&(x(L,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?k:t},size:function(e){var t=e.size;return 20===t?k:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?k:t}}),x(L,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),i.ie&&i.ie<9&&(D["float"]="styleFloat",x(M,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),f.attrHooks=L,f.cssHooks=M,f}),r(v,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d,f,h="\ufeff";for(e=e||{},t&&(d=t.getValidStyles(),f=t.getInvalidStyles()),u=("\\\" \\' \\; \\: ; : "+h).split(" "),l=0;l-1&&n||(m[e+t]=-1==l?s[0]:s.join(" "),delete m[e+"-top"+t],delete m[e+"-right"+t],delete m[e+"-bottom"+t],delete m[e+"-left"+t])}}function u(e){var t=m[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return m[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(m[e]=m[t]+" "+m[n]+" "+m[r],delete m[t],delete m[n],delete m[r])}function f(e){return b=!0,c[e]}function h(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function p(t,n,r,i,o,a){if(o=o||a)return o=h(o),"'"+o.replace(/\'/g,"\\'")+"'";if(n=h(n||r||i),!e.allow_script_urls){var s=n.replace(/[\s\r\n]+/,"");if(/(java|vb)script:/i.test(s))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(s))return""}return C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"}var m={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),y=y.replace(/\\[0-9a-f]+/g,function(e){return String.fromCharCode(parseInt(e.substr(1),16))}),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(|\/\*|\*\//.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":"color"!==v&&"background-color"!==v||(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,p),m[v]=b?h(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(e,t){function n(t){var n,r,o,a;if(n=d[t])for(r=0,o=n.length;o>r;r++)t=n[r],a=e[t],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+t+": "+a+";")}function r(e,t){var n;return n=f["*"],n&&n[e]?!1:(n=f[t],!n||!n[e])}var i="",o,a;if(t&&d)n("*"),n(t);else for(o in e)a=e[o],a!==s&&a.length>0&&(f&&!r(o,t)||(i+=(i.length>0?" ":"")+o+": "+a+";"));return i}}}}),r(y,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}function r(e,n,r,i){var o,a,s;if(e){if(o=e[r],t&&o===t)return;if(o){if(!i)for(s=o[n];s;s=s[n])if(!s[n])return s;return o}if(a=e.parentNode,a&&a!==t)return a}}var i=e;this.current=function(){return i},this.next=function(e){return i=n(i,"firstChild","nextSibling",e)},this.prev=function(e){return i=n(i,"lastChild","previousSibling",e)},this.prev2=function(e){return i=r(i,"lastChild","previousSibling",e)}}}),r(b,[m],function(e){function t(n){function r(){return P.createDocumentFragment()}function i(e,t){N(F,e,t)}function o(e,t){N(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[V]=M[W],M[$]=M[U]):(M[W]=M[V],M[U]=M[$]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function h(e,t){var n=M[W],r=M[U],i=M[V],o=M[$],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function p(){E(I)}function m(){return E(O)}function g(){return E(H)}function v(e){var t=this[W],r=this[U],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return q(new t(n),{startContainer:M[W],startOffset:M[U],endContainer:M[V],endOffset:M[$],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[W]==M[V]&&M[U]==M[$]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function N(e,t,r){var i,o;for(e?(M[W]=t,M[U]=r):(M[V]=t,M[$]=r),i=M[V];i.parentNode;)i=i.parentNode;for(o=M[W];o.parentNode;)o=o.parentNode;o==i?w(M[W],M[U],M[V],M[$])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[W],M[V])}function E(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[W]==M[V])return _(e);for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[W])return S(t,e);++n}for(t=M[W],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return k(t,e);++r}for(o=r-n,a=M[W];o>0;)a=a.parentNode,o--;for(s=M[V];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function _(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[U]==M[$])return t;if(3==M[W].nodeType){if(n=M[W].nodeValue,i=n.substring(M[U],M[$]),e!=H&&(o=M[W],c=M[U],u=M[$]-M[U],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(P.createTextNode(i)),t}for(o=C(M[W],M[U]),a=M[$]-M[U];o&&a>0;)s=o.nextSibling,l=D(o,e),t&&t.appendChild(l),--a,o=s;return e!=H&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[U],0>=a)return t!=H&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=D(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=H&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[$]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=D(o,t),n&&n.appendChild(l),--a,o=s;return t!=H&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=D(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=H&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[V],M[$]-1),r,i,o,a,s,l=n!=M[V];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[W],M[U]),r=n!=M[W],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return D(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[U],a=o.substring(l),s=o.substring(0,l)):(l=M[$],a=o.substring(0,l),s=o.substring(l)),i!=H&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function D(e,t){return t!=I?t==H?n.clone(e,F):e:void e.parentNode.removeChild(e)}function L(){return n.create("body",null,g()).outerText}var M=this,P=n.doc,O=0,H=1,I=2,F=!0,z=!1,U="startOffset",W="startContainer",V="endContainer",$="endOffset",q=e.extend,j=n.nodeIndex;return q(M,{startContainer:P,startOffset:0,endContainer:P,endOffset:0,collapsed:F,commonAncestorContainer:P,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:h,deleteContents:p,extractContents:m,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:L}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(C,[m],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n){return n?(n="x"===n.charAt(0).toLowerCase()?parseInt(n.substr(1),16):parseInt(n,10),n>65535?(n-=65536,String.fromCharCode(55296+(n>>10),56320+(1023&n))):d[n]||String.fromCharCode(n)):a[e]||i[e]||t(e)})}};return f}),r(x,[m,u],function(e,t){return function(n,r){function i(e){n.getElementsByTagName("head")[0].appendChild(e)}function o(r,o,c){function u(){for(var e=b.passed,t=e.length;t--;)e[t]();b.status=2,b.passed=[],b.failed=[]}function d(){for(var e=b.failed,t=e.length;t--;)e[t]();b.status=3,b.passed=[],b.failed=[]}function f(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function h(e,n){e()||((new Date).getTime()-y0)return v=n.createElement("style"),v.textContent='@import "'+r+'"',m(),void i(v);p()}i(g),g.href=r}}var a=0,s={},l;r=r||{},l=r.maxLoadTime||5e3,this.load=o}}),r(w,[h,g,v,f,y,b,C,d,m,x],function(e,n,r,i,o,a,s,l,c,u){function d(e,t){var n={},r=t.keep_values,i;return i={set:function(n,r,i){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||e,r,i,n[0])),n.attr("data-mce-"+i,r).attr(i,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},n={style:{set:function(e,t){return null!==t&&"object"==typeof t?void e.css(t):(r&&e.attr("data-mce-style",t),void e.attr("style",t))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serializeStyle(e.parseStyle(n),t[0].nodeName)}}},r&&(n.href=n.src=i),n}function f(e,t){var n=t.attr("style");n=e.serializeStyle(e.parseStyle(n),t[0].nodeName),n||(n=null),t.attr("data-mce-style",n)}function h(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n}function p(e,t){var o=this,a;o.doc=e,o.win=window,o.files={},o.counter=0,o.stdMode=!b||e.documentMode>=8,o.boxModel=!b||"CSS1Compat"==e.compatMode||o.stdMode,o.styleSheetLoader=new u(e),o.boundEvents=[],o.settings=t=t||{},o.schema=t.schema,o.styles=new r({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),o.fixDoc(e),o.events=t.ownEvents?new i(t.proxy):i.Event,o.attrHooks=d(o,t),a=t.schema?t.schema.getBlockElements():{},o.$=n.overrideDefaults(function(){return{context:e,element:o.getRoot()}}),o.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!a[e.nodeName]):!!a[e]}}var m=c.each,g=c.is,v=c.grep,y=c.trim,b=l.ie,C=/^([a-z0-9],?)+$/i,x=/^[ \t\r\n]*$/;return p.prototype={$$:function(e){return"string"==typeof e&&(e=this.get(e)),this.$(e)},root:null,fixDoc:function(e){var t=this.settings,n;if(b&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!b||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.settings.root_element||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),g(n,"string")&&(a=n, +n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.settings.root_element||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(C.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=g(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&"undefined"!=typeof t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return e=this.$$(e),t?e.each(function(){for(var e;e=this.firstChild;)3==e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():e.remove(),e.length>1?e.toArray():e[0]},setStyle:function(e,t,n){e=this.$$(e).css(t,n),this.settings.update_styles&&f(this,e)},getStyle:function(e,n,r){return e=this.$$(e),r?e.css(n):(n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=l.ie&&l.ie<12?"styleFloat":"cssFloat"),e[0]&&e[0].style?e[0].style[n]:t)},setStyles:function(e,t){e=this.$$(e).css(t),this.settings.update_styles&&f(this,e)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this,i,o,a=r.settings;""===n&&(n=null),e=r.$$(e),i=e.attr(t),e.length&&(o=r.attrHooks[t],o&&o.set?o.set(e,n,t):e.attr(t,n),i!=n&&a.onSetAttrib&&a.onSetAttrib({attrElm:e,attrName:t,attrValue:n}))},setAttribs:function(e,t){var n=this;n.$$(e).each(function(e,r){m(t,function(e,t){n.setAttrib(r,t,e)})})},getAttrib:function(e,t,n){var r=this,i,o;return e=r.$$(e),e.length&&(i=r.attrHooks[t],o=i&&i.get?i.get(e,t):e.attr(t)),"undefined"==typeof o&&(o=n||""),o},getPos:function(e,t){var r=this,i=0,o=0,a,s=r.doc,l=s.body,c;if(e=r.get(e),t=t||l,e){if(t===l&&e.getBoundingClientRect&&"static"===n(l).css("position"))return c=e.getBoundingClientRect(),t=r.boxModel?s.documentElement:l,i=c.left+(s.documentElement.scrollLeft||l.scrollLeft)-t.clientLeft,o=c.top+(s.documentElement.scrollTop||l.scrollTop)-t.clientTop,{x:i,y:o};for(a=e;a&&a!=t&&a.nodeType;)i+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=e.parentNode;a&&a!=t&&a.nodeType;)i-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode}return{x:i,y:o}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==p.DOM&&n===document){var o=p.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,p.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==p.DOM&&n===document?void p.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void m(e.split(","),function(e){var i;e=c._addCacheSuffix(e),t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),b&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){this.$$(e).addClass(t)},removeClass:function(e,t){this.toggleClass(e,t,!1)},hasClass:function(e,t){return this.$$(e).hasClass(t)},toggleClass:function(e,t,r){this.$$(e).toggleClass(t,r).each(function(){""===this.className&&n(this).attr("class",null)})},show:function(e){this.$$(e).show()},hide:function(e){this.$$(e).hide()},isHidden:function(e){return"none"==this.$$(e).css("display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){e=this.$$(e),b?e.each(function(e,r){if(r.canHaveHTML!==!1){for(;r.firstChild;)r.removeChild(r.firstChild);try{r.innerHTML="
    "+t,r.removeChild(r.firstChild)}catch(i){n("
    ").html("
    "+t).contents().slice(1).appendTo(r)}return t}}):e.html(t)},getOuterHTML:function(e){return e=this.get(e),1==e.nodeType&&"outerHTML"in e?e.outerHTML:n("
    ").append(n(e).clone()).html()},setOuterHTML:function(e,t){var r=this;r.$$(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}r.remove(n(this).html(t),!0)})},decode:s.decode,encode:s.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return g(t,"array")&&(e=e.cloneNode(!0)),n&&m(v(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),m(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(c.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],m(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(b){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,i,a,s,l,c=0;if(e=e.firstChild){s=new o(e,e.parentNode),t=t||(n.schema?n.schema.getNonEmptyElements():null);do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(i=n.getAttribs(e),r=i.length;r--;)if(l=i[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!x.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new a(this)},nodeIndex:h,split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=y(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.insertBefore(n,e):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(c.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(c.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return e&&1==e.nodeType?(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null):null},getContentEditableParent:function(e){for(var t=this.getRoot(),n=null;e&&e!==t&&(n=this.getContentEditable(e),null===n);e=e.parentNode);return n},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},p.DOM=new p(document),p.nodeIndex=h,p}),r(N,[w,m],function(e,t){function n(){function e(e,n){function i(){a.remove(l),s&&(s.onreadystatechange=s.onload=s=null),n()}function o(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var a=r,s,l;l=a.uniqueId(),s=document.createElement("script"),s.id=l,s.type="text/javascript",s.src=t._addCacheSuffix(e),"onreadystatechange"in s?s.onreadystatechange=function(){/loaded|complete/.test(s.readyState)&&i()}:s.onload=i,s.onerror=o,(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}var n=0,a=1,s=2,l={},c=[],u={},d=[],f=0,h;this.isDone=function(e){return l[e]==s},this.markDone=function(e){l[e]=s},this.add=this.load=function(e,t,r){var i=l[e];i==h&&(c.push(e),l[e]=n),t&&(u[e]||(u[e]=[]),u[e].push({func:t,scope:r||this}))},this.remove=function(e){delete l[e],delete u[e]},this.loadQueue=function(e,t){this.loadScripts(c,e,t)},this.loadScripts=function(t,n,r){function c(e){i(u[e],function(e){e.func.call(e.scope)}),u[e]=h}var p;d.push({func:n,scope:r||this}),(p=function(){var n=o(t);t.length=0,i(n,function(t){return l[t]==s?void c(t):void(l[t]!=a&&(l[t]=a,f++,e(t,function(){l[t]=s,f--,c(t),p()})))}),f||(i(d,function(e){e.func.call(e.scope)}),d.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(E,[N,m],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){var i=r.language;if(i&&r.languageLoad!==!1){if(n)if(n=","+n+",",-1!=n.indexOf(","+i.substr(0,2)+","))i=i.substr(0,2);else if(-1==n.indexOf(","+i+","))return;e.ScriptLoader.add(this.urls[t]+"/langs/"+i+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},remove:function(e){delete this.urls[e],delete this.lookup[e]},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&(s?a.call(s):a.call(e))}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(_,[],function(){function e(e){return function(t){return!!t&&t.nodeType==e}}function t(e){return e=e.toLowerCase().split(" "),function(t){var n,r;if(t&&t.nodeType)for(r=t.nodeName.toLowerCase(),n=0;nn.length-1?t=n.length-1:0>t&&(t=0),n[t]||e}function a(e){this.walk=function(t,n){function r(e){var t;return t=e[0],3===t.nodeType&&t===c&&u>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===f&&e.length>0&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e}function i(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,o){var a=o?"nextSibling":"previousSibling";for(g=e,v=g.parentNode;g&&g!=t;g=v)v=g.parentNode,y=i(g==e?g:g[a],a),y.length&&(o||y.reverse(),n(r(y)))}var c=t.startContainer,u=t.startOffset,d=t.endContainer,f=t.endOffset,h,p,m,g,v,y,b;if(b=e.select("td[data-mce-selected],th[data-mce-selected]"),b.length>0)return void l(b,function(e){n([e])});if(1==c.nodeType&&c.hasChildNodes()&&(c=c.childNodes[u]),1==d.nodeType&&d.hasChildNodes()&&(d=o(d,f)),c==d)return n(r([c]));for(h=e.findCommonAncestor(c,d),g=c;g;g=g.parentNode){if(g===d)return s(c,h,!0);if(g===h)break}for(g=d;g;g=g.parentNode){if(g===c)return s(d,h);if(g===h)break}p=a(c,h)||c,m=a(d,h)||d,s(c,p,!0),y=i(p==c?p:p.nextSibling,"nextSibling",m==d?m.nextSibling:m),y.length&&n(r(y)),s(d,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return h=v,p=n?v.nodeValue.length:0,void(i=!0);if(e.isBlock(v)||y[v.nodeName.toLowerCase()])return;s=v}o&&s&&(h=s,i=!0,p=0)}var h,p,m,g=e.getRoot(),v,y,b,C;if(h=n[(r?"start":"end")+"Container"],p=n[(r?"start":"end")+"Offset"],C=1==h.nodeType&&p===h.childNodes.length,y=e.schema.getNonEmptyElements(),b=r,!u(h)){if(1==h.nodeType&&p>h.childNodes.length-1&&(b=!1),9===h.nodeType&&(h=e.getRoot(),p=0),h===g){if(b&&(v=h.childNodes[p>0?p-1:0])){if(u(v))return;if(y[v.nodeName]||"TABLE"==v.nodeName)return}if(h.hasChildNodes()){if(p=Math.min(!b&&p>0?p-1:p,h.childNodes.length-1),h=h.childNodes[p],p=0,!o&&h===g.lastChild&&"TABLE"===h.nodeName)return;if(l(h)||u(h))return;if(h.hasChildNodes()&&!/TABLE/.test(h.nodeName)){v=h,m=new t(h,g);do{if(c(v)||u(v)){i=!1;break}if(3===v.nodeType&&v.nodeValue.length>0){p=b?0:v.nodeValue.length,h=v,i=!0;break}if(y[v.nodeName.toLowerCase()]&&!a(v)){p=e.nodeIndex(v),h=v.parentNode,"IMG"!=v.nodeName||b||p++,i=!0;break}}while(v=b?m.next():m.prev())}}}o&&(3===h.nodeType&&0===p&&f(!0),1===h.nodeType&&(v=h.childNodes[p],v||(v=h.childNodes[p-1]),!v||"BR"!==v.nodeName||d(v,"A")||s(v)||s(v,!0)||f(!0,v))),b&&!o&&3===h.nodeType&&p===h.nodeValue.length&&f(!1),i&&n["set"+(r?"Start":"End")](h,p)}}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}function s(t,n,r){var i,o,a;if(i=r.elementFromPoint(t,n),o=r.body.createTextRange(),i&&"HTML"!=i.tagName||(i=r.body),o.moveToElementText(i),a=e.toArray(o.getClientRects()),a=a.sort(function(e,t){return e=Math.abs(Math.max(e.top-n,e.bottom-n)),t=Math.abs(Math.max(t.top-n,t.bottom-n)),e-t}),a.length>0){n=(a[0].bottom+a[0].top)/2;try{return o.moveToPoint(t,n),o.collapse(!0),o}catch(s){}}return null}var l=e.each,c=n.isContentEditableFalse,u=i.isCaretContainer;return a.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},a.getCaretRangeFromPoint=function(e,t,n){var r,i;if(n.caretPositionFromPoint)i=n.caretPositionFromPoint(e,t),r=n.createRange(),r.setStart(i.offsetNode,i.offset),r.collapse(!0);else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(n.body.createTextRange){r=n.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(o){r=s(e,t,n)}}return r},a.getSelectedNode=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset==n+1?t.childNodes[n]:null},a.getNode=function(e,t){return 1==e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},a}),r(R,[T,d,u],function(e,t,n){return function(r){function i(e){var t,n;if(n=r.$(e).parentsUntil(r.getBody()).add(e),n.length===a.length){for(t=n.length;t>=0&&n[t]===a[t];t--);if(-1===t)return a=n,!0}return a=n,!1}var o,a=[];"onselectionchange"in r.getDoc()||r.on("NodeChange Click MouseUp KeyUp Focus",function(t){var n,i;n=r.selection.getRng(),i={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset},"nodechange"!=t.type&&e.compareRanges(i,o)||r.fire("SelectionChange"),o=i}),r.on("contextmenu",function(){r.fire("SelectionChange")}),r.on("SelectionChange",function(){var e=r.selection.getStart(!0);!t.range&&r.selection.isCollapsed()||!i(e)&&r.dom.isChildOf(e,r.getBody())&&r.nodeChanged({selectionChange:!0})}),r.on("MouseUp",function(e){e.isDefaultPrevented()||("IMG"==r.selection.getNode().nodeName?n.setEditorTimeout(r,function(){r.nodeChanged()}):r.nodeChanged())}),this.nodeChanged=function(e){var t=r.selection,n,i,o;r.initialized&&t&&!r.settings.disable_nodechange&&!r.readonly&&(o=r.getBody(),n=t.getStart()||o,n.ownerDocument==r.getDoc()&&r.dom.isChildOf(n,o)||(n=o),"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),i=[],r.dom.getParent(n,function(e){return e===o?!0:void i.push(e)}),e=e||{},e.element=n,e.parents=i,r.fire("NodeChange",e))}}}),r(A,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(B,[m],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e,t){var n={},r,i;for(r=0,i=e.length;i>r;r++)n[e[r]]=t||{};return n}var s,c,u,d=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),c=3;co;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},l,c,u,d,f,h;return i[e]?i[e]:(l=t("id accesskey class dir lang style tabindex title"),c=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),u=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(l.push.apply(l,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),c.push.apply(c,t("article aside details dialog figure header footer hgroup section nav")),u.push.apply(u,t("audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(l.push("xml:lang"),h=t("acronym applet basefont big font strike tt"),u.push.apply(u,h),s(h,function(e){n(e,"",u)}),f=t("center dir isindex noframes"),c.push.apply(c,f),d=[].concat(c,u),s(f,function(e){n(e,"",d)})),d=d||[].concat(c,u),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),n("address dt dd div caption","",d),n("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",u),n("blockquote","cite",d),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",d),n("dl","","dt dd"),n("a","href target rel media hreflang type",u),n("q","cite",u),n("ins del","cite datetime",d),n("img","src sizes srcset alt usemap ismap width height"),n("iframe","src name width height",d),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",d,"param"),n("param","name value"),n("map","name",d,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",d),n("th","colspan rowspan headers scope abbr",d),n("form","accept-charset action autocomplete enctype method name novalidate target",d),n("fieldset","disabled form name",d,"legend"),n("label","form for",u),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?d:u),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",d,"li"),n("noscript","",d),"html4"!=e&&(n("wbr"),n("ruby","",u,"rt rp"),n("figcaption","",d),n("mark rt rp summary bdi","",u),n("canvas","width height",d),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",d,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",d,"track source"),n("picture","","img source"),n("source","src srcset type media sizes"),n("track","kind src srclang label default"),n("datalist","",u,"option"),n("article section nav aside header footer","",d),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",d,"figcaption"),n("time","datetime",u),n("dialog","open",d),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",u),n("progress","value max",u),n("meter","value min max low high optimum",u),n("details","open",d,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(r("script","language xml:space"),r("style","xml:space"),r("object","declare classid code codebase codetype archive standby align border hspace vspace"),r("embed","align name hspace vspace"),r("param","valuetype type"),r("a","charset name rev shape coords"),r("br","clear"),r("applet","codebase archive code object alt name width height align hspace vspace"),r("img","name longdesc align border hspace vspace"),r("iframe","longdesc frameborder marginwidth marginheight scrolling align"),r("font basefont","size color face"),r("input","usemap align"),r("select","onchange"),r("textarea"),r("h1 h2 h3 h4 h5 h6 div p legend caption","align"),r("ul","type compact"),r("li","type"),r("ol dl menu dir","compact"),r("pre","width xml:space"),r("hr","align noshade size width"),r("isindex","prompt"),r("table","summary width frame rules cellspacing cellpadding align bgcolor"),r("col","width align char charoff valign"),r("colgroup","width align char charoff valign"),r("thead","align char charoff valign"),r("tr","align char charoff valign bgcolor"),r("th","axis align char charoff valign nowrap bgcolor width height"),r("form","accept"),r("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),r("tfoot","align char charoff valign"),r("tbody","align char charoff valign"),r("area","nohref"),r("body","background bgcolor text link vlink alink")),"html4"!=e&&(r("input button select textarea","autofocus"),r("input textarea","placeholder"),r("a","download"),r("link script img","crossorigin"),r("iframe","sandbox seamless allowfullscreen")),s(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,delete a.script,i[e]=a,a)}function r(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),s(e,function(e,r){n[r]=n[r.toUpperCase()]="map"==t?a(e,/[, ]/):c(e,/[, ]/)})),n}var i={},o={},a=e.makeMap,s=e.each,l=e.extend,c=e.explode,u=e.inArray;return function(e){function o(t,n,r){var o=e[t];return o?o=a(o,/[, ]/,a(o.toUpperCase(),/[, ]/)):(o=i[t],o||(o=a(n," ",a(n.toUpperCase()," ")),o=l(o,r),i[t]=o)),o}function d(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function f(e){var n,r,i,o,s,l,c,f,h,p,m,g,v,b,x,w,N,E,_,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),y["@"]&&(w=y["@"].attributes,N=y["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(b=s[1],h=s[2],x=s[3],f=s[5],g={},v=[],l={attributes:g,attributesOrder:v},"#"===b&&(l.paddEmpty=!0),"-"===b&&(l.removeEmpty=!0),"!"===s[4]&&(l.removeEmptyAttrs=!0),w){for(E in w)g[E]=w[E];v.push.apply(v,N)}if(f)for(f=t(f,"|"),i=0,o=f.length;o>i;i++)if(s=k.exec(f[i])){if(c={},m=s[1],p=s[2].replace(/::/g,":"),b=s[3],_=s[4],"!"===m&&(l.attributesRequired=l.attributesRequired||[],l.attributesRequired.push(p),c.required=!0),"-"===m){delete g[p],v.splice(u(v,p),1);continue}b&&("="===b&&(l.attributesDefault=l.attributesDefault||[],l.attributesDefault.push({name:p,value:_}),c.defaultValue=_),":"===b&&(l.attributesForced=l.attributesForced||[],l.attributesForced.push({name:p,value:_}),c.forcedValue=_),"<"===b&&(c.validValues=a(_,"?"))), +T.test(p)?(l.attributePatterns=l.attributePatterns||[],c.pattern=d(p),l.attributePatterns.push(c)):(g[p]||v.push(p),g[p]=c)}w||"@"!=h||(w=g,N=v),x&&(l.outputName=h,y[x]=l),T.test(h)?(l.pattern=d(h),C.push(l)):y[h]=l}}function h(e){y={},C=[],f(e),s(N,function(e,t){b[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(i.text_block_elements=i.block_elements=null,s(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",o=t[2];if(b[o]=b[i],M[o]=i,r||(R[o.toUpperCase()]={},R[o]={}),!y[o]){var a=y[i];a=l({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,y[o]=a}s(b,function(e,t){e[i]&&(b[t]=e=l({},b[t]),e[o]=e[i])})}))}function m(n){var r=/^([+\-]?)(\w+)\[([^\]]+)\]$/;i[e.schema]=null,n&&s(t(n,","),function(e){var n=r.exec(e),i,o;n&&(o=n[1],i=o?b[n[2]]:b[n[2]]={"#comment":{}},i=b[n[2]],s(t(n[3],"|"),function(e){"-"===o?delete i[e]:i[e]={}}))})}function g(e){var t=y[e],n;if(t)return t;for(n=C.length;n--;)if(t=C[n],t.pattern.test(e))return t}var v=this,y={},b={},C=[],x,w,N,E,_,S,k,T,R,A,B,D,L,M={},P={};e=e||{},N=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),x=r(e.valid_styles),w=r(e.invalid_styles,"map"),T=r(e.valid_classes,"map"),E=o("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=o("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),S=o("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),k=o("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),A=o("non_empty_elements","td th iframe video audio object script",S),B=o("move_caret_before_on_enter_elements","table",A),D=o("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),R=o("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption",D),L=o("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),s((e.special||"script noscript style textarea").split(" "),function(e){P[e]=new RegExp("]*>","gi")}),e.valid_elements?h(e.valid_elements):(s(N,function(e,t){y[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},b[t]=e.children}),"html5"!=e.schema&&s(t("strong/b em/i"),function(e){e=t(e,"/"),y[e[1]].outputName=e[0]}),s(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){y[e]&&(y[e].removeEmpty=!0)}),s(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){y[e].paddEmpty=!0}),s(t("span"),function(e){y[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),f(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&s(c(e.invalid_elements),function(e){y[e]&&delete y[e]}),g("span")||f("span[!data-mce-type|*]"),v.children=b,v.getValidStyles=function(){return x},v.getInvalidStyles=function(){return w},v.getValidClasses=function(){return T},v.getBoolAttrs=function(){return k},v.getBlockElements=function(){return R},v.getTextBlockElements=function(){return D},v.getTextInlineElements=function(){return L},v.getShortEndedElements=function(){return S},v.getSelfClosingElements=function(){return _},v.getNonEmptyElements=function(){return A},v.getMoveCaretBeforeOnEnterElements=function(){return B},v.getWhiteSpaceElements=function(){return E},v.getSpecialElements=function(){return P},v.isValidChild=function(e,t){var n=b[e];return!(!n||!n[t])},v.isValid=function(e,t){var n,r,i=g(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},v.getElementRule=g,v.getCustomElements=function(){return M},v.addValidElements=f,v.setValidElements=h,v.addCustomElements=p,v.addValidChildren=m,v.elements=y}}),r(D,[B,C,m],function(e,t,n){function r(e,t,n){var r=1,i,o,a,s;for(s=e.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,a.lastIndex=i=n;o=a.exec(t);){if(i=a.lastIndex,"/"===o[1])r--;else if(!o[1]){if(o[2]in s)continue;r++}if(0===r)break}return i}function i(i,a){function s(){}var l=this;i=i||{},l.schema=a=a||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),o("comment cdata text start end pi doctype".split(" "),function(e){e&&(l[e]=i[e]||s)}),l.parse=function(e){function o(e){var t,n;for(t=h.length;t--&&h[t].name!==e;);if(t>=0){for(n=h.length-1;n>=t;n--)e=h[n],e.valid&&l.end(e.name);h.length=t}}function s(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in x?t:z(n||r||o||""),N&&!y&&0!==t.indexOf("data-")){if(a=T[t],!a&&R){for(s=R.length;s--&&(a=R[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{c=decodeURIComponent(c)}catch(u){c=unescape(c)}if(V.test(c))return;if(!i.allow_html_data_urls&&$.test(c)&&!/^data:image\//i.test(c))return}p.map[t]=n,p.push({name:t,value:n})}var l=this,c,u=0,d,f,h=[],p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F=0,z=t.decode,U,W=n.makeMap("src,href,data,background,formaction,poster"),V=/((java|vb)script|mhtml):/i,$=/^data:/i;for(P=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-_\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),O=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=a.getShortEndedElements(),M=i.self_closing_elements||a.getSelfClosingElements(),x=a.getBoolAttrs(),N=i.validate,b=i.remove_internals,U=i.fix_self_closing,H=a.getSpecialElements();c=P.exec(e);){if(u0&&h[h.length-1].name===d&&o(d),!N||(E=a.getElementRule(d))){if(_=!0,N&&(T=E.attributes,R=E.attributePatterns),(k=c[8])?(y=-1!==k.indexOf("data-mce-type"),y&&b&&(_=!1),p=[],p.map={},k.replace(O,s)):(p=[],p.map={}),N&&!y){if(A=E.attributesRequired,B=E.attributesDefault,D=E.attributesForced,L=E.removeEmptyAttrs,L&&!p.length&&(_=!1),D)for(m=D.length;m--;)S=D[m],v=S.name,I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I});if(B)for(m=B.length;m--;)S=B[m],v=S.name,v in p.map||(I=S.value,"{$uid}"===I&&(I="mce_"+F++),p.map[v]=I,p.push({name:v,value:I}));if(A){for(m=A.length;m--&&!(A[m]in p.map););-1===m&&(_=!1)}if(S=p.map["data-mce-bogus"]){if("all"===S){u=r(a,e,P.lastIndex),P.lastIndex=u;continue}_=!1}}_&&l.start(d,p,w)}else _=!1;if(f=H[d]){f.lastIndex=u=c.index+c[0].length,(c=f.exec(e))?(_&&(g=e.substr(u,c.index-u)),u=c.index+c[0].length):(g=e.substr(u),u=e.length),_&&(g.length>0&&l.text(g,!0),l.end(d)),P.lastIndex=u;continue}w||(k&&k.indexOf("/")==k.length-1?_&&l.end(d):h.push({name:d,valid:_}))}else(d=c[1])?(">"===d.charAt(0)&&(d=" "+d),i.allow_conditional_comments||"[if"!==d.substr(0,3)||(d=" "+d),l.comment(d)):(d=c[2])?l.cdata(d):(d=c[3])?l.doctype(d):(d=c[4])&&l.pi(d,c[5]);u=c.index+c[0].length}for(u=0;m--)d=h[m],d.valid&&l.end(d.name)}}var o=n.each;return i.findEndTag=r,i}),r(L,[A,B,D,m],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,h,p,m,g,v,y,b;for(m=i("tr,td,th,tbody,thead,tfoot,table"),p=l.getNonEmptyElements(),g=l.getTextBlockElements(),v=l.getSpecialElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),h=0;h0)return void(t.value=r);if(n=t.next){if(3==n.type&&n.value.length){t=t.prev;continue}if(!o[n.name]&&"script"!=n.name&&"style"!=n.name){t=t.prev;continue}}i=t.prev,t.remove(),t=i}}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,N,E,_,S,k,T,R,A=[],B,D,L,M,P,O,H,I;if(o=o||{},h={},p={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),H=l.getNonEmptyElements(),O=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,P=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,L=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(L," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,m(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,m(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=O[b.name],s&&O[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(_=p[a],_?_.push(r):p[a]=[r]);T[e]&&m(r),n||(b=r),!B&&P[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(D,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&P[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(H))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,T[b.name]?b.empty().remove():b.unwrap(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in h){for(_=d[S],C=h[S],N=C.length;N--;)C[N].parent||C.splice(N,1);for(x=0,w=_.length;w>x;x++)_[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(_=f[x],_.name in p){for(C=p[_.name],N=C.length;N--;)C[N].parent||C.splice(N,1);for(N=0,E=_.callbacks.length;E>N;N++)_.callbacks[N](C,_.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,h,p;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(h=l.getElementRule(c.name),h&&(h.removeEmpty?c.remove():h.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(p=new e("#text",3),p.value="\xa0",i.replace(p))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}}),r.validate&&l.getValidClasses()&&u.addAttributeFilter("class",function(e){for(var t=e.length,n,r,i,o,a,s=l.getValidClasses(),c,u;t--;){for(n=e[t],r=n.attr("class").split(" "),a="",i=0;i0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');!n||l?r[r.length]=">":r[r.length]=" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(P,[M,B],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,h,p,m;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1&&(f=[],f.map={},m=r.getElementRule(e.name))){for(h=0,p=m.attributesOrder.length;p>h;h++)u=m.attributesOrder[h],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(h=0,p=c.length;p>h;h++)u=c[h].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(O,[w,L,D,C,P,A,B,d,m,S],function(e,t,n,r,i,o,a,s,l,c){function u(e){function t(e){return e&&"br"===e.name}var n,r;n=e.lastChild,t(n)&&(r=n.prev,t(r)&&(n.remove(),r.remove()))}var d=l.each,f=l.trim,h=e.DOM,p=["data-mce-selected"];return function(e,o){function m(e){var t=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","\\s?("+p.join("|")+')="[^"]+"'].join("|"),"gi");return e=c.trim(e.replace(t,""))}function g(){var e=o.getBody().innerHTML,t=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,r,i,a,s,l,c=o.schema;for(e=m(e),l=c.getShortEndedElements();s=t.exec(e);)i=t.lastIndex,a=s[0].length,r=l[s[1]]?i:n.findEndTag(c,e,i),e=e.substring(0,i-a)+e.substring(r),t.lastIndex=i-a;return f(e)}function v(e){-1===l.inArray(p,e)&&(C.addAttributeFilter(e,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),p.push(e))}var y,b,C;return o&&(y=o.dom,b=o.schema),y=y||h,b=b||new a(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,C=new t(e,b),C.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n=e.length,r;n--;)r=e[n],r.attr("tabindex",r.attributes.map["data-mce-tabindex"]),r.attr(t,null)}),C.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,s=e.url_converter,l=e.url_converter_scope,c;r--;)i=t[r],o=i.attributes.map[a],o!==c?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=y.serializeStyle(y.parseStyle(o),i.name):s&&(o=s.call(l,o,n,i.name)),i.attr(n,o.length>0?o:null))}),C.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class"),r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}),C.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),C.addNodeFilter("noscript",function(e){for(var t=e.length,n;t--;)n=e[t].firstChild,n&&(n.value=r.decode(n.value))}),C.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o,a;r--;)i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t?(a=i.attr("type"),a&&i.attr("type","mce-no/type"==a?null:a.replace(/^mce\-/,"")),o.length>0&&(i.firstChild.value="// ")):o.length>0&&(i.firstChild.value="")}),C.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),C.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&C.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,"ul"!==r.name&&"ol"!==r.name||n.prev&&"li"===n.prev.name&&n.prev.append(n)}),C.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:b,addNodeFilter:C.addNodeFilter,addAttributeFilter:C.addAttributeFilter,serialize:function(t,n){var r=this,o,a,l,h,p,m;return s.ie&&y.select("script,style,select,map").length>0?(p=t.innerHTML,t=t.cloneNode(!1),y.setHTML(t,p)):t=t.cloneNode(!0),o=document.implementation,o.createHTMLDocument&&(a=o.createHTMLDocument(""),d("BODY"==t.nodeName?t.childNodes:[t],function(e){a.body.appendChild(a.importNode(e,!0))}),t="BODY"!=t.nodeName?a.body.firstChild:a.body,l=y.doc,y.doc=a),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,r.onPreProcess(n)),m=C.parse(f(n.getInner?t.innerHTML:y.getOuterHTML(t)),n),u(m),h=new i(e,b),n.content=h.serialize(m),n.cleanup||(n.content=c.trim(n.content),n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||r.onPostProcess(n),l&&(y.doc=l),n.node=null,n.content},addRules:function(e){b.addValidElements(e)},setRules:function(e){b.setValidElements(e)},onPreProcess:function(e){o&&o.fire("PreProcess",e)},onPostProcess:function(e){o&&o.fire("PostProcess",e)},addTempAttr:v,trimHtml:m,getTrimmedContent:g}}}),r(H,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l));for(;l;){if(3==l.nodeType&&(u=l.nodeValue,s+=u.length,s>=i)){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(3==l.nodeType&&(s+=l.nodeValue.length,s>=i)){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,p;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),t!=f&&t!=f.documentElement||(t=h,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(p=t.childNodes,p.length?(n>=p.length?i.insertAfter(a,p[p.length-1]):t.insertBefore(a,p[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,h=f.body,p,m;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=h.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(m=s.childNodes[l],a=h.createControlRange(),a.addElement(m),a.select(),p=e.getRng(),p.item&&m===p.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(I,[d],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(t){return e.mac?t.metaKey:t.ctrlKey&&!t.altKey}}}),r(F,[I,m,u,d,_],function(e,t,n,r,i){function o(e,t){for(;t&&t!=e;){if(s(t)||a(t))return t;t=t.parentNode}return null}var a=i.isContentEditableFalse,s=i.isContentEditableTrue;return function(i,s){function l(e){var t=s.settings.object_resizing;return t===!1||r.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:e==s.getBody()?!1:s.dom.is(e,t))}function c(t){var n,r,i,o,a;n=t.screenX-L,r=t.screenY-M,U=n*B[2]+H,W=r*B[3]+I,U=5>U?5:U,W=5>W?5:W,i="IMG"==k.nodeName&&s.settings.resize_img_proportional!==!1?!e.modifierPressed(t):e.modifierPressed(t)||"IMG"==k.nodeName&&B[2]*B[3]!==0,i&&(j(n)>j(r)?(W=Y(U*F),U=Y(W/F)):(U=Y(W/F),W=Y(U*F))),_.setStyles(T,{width:U,height:W}),o=B.startPos.x+n,a=B.startPos.y+r,o=o>0?o:0,a=a>0?a:0,_.setStyles(R,{left:o,top:a,display:"block"}),R.innerHTML=U+" × "+W,B[2]<0&&T.clientWidth<=U&&_.setStyle(T,"left",P+(H-U)),B[3]<0&&T.clientHeight<=W&&_.setStyle(T,"top",O+(I-W)),n=X.scrollWidth-K,r=X.scrollHeight-G,n+r!==0&&_.setStyles(R,{left:o-n,top:a-r}),z||(s.fire("ObjectResizeStart",{target:k,width:H,height:I}),z=!0)}function u(){function e(e,t){t&&(k.style[e]||!s.schema.isValid(k.nodeName.toLowerCase(),e)?_.setStyle(k,e,t):_.setAttrib(k,e,t))}z=!1,e("width",U),e("height",W),_.unbind(V,"mousemove",c),_.unbind(V,"mouseup",u),$!=V&&(_.unbind($,"mousemove",c),_.unbind($,"mouseup",u)),_.remove(T),_.remove(R),q&&"TABLE"!=k.nodeName||d(k),s.fire("ObjectResized",{target:k,width:U,height:W}),_.setAttrib(k,"style",_.getAttrib(k,"style")),s.nodeChanged()}function d(e,t,n){var i,o,a,d,h;f(),x(),i=_.getPos(e,X),P=i.x,O=i.y,h=e.getBoundingClientRect(),o=h.width||h.right-h.left,a=h.height||h.bottom-h.top,k!=e&&(C(),k=e,U=W=0),d=s.fire("ObjectSelected",{target:e}),l(e)&&!d.isDefaultPrevented()?S(A,function(e,i){function s(t){L=t.screenX,M=t.screenY,H=k.clientWidth,I=k.clientHeight,F=I/H,B=e,e.startPos={x:o*e[0]+P,y:a*e[1]+O},K=X.scrollWidth,G=X.scrollHeight,T=k.cloneNode(!0),_.addClass(T,"mce-clonedresizable"),_.setAttrib(T,"data-mce-bogus","all"),T.contentEditable=!1,T.unSelectabe=!0,_.setStyles(T,{left:P,top:O,margin:0}),T.removeAttribute("data-mce-selected"),X.appendChild(T),_.bind(V,"mousemove",c),_.bind(V,"mouseup",u),$!=V&&(_.bind($,"mousemove",c),_.bind($,"mouseup",u)),R=_.add(X,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},H+" × "+I)}var l;return t?void(i==t&&s(n)):(l=_.get("mceResizeHandle"+i),l&&_.remove(l),l=_.add(X,"div",{id:"mceResizeHandle"+i,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+i+"-resize; margin:0; padding:0"}),r.ie&&(l.contentEditable=!1),_.bind(l,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),s(e)}),e.elm=l,void _.setStyles(l,{left:o*e[0]+P-l.offsetWidth/2,top:a*e[1]+O-l.offsetHeight/2}))}):f(),k.setAttribute("data-mce-selected","1")}function f(){var e,t;x(),k&&k.removeAttribute("data-mce-selected");for(e in A)t=_.get("mceResizeHandle"+e),t&&(_.unbind(t),_.remove(t))}function h(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n,r;if(!z&&!s.removed)return S(_.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"==e.type?e.target:i.getNode(),r=_.$(r).closest(q?"table":"table,img,hr")[0],t(r,X)&&(w(),n=i.getStart(!0),t(n,r)&&t(i.getEnd(!0),r)&&(!q||r!=n&&"IMG"!==n.nodeName))?void d(r):void f()}function p(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function m(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function g(e){var t=e.srcElement,n,r,i,o,a,l,c;n=t.getBoundingClientRect(),l=D.clientX-n.left,c=D.clientY-n.top;for(r in A)if(i=A[r],o=t.offsetWidth*i[0],a=t.offsetHeight*i[1],j(o-l)<8&&j(a-c)<8){B=i;break}z=!0,s.fire("ObjectResizeStart",{target:k,width:k.clientWidth,height:k.clientHeight}),s.getDoc().selection.empty(),d(t,r,D)}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){return a(o(s.getBody(),e))}function b(e){var t=e.srcElement;if(y(t))return void v(e);if(t!=k){if(s.fire("ObjectSelected",{target:t}),C(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);"IMG"!=t.nodeName&&"TABLE"!=t.nodeName||(f(),k=t,p(t,"resizestart",g))}}function C(){m(k,"resizestart",g)}function x(){for(var e in A){var t=A[e];t.elm&&(_.unbind(t.elm),delete t.elm)}}function w(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function N(e){var t;if(q){t=V.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function E(){k=T=null,q&&(C(),m(X,"controlselect",b))}var _=s.dom,S=t.each,k,T,R,A,B,D,L,M,P,O,H,I,F,z,U,W,V=s.getDoc(),$=document,q=r.ie&&r.ie<11,j=Math.abs,Y=Math.round,X=s.getBody(),K,G;A={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var J=".mce-content-body";return s.contentStyles.push(J+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: box-sizing;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+J+" .mce-resizehandle:hover {background: #000}"+J+" img[data-mce-selected],"+J+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+J+" .mce-clonedresizable {position: absolute;"+(r.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+J+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}"),s.on("init",function(){q?(s.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(f(),N(e.target))}),p(X,"controlselect",b),s.on("mousedown",function(e){D=e})):(w(),r.ie>=11&&(s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;z||!/^(TABLE|IMG|HR)$/.test(n)||y(t)||(s.selection.select(t,"TABLE"==n),"mousedown"==e.type&&s.nodeChanged())}),s.dom.bind(X,"mscontrolselect",function(e){function t(e){n.setEditorTimeout(s,function(){s.selection.select(e)})}return y(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&t(e.target)))})));var e=n.throttle(function(e){s.composing||h(e)});s.on("nodechange ResizeEditor ResizeWindow drop",e),s.on("keyup compositionend",function(t){k&&"TABLE"==k.nodeName&&e(t)}),s.on("hide blur",f)}),s.on("remove",x),{isResizable:l,showResizeRect:d,hideResizeRect:f,updateResizeRect:h,controlSelect:N,destroy:E}}}),r(z,[],function(){function e(e){return function(){return e}}function t(e){return function(t){return!e(t)}}function n(e,t){return function(n){return e(t(n))}}function r(){var e=a.call(arguments);return function(t){for(var n=0;n=e.length?e.apply(this,t.slice(1)):function(){var e=t.concat([].slice.call(arguments));return o.apply(this,e)}}var a=[].slice;return{constant:e,negate:t,and:i,or:r,curry:o,compose:n}}),r(U,[_,p,k],function(e,t,n){function r(e){return m(e)?!1:d(e)?!f(e.parentNode):h(e)||u(e)||p(e)||c(e)}function i(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode){if(c(e))return!1;if(l(e))return!0}return!0}function o(e){return c(e)?t.reduce(e.getElementsByTagName("*"),function(e,t){return e||l(t)},!1)!==!0:!1}function a(e){return h(e)||o(e)}function s(e,t){return r(e)&&i(e,t)}var l=e.isContentEditableTrue,c=e.isContentEditableFalse,u=e.isBr,d=e.isText,f=e.matchNodeNames("script style textarea"),h=e.matchNodeNames("img input textarea hr iframe video audio object"),p=e.matchNodeNames("table"),m=n.isCaretContainer;return{isCaretCandidate:r,isInEditable:i,isAtomic:a,isEditableCaretCandidate:s}}),r(W,[],function(){function e(e){return e?{left:u(e.left),top:u(e.top),bottom:u(e.bottom),right:u(e.right),width:u(e.width),height:u(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function t(t,n){return t=e(t),n?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t}function n(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right}function r(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2}function i(e,t){return e.bottomt.bottom?!1:r(t.top-e.bottom,e,t)}function o(e,t){return e.top>t.bottom?!0:e.bottomt.right}function l(e,t){return i(e,t)?-1:o(e,t)?1:a(e,t)?-1:s(e,t)?1:0}function c(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom}var u=Math.round;return{clone:e,collapse:t,isEqual:n,isAbove:i,isBelow:o,isLeft:a,isRight:s,compare:l,containsXY:c}}),r(V,[],function(){function e(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&t.test(e)}var t=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]");return{isExtendingChar:e}}),r($,[z,_,w,T,U,W,V],function(e,t,n,r,i,o,a){function s(e){return"createRange"in e?e.createRange():n.DOM.createRng()}function l(e){return e&&/[\r\n\t ]/.test(e)}function c(e){var t=e.startContainer,n=e.startOffset,r;return!!(l(e.toString())&&v(t.parentNode)&&(r=t.data,l(r[n-1])||l(r[n+1])))}function u(e){function t(e){var t=e.ownerDocument,n=s(t),r=t.createTextNode("\xa0"),i=e.parentNode,a;return i.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1),a=o.clone(n.getBoundingClientRect()),i.removeChild(r),a}function n(e){var n,r;return r=e.getClientRects(),n=r.length>0?o.clone(r[0]):o.clone(e.getBoundingClientRect()),b(e)&&0===n.left?t(e):n}function r(e,t){return e=o.collapse(e,t),e.width=1,e.right=e.left+1,e}function i(e){0!==e.height&&(u.length>0&&o.isEqual(e,u[u.length-1])||u.push(e))}function l(e,t){var o=s(e.ownerDocument);if(t0&&(o.setStart(e,t-1),o.setEnd(e,t),c(o)||i(r(n(o),!1))),t=t.data.length:n>=t.childNodes.length}function a(){var e;return e=s(t.ownerDocument),e.setStart(t,n),e.setEnd(t,n),e}function l(){return r||(r=u(new d(t,n))),r}function c(){return l().length>0}function f(e){return e&&t===e.container()&&n===e.offset()}function h(e){return x(t,e?n-1:n)}return{container:e.constant(t),offset:e.constant(n),toRange:a,getClientRects:l,isVisible:c,isAtStart:i,isAtEnd:o,isEqual:f,getNode:h}}var f=t.isElement,h=i.isCaretCandidate,p=t.matchStyleValues("display","block table"),m=t.matchStyleValues("float","left right"),g=e.and(f,h,e.negate(m)),v=e.negate(t.matchStyleValues("white-space","pre pre-line pre-wrap")),y=t.isText,b=t.isBr,C=n.nodeIndex,x=r.getNode;return d.fromRangeStart=function(e){return new d(e.startContainer,e.startOffset)},d.fromRangeEnd=function(e){return new d(e.endContainer,e.endOffset)},d.after=function(e){return new d(e.parentNode,C(e)+1)},d.before=function(e){return new d(e.parentNode,C(e))},d}),r(q,[_,w,z,p,$],function(e,t,n,r,i){function o(e){var t=e.parentNode;return v(t)?o(t):t}function a(e){return e?r.reduce(e.childNodes,function(e,t){return v(t)&&"BR"!=t.nodeName?e=e.concat(a(t)):e.push(t),e},[]):[]}function s(e,t){for(;(e=e.previousSibling)&&g(e);)t+=e.data.length;return t}function l(e){return function(t){return e===t}}function c(t){var n,i,s;return n=a(o(t)),i=r.findIndex(n,l(t),t),n=n.slice(0,i+1),s=r.reduce(n,function(e,t,r){return g(t)&&g(n[r-1])&&e++,e},0),n=r.filter(n,e.matchNodeNames(t.nodeName)),i=r.findIndex(n,l(t),t),i-s}function u(e){var t;return t=g(e)?"text()":e.nodeName.toLowerCase(),t+"["+c(e)+"]"}function d(e,t,n){var r=[];for(t=t.parentNode;t!=e&&(!n||!n(t));t=t.parentNode)r.push(t);return r}function f(t,i){var o,a,l=[],c,f,h;return o=i.container(),a=i.offset(),g(o)?c=s(o,a):(f=o.childNodes,a>=f.length?(c="after",a=f.length-1):c="before",o=f[a]),l.push(u(o)),h=d(t,o),h=r.filter(h,n.negate(e.isBogus)),l=l.concat(r.map(h,function(e){return u(e)})),l.reverse().join("/")+","+c}function h(t,n,i){var o=a(t);return o=r.filter(o,function(e,t){return!g(e)||!g(o[t-1])}),o=r.filter(o,e.matchNodeNames(n)),o[i]}function p(e,t){for(var n=e,r=0,o;g(n);){if(o=n.data.length,t>=r&&r+o>=t){e=n,t-=r;break}if(!g(n.nextSibling)){e=n,t=o;break}r+=o,n=n.nextSibling}return t>e.data.length&&(t=e.data.length),new i(e,t)}function m(e,t){var n,o,a;return t?(n=t.split(","),t=n[0].split("/"),a=n.length>1?n[1]:"before",o=r.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),h(e,t[1],parseInt(t[2],10))):null},e),o?g(o)?p(o,parseInt(a,10)):(a="after"===a?y(o)+1:y(o),new i(o.parentNode,a)):null):null}var g=e.isText,v=e.isBogus,y=t.nodeIndex;return{create:f,resolve:m}}),r(j,[d,m,k,q,$,_],function(e,t,n,r,i,o){function a(a){var l=a.dom;this.getBookmark=function(e,c){function u(e,n){var r=0;return t.each(l.select(e),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e==n?!1:void r++:void 0}),r}function d(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function f(e){function t(e,t){var r=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],o=[],a,s,u=0;if(3==r.nodeType){if(c)for(a=r.previousSibling;a&&3==a.nodeType;a=a.previousSibling)i+=a.nodeValue.length;o.push(i)}else s=r.childNodes,i>=s.length&&s.length&&(u=1,i=Math.max(0,s.length-1)),o.push(l.nodeIndex(s[i],c)+u);for(;r&&r!=n;r=r.parentNode)o.push(l.nodeIndex(r,c));return o}var n=l.getRoot(),r={};return r.start=t(e,!0),a.isCollapsed()||(r.end=t(e)),r}function h(e){function t(e){var t;if(n.isCaretContainer(e)){if(o.isText(e)&&n.isCaretContainerBlock(e)&&(e=e.parentNode),t=e.previousSibling,s(t))return t;if(t=e.nextSibling,s(t))return t}}return t(e.startContainer)||t(e.endContainer)}var p,m,g,v,y,b,C="",x;if(2==e)return b=a.getNode(),y=b?b.nodeName:null,p=a.getRng(),s(b)||"IMG"==y?{name:y,index:u(y,b)}:a.tridentSel?a.tridentSel.getBookmark(e):(b=h(p),b?(y=b.tagName,{name:y,index:u(y,b)}):f(p));if(3==e)return p=a.getRng(),{start:r.create(l.getRoot(),i.fromRangeStart(p)),end:r.create(l.getRoot(),i.fromRangeEnd(p))};if(e)return{rng:a.getRng()};if(p=a.getRng(),g=l.uniqueId(),v=a.isCollapsed(),x="overflow:hidden;line-height:0px",p.duplicate||p.item){if(p.item)return b=p.item(0),y=b.nodeName,{name:y,index:u(y,b)};m=p.duplicate();try{p.collapse(),p.pasteHTML(''+C+""),v||(m.collapse(!1),p.moveToElementText(m.parentElement()),0===p.compareEndPoints("StartToEnd",m)&&m.move("character",-1),m.pasteHTML(''+C+""))}catch(w){return null}}else{if(b=a.getNode(),y=b.nodeName,"IMG"==y)return{name:y,index:u(y,b)};m=d(p.cloneRange()),v||(m.collapse(!1),m.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_end",style:x},C))),p=d(p),p.collapse(!0),p.insertNode(l.create("span",{"data-mce-type":"bookmark",id:g+"_start",style:x},C))}return a.moveToBookmark({id:g,keep:1}),{id:g}},this.moveToBookmark=function(n){function i(e){var t=n[e?"start":"end"],r,i,o,a;if(t){for(o=t[0],i=d,r=t.length-1;r>=1;r--){if(a=i.childNodes,t[r]>a.length-1)return;i=a[t[r]]}3===i.nodeType&&(o=Math.min(t[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(t[0],i.childNodes.length)),e?u.setStart(i,o):u.setEnd(i,o)}return!0}function o(r){var i=l.get(n.id+"_"+r),o,a,s,c,u=n.keep;if(i&&(o=i.parentNode,"start"==r?(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),f=h=o,p=m=a):(u?(o=i.firstChild,a=1):a=l.nodeIndex(i),h=o,m=a),!u)){for(c=i.previousSibling,s=i.nextSibling,t.each(t.grep(i.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});i=l.get(n.id+"_"+r);)l.remove(i,1);c&&s&&c.nodeType==s.nodeType&&3==c.nodeType&&!e.opera&&(a=c.nodeValue.length,c.appendData(s.nodeValue),l.remove(s),"start"==r?(f=h=c,p=m=a):(h=c,m=a))}}function s(t){return!l.isBlock(t)||t.innerHTML||e.ie||(t.innerHTML='
    '),t}function c(){var e,t;return e=l.createRng(),t=r.resolve(l.getRoot(),n.start),e.setStart(t.container(),t.offset()),t=r.resolve(l.getRoot(),n.end),e.setEnd(t.container(),t.offset()),e}var u,d,f,h,p,m;if(n)if(t.isArray(n.start)){if(u=l.createRng(),d=l.getRoot(),a.tridentSel)return a.tridentSel.moveToBookmark(n);i(!0)&&i()&&a.setRng(u)}else"string"==typeof n.start?a.setRng(c(n)):n.id?(o("start"),o("end"),f&&(u=l.createRng(),u.setStart(s(f),p),u.setEnd(s(h),m),a.setRng(u))):n.name?a.select(l.select(n.name)[n.index]):n.rng&&a.setRng(n.rng)}}var s=o.isContentEditableFalse;return a.isBookmarkNode=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},a}),r(Y,[y,H,F,T,j,_,d,m,$],function(e,n,r,i,o,a,s,l,c){function u(e,t,i,a){var s=this;s.dom=e,s.win=t,s.serializer=i,s.editor=a,s.bookmarkManager=new o(s),s.controlSelection=new r(s,a),s.win.getSelection||(s.tridentSel=new n(s))}var d=l.each,f=l.trim,h=s.ie;return u.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(e){var t=this,n=t.getRng(),r,i,o,a;if(n.duplicate||n.item){if(n.item)return n.item(0);for(o=n.duplicate(),o.collapse(1),r=o.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),i=a=n.parentElement();a=a.parentNode;)if(a==r){r=i;break}return r}return r=n.startContainer,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[Math.min(r.childNodes.length-1,n.startOffset)])),r&&3==r.nodeType?r.parentNode:r},getEnd:function(e){var t=this,n=t.getRng(),r,i;return n.duplicate||n.item?n.item?n.item(0):(n=n.duplicate(),n.collapse(0),r=n.parentElement(),r.ownerDocument!==t.dom.doc&&(r=t.dom.getRoot()),r&&"BODY"==r.nodeName?r.lastChild||r:r):(r=n.endContainer,i=n.endOffset,1==r.nodeType&&r.hasChildNodes()&&(e&&n.collapsed||(r=r.childNodes[i>0?i-1:i])),r&&3==r.nodeType?r.parentNode:r)},getBookmark:function(e,t){return this.bookmarkManager.getBookmark(e,t)},moveToBookmark:function(e){return this.bookmarkManager.moveToBookmark(e)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a,s,l;if(!n.win)return null;if(a=n.win.document,!e&&n.lastFocusBookmark){var c=n.lastFocusBookmark;return c.startContainer?(i=a.createRange(),i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset)):i=c,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(u){}if(l=n.editor.fire("GetSelectionRange",{range:i}),l.range!==i)return l.range;if(h&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(u){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r,i,o;if(e)if(e.select){n.explicitRange=null;try{e.select()}catch(a){}}else if(n.tridentSel){if(e.cloneRange)try{n.tridentSel.addRange(e)}catch(a){}}else{if(r=n.getSel(),o=n.editor.fire("SetSelectionRange",{range:e}),e=o.range,r){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(a){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}e.collapsed||e.startContainer!=e.endContainer||!r.setBaseAndExtent||s.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(i=e.startContainer.childNodes[e.startOffset],i&&"IMG"==i.tagName&&n.getSel().setBaseAndExtent(i,0,i,1))}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i,o,a,s,l=t.dom.getRoot();return n?(i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r)):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return s.range&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};d(n.selectorChangedData,function(e,t){d(o,function(n){return i.is(n,t)?(r[t]||(d(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),d(r,function(e,n){a[n]||(delete r[n],d(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){function n(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var r,i,o=this,s=o.dom,l=s.getRoot(),c,u,d=0;if(a.isElement(e)){if(t===!1&&(d=e.offsetHeight),"BODY"!=l.nodeName){var f=o.getScrollContainer();if(f)return r=n(e).y-n(f).y+d,u=f.clientHeight,c=f.scrollTop,void((c>r||r+25>c+u)&&(f.scrollTop=c>r?r:r-u+25))}i=s.getViewPort(o.editor.getWin()),r=s.getPos(e).y+d,c=i.y,u=i.h,(rc+u)&&o.editor.getWin().scrollTo(0,c>r?r:r-u+25)}},placeCaretAt:function(e,t){this.setRng(i.getCaretRangeFromPoint(e,t,this.editor.getDoc()))},_moveEndPoint:function(t,n,r){var i=n,o=new e(n,i),a=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==f(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(s.ie&&s.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?o.next():o.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},getBoundingClientRect:function(){var e=this.getRng();return e.collapsed?c.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){this.win=null,this.controlSelection.destroy()}},u}),r(X,[j,m],function(e,t){function n(t){this.compare=function(n,i){function o(e){var n={};return r(t.getAttribs(e),function(r){var i=r.nodeName.toLowerCase();0!==i.indexOf("_")&&"style"!==i&&0!==i.indexOf("data-")&&(n[i]=t.getAttrib(e,i))}),n}function a(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!=n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0}return n.nodeName!=i.nodeName?!1:a(o(n),o(i))&&a(t.parseStyle(t.getAttrib(n,"style")),t.parseStyle(t.getAttrib(i,"style")))?!e.isBookmarkNode(n)&&!e.isBookmarkNode(i):!1}}var r=t.each;return n}),r(K,[m],function(e){function t(e,t){function r(e){return e.replace(/%(\w+)/g,"")}var i,o,a=e.dom,s="",l,c;if(c=e.settings.preview_styles,c===!1)return"";if(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),"string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return i=t.block||t.inline||"span",o=a.create(i),n(t.styles,function(e,t){e=r(e),e&&a.setStyle(o,t,e)}),n(t.attributes,function(e,t){e=r(e),e&&a.setAttrib(o,t,e)}),n(t.classes,function(e){e=r(e),a.hasClass(o,e)||a.addClass(o,e)}),e.fire("PreviewFormats"),a.setStyles(o,{position:"absolute",left:-65535}),e.getBody().appendChild(o),l=a.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,n(c.split(" "),function(t){var n=a.getStyle(o,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=a.getStyle(e.getBody(),t,!0),"#ffffff"==a.toHex(n).toLowerCase())||"color"==t&&"#000000"==a.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(s+="padding:0 2px;"),s+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),a.remove(o),s}var n=e.each;return{getCssText:t}}),r(G,[p,_,g],function(e,t,n){function r(e,t){var n=o[e];n||(o[e]=n=[]),o[e].push(t)}function i(e,t){s(o[e],function(e){e(t)})}var o=[],a=e.filter,s=e.each;return r("pre",function(r){function i(t){return c(t.previousSibling)&&-1!=e.indexOf(u,t.previousSibling)}function o(e,t){n(t).remove(),n(e).append("

    ").append(t.childNodes)}var l=r.selection.getRng(),c,u;c=t.matchNodeNames("pre"),l.collapsed||(u=r.selection.getSelectedBlocks(),s(a(a(u,c),i),function(e){o(e.previousSibling,e)}))}),{postProcess:i}}),r(J,[y,T,j,X,m,K,G],function(e,t,n,r,i,o,a){return function(s){function l(e){return e.nodeType&&(e=e.nodeName),!!s.schema.getTextBlockElements()[e.toLowerCase()]}function c(e){return/^(TH|TD)$/.test(e.nodeName)}function u(e){return e&&/^(IMG)$/.test(e.nodeName)}function d(e,t){return Y.getParents(e,t,Y.getRoot())}function f(e){return 1===e.nodeType&&"_mce_caret"===e.id}function h(){g({valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){ue(n,function(t,n){Y.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),ue("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){g(e,{block:e,remove:"all"})}),g(s.settings.formats)}function p(){s.addShortcut("meta+b","bold_desc","Bold"),s.addShortcut("meta+i","italic_desc","Italic"),s.addShortcut("meta+u","underline_desc","Underline");for(var e=1;6>=e;e++)s.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);s.addShortcut("access+7","",["FormatBlock",!1,"p"]),s.addShortcut("access+8","",["FormatBlock",!1,"div"]),s.addShortcut("access+9","",["FormatBlock",!1,"address"])}function m(e){return e?j[e]:j}function g(e,t){e&&("string"!=typeof e?ue(e,function(e,t){g(t,e)}):(t=t.length?t:[t],ue(t,function(e){e.deep===oe&&(e.deep=!e.selector),e.split===oe&&(e.split=!e.selector||e.inline),e.remove===oe&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),j[e]=t))}function v(e){return e&&j[e]&&delete j[e],j}function y(e,t){var n=m(t);if(n)for(var r=0;r0)return r;if(r.childNodes.length>1||r==t||"BR"==r.tagName)return r}}var n=s.selection.getRng(),i=n.startContainer,o=n.endContainer;if(i!=o&&0===n.endOffset){var a=t(i,o),l=3==a.nodeType?a.data.length:a.childNodes.length;n.setEnd(a,l)}return n}function c(e,r,o){var a=[],s,c,h=!0;s=d.inline||d.block,c=Y.create(s),i(c),K.walk(e,function(e){function r(e){var m,v,y,b,C;return C=h,m=e.nodeName.toLowerCase(),v=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&ae(e)&&(C=h,h="true"===ae(e),b=!0),B(m,"br")?(p=0,void(d.block&&Y.remove(e))):d.wrapper&&E(e,t,n)?void(p=0):h&&!b&&d.block&&!d.wrapper&&l(m)&&G(v,s)?(e=Y.rename(e,s),i(e),a.push(e),void(p=0)):d.selector&&(ue(u,function(t){return"collapsed"in t&&t.collapsed!==g?void 0:Y.is(e,t.selector)&&!f(e)?(i(e,t),y=!0,!1):void 0}),!d.inline||y)?void(p=0):void(!h||b||!G(s,m)||!G(v,s)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||f(e)||d.inline&&J(e)?(p=0,ue(de(e.childNodes),r),b&&(h=C),p=0):(p||(p=Y.clone(c,ne),e.parentNode.insertBefore(p,e),a.push(p)),p.appendChild(e)))}var p;ue(e,r)}),d.links===!0&&ue(a,function(e){function t(e){"A"===e.nodeName&&i(e,d),ue(de(e.childNodes),t)}t(e)}),ue(a,function(e){function r(e){var t=0;return ue(e.childNodes,function(e){P(e)||ce(e)||t++}),t}function o(e){var t,n;return ue(e.childNodes,function(e){return 1!=e.nodeType||ce(e)||f(e)?void 0:(t=e,ne)}),t&&!ce(t)&&A(t,d)&&(n=Y.clone(t,ne),i(n),Y.replace(n,e,re),Y.remove(t,1)),n||e}var s;if(s=r(e),(a.length>1||!J(e))&&0===s)return void Y.remove(e,1);if(d.inline||d.wrapper){if(d.exact||1!==s||(e=o(e)),ue(u,function(t){ue(Y.select(t.inline,e),function(e){ce(e)||F(t,n,e,t.exact?e:null)})}),E(e.parentNode,t,n))return Y.remove(e,1),e=0,re;d.merge_with_parents&&Y.getParent(e.parentNode,function(r){return E(r,t,n)?(Y.remove(e,1),e=0,re):void 0}),e&&d.merge_siblings!==!1&&(e=W(U(e),e),e=W(e,U(e,re)))}})}var u=m(t),d=u[0],h,p,g=!r&&X.isCollapsed();if("false"!==ae(X.getNode())){if(d){if(r)r.nodeType?(p=Y.createRng(),p.setStartBefore(r),p.setEndAfter(r),c(H(p,u),null,!0)):c(r,null,!0);else if(g&&d.inline&&!Y.select("td[data-mce-selected],th[data-mce-selected]").length)$("apply",t,n);else{var v=s.selection.getNode();Q||!u[0].defaultBlock||Y.getParent(v,Y.isBlock)||x(u[0].defaultBlock),s.selection.setRng(o()),h=X.getBookmark(),c(H(X.getRng(re),u),h),d.styles&&(d.styles.color||d.styles.textDecoration)&&(fe(v,C,"childNodes"),C(v)),X.moveToBookmark(h),q(X.getRng(re)),s.nodeChanged()}a.postProcess(t,s)}}else{r=X.getNode();for(var y=0,b=u.length;b>y;y++)if(u[y].ceFalseOverride&&Y.is(r,u[y].selector))return void i(r,u[y])}}function w(e,t,n,r){function i(e){var n,r,o,a,s;if(1===e.nodeType&&ae(e)&&(a=y,y="true"===ae(e),s=!0),n=de(e.childNodes),y&&!s)for(r=0,o=h.length;o>r&&!F(h[r],t,e,e);r++);if(p.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(y=a)}}function o(n){var i;return ue(d(n.parentNode).reverse(),function(n){var o;i||"_start"==n.id||"_end"==n.id||(o=E(n,e,t,r),o&&o.split!==!1&&(i=n))}),i}function a(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode, +o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=Y.clone(o,ne),c=0;cC&&(!h[C].ceFalseOverride||!F(h[C],t,n,n));C++);}}function N(e,t,n){var r=m(e);!_(e,t,n)||"toggle"in r[0]&&!r[0].toggle?x(e,t,n):w(e,t,n)}function E(e,t,n,r){function i(e,t,i){var o,a,s=t[i],l;if(t.onmatch)return t.onmatch(e,t,i);if(s)if(s.length===oe){for(o in s)if(s.hasOwnProperty(o)){if(a="attributes"===i?Y.getAttrib(e,o):D(e,o),r&&!a&&!t.exact)return;if((!r||t.exact)&&!B(a,L(M(s[o],n),o)))return}}else for(l=0;l=0;o--){if(a=t[o].selector,!a||t[o].defaultBlock)return re;for(i=r.length-1;i>=0;i--)if(Y.is(r[i],a))return re}return ne}function T(e,t,n){var r;return ie||(ie={},r={},s.on("NodeChange",function(e){var t=d(e.element),n={};t=i.grep(t,function(e){return 1==e.nodeType&&!e.getAttribute("data-mce-bogus")}),ue(ie,function(e,i){ue(t,function(o){return E(o,i,{},e.similar)?(r[i]||(ue(e,function(e){e(!0,{node:o,format:i,parents:t})}),r[i]=e),n[i]=e,!1):y(o,i)?!1:void 0})}),ue(r,function(i,o){n[o]||(delete r[o],ue(i,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),ue(e.split(","),function(e){ie[e]||(ie[e]=[],ie[e].similar=n),ie[e].push(t)}),this}function R(e){return o.getCssText(s,e)}function A(e,t){return B(e,t.inline)?re:B(e,t.block)?re:t.selector?1==e.nodeType&&Y.is(e,t.selector):void 0}function B(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function D(e,t){return L(Y.getStyle(e,t),t)}function L(e,t){return"color"!=t&&"backgroundColor"!=t||(e=Y.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function M(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function P(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function O(e,t,n){var r=Y.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function H(t,n,r){function i(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=Y.getRoot(),3==r.nodeType&&!P(r)&&(e?v>0:bo?n:o,-1===n||r||n++):(n=a.indexOf(" ",t),o=a.indexOf("\xa0",t),n=-1!==n&&(-1===o||o>n)?n:o),n}var a,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(a=new e(t,Y.getParent(t,J)||s.getBody());l=a[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(J(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function u(e,r){var i,o,a,s;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=d(e),o=0;oh?h:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(h=y.childNodes.length-1,y=y.childNodes[b>h?h:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=a(g),y=a(y),(ce(g.parentNode)||ce(g))&&(g=ce(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(ce(y.parentNode)||ce(y))&&(y=ce(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(m=c(g,v,!0),m&&(g=m.container,v=m.offset),m=c(y,b),m&&(y=m.container,b=m.offset)),p=o(y,b),p.node)){for(;p.node&&0===p.offset&&p.node.previousSibling;)p=o(p.node.previousSibling);p.node&&p.offset>0&&3===p.node.nodeType&&" "===p.node.nodeValue.charAt(p.offset-1)&&p.offset>1&&(y=p.node,y.splitText(p.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=i(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=i())),n[0].selector&&n[0].expand!==ne&&!n[0].inline&&(g=u(g,"previousSibling"),y=u(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(J(g)||(g=i(!0)),J(y)||(y=i()))),1==g.nodeType&&(v=Z(g),g=g.parentNode),1==y.nodeType&&(b=Z(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function I(e,t){return t.links&&"A"==e.tagName}function F(e,t,n,r){var i,o,a;if(!A(n,e)&&!I(n,e))return ne;if("all"!=e.remove)for(ue(e.styles,function(i,o){i=L(M(i,t),o),"number"==typeof o&&(o=i,r=0),(e.remove_similar||!r||B(D(r,o),i))&&Y.setStyle(n,o,""),a=1}),a&&""===Y.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),ue(e.attributes,function(e,i){var o;if(e=M(e,t),"number"==typeof i&&(i=e,r=0),!r||B(Y.getAttrib(r,i),e)){if("class"==i&&(e=Y.getAttrib(n,i),e&&(o="",ue(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void Y.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),te.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),ue(e.classes,function(e){e=M(e,t),r&&!Y.hasClass(r,e)||Y.removeClass(n,e)}),o=Y.getAttribs(n),i=0;io?o:i]),3===r.nodeType&&n&&i>=r.nodeValue.length&&(r=new e(r,s.getBody()).next()||r),3!==r.nodeType||n||0!==i||(r=new e(r,s.getBody()).prev()||r),r}function $(t,n,r,i){function o(e){var t=Y.create("span",{id:g,"data-mce-bogus":!0,style:v?"color:red":""});return e&&t.appendChild(s.getDoc().createTextNode(ee)),t}function a(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==ee||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function c(e){for(;e;){if(e.id===g)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=X.getRng(!0),a(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),Y.remove(e)):(n=u(e),n.nodeValue.charAt(0)===ee&&(n.deleteData(0,1),r.startContainer==n&&r.startOffset>0&&r.setStart(n,r.startOffset-1),r.endContainer==n&&r.endOffset>0&&r.setEnd(n,r.endOffset-1)),Y.remove(e,1)),X.setRng(r);else if(e=c(X.getStart()),!e)for(;e=Y.get(g);)d(e,!1)}function f(){var e,t,i,a,s,l,d;e=X.getRng(!0),a=e.startOffset,l=e.startContainer,d=l.nodeValue,t=c(X.getStart()),t&&(i=u(t)),d&&a>0&&a=0;h--)u.appendChild(Y.clone(f[h],!1)),u=u.firstChild;u.appendChild(Y.doc.createTextNode(ee)),u=u.firstChild;var g=Y.getParent(d,l);g&&Y.isEmpty(g)?d.parentNode.replaceChild(p,d):Y.insertAfter(p,d),X.setCursorLocation(u,1),Y.isEmpty(d)&&Y.remove(d)}}function p(){var e;e=c(X.getStart()),e&&!Y.isEmpty(e)&&fe(e,function(e){1!=e.nodeType||e.id===g||Y.isEmpty(e)||Y.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var g="_mce_caret",v=s.settings.caret_debug;s._hasCaretEvents||(le=function(){var e=[],t;if(a(c(X.getStart()),e))for(t=e.length;t--;)Y.setAttrib(e[t],"data-mce-bogus","1")},se=function(e){var t=e.keyCode;d(),8==t&&X.isCollapsed()&&X.getStart().innerHTML==ee&&d(c(X.getStart())),37!=t&&39!=t||d(c(X.getStart())),p()},s.on("SetContent",function(e){e.selection&&p()}),s._hasCaretEvents=!0),"apply"==t?f():h()}function q(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if((t.startContainer!=t.endContainer||!u(t.startContainer.childNodes[t.startOffset]))&&(3==n.nodeType&&r>=n.nodeValue.length&&(r=Z(n),n=n.parentNode,i=!0),1==n.nodeType))for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,Y.getParent(n,Y.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!P(a))return l=Y.create("a",{"data-mce-bogus":"all"},ee),a.parentNode.insertBefore(l,a),t.setStart(a,0),X.setRng(t),void Y.remove(l)}var j={},Y=s.dom,X=s.selection,K=new t(Y),G=s.schema.isValidChild,J=Y.isBlock,Q=s.settings.forced_root_block,Z=Y.nodeIndex,ee="\ufeff",te=/^(src|href|style)$/,ne=!1,re=!0,ie,oe,ae=Y.getContentEditable,se,le,ce=n.isBookmarkNode,ue=i.each,de=i.grep,fe=i.walk,he=i.extend;he(this,{get:m,register:g,unregister:v,apply:x,remove:w,toggle:N,match:_,matchAll:S,matchNode:E,canApply:k,formatChanged:T,getCssText:R}),h(),p(),s.on("BeforeGetContent",function(e){le&&"raw"!=e.format&&le()}),s.on("mouseup keydown",function(e){se&&se(e)})}}),r(Q,[I,d],function(e,t){return function(e){function n(){return e.serializer.getTrimmedContent()}function r(t){e.setDirty(t)}function i(e){o.typing=!1,o.add({},e)}var o=this,a=0,s=[],l,c,u=0;return e.on("init",function(){o.add()}),e.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o.beforeChange()}),e.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&i(e)}),e.on("ObjectResizeStart Cut",function(){o.beforeChange()}),e.on("SaveContent ObjectResized blur",i),e.on("DragEnd",i),e.on("KeyUp",function(a){var l=a.keyCode;a.isDefaultPrevented()||((l>=33&&36>=l||l>=37&&40>=l||45==l||13==l||a.ctrlKey)&&(i(),e.nodeChanged()),(46==l||8==l||t.mac&&(91==l||93==l))&&e.nodeChanged(),c&&o.typing&&(e.isDirty()||(r(s[0]&&n()!=s[0].content),e.isDirty()&&e.fire("change",{level:s[0],lastLevel:null})),e.fire("TypingUndo"),c=!1,e.nodeChanged()))}),e.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented()){if(t>=33&&36>=t||t>=37&&40>=t||45==t)return void(o.typing&&i(e));var n=e.ctrlKey&&!e.altKey||e.metaKey;!(16>t||t>20)||224==t||91==t||o.typing||n||(o.beforeChange(),o.typing=!0,o.add({},e),c=!0)}}),e.on("MouseDown",function(e){o.typing&&i(e)}),e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()}),o={data:s,typing:!1,beforeChange:function(){u||(l=e.selection.getBookmark(2,!0))},add:function(t,i){var o,c=e.settings,d;if(t=t||{},t.content=n(),u||e.removed)return null;if(d=s[a],e.fire("BeforeAddUndo",{level:t,lastLevel:d,originalEvent:i}).isDefaultPrevented())return null;if(d&&d.content==t.content)return null;if(s[a]&&(s[a].beforeBookmark=l),c.custom_undo_redo_levels&&s.length>c.custom_undo_redo_levels){for(o=0;o0&&(r(!0),e.fire("change",f)),t},undo:function(){var t;return o.typing&&(o.add(),o.typing=!1),a>0&&(t=s[--a],e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(t.beforeBookmark),r(!0),e.fire("undo",{level:t})),t},redo:function(){var t;return a0||o.typing&&s[0]&&n()!=s[0].content},hasRedo:function(){return aP)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}}function y(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function b(e){e.innerHTML=r?"":'
    '}function C(e){var t=D,n,i,o,s=u.getTextInlineElements();if(e||"TABLE"==z?(n=a.create(e||W),y(n)):n=M.cloneNode(!1),o=n,l.keep_styles!==!1)do if(s[t.nodeName]){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while((t=t.parentNode)&&t!=B);return r||(o.innerHTML='
    '),n}function x(t){var n,r,i;if(3==D.nodeType&&(t?L>0:LD.childNodes.length-1,D=D.childNodes[Math.min(L,D.childNodes.length-1)]||D,L=V&&3==D.nodeType?D.nodeValue.length:0),B=S(D)){if(c.beforeChange(),!a.isBlock(B)&&B!=a.getRoot())return void(W&&!O||E());if((W&&!O||!W&&O)&&(D=w(D,L)),M=a.getParent(D,a.isBlock),F=M?a.getParent(M.parentNode,a.isBlock):null,z=M?M.nodeName.toUpperCase():"",U=F?F.nodeName.toUpperCase():"","LI"!=U||o.ctrlKey||(M=F,z=U),/^(LI|DT|DD)$/.test(z)){if(!W&&O)return void E();if(a.isEmpty(M))return void N()}if("PRE"==z&&l.br_in_pre!==!1){if(!O)return void E()}else if(!W&&!O&&"LI"!=z||W&&O)return void E();W&&M===i.getBody()||(W=W||"P",x()?T():x(!0)?(H=M.parentNode.insertBefore(C(),M),m(H),v(M)):(A=R.cloneRange(),A.setEndAfter(M),I=A.extractContents(),_(I),H=I.firstChild,a.insertAfter(I,M),g(H),k(M),a.isEmpty(M)&&b(M),H.normalize(),a.isEmpty(H)?(a.remove(H),T()):v(H)),a.setAttrib(H,"id",""),i.fire("NewBlock",{newBlock:H}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements(),f=u.getMoveCaretBeforeOnEnterElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(ee,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,h,p,m=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",m),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",m)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){p=t,t=t.nextSibling,r.remove(p);continue}h||(h=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(h,t),g=!0),p=t,t=t.nextSibling,h.appendChild(p)}else h=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(te,[z,y,_,$,k,U],function(e,t,n,r,i,o){function a(e){return e>0}function s(e){return 0>e}function l(e,n,r,i,o){var l=new t(e,i);if(s(n)){if(C(e)&&(e=l.prev(!0),r(e)))return e;for(;e=l.prev(o);)if(r(e))return e}if(a(n)){if(C(e)&&(e=l.next(!0),r(e)))return e;for(;e=l.next(o);)if(r(e))return e}return null}function c(e,t){for(e=e.parentNode;e&&e!=t;e=e.parentNode)if(b(e))return e;return t}function u(e,t){for(;e&&e!=t;){if(x(e))return e;e=e.parentNode}return null}function d(e,t,n){return u(e.container(),n)==u(t.container(),n)}function f(e,t,n){return c(e.container(),n)==c(t.container(),n)}function h(e,t){var n,r;return t?(n=t.container(),r=t.offset(),E(n)?n.childNodes[r+e]:null):null}function p(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n}function m(e,t,n){return u(t,e)==u(n,e)}function g(e,t,n){var r,i;for(i=e?"previousSibling":"nextSibling";n&&n!=t;){if(r=n[i],w(r)&&(r=r[i]),C(r)){if(m(t,r,n))return r;break}if(_(r))break;n=n.parentNode}return null}function v(e,t,r){var o,a,s,l,c=N(g,!0,t),u=N(g,!1,t);if(a=r.startContainer,s=r.startOffset,i.isCaretContainerBlock(a)){if(E(a)||(a=a.parentNode),l=a.getAttribute("data-mce-caret"),"before"==l&&(o=a.nextSibling,C(o)))return S(o);if("after"==l&&(o=a.previousSibling,C(o)))return k(o)}if(!r.collapsed)return r;if(n.isText(a)){if(w(a)){if(1===e){if(o=u(a))return S(o);if(o=c(a))return k(o)}if(-1===e){if(o=c(a))return k(o);if(o=u(a))return S(o)}return r}if(i.endsWithCaretContainer(a)&&s>=a.data.length-1)return 1===e&&(o=u(a))?S(o):r;if(i.startsWithCaretContainer(a)&&1>=s)return-1===e&&(o=c(a))?k(o):r;if(s===a.data.length)return o=u(a),o?S(o):r;if(0===s)return o=c(a),o?k(o):r}return r}function y(e,t){return C(h(e,t))}var b=n.isContentEditableTrue,C=n.isContentEditableFalse,x=n.matchStyleValues("display","block table table-cell table-caption"),w=i.isCaretContainer,N=e.curry,E=n.isElement,_=o.isCaretCandidate,S=N(p,!0),k=N(p,!1);return{isForwards:a,isBackwards:s,findNode:l,getEditingHost:c,getParentBlock:u,isInSameBlock:d,isInSameEditingHost:f,isBeforeContentEditableFalse:N(y,0),isAfterContentEditableFalse:N(y,-1),normalizeRange:v}}),r(ne,[_,U,$,te,p,z],function(e,t,n,r,i,o){function a(e,t){for(var n=[];e&&e!=t;)n.push(e),e=e.parentNode;return n}function s(e,t){return e.hasChildNodes()&&t0)return n(C,--x);if(m(e)&&x0&&(N=s(C,x-1),v(N)))return!y(N)&&(E=r.findNode(N,e,b,N))?f(E)?n(E,E.data.length):n.after(E):f(N)?n(N,N.data.length):n.before(N);if(m(e)&&x0&&s(e[e.length-1])?e.slice(0,-1):e},c=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},u=function(e,t){return!!c(e,t)},d=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},f=function(e,r){var i=n.before(e),o=new t(r),a=o.next(i);return a?a.toRange():null},h=function(e,r){var i=n.after(e),o=new t(r),a=o.prev(i);return a?a.toRange():null},p=function(t,n,r,i){var o=d(t,i),a=t.parentNode;return a.insertBefore(o[0],t),e.each(n,function(e){a.insertBefore(e,t)}),a.insertBefore(o[1],t),a.removeChild(t),h(n[n.length-1],r)},m=function(t,n,r){var i=t.parentNode;return e.each(n,function(e){i.insertBefore(e,t)}),f(t,r)},g=function(e,t,n,r){return r.insertAfter(t.reverse(),e),h(t[0],n)},v=function(e,r,i,s){var u=o(r,e,s),d=c(r,i.startContainer),f=l(a(u.firstChild)),h=1,v=2,y=r.getRoot(),b=function(e){var o=n.fromRangeStart(i),a=new t(r.getRoot()),s=e===h?a.prev(o):a.next(o);return s?c(r,s.getNode())!==d:!0};return b(h)?m(d,f,y):b(v)?g(d,f,y,r):p(d,f,y,i)};return{isListFragment:r,insertAtCaret:v,isParentBlockLi:u,trimListItems:l,listItems:a}}),r(ie,[d,m,P,ne,$,X,_,re],function(e,t,n,r,i,o,a,s){var l=a.matchNodeNames("td th"),c=function(a,c,u){function d(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=D.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}function f(){var e,t,n;e=D.getRng(!0),t=e.startContainer,n=e.startOffset,3==t.nodeType&&e.collapsed&&("\xa0"===t.data[n]?(t.deleteData(n,1),/[\u00a0| ]$/.test(c)||(c+=" ")):"\xa0"===t.data[n-1]&&(t.deleteData(n-1,1),/[\u00a0| ]$/.test(c)||(c=" "+c)))}function h(){if(A){var e=a.getBody(),n=new o(L);t.each(L.select("*[data-mce-fragment]"),function(t){for(var r=t.parentNode;r&&r!=e;r=r.parentNode)B[t.nodeName.toLowerCase()]&&n.compare(r,t)&&L.remove(t,!0)})}}function p(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}function m(e){t.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})}function g(e){return!!e.getAttribute("data-mce-fragment")}function v(e){return e&&!a.schema.getShortEndedElements()[e.nodeName]}function y(t){function n(e){for(var t=a.getBody();e&&e!==t;e=e.parentNode)if("false"===a.dom.getContentEditable(e))return e;return null}function o(e){var t=i.fromRangeStart(e),n=new r(a.getBody());return t=n.next(t),t?t.toRange():void 0}var s,c,u;if(t){if(D.scrollIntoView(t),s=n(t))return L.remove(t),void D.select(s);S=L.createRng(),k=t.previousSibling,k&&3==k.nodeType?(S.setStart(k,k.nodeValue.length),e.ie||(T=t.nextSibling,T&&3==T.nodeType&&(k.appendData(T.data),T.parentNode.removeChild(T)))):(S.setStartBefore(t),S.setEndBefore(t)),c=L.getParent(t,L.isBlock),L.remove(t),c&&L.isEmpty(c)&&(a.$(c).empty(),S.setStart(c,0),S.setEnd(c,0),l(c)||g(c)||!(u=o(S))?L.add(c,L.create("br",{"data-mce-bogus":"1"})):(S=u,L.remove(c))),D.setRng(S)}}var b,C,x,w,N,E,_,S,k,T,R,A,B=a.schema.getTextInlineElements(),D=a.selection,L=a.dom;/^ | $/.test(c)&&(c=d(c)),b=a.parser,A=u.merge,C=new n({validate:a.settings.validate},a.schema),R='​',E={content:c,format:"html",selection:!0},a.fire("BeforeSetContent",E),c=E.content,-1==c.indexOf("{$caret}")&&(c+="{$caret}"),c=c.replace(/\{\$caret\}/,R),S=D.getRng();var M=S.startContainer||(S.parentElement?S.parentElement():null),P=a.getBody();M===P&&D.isCollapsed()&&L.isBlock(P.firstChild)&&v(P.firstChild)&&L.isEmpty(P.firstChild)&&(S=L.createRng(),S.setStart(P.firstChild,0),S.setEnd(P.firstChild,0),D.setRng(S)),D.isCollapsed()||(a.selection.setRng(a.selection.getRng()),a.getDoc().execCommand("Delete",!1,null), +f()),x=D.getNode();var O={context:x.nodeName.toLowerCase(),data:u.data};if(N=b.parse(c,O),u.paste===!0&&s.isListFragment(N)&&s.isParentBlockLi(L,x))return S=s.insertAtCaret(C,L,a.selection.getRng(!0),N),a.selection.setRng(S),void a.fire("SetContent",E);if(p(N),k=N.lastChild,"mce_marker"==k.attr("id"))for(_=k,k=k.prev;k;k=k.walk(!0))if(3==k.type||!L.isBlock(k.name)){a.schema.isValidChild(k.parent.name,"span")&&k.parent.insert(_,k,"br"===k.name);break}if(a._selectionOverrides.showBlockCaretContainer(x),O.invalid){for(D.setContent(R),x=D.getNode(),w=a.getBody(),9==x.nodeType?x=k=w:k=x;k!==w;)x=k,k=k.parentNode;c=x==w?w.innerHTML:L.getOuterHTML(x),c=C.serialize(b.parse(c.replace(//i,function(){return C.serialize(N)}))),x==w?L.setHTML(w,c):L.setOuterHTML(x,c)}else c=C.serialize(N),k=x.firstChild,T=x.lastChild,!k||k===T&&"BR"===k.nodeName?L.setHTML(x,c):D.setContent(c);h(),y(L.get("mce_marker")),m(a.getBody()),a.fire("SetContent",E),a.addVisual()},u=function(e){var n;return"string"!=typeof e?(n=t.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:n}):{content:e,details:{}}},d=function(e,t){var n=u(t);c(e,n.content,n.details)};return{insertAtCaret:d}}),r(oe,[d,m,T,y,ie],function(e,n,r,i,o){var a=n.each,s=n.extend,l=n.map,c=n.inArray,u=n.explode,d=e.ie&&e.ie<11,f=!0,h=!1;return function(n){function p(e,t,r,i){var o,s,l=0;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||i&&i.skip_focus||n.focus(),i=n.fire("BeforeExecCommand",{command:e,ui:t,value:r}),i.isDefaultPrevented())return!1;if(s=e.toLowerCase(),o=B.exec[s])return o(s,t,r),n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;if(a(n.plugins,function(i){return i.execCommand&&i.execCommand(e,t,r)?(n.fire("ExecCommand",{command:e,ui:t,value:r}),l=!0,!1):void 0}),l)return l;if(n.theme&&n.theme.execCommand&&n.theme.execCommand(e,t,r))return n.fire("ExecCommand",{command:e,ui:t,value:r}),!0;try{l=n.getDoc().execCommand(e,t,r)}catch(c){}return l?(n.fire("ExecCommand",{command:e,ui:t,value:r}),!0):!1}function m(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.state[e])return t(e);try{return n.getDoc().queryCommandState(e)}catch(r){}return!1}}function g(e){var t;if(!n.quirks.isHidden()){if(e=e.toLowerCase(),t=B.value[e])return t(e);try{return n.getDoc().queryCommandValue(e)}catch(r){}}}function v(e,t){t=t||"exec",a(e,function(e,n){a(n.toLowerCase().split(","),function(n){B[t][n]=e})})}function y(e,t,r){e=e.toLowerCase(),B.exec[e]=function(e,i,o,a){return t.call(r||n,i,o,a)}}function b(e){if(e=e.toLowerCase(),B.exec[e])return!0;try{return n.getDoc().queryCommandSupported(e)}catch(t){}return!1}function C(e,t,r){e=e.toLowerCase(),B.state[e]=function(){return t.call(r||n)}}function x(e,t,r){e=e.toLowerCase(),B.value[e]=function(){return t.call(r||n)}}function w(e){return e=e.toLowerCase(),!!B.exec[e]}function N(e,r,i){return r===t&&(r=h),i===t&&(i=null),n.getDoc().execCommand(e,r,i)}function E(e){return A.match(e)}function _(e,r){A.toggle(e,r?{value:r}:t),n.nodeChanged()}function S(e){L=R.getBookmark(e)}function k(){R.moveToBookmark(L)}var T,R,A,B={state:{},exec:{},value:{}},D=n.settings,L;n.on("PreInit",function(){T=n.dom,R=n.selection,D=n.settings,A=n.formatter}),s(this,{execCommand:p,queryCommandState:m,queryCommandValue:g,queryCommandSupported:b,addCommands:v,addCommand:y,addQueryStateHandler:C,addQueryValueHandler:x,hasCustomCommand:w}),v({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(t){var r=n.getDoc(),i;try{N(t)}catch(o){i=f}if("paste"!==t||r.queryCommandEnabled(t)||(i=!0),i||!r.queryCommandSupported(t)){var a=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");e.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(R.isCollapsed()){var e=R.getNode();return void("A"==e.tagName&&n.dom.remove(e,!0))}A.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"==t&&(t="justify"),a("left,center,right,justify".split(","),function(e){t!=e&&A.remove("align"+e)}),"none"!=t&&_("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;N(e),t=T.getParent(R.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(S(),T.split(n,t),k()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){_(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){_(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=u(D.font_size_style_values),r=u(D.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),_(e,n)},RemoveFormat:function(e){A.remove(e)},mceBlockQuote:function(){_("blockquote")},FormatBlock:function(e,t,n){return _(n||"p")},mceCleanup:function(){var e=R.getBookmark();n.setContent(n.getContent({cleanup:f}),{cleanup:f}),R.moveToBookmark(e)},mceRemoveNode:function(e,t,r){var i=r||R.getNode();i!=n.getBody()&&(S(),n.dom.remove(i,f),k())},mceSelectNodeDepth:function(e,t,r){var i=0;T.getParent(R.getNode(),function(e){return 1==e.nodeType&&i++==r?(R.select(e),h):void 0},n.getBody())},mceSelectNode:function(e,t,n){R.select(n)},mceInsertContent:function(e,t,r){o.insertAtCaret(n,r)},mceInsertRawHTML:function(e,t,r){R.setContent("tiny_mce_marker"),n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return r}))},mceToggleFormat:function(e,t,n){_(n)},mceSetContent:function(e,t,r){n.setContent(r)},"Indent,Outdent":function(e){var t,r,i;t=D.indentation,r=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?N(e):(D.forced_root_block||T.getParent(R.getNode(),T.isBlock)||A.apply("div"),a(R.getSelectedBlocks(),function(o){if("false"!==T.getContentEditable(o)&&"LI"!=o.nodeName){var a=n.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==T.getStyle(o,"direction",!0)?"Right":"Left","outdent"==e?(i=Math.max(0,parseInt(o.style[a]||0,10)-t),T.setStyle(o,a,i?i+r:"")):(i=parseInt(o.style[a]||0,10)+t+r,T.setStyle(o,a,i))}}))},mceRepaint:function(){},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual,n.addVisual()},mceReplaceContent:function(e,t,r){n.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,R.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=T.getParent(R.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||A.remove("link"),n.href&&A.apply("link",n,r)},selectAll:function(){var e=T.getRoot(),t;R.getRng().setStart?(t=T.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),R.setRng(t)):(t=R.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){N("Delete");var e=n.getBody();T.isEmpty(e)&&(n.setContent(""),e.firstChild&&T.isBlock(e.firstChild)?n.selection.setCursorLocation(e.firstChild,0):n.selection.setCursorLocation(e,0))},mceNewDocument:function(){n.setContent("")},InsertLineBreak:function(e,t,o){function a(){for(var e=new i(m,v),t,r=n.schema.getNonEmptyElements();t=e.next();)if(r[t.nodeName.toLowerCase()]||t.length>0)return!0}var s=o,l,c,u,h=R.getRng(!0);new r(T).normalize(h);var p=h.startOffset,m=h.startContainer;if(1==m.nodeType&&m.hasChildNodes()){var g=p>m.childNodes.length-1;m=m.childNodes[Math.min(p,m.childNodes.length-1)]||m,p=g&&3==m.nodeType?m.nodeValue.length:0}var v=T.getParent(m,T.isBlock),y=v?v.nodeName.toUpperCase():"",b=v?T.getParent(v.parentNode,T.isBlock):null,C=b?b.nodeName.toUpperCase():"",x=s&&s.ctrlKey;"LI"!=C||x||(v=b,y=C),m&&3==m.nodeType&&p>=m.nodeValue.length&&(d||a()||(l=T.create("br"),h.insertNode(l),h.setStartAfter(l),h.setEndAfter(l),c=!0)),l=T.create("br"),h.insertNode(l);var w=T.doc.documentMode;return d&&"PRE"==y&&(!w||8>w)&&l.parentNode.insertBefore(T.doc.createTextNode("\r"),l),u=T.create("span",{}," "),l.parentNode.insertBefore(u,l),R.scrollIntoView(u),T.remove(u),c?(h.setStartBefore(l),h.setEndBefore(l)):(h.setStartAfter(l),h.setEndAfter(l)),R.setRng(h),n.undoManager.add(),f}}),v({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=R.isCollapsed()?[T.getParent(R.getNode(),T.isBlock)]:R.getSelectedBlocks(),r=l(n,function(e){return!!A.matchNode(e,t)});return-1!==c(r,f)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return E(e)},mceBlockQuote:function(){return E("blockquote")},Outdent:function(){var e;if(D.inline_styles){if((e=T.getParent(R.getStart(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f;if((e=T.getParent(R.getEnd(),T.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return f}return m("InsertUnorderedList")||m("InsertOrderedList")||!D.inline_styles&&!!T.getParent(R.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=T.getParent(R.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),v({"FontSize,FontName":function(e){var t=0,n;return(n=T.getParent(R.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),v({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}),r(ae,[m],function(e){function t(e,o){var a=this,s,l;if(e=r(e),o=a.settings=o||{},s=o.base_uri,/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(a.source=e);var c=0===e.indexOf("//");0!==e.indexOf("/")||c||(e=(s?s.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(l=o.base_uri?o.base_uri.path:new t(location.href).directory,""===o.base_uri.protocol?e="//mce_host"+a.toAbsPath(l,e):(e=/([^#?]*)([#?]?.*)/.exec(e),e=(s&&s.protocol||"http")+"://mce_host"+a.toAbsPath(l,e[1])+e[2])),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(i,function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),a[t]=r}),s&&(a.protocol||(a.protocol=s.protocol),a.userInfo||(a.userInfo=s.userInfo),a.port||"mce_host"!==a.host||(a.port=s.port),a.host&&"mce_host"!==a.host||(a.host=s.host),a.source=""),c&&(a.protocol="")}var n=e.each,r=e.trim,i="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),o={ftp:21,http:80,https:443,mailto:25};return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(n&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=o[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o];return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t}),r(se,[m],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],"function"==typeof f&&c[d]?u[d]=s(d,f):u[d]=f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(le,[m],function(e){function t(t){function n(){return!1}function r(){return!0}function i(e,i){var o,s,l,c;if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=u),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=r},i.stopPropagation=function(){i.isPropagationStopped=r},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=r},i.isDefaultPrevented=n,i.isPropagationStopped=n,i.isImmediatePropagationStopped=n),t.beforeFire&&t.beforeFire(i),o=d[e])for(s=0,l=o.length;l>s;s++){if(c=o[s],c.once&&a(e,c.func),i.isImmediatePropagationStopped())return i.stopPropagation(),i;if(c.func.call(u,i)===!1)return i.preventDefault(),i}return i}function o(t,r,i,o){var a,s,l;if(r===!1&&(r=n),r)for(r={func:r},o&&e.extend(r,o),s=t.toLowerCase().split(" "),l=s.length;l--;)t=s[l],a=d[t],a||(a=d[t]=[],f(t,!0)),i?a.unshift(r):a.push(r);return c}function a(e,t){var n,r,i,o,a;if(e)for(o=e.toLowerCase().split(" "),n=o.length;n--;){if(e=o[n],r=d[e],!e){for(i in d)f(i,!1),delete d[i];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),d[e]=r);else r.length=0;r.length||(f(e,!1),delete d[e])}}else{for(e in d)f(e,!1);d={}}return c}function s(e,t,n){return o(e,t,n,{once:!0})}function l(e){return e=e.toLowerCase(),!(!d[e]||0===d[e].length)}var c=this,u,d={},f;t=t||{},u=t.scope||c,f=t.toggleEvent||n,c.fire=i,c.on=o,c.off=a,c.once=s,c.has=l}var n=e.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," ");return t.isNative=function(e){return!!n[e.toLowerCase()]},t}),r(ce,[],function(){function e(e){this.create=e.create}return e.create=function(t,n){return new e({create:function(e,r){function i(t){e.set(r,t.value)}function o(e){t.set(n,e.value)}var a;return e.on("change:"+r,o),t.on("change:"+n,i),a=e._bindings,a||(a=e._bindings=[],e.on("destroy",function(){for(var e=a.length;e--;)a[e]()})),a.push(function(){t.off("change:"+n,i)}),t.get(n)}})},e}),r(ue,[le],function(e){function t(t){return t._eventDispatcher||(t._eventDispatcher=new e({scope:t,toggleEvent:function(n,r){e.isNative(n)&&t.toggleNativeEvent&&t.toggleNativeEvent(n,r)}})),t._eventDispatcher}return{fire:function(e,n,r){var i=this;if(i.removed&&"remove"!==e)return n;if(n=t(i).fire(e,n,r),r!==!1&&i.parent)for(var o=i.parent();o&&!n.isPropagationStopped();)o.fire(e,n,!1),o=o.parent();return n},on:function(e,n,r){return t(this).on(e,n,r)},off:function(e,n){return t(this).off(e,n)},once:function(e,n){return t(this).once(e,n)},hasEventListeners:function(e){return t(this).has(e)}}}),r(de,[ce,ue,se,m],function(e,t,n,r){function i(e){return e.nodeType>0}function o(e,t){var n,a;if(e===t)return!0;if(null===e||null===t)return e===t;if("object"!=typeof e||"object"!=typeof t)return e===t;if(r.isArray(t)){if(e.length!==t.length)return!1;for(n=e.length;n--;)if(!o(e[n],t[n]))return!1}if(i(e)||i(t))return e===t;a={};for(n in t){if(!o(e[n],t[n]))return!1;a[n]=!0}for(n in e)if(!a[n]&&!o(e[n],t[n]))return!1;return!0}return n.extend({Mixins:[t],init:function(t){var n,r;t=t||{};for(n in t)r=t[n],r instanceof e&&(t[n]=r.create(this,n));this.data=t},set:function(t,n){var r,i,a=this.data[t];if(n instanceof e&&(n=n.create(this,t)),"object"==typeof t){for(r in t)this.set(r,t[r]);return this}return o(a,n)||(this.data[t]=n,i={target:this,name:t,value:n,oldValue:a},this.fire("change:"+t,i),this.fire("change",i)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(t){return e.create(this,t)},destroy:function(){this.fire("destroy")}})}),r(fe,[se],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.classes.contains(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.pseudo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,h,p;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,p=e,h=0,i=o-1;i>=0;i--)for(c=a[i];p;){if(c.pseudo)for(f=p.parent().items(),u=d=f.length;u--&&f[u]!==p;);for(s=0,l=c.length;l>s;s++)if(!c[s](p,u,d)){s=l+1;break}if(s===l){h++;break}if(i===o-1)break;p=p.parent()}if(h===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(he,[m,fe,se],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].classes.contains(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},e.each("fire on off show hide append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(pe,[d,m,w],function(e,t,n){var r=0,i={id:function(){return"mceu_"+r++},create:function(e,r,i){var o=document.createElement(e);return n.DOM.setAttribs(o,r),"string"==typeof i?o.innerHTML=i:t.each(i,function(e){e.nodeType&&o.appendChild(e)}),o},createFragment:function(e){return n.DOM.createFragment(e)},getWindowSize:function(){return n.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return n.DOM.getPos(e,t||i.getContainer())},getContainer:function(){return e.container?e.container:document.body},getViewPort:function(e){return n.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return n.DOM.addClass(e,t)},removeClass:function(e,t){return n.DOM.removeClass(e,t)},hasClass:function(e,t){return n.DOM.hasClass(e,t)},toggleClass:function(e,t,r){return n.DOM.toggleClass(e,t,r)},css:function(e,t,r){return n.DOM.setStyle(e,t,r)},getRuntimeStyle:function(e,t){return n.DOM.getStyle(e,t,!0)},on:function(e,t,r,i){return n.DOM.bind(e,t,r,i)},off:function(e,t,r){return n.DOM.unbind(e,t,r)},fire:function(e,t,r){return n.DOM.fire(e,t,r)},innerHtml:function(e,t){n.DOM.setHTML(e,t)}};return i}),r(me,[],function(){return{parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}}}}),r(ge,[m],function(e){function t(){}function n(e){this.cls=[],this.cls._map={},this.onchange=e||t,this.prefix=""}return e.extend(n.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){for(var t=0;t0&&(e+=" "),e+=this.prefix+this.cls[t];return e},n}),r(ve,[u],function(e){var t={},n;return{add:function(r){var i=r.parent();if(i){if(!i._layout||i._layout.isNative())return;t[i._id]||(t[i._id]=i),n||(n=!0,e.requestAnimationFrame(function(){var e,r;n=!1;for(e in t)r=t[e],r.state.get("rendered")&&r.reflow();t={}},document.body))}},remove:function(e){t[e._id]&&delete t[e._id]}}}),r(ye,[se,m,le,de,he,pe,g,me,ge,ve],function(e,t,n,r,i,o,a,s,l,c){function u(e){return e._eventDispatcher||(e._eventDispatcher=new n({scope:e,toggleEvent:function(t,r){r&&n.isNative(t)&&(e._nativeEvents||(e._nativeEvents={}),e._nativeEvents[t]=!0,e.state.get("rendered")&&d(e))}})),e._eventDispatcher}function d(e){function t(t){var n=e.getParentCtrl(t.target);n&&n.fire(t.type,t)}function n(){var e=c._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),c._lastHoverCtrl=null)}function r(t){var n=e.getParentCtrl(t.target),r=c._lastHoverCtrl,i=0,o,a,s;if(n!==r){if(c._lastHoverCtrl=n,a=n.parents().toArray().reverse(),a.push(n),r){for(s=r.parents().toArray().reverse(),s.push(r),i=0;i=i;o--)r=s[o],r.fire("mouseleave",{target:r.getEl()})}for(o=i;oo;o++)c=l[o]._eventsRoot;for(c||(c=l[l.length-1]||e),e._eventsRoot=c,s=o,o=0;s>o;o++)l[o]._eventsRoot=c;var p=c._delegates;p||(p=c._delegates={});for(d in u){if(!u)return!1;"wheel"!==d||h?("mouseenter"===d||"mouseleave"===d?c._hasMouseEnter||(a(c.getEl()).on("mouseleave",n).on("mouseover",r),c._hasMouseEnter=1):p[d]||(a(c.getEl()).on(d,t),p[d]=!0),u[d]=!1):f?a(e.getEl()).on("mousewheel",i):a(e.getEl()).on("DOMMouseScroll",i)}}}var f="onmousewheel"in document,h=!1,p="mce-",m,g=0,v={Statics:{classPrefix:p},isRtl:function(){return m.rtl},classPrefix:p,init:function(e){function n(e){var t;for(e=e.split(" "),t=0;tn.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,r.x===n.x&&r.y===n.y&&r.w===n.w&&r.h===n.h||(l=m.repaintControls,l&&l.map&&!l.map[t._id]&&(l.push(t),l.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o,a,s,l,c,u;c=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,i=e._layoutRect,l=e._lastRepaintRect||{},o=e.borderBox,a=o.left+o.right,s=o.top+o.bottom,i.x!==l.x&&(t.left=c(i.x)+"px",l.x=i.x),i.y!==l.y&&(t.top=c(i.y)+"px",l.y=i.y),i.w!==l.w&&(u=c(i.w-a),t.width=(u>=0?u:0)+"px",l.w=i.w),i.h!==l.h&&(u=c(i.h-s),t.height=(u>=0?u:0)+"px",l.h=i.h),e._hasBody&&i.innerW!==l.innerW&&(u=c(i.innerW),r=e.getEl("body"),r&&(n=r.style,n.width=(u>=0?u:0)+"px"),l.innerW=i.innerW),e._hasBody&&i.innerH!==l.innerH&&(u=c(i.innerH),r=r||e.getEl("body"),r&&(n=n||r.style,n.height=(u>=0?u:0)+"px"),l.innerH=i.innerH),e._lastRepaintRect=l,e.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,o.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){function n(e){var t,n;return"string"!=typeof e?e:function(i){return t||r.parentsAndSelf().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t?t.call(n,i):(i.action=e,void this.fire("execute",i))}}var r=this;return u(r).on(e,n(t)),r},off:function(e,t){return u(this).off(e,t),this},fire:function(e,t,n){var r=this;if(t=t||{},t.control||(t.control=r),t=u(r).fire(e,t),n!==!1&&r.parent)for(var i=r.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return u(this).has(e)},parents:function(e){var t=this,n,r=new i;for(n=t.parent();n;n=n.parent())r.add(n);return e&&(r=r.filter(e)),r},parentsAndSelf:function(e){return new i(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=a("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return m.translate?m.translate(e):e},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),r,i; +if(e.items){var o=e.items().toArray();for(i=o.length;i--;)o[i].remove()}n&&n.items&&(r=[],n.items().each(function(t){t!==e&&r.push(t)}),n.items().set(r),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&a(t).off();var s=e.getRoot().controlIdLookup;return s&&delete s[e._id],t&&t.parentNode&&t.parentNode.removeChild(t),e.state.set("rendered",!1),e.state.destroy(),e.fire("remove"),e},renderBefore:function(e){return a(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return a(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'
    '},postRender:function(){var e=this,t=e.settings,n,r,i,o,s;e.$el=a(e.getEl()),e.state.set("rendered",!0);for(o in t)0===o.indexOf("on")&&e.on(o.substr(2),t[o]);if(e._eventsRoot){for(i=e.parent();!s&&i;i=i.parent())s=i._eventsRoot;if(s)for(o in s._nativeEvents)e._nativeEvents[o]=!0}d(e),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e.settings.border&&(r=e.borderBox,e.$el.css({"border-top-width":r.top,"border-right-width":r.right,"border-bottom-width":r.bottom,"border-left-width":r.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var u in e._aria)e.aria(u,e._aria[u]);e.state.get("visible")===!1&&(e.getEl().style.display="none"),e.bindStates(),e.state.on("change:visible",function(t){var n=t.value,r;e.state.get("rendered")&&(e.getEl().style.display=n===!1?"none":"",e.getEl().getBoundingClientRect()),r=e.parent(),r&&(r._lastRect=null),e.fire(n?"show":"hide"),c.add(e)}),e.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){c.remove(this);var e=this.parent();return e._layout&&!e._layout.isNative()&&e.reflow(),this}};return t.each("text title visible disabled active value".split(" "),function(e){v[e]=function(t){return 0===arguments.length?this.state.get(e):("undefined"!=typeof t&&this.state.set(e,t),this)}}),m=e.extend(v)}),r(be,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r(Ce,[],function(){return function(e){function t(e){return e&&1===e.nodeType}function n(e){return e=e||C,t(e)?e.getAttribute("role"):null}function r(e){for(var t,r=e||C;r=r.parentNode;)if(t=n(r))return t}function i(e){var n=C;return t(n)?n.getAttribute("aria-"+e):void 0}function o(e){var t=e.tagName.toUpperCase();return"INPUT"==t||"TEXTAREA"==t||"SELECT"==t}function a(e){return o(e)&&!e.hidden?!0:!!/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(n(e))}function s(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){a(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function d(e,t){var n=-1,r=l();t=t||s(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r;t.parent(e),t.state.get("rendered")||(r=e.getEl("body"),r.hasChildNodes()&&n<=r.childNodes.length-1?a(r.childNodes[n]).before(t.renderHtml()):a(r).append(t.renderHtml()),t.postRender(),l.add(t))}),e._layout.applyClasses(e.items().filter(":visible")),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(l.remove(this),this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(we,[g],function(e){function t(e){var t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}function n(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n").css({position:"absolute",top:0,left:0,width:c.width,height:c.height,zIndex:2147483647,opacity:1e-4,cursor:m}).appendTo(s.body),e(s).on("mousemove touchmove",d).on("mouseup touchend",u),i.start(r)},d=function(e){return n(e),e.button!==l?u(e):(e.deltaX=e.screenX-f,e.deltaY=e.screenY-h,e.preventDefault(),void i.drag(e))},u=function(t){n(t),e(s).off("mousemove touchmove",d).off("mouseup touchend",u),a.remove(),i.stop&&i.stop(t)},this.destroy=function(){e(o()).off()},e(o()).on("mousedown touchstart",c)}}),r(Ne,[g,we],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,h,p,m,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),e(i.getEl("absend")).css(y,i.layoutRect()[l]-1),!c)return void e(f).css("display","none");e(f).css("display","block"),d=i.getEl("body"),h=i.getEl("scroll"+t+"t"),p=d["client"+s]-2*o,p-=n&&r?f["client"+u]:0,m=d["scroll"+s],g=p/m,v={},v[y]=d["offset"+a]+o,v[b]=p,e(f).css(v),v={},v[y]=d["scroll"+a]*g,v[b]=p*g,e(h).css(v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;e(i.getEl()).append('
    '),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e("#"+u).addClass(d+"active")},drag:function(e){var t,u,d,f,h=i.layoutRect();u=h.contentW>h.innerW,d=h.contentH>h.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e("#"+u).removeClass(d+"active")}})}i.classes.add("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e(i.getEl("body")).on("scroll",n)),n())}}}),r(Ee,[xe,Ne],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(_e,[pe],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,h;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t.state.get("fixed")&&"static"==e.getRuntimeStyle(document.body,"position")&&(a-=f.x,s-=f.y),i=t.getEl(),h=e.getSize(i),l=h.width,c=h.height,h=e.getSize(n),u=h.width,d=h.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i.state.get("rendered")?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(Se,[pe],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(ke,[Ee,_e,Se,pe,g,u],function(e,t,n,r,i,o){function a(e,t){for(;e;){if(e==t)return!0;e=e.parent()}}function s(e){for(var t=v.length;t--;){var n=v[t],r=n.getParentCtrl(e.target);if(n.settings.autohide){if(r&&(a(r,n)||n.parent()===r))continue;e=n.fire("autohide",{target:e.target}),e.isDefaultPrevented()||n.hide()}}}function l(){p||(p=function(e){2!=e.button&&s(e)},i(document).on("click touchstart",p))}function c(){m||(m=function(){var e;for(e=v.length;e--;)d(v[e])},i(window).on("scroll",m))}function u(){if(!g){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;g=function(){document.all&&t==e.clientWidth&&n==e.clientHeight||(t=e.clientWidth,n=e.clientHeight,C.hideAll())},i(window).on("resize",g)}}function d(e){function t(t,n){for(var r,i=0;in&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY
    ').appendTo(t.getContainerElm())),o.setTimeout(function(){n.addClass(r+"in"),i(t.getEl()).addClass(r+"in")}),b=!0),f(!0,t)}}),t.on("show",function(){t.parents().each(function(e){return e.state.get("fixed")?(t.fixed(!0),!1):void 0})}),e.popover&&(t._preBodyHtml='
    ',t.classes.add("popover").add("bottom").add(t.isRtl()?"end":"start")),t.aria("label",e.ariaLabel),t.aria("labelledby",t._id),t.aria("describedby",t.describedBy||t._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!=e){if(t.state.get("rendered")){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e=this,t,n=e._super();for(t=v.length;t--&&v[t]!==e;);return-1===t&&v.push(e),n},hide:function(){return h(this),f(!1,this),this._super()},hideAll:function(){C.hideAll()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||(e.remove(),f(!1,e)),e},remove:function(){h(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return C.hideAll=function(){for(var e=v.length;e--;){var t=v[e];t&&t.settings.autohide&&(t.hide(),v.splice(e,1))}},C}),r(Te,[ke,Ee,pe,g,we,me,d,u],function(e,t,n,r,i,o,a,s){function l(e){var t="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0",n=r("meta[name=viewport]")[0],i;a.overrideViewPort!==!1&&(n||(n=document.createElement("meta"),n.setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),i=n.getAttribute("content"),i&&"undefined"!=typeof f&&(f=i),n.setAttribute("content",e?t:f))}function c(e){for(var t=0;tr.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=e.settings.x||Math.max(0,a.w/2-t.w/2),t.y=e.settings.y||Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,i=document.documentElement,a,l=t.classPrefix,c;if(e!=t._fullscreen)if(r(window).on("resize",function(){var e;if(t._fullscreen)if(a)t._timer||(t._timer=s.setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(a=!0)}}),c=t.layoutRect(),t._fullscreen=e,e){t._initial={x:c.x,y:c.y,w:c.w,h:c.h},t.borderBox=o.parseBox("0"),t.getEl("head").style.display="none",c.deltaH-=c.headerH+2,r([i,document.body]).addClass(l+"fullscreen"),t.classes.add("fullscreen");var u=n.getWindowSize();t.moveTo(0,0).resizeTo(u.w,u.h)}else t.borderBox=o.parseBox(t.settings.border),t.getEl("head").style.display="",c.deltaH+=c.headerH,r([i,document.body]).removeClass(l+"fullscreen"),t.classes.remove("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.classes.add("in"),e.fire("open")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new i(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()}),d.push(e),l(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),t=d.length;t--;)d[t]===e&&d.splice(t,1);l(d.length>0),c(e.classPrefix)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});return u(),h}),r(Re,[Te],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){function r(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),o(t)}}}var i,o=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:i=[r("Ok",!0,!0),r("Cancel",!1)];break;case t.YES_NO:case t.YES_NO_CANCEL:i=[r("Yes",1,!0),r("No",0)],n.buttons==t.YES_NO_CANCEL&&i.push(r("Cancel",-1));break;default:i=[r("Ok",!0,!0)]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:i,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){o(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(Ae,[Te,Re],function(e,t){return function(n){function r(){return s.length?s[s.length-1]:void 0}function i(e){n.fire("OpenWindow",{win:e})}function o(e){n.fire("CloseWindow",{win:e})}var a=this,s=[];a.windows=s,n.on("remove",function(){for(var e=s.length;e--;)s[e].close()}),a.open=function(t,r){var a;return n.editorManager.setActive(n),t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body,data:t.data,callbacks:t.commands}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){a.find("form")[0].submit()}},{text:"Cancel",onclick:function(){a.close()}}]),a=new e(t),s.push(a),a.on("close",function(){for(var e=s.length;e--;)s[e]===a&&s.splice(e,1);s.length||n.focus(),o(a)}),t.data&&a.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),a.features=t||{},a.params=r||{},1===s.length&&n.nodeChanged(),a=a.renderTo().reflow(),i(a),a},a.alert=function(e,r,a){var s;s=t.alert(e,function(){r?r.call(a||this):n.focus()}),s.on("close",function(){o(s)}),i(s)},a.confirm=function(e,n,r){var a;a=t.confirm(e,function(e){n.call(r||this,e)}),a.on("close",function(){o(a)}),i(a)},a.close=function(){r()&&r().close()},a.getParams=function(){return r()?r().params:null},a.setParams=function(e){r()&&(r().params=e)},a.getWindows=function(){return s}}}),r(Be,[ye,_e],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(De,[ye,Be],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.classes.toggle("tooltip-n","bc-tc"==i),r.classes.toggle("tooltip-nw","bc-tl"==i),r.classes.toggle("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){function e(e){n.aria("disabled",e),n.classes.toggle("disabled",e)}function t(e){n.aria("pressed",e),n.classes.toggle("active",e)}var n=this;return n.state.on("change:disabled",function(t){e(t.value)}),n.state.on("change:active",function(e){t(e.value)}),n.state.get("disabled")&&e(!0),n.state.get("active")&&t(!0),n._super()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Le,[De],function(e){return e.extend({Defaults:{value:0},init:function(e){var t=this;t._super(e),t.classes.add("progress"),t.settings.filter||(t.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this,t=e._id,n=this.classPrefix;return'
    0%
    '},postRender:function(){var e=this;return e._super(),e.value(e.settings.value),e},bindStates:function(){function e(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}var t=this;return t.state.on("change:value",function(t){e(t.value)}),e(t.state.get("value")),t._super()}})}),r(Me,[ye,_e,Le,u],function(e,t,n,r){return e.extend({Mixins:[t],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||e.timeout>0)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new n),t.on("click",function(e){-1!=e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e=this,t=e.classPrefix,n="",r="",i="",o="";return e.icon&&(n=''),e.color&&(o=' style="background-color: '+e.color+'"'),e.closeButton&&(r=''),e.progressBar&&(i=e.progressBar.renderHtml()),'"},postRender:function(){var e=this;return r.setTimeout(function(){e.$el.addClass(e.classPrefix+"in")}),e._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().childNodes[1].innerHTML=t.value}),e.progressBar&&e.progressBar.bindStates(),e._super()},close:function(){var e=this;return e.fire("close").isDefaultPrevented()||e.remove(),e},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(Pe,[Me,u],function(e,t){return function(n){function r(){return l.length?l[l.length-1]:void 0}function i(){t.requestAnimationFrame(function(){o(),a()})}function o(){for(var e=0;e0){var e=l.slice(0,1)[0],t=n.inline?n.getElement():n.getContentAreaContainer();if(e.moveRel(t,"tc-tc"),l.length>1)for(var r=1;r0&&(r.timer=setTimeout(function(){r.close()},t.timeout)),r.on("close",function(){var e=l.length;for(r.timer&&n.getWin().clearTimeout(r.timer);e--;)l[e]===r&&l.splice(e,1);a()}),r.renderTo(),a(),r},s.close=function(){r()&&r().close()},s.getNotifications=function(){return l},n.on("SkinLoaded",function(){var e=n.settings.service_message;e&&n.notificationManager.open({text:e,type:"warning",timeout:0,icon:""})})}}),r(Oe,[w],function(e){function t(t,n,r){for(var i=[];n&&n!=t;n=n.parentNode)i.push(e.nodeIndex(n,r));return i}function n(e,t){var n,r,i;for(r=e,n=t.length-1;n>=0;n--){if(i=r.childNodes,t[n]>i.length-1)return null;r=i[t[n]]}return r}return{create:t,resolve:n}}),r(He,[I,T,y,Oe,A,C,d,m,u,k,$,ne],function(e,t,n,r,i,o,a,s,l,c,u,d){return function(f){function h(e,t){try{f.getDoc().execCommand(e,!1,t)}catch(n){}}function p(){var e=f.getDoc().documentMode;return e?e:6}function m(e){return e.isDefaultPrevented()}function g(e){var t,n;e.dataTransfer&&(f.selection.isCollapsed()&&"IMG"==e.target.tagName&&re.select(e.target),t=f.selection.getContent(),t.length>0&&(n=ue+escape(f.id)+","+escape(t),e.dataTransfer.setData(de,n)))}function v(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(de),t&&t.indexOf(ue)>=0)?(t=t.substr(ue.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}function y(e){f.queryCommandSupported("mceInsertClipboardContent")?f.execCommand("mceInsertClipboardContent",!1,{content:e}):f.execCommand("mceInsertContent",!1,e)}function b(){function i(e){var t=C.schema.getBlockElements(),n=f.getBody();if("BR"!=e.nodeName)return!1;for(;e!=n&&!t[e.nodeName];e=e.parentNode)if(e.nextSibling)return!1;return!0}function o(e,t){var n;for(n=e.nextSibling;n&&n!=t;n=n.nextSibling)if((3!=n.nodeType||0!==Z.trim(n.data).length)&&n!==t)return!1;return n===t}function a(e,t,r){var o,a,s;for(s=C.schema.getNonEmptyElements(),o=new n(r||e,e);a=o[t?"next":"prev"]();){if(s[a.nodeName]&&!i(a))return a;if(3==a.nodeType&&a.data.length>0)return a}}function c(e){var n,r,i,o,s;if(!e.collapsed&&(n=C.getParent(t.getNode(e.startContainer,e.startOffset),C.isBlock), +r=C.getParent(t.getNode(e.endContainer,e.endOffset),C.isBlock),s=f.schema.getTextBlockElements(),n!=r&&s[n.nodeName]&&s[r.nodeName]&&"false"!==C.getContentEditable(n)&&"false"!==C.getContentEditable(r)))return e.deleteContents(),i=a(n,!1),o=a(r,!0),C.isEmpty(r)||Z(n).append(r.childNodes),Z(r).remove(),i?1==i.nodeType?"BR"==i.nodeName?(e.setStartBefore(i),e.setEndBefore(i)):(e.setStartAfter(i),e.setEndAfter(i)):(e.setStart(i,i.data.length),e.setEnd(i,i.data.length)):o&&(1==o.nodeType?(e.setStartBefore(o),e.setEndBefore(o)):(e.setStart(o,0),e.setEnd(o,0))),x.setRng(e),!0}function u(e,n){var r,i,s,l,c,u;if(!e.collapsed)return e;if(c=e.startContainer,u=e.startOffset,3==c.nodeType)if(n){if(u0)return e;if(r=t.getNode(e.startContainer,e.startOffset),s=C.getParent(r,C.isBlock),i=a(f.getBody(),n,r),l=C.getParent(i,C.isBlock),!r||!i)return e;if(l&&s!=l)if(n){if(!o(s,l))return e;1==r.nodeType?"BR"==r.nodeName?e.setStartBefore(r):e.setStartAfter(r):e.setStart(r,r.data.length),1==i.nodeType?e.setEnd(i,0):e.setEndBefore(i)}else{if(!o(l,s))return e;1==i.nodeType?"BR"==i.nodeName?e.setStartBefore(i):e.setStartAfter(i):e.setStart(i,i.data.length),1==r.nodeType?e.setEnd(r,0):e.setEndBefore(r)}return e}function d(e){var t=x.getRng();return t=u(t,e),c(t)?!0:void 0}function h(e,t){function n(e,n){return m=Z(n).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),l=e.cloneNode(!1),m=s.map(m,function(e){return e=e.cloneNode(!1),l.hasChildNodes()?(e.appendChild(l.firstChild),l.appendChild(e)):l.appendChild(e),l.appendChild(e),e}),m.length?(p=C.create("br"),m[0].appendChild(p),C.replace(l,e),t.setStartBefore(p),t.setEndBefore(p),f.selection.setRng(t),p):null}function i(e){return e&&f.schema.getTextBlockElements()[e.tagName]}var o,a,l,c,u,d,h,p,m;if(t.collapsed&&(d=t.startContainer,h=t.startOffset,a=C.getParent(d,C.isBlock),i(a)))if(1==d.nodeType){if(d=d.childNodes[h],d&&"BR"!=d.tagName)return;if(u=e?a.nextSibling:a.previousSibling,C.isEmpty(a)&&i(u)&&C.isEmpty(u)&&n(a,d))return C.remove(u),!0}else if(3==d.nodeType){if(o=r.create(a,d),c=a.cloneNode(!0),d=r.resolve(c,o),e){if(h>=d.data.length)return;d.deleteData(h,1)}else{if(0>=h)return;d.deleteData(h-1,1)}if(C.isEmpty(c))return n(a,d)}}function p(e){var t,n,r;d(e)||(s.each(f.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&f.dom.setAttrib(e,"style",f.dom.getAttrib(e,"style"))}),t=new w(function(){}),t.observe(f.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),f.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null),n=f.selection.getRng(),r=n.startContainer.parentNode,s.each(t.takeRecords(),function(e){if(C.isChildOf(e.target,f.getBody())){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}s.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),C.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),f.selection.setRng(n))}})}}),t.disconnect(),s.each(f.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")}))}var b=f.getDoc(),C=f.dom,x=f.selection,w=window.MutationObserver,N,E;w||(N=!0,w=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMSubtreeModified",e,!1),r.removeEventListener("DOMNodeInsertedIntoDocument",e,!1),r.removeEventListener("DOMNodeInserted",e,!1),r.removeEventListener("DOMAttrModified",t,!1)},this.takeRecords=function(){return n}}),f.on("keydown",function(e){var t=e.keyCode==te,n=e.ctrlKey||e.metaKey;if(!m(e)&&(t||e.keyCode==ee)){var r=f.selection.getRng(),i=r.startContainer,o=r.startOffset;if(t&&e.shiftKey)return;if(h(t,r))return void e.preventDefault();if(!n&&r.collapsed&&3==i.nodeType&&(t?o0))return;e.preventDefault(),n&&f.selection.getSel().modify("extend",t?"forward":"backward",e.metaKey?"lineboundary":"word"),p(t)}}),f.on("keypress",function(t){if(!m(t)&&!x.isCollapsed()&&t.charCode>31&&!e.metaKeyPressed(t)){var n,r,i,o,a,s;n=f.selection.getRng(),s=String.fromCharCode(t.charCode),t.preventDefault(),r=Z(n.startContainer).parents().filter(function(e,t){return!!f.schema.getTextInlineElements()[t.nodeName]}),p(!0),r=r.filter(function(e,t){return!Z.contains(f.getBody(),t)}),r.length?(i=C.createFragment(),r.each(function(e,t){t=t.cloneNode(!1),i.hasChildNodes()?(t.appendChild(i.firstChild),i.appendChild(t)):(a=t,i.appendChild(t)),i.appendChild(t)}),a.appendChild(f.getDoc().createTextNode(s)),o=C.getParent(n.startContainer,C.isBlock),C.isEmpty(o)?Z(o).empty().append(i):n.insertNode(i),n.setStart(a.firstChild,1),n.setEnd(a.firstChild,1),f.selection.setRng(n)):f.selection.setContent(s)}}),f.addCommand("Delete",function(){p()}),f.addCommand("ForwardDelete",function(){p(!0)}),N||(f.on("dragstart",function(e){E=x.getRng(),g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);n&&(e.preventDefault(),l.setEditorTimeout(f,function(){var r=t.getCaretRangeFromPoint(e.x,e.y,b);E&&(x.setRng(E),E=null),p(),x.setRng(r),y(n.html)}))}}),f.on("cut",function(e){m(e)||!e.clipboardData||f.selection.isCollapsed()||(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",f.selection.getContent()),e.clipboardData.setData("text/plain",f.selection.getContent({format:"text"})),l.setEditorTimeout(f,function(){p(!0)}))}))}function C(){function e(e){var t=ne.create("body"),n=e.cloneContents();return t.appendChild(n),re.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(f.getBody()),t.compareRanges(n,r)}var i=e(n),o=ne.createRng();o.selectNode(f.getBody());var a=e(o);return i===a}f.on("keydown",function(e){var t=e.keyCode,r,i;if(!m(e)&&(t==te||t==ee)){if(r=f.selection.isCollapsed(),i=f.getBody(),r&&!ne.isEmpty(i))return;if(!r&&!n(f.selection.getRng()))return;e.preventDefault(),f.setContent(""),i.firstChild&&ne.isBlock(i.firstChild)?f.selection.setCursorLocation(i.firstChild,0):f.selection.setCursorLocation(i,0),f.nodeChanged()}})}function x(){f.shortcuts.add("meta+a",null,"SelectAll")}function w(){f.settings.content_editable||ne.bind(f.getDoc(),"mousedown mouseup",function(e){var t;if(e.target==f.getDoc().documentElement)if(t=re.getRng(),f.getBody().focus(),"mousedown"==e.type){if(c.isCaretContainer(t.startContainer))return;re.placeCaretAt(e.clientX,e.clientY)}else re.setRng(t)})}function N(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee){if(!f.getBody().getElementsByTagName("hr").length)return;if(re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return ne.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(ne.remove(n),e.preventDefault())}}})}function E(){window.Range.prototype.getClientRects||f.on("mousedown",function(e){if(!m(e)&&"HTML"===e.target.nodeName){var t=f.getBody();t.blur(),l.setEditorTimeout(f,function(){t.focus()})}})}function _(){f.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==ne.getContentEditableParent(t)&&(e.preventDefault(),re.getSel().setBaseAndExtent(t,0,t,1),f.nodeChanged()),"A"==t.nodeName&&ne.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),re.select(t))})}function S(){function e(){var e=ne.getAttribs(re.getStart().cloneNode(!1));return function(){var t=re.getStart();t!==f.getBody()&&(ne.setAttrib(t,"style",null),Q(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!re.isCollapsed()&&ne.getParent(re.getStart(),ne.isBlock)!=ne.getParent(re.getEnd(),ne.isBlock)}f.on("keypress",function(n){var r;return m(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),f.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),ne.bind(f.getDoc(),"cut",function(n){var r;!m(n)&&t()&&(r=e(),l.setEditorTimeout(f,function(){r()}))})}function k(){document.body.setAttribute("role","application")}function T(){f.on("keydown",function(e){if(!m(e)&&e.keyCode===ee&&re.isCollapsed()&&0===re.getRng(!0).startOffset){var t=re.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function R(){p()>7||(h("RespectVisibilityInDesign",!0),f.contentStyles.push(".mceHideBrInPre pre br {display: none}"),ne.addClass(f.getBody(),"mceHideBrInPre"),oe.addNodeFilter("pre",function(e){for(var t=e.length,n,r,o,a;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)o=n[r],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new i("#text",3),o,!0).value="\n"}),ae.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function A(){ne.bind(f.getBody(),"mouseup",function(){var e,t=re.getNode();"IMG"==t.nodeName&&((e=ne.getStyle(t,"width"))&&(ne.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"width","")),(e=ne.getStyle(t,"height"))&&(ne.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),ne.setStyle(t,"height","")))})}function B(){f.on("keydown",function(t){var n,r,i,o,a;if(!m(t)&&t.keyCode==e.BACKSPACE&&(n=re.getRng(),r=n.startContainer,i=n.startOffset,o=ne.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(f.formatter.toggle("blockquote",null,a),n=ne.createRng(),n.setStart(r,0),n.setEnd(r,0),re.setRng(n))}})}function D(){function e(){K(),h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),ie.object_resizing||h("enableObjectResizing",!1)}ie.readonly||f.on("BeforeExecCommand MouseDown",e)}function L(){function e(){Q(ne.select("a"),function(e){var t=e.parentNode,n=ne.getRoot();if(t.lastChild===e){for(;t&&!ne.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}ne.add(t,"br",{"data-mce-bogus":1})}})}f.on("SetContent ExecCommand",function(t){"setcontent"!=t.type&&"mceInsertLink"!==t.command||e()})}function M(){ie.forced_root_block&&f.on("init",function(){h("DefaultParagraphSeparator",ie.forced_root_block)})}function P(){f.on("keydown",function(e){var t;m(e)||e.keyCode!=ee||(t=f.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),f.undoManager.beforeChange(),ne.remove(t.item(0)),f.undoManager.add()))})}function O(){var e;p()>=10&&(e="",Q("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),f.contentStyles.push(e+"{padding-right: 1px !important}"))}function H(){p()<9&&(oe.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),ae.addNodeFilter("noscript",function(e){for(var t=e.length,n,r,a;t--;)n=e[t],r=e[t].firstChild,r?r.value=o.decode(r.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),r=new i("#text",3),r.value=a,r.raw=!0,n.append(r)))}))}function I(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),ne.unbind(r,"mouseup",n),ne.unbind(r,"mousemove",t),a=o=0}var r=ne.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,ne.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(ne.bind(r,"mouseup",n),ne.bind(r,"mousemove",t),ne.getRoot().focus(),a.select())}})}function F(){f.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||re.normalize()},!0)}function z(){f.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function U(){f.inline||f.on("keydown",function(){document.activeElement==document.body&&f.getWin().focus()})}function W(){f.inline||(f.contentStyles.push("body {min-height: 150px}"),f.on("click",function(e){var t;if("HTML"==e.target.nodeName){if(a.ie>11)return void f.getBody().focus();t=f.selection.getRng(),f.getBody().focus(),f.selection.setRng(t),f.selection.normalize(),f.nodeChanged()}}))}function V(){a.mac&&f.on("keydown",function(t){!e.metaKeyPressed(t)||t.shiftKey||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),f.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","lineboundary"))})}function $(){h("AutoUrlDetect",!1)}function q(){f.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),f.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function j(){f.on("init",function(){f.dom.bind(f.getBody(),"submit",function(e){e.preventDefault()})})}function Y(){oe.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function X(){f.on("dragstart",function(e){g(e)}),f.on("drop",function(e){if(!m(e)){var n=v(e);if(n&&n.id!=f.id){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,f.getDoc());re.setRng(r),y(n.html)}}})}function K(){var e,t;G()&&(e=f.getBody(),t=e.parentNode,t.removeChild(e),t.appendChild(e),e.focus())}function G(){var e;return se?(e=f.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}function J(){function t(e){var t=new d(e.getBody()),n=e.selection.getRng(),r=u.fromRangeStart(n),i=u.fromRangeEnd(n);return!e.selection.isCollapsed()&&!t.prev(r)&&!t.next(i)}f.on("keypress",function(n){!m(n)&&!re.isCollapsed()&&n.charCode>31&&!e.metaKeyPressed(n)&&t(f)&&(n.preventDefault(),f.setContent(String.fromCharCode(n.charCode)),f.selection.select(f.getBody(),!0),f.selection.collapse(!1),f.nodeChanged())}),f.on("keydown",function(e){var n=e.keyCode;m(e)||n!=te&&n!=ee||t(f)&&(e.preventDefault(),f.setContent(""),f.nodeChanged())})}var Q=s.each,Z=f.$,ee=e.BACKSPACE,te=e.DELETE,ne=f.dom,re=f.selection,ie=f.settings,oe=f.parser,ae=f.serializer,se=a.gecko,le=a.ie,ce=a.webkit,ue="data:text/mce-internal,",de=le?"Text":"URL";return B(),C(),a.windowsPhone||F(),ce&&(J(),b(),w(),_(),M(),j(),T(),Y(),a.iOS?(U(),W(),q()):x()),le&&a.ie<11&&(N(),k(),R(),A(),P(),O(),H(),I()),a.ie>=11&&(W(),T()),a.ie&&(x(),$(),X()),se&&(J(),N(),E(),S(),D(),L(),z(),V(),T()),{refreshContentEditable:K,isHidden:G}}}),r(Ie,[ue,w,m],function(e,t,n){function r(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=o.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()}function i(e,t){function n(e){return!e.hidden&&!e.readonly}var i=r(e,t),s;if(e.delegates||(e.delegates={}),!e.delegates[t])if(e.settings.event_root){if(a||(a={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&a){for(t in a)e.dom.unbind(r(e,t));a=null}})),a[t])return;s=function(r){for(var i=r.target,a=e.editorManager.editors,s=a.length;s--;){var l=a[s].getBody();(l===i||o.isChildOf(i,l))&&n(a[s])&&a[s].fire(t,r)}},a[t]=s,o.bind(i,t,s)}else s=function(r){n(e)&&e.fire(t,r)},o.bind(i,t,s),e.delegates[t]=s}var o=t.DOM,a,s={bindPendingEventDelegates:function(){var e=this;n.each(e._pendingNativeEvents,function(t){i(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!=e&&"blur"!=e&&(t?n.initialized?i(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(r(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t;if(e.delegates){for(t in e.delegates)e.dom.unbind(r(e,t),t,e.delegates[t]);delete e.delegates}e.inline||(e.getBody().onload=null,e.dom.unbind(e.getWin()),e.dom.unbind(e.getDoc())),e.dom.unbind(e.getBody()),e.dom.unbind(e.getContainer())}};return s=n.extend({},e,s)}),r(Fe,[],function(){function e(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}}function t(e){var t,n;return t=e.getBody(),n=function(t){e.dom.getParents(t.target,"a").length>0&&t.preventDefault()},e.dom.bind(t,"click",n),{unbind:function(){e.dom.unbind(t,"click",n)}}}function n(n,r){n._clickBlocker&&(n._clickBlocker.unbind(),n._clickBlocker=null),r?(n._clickBlocker=t(n),n.selection.controlSelection.hideResizeRect(),n.readonly=!0,n.getBody().contentEditable=!1):(n.readonly=!1,n.getBody().contentEditable=!0,e(n,"StyleWithCSS",!1),e(n,"enableInlineTableEditing",!1),e(n,"enableObjectResizing",!1),n.focus(),n.nodeChanged())}function r(e,t){var r=e.readonly?"readonly":"design";t!=r&&(e.initialized?n(e,"readonly"==t):e.on("init",function(){n(e,"readonly"==t)}),e.fire("SwitchMode",{mode:t}))}return{setMode:r}}),r(ze,[m,d],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122},o=e.makeMap("alt,ctrl,shift,meta,access");return function(a){function s(e){var a,s,l={};n(r(e,"+"),function(e){e in o?l[e]=!0:/^[0-9]{2,}$/.test(e)?l.keyCode=parseInt(e,10):(l.charCode=e.charCodeAt(0),l.keyCode=i[e]||e.toUpperCase().charCodeAt(0))}),a=[l.keyCode];for(s in o)l[s]?a.push(s):l[s]=!1;return l.id=a.join(","),l.access&&(l.alt=!0,t.mac?l.ctrl=!0:l.shift=!0),l.meta&&(t.mac?l.meta=!0:(l.ctrl=!0,l.meta=!1)),l}function l(t,n,i,o){var l;return l=e.map(r(t,">"),s),l[l.length-1]=e.extend(l[l.length-1],{func:i,scope:o||a}),e.extend(l[0],{desc:a.translate(n),subpatterns:l.slice(1)})}function c(e){return e.altKey||e.ctrlKey||e.metaKey}function u(e){return e.keyCode>=112&&e.keyCode<=123}function d(e,t){return t?t.ctrl!=e.ctrlKey||t.meta!=e.metaKey?!1:t.alt!=e.altKey||t.shift!=e.shiftKey?!1:e.keyCode==t.keyCode||e.charCode&&e.charCode==t.charCode?(e.preventDefault(),!0):!1:!1}function f(e){return e.func?e.func.call(e.scope):null}var h=this,p={},m=[];a.on("keyup keypress keydown",function(e){!c(e)&&!u(e)||e.isDefaultPrevented()||(n(p,function(t){return d(e,t)?(m=t.subpatterns.slice(0),"keydown"==e.type&&f(t),!0):void 0}),d(e,m[0])&&(1===m.length&&"keydown"==e.type&&f(m[0]),m.shift()))}),h.add=function(t,i,o,s){var c;return c=o,"string"==typeof o?o=function(){a.execCommand(c,!1,null)}:e.isArray(c)&&(o=function(){a.execCommand(c[0],c[1],c[2])}),n(r(e.trim(t.toLowerCase())),function(e){var t=l(e,i,o,s);p[t.id]=t}),!0},h.remove=function(e){var t=l(e);return p[t.id]?(delete p[t.id],!0):!1}}}),r(Ue,[c,m,z],function(e,t,n){return function(r,i){function o(e){var t,n;return n={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"},t=n[e.blob().type.toLowerCase()]||"dat",e.id()+"."+t}function a(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t}function s(e){return{id:e.id,blob:e.blob,base64:e.base64,filename:n.constant(o(e))}}function l(e,t,n,r){var s,l;s=new XMLHttpRequest,s.open("POST",i.url),s.withCredentials=i.credentials,s.upload.onprogress=function(e){r(e.loaded/e.total*100)},s.onerror=function(){n("Image upload failed due to a XHR Transport error. Code: "+s.status)},s.onload=function(){var e;return 200!=s.status?void n("HTTP Error: "+s.status):(e=JSON.parse(s.responseText),e&&"string"==typeof e.location?void t(a(i.basePath,e.location)):void n("Invalid JSON: "+s.responseText))},l=new FormData,l.append("file",e.blob(),o(e)),s.send(l)}function c(){return new e(function(e){e([])})}function u(e,t){return{url:t,blobInfo:e,status:!0}}function d(e,t){return{url:"",blobInfo:e,status:!1,error:t}}function f(e,n){t.each(y[e],function(e){e(n)}),delete y[e]}function h(t,n,i){return r.markPending(t.blobUri()),new e(function(e){var o,a,l=function(){};try{var c=function(){o&&(o.close(),a=l)},h=function(n){c(),r.markUploaded(t.blobUri(),n),f(t.blobUri(),u(t,n)),e(u(t,n))},p=function(){c(),r.removeFailed(t.blobUri()),f(t.blobUri(),d(t,p)),e(d(t,p))};a=function(e){0>e||e>100||(o||(o=i()),o.progressBar.value(e))},n(s(t),h,p,a)}catch(m){e(d(t,m.message))}})}function p(e){return e===l}function m(t){var n=t.blobUri();return new e(function(e){y[n]=y[n]||[],y[n].push(e)})}function g(n,o){return n=t.grep(n,function(e){return!r.isUploaded(e.blobUri())}),e.all(t.map(n,function(e){return r.isPending(e.blobUri())?m(e):h(e,i.handler,o)}))}function v(e,t){return!i.url&&p(i.handler)?c():g(e,t)}var y={};return i=t.extend({credentials:!1,handler:l},i),{upload:v}}}),r(We,[c],function(e){function t(t){return new e(function(e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200==this.status&&e(this.response)},n.send()})}function n(e){var t,n;return e=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(e[0]),n&&(t=n[1]),{type:t,data:e[1]}}function r(t){return new e(function(e){var r,i,o;t=n(t);try{r=atob(t.data)}catch(a){return void e(new Blob([]))}for(i=new Uint8Array(r.length),o=0;o0&&(n&&(l*=-1),r.left+=l,r.right+=l),r}function l(){var n,r,o,a,s;for(n=i("*[contentEditable=false]",t),a=0;a
    ').css(l).appendTo(t),o&&m.addClass("mce-visual-caret-before"),d(),c=a.ownerDocument.createRange(),f=g.firstChild,c.setStart(f,0),c.setEnd(f,1),c):(g=e.insertInline(a,o),c=a.ownerDocument.createRange(),s(g.nextSibling)?(c.setStart(g,0),c.setEnd(g,0)):(c.setStart(g,1),c.setEnd(g,1)),c)}function u(){l(),g&&(e.remove(g),g=null),m&&(m.remove(),m=null),clearInterval(p)}function d(){p=a.setInterval(function(){i("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden")},500)}function f(){a.clearInterval(p)}function h(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"}var p,m,g;return{show:c,hide:u,getCss:h,destroy:f}}}),r(Xe,[p,_,W],function(e,t,n){function r(i){function o(t){return e.map(t,function(e){return e=n.clone(e),e.node=i,e})}if(e.isArray(i))return e.reduce(i,function(e,t){return e.concat(r(t))},[]);if(t.isElement(i))return o(i.getClientRects());if(t.isText(i)){var a=i.ownerDocument.createRange();return a.setStart(i,0),a.setEnd(i,i.data.length),o(a.getClientRects())}}return{getClientRects:r}}),r(Ke,[z,p,Xe,U,te,ne,$,W],function(e,t,n,r,i,o,a,s){function l(e,t,n,o){for(;o=i.findNode(o,e,r.isEditableCaretCandidate,t);)if(n(o))return}function c(e,r,i,o,a,s){function c(o){var s,l,c;for(c=n.getClientRects(o),-1==e&&(c=c.reverse()),s=0;s0&&r(l,t.last(f))&&u++,l.line=u,a(l))return!0;f.push(l)}}var u=0,d,f=[],h;return(h=t.last(s.getClientRects()))?(d=s.getNode(),c(d),l(e,o,c,d),f):f}function u(e,t){return t.line>e}function d(e,t){return t.line===e}function f(e,n,r,i){function l(n){return 1==e?t.last(n.getClientRects()):t.last(n.getClientRects())}var c=new o(n),u,d,f,h,p=[],m=0,g,v;1==e?(u=c.next,d=s.isBelow,f=s.isAbove,h=a.after(i)):(u=c.prev,d=s.isAbove,f=s.isBelow,h=a.before(i)),v=l(h);do if(h.isVisible()&&(g=l(h),!f(g,v))){if(p.length>0&&d(g,t.last(p))&&m++,g=s.clone(g),g.position=h,g.line=m,r(g))return p;p.push(g)}while(h=u(h));return p}var h=e.curry,p=h(c,-1,s.isAbove,s.isBelow),m=h(c,1,s.isBelow,s.isAbove);return{upUntil:p,downUntil:m,positionsUntil:f,isAboveLine:h(u),isLine:h(d)}}),r(Ge,[z,p,_,Xe,W,te,U],function(e,t,n,r,i,o,a){function s(e,t){return Math.abs(e.left-t)}function l(e,t){return Math.abs(e.right-t)}function c(e,n){function r(e,t){return e>=t.left&&e<=t.right}return t.reduce(e,function(e,t){var i,o;return i=Math.min(s(e,n),l(e,n)),o=Math.min(s(t,n),l(t,n)),r(n,t)?t:r(n,e)?e:o==i&&m(t.node)?t:i>o?t:e})}function u(e,t,n,r){for(;r=g(r,e,a.isEditableCaretCandidate,t);)if(n(r))return}function d(e,n){function o(e,i){var o;return o=t.filter(r.getClientRects(i),function(t){return!e(t,n)}),a=a.concat(o),0===o.length}var a=[];return a.push(n),u(-1,e,v(o,i.isAbove),n.node),u(1,e,v(o,i.isBelow),n.node),a}function f(e){return t.filter(t.toArray(e.getElementsByTagName("*")),m)}function h(e,t){return{node:e.node,before:s(e,t)=e.top&&i<=e.bottom}),a=c(o,n),a&&(a=c(d(e,a),n),a&&m(a.node))?h(a,n):null}var m=n.isContentEditableFalse,g=o.findNode,v=e.curry;return{findClosestClientRect:c,findLineNodeRects:d,closestCaret:p}}),r(Je,[],function(){var e=function(e){var t,n,r,i;return i=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:i.top+r.pageYOffset-n.clientTop,left:i.left+r.pageXOffset-n.clientLeft}},t=function(t){return t.inline?e(t.getBody()):{left:0,top:0}},n=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},i={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:i},i=function(t,n){if(n.target.ownerDocument!==t.getDoc()){var i=e(t.getContentAreaContainer()),o=r(t);return{left:n.pageX-i.left+o.left,top:n.pageY-i.top+o.top}}return{left:n.pageX,top:n.pageY}},o=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},a=function(e,r){return o(t(e),n(e),i(e,r))};return{calc:a}}),r(Qe,[_,p,z,u,w,Je],function(e,t,n,r,i,o){var a=e.isContentEditableFalse,s=e.isContentEditableTrue,l=function(e){return a(e)},c=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!a(t)},u=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},d=function(e,t,n,r){var i=t.cloneNode(!0);e.dom.setStyles(i,{width:n,height:r}),e.dom.setAttrib(i,"data-mce-selected",null);var o=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(o,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(i,{margin:0,boxSizing:"border-box"}),o.appendChild(i),o},f=function(e,t){e.parentNode!==t&&t.appendChild(e)},h=function(e,t,n,r,i,o){var a=0,s=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>i&&(a=t.pageX+n-i), +t.pageY+r>o&&(s=t.pageY+r-o),e.style.width=n-a+"px",e.style.height=r-s+"px"},p=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},m=function(e){return 0===e.button},g=function(e){return e.element},v=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},y=function(e,r){return function(i){if(m(i)){var o=t.find(r.dom.getParents(i.target),n.or(a,s));if(l(o)){var c=r.dom.getPos(o),u=r.getBody(),f=r.getDoc().documentElement;e.element=o,e.screenX=i.screenX,e.screenY=i.screenY,e.maxX=(r.inline?u.scrollWidth:f.offsetWidth)-2,e.maxY=(r.inline?u.scrollHeight:f.offsetHeight)-2,e.relX=i.pageX-c.x,e.relY=i.pageY-c.y,e.width=o.offsetWidth,e.height=o.offsetHeight,e.ghost=d(r,o,e.width,e.height)}}}},b=function(e,t){var n=r.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(g(e)&&!e.dragging&&i>10){var a=t.fire("dragstart",{target:e.element});if(a.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var s=v(e,o.calc(t,r));f(e.ghost,t.getBody()),h(e.ghost,s,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},C=function(e,t){return function(n){if(e.dragging&&c(t,t.selection.getNode(),e.element)){var r=u(e.element),i=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});i.isDefaultPrevented()||(r=i.targetClone,t.undoManager.transact(function(){p(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}w(e)}},x=function(e,t){return function(){w(e),e.dragging&&t.fire("dragend")}},w=function(e){e.dragging=!1,e.element=null,p(e.ghost)},N=function(e){var t={},n,r,o,a,s,l;n=i.DOM,l=document,r=y(t,e),o=b(t,e),a=C(t,e),s=x(t,e),e.on("mousedown",r),e.on("mousemove",o),e.on("mouseup",a),n.bind(l,"mousemove",o),n.bind(l,"mouseup",s),e.on("remove",function(){n.unbind(l,"mousemove",o),n.unbind(l,"mouseup",s)})},E=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(a(n)||a(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},_=function(e){N(e),E(e)};return{init:_}}),r(Ze,[d,ne,$,k,te,Ye,Ke,Ge,_,T,W,I,z,p,u,Qe,S],function(e,t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g){function v(e,t){for(;t=e(t);)if(t.isVisible())return t;return t}function y(c){function y(){var e=c.dom.get(le);return e?e.getElementsByTagName("*")[0]:e}function S(e){return c.dom.isBlock(e)}function k(e){e&&c.selection.setRng(e)}function T(){return c.selection.getRng()}function R(e,t){c.selection.scrollIntoView(e,t)}function A(e,t,n){var r;return r=c.fire("ShowCaret",{target:t,direction:e,before:n}),r.isDefaultPrevented()?null:(R(t,-1===e),se.show(n,t))}function B(e){var t;return se.hide(),t=c.fire("BeforeObjectSelected",{target:e}),t.isDefaultPrevented()?null:D(e)}function D(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}function L(e,t){var n=i.isInSameBlock(e,t);return!n&&l.isBr(e.getNode())?!0:n}function M(e,t){return t=i.normalizeRange(e,re,t),-1==e?n.fromRangeStart(t):n.fromRangeEnd(t)}function P(e){return r.isCaretContainerBlock(e.startContainer)}function O(e,t,n,r){var i,o,a,s;return!r.collapsed&&(i=_(r),x(i))?A(e,i,-1==e):(s=P(r),o=M(e,r),n(o)?B(o.getNode(-1==e)):(o=t(o))?n(o)?A(e,o.getNode(-1==e),1==e):(a=t(o),n(a)&&L(o,a)?A(e,a.getNode(-1==e),1==e):s?$(o.toRange()):null):s?r:null)}function H(e,t,n){var r,i,o,l,c,u,d,f,p;if(p=_(n),r=M(e,n),i=t(re,a.isAboveLine(1),r),o=h.filter(i,a.isLine(1)),c=h.last(r.getClientRects()),E(r)&&(p=r.getNode()),N(r)&&(p=r.getNode(!0)),!c)return null;if(u=c.left,l=s.findClosestClientRect(o,u),l&&x(l.node))return d=Math.abs(u-l.left),f=Math.abs(u-l.right),A(e,l.node,f>d);if(p){var m=a.positionsUntil(e,re,a.isAboveLine(1),p);if(l=s.findClosestClientRect(h.filter(m,a.isLine(1)),u))return $(l.position.toRange());if(l=h.last(h.filter(m,a.isLine(0))))return $(l.position.toRange())}}function I(t,r){function i(){var t=c.dom.create(c.settings.forced_root_block);return(!e.ie||e.ie>=11)&&(t.innerHTML='
    '),t}var o,a,s;if(r.collapsed&&c.settings.forced_root_block){if(o=c.dom.getParent(r.startContainer,"PRE"),!o)return;a=1==t?oe(n.fromRangeStart(r)):ae(n.fromRangeStart(r)),a||(s=i(),1==t?c.$(o).after(s):c.$(o).before(s),c.selection.select(s,!0),c.selection.collapse())}}function F(e,t,n,r){var i;return(i=O(e,t,n,r))?i:(i=I(e,r),i?i:null)}function z(e,t,n){var r;return(r=H(e,t,n))?r:(r=I(e,n),r?r:null)}function U(){return ue("*[data-mce-caret]")[0]}function W(e){e=ue(e),e.attr("data-mce-caret")&&(se.hide(),e.removeAttr("data-mce-caret"),e.removeAttr("data-mce-bogus"),e.removeAttr("style"),k(T()),R(e[0]))}function V(e){var t,r;return e=i.normalizeRange(1,re,e),t=n.fromRangeStart(e),x(t.getNode())?A(1,t.getNode(),!t.isAtEnd()):x(t.getNode(!0))?A(1,t.getNode(!0),!1):(r=c.dom.getParent(t.getNode(),f.or(x,C)),x(r)?A(1,r,!1):(se.hide(),null))}function $(e){var t;return e&&e.collapsed?(t=V(e),t?t:e):e}function q(e){var t,i,o,a;return x(e)?(x(e.previousSibling)&&(o=e.previousSibling),i=ae(n.before(e)),i||(t=oe(n.after(e))),t&&w(t.getNode())&&(a=t.getNode()),r.remove(e.previousSibling),r.remove(e.nextSibling),c.dom.remove(e),ee(),c.dom.isEmpty(c.getBody())?(c.setContent(""),void c.focus()):o?n.after(o).toRange():a?n.before(a).toRange():i?i.toRange():t?t.toRange():null):null}function j(e){var t=c.schema.getTextBlockElements();return e.nodeName in t}function Y(e){return c.dom.isEmpty(e)}function X(e,t,r){var i=c.dom,o,a,s,l;if(o=i.getParent(t.getNode(),i.isBlock),a=i.getParent(r.getNode(),i.isBlock),-1===e){if(l=r.getNode(!0),N(r)&&S(l))return j(o)?(Y(o)&&i.remove(o),n.after(l).toRange()):q(r.getNode(!0))}else if(l=t.getNode(),E(t)&&S(l))return j(a)?(Y(a)&&i.remove(a),n.before(l).toRange()):q(t.getNode());if(o===a||!j(o)||!j(a))return null;for(;s=o.firstChild;)a.appendChild(s);return c.dom.remove(o),r.toRange()}function K(e,t,n,i){var o,a,s,l;return!i.collapsed&&(o=_(i),x(o))?$(q(o)):(a=M(e,i),n(a)&&r.isCaretContainerBlock(i.startContainer)?(l=-1==e?ie.prev(a):ie.next(a),l?$(l.toRange()):i):t(a)?$(q(a.getNode(-1==e))):(s=-1==e?ie.prev(a):ie.next(a),t(s)?-1===e?X(e,a,s):X(e,s,a):void 0))}function G(){function r(e,t){var n=t(T());n&&!e.isDefaultPrevented()&&(e.preventDefault(),k(n))}function i(e){for(var t=c.getBody();e&&e!=t;){if(C(e)||x(e))return e;e=e.parentNode}return null}function o(e,t,n){return n.collapsed?!1:h.reduce(n.getClientRects(),function(n,r){return n||u.containsXY(r,e,t)},!1)}function l(e){var t=!1;e.on("touchstart",function(){t=!1}),e.on("touchmove",function(){t=!0}),e.on("touchend",function(e){var n=i(e.target);x(n)?t||(e.preventDefault(),Z(B(n))):ee()})}function f(){var e,t=i(c.selection.getNode());C(t)&&S(t)&&c.dom.isEmpty(t)&&(e=c.dom.create("br",{"data-mce-bogus":"1"}),c.$(t).empty().append(e),c.selection.setRng(n.before(e).toRange()))}function g(e){var t=U();if(t)return"compositionstart"==e.type?(e.preventDefault(),e.stopPropagation(),void W(t)):void(" "!=t.innerHTML&&W(t))}function v(e){var t;switch(e.keyCode){case d.DELETE:t=f();break;case d.BACKSPACE:t=f()}t&&e.preventDefault()}var w=b(F,1,oe,E),_=b(F,-1,ae,N),R=b(K,1,E,N),D=b(K,-1,N,E),L=b(z,-1,a.upUntil),M=b(z,1,a.downUntil);c.on("mouseup",function(){var e=T();e.collapsed&&k(V(e))}),c.on("click",function(e){var t;t=i(e.target),t&&x(t)&&(e.preventDefault(),c.focus())});var P=function(e){var r=new t(e);if(!e.firstChild)return!1;var i=n.before(e.firstChild),o=r.next(i);return o&&!E(o)&&!N(o)},O=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n===r},H=function(e,t){var n=c.dom.getParent(e,c.dom.isBlock),r=c.dom.getParent(t,c.dom.isBlock);return n&&!O(n,r)&&P(n)};l(c),c.on("mousedown",function(e){var t;if(t=i(e.target))x(t)?(e.preventDefault(),Z(B(t))):(ee(),o(e.clientX,e.clientY,c.selection.getRng())||c.selection.placeCaretAt(e.clientX,e.clientY));else{ee(),se.hide();var n=s.closestCaret(re,e.clientX,e.clientY);n&&(H(e.target,n.node)||(e.preventDefault(),c.getBody().focus(),k(A(1,n.node,n.before))))}}),c.on("keydown",function(e){if(!d.modifierPressed(e))switch(e.keyCode){case d.RIGHT:r(e,w);break;case d.DOWN:r(e,M);break;case d.LEFT:r(e,_);break;case d.UP:r(e,L);break;case d.DELETE:r(e,R);break;case d.BACKSPACE:r(e,D);break;default:x(c.selection.getNode())&&e.preventDefault()}}),c.on("keyup compositionstart",function(e){g(e),v(e)},!0),c.on("cut",function(){var e=c.selection.getNode();x(e)&&p.setEditorTimeout(c,function(){k($(q(e)))})}),c.on("getSelectionRange",function(e){var t=e.range;if(ce){if(!ce.parentNode)return void(ce=null);t=t.cloneRange(),t.selectNode(ce),e.range=t}}),c.on("setSelectionRange",function(e){var t;t=Z(e.range),t&&(e.range=t)}),c.on("focus",function(){p.setEditorTimeout(c,function(){c.selection.setRng($(c.selection.getRng()))},0)}),c.on("copy",function(t){var n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!e.ie){var r=y();r&&(t.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),m.init(c)}function J(){var e=c.contentStyles,t=".mce-content-body";e.push(se.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")}function Q(e){return r.isCaretContainer(e.startContainer)||r.isCaretContainer(e.endContainer)}function Z(t){var n,r=c.$,i=c.dom,o,a,s,l,u,d,f,h,p;if(!t)return ee(),null;if(t.collapsed){if(ee(),!Q(t)){if(f=M(1,t),x(f.getNode()))return A(1,f.getNode(),!f.isAtEnd());if(x(f.getNode(!0)))return A(1,f.getNode(!0),!1)}return null}return s=t.startContainer,l=t.startOffset,u=t.endOffset,3==s.nodeType&&0==l&&x(s.parentNode)&&(s=s.parentNode,l=i.nodeIndex(s),s=s.parentNode),1!=s.nodeType?(ee(),null):(u==l+1&&(n=s.childNodes[l]),x(n)?(h=p=n.cloneNode(!0),d=c.fire("ObjectSelected",{target:n,targetClone:h}),d.isDefaultPrevented()?(ee(),null):(h=d.targetClone,o=r("#"+le),0===o.length&&(o=r('
    ').attr("id",le),o.appendTo(c.getBody())),t=c.dom.createRng(),h===p&&e.ie?(o.empty().append(g.ZWSP).append(h).append(g.ZWSP),t.setStart(o[0].firstChild,0),t.setEnd(o[0].lastChild,1)):(o.empty().append("\xa0").append(h).append("\xa0"),t.setStart(o[0].firstChild,1),t.setEnd(o[0].lastChild,0)),o.css({top:i.getPos(n,c.getBody()).y}),o[0].focus(),a=c.selection.getSel(),a.removeAllRanges(),a.addRange(t),c.$("*[data-mce-selected]").removeAttr("data-mce-selected"),n.setAttribute("data-mce-selected",1),ce=n,t)):(ee(),null))}function ee(){ce&&(ce.removeAttribute("data-mce-selected"),c.$("#"+le).remove(),ce=null)}function te(){se.destroy(),ce=null}function ne(){se.hide()}var re=c.getBody(),ie=new t(re),oe=b(v,ie.next),ae=b(v,ie.prev),se=new o(c.getBody(),S),le="sel-"+c.dom.uniqueId(),ce,ue=c.$;return e.ceFalse&&(G(),J()),{showBlockCaretContainer:W,hideFakeCaret:ne,destroy:te}}var b=f.curry,C=l.isContentEditableTrue,x=l.isContentEditableFalse,w=l.isElement,N=i.isAfterContentEditableFalse,E=i.isBeforeContentEditableFalse,_=c.getSelectedNode;return y}),r(et,[],function(){var e=0,t=function(){var e=function(){return Math.round(4294967295*Math.random()).toString(36)},t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()},n=function(n){return n+e++ +t()};return{uuid:n}}),r(tt,[w,g,E,R,A,O,P,Y,J,Q,Z,ee,oe,ae,N,f,Ae,Pe,B,L,He,d,m,u,Ie,Fe,ze,je,Ze,et],function(e,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E,_,S,k,T,R,A){function B(e,t,i){var o=this,a,s,l;a=o.documentBaseUrl=i.documentBaseURL,s=i.baseURI,l=i.defaultSettings,t=P({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o,ie7_compat:!0},l,t),l&&l.external_plugins&&t.external_plugins&&(t.external_plugins=P({},l.external_plugins,t.external_plugins)),o.settings=t,r.language=t.language||"en",r.languageLoad=t.language_load,r.baseURL=i.baseURL,o.id=t.id=e,o.setDirty(!1),o.plugins={},o.documentBaseURI=new p(t.document_base_url||a,{base_uri:s}),o.baseURI=s,o.contentCSS=[],o.contentStyles=[],o.shortcuts=new k(o),o.loadedCSS={},o.editorCommands=new h(o),t.target&&(o.targetElm=t.target),o.suffix=i.suffix,o.editorManager=i,o.inline=t.inline,o.settings.content_editable=o.inline,t.cache_suffix&&(w.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),t.override_viewport===!1&&(w.overrideViewPort=!1),i.fire("SetupEditor",o),o.execCallback("setup",o),o.$=n.overrideDefaults(function(){return{context:o.inline?o.getBody():o.getDoc(),element:o.getBody()}})}var D=e.DOM,L=r.ThemeManager,M=r.PluginManager,P=N.extend,O=N.each,H=N.explode,I=N.inArray,F=N.trim,z=N.resolve,U=g.Event,W=w.gecko,V=w.ie;return B.prototype={render:function(){function e(){D.unbind(window,"ready",e),n.render()}function t(){var e=m.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!L.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",L.load(r.theme,t)}N.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),O(r.external_plugins,function(e,t){M.load(t,e),r.plugins+=" "+t}),O(r.plugins.split(/[ ,]/),function(e){if(e=F(e),e&&!M.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=M.dependencies(e);O(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=M.createUrl(t,e),M.load(e.resource,e)})}else M.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!U.domLoaded)return void D.bind(window,"ready",e);if(n.getElement()&&w.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||D.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(D.insertAfter(D.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},D.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.setDirty(!1),a._mceOldSubmit(a)})),n.windowManager=new v(n),n.notificationManager=new y(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=D.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),t()}},init:function(){function e(n){var r=M.get(n),i,o;if(i=M.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=F(n),r&&-1===I(m,n)){if(O(M.dependencies(n),function(t){e(t)}),t.plugins[n])return;o=new r(t,i,t.$),t.plugins[n]=o,o.init&&(o.init(t,i),m.push(n))}}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,h,p,m=[];if(t.rtl=n.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(n.language),n.aria_label=n.aria_label||D.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=L.get(n.theme),t.theme=new c(t,L.urls[n.theme]),t.theme.init&&t.theme.init(t,L.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""),t.$)):t.theme=n.theme),O(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,h=/^[0-9\.]+(|px)$/i,h.test(""+i)&&(i=Math.max(parseInt(i,10),100)),h.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&O(H(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();if(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!w.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',!/#$/.test(document.location.href))for(p=0;p',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),n.content_security_policy&&(t.iframeHTML+=''),t.iframeHTML+='
    ';var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';document.domain!=location.hostname&&w.ie&&w.ie<12&&(u=v);var y=D.create("iframe",{id:t.id+"_ifr",frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}});if(y.onload=function(){y.onload=null,t.fire("load")},D.setAttrib(y,"src",u||'javascript:""'),t.contentAreaContainer=l.iframeContainer,t.iframeElement=y,s=D.add(l.iframeContainer,y),V)try{t.getDoc()}catch(b){s.src=u=v}l.editorContainer&&(D.get(l.editorContainer).style.display=t.orgDisplay,t.hidden=D.isHidden(l.editorContainer)),t.getElement().style.display="none",D.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,r=n.settings,s=n.getElement(),h=n.getDoc(),p,m;r.inline||(n.getElement().style.visibility=n.orgVisibility),t||r.content_editable||(h.open(),h.write(n.iframeHTML),h.close()),r.content_editable&&(n.on("remove",function(){var e=this.getBody();D.removeClass(e,"mce-content-body"),D.removeClass(e,"mce-edit-focus"),D.setAttrib(e,"contentEditable",null)}),D.addClass(s,"mce-content-body"),n.contentDocument=h=r.content_document||document,n.contentWindow=r.content_window||window,n.bodyElement=s,r.content_document=r.content_window=null,r.root_name=s.nodeName.toLowerCase()),p=n.getBody(),p.disabled=!0,n.readonly=r.readonly,n.readonly||(n.inline&&"static"==D.getStyle(p,"position",!0)&&(p.style.position="relative"),p.contentEditable=n.getParam("content_editable_state",!0)),p.disabled=!1,n.editorUpload=new T(n),n.schema=new b(r),n.dom=new e(h,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:r.force_hex_style_colors,class_filter:r.class_filter,update_styles:!0,root_element:n.inline?n.getBody():null,collect:r.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new C(r,n.schema),n.parser.addAttributeFilter("src,href,style,tabindex",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)if(i=e[r],a=i.attr(t),s="data-mce-"+t,!i.attributes.map[s]){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===t?(a=o.serializeStyle(o.parseStyle(a),i.name),a.length||(a=null),i.attr(s,a),i.attr(t,a)):"tabindex"===t?(i.attr(s,a),i.attr(t,null)):i.attr(s,n.convertURL(a,t,i.name))}}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("type")||"no/type",0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,r,i=n.schema.getNonEmptyElements();t--;)r=e[t],r.isEmpty(i)&&(r.append(new o("br",1)).shortEnded=!0)}),n.serializer=new a(r,n),n.selection=new l(n.dom,n.getWin(),n.serializer,n),n.formatter=new c(n),n.undoManager=new u(n),n.forceBlocks=new f(n),n.enterKey=new d(n),n._nodeChangeDispatcher=new i(n),n._selectionOverrides=new R(n),n.fire("PreInit"),r.browser_spellcheck||r.gecko_spellcheck||(h.body.spellcheck=!1,D.setAttrib(p,"spellcheck","false")),n.quirks=new x(n),n.fire("PostRender"),r.directionality&&(p.dir=r.directionality),r.nowrap&&(p.style.whiteSpace="nowrap"),r.protect&&n.on("BeforeSetContent",function(e){O(r.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),r.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,n.bindPendingEventDelegates(),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.on("compositionstart compositionend",function(e){n.composing="compositionstart"===e.type}),n.contentStyles.length>0&&(m="",O(n.contentStyles,function(e){m+=e+"\r\n"}),n.dom.addStyle(m)),O(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),r.auto_focus&&E.setEditorTimeout(n,function(){var e;e=r.auto_focus===!0?n:n.editorManager.get(r.auto_focus),e.destroyed||e.focus()},100),s=h=p=null},focus:function(e){function t(e){return n.dom.getParent(e,function(e){return"true"===n.dom.getContentEditable(e)})}var n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l=n.getBody(),c;if(!e){if(o=r.getRng(),o.item&&(a=o.item(0)),n.quirks.refreshContentEditable(),c=t(r.getNode()),n.$.contains(l,c))return c.focus(),r.normalize(),void n.editorManager.setActive(n);if(i||(w.opera||n.getBody().focus(),n.getWin().focus()),W||i){if(l.setActive)try{l.setActive()}catch(u){l.focus()}else l.focus();i&&r.normalize()}a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())}n.editorManager.setActive(n)},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?z(r):0,n=z(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?(e=n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}),this.editorManager.translate(e)):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?O(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(e){e=e.split("="),e.length>1?i[F(e[0])]=F(e[1]):i[F(e[0])]=F(e)}):i=r,i):r},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addContextToolbar:function(e,t){var n=this,r;n.contextToolbars=n.contextToolbars||[],"string"==typeof e&&(r=e,e=function(e){return n.dom.is(e,r)}),n.contextToolbars.push({id:A.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable=!0:(D.show(e.getContainer()),D.hide(e.id)),e.load(),e.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(V&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e==e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(D.hide(e.getContainer()),D.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),"raw"==e.format&&t.fire("RawSaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=D.getParent(t.id,"form"))&&O(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&t.setDirty(!1),r},setContent:function(e,t){var n=this,r=n.getBody(),i,o;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(o=V&&11>V?"":'
    ',"TABLE"==r.nodeName?e=""+o+"":/^(UL|OL)$/.test(r.nodeName)&&(e="
  • "+o+"
  • "),i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=o,e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):V||e||(e='
    '),n.dom.setHTML(r,e),n.fire("SetContent",t)):("raw"!==t.format&&(e=new s({validate:n.validate},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=F(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?t.serializer.getTrimmedContent():"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),"text"!=e.format?e.content=F(n):e.content=n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e,t){t&&(e=P({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!=t&&this.fire("dirty")},setMode:function(e){S.setMode(this,e)},getContainer:function(){var e=this;return e.container||(e.container=D.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=D.get(this.id)),this.targetElm},getWin:function(){var e=this,t;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),O(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||!n.hasVisual?i.removeClass(e,o):i.addClass(e,o));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&n.hasVisual?i.addClass(e,o):i.removeClass(e,o)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;e.removed||(e.save(),e.removed=1,e.unbindAllNativeEvents(),e.hasHiddenInput&&D.remove(e.getElement().nextSibling),e.inline||(V&&10>V&&e.getDoc().execCommand("SelectAll",!1,null),D.setStyle(e.id,"display",e.orgDisplay),e.getBody().onload=null),e.fire("remove"),e.editorManager.remove(e),D.remove(e.getContainer()),e._selectionOverrides.destroy(),e.editorUpload.destroy(),e.destroy())},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),D.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},P(B.prototype,_),B}),r(nt,[],function(){var e={},t="en";return{setCode:function(e){e&&(t=e,this.rtl=this.data[e]?"rtl"===this.data[e]._dir:!1)},getCode:function(){return t},rtl:!1,add:function(t,n){var r=e[t];r||(e[t]=r={});for(var i in n)r[i]=n[i];this.setCode(t)},translate:function(n){var r;if(r=e[t],r||(r={}),"undefined"==typeof n)return n;if("string"!=typeof n&&n.raw)return n.raw;if(n.push){var i=n.slice(1);n=(r[n[0]]||n[0]).replace(/\{([0-9]+)\}/g,function(e,t){return i[t]})}return(r[n]||n).replace(/{context:\w+}$/,"")},data:e}}),r(rt,[w,u,d],function(e,t,n){function r(e){function l(){try{return document.activeElement}catch(e){return document.body}}function c(e,t){if(t&&t.startContainer){if(!e.isChildOf(t.startContainer,e.getRoot())||!e.isChildOf(t.endContainer,e.getRoot()))return;return{startContainer:t.startContainer, +startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset}}return t}function u(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function d(e){return!!s.getParent(e,r.isEditorUIElement)}function f(r){var f=r.editor;f.on("init",function(){(f.inline||n.ie)&&("onbeforedeactivate"in document&&n.ie<9?f.dom.bind(f.getBody(),"beforedeactivate",function(e){if(e.target==f.getBody())try{f.lastRng=f.selection.getRng()}catch(t){}}):f.on("nodechange mouseup keyup",function(e){var t=l();"nodechange"==e.type&&e.selectionChange||(t&&t.id==f.id+"_ifr"&&(t=f.getBody()),f.dom.isChildOf(t,f.getBody())&&(f.lastRng=f.selection.getRng()))}),n.webkit&&!i&&(i=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(f.lastRng=n)}},s.bind(document,"selectionchange",i)))}),f.on("setcontent",function(){f.lastRng=null}),f.on("mousedown",function(){f.selection.lastFocusBookmark=null}),f.on("focusin",function(){var t=e.focusedEditor,n;f.selection.lastFocusBookmark&&(n=u(f,f.selection.lastFocusBookmark),f.selection.lastFocusBookmark=null,f.selection.setRng(n)),t!=f&&(t&&t.fire("blur",{focusedEditor:f}),e.setActive(f),e.focusedEditor=f,f.fire("focus",{blurredEditor:t}),f.focus(!0)),f.lastRng=null}),f.on("focusout",function(){t.setEditorTimeout(f,function(){var t=e.focusedEditor;d(l())||t!=f||(f.fire("blur",{focusedEditor:null}),e.focusedEditor=null,f.selection&&(f.selection.lastFocusBookmark=null))})}),o||(o=function(t){var n=e.activeEditor,r;r=t.target,n&&r.ownerDocument==document&&(n.selection&&r!=n.getBody()&&(n.selection.lastFocusBookmark=c(n.dom,n.lastRng)),r==document.body||d(r)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},s.bind(document,"focusin",o)),f.inline&&!a&&(a=function(t){var n=e.activeEditor,r=n.dom;if(n.inline&&r&&!r.isChildOf(t.target,n.getBody())){var i=n.selection.getRng();i.collapsed||(n.lastRng=i)}},s.bind(document,"mouseup",a))}function h(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(s.unbind(document,"selectionchange",i),s.unbind(document,"focusin",o),s.unbind(document,"mouseup",a),i=o=a=null)}e.on("AddEditor",f),e.on("RemoveEditor",h)}var i,o,a,s=e.DOM;return r.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},r}),r(it,[tt,g,w,ae,d,m,c,ue,nt,rt],function(e,t,n,r,i,o,a,s,l,c){function u(e){g(C.editors,function(t){"scroll"===e.type?t.fire("ScrollWindow",e):t.fire("ResizeWindow",e)})}function d(e,n){n!==x&&(n?t(window).on("resize scroll",u):t(window).off("resize scroll",u),x=n)}function f(e){var t=C.editors,n;delete t[e.id];for(var r=0;r0&&g(m(t),function(e){var t;(t=p.get(e))?n.push(t):g(document.forms,function(t){g(t.elements,function(t){t.name===e&&(e="mce_editor_"+y++,p.setAttrib(t,"id",e),n.push(t))})})});break;case"textareas":case"specific_textareas":g(p.select("textarea"),function(t){e.editor_deselector&&c(t,e.editor_deselector)||e.editor_selector&&!c(t,e.editor_selector)||n.push(t)})}return n}function d(){function a(t,n,r){var i=new e(t,n,f);m.push(i),i.on("init",function(){++c===y.length&&x(m)}),i.targetElm=i.targetElm||r,i.render()}var c=0,m=[],y;return p.unbind(window,"ready",d),l("onpageload"),y=t.unique(u(n)),n.types?void g(n.types,function(e){o.each(y,function(t){return p.is(t,e.selector)?(a(s(t),v({},n,e),t),!1):!0})}):(o.each(y,function(e){h(f.get(e.id))}),y=o.grep(y,function(e){return!f.get(e.id)}),void g(y,function(e){r(n,e)?i("Could not initialize inline editor on invalid inline target element",e):a(s(e),n,e)}))}var f=this,b,C;C=o.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var x=function(e){b=e};return f.settings=n,p.bind(window,"ready",d),new a(function(e){b?e(b):x=function(t){e(t)}})},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),d(n,!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),b||(b=function(){t.fire("BeforeUnload")},p.bind(window,"beforeunload",b)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void g(p.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(f(i)&&t.fire("RemoveEditor",{editor:i}),r.length||p.unbind(window,"beforeunload",b),i.remove(),d(r,r.length>0),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){g(this.editors,function(e){e.save()})},addI18n:function(e,t){l.add(e,t)},translate:function(e){return l.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},v(C,s),C.setup(),window.tinymce=window.tinyMCE=C,C}),r(ot,[it,m],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(at,[ue,m],function(e,t){var n={send:function(e){function r(){!e.async||4==i.readyState||o++>1e4?(e.success&&1e4>o&&200==i.status?e.success.call(e.success_scope,""+i.responseText,i,e):e.error&&e.error.call(e.error_scope,o>1e4?"TIMED_OUT":"GENERAL",i,e),i=null):setTimeout(r,10)}var i,o=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async!==!1,e.data=e.data||"",n.fire("beforeInitialize",{settings:e}),i=new XMLHttpRequest){if(i.overrideMimeType&&i.overrideMimeType(e.content_type),i.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(i.withCredentials=!0),e.content_type&&i.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&t.each(e.requestheaders,function(e){i.setRequestHeader(e.key,e.value)}),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i=n.fire("beforeSend",{xhr:i,settings:e}).xhr,i.send(e.data),!e.async)return r();setTimeout(r,10)}}};return t.extend(n,e),n}),r(st,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(lt,[st,at,m],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(ct,[w],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(ut,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(dt,[w,f,N,E,m,d],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(ft,[se,m],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t=this,n=t.settings,r,i,o,a;r=n.firstControlClass,i=n.lastControlClass,e.each(function(e){e.classes.remove(r).remove(i).add(n.controlClass),e.visible()&&(o||(o=e),a=e)}),o&&o.classes.add(r),a&&a.classes.add(i)},renderHtml:function(e){var t=this,n="";return t.applyClasses(e.items()),e.items().each(function(e){n+=e.renderHtml()}),n},recalc:function(){},postRender:function(){},isNative:function(){return!1}})}),r(ht,[ft],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(pt,[De],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t._super(e),e=t.settings,n=t.settings.size,t.on("click mousedown",function(e){e.preventDefault()}),t.on("touchstart",function(e){t.fire("click",e),e.preventDefault()}),e.subtype&&t.classes.add(e.subtype),n&&t.classes.add("btn-"+n),e.icon&&t.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e=this.getEl().firstChild,t;e&&(t=e.style,t.width=t.height="100%"),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("icon"),i,o=e.state.get("text"),a="";return i=e.settings.image,i?(r="none","string"!=typeof i&&(i=window.getSelection?i[0]:i[1]),i=" style=\"background-image: url('"+i+"')\""):i="",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "},bindStates:function(){function e(e){var i=n("span."+r,t.getEl());e?(i[0]||(n("button:first",t.getEl()).append(''),i=n("span."+r,t.getEl())),i.html(t.encode(e))):i.remove(),t.classes.toggle("btn-has-text",!!e)}var t=this,n=t.$,r=t.classPrefix+"txt";return t.state.on("change:text",function(t){e(t.value)}),t.state.on("change:icon",function(n){var r=n.value,i=t.classPrefix;t.settings.icon=r,r=r?i+"ico "+i+"i-"+t.settings.icon:"";var o=t.getEl().firstChild,a=o.getElementsByTagName("i")[0];r?(a&&a==o.firstChild||(a=document.createElement("i"),o.insertBefore(a,o.firstChild)),a.className=r):a&&o.removeChild(a),e(t.state.get("text"))}),t._super()}})}),r(mt,[xe],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(gt,[De],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+"
    "},bindStates:function(){function e(e){t.classes.toggle("checked",e),t.aria("checked",e)}var t=this;return t.state.on("change:text",function(e){t.getEl("al").firstChild.data=t.translate(e.value)}),t.state.on("change:checked change:value",function(n){t.fire("change"),e(n.value)}),t.state.on("change:icon",function(e){var n=e.value,r=t.classPrefix;if("undefined"==typeof n)return t.settings.icon;t.settings.icon=n,n=n?r+"ico "+r+"i-"+t.settings.icon:"";var i=t.getEl().firstChild,o=i.getElementsByTagName("i")[0];n?(o&&o==i.firstChild||(o=document.createElement("i"),i.insertBefore(o,i.firstChild)),o.className=n):o&&i.removeChild(o)}),t.state.get("checked")&&e(!0),t._super()}})}),r(vt,[De,be,pe,g],function(e,t,n,r){return e.extend({init:function(e){var t=this;t._super(e),e=t.settings,t.classes.add("combobox"),t.subinput=!0,t.ariaTarget="inp",e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){var i=n.target,o=t.getEl();if(r.contains(o,i)||i==o)for(;i&&i!=o;)i.id&&-1!=i.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),i=i.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){var r=t.state.get("value"),i=t.getEl("inp").value;return e.preventDefault(),t.state.set("value",i),r!=i&&t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),t.on("keyup",function(e){"INPUT"==e.target.nodeName&&t.state.set("value",e.target.value)})},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),i=e.getEl("open"),o=e.layoutRect(),a,s;a=i?o.w-n.getSize(i).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(s=e.layoutRect().h-2+"px"),r(t.firstChild).css({width:a,lineHeight:s}),e._super(),e},postRender:function(){var e=this;return r(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=e.state.get("value")||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e.state.get("text"),(o||a)&&(s='
    ",e.classes.add("has-open")),'
    '+s+"
    "},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl("inp").value!=t.value&&(e.getEl("inp").value=t.value)}),e.state.on("change:disabled",function(t){e.getEl("inp").disabled=t.value}),e._super()},remove:function(){r(this.getEl("inp")).off(),this._super()}})}),r(yt,[vt],function(e){return e.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl().getElementsByTagName("i")[0];if(t)try{t.style.background=e}catch(n){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}})}),r(bt,[pt,ke],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}})}),r(Ct,[bt,w],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.state.get("text"),i=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",a="";return r&&(e.classes.add("btn-has-text"),a=''+e.encode(r)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(xt,[],function(){function e(e){function i(e,i,o){var a,s,l,c,u,d;return a=0,s=0,l=0,e/=255,i/=255,o/=255,u=t(e,t(i,o)),d=n(e,n(i,o)),u==d?(l=u,{h:0,s:0,v:100*l}):(c=e==u?i-o:o==u?e-i:o-e,a=e==u?3:o==u?1:5,a=60*(a-c/(d-u)),s=(d-u)/d,l=d,{h:r(a),s:r(100*s),v:r(100*l)})}function o(e,i,o){var a,s,l,c;if(e=(parseInt(e,10)||0)%360,i=parseInt(i,10)/100,o=parseInt(o,10)/100,i=n(0,t(i,1)),o=n(0,t(o,1)),0===i)return void(d=f=h=r(255*o));switch(a=e/60,s=o*i,l=s*(1-Math.abs(a%2-1)),c=o-s,Math.floor(a)){case 0:d=s,f=l,h=0;break;case 1:d=l,f=s,h=0;break;case 2:d=0,f=s,h=l;break;case 3:d=0,f=l,h=s;break;case 4:d=l,f=0,h=s;break;case 5:d=s,f=0,h=l;break;default:d=f=h=0}d=r(255*(d+c)),f=r(255*(f+c)),h=r(255*(h+c))}function a(){function e(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+e(d)+e(f)+e(h)}function s(){return{r:d,g:f,b:h}}function l(){return i(d,f,h)}function c(e){var t;return"object"==typeof e?"r"in e?(d=e.r,f=e.g,h=e.b):"v"in e&&o(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(d=parseInt(t[1],10),f=parseInt(t[2],10),h=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(d=parseInt(t[1],16),f=parseInt(t[2],16),h=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(d=parseInt(t[1]+t[1],16),f=parseInt(t[2]+t[2],16),h=parseInt(t[3]+t[3],16)),d=0>d?0:d>255?255:d,f=0>f?0:f>255?255:f,h=0>h?0:h>255?255:h,u}var u=this,d=0,f=0,h=0;e&&c(e),u.toRgb=s,u.toHsv=l,u.toHex=a,u.parse=c}var t=Math.min,n=Math.max,r=Math.round;return e}),r(wt,[De,we,pe,xt],function(e,t,n,r){return e.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){function e(e,t){var r=n.getPos(e),i,o;return i=t.pageX-r.x,o=t.pageY-r.y,i=Math.max(0,Math.min(i/e.clientWidth,1)),o=Math.max(0,Math.min(o/e.clientHeight,1)),{x:i,y:o}}function i(e,t){var i=(360-e.h)/360;n.css(d,{top:100*i+"%"}),t||n.css(h,{left:e.s+"%",top:100-e.v+"%"}),f.style.background=new r({s:100,v:100,h:e.h}).toHex(),s.color().parse({s:e.s,v:e.v,h:e.h})}function o(t){var n;n=e(f,t),c.s=100*n.x,c.v=100*(1-n.y),i(c),s.fire("change")}function a(t){var n;n=e(u,t),c=l.toHsv(),c.h=360*(1-n.y),i(c,!0),s.fire("change")}var s=this,l=s.color(),c,u,d,f,h;u=s.getEl("h"),d=s.getEl("hp"),f=s.getEl("sv"),h=s.getEl("svp"),s._repaint=function(){c=l.toHsv(),i(c)},s._super(),s._svdraghelper=new t(s._id+"-sv",{start:o,drag:o}),s._hdraghelper=new t(s._id+"-h",{start:a,drag:a}),s._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){var t=this;return arguments.length?(t.color().parse(e),void(t._rendered&&t._repaint())):t.color().toHex()},color:function(){return this._color||(this._color=new r),this._color},renderHtml:function(){function e(){var e,t,n="",i,a;for(i="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",a=o.split(","),e=0,t=a.length-1;t>e;e++)n+='
    ';return n}var t=this,n=t._id,r=t.classPrefix,i,o="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000",a="background: -ms-linear-gradient(top,"+o+");background: linear-gradient(to bottom,"+o+");";return i='
    '+e()+'
    ','
    '+i+"
    "}})}),r(Nt,[De],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.classes.add("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.row()[n],index:n})}),t.row(t.settings.row)},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){var e=this;return'
    '+e._getDataPathHtml(e.state.get("row"))+"
    "},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(e){var t=this,n=e||[],r,i,o="",a=t.classPrefix;for(r=0,i=n.length;i>r;r++)o+=(r>0?'":"")+'
    '+n[r].name+"
    ";return o||(o='
    \xa0
    '),o}})}),r(Et,[Nt],function(e){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var t=this,n=t.settings.editor;return n.settings.elementpath!==!1&&(t.on("select",function(e){n.focus(),n.selection.select(this.row()[e.index].element),n.nodeChanged()}),n.on("nodeChange",function(r){for(var i=[],o=r.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=n.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});if(s.isDefaultPrevented()||i.push({name:s.name,element:o[a]}),s.isPropagationStopped())break}t.row(i)})),t._super()}})}),r(_t,[xe],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(St,[xe,_t,m],function(e,t,n){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,r=e.items();e.settings.formItemDefaults||(e.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),r.each(function(r){var i,o=r.settings.label;o&&(i=new t(n.extend({items:{type:"label",id:r._id+"-l",text:o,flex:0,forId:r._id,disabled:r.disabled()}},e.settings.formItemDefaults)),i.type="formitem",r.aria("labelledby",r._id+"-l"),"undefined"==typeof r.settings.flex&&(r.settings.flex=1),e.replace(r,i),i.add(r))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.fromJSON(e.settings.data)},bindStates:function(){function e(){var e=0,n=[],r,i,o;if(t.settings.labelGapCalc!==!1)for(o="children"==t.settings.labelGapCalc?t.find("formitem"):t.items(),o.filter("formitem").each(function(t){var r=t.items()[0],i=r.getEl().clientWidth;e=i>e?i:e,n.push(r)}),i=t.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=e+i}var t=this;t._super(),t.on("show",e),e()}})}),r(kt,[St],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Tt,[vt,m],function(e,t){return e.extend({init:function(e){var n=this,r=tinymce.activeEditor,i=r.settings,o,a,s;e.spellcheck=!1,s=i.file_picker_types||i.file_browser_callback_types,s&&(s=t.makeMap(s,/[, ]/)),s&&!s[e.filetype]||(a=i.file_picker_callback,!a||s&&!s[e.filetype]?(a=i.file_browser_callback,!a||s&&!s[e.filetype]||(o=function(){a(n.getEl("inp").id,n.value(),e.filetype,window)})):o=function(){var i=n.fire("beforecall").meta;i=t.extend({filetype:e.filetype},i),a.call(r,function(e,t){n.value(e).fire("change",{meta:t})},n.value(),i)}),o&&(e.icon="browse",e.onaction=o),n._super(e)}})}),r(Rt,[ht],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}})}),r(At,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v=[],y,b,C,x,w,N,E,_,S,k,T,R,A,B,D,L,M,P,O,H,I,F,z=Math.max,U=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e.paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,"row-reversed"!=f&&"column-reverse"!=f||(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",E="h",_="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",O="left",M="w",D="x",L="innerW", +P="minW",H="right",I="deltaW",F="contentW"):(S="x",E="w",_="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",O="top",M="h",D="y",L="innerH",P="minH",H="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],N=u=0,t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),m=h.settings,g=m.flex,d-=n-1>t?c:0,g>0&&(u+=g,p[k]&&v.push(h),p.flex=g),d-=p[_],y=o[O]+p[P]+o[H],y>N&&(N=y);if(x={},0>d?x[_]=i[_]-d+i[A]:x[_]=i[R]-d+i[A],x[P]=N+i[I],x[B]=i[R]-d,x[F]=N,x.minW=U(x.minW,i.maxW),x.minH=U(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)h=v[t],p=h.layoutRect(),b=p[k],y=p[_]+p.flex*C,y>b?(d-=p[k]-p[_],u-=p.flex,p.flex=0,p.maxFlexSize=b):p.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[D]=o[O],t=0,n=r.length;n>t;t++)h=r[t],p=h.layoutRect(),y=p.maxFlexSize||p[_],"center"===s?x[D]=Math.round(i[L]/2-p[M]/2):"stretch"===s?(x[M]=z(p[P]||0,i[L]-o[O]-o[H]),x[D]=o[O]):"end"===s&&(x[D]=i[L]-p[M]-o.top),p.flex>0&&(y+=p.flex*C),x[E]=y,x[S]=w,h.layoutRect(x),h.recalc&&h.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var W=e.parent();W&&(W._lastRect=null,W.recalc())}}})}),r(Bt,[ft],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}})}),r(Dt,[ye,De,ke,m,w,it,d],function(e,t,n,r,i,o,a){function s(e){e.settings.ui_container&&(a.container=i.DOM.select(e.settings.ui_container)[0])}function l(t){t.on("ScriptsLoaded",function(){t.rtl&&(e.rtl=!0)})}function c(e){function t(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;u(i.parents,function(e){return u(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function r(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function i(){function t(e){var n=[];if(e)return u(e,function(e){var o={text:e.title,icon:e.icon};if(e.items)o.menu=t(e.items);else{var a=e.format||"custom"+r++;e.format||(e.name=a,i.push(e)),o.format=a,o.cmd=e.cmd}n.push(o)}),n}function n(){var n;return n=t(e.settings.style_formats_merge?e.settings.style_formats?o.concat(e.settings.style_formats):o:e.settings.style_formats||o)}var r=0,i=[],o=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){u(i,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:n(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?e.formatter.getCssText(this.settings.format):void 0},onPostRender:function(){var t=this;t.parent().on("show",function(){var n,r;n=t.settings.format,n&&(t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))),r=t.settings.cmd,r&&t.active(e.queryCommandState(r))})},onclick:function(){this.settings.format&&l(this.settings.format),this.settings.cmd&&e.execCommand(this.settings.cmd)}}}}function o(t){return function(){var n=this;e.formatter?e.formatter.formatChanged(t,function(e){n.active(e)}):e.on("init",function(){e.formatter.formatChanged(t,function(e){n.active(e)})})}}function a(t){return function(){function n(){return e.undoManager?e.undoManager[t]():!1}var r=this;t="redo"==t?"hasRedo":"hasUndo",r.disabled(!n()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){r.disabled(e.readonly||!n())})}}function s(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function l(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var c;c=i(),u({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:o(n),onclick:function(){l(n)}})}),u({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),u({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:o(n)})}),e.addButton("undo",{tooltip:"Undo",onPostRender:a("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:a("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:a("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:s,cmd:"mceToggleVisualAid"}),e.addButton("remove",{tooltip:"Remove",icon:"remove",cmd:"Delete"}),u({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return u(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return u(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return u(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var u=r.each;o.on("AddEditor",function(e){var t=e.editor;l(t),c(t),s(t)}),e.translate=function(e){return o.translate(e)},t.tooltips=!a.iOS}),r(Lt,[ht],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,h,p,m,g,v,y,b,C,x,w,N,E=[],_=[],S,k,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e.paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)_.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,E[d]=S>E[d]?S:E[d],_[f]=k>_[f]?k:_[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,N=0,f=0;n>f;f++)N+=_[f]+(f>0?b:0),R-=(f>0?b:0)+_[f];if(w+=g.left+g.right,N+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=N+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var D;D="start"==t.packV?0:R>0?Math.floor(R/n):0;var L=0,M=t.flexWidths;if(M)for(d=0;dd;d++)E[d]+=M?M[d]*P:P;for(p=g.top,f=0;n>f;f++){for(h=g.left,s=_[f]+D,d=0;r>d&&(B=A?f*r+r-1-d:f*r+d,u=i[B],u);d++)m=u.settings,c=u.layoutRect(),a=Math.max(E[d],c.startMinWidth),c.x=h,c.y=p,v=m.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=h+a/2-c.w/2:"right"==v?c.x=h+a-c.w:"stretch"==v&&(c.w=a),v=m.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=p+s/2-c.h/2:"bottom"==v?c.y=p+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),h+=a+y,u.recalc&&u.recalc();p+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}})}),r(Mt,[De,u],function(e,t){return e.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,n){var r=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,n&&n()):t.setTimeout(function(){r.html(e)}),this}})}),r(Pt,[De],function(e){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("infobox"),t.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'
    '+e.encode(e.state.get("text"))+'
    '},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ot,[De,pe],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.classes.add("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e=this,t,n,r=e.settings.forId;return!r&&(n=e.settings.forName)&&(t=e.getRoot().find("#"+n)[0],t&&(r=t._id)),r?'":''+e.encode(e.state.get("text"))+""},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}})}),r(Ht,[xe],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.classes.add("toolbar")},postRender:function(){var e=this;return e.items().each(function(e){e.classes.add("toolbar-item")}),e._super()}})}),r(It,[Ht],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Ft,[pt,be,It],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(){var e=this,n;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(n=e.state.get("menu")||[],n.length?n={type:"menu",items:n}:n.type=n.type||"menu",n.renderTo?e.menu=n.parent(e).show().renderTo():e.menu=t.create(n).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon,o,a=e.state.get("text"),s="";return o=e.settings.image,o?(i="none","string"!=typeof o&&(o=window.getSelection?o[0]:o[1]),o=" style=\"background-image: url('"+o+"')\""):o="",a&&(e.classes.add("btn-has-text"),s=''+e.encode(a)+""),i=e.settings.icon?r+"ico "+r+"i-"+i:"",e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});return i}),r(zt,[De,be,d,u],function(e,t,n,r){return e.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t=this,n;t._super(e),e=t.settings,t.classes.add("menu-item"),e.menu&&t.classes.add("menu-item-expand"),e.preview&&t.classes.add("menu-item-preview"),n=t.state.get("text"),"-"!==n&&"|"!==n||(t.classes.add("menu-item-sep"),t.aria("role","separator"),t.state.set("text","-")),e.selectable&&(t.aria("role","menuitemcheckbox"),t.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||t.classes.add("menu-item-normal"),t.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&t.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e=this,n=e.settings,r,i=e.parent();if(i.items().each(function(t){t!==e&&t.hideMenu()}),n.menu){r=e.menu,r?r.show():(r=n.menu,r.length?r={type:"menu",items:r}:r.type=r.type||"menu",i.settings.itemDefaults&&(r.itemDefaults=i.settings.itemDefaults),r=e.menu=t.create(r).parent(e).renderTo(),r.reflow(),r.on("cancel",function(t){t.stopPropagation(),e.focus(),r.hide()}),r.on("show hide",function(e){e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),r.on("hide",function(t){t.control===r&&e.classes.remove("selected")}),r.submenu=!0),r._parentMenu=i,r.classes.add("menu-sub");var o=r.testMoveRel(e.getEl(),e.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);r.moveRel(e.getEl(),o),r.rel=o,o="menu-sub-"+o,r.classes.remove(r._lastRel).add(o),r._lastRel=o,e.classes.add("selected"),e.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){function e(e){var t,r,i={};for(i=n.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t'+("-"!==a?'\xa0":"")+("-"!==a?''+a+"":"")+(c?'
    '+c+"
    ":"")+(i.menu?'
    ':"")+"
    "},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var i=e.getEl("text");i&&i.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),r.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){var e=this;return e.parent().items().each(function(e){e.classes.remove("selected")}),e.classes.toggle("selected",!0),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[g,ye,u],function(e,t,n){return function(r,i){var o=this,a,s=t.classPrefix,l;o.show=function(t,c){function u(){a&&(e(r).append('
    '),c&&c())}return o.hide(),a=!0,t?l=n.setTimeout(u,t):u(),o},o.hide=function(){var e=r.lastChild;return n.clearTimeout(l),e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),a=!1,o}}}),r(Wt,[ke,zt,Ut,m],function(e,t,n,r){return e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var n=e.items,i=n.length;i--;)n[i]=r.extend({},e.itemDefaults,n[i]);t._super(e),t.classes.add("menu")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},load:function(){function e(){t.throbber&&(t.throbber.hide(),t.throbber=null)}var t=this,r,i;i=t.settings.itemsFactory,i&&(t.throbber||(t.throbber=new n(t.getEl("body"),!0),0===t.items().length?(t.throbber.show(),t.fire("loading")):t.throbber.show(100,function(){t.items().remove(),t.fire("loading")}),t.on("hide close",e)),t.requestTime=r=(new Date).getTime(),t.settings.itemsFactory(function(n){return 0===n.length?void t.hide():void(t.requestTime===r&&(t.getEl().style.width="",t.getEl("body").style.width="",e(),t.items().remove(),t.getEl("body").innerHTML="",t.add(n),t.renderNew(),t.fire("loaded")))}))},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.image||n.selectable?(e._hasIcons=!0,!1):void 0}),e.settings.itemsFactory&&e.on("postrender",function(){e.settings.itemsFactory&&e.load()}),e._super()}})}),r(Vt,[Ft,Wt],function(e,t){return e.extend({init:function(e){function t(r){for(var a=0;a0&&(o=r[0].text,n.state.set("value",r[0].value)),n.state.set("menu",r)),n.state.set("text",e.text||o),n.classes.add("listbox"),n.on("select",function(t){var r=t.control;a&&(t.lastControl=a),e.multiple?r.active(!r.active()):n.value(t.control.value()),a=r})},bindStates:function(){function e(e,n){e instanceof t&&e.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}function n(e,t){var r;if(e)for(var i=0;i
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(jt,[De],function(e){function t(e){var t="";if(e)for(var n=0;n'+e[n]+"";return t}return e.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var t=this;t._super(e),t.settings.size&&(t.size=t.settings.size),t.settings.options&&(t._options=t.settings.options),t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e=this,n,r="";return n=t(e._options),e.size&&(r=' size = "'+e.size+'"'),'"},bindStates:function(){var e=this;return e.state.on("change:options",function(n){e.getEl().innerHTML=t(n.value)}),e._super()}})}),r(Yt,[De,we,pe],function(e,t,n){function r(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function i(e,t,n){e.setAttribute("aria-"+t,n)}function o(e,t){var r,o,a,s,l,c;"v"==e.settings.orientation?(s="top",a="height",o="h"):(s="left",a="width",o="w"),c=e.getEl("handle"),r=(e.layoutRect()[o]||100)-n.getSize(c)[a],l=r*((t-e._minValue)/(e._maxValue-e._minValue))+"px",c.style[s]=l,c.style.height=e.layoutRect().h+"px",i(c,"valuenow",t),i(c,"valuetext",""+e.settings.previewFilter(t)),i(c,"valuemin",e._minValue),i(c,"valuemax",e._maxValue)}return e.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"==e.orientation&&t.classes.add("vertical"),t._minValue=e.minValue||0,t._maxValue=e.maxValue||100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '},reset:function(){this.value(this._initValue).repaint()},postRender:function(){function e(e,t,n){return(n+e)/(t-e)}function i(e,t,n){return n*(t-e)-e}function o(t,n){function o(o){var a;a=s.value(),a=i(t,n,e(t,n,a)+.05*o),a=r(a,t,n),s.value(a),s.fire("dragstart",{value:a}),s.fire("drag",{value:a}),s.fire("dragend",{value:a})}s.on("keydown",function(e){switch(e.keyCode){case 37:case 38:o(-1);break;case 39:case 40:o(1)}})}function a(e,i,o){var a,l,c,p,m;s._dragHelper=new t(s._id,{handle:s._id+"-handle",start:function(e){a=e[u],l=parseInt(s.getEl("handle").style[d],10),c=(s.layoutRect()[h]||100)-n.getSize(o)[f],s.fire("dragstart",{value:m})},drag:function(t){var n=t[u]-a;p=r(l+n,0,c),o.style[d]=p+"px",m=e+p/c*(i-e),s.value(m),s.tooltip().text(""+s.settings.previewFilter(m)).show().moveRel(o,"bc tc"),s.fire("drag",{value:m})},stop:function(){s.tooltip().hide(),s.fire("dragend",{value:m})}})}var s=this,l,c,u,d,f,h;l=s._minValue,c=s._maxValue,"v"==s.settings.orientation?(u="screenY",d="top",f="height",h="h"):(u="screenX",d="left",f="width",h="w"),s._super(),o(l,c,s.getEl("handle")),a(l,c,s.getEl("handle"))},repaint:function(){this._super(),o(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){o(e,t.value)}),e._super()}})}),r(Xt,[De],function(e){return e.extend({renderHtml:function(){var e=this;return e.classes.add("spacer"),e.canFocus=!1,'
    '}})}),r(Kt,[Ft,pe,g],function(e,t,n){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,r=e.getEl(),i=e.layoutRect(),o,a;return e._super(),o=r.firstChild,a=r.lastChild,n(o).css({width:i.w-t.getSize(a).width,height:i.h-2}),n(a).css({height:i.h-2}),e},activeMenu:function(e){var t=this;n(t.getEl().lastChild).toggleClass(t.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r,i=e.state.get("icon"),o=e.state.get("text"),a="";return r=e.settings.image,r?(i="none","string"!=typeof r&&(r=window.getSelection?r[0]:r[1]),r=" style=\"background-image: url('"+r+"')\""):r="",i=e.settings.icon?n+"ico "+n+"i-"+i:"",o&&(e.classes.add("btn-has-text"),a=''+e.encode(o)+""),'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void(t&&t.call(this,e));n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Bt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}})}),r(Jt,[Ee,g,pe],function(e,t,n){return e.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t(n).removeClass(this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t(n).addClass(this.classPrefix+"active"),this.items()[e].show().fire("showtab"),this.reflow(),this.items().each(function(t,n){e!=n&&t.hide()})},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,t,r,i;r=n.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(e){r=Math.max(r,e.layoutRect().minW),i=Math.max(i,e.layoutRect().minH)}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=n.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,t=e._super(),t.deltaH+=o,t.innerH=t.h-t.deltaH,t}})}),r(Qt,[De,m,pe],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.classes.add("textbox"),e.multiline?t.classes.add("multiline"):(t.on("keydown",function(e){var n;13==e.keyCode&&(e.preventDefault(),t.parents().reverse().each(function(e){return e.toJSON?(n=e,!1):void 0}),t.fire("submit",{data:n.toJSON()}))}),t.on("keyup",function(e){t.state.set("value",e.target.value)}))},repaint:function(){var e=this,t,n,r,i,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e.borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,r=e.settings,i,o;return i={id:e._id,hidefocus:"1"},t.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){i[e]=r[e]}),e.disabled()&&(i.disabled="disabled"),r.subtype&&(i.type=r.subtype),o=n.create(r.multiline?"textarea":"input",i),o.value=e.state.get("value"),o.className=e.classes,o.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){ +e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!=t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}})}),r(Zt,[],function(){var e=this||window,t=function(){return e.tinymce};return"function"==typeof e.define&&(e.define.amd||e.define("ephox/tinymce",[],t)),{}}),a([l,c,u,d,f,h,m,g,v,y,C,w,N,E,T,A,B,D,L,M,P,O,I,F,j,Y,J,Q,oe,ae,se,le,ue,fe,he,ve,ye,be,Ce,xe,we,Ne,Ee,_e,Se,ke,Te,Re,Ae,Be,De,Le,Me,Pe,Ie,ze,tt,nt,rt,it,at,st,lt,ct,ut,dt,ft,ht,pt,mt,gt,vt,yt,bt,Ct,xt,wt,Nt,Et,_t,St,kt,Tt,Rt,At,Bt,Dt,Lt,Mt,Pt,Ot,Ht,It,Ft,zt,Ut,Wt,Vt,$t,qt,jt,Yt,Xt,Kt,Gt,Jt,Qt])}(this); \ No newline at end of file diff --git a/media/jui/css/bootstrap-extended.css b/media/jui/css/bootstrap-extended.css index c3cc6389e7a38..f5b42ed53d3c6 100644 --- a/media/jui/css/bootstrap-extended.css +++ b/media/jui/css/bootstrap-extended.css @@ -255,7 +255,8 @@ hr.hr-condensed { background-color: #f5f5f5; } .row-striped .row-fluid { - width: 97%; + width: 100%; + box-sizing: border-box; } .row-striped .row-fluid [class*="span"] { min-height: 10px; @@ -346,18 +347,6 @@ fieldset.radio.btn-group { margin: 2px 0px 10px 0px; padding-bottom: 5px; } -.input-prepend .chzn-container-single .chzn-single, -.input-append .chzn-container-single .chzn-single { - border-color: #ccc; - height: 26px; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} -.input-prepend .chzn-container-single .chzn-drop, -.input-append .chzn-container-single .chzn-drop { - border-color: #ccc; -} .input-prepend > .add-on, .input-append > .add-on { vertical-align: top; @@ -397,6 +386,14 @@ fieldset.radio.btn-group { width: 1px; overflow: hidden; } +.element-invisible:focus { + width: auto; + height: auto; + overflow: auto; + background: #eee; + color: #000; + padding: 1em; +} .form-vertical .control-label { float: none; width: auto; @@ -476,3 +473,19 @@ th .tooltip-inner { .dropdown-menu { text-align: left; } +.alert-link { + font-weight: bold; +} +.alert .alert-link { + color: #a47e3c; +} +.alert-success .alert-link { + color: #356635; +} +.alert-danger .alert-link, +.alert-error .alert-link { + color: #953b39; +} +.alert-info .alert-link { + color: #2d6987; +} diff --git a/media/jui/css/bootstrap-rtl.css b/media/jui/css/bootstrap-rtl.css index 640911e0d16a0..5ba1382c9345e 100644 --- a/media/jui/css/bootstrap-rtl.css +++ b/media/jui/css/bootstrap-rtl.css @@ -444,7 +444,7 @@ body { margin-left: 0; margin-right: 180px; } -.dl-horizontal dt +.dl-horizontal dt, .profile> ul { margin: 9px 25px 0 0; } @@ -585,9 +585,18 @@ body { #mediamanager-form .dimensions { direction: ltr; } +.popover, .tooltip-inner { text-align: right; } +.popover.top .arrow, +.popover.bottom .arrow { + margin-right: -11px; +} +.popover.top .arrow:after, +.popover.bottom .arrow:after { + margin-right: -10px; +} @media (max-width: 480px) { .btn-toolbar .btn-wrapper { display: block; diff --git a/media/jui/css/chosen-sprite.png b/media/jui/css/chosen-sprite.png index ebaf1b6c39303..c57da70b4b5b1 100644 Binary files a/media/jui/css/chosen-sprite.png and b/media/jui/css/chosen-sprite.png differ diff --git a/media/jui/css/chosen-sprite@2x.png b/media/jui/css/chosen-sprite@2x.png index 301e388525a3a..6b50545202cb4 100644 Binary files a/media/jui/css/chosen-sprite@2x.png and b/media/jui/css/chosen-sprite@2x.png differ diff --git a/media/jui/css/chosen.css b/media/jui/css/chosen.css index 50ae2d942bc5d..0ad857139734c 100644 --- a/media/jui/css/chosen.css +++ b/media/jui/css/chosen.css @@ -1,23 +1,35 @@ +/*! +Chosen, a Select Box Enhancer for jQuery and Prototype +by Patrick Filler for Harvest, http://getharvest.com + +Version 1.6.2 +Full source at https://github.com/harvesthq/chosen +Copyright (c) 2011-2016 Harvest http://getharvest.com + +MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +This file is generated by `grunt build`, do not edit it by hand. +*/ + /* @group Base */ .chzn-container { position: relative; display: inline-block; vertical-align: middle; font-size: 13px; - zoom: 1; - *display: inline; -webkit-user-select: none; -moz-user-select: none; user-select: none; } +.chzn-container * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} .chzn-container .chzn-drop { position: absolute; top: 100%; left: -9999px; z-index: 1010; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; width: 100%; border: 1px solid #aaa; border-top: 0; @@ -30,6 +42,19 @@ .chzn-container a { cursor: pointer; } +.chzn-container .search-choice .group-name, .chzn-container .chzn-single .group-name { + margin-right: 4px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-weight: normal; + color: #999999; +} +.chzn-container .search-choice .group-name:after, .chzn-container .chzn-single .group-name:after { + content: ":"; + padding-left: 2px; + vertical-align: top; +} /* @end */ /* @group Single Chosen */ @@ -38,15 +63,15 @@ display: block; overflow: hidden; padding: 0 0 0 8px; - height: 23px; + height: 25px; border: 1px solid #aaa; border-radius: 5px; background-color: #fff; background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4)); - background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); - background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background: -webkit-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background: -moz-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background: -o-linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); + background: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%); background-clip: padding-box; box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1); color: #444; @@ -105,9 +130,6 @@ white-space: nowrap; } .chzn-container-single .chzn-search input[type="text"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; margin: 1px 0; padding: 4px 20px 4px 5px; width: 100%; @@ -115,11 +137,7 @@ outline: 0; border: 1px solid #aaa; background: white url('chosen-sprite.png') no-repeat 100% -20px; - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(#eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat 100% -20px; font-size: 1em; font-family: sans-serif; line-height: normal; @@ -138,6 +156,7 @@ /* @end */ /* @group Results */ .chzn-container .chzn-results { + color: #444; position: relative; overflow-x: hidden; overflow-y: auto; @@ -152,6 +171,8 @@ padding: 5px 6px; list-style: none; line-height: 15px; + word-wrap: break-word; + -webkit-touch-callout: none; } .chzn-container .chzn-results li.active-result { display: list-item; @@ -172,6 +193,7 @@ color: #fff; } .chzn-container .chzn-results li.no-results { + color: #777; display: list-item; background: #f4f4f4; } @@ -193,14 +215,10 @@ .chzn-container-multi .chzn-choices { position: relative; overflow: hidden; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; margin: 0; - padding: 0; + padding: 0 5px; width: 100%; - height: auto !important; - height: 1%; + height: auto; border: 1px solid #aaa; background-color: #fff; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); @@ -221,39 +239,42 @@ } .chzn-container-multi .chzn-choices li.search-field input[type="text"] { margin: 1px 0; - padding: 5px; - height: 15px; + padding: 0; + height: 25px; outline: 0; border: 0 !important; background: transparent !important; box-shadow: none; - color: #666; + color: #999; font-size: 100%; font-family: sans-serif; line-height: normal; border-radius: 0; } -.chzn-container-multi .chzn-choices li.search-field .default { - color: #999; -} .chzn-container-multi .chzn-choices li.search-choice { position: relative; - margin: 3px 0 3px 5px; + margin: 3px 5px 3px 0; padding: 3px 20px 3px 5px; border: 1px solid #aaa; + max-width: 100%; border-radius: 3px; - background-color: #e4e4e4; + background-color: #eeeeee; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-size: 100% 19px; + background-repeat: repeat-x; background-clip: padding-box; box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05); color: #333; line-height: 13px; cursor: default; } +.chzn-container-multi .chzn-choices li.search-choice span { + word-wrap: break-word; +} .chzn-container-multi .chzn-choices li.search-choice .search-choice-close { position: absolute; top: 4px; @@ -272,10 +293,10 @@ border: 1px solid #ccc; background-color: #e4e4e4; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); - background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); + background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); color: #666; } .chzn-container-multi .chzn-choices li.search-choice-focus { @@ -311,6 +332,8 @@ background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%); background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%); background-image: linear-gradient(#eeeeee 20%, #ffffff 80%); + /* JUI remove next line */ + /* box-shadow: 0 1px 0 #fff inset; */ } .chzn-container-active.chzn-with-drop .chzn-single div { border-left: none; @@ -324,7 +347,7 @@ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); } .chzn-container-active .chzn-choices li.search-field input[type="text"] { - color: #111 !important; + color: #222 !important; } /* @end */ @@ -379,6 +402,7 @@ right: auto; left: 4px; } +.chzn-rtl.chzn-container-single-nosearch .chzn-search, .chzn-rtl .chzn-drop { left: 9999px; } @@ -396,11 +420,7 @@ .chzn-rtl .chzn-search input[type="text"] { padding: 4px 5px 4px 20px; background: white url('chosen-sprite.png') no-repeat -30px -20px; - background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background: url('chosen-sprite.png') no-repeat -30px -20px, -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -30px -20px, -moz-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -30px -20px, -o-linear-gradient(#eeeeee 1%, #ffffff 15%); - background: url('chosen-sprite.png') no-repeat -30px -20px, linear-gradient(#eeeeee 1%, #ffffff 15%); + background: url('chosen-sprite.png') no-repeat -30px -20px; direction: rtl; } .chzn-rtl.chzn-container-single .chzn-single div b { @@ -409,28 +429,5 @@ .chzn-rtl.chzn-container-single.chzn-with-drop .chzn-single div b { background-position: -12px 2px; } -[dir="rtl"] .chzn-container .chzn-drop, -[dir="rtl"] .chzn-container-single.chzn-container-single-nosearch .chzn-search { - left: auto; - right: -9999px; -} -[dir="rtl"] .chzn-container.chzn-with-drop .chzn-drop { - right: 0; -} /* @end */ -/* @group Retina compatibility */ -@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) { - .chzn-rtl .chzn-search input[type="text"], - .chzn-container-single .chzn-single abbr, - .chzn-container-single .chzn-single div b, - .chzn-container-single .chzn-search input[type="text"], - .chzn-container-multi .chzn-choices .search-choice .search-choice-close, - .chzn-container .chzn-results-scroll-down span, - .chzn-container .chzn-results-scroll-up span { - background-image: url('chosen-sprite@2x.png') !important; - background-size: 52px 37px !important; - background-repeat: no-repeat !important; - } -} -/* @end */ diff --git a/media/jui/js/chosen.jquery.js b/media/jui/js/chosen.jquery.js index d72b6becaeca0..efc65967c594a 100644 --- a/media/jui/js/chosen.jquery.js +++ b/media/jui/js/chosen.jquery.js @@ -1,18 +1,19 @@ -// Chosen, a Select Box Enhancer for jQuery and Prototype -// by Patrick Filler for Harvest, http://getharvest.com -// -// Version 0.14.0 -// Full source at https://github.com/harvesthq/chosen -// Copyright (c) 2011 Harvest http://getharvest.com - -// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md -// This file is generated by `grunt build`, do not edit it by hand. - -// -// Modified for Joomla! UI: -// - fix zero width, based on https://github.com/harvesthq/chosen/pull/1439 -// - allow to add a custom value on fly, based on https://github.com/harvesthq/chosen/pull/749 -// +/*! +Chosen, a Select Box Enhancer for jQuery and Prototype +by Patrick Filler for Harvest, http://getharvest.com + +Version 1.6.2 +Full source at https://github.com/harvesthq/chosen +Copyright (c) 2011-2016 Harvest http://getharvest.com + + Modified for Joomla! UI: + - rename the css and javascript classes and functions to revert back to using chzn and liszt + - fix zero width, based on https://github.com/harvesthq/chosen/pull/1439 + - allow to add a custom value on fly, based on https://github.com/harvesthq/chosen/pull/749 + +MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +This file is generated by `grunt build`, do not edit it by hand. +*/ (function() { var $, AbstractChosen, Chosen, SelectParser, _ref, @@ -35,14 +36,15 @@ SelectParser.prototype.add_group = function(group) { var group_position, option, _i, _len, _ref, _results; - group_position = this.parsed.length; this.parsed.push({ array_index: group_position, group: true, label: this.escapeExpression(group.label), + title: group.title ? group.title : void 0, children: 0, - disabled: group.disabled + disabled: group.disabled, + classes: group.className }); _ref = group.childNodes; _results = []; @@ -65,9 +67,11 @@ value: option.value, text: option.text, html: option.innerHTML, + title: option.title ? option.title : void 0, selected: option.selected, disabled: group_disabled === true ? group_disabled : option.disabled, group_array_index: group_position, + group_label: group_position != null ? this.parsed[group_position].label : null, classes: option.className, style: option.style.cssText }); @@ -84,7 +88,6 @@ SelectParser.prototype.escapeExpression = function(text) { var map, unsafe_chars; - if ((text == null) || text === false) { return ""; } @@ -110,7 +113,6 @@ SelectParser.select_to_array = function(select) { var child, parser, _i, _len, _ref; - parser = new SelectParser(); _ref = select.childNodes; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -133,12 +135,11 @@ this.setup(); this.set_up_html(); this.register_observers(); - this.finish_setup(); + this.on_ready(); } AbstractChosen.prototype.set_default_values = function() { var _this = this; - this.click_test_action = function(evt) { return _this.test_active_click(evt); }; @@ -149,7 +150,6 @@ this.mouse_on_container = false; this.results_showing = false; this.result_highlighted = null; - this.result_single_selected = null; /**/ /* Original: not exist */ this.allow_custom_value = false; @@ -164,7 +164,10 @@ this.max_selected_options = this.options.max_selected_options || Infinity; this.inherit_select_classes = this.options.inherit_select_classes || false; this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true; - return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true; + this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true; + this.include_group_label_in_selected = this.options.include_group_label_in_selected || false; + this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY; + return this.case_sensitive_search = this.options.case_sensitive_search || false; }; AbstractChosen.prototype.set_default_text = function() { @@ -182,6 +185,14 @@ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text; }; + AbstractChosen.prototype.choice_label = function(item) { + if (this.include_group_label_in_selected && (item.group_label != null)) { + return "" + item.group_label + "" + item.html; + } else { + return item.html; + } + }; + AbstractChosen.prototype.mouse_enter = function() { return this.mouse_on_container = true; }; @@ -192,7 +203,6 @@ AbstractChosen.prototype.input_focus = function(evt) { var _this = this; - if (this.is_multiple) { if (!this.active_field) { return setTimeout((function() { @@ -208,7 +218,6 @@ AbstractChosen.prototype.input_blur = function(evt) { var _this = this; - if (!this.mouse_on_container) { this.active_field = false; return setTimeout((function() { @@ -218,31 +227,38 @@ }; AbstractChosen.prototype.results_option_build = function(options) { - var content, data, _i, _len, _ref; - + var content, data, data_content, shown_results, _i, _len, _ref; content = ''; + shown_results = 0; _ref = this.results_data; for (_i = 0, _len = _ref.length; _i < _len; _i++) { data = _ref[_i]; + data_content = ''; if (data.group) { - content += this.result_add_group(data); + data_content = this.result_add_group(data); } else { - content += this.result_add_option(data); + data_content = this.result_add_option(data); + } + if (data_content !== '') { + shown_results++; + content += data_content; } if (options != null ? options.first : void 0) { if (data.selected && this.is_multiple) { this.choice_build(data); } else if (data.selected && !this.is_multiple) { - this.single_set_selected_text(data.text); + this.single_set_selected_text(this.choice_label(data)); } } + if (shown_results >= this.max_shown_results) { + break; + } } return content; }; AbstractChosen.prototype.result_add_option = function(option) { - var classes, style; - + var classes, option_el; if (!option.search_match) { return ''; } @@ -265,18 +281,37 @@ if (option.classes !== "") { classes.push(option.classes); } - style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : ""; - return "
  • " + option.search_text + "
  • "; + option_el = document.createElement("li"); + option_el.className = classes.join(" "); + option_el.style.cssText = option.style; + option_el.setAttribute("data-option-array-index", option.array_index); + option_el.innerHTML = option.search_text; + if (option.title) { + option_el.title = option.title; + } + return this.outerHTML(option_el); }; AbstractChosen.prototype.result_add_group = function(group) { + var classes, group_el; if (!(group.search_match || group.group_match)) { return ''; } if (!(group.active_options > 0)) { return ''; } - return "
  • " + group.search_text + "
  • "; + classes = []; + classes.push("group-result"); + if (group.classes) { + classes.push(group.classes); + } + group_el = document.createElement("li"); + group_el.className = classes.join(" "); + group_el.innerHTML = group.search_text; + if (group.title) { + group_el.title = group.title; + } + return this.outerHTML(group_el); }; AbstractChosen.prototype.results_update_field = function() { @@ -285,13 +320,27 @@ this.results_reset_cleanup(); } this.result_clear_highlight(); - this.result_single_selected = null; this.results_build(); if (this.results_showing) { return this.winnow_results(); } }; + AbstractChosen.prototype.reset_single_select_options = function() { + var result, _i, _len, _ref, _results; + _ref = this.results_data; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + result = _ref[_i]; + if (result.selected) { + _results.push(result.selected = false); + } else { + _results.push(void 0); + } + } + return _results; + }; + AbstractChosen.prototype.results_toggle = function() { if (this.results_showing) { return this.results_hide(); @@ -309,15 +358,13 @@ }; AbstractChosen.prototype.winnow_results = function() { - var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref; - + var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref; this.no_results_clear(); results = 0; searchText = this.get_search_text(); escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - regexAnchor = this.search_contains ? "" : "^"; - regex = new RegExp(regexAnchor + escapedSearchText, 'i'); zregex = new RegExp(escapedSearchText, 'i'); + regex = this.get_search_regex(escapedSearchText); _ref = this.results_data; for (_i = 0, _len = _ref.length; _i < _len; _i++) { option = _ref[_i]; @@ -335,8 +382,8 @@ } results_group.active_options += 1; } + option.search_text = option.group ? option.label : option.html; if (!(option.group && !this.group_search)) { - option.search_text = option.group ? option.label : option.html; option.search_match = this.search_string_match(option.search_text, regex); if (option.search_match && !option.group) { results += 1; @@ -366,9 +413,15 @@ } }; + AbstractChosen.prototype.get_search_regex = function(escaped_search_string) { + var regex_anchor, regex_flag; + regex_anchor = this.search_contains ? "" : "^"; + regex_flag = this.case_sensitive_search ? "" : "i"; + return new RegExp(regex_anchor + escaped_search_string, regex_flag); + }; + AbstractChosen.prototype.search_string_match = function(search_string, regex) { var part, parts, _i, _len; - if (regex.test(search_string)) { return true; } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) { @@ -386,7 +439,6 @@ AbstractChosen.prototype.choices_count = function() { var option, _i, _len, _ref; - if (this.selected_option_count != null) { return this.selected_option_count; } @@ -410,7 +462,6 @@ AbstractChosen.prototype.keyup_checker = function(evt) { var stroke, _ref; - stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; this.search_field_scale(); switch (stroke) { @@ -439,12 +490,20 @@ case 16: case 91: case 17: + case 18: break; default: return this.results_search(); } }; + AbstractChosen.prototype.clipboard_event_checker = function(evt) { + var _this = this; + return setTimeout((function() { + return _this.results_search(); + }), 50); + }; + AbstractChosen.prototype.container_width = function() { if (this.options.width != null) { return this.options.width; @@ -471,18 +530,39 @@ return true; }; + AbstractChosen.prototype.search_results_touchstart = function(evt) { + this.touch_started = true; + return this.search_results_mouseover(evt); + }; + + AbstractChosen.prototype.search_results_touchmove = function(evt) { + this.touch_started = false; + return this.search_results_mouseout(evt); + }; + + AbstractChosen.prototype.search_results_touchend = function(evt) { + if (this.touch_started) { + return this.search_results_mouseup(evt); + } + }; + + AbstractChosen.prototype.outerHTML = function(element) { + var tmp; + if (element.outerHTML) { + return element.outerHTML; + } + tmp = document.createElement("div"); + tmp.appendChild(element); + return tmp.innerHTML; + }; + AbstractChosen.browser_is_supported = function() { - if (window.navigator.appName === "Microsoft Internet Explorer") { + if ("Microsoft Internet Explorer" === window.navigator.appName) { return document.documentMode >= 8; } - if (/iP(od|hone)/i.test(window.navigator.userAgent)) { + if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) { return false; } - if (/Android/i.test(window.navigator.userAgent)) { - if (/Mobile/i.test(window.navigator.userAgent)) { - return false; - } - } return true; }; @@ -505,12 +585,15 @@ } return this.each(function(input_field) { var $this, chosen; - $this = $(this); chosen = $this.data('chosen'); - if (options === 'destroy' && chosen) { - chosen.destroy(); - } else if (!chosen) { + if (options === 'destroy') { + if (chosen instanceof Chosen) { + chosen.destroy(); + } + return; + } + if (!(chosen instanceof Chosen)) { $this.data('chosen', new Chosen(this, options)); } }); @@ -535,13 +618,8 @@ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl"); }; - Chosen.prototype.finish_setup = function() { - return this.form_field_jq.addClass("chzn-done"); - }; - Chosen.prototype.set_up_html = function() { var container_classes, container_props; - container_classes = ["chzn-container"]; container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single")); if (this.inherit_select_classes && this.form_field.className) { @@ -562,7 +640,7 @@ if (this.is_multiple) { this.container.html('
      '); } else { - this.container.html('' + this.default_text + '
        '); + this.container.html('' + this.default_text + '
          '); } this.form_field_jq.hide().after(this.container); this.dropdown = this.container.find('div.chzn-drop').first(); @@ -579,7 +657,10 @@ } this.results_build(); this.set_tab_index(); - this.set_label_behavior(); + return this.set_label_behavior(); + }; + + Chosen.prototype.on_ready = function() { return this.form_field_jq.trigger("liszt:ready", { chosen: this }); @@ -587,7 +668,14 @@ Chosen.prototype.register_observers = function() { var _this = this; - + this.container.bind('touchstart.chosen', function(evt) { + _this.container_mousedown(evt); + return evt.preventDefault(); + }); + this.container.bind('touchend.chosen', function(evt) { + _this.container_mouseup(evt); + return evt.preventDefault(); + }); this.container.bind('mousedown.chosen', function(evt) { _this.container_mousedown(evt); }); @@ -612,6 +700,15 @@ this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) { _this.search_results_mousewheel(evt); }); + this.search_results.bind('touchstart.chosen', function(evt) { + _this.search_results_touchstart(evt); + }); + this.search_results.bind('touchmove.chosen', function(evt) { + _this.search_results_touchmove(evt); + }); + this.search_results.bind('touchend.chosen', function(evt) { + _this.search_results_touchend(evt); + }); this.form_field_jq.bind("liszt:updated.chosen", function(evt) { _this.results_update_field(evt); }); @@ -621,6 +718,9 @@ this.form_field_jq.bind("liszt:open.chosen", function(evt) { _this.container_mousedown(evt); }); + this.form_field_jq.bind("liszt:close.chosen", function(evt) { + _this.input_blur(evt); + }); this.search_field.bind('blur.chosen', function(evt) { _this.input_blur(evt); }); @@ -633,6 +733,12 @@ this.search_field.bind('focus.chosen', function(evt) { _this.input_focus(evt); }); + this.search_field.bind('cut.chosen', function(evt) { + _this.clipboard_event_checker(evt); + }); + this.search_field.bind('paste.chosen', function(evt) { + _this.clipboard_event_checker(evt); + }); if (this.is_multiple) { return this.search_choices.bind('click.chosen', function(evt) { _this.choices_click(evt); @@ -645,7 +751,7 @@ }; Chosen.prototype.destroy = function() { - $(document).unbind("click.chosen", this.click_test_action); + $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); if (this.search_field[0].tabIndex) { this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex; } @@ -682,7 +788,7 @@ if (this.is_multiple) { this.search_field.val(""); } - $(document).bind('click.chosen', this.click_test_action); + $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action); this.results_show(); } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) { evt.preventDefault(); @@ -700,9 +806,10 @@ }; Chosen.prototype.search_results_mousewheel = function(evt) { - var delta, _ref1, _ref2; - - delta = -((_ref1 = evt.originalEvent) != null ? _ref1.wheelDelta : void 0) || ((_ref2 = evt.originialEvent) != null ? _ref2.detail : void 0); + var delta; + if (evt.originalEvent) { + delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail; + } if (delta != null) { evt.preventDefault(); if (evt.type === 'DOMMouseScroll') { @@ -719,7 +826,7 @@ }; Chosen.prototype.close_field = function() { - $(document).unbind("click.chosen", this.click_test_action); + $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action); this.active_field = false; this.results_hide(); this.container.removeClass("chzn-container-active"); @@ -736,7 +843,9 @@ }; Chosen.prototype.test_active_click = function(evt) { - if (this.container.is($(evt.target).closest('.chzn-container'))) { + var active_container; + active_container = $(evt.target).closest('.chzn-container'); + if (active_container.length && this.container[0] === active_container[0]) { return this.active_field = true; } else { return this.close_field(); @@ -770,7 +879,6 @@ Chosen.prototype.result_do_highlight = function(el) { var high_bottom, high_top, maxHeight, visible_bottom, visible_top; - if (el.length) { this.result_clear_highlight(); this.result_highlight = el; @@ -803,13 +911,13 @@ return false; } this.container.addClass("chzn-with-drop"); - this.form_field_jq.trigger("liszt:showing_dropdown", { - chosen: this - }); this.results_showing = true; this.search_field.focus(); this.search_field.val(this.search_field.val()); - return this.winnow_results(); + this.winnow_results(); + return this.form_field_jq.trigger("liszt:showing_dropdown", { + chosen: this + }); }; Chosen.prototype.update_results_content = function(content) { @@ -829,7 +937,6 @@ Chosen.prototype.set_tab_index = function(el) { var ti; - if (this.form_field.tabIndex) { ti = this.form_field.tabIndex; this.form_field.tabIndex = -1; @@ -839,7 +946,6 @@ Chosen.prototype.set_label_behavior = function() { var _this = this; - this.form_field_label = this.form_field_jq.parents("label"); if (!this.form_field_label.length && this.form_field.id.length) { this.form_field_label = $("label[for='" + this.form_field.id + "']"); @@ -867,7 +973,6 @@ Chosen.prototype.search_results_mouseup = function(evt) { var target; - target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); if (target.length) { this.result_highlight = target; @@ -878,7 +983,6 @@ Chosen.prototype.search_results_mouseover = function(evt) { var target; - target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); if (target) { return this.result_do_highlight(target); @@ -894,10 +998,9 @@ Chosen.prototype.choice_build = function(item) { var choice, close_link, _this = this; - choice = $('
        • ', { "class": "search-choice" - }).html("" + item.html + ""); + }).html("" + (this.choice_label(item)) + ""); if (item.disabled) { choice.addClass('search-choice-disabled'); } else { @@ -933,8 +1036,8 @@ }; Chosen.prototype.results_reset = function() { + this.reset_single_select_options(); this.form_field.options[0].selected = true; - this.selected_option_count = null; this.single_set_selected_text(); this.show_search_field_default(); this.results_reset_cleanup(); @@ -969,12 +1072,7 @@ if (this.is_multiple) { high.removeClass("active-result"); } else { - if (this.result_single_selected) { - this.result_single_selected.removeClass("result-selected"); - selected_index = this.result_single_selected[0].getAttribute('data-option-array-index'); - this.results_data[selected_index].selected = false; - } - this.result_single_selected = high; + this.reset_single_select_options(); } high.addClass("result-selected"); item = this.results_data[high[0].getAttribute("data-option-array-index")]; @@ -984,18 +1082,19 @@ if (this.is_multiple) { this.choice_build(item); } else { - this.single_set_selected_text(item.text); + this.single_set_selected_text(this.choice_label(item)); } if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) { this.results_hide(); } - this.search_field.val(""); + this.show_search_field_default(); if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) { this.form_field_jq.trigger("change", { 'selected': this.form_field.options[item.options_index].value }); } this.current_selectedIndex = this.form_field.selectedIndex; + evt.preventDefault(); return this.search_field_scale(); } /**/ @@ -1049,12 +1148,11 @@ this.single_deselect_control_build(); this.selected_item.removeClass("chzn-default"); } - return this.selected_item.find("span").text(text); + return this.selected_item.find("span").html(text); }; Chosen.prototype.result_deselect = function(pos) { var result_data; - result_data = this.results_data[pos]; if (!this.form_field.options[result_data.options_index].disabled) { result_data.selected = false; @@ -1085,16 +1183,11 @@ }; Chosen.prototype.get_search_text = function() { - if (this.search_field.val() === this.default_text) { - return ""; - } else { - return $('
          ').text($.trim(this.search_field.val())).html(); - } + return $('
          ').text($.trim(this.search_field.val())).html(); }; Chosen.prototype.winnow_results_set_highlight = function() { var do_high, selected_results; - selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); if (do_high != null) { @@ -1104,10 +1197,12 @@ Chosen.prototype.no_results = function(terms) { var no_results_html; - no_results_html = $('
        • ' + this.results_none_found + ' ""
        • '); no_results_html.find("span").first().html(terms); - return this.search_results.append(no_results_html); + this.search_results.append(no_results_html); + return this.form_field_jq.trigger("liszt:no_results", { + chosen: this + }); }; Chosen.prototype.no_results_clear = function() { @@ -1116,7 +1211,6 @@ Chosen.prototype.keydown_arrow = function() { var next_sib; - if (this.results_showing && this.result_highlight) { next_sib = this.result_highlight.nextAll("li.active-result").first(); if (next_sib) { @@ -1129,7 +1223,6 @@ Chosen.prototype.keyup_arrow = function() { var prev_sibs; - if (!this.results_showing && !this.is_multiple) { return this.results_show(); } else if (this.result_highlight) { @@ -1147,7 +1240,6 @@ Chosen.prototype.keydown_backstroke = function() { var next_available_destroy; - if (this.pending_backstroke) { this.choice_destroy(this.pending_backstroke.find("a").first()); return this.clear_backstroke(); @@ -1173,7 +1265,6 @@ Chosen.prototype.keydown_checker = function(evt) { var stroke, _ref1; - stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode; this.search_field_scale(); if (stroke !== 8 && this.pending_backstroke) { @@ -1190,7 +1281,14 @@ this.mouse_on_container = false; break; case 13: - evt.preventDefault(); + if (this.results_showing) { + evt.preventDefault(); + } + break; + case 32: + if (this.disable_search) { + evt.preventDefault(); + } break; case 38: evt.preventDefault(); @@ -1205,7 +1303,6 @@ Chosen.prototype.search_field_scale = function() { var div, f_width, h, style, style_block, styles, w, _i, _len; - if (this.is_multiple) { h = 0; w = 0; diff --git a/media/jui/js/chosen.jquery.min.js b/media/jui/js/chosen.jquery.min.js index 5be8c12faa9d3..36da67b79f98e 100644 --- a/media/jui/js/chosen.jquery.min.js +++ b/media/jui/js/chosen.jquery.min.js @@ -1 +1 @@ -(function(){var e,t,n,r,i,s={}.hasOwnProperty,o=function(e,t){function r(){this.constructor=e}for(var n in t)s.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r\"\'\`]/.test(e)?(t={"<":"<",">":">",'"':""","'":"'","`":"`"},n=/&(?!\w+;)|[\<\>\"\'\`]/g,e.replace(n,function(e){return t[e]||"&"})):e},e}(),r.select_to_array=function(e){var t,n,i,s,o;n=new r,o=e.childNodes;for(i=0,s=o.length;i'+e.search_text+""):"":""},e.prototype.result_add_group=function(e){return!e.search_match&&!e.group_match?"":e.active_options>0?'
        • '+e.search_text+"
        • ":""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build();if(this.results_showing)return this.winnow_results()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(){var e,t,n,r,i,s,o,u,a,f,l,c,h;this.no_results_clear(),i=0,o=this.get_search_text(),e=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),r=this.search_contains?"":"^",n=new RegExp(r+e,"i"),f=new RegExp(e,"i"),h=this.results_data;for(l=0,c=h.length;l"+t.search_text.substr(u+o.length),t.search_text=a.substr(0,u)+""+a.substr(u)),s!=null&&(s.group_match=!0)):t.group_array_index!=null&&this.results_data[t.group_array_index].search_match&&(t.search_match=!0)}}return this.result_clear_highlight(),i<1&&o.length?(this.update_results_content(""),this.no_results(o)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},e.prototype.search_string_match=function(e,t){var n,r,i,s;if(t.test(e))return!0;if(this.enable_split_word_search&&(e.indexOf(" ")>=0||e.indexOf("[")===0)){r=e.replace(/\[|\]/g,"").split(" ");if(r.length)for(i=0,s=r.length;i0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.container_width=function(){return this.options.width!=null?this.options.width:this.form_field_jq.css("width")||""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return this.is_multiple&&!this.display_selected_options&&e.selected?!1:!this.display_disabled_options&&e.disabled?!1:e.empty?!1:!0},e.browser_is_supported=function(){return window.navigator.appName==="Microsoft Internet Explorer"?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),e=jQuery,e.fn.extend({chosen:function(r){return t.browser_is_supported()?this.each(function(t){var i,s;i=e(this),s=i.data("chosen"),r==="destroy"&&s?s.destroy():s||i.data("chosen",new n(this,r))}):this}}),n=function(t){function n(){return i=n.__super__.constructor.apply(this,arguments),i}return o(n,t),n.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.allow_custom_value=this.form_field_jq.hasClass("chzn-custom-value")||this.options.allow_custom_value,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},n.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},n.prototype.set_up_html=function(){var t,n;return t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),n={"class":t.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(n.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chzn"),this.container=e("
          ",n),this.is_multiple?this.container.html('
            '):this.container.html(''+this.default_text+'
              '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},n.prototype.register_observers=function(){var e=this;return this.container.bind("mousedown.chosen",function(t){e.container_mousedown(t)}),this.container.bind("mouseup.chosen",function(t){e.container_mouseup(t)}),this.container.bind("mouseenter.chosen",function(t){e.mouse_enter(t)}),this.container.bind("mouseleave.chosen",function(t){e.mouse_leave(t)}),this.search_results.bind("mouseup.chosen",function(t){e.search_results_mouseup(t)}),this.search_results.bind("mouseover.chosen",function(t){e.search_results_mouseover(t)}),this.search_results.bind("mouseout.chosen",function(t){e.search_results_mouseout(t)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(t){e.search_results_mousewheel(t)}),this.form_field_jq.bind("liszt:updated.chosen",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate.chosen",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open.chosen",function(t){e.container_mousedown(t)}),this.search_field.bind("blur.chosen",function(t){e.input_blur(t)}),this.search_field.bind("keyup.chosen",function(t){e.keyup_checker(t)}),this.search_field.bind("keydown.chosen",function(t){e.keydown_checker(t)}),this.search_field.bind("focus.chosen",function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.bind("click.chosen",function(t){e.choices_click(t)}):this.container.bind("click.chosen",function(e){e.preventDefault()})},n.prototype.destroy=function(){return e(document).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus.chosen",this.activate_action)},n.prototype.container_mousedown=function(t){if(!this.is_disabled){t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault();if(t==null||!e(t.target).hasClass("search-choice-close"))return this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()}},n.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},n.prototype.search_results_mousewheel=function(e){var t,n,r;t=-((n=e.originalEvent)!=null?n.wheelDelta:void 0)||((r=e.originialEvent)!=null?r.detail:void 0);if(t!=null)return e.preventDefault(),e.type==="DOMMouseScroll"&&(t*=40),this.search_results.scrollTop(t+this.search_results.scrollTop())},n.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},n.prototype.close_field=function(){return e(document).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},n.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(t){return this.container.is(e(t.target).closest(".chzn-container"))?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=r.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chzn-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chzn-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n0)return this.form_field_label.bind("click.chosen",function(e){return t.is_multiple?t.container_mousedown(e):t.activate_field()})},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},n.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},n.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},n.prototype.choice_build=function(t){var n,r,i=this;return n=e("
            • ",{"class":"search-choice"}).html(""+t.html+""),t.disabled?n.addClass("search-choice-disabled"):(r=e("",{"class":"search-choice-close","data-option-array-index":t.array_index}),r.bind("click.chosen",function(e){return i.choice_destroy_link_click(e)}),n.append(r)),this.search_container.before(n)},n.prototype.choice_destroy_link_click=function(t){t.preventDefault(),t.stopPropagation();if(!this.is_disabled)return this.choice_destroy(e(t.target))},n.prototype.choice_destroy=function(e){if(this.result_deselect(e[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_option_count=null,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var n,r,i,s,o,u,a;if(this.result_highlight)return r=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(this.is_multiple?r.removeClass("active-result"):(this.result_single_selected&&(this.result_single_selected.removeClass("result-selected"),selected_index=this.result_single_selected[0].getAttribute("data-option-array-index"),this.results_data[selected_index].selected=!1),this.result_single_selected=r),r.addClass("result-selected"),s=this.results_data[r[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(s.text),(!t.metaKey&&!t.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale());if(!this.is_multiple&&this.allow_custom_value)return a=this.search_field.val(),n=this.add_unique_custom_group(),o=e('"),n.append(o),this.form_field_jq.append(n),this.form_field.options[this.form_field.options.length-1].selected=!0,t.metaKey||this.results_hide(),this.results_build()},n.prototype.find_custom_group=function(){var t,n,r,i,s;s=e("optgroup",this.form_field);for(r=0,i=s.length;r')),e(t)},n.prototype.single_set_selected_text=function(e){return e==null&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chzn-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chzn-default")),this.selected_item.find("span").text(e)},n.prototype.result_deselect=function(e){var t;return t=this.results_data[e],this.form_field.options[t.options_index].disabled?!1:(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(!this.allow_single_deselect)return;return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chzn-single-with-deselect")},n.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":e("
              ").text(e.trim(this.search_field.val())).html()},n.prototype.winnow_results_set_highlight=function(){var e,t;t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)},n.prototype.no_results=function(t){var n;return n=e('
            • '+this.results_none_found+' ""
            • '),n.find("span").first().html(t),this.search_results.append(n)},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var e;if(!this.results_showing||!this.result_highlight)return this.results_show();e=this.result_highlight.nextAll("li.active-result").first();if(e)return this.result_do_highlight(e)},n.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())},n.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},n.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a",{style:s}),t.text(this.search_field.val()),e("body").append(t),u=t.width()+25,t.remove(),n=this.container.outerWidth(),u>n-10&&(u=n-10),this.search_field.css({width:u+"px"})}},n}(t)}).call(this); \ No newline at end of file +(function(){var a,b,c,d,e,f={}.hasOwnProperty,g=function(a,b){function d(){this.constructor=a}for(var c in b)f.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;d\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;e"+a.group_label+""+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return b.blur_test()},100)},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;f=this.max_shown_results));f++);return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;b"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+""+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),d<1&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;e0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},a.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field_jq.css("width")||""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return!(this.is_multiple&&!this.display_selected_options&&a.selected)&&(!(!this.display_disabled_options&&a.disabled)&&!a.empty)},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){if(this.touch_started)return this.search_results_mouseup(a)},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(b){var e,f;return e=a(this),f=e.data("chosen"),"destroy"===d?void(f instanceof c&&f.destroy()):void(f instanceof c||e.data("chosen",new c(this,d)))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return g(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.allow_custom_value=this.form_field_jq.hasClass("chzn-custom-value")||this.options.allow_custom_value,this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},c.prototype.set_up_html=function(){var b,c;return b=["chzn-container"],b.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chzn-rtl"),c={class:b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chzn"),this.container=a("
              ",c),this.is_multiple?this.container.html('
                '):this.container.html('
                '+this.default_text+'
                  '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},c.prototype.on_ready=function(){return this.form_field_jq.trigger("liszt:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("liszt:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("liszt:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("liszt:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("liszt:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},c.prototype.container_mousedown=function(b){if(!this.is_disabled&&(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null==b||!a(b.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chzn-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},c.prototype.container_mouseup=function(a){if("ABBR"===a.target.nodeName&&!this.is_disabled)return this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;if(a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b)return a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())},c.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},c.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chzn-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chzn-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chzn-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c0)return this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()})},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;if(c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length)return this.result_highlight=c,this.result_select(b),this.search_field.focus()},c.prototype.search_results_mouseover=function(b){var c;if(c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first())return this.result_do_highlight(c)},c.prototype.search_results_mouseout=function(b){if(a(b.target).hasClass("active-result"))return this.result_clear_highlight()},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("
                • ",{class:"search-choice"}).html(""+this.choice_label(b)+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{class:"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){if(b.preventDefault(),b.stopPropagation(),!this.is_disabled)return this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){if(this.result_deselect(a[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()},c.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(b){var c,d,f,g,i;return this.result_highlight?(d=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(this.is_multiple?d.removeClass("active-result"):this.reset_single_select_options(),d.addClass("result-selected"),f=this.results_data[d[0].getAttribute("data-option-array-index")],f.selected=!0,this.form_field.options[f.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(f):this.single_set_selected_text(this.choice_label(f)),(b.metaKey||b.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[f.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,b.preventDefault(),this.search_field_scale())):!this.is_multiple&&this.allow_custom_value?(i=this.search_field.val(),c=this.add_unique_custom_group(),g=a('"),c.append(g),this.form_field_jq.append(c),this.form_field.options[this.form_field.options.length-1].selected=!0,b.metaKey||this.results_hide(),this.results_build()):void 0},c.prototype.find_custom_group=function(){var b,c,d,e,f;for(f=a("optgroup",this.form_field),d=0,e=f.length;d')),a(b)},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chzn-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chzn-default")),this.selected_item.find("span").html(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],!this.form_field.options[b.options_index].disabled&&(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chzn-single-with-deselect")},c.prototype.get_search_text=function(){return a("
                  ").text(a.trim(this.search_field.val())).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;if(b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a)return this.result_do_highlight(a)},c.prototype.no_results=function(b){var c;return c=a('
                • '+this.results_none_found+' ""
                • '),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("liszt:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;i",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},c}(b)}).call(this); \ No newline at end of file diff --git a/media/jui/js/cms-uncompressed.js b/media/jui/js/cms-uncompressed.js index af1d63ab51593..ec59ca4efb397 100644 --- a/media/jui/js/cms-uncompressed.js +++ b/media/jui/js/cms-uncompressed.js @@ -8,6 +8,9 @@ if (typeof(Joomla) === 'undefined') { var Joomla = {}; } +!(function (document, Joomla) { + "use strict"; + /** * Sets the HTML of the container-collapse element */ @@ -15,31 +18,74 @@ Joomla.setcollapse = function(url, name, height) { if (!document.getElementById('collapse-' + name)) { document.getElementById('container-collapse').innerHTML = '
                  '; } +}; + +/** + * IE8 polyfill for indexOf() + */ +if (!Array.prototype.indexOf) +{ + Array.prototype.indexOf = function(elt) + { + var len = this.length >>> 0; + + var from = Number(arguments[1]) || 0; + from = (from < 0) ? Math.ceil(from) : Math.floor(from); + + if (from < 0) + { + from += len; + } + + for (; from < len; from++) + { + if (from in this && this[from] === elt) + { + return from; + } + } + return -1; + }; } + /** + * JField 'showon' feature. + */ + window.jQuery && (function ($) { -if (jQuery) { - jQuery(document).ready(function($) { - var linkedoptions = function(target) { - var showfield = true, itemval, jsondata = target.data('showon'); + /** + * Method to check condition and change the target visibility + * @param {jQuery} target + * @param {Boolean} animate + */ + function linkedoptions (target, animate) { + var showfield = true, + jsondata = target.data('showon') || [], + itemval, condition, fieldName, $fields; // Check if target conditions are satisfied - $.each(jsondata, function(j, item) { - $fields = $('[name="' + jsondata[j]['field'] + '"], [name="' + jsondata[j]['field'] + '[]"]'); - jsondata[j]['valid'] = 0; + for (var j = 0, lj = jsondata.length; j < lj; j++) { + condition = jsondata[j] || {}; + fieldName = condition.field; + $fields = $('[name="' + fieldName + '"], [name="' + fieldName + '[]"]'); + + condition['valid'] = 0; // Test in each of the elements in the field array if condition is valid $fields.each(function() { + var $field = $(this); + // If checkbox or radio box the value is read from proprieties - if (['checkbox','radio'].indexOf($(this).attr('type')) != -1) + if (['checkbox','radio'].indexOf($field.attr('type')) !== -1) { - itemval = $(this).prop('checked') ? $(this).val() : ''; + itemval = $field.prop('checked') ? $field.val() : ''; } else { - itemval = $(this).val(); + itemval = $field.val(); } - // Convert to array to allow multiple values in the field (e.g. type=list multiple) and normalize as string + // Convert to array to allow multiple values in the field (e.g. type=list multiple) + // and normalize as string if (!(typeof itemval === 'object')) { itemval = JSON.parse('["' + itemval + '"]'); @@ -48,18 +94,18 @@ if (jQuery) { // Test if any of the values of the field exists in showon conditions for (var i in itemval) { - if (jsondata[j]['values'].indexOf(itemval[i]) != -1) + if (condition['values'].indexOf(itemval[i]) !== -1) { - jsondata[j]['valid'] = 1; + condition['valid'] = 1; } } }); // Verify conditions // First condition (no operator): current condition must be valid - if (jsondata[j]['op'] == '') + if (condition['op'] === '') { - if (jsondata[j]['valid'] == 0) + if (condition['valid'] === 0) { showfield = false; } @@ -68,35 +114,88 @@ if (jQuery) { else { // AND operator: both the previous and current conditions must be valid - if (jsondata[j]['op'] == 'AND' && jsondata[j]['valid'] + jsondata[j-1]['valid'] < 2) + if (condition['op'] === 'AND' && condition['valid'] + jsondata[j-1]['valid'] < 2) { showfield = false; } // OR operator: one of the previous and current conditions must be valid - if (jsondata[j]['op'] == 'OR' && jsondata[j]['valid'] + jsondata[j-1]['valid'] > 0) + if (condition['op'] === 'OR' && condition['valid'] + jsondata[j-1]['valid'] > 0) { showfield = true; } } - }); + } // If conditions are satisfied show the target field(s), else hide - (showfield) ? target.slideDown() : target.slideUp(); - }; + if (animate) { + (showfield) ? target.slideDown() : target.slideUp(); + } else { + target.toggle(showfield); + } + } - $('[data-showon]').each(function() { - var target = $(this), jsondata = $(this).data('showon'); + /** + * Method for setup the 'showon' feature, for the fields in given container + * @param {HTMLElement} container + */ + function setUpShowon (container) { + container = container || document; - // Attach events to referenced element - $.each(jsondata, function(j, item) { - $fields = $('[name="' + jsondata[j]['field'] + '"], [name="' + jsondata[j]['field'] + '[]"]'); - // Attach events to referenced element - $fields.each(function() { - linkedoptions(target); - }).bind('change', function() { - linkedoptions(target); - }); + var $showonFields = $(container).find('[data-showon]'); + + // Setup each 'showon' field + for (var is = 0, ls = $showonFields.length; is < ls; is++) { + // Use anonymous function to capture arguments + (function () { + var $target = $($showonFields[is]), jsondata = $target.data('showon') || [], + field, $fields = $(); + + // Collect an all referenced elements + for (var ij = 0, lj = jsondata.length; ij < lj; ij++) { + field = jsondata[ij]['field']; + $fields = $fields.add($('[name="' + field + '"], [name="' + field + '[]"]')); + } + + // Check current condition for element + linkedoptions($target); + + // Attach events to referenced element, to check condition on change + $fields.on('change', function() { + linkedoptions($target, true); + }); + })(); + } + } + + /** + * Initialize 'showon' feature + */ + $(document).ready(function() { + setUpShowon(); + + // Setup showon feature in the subform field + $(document).on('subform-row-add', function(event, row){ + var $row = $(row), + $elements = $row.find('[data-showon]'), + baseName = $row.data('baseName'), + group = $row.data('group'), + search = new RegExp('\\[' + baseName + '\\]\\[' + baseName + 'X\\]', 'g'), + replace = '[' + baseName + '][' + group + ']', + $elm, showon; + + // Fix showon field names in a current group + for (var i = 0, l = $elements.length; i < l; i++) { + $elm = $($elements[i]); + showon = $elm.attr('data-showon').replace(search, replace); + + $elm.attr('data-showon', showon); + } + + setUpShowon(row); }); }); - }); -} \ No newline at end of file + + })(jQuery); + + +})(document, Joomla); diff --git a/media/jui/js/cms.js b/media/jui/js/cms.js index aa7becd61b052..3cfbf1528bcce 100644 --- a/media/jui/js/cms.js +++ b/media/jui/js/cms.js @@ -1 +1 @@ -if("undefined"===typeof Joomla)var Joomla={};Joomla.setcollapse=function(e,i,a){if(!document.getElementById("collapse-"+i))document.getElementById("container-collapse").innerHTML='
                  '};if(jQuery)jQuery(document).ready(function(e){var i=function(i){var a=true,n,l=i.data("showon");e.each(l,function(i,o){$fields=e('[name="'+l[i]["field"]+'"], [name="'+l[i]["field"]+'[]"]');l[i]["valid"]=0;$fields.each(function(){if(["checkbox","radio"].indexOf(e(this).attr("type"))!=-1)n=e(this).prop("checked")?e(this).val():"";else n=e(this).val();if(!("object"===typeof n))n=JSON.parse('["'+n+'"]');for(var a in n)if(l[i]["values"].indexOf(n[a])!=-1)l[i]["valid"]=1});if(""==l[i]["op"]){if(0==l[i]["valid"])a=false}else{if("AND"==l[i]["op"]&&l[i]["valid"]+l[i-1]["valid"]<2)a=false;if("OR"==l[i]["op"]&&l[i]["valid"]+l[i-1]["valid"]>0)a=true}});a?i.slideDown():i.slideUp()};e("[data-showon]").each(function(){var a=e(this),n=e(this).data("showon");e.each(n,function(l,o){$fields=e('[name="'+n[l]["field"]+'"], [name="'+n[l]["field"]+'[]"]');$fields.each(function(){i(a)}).bind("change",function(){i(a)})})})}); \ No newline at end of file +if(typeof Joomla==="undefined"){var Joomla={}}!function(document,Joomla){"use strict";Joomla.setcollapse=function(url,name,height){if(!document.getElementById("collapse-"+name)){document.getElementById("container-collapse").innerHTML='
                  '}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt){var len=this.length>>>0;var from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0){from+=len}for(;from0){showfield=true}}}if(animate){showfield?target.slideDown():target.slideUp()}else{target.toggle(showfield)}}function setUpShowon(container){container=container||document;var $showonFields=$(container).find("[data-showon]");for(var is=0,ls=$showonFields.length;is)([^>]*)$/; // $(html) "looks like html" rule change jQuery.fn.init = function( selector, context, rootjQuery ) { - var match; + var match, ret; - if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) && - (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) { - // This is an HTML string according to the "old" rules; is it still? - if ( selector.charAt( 0 ) !== "<" ) { - migrateWarn("$(html) HTML strings must start with '<' character"); - } - if ( match[ 3 ] ) { - migrateWarn("$(html) HTML text after last tag is ignored"); - } - // Consistently reject any HTML-like string starting with a hash (#9521) - // Note that this may break jQuery 1.6.x code that otherwise would work. - if ( match[ 0 ].charAt( 0 ) === "#" ) { - migrateWarn("HTML string cannot start with a '#' character"); - jQuery.error("JQMIGRATE: Invalid selector string (XSS)"); - } - // Now process using loose rules; let pre-1.8 play too - if ( context && context.context ) { - // jQuery object as context; parseHTML expects a DOM object - context = context.context; + if ( selector && typeof selector === "string" ) { + if ( !jQuery.isPlainObject( context ) && + (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) { + + // This is an HTML string according to the "old" rules; is it still? + if ( !rspaceAngle.test( selector ) ) { + migrateWarn("$(html) HTML strings must start with '<' character"); + } + if ( match[ 3 ] ) { + migrateWarn("$(html) HTML text after last tag is ignored"); + } + + // Consistently reject any HTML-like string starting with a hash (gh-9521) + // Note that this may break jQuery 1.6.x code that otherwise would work. + if ( match[ 0 ].charAt( 0 ) === "#" ) { + migrateWarn("HTML string cannot start with a '#' character"); + jQuery.error("JQMIGRATE: Invalid selector string (XSS)"); + } + + // Now process using loose rules; let pre-1.8 play too + // Is this a jQuery context? parseHTML expects a DOM element (#178) + if ( context && context.context && context.context.nodeType ) { + context = context.context; + } + + if ( jQuery.parseHTML ) { + return oldInit.call( this, + jQuery.parseHTML( match[ 2 ], context && context.ownerDocument || + context || document, true ), context, rootjQuery ); + } } - if ( jQuery.parseHTML ) { - return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ), - context, rootjQuery ); + } + + ret = oldInit.apply( this, arguments ); + + // Fill in selector and context properties so .live() works + if ( selector && selector.selector !== undefined ) { + // A jQuery object, copy its properties + ret.selector = selector.selector; + ret.context = selector.context; + + } else { + ret.selector = typeof selector === "string" ? selector : ""; + if ( selector ) { + ret.context = selector.nodeType? selector : context || document; } } - return oldInit.apply( this, arguments ); + + return ret; }; jQuery.fn.init.prototype = jQuery.fn; +jQuery.find = function( selector ) { + var args = Array.prototype.slice.call( arguments ); + + // Support: PhantomJS 1.x + // String#match fails to match when used with a //g RegExp, only on some strings + if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { + + // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 + // First see if qS thinks it's a valid selector, if so avoid a false positive + try { + document.querySelector( selector ); + } catch ( err1 ) { + + // Didn't *look* valid to qSA, warn and try quoting what we think is the value + selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { + return "[" + attr + op + "\"" + value + "\"]"; + } ); + + // If the regexp *may* have created an invalid selector, don't update it + // Note that there may be false alarms if selector uses jQuery extensions + try { + document.querySelector( selector ); + migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); + args[ 0 ] = selector; + } catch ( err2 ) { + migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); + } + } + } + + return oldFind.apply( this, args ); +}; + +// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) +var findProp; +for ( findProp in oldFind ) { + if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { + jQuery.find[ findProp ] = oldFind[ findProp ]; + } +} + // Let $.parseJSON(falsy_value) return null jQuery.parseJSON = function( json ) { - if ( !json && json !== null ) { + if ( !json ) { migrateWarn("jQuery.parseJSON requires a valid JSON string"); return null; } @@ -274,6 +346,11 @@ if ( !jQuery.browser ) { // Warn if the code tries to get jQuery.browser migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" ); +// jQuery.boxModel deprecated in 1.3, jQuery.support.boxModel deprecated in 1.7 +jQuery.boxModel = jQuery.support.boxModel = (document.compatMode === "CSS1Compat"); +migrateWarnProp( jQuery, "boxModel", jQuery.boxModel, "jQuery.boxModel is deprecated" ); +migrateWarnProp( jQuery.support, "boxModel", jQuery.support.boxModel, "jQuery.support.boxModel is deprecated" ); + jQuery.sub = function() { function jQuerySub( selector, context ) { return new jQuerySub.fn.init( selector, context ); @@ -284,11 +361,10 @@ jQuery.sub = function() { jQuerySub.fn.constructor = jQuerySub; jQuerySub.sub = this.sub; jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + var instance = jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + return instance instanceof jQuerySub ? + instance : + jQuerySub( instance ); }; jQuerySub.fn.init.prototype = jQuerySub.fn; var rootjQuerySub = jQuerySub(document); @@ -296,6 +372,57 @@ jQuery.sub = function() { return jQuerySub; }; +// The number of elements contained in the matched element set +jQuery.fn.size = function() { + migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" ); + return this.length; +}; + + +var internalSwapCall = false; + +// If this version of jQuery has .swap(), don't false-alarm on internal uses +if ( jQuery.swap ) { + jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { + var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; + + if ( oldHook ) { + jQuery.cssHooks[ name ].get = function() { + var ret; + + internalSwapCall = true; + ret = oldHook.apply( this, arguments ); + internalSwapCall = false; + return ret; + }; + } + }); +} + +jQuery.swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + if ( !internalSwapCall ) { + migrateWarn( "jQuery.swap() is undocumented and deprecated" ); + } + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + // Ensure that $.ajax gets the new parseJSON defined in core.js jQuery.ajaxSetup({ @@ -324,13 +451,7 @@ jQuery.fn.data = function( name ) { }; -var rscriptType = /\/(java|ecma)script/i, - oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; - -jQuery.fn.andSelf = function() { - migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"); - return oldSelf.apply( this, arguments ); -}; +var rscriptType = /\/(java|ecma)script/i; // Since jQuery.clean is used internally on older versions, we only shim if it's missing if ( !jQuery.clean ) { @@ -388,6 +509,7 @@ var eventAdd = jQuery.event.add, oldToggle = jQuery.fn.toggle, oldLive = jQuery.fn.live, oldDie = jQuery.fn.die, + oldLoad = jQuery.fn.load, ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess", rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ), rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, @@ -422,17 +544,35 @@ jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){ eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes ); }; -jQuery.fn.error = function() { - var args = Array.prototype.slice.call( arguments, 0); - migrateWarn("jQuery.fn.error() is deprecated"); - args.splice( 0, 0, "error" ); - if ( arguments.length ) { - return this.bind.apply( this, args ); - } - // error event should not bubble to window, although it does pre-1.7 - this.triggerHandler.apply( this, args ); - return this; -}; +jQuery.each( [ "load", "unload", "error" ], function( _, name ) { + + jQuery.fn[ name ] = function() { + var args = Array.prototype.slice.call( arguments, 0 ); + + // If this is an ajax load() the first arg should be the string URL; + // technically this could also be the "Anything" arg of the event .load() + // which just goes to show why this dumb signature has been deprecated! + // jQuery custom builds that exclude the Ajax module justifiably die here. + if ( name === "load" && typeof args[ 0 ] === "string" ) { + return oldLoad.apply( this, args ); + } + + migrateWarn( "jQuery.fn." + name + "() is deprecated" ); + + args.splice( 0, 0, name ); + if ( arguments.length ) { + return this.bind.apply( this, args ); + } + + // Use .triggerHandler here because: + // - load and unload events don't need to bubble, only applied to window or image + // - error event should not bubble to window, although it does pre-1.7 + // See http://bugs.jquery.com/ticket/11820 + this.triggerHandler.apply( this, args ); + return this; + }; + +}); jQuery.fn.toggle = function( fn, fn2 ) { @@ -501,7 +641,7 @@ jQuery.each( ajaxEvents.split("|"), // The document needs no shimming; must be !== for oldIE if ( elem !== document ) { jQuery.event.add( document, name + "." + jQuery.guid, function() { - jQuery.event.trigger( name, null, elem, true ); + jQuery.event.trigger( name, Array.prototype.slice.call( arguments, 1 ), elem, true ); }); jQuery._data( this, name, jQuery.guid++ ); } @@ -517,5 +657,96 @@ jQuery.each( ajaxEvents.split("|"), } ); +jQuery.event.special.ready = { + setup: function() { + if ( this === document ) { + migrateWarn( "'ready' event is deprecated" ); + } + } +}; + +var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, + oldFnFind = jQuery.fn.find; + +jQuery.fn.andSelf = function() { + migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"); + return oldSelf.apply( this, arguments ); +}; + +jQuery.fn.find = function( selector ) { + var ret = oldFnFind.apply( this, arguments ); + ret.context = this.context; + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; +}; + + +// jQuery 1.6 did not support Callbacks, do not warn there +if ( jQuery.Callbacks ) { + + var oldDeferred = jQuery.Deferred, + tuples = [ + // action, add listener, callbacks, .then handlers, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), + jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), + jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory"), + jQuery.Callbacks("memory") ] + ]; + + jQuery.Deferred = function( func ) { + var deferred = oldDeferred(), + promise = deferred.promise(); + + deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + migrateWarn( "deferred.pipe() is deprecated" ); + + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + }); + }); + fns = null; + }).promise(); + + }; + + deferred.isResolved = function() { + migrateWarn( "deferred.isResolved is deprecated" ); + return deferred.state() === "resolved"; + }; + + deferred.isRejected = function() { + migrateWarn( "deferred.isRejected is deprecated" ); + return deferred.state() === "rejected"; + }; + + if ( func ) { + func.call( deferred, deferred ); + } + + return deferred; + }; + +} })( jQuery, window ); diff --git a/media/jui/js/jquery-migrate.min.js b/media/jui/js/jquery-migrate.min.js index 62149c28b9d88..2e84fcb91a957 100644 --- a/media/jui/js/jquery-migrate.min.js +++ b/media/jui/js/jquery-migrate.min.js @@ -1,2 +1,2 @@ -/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ -jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window); \ No newline at end of file +/*! jQuery Migrate v1.4.1 | (c) jQuery Foundation and other contributors | jquery.org/license */ +"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b,c){function d(c){var d=b.console;f[c]||(f[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function e(b,c,e,f){if(Object.defineProperty)try{return void Object.defineProperty(b,c,{configurable:!0,enumerable:!0,get:function(){return d(f),e},set:function(a){d(f),e=a}})}catch(g){}a._definePropertyBroken=!0,b[c]=e}a.migrateVersion="1.4.1";var f={};a.migrateWarnings=[],b.console&&b.console.log&&b.console.log("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion),a.migrateTrace===c&&(a.migrateTrace=!0),a.migrateReset=function(){f={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&d("jQuery is not compatible with Quirks Mode");var g=a("",{size:1}).attr("size")&&a.attrFn,h=a.attr,i=a.attrHooks.value&&a.attrHooks.value.get||function(){return null},j=a.attrHooks.value&&a.attrHooks.value.set||function(){return c},k=/^(?:input|button)$/i,l=/^[238]$/,m=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,n=/^(?:checked|selected)$/i;e(a,"attrFn",g||{},"jQuery.attrFn is deprecated"),a.attr=function(b,e,f,i){var j=e.toLowerCase(),o=b&&b.nodeType;return i&&(h.length<4&&d("jQuery.fn.attr( props, pass ) is deprecated"),b&&!l.test(o)&&(g?e in g:a.isFunction(a.fn[e])))?a(b)[e](f):("type"===e&&f!==c&&k.test(b.nodeName)&&b.parentNode&&d("Can't change the 'type' of an input or button in IE 6/7/8"),!a.attrHooks[j]&&m.test(j)&&(a.attrHooks[j]={get:function(b,d){var e,f=a.prop(b,d);return f===!0||"boolean"!=typeof f&&(e=b.getAttributeNode(d))&&e.nodeValue!==!1?d.toLowerCase():c},set:function(b,c,d){var e;return c===!1?a.removeAttr(b,d):(e=a.propFix[d]||d,e in b&&(b[e]=!0),b.setAttribute(d,d.toLowerCase())),d}},n.test(j)&&d("jQuery.fn.attr('"+j+"') might use property instead of attribute")),h.call(a,b,e,f))},a.attrHooks.value={get:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?i.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value') no longer gets properties"),b in a?a.value:null)},set:function(a,b){var c=(a.nodeName||"").toLowerCase();return"button"===c?j.apply(this,arguments):("input"!==c&&"option"!==c&&d("jQuery.fn.attr('value', val) no longer sets properties"),void(a.value=b))}};var o,p,q=a.fn.init,r=a.find,s=a.parseJSON,t=/^\s*)([^>]*)$/;a.fn.init=function(b,e,f){var g,h;return b&&"string"==typeof b&&!a.isPlainObject(e)&&(g=w.exec(a.trim(b)))&&g[0]&&(t.test(b)||d("$(html) HTML strings must start with '<' character"),g[3]&&d("$(html) HTML text after last tag is ignored"),"#"===g[0].charAt(0)&&(d("HTML string cannot start with a '#' character"),a.error("JQMIGRATE: Invalid selector string (XSS)")),e&&e.context&&e.context.nodeType&&(e=e.context),a.parseHTML)?q.call(this,a.parseHTML(g[2],e&&e.ownerDocument||e||document,!0),e,f):(h=q.apply(this,arguments),b&&b.selector!==c?(h.selector=b.selector,h.context=b.context):(h.selector="string"==typeof b?b:"",b&&(h.context=b.nodeType?b:e||document)),h)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&u.test(a))try{document.querySelector(a)}catch(c){a=a.replace(v,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),d("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){d("Attribute selector with '#' was not fixed: "+b[0])}}return r.apply(this,b)};var x;for(x in r)Object.prototype.hasOwnProperty.call(r,x)&&(a.find[x]=r[x]);a.parseJSON=function(a){return a?s.apply(this,arguments):(d("jQuery.parseJSON requires a valid JSON string"),null)},a.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a.browser||(o=a.uaMatch(navigator.userAgent),p={},o.browser&&(p[o.browser]=!0,p.version=o.version),p.chrome?p.webkit=!0:p.webkit&&(p.safari=!0),a.browser=p),e(a,"browser",a.browser,"jQuery.browser is deprecated"),a.boxModel=a.support.boxModel="CSS1Compat"===document.compatMode,e(a,"boxModel",a.boxModel,"jQuery.boxModel is deprecated"),e(a.support,"boxModel",a.support.boxModel,"jQuery.support.boxModel is deprecated"),a.sub=function(){function b(a,c){return new b.fn.init(a,c)}a.extend(!0,b,this),b.superclass=this,b.fn=b.prototype=this(),b.fn.constructor=b,b.sub=this.sub,b.fn.init=function(d,e){var f=a.fn.init.call(this,d,e,c);return f instanceof b?f:b(f)},b.fn.init.prototype=b.fn;var c=b(document);return d("jQuery.sub() is deprecated"),b},a.fn.size=function(){return d("jQuery.fn.size() is deprecated; use the .length property"),this.length};var y=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return y=!0,a=d.apply(this,arguments),y=!1,a})}),a.swap=function(a,b,c,e){var f,g,h={};y||d("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=c.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f},a.ajaxSetup({converters:{"text json":a.parseJSON}});var z=a.fn.data;a.fn.data=function(b){var e,f,g=this[0];return!g||"events"!==b||1!==arguments.length||(e=a.data(g,b),f=a._data(g,b),e!==c&&e!==f||f===c)?z.apply(this,arguments):(d("Use of jQuery.fn.data('events') is deprecated"),f)};var A=/\/(java|ecma)script/i;a.clean||(a.clean=function(b,c,e,f){c=c||document,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,d("jQuery.clean() is deprecated");var g,h,i,j,k=[];if(a.merge(k,a.buildFragment(b,c).childNodes),e)for(i=function(a){return!a.type||A.test(a.type)?f?f.push(a.parentNode?a.parentNode.removeChild(a):a):e.appendChild(a):void 0},g=0;null!=(h=k[g]);g++)a.nodeName(h,"script")&&i(h)||(e.appendChild(h),"undefined"!=typeof h.getElementsByTagName&&(j=a.grep(a.merge([],h.getElementsByTagName("script")),i),k.splice.apply(k,[g+1,0].concat(j)),g+=j.length));return k});var B=a.event.add,C=a.event.remove,D=a.event.trigger,E=a.fn.toggle,F=a.fn.live,G=a.fn.die,H=a.fn.load,I="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",J=new RegExp("\\b(?:"+I+")\\b"),K=/(?:^|\s)hover(\.\S+|)\b/,L=function(b){return"string"!=typeof b||a.event.special.hover?b:(K.test(b)&&d("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),b&&b.replace(K,"mouseenter$1 mouseleave$1"))};a.event.props&&"attrChange"!==a.event.props[0]&&a.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),a.event.dispatch&&e(a.event,"handle",a.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),a.event.add=function(a,b,c,e,f){a!==document&&J.test(b)&&d("AJAX events should be attached to document: "+b),B.call(this,a,L(b||""),c,e,f)},a.event.remove=function(a,b,c,d,e){C.call(this,a,L(b)||"",c,d,e)},a.each(["load","unload","error"],function(b,c){a.fn[c]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===c&&"string"==typeof a[0]?H.apply(this,a):(d("jQuery.fn."+c+"() is deprecated"),a.splice(0,0,c),arguments.length?this.bind.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a.fn.toggle=function(b,c){if(!a.isFunction(b)||!a.isFunction(c))return E.apply(this,arguments);d("jQuery.fn.toggle(handler, handler...) is deprecated");var e=arguments,f=b.guid||a.guid++,g=0,h=function(c){var d=(a._data(this,"lastToggle"+b.guid)||0)%g;return a._data(this,"lastToggle"+b.guid,d+1),c.preventDefault(),e[d].apply(this,arguments)||!1};for(h.guid=f;g$1<\/strong>') .replace(/&/g, '&') @@ -153,7 +158,7 @@ that.element.setAttribute('autocomplete', 'off'); that.killerFn = function (e) { - if ($(e.target).closest('.' + that.options.containerClass).length === 0) { + if (!$(e.target).closest('.' + that.options.containerClass).length) { that.killSuggestions(); that.disableKillerFn(); } @@ -171,7 +176,7 @@ // Only set width if it was provided: if (options.width !== 'auto') { - container.width(options.width); + container.css('width', options.width); } // Listen for mouse over event on suggestions list: @@ -188,6 +193,7 @@ // Listen for click event on suggestions list: container.on('click.autocomplete', suggestionSelector, function () { that.select($(this).data('index')); + return false; }); that.fixPositionCapture = function () { @@ -208,8 +214,10 @@ onFocus: function () { var that = this; + that.fixPosition(); - if (that.options.minChars === 0 && that.el.val().length === 0) { + + if (that.el.val().length >= that.options.minChars) { that.onValueChange(); } }, @@ -324,9 +332,8 @@ } } - // -2px to account for suggestions border. if (that.options.width === 'auto') { - styles.width = (that.el.outerWidth() - 2) + 'px'; + styles.width = that.el.outerWidth() + 'px'; } $container.css(styles); @@ -347,7 +354,13 @@ that.stopKillSuggestions(); that.intervalId = window.setInterval(function () { if (that.visible) { - that.el.val(that.currentValue); + // No need to restore value when + // preserveInput === true, + // because we did not change it + if (!that.options.preserveInput) { + that.el.val(that.currentValue); + } + that.hide(); } @@ -628,7 +641,7 @@ }, suggest: function () { - if (this.suggestions.length === 0) { + if (!this.suggestions.length) { if (this.options.showNoSuggestionNotice) { this.noSuggestions(); } else { @@ -672,7 +685,7 @@ html += formatGroup(suggestion, value, i); } - html += '
                  ' + formatResult(suggestion, value) + '
                  '; + html += '
                  ' + formatResult(suggestion, value, i) + '
                  '; }); this.adjustContainerWidth(); @@ -681,7 +694,7 @@ container.html(html); if ($.isFunction(beforeRender)) { - beforeRender.call(that.element, container); + beforeRender.call(that.element, container, that.suggestions); } that.fixPosition(); @@ -726,10 +739,9 @@ // If width is auto, adjust width before displaying suggestions, // because if instance was created before input had width, it will be zero. // Also it adjusts if input width has changed. - // -2px to account for suggestions border. if (options.width === 'auto') { - width = that.el.outerWidth() - 2; - container.width(width > 0 ? width : 300); + width = that.el.outerWidth(); + container.css('width', width > 0 ? width : 300); } }, @@ -796,7 +808,7 @@ // Cache results if cache is not disabled: if (!options.noCache) { that.cachedResponse[cacheKey] = result; - if (options.preventBadQueries && result.suggestions.length === 0) { + if (options.preventBadQueries && !result.suggestions.length) { that.badQueries.push(originalQuery); } } @@ -954,7 +966,7 @@ var dataKey = 'autocomplete'; // If function invoked without argument return // instance of the first matched element: - if (arguments.length === 0) { + if (!arguments.length) { return this.first().data(dataKey); } diff --git a/media/jui/js/jquery.autocomplete.min.js b/media/jui/js/jquery.autocomplete.min.js index 21dc41bd8c3fe..0549a1ab8fc32 100644 --- a/media/jui/js/jquery.autocomplete.min.js +++ b/media/jui/js/jquery.autocomplete.min.js @@ -1,8 +1,8 @@ /** -* Ajax Autocomplete for jQuery, version 1.2.24 +* Ajax Autocomplete for jQuery, version 1.2.26 * (c) 2014 Tomas Kirda * * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license. * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete */ -!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=function(){},f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:"query",transformResult:function(b){return"string"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},f.hint=null,f.hintValue="",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){var d="("+c.escapeRegExChars(b)+")";return a.value.replace(new RegExp(d,"gi"),"$1").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/<(\/?strong)>/g,"<$1>")},b.prototype={killerFn:null,initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.killerFn=function(b){0===a(b.target).closest("."+d.options.containerClass).length&&(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('
                  ').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),"auto"!==g.width&&c.width(g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){d.select(a(this).data("index"))}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),0===a.options.minChars&&0===a.el.val().length&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearInterval(a.onChangeInterval),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()-2+"px"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on("click.autocomplete",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off("click.autocomplete",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.visible&&(a.el.val(a.currentValue),a.hide()),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case d.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearInterval(b.onChangeInterval),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.lengthh&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,h.onSearchStart.call(g.element,h.params)!==!1){if(a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearInterval(b.onChangeInterval),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(0===this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var d=a.data[e];return b===d?"":(b=d,'
                  '+b+"
                  ")};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='
                  '+f(b,g)+"
                  "}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width&&(b=c.el.outerWidth()-2,e.width(b>0?b:300))},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&0===a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),b.disableKillerFn(),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return 0===arguments.length?this.first().data(e):this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))})}}); \ No newline at end of file +!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(a){"use strict";function b(c,d){var e=a.noop,f=this,g={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:b.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(a,b,c){return-1!==a.value.toLowerCase().indexOf(c)},paramName:"query",transformResult:function(b){return"string"==typeof b?a.parseJSON(b):b},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};f.element=c,f.el=a(c),f.suggestions=[],f.badQueries=[],f.selectedIndex=-1,f.currentValue=f.element.value,f.intervalId=0,f.cachedResponse={},f.onChangeInterval=null,f.onChange=null,f.isLocal=!1,f.suggestionsContainer=null,f.noSuggestionsContainer=null,f.options=a.extend({},g,d),f.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},f.hint=null,f.hintValue="",f.selection=null,f.initialize(),f.setOptions(d)}var c=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),d={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};b.utils=c,a.Autocomplete=b,b.formatResult=function(a,b){if(!b)return a.value;var d="("+c.escapeRegExChars(b)+")";return a.value.replace(new RegExp(d,"gi"),"$1").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/<(\/?strong)>/g,"<$1>")},b.prototype={killerFn:null,initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.killerFn=function(b){a(b.target).closest("."+d.options.containerClass).length||(d.killSuggestions(),d.disableKillerFn())},d.noSuggestionsContainer=a('
                  ').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo),"auto"!==g.width&&c.css("width",g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){return d.select(a(this).data("index")),!1}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=c.options;a.extend(d,b),c.isLocal=a.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex})},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearInterval(a.onChangeInterval),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()+"px"),c.css(i)}},enableKillerFn:function(){var b=this;a(document).on("click.autocomplete",b.killerFn)},disableKillerFn:function(){var b=this;a(document).off("click.autocomplete",b.killerFn)},killSuggestions:function(){var a=this;a.stopKillSuggestions(),a.intervalId=window.setInterval(function(){a.visible&&(a.options.preserveInput||a.el.val(a.currentValue),a.hide()),a.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:document.selection?(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length):!0},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===d.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case d.ESC:b.el.val(b.currentValue),b.hide();break;case d.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case d.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(-1===b.selectedIndex)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case d.RETURN:if(-1===b.selectedIndex)return void b.hide();b.select(b.selectedIndex);break;case d.UP:b.moveUp();break;case d.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case d.UP:case d.DOWN:return}clearInterval(b.onChangeInterval),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeInterval=setInterval(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearInterval(b.onChangeInterval),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.lengthh&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,d=h.ignoreParams?null:h.params,h.onSearchStart.call(g.element,h.params)!==!1){if(a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&a.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearInterval(b.onChangeInterval),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var d=a.data[e];return b===d?"":(b=d,'
                  '+b+"
                  ")};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+='
                  '+f(b,g,a)+"
                  "}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=a(b.suggestionsContainer),d=a(b.noSuggestionsContainer);this.adjustContainerWidth(),d.detach(),c.empty(),c.append(d),b.fixPosition(),c.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width&&(b=c.el.outerWidth(),e.css("width",b>0?b:300))},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),-1===a.inArray(b,["auto","bottom","top"])&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,-1!==d.selectedIndex&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(-1!==b.selectedIndex)return 0===b.selectedIndex?(a(b.suggestionsContainer).children().first().removeClass(b.classes.selected),b.selectedIndex=-1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,f>e?a(c.suggestionsContainer).scrollTop(e):e>g&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||c.el.val(c.getValue(c.suggestions[b].value)),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),b.disableKillerFn(),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.autocomplete=a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)}}); \ No newline at end of file diff --git a/media/jui/js/jquery.js b/media/jui/js/jquery.js index 6feb11086f45e..7fc60fca78b62 100644 --- a/media/jui/js/jquery.js +++ b/media/jui/js/jquery.js @@ -1,27 +1,27 @@ /*! - * jQuery JavaScript Library v1.11.3 + * jQuery JavaScript Library v1.12.4 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2015-04-28T16:19Z + * Date: 2016-05-20T17:17Z */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info + // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { @@ -37,14 +37,15 @@ // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { -// Can't do this because several apps including ASP.NET trace +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - +//"use strict"; var deletedIds = []; +var document = window.document; + var slice = deletedIds.slice; var concat = deletedIds.concat; @@ -64,10 +65,11 @@ var support = {}; var - version = "1.11.3", + version = "1.12.4", // Define a local copy of jQuery jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); @@ -87,6 +89,7 @@ var }; jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used jquery: version, @@ -130,16 +133,14 @@ jQuery.fn = jQuery.prototype = { }, // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); + each: function( callback ) { + return jQuery.each( this, callback ); }, map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); - })); + } ) ); }, slice: function() { @@ -157,11 +158,11 @@ jQuery.fn = jQuery.prototype = { eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { - return this.prevObject || this.constructor(null); + return this.prevObject || this.constructor(); }, // For internal use only. @@ -173,7 +174,7 @@ jQuery.fn = jQuery.prototype = { jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, + target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; @@ -188,7 +189,7 @@ jQuery.extend = jQuery.fn.extend = function() { } // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { target = {}; } @@ -199,8 +200,10 @@ jQuery.extend = jQuery.fn.extend = function() { } for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { + if ( ( options = arguments[ i ] ) != null ) { + // Extend the base object for ( name in options ) { src = target[ name ]; @@ -212,13 +215,15 @@ jQuery.extend = jQuery.fn.extend = function() { } // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + if ( copyIsArray ) { copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; + clone = src && jQuery.isArray( src ) ? src : []; } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; + clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them @@ -236,7 +241,8 @@ jQuery.extend = jQuery.fn.extend = function() { return target; }; -jQuery.extend({ +jQuery.extend( { + // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), @@ -253,11 +259,11 @@ jQuery.extend({ // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { - return jQuery.type(obj) === "function"; + return jQuery.type( obj ) === "function"; }, isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; + return jQuery.type( obj ) === "array"; }, isWindow: function( obj ) { @@ -266,11 +272,13 @@ jQuery.extend({ }, isNumeric: function( obj ) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) - return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; }, isEmptyObject: function( obj ) { @@ -287,25 +295,27 @@ jQuery.extend({ // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { + // Not own constructor property must be Object if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + !hasOwn.call( obj, "constructor" ) && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { return false; } } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { + if ( !support.ownFirst ) { for ( key in obj ) { return hasOwn.call( obj, key ); } @@ -323,20 +333,20 @@ jQuery.extend({ return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : + class2type[ toString.call( obj ) ] || "object" : typeof obj; }, - // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); + window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation } )( data ); } }, @@ -351,49 +361,20 @@ jQuery.extend({ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); + each: function( obj, callback ) { + var length, i = 0; - if ( value === false ) { - break; - } + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } - - // A special, fast, case for the most common use of each } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } } @@ -413,7 +394,7 @@ jQuery.extend({ var ret = results || []; if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { + if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr @@ -438,6 +419,7 @@ jQuery.extend({ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; @@ -460,7 +442,7 @@ jQuery.extend({ // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { - while ( second[j] !== undefined ) { + while ( second[ j ] !== undefined ) { first[ i++ ] = second[ j++ ]; } } @@ -491,14 +473,13 @@ jQuery.extend({ // arg is for internal usage only map: function( elems, callback, arg ) { - var value, + var length, value, i = 0, - length = elems.length, - isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values - if ( isArray ) { + if ( isArrayLike( elems ) ) { + length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); @@ -561,43 +542,50 @@ jQuery.extend({ // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support -}); +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; +} +/* jshint ignore: end */ // Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); +} ); -function isArraylike( obj ) { +function isArrayLike( obj ) { // Support: iOS 8.2 (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE - var length = "length" in obj && obj.length, + var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } - if ( obj.nodeType === 1 && length ) { - return true; - } - return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! - * Sizzle CSS Selector Engine v2.2.0-pre + * Sizzle CSS Selector Engine v2.2.1 * http://sizzlejs.com/ * - * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-16 + * Date: 2015-10-17 */ (function( window ) { @@ -665,25 +653,21 @@ var i, // Regular expressions - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", - pseudos = ":(" + characterEncoding + ")(?:\\((" + + pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + @@ -706,9 +690,9 @@ var i, ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + @@ -786,103 +770,129 @@ try { } function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; - context = context || document; results = results || []; - nodeType = context.nodeType; + // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } - if ( !seed && documentIsHTML ) { + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { - // Try to shortcut find operations when possible (e.g., not under DocumentFragment) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { return results; } + + // Element context } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } } - } - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } } - } - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType !== 1 && selector; + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } } } } @@ -895,7 +905,7 @@ function Sizzle( selector, context, results, seed ) { /** * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ @@ -950,7 +960,7 @@ function assert( fn ) { */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), - i = attrs.length; + i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; @@ -1063,33 +1073,29 @@ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; - // If no document and documentElement is available, return + // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } - // Set our document + // Update global variables document = doc; - docElem = doc.documentElement; - parent = doc.defaultView; - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 if ( parent.addEventListener ) { parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", unloadHandler ); } } - /* Support tests - ---------------------------------------------------------------------- */ - documentIsHTML = !isXML( doc ); - /* Attributes ---------------------------------------------------------------------- */ @@ -1106,12 +1112,12 @@ setDocument = Sizzle.setDocument = function( node ) { // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); + div.appendChild( document.createComment("") ); return !div.getElementsByTagName("*").length; }); // Support: IE<9 - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name @@ -1119,7 +1125,7 @@ setDocument = Sizzle.setDocument = function( node ) { // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + return !document.getElementsByName || !document.getElementsByName( expando ).length; }); // ID find and filter @@ -1127,9 +1133,7 @@ setDocument = Sizzle.setDocument = function( node ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; + return m ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { @@ -1146,7 +1150,8 @@ setDocument = Sizzle.setDocument = function( node ) { Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); return node && node.value === attrId; }; }; @@ -1186,7 +1191,7 @@ setDocument = Sizzle.setDocument = function( node ) { // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( documentIsHTML ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; @@ -1206,7 +1211,7 @@ setDocument = Sizzle.setDocument = function( node ) { // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { @@ -1216,7 +1221,7 @@ setDocument = Sizzle.setDocument = function( node ) { // since its presence should be enough // http://bugs.jquery.com/ticket/12359 docElem.appendChild( div ).innerHTML = "
                  " + - "" + ""; // Support: IE8, Opera 11-12.16 @@ -1233,7 +1238,7 @@ setDocument = Sizzle.setDocument = function( node ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } - // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } @@ -1256,7 +1261,7 @@ setDocument = Sizzle.setDocument = function( node ) { assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); + var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); @@ -1304,7 +1309,7 @@ setDocument = Sizzle.setDocument = function( node ) { hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another - // Purposefully does not implement inclusive descendent + // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { @@ -1358,10 +1363,10 @@ setDocument = Sizzle.setDocument = function( node ) { (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } @@ -1389,8 +1394,8 @@ setDocument = Sizzle.setDocument = function( node ) { // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : + return a === document ? -1 : + b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? @@ -1427,7 +1432,7 @@ setDocument = Sizzle.setDocument = function( node ) { 0; }; - return doc; + return document; }; Sizzle.matches = function( expr, elements ) { @@ -1444,6 +1449,7 @@ Sizzle.matchesSelector = function( elem, expr ) { expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { @@ -1717,11 +1723,12 @@ Expr = Sizzle.selectors = { } : function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, + var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; + useCache = !xml && !ofType, + diff = false; if ( parent ) { @@ -1730,7 +1737,10 @@ Expr = Sizzle.selectors = { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + return false; } } @@ -1744,11 +1754,21 @@ Expr = Sizzle.selectors = { // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { + // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || @@ -1758,29 +1778,55 @@ Expr = Sizzle.selectors = { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } - if ( node === elem ) { - break; + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } } } } @@ -2142,10 +2188,10 @@ function addCombinator( matcher, combinator, base ) { // Check against all ancestor/preceding elements function( elem, context, xml ) { - var oldCache, outerCache, + var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { @@ -2158,14 +2204,19 @@ function addCombinator( matcher, combinator, base ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; + uniqueCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { @@ -2390,18 +2441,21 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { len = elems.length; if ( outermost ) { - outermostContext = context !== document && context; + outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { + if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } @@ -2425,8 +2479,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { } } - // Apply set filters to unmatched elements + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { @@ -2518,10 +2581,11 @@ select = Sizzle.select = function( selector, context, results, seed ) { results = results || []; - // Try to minimize operations if there is no seed and only one group + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) if ( match.length === 1 ) { - // Take a shortcut and set the context if the root selector is an ID + // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && @@ -2576,7 +2640,7 @@ select = Sizzle.select = function( selector, context, results, seed ) { context, !documentIsHTML, results, - rsibling.test( selector ) && testContext( context.parentNode ) || context + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; @@ -2652,17 +2716,46 @@ return Sizzle; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + var rneedsContext = jQuery.expr.match.needsContext; -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); @@ -2674,14 +2767,14 @@ function winnow( elements, qualifier, not ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; - }); + } ); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; - }); + } ); } @@ -2694,8 +2787,8 @@ function winnow( elements, qualifier, not ) { } return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); + return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; + } ); } jQuery.filter = function( expr, elems, not ) { @@ -2709,10 +2802,10 @@ jQuery.filter = function( expr, elems, not ) { jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; - })); + } ) ); }; -jQuery.fn.extend({ +jQuery.fn.extend( { find: function( selector ) { var i, ret = [], @@ -2720,13 +2813,13 @@ jQuery.fn.extend({ len = self.length; if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { + return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } - }) ); + } ) ); } for ( i = 0; i < len; i++ ) { @@ -2739,10 +2832,10 @@ jQuery.fn.extend({ return ret; }, filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); + return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); + return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( @@ -2756,7 +2849,7 @@ jQuery.fn.extend({ false ).length; } -}); +} ); // Initialize a jQuery object @@ -2765,15 +2858,12 @@ jQuery.fn.extend({ // A central reference to the root jQuery(document) var rootjQuery, - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - init = jQuery.fn.init = function( selector, context ) { + init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) @@ -2781,9 +2871,16 @@ var rootjQuery, return this; } + // init accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + // Handle HTML strings if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + if ( selector.charAt( 0 ) === "<" && + selector.charAt( selector.length - 1 ) === ">" && + selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; @@ -2792,23 +2889,24 @@ var rootjQuery, } // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { + if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( - match[1], + match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { + // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); @@ -2824,20 +2922,21 @@ var rootjQuery, // HANDLE: $(#id) } else { - elem = document.getElementById( match[2] ); + elem = document.getElementById( match[ 2 ] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items // by name instead of ID - if ( elem.id !== match[2] ) { + if ( elem.id !== match[ 2 ] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; - this[0] = elem; + this[ 0 ] = elem; } this.context = document; @@ -2847,7 +2946,7 @@ var rootjQuery, // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); + return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) @@ -2857,15 +2956,16 @@ var rootjQuery, // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { - this.context = this[0] = selector; + this.context = this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : + return typeof root.ready !== "undefined" ? + root.ready( selector ) : + // Execute immediately if ready is not present selector( jQuery ); } @@ -2886,6 +2986,7 @@ rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, @@ -2894,46 +2995,19 @@ var rparentsprev = /^(?:parents|prev(?:Until|All))/, prev: true }; -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ +jQuery.fn.extend( { has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; - return this.filter(function() { + return this.filter( function() { for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { + if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } - }); + } ); }, closest: function( selectors, context ) { @@ -2946,14 +3020,15 @@ jQuery.fn.extend({ 0; for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { + jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; @@ -2961,7 +3036,7 @@ jQuery.fn.extend({ } } - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within @@ -2970,23 +3045,24 @@ jQuery.fn.extend({ // No argument, return index in parent if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); + return jQuery.inArray( this[ 0 ], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( + // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); + elem.jquery ? elem[ 0 ] : elem, this ); }, add: function( selector, context ) { return this.pushStack( - jQuery.unique( + jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); @@ -2994,10 +3070,10 @@ jQuery.fn.extend({ addBack: function( selector ) { return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) + this.prevObject : this.prevObject.filter( selector ) ); } -}); +} ); function sibling( cur, dir ) { do { @@ -3007,16 +3083,16 @@ function sibling( cur, dir ) { return cur; } -jQuery.each({ +jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); + return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); + return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); @@ -3025,22 +3101,22 @@ jQuery.each({ return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); + return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); + return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); + return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); + return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { - return jQuery.sibling( elem.firstChild ); + return siblings( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? @@ -3060,9 +3136,10 @@ jQuery.each({ } if ( this.length > 1 ) { + // Remove duplicates if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); + ret = jQuery.uniqueSort( ret ); } // Reverse order for parents* and prev-derivatives @@ -3073,20 +3150,17 @@ jQuery.each({ return this.pushStack( ret ); }; -}); -var rnotwhite = (/\S+/g); +} ); +var rnotwhite = ( /\S+/g ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache +// Convert String-formatted options into Object-formatted ones function createOptions( options ) { - var object = optionsCache[ options ] = {}; + var object = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; - }); + } ); return object; } @@ -3117,156 +3191,186 @@ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : + createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, - // Last fire value (for non-forgettable lists) + + // Last fire value for non-forgettable lists memory, + // Flag to know if list was already fired fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, + + // Flag to prevent firing + locked, + // Actual callback list list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } } } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { list = []; + + // Otherwise, this object is spent } else { - self.disable(); + list = ""; } } }, + // Actual Callbacks object self = { + // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { + if ( jQuery.isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } - } else if ( arg && arg.length && type !== "string" ) { + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + // Inspect recursively add( arg ); } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); } } return this; }, + // Remove a callback from the list remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; } - }); - } + } + } ); return this; }, + // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; }, + // Remove all callbacks from the list empty: function() { - list = []; - firingLength = 0; + if ( list ) { + list = []; + } return this; }, - // Have the list do nothing anymore + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values disable: function() { - list = stack = memory = undefined; + locked = queue = []; + list = memory = ""; return this; }, - // Is it disabled? disabled: function() { return !list; }, - // Lock the list in its current state + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions lock: function() { - stack = undefined; + locked = true; if ( !memory ) { self.disable(); } return this; }, - // Is it locked? locked: function() { - return !stack; + return !!locked; }, + // Call all callbacks with the given context and arguments fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { + if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); + queue.push( args ); + if ( !firing ) { + fire(); } } return this; }, + // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, + // To know if the callbacks have already been called at least once fired: function() { return !!fired; @@ -3277,14 +3381,15 @@ jQuery.Callbacks = function( options ) { }; -jQuery.extend({ +jQuery.extend( { Deferred: function( func ) { var tuples = [ + // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] ], state = "pending", promise = { @@ -3297,25 +3402,30 @@ jQuery.extend({ }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; - return jQuery.Deferred(function( newDefer ) { + return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { + deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() + .progress( newDefer.notify ) .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); + .fail( newDefer.reject ); } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); } - }); - }); + } ); + } ); fns = null; - }).promise(); + } ).promise(); }, + // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { @@ -3333,11 +3443,12 @@ jQuery.extend({ stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; + promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { - list.add(function() { + list.add( function() { + // state = [ resolved | rejected ] state = stateString; @@ -3346,12 +3457,12 @@ jQuery.extend({ } // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); // Make the deferred a promise promise.promise( deferred ); @@ -3372,9 +3483,11 @@ jQuery.extend({ length = resolveValues.length, // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values @@ -3385,7 +3498,7 @@ jQuery.extend({ if ( values === progressValues ) { deferred.notifyWith( contexts, values ); - } else if ( !(--remaining) ) { + } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; @@ -3401,9 +3514,9 @@ jQuery.extend({ for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); + .fail( deferred.reject ); } else { --remaining; } @@ -3417,20 +3530,22 @@ jQuery.extend({ return deferred.promise(); } -}); +} ); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { + // Add the callback jQuery.ready.promise().done( fn ); return this; }; -jQuery.extend({ +jQuery.extend( { + // Is the DOM ready to be used? Set to true once it occurs. isReady: false, @@ -3455,11 +3570,6 @@ jQuery.extend({ return; } - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - // Remember that the DOM is ready jQuery.isReady = true; @@ -3477,15 +3587,15 @@ jQuery.extend({ jQuery( document ).off( "ready" ); } } -}); +} ); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); } else { document.detachEvent( "onreadystatechange", completed ); @@ -3497,8 +3607,12 @@ function detach() { * The ready event handler and self cleanup method */ function completed() { + // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + if ( document.addEventListener || + window.event.type === "load" || + document.readyState === "complete" ) { + detach(); jQuery.ready(); } @@ -3509,23 +3623,28 @@ jQuery.ready.promise = function( obj ) { readyList = jQuery.Deferred(); - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE6-10 + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); + window.setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { + // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); + document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); + window.addEventListener( "load", completed ); // If IE event model is used } else { + // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); @@ -3538,18 +3657,19 @@ jQuery.ready.promise = function( obj ) { try { top = window.frameElement == null && document.documentElement; - } catch(e) {} + } catch ( e ) {} if ( top && top.doScroll ) { - (function doScrollCheck() { + ( function doScrollCheck() { if ( !jQuery.isReady ) { try { + // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); + top.doScroll( "left" ); + } catch ( e ) { + return window.setTimeout( doScrollCheck, 50 ); } // detach all dom ready events @@ -3558,15 +3678,16 @@ jQuery.ready.promise = function( obj ) { // and execute any waiting functions jQuery.ready(); } - })(); + } )(); } } } return readyList.promise( obj ); }; +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); -var strundefined = typeof undefined; @@ -3576,19 +3697,21 @@ var i; for ( i in jQuery( support ) ) { break; } -support.ownLast = i !== "0"; +support.ownFirst = i === "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom -jQuery(function() { +jQuery( function() { + // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { + // Return for frameset docs that don't have a body return; } @@ -3599,7 +3722,8 @@ jQuery(function() { container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); - if ( typeof div.style.zoom !== strundefined ) { + if ( typeof div.style.zoom !== "undefined" ) { + // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving @@ -3608,6 +3732,7 @@ jQuery(function() { support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { + // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 @@ -3616,35 +3741,25 @@ jQuery(function() { } body.removeChild( container ); -}); - +} ); - -(function() { +( function() { var div = document.createElement( "div" ); - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch ( e ) { + support.deleteExpando = false; } // Null elements to avoid leaks in IE. div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], +} )(); +var acceptData = function( elem ) { + var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). @@ -3652,14 +3767,17 @@ jQuery.acceptData = function( elem ) { false : // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; + !noData || noData !== true && elem.getAttribute( "classid" ) === noData; }; + + var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { @@ -3673,11 +3791,12 @@ function dataAttr( elem, key, data ) { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : + // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; - } catch( e ) {} + } catch ( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); @@ -3696,7 +3815,7 @@ function isEmptyDataObject( obj ) { for ( name in obj ) { // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { continue; } if ( name !== "toJSON" ) { @@ -3708,7 +3827,7 @@ function isEmptyDataObject( obj ) { } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { + if ( !acceptData( elem ) ) { return; } @@ -3729,11 +3848,13 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ) { // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { + if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && + data === undefined && typeof name === "string" ) { return; } if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { @@ -3744,6 +3865,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ) { } if ( !cache[ id ] ) { + // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; @@ -3797,7 +3919,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ) { } function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { + if ( !acceptData( elem ) ) { return; } @@ -3833,10 +3955,11 @@ function internalRemoveData( elem, name, pvt ) { if ( name in thisCache ) { name = [ name ]; } else { - name = name.split(" "); + name = name.split( " " ); } } } else { + // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. @@ -3848,12 +3971,12 @@ function internalRemoveData( elem, name, pvt ) { i = name.length; while ( i-- ) { - delete thisCache[ name[i] ]; + delete thisCache[ name[ i ] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { + if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { return; } } @@ -3880,13 +4003,13 @@ function internalRemoveData( elem, name, pvt ) { /* jshint eqeqeq: true */ delete cache[ id ]; - // When all else fails, null + // When all else fails, undefined } else { - cache[ id ] = null; + cache[ id ] = undefined; } } -jQuery.extend({ +jQuery.extend( { cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) @@ -3894,12 +4017,13 @@ jQuery.extend({ noData: { "applet ": true, "embed ": true, + // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, @@ -3919,12 +4043,12 @@ jQuery.extend({ _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { data: function( key, value ) { var i, name, data, - elem = this[0], + elem = this[ 0 ], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, @@ -3944,7 +4068,7 @@ jQuery.fn.extend({ if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); + name = jQuery.camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } @@ -3958,17 +4082,17 @@ jQuery.fn.extend({ // Sets multiple values if ( typeof key === "object" ) { - return this.each(function() { + return this.each( function() { jQuery.data( this, key ); - }); + } ); } return arguments.length > 1 ? // Sets one value - this.each(function() { + this.each( function() { jQuery.data( this, key, value ); - }) : + } ) : // Gets one value // Try to fetch any internally stored data first @@ -3976,14 +4100,14 @@ jQuery.fn.extend({ }, removeData: function( key ) { - return this.each(function() { + return this.each( function() { jQuery.removeData( this, key ); - }); + } ); } -}); +} ); -jQuery.extend({ +jQuery.extend( { queue: function( elem, type, data ) { var queue; @@ -3993,8 +4117,8 @@ jQuery.extend({ // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + if ( !queue || jQuery.isArray( data ) ) { + queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } @@ -4038,19 +4162,20 @@ jQuery.extend({ } }, - // not intended for public consumption - generates a queueHooks object, or returns the current one + // not intended for public consumption - generates a queueHooks object, + // or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { + empty: jQuery.Callbacks( "once memory" ).add( function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); - }) - }); + } ) + } ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; @@ -4061,30 +4186,31 @@ jQuery.fn.extend({ } if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); + return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : - this.each(function() { + this.each( function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); - if ( type === "fx" && queue[0] !== "inprogress" ) { + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } - }); + } ); }, dequeue: function( type ) { - return this.each(function() { + return this.each( function() { jQuery.dequeue( this, type ); - }); + } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, + // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { @@ -4115,23 +4241,138 @@ jQuery.fn.extend({ resolve(); return defer.promise( obj ); } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; +} ); + + +( function() { + var shrinkWrapBlocksVal; + + support.shrinkWrapBlocks = function() { + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + // Minified: var b,c,d + var div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Test fired too early or in an unsupported environment, exit. + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== "undefined" ) { + + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + return shrinkWrapBlocksVal; + }; + +} )(); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { + // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); }; +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; @@ -4140,7 +4381,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value @@ -4152,6 +4393,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe } if ( bulk ) { + // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); @@ -4168,7 +4410,11 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe if ( fn ) { for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + fn( + elems[ i ], + key, + raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); } } } @@ -4179,17 +4425,41 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe // Gets bulk ? fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; + length ? fn( elems[ 0 ], key ) : emptyGet; }; -var rcheckableType = (/^(?:checkbox|radio)$/i); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); +var rtagName = ( /<([\w:-]+)/ ); +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); +var rleadingWhitespace = ( /^\s+/ ); + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + + +( function() { + var div = document.createElement( "div" ), + fragment = document.createDocumentFragment(), + input = document.createElement( "input" ); // Setup div.innerHTML = "
                  a"; @@ -4224,62 +4494,267 @@ var rcheckableType = (/^(?:checkbox|radio)$/i); // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); - div.innerHTML = ""; + + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input = document.createElement( "input" ); + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); + // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ + support.noCloneEvent = !!div.addEventListener; + + // Support: IE<9 + // Since attributes and properties are the same in IE, + // cleanData must set properties to undefined rather than use removeAttribute + div[ jQuery.expando ] = 1; + support.attributes = !div.getAttribute( jQuery.expando ); +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
                  ", "
                  " ], + area: [ 1, "", "" ], + + // Support: IE8 + param: [ 1, "", "" ], + thead: [ 1, "", "
                  " ], + tr: [ 2, "", "
                  " ], + col: [ 2, "", "
                  " ], + td: [ 3, "", "
                  " ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
                  ", "
                  " ] +}; + +// Support: IE8-IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + undefined; - div.cloneNode( true ).click(); + if ( !found ) { + for ( found = [], elems = context.childNodes || context; + ( elem = elems[ i ] ) != null; + i++ + ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } } - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + jQuery._data( + elem, + "globalEval", + !refElements || jQuery._data( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/, + rtbody = / from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[ 1 ] === "
                  " && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && + !tbody.childNodes.length ) { + + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } } } -})(); + + tmp = null; + + return safe; +} -(function() { +( function() { var i, eventName, div = document.createElement( "div" ); - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { + // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) + for ( i in { submit: true, change: true, focusin: true } ) { eventName = "on" + i; - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { + if ( !( support[ i ] = eventName in window ) ) { + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; + support[ i ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; -})(); +} )(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; @@ -4289,12 +4764,75 @@ function returnFalse() { return false; } +// Support: IE9 +// See #13393 for more info function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. @@ -4327,18 +4865,22 @@ jQuery.event = { } // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { + if ( !( events = elemData.events ) ) { events = elemData.events = {}; } - if ( !(eventHandle = elemData.handle) ) { + if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? + return typeof jQuery !== "undefined" && + ( !e || jQuery.event.triggered !== e.type ) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + + // Add elem as a property of the handle fn to prevent a memory leak + // with IE non-native events eventHandle.elem = elem; } @@ -4346,9 +4888,9 @@ jQuery.event = { types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { @@ -4365,7 +4907,7 @@ jQuery.event = { special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers - handleObj = jQuery.extend({ + handleObj = jQuery.extend( { type: type, origType: origType, data: data, @@ -4373,16 +4915,18 @@ jQuery.event = { guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") + namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { + if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); @@ -4424,7 +4968,7 @@ jQuery.event = { namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - if ( !elemData || !(events = elemData.events) ) { + if ( !elemData || !( events = elemData.events ) ) { return; } @@ -4432,9 +4976,9 @@ jQuery.event = { types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { @@ -4447,7 +4991,8 @@ jQuery.event = { special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; @@ -4457,7 +5002,8 @@ jQuery.event = { if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { @@ -4472,7 +5018,9 @@ jQuery.event = { // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); } @@ -4495,7 +5043,7 @@ jQuery.event = { bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = tmp = elem = elem || document; @@ -4509,13 +5057,14 @@ jQuery.event = { return; } - if ( type.indexOf(".") >= 0 ) { + if ( type.indexOf( "." ) > -1 ) { + // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); + namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } - ontype = type.indexOf(":") < 0 && "on" + type; + ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? @@ -4524,9 +5073,9 @@ jQuery.event = { // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused @@ -4560,28 +5109,30 @@ jQuery.event = { } // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { + if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && + jQuery._data( cur, "handle" ); + if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { + if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); @@ -4593,8 +5144,11 @@ jQuery.event = { // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { + if ( + ( !special._default || + special._default.apply( eventPath.pop(), data ) === false + ) && acceptData( elem ) + ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. @@ -4613,6 +5167,7 @@ jQuery.event = { try { elem[ type ](); } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } @@ -4633,14 +5188,14 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); - var i, ret, handleObj, matched, j, + var i, j, ret, matched, handleObj, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; + args[ 0 ] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired @@ -4653,24 +5208,25 @@ jQuery.event = { // Run delegates first; they may want to stop propagation beneath us i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { + if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } @@ -4688,15 +5244,19 @@ jQuery.event = { }, handlers: function( event, handlers ) { - var sel, handleObj, matches, i, + var i, matches, sel, handleObj, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; + // Support (at least): Chrome, IE9 // Find delegate handlers // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { @@ -4704,7 +5264,7 @@ jQuery.event = { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; @@ -4714,7 +5274,7 @@ jQuery.event = { if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : + jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { @@ -4722,7 +5282,7 @@ jQuery.event = { } } if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); + handlerQueue.push( { elem: cur, handlers: matches } ); } } } @@ -4730,7 +5290,7 @@ jQuery.event = { // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; @@ -4769,7 +5329,7 @@ jQuery.event = { event.target = originalEvent.srcElement || document; } - // Support: Chrome 23+, Safari? + // Support: Safari 6-8+ // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; @@ -4783,12 +5343,13 @@ jQuery.event = { }, // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), fixHooks: {}, keyHooks: { - props: "char charCode key keyCode".split(" "), + props: "char charCode key keyCode".split( " " ), filter: function( event, original ) { // Add which for key events @@ -4801,7 +5362,8 @@ jQuery.event = { }, mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + props: ( "button buttons clientX clientY fromElement offsetX offsetY " + + "pageX pageY screenX screenY toElement" ).split( " " ), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, @@ -4813,13 +5375,19 @@ jQuery.event = { doc = eventDoc.documentElement; body = eventDoc.body; - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + event.relatedTarget = fromElement === event.target ? + original.toElement : + fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right @@ -4834,10 +5402,12 @@ jQuery.event = { special: { load: { + // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { + // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { @@ -4845,6 +5415,7 @@ jQuery.event = { this.focus(); return false; } catch ( e ) { + // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers @@ -4863,6 +5434,7 @@ jQuery.event = { delegateType: "focusout" }, click: { + // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { @@ -4889,24 +5461,28 @@ jQuery.event = { } }, - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. + // Piggyback on a donor event to simulate a different one + simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, - isSimulated: true, - originalEvent: {} + isSimulated: true + + // Previously, `originalEvent: {}` was set here, so stopPropagation call + // would not be triggered on donor event, since in our own + // jQuery.event.stopPropagation function we had a check for existence of + // originalEvent.stopPropagation method, so, consequently it would be a noop. + // + // Guard for simulated events was moved to jQuery.event.stopPropagation function + // since `originalEvent` should point to the original event for the + // constancy with other events and for more focused logic } ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } + + jQuery.event.trigger( e, null, elem ); + if ( e.isDefaultPrevented() ) { event.preventDefault(); } @@ -4915,8 +5491,10 @@ jQuery.event = { jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { + + // This "if" is needed for plain objects if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); + elem.removeEventListener( type, handle ); } } : function( elem, type, handle ) { @@ -4925,8 +5503,9 @@ jQuery.removeEvent = document.removeEventListener ? if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { + // detachEvent needed property on element, by name of that event, + // to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { elem[ name ] = null; } @@ -4935,8 +5514,9 @@ jQuery.removeEvent = document.removeEventListener ? }; jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { + if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } @@ -4949,6 +5529,7 @@ jQuery.Event = function( src, props ) { // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && + // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : @@ -4974,6 +5555,7 @@ jQuery.Event = function( src, props ) { // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { + constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, @@ -5000,9 +5582,11 @@ jQuery.Event.prototype = { var e = this.originalEvent; this.isPropagationStopped = returnTrue; - if ( !e ) { + + if ( !e || this.isSimulated ) { return; } + // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); @@ -5026,7 +5610,14 @@ jQuery.Event.prototype = { }; // Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", @@ -5042,9 +5633,9 @@ jQuery.each({ related = event.relatedTarget, handleObj = event.handleObj; - // For mousenter/leave call the handler if related is outside the target. + // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; @@ -5052,13 +5643,14 @@ jQuery.each({ return ret; } }; -}); +} ); // IE submit delegation -if ( !support.submitBubbles ) { +if ( !support.submit ) { jQuery.event.special.submit = { setup: function() { + // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; @@ -5066,30 +5658,42 @@ if ( !support.submitBubbles ) { // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? + + // Support: IE <=8 + // We use jQuery.prop instead of elem.form + // to allow fixing the IE8 delegated submit issue (gh-2332) + // by 3rd party polyfills/workarounds. + jQuery.prop( elem, "form" ) : + undefined; + + if ( form && !jQuery._data( form, "submit" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); + event._submitBubble = true; + } ); + jQuery._data( form, "submit", true ); } - }); + } ); + // return undefined since we don't need an event listener }, postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; + if ( event._submitBubble ) { + delete event._submitBubble; if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); + jQuery.event.simulate( "submit", this.parentNode, event ); } } }, teardown: function() { + // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; @@ -5102,52 +5706,57 @@ if ( !support.submitBubbles ) { } // IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { +if ( !support.change ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; + this._justChanged = true; } - }); + } ); jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; + if ( this._justChanged && !event.isTrigger ) { + this._justChanged = false; } + // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); + jQuery.event.simulate( "change", this, event ); + } ); } return false; } + // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); + jQuery.event.simulate( "change", this.parentNode, event ); } - }); - jQuery._data( elem, "changeBubbles", true ); + } ); + jQuery._data( elem, "change", true ); } - }); + } ); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + if ( this !== elem || event.isSimulated || event.isTrigger || + ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { + return event.handleObj.handler.apply( this, arguments ); } }, @@ -5160,14 +5769,21 @@ if ( !support.changeBubbles ) { }; } -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { +// Support: Firefox +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome, Safari +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; jQuery.event.special[ fix ] = { setup: function() { @@ -5191,80 +5807,34 @@ if ( !support.focusinBubbles ) { } } }; - }); + } ); } -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } +jQuery.fn.extend( { - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); + return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { + // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); @@ -5272,6 +5842,7 @@ jQuery.fn.extend({ return this; } if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) fn = selector; selector = undefined; @@ -5279,105 +5850,40 @@ jQuery.fn.extend({ if ( fn === false ) { fn = returnFalse; } - return this.each(function() { + return this.each( function() { jQuery.event.remove( this, types, fn, selector ); - }); + } ); }, trigger: function( type, data ) { - return this.each(function() { + return this.each( function() { jQuery.event.trigger( type, data, this ); - }); + } ); }, triggerHandler: function( type, data ) { - var elem = this[0]; + var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } -}); +} ); -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); +var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
                  ", "
                  " ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "
                  ", "
                  " ], - tr: [ 2, "", "
                  " ], - col: [ 2, "", "
                  " ], - td: [ 3, "", "
                  " ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
                  ", "
                  " ] - }, safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} + fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); // Support: IE<8 // Manipulating tables requires a tbody @@ -5385,37 +5891,27 @@ function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem.getElementsByTagName( "tbody" )[ 0 ] || + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; + elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { - elem.type = match[1]; + elem.type = match[ 1 ]; } else { - elem.removeAttribute("type"); + elem.removeAttribute( "type" ); } return elem; } -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - function cloneCopyEvent( src, dest ) { - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } @@ -5480,11 +5976,12 @@ function fixCloneNodeIssues( src, dest ) { // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set @@ -5509,12 +6006,137 @@ function fixCloneNodeIssues( src, dest ) { } } -jQuery.extend({ +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( + ( node.text || node.textContent || node.innerHTML || "" ) + .replace( rcleanScript, "" ) + ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + elems = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = elems[ i ] ) != null; i++ ) { + + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + if ( support.html5Clone || jQuery.isXMLDoc( elem ) || + !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes @@ -5523,18 +6145,19 @@ jQuery.extend({ fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + if ( ( !support.noCloneEvent || !support.noCloneChecked ) && + ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { + for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); + if ( destElements[ i ] ) { + fixCloneNodeIssues( node, destElements[ i ] ); } } } @@ -5545,8 +6168,8 @@ jQuery.extend({ srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); + for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { + cloneCopyEvent( node, destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); @@ -5565,143 +6188,16 @@ jQuery.extend({ return clone; }, - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
                  " && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { + cleanData: function( elems, /* internal */ forceAcceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, - deleteExpando = support.deleteExpando, + attributes = support.attributes, special = jQuery.event.special; - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + if ( forceAcceptData || acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; @@ -5724,17 +6220,18 @@ jQuery.extend({ delete cache[ id ]; - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { + // Support: IE<9 + // IE does not allow us to delete expando properties from nodes + // IE creates expando attributes along with the property + // IE does not have a removeAttribute function on Document nodes + if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { elem.removeAttribute( internalKey ); + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 } else { - elem[ internalKey ] = null; + elem[ internalKey ] = undefined; } deletedIds.push( id ); @@ -5743,78 +6240,71 @@ jQuery.extend({ } } } -}); +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, -jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + this.empty().append( + ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) + ); }, null, value, arguments.length ); }, append: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } - }); + } ); }, prepend: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } - }); + } ); }, before: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } - }); + } ); }, after: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; + } ); }, empty: function() { var elem, i = 0; - for ( ; (elem = this[i]) != null; i++ ) { + for ( ; ( elem = this[ i ] ) != null; i++ ) { + // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); @@ -5839,9 +6329,9 @@ jQuery.fn.extend({ dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - return this.map(function() { + return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); + } ); }, html: function( value ) { @@ -5860,14 +6350,15 @@ jQuery.fn.extend({ if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - value = value.replace( rxhtmlTag, "<$1>" ); + value = jQuery.htmlPrefilter( value ); try { - for (; i < l; i++ ) { + for ( ; i < l; i++ ) { + // Remove element nodes and prevent memory leaks - elem = this[i] || {}; + elem = this[ i ] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; @@ -5877,7 +6368,7 @@ jQuery.fn.extend({ elem = 0; // If using innerHTML throws an exception, use the fallback method - } catch(e) {} + } catch ( e ) {} } if ( elem ) { @@ -5887,117 +6378,25 @@ jQuery.fn.extend({ }, replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); + var ignored = []; - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; } - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; + // Force callback invocation + }, ignored ); } -}); +} ); -jQuery.each({ +jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", @@ -6012,8 +6411,8 @@ jQuery.each({ last = insert.length - 1; for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); @@ -6021,28 +6420,29 @@ jQuery.each({ return this.pushStack( ret ); }; -}); +} ); var iframe, - elemdisplay = {}; + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ + // Called only from within defaultDisplay function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); + display = jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element @@ -6066,7 +6466,8 @@ function defaultDisplay( nodeName ) { if ( display === "none" || !display ) { // Use the already-created iframe if possible - iframe = (iframe || jQuery( "',"function"==typeof $f){var t=$f(o.childNodes[0]),u=-1;t.addEvent("ready",function(){function a(a,b,c,d){var e={type:c,target:b};"timeupdate"==c&&(b.currentTime=e.currentTime=d.seconds,b.duration=e.duration=d.duration),b.dispatchEvent(e)}t.playVideo=function(){t.api("play")},t.stopVideo=function(){t.api("unload")},t.pauseVideo=function(){t.api("pause")},t.seekTo=function(a){t.api("seekTo",a)},t.setVolume=function(a){t.api("setVolume",a)},t.setMuted=function(a){a?(t.lastVolume=t.api("getVolume"),t.api("setVolume",0)):(t.api("setVolume",t.lastVolume),delete t.lastVolume)},t.getPlayerState=function(){return u},t.addEvent("play",function(){u=1,a(t,n,"play"),a(t,n,"playing")}),t.addEvent("pause",function(){u=2,a(t,n,"pause")}),t.addEvent("finish",function(){u=0,a(t,n,"ended")}),t.addEvent("playProgress",function(b){a(t,n,"timeupdate",b)}),t.addEvent("seek",function(b){u=3,a(t,n,"seeked",b)}),t.addEvent("loadProgress",function(b){u=3,a(t,n,"progress",b)}),n.pluginElement=o,n.pluginApi=t,n.success(n,n.pluginElement)})}else console.warn("You need to include froogaloop for vimeo to work")}return j.style.display="none",j.removeAttribute("autoplay"),n},updateNative:function(a,b,c,d){var e,f=a.htmlMediaElement;for(e in mejs.HtmlMediaElement)f[e]=mejs.HtmlMediaElement[e];return b.success(f,f),f}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(a){if(!this.isIframeStarted){var b=document.createElement("script");b.src=a.scheme+"www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(a){this.isLoaded?this.createIframe(a):(this.loadIframeApi(a),this.iframeQueue.push(a))},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0,wmode:"transparent"},events:{onReady:function(){c.setVideoSize=function(a,b){c.setSize(a,b)},a.pluginMediaElement.pluginApi=c,a.pluginMediaElement.pluginElement=document.getElementById(a.containerId),b.success(b,b.pluginElement),setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(a){mejs.YouTubeApi.handleStateChange(a.data,c,b)}}})},createEvent:function(a,b,c){var d={type:c,target:b};if(a&&a.getDuration){b.currentTime=d.currentTime=a.getCurrentTime(),b.duration=d.duration=a.getDuration(),d.paused=b.paused,d.ended=b.ended,d.muted=a.isMuted(),d.volume=a.getVolume()/100,d.bytesTotal=a.getVideoBytesTotal(),d.bufferedBytes=a.getVideoBytesLoaded();var e=d.bufferedBytes/d.bytesTotal*d.duration;d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return e},length:1}}b.dispatchEvent(d)},iFrameReady:function(){for(this.isLoaded=!0,this.isIframeLoaded=!0;this.iframeQueue.length>0;){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,c=a.scheme+"www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(b=document.createElement("div"),a.container.appendChild(b),b.outerHTML=''):a.container.innerHTML=''},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c,b.success(d,d.pluginElement),c.cueVideoById(b.videoId);var e=b.containerId+"_callback";window[e]=function(a){mejs.YouTubeApi.handleStateChange(a,c,d)},c.addEventListener("onStateChange",e),setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250),mejs.YouTubeApi.createEvent(c,d,"canplay")},handleStateChange:function(a,b,c){switch(a){case-1:c.paused=!0,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=!1,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=!1,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"play"),mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=!0,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress");break;case 5:}}},window.onYouTubePlayerAPIReady=function(){mejs.YouTubeApi.iFrameReady()},window.onYouTubePlayerReady=function(a){mejs.YouTubeApi.flashReady(a)},window.mejs=mejs,window.MediaElement=mejs.MediaElement,function(a,b,c){"use strict";var d={locale:{language:b.i18n&&b.i18n.locale.language||"",strings:b.i18n&&b.i18n.locale.strings||{}},ietf_lang_regex:/^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/,methods:{}};d.getLanguage=function(){var a=d.locale.language||window.navigator.userLanguage||window.navigator.language;return d.ietf_lang_regex.exec(a)?a:null},"undefined"!=typeof mejsL10n&&(d.locale.language=mejsL10n.language),d.methods.checkPlain=function(a){var b,c,d={"&":"&",'"':""","<":"<",">":">"};a=String(a);for(b in d)d.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,d[b]));return a},d.methods.t=function(a,b){return d.locale.strings&&d.locale.strings[b.context]&&d.locale.strings[b.context][a]&&(a=d.locale.strings[b.context][a]),d.methods.checkPlain(a)},d.t=function(a,b){if("string"==typeof a&&a.length>0){var c=d.getLanguage();return b=b||{context:c},d.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},b.i18n=d}(document,mejs),function(a,b){"use strict";"undefined"!=typeof mejsL10n&&(a[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings),/*! +var mejs=mejs||{};mejs.version="2.23.0",mejs.meIndex=0,mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/dailymotion","video/x-dailymotion","application/x-mpegURL"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo","video/x-vimeo"]}]},mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");return b.innerHTML='x',b.firstChild.href},getScriptPath:function(a){for(var b,c,d,e,f,g,h=0,i="",j="",k=document.getElementsByTagName("script"),l=k.length,m=a.length;l>h;h++){for(e=k[h].src,c=e.lastIndexOf("/"),c>-1?(g=e.substring(c+1),f=e.substring(0,c+1)):(g=e,f=""),b=0;m>b;b++)if(j=a[b],d=g.indexOf(j),d>-1){i=f;break}if(""!==i)break}return i},calculateTimeFormat:function(a,b,c){0>a&&(a=0),"undefined"==typeof c&&(c=25);var d=b.timeFormat,e=d[0],f=d[1]==d[0],g=f?2:1,h=":",i=Math.floor(a/3600)%24,j=Math.floor(a/60)%60,k=Math.floor(a%60),l=Math.floor((a%1*c).toFixed(3)),m=[[l,"f"],[k,"s"],[j,"m"],[i,"h"]];d.lengtho;o++)if(-1!==d.indexOf(m[o][1]))n=!0;else if(n){for(var q=!1,r=o;p>r;r++)if(m[r][0]>0){q=!0;break}if(!q)break;f||(d=e+d),d=m[o][1]+h+d,f&&(d=m[o][1]+d),e=m[o][1]}b.currentTimeFormat=d},twoDigitsString:function(a){return 10>a?"0"+a:String(a)},secondsToTimeCode:function(a,b){if(0>a&&(a=0),"object"!=typeof b){var c="m:ss";c=arguments[1]?"hh:mm:ss":c,c=arguments[2]?c+":ff":c,b={currentTimeFormat:c,framesPerSecond:arguments[3]||25}}var d=b.framesPerSecond;"undefined"==typeof d&&(d=25);var c=b.currentTimeFormat,e=Math.floor(a/3600)%24,f=Math.floor(a/60)%60,g=Math.floor(a%60),h=Math.floor((a%1*d).toFixed(3));lis=[[h,"f"],[g,"s"],[f,"m"],[e,"h"]];var j=c;for(i=0,len=lis.length;i0&&(d=Math.pow(60,e)),b+=Number(a[e])*d;return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);b&&/object|embed/i.test(b.nodeName)&&(mejs.MediaFeatures.isIE?(b.style.display="none",function(){4==b.readyState?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))},removeObjectInIE:function(a){var b=document.getElementById(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}},determineScheme:function(a){return a&&-1!=a.indexOf("://")?a.substr(0,a.indexOf("://")+3):"//"}},mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];return b[1]=b[1]||0,b[2]=b[2]||0,c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e,f,g,h=[0,0,0];if("undefined"!=typeof this.nav.plugins&&"object"==typeof this.nav.plugins[a]){if(e=this.nav.plugins[a].description,e&&("undefined"==typeof this.nav.mimeTypes||!this.nav.mimeTypes[b]||this.nav.mimeTypes[b].enabledPlugin))for(h=e.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split("."),f=0;f0;)this.removeChild(b[0]);if("string"==typeof a)this.src=a;else{var c,d;for(c=0;c0&&null!==q[0].url&&this.getTypeFromFile(q[0].url).indexOf("audio")>-1&&(r.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(a.canPlayType=function(a){return null!==a.match(/video\/(mp4|m4v)/gi)?"maybe":""}),mejs.MediaFeatures.isChromium&&(a.canPlayType=function(a){return null!==a.match(/video\/(webm|ogv|ogg)/gi)?"maybe":""}),c&&("auto"===b.mode||"auto_plugin"===b.mode||"native"===b.mode)&&(!mejs.MediaFeatures.isBustedNativeHTTPS||b.httpsBasicAuthSite!==!0)){for(d||(o=document.createElement(r.isVideo?"video":"audio"),a.parentNode.insertBefore(o,a),a.style.display="none",r.htmlMediaElement=a=o),f=0;f0&&(r.url=q[0].url),r)},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];var b=a.substring(a.lastIndexOf(".")+1).toLowerCase(),c=/(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b)?"video/":"audio/";return this.getTypeFromExtension(b,c)},getTypeFromExtension:function(a,b){switch(b=b||"",a){case"mp4":case"m4v":case"m4a":case"f4v":case"f4a":return b+"mp4";case"flv":return b+"x-flv";case"webm":case"webma":case"webmv":return b+"webm";case"ogg":case"oga":case"ogv":return b+"ogg";case"m3u8":return"application/x-mpegurl";case"ts":return b+"mp2t";default:return b+a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div"),f=b.customError;e.className="me-cannotplay";try{e.style.width=d.width+"px",e.style.height=d.height+"px"}catch(g){}f||(f='',""!==c&&(f+=''),f+=""+mejs.i18n.t("Download File")+""),e.innerHTML=f,d.parentNode.insertBefore(e,d),d.style.display="none",b.error(d)},createPlugin:function(a,b,c,d,e,f){var g,h,i,j=a.htmlMediaElement,k=1,l=1,m="me_"+a.method+"_"+mejs.meIndex++,n=new mejs.PluginMediaElement(m,a.method,a.url),o=document.createElement("div");n.tagName=j.tagName;for(var p=0;p0?b.pluginWidth:b.videoWidth>0?b.videoWidth:null!==j.getAttribute("width")?j.getAttribute("width"):b.defaultVideoWidth,l=b.pluginHeight>0?b.pluginHeight:b.videoHeight>0?b.videoHeight:null!==j.getAttribute("height")?j.getAttribute("height"):b.defaultVideoHeight,k=mejs.Utility.encodeUrl(k),l=mejs.Utility.encodeUrl(l)):b.enablePluginDebug&&(k=320,l=240),n.success=b.success,o.className="me-plugin",o.id=m+"_container",a.isVideo?j.parentNode.insertBefore(o,j):document.body.insertBefore(o,document.body.childNodes[0]),("flash"===a.method||"silverlight"===a.method)&&(i=["id="+m,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+k,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+l,"pseudostreamstart="+b.pseudoStreamingStartQueryParam],null!==a.url&&("flash"==a.method?i.push("file="+mejs.Utility.encodeUrl(a.url)):i.push("file="+a.url)),b.enablePluginDebug&&i.push("debug=true"),b.enablePluginSmoothing&&i.push("smoothing=true"),b.enablePseudoStreaming&&i.push("pseudostreaming=true"),f&&i.push("controls=true"),b.pluginVars&&(i=i.concat(b.pluginVars)),window[m+"_init"]=function(){switch(n.pluginType){case"flash":n.pluginElement=n.pluginApi=document.getElementById(m);break;case"silverlight":n.pluginElement=document.getElementById(n.id),n.pluginApi=n.pluginElement.Content.MediaElementJS}null!=n.pluginApi&&n.success&&n.success(n,j)},window[m+"_event"]=function(a,b){var c,d,e;c={type:a,target:n};for(d in b)n[d]=b[d],c[d]=b[d];e=b.bufferedTime||0,c.target.buffered=c.buffered={start:function(a){return 0},end:function(a){return e},length:1},n.dispatchEvent(c)}),a.method){case"silverlight":o.innerHTML='';break;case"flash":mejs.MediaFeatures.isIE?(g=document.createElement("div"),o.appendChild(g),g.outerHTML=''):o.innerHTML='';break;case"youtube":var r;if(-1!=a.url.lastIndexOf("youtu.be"))r=a.url.substr(a.url.lastIndexOf("/")+1),-1!=r.indexOf("?")&&(r=r.substr(0,r.indexOf("?")));else{var s=a.url.match(/[?&]v=([^&#]+)|&|#|$/);s&&(r=s[1])}youtubeSettings={container:o,containerId:o.id,pluginMediaElement:n,pluginId:m,videoId:r,height:l,width:k,scheme:a.scheme},window.postMessage?mejs.YouTubeApi.enqueueIframe(youtubeSettings):mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])&&mejs.YouTubeApi.createFlash(youtubeSettings,b);break;case"vimeo":var t=m+"_player";if(n.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1),o.innerHTML='',"function"==typeof $f){var u=$f(o.childNodes[0]),v=-1;u.addEvent("ready",function(){function a(a,b,c,d){var e={type:c,target:b};"timeupdate"==c&&(b.currentTime=e.currentTime=d.seconds,b.duration=e.duration=d.duration),b.dispatchEvent(e)}u.playVideo=function(){u.api("play")},u.stopVideo=function(){u.api("unload")},u.pauseVideo=function(){u.api("pause")},u.seekTo=function(a){u.api("seekTo",a)},u.setVolume=function(a){u.api("setVolume",a)},u.setMuted=function(a){a?(u.lastVolume=u.api("getVolume"),u.api("setVolume",0)):(u.api("setVolume",u.lastVolume),delete u.lastVolume)},u.getPlayerState=function(){return v},u.addEvent("play",function(){v=1,a(u,n,"play"),a(u,n,"playing")}),u.addEvent("pause",function(){v=2,a(u,n,"pause")}),u.addEvent("finish",function(){v=0,a(u,n,"ended")}),u.addEvent("playProgress",function(b){a(u,n,"timeupdate",b)}),u.addEvent("seek",function(b){v=3,a(u,n,"seeked",b)}),u.addEvent("loadProgress",function(b){v=3,a(u,n,"progress",b)}),n.pluginElement=o,n.pluginApi=u,n.success(n,n.pluginElement)})}else console.warn("You need to include froogaloop for vimeo to work")}return j.style.display="none",j.removeAttribute("autoplay"),n},updateNative:function(a,b,c,d){var e,f=a.htmlMediaElement;for(e in mejs.HtmlMediaElement)f[e]=mejs.HtmlMediaElement[e];return b.success(f,f),f}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(a){if(!this.isIframeStarted){var b=document.createElement("script");b.src=a.scheme+"www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(a){this.isLoaded?this.createIframe(a):(this.loadIframeApi(a),this.iframeQueue.push(a))},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0,wmode:"transparent"},events:{onReady:function(d){c.setVideoSize=function(a,b){c.setSize(a,b)},a.pluginMediaElement.pluginApi=c,a.pluginMediaElement.pluginElement=document.getElementById(a.containerId),b.success(b,b.pluginElement),mejs.YouTubeApi.createEvent(c,b,"canplay"),setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250),"undefined"!=typeof b.attributes.autoplay&&c.playVideo()},onStateChange:function(a){mejs.YouTubeApi.handleStateChange(a.data,c,b)}}})},createEvent:function(a,b,c){var d={type:c,target:b};if(a&&a.getDuration){b.currentTime=d.currentTime=a.getCurrentTime(),b.duration=d.duration=a.getDuration(),d.paused=b.paused,d.ended=b.ended,d.muted=a.isMuted(),d.volume=a.getVolume()/100,d.bytesTotal=a.getVideoBytesTotal(),d.bufferedBytes=a.getVideoBytesLoaded();var e=d.bufferedBytes/d.bytesTotal*d.duration;d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return e},length:1}}b.dispatchEvent(d)},iFrameReady:function(){for(this.isLoaded=!0,this.isIframeLoaded=!0;this.iframeQueue.length>0;){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,c=a.scheme+"www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(b=document.createElement("div"),a.container.appendChild(b),b.outerHTML=''):a.container.innerHTML=''},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c,b.success(d,d.pluginElement),c.cueVideoById(b.videoId);var e=b.containerId+"_callback";window[e]=function(a){mejs.YouTubeApi.handleStateChange(a,c,d)},c.addEventListener("onStateChange",e),setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250),mejs.YouTubeApi.createEvent(c,d,"canplay")},handleStateChange:function(a,b,c){switch(a){case-1:c.paused=!0,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=!1,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=!1,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"play"),mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=!0,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress");break;case 5:}}},window.onYouTubePlayerAPIReady=function(){mejs.YouTubeApi.iFrameReady()},window.onYouTubePlayerReady=function(a){mejs.YouTubeApi.flashReady(a)},window.mejs=mejs,window.MediaElement=mejs.MediaElement,function(a,b,c){"use strict";var d={locale:{language:b.i18n&&b.i18n.locale.language||"",strings:b.i18n&&b.i18n.locale.strings||{}},ietf_lang_regex:/^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/,methods:{}};d.getLanguage=function(){var a=d.locale.language||window.navigator.userLanguage||window.navigator.language;return d.ietf_lang_regex.exec(a)?a:null},"undefined"!=typeof mejsL10n&&(d.locale.language=mejsL10n.language),d.methods.checkPlain=function(a){var b,c,d={"&":"&",'"':""","<":"<",">":">"};a=String(a);for(b in d)d.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,d[b]));return a},d.methods.t=function(a,b){return d.locale.strings&&d.locale.strings[b.context]&&d.locale.strings[b.context][a]&&(a=d.locale.strings[b.context][a]),d.methods.checkPlain(a)},d.t=function(a,b){if("string"==typeof a&&a.length>0){var c=d.getLanguage();return b=b||{context:c},d.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},b.i18n=d}(document,mejs),function(a,b){"use strict";"undefined"!=typeof mejsL10n&&(a[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings),/*! * * MediaElementPlayer * http://mediaelementjs.com/ @@ -24,5 +24,5 @@ var mejs=mejs||{};mejs.version="2.21.2",mejs.meIndex=0,mejs.plugins={silverlight * License: MIT * */ -"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):"undefined"!=typeof ender&&(mejs.$=ender),function(a){mejs.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,autosizeProgress:!0,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.volume+.1,1);b.setVolume(c)}},{keys:[40],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.volume-.1,0);b.setVolume(c)}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a,b){"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},mejs.mepIndex=0,mejs.players={},mejs.MediaElementPlayer=function(b,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(b,c);var d=this;return d.$media=d.$node=a(b),d.node=d.media=d.$media[0],d.node?"undefined"!=typeof d.node.player?d.node.player:("undefined"==typeof c&&(c=d.$node.data("mejsoptions")),d.options=a.extend({},mejs.MepDefaults,c),d.options.timeFormat||(d.options.timeFormat="mm:ss",d.options.alwaysShowHours&&(d.options.timeFormat="hh:mm:ss"),d.options.showTimecodeFrameCount&&(d.options.timeFormat+=":ff")),mejs.Utility.calculateTimeFormat(0,d.options,d.options.framesPerSecond||25),d.id="mep_"+mejs.mepIndex++,mejs.players[d.id]=d,d.init(),d):void 0},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var b=this,c=mejs.MediaFeatures,d=a.extend(!0,{},b.options,{success:function(a,c){b.meReady(a,c)},error:function(a){b.handleError(a)}}),e=b.media.tagName.toLowerCase();if(b.isDynamic="audio"!==e&&"video"!==e,b.isDynamic?b.isVideo=b.options.isVideo:b.isVideo="audio"!==e&&b.options.isVideo,c.isiPad&&b.options.iPadUseNativeControls||c.isiPhone&&b.options.iPhoneUseNativeControls)b.$media.attr("controls","controls"),c.isiPad&&null!==b.media.getAttribute("autoplay")&&b.play();else if(c.isAndroid&&b.options.AndroidUseNativeControls);else{b.$media.removeAttr("controls");var f=b.isVideo?mejs.i18n.t("Video Player"):mejs.i18n.t("Audio Player");a(''+f+"").insertBefore(b.$media),b.container=a('
                  ').addClass(b.$media[0].className).insertBefore(b.$media).focus(function(a){if(!b.controlsAreVisible){b.showControls(!0);var c=b.container.find(".mejs-playpause-button > button");c.focus()}}),b.container.addClass((c.isAndroid?"mejs-android ":"")+(c.isiOS?"mejs-ios ":"")+(c.isiPad?"mejs-ipad ":"")+(c.isiPhone?"mejs-iphone ":"")+(b.isVideo?"mejs-video ":"mejs-audio ")),b.container.find(".mejs-mediaelement").append(b.$media),b.node.player=b,b.controls=b.container.find(".mejs-controls"),b.layers=b.container.find(".mejs-layers");var g=b.isVideo?"video":"audio",h=g.substring(0,1).toUpperCase()+g.substring(1);b.options[g+"Width"]>0||b.options[g+"Width"].toString().indexOf("%")>-1?b.width=b.options[g+"Width"]:""!==b.media.style.width&&null!==b.media.style.width?b.width=b.media.style.width:null!==b.media.getAttribute("width")?b.width=b.$media.attr("width"):b.width=b.options["default"+h+"Width"],b.options[g+"Height"]>0||b.options[g+"Height"].toString().indexOf("%")>-1?b.height=b.options[g+"Height"]:""!==b.media.style.height&&null!==b.media.style.height?b.height=b.media.style.height:null!==b.$media[0].getAttribute("height")?b.height=b.$media.attr("height"):b.height=b.options["default"+h+"Height"],b.setPlayerSize(b.width,b.height),d.pluginWidth=b.width,d.pluginHeight=b.height}mejs.MediaElement(b.$media[0],d),"undefined"!=typeof b.container&&b.controlsAreVisible&&b.container.trigger("controlsshown")},showControls:function(a){var b=this;a="undefined"==typeof a||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(b){var c=this;b="undefined"==typeof b||b,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||(b?(c.controls.stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:1500,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(b,c){var d,e,f=this,g=mejs.MediaFeatures,h=c.getAttribute("autoplay"),i=!("undefined"==typeof h||null===h||"false"===h);if(!f.created){if(f.created=!0,f.media=b,f.domNode=c,!(g.isAndroid&&f.options.AndroidUseNativeControls||g.isiPad&&f.options.iPadUseNativeControls||g.isiPhone&&f.options.iPhoneUseNativeControls)){f.buildposter(f,f.controls,f.layers,f.media),f.buildkeyboard(f,f.controls,f.layers,f.media),f.buildoverlays(f,f.controls,f.layers,f.media),f.findTracks();for(d in f.options.features)if(e=f.options.features[d],f["build"+e])try{f["build"+e](f,f.controls,f.layers,f.media)}catch(j){}f.container.trigger("controlsready"),f.setPlayerSize(f.width,f.height),f.setControlsSize(),f.isVideo&&(mejs.MediaFeatures.hasTouch?f.$media.bind("touchstart",function(){f.controlsAreVisible?f.hideControls(!1):f.controlsEnabled&&f.showControls(!1)}):(f.clickToPlayPauseCallback=function(){f.options.clickToPlayPause&&(f.media.paused?f.play():f.pause())},f.media.addEventListener("click",f.clickToPlayPauseCallback,!1),f.container.bind("mouseenter",function(){f.controlsEnabled&&(f.options.alwaysShowControls||(f.killControlsTimer("enter"),f.showControls(),f.startControlsTimer(2500)))}).bind("mousemove",function(){f.controlsEnabled&&(f.controlsAreVisible||f.showControls(),f.options.alwaysShowControls||f.startControlsTimer(2500))}).bind("mouseleave",function(){f.controlsEnabled&&(f.media.paused||f.options.alwaysShowControls||f.startControlsTimer(1e3))})),f.options.hideVideoControlsOnLoad&&f.hideControls(!1),i&&!f.options.alwaysShowControls&&f.hideControls(),f.options.enableAutosize&&f.media.addEventListener("loadedmetadata",function(a){f.options.videoHeight<=0&&null===f.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(f.setPlayerSize(a.target.videoWidth,a.target.videoHeight),f.setControlsSize(),f.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1)),b.addEventListener("play",function(){var a;for(a in mejs.players){var b=mejs.players[a];b.id==f.id||!f.options.pauseOtherPlayers||b.paused||b.ended||b.pause(),b.hasFocus=!1}f.hasFocus=!0},!1),f.media.addEventListener("ended",function(b){if(f.options.autoRewind)try{f.media.setCurrentTime(0),window.setTimeout(function(){a(f.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}f.media.pause(),f.setProgressRail&&f.setProgressRail(),f.setCurrentRail&&f.setCurrentRail(),f.options.loop?f.play():!f.options.alwaysShowControls&&f.controlsEnabled&&f.showControls()},!1),f.media.addEventListener("loadedmetadata",function(a){f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.isFullScreen||(f.setPlayerSize(f.width,f.height),f.setControlsSize())},!1);var k=null;f.media.addEventListener("timeupdate",function(){k!==this.duration&&(k=this.duration,mejs.Utility.calculateTimeFormat(k,f.options,f.options.framesPerSecond||25),f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.setControlsSize())},!1),f.container.focusout(function(b){if(b.relatedTarget){var c=a(b.relatedTarget);f.keyboardAction&&0===c.parents(".mejs-container").length&&(f.keyboardAction=!1,f.hideControls(!0))}}),setTimeout(function(){f.setPlayerSize(f.width,f.height),f.setControlsSize()},50),f.globalBind("resize",function(){f.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||f.setPlayerSize(f.width,f.height),f.setControlsSize()}),"youtube"==f.media.pluginType&&(g.isiOS||g.isAndroid)&&(f.container.find(".mejs-overlay-play").hide(),f.container.find(".mejs-poster").hide())}i&&"native"==b.pluginType&&f.play(),f.options.success&&("string"==typeof f.options.success?window[f.options.success](f.media,f.domNode,f):f.options.success(f.media,f.domNode,f))}},handleError:function(a){var b=this;b.controls&&b.controls.hide(),b.options.error&&b.options.error(a)},setPlayerSize:function(b,c){var d=this;if(!d.options.setDimensions)return!1;if("undefined"!=typeof b&&(d.width=b),"undefined"!=typeof c&&(d.height=c),d.height.toString().indexOf("%")>0||"none"!==d.$node.css("max-width")&&"t.width"!==d.$node.css("max-width")||d.$node[0].currentStyle&&"100%"===d.$node[0].currentStyle.maxWidth){var e=function(){return d.isVideo?d.media.videoWidth&&d.media.videoWidth>0?d.media.videoWidth:null!==d.media.getAttribute("width")?d.media.getAttribute("width"):d.options.defaultVideoWidth:d.options.defaultAudioWidth}(),f=function(){return d.isVideo?d.media.videoHeight&&d.media.videoHeight>0?d.media.videoHeight:null!==d.media.getAttribute("height")?d.media.getAttribute("height"):d.options.defaultVideoHeight:d.options.defaultAudioHeight}(),g=d.container.parent().closest(":visible").width(),h=d.container.parent().closest(":visible").height(),i=d.isVideo||!d.options.autosizeProgress?parseInt(g*f/e,10):f;isNaN(i)&&(i=h),d.container.parent().length>0&&"body"===d.container.parent()[0].tagName.toLowerCase()&&(g=a(window).width(),i=a(window).height()),i&&g&&(d.container.width(g).height(i),d.$media.add(d.container.find(".mejs-shim")).width("100%").height("100%"),d.isVideo&&d.media.setVideoSize&&d.media.setVideoSize(g,i),d.layers.children(".mejs-layer").width("100%").height("100%"))}else d.container.width(d.width).height(d.height),d.layers.children(".mejs-layer").width(d.width).height(d.height)},setControlsSize:function(){var b=this,c=0,d=0,e=b.controls.find(".mejs-time-rail"),f=b.controls.find(".mejs-time-total"),g=e.siblings(),h=g.last(),i=null;if(b.container.is(":visible")&&e.length&&e.is(":visible")){b.options&&!b.options.autosizeProgress&&(d=parseInt(e.css("width"),10)),0!==d&&d||(g.each(function(){var b=a(this);"absolute"!=b.css("position")&&b.is(":visible")&&(c+=a(this).outerWidth(!0))}),d=b.controls.width()-c-(e.outerWidth(!0)-e.width()));do e.width(d),f.width(d-(f.outerWidth(!0)-f.width())),"absolute"!=h.css("position")&&(i=h.length?h.position():null,d--);while(null!==i&&i.top.toFixed(2)>0&&d>0);b.container.trigger("controlsresize")}},buildposter:function(b,c,d,e){var f=this,g=a('
                  ').appendTo(d),h=b.$media.attr("poster");""!==b.options.poster&&(h=b.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),b.options.showPosterWhenEnded&&b.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(b){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=a('').appendTo(d)),e.attr("src",b),d.css({"background-image":"url("+b+")"})},buildoverlays:function(b,c,d,e){var f=this;if(b.isVideo){var g=a('
                  ').hide().appendTo(d),h=a('
                  ').hide().appendTo(d),i=a('
                  ').appendTo(d).bind("click",function(){f.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("playing",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("seeking",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("seeked",function(){g.hide(),c.find(".mejs-time-buffering").hide()},!1),e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||i.show()},!1),e.addEventListener("waiting",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("loadeddata",function(){g.show(),c.find(".mejs-time-buffering").show(),mejs.MediaFeatures.isAndroid&&(e.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),e.dispatchEvent(a)}},300))},!1),e.addEventListener("canplay",function(){g.hide(),c.find(".mejs-time-buffering").hide(),clearTimeout(e.canplayTimeout)},!1),e.addEventListener("error",function(a){f.handleError(a),g.hide(),i.hide(),h.show(),h.find(".mejs-overlay-error").html("Error loading this resource")},!1),e.addEventListener("keydown",function(a){f.onkeydown(b,e,a)},!1)}},buildkeyboard:function(b,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return b.hasFocus=0!==a(c.target).closest(".mejs-container").length&&a(c.target).closest(".mejs-container").attr("id")===b.$media.closest(".mejs-container").attr("id"),f.onkeydown(b,e,c)}),f.globalBind("click",function(c){b.hasFocus=0!==a(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode==f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var b=this,c=b.$media.find("track");b.tracks=[],c.each(function(c,d){d=a(d),b.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){this.container[0].className="mejs-container "+a,this.setPlayerSize(this.width,this.height),this.setControlsSize()},play:function(){this.load(),this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||this.media.load(),this.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b,c=this;c.container.prev(".mejs-offscreen").remove();for(a in c.options.features)if(b=c.options.features[a],c["clean"+b])try{c["clean"+b](c)}catch(d){}c.isDynamic?c.$node.insertBefore(c.container):(c.$media.prop("controls",!0),c.$node.clone().insertBefore(c.container).show(),c.$node.remove()),"native"!==c.media.pluginType&&c.media.remove(),delete mejs.players[c.id],"object"==typeof c.container&&c.container.remove(),c.globalUnbind(),delete c.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function b(b,d){var e={d:[],w:[]};return a.each((b||"").split(" "),function(a,b){var f=b+"."+d;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[c.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var c=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,d,e){var f=this,g=f.node?f.node.ownerDocument:document;c=b(c,f.id),c.d&&a(g).bind(c.d,d,e),c.w&&a(window).bind(c.w,d,e)},mejs.MediaElementPlayer.prototype.globalUnbind=function(c,d){var e=this,f=e.node?e.node.ownerDocument:document;c=b(c,e.id),c.d&&a(f).unbind(c.d,d),c.w&&a(window).unbind(c.w,d)}}(),"undefined"!=typeof a&&(a.fn.mediaelementplayer=function(b){return b===!1?this.each(function(){var b=a(this).data("mediaelementplayer");b&&b.remove(),a(this).removeData("mediaelementplayer")}):this.each(function(){a(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,b))}),this},a(document).ready(function(){a(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=mejs.MediaElementPlayer}(mejs.$),function(a){a.extend(mejs.MepDefaults,{playText:mejs.i18n.t("Play"),pauseText:mejs.i18n.t("Pause")}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(i.removeClass("mejs-play").addClass("mejs-pause"),j.attr({title:h.pauseText,"aria-label":h.pauseText})):(i.removeClass("mejs-pause").addClass("mejs-play"),j.attr({title:h.playText,"aria-label":h.playText}))}var g=this,h=g.options,i=a('
                  ').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),j=i.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:"Stop"}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this;a('
                  ').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{progessHelpText:mejs.i18n.t("Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.")}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){a('
                  00:00
                  ').appendTo(c),c.find(".mejs-time-buffering").hide();var f=this,g=c.find(".mejs-time-total"),h=c.find(".mejs-time-loaded"),i=c.find(".mejs-time-current"),j=c.find(".mejs-time-handle"),k=c.find(".mejs-time-float"),l=c.find(".mejs-time-float-current"),m=c.find(".mejs-time-slider"),n=function(a){var c,d=g.offset(),f=g.width(),h=0,i=0,j=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(cf+d.left&&(c=f+d.left),j=c-d.left,h=j/f,i=.02>=h?0:h*e.duration,o&&i!==e.currentTime&&e.setCurrentTime(i),mejs.MediaFeatures.hasTouch||(k.css("left",j),l.html(mejs.Utility.secondsToTimeCode(i,b.options)),k.show()))},o=!1,p=!1,q=0,r=!1,s=b.options.autoRewind,t=function(a){var c=e.currentTime,d=mejs.i18n.t("Time Slider"),f=mejs.Utility.secondsToTimeCode(c,b.options),g=e.duration;m.attr({"aria-label":d,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":c,"aria-valuetext":f,role:"slider",tabindex:0})},u=function(){var a=new Date;a-q>=1e3&&e.play()};m.bind("focus",function(a){b.options.autoRewind=!1}),m.bind("blur",function(a){b.options.autoRewind=s}),m.bind("keydown",function(a){new Date-q>=1e3&&(r=e.paused);var c=a.keyCode,d=e.duration,f=e.currentTime,g=b.options.defaultSeekForwardInterval(d),h=b.options.defaultSeekBackwardInterval(d);switch(c){case 37:case 40:f-=h;break;case 39:case 38:f+=g;break;case 36:f=0;break;case 35:f=d;break;case 32:case 13:return void(e.paused?e.play():e.pause());default:return}return f=0>f?0:f>=d?d:Math.floor(f),q=new Date,r||e.pause(),f0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(b.total.width()*d))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);a.current.width(b),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
                  '+mejs.Utility.secondsToTimeCode(0,b.options)+"
                  ").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
                  '+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"
                  ").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options))},updateDuration:function(){var a=this,b=a.media.duration;a.options.duration>0&&(b=a.options.duration),isNaN(b)&&(b=0),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),allyVolumeControlText:mejs.i18n.t("Use Up/Down Arrow keys to increase or decrease volume."),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"==g?a('
                  '+f.options.allyVolumeControlText+'
                  ').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){if(!i.is(":visible")&&"undefined"==typeof b)return i.show(),m(a,!0),void i.hide();a=Math.max(0,a),a=Math.min(a,1),0===a?(h.removeClass("mejs-mute").addClass("mejs-unmute"),h.children("button").attr("title",mejs.i18n.t("Unmute")).attr("aria-label",mejs.i18n.t("Unmute"))):(h.removeClass("mejs-unmute").addClass("mejs-mute"),h.children("button").attr("title",mejs.i18n.t("Mute")).attr("aria-label",mejs.i18n.t("Mute")));var c=j.position();if("vertical"==g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!=g||i.hide()});var q=function(a){var b=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("Volume Slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":b,"aria-valuetext":b+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!=g||i.hide()}),o=!0,!1}).bind("keydown",function(a){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1);break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").bind("focus",function(){i.show()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0),"native"===e.pluginType&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){m(e.volume)})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,fullscreenMode:"",buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("play",function(){b.detectFullscreenMode()});var f=this,g=null,h=a('
                  ').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"==f.fullscreenMode){null!==g&&(clearTimeout(g),delete g);var a=h.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0)}}).on("mouseout",function(){"plugin-hover"==f.fullscreenMode&&(null!==g&&(clearTimeout(g),delete g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=h,f.globalBind("keydown",function(a){27==a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var i=function(a){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,i)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures;return c.hasTrueNativeFullScreen&&"native"===a.media.pluginType?b="native-native":c.hasTrueNativeFullScreen&&"native"!==a.media.pluginType&&!c.hasFirefoxPluginMovingProblem?b="plugin-native":a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow",a.fullscreenMode=b,b},isPluginClickThroughCreated:!1,createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""), -b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('
                  ').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageYc.top+fullscreenBtn.outerHeight(!0)||a.pageXc.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var b=this;return mejs.MediaFeatures.hasiOSFullScreen?void b.media.webkitEnterFullscreen():(a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function c(){if(b.isNativeFullScreen){var d=.002,e=a(window).width(),f=screen.width,g=Math.abs(f-e),h=f*d;g>h?b.exitFullScreen():setTimeout(c,500)}},1e3)):"fullwindow"==b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),"native"===b.media.pluginType?b.$media.width("100%").height("100%"):(b.container.find(".mejs-shim").width("100%").height("100%"),setTimeout(function(){var c=a(window),d=c.width(),e=c.height();b.media.setVideoSize(d,e)},500)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0,b.container.find(".mejs-captions-text").css("font-size",screen.width/b.width*1*100+"%"),b.container.find(".mejs-captions-position").css("bottom","45px"),void b.container.trigger("enteredfullscreen"))},exitFullScreen:function(){var b=this;clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen").width(b.normalWidth).height(b.normalHeight),"native"===b.media.pluginType?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find(".mejs-shim").width(b.normalWidth).height(b.normalHeight),b.media.setVideoSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this;if("native"==f.media.pluginType){for(var g=null,h=null,i=null,j=null,k=[],l=!1,m=0,n=f.options.speeds.length;n>m;m++){var o=f.options.speeds[m];"string"==typeof o?(k.push({name:o+f.options.speedChar,value:o}),o===f.options.defaultSpeed&&(l=!0)):(k.push(o),o.value===f.options.defaultSpeed&&(l=!0))}l||k.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),k.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var p=function(a){for(m=0,n=k.length;n>m;m++)if(k[m].value===a)return k[m].name},q='
                    ';for(m=0,il=k.length;m";q+="
                  ",g=a(q).appendTo(c),h=g.find(".mejs-speed-selector"),i=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){i&&(e.playbackRate=parseFloat(i))},!0),h.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");i=b,e.playbackRate=parseFloat(b),g.find("button").html(p(b)),g.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),g.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),g.one("mouseenter focusin",function(){h.height(g.find(".mejs-speed-selector ul").outerHeight(!0)+g.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*h.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,cleartracks:function(a,b,c,d){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g=this,h=g.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"";if(g.domNode.textTracks)for(f=g.domNode.textTracks.length-1;f>=0;f--)g.domNode.textTracks[f].mode="hidden";g.cleartracks(b,c,d,e),b.chapters=a('
                  ').prependTo(d).hide(),b.captions=a('
                  ').prependTo(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('
                  ").appendTo(c);var i=0;for(f=0;f0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage==b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('
                • ")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(i=0;i=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];"undefined"==typeof e||"undefined"==typeof e.fadeIn?c.slides.entries.imgs[b]=e=a('').on("load",function(){e.appendTo(c.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):e.is(":visible")||e.is(":animated")||e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if("undefined"!=typeof this.slides){var a,b=this,c=b.slides;for(a=0;a=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;a100||c==b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('
                  '+b.entries.text[c]+''+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options)+"
                  ")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(this).attr("rel"))),e.media.paused&&e.media.play()}),e.chapters.show()}}),mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}},mejs.TrackFormatParser={webvtt:{pattern_timecode:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f$1"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e$1"),i.text.push(d),0===i.times.start&&(i.times.start=2)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c
                  ').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer(),a.contextMenuTimer=setTimeout(function(){a.hideContextMenu(),a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;null!=a&&(clearTimeout(a),delete a,a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='
                  ';else{var i=f[g].render(d);null!=i&&(e+='
                  '+i+"
                  ")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:mejs.i18n.t("Skip back %1 seconds")}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=f.options.skipBackText.replace("%1",f.options.skipBackInterval);a('
                  ").appendTo(c).click(function(){e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur()})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof g&&(b.postroll=a('').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:g,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$); \ No newline at end of file +"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):"undefined"!=typeof ender&&(mejs.$=ender),function(a){mejs.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,autosizeProgress:!0,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,stretching:"auto",enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.volume+.1,1);b.setVolume(c)}},{keys:[40],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.volume-.1,0);b.setVolume(c)}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a,b){"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},mejs.mepIndex=0,mejs.players={},mejs.MediaElementPlayer=function(b,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(b,c);var d=this;return d.$media=d.$node=a(b),d.node=d.media=d.$media[0],d.node?"undefined"!=typeof d.node.player?d.node.player:("undefined"==typeof c&&(c=d.$node.data("mejsoptions")),d.options=a.extend({},mejs.MepDefaults,c),d.options.timeFormat||(d.options.timeFormat="mm:ss",d.options.alwaysShowHours&&(d.options.timeFormat="hh:mm:ss"),d.options.showTimecodeFrameCount&&(d.options.timeFormat+=":ff")),mejs.Utility.calculateTimeFormat(0,d.options,d.options.framesPerSecond||25),d.id="mep_"+mejs.mepIndex++,mejs.players[d.id]=d,d.init(),d):void 0},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var b=this,c=mejs.MediaFeatures,d=a.extend(!0,{},b.options,{success:function(a,c){b.meReady(a,c)},error:function(a){b.handleError(a)}}),e=b.media.tagName.toLowerCase();if(b.isDynamic="audio"!==e&&"video"!==e,b.isDynamic?b.isVideo=b.options.isVideo:b.isVideo="audio"!==e&&b.options.isVideo,c.isiPad&&b.options.iPadUseNativeControls||c.isiPhone&&b.options.iPhoneUseNativeControls)b.$media.attr("controls","controls"),c.isiPad&&null!==b.media.getAttribute("autoplay")&&b.play();else if(c.isAndroid&&b.options.AndroidUseNativeControls);else{b.$media.removeAttr("controls");var f=b.isVideo?mejs.i18n.t("Video Player"):mejs.i18n.t("Audio Player");a(''+f+"").insertBefore(b.$media),b.container=a('
                  ').addClass(b.$media[0].className).insertBefore(b.$media).focus(function(a){if(!b.controlsAreVisible&&!b.hasFocus&&b.controlsEnabled&&(b.showControls(!0),!b.hasMsNativeFullScreen)){var c=b.container.find(".mejs-playpause-button > button");c.focus()}}),"fill"!==b.options.stretching||b.container.parent("mejs-fill-container").length||(b.outerContainer=b.$media.parent(),b.container.wrap('
                  ')),b.container.addClass((c.isAndroid?"mejs-android ":"")+(c.isiOS?"mejs-ios ":"")+(c.isiPad?"mejs-ipad ":"")+(c.isiPhone?"mejs-iphone ":"")+(b.isVideo?"mejs-video ":"mejs-audio ")),b.container.find(".mejs-mediaelement").append(b.$media),b.node.player=b,b.controls=b.container.find(".mejs-controls"),b.layers=b.container.find(".mejs-layers");var g=b.isVideo?"video":"audio",h=g.substring(0,1).toUpperCase()+g.substring(1);b.options[g+"Width"]>0||b.options[g+"Width"].toString().indexOf("%")>-1?b.width=b.options[g+"Width"]:""!==b.media.style.width&&null!==b.media.style.width?b.width=b.media.style.width:null!==b.media.getAttribute("width")?b.width=b.$media.attr("width"):b.width=b.options["default"+h+"Width"],b.options[g+"Height"]>0||b.options[g+"Height"].toString().indexOf("%")>-1?b.height=b.options[g+"Height"]:""!==b.media.style.height&&null!==b.media.style.height?b.height=b.media.style.height:null!==b.$media[0].getAttribute("height")?b.height=b.$media.attr("height"):b.height=b.options["default"+h+"Height"],b.setPlayerSize(b.width,b.height),d.pluginWidth=b.width,d.pluginHeight=b.height}mejs.MediaElement(b.$media[0],d),"undefined"!=typeof b.container&&b.controlsAreVisible&&b.container.trigger("controlsshown")},showControls:function(a){var b=this;a="undefined"==typeof a||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(b){var c=this;b="undefined"==typeof b||b,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||c.media.paused||c.media.ended||(b?(c.controls.stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:b.options.controlsTimeoutDefault,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(b,c){var d,e,f=this,g=mejs.MediaFeatures,h=c.getAttribute("autoplay"),i=!("undefined"==typeof h||null===h||"false"===h);if(!f.created){if(f.created=!0,f.media=b,f.domNode=c,!(g.isAndroid&&f.options.AndroidUseNativeControls||g.isiPad&&f.options.iPadUseNativeControls||g.isiPhone&&f.options.iPhoneUseNativeControls)){f.buildposter(f,f.controls,f.layers,f.media),f.buildkeyboard(f,f.controls,f.layers,f.media),f.buildoverlays(f,f.controls,f.layers,f.media),f.findTracks();for(d in f.options.features)if(e=f.options.features[d],f["build"+e])try{f["build"+e](f,f.controls,f.layers,f.media)}catch(j){}f.container.trigger("controlsready"),f.setPlayerSize(f.width,f.height),f.setControlsSize(),f.isVideo&&(mejs.MediaFeatures.hasTouch&&!f.options.alwaysShowControls?f.$media.bind("touchstart",function(){f.controlsAreVisible?f.hideControls(!1):f.controlsEnabled&&f.showControls(!1)}):(f.clickToPlayPauseCallback=function(){if(f.options.clickToPlayPause){f.media.paused?f.play():f.pause();var a=f.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");a.attr("aria-pressed",!b)}},f.media.addEventListener("click",f.clickToPlayPauseCallback,!1),f.container.bind("mouseenter",function(){f.controlsEnabled&&(f.options.alwaysShowControls||(f.killControlsTimer("enter"),f.showControls(),f.startControlsTimer(f.options.controlsTimeoutMouseEnter)))}).bind("mousemove",function(){f.controlsEnabled&&(f.controlsAreVisible||f.showControls(),f.options.alwaysShowControls||f.startControlsTimer(f.options.controlsTimeoutMouseEnter))}).bind("mouseleave",function(){f.controlsEnabled&&(f.media.paused||f.options.alwaysShowControls||f.startControlsTimer(f.options.controlsTimeoutMouseLeave))})),f.options.hideVideoControlsOnLoad&&f.hideControls(!1),i&&!f.options.alwaysShowControls&&f.hideControls(),f.options.enableAutosize&&f.media.addEventListener("loadedmetadata",function(a){f.options.videoHeight<=0&&null===f.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(f.setPlayerSize(a.target.videoWidth,a.target.videoHeight),f.setControlsSize(),f.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1)),f.media.addEventListener("play",function(){var a;for(a in mejs.players){var b=mejs.players[a];b.id==f.id||!f.options.pauseOtherPlayers||b.paused||b.ended||b.pause(),b.hasFocus=!1}f.hasFocus=!0},!1),f.media.addEventListener("ended",function(b){if(f.options.autoRewind)try{f.media.setCurrentTime(0),window.setTimeout(function(){a(f.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}f.media.pause(),f.setProgressRail&&f.setProgressRail(),f.setCurrentRail&&f.setCurrentRail(),f.options.loop?f.play():!f.options.alwaysShowControls&&f.controlsEnabled&&f.showControls()},!1),f.media.addEventListener("loadedmetadata",function(){mejs.Utility.calculateTimeFormat(f.duration,f.options,f.options.framesPerSecond||25),f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.isFullScreen||(f.setPlayerSize(f.width,f.height),f.setControlsSize())},!1);var k=null;f.media.addEventListener("timeupdate",function(){k!==this.duration&&(k=this.duration,mejs.Utility.calculateTimeFormat(k,f.options,f.options.framesPerSecond||25),f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.setControlsSize())},!1),f.container.focusout(function(b){if(b.relatedTarget){var c=a(b.relatedTarget);f.keyboardAction&&0===c.parents(".mejs-container").length&&(f.keyboardAction=!1,f.isVideo&&!f.options.alwaysShowControls&&f.hideControls(!0))}}),setTimeout(function(){f.setPlayerSize(f.width,f.height),f.setControlsSize()},50),f.globalBind("resize",function(){f.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||f.setPlayerSize(f.width,f.height),f.setControlsSize()}),"youtube"==f.media.pluginType&&(g.isiOS||g.isAndroid)&&(f.container.find(".mejs-overlay-play").hide(),f.container.find(".mejs-poster").hide())}i&&"native"==b.pluginType&&f.play(),f.options.success&&("string"==typeof f.options.success?window[f.options.success](f.media,f.domNode,f):f.options.success(f.media,f.domNode,f))}},handleError:function(a){var b=this;b.controls&&b.controls.hide(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,b){var c=this;if(!c.options.setDimensions)return!1;switch("undefined"!=typeof a&&(c.width=a),"undefined"!=typeof b&&(c.height=b),c.options.stretching){case"fill":c.isVideo?this.setFillMode():this.setDimensions(c.width,c.height);break;case"responsive":this.setResponsiveMode();break;case"none":this.setDimensions(c.width,c.height);break;default:this.hasFluidMode()===!0?this.setResponsiveMode():this.setDimensions(c.width,c.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>0||"none"!==a.$node.css("max-width")&&"t.width"!==a.$node.css("max-width")||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var b=this,c=function(){return b.isVideo?b.media.videoWidth&&b.media.videoWidth>0?b.media.videoWidth:null!==b.media.getAttribute("width")?b.media.getAttribute("width"):b.options.defaultVideoWidth:b.options.defaultAudioWidth}(),d=function(){return b.isVideo?b.media.videoHeight&&b.media.videoHeight>0?b.media.videoHeight:null!==b.media.getAttribute("height")?b.media.getAttribute("height"):b.options.defaultVideoHeight:b.options.defaultAudioHeight}(),e=b.container.parent().closest(":visible").width(),f=b.container.parent().closest(":visible").height(),g=b.isVideo||!b.options.autosizeProgress?parseInt(e*d/c,10):d;(isNaN(g)||0!==f&&g>f&&f>d)&&(g=f),b.container.parent().length>0&&"body"===b.container.parent()[0].tagName.toLowerCase()&&(e=a(window).width(),g=a(window).height()),g&&e&&(b.container.width(e).height(g),b.$media.add(b.container.find(".mejs-shim")).width("100%").height("100%"),b.isVideo&&b.media.setVideoSize&&b.media.setVideoSize(e,g),b.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=!(i>c),l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setVideoSize&&a.media.setVideoSize(c,m)):(targetElement.height(d).width(l),a.media.setVideoSize&&a.media.setVideoSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var b=this,c=0,d=0,e=b.controls.find(".mejs-time-rail"),f=b.controls.find(".mejs-time-total"),g=e.siblings(),h=g.last(),i=null;if(b.container.is(":visible")&&e.length&&e.is(":visible")){b.options&&!b.options.autosizeProgress&&(d=parseInt(e.css("width"),10)),0!==d&&d||(g.each(function(){var b=a(this);"absolute"!=b.css("position")&&b.is(":visible")&&(c+=a(this).outerWidth(!0))}),d=b.controls.width()-c-(e.outerWidth(!0)-e.width()));do e.width(d),f.width(d-(f.outerWidth(!0)-f.width())),"absolute"!=h.css("position")&&(i=h.length?h.position():null,d--);while(null!==i&&i.top.toFixed(2)>0&&d>0);b.container.trigger("controlsresize")}},buildposter:function(b,c,d,e){var f=this,g=a('
                  ').appendTo(d),h=b.$media.attr("poster");""!==b.options.poster&&(h=b.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),b.options.showPosterWhenEnded&&b.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(b){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=a('').appendTo(d)),e.attr("src",b),d.css({"background-image":"url("+b+")"})},buildoverlays:function(b,c,d,e){var f=this;if(b.isVideo){var g=a('
                  ').hide().appendTo(d),h=a('
                  ').hide().appendTo(d),i=a('
                  ').appendTo(d).bind("click",function(){if(f.options.clickToPlayPause){e.paused&&e.play();var b=a(this).find(".mejs-overlay-button"),c=b.attr("aria-pressed");b.attr("aria-pressed",!!c)}});e.addEventListener("play",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("playing",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("seeking",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("seeked",function(){g.hide(),c.find(".mejs-time-buffering").hide()},!1),e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||i.show()},!1),e.addEventListener("waiting",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("loadeddata",function(){g.show(),c.find(".mejs-time-buffering").show(),mejs.MediaFeatures.isAndroid&&(e.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),e.dispatchEvent(a)}},300))},!1),e.addEventListener("canplay",function(){g.hide(),c.find(".mejs-time-buffering").hide(),clearTimeout(e.canplayTimeout)},!1),e.addEventListener("error",function(a){f.handleError(a),g.hide(),i.hide(),h.show(),h.find(".mejs-overlay-error").html("Error loading this resource")},!1),e.addEventListener("keydown",function(a){f.onkeydown(b,e,a)},!1)}},buildkeyboard:function(b,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return b.hasFocus=0!==a(c.target).closest(".mejs-container").length&&a(c.target).closest(".mejs-container").attr("id")===b.$media.closest(".mejs-container").attr("id"),f.onkeydown(b,e,c)}),f.globalBind("click",function(c){b.hasFocus=0!==a(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode==f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var b=this,c=b.$media.find("track");b.tracks=[],c.each(function(c,d){d=a(d),b.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){this.container[0].className="mejs-container "+a,this.setPlayerSize(this.width,this.height),this.setControlsSize()},play:function(){this.load(),this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||this.media.load(),this.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){var b=this;if("youtube"===b.media.pluginType){var c;if("string"!=typeof a){var d,e;for(d=0;d
                  ').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),j=i.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:"Stop"}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this;a('
                  ').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{enableProgressTooltip:!0,progressHelpText:mejs.i18n.t("Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.")}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){var f=this,g=!1,h=!1,i=0,j=!1,k=b.options.autoRewind,l=b.options.enableProgressTooltip?'00:00':"";a('
                  '+l+"
                  ").appendTo(c),c.find(".mejs-time-buffering").hide(),f.total=c.find(".mejs-time-total"),f.loaded=c.find(".mejs-time-loaded"),f.current=c.find(".mejs-time-current"),f.handle=c.find(".mejs-time-handle"),f.timefloat=c.find(".mejs-time-float"),f.timefloatcurrent=c.find(".mejs-time-float-current"),f.slider=c.find(".mejs-time-slider");var m=function(a){var c,d=f.total.offset(),h=f.total.width(),i=0,j=0,k=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(ch+d.left&&(c=h+d.left),k=c-d.left,i=k/h,j=.02>=i?0:i*e.duration,g&&j!==e.currentTime&&e.setCurrentTime(j),mejs.MediaFeatures.hasTouch||(f.timefloat.css("left",k),f.timefloatcurrent.html(mejs.Utility.secondsToTimeCode(j,b.options)),f.timefloat.show()))},n=function(a){var c=e.currentTime,d=mejs.i18n.t("Time Slider"),g=mejs.Utility.secondsToTimeCode(c,b.options),h=e.duration;f.slider.attr({"aria-label":d,"aria-valuemin":0,"aria-valuemax":h,"aria-valuenow":c,"aria-valuetext":g,role:"slider",tabindex:0})},o=function(){var a=new Date;a-i>=1e3&&e.play()};f.slider.bind("focus",function(a){b.options.autoRewind=!1}),f.slider.bind("blur",function(a){b.options.autoRewind=k}),f.slider.bind("keydown",function(a){new Date-i>=1e3&&(j=e.paused);var c=a.keyCode,d=e.duration,f=e.currentTime,g=b.options.defaultSeekForwardInterval(e),h=b.options.defaultSeekBackwardInterval(e);switch(c){case 37:case 40:f-=h;break;case 39:case 38:f+=g;break;case 36:f=0;break;case 35:f=d;break;case 32:case 13:return void(e.paused?e.play():e.pause());default:return}return f=0>f?0:f>=d?d:Math.floor(f),i=new Date,j||e.pause(),f0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(b.total.width()*d))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);a.current.width(b),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
                  '+mejs.Utility.secondsToTimeCode(0,b.options)+"
                  ").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
                  '+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"
                  ").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options))},updateDuration:function(){var a=this,b=a.media.duration;a.options.duration>0&&(b=a.options.duration),isNaN(b)&&(b=0),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),allyVolumeControlText:mejs.i18n.t("Use Up/Down Arrow keys to increase or decrease volume."),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"==g?a('
                  '+f.options.allyVolumeControlText+'
                  ').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){if(!i.is(":visible")&&"undefined"==typeof b)return i.show(),m(a,!0),void i.hide();a=Math.max(0,a),a=Math.min(a,1),0===a?(h.removeClass("mejs-mute").addClass("mejs-unmute"),h.children("button").attr("title",mejs.i18n.t("Unmute")).attr("aria-label",mejs.i18n.t("Unmute"))):(h.removeClass("mejs-unmute").addClass("mejs-mute"),h.children("button").attr("title",mejs.i18n.t("Mute")).attr("aria-label",mejs.i18n.t("Mute")));var c=j.position();if("vertical"==g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!=g||i.hide()});var q=function(a){var b=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("Volume Slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":b,"aria-valuetext":b+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!=g||i.hide()}),o=!0,!1}).bind("keydown",function(a){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1); +break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").bind("focus",function(){i.show()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0),"native"===e.pluginType&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,fullscreenMode:"",buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("loadstart",function(){b.detectFullscreenMode()});var f=this,g=null,h=a('
                  ').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"==f.fullscreenMode){null!==g&&(clearTimeout(g),delete g);var a=h.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0)}}).on("mouseout",function(){"plugin-hover"==f.fullscreenMode&&(null!==g&&(clearTimeout(g),delete g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=h,f.globalBind("keydown",function(a){27==a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var i=function(a){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,i)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures;return c.hasTrueNativeFullScreen&&"native"===a.media.pluginType?b="native-native":c.hasTrueNativeFullScreen&&"native"!==a.media.pluginType&&!c.hasFirefoxPluginMovingProblem?b="plugin-native":a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow",a.fullscreenMode=b,b},isPluginClickThroughCreated:!1,createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('
                  ').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageYc.top+fullscreenBtn.outerHeight(!0)||a.pageXc.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var b=this;return mejs.MediaFeatures.isiOS&&mejs.MediaFeatures.hasiOSFullScreen&&"function"==typeof b.media.webkitEnterFullscreen?void b.media.webkitEnterFullscreen():(a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function c(){if(b.isNativeFullScreen){var d=.002,e=a(window).width(),f=screen.width,g=Math.abs(f-e),h=f*d;g>h?b.exitFullScreen():setTimeout(c,500)}},1e3)):"fullwindow"==b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),"native"===b.media.pluginType?b.$media.width("100%").height("100%"):(b.container.find(".mejs-shim").width("100%").height("100%"),setTimeout(function(){var c=a(window),d=c.width(),e=c.height();b.media.setVideoSize(d,e)},500)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0,b.container.find(".mejs-captions-text").css("font-size",screen.width/b.width*1*100+"%"),b.container.find(".mejs-captions-position").css("bottom","45px"),void b.container.trigger("enteredfullscreen"))},exitFullScreen:function(){var b=this;clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen").width(b.normalWidth).height(b.normalHeight),"native"===b.media.pluginType?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find(".mejs-shim").width(b.normalWidth).height(b.normalHeight),b.media.setVideoSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this;if("native"==f.media.pluginType){for(var g=null,h=null,i=null,j=null,k=[],l=!1,m=0,n=f.options.speeds.length;n>m;m++){var o=f.options.speeds[m];"string"==typeof o?(k.push({name:o+f.options.speedChar,value:o}),o===f.options.defaultSpeed&&(l=!0)):(k.push(o),o.value===f.options.defaultSpeed&&(l=!0))}l||k.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),k.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var p=function(a){for(m=0,n=k.length;n>m;m++)if(k[m].value===a)return k[m].name},q='
                    ';for(m=0,il=k.length;m";q+="
                  ",g=a(q).appendTo(c),h=g.find(".mejs-speed-selector"),i=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){i&&(e.playbackRate=parseFloat(i))},!0),h.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");i=b,e.playbackRate=parseFloat(b),g.find("button").html(p(b)),g.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),g.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),g.one("mouseenter focusin",function(){h.height(g.find(".mejs-speed-selector ul").outerHeight(!0)+g.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*h.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,cleartracks:function(a,b,c,d){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g,h=this,i=h.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"";if(h.domNode.textTracks)for(f=h.domNode.textTracks.length-1;f>=0;f--)h.domNode.textTracks[f].mode="hidden";h.cleartracks(b,c,d,e),b.chapters=a('
                  ').prependTo(d).hide(),b.captions=a('
                  ').prependTo(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('
                  ").appendTo(c);var j=0;for(f=0;f0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage==b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('
                • ")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(var c=0;c=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];"undefined"==typeof e||"undefined"==typeof e.fadeIn?c.slides.entries.imgs[b]=e=a('').on("load",function(){e.appendTo(c.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):e.is(":visible")||e.is(":animated")||e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if("undefined"!=typeof this.slides){var a,b=this,c=b.slides;for(a=0;a=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;a100||c==b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('
                  '+b.entries.text[c]+''+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options)+"
                  ")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(this).attr("rel"))),e.media.paused&&e.media.play()}),e.chapters.show()}}),mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}},mejs.TrackFormatParser={webvtt:{pattern_timecode:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f$1"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e$1"),i.text.push(d)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c
                  ').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer(),a.contextMenuTimer=setTimeout(function(){a.hideContextMenu(),a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;null!=a&&(clearTimeout(a),delete a,a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='
                  ';else{var i=f[g].render(d);null!=i&&(e+='
                  '+i+"
                  ")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:mejs.i18n.t("Skip back %1 seconds")}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=f.options.skipBackText.replace("%1",f.options.skipBackInterval);a('
                  ").appendTo(c).click(function(){e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur()})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof g&&(b.postroll=a('').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:g,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$); \ No newline at end of file diff --git a/media/media/js/mediafield.js b/media/media/js/mediafield.js index a0b9a55eeb9d8..92cdab5ef21a8 100644 --- a/media/media/js/mediafield.js +++ b/media/media/js/mediafield.js @@ -94,20 +94,36 @@ return; } - // Reset tooltip and preview - this.$containerPreview.popover('destroy'); - this.$input.tooltip('destroy'); + if (this.options.preview && !this.options.previewAsTooltip) { + var value = this.$input.val(); + + if (!value) { + this.$containerPreview.append(''); + } else { + var imgPreview = new Image(); + imgPreview.src = this.options.basepath + value; + if (imgPreview.width > imgPreview.height) { + this.$containerPreview.html($('',{src: imgPreview.src, style: 'width: ' + this.options.previewWidth + 'px'})); + } else { + this.$containerPreview.html($('',{src: imgPreview.src, style: 'height: ' + this.options.previewHeight + 'px'})); + } + } + } else { + // Reset tooltip and preview + this.$containerPreview.popover('destroy'); + this.$input.tooltip('destroy'); - var value = this.$input.val(); + var value = this.$input.val(); - if (!value) { - this.$containerPreview.popover(); - } else { - var imgPreview = new Image(this.options.previewWidth, this.options.previewHeight); - imgPreview.src = this.options.basepath + value; + if (!value) { + this.$containerPreview.popover(); + } else { + var imgPreview = new Image(this.options.previewWidth, this.options.previewHeight); + imgPreview.src = this.options.basepath + value; - this.$containerPreview.popover({content: imgPreview}); - this.$input.tooltip({placement: 'top', title: value}); + this.$containerPreview.popover({content: imgPreview}); + this.$input.tooltip({placement: 'top', title: value}); + } } }; @@ -119,13 +135,14 @@ buttonSaveSelected: '.button-save-selected', // selector for button to save the selected value input: '.field-media-input', // selector for the input preview: true, // whether use the preview + previewAsTooltip: true, // whether use the preview previewContainer: '.field-media-preview', // selector for the preview container previewWidth: 200, // preview width previewHeight: 200, // preview height url: 'index.php?option=com_media&tmpl=component', // url for load the iframe modal: '.modal', // modal selector modalWidth: '100%', // modal width - modalHeight: '300px' // modal height + modalHeight: '300px', // modal height }; $.fn.fieldMedia = function(options){ @@ -133,7 +150,7 @@ var $el = $(this), instance = $el.data('fieldMedia'); if(!instance){ var options = options || {}, - data = $el.data(); + data = $el.data(); // Check options in the element for (var p in data) { @@ -154,3 +171,68 @@ }); })(jQuery); + +// Compatibility with mootools modal layout +function jInsertFieldValue(value, id) { + var $ = jQuery.noConflict(); + var old_value = $("#" + id).val(); + if (old_value != value) { + var $elem = $("#" + id); + $elem.val(value); + $elem.trigger("change"); + if (typeof($elem.get(0).onchange) === "function") { + $elem.get(0).onchange(); + } + jMediaRefreshPreview(id); + } +} + +function jMediaRefreshPreview(id) { + var $ = jQuery.noConflict(); + var value = $("#" + id).val(); + var $img = $("#" + id + "_preview"); + var basepath = $("#" + id).data("basepath"); + + if ($img.length) { + if (value) { + $img.attr("src", basepath + value); + $("#" + id + "_preview_empty").hide(); + $("#" + id + "_preview_img").show() + } else { + $img.attr("src", ""); + $("#" + id + "_preview_empty").show(); + $("#" + id + "_preview_img").hide(); + } + } +} + +function jMediaRefreshPreviewTip(tip) +{ + var $ = jQuery.noConflict(); + var $tip = $(tip); + var $img = $tip.find("img.media-preview"); + + $img.each(function(index, value) { + $tip.find("div.tip").css("max-width", "none"); + var id = $(this).attr("id"); + id = id.substring(0, id.length - "_preview".length); + jMediaRefreshPreview(id); + $tip.show(this); + }); +} + +// JQuery for tooltip for INPUT showing whole image path +function jMediaRefreshImgpathTip(tip, els) +{ + var $ = jQuery.noConflict(); + var $tip = $(tip); + $tip.css("max-width", "none"); + var $imgpath = $(els).val(); + $("#TipImgpath").html($imgpath); + + if ($imgpath.length) { + $tip.show(); + } else { + $tip.hide(); + } +} diff --git a/media/media/js/mediafield.min.js b/media/media/js/mediafield.min.js index 8a60e3a260e94..08bcd26aecd4c 100644 --- a/media/media/js/mediafield.min.js +++ b/media/media/js/mediafield.min.js @@ -1 +1 @@ -!function(t){"use strict";t.fieldMedia=function(i,e){this.options=t.extend({},t.fieldMedia.defaults,e),this.$container=t(i),this.$modal=this.$container.find(this.options.modal),this.$modalBody=this.$modal.children(".modal-body"),this.$input=this.$container.find(this.options.input),this.$containerPreview=this.$container.find(this.options.previewContainer),this.$buttonSelect=this.$container.find(this.options.buttonSelect),this.$buttonClear=this.$container.find(this.options.buttonClear),this.$buttonSelect.on("click",this.modalOpen.bind(this)),this.$buttonClear.on("click",this.clearValue.bind(this)),this.$modal.on("hide",this.removeIframe.bind(this)),this.updatePreview()},t.fieldMedia.prototype.modalOpen=function(){var i=t("\n'},d(function(){d("."+ib+':not([data-auto="false"])').fotorama()})}(window,document,location,"undefined"!=typeof jQuery&&jQuery); \ No newline at end of file diff --git a/media/plg_quickicon_extensionupdate/js/extensionupdatecheck.js b/media/plg_quickicon_extensionupdate/js/extensionupdatecheck.js index e86ed0f026d77..47bec7fffb957 100644 --- a/media/plg_quickicon_extensionupdate/js/extensionupdatecheck.js +++ b/media/plg_quickicon_extensionupdate/js/extensionupdatecheck.js @@ -11,7 +11,7 @@ jQuery(document).ready(function() { try { var updateInfoList = jQuery.parseJSON(data); } catch (e) { - // An error occured + // An error occurred link.html(plg_quickicon_extensionupdate_text.ERROR); } @@ -32,12 +32,12 @@ jQuery(document).ready(function() { link.html(updateString); } } else { - // An error occured + // An error occurred link.html(plg_quickicon_extensionupdate_text.ERROR); } }, error: function(jqXHR, textStatus, errorThrown) { - // An error occured + // An error occurred jQuery('#plg_quickicon_extensionupdate').find('span.j-links-link').html(plg_quickicon_extensionupdate_text.ERROR); }, url: plg_quickicon_extensionupdate_ajax_url + '&eid=0&skip=700' diff --git a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js index b4535f9532943..8626873df041c 100644 --- a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js +++ b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js @@ -13,7 +13,7 @@ jQuery(document).ready(function() { try { var updateInfoList = jQuery.parseJSON(data); } catch (e) { - // An error occured + // An error occurred link.html(plg_quickicon_joomlaupdate_text.ERROR); } @@ -39,12 +39,12 @@ jQuery(document).ready(function() { } } } else { - // An error occured + // An error occurred link.html(plg_quickicon_joomlaupdate_text.ERROR); } }, error: function(jqXHR, textStatus, errorThrown) { - // An error occured + // An error occurred jQuery('#plg_quickicon_joomlaupdate').find('span.j-links-link').html(plg_quickicon_joomlaupdate_text.ERROR); }, url: plg_quickicon_joomlaupdate_ajax_url + '&eid=700&cache_timeout=3600' diff --git a/media/system/css/jquery.Jcrop.min.css b/media/system/css/jquery.Jcrop.min.css index edc76b2b3f435..40c7966d31dfc 100644 --- a/media/system/css/jquery.Jcrop.min.css +++ b/media/system/css/jquery.Jcrop.min.css @@ -1,29 +1,6 @@ -/* jquery.Jcrop.min.css v0.9.12 (build:20130126) */ -.jcrop-holder{direction:ltr;text-align:left;} -.jcrop-vline,.jcrop-hline{background:#FFF url(Jcrop.gif);font-size:0;position:absolute;} -.jcrop-vline{height:100%;width:1px!important;} -.jcrop-vline.right{right:0;} -.jcrop-hline{height:1px!important;width:100%;} -.jcrop-hline.bottom{bottom:0;} -.jcrop-tracker{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;height:100%;width:100%;} -.jcrop-handle{background-color:#333;border:1px #EEE solid;font-size:1px;height:7px;width:7px;} -.jcrop-handle.ord-n{left:50%;margin-left:-4px;margin-top:-4px;top:0;} -.jcrop-handle.ord-s{bottom:0;left:50%;margin-bottom:-4px;margin-left:-4px;} -.jcrop-handle.ord-e{margin-right:-4px;margin-top:-4px;right:0;top:50%;} -.jcrop-handle.ord-w{left:0;margin-left:-4px;margin-top:-4px;top:50%;} -.jcrop-handle.ord-nw{left:0;margin-left:-4px;margin-top:-4px;top:0;} -.jcrop-handle.ord-ne{margin-right:-4px;margin-top:-4px;right:0;top:0;} -.jcrop-handle.ord-se{bottom:0;margin-bottom:-4px;margin-right:-4px;right:0;} -.jcrop-handle.ord-sw{bottom:0;left:0;margin-bottom:-4px;margin-left:-4px;} -.jcrop-dragbar.ord-n,.jcrop-dragbar.ord-s{height:7px;width:100%;} -.jcrop-dragbar.ord-e,.jcrop-dragbar.ord-w{height:100%;width:7px;} -.jcrop-dragbar.ord-n{margin-top:-4px;} -.jcrop-dragbar.ord-s{bottom:0;margin-bottom:-4px;} -.jcrop-dragbar.ord-e{margin-right:-4px;right:0;} -.jcrop-dragbar.ord-w{margin-left:-4px;} -.jcrop-light .jcrop-vline,.jcrop-light .jcrop-hline{background:#FFF;filter:alpha(opacity=70)!important;opacity:.70!important;} -.jcrop-light .jcrop-handle{-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#000;border-color:#FFF;border-radius:3px;} -.jcrop-dark .jcrop-vline,.jcrop-dark .jcrop-hline{background:#000;filter:alpha(opacity=70)!important;opacity:.7!important;} -.jcrop-dark .jcrop-handle{-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#FFF;border-color:#000;border-radius:3px;} -.solid-line .jcrop-vline,.solid-line .jcrop-hline{background:#FFF;} -.jcrop-holder img,img.jcrop-preview{max-width:none;} +/*! Jcrop.min.css v2.0.4 - build: 20151117 + * Copyright 2008-2015 Tapmodo Interactive LLC + * Free software under MIT License + **/ + +.jcrop-active{direction:ltr;text-align:left;box-sizing:border-box;-ms-touch-action:none}.jcrop-dragging{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.jcrop-selection{z-index:2}.jcrop-selection.jcrop-current{z-index:4}.jcrop-border{background:#fff url(Jcrop.gif);line-height:1px!important;font-size:0!important;overflow:hidden;position:absolute;filter:alpha(opacity=50)!important;opacity:.5!important}.jcrop-border.ord-w,.jcrop-border.ord-e,.jcrop-border.ord-n{top:0}.jcrop-border.ord-n,.jcrop-border.ord-s{width:100%;height:1px!important}.jcrop-border.ord-w,.jcrop-border.ord-e{height:100%;width:1px!important}.jcrop-border.ord-e{right:-1px}.jcrop-border.ord-n{top:-1px}.jcrop-border.ord-w{left:-1px}.jcrop-border.ord-s{bottom:-1px}.jcrop-selection{position:absolute}.jcrop-box{z-index:2;display:block;background:0 0;border:0;padding:0;margin:0;font-size:0}.jcrop-box:hover{background:0 0}.jcrop-box:active{background:0 0}.jcrop-box:focus{outline:1px rgba(128,128,128,.65) dotted}.jcrop-active,.jcrop-box{position:relative}.jcrop-box{width:100%;height:100%;cursor:move}.jcrop-handle{z-index:4;background-color:rgba(49,28,28,.58);border:1px #eee solid;width:9px;height:9px;font-size:0;position:absolute;filter:alpha(opacity=80)!important;opacity:.8!important}.jcrop-handle.ord-n{left:50%;margin-left:-5px;margin-top:-5px;top:0;cursor:n-resize}.jcrop-handle.ord-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px;cursor:s-resize}.jcrop-handle.ord-e{margin-right:-5px;margin-top:-5px;right:0;top:50%;cursor:e-resize}.jcrop-handle.ord-w{left:0;margin-left:-5px;margin-top:-5px;top:50%;cursor:w-resize}.jcrop-handle.ord-nw{left:0;margin-left:-5px;margin-top:-5px;top:0;cursor:nw-resize}.jcrop-handle.ord-ne{margin-right:-5px;margin-top:-5px;right:0;top:0;cursor:ne-resize}.jcrop-handle.ord-se{bottom:0;margin-bottom:-5px;margin-right:-5px;right:0;cursor:se-resize}.jcrop-handle.ord-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px;cursor:sw-resize}.jcrop-touch .jcrop-handle{z-index:4;background-color:rgba(49,28,28,.58);border:1px #eee solid;width:18px;height:18px;font-size:0;position:absolute;filter:alpha(opacity=80)!important;opacity:.8!important}.jcrop-touch .jcrop-handle.ord-n{left:50%;margin-left:-10px;margin-top:-10px;top:0;cursor:n-resize}.jcrop-touch .jcrop-handle.ord-s{bottom:0;left:50%;margin-bottom:-10px;margin-left:-10px;cursor:s-resize}.jcrop-touch .jcrop-handle.ord-e{margin-right:-10px;margin-top:-10px;right:0;top:50%;cursor:e-resize}.jcrop-touch .jcrop-handle.ord-w{left:0;margin-left:-10px;margin-top:-10px;top:50%;cursor:w-resize}.jcrop-touch .jcrop-handle.ord-nw{left:0;margin-left:-10px;margin-top:-10px;top:0;cursor:nw-resize}.jcrop-touch .jcrop-handle.ord-ne{margin-right:-10px;margin-top:-10px;right:0;top:0;cursor:ne-resize}.jcrop-touch .jcrop-handle.ord-se{bottom:0;margin-bottom:-10px;margin-right:-10px;right:0;cursor:se-resize}.jcrop-touch .jcrop-handle.ord-sw{bottom:0;left:0;margin-bottom:-10px;margin-left:-10px;cursor:sw-resize}.jcrop-dragbar{font-size:0;position:absolute}.jcrop-dragbar.ord-n,.jcrop-dragbar.ord-s{height:9px!important;width:100%}.jcrop-dragbar.ord-e,.jcrop-dragbar.ord-w{top:0;height:100%;width:9px!important}.jcrop-dragbar.ord-n{margin-top:-5px;cursor:n-resize;top:0}.jcrop-dragbar.ord-s{bottom:0;margin-bottom:-5px;cursor:s-resize}.jcrop-dragbar.ord-e{margin-right:-5px;right:0;cursor:e-resize}.jcrop-dragbar.ord-w{margin-left:-5px;cursor:w-resize}.jcrop-shades{position:relative;top:0;left:0}.jcrop-shades div{cursor:crosshair}.jcrop-noresize .jcrop-dragbar,.jcrop-noresize .jcrop-handle{display:none}.jcrop-selection.jcrop-nodrag .jcrop-box,.jcrop-nodrag .jcrop-shades div{cursor:default}.jcrop-light .jcrop-border{background:#fff;filter:alpha(opacity=70)!important;opacity:.7!important}.jcrop-light .jcrop-handle{background-color:#000;border-color:#fff}.jcrop-dark .jcrop-border{background:#000;filter:alpha(opacity=70)!important;opacity:.7!important}.jcrop-dark .jcrop-handle{background-color:#fff;border-color:#000}.solid-line .jcrop-border{background:#fff}.jcrop-thumb{position:absolute;overflow:hidden;z-index:5}.jcrop-active img,.jcrop-thumb img,.jcrop-thumb canvas{min-width:none;min-height:none;max-width:none;max-height:none}.jcrop-hl-active .jcrop-border{filter:alpha(opacity=20)!important;opacity:.2!important}.jcrop-hl-active .jcrop-handle{filter:alpha(opacity=10)!important;opacity:.1!important}.jcrop-hl-active .jcrop-selection:hover{}.jcrop-hl-active .jcrop-selection:hover .jcrop-border{background-color:#ccc;filter:alpha(opacity=50)!important;opacity:.5!important}.jcrop-hl-active .jcrop-selection.jcrop-current .jcrop-border{background:gray url(Jcrop.gif);opacity:.35!important;filter:alpha(opacity=35)!important}.jcrop-hl-active .jcrop-selection.jcrop-current .jcrop-handle{filter:alpha(opacity=30)!important;opacity:.3!important}.jcrop-hl-active .jcrop-selection.jcrop-focus .jcrop-border{background:url(Jcrop.gif);opacity:.65!important;filter:alpha(opacity=65)!important}.jcrop-hl-active .jcrop-selection.jcrop-focus .jcrop-handle{filter:alpha(opacity=60)!important;opacity:.6!important}button.jcrop-box{background:0 0} \ No newline at end of file diff --git a/media/system/css/modal.css b/media/system/css/modal.css index ea893dfee18f3..6959040ed7eac 100644 --- a/media/system/css/modal.css +++ b/media/system/css/modal.css @@ -13,7 +13,7 @@ */ #sbox-overlay { - position: absolute; + position: fixed; background-color: #000; left: 0px; top: 0px; diff --git a/media/system/js/associations-edit-uncompressed.js b/media/system/js/associations-edit-uncompressed.js new file mode 100644 index 0000000000000..683f89470151e --- /dev/null +++ b/media/system/js/associations-edit-uncompressed.js @@ -0,0 +1,97 @@ +/** + * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/** + * Edit Associations javascript behavior + * + * Used for editing associations in the backend. + * + * @package Joomla + * @since __DEPLOY_VERSION__ + */ + +window.hideAssociation = function(formControl, languageCode) +{ + jQuery('#associations .control-group').each(function() + { + // Current selected language. Hide it. + if (jQuery(this).find('.control-label label').attr('for').replace('_id', '') == formControl + '_associations_' + languageCode.replace('-', '_')) + { + jQuery(this).hide(); + } + }); +} + +window.showAssociationMessage = function() +{ + jQuery('#associations .control-group').hide(); + jQuery('#associations').prepend('
                  ' + Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE') + '
                  '); +} + +!(function() +{ + jQuery(document).ready(function($) + { + var associationsEditOptions = Joomla.getOptions('system.associations.edit'), formControl = associationsEditOptions.formControl || 'jform'; + + // Hide the associations tab if needed. + if (associationsEditOptions.hidden == 1) + { + window.showAssociationMessage(); + } + // Hide only the associations for the current language. + else + { + window.hideAssociation(formControl, $('#' + formControl + '_language').val()); + } + + // When changing the language. + $('#' + formControl + '_language').on('change', function(event) + { + // Remove message if any. + Joomla.removeMessages(); + $('#associations-notice').remove(); + + var existsAssociations = false; + + // For each language, remove the associations, ie, empty the associations fields and reset the buttons to Select/Create. + $('#associations .control-group').each(function() + { + var languageCode = $(this).find('.control-label label').attr('for').replace('_id', '').replace('jform_associations_', ''); + + // Show the association fields. + $(this).show(); + + // Check if there was an association selected for this language. + if (!existsAssociations && $('#' + formControl + '_associations_' + languageCode + '_id').val() !== '') + { + existsAssociations = true; + } + + // Call the modal clear button. + $('#' + formControl + '_associations_' + languageCode + '_clear').click(); + }); + + // If associations existed, send a warning to the user. + if (existsAssociations) + { + Joomla.renderMessages({warning: [Joomla.JText._('JGLOBAL_ASSOCIATIONS_RESET_WARNING')]}); + } + + var selectedLanguage = $(this).val(); + + // If the selected language is All hide the fields and add a message. + if (selectedLanguage == '*') + { + window.showAssociationMessage(); + } + // Else show the associations fields/buttons and hide the current selected language. + else + { + window.hideAssociation(formControl, selectedLanguage); + } + }); + }); +})(window, document, Joomla); diff --git a/media/system/js/associations-edit.js b/media/system/js/associations-edit.js new file mode 100644 index 0000000000000..ea17b04783700 --- /dev/null +++ b/media/system/js/associations-edit.js @@ -0,0 +1 @@ +window.hideAssociation=function(o,i){jQuery("#associations .control-group").each(function(){jQuery(this).find(".control-label label").attr("for").replace("_id","")==o+"_associations_"+i.replace("-","_")&&jQuery(this).hide()})},window.showAssociationMessage=function(){jQuery("#associations .control-group").hide(),jQuery("#associations").prepend('
                  '+Joomla.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE")+"
                  ")},!function(){jQuery(document).ready(function(o){var i=Joomla.getOptions("system.associations.edit"),s=i.formControl||"jform";1==i.hidden?window.showAssociationMessage():window.hideAssociation(s,o("#"+s+"_language").val()),o("#"+s+"_language").on("change",function(){Joomla.removeMessages(),o("#associations-notice").remove();var i=!1;o("#associations .control-group").each(function(){var a=o(this).find(".control-label label").attr("for").replace("_id","").replace("jform_associations_","");o(this).show(),i||""===o("#"+s+"_associations_"+a+"_id").val()||(i=!0),o("#"+s+"_associations_"+a+"_clear").click()}),i&&Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});var a=o(this).val();"*"==a?window.showAssociationMessage():window.hideAssociation(s,a)})})}(window,document,Joomla); diff --git a/media/system/js/color-field-adv-init.js b/media/system/js/color-field-adv-init.js new file mode 100644 index 0000000000000..1fc40f1b7d0f7 --- /dev/null +++ b/media/system/js/color-field-adv-init.js @@ -0,0 +1,17 @@ +jQuery(document).ready(function ($){ + $('.minicolors').each(function() { + $(this).minicolors({ + control: $(this).attr('data-control') || 'hue', + format: $(this).attr('data-validate') === 'color' + ? 'hex' + : ($(this).attr('data-format') === 'rgba' + ? 'rgb' + : $(this).attr('data-format')) + || 'hex', + keywords: $(this).attr('data-keywords') || '', + opacity: $(this).attr('data-format') === 'rgba' ? true : false || false, + position: $(this).attr('data-position') || 'default', + theme: 'bootstrap' + }); + }); +}); diff --git a/media/system/js/color-field-adv-init.min.js b/media/system/js/color-field-adv-init.min.js new file mode 100644 index 0000000000000..272d2a7c952a8 --- /dev/null +++ b/media/system/js/color-field-adv-init.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(t){t(".minicolors").each(function(){t(this).minicolors({control:t(this).attr("data-control")||"hue",format:"color"===t(this).attr("data-validate")?"hex":("rgba"===t(this).attr("data-format")?"rgb":t(this).attr("data-format"))||"hex",keywords:t(this).attr("data-keywords")||"",opacity:"rgba"===t(this).attr("data-format")?!0:!1,position:t(this).attr("data-position")||"default",theme:"bootstrap"})})}); \ No newline at end of file diff --git a/media/system/js/color-field-init.js b/media/system/js/color-field-init.js new file mode 100644 index 0000000000000..2705bb75e9dac --- /dev/null +++ b/media/system/js/color-field-init.js @@ -0,0 +1,3 @@ +jQuery(document).ready(function ($){ + $('select.simplecolors').simplecolors(); +}); diff --git a/media/system/js/color-field-init.min.js b/media/system/js/color-field-init.min.js new file mode 100644 index 0000000000000..5bedc7f6f27c1 --- /dev/null +++ b/media/system/js/color-field-init.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function($){$('select.simplecolors').simplecolors();}); diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 9d8926dfe14e3..856abdf5dcfb5 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -30,7 +30,7 @@ Joomla.editors.instances = Joomla.editors.instances || {}; // Toggle HTML5 validation form.noValidate = !validate; - form.setAttribute('novalidate', !validate) + form.setAttribute('novalidate', !validate); // Submit the form. // Create the input type="submit" @@ -58,19 +58,117 @@ Joomla.editors.instances = Joomla.editors.instances || {}; * Allows you to call Joomla.JText._() to get a translated JavaScript string pushed in with JText::script() in Joomla. */ Joomla.JText = { - strings: {}, + strings: {}, + + /** + * Translates a string into the current language. + * + * @param {String} key The string to translate + * @param {String} def Default string + * + * @returns {String} + */ '_': function( key, def ) { - return typeof this.strings[ key.toUpperCase() ] !== 'undefined' ? this.strings[ key.toUpperCase() ] : def; + + // Check for new strings in the optionsStorage, and load them + var newStrings = Joomla.getOptions('joomla.jtext'); + if ( newStrings ) { + this.load(newStrings); + + // Clean up the optionsStorage from useless data + Joomla.loadOptions({'joomla.jtext': null}); + } + + def = def === undefined ? '' : def; + key = key.toUpperCase(); + + return this.strings[ key ] !== undefined ? this.strings[ key ] : def; }, + + /** + * Load new strings in to Joomla.JText + * + * @param {Object} object Object with new strings + * @returns {Joomla.JText} + */ load: function( object ) { for ( var key in object ) { if (!object.hasOwnProperty(key)) continue; this.strings[ key.toUpperCase() ] = object[ key ]; } + return this; } }; + /** + * Joomla options storage + * + * @type {{}} + * + * @since __DEPLOY_VERSION__ + */ + Joomla.optionsStorage = Joomla.optionsStorage || null; + + /** + * Get script(s) options + * + * @param {String} key Name in Storage + * @param mixed def Default value if nothing found + * + * @return mixed + * + * @since __DEPLOY_VERSION__ + */ + Joomla.getOptions = function( key, def ) { + // Load options if they not exists + if (!Joomla.optionsStorage) { + Joomla.loadOptions(); + } + + return Joomla.optionsStorage[key] !== undefined ? Joomla.optionsStorage[key] : def; + }; + + /** + * Load new options from given options object or from Element + * + * @param {Object|undefined} options The options object to load. Eg {"com_foobar" : {"option1": 1, "option2": 2}} + * + * @since __DEPLOY_VERSION__ + */ + Joomla.loadOptions = function( options ) { + // Load form the script container + if (!options) { + var elements = document.querySelectorAll('.joomla-script-options.new'), + str, element, option; + + for (var i = 0, l = elements.length; i < l; i++) { + element = elements[i]; + str = element.text || element.textContent; + option = JSON.parse(str); + + option ? Joomla.loadOptions(option) : null; + + element.className = element.className.replace(' new', ' loaded'); + } + + return; + } + + // Initial loading + if (!Joomla.optionsStorage) { + Joomla.optionsStorage = options; + } + // Merge with existing + else { + for (var p in options) { + if (options.hasOwnProperty(p)) { + Joomla.optionsStorage[p] = options[p]; + } + } + } + }; + /** * Method to replace all request tokens on the page with a new one. * Used in Joomla Installation @@ -217,6 +315,65 @@ Joomla.editors.instances = Joomla.editors.instances || {}; messageContainer.style.display = ''; }; + /** + * Treat AJAX errors. + * Used by some javascripts such as sendtestmail.js and permissions.js + * + * @param object xhr XHR object. + * @param string textStatus Type of error that occurred. + * @param string error Textual portion of the HTTP status. + * + * @return object JavaScript object containing the system error message. + * + * @since 3.6.0 + */ + Joomla.ajaxErrorsMessages = function( xhr, textStatus, error ) { + var msg = {}; + + // For jQuery jqXHR + if (textStatus === 'parsererror') + { + // Html entity encode. + var encodedJson = xhr.responseText.trim(); + + var buf = []; + for (var i = encodedJson.length-1; i >= 0; i--) { + buf.unshift( [ '&#', encodedJson[i].charCodeAt(), ';' ].join('') ); + } + + encodedJson = buf.join(''); + + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_PARSE').replace('%s', encodedJson) ]; + } + else if (textStatus === 'nocontent') + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_NO_CONTENT') ]; + } + else if (textStatus === 'timeout') + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_TIMEOUT') ]; + } + else if (textStatus === 'abort') + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_CONNECTION_ABORT') ]; + } + // For vannila XHR + else if (xhr.responseJSON && xhr.responseJSON.message) + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status) + ' ' + xhr.responseJSON.message + '' ]; + } + else if (xhr.statusText) + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status) + ' ' + xhr.statusText + '' ]; + } + else + { + msg.error = [ Joomla.JText._('JLIB_JS_AJAX_ERROR_OTHER').replace('%s', xhr.status) ]; + } + + return msg; + }; + /** * USED IN: administrator/components/com_cache/views/cache/tmpl/default.php * administrator/components/com_installer/views/discover/tmpl/default_item.php @@ -302,8 +459,10 @@ Joomla.editors.instances = Joomla.editors.instances || {}; * The original key that was selected * @param string * The original item value that was selected + * @param string + * The elem where the list will be written */ - window.writeDynaList = function ( selectParams, source, key, orig_key, orig_val ) { + window.writeDynaList = function ( selectParams, source, key, orig_key, orig_val, element ) { var html = ''; - document.writeln( html ); + if (element) { + element.innerHTML = html; + } else { + document.writeln( html ); + } }; /** @@ -386,9 +549,9 @@ Joomla.editors.instances = Joomla.editors.instances || {}; * @param radioObj * @return */ - // return the value of the radio button that is checked - // return an empty string if none are checked, or - // there are no radio buttons + // return the value of the radio button that is checked + // return an empty string if none are checked, or + // there are no radio buttons window.radioGetCheckedValue = function ( radioObj ) { if ( !radioObj ) { return ''; } @@ -565,7 +728,7 @@ Joomla.editors.instances = Joomla.editors.instances || {}; parentElement.appendChild(loadingDiv); } // Show or hide the layer. - else + else { if (!document.getElementById('loading-logo')) { @@ -578,4 +741,118 @@ Joomla.editors.instances = Joomla.editors.instances || {}; return document.getElementById('loading-logo'); }; + /** + * Method to Extend Objects + * + * @param {Object} destination + * @param {Object} source + * + * @return Object + */ + Joomla.extend = function (destination, source) { + for (var p in source) { + if (source.hasOwnProperty(p)) { + destination[p] = source[p]; + } + } + + return destination; + }; + + /** + * Method to perform AJAX request + * + * @param {Object} options Request options: + * { + * url: 'index.php', // Request URL + * method: 'GET', // Request method GET (default), POST + * data: null, // Data to be sent, see https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/send + * perform: true, // Perform the request immediately, or return XMLHttpRequest instance and perform it later + * headers: null, // Object of custom headers, eg {'X-Foo': 'Bar', 'X-Bar': 'Foo'} + * + * onBefore: function(xhr){} // Callback on before the request + * onSuccess: function(response, xhr){}, // Callback on the request success + * onError: function(xhr){}, // Callback on the request error + * } + * + * @return XMLHttpRequest|Boolean + * + * @example + * + * Joomla.request({ + * url: 'index.php?option=com_example&view=example', + * onSuccess: function(response, xhr){ + * console.log(response); + * } + * }) + * + * @see https://developer.mozilla.org/docs/Web/API/XMLHttpRequest + */ + Joomla.request = function (options) { + + // Prepare the options + options = Joomla.extend({ + url: '', + method: 'GET', + data: null, + perform: true + }, options); + + // Use POST for send the data + options.method = options.data ? 'POST' : options.method; + + // Set up XMLHttpRequest instance + try{ + var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('MSXML2.XMLHTTP.3.0'); + xhr.open(options.method, options.url, true); + + // Set the headers + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.setRequestHeader('X-Ajax-Engine', 'Joomla!'); + + if (options.method === 'POST' && (!options.headers || !options.headers['Content-Type'])) { + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + } + + // Custom headers + if (options.headers){ + for (var p in options.headers){ + if (options.headers.hasOwnProperty(p)) { + xhr.setRequestHeader(p, options.headers[p]); + } + } + } + + xhr.onreadystatechange = function () { + // Request not finished + if (xhr.readyState !== 4) return; + + // Request finished and response is ready + if (xhr.status === 200) { + if(options.onSuccess) { + options.onSuccess.call(window, xhr.responseText, xhr); + } + } else if(options.onError) { + options.onError.call(window, xhr); + } + }; + + // Do request + if (options.perform) { + if (options.onBefore && options.onBefore.call(window, xhr) === false) { + // Request interrupted + return xhr; + } + + xhr.send(options.data); + } + + } catch (error) { + window.console ? console.log(error) : null; + return false; + } + + return xhr; + }; + }( Joomla, document )); diff --git a/media/system/js/core.js b/media/system/js/core.js index 37110c02f12c4..d58fd89f6a654 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1 +1 @@ -Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},function(e,t){"use strict";e.submitform=function(e,n,o){n||(n=t.getElementById("adminForm")),e&&(n.task.value=e),n.noValidate=!o,n.setAttribute("novalidate",!o);var i=t.createElement("input");i.style.display="none",i.type="submit",n.appendChild(i).click(),n.removeChild(i)},e.submitbutton=function(t){e.submitform(t)},e.JText={strings:{},_:function(e,t){return"undefined"!=typeof this.strings[e.toUpperCase()]?this.strings[e.toUpperCase()]:t},load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.strings[t.toUpperCase()]=e[t]);return this}},e.replaceTokens=function(e){if(/^[0-9A-F]{32}$/i.test(e)){var n,o,i,r=t.getElementsByTagName("input");for(n=0,i=r.length;i>n;n++)o=r[n],"hidden"==o.type&&"1"==o.value&&32==o.name.length&&(o.name=e)}},e.isEmail=function(e){var t=/^[\w.!#$%&‚Äô*+\/=?^`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]{2,})+$/i;return t.test(e)},e.checkAll=function(e,t){if(!e.form)return!1;t=t?t:"cb";var n,o,i,r=0;for(n=0,i=e.form.elements.length;i>n;n++)o=e.form.elements[n],o.type==e.type&&0===o.id.indexOf(t)&&(o.checked=e.checked,r+=o.checked?1:0);return e.form.boxchecked&&(e.form.boxchecked.value=r),!0},e.renderMessages=function(n){e.removeMessages();var o,i,r,a,l,s,d,c,u=t.getElementById("system-message-container");for(o in n)if(n.hasOwnProperty(o)){i=n[o],r=t.createElement("div"),c="notice"==o?"alert-info":"alert-"+o,c="message"==o?"alert-success":c,r.className="alert "+c;var m=t.createElement("button");for(m.setAttribute("type","button"),m.setAttribute("data-dismiss","alert"),m.className="close",m.innerHTML="×",r.appendChild(m),a=e.JText._(o),"undefined"!=typeof a&&(l=t.createElement("h4"),l.className="alert-heading",l.innerHTML=e.JText._(o),r.appendChild(l)),s=i.length-1;s>=0;s--)d=t.createElement("div"),d.innerHTML=i[s],r.appendChild(d);u.appendChild(r)}},e.removeMessages=function(){for(var e=t.getElementById("system-message-container");e.firstChild;)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},e.isChecked=function(e,n){if("undefined"==typeof n&&(n=t.getElementById("adminForm")),n.boxchecked.value=e?parseInt(n.boxchecked.value)+1:parseInt(n.boxchecked.value)-1,n.elements["checkall-toggle"]){var o,i,r,a=!0;for(o=0,r=n.elements.length;r>o;o++)if(i=n.elements[o],"checkbox"==i.type&&"checkall-toggle"!=i.name&&!i.checked){a=!1;break}n.elements["checkall-toggle"].checked=a}},e.popupWindow=function(e,t,n,o,i){var r=(screen.width-n)/2,a=(screen.height-o)/2,l="height="+o+",width="+n+",top="+a+",left="+r+",scrollbars="+i+",resizable";window.open(e,t,l).window.focus()},e.tableOrdering=function(n,o,i,r){"undefined"==typeof r&&(r=t.getElementById("adminForm")),r.filter_order.value=n,r.filter_order_Dir.value=o,e.submitform(i,r)},window.writeDynaList=function(e,n,o,i,r){var a,l,s,d="",t.writeln(d)},window.changeDynaList=function(e,n,o,i,r){for(var a,l,s,d,c=t.adminForm[e],u=o==i;c.firstChild;)c.removeChild(c.firstChild);a=0;for(l in n)n.hasOwnProperty(l)&&(s=n[l],s[0]==o&&(d=new Option,d.value=s[1],d.text=s[2],(u&&r==d.value||!u&&0===a)&&(d.selected=!0),c.options[a++]=d));c.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t,n=e.length;if(void 0===n)return e.checked?e.value:"";for(t=0;n>t;t++)if(e[t].checked)return e[t].value;return""},window.getSelectedValue=function(e,n){var o=t[e][n],i=o.selectedIndex;return null!==i&&i>-1?o.options[i].value:null},window.listItemTask=function(e,n){var o,i=t.adminForm,r=0,a=i[e];if(!a)return!1;for(;;){if(o=i["cb"+r],!o)break;o.checked=!1,r++}return a.checked=!0,i.boxchecked.value=1,window.submitform(n),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){window.checkAll_button(e,t)},window.checkAll_button=function(n,o){o=o?o:"saveorder";var i,r;for(i=0;n>=i;i++){if(r=t.adminForm["cb"+i],!r)return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");r.checked=!0}e.submitform(o)},e.loadingLayer=function(n,o){if(n=n||"show",o=o||t.body,"load"==n){var i=t.getElementsByTagName("body")[0].getAttribute("data-basepath")||"",r=t.createElement("div");r.id="loading-logo",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.opacity="0.8",r.style.filter="alpha(opacity=80)",r.style.overflow="hidden",r.style["z-index"]="10000",r.style.display="none",r.style["background-color"]="#fff",r.style["background-image"]='url("'+i+'/media/jui/images/ajax-loader.gif")',r.style["background-position"]="center",r.style["background-repeat"]="no-repeat",r.style["background-attachment"]="fixed",o.appendChild(r)}else t.getElementById("loading-logo")||e.loadingLayer("load",o),t.getElementById("loading-logo").style.display="show"==n?"block":"none";return t.getElementById("loading-logo")}}(Joomla,document); +Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},function(e,t){"use strict";e.submitform=function(e,o,n){o||(o=t.getElementById("adminForm")),e&&(o.task.value=e),o.noValidate=!n,o.setAttribute("novalidate",!n);var r=t.createElement("input");r.style.display="none",r.type="submit",o.appendChild(r).click(),o.removeChild(r)},e.submitbutton=function(t){e.submitform(t)},e.JText={strings:{},_:function(t,o){var n=e.getOptions("joomla.jtext");return n&&(this.load(n),e.loadOptions({"joomla.jtext":null})),o=void 0===o?"":o,t=t.toUpperCase(),void 0!==this.strings[t]?this.strings[t]:o},load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.strings[t.toUpperCase()]=e[t]);return this}},e.optionsStorage=e.optionsStorage||null,e.getOptions=function(t,o){return e.optionsStorage||e.loadOptions(),void 0!==e.optionsStorage[t]?e.optionsStorage[t]:o},e.loadOptions=function(o){if(o)if(e.optionsStorage)for(var n in o)o.hasOwnProperty(n)&&(e.optionsStorage[n]=o[n]);else e.optionsStorage=o;else for(var r,a,i,s=t.querySelectorAll(".joomla-script-options.new"),l=0,d=s.length;d>l;l++)a=s[l],r=a.text||a.textContent,i=JSON.parse(r),i?e.loadOptions(i):null,a.className=a.className.replace(" new"," loaded")},e.replaceTokens=function(e){if(/^[0-9A-F]{32}$/i.test(e)){var o,n,r,a=t.getElementsByTagName("input");for(o=0,r=a.length;r>o;o++)n=a[o],"hidden"==n.type&&"1"==n.value&&32==n.name.length&&(n.name=e)}},e.isEmail=function(e){var t=/^[\w.!#$%&‚Äô*+\/=?^`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]{2,})+$/i;return t.test(e)},e.checkAll=function(e,t){if(!e.form)return!1;t=t?t:"cb";var o,n,r,a=0;for(o=0,r=e.form.elements.length;r>o;o++)n=e.form.elements[o],n.type==e.type&&0===n.id.indexOf(t)&&(n.checked=e.checked,a+=n.checked?1:0);return e.form.boxchecked&&(e.form.boxchecked.value=a),!0},e.renderMessages=function(o){e.removeMessages();var n,r,a,i,s,l,d,c,u=t.getElementById("system-message-container");for(n in o)if(o.hasOwnProperty(n)){r=o[n],a=t.createElement("div"),c="notice"==n?"alert-info":"alert-"+n,c="message"==n?"alert-success":c,a.className="alert "+c;var m=t.createElement("button");for(m.setAttribute("type","button"),m.setAttribute("data-dismiss","alert"),m.className="close",m.innerHTML="×",a.appendChild(m),i=e.JText._(n),"undefined"!=typeof i&&(s=t.createElement("h4"),s.className="alert-heading",s.innerHTML=e.JText._(n),a.appendChild(s)),l=r.length-1;l>=0;l--)d=t.createElement("div"),d.innerHTML=r[l],a.appendChild(d);u.appendChild(a)}},e.removeMessages=function(){for(var e=t.getElementById("system-message-container");e.firstChild;)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},e.ajaxErrorsMessages=function(t,o){var n={};if("parsererror"===o){for(var r=t.responseText.trim(),a=[],i=r.length-1;i>=0;i--)a.unshift(["&#",r[i].charCodeAt(),";"].join(""));r=a.join(""),n.error=[e.JText._("JLIB_JS_AJAX_ERROR_PARSE").replace("%s",r)]}else"nocontent"===o?n.error=[e.JText._("JLIB_JS_AJAX_ERROR_NO_CONTENT")]:"timeout"===o?n.error=[e.JText._("JLIB_JS_AJAX_ERROR_TIMEOUT")]:"abort"===o?n.error=[e.JText._("JLIB_JS_AJAX_ERROR_CONNECTION_ABORT")]:t.responseJSON&&t.responseJSON.message?n.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.responseJSON.message+""]:t.statusText?n.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.statusText+""]:n.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)];return n},e.isChecked=function(e,o){if("undefined"==typeof o&&(o=t.getElementById("adminForm")),o.boxchecked.value=e?parseInt(o.boxchecked.value)+1:parseInt(o.boxchecked.value)-1,o.elements["checkall-toggle"]){var n,r,a,i=!0;for(n=0,a=o.elements.length;a>n;n++)if(r=o.elements[n],"checkbox"==r.type&&"checkall-toggle"!=r.name&&!r.checked){i=!1;break}o.elements["checkall-toggle"].checked=i}},e.popupWindow=function(e,t,o,n,r){var a=(screen.width-o)/2,i=(screen.height-n)/2,s="height="+n+",width="+o+",top="+i+",left="+a+",scrollbars="+r+",resizable";window.open(e,t,s).window.focus()},e.tableOrdering=function(o,n,r,a){"undefined"==typeof a&&(a=t.getElementById("adminForm")),a.filter_order.value=o,a.filter_order_Dir.value=n,e.submitform(r,a)},window.writeDynaList=function(e,o,n,r,a,i){var s,l,d,c="",i?i.innerHTML=c:t.writeln(c)},window.changeDynaList=function(e,o,n,r,a){for(var i,s,l,d,c=t.adminForm[e],u=n==r;c.firstChild;)c.removeChild(c.firstChild);i=0;for(s in o)o.hasOwnProperty(s)&&(l=o[s],l[0]==n&&(d=new Option,d.value=l[1],d.text=l[2],(u&&a==d.value||!u&&0===i)&&(d.selected=!0),c.options[i++]=d));c.length=i},window.radioGetCheckedValue=function(e){if(!e)return"";var t,o=e.length;if(void 0===o)return e.checked?e.value:"";for(t=0;o>t;t++)if(e[t].checked)return e[t].value;return""},window.getSelectedValue=function(e,o){var n=t[e][o],r=n.selectedIndex;return null!==r&&r>-1?n.options[r].value:null},window.listItemTask=function(e,o){var n,r=t.adminForm,a=0,i=r[e];if(!i)return!1;for(;;){if(n=r["cb"+a],!n)break;n.checked=!1,a++}return i.checked=!0,r.boxchecked.value=1,window.submitform(o),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){window.checkAll_button(e,t)},window.checkAll_button=function(o,n){n=n?n:"saveorder";var r,a;for(r=0;o>=r;r++){if(a=t.adminForm["cb"+r],!a)return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");a.checked=!0}e.submitform(n)},e.loadingLayer=function(o,n){if(o=o||"show",n=n||t.body,"load"==o){var r=t.getElementsByTagName("body")[0].getAttribute("data-basepath")||"",a=t.createElement("div");a.id="loading-logo",a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.width="100%",a.style.height="100%",a.style.opacity="0.8",a.style.filter="alpha(opacity=80)",a.style.overflow="hidden",a.style["z-index"]="10000",a.style.display="none",a.style["background-color"]="#fff",a.style["background-image"]='url("'+r+'/media/jui/images/ajax-loader.gif")',a.style["background-position"]="center",a.style["background-repeat"]="no-repeat",a.style["background-attachment"]="fixed",n.appendChild(a)}else t.getElementById("loading-logo")||e.loadingLayer("load",n),t.getElementById("loading-logo").style.display="show"==o?"block":"none";return t.getElementById("loading-logo")},e.extend=function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},e.request=function(t){t=e.extend({url:"",method:"GET",data:null,perform:!0},t),t.method=t.data?"POST":t.method;try{var o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");if(o.open(t.method,t.url,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("X-Ajax-Engine","Joomla!"),"POST"!==t.method||t.headers&&t.headers["Content-Type"]||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.headers)for(var n in t.headers)t.headers.hasOwnProperty(n)&&o.setRequestHeader(n,t.headers[n]);if(o.onreadystatechange=function(){4===o.readyState&&(200===o.status?t.onSuccess&&t.onSuccess.call(window,o.responseText,o):t.onError&&t.onError.call(window,o))},t.perform){if(t.onBefore&&t.onBefore.call(window,o)===!1)return o;o.send(t.data)}}catch(r){return window.console?console.log(r):null,!1}return o}}(Joomla,document); diff --git a/media/system/js/html5fallback-uncompressed.js b/media/system/js/html5fallback-uncompressed.js index 3598c0d2f1e56..06b18eb7e31d6 100644 --- a/media/system/js/html5fallback-uncompressed.js +++ b/media/system/js/html5fallback-uncompressed.js @@ -3,7 +3,7 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - /** +/** * Unobtrusive Form Validation and HTML5 Form polyfill library * * Inspired by: Ryan Seddon @@ -12,386 +12,528 @@ * @subpackage Forms */ -(function($,document,undefined){ +( function( $, document, undefined ) { + "use strict"; + // Utility function - if(typeof Object.create !== 'function'){ - Object.create = function(obj){ - function F(){}; + if ( typeof Object.create !== 'function' ) { + Object.create = function( obj ) { + function F() {} F.prototype = obj; return new F(); }; } + var features = ( function( el, item ) { + var attributes = [ 'required', 'pattern', 'placeholder', 'autofocus', 'formnovalidate' ], + types = [ 'email', 'url', 'number', 'range' ], + result = { + attributes: {}, + types: {} + }; + + while ( item = attributes.pop() ) { + result.attributes[ item ] = !!( item in el ); + } + + while ( item = types.pop() ) { + el.setAttribute( 'type', item ); + result.types[ item ] = ( el.type == item ); + } + + return result; + }( document.createElement( "input" ) ) ); + var H5Form = { - init: function(options, elem){ + /** + * Init function, prepares the form for for validation + * + * @param object options Some options to override the defaults. + * @param Element elem The form or element to validate. + * + * @return void + */ + init: function( options, elem ) { var self = this; + self.elem = elem; - self.$elem = $(elem); + self.$elem = $( elem ); elem.H5Form = self; - self.options = $.extend({}, $.fn.h5f.options, options); - self.field = document.createElement("input"); - self.checkSupport(self); - //check whether the element is form or not - if(elem.nodeName.toLowerCase() === "form"){ - self.bindWithForm(self.elem, self.$elem); + self.options = $.extend( {}, $.fn.h5f.options, options ); + + // Check whether the element is form or not + if ( elem.nodeName.toLowerCase() === "form" ) { + self.bindWithForm( self.elem, self.$elem ); } }, - bindWithForm : function(form, $form){ + /** + * Attach the validation behaviors to the form + * + * @param Element form The form element + * @param jQuery $form A jQuery object containing the form + * + * @return void + */ + bindWithForm: function( form, $form ) { var self = this, - novalidate = !!$form.attr('novalidate'), + novalidate = !!$form.attr( 'novalidate' ), f = form.elements, - flen = f.length; - if(self.options.formValidationEvent === "onSubmit"){ - $form.on('submit',function(e){ - novalidate = !!$form.attr('novalidate'); - var formnovalidate = this.H5Form.donotValidate != undefined ? this.H5Form.donotValidate : false; - if(!formnovalidate && !novalidate && !self.validateForm(self)){ - //prevent form from submit + flen = f.length, + formnovalidate; + + if ( self.options.formValidationEvent === "onSubmit" ) { + $form.on( 'submit', function( e ) { + formnovalidate = this.H5Form.donotValidate !== undefined ? this.H5Form.donotValidate : false; + + if ( !formnovalidate && !novalidate && !self.validateForm( self ) ) { + // Prevent form from submit e.preventDefault(); this.donotValidate = false; - } - else{ - $form.find(':input').each(function(){ - self.placeholder(self,this,'submit'); - }); + } else { + $form.find( ':input' ) + .each( function() { + self.placeholder( self, this, 'submit' ); + } ); } }); } - $form.on('focusout focusin', function(event){ - self.placeholder(self, event.target, event.type); - }); - - $form.on('focusout change', self.validateField); - $form.find('fieldset').on('change',function(){ - self.validateField(this); + $form.on( 'focusout focusin', function( event ) { + self.placeholder( self, event.target, event.type ); }); - if(!self.browser.isFormnovalidateNative){ - $form.find(':submit[formnovalidate]').on('click',function(){ - self.donotValidate = true; + $form.on( 'focusout change', self.validateField ); + + $form.find( 'fieldset' ) + .on( 'change', function() { + self.validateField( this ); }); + + if ( !features.attributes.formnovalidate ) { + $form.find( ':submit[formnovalidate]' ) + .on( 'click', function() { + self.donotValidate = true; + }); } - while(flen--) { - //assign graphical polyfills - var elem = f[flen]; - self.polyfill(elem); - self.autofocus(self, elem); - } - }, - polyfill : function(elem){ - if(elem.nodeName.toLowerCase() === 'form')return true; - var self = elem.form.H5Form; - self.placeholder(self, elem); - self.numberType(self, elem); + while ( flen-- ) { + // Assign graphical polyfills + self.polyfill( f[ flen ] ); + self.autofocus( self, f[ flen ] ); + } }, - checkSupport : function(self){ - self.browser = {}; - self.browser.isRequiredNative = !!("required" in self.field); - self.browser.isPatternNative = !!("pattern" in self.field); - self.browser.isPlaceholderNative = !!("placeholder" in self.field); - self.browser.isAutofocusNative = !!("autofocus" in self.field); - self.browser.isFormnovalidateNative = !!("formnovalidate" in self.field); - - self.field.setAttribute('type', 'email'); - self.browser.isEmailNative = (self.field.type == 'email'); + /** + * Apply the polyfills where applicable + * + * @param Element elem The element to apply polyfills to + * + * @return void + */ + polyfill: function( elem ) { + if ( elem.nodeName.toLowerCase() === 'form' ) return true; - self.field.setAttribute('type', 'url'); - self.browser.isUrlNative = (self.field.type == 'url'); + var self = elem.form.H5Form; - self.field.setAttribute('type', 'number'); - self.browser.isNumberNative = (self.field.type == 'number'); - - self.field.setAttribute('type', 'range'); - self.browser.isRangeNative = (self.field.type == 'range'); + self.placeholder( self, elem ); + self.numberType( self, elem ); }, - validateForm : function(){ + /** + * Validate the form + * + * @return boolean True if the form is valid, False if not + */ + validateForm: function() { var self = this, form = self.elem, f = form.elements, flen = f.length, - isFieldValid = true; + isFieldValid = true, + i, elem; + form.isValid = true; - for(var i=0; i'), - $option; - - min = isNaN(min) ? -100 : min; - - for (var i=min; i <= max ; i+=step) { - $option = $("