diff --git a/.appveyor.yml b/.appveyor.yml index 39a64f6d13efe..2ed100c749580 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -96,7 +96,6 @@ install: - appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar - cd C:\projects\joomla-cms - appveyor-retry composer install --no-progress --profile - - appveyor-retry composer update joomla/test-unit --no-progress --profile before_test: # Database setup for MySQL via PowerShell tools - > @@ -113,4 +112,4 @@ before_test: test_script: - cd C:\projects\joomla-cms - - libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist + - libraries/vendor/bin/phpunit diff --git a/.drone.yml b/.drone.yml index de3758236c4e2..04370afd1bd4e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,10 +23,9 @@ pipeline: image: joomlaprojects/docker-tools:develop commands: - composer install --no-progress --no-suggest - # needed for unit testing - - composer update joomla/test-unit --no-progress --no-suggest # needed for system testing - composer update joomla/test-system --no-progress --no-suggest + - composer update joomla/test-api --no-progress --no-suggest - composer update joomla-projects/selenium-server-standalone --no-progress --no-suggest - composer update joomla-projects/joomla-browser --no-progress --no-suggest - npm install --unsafe-perm @@ -44,19 +43,19 @@ pipeline: group: unit image: joomlaprojects/docker-php70:develop commands: - - ./libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist + - ./libraries/vendor/bin/phpunit php71-unit: group: unit image: joomlaprojects/docker-php71:develop commands: - - ./libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist + - ./libraries/vendor/bin/phpunit php72-unit: group: unit image: joomlaprojects/docker-php72:develop commands: - - ./libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist + - ./libraries/vendor/bin/phpunit javascript-cs: image: joomlaprojects/docker-systemtests:develop @@ -65,7 +64,7 @@ pipeline: - Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 & - sleep 3 - fluxbox > /dev/null 2>&1 & - - cd /drone/src/github.com/joomla/joomla-cms && npm run lint:js + - npm run lint:js javascript-tests: image: joomlaprojects/docker-systemtests:develop @@ -81,8 +80,13 @@ pipeline: commands: - bash libraries/vendor/joomla/test-system/src/drone-run.sh "$(pwd)" + api-tests: + image: joomlaprojects/docker-systemtests:latest + commands: + - bash libraries/vendor/joomla/test-api/drone-run.sh "$(pwd)" + analysis3x: - image: rips/rips-cli + image: rips/rips-cli:1.2.1 secrets: [rips_username, rips_password] when: branch: staging @@ -91,10 +95,10 @@ pipeline: - export RIPS_USERNAME=$RIPS_USERNAME - export RIPS_PASSWORD=$RIPS_PASSWORD - if [ $DRONE_REPO_OWNER != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi - - rips-cli rips:scan:start -a 1 -t 1 -p $(pwd) -t 1 -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + - rips-cli rips:scan:start -a 1 -t 1 -R -k -p $(pwd) -t 1 -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } analysis4x: - image: rips/rips-cli + image: rips/rips-cli:1.2.1 secrets: [rips_username, rips_password] when: branch: 4.0-dev @@ -103,7 +107,7 @@ pipeline: - export RIPS_USERNAME=$RIPS_USERNAME - export RIPS_PASSWORD=$RIPS_PASSWORD - if [ $DRONE_REPO_OWNER != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi - - rips-cli rips:scan:start -a 3 -t 1 -p $(pwd) -t 1 -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + - rips-cli rips:scan:start -a 3 -t 1 -R -k -p $(pwd) -t 1 -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } branches: exclude: [ l10n_* ] diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000..287896868eaa4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.eslintignore b/.eslintignore index bb3c737a70835..0948100b4106f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,16 @@ # A list of files to ignore from linting -# TODO: Fix the webcomponents codestyle then also allow linting on them *.js !*.es6.js administrator/components/com_media/node_modules/uri-js/node_modules/punycode/punycode.es6.js +media *.vue +# TODO: Fix the webcomponents codestyle then also allow linting on them +joomla-editor-codemirror.w-c.es6.js +joomla-field-fancy-select.w-c.es6.js +joomla-field-module-order.w-c.es6.js +joomla-field-permissions.w-c.es6.js +joomla-field-send-test-mail.w-c.es6.js +joomla-field-simple-color.w-c.es6.js +joomla-field-subform.w-c.es6.js +joomla-field-switcher.w-c.es6.js +# End of TODO diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a26c804e9aa8c..a11b0d0ab7de0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -57,7 +57,7 @@ RoboFile.php @rdeutz travis-phpunit.xml @rdeutz # Core JS -media/*/js/* @dgt41 +media/*/js/* @dgrammatiko # CSP Tooling plugins/system/httpheaders/* @zero-24 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index caf403a10e050..3e1635228df47 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,6 +19,6 @@ There are other branches available which serve specific purposes. | Branch | Purpose | | ------ | ------- | -| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. | -| 3.9-dev | Branch for the next minor Joomla version. The 3.9.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. | +| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. The 3.9.0 release will include the Privacy Tools Suite features. | +| 3.10-dev | Branch for the next minor Joomla version. The 3.10.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. | | 4.0-dev | Branch for the next major Joomla version. New features go into this branch. Commits to staging will be applied to this branch as well. | diff --git a/.github/ISSUE_TEMPLATE/Security.md b/.github/ISSUE_TEMPLATE/Security.md new file mode 100644 index 0000000000000..d7ff7ea26e670 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Security.md @@ -0,0 +1,11 @@ +--- +name: Security +about: Report a security issue + +--- + +Security issues should **NOT** be reported on this repository. + +If you believe you have found a security issue, please contact the Joomla Security Strike Team via email at security@joomla.org or through the contact form at https://developer.joomla.org/security/contact-the-team.html. + +Please see https://developer.joomla.org/security.html for more information on how the Joomla project responds to security issues. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 1f4c40264b859..0de43064ffe21 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -1,8 +1,8 @@ Where can you get support and help? ==================== -* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page); -* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ); -* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here); -* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html); -* Post questions at [our forums](https://forum.joomla.org); +* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page). +* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ). +* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here). +* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html). +* Post questions at [our forums](https://forum.joomla.org). * [Joomla Resources Directory](https://resources.joomla.org) (JRD). diff --git a/.gitignore b/.gitignore index 875e93f47524e..89f7804d40967 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # IDE & System Related Files # .buildpath -.editorconfig .project .settings .DS_Store diff --git a/.travis.yml b/.travis.yml index 1f4feb5c9a4d4..96e849aa76a2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ before_script: - composer install --ignore-platform-reqs script: - - libraries/vendor/bin/phpunit --configuration ./libraries/vendor/joomla/test-unit/phpunit.xml.dist + - libraries/vendor/bin/phpunit branches: except: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000..990fc7493fc7f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,62 @@ +# Joomla Contributor Covenant Code of Conduct + +This document outlines the Code of Conduct for all persons volunteering their service to the Joomla Project and/or Open Source Matters. It covers your behaviour as a member of the Joomla community, in any forum, mailing list, Wiki, Web site, IRC channel, install-fest, public meeting or private correspondence. + +If you cannot agree to any of these principles, then volunteering in the Joomla Project is not for you. Contributing to our community assumes acceptance of these principles: +## Be Considerate + +You are working with others as a team so be considerate of how your actions or contribution affects your colleagues and the community as a whole. +## Be Respectful + +Treat one another and members of the community with respect. Everyone can make a valuable contribution to Joomla. We may not always agree, but disagreement is no excuse for poor behavior or poor manners. + +We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It's important to remember that a community where people feel uncomfortable or threatened is not a productive one. We expect the members of Joomla community to be respectful when dealing with other volunteers as well as with people from outside projects and initiatives and with users. + +Avoid becoming involved in flame wars, trolling, personal attacks, and repetitive arguments. Take the matters "outside" (off-list, etc) if it helps resolve the situation, and do not use communal methods of communication to be a vehicle for your private "wall of shame." +## Be Collaborative + +Joomla is free software and about collaboration and working together. Collaboration reduces redundancy of work done in the free software world, and improves the quality of the software produced regardless of whether you are writing code or performing some other task. + +When you disagree, consult others. Disagreements, both political and technical, happen all the time, and Joomla is no exception. Disagreement, debate and constructive criticism is often how progress is made and are a necessary part of doing complex work in a team. + +The important goal is not to avoid disagreements or differing views but to resolve them constructively. Above all, avoid making conflicts about the work into personal conflicts. Debate should never include reference to someone's nationality, gender, religion or other personal characteristics. + +You should turn to the community and to the community process to seek advice and to resolve disagreements. Team leaders and Department Coordinators are able to help you figure out which direction will be most acceptable. + +When you are unsure, ask for help. Nobody knows everything and nobody is expected to be perfect. Asking questions avoids many problems down the road and so questions are encouraged. Those who are asked should be responsive and helpful. However, when asking a question, care must be taken to do so in an appropriate forum. Off-topic questions, such as requests for help on a development mailing list, detract from productive discussion. +## Step Down Considerately + +People on every project come and go, and Joomla is no different. When you leave or disengage from the community, in whole or in part, we ask that you do so in a way that minimizes disruption to the Project. This means you should tell people you are leaving and take the proper steps to ensure that others can pick up where you leave off. +## Be Available + +Check your e-mails regularly and answer them promptly—even if it's "I'll get back to you." +## Be Honest + +Sometimes the hardest thing to say is "no" or admit you've forgotten do something. Be honest with each other and yourself with regards to what you say and what you can realistically commit to. +## Follow the Rules + +Volunteers are expected to uphold Joomla's licensing and trademark requirements including, but not limited to, compliance on their own or affiliate Web sites and extensions. Make sure you have sought the appropriate approvals for domain name, name and logo usage prior to volunteering and that any extensions you distribute comply with the Joomla license. + +All work contributed to the Project, whether code, documentation or other material, must observe the appropriate licenses as set down by the Core Team and Open Source Matters. + +Some contributors represent the Joomla Project in specific areas, but you should not speak on behalf of the Project or present yourself as an official representative of the Project unless you are specifically authorized to do so, and you should never state your opinions as the official policies of the Project. +## Exercise Discretion and Confidentiality at Appropriate Times + +Depending on your role, you will be privy to various levels of information. As a volunteer you are expected to keep site access details (such as logins, FTP details, etc.) secure at all times. + +Information contained within private forums (for example, about serious security matters, legal cases, or personal details), private mailing lists, chats or other mediums is also to be kept confidential even after you have discontinued your service. Breaches in the area of privacy and confidentiality are taken very seriously by the Project. +## Conflict of Interest + +When using Project resources or making decisions within the board, your department, team, or subteam or the concerning Project's policy positions, you must do so based only on the best interests of the Project and its user community. If you have a situation or affiliation that might constitute or lead to a conflict of interest or might be perceived by a reasonable person in the community to be a conflict of interest, disclose this to your Team Leaders or the team as a whole. If appropriate, after discussing with your team, you should remove yourself from specific decisions or discussions in which you may have a conflict of interest. +## Conflict Resolution Team + +Should you wish to make a CoC violation report or are facing a conflict that has failed to be resolved in the manner set out in this CoC, please [click here](https://docs.google.com/forms/d/e/1FAIpQLSea_VL9NUvUM3iX-gptNuJe5oz5-jp9y5Y4v9ZyKImblfYTcQ/viewform) to access the report form. +## The Fine Print + +Members of the board of Open Source Matters are governed by additional guidelines and requirements and, where a conflict exists, these take precedence over this Code of Conduct. +## The Last Bit + +This Code of Conduct has changed over time and will continue to develop, but was originally derived, with permission, from the Ubuntu CoC. + +Last Updated 8th of June 2017 +Online version of this document is available at https://www.joomla.org/about-joomla/the-project/code-of-conduct.html diff --git a/README.md b/README.md index 962f48dc23a14..7ca0dfcdad9a7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) +Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) ==================== Build Status @@ -64,7 +64,7 @@ Do you want to improve Joomla? Copyright --------------------- -* Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +* Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. * [Special Thanks](https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks) * Distributed under the GNU General Public License version 2 or later * See [License details](https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses) diff --git a/README.txt b/README.txt index 006fedcd41833..75a33e037933b 100644 --- a/README.txt +++ b/README.txt @@ -13,7 +13,7 @@ 3- Is Joomla! for you? * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More * See Joomla's core features - https://www.joomla.org/core-features.html - * Try out our online demo: https://demo.joomla.org + * Try out our free hosting service: https://launch.joomla.org 4- How to find a Joomla! translation? * Repository of accredited language packs: https://community.joomla.org/translations.html @@ -67,7 +67,7 @@ * Documentation for Web designers: https://docs.joomla.org/Special:MyLanguage/Web_designers Copyright: - * Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + * Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. * Special Thanks: https://docs.joomla.org/Special:MyLanguage/Joomla!_Credits_and_Thanks * Distributed under the GNU General Public License version 2 or later * See Licenses details at https://docs.joomla.org/Special:MyLanguage/Joomla_Licenses diff --git a/RoboFile.php b/RoboFile.php index 9f20da0847b70..996c9fb035479 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -3,7 +3,7 @@ * @package Joomla.Site * @subpackage RoboFile * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_actionlogs/actionlogs.php b/administrator/components/com_actionlogs/actionlogs.php new file mode 100644 index 0000000000000..5f467d68d378f --- /dev/null +++ b/administrator/components/com_actionlogs/actionlogs.php @@ -0,0 +1,19 @@ +authorise('core.admin')) +{ + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); +} + +$controller = JControllerLegacy::getInstance('Actionlogs'); +$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->redirect(); diff --git a/administrator/components/com_actionlogs/actionlogs.xml b/administrator/components/com_actionlogs/actionlogs.xml new file mode 100644 index 0000000000000..0258379f0c3ef --- /dev/null +++ b/administrator/components/com_actionlogs/actionlogs.xml @@ -0,0 +1,29 @@ + + + com_actionlogs + Joomla! Project + May 2018 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.9.0 + COM_ACTIONLOGS_XML_DESCRIPTION + + COM_ACTIONLOGS + + actionlogs.php + config.xml + access.xml + controller.php + controllers + helpers + models + views + + + language/en-GB.com_actionlogs.ini + language/en-GB.com_actionlogs.sys.ini + + + diff --git a/administrator/components/com_actionlogs/config.xml b/administrator/components/com_actionlogs/config.xml new file mode 100644 index 0000000000000..c8450079348ff --- /dev/null +++ b/administrator/components/com_actionlogs/config.xml @@ -0,0 +1,35 @@ + + +
+ + + + + + + + + +
+
diff --git a/administrator/components/com_actionlogs/controller.php b/administrator/components/com_actionlogs/controller.php new file mode 100644 index 0000000000000..0967bcd774970 --- /dev/null +++ b/administrator/components/com_actionlogs/controller.php @@ -0,0 +1,19 @@ +registerTask('exportSelectedLogs', 'exportLogs'); + } + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return object The model. + * + * @since 3.9.0 + */ + public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel', $config = array('ignore_request' => true)) + { + // Return the model + return parent::getModel($name, $prefix, $config); + } + + /** + * Method to export logs + * + * @return void + * + * @since 3.9.0 + */ + public function exportLogs() + { + // Check for request forgeries. + $this->checkToken(); + + $task = $this->getTask(); + + $pks = array(); + + if ($task == 'exportSelectedLogs') + { + // Get selected logs + $pks = ArrayHelper::toInteger(explode(',', $this->input->post->getString('cids'))); + } + + /** @var ActionlogsModelActionlogs $model */ + $model = $this->getModel(); + + // Get the logs data + $data = $model->getLogDataAsIterator($pks); + + if (count($data)) + { + + try + { + $rows = ActionlogsHelper::getCsvData($data); + } + catch (InvalidArgumentException $exception) + { + $this->setMessage(JText::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error'); + $this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false)); + + return; + } + + // Destroy the iterator now + unset($data); + + $date = new JDate('now', new DateTimeZone('UTC')); + $filename = 'logs_' . $date->format('Y-m-d_His_T'); + + $csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ','); + + $app = JFactory::getApplication(); + $app->setHeader('Content-Type', 'application/csv', true) + ->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '.csv"', true) + ->setHeader('Cache-Control', 'must-revalidate', true) + ->sendHeaders(); + + $output = fopen("php://output", "w"); + + foreach ($rows as $row) + { + fputcsv($output, $row, $csvDelimiter); + } + + fclose($output); + + $app->close(); + } + else + { + $this->setMessage(JText::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT')); + $this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false)); + } + } + + /** + * Clean out the logs + * + * @return void + * + * @since 3.9.0 + */ + public function purge() + { + // Check for request forgeries. + $this->checkToken(); + + $model = $this->getModel(); + + if ($model->purge()) + { + $message = JText::_('COM_ACTIONLOGS_PURGE_SUCCESS'); + } + else + { + $message = JText::_('COM_ACTIONLOGS_PURGE_FAIL'); + } + + $this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false), $message); + } +} diff --git a/administrator/components/com_actionlogs/helpers/actionlogs.php b/administrator/components/com_actionlogs/helpers/actionlogs.php new file mode 100644 index 0000000000000..be9351d7ef0a4 --- /dev/null +++ b/administrator/components/com_actionlogs/helpers/actionlogs.php @@ -0,0 +1,317 @@ +=')) + { + // Only include the PHP 5.5 helper in this conditional to prevent the potential of parse errors for PHP 5.4 or earlier + JLoader::register('ActionlogsHelperPhp55', __DIR__ . '/actionlogsphp55.php'); + + return ActionlogsHelperPhp55::getCsvAsGenerator($data); + } + + $rows = array(); + + // Header row + $rows[] = array('Id', 'Message', 'Date', 'Extension', 'User', 'Ip'); + + foreach ($data as $log) + { + $date = new JDate($log->log_date, new DateTimeZone('UTC')); + $extension = strtok($log->extension, '.'); + + static::loadTranslationFiles($extension); + + $rows[] = array( + 'id' => $log->id, + 'message' => strip_tags(static::getHumanReadableLogMessage($log, false)), + 'date' => $date->format('Y-m-d H:i:s T'), + 'extension' => JText::_($extension), + 'name' => $log->name, + 'ip_address' => JText::_($log->ip_address), + ); + } + + return $rows; + } + + /** + * Load the translation files for an extension + * + * @param string $extension Extension name + * + * @return void + * + * @since 3.9.0 + */ + public static function loadTranslationFiles($extension) + { + static $cache = array(); + $extension = strtolower($extension); + + if (isset($cache[$extension])) + { + return; + } + + $lang = JFactory::getLanguage(); + + switch (substr($extension, 0, 3)) + { + case 'com': + default: + $source = JPATH_ADMINISTRATOR . '/components/' . $extension; + break; + + case 'lib': + $source = JPATH_LIBRARIES . '/' . substr($extension, 4); + break; + + case 'mod': + $source = JPATH_SITE . '/modules/' . $extension; + break; + + case 'plg': + $parts = explode('_', $extension, 3); + $source = JPATH_PLUGINS . '/' . $parts[1] . '/' . $parts[2]; + break; + + case 'tpl': + $source = JPATH_BASE . '/templates/' . substr($extension, 4); + break; + + } + + $lang->load($extension, JPATH_ADMINISTRATOR, null, false, true) + || $lang->load($extension, $source, null, false, true); + + if (!$lang->hasKey(strtoupper($extension))) + { + $lang->load($extension . '.sys', JPATH_ADMINISTRATOR, null, false, true) + || $lang->load($extension . '.sys', $source, null, false, true); + } + + $cache[$extension] = true; + } + + /** + * Get parameters to be + * + * @param string $context The context of the content + * + * @return mixed An object contains content type parameters, or null if not found + * + * @since 3.9.0 + */ + public static function getLogContentTypeParams($context) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('a.*') + ->from($db->quoteName('#__action_log_config', 'a')) + ->where($db->quoteName('a.type_alias') . ' = ' . $db->quote($context)); + + $db->setQuery($query); + + return $db->loadObject(); + } + + /** + * Get human readable log message for a User Action Log + * + * @param stdClass $log A User Action log message record + * @param boolean $generateLinks Flag to disable link generation when creating a message + * + * @return string + * + * @since 3.9.0 + */ + public static function getHumanReadableLogMessage($log, $generateLinks = true) + { + static $links = array(); + + $message = JText::_($log->message_language_key); + $messageData = json_decode($log->message, true); + + // Special handling for translation extension name + if (isset($messageData['extension_name'])) + { + static::loadTranslationFiles($messageData['extension_name']); + $messageData['extension_name'] = JText::_($messageData['extension_name']); + } + + $linkMode = JFactory::getApplication()->get('force_ssl', 0) >= 1 ? 1 : -1; + + foreach ($messageData as $key => $value) + { + // Convert relative url to absolute url so that it is clickable in action logs notification email + if ($generateLinks && StringHelper::strpos($value, 'index.php?') === 0) + { + if (!isset($links[$value])) + { + $links[$value] = JRoute::link('administrator', $value, false, $linkMode); + } + + $value = $links[$value]; + } + + $message = str_replace('{' . $key . '}', JText::_($value), $message); + } + + return $message; + } + + /** + * Get link to an item of given content type + * + * @param string $component + * @param string $contentType + * @param integer $id + * @param string $urlVar + * + * @return string Link to the content item + * + * @since 3.9.0 + */ + public static function getContentTypeLink($component, $contentType, $id, $urlVar = 'id') + { + // Try to find the component helper. + $eName = str_replace('com_', '', $component); + $file = Path::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, 'getContentTypeLink'))) + { + return $cName::getContentTypeLink($contentType, $id); + } + } + + if (empty($urlVar)) + { + $urlVar = 'id'; + } + + // Return default link to avoid having to implement getContentTypeLink in most of our components + return 'index.php?option=' . $component . '&task=' . $contentType . '.edit&' . $urlVar . '=' . $id; + } + + /** + * Load both enabled and disabled actionlog plugins language file. + * + * It is used to make sure actions log is displayed properly instead of only language items displayed when a plugin is disabled. + * + * @return void + * + * @since 3.9.0 + */ + public static function loadActionLogPluginsLanguage() + { + $lang = JFactory::getLanguage(); + $db = JFactory::getDbo(); + + // Get all (both enabled and disabled) actionlog plugins + $query = $db->getQuery(true) + ->select( + $db->quoteName( + array( + 'folder', + 'element', + 'params', + 'extension_id' + ), + array( + 'type', + 'name', + 'params', + 'id' + ) + ) + ) + ->from('#__extensions') + ->where('type = ' . $db->quote('plugin')) + ->where('folder = ' . $db->quote('actionlog')) + ->where('state IN (0,1)') + ->order('ordering'); + $db->setQuery($query); + + try + { + $rows = $db->loadObjectList(); + } + catch (RuntimeException $e) + { + $rows = array(); + } + + if (empty($rows)) + { + return; + } + + foreach ($rows as $row) + { + $name = $row->name; + $type = $row->type; + $extension = 'Plg_' . $type . '_' . $name; + $extension = strtolower($extension); + + // If language already loaded, don't load it again. + if ($lang->getPaths($extension)) + { + continue; + } + + $lang->load($extension, JPATH_ADMINISTRATOR, null, false, true) + || $lang->load($extension, JPATH_PLUGINS . '/' . $type . '/' . $name, null, false, true); + } + + // Load com_privacy too. + $lang->load('com_privacy', JPATH_ADMINISTRATOR, null, false, true); + } +} diff --git a/administrator/components/com_actionlogs/helpers/actionlogsphp55.php b/administrator/components/com_actionlogs/helpers/actionlogsphp55.php new file mode 100644 index 0000000000000..37e9d718ad23e --- /dev/null +++ b/administrator/components/com_actionlogs/helpers/actionlogsphp55.php @@ -0,0 +1,65 @@ +extension, '.'); + + ActionlogsHelper::loadTranslationFiles($extension); + + yield array( + 'id' => $log->id, + 'message' => strip_tags(ActionlogsHelper::getHumanReadableLogMessage($log, false)), + 'date' => (new JDate($log->log_date, new DateTimeZone('UTC')))->format('Y-m-d H:i:s T'), + 'extension' => JText::_($extension), + 'name' => $log->name, + 'ip_address' => JText::_($log->ip_address), + ); + } + } +} diff --git a/administrator/components/com_actionlogs/layouts/logstable.php b/administrator/components/com_actionlogs/layouts/logstable.php new file mode 100644 index 0000000000000..2aca08c590e3b --- /dev/null +++ b/administrator/components/com_actionlogs/layouts/logstable.php @@ -0,0 +1,46 @@ +load("com_actionlogs", JPATH_ADMINISTRATOR, null, false, true); + +$messages = $displayData['messages']; +$showIpColumn = $displayData['showIpColumn']; +?> +

+ +

+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + +
message; ?>log_date, 'Y-m-d H:i:s T', 'UTC'); ?>extension; ?>ip_address); ?>
diff --git a/administrator/components/com_actionlogs/libraries/actionlogplugin.php b/administrator/components/com_actionlogs/libraries/actionlogplugin.php new file mode 100644 index 0000000000000..e9e1819829a77 --- /dev/null +++ b/administrator/components/com_actionlogs/libraries/actionlogplugin.php @@ -0,0 +1,98 @@ + $message) + { + if (!array_key_exists('userid', $message)) + { + $message['userid'] = $user->id; + } + + if (!array_key_exists('username', $message)) + { + $message['username'] = $user->username; + } + + if (!array_key_exists('accountlink', $message)) + { + $message['accountlink'] = 'index.php?option=com_users&task=user.edit&id=' . $user->id; + } + + if (array_key_exists('type', $message)) + { + $message['type'] = strtoupper($message['type']); + } + + if (array_key_exists('app', $message)) + { + $message['app'] = strtoupper($message['app']); + } + + $messages[$index] = $message; + } + + /** @var ActionlogsModelActionlog $model **/ + $model = BaseModel::getInstance('Actionlog', 'ActionlogsModel'); + $model->addLog($messages, strtoupper($messageLanguageKey), $context, $userId); + } +} diff --git a/administrator/components/com_actionlogs/models/actionlog.php b/administrator/components/com_actionlogs/models/actionlog.php new file mode 100644 index 0000000000000..61f0016ee0701 --- /dev/null +++ b/administrator/components/com_actionlogs/models/actionlog.php @@ -0,0 +1,172 @@ +getDbo(); + $date = JFactory::getDate(); + $params = ComponentHelper::getComponent('com_actionlogs')->getParams(); + + if ($params->get('ip_logging', 0)) + { + $ip = IpHelper::getIp(); + + if (!filter_var($ip, FILTER_VALIDATE_IP)) + { + $ip = 'COM_ACTIONLOGS_IP_INVALID'; + } + } + else + { + $ip = 'COM_ACTIONLOGS_DISABLED'; + } + + $loggedMessages = array(); + + foreach ($messages as $message) + { + $logMessage = new stdClass; + $logMessage->message_language_key = $messageLanguageKey; + $logMessage->message = json_encode($message); + $logMessage->log_date = (string) $date; + $logMessage->extension = $context; + $logMessage->user_id = $user->id; + $logMessage->ip_address = $ip; + $logMessage->item_id = isset($message['id']) ? (int) $message['id'] : 0; + + try + { + $db->insertObject('#__action_logs', $logMessage); + $loggedMessages[] = $logMessage; + } + catch (RuntimeException $e) + { + // Ignore it + } + } + + // Send notification email to users who choose to be notified about the action logs + $this->sendNotificationEmails($loggedMessages, $user->name, $context); + } + + /** + * Send notification emails about the action log + * + * @param array $messages The logged messages + * @param string $username The username + * @param string $context The Context + * + * @return void + * + * @since 3.9.0 + */ + protected function sendNotificationEmails($messages, $username, $context) + { + $db = $this->getDbo(); + $query = $db->getQuery(true); + $params = ComponentHelper::getParams('com_actionlogs'); + $showIpColumn = (bool) $params->get('ip_logging', 0); + + $query + ->select($db->quoteName(array('u.email', 'l.extensions'))) + ->from($db->quoteName('#__users', 'u')) + ->join( + 'INNER', + $db->quoteName('#__action_logs_users', 'l') . ' ON ( ' . $db->quoteName('l.notify') . ' = 1 AND ' + . $db->quoteName('l.user_id') . ' = ' . $db->quoteName('u.id') . ')' + ); + + $db->setQuery($query); + + try + { + $users = $db->loadObjectList(); + } + catch (RuntimeException $e) + { + JError::raiseWarning(500, $e->getMessage()); + + return; + } + + $recipients = array(); + + foreach ($users as $user) + { + $extensions = json_decode($user->extensions, true); + + if ($extensions && in_array(strtok($context, '.'), $extensions)) + { + $recipients[] = $user->email; + } + } + + if (empty($recipients)) + { + return; + } + + $layout = new JLayoutFile('components.com_actionlogs.layouts.logstable', JPATH_ADMINISTRATOR); + $extension = strtok($context, '.'); + ActionlogsHelper::loadTranslationFiles($extension); + + foreach ($messages as $message) + { + $message->extension = JText::_($extension); + $message->message = ActionlogsHelper::getHumanReadableLogMessage($message); + } + + $displayData = array( + 'messages' => $messages, + 'username' => $username, + 'showIpColumn' => $showIpColumn, + ); + + $body = $layout->render($displayData); + $mailer = JFactory::getMailer(); + $mailer->addRecipient($recipients); + $mailer->setSubject(JText::_('COM_ACTIONLOGS_EMAIL_SUBJECT')); + $mailer->isHTML(true); + $mailer->Encoding = 'base64'; + $mailer->setBody($body); + + if (!$mailer->Send()) + { + JError::raiseWarning(500, JText::_('JERROR_SENDING_EMAIL')); + } + } +} diff --git a/administrator/components/com_actionlogs/models/actionlogs.php b/administrator/components/com_actionlogs/models/actionlogs.php new file mode 100644 index 0000000000000..8efc01d4d0088 --- /dev/null +++ b/administrator/components/com_actionlogs/models/actionlogs.php @@ -0,0 +1,389 @@ +getUserStateFromRequest($this->context . 'filter.search', 'filter_search', '', 'string'); + $this->setState('filter.search', $search); + + $user = $app->getUserStateFromRequest($this->context . 'filter.user', 'filter_user', '', 'string'); + $this->setState('filter.user', $user); + + $extension = $app->getUserStateFromRequest($this->context . 'filter.extension', 'filter_extension', '', 'string'); + $this->setState('filter.extension', $extension); + + $ip_address = $app->getUserStateFromRequest($this->context . 'filter.ip_address', 'filter_ip_address', '', 'string'); + $this->setState('filter.ip_address', $ip_address); + + $dateRange = $app->getUserStateFromRequest($this->context . 'filter.dateRange', 'filter_dateRange', '', 'string'); + $this->setState('filter.dateRange', $dateRange); + + parent::populateState($ordering, $direction); + } + + /** + * Build an SQL query to load the list data. + * + * @return JDatabaseQuery + * + * @since 3.9.0 + */ + protected function getListQuery() + { + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->select('a.*, u.name') + ->from('#__action_logs AS a') + ->leftJoin('#__users AS u ON a.user_id = u.id'); + + // Get ordering + $fullorderCol = $this->state->get('list.fullordering', 'a.id DESC'); + + // Apply ordering + if (!empty($fullorderCol)) + { + $query->order($db->escape($fullorderCol)); + } + + // Get filter by user + $user = $this->getState('filter.user'); + + // Apply filter by user + if (!empty($user)) + { + $query->where($db->quoteName('a.user_id') . ' = ' . (int) $user); + } + + // Get filter by extension + $extension = $this->getState('filter.extension'); + + // Apply filter by extension + if (!empty($extension)) + { + $query->where($db->quoteName('a.extension') . ' LIKE ' . $db->quote($extension . '%')); + } + + // Get filter by date range + $dateRange = $this->getState('filter.dateRange'); + + // Apply filter by date range + if (!empty($dateRange)) + { + $date = $this->buildDateRange($dateRange); + + // If the chosen range is not more than a year ago + if ($date['dNow'] != false) + { + $query->where( + $db->qn('a.log_date') . ' >= ' . $db->quote($date['dStart']->format('Y-m-d H:i:s')) . + ' AND ' . $db->qn('a.log_date') . ' <= ' . $db->quote($date['dNow']->format('Y-m-d H:i:s')) + ); + } + } + + // Filter the items over the search string if set. + $search = $this->getState('filter.search'); + + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3)); + } + elseif (stripos($search, 'item_id:') === 0) + { + $query->where($db->quoteName('a.item_id') . ' = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search, true) . '%'); + $query->where('(' . $db->quoteName('u.username') . ' LIKE ' . $search . ')'); + } + } + + return $query; + } + + /** + * Construct the date range to filter on. + * + * @param string $range The textual range to construct the filter for. + * + * @return array The date range to filter on. + * + * @since 3.9.0 + */ + private function buildDateRange($range) + { + // Get UTC for now. + $dNow = new JDate; + $dStart = clone $dNow; + + switch ($range) + { + case 'past_week': + $dStart->modify('-7 day'); + break; + + case 'past_1month': + $dStart->modify('-1 month'); + break; + + case 'past_3month': + $dStart->modify('-3 month'); + break; + + case 'past_6month': + $dStart->modify('-6 month'); + break; + + case 'past_year': + $dStart->modify('-1 year'); + break; + + case 'today': + // Ranges that need to align with local 'days' need special treatment. + $offset = JFactory::getApplication()->get('offset'); + + // Reset the start time to be the beginning of today, local time. + $dStart = new JDate('now', $offset); + $dStart->setTime(0, 0, 0); + + // Now change the timezone back to UTC. + $tz = new DateTimeZone('GMT'); + $dStart->setTimezone($tz); + break; + } + + return array('dNow' => $dNow, 'dStart' => $dStart); + } + + /** + * Get all log entries for an item + * + * @param string $extension The extension the item belongs to + * @param integer $itemId The item ID + * + * @return array + * + * @since 3.9.0 + */ + public function getLogsForItem($extension, $itemId) + { + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->select('a.*, u.name') + ->from('#__action_logs AS a') + ->innerJoin('#__users AS u ON a.user_id = u.id') + ->where($db->quoteName('a.extension') . ' = ' . $db->quote($extension)) + ->where($db->quoteName('a.item_id') . ' = ' . (int) $itemId); + + // Get ordering + $fullorderCol = $this->getState('list.fullordering', 'a.id DESC'); + + // Apply ordering + if (!empty($fullorderCol)) + { + $query->order($db->escape($fullorderCol)); + } + + $db->setQuery($query); + + return $db->loadObjectList(); + } + + /** + * Get logs data into JTable object + * + * @param integer[]|null $pks An optional array of log record IDs to load + * + * @return array All logs in the table + * + * @since 3.9.0 + */ + public function getLogsData($pks = null) + { + $db = $this->getDbo(); + $query = $this->getLogDataQuery($pks); + + $db->setQuery($query); + + return $db->loadObjectList(); + } + + /** + * Get logs data as a database iterator + * + * @param integer[]|null $pks An optional array of log record IDs to load + * + * @return JDatabaseIterator + * + * @since 3.9.0 + */ + public function getLogDataAsIterator($pks = null) + { + $db = $this->getDbo(); + $query = $this->getLogDataQuery($pks); + + $db->setQuery($query); + + return $db->getIterator(); + } + + /** + * Get the query for loading logs data + * + * @param integer[]|null $pks An optional array of log record IDs to load + * + * @return JDatabaseQuery + * + * @since 3.9.0 + */ + private function getLogDataQuery($pks = null) + { + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->select('a.*, u.name') + ->from('#__action_logs AS a') + ->innerJoin('#__users AS u ON a.user_id = u.id'); + + if (is_array($pks) && count($pks) > 0) + { + $query->where($db->quoteName('a.id') . ' IN (' . implode(',', ArrayHelper::toInteger($pks)) . ')'); + } + + return $query; + } + + /** + * Delete logs + * + * @param array $pks Primary keys of logs + * + * @return boolean + * + * @since 3.9.0 + */ + public function delete(&$pks) + { + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->delete($db->quoteName('#__action_logs')) + ->where($db->quoteName('id') . ' IN (' . implode(',', ArrayHelper::toInteger($pks)) . ')'); + $db->setQuery($query); + + try + { + $db->execute(); + + return true; + } + catch (RuntimeException $e) + { + $this->setError($e->getMessage()); + + return false; + } + } + + /** + * Removes all of logs from the table. + * + * @return boolean result of operation + * + * @since 3.9.0 + */ + public function purge() + { + try + { + $this->getDbo()->truncateTable('#__action_logs'); + + return true; + } + catch (Exception $e) + { + return false; + } + } + + /** + * Get the filter form + * + * @param array $data data + * @param boolean $loadData load current data + * + * @return \JForm|boolean The \JForm object or false on error + * + * @since 3.9.0 + */ + public function getFilterForm($data = array(), $loadData = true) + { + $form = parent::getFilterForm($data, $loadData); + $params = ComponentHelper::getParams('com_actionlogs'); + $ipLogging = (bool) $params->get('ip_logging', 0); + + // Add ip sort options to sort dropdown + if ($form && $ipLogging) + { + /* @var JFormFieldList $field */ + $field = $form->getField('fullordering', 'list'); + $field->addOption(JText::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), array('value' => 'a.ip_address ASC')); + $field->addOption(JText::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), array('value' => 'a.ip_address DESC')); + } + + return $form; + } +} diff --git a/administrator/components/com_actionlogs/models/fields/extension.php b/administrator/components/com_actionlogs/models/fields/extension.php new file mode 100644 index 0000000000000..4eb3153662d32 --- /dev/null +++ b/administrator/components/com_actionlogs/models/fields/extension.php @@ -0,0 +1,68 @@ +getQuery(true) + ->select('DISTINCT ' . $db->quoteName('extension')) + ->from($db->quoteName('#__action_logs')) + ->order($db->quoteName('extension')); + + $db->setQuery($query); + $context = $db->loadColumn(); + + $options = array(); + + if (count($context) > 0) + { + foreach ($context as $item) + { + $extensions[] = strtok($item, '.'); + } + + $extensions = array_unique($extensions); + + foreach ($extensions as $extension) + { + ActionlogsHelper::loadTranslationFiles($extension); + $options[] = JHtml::_('select.option', $extension, JText::_($extension)); + } + } + + return array_merge(parent::getOptions(), $options); + } +} diff --git a/administrator/components/com_actionlogs/models/fields/logcreator.php b/administrator/components/com_actionlogs/models/fields/logcreator.php new file mode 100644 index 0000000000000..c93081555d9a1 --- /dev/null +++ b/administrator/components/com_actionlogs/models/fields/logcreator.php @@ -0,0 +1,79 @@ +element); + + if (!isset(static::$options[$hash])) + { + static::$options[$hash] = parent::getOptions(); + + $options = array(); + + $db = JFactory::getDbo(); + + // Construct the query + $query = $db->getQuery(true) + ->select($db->quoteName('u.id', 'value')) + ->select($db->quoteName('u.name', 'text')) + ->from($db->quoteName('#__users', 'u')) + ->join('INNER', $db->quoteName('#__action_logs', 'c') . ' ON ' . $db->quoteName('c.user_id') . ' = ' . $db->quoteName('u.id')) + ->group($db->quoteName('u.id')) + ->group($db->quoteName('u.name')) + ->order($db->quoteName('u.name')); + + // Setup the query + $db->setQuery($query); + + // Return the result + if ($options = $db->loadObjectList()) + { + static::$options[$hash] = array_merge(static::$options[$hash], $options); + } + } + + return static::$options[$hash]; + } +} diff --git a/administrator/components/com_actionlogs/models/fields/logsdaterange.php b/administrator/components/com_actionlogs/models/fields/logsdaterange.php new file mode 100644 index 0000000000000..f415254455b21 --- /dev/null +++ b/administrator/components/com_actionlogs/models/fields/logsdaterange.php @@ -0,0 +1,59 @@ + 'COM_ACTIONLOGS_OPTION_RANGE_TODAY', + 'past_week' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_WEEK', + 'past_1month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_1MONTH', + 'past_3month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_3MONTH', + 'past_6month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_6MONTH', + 'past_year' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_YEAR', + ); + + /** + * Method to instantiate the form field object. + * + * @param JForm $form The form to attach to the form field object. + * + * @since 3.9.0 + */ + public function __construct($form = null) + { + parent::__construct($form); + + // Load the required language + $lang = JFactory::getLanguage(); + $lang->load('com_actionlogs', JPATH_ADMINISTRATOR); + } +} diff --git a/administrator/components/com_actionlogs/models/fields/logtype.php b/administrator/components/com_actionlogs/models/fields/logtype.php new file mode 100644 index 0000000000000..c8f0ef56b08e5 --- /dev/null +++ b/administrator/components/com_actionlogs/models/fields/logtype.php @@ -0,0 +1,62 @@ +getQuery(true) + ->select($db->quoteName('extension')) + ->from($db->quoteName('#__action_logs_extensions')); + + $extensions = $db->setQuery($query)->loadColumn(); + + $options = array(); + $tmp = array('checked' => true); + + foreach ($extensions as $extension) + { + ActionlogsHelper::loadTranslationFiles($extension); + $option = JHtml::_('select.option', $extension, JText::_($extension)); + $options[ApplicationHelper::stringURLSafe(JText::_($extension)) . '_' . $extension] = (object) array_merge($tmp, (array) $option); + } + + ksort($options); + + return array_merge(parent::getOptions(), array_values($options)); + } +} diff --git a/administrator/components/com_actionlogs/models/forms/filter_actionlogs.xml b/administrator/components/com_actionlogs/models/forms/filter_actionlogs.xml new file mode 100644 index 0000000000000..bb41c4087922c --- /dev/null +++ b/administrator/components/com_actionlogs/models/forms/filter_actionlogs.xml @@ -0,0 +1,69 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php b/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php new file mode 100644 index 0000000000000..74b9e0f8658da --- /dev/null +++ b/administrator/components/com_actionlogs/views/actionlogs/tmpl/default.php @@ -0,0 +1,137 @@ +escape($this->state->get('list.ordering')); +$listDirn = $this->escape($this->state->get('list.direction')); + +JFactory::getDocument()->addScriptDeclaration(' + Joomla.submitbutton = function(task) + { + if (task == "actionlogs.exportLogs") + { + Joomla.submitform(task, document.getElementById("exportForm")); + + return; + } + + if (task == "actionlogs.exportSelectedLogs") + { + // Get id of selected action logs item and pass it to export form hidden input + var cids = []; + + jQuery("input[name=\'cid[]\']:checked").each(function() { + cids.push(jQuery(this).val()); + }); + + document.exportForm.cids.value = cids.join(","); + Joomla.submitform(task, document.getElementById("exportForm")); + + return; + } + + Joomla.submitform(task); + }; +'); +?> +
+
+ $this)); ?> + items)) : ?> +
+ +
+ + + + + + + + + showIpColumn) : ?> + + + + + + + + + + + items as $i => $item) : + $extension = strtok($item->extension, '.'); + ActionlogsHelper::loadTranslationFiles($extension); ?> + + + + + + + showIpColumn) : ?> + + + + + + +
+ + + + + + + + + + + + + +
+ pagination->getListFooter(); ?> +
+ id); ?> + + + + escape(JText::_($extension)); ?> + + + log_date); ?> + + + name; ?> + + escape($item->ip_address)); ?> + + id; ?> +
+ + + + +
+
+
+ + + +
diff --git a/administrator/components/com_actionlogs/views/actionlogs/view.html.php b/administrator/components/com_actionlogs/views/actionlogs/view.html.php new file mode 100644 index 0000000000000..9bbf6cb63ddad --- /dev/null +++ b/administrator/components/com_actionlogs/views/actionlogs/view.html.php @@ -0,0 +1,109 @@ +items = $this->get('Items'); + $this->state = $this->get('State'); + $this->filterForm = $this->get('FilterForm'); + $this->activeFilters = $this->get('ActiveFilters'); + $this->pagination = $this->get('Pagination'); + $this->showIpColumn = (bool) $params->get('ip_logging', 0); + + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode("\n", $errors)); + + return false; + } + + $this->addToolBar(); + + // Load all actionlog plugins language files + ActionlogsHelper::loadActionLogPluginsLanguage(); + + return parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * + * @since 3.9.0 + */ + protected function addToolbar() + { + JToolbarHelper::title(JText::_('COM_ACTIONLOGS_MANAGER_USERLOGS'), 'list-2'); + + JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'actionlogs.delete'); + $bar = JToolbar::getInstance('toolbar'); + $bar->appendButton('Confirm', 'COM_ACTIONLOGS_PURGE_CONFIRM', 'delete', 'COM_ACTIONLOGS_TOOLBAR_PURGE', 'actionlogs.purge', false); + JToolbarHelper::preferences('com_actionlogs'); + JToolbarHelper::help('JHELP_COMPONENTS_ACTIONLOGS'); + JToolBarHelper::custom('actionlogs.exportSelectedLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_CSV', true); + JToolBarHelper::custom('actionlogs.exportLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_ALL_CSV', false); + } +} diff --git a/administrator/components/com_admin/Controller/DisplayController.php b/administrator/components/com_admin/Controller/DisplayController.php index 29166badb2589..eb99ab1bdad6b 100644 --- a/administrator/components/com_admin/Controller/DisplayController.php +++ b/administrator/components/com_admin/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Controller/ProfileController.php b/administrator/components/com_admin/Controller/ProfileController.php deleted file mode 100644 index b629ce35ad5bc..0000000000000 --- a/administrator/components/com_admin/Controller/ProfileController.php +++ /dev/null @@ -1,84 +0,0 @@ -app->getIdentity()->id; - } - - /** - * Overrides parent save method to check the submitted passwords match. - * - * @param string $key The name of the primary key of the URL variable. - * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). - * - * @return boolean True if successful, false otherwise. - * - * @since 3.2 - */ - public function save($key = null, $urlVar = null) - { - $this->setRedirect(Route::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->app->getIdentity()->id, false)); - - $return = parent::save(); - - if ($this->getTask() != 'apply') - { - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - } - - return $return; - } - - /** - * Method to cancel an edit. - * - * @param string $key The name of the primary key of the URL variable. - * - * @return boolean True if access level checks pass, false otherwise. - * - * @since 1.6 - */ - public function cancel($key = null) - { - $return = parent::cancel($key); - - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - - return $return; - } -} diff --git a/administrator/components/com_admin/Dispatcher/Dispatcher.php b/administrator/components/com_admin/Dispatcher/Dispatcher.php index 59670da27b3cc..0e245d801a42c 100644 --- a/administrator/components/com_admin/Dispatcher/Dispatcher.php +++ b/administrator/components/com_admin/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Extension/AdminComponent.php b/administrator/components/com_admin/Extension/AdminComponent.php index c98d04b864901..b5425b88de0d3 100644 --- a/administrator/components/com_admin/Extension/AdminComponent.php +++ b/administrator/components/com_admin/Extension/AdminComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Model/HelpModel.php b/administrator/components/com_admin/Model/HelpModel.php index 8f04d780c3c6c..874000402423a 100644 --- a/administrator/components/com_admin/Model/HelpModel.php +++ b/administrator/components/com_admin/Model/HelpModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Model/ProfileModel.php b/administrator/components/com_admin/Model/ProfileModel.php deleted file mode 100644 index 884d4b5413b7b..0000000000000 --- a/administrator/components/com_admin/Model/ProfileModel.php +++ /dev/null @@ -1,168 +0,0 @@ -loadForm('com_admin.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData)); - - if (empty($form)) - { - return false; - } - - // Check for username compliance and parameter set - $isUsernameCompliant = true; - - if ($this->loadFormData()->username) - { - $username = $this->loadFormData()->username; - $isUsernameCompliant = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2 - || trim($username) != $username); - } - - $this->setState('user.username.compliant', $isUsernameCompliant); - - if (!ComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) - { - $form->setFieldAttribute('username', 'required', 'false'); - $form->setFieldAttribute('username', 'readonly', 'true'); - $form->setFieldAttribute('username', 'description', 'COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC'); - } - - // When multilanguage is set, a user's default site language should also be a Content Language - if (Multilanguage::isEnabled()) - { - $form->setFieldAttribute('language', 'type', 'frontend_language', 'params'); - } - - // If the user needs to change their password, mark the password fields as required - if (Factory::getUser()->requireReset) - { - $form->setFieldAttribute('password', 'required', 'true'); - $form->setFieldAttribute('password2', 'required', 'true'); - } - - return $form; - } - - /** - * Method to get the data that should be injected in the form. - * - * @return mixed The data for the form. - * - * @since 1.6 - */ - protected function loadFormData() - { - // Check the session for previously entered form data. - $data = Factory::getApplication()->getUserState('com_users.edit.user.data', array()); - - if (empty($data)) - { - $data = $this->getItem(); - } - - // Load the users plugins. - PluginHelper::importPlugin('user'); - - $this->preprocessData('com_admin.profile', $data); - - return $data; - } - - /** - * Method to get a single record. - * - * @param integer $pk The id of the primary key. - * - * @return mixed Object on success, false on failure. - * - * @since 1.6 - */ - public function getItem($pk = null) - { - return parent::getItem(Factory::getUser()->id); - } - - /** - * Method to save the form data. - * - * @param array $data The form data. - * - * @return boolean True on success. - * - * @since 1.6 - */ - public function save($data) - { - $user = Factory::getUser(); - - unset($data['id']); - unset($data['groups']); - unset($data['sendEmail']); - unset($data['block']); - - $isUsernameCompliant = $this->getState('user.username.compliant'); - - if (!ComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) - { - unset($data['username']); - } - - // Bind the data. - if (!$user->bind($data)) - { - $this->setError($user->getError()); - - return false; - } - - $user->groups = null; - - // Store the data. - if (!$user->save()) - { - $this->setError($user->getError()); - - return false; - } - - $this->setState('user.id', $user->id); - - return true; - } -} diff --git a/administrator/components/com_admin/Model/SysinfoModel.php b/administrator/components/com_admin/Model/SysinfoModel.php index 2547dce21b0a2..acb50cf8eb7be 100644 --- a/administrator/components/com_admin/Model/SysinfoModel.php +++ b/administrator/components/com_admin/Model/SysinfoModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -309,7 +309,7 @@ public function &getInfo() $this->info = array( 'php' => php_uname(), - 'dbserver' => $db->getServerType(), + 'dbserver' => $db->getServerType(), 'dbversion' => $db->getVersion(), 'dbcollation' => $db->getCollation(), 'dbconnectioncollation' => $db->getConnectionCollation(), diff --git a/administrator/components/com_admin/Service/HTML/Directory.php b/administrator/components/com_admin/Service/HTML/Directory.php index 78f05e8877968..4844c60a8eb6d 100644 --- a/administrator/components/com_admin/Service/HTML/Directory.php +++ b/administrator/components/com_admin/Service/HTML/Directory.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Service/HTML/PhpSetting.php b/administrator/components/com_admin/Service/HTML/PhpSetting.php index 8ad8674eba67e..c5ae964c3e832 100644 --- a/administrator/components/com_admin/Service/HTML/PhpSetting.php +++ b/administrator/components/com_admin/Service/HTML/PhpSetting.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/Service/HTML/System.php b/administrator/components/com_admin/Service/HTML/System.php index d717e4a235f48..d340234e6153c 100644 --- a/administrator/components/com_admin/Service/HTML/System.php +++ b/administrator/components/com_admin/Service/HTML/System.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/View/Help/HtmlView.php b/administrator/components/com_admin/View/Help/HtmlView.php index 3c5bdfaf57ec3..086ce8e1e3c14 100644 --- a/administrator/components/com_admin/View/Help/HtmlView.php +++ b/administrator/components/com_admin/View/Help/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/View/Profile/HtmlView.php b/administrator/components/com_admin/View/Profile/HtmlView.php deleted file mode 100644 index 8b6185ff31d71..0000000000000 --- a/administrator/components/com_admin/View/Profile/HtmlView.php +++ /dev/null @@ -1,104 +0,0 @@ -form = $this->get('Form'); - $this->item = $this->get('Item'); - $this->state = $this->get('State'); - - // Check for errors. - if (count($errors = $this->get('Errors'))) - { - throw new \JViewGenericdataexception(implode("\n", $errors), 500); - } - - $this->form->setValue('password', null); - $this->form->setValue('password2', null); - - $this->addToolbar(); - - return parent::display($tpl); - } - - /** - * Add the page title and toolbar. - * - * @return void - * - * @since 1.6 - */ - protected function addToolbar() - { - Factory::getApplication()->input->set('hidemainmenu', 1); - - ToolbarHelper::title(Text::_('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user user-profile'); - - ToolbarHelper::saveGroup( - [ - ['apply', 'profile.apply'], - ['save', 'profile.save'] - ], - 'btn-success' - ); - - ToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE'); - ToolbarHelper::divider(); - ToolbarHelper::help('JHELP_ADMIN_USER_PROFILE_EDIT'); - } -} diff --git a/administrator/components/com_admin/View/Sysinfo/HtmlView.php b/administrator/components/com_admin/View/Sysinfo/HtmlView.php index 4f393f6e82b36..f361e6c184690 100644 --- a/administrator/components/com_admin/View/Sysinfo/HtmlView.php +++ b/administrator/components/com_admin/View/Sysinfo/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/View/Sysinfo/JsonView.php b/administrator/components/com_admin/View/Sysinfo/JsonView.php index 55f460b00b0bc..f92afdfc71e4b 100644 --- a/administrator/components/com_admin/View/Sysinfo/JsonView.php +++ b/administrator/components/com_admin/View/Sysinfo/JsonView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/View/Sysinfo/TextView.php b/administrator/components/com_admin/View/Sysinfo/TextView.php index 4167fc76e7bb8..3f7af346b5e8e 100644 --- a/administrator/components/com_admin/View/Sysinfo/TextView.php +++ b/administrator/components/com_admin/View/Sysinfo/TextView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/admin.xml b/administrator/components/com_admin/admin.xml index 5a4d7223533c1..2614d4fc380eb 100644 --- a/administrator/components/com_admin/admin.xml +++ b/administrator/components/com_admin/admin.xml @@ -3,7 +3,7 @@ com_admin Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_admin/forms/profile.xml b/administrator/components/com_admin/forms/profile.xml deleted file mode 100644 index e1daa6ed6a1c4..0000000000000 --- a/administrator/components/com_admin/forms/profile.xml +++ /dev/null @@ -1,150 +0,0 @@ - -
-
- - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
-
-
diff --git a/administrator/components/com_admin/postinstall/eaccelerator.php b/administrator/components/com_admin/postinstall/eaccelerator.php index 312ffbece0a53..0be79e70fcef8 100644 --- a/administrator/components/com_admin/postinstall/eaccelerator.php +++ b/administrator/components/com_admin/postinstall/eaccelerator.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file contains post-installation message handling for eAccelerator compatibility. diff --git a/administrator/components/com_admin/postinstall/htaccess.php b/administrator/components/com_admin/postinstall/htaccess.php index 7a1ff985e4def..1d568615181cd 100644 --- a/administrator/components/com_admin/postinstall/htaccess.php +++ b/administrator/components/com_admin/postinstall/htaccess.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file contains post-installation message handling for notifying users of a change diff --git a/administrator/components/com_admin/postinstall/languageaccess340.php b/administrator/components/com_admin/postinstall/languageaccess340.php index b9fab5252bbf8..e504082c8e3d7 100644 --- a/administrator/components/com_admin/postinstall/languageaccess340.php +++ b/administrator/components/com_admin/postinstall/languageaccess340.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file contains post-installation message handling for the checks if the installation is diff --git a/administrator/components/com_admin/postinstall/statscollection.php b/administrator/components/com_admin/postinstall/statscollection.php index 1d8fde9d94ce8..4d4a3053df195 100644 --- a/administrator/components/com_admin/postinstall/statscollection.php +++ b/administrator/components/com_admin/postinstall/statscollection.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file contains post-installation message handling for the checking minimum PHP version support diff --git a/administrator/components/com_admin/postinstall/updatedefaultsettings.php b/administrator/components/com_admin/postinstall/updatedefaultsettings.php index d111f4d50c799..5d9a2ebdda109 100644 --- a/administrator/components/com_admin/postinstall/updatedefaultsettings.php +++ b/administrator/components/com_admin/postinstall/updatedefaultsettings.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file contains post-installation message handling for notifying users of a change diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index eaa8f892e28d7..aa768e509e263 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -931,6 +931,7 @@ public function deleteUnexistingFiles() '/administrator/components/com_languages/helpers/languages.php', '/administrator/components/com_languages/helpers/multilangstatus.php', '/administrator/components/com_languages/languages.php', + '/administrator/components/com_languages/layouts/joomla/searchtools/default/bar.php', '/administrator/components/com_languages/models/forms/filter_installed.xml', '/administrator/components/com_languages/models/forms/filter_languages.xml', '/administrator/components/com_languages/models/forms/language.xml', diff --git a/administrator/components/com_admin/services/provider.php b/administrator/components/com_admin/services/provider.php index 84234da102984..1d3e4f9e6436c 100644 --- a/administrator/components/com_admin/services/provider.php +++ b/administrator/components/com_admin/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-02.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-02.sql new file mode 100644 index 0000000000000..ef74036ca361b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-02.sql @@ -0,0 +1,16 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(35, 0, 'com_privacy', 'component', 'com_privacy', '', 1, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); + +CREATE TABLE IF NOT EXISTS `#__privacy_requests` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `email` varchar(100) NOT NULL DEFAULT '', + `requested_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `status` tinyint(4) NOT NULL DEFAULT '0', + `request_type` varchar(25) NOT NULL DEFAULT '', + `confirm_token` varchar(100) NOT NULL DEFAULT '', + `confirm_token_created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) NOT NULL DEFAULT '0', + `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `idx_checkout` (`checked_out`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-03.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-03.sql new file mode 100644 index 0000000000000..d1f294af6a0ff --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-03.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(482, 0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-05.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-05.sql new file mode 100644 index 0000000000000..78db9a8d1cc88 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-05.sql @@ -0,0 +1,85 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(36, 0, 'com_actionlogs', 'component', 'com_actionlogs', '', 1, 1, 1, 1, '', '{"ip_logging":0,"csv_delimiter":",","loggable_extensions":["com_banners","com_cache","com_categories","com_config","com_contact","com_content","com_installer","com_media","com_menus","com_messages","com_modules","com_newsfeeds","com_plugins","com_redirect","com_tags","com_templates","com_users"]}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(483, 0, 'plg_system_actionlogs', 'plugin', 'actionlogs', 'system', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(484, 0, 'plg_actionlog_joomla', 'plugin', 'joomla', 'actionlog', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); + + +-- +-- Table structure for table `#__action_logs` +-- + +CREATE TABLE IF NOT EXISTS `#__action_logs` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `message_language_key` varchar(255) NOT NULL DEFAULT '', + `message` text NOT NULL, + `log_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `extension` varchar(50) NOT NULL DEFAULT '', + `user_id` int(11) NOT NULL DEFAULT 0, + `item_id` int(11) NOT NULL DEFAULT 0, + `ip_address` VARCHAR(40) NOT NULL DEFAULT '0.0.0.0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `#__action_logs_extensions` +-- + +CREATE TABLE IF NOT EXISTS `#__action_logs_extensions` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `extension` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +INSERT INTO `#__action_logs_extensions` (`id`, `extension`) VALUES +(1, 'com_banners'), +(2, 'com_cache'), +(3, 'com_categories'), +(4, 'com_config'), +(5, 'com_contact'), +(6, 'com_content'), +(7, 'com_installer'), +(8, 'com_media'), +(9, 'com_menus'), +(10, 'com_messages'), +(11, 'com_modules'), +(12, 'com_newsfeeds'), +(13, 'com_plugins'), +(14, 'com_redirect'), +(15, 'com_tags'), +(16, 'com_templates'), +(17, 'com_users'); + +-- +-- Table structure for table `#__action_log_config` +-- + +CREATE TABLE IF NOT EXISTS `#__action_log_config` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type_title` varchar(255) NOT NULL DEFAULT '', + `type_alias` varchar(255) NOT NULL DEFAULT '', + `id_holder` varchar(255), + `title_holder` varchar(255), + `table_name` varchar(255), + `text_prefix` varchar(255), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +INSERT INTO `#__action_log_config` (`id`, `type_title`, `type_alias`, `id_holder`, `title_holder`, `table_name`, `text_prefix`) VALUES +(1, 'article', 'com_content.article', 'id' ,'title' , '#__content', 'PLG_ACTIONLOG_JOOMLA'), +(2, 'article', 'com_content.form', 'id', 'title' , '#__content', 'PLG_ACTIONLOG_JOOMLA'), +(3, 'banner', 'com_banners.banner', 'id' ,'name' , '#__banners', 'PLG_ACTIONLOG_JOOMLA'), +(4, 'user_note', 'com_users.note', 'id', 'subject' ,'#__user_notes', 'PLG_ACTIONLOG_JOOMLA'), +(5, 'media', 'com_media.file', '' , 'name' , '', 'PLG_ACTIONLOG_JOOMLA'), +(6, 'category', 'com_categories.category', 'id' , 'title' , '#__categories', 'PLG_ACTIONLOG_JOOMLA'), +(7, 'menu', 'com_menus.menu', 'id' ,'title' , '#__menu_types', 'PLG_ACTIONLOG_JOOMLA'), +(8, 'menu_item', 'com_menus.item', 'id' , 'title' , '#__menu', 'PLG_ACTIONLOG_JOOMLA'), +(9, 'newsfeed', 'com_newsfeeds.newsfeed', 'id' ,'name' , '#__newsfeeds', 'PLG_ACTIONLOG_JOOMLA'), +(10, 'link', 'com_redirect.link', 'id', 'old_url' , '#__redirect_links', 'PLG_ACTIONLOG_JOOMLA'), +(11, 'tag', 'com_tags.tag', 'id', 'title' , '#__tags', 'PLG_ACTIONLOG_JOOMLA'), +(12, 'style', 'com_templates.style', 'id' , 'title' , '#__template_styles', 'PLG_ACTIONLOG_JOOMLA'), +(13, 'plugin', 'com_plugins.plugin', 'extension_id' , 'name' , '#__extensions', 'PLG_ACTIONLOG_JOOMLA'), +(14, 'component_config', 'com_config.component', 'extension_id' , 'name', '', 'PLG_ACTIONLOG_JOOMLA'), +(15, 'contact', 'com_contact.contact', 'id', 'name', '#__contact_details', 'PLG_ACTIONLOG_JOOMLA'), +(16, 'module', 'com_modules.module', 'id' ,'title', '#__modules', 'PLG_ACTIONLOG_JOOMLA'), +(17, 'access_level', 'com_users.level', 'id' , 'title', '#__viewlevels', 'PLG_ACTIONLOG_JOOMLA'), +(18, 'banner_client', 'com_banners.client', 'id', 'name', '#__banner_clients', 'PLG_ACTIONLOG_JOOMLA'); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-19.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-19.sql new file mode 100644 index 0000000000000..512acbd7f707e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-19.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(481, 0, 'plg_fields_repeatable', 'plugin', 'repeatable', '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.9.0-2018-05-20.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-20.sql new file mode 100644 index 0000000000000..8b918f8c257be --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-20.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(319, 0, 'mod_latestactions', 'module', 'mod_latestactions', '', 1, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-24.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-24.sql new file mode 100644 index 0000000000000..1dd1d9b474e73 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-24.sql @@ -0,0 +1,14 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(485, 0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); + +CREATE TABLE IF NOT EXISTS `#__privacy_consents` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL DEFAULT '0', + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `subject` varchar(255) NOT NULL DEFAULT '', + `body` text NOT NULL, + `remind` tinyint(4) NOT NULL DEFAULT '0', + `token` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `idx_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-27.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-27.sql new file mode 100644 index 0000000000000..ab0958e02c946 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-05-27.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(486, 0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(487, 0, 'plg_privacy_user', 'plugin', 'user', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-02.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-02.sql new file mode 100644 index 0000000000000..4dea034967e2e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-02.sql @@ -0,0 +1,4 @@ +ALTER TABLE `#__content` ADD COLUMN `note` VARCHAR(255) NOT NULL DEFAULT ''; + +UPDATE `#__content_types` SET `field_mappings` = +'{"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", "note":"note"}, "special":{"fulltext":"fulltext"}}' WHERE `type_title` = 'Article'; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-12.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-12.sql new file mode 100644 index 0000000000000..c45e9d6c7d9fd --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-12.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(320, 0, 'mod_privacy_dashboard', 'module', 'mod_privacy_dashboard', '', 1, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-13.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-13.sql new file mode 100644 index 0000000000000..edda43880912d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-13.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(488, 0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-14.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-14.sql new file mode 100644 index 0000000000000..cc18b1d191c96 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-14.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_ACTIONLOGS_POSTINSTALL_TITLE', 'COM_ACTIONLOGS_POSTINSTALL_BODY', '', 'com_actionlogs', 1, 'message', '', '', '', '', '3.9.0', 1), +(700, 'COM_PRIVACY_POSTINSTALL_TITLE', 'COM_PRIVACY_POSTINSTALL_BODY', '', 'com_privacy', 1, 'message', '', '', '', '', '3.9.0', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-17.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-17.sql new file mode 100644 index 0000000000000..d3d3ee5f930f3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-06-17.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(489, 0, 'plg_user_terms', 'plugin', 'terms', 'user', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-09.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-09.sql new file mode 100644 index 0000000000000..7c8215c3f93e6 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-09.sql @@ -0,0 +1,4 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(490, 0, 'plg_privacy_contact', 'plugin', 'contact', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(491, 0, 'plg_privacy_content', 'plugin', 'content', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(492, 0, 'plg_privacy_message', 'plugin', 'message', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-10.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-10.sql new file mode 100644 index 0000000000000..3c8c70a81ade9 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-10.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__action_log_config` (`id`, `type_title`, `type_alias`, `id_holder`, `title_holder`, `table_name`, `text_prefix`) + VALUES (19, 'application_config', 'com_config.application', '', 'name', '', 'PLG_ACTIONLOG_JOOMLA'); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-11.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-11.sql new file mode 100644 index 0000000000000..a6b89c858e868 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-07-11.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(493, 0, 'plg_privacy_actionlogs', 'plugin', 'actionlogs', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-12.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-12.sql new file mode 100644 index 0000000000000..250118c1f9375 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-12.sql @@ -0,0 +1 @@ +ALTER TABLE `#__privacy_consents` ADD COLUMN `state` INT(10) NOT NULL DEFAULT '1' AFTER `user_id`; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-28.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-28.sql new file mode 100644 index 0000000000000..e181ed56f8de7 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-28.sql @@ -0,0 +1,3 @@ +ALTER TABLE `#__session` MODIFY `session_id` varbinary(192) NOT NULL; +ALTER TABLE `#__session` MODIFY `guest` tinyint(3) unsigned DEFAULT 1; +ALTER TABLE `#__session` MODIFY `time` int(11) NOT NULL DEFAULT 0; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-29.sql new file mode 100644 index 0000000000000..9fe0097bbc15a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-08-29.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(494, 0, 'plg_captcha_recaptcha_invisible', 'plugin', 'recaptcha_invisible', 'captcha', 0, 0, 1, 0, '', '{"public_key":"","private_key":"","theme":"clean"}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-09-04.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-09-04.sql new file mode 100644 index 0000000000000..14bfe2497ef69 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-09-04.sql @@ -0,0 +1,7 @@ +CREATE TABLE IF NOT EXISTS `#__action_logs_users` ( + `user_id` int(11) UNSIGNED NOT NULL, + `notify` tinyint(1) UNSIGNED NOT NULL, + `extensions` text NOT NULL, + PRIMARY KEY (`user_id`), + KEY `idx_notify` (`notify`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-15.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-15.sql new file mode 100644 index 0000000000000..c9a13c1f64a00 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-15.sql @@ -0,0 +1,4 @@ +ALTER TABLE `#__action_logs` ADD INDEX `idx_user_id` (`user_id`); +ALTER TABLE `#__action_logs` ADD INDEX `idx_user_id_logdate` (`user_id`, `log_date`); +ALTER TABLE `#__action_logs` ADD INDEX `idx_user_id_extension` (`user_id`, `extension`); +ALTER TABLE `#__action_logs` ADD INDEX `idx_extension_item_id` (`extension`, `item_id`); diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-20.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-20.sql new file mode 100644 index 0000000000000..79f266d89036f --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-20.sql @@ -0,0 +1,3 @@ +ALTER TABLE `#__privacy_requests` DROP INDEX `idx_checkout`; +ALTER TABLE `#__privacy_requests` DROP COLUMN `checked_out`; +ALTER TABLE `#__privacy_requests` DROP COLUMN `checked_out_time`; diff --git a/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-21.sql b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-21.sql new file mode 100644 index 0000000000000..1fafdfdc2c74d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/3.9.0-2018-10-21.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_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 +(495, 0, 'plg_privacy_consents', 'plugin', 'consents', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2016-07-03.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2016-07-03.sql index 78ec385137e3f..05f0d5e850bbc 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2016-07-03.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2016-07-03.sql @@ -1,3 +1,3 @@ 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_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), -(459, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); +(494, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(495, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-04-25.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-04-25.sql index 4821e1462132a..86bd10da3d517 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-04-25.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-04-25.sql @@ -1,5 +1,5 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -(481, 'plg_filesystem_local', 'plugin', 'local', 'filesystem', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), -(482, 'plg_media-action_crop', 'plugin', 'crop', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), -(483, 'plg_media-action_resize', 'plugin', 'resize', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), -(484, 'plg_media-action_rotate', 'plugin', 'rotate', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); +(496, 'plg_filesystem_local', 'plugin', 'local', 'filesystem', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(497, 'plg_media-action_crop', 'plugin', 'crop', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(498, 'plg_media-action_resize', 'plugin', 'resize', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(499, 'plg_media-action_rotate', 'plugin', 'rotate', 'media-action', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-06-03.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-06-03.sql new file mode 100644 index 0000000000000..2166de7eb35be --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-06-03.sql @@ -0,0 +1,2 @@ +ALTER TABLE `#__extensions` ADD COLUMN `changelogurl` text AFTER `element`; +ALTER TABLE `#__updates` ADD COLUMN `changelogurl` text AFTER `infourl`; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-10-10.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-10-10.sql index d50f4cf946753..1e52dfcfdda8a 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-10-10.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-10-10.sql @@ -1,5 +1,5 @@ INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -(487, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); +(501, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); 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 diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql index a0e5f65b784f6..903d0fcd5501e 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-05-15.sql @@ -75,8 +75,8 @@ CREATE TABLE IF NOT EXISTS `#__workflow_stages` ( -- INSERT INTO `#__workflow_stages` (`id`, `asset_id`, `ordering`, `workflow_id`, `published`, `title`, `description`, `condition`, `default`) VALUES -(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 0), -(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 1), +(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1), +(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0), (3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0), (4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0); @@ -117,7 +117,7 @@ INSERT INTO `#__workflow_transitions` (`id`, `asset_id`, `published`, `ordering` -- INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -(35, 0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); +(37, 0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); -- -- Creating Associations for existing content diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql index a2ea57c63c0b2..55c62fb9ebf6f 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql @@ -15,4 +15,4 @@ CREATE TABLE IF NOT EXISTS `#__csp` ( ) 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`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES -(35, 'com_csp', 'component', 'com_csp', '', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); +(38, 'com_csp', 'component', 'com_csp', '', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-06.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-06.sql index 222b11d060977..767fa880257ca 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-06.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-06.sql @@ -2,8 +2,8 @@ CREATE TABLE IF NOT EXISTS `#__finder_logging` ( `searchterm` VARCHAR(255) NOT NULL DEFAULT '', `md5sum` VARCHAR(32) NOT NULL DEFAULT '', `query` BLOB NOT NULL, - `hits` INT(11) NOT NULL DEFAULT '1', - `results` INT(11) NOT NULL DEFAULT '0', + `hits` INT(11) NOT NULL DEFAULT 1, + `results` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY `md5sum` (`md5sum`), INDEX `searchterm` (`searchterm`(191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-11.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-11.sql index f29eb4df240ce..ca9b375d05120 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-11.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-11.sql @@ -1,4 +1,4 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES - (488, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0); + (490, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-16.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-16.sql new file mode 100644 index 0000000000000..188dcfbb9665c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-16.sql @@ -0,0 +1,185 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES (506, 0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0); +DROP TABLE IF EXISTS `#__finder_terms_common`; +CREATE TABLE `#__finder_terms_common` ( + `term` varchar(75) NOT NULL DEFAULT '', + `language` char(7) NOT NULL DEFAULT '', + `custom` int(11) NOT NULL DEFAULT '0', + UNIQUE KEY `idx_word_lang` (`term`,`language`), + KEY `idx_lang` (`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_bin; + +INSERT INTO `#__finder_terms_common` (`term`, `language`, `custom`) VALUES + ('i', 'en', 0), + ('me', 'en', 0), + ('my', 'en', 0), + ('myself', 'en', 0), + ('we', 'en', 0), + ('our', 'en', 0), + ('ours', 'en', 0), + ('ourselves', 'en', 0), + ('you', 'en', 0), + ('your', 'en', 0), + ('yours', 'en', 0), + ('yourself', 'en', 0), + ('yourselves', 'en', 0), + ('he', 'en', 0), + ('him', 'en', 0), + ('his', 'en', 0), + ('himself', 'en', 0), + ('she', 'en', 0), + ('her', 'en', 0), + ('hers', 'en', 0), + ('herself', 'en', 0), + ('it', 'en', 0), + ('its', 'en', 0), + ('itself', 'en', 0), + ('they', 'en', 0), + ('them', 'en', 0), + ('their', 'en', 0), + ('theirs', 'en', 0), + ('themselves', 'en', 0), + ('what', 'en', 0), + ('which', 'en', 0), + ('who', 'en', 0), + ('whom', 'en', 0), + ('this', 'en', 0), + ('that', 'en', 0), + ('these', 'en', 0), + ('those', 'en', 0), + ('am', 'en', 0), + ('is', 'en', 0), + ('are', 'en', 0), + ('was', 'en', 0), + ('were', 'en', 0), + ('be', 'en', 0), + ('been', 'en', 0), + ('being', 'en', 0), + ('have', 'en', 0), + ('has', 'en', 0), + ('had', 'en', 0), + ('having', 'en', 0), + ('do', 'en', 0), + ('does', 'en', 0), + ('did', 'en', 0), + ('doing', 'en', 0), + ('would', 'en', 0), + ('should', 'en', 0), + ('could', 'en', 0), + ('ought', 'en', 0), + ('i\'m', 'en', 0), + ('you\'re', 'en', 0), + ('he\'s', 'en', 0), + ('she\'s', 'en', 0), + ('it\'s', 'en', 0), + ('we\'re', 'en', 0), + ('they\'re', 'en', 0), + ('i\'ve', 'en', 0), + ('you\'ve', 'en', 0), + ('we\'ve', 'en', 0), + ('they\'ve', 'en', 0), + ('i\'d', 'en', 0), + ('you\'d', 'en', 0), + ('he\'d', 'en', 0), + ('she\'d', 'en', 0), + ('we\'d', 'en', 0), + ('they\'d', 'en', 0), + ('i\'ll', 'en', 0), + ('you\'ll', 'en', 0), + ('he\'ll', 'en', 0), + ('she\'ll', 'en', 0), + ('we\'ll', 'en', 0), + ('they\'ll', 'en', 0), + ('isn\'t', 'en', 0), + ('aren\'t', 'en', 0), + ('wasn\'t', 'en', 0), + ('weren\'t', 'en', 0), + ('hasn\'t', 'en', 0), + ('haven\'t', 'en', 0), + ('hadn\'t', 'en', 0), + ('doesn\'t', 'en', 0), + ('don\'t', 'en', 0), + ('didn\'t', 'en', 0), + ('won\'t', 'en', 0), + ('wouldn\'t', 'en', 0), + ('shan\'t', 'en', 0), + ('shouldn\'t', 'en', 0), + ('can\'t', 'en', 0), + ('cannot', 'en', 0), + ('couldn\'t', 'en', 0), + ('mustn\'t', 'en', 0), + ('let\'s', 'en', 0), + ('that\'s', 'en', 0), + ('who\'s', 'en', 0), + ('what\'s', 'en', 0), + ('here\'s', 'en', 0), + ('there\'s', 'en', 0), + ('when\'s', 'en', 0), + ('where\'s', 'en', 0), + ('why\'s', 'en', 0), + ('how\'s', 'en', 0), + ('a', 'en', 0), + ('an', 'en', 0), + ('the', 'en', 0), + ('and', 'en', 0), + ('but', 'en', 0), + ('if', 'en', 0), + ('or', 'en', 0), + ('because', 'en', 0), + ('as', 'en', 0), + ('until', 'en', 0), + ('while', 'en', 0), + ('of', 'en', 0), + ('at', 'en', 0), + ('by', 'en', 0), + ('for', 'en', 0), + ('with', 'en', 0), + ('about', 'en', 0), + ('against', 'en', 0), + ('between', 'en', 0), + ('into', 'en', 0), + ('through', 'en', 0), + ('during', 'en', 0), + ('before', 'en', 0), + ('after', 'en', 0), + ('above', 'en', 0), + ('below', 'en', 0), + ('to', 'en', 0), + ('from', 'en', 0), + ('up', 'en', 0), + ('down', 'en', 0), + ('in', 'en', 0), + ('out', 'en', 0), + ('on', 'en', 0), + ('off', 'en', 0), + ('over', 'en', 0), + ('under', 'en', 0), + ('again', 'en', 0), + ('further', 'en', 0), + ('then', 'en', 0), + ('once', 'en', 0), + ('here', 'en', 0), + ('there', 'en', 0), + ('when', 'en', 0), + ('where', 'en', 0), + ('why', 'en', 0), + ('how', 'en', 0), + ('all', 'en', 0), + ('any', 'en', 0), + ('both', 'en', 0), + ('each', 'en', 0), + ('few', 'en', 0), + ('more', 'en', 0), + ('most', 'en', 0), + ('other', 'en', 0), + ('some', 'en', 0), + ('such', 'en', 0), + ('no', 'en', 0), + ('nor', 'en', 0), + ('not', 'en', 0), + ('only', 'en', 0), + ('own', 'en', 0), + ('same', 'en', 0), + ('so', 'en', 0), + ('than', 'en', 0), + ('too', 'en', 0), + ('very', 'en', 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-19.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-19.sql index 35b6e684afaca..3de94a1bc9368 100644 --- a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-19.sql +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-19.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS `#__template_overrides` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`, `namespace`) VALUES -(491, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 4, 0, ''), -(492, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, ''); +(504, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 4, 0, ''), +(505, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0, ''); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql new file mode 100644 index 0000000000000..9437f4bf5e014 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-07-29.sql @@ -0,0 +1,26 @@ +DROP 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', + `lft` INT(11) NOT NULL DEFAULT '0', + `rgt` INT(11) NOT NULL DEFAULT '0', + `level` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `path` VARCHAR(400) NOT NULL DEFAULT '', + `title` VARCHAR(255) NOT NULL DEFAULT '', + `alias` VARCHAR(400) NOT NULL DEFAULT '', + `state` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + `access` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + `language` CHAR(7) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + INDEX `idx_state` (`state`), + INDEX `idx_access` (`access`), + INDEX `idx_path` (`path`(100)), + INDEX `idx_left_right` (`lft`, `rgt`), + INDEX `idx_alias` (`alias`(100)), + INDEX `idx_language` (`language`), + INDEX `idx_parent_published` (`parent_id`, `state`, `access`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; + +INSERT INTO `#__finder_taxonomy` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `state`, `access`, `language`) VALUES +(1, 0, 0, 1, 0, '', 'ROOT', 'root', 1, 1, '*'); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql new file mode 100644 index 0000000000000..3786f39217d21 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-29.sql @@ -0,0 +1,9 @@ +ALTER TABLE `#__modules` MODIFY `publish_up` datetime NULL DEFAULT NULL; +ALTER TABLE `#__modules` MODIFY `publish_down` datetime NULL DEFAULT NULL; +ALTER TABLE `#__modules` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; + +-- Use 0 instead of '0000-00-00 00:00:00' if you get 'Invalid default value for ...' +UPDATE `#__modules` SET + `publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END, + `publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END, + `checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END; diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-01-05.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-01-05.sql new file mode 100644 index 0000000000000..8832618121ad1 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-01-05.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(900, 0, 'plg_api-authentication_basic', 'plugin', 'basic', 'api-authentication', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(901, 0, 'plg_webservices_content', 'plugin', 'content', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql new file mode 100644 index 0000000000000..fc280184efb50 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(507, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-31.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-31.sql new file mode 100644 index 0000000000000..b36e061a25170 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-31.sql @@ -0,0 +1,3 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(502, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(500, 0, 'plg_installer_webinstaller', 'plugin', 'webinstaller', 'installer', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-02.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-02.sql new file mode 100644 index 0000000000000..9eec675a8f1cb --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-02.sql @@ -0,0 +1,17 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(35, 0, 'com_privacy', 'component', 'com_privacy', '', 1, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); + +CREATE TABLE "#__privacy_requests" ( + "id" serial NOT NULL, + "email" varchar(100) DEFAULT '' NOT NULL, + "requested_at" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "status" smallint DEFAULT 0 NOT NULL, + "request_type" varchar(25) DEFAULT '' NOT NULL, + "confirm_token" varchar(100) DEFAULT '' NOT NULL, + "confirm_token_created_at" timestamp without time zone DEFAULT '1970-01-01 00:00:00' 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, + PRIMARY KEY ("id") +); +CREATE INDEX "#__privacy_requests_idx_checked_out" ON "#__privacy_requests" ("checked_out"); +CREATE INDEX "#__privacy_requests_idx_user_id" ON "#__privacy_requests" ("user_id"); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-03.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-03.sql new file mode 100644 index 0000000000000..6ef9999e731f4 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-03.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(482, 0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-05.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-05.sql new file mode 100644 index 0000000000000..94366fa954c7e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-05.sql @@ -0,0 +1,92 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(36, 0, 'com_actionlogs', 'component', 'com_actionlogs', '', 1, 1, 1, 1, '', '{"ip_logging":0,"csv_delimiter":",","loggable_extensions":["com_banners","com_cache","com_categories","com_config","com_contact","com_content","com_installer","com_media","com_menus","com_messages","com_modules","com_newsfeeds","com_plugins","com_redirect","com_tags","com_templates","com_users"]}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(483, 0, 'plg_system_actionlogs', 'plugin', 'actionlogs', 'system', 0, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(484, 0, 'plg_actionlog_joomla', 'plugin', 'joomla', 'actionlog', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); + +-- +-- Table: #__action_logs +-- +CREATE TABLE "#__action_logs" ( + "id" serial NOT NULL, + "message_language_key" varchar(255) NOT NULL DEFAULT '', + "message" text NOT NULL DEFAULT '', + "log_date" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "extension" varchar(50) NOT NULL DEFAULT '', + "user_id" integer DEFAULT 0 NOT NULL, + "item_id" integer DEFAULT 0 NOT NULL, + "ip_address" varchar(40) NOT NULL DEFAULT '0.0.0.0', + PRIMARY KEY ("id") +); + +-- Table: #__action_logs_extensions +-- +CREATE TABLE "#__action_logs_extensions" ( + "id" serial NOT NULL, + "extension" varchar(50) NOT NULL DEFAULT '', + PRIMARY KEY ("id") +); + +-- +-- Dumping data for table '#__action_logs_extensions' +-- +INSERT INTO "#__action_logs_extensions" ("id", "extension") VALUES +(1, 'com_banners'), +(2, 'com_cache'), +(3, 'com_categories'), +(4, 'com_config'), +(5, 'com_contact'), +(6, 'com_content'), +(7, 'com_installer'), +(8, 'com_media'), +(9, 'com_menus'), +(10, 'com_messages'), +(11, 'com_modules'), +(12, 'com_newsfeeds'), +(13, 'com_plugins'), +(14, 'com_redirect'), +(15, 'com_tags'), +(16, 'com_templates'), +(17, 'com_users'); + +SELECT setval('#__action_logs_extensions_id_seq', 18, false); +-- -------------------------------------------------------- + +-- +-- Table: #__action_log_config +-- +CREATE TABLE "#__action_log_config" ( + "id" serial NOT NULL, + "type_title" varchar(255) NOT NULL DEFAULT '', + "type_alias" varchar(255) NOT NULL DEFAULT '', + "id_holder" varchar(255) NULL, + "title_holder" varchar(255) NULL, + "table_name" varchar(255) NULL, + "text_prefix" varchar(255) NULL, + PRIMARY KEY ("id") +); + +-- +-- Dumping data for table #__action_log_config +-- +INSERT INTO "#__action_log_config" ("id", "type_title", "type_alias", "id_holder", "title_holder", "table_name", "text_prefix") VALUES +(1, 'article', 'com_content.article', 'id' ,'title' , '#__content', 'PLG_ACTIONLOG_JOOMLA'), +(2, 'article', 'com_content.form', 'id', 'title' , '#__content', 'PLG_ACTIONLOG_JOOMLA'), +(3, 'banner', 'com_banners.banner', 'id' ,'name' , '#__banners', 'PLG_ACTIONLOG_JOOMLA'), +(4, 'user_note', 'com_users.note', 'id', 'subject' ,'#__user_notes', 'PLG_ACTIONLOG_JOOMLA'), +(5, 'media', 'com_media.file', '' , 'name' , '', 'PLG_ACTIONLOG_JOOMLA'), +(6, 'category', 'com_categories.category', 'id' , 'title' , '#__categories', 'PLG_ACTIONLOG_JOOMLA'), +(7, 'menu', 'com_menus.menu', 'id' ,'title' , '#__menu_types', 'PLG_ACTIONLOG_JOOMLA'), +(8, 'menu_item', 'com_menus.item', 'id' , 'title' , '#__menu', 'PLG_ACTIONLOG_JOOMLA'), +(9, 'newsfeed', 'com_newsfeeds.newsfeed', 'id' ,'name' , '#__newsfeeds', 'PLG_ACTIONLOG_JOOMLA'), +(10, 'link', 'com_redirect.link', 'id', 'old_url' , '#__redirect_links', 'PLG_ACTIONLOG_JOOMLA'), +(11, 'tag', 'com_tags.tag', 'id', 'title' , '#__tags', 'PLG_ACTIONLOG_JOOMLA'), +(12, 'style', 'com_templates.style', 'id' , 'title' , '#__template_styles', 'PLG_ACTIONLOG_JOOMLA'), +(13, 'plugin', 'com_plugins.plugin', 'extension_id' , 'name' , '#__extensions', 'PLG_ACTIONLOG_JOOMLA'), +(14, 'component_config', 'com_config.component', 'extension_id' , 'name', '', 'PLG_ACTIONLOG_JOOMLA'), +(15, 'contact', 'com_contact.contact', 'id', 'name', '#__contact_details', 'PLG_ACTIONLOG_JOOMLA'), +(16, 'module', 'com_modules.module', 'id' ,'title', '#__modules', 'PLG_ACTIONLOG_JOOMLA'), +(17, 'access_level', 'com_users.level', 'id' , 'title', '#__viewlevels', 'PLG_ACTIONLOG_JOOMLA'), +(18, 'banner_client', 'com_banners.client', 'id', 'name', '#__banner_clients', 'PLG_ACTIONLOG_JOOMLA'); + + +SELECT setval('#__action_log_config_id_seq', 18, false); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-19.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-19.sql new file mode 100644 index 0000000000000..b8ce724e76bf4 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-19.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(481, 0, 'plg_fields_repeatable', 'plugin', 'repeatable', '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.9.0-2018-05-20.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-20.sql new file mode 100644 index 0000000000000..1245f67a7df6b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-20.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(319, 0, 'mod_latestactions', 'module', 'mod_latestactions', '', 1, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-24.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-24.sql new file mode 100644 index 0000000000000..649caf5771667 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-24.sql @@ -0,0 +1,18 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(485, 0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); + +-- +-- Table structure for table `#__privacy_consents` +-- + +CREATE TABLE "#__privacy_consents" ( + "id" serial NOT NULL, + "user_id" bigint DEFAULT 0 NOT NULL, + "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, + "subject" varchar(255) DEFAULT '' NOT NULL, + "body" text NOT NULL, + "remind" smallint DEFAULT 0 NOT NULL, + "token" varchar(100) DEFAULT '' NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "#__privacy_consents_idx_user_id" ON "#__privacy_consents" ("user_id"); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-27.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-27.sql new file mode 100644 index 0000000000000..9d13ef54ad8e7 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-05-27.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(486, 0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(487, 0, 'plg_privacy_user', 'plugin', 'user', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-02.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-02.sql new file mode 100644 index 0000000000000..2551f21d93cc3 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-02.sql @@ -0,0 +1,4 @@ +ALTER TABLE "#__content" ADD COLUMN "note" VARCHAR(255) NOT NULL DEFAULT ''; + +UPDATE "#__content_types" SET "field_mappings" = +'{"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", "note":"note"}, "special":{"fulltext":"fulltext"}}' WHERE "type_title" = 'Article'; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-12.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-12.sql new file mode 100644 index 0000000000000..f1d2dffb8e93e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-12.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(320, 0, 'mod_privacy_dashboard', 'module', 'mod_privacy_dashboard', '', 1, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-13.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-13.sql new file mode 100644 index 0000000000000..86a8fa6ba7167 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-13.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(488, 0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-14.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-14.sql new file mode 100644 index 0000000000000..f2e932fee5a4f --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-14.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_ACTIONLOGS_POSTINSTALL_TITLE', 'COM_ACTIONLOGS_POSTINSTALL_BODY', '', 'com_actionlogs', 1, 'message', '', '', '', '', '3.9.0', 1), +(700, 'COM_PRIVACY_POSTINSTALL_TITLE', 'COM_PRIVACY_POSTINSTALL_BODY', '', 'com_privacy', 1, 'message', '', '', '', '', '3.9.0', 1); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-17.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-17.sql new file mode 100644 index 0000000000000..e10fe5087a320 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-06-17.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(489, 0, 'plg_user_terms', 'plugin', 'terms', 'user', 0, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-09.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-09.sql new file mode 100644 index 0000000000000..951914be74db4 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-09.sql @@ -0,0 +1,4 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(490, 0, 'plg_privacy_contact', 'plugin', 'contact', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(491, 0, 'plg_privacy_content', 'plugin', 'content', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(492, 0, 'plg_privacy_message', 'plugin', 'message', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-10.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-10.sql new file mode 100644 index 0000000000000..74e65fd4b16be --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-10.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__action_log_config" ("id", "type_title", "type_alias", "id_holder", "title_holder", "table_name", "text_prefix") + VALUES (19, 'application_config', 'com_config.application', '', 'name', '', 'PLG_ACTIONLOG_JOOMLA'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-11.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-11.sql new file mode 100644 index 0000000000000..270a1af635148 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-07-11.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(493, 0, 'plg_privacy_actionlogs', 'plugin', 'actionlogs', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-12.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-12.sql new file mode 100644 index 0000000000000..4e56e40bb7911 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-12.sql @@ -0,0 +1 @@ +ALTER TABLE "#__privacy_consents" ADD COLUMN "state" smallint DEFAULT 1 NOT NULL; \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-28.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-28.sql new file mode 100644 index 0000000000000..2492ac1788f60 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-28.sql @@ -0,0 +1,7 @@ +ALTER TABLE "#__session" ALTER COLUMN "session_id" DROP DEFAULT; +ALTER TABLE "#__session" ALTER COLUMN "session_id" TYPE bytea USING "session_id"::bytea; +ALTER TABLE "#__session" ALTER COLUMN "session_id" SET NOT NULL; +ALTER TABLE "#__session" ALTER COLUMN "time" DROP DEFAULT, + ALTER COLUMN "time" TYPE integer USING "time"::integer; +ALTER TABLE "#__session" ALTER COLUMN "time" SET DEFAULT 0; +ALTER TABLE "#__session" ALTER COLUMN "time" SET NOT NULL; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-29.sql new file mode 100644 index 0000000000000..b4421597d895b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-08-29.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(494, 0, 'plg_captcha_recaptcha_invisible', 'plugin', 'recaptcha_invisible', 'captcha', 0, 0, 1, 0, '', '{"public_key":"","private_key":"","theme":"clean"}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-09-04.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-09-04.sql new file mode 100644 index 0000000000000..1823a0a8fed4b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-09-04.sql @@ -0,0 +1,8 @@ +CREATE TABLE "#__action_logs_users" ( + "user_id" integer NOT NULL, + "notify" integer NOT NULL, + "extensions" text NOT NULL, + PRIMARY KEY ("user_id") +); + +CREATE INDEX "#__action_logs_users_idx_notify" ON "#__action_logs_users" ("notify"); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-15.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-15.sql new file mode 100644 index 0000000000000..358decd0a484a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-15.sql @@ -0,0 +1,4 @@ +CREATE INDEX "#__action_logs_idx_user_id" ON "#__action_logs" ("user_id"); +CREATE INDEX "#__action_logs_idx_user_id_logdate" ON "#__action_logs" ("user_id", "log_date"); +CREATE INDEX "#__action_logs_idx_user_id_extension" ON "#__action_logs" ("user_id", "extension"); +CREATE INDEX "#__action_logs_idx_extension_itemid" ON "#__action_logs" ("extension", "item_id"); diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-20.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-20.sql new file mode 100644 index 0000000000000..a33f707516f5a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-20.sql @@ -0,0 +1,3 @@ +DROP INDEX "#__privacy_requests_idx_checked_out"; +ALTER TABLE "#__privacy_requests" DROP COLUMN "checked_out"; +ALTER TABLE "#__privacy_requests" DROP COLUMN "checked_out_time"; diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-21.sql b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-21.sql new file mode 100644 index 0000000000000..271663e64fbc2 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.9.0-2018-10-21.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_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 +(495, 0, 'plg_privacy_consents', 'plugin', 'consents', 'privacy', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2016-07-03.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2016-07-03.sql index 9540431d11de3..d2e76a5654153 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2016-07-03.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2016-07-03.sql @@ -1,3 +1,3 @@ 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_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), -(459, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); \ No newline at end of file +(494, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(495, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-04-25.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-04-25.sql index c2b2bef81945b..0ef1a93a1a555 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-04-25.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-04-25.sql @@ -1,5 +1,5 @@ INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES -(481, 'plg_filesystem_local', 'plugin', 'local', 'filesystem', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), -(482, 'plg_media-action_crop', 'plugin', 'crop', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), -(483, 'plg_media-action_resize', 'plugin', 'resize', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), -(484, 'plg_media-action_rotate', 'plugin', 'rotate', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),; +(496, 'plg_filesystem_local', 'plugin', 'local', 'filesystem', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(497, 'plg_media-action_crop', 'plugin', 'crop', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(498, 'plg_media-action_resize', 'plugin', 'resize', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(499, 'plg_media-action_rotate', 'plugin', 'rotate', 'media-action', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0),; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-06-03.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-06-03.sql new file mode 100644 index 0000000000000..018cb0b5b749a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-06-03.sql @@ -0,0 +1,2 @@ +ALTER TABLE "#__extensions" ADD COLUMN "changelogurl" text; +ALTER TABLE "#__updates" ADD COLUMN "changelogurl" text; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-10-10.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-10-10.sql index f9321eed78908..e4f7cb20ee330 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-10-10.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2017-10-10.sql @@ -1,5 +1,5 @@ INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES -(487, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); +(501, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); 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 diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql index 28c2c3c34cdc1..c07179ff547f0 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-05-15.sql @@ -75,8 +75,8 @@ CREATE INDEX "#__workflow_stages_idx_default" ON "#__workflow_stages" ("default" -- INSERT INTO "#__workflow_stages" ("id", "asset_id", "ordering", "workflow_id", "published", "title", "description", "condition", "default") VALUES -(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 0), -(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 1), +(1, 0, 1, 1, 1, 'JUNPUBLISHED', '', 0, 1), +(2, 0, 2, 1, 1, 'JPUBLISHED', '', 1, 0), (3, 0, 3, 1, 1, 'JTRASHED', '', -2, 0), (4, 0, 4, 1, 1, 'JARCHIVED', '', 2, 0); @@ -113,7 +113,7 @@ INSERT INTO "#__workflow_transitions" ("id", "asset_id", "published", "ordering" -- INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES -(35, 0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); +(37, 0, 'com_workflow', 'component', 'com_workflow', '', 1, 1, 0, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); -- -- Creating Associations for existing content diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql index 9b024b02fed9e..06e202c826dd2 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql @@ -15,4 +15,4 @@ CREATE TABLE IF NOT EXISTS "#__csp" ( ); INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES -(35, 'com_csp', 'component', 'com_csp', ' ', 0, 0, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); +(38, 'com_csp', 'component', 'com_csp', ' ', 0, 0, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-11.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-11.sql index 4d4ddb987927d..e0b521329686a 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-11.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-11.sql @@ -1,4 +1,4 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES - (488, 0, 'plg_sampledata_blog', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0); + (490, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-16.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-16.sql new file mode 100644 index 0000000000000..3bfbbd98c407c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-16.sql @@ -0,0 +1,186 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES (506, 0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0); +DROP TABLE IF EXISTS "#__finder_terms_common"; +CREATE TABLE "#__finder_terms_common" ( + "term" varchar(75) NOT NULL, + "language" varchar(7) DEFAULT '' NOT NULL, + "custom" integer DEFAULT 0 NOT NULL, + CONSTRAINT "#__finder_terms_idx_term" UNIQUE ("term", "language") +); +CREATE INDEX "#__finder_terms_common_idx_word_lang" on "#__finder_terms_common" ("term", "language"); +CREATE INDEX "#__finder_terms_common_idx_lang" on "#__finder_terms_common" ("language"); + +INSERT INTO "#__finder_terms_common" ("term", "language", "custom") VALUES + ('i', 'en', 0), + ('me', 'en', 0), + ('my', 'en', 0), + ('myself', 'en', 0), + ('we', 'en', 0), + ('our', 'en', 0), + ('ours', 'en', 0), + ('ourselves', 'en', 0), + ('you', 'en', 0), + ('your', 'en', 0), + ('yours', 'en', 0), + ('yourself', 'en', 0), + ('yourselves', 'en', 0), + ('he', 'en', 0), + ('him', 'en', 0), + ('his', 'en', 0), + ('himself', 'en', 0), + ('she', 'en', 0), + ('her', 'en', 0), + ('hers', 'en', 0), + ('herself', 'en', 0), + ('it', 'en', 0), + ('its', 'en', 0), + ('itself', 'en', 0), + ('they', 'en', 0), + ('them', 'en', 0), + ('their', 'en', 0), + ('theirs', 'en', 0), + ('themselves', 'en', 0), + ('what', 'en', 0), + ('which', 'en', 0), + ('who', 'en', 0), + ('whom', 'en', 0), + ('this', 'en', 0), + ('that', 'en', 0), + ('these', 'en', 0), + ('those', 'en', 0), + ('am', 'en', 0), + ('is', 'en', 0), + ('are', 'en', 0), + ('was', 'en', 0), + ('were', 'en', 0), + ('be', 'en', 0), + ('been', 'en', 0), + ('being', 'en', 0), + ('have', 'en', 0), + ('has', 'en', 0), + ('had', 'en', 0), + ('having', 'en', 0), + ('do', 'en', 0), + ('does', 'en', 0), + ('did', 'en', 0), + ('doing', 'en', 0), + ('would', 'en', 0), + ('should', 'en', 0), + ('could', 'en', 0), + ('ought', 'en', 0), + ('i\'m', 'en', 0), + ('you\'re', 'en', 0), + ('he\'s', 'en', 0), + ('she\'s', 'en', 0), + ('it\'s', 'en', 0), + ('we\'re', 'en', 0), + ('they\'re', 'en', 0), + ('i\'ve', 'en', 0), + ('you\'ve', 'en', 0), + ('we\'ve', 'en', 0), + ('they\'ve', 'en', 0), + ('i\'d', 'en', 0), + ('you\'d', 'en', 0), + ('he\'d', 'en', 0), + ('she\'d', 'en', 0), + ('we\'d', 'en', 0), + ('they\'d', 'en', 0), + ('i\'ll', 'en', 0), + ('you\'ll', 'en', 0), + ('he\'ll', 'en', 0), + ('she\'ll', 'en', 0), + ('we\'ll', 'en', 0), + ('they\'ll', 'en', 0), + ('isn\'t', 'en', 0), + ('aren\'t', 'en', 0), + ('wasn\'t', 'en', 0), + ('weren\'t', 'en', 0), + ('hasn\'t', 'en', 0), + ('haven\'t', 'en', 0), + ('hadn\'t', 'en', 0), + ('doesn\'t', 'en', 0), + ('don\'t', 'en', 0), + ('didn\'t', 'en', 0), + ('won\'t', 'en', 0), + ('wouldn\'t', 'en', 0), + ('shan\'t', 'en', 0), + ('shouldn\'t', 'en', 0), + ('can\'t', 'en', 0), + ('cannot', 'en', 0), + ('couldn\'t', 'en', 0), + ('mustn\'t', 'en', 0), + ('let\'s', 'en', 0), + ('that\'s', 'en', 0), + ('who\'s', 'en', 0), + ('what\'s', 'en', 0), + ('here\'s', 'en', 0), + ('there\'s', 'en', 0), + ('when\'s', 'en', 0), + ('where\'s', 'en', 0), + ('why\'s', 'en', 0), + ('how\'s', 'en', 0), + ('a', 'en', 0), + ('an', 'en', 0), + ('the', 'en', 0), + ('and', 'en', 0), + ('but', 'en', 0), + ('if', 'en', 0), + ('or', 'en', 0), + ('because', 'en', 0), + ('as', 'en', 0), + ('until', 'en', 0), + ('while', 'en', 0), + ('of', 'en', 0), + ('at', 'en', 0), + ('by', 'en', 0), + ('for', 'en', 0), + ('with', 'en', 0), + ('about', 'en', 0), + ('against', 'en', 0), + ('between', 'en', 0), + ('into', 'en', 0), + ('through', 'en', 0), + ('during', 'en', 0), + ('before', 'en', 0), + ('after', 'en', 0), + ('above', 'en', 0), + ('below', 'en', 0), + ('to', 'en', 0), + ('from', 'en', 0), + ('up', 'en', 0), + ('down', 'en', 0), + ('in', 'en', 0), + ('out', 'en', 0), + ('on', 'en', 0), + ('off', 'en', 0), + ('over', 'en', 0), + ('under', 'en', 0), + ('again', 'en', 0), + ('further', 'en', 0), + ('then', 'en', 0), + ('once', 'en', 0), + ('here', 'en', 0), + ('there', 'en', 0), + ('when', 'en', 0), + ('where', 'en', 0), + ('why', 'en', 0), + ('how', 'en', 0), + ('all', 'en', 0), + ('any', 'en', 0), + ('both', 'en', 0), + ('each', 'en', 0), + ('few', 'en', 0), + ('more', 'en', 0), + ('most', 'en', 0), + ('other', 'en', 0), + ('some', 'en', 0), + ('such', 'en', 0), + ('no', 'en', 0), + ('nor', 'en', 0), + ('not', 'en', 0), + ('only', 'en', 0), + ('own', 'en', 0), + ('same', 'en', 0), + ('so', 'en', 0), + ('than', 'en', 0), + ('too', 'en', 0), + ('very', 'en', 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql index 67174b4a65058..60f50a3233acc 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-19.sql @@ -14,5 +14,5 @@ CREATE INDEX "#__template_overrides_idx_template" ON "#__template_overrides" ("t CREATE INDEX "#__template_overrides_idx_extension_id" ON "#__template_overrides" ("extension_id"); INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state", "namespace") VALUES -(491, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 4, 0, ''), -(492, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''); +(504, 0, 'plg_installer_override', 'plugin', 'override', 'installer', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 4, 0, ''), +(505, 0, 'plg_quickicon_overridecheck', 'plugin', 'overridecheck', 'quickicon', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0, ''); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql new file mode 100644 index 0000000000000..ea1b4ae743d71 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-07-29.sql @@ -0,0 +1,28 @@ +DROP TABLE "#__finder_taxonomy"; + +CREATE TABLE IF NOT EXISTS "#__finder_taxonomy" ( + "id" serial NOT NULL, + "parent_id" integer DEFAULT 0 NOT NULL, + "lft" integer DEFAULT 0 NOT NULL, + "rgt" integer DEFAULT 0 NOT NULL, + "level" integer DEFAULT 0 NOT NULL, + "path" VARCHAR(400) NOT NULL DEFAULT '', + "title" VARCHAR(255) NOT NULL DEFAULT '', + "alias" VARCHAR(400) NOT NULL DEFAULT '', + "state" smallint DEFAULT 1 NOT NULL, + "access" smallint DEFAULT 1 NOT NULL, + "language" varchar(7) DEFAULT '' NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "#__finder_taxonomy_state" on "#__finder_taxonomy" ("state"); +CREATE INDEX "#__finder_taxonomy_access" on "#__finder_taxonomy" ("access"); +CREATE INDEX "#__finder_taxonomy_path" on "#__finder_taxonomy" ("path"); +CREATE INDEX "#__finder_taxonomy_lft_rgt" on "#__finder_taxonomy" ("lft", "rgt"); +CREATE INDEX "#__finder_taxonomy_alias" on "#__finder_taxonomy" ("alias"); +CREATE INDEX "#__finder_taxonomy_language" on "#__finder_taxonomy" ("language"); +CREATE INDEX "#__finder_taxonomy_idx_parent_published" on "#__finder_taxonomy" ("parent_id", "state", "access"); + +INSERT INTO "#__finder_taxonomy" ("id", "parent_id", "lft", "rgt", "level", "path", "title", "alias", "state", "access", "language") VALUES +(1, 0, 0, 1, 0, '', 'ROOT', 'root', 1, 1, '*'); + +SELECT setval('#__finder_taxonomy_id_seq', 2, false); \ No newline at end of file diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql new file mode 100644 index 0000000000000..723794f171d25 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-29.sql @@ -0,0 +1,13 @@ +ALTER TABLE "#__modules" ALTER COLUMN "publish_up" DROP NOT NULL; +ALTER TABLE "#__modules" ALTER COLUMN "publish_up" DROP DEFAULT; + +ALTER TABLE "#__modules" ALTER COLUMN "publish_down" DROP NOT NULL; +ALTER TABLE "#__modules" ALTER COLUMN "publish_down" DROP DEFAULT; + +ALTER TABLE "#__modules" ALTER COLUMN "checked_out_time" DROP NOT NULL; +ALTER TABLE "#__modules" ALTER COLUMN "checked_out_time" DROP DEFAULT; + +UPDATE "#__modules" SET + "publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END, + "publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END, + "checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-01-05.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-01-05.sql new file mode 100644 index 0000000000000..8432ebe636b27 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-01-05.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES +(900, 0, 'plg_api-authentication_basic', 'plugin', 'basic', 'api-authentication', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(901, 0, 'plg_webservices_content', 'plugin', 'content', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql new file mode 100644 index 0000000000000..9b6cc6bee874a --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES +(507, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-31.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-31.sql new file mode 100644 index 0000000000000..49ff324103cf4 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-31.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES +(502, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(500, 0, 'plg_installer_webinstaller', 'plugin', 'webinstaller', 'installer', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0); diff --git a/administrator/components/com_admin/tmpl/help/default.php b/administrator/components/com_admin/tmpl/help/default.php index b0f537a468abd..9892d872dfa54 100644 --- a/administrator/components/com_admin/tmpl/help/default.php +++ b/administrator/components/com_admin/tmpl/help/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/help/langforum.php b/administrator/components/com_admin/tmpl/help/langforum.php index aee7420915a76..c57b24160afc9 100644 --- a/administrator/components/com_admin/tmpl/help/langforum.php +++ b/administrator/components/com_admin/tmpl/help/langforum.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/profile/edit.php b/administrator/components/com_admin/tmpl/profile/edit.php deleted file mode 100644 index 2f34cfae0f8f7..0000000000000 --- a/administrator/components/com_admin/tmpl/profile/edit.php +++ /dev/null @@ -1,69 +0,0 @@ -form->getFieldsets(); -?> - -
- 'account')); ?> - - - form->getFieldset('user_details') as $field) : ?> -
-
- label; ?> -
-
- fieldname == 'password2') : ?> - - - input; ?> -
-
- - - - - name == 'user_details') - { - continue; - } - ?> - name, Text::_($fieldset->label)); ?> - form->getFieldset($fieldset->name) as $field) : ?> - hidden) : ?> -
-
input; ?>
-
- -
-
- label; ?> -
-
input; ?>
-
- - - - - - - - -
diff --git a/administrator/components/com_admin/tmpl/sysinfo/default.php b/administrator/components/com_admin/tmpl/sysinfo/default.php index 03e97fad66289..70735d7dc2525 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_config.php b/administrator/components/com_admin/tmpl/sysinfo/default_config.php index b0ce9da672f8d..fa5ff1a0a5d99 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default_config.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default_config.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_directory.php b/administrator/components/com_admin/tmpl/sysinfo/default_directory.php index c0f68f80c4123..dcfd30d6aa81f 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default_directory.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default_directory.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_phpinfo.php b/administrator/components/com_admin/tmpl/sysinfo/default_phpinfo.php index a3063d9b229ce..0c21295be3df4 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default_phpinfo.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default_phpinfo.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_phpsettings.php b/administrator/components/com_admin/tmpl/sysinfo/default_phpsettings.php index 2a695f460a84b..db9e2dfb092f6 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default_phpsettings.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default_phpsettings.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_admin/tmpl/sysinfo/default_system.php b/administrator/components/com_admin/tmpl/sysinfo/default_system.php index 24c1eaffcc086..e8abbb5fbdc4b 100644 --- a/administrator/components/com_admin/tmpl/sysinfo/default_system.php +++ b/administrator/components/com_admin/tmpl/sysinfo/default_system.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_ajax/ajax.php b/administrator/components/com_ajax/ajax.php index 0bbcfdf5da4a1..f96da3c4d69a0 100644 --- a/administrator/components/com_ajax/ajax.php +++ b/administrator/components/com_ajax/ajax.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_ajax * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_ajax/ajax.xml b/administrator/components/com_ajax/ajax.xml index 3bcd196e1bdb5..75d31342532a0 100644 --- a/administrator/components/com_ajax/ajax.xml +++ b/administrator/components/com_ajax/ajax.xml @@ -3,7 +3,7 @@ com_ajax Joomla! Project August 2013 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_associations/Controller/AssociationController.php b/administrator/components/com_associations/Controller/AssociationController.php index 021405fa00e45..65a4e48697bb6 100644 --- a/administrator/components/com_associations/Controller/AssociationController.php +++ b/administrator/components/com_associations/Controller/AssociationController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,7 +14,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper; /** @@ -64,7 +63,7 @@ public function edit($key = null, $urlVar = null) */ public function cancel($key = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string'), 2); diff --git a/administrator/components/com_associations/Controller/AssociationsController.php b/administrator/components/com_associations/Controller/AssociationsController.php index 1007d2f2469db..f5c362d5a3f01 100644 --- a/administrator/components/com_associations/Controller/AssociationsController.php +++ b/administrator/components/com_associations/Controller/AssociationsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Controller/DisplayController.php b/administrator/components/com_associations/Controller/DisplayController.php index c4d3d01ce63af..dd9497d71e1b9 100644 --- a/administrator/components/com_associations/Controller/DisplayController.php +++ b/administrator/components/com_associations/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Dispatcher/Dispatcher.php b/administrator/components/com_associations/Dispatcher/Dispatcher.php index 07da1ee4d2f43..f949efa05e7ec 100644 --- a/administrator/components/com_associations/Dispatcher/Dispatcher.php +++ b/administrator/components/com_associations/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Field/ItemlanguageField.php b/administrator/components/com_associations/Field/ItemlanguageField.php index 88bec1219315d..3f23450b9c8b9 100644 --- a/administrator/components/com_associations/Field/ItemlanguageField.php +++ b/administrator/components/com_associations/Field/ItemlanguageField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,19 +12,17 @@ defined('JPATH_BASE') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Language\LanguageHelper; use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper; use Joomla\Utilities\ArrayHelper; -FormHelper::loadFieldClass('list'); - /** * Field listing item languages * * @since 3.7.0 */ -class ItemlanguageField extends \JFormFieldList +class ItemlanguageField extends ListField { /** * The form field type. diff --git a/administrator/components/com_associations/Field/ItemtypeField.php b/administrator/components/com_associations/Field/ItemtypeField.php index 76cdec8dfb7b0..cdbe2f89887d1 100644 --- a/administrator/components/com_associations/Field/ItemtypeField.php +++ b/administrator/components/com_associations/Field/ItemtypeField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Field/Modal/AssociationField.php b/administrator/components/com_associations/Field/Modal/AssociationField.php index f59f5daffaee1..7dbca9a9dce60 100644 --- a/administrator/components/com_associations/Field/Modal/AssociationField.php +++ b/administrator/components/com_associations/Field/Modal/AssociationField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Helper/AssociationsHelper.php b/administrator/components/com_associations/Helper/AssociationsHelper.php index f5ab84ecb973b..564e42d1aa61b 100644 --- a/administrator/components/com_associations/Helper/AssociationsHelper.php +++ b/administrator/components/com_associations/Helper/AssociationsHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Model/AssociationModel.php b/administrator/components/com_associations/Model/AssociationModel.php index 24d075be85b03..8ed1685a28658 100644 --- a/administrator/components/com_associations/Model/AssociationModel.php +++ b/administrator/components/com_associations/Model/AssociationModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/Model/AssociationsModel.php b/administrator/components/com_associations/Model/AssociationsModel.php index 3ac7b4dea7969..da696f3ebff5d 100644 --- a/administrator/components/com_associations/Model/AssociationsModel.php +++ b/administrator/components/com_associations/Model/AssociationsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/View/Association/HtmlView.php b/administrator/components/com_associations/View/Association/HtmlView.php index 0bdc8326f9a83..c59abab1a6fb0 100644 --- a/administrator/components/com_associations/View/Association/HtmlView.php +++ b/administrator/components/com_associations/View/Association/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -119,6 +119,7 @@ public function display($tpl = null) $reference = ArrayHelper::fromObject(AssociationsHelper::getItem($extensionName, $typeName, $referenceId)); $this->referenceLanguage = $reference[$languageField]; + $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); // Check for special case category $typeNameExploded = explode('.', $typeName); @@ -156,6 +157,7 @@ public function display($tpl = null) $this->targetLanguage = ''; $this->defaultTargetSrc = ''; $this->targetAction = ''; + $this->targetTitle = ''; if ($target = $input->get('target', '', 'string')) { @@ -163,38 +165,19 @@ public function display($tpl = null) $this->targetAction = $matches[2]; $this->targetId = $matches[1]; $this->targetLanguage = $matches[0]; - $task = $this->typeName . '.' . $this->targetAction; - $this->defaultTargetSrc = Route::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId); + $this->targetTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); + $task = $typeName . '.' . $this->targetAction; + + /* + * Let's put the target src into a variable to use in the javascript code + * to avoid race conditions when the reference iframe loads. + */ + $document = Factory::getDocument(); + $document->addScriptOptions('targetSrc', Route::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId)); $this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction); } - /** - * @todo Review later - */ - - // We don't need toolbar in the modal window. - if ($this->getLayout() !== 'modal') - { - $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); - } - else - { - // In article associations modal we need to remove language filter if forcing a language. - // We also need to change the category filter to show show categories with All or the forced language. - if ($forcedLanguage = Factory::getApplication()->input->get('forcedLanguage', '', 'CMD')) - { - // If the language is forced we can't allow to select the language, so transform the language selector filter into a hidden field. - $languageXml = new \SimpleXMLElement(''); - $this->filterForm->setField($languageXml, 'filter', true); - - // Also, unset the active language filter so the search tools is not open by default with this filter. - unset($this->activeFilters['language']); - - // One last changes needed is to change the category filter to just show categories with All language or with the forced language. - $this->filterForm->setFieldAttribute('category_id', 'language', '*,' . $forcedLanguage, 'filter'); - } - } + $this->addToolbar(); parent::display($tpl); } diff --git a/administrator/components/com_associations/View/Associations/HtmlView.php b/administrator/components/com_associations/View/Associations/HtmlView.php index 94875eb9ea8cb..b57b4b8312cd9 100644 --- a/administrator/components/com_associations/View/Associations/HtmlView.php +++ b/administrator/components/com_associations/View/Associations/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -168,6 +168,15 @@ public function display($tpl = null) if (empty($support['catid'])) { $this->filterForm->setFieldAttribute('category_id', 'extension', $extensionName, 'filter'); + + if ($this->getLayout() == 'modal') + { + // We need to change the category filter to only show categories tagged to All or to the forced language. + if ($forcedLanguage = Factory::getApplication()->input->get('forcedLanguage', '', 'CMD')) + { + $this->filterForm->setFieldAttribute('category_id', 'language', '*,' . $forcedLanguage, 'filter'); + } + } } $this->items = $this->get('Items'); diff --git a/administrator/components/com_associations/associations.xml b/administrator/components/com_associations/associations.xml index 17ab7375e95ce..a5d27d97d85c2 100644 --- a/administrator/components/com_associations/associations.xml +++ b/administrator/components/com_associations/associations.xml @@ -3,7 +3,7 @@ com_associations Joomla! Project January 2017 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_associations/layouts/joomla/searchtools/default.php b/administrator/components/com_associations/layouts/joomla/searchtools/default.php index 9a742748203eb..51d0592bd165b 100644 --- a/administrator/components/com_associations/layouts/joomla/searchtools/default.php +++ b/administrator/components/com_associations/layouts/joomla/searchtools/default.php @@ -3,12 +3,14 @@ * @package Joomla.Administrator * @subpackage Layout * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_BASE') or die; +use Joomla\CMS\Factory; + /** @var array $displayData */ $data = $displayData; @@ -28,7 +30,7 @@ // Set some basic options $customOptions = array( 'filtersHidden' => $data['options']['filtersHidden'] ?? empty($data['view']->activeFilters), - 'defaultLimit' => $data['options']['defaultLimit'] ?? JFactory::getApplication()->get('list_limit', 20), + 'defaultLimit' => $data['options']['defaultLimit'] ?? Factory::getApplication()->get('list_limit', 20), 'searchFieldSelector' => '#filter_search', 'orderFieldSelector' => '#list_fullordering', 'formSelector' => !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm', diff --git a/administrator/components/com_associations/services/provider.php b/administrator/components/com_associations/services/provider.php index 522e8c355af1d..a67d61e6a36fa 100644 --- a/administrator/components/com_associations/services/provider.php +++ b/administrator/components/com_associations/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_associations/tmpl/association/edit.php b/administrator/components/com_associations/tmpl/association/edit.php index 5711f525f919e..474dca3bba2a0 100644 --- a/administrator/components/com_associations/tmpl/association/edit.php +++ b/administrator/components/com_associations/tmpl/association/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -42,6 +42,7 @@ data-action="edit" data-item="typeName; ?>" data-id="referenceId; ?>" + data-title="referenceTitle; ?>" data-language="referenceLanguage; ?>" data-editurl="editUri); ?>"> @@ -60,6 +61,7 @@ data-action="targetAction; ?>" data-item="typeName; ?>" data-id="targetId; ?>" + data-title="targetTitle; ?>" data-language="targetLanguage; ?>" data-editurl="editUri); ?>"> diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index 3281e01fdd57d..533c4c91a5469 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -94,29 +94,31 @@ - level)) : ?> - $item->level)); ?> - - - editor, $item->checked_out_time, 'associations.', $canCheckin); ?> - - - '; ?> - - escape($item->title); ?> - - escape($item->title); ?> - - typeFields['alias'])) : ?> - - escape($item->alias)); ?> - - - typeFields['catid'])) : ?> -
- escape($item->category_title); ?> -
- +
+ level)) : ?> + $item->level)); ?> + + + editor, $item->checked_out_time, 'associations.', $canCheckin); ?> + + + '; ?> + + escape($item->title); ?> + + escape($item->title); ?> + + typeFields['alias'])) : ?> + + escape($item->alias)); ?> + + + typeFields['catid'])) : ?> +
+ escape($item->category_title); ?> +
+ +
diff --git a/administrator/components/com_associations/tmpl/associations/modal.php b/administrator/components/com_associations/tmpl/associations/modal.php index 2b00b639ef45a..de4bbee63f0fc 100644 --- a/administrator/components/com_associations/tmpl/associations/modal.php +++ b/administrator/components/com_associations/tmpl/associations/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_associations * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Controller/BannerController.php b/administrator/components/com_banners/Controller/BannerController.php index f970f019d8c3f..b3d5ae3fb4b29 100644 --- a/administrator/components/com_banners/Controller/BannerController.php +++ b/administrator/components/com_banners/Controller/BannerController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,10 +11,8 @@ defined('_JEXEC') or die; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -103,7 +101,7 @@ protected function allowEdit($data = array(), $key = 'id') */ public function batch($model = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Set the model $model = $this->getModel('Banner', '', array()); diff --git a/administrator/components/com_banners/Controller/BannersController.php b/administrator/components/com_banners/Controller/BannersController.php index 7971f7d70d86f..96842eb1b6d3a 100644 --- a/administrator/components/com_banners/Controller/BannersController.php +++ b/administrator/components/com_banners/Controller/BannersController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,7 +15,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; -use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -76,7 +75,7 @@ public function getModel($name = 'Banner', $prefix = 'Administrator', $config = public function sticky_publish() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); $values = array('sticky_publish' => 1, 'sticky_unpublish' => 0); diff --git a/administrator/components/com_banners/Controller/ClientController.php b/administrator/components/com_banners/Controller/ClientController.php index 214e211c0a990..63203c2e9e3a7 100644 --- a/administrator/components/com_banners/Controller/ClientController.php +++ b/administrator/components/com_banners/Controller/ClientController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Controller/ClientsController.php b/administrator/components/com_banners/Controller/ClientsController.php index 65321aa7d2e56..7b045ba4b4b42 100644 --- a/administrator/components/com_banners/Controller/ClientsController.php +++ b/administrator/components/com_banners/Controller/ClientsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Controller/DisplayController.php b/administrator/components/com_banners/Controller/DisplayController.php index a9457dec008d4..e338dbc6d56ac 100644 --- a/administrator/components/com_banners/Controller/DisplayController.php +++ b/administrator/components/com_banners/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Controller/TracksController.php b/administrator/components/com_banners/Controller/TracksController.php index 79ccb281d3e96..479073a1b8d6f 100644 --- a/administrator/components/com_banners/Controller/TracksController.php +++ b/administrator/components/com_banners/Controller/TracksController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,7 +15,6 @@ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; -use Joomla\CMS\Session\Session; /** * Tracks list controller class. @@ -58,7 +57,7 @@ public function getModel($name = 'Tracks', $prefix = 'Administrator', $config = public function delete() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Get the model. /** @var \Joomla\Component\Banners\Administrator\Model\TracksModel $model */ diff --git a/administrator/components/com_banners/Extension/BannersComponent.php b/administrator/components/com_banners/Extension/BannersComponent.php index 08bf8534db74a..ae4ea87412816 100644 --- a/administrator/components/com_banners/Extension/BannersComponent.php +++ b/administrator/components/com_banners/Extension/BannersComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Field/BannerclientField.php b/administrator/components/com_banners/Field/BannerclientField.php index 92a3a4af4d993..222d081c1ef61 100644 --- a/administrator/components/com_banners/Field/BannerclientField.php +++ b/administrator/components/com_banners/Field/BannerclientField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,17 +11,16 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Form\FormHelper; use Joomla\Component\Banners\Administrator\Helper\BannersHelper; -FormHelper::loadFieldClass('list'); - /** * Bannerclient field. * * @since 1.6 */ -class BannerclientField extends \JFormFieldList +class BannerclientField extends ListField { /** * The form field type. diff --git a/administrator/components/com_banners/Field/ClicksField.php b/administrator/components/com_banners/Field/ClicksField.php index ec4dacc0c09a4..671e6e57d2cd0 100644 --- a/administrator/components/com_banners/Field/ClicksField.php +++ b/administrator/components/com_banners/Field/ClicksField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Field/ImpmadeField.php b/administrator/components/com_banners/Field/ImpmadeField.php index e8bcd3fcf4314..bf2c02f2441b5 100644 --- a/administrator/components/com_banners/Field/ImpmadeField.php +++ b/administrator/components/com_banners/Field/ImpmadeField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Field/ImptotalField.php b/administrator/components/com_banners/Field/ImptotalField.php index 3f58f7101c215..9138ee670db8e 100644 --- a/administrator/components/com_banners/Field/ImptotalField.php +++ b/administrator/components/com_banners/Field/ImptotalField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Helper/BannersHelper.php b/administrator/components/com_banners/Helper/BannersHelper.php index 6dd50ebef42a9..b6f2781958f30 100644 --- a/administrator/components/com_banners/Helper/BannersHelper.php +++ b/administrator/components/com_banners/Helper/BannersHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Model/BannerModel.php b/administrator/components/com_banners/Model/BannerModel.php index 83c86cc92d45e..08b0d073d2a56 100644 --- a/administrator/components/com_banners/Model/BannerModel.php +++ b/administrator/components/com_banners/Model/BannerModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -103,131 +103,6 @@ protected function batchClient($value, $pks, $contexts) return true; } - /** - * Batch copy items to a new category or current. - * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. - * - * @return mixed An array of new IDs on success, boolean false on failure. - * - * @since 2.5 - */ - protected function batchCopy($value, $pks, $contexts) - { - $categoryId = (int) $value; - - /** @var \Joomla\Component\Banners\Administrator\Table\Banner $table */ - $table = $this->getTable(); - $newIds = array(); - - // Check that the category exists - if ($categoryId) - { - $categoryTable = Table::getInstance('Category'); - - if (!$categoryTable->load($categoryId)) - { - if ($error = $categoryTable->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - - $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); - - return false; - } - } - - if (empty($categoryId)) - { - $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); - - return false; - } - - // Check that the user has create permission for the component - if (!Factory::getUser()->authorise('core.create', 'com_banners.category.' . $categoryId)) - { - $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE')); - - return false; - } - - // Parent exists so we let's proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $table->reset(); - - // Check that the row actually exists - if (!$table->load($pk)) - { - if ($error = $table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - - // Not fatal error - $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); - $table->name = $data['0']; - $table->alias = $data['1']; - - // Reset the ID because we are making a copy - $table->id = 0; - - // New category ID - $table->catid = $categoryId; - - // Unpublish because we are making a copy - $table->state = 0; - - // TODO: Deal with ordering? - // $table->ordering = 1; - - // Check the row. - if (!$table->check()) - { - $this->setError($table->getError()); - - return false; - } - - // Store the row. - if (!$table->store()) - { - $this->setError($table->getError()); - - return false; - } - - // Get the new item ID - $newId = $table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; - } - - // Clean the cache - $this->cleanCache(); - - return $newIds; - } - /** * Method to test whether a record can be deleted. * @@ -255,6 +130,25 @@ protected function canDelete($record) } } + /** + * A method to preprocess generating a new title in order to allow tables with alternative names + * for alias and title to use the batch move and copy methods + * + * @param integer $categoryId The target category id + * @param Table $table The JTable within which move or copy is taking place + * + * @return void + * + * @since 3.8.12 + */ + public function generateTitle($categoryId, $table) + { + // Alter the title & alias + $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); + $table->name = $data['0']; + $table->alias = $data['1']; + } + /** * Method to test whether a record can have its state changed. * diff --git a/administrator/components/com_banners/Model/BannersModel.php b/administrator/components/com_banners/Model/BannersModel.php index e9f204dfc371b..779559ff5bff1 100644 --- a/administrator/components/com_banners/Model/BannersModel.php +++ b/administrator/components/com_banners/Model/BannersModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Model/ClientModel.php b/administrator/components/com_banners/Model/ClientModel.php index 3a0b4c7f1d242..ee037e1c33169 100644 --- a/administrator/components/com_banners/Model/ClientModel.php +++ b/administrator/components/com_banners/Model/ClientModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Model/ClientsModel.php b/administrator/components/com_banners/Model/ClientsModel.php index db8a35c3731ff..b7080aca29392 100644 --- a/administrator/components/com_banners/Model/ClientsModel.php +++ b/administrator/components/com_banners/Model/ClientsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Model/DownloadModel.php b/administrator/components/com_banners/Model/DownloadModel.php index 4d209160d5a7c..59bb80c86c223 100644 --- a/administrator/components/com_banners/Model/DownloadModel.php +++ b/administrator/components/com_banners/Model/DownloadModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Model/TracksModel.php b/administrator/components/com_banners/Model/TracksModel.php index 2005d3435a59e..e8ecb60134915 100644 --- a/administrator/components/com_banners/Model/TracksModel.php +++ b/administrator/components/com_banners/Model/TracksModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Banners\Administrator\Model; diff --git a/administrator/components/com_banners/Service/Html/Banner.php b/administrator/components/com_banners/Service/Html/Banner.php index f1cc73883da07..218074dd6475d 100644 --- a/administrator/components/com_banners/Service/Html/Banner.php +++ b/administrator/components/com_banners/Service/Html/Banner.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Table/BannerTable.php b/administrator/components/com_banners/Table/BannerTable.php index 5f791b51ba564..29447f02f7c43 100644 --- a/administrator/components/com_banners/Table/BannerTable.php +++ b/administrator/components/com_banners/Table/BannerTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/Table/ClientTable.php b/administrator/components/com_banners/Table/ClientTable.php index 152a60b9d88fc..e7c9a96feceac 100644 --- a/administrator/components/com_banners/Table/ClientTable.php +++ b/administrator/components/com_banners/Table/ClientTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/View/Banner/HtmlView.php b/administrator/components/com_banners/View/Banner/HtmlView.php index 1e106639c3f36..93b07000683b9 100644 --- a/administrator/components/com_banners/View/Banner/HtmlView.php +++ b/administrator/components/com_banners/View/Banner/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -97,7 +97,7 @@ protected function addToolbar() // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) { - $toolbarButtons[] = ['apply', 'banner.apply']; + ToolbarHelper::apply('banner.apply'); $toolbarButtons[] = ['save', 'banner.save']; if ($canDo->get('core.create')) diff --git a/administrator/components/com_banners/View/Banners/HtmlView.php b/administrator/components/com_banners/View/Banners/HtmlView.php index 340d9145ac98c..0c8feef3e3024 100644 --- a/administrator/components/com_banners/View/Banners/HtmlView.php +++ b/administrator/components/com_banners/View/Banners/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -120,7 +120,7 @@ protected function addToolbar() if ($canDo->get('core.edit.state') || ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))) { - $dropdown = $toolbar->dropdownButton('status') + $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('fa fa-globe') diff --git a/administrator/components/com_banners/View/Client/HtmlView.php b/administrator/components/com_banners/View/Client/HtmlView.php index b758104cdc92f..c650e5db3345d 100644 --- a/administrator/components/com_banners/View/Client/HtmlView.php +++ b/administrator/components/com_banners/View/Client/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -104,7 +104,7 @@ protected function addToolbar() // If not checked out, can save the item. if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) { - $toolbarButtons[] = ['apply', 'client.apply']; + ToolbarHelper::apply('client.apply'); $toolbarButtons[] = ['save', 'client.save']; } diff --git a/administrator/components/com_banners/View/Clients/HtmlView.php b/administrator/components/com_banners/View/Clients/HtmlView.php index 2bde49b0a4db6..b84a8b623c3fa 100644 --- a/administrator/components/com_banners/View/Clients/HtmlView.php +++ b/administrator/components/com_banners/View/Clients/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -98,7 +98,7 @@ protected function addToolbar() if ($canDo->get('core.edit.state') || $canDo->get('core.admin')) { - $dropdown = $toolbar->dropdownButton('status') + $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('fa fa-globe') diff --git a/administrator/components/com_banners/View/Download/HtmlView.php b/administrator/components/com_banners/View/Download/HtmlView.php index b727005dc0d62..1e2c36fb3e423 100644 --- a/administrator/components/com_banners/View/Download/HtmlView.php +++ b/administrator/components/com_banners/View/Download/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/View/Tracks/HtmlView.php b/administrator/components/com_banners/View/Tracks/HtmlView.php index 40a0692bb740a..eb3ec223f24dd 100644 --- a/administrator/components/com_banners/View/Tracks/HtmlView.php +++ b/administrator/components/com_banners/View/Tracks/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/View/Tracks/RawView.php b/administrator/components/com_banners/View/Tracks/RawView.php index fb18316ba5d4a..f229154af24a2 100644 --- a/administrator/components/com_banners/View/Tracks/RawView.php +++ b/administrator/components/com_banners/View/Tracks/RawView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/banners.xml b/administrator/components/com_banners/banners.xml index 7e07bbe50b655..d89c6d605aa2b 100644 --- a/administrator/components/com_banners/banners.xml +++ b/administrator/components/com_banners/banners.xml @@ -3,7 +3,7 @@ com_banners Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_banners/helpers/banners.php b/administrator/components/com_banners/helpers/banners.php index 443a949152a9c..a3a4308aa60ea 100644 --- a/administrator/components/com_banners/helpers/banners.php +++ b/administrator/components/com_banners/helpers/banners.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/services/provider.php b/administrator/components/com_banners/services/provider.php index 8df60fdd6e65a..66d911578cbad 100644 --- a/administrator/components/com_banners/services/provider.php +++ b/administrator/components/com_banners/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/banner/edit.php b/administrator/components/com_banners/tmpl/banner/edit.php index 59eeca131a9ed..a45813e861a5e 100644 --- a/administrator/components/com_banners/tmpl/banner/edit.php +++ b/administrator/components/com_banners/tmpl/banner/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/banners/default.php b/administrator/components/com_banners/tmpl/banners/default.php index 06dbe2d2817b5..7e5f99dc6015e 100644 --- a/administrator/components/com_banners/tmpl/banners/default.php +++ b/administrator/components/com_banners/tmpl/banners/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/banners/default_batch_body.php b/administrator/components/com_banners/tmpl/banners/default_batch_body.php index 933f3210e85bb..0399a65c84dd6 100644 --- a/administrator/components/com_banners/tmpl/banners/default_batch_body.php +++ b/administrator/components/com_banners/tmpl/banners/default_batch_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/banners/default_batch_footer.php b/administrator/components/com_banners/tmpl/banners/default_batch_footer.php index e988e71dcbc01..3c491481c34f5 100644 --- a/administrator/components/com_banners/tmpl/banners/default_batch_footer.php +++ b/administrator/components/com_banners/tmpl/banners/default_batch_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,9 +12,9 @@ use Joomla\CMS\Language\Text; ?> - + + diff --git a/administrator/components/com_banners/tmpl/client/edit.php b/administrator/components/com_banners/tmpl/client/edit.php index 18c5d1234a855..a844c2b9074e2 100644 --- a/administrator/components/com_banners/tmpl/client/edit.php +++ b/administrator/components/com_banners/tmpl/client/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/clients/default.php b/administrator/components/com_banners/tmpl/clients/default.php index 2efe51251c5b6..5c7028bcb2912 100644 --- a/administrator/components/com_banners/tmpl/clients/default.php +++ b/administrator/components/com_banners/tmpl/clients/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/download/default.php b/administrator/components/com_banners/tmpl/download/default.php index a72f377977424..a0e1c4cff1d17 100644 --- a/administrator/components/com_banners/tmpl/download/default.php +++ b/administrator/components/com_banners/tmpl/download/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_banners/tmpl/tracks/default.php b/administrator/components/com_banners/tmpl/tracks/default.php index 9f3073dcac15a..743a4363e8e86 100644 --- a/administrator/components/com_banners/tmpl/tracks/default.php +++ b/administrator/components/com_banners/tmpl/tracks/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cache/Controller/DisplayController.php b/administrator/components/com_cache/Controller/DisplayController.php index 7f9a7805533ee..07dd644e7d977 100644 --- a/administrator/components/com_cache/Controller/DisplayController.php +++ b/administrator/components/com_cache/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,7 +13,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; -use Joomla\CMS\Session\Session; use Joomla\Component\Cache\Administrator\Helper\CacheHelper; /** @@ -63,9 +62,6 @@ public function display($cachable = false, $urlparams = false) // Push document object into the view. $view->document = $document; - // Load the submenu. - CacheHelper::addSubmenu($this->input->get('view', 'cache')); - $view->display(); } } @@ -78,7 +74,7 @@ public function display($cachable = false, $urlparams = false) public function delete() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $cid = $this->input->post->get('cid', array(), 'array'); @@ -113,7 +109,7 @@ public function delete() public function deleteAll() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $app = $this->app; $model = $this->getModel('cache'); @@ -154,7 +150,7 @@ public function deleteAll() public function purge() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); if (!$this->getModel('cache')->purge()) { diff --git a/administrator/components/com_cache/Helper/CacheHelper.php b/administrator/components/com_cache/Helper/CacheHelper.php index 8a0f2a5795dcb..7966d034b3388 100644 --- a/administrator/components/com_cache/Helper/CacheHelper.php +++ b/administrator/components/com_cache/Helper/CacheHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -20,32 +20,5 @@ */ class CacheHelper { - /** - * Configure the Linkbar. - * - * @param string $vName The name of the active view. - * - * @return void - * - * @since 1.6 - */ - public static function addSubmenu($vName) - { - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_CHECKIN'), - 'index.php?option=com_checkin', - $vName == 'com_checkin' - ); - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_CLEAR_CACHE'), - 'index.php?option=com_cache', - $vName == 'cache' - ); - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'), - 'index.php?option=com_cache&view=purge', - $vName == 'purge' - ); - } } diff --git a/administrator/components/com_cache/Model/CacheModel.php b/administrator/components/com_cache/Model/CacheModel.php index 5ff19411dc931..33629413ea2ad 100644 --- a/administrator/components/com_cache/Model/CacheModel.php +++ b/administrator/components/com_cache/Model/CacheModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cache/View/Cache/HtmlView.php b/administrator/components/com_cache/View/Cache/HtmlView.php index 2f85028bbce9a..38329dab5696c 100644 --- a/administrator/components/com_cache/View/Cache/HtmlView.php +++ b/administrator/components/com_cache/View/Cache/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -52,7 +52,6 @@ public function display($tpl = null) } $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); parent::display($tpl); } diff --git a/administrator/components/com_cache/View/Purge/HtmlView.php b/administrator/components/com_cache/View/Purge/HtmlView.php index db854e08336e6..f6b640ce3e695 100644 --- a/administrator/components/com_cache/View/Purge/HtmlView.php +++ b/administrator/components/com_cache/View/Purge/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -33,7 +33,6 @@ class HtmlView extends BaseHtmlView public function display($tpl = null) { $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); parent::display($tpl); } diff --git a/administrator/components/com_cache/cache.xml b/administrator/components/com_cache/cache.xml index 1aa8d2c19ec2a..dddf8700843ba 100644 --- a/administrator/components/com_cache/cache.xml +++ b/administrator/components/com_cache/cache.xml @@ -3,7 +3,7 @@ com_cache Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_cache/services/provider.php b/administrator/components/com_cache/services/provider.php index 95e5944e92f6e..cd2e7baa1cf0c 100644 --- a/administrator/components/com_cache/services/provider.php +++ b/administrator/components/com_cache/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cache/tmpl/cache/default.php b/administrator/components/com_cache/tmpl/cache/default.php index 33bd9198ed50b..169576262d66f 100644 --- a/administrator/components/com_cache/tmpl/cache/default.php +++ b/administrator/components/com_cache/tmpl/cache/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -21,10 +21,7 @@ ?>
-
- sidebar; ?> -
-
+
$this)); ?> data) > 0) : ?> diff --git a/administrator/components/com_cache/tmpl/purge/default.php b/administrator/components/com_cache/tmpl/purge/default.php index 18c5d46a8281f..7b0e26d3e459d 100644 --- a/administrator/components/com_cache/tmpl/purge/default.php +++ b/administrator/components/com_cache/tmpl/purge/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cache * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,10 +17,7 @@
-
- sidebar; ?> -
-
+

diff --git a/administrator/components/com_categories/Controller/AjaxController.php b/administrator/components/com_categories/Controller/AjaxController.php new file mode 100644 index 0000000000000..234c1abc91a33 --- /dev/null +++ b/administrator/components/com_categories/Controller/AjaxController.php @@ -0,0 +1,95 @@ +input->get('extension'); + + $assocId = $this->input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JsonResponse(null, Text::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $this->input->get('excludeLang', '', 'STRING'); + + $associations = Associations::getAssociations($extension, '#__categories', 'com_categories.item', (int) $assocId, 'id', 'alias', ''); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables'); + $categoryTable = Table::getInstance('Category', 'JTable'); + + foreach ($associations as $lang => $association) + { + $categoryTable->load($association->id); + $associations[$lang]->title = $categoryTable->title; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = Text::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JsonResponse($associations, $message); + } + } +} diff --git a/administrator/components/com_categories/Controller/CategoriesController.php b/administrator/components/com_categories/Controller/CategoriesController.php index 979e954ac1e46..9703c8db66b45 100644 --- a/administrator/components/com_categories/Controller/CategoriesController.php +++ b/administrator/components/com_categories/Controller/CategoriesController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,7 +14,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -49,7 +48,7 @@ public function getModel($name = 'Category', $prefix = 'Administrator', $config */ public function rebuild() { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $extension = $this->input->get('extension'); $this->setRedirect(Route::_('index.php?option=com_categories&view=categories&extension=' . $extension, false)); @@ -80,7 +79,7 @@ public function rebuild() */ public function delete() { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Get items to remove from the request. $cid = $this->input->get('cid', array(), 'array'); diff --git a/administrator/components/com_categories/Controller/CategoryController.php b/administrator/components/com_categories/Controller/CategoryController.php index 6444f4988139e..397eeeb0c971c 100644 --- a/administrator/components/com_categories/Controller/CategoryController.php +++ b/administrator/components/com_categories/Controller/CategoryController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -126,7 +126,7 @@ protected function allowEdit($data = array(), $key = 'parent_id') */ public function batch($model = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Set the model /** @var \Joomla\Component\Categories\Administrator\Model\CategoryModel $model */ diff --git a/administrator/components/com_categories/Controller/DisplayController.php b/administrator/components/com_categories/Controller/DisplayController.php index a0bee769057af..b7b6ffaa19c1d 100644 --- a/administrator/components/com_categories/Controller/DisplayController.php +++ b/administrator/components/com_categories/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Dispatcher/Dispatcher.php b/administrator/components/com_categories/Dispatcher/Dispatcher.php index 723ddd44bde36..92f034c89d60d 100644 --- a/administrator/components/com_categories/Dispatcher/Dispatcher.php +++ b/administrator/components/com_categories/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,6 +11,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Access\Exception\NotAllowed; use Joomla\CMS\Dispatcher\ComponentDispatcher; /** diff --git a/administrator/components/com_categories/Extension/CategoriesComponent.php b/administrator/components/com_categories/Extension/CategoriesComponent.php index 9ae0cbe749041..f35f225125e43 100644 --- a/administrator/components/com_categories/Extension/CategoriesComponent.php +++ b/administrator/components/com_categories/Extension/CategoriesComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Field/CategoryeditField.php b/administrator/components/com_categories/Field/CategoryeditField.php index 64262dbab6b63..94581ea586310 100644 --- a/administrator/components/com_categories/Field/CategoryeditField.php +++ b/administrator/components/com_categories/Field/CategoryeditField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -349,11 +349,11 @@ protected function getInput() { $data = $this->getLayoutData(); - $data['options'] = $this->getOptions(); - $data['allowCustom'] = $this->allowAdd; - $data['customFields'] = (boolean) $this->element['custom-fields-enabled']; - $data['customFieldsCatId'] = (string) $this->element['custom-fields-cat-id']; - $data['customFieldsSection'] = (string) $this->element['custom-fields-section']; + $data['options'] = $this->getOptions(); + $data['allowCustom'] = $this->allowAdd; + $data['refreshPage'] = (boolean) $this->element['refresh-enabled']; + $data['refreshCatId'] = (string) $this->element['refresh-cat-id']; + $data['refreshSection'] = (string) $this->element['refresh-section']; $renderer = $this->getRenderer($this->layout); $renderer->setComponent('com_categories'); diff --git a/administrator/components/com_categories/Field/Modal/CategoryField.php b/administrator/components/com_categories/Field/Modal/CategoryField.php index 728a9fdb7ab1e..ced4aeb7aacb5 100644 --- a/administrator/components/com_categories/Field/Modal/CategoryField.php +++ b/administrator/components/com_categories/Field/Modal/CategoryField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,6 +14,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Form\FormField; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Session\Session; @@ -50,10 +51,13 @@ protected function getInput() $extension = (string) Factory::getApplication()->input->get('extension', 'com_content'); } - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != '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'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language. Factory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR); @@ -85,6 +89,8 @@ function jSelectCategory_" . $this->id . "(id, title, object) { } "); + Text::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -145,55 +151,72 @@ function jSelectCategory_" . $this->id . "(id, title, object) { // Select category button. if ($allowSelect) { - $html .= '' . ' ' . Text::_('JSELECT') - . ''; + . ''; } // New category button. if ($allowNew) { - $html .= '' . ' ' . Text::_('JACTION_CREATE') - . ''; + . ''; } // Edit category button. if ($allowEdit) { - $html .= '' . ' ' . Text::_('JACTION_EDIT') - . ''; + . ''; } // Clear category button. if ($allowClear) { - $html .= '' . '' . Text::_('JCLEAR') - . ''; + . ''; + } + + // Propagate category button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectCategory_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; } if ($allowSelect || $allowNew || $allowEdit || $allowClear) diff --git a/administrator/components/com_categories/Helper/CategoriesHelper.php b/administrator/components/com_categories/Helper/CategoriesHelper.php index 3dc57492569d7..9f950944c6231 100644 --- a/administrator/components/com_categories/Helper/CategoriesHelper.php +++ b/administrator/components/com_categories/Helper/CategoriesHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Helper/CategoryAssociationHelper.php b/administrator/components/com_categories/Helper/CategoryAssociationHelper.php index 615e6d7ac9b16..fca90862e657e 100644 --- a/administrator/components/com_categories/Helper/CategoryAssociationHelper.php +++ b/administrator/components/com_categories/Helper/CategoryAssociationHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Model/CategoriesModel.php b/administrator/components/com_categories/Model/CategoriesModel.php index f0c264cc8b7c9..1e551d5482d8f 100644 --- a/administrator/components/com_categories/Model/CategoriesModel.php +++ b/administrator/components/com_categories/Model/CategoriesModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Model/CategoryModel.php b/administrator/components/com_categories/Model/CategoryModel.php index c727a1447292e..68770ca10e529 100644 --- a/administrator/components/com_categories/Model/CategoryModel.php +++ b/administrator/components/com_categories/Model/CategoryModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -490,6 +490,7 @@ protected function preprocessForm(\JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_categories/Service/HTML/AdministratorService.php b/administrator/components/com_categories/Service/HTML/AdministratorService.php index 68a0018871299..2f7758819dcba 100644 --- a/administrator/components/com_categories/Service/HTML/AdministratorService.php +++ b/administrator/components/com_categories/Service/HTML/AdministratorService.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/Table/CategoryTable.php b/administrator/components/com_categories/Table/CategoryTable.php index ed284901ae432..d310a2e0d66f8 100644 --- a/administrator/components/com_categories/Table/CategoryTable.php +++ b/administrator/components/com_categories/Table/CategoryTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/View/Categories/HtmlView.php b/administrator/components/com_categories/View/Categories/HtmlView.php index 1138bdcd69373..5335877884fd7 100644 --- a/administrator/components/com_categories/View/Categories/HtmlView.php +++ b/administrator/components/com_categories/View/Categories/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/View/Category/HtmlView.php b/administrator/components/com_categories/View/Category/HtmlView.php index 7e21387065751..8b9df5e6db107 100644 --- a/administrator/components/com_categories/View/Category/HtmlView.php +++ b/administrator/components/com_categories/View/Category/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -16,6 +16,7 @@ use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; @@ -186,9 +187,9 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew && (count($user->getAuthorisedCategories($component, 'core.create')) > 0)) { + ToolbarHelper::apply('category.apply'); ToolbarHelper::saveGroup( [ - ['apply', 'category.apply'], ['save', 'category.save'], ['save2new', 'category.save2new'] ], @@ -209,7 +210,8 @@ protected function addToolbar() // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - $toolbarButtons[] = ['apply', 'category.apply']; + ToolbarHelper::apply('category.apply'); + $toolbarButtons[] = ['save', 'category.save']; if ($canDo->get('core.create')) @@ -235,6 +237,11 @@ protected function addToolbar() ToolbarHelper::versions($typeAlias, $this->item->id); } + if (Associations::isEnabled() && ComponentHelper::isEnabled('com_associations')) + { + ToolbarHelper::custom('category.editAssociations', 'contract', 'contract', 'JTOOLBAR_ASSOCIATIONS', false, false); + } + ToolbarHelper::cancel('category.cancel', 'JTOOLBAR_CLOSE'); } diff --git a/administrator/components/com_categories/categories.xml b/administrator/components/com_categories/categories.xml index d6d0e6b240875..08aac30d155ea 100644 --- a/administrator/components/com_categories/categories.xml +++ b/administrator/components/com_categories/categories.xml @@ -3,7 +3,7 @@ com_categories Joomla! Project December 2007 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_categories/forms/category.xml b/administrator/components/com_categories/forms/category.xml index 61a5053e5c3b6..1f1dc926ec352 100644 --- a/administrator/components/com_categories/forms/category.xml +++ b/administrator/components/com_categories/forms/category.xml @@ -204,7 +204,6 @@ name="tags" type="tag" label="JTAG" - class="col-sm-12" multiple="true" /> diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php index 1c919ea1c5e9f..fed2fdcebdf2d 100644 --- a/administrator/components/com_categories/helpers/categories.php +++ b/administrator/components/com_categories/helpers/categories.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php index 7843737d2074a..e21c1eb635d53 100644 --- a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php +++ b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php @@ -3,7 +3,7 @@ * @package Joomla.Site * @subpackage Layout * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -119,10 +119,15 @@ $html[] = HTMLHelper::_('select.genericlist', $options, $name, trim($attr), 'value', 'text', $value, $id); } -if ($customFields === true) +if ($refreshPage === true) { - $attr2 .= ' data-custom-fields-catid="' . $customFieldsCatId . '" data-custom-fields-section="' . $customFieldsSection . '"'; + $attr2 .= ' data-refresh-catid="' . $refreshCatId . '" data-refresh-section="' . $refreshSection . '"'; $attr2 .= ' onchange="Joomla.categoryHasChanged(this)"'; + + HTMLHelper::_('script', 'layouts/joomla/form/field/category-change.min.js', ['version' => 'auto', 'relative' => true], ['defer' => true]); + + // Pass the element id to the javascript + Factory::getDocument()->addScriptOptions('category-change', $id); } else { @@ -134,11 +139,7 @@ Factory::getDocument()->getWebAssetManager()->enableAsset('choicesjs'); -// Pass the element id to the javascript -\Joomla\CMS\Factory::getDocument()->addScriptOptions('category-change', $id); - -HTMLHelper::_('script', 'layouts/joomla/form/field/category-change.min.js', ['version' => 'auto', 'relative' => true], ['defer' => true]); -HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]); +HTMLHelper::_('webcomponent', 'system/fields/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]); ?> > diff --git a/administrator/components/com_categories/services/provider.php b/administrator/components/com_categories/services/provider.php index 793bda862b295..c616c63583c09 100644 --- a/administrator/components/com_categories/services/provider.php +++ b/administrator/components/com_categories/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index 42473f06645e8..6a4454d9d9ddc 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/categories/default_batch_body.php b/administrator/components/com_categories/tmpl/categories/default_batch_body.php index bcaf2f842c9c8..20bfdaf1e4ea3 100644 --- a/administrator/components/com_categories/tmpl/categories/default_batch_body.php +++ b/administrator/components/com_categories/tmpl/categories/default_batch_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_categories/tmpl/categories/default_batch_footer.php b/administrator/components/com_categories/tmpl/categories/default_batch_footer.php index a35314fd419c7..a0ebaf58d232e 100644 --- a/administrator/components/com_categories/tmpl/categories/default_batch_footer.php +++ b/administrator/components/com_categories/tmpl/categories/default_batch_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -11,9 +11,9 @@ use Joomla\CMS\Language\Text; ?> - + + \ No newline at end of file + diff --git a/administrator/components/com_categories/tmpl/categories/modal.php b/administrator/components/com_categories/tmpl/categories/modal.php index a7518b692728c..812cb0ecd3df7 100644 --- a/administrator/components/com_categories/tmpl/categories/modal.php +++ b/administrator/components/com_categories/tmpl/categories/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/edit.php b/administrator/components/com_categories/tmpl/category/edit.php index 7bfcc035e7748..f59dc02b9665d 100644 --- a/administrator/components/com_categories/tmpl/category/edit.php +++ b/administrator/components/com_categories/tmpl/category/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/edit_associations.php b/administrator/components/com_categories/tmpl/category/edit_associations.php index b6e6c5f359070..06b51884993d8 100644 --- a/administrator/components/com_categories/tmpl/category/edit_associations.php +++ b/administrator/components/com_categories/tmpl/category/edit_associations.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/edit_metadata.php b/administrator/components/com_categories/tmpl/category/edit_metadata.php index f3a07be357272..5c6cdc06099f3 100644 --- a/administrator/components/com_categories/tmpl/category/edit_metadata.php +++ b/administrator/components/com_categories/tmpl/category/edit_metadata.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/modal.php b/administrator/components/com_categories/tmpl/category/modal.php index a03977ef93e63..0f8ebe9e519a0 100644 --- a/administrator/components/com_categories/tmpl/category/modal.php +++ b/administrator/components/com_categories/tmpl/category/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/modal_associations.php b/administrator/components/com_categories/tmpl/category/modal_associations.php index b6e6c5f359070..06b51884993d8 100644 --- a/administrator/components/com_categories/tmpl/category/modal_associations.php +++ b/administrator/components/com_categories/tmpl/category/modal_associations.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/modal_extrafields.php b/administrator/components/com_categories/tmpl/category/modal_extrafields.php index c3a7e055cc328..8293395e3cd9c 100644 --- a/administrator/components/com_categories/tmpl/category/modal_extrafields.php +++ b/administrator/components/com_categories/tmpl/category/modal_extrafields.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/modal_metadata.php b/administrator/components/com_categories/tmpl/category/modal_metadata.php index f3a07be357272..5c6cdc06099f3 100644 --- a/administrator/components/com_categories/tmpl/category/modal_metadata.php +++ b/administrator/components/com_categories/tmpl/category/modal_metadata.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_categories/tmpl/category/modal_options.php b/administrator/components/com_categories/tmpl/category/modal_options.php index 165284978c582..77e7172fd3560 100644 --- a/administrator/components/com_categories/tmpl/category/modal_options.php +++ b/administrator/components/com_categories/tmpl/category/modal_options.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_categories * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_checkin/Controller/DisplayController.php b/administrator/components/com_checkin/Controller/DisplayController.php index 8e9a77248adb5..2e89ffc7d3365 100644 --- a/administrator/components/com_checkin/Controller/DisplayController.php +++ b/administrator/components/com_checkin/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_checkin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,7 +13,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; -use Joomla\CMS\Session\Session; /** * Checkin Controller @@ -40,9 +39,6 @@ class DisplayController extends BaseController */ public function display($cachable = false, $urlparams = array()) { - // Load the submenu. - $this->addSubmenu($this->input->getWord('option', 'com_checkin')); - return parent::display(); } @@ -54,7 +50,7 @@ public function display($cachable = false, $urlparams = array()) public function checkin() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); @@ -74,33 +70,4 @@ public function checkin() $this->setRedirect('index.php?option=com_checkin'); } - - /** - * Configure the Linkbar. - * - * @param string $vName The name of the active view. - * - * @return void - * - * @since 1.6 - */ - protected function addSubmenu($vName) - { - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_CHECKIN'), - 'index.php?option=com_checkin', - $vName == 'com_checkin' - ); - - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_CLEAR_CACHE'), - 'index.php?option=com_cache', - $vName == 'cache' - ); - \JHtmlSidebar::addEntry( - Text::_('JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE'), - 'index.php?option=com_cache&view=purge', - $vName == 'purge' - ); - } } diff --git a/administrator/components/com_checkin/Model/CheckinModel.php b/administrator/components/com_checkin/Model/CheckinModel.php index cc8a3713b9fbd..ff44e341149f8 100644 --- a/administrator/components/com_checkin/Model/CheckinModel.php +++ b/administrator/components/com_checkin/Model/CheckinModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_checkin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_checkin/View/Checkin/HtmlView.php b/administrator/components/com_checkin/View/Checkin/HtmlView.php index b829032a77ae9..ef5613fa8eaf6 100644 --- a/administrator/components/com_checkin/View/Checkin/HtmlView.php +++ b/administrator/components/com_checkin/View/Checkin/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_checkin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -44,13 +44,6 @@ class HtmlView extends BaseHtmlView */ protected $state; - /** - * The sidebar markup - * - * @var string - */ - protected $sidebar; - /** * Form object for search filters * @@ -90,7 +83,6 @@ public function display($tpl = null) } $this->addToolbar(); - $this->sidebar = \JHtmlSidebar::render(); return parent::display($tpl); } diff --git a/administrator/components/com_checkin/checkin.xml b/administrator/components/com_checkin/checkin.xml index bfb95d85f6097..66ade393319aa 100644 --- a/administrator/components/com_checkin/checkin.xml +++ b/administrator/components/com_checkin/checkin.xml @@ -3,7 +3,7 @@ com_checkin Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_checkin/services/provider.php b/administrator/components/com_checkin/services/provider.php index 076ba7a61f52e..08f9f553a10c7 100644 --- a/administrator/components/com_checkin/services/provider.php +++ b/administrator/components/com_checkin/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_checkin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_checkin/tmpl/checkin/default.php b/administrator/components/com_checkin/tmpl/checkin/default.php index 7146da5e2eb70..00bf5b222cda5 100644 --- a/administrator/components/com_checkin/tmpl/checkin/default.php +++ b/administrator/components/com_checkin/tmpl/checkin/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_checkin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -21,10 +21,7 @@ ?>
-
- sidebar; ?> -
-
+
$this)); ?> total > 0) : ?> @@ -34,7 +31,7 @@ - + diff --git a/administrator/components/com_config/Controller/ApplicationController.php b/administrator/components/com_config/Controller/ApplicationController.php index 681f97635ff3a..129e97677e2e1 100644 --- a/administrator/components/com_config/Controller/ApplicationController.php +++ b/administrator/components/com_config/Controller/ApplicationController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Controller/ComponentController.php b/administrator/components/com_config/Controller/ComponentController.php index a1e7654e1c7f6..08be73b113051 100644 --- a/administrator/components/com_config/Controller/ComponentController.php +++ b/administrator/components/com_config/Controller/ComponentController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Controller/DisplayController.php b/administrator/components/com_config/Controller/DisplayController.php index 91eb76f7f204a..7399d0846313f 100644 --- a/administrator/components/com_config/Controller/DisplayController.php +++ b/administrator/components/com_config/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Controller/RequestController.php b/administrator/components/com_config/Controller/RequestController.php index d04b53332e4c4..2e3d1f609251f 100644 --- a/administrator/components/com_config/Controller/RequestController.php +++ b/administrator/components/com_config/Controller/RequestController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Field/ConfigComponentsField.php b/administrator/components/com_config/Field/ConfigComponentsField.php index dab340eb77f6a..db477d0dd7887 100644 --- a/administrator/components/com_config/Field/ConfigComponentsField.php +++ b/administrator/components/com_config/Field/ConfigComponentsField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,17 +13,16 @@ use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\File; +use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Language\Text; use Joomla\Utilities\ArrayHelper; -\JFormHelper::loadFieldClass('List'); - /** * Text Filters form field. * * @since 3.7.0 */ -class ConfigComponentsField extends \JFormFieldList +class ConfigComponentsField extends ListField { /** * The form field type. diff --git a/administrator/components/com_config/Field/FiltersField.php b/administrator/components/com_config/Field/FiltersField.php index dcaed71277e3a..968e05aa935fb 100644 --- a/administrator/components/com_config/Field/FiltersField.php +++ b/administrator/components/com_config/Field/FiltersField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Helper/ConfigHelper.php b/administrator/components/com_config/Helper/ConfigHelper.php index d84b6581bde81..db0d377789958 100644 --- a/administrator/components/com_config/Helper/ConfigHelper.php +++ b/administrator/components/com_config/Helper/ConfigHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/Model/ApplicationModel.php b/administrator/components/com_config/Model/ApplicationModel.php index b457615e15c5f..8540884c38ea5 100644 --- a/administrator/components/com_config/Model/ApplicationModel.php +++ b/administrator/components/com_config/Model/ApplicationModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -305,7 +305,7 @@ public function save($data) $revisedDbo->truncateTable('#__session'); } } - catch (RuntimeException $e) + catch (\RuntimeException $e) { /* * The database API logs errors on failures so we don't need to add any error handling mechanisms here. @@ -513,8 +513,21 @@ public function save($data) $this->cleanCache('_system', 0); $this->cleanCache('_system', 1); + $result = $app->triggerEvent('onApplicationBeforeSave', array($config)); + + // Store the data. + if (in_array(false, $result, true)) + { + throw new \RuntimeException(Text::_('COM_CONFIG_ERROR_UNKNOWN_BEFORE_SAVING')); + } + // Write the configuration file. - return $this->writeConfigFile($config); + $result = $this->writeConfigFile($config); + + // Trigger the after save event. + $app->triggerEvent('onApplicationAfterSave', array($config)); + + return $result; } /** @@ -529,6 +542,8 @@ public function save($data) */ public function removeroot() { + $app = Factory::getApplication(); + // Get the previous configuration. $prev = new \JConfig; $prev = ArrayHelper::fromObject($prev); @@ -537,8 +552,21 @@ public function removeroot() unset($prev['root_user']); $config = new Registry($prev); + $result = $app->triggerEvent('onApplicationBeforeSave', array($config)); + + // Store the data. + if (in_array(false, $result, true)) + { + throw new \RuntimeException(Text::_('COM_CONFIG_ERROR_UNKNOWN_BEFORE_SAVING')); + } + // Write the configuration file. - return $this->writeConfigFile($config); + $result = $this->writeConfigFile($config); + + // Trigger the after save event. + $app->triggerEvent('onApplicationAfterSave', array($config)); + + return $result; } /** diff --git a/administrator/components/com_config/Model/ComponentModel.php b/administrator/components/com_config/Model/ComponentModel.php index f9695b8de7ab7..5850aa905755a 100644 --- a/administrator/components/com_config/Model/ComponentModel.php +++ b/administrator/components/com_config/Model/ComponentModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/View/Application/HtmlView.php b/administrator/components/com_config/View/Application/HtmlView.php index 9a5623c6ecdb8..145caf6124568 100644 --- a/administrator/components/com_config/View/Application/HtmlView.php +++ b/administrator/components/com_config/View/Application/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -101,13 +101,9 @@ public function display($tpl = null) protected function addToolbar() { ToolbarHelper::title(Text::_('COM_CONFIG_GLOBAL_CONFIGURATION'), 'equalizer config'); - ToolbarHelper::saveGroup( - [ - ['apply', 'application.apply'], - ['save', 'application.save'] - ], - 'btn-success' - ); + ToolbarHelper::apply('application.apply'); + ToolbarHelper::divider(); + ToolbarHelper::save('application.save'); ToolbarHelper::divider(); ToolbarHelper::cancel('application.cancel', 'JTOOLBAR_CLOSE'); ToolbarHelper::divider(); diff --git a/administrator/components/com_config/View/Component/HtmlView.php b/administrator/components/com_config/View/Component/HtmlView.php index e4a915de463c0..bd3970e7f053e 100644 --- a/administrator/components/com_config/View/Component/HtmlView.php +++ b/administrator/components/com_config/View/Component/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -103,13 +103,9 @@ public function display($tpl = null) protected function addToolbar() { ToolbarHelper::title(Text::_($this->component->option . '_configuration'), 'equalizer config'); - ToolbarHelper::saveGroup( - [ - ['apply', 'component.apply'], - ['save', 'component.save'] - ], - 'btn-success' - ); + ToolbarHelper::apply('component.apply'); + ToolbarHelper::divider(); + ToolbarHelper::save('component.save'); ToolbarHelper::divider(); ToolbarHelper::cancel('component.cancel', 'JTOOLBAR_CLOSE'); ToolbarHelper::divider(); diff --git a/administrator/components/com_config/config.xml b/administrator/components/com_config/config.xml index 20099898ddcde..7b87728db1be5 100644 --- a/administrator/components/com_config/config.xml +++ b/administrator/components/com_config/config.xml @@ -3,7 +3,7 @@ com_config Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_config/forms/application.xml b/administrator/components/com_config/forms/application.xml index bb9534a497d0f..2ddf22a4d510c 100644 --- a/administrator/components/com_config/forms/application.xml +++ b/administrator/components/com_config/forms/application.xml @@ -261,6 +261,20 @@ + + + + +
@@ -1105,6 +1119,10 @@ name="core.login.admin" title="JACTION_LOGIN_ADMIN" /> + -
+
ftp instanceof Exception) : ?> diff --git a/administrator/components/com_config/tmpl/application/default_locale.php b/administrator/components/com_config/tmpl/application/default_locale.php index 43d6ce3bc1825..b8b001db539c2 100644 --- a/administrator/components/com_config/tmpl/application/default_locale.php +++ b/administrator/components/com_config/tmpl/application/default_locale.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_mail.php b/administrator/components/com_config/tmpl/application/default_mail.php index f676748817de4..fd08b759e5fa7 100644 --- a/administrator/components/com_config/tmpl/application/default_mail.php +++ b/administrator/components/com_config/tmpl/application/default_mail.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -16,7 +16,7 @@ defined('_JEXEC') or die; HTMLHelper::_('form.csrf'); -HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-field-send-test-mail.min.js', ['version' => 'auto', 'relative' => true]); +HTMLHelper::_('webcomponent', 'system/fields/joomla-field-send-test-mail.min.js', ['version' => 'auto', 'relative' => true]); // Load JavaScript message titles Text::script('ERROR'); diff --git a/administrator/components/com_config/tmpl/application/default_metadata.php b/administrator/components/com_config/tmpl/application/default_metadata.php index 130690ddbe770..8fb9667b4ac79 100644 --- a/administrator/components/com_config/tmpl/application/default_metadata.php +++ b/administrator/components/com_config/tmpl/application/default_metadata.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_navigation.php b/administrator/components/com_config/tmpl/application/default_navigation.php index 3365a1960fa83..4ab3804a0b236 100644 --- a/administrator/components/com_config/tmpl/application/default_navigation.php +++ b/administrator/components/com_config/tmpl/application/default_navigation.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_permissions.php b/administrator/components/com_config/tmpl/application/default_permissions.php index fb76b06675cd0..06c39e773aabd 100644 --- a/administrator/components/com_config/tmpl/application/default_permissions.php +++ b/administrator/components/com_config/tmpl/application/default_permissions.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_proxy.php b/administrator/components/com_config/tmpl/application/default_proxy.php index 94ed4c100a666..3913bf534f314 100644 --- a/administrator/components/com_config/tmpl/application/default_proxy.php +++ b/administrator/components/com_config/tmpl/application/default_proxy.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_seo.php b/administrator/components/com_config/tmpl/application/default_seo.php index 797c0b00173fb..4bf7b108a4091 100644 --- a/administrator/components/com_config/tmpl/application/default_seo.php +++ b/administrator/components/com_config/tmpl/application/default_seo.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_server.php b/administrator/components/com_config/tmpl/application/default_server.php index 4038ac5c9b5c2..a42374b43c911 100644 --- a/administrator/components/com_config/tmpl/application/default_server.php +++ b/administrator/components/com_config/tmpl/application/default_server.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_session.php b/administrator/components/com_config/tmpl/application/default_session.php index 546d7e2559b02..1dd01c1028151 100644 --- a/administrator/components/com_config/tmpl/application/default_session.php +++ b/administrator/components/com_config/tmpl/application/default_session.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_site.php b/administrator/components/com_config/tmpl/application/default_site.php index 10193d7a77144..ffff07fc26b12 100644 --- a/administrator/components/com_config/tmpl/application/default_site.php +++ b/administrator/components/com_config/tmpl/application/default_site.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/application/default_system.php b/administrator/components/com_config/tmpl/application/default_system.php index b024b43588884..8b34d2e2c0f25 100644 --- a/administrator/components/com_config/tmpl/application/default_system.php +++ b/administrator/components/com_config/tmpl/application/default_system.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/component/default.php b/administrator/components/com_config/tmpl/component/default.php index 8cf04a3bdf69d..e73c172595bca 100644 --- a/administrator/components/com_config/tmpl/component/default.php +++ b/administrator/components/com_config/tmpl/component/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_config/tmpl/component/default.xml b/administrator/components/com_config/tmpl/component/default.xml old mode 100755 new mode 100644 diff --git a/administrator/components/com_config/tmpl/component/default_navigation.php b/administrator/components/com_config/tmpl/component/default_navigation.php index b4b884ddc8755..c08618a1071db 100644 --- a/administrator/components/com_config/tmpl/component/default_navigation.php +++ b/administrator/components/com_config/tmpl/component/default_navigation.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_config * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Controller/AjaxController.php b/administrator/components/com_contact/Controller/AjaxController.php new file mode 100644 index 0000000000000..ece8e98c1717b --- /dev/null +++ b/administrator/components/com_contact/Controller/AjaxController.php @@ -0,0 +1,93 @@ +input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JsonResponse(null, Text::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $this->input->get('excludeLang', '', 'STRING'); + + $associations = Associations::getAssociations('com_contact', '#__contact_details', 'com_contact.item', (int) $assocId); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_contact/tables'); + $contactTable = Table::getInstance('Contact', 'ContactTable'); + + foreach ($associations as $lang => $association) + { + $contactTable->load($association->id); + $associations[$lang]->title = $contactTable->name; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = Text::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JsonResponse($associations, $message); + } + } +} diff --git a/administrator/components/com_contact/Controller/ContactController.php b/administrator/components/com_contact/Controller/ContactController.php index 7eae7895e0ef9..54acd8e05d28c 100644 --- a/administrator/components/com_contact/Controller/ContactController.php +++ b/administrator/components/com_contact/Controller/ContactController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,10 +12,8 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -103,7 +101,7 @@ protected function allowEdit($data = array(), $key = 'id') */ public function batch($model = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Set the model /** @var \Joomla\Component\Contact\Administrator\Model\ContactModel $model */ diff --git a/administrator/components/com_contact/Controller/ContactsController.php b/administrator/components/com_contact/Controller/ContactsController.php index 9a975c28cd912..15ac81bd7d251 100644 --- a/administrator/components/com_contact/Controller/ContactsController.php +++ b/administrator/components/com_contact/Controller/ContactsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,7 +15,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; -use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -54,7 +53,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu public function featured() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); $values = array('featured' => 1, 'unfeatured' => 0); diff --git a/administrator/components/com_contact/Controller/DisplayController.php b/administrator/components/com_contact/Controller/DisplayController.php index 84a02858d4b88..c57cb791568b0 100644 --- a/administrator/components/com_contact/Controller/DisplayController.php +++ b/administrator/components/com_contact/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Extension/ContactComponent.php b/administrator/components/com_contact/Extension/ContactComponent.php index d045c2a4c9865..a7028687f295e 100644 --- a/administrator/components/com_contact/Extension/ContactComponent.php +++ b/administrator/components/com_contact/Extension/ContactComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Field/Modal/ContactField.php b/administrator/components/com_contact/Field/Modal/ContactField.php index 970a0ca1c4de0..62955ed1ccb36 100644 --- a/administrator/components/com_contact/Field/Modal/ContactField.php +++ b/administrator/components/com_contact/Field/Modal/ContactField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,6 +14,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Form\FormField; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Session\Session; @@ -41,10 +42,13 @@ class ContactField extends FormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language Factory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR); @@ -76,6 +80,8 @@ function jSelectContact_" . $this->id . "(id, title, object) { } "); + Text::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -134,55 +140,72 @@ function jSelectContact_" . $this->id . "(id, title, object) { // Select contact button if ($allowSelect) { - $html .= '' . ' ' . Text::_('JSELECT') - . ''; + . ''; } // New contact button if ($allowNew) { - $html .= '' . ' ' . Text::_('JACTION_CREATE') - . ''; + . ''; } // Edit contact button if ($allowEdit) { - $html .= '' . ' ' . Text::_('JACTION_EDIT') - . ''; + . ''; } // Clear contact button if ($allowClear) { - $html .= '' . '' . Text::_('JCLEAR') - . ''; + . ''; + } + + // Propagate contact button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectContact_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . Text::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; } if ($allowSelect || $allowNew || $allowEdit || $allowClear) diff --git a/administrator/components/com_contact/Helper/AssociationsHelper.php b/administrator/components/com_contact/Helper/AssociationsHelper.php index 091a8e13c6611..74e1f395f0904 100644 --- a/administrator/components/com_contact/Helper/AssociationsHelper.php +++ b/administrator/components/com_contact/Helper/AssociationsHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Helper/ContactHelper.php b/administrator/components/com_contact/Helper/ContactHelper.php index 88ef2d4879019..7f869e1e4e8ce 100644 --- a/administrator/components/com_contact/Helper/ContactHelper.php +++ b/administrator/components/com_contact/Helper/ContactHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Model/ContactModel.php b/administrator/components/com_contact/Model/ContactModel.php index c51a1dc3f35c4..1d4dce086156e 100644 --- a/administrator/components/com_contact/Model/ContactModel.php +++ b/administrator/components/com_contact/Model/ContactModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -65,99 +65,6 @@ class ContactModel extends AdminModel 'user_id' => 'batchUser', ); - /** - * Batch copy items to a new category or current. - * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. - * - * @return mixed An array of new IDs on success, boolean false on failure. - * - * @since 1.7.0 - */ - protected function batchCopy($value, $pks, $contexts) - { - $categoryId = (int) $value; - - $newIds = array(); - - if (!parent::checkCategoryId($categoryId)) - { - return false; - } - - // Parent exists so we proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $this->table->reset(); - - // Check that the row actually exists - if (!$this->table->load($pk)) - { - if ($error = $this->table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - else - { - // Not fatal error - $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $this->table->alias, $this->table->name); - $this->table->name = $data['0']; - $this->table->alias = $data['1']; - - // Reset the ID because we are making a copy - $this->table->id = 0; - - // New category ID - $this->table->catid = $categoryId; - - // Unpublish because we are making a copy - $this->table->published = 0; - - // TODO: Deal with ordering? - - // Check the row. - if (!$this->table->check()) - { - $this->setError($this->table->getError()); - - return false; - } - - // Store the row. - if (!$this->table->store()) - { - $this->setError($this->table->getError()); - - return false; - } - - // Get the new item ID - $newId = $this->table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; - } - - // Clean the cache - $this->cleanCache(); - - return $newIds; - } - /** * Batch change a linked user. * @@ -255,7 +162,7 @@ protected function canEditState($record) */ public function getForm($data = array(), $loadData = true) { - \JForm::addFieldPath('JPATH_ADMINISTRATOR/components/com_users/models/fields'); + \JForm::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_users/models/fields'); // Get the form. $form = $this->loadForm('com_contact.contact', 'contact', array('control' => 'jform', 'load_data' => $loadData)); @@ -548,6 +455,7 @@ protected function preprocessForm(\JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_contact/Model/ContactsModel.php b/administrator/components/com_contact/Model/ContactsModel.php index abdfa49f9c42b..f08ea88f9fdee 100644 --- a/administrator/components/com_contact/Model/ContactsModel.php +++ b/administrator/components/com_contact/Model/ContactsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Service/HTML/AdministratorService.php b/administrator/components/com_contact/Service/HTML/AdministratorService.php index 464ad9d580cb0..9afd50b7fab76 100644 --- a/administrator/components/com_contact/Service/HTML/AdministratorService.php +++ b/administrator/components/com_contact/Service/HTML/AdministratorService.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/Table/ContactTable.php b/administrator/components/com_contact/Table/ContactTable.php index 4bdead5d325df..64d7dee246efa 100644 --- a/administrator/components/com_contact/Table/ContactTable.php +++ b/administrator/components/com_contact/Table/ContactTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/View/Contact/HtmlView.php b/administrator/components/com_contact/View/Contact/HtmlView.php index 4ef8cdbd51214..144570a2c27b6 100644 --- a/administrator/components/com_contact/View/Contact/HtmlView.php +++ b/administrator/components/com_contact/View/Contact/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,6 +14,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; +use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; @@ -112,9 +113,10 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew && (count($user->getAuthorisedCategories('com_contact', 'core.create')) > 0)) { + ToolbarHelper::apply('contact.apply'); + ToolbarHelper::saveGroup( [ - ['apply', 'contact.apply'], ['save', 'contact.save'], ['save2new', 'contact.save2new'] ], @@ -134,7 +136,8 @@ protected function addToolbar() // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - $toolbarButtons[] = ['apply', 'contact.apply']; + ToolbarHelper::apply('contact.apply'); + $toolbarButtons[] = ['save', 'contact.save']; // We can save this record, but check the create permission to see if we can return to make a new one. @@ -160,6 +163,11 @@ protected function addToolbar() ToolbarHelper::versions('com_contact.contact', $this->item->id); } + if (Associations::isEnabled() && ComponentHelper::isEnabled('com_associations')) + { + ToolbarHelper::custom('contact.editAssociations', 'contract', 'contract', 'JTOOLBAR_ASSOCIATIONS', false, false); + } + ToolbarHelper::cancel('contact.cancel', 'JTOOLBAR_CLOSE'); } diff --git a/administrator/components/com_contact/View/Contacts/HtmlView.php b/administrator/components/com_contact/View/Contacts/HtmlView.php index d281b2cc22524..75c35dd810754 100644 --- a/administrator/components/com_contact/View/Contacts/HtmlView.php +++ b/administrator/components/com_contact/View/Contacts/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -163,7 +163,7 @@ protected function addToolbar() if ($canDo->get('core.edit.state')) { - $dropdown = $toolbar->dropdownButton('status') + $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('fa fa-globe') @@ -219,7 +219,7 @@ protected function addToolbar() if ($user->authorise('core.admin', 'com_contact') || $user->authorise('core.options', 'com_contact')) { - $toolbar->preferences('com_menus'); + $toolbar->preferences('com_contact'); } $toolbar->help('JHELP_COMPONENTS_CONTACTS_CONTACTS'); diff --git a/administrator/components/com_contact/config.xml b/administrator/components/com_contact/config.xml index 7eb0592885cb0..3d9e87cbd20cc 100644 --- a/administrator/components/com_contact/config.xml +++ b/administrator/components/com_contact/config.xml @@ -827,6 +827,23 @@ + + + + + + + + + + + + COM_CONTACT_FIELD_VALUE_NAME +
diff --git a/administrator/components/com_contact/contact.xml b/administrator/components/com_contact/contact.xml index 8ac4609e49d84..094f8fa4e134a 100644 --- a/administrator/components/com_contact/contact.xml +++ b/administrator/components/com_contact/contact.xml @@ -3,7 +3,7 @@ com_contact Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_contact/helpers/contact.php b/administrator/components/com_contact/helpers/contact.php index 6e636fc544a24..b2064f40e6b67 100644 --- a/administrator/components/com_contact/helpers/contact.php +++ b/administrator/components/com_contact/helpers/contact.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/services/provider.php b/administrator/components/com_contact/services/provider.php index 7b48ba445b22c..4ea9f14a7242c 100644 --- a/administrator/components/com_contact/services/provider.php +++ b/administrator/components/com_contact/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/edit.php b/administrator/components/com_contact/tmpl/contact/edit.php index 03b1eb91cd5e4..b89820c625289 100644 --- a/administrator/components/com_contact/tmpl/contact/edit.php +++ b/administrator/components/com_contact/tmpl/contact/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -80,7 +80,8 @@
- form->renderField('misc'); ?> + form->getLabel('misc'); ?> + form->getInput('misc'); ?>
diff --git a/administrator/components/com_contact/tmpl/contact/edit_associations.php b/administrator/components/com_contact/tmpl/contact/edit_associations.php index 6bbc7421ec05b..bd9c6605e2a55 100644 --- a/administrator/components/com_contact/tmpl/contact/edit_associations.php +++ b/administrator/components/com_contact/tmpl/contact/edit_associations.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/edit_metadata.php b/administrator/components/com_contact/tmpl/contact/edit_metadata.php index e4a89dfb34581..595dccab85a8e 100644 --- a/administrator/components/com_contact/tmpl/contact/edit_metadata.php +++ b/administrator/components/com_contact/tmpl/contact/edit_metadata.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/edit_params.php b/administrator/components/com_contact/tmpl/contact/edit_params.php index a8c0e5b6f5e54..3c11ec5e034e0 100644 --- a/administrator/components/com_contact/tmpl/contact/edit_params.php +++ b/administrator/components/com_contact/tmpl/contact/edit_params.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/modal.php b/administrator/components/com_contact/tmpl/contact/modal.php index a310090bd13af..e3686337ccaea 100644 --- a/administrator/components/com_contact/tmpl/contact/modal.php +++ b/administrator/components/com_contact/tmpl/contact/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/modal_associations.php b/administrator/components/com_contact/tmpl/contact/modal_associations.php index 6bbc7421ec05b..bd9c6605e2a55 100644 --- a/administrator/components/com_contact/tmpl/contact/modal_associations.php +++ b/administrator/components/com_contact/tmpl/contact/modal_associations.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/modal_metadata.php b/administrator/components/com_contact/tmpl/contact/modal_metadata.php index e4a89dfb34581..595dccab85a8e 100644 --- a/administrator/components/com_contact/tmpl/contact/modal_metadata.php +++ b/administrator/components/com_contact/tmpl/contact/modal_metadata.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contact/modal_params.php b/administrator/components/com_contact/tmpl/contact/modal_params.php index a8c0e5b6f5e54..3c11ec5e034e0 100644 --- a/administrator/components/com_contact/tmpl/contact/modal_params.php +++ b/administrator/components/com_contact/tmpl/contact/modal_params.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contact/tmpl/contacts/default.php b/administrator/components/com_contact/tmpl/contacts/default.php index eb966a8f36708..a97d837976693 100644 --- a/administrator/components/com_contact/tmpl/contacts/default.php +++ b/administrator/components/com_contact/tmpl/contacts/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -61,6 +61,9 @@ + + + @@ -124,12 +127,17 @@ id); ?> + +
+ featured, $i, $canChange); ?> +
+
published, $i, 'contacts.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?> - featured, $i, $canChange); ?> -
+
+
checked_out) : ?> diff --git a/administrator/components/com_contact/tmpl/contacts/default_batch.php b/administrator/components/com_contact/tmpl/contacts/default_batch.php index 1b256eb9ed44b..45677ddd65f87 100644 --- a/administrator/components/com_contact/tmpl/contacts/default_batch.php +++ b/administrator/components/com_contact/tmpl/contacts/default_batch.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contact * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,6 +13,7 @@ use Joomla\CMS\Layout\LayoutHelper; $published = $this->state->get('filter.published'); +$noUser = true; ?> diff --git a/administrator/components/com_content/tmpl/articles/default.xml b/administrator/components/com_content/tmpl/articles/default.xml index b3dec7f7be330..aaacb96288aef 100644 --- a/administrator/components/com_content/tmpl/articles/default.xml +++ b/administrator/components/com_content/tmpl/articles/default.xml @@ -5,4 +5,79 @@ + + +
+ + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/administrator/components/com_content/tmpl/articles/default_batch_body.php b/administrator/components/com_content/tmpl/articles/default_batch_body.php index 034c04356e917..bc8851c48e505 100644 --- a/administrator/components/com_content/tmpl/articles/default_batch_body.php +++ b/administrator/components/com_content/tmpl/articles/default_batch_body.php @@ -3,16 +3,17 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\Layout\LayoutHelper; $published = $this->state->get('filter.published'); -$user = \Joomla\CMS\Factory::getUser(); +$user = Factory::getUser(); ?>
diff --git a/administrator/components/com_content/tmpl/articles/default_batch_footer.php b/administrator/components/com_content/tmpl/articles/default_batch_footer.php index f4de2c5b2c9ee..041a84863a67a 100644 --- a/administrator/components/com_content/tmpl/articles/default_batch_footer.php +++ b/administrator/components/com_content/tmpl/articles/default_batch_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -13,9 +13,9 @@ HTMLHelper::_('script', 'com_content/admin-articles-default-batch-footer.js', ['version' => 'auto', 'relative' => true]); ?> - - diff --git a/administrator/components/com_content/tmpl/articles/default_stage_body.php b/administrator/components/com_content/tmpl/articles/default_stage_body.php index ff27039a8a619..5c45de087c832 100644 --- a/administrator/components/com_content/tmpl/articles/default_stage_body.php +++ b/administrator/components/com_content/tmpl/articles/default_stage_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_content/tmpl/articles/default_stage_footer.php b/administrator/components/com_content/tmpl/articles/default_stage_footer.php index 593e4247ca339..c37b721907c68 100644 --- a/administrator/components/com_content/tmpl/articles/default_stage_footer.php +++ b/administrator/components/com_content/tmpl/articles/default_stage_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_content/tmpl/articles/modal.php b/administrator/components/com_content/tmpl/articles/modal.php index 7e47fa7970b09..ac6c62f55f4ff 100644 --- a/administrator/components/com_content/tmpl/articles/modal.php +++ b/administrator/components/com_content/tmpl/articles/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -125,6 +125,13 @@ > escape($item->title); ?> + + note)) : ?> + escape($item->alias)); ?> + + escape($item->alias), $this->escape($item->note)); ?> + +
escape($item->category_title); ?>
diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php index 00751574ac8a8..ac980dea478ea 100644 --- a/administrator/components/com_content/tmpl/featured/default.php +++ b/administrator/components/com_content/tmpl/featured/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -55,7 +55,7 @@ var elements = [].slice.call(document.querySelectorAll('.article-status')); elements.forEach(function (element) { - element.addEventListener('click', function(event) { + element.addEventListener('click', function(event) { event.stopPropagation(); }); }); @@ -104,6 +104,9 @@ + + + @@ -144,12 +147,16 @@ items); ?> items as $i => $item) : $item->max_ordering = 0; - $ordering = ($listOrder == 'fp.ordering'); - $assetId = 'com_content.article.' . $item->id; - $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); - $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; - $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; + $ordering = ($listOrder == 'fp.ordering'); + $assetId = 'com_content.article.' . $item->id; + $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); + $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; + $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; + $canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid); + $canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId; + $canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id); + $canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId; $transitions = ContentHelper::filterTransitions($this->transitions, $item->stage_id, $item->workflow_id); @@ -207,10 +214,12 @@ id); ?> + + render($item->featured, $i, ['disabled' => !$canChange]); ?> +
- render($item->featured, $i, ['disabled' => !$canChange]); ?> escape($item->alias)); ?>">escape($item->title); ?> - escape($item->alias)); ?> + note)) : ?> + escape($item->alias)); ?> + + escape($item->alias), $this->escape($item->note)); ?> +
- escape($item->category_title); ?> + parent_category_id . '&extension=com_content'); + $CurrentCatUrl = Route::_('index.php?option=com_categories&task=category.edit&id=' . $item->catid . '&extension=com_content'); + $EditCatTxt = Text::_('JACTION_EDIT') . ' ' . Text::_('JCATEGORY'); + echo Text::_('JCATEGORY') . ': '; + if ($item->category_level != '1') : + if ($item->parent_category_level != '1') : + echo ' » '; + endif; + endif; + if (Factory::getLanguage()->isRtl()) + { + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + if ($item->category_level != '1') : + echo ' « '; + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + endif; + } + else + { + if ($item->category_level != '1') : + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo ' » '; + endif; + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + } + ?>
@@ -260,17 +323,17 @@ created_by != 0) : ?> created_by_alias) : ?> - + escape($item->author_name); ?> -
escape($item->created_by_alias)); ?>
+
escape($item->created_by_alias)); ?>
- + escape($item->author_name); ?> created_by_alias) : ?> -
escape($item->created_by_alias)); ?>
+
escape($item->created_by_alias)); ?>
diff --git a/administrator/components/com_content/tmpl/featured/default_stage_body.php b/administrator/components/com_content/tmpl/featured/default_stage_body.php index ff27039a8a619..5c45de087c832 100644 --- a/administrator/components/com_content/tmpl/featured/default_stage_body.php +++ b/administrator/components/com_content/tmpl/featured/default_stage_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_content/tmpl/featured/default_stage_footer.php b/administrator/components/com_content/tmpl/featured/default_stage_footer.php index 593e4247ca339..c37b721907c68 100644 --- a/administrator/components/com_content/tmpl/featured/default_stage_footer.php +++ b/administrator/components/com_content/tmpl/featured/default_stage_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_content * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_contenthistory/Controller/DisplayController.php b/administrator/components/com_contenthistory/Controller/DisplayController.php index 032fc48d51183..91c0cf485b44f 100644 --- a/administrator/components/com_contenthistory/Controller/DisplayController.php +++ b/administrator/components/com_contenthistory/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Controller/HistoryController.php b/administrator/components/com_contenthistory/Controller/HistoryController.php index 8a8681e853e84..1f030ae291533 100644 --- a/administrator/components/com_contenthistory/Controller/HistoryController.php +++ b/administrator/components/com_contenthistory/Controller/HistoryController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -33,7 +33,7 @@ class HistoryController extends AdminController */ public function delete() { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Get items to remove from the request. $cid = $this->input->get('cid', array(), 'array'); @@ -95,7 +95,7 @@ public function getModel($name = 'History', $prefix = 'Administrator', $config = */ public function keep() { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Get items to remove from the request. $cid = $this->input->get('cid', array(), 'array'); diff --git a/administrator/components/com_contenthistory/Controller/PreviewController.php b/administrator/components/com_contenthistory/Controller/PreviewController.php index c4cf8e5da3968..6a03c01aacbab 100644 --- a/administrator/components/com_contenthistory/Controller/PreviewController.php +++ b/administrator/components/com_contenthistory/Controller/PreviewController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Dispatcher/Dispatcher.php b/administrator/components/com_contenthistory/Dispatcher/Dispatcher.php index 2d35f34c153e6..2f7471a06a89b 100644 --- a/administrator/components/com_contenthistory/Dispatcher/Dispatcher.php +++ b/administrator/components/com_contenthistory/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Helper/ContenthistoryHelper.php b/administrator/components/com_contenthistory/Helper/ContenthistoryHelper.php index 58d2cbb0fab17..91d6fd925fa28 100644 --- a/administrator/components/com_contenthistory/Helper/ContenthistoryHelper.php +++ b/administrator/components/com_contenthistory/Helper/ContenthistoryHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Model/CompareModel.php b/administrator/components/com_contenthistory/Model/CompareModel.php index 831db1e4d8e1d..9283ad49f1164 100644 --- a/administrator/components/com_contenthistory/Model/CompareModel.php +++ b/administrator/components/com_contenthistory/Model/CompareModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Model/HistoryModel.php b/administrator/components/com_contenthistory/Model/HistoryModel.php index 94f5055ce36b4..082c6e5671791 100644 --- a/administrator/components/com_contenthistory/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/Model/HistoryModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/Model/PreviewModel.php b/administrator/components/com_contenthistory/Model/PreviewModel.php index a2204d50825ec..9a8abdf3b8919 100644 --- a/administrator/components/com_contenthistory/Model/PreviewModel.php +++ b/administrator/components/com_contenthistory/Model/PreviewModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/View/Compare/HtmlView.php b/administrator/components/com_contenthistory/View/Compare/HtmlView.php index dcdf6bbc6d548..faab1d33017fb 100644 --- a/administrator/components/com_contenthistory/View/Compare/HtmlView.php +++ b/administrator/components/com_contenthistory/View/Compare/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/View/History/HtmlView.php b/administrator/components/com_contenthistory/View/History/HtmlView.php index 8c7e9286ddece..beede5fe4b6da 100644 --- a/administrator/components/com_contenthistory/View/History/HtmlView.php +++ b/administrator/components/com_contenthistory/View/History/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/View/Preview/HtmlView.php b/administrator/components/com_contenthistory/View/Preview/HtmlView.php index 4821c34beb299..f42172b021a43 100644 --- a/administrator/components/com_contenthistory/View/Preview/HtmlView.php +++ b/administrator/components/com_contenthistory/View/Preview/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/contenthistory.xml b/administrator/components/com_contenthistory/contenthistory.xml index 6f0eab11be717..c13e407bd53cd 100644 --- a/administrator/components/com_contenthistory/contenthistory.xml +++ b/administrator/components/com_contenthistory/contenthistory.xml @@ -3,7 +3,7 @@ com_contenthistory Joomla! Project May 2013 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php index c738d556824ea..af8dd976d636f 100644 --- a/administrator/components/com_contenthistory/helpers/contenthistory.php +++ b/administrator/components/com_contenthistory/helpers/contenthistory.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/services/provider.php b/administrator/components/com_contenthistory/services/provider.php index c30c7a0f2ca2b..fdf9734364b5d 100644 --- a/administrator/components/com_contenthistory/services/provider.php +++ b/administrator/components/com_contenthistory/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_banners * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/tmpl/compare/compare.php b/administrator/components/com_contenthistory/tmpl/compare/compare.php index b7ad2207c376a..f1b06b5e4557f 100644 --- a/administrator/components/com_contenthistory/tmpl/compare/compare.php +++ b/administrator/components/com_contenthistory/tmpl/compare/compare.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/tmpl/history/modal.php b/administrator/components/com_contenthistory/tmpl/history/modal.php index a3128ab3860e0..1ce7a1684464c 100644 --- a/administrator/components/com_contenthistory/tmpl/history/modal.php +++ b/administrator/components/com_contenthistory/tmpl/history/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_contenthistory/tmpl/preview/preview.php b/administrator/components/com_contenthistory/tmpl/preview/preview.php index 10c2ead439f20..425f5a87375ce 100644 --- a/administrator/components/com_contenthistory/tmpl/preview/preview.php +++ b/administrator/components/com_contenthistory/tmpl/preview/preview.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_contenthistory * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/Controller/DisplayController.php b/administrator/components/com_cpanel/Controller/DisplayController.php index 4eaa886c92657..2623938e768f8 100644 --- a/administrator/components/com_cpanel/Controller/DisplayController.php +++ b/administrator/components/com_cpanel/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/Controller/SystemController.php b/administrator/components/com_cpanel/Controller/SystemController.php new file mode 100644 index 0000000000000..b33abe06ad695 --- /dev/null +++ b/administrator/components/com_cpanel/Controller/SystemController.php @@ -0,0 +1,213 @@ +input->get('type'); + + $count = 0; + + switch ($type) + { + case 'postinstall': + $count = $this->countItems('com_postinstall', 'Messages'); + break; + + case 'installationwarnings': + $count = $this->countItems('com_installer', 'Warnings'); + break; + + case 'checkins': + $count = $this->countItems('com_checkin', 'Checkin'); + break; + + case 'databaseupdate': + $count = $this->countDatabaseUpdates(); + break; + + case 'systemupdate': + $count = $this->countSystemUpdates(); + break; + + case 'extensionupdate': + $count = $this->countExtensionUpdates(); + break; + + case 'extensiondiscover': + $count = $this->countExtensionDiscover(); + break; + + default: + /** + * @TODO: Plugin event to allow custom sections to be added (see SystemModel) + */ + throw new \Exception(Text::_('COM_CPANEL_ERROR_DASHBOARD_TYPE_NOT_SUPPORTED')); + } + + echo new JsonResponse($count); + } + + /** + * Returns the existing database errors of the table structur + * + * @return integer Number of database table errors + * + * @throws \Exception + * @since 4.0.0 + */ + protected function countDatabaseUpdates() + { + if (!Factory::getUser()->authorise('core.manage', 'com_installer')) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $boot = Factory::getApplication()->bootComponent('com_installer'); + $model = $boot->getMVCFactory()->createModel('Database', 'Administrator', ['ignore_request' => true]); + + $changeSet = $model->getItems(); + + $changeSetCount = 0; + + foreach ($changeSet as $item) + { + $changeSetCount += $item['errorsCount']; + } + + return $changeSetCount; + } + + /** + * Returns the version number of the latest update or empty string if system is uptodate + * + * @return string The version number or empty string + * + * @throws \Exception + * @since 4.0.0 + */ + protected function countSystemUpdates() + { + if (!Factory::getUser()->authorise('core.manage', 'com_joomlaupdate')) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $boot = Factory::getApplication()->bootComponent('com_joomlaupdate'); + $model = $boot->getMVCFactory()->createModel('Update', 'Administrator', ['ignore_request' => true]); + + $model->refreshUpdates(true); + + $joomlaUpdate = $model->getUpdateInformation(); + + $hasUpdate = $joomlaUpdate['hasUpdate'] ? '‎' . $joomlaUpdate['latest'] : ''; + + return $hasUpdate; + } + + /** + * Returns the number of outdates extensions installed in the system + * + * @return integer Number of available updates + * + * @throws \Exception + * @since 4.0.0 + */ + protected function countExtensionUpdates() + { + if (!Factory::getUser()->authorise('core.manage', 'com_installer')) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $boot = Factory::getApplication()->bootComponent('com_installer'); + $model = $boot->getMVCFactory()->createModel('Update', 'Administrator', ['ignore_request' => true]); + + $model->findUpdates(); + + $items = count($model->getItems()); + + return $items; + } + + /** + * Returns the number of available extensions for installation + * + * @return integer Number of available updates + * + * @throws \Exception + */ + protected function countExtensionDiscover() + { + if (!Factory::getUser()->authorise('core.manage', 'com_installer')) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $boot = Factory::getApplication()->bootComponent('com_installer'); + $model = $boot->getMVCFactory()->createModel('Discover', 'Administrator', ['ignore_request' => true]); + + $model->discover(); + + $items = count($model->getItems()); + + return $items; + } + + /** + * Generic getItems counter for different calls + * + * @param type $extension The extension to check and authorise for + * @param type $model The Model to load + * + * @return integer The number of items + * + * @throws \Exception + * @since 4.0.0 + */ + protected function countItems($extension, $modelname) + { + if (!Factory::getUser()->authorise('core.manage', $extension)) + { + throw new \Exception(Text::_('JGLOBAL_AUTH_ACCESS_DENIED')); + } + + $boot = Factory::getApplication()->bootComponent($extension); + $model = $boot->getMVCFactory()->createModel($modelname, 'Administrator', ['ignore_request' => true]); + + $items = count($model->getItems()); + + return $items; + } +} diff --git a/administrator/components/com_cpanel/Dispatcher/Dispatcher.php b/administrator/components/com_cpanel/Dispatcher/Dispatcher.php index 8ef4dc5003e41..b8bc7ed7d7c13 100644 --- a/administrator/components/com_cpanel/Dispatcher/Dispatcher.php +++ b/administrator/components/com_cpanel/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/Entities/SystemHeader.php b/administrator/components/com_cpanel/Entities/SystemHeader.php index 829bd825f05d1..3e0b80ad33a7f 100644 --- a/administrator/components/com_cpanel/Entities/SystemHeader.php +++ b/administrator/components/com_cpanel/Entities/SystemHeader.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/Entities/SystemItem.php b/administrator/components/com_cpanel/Entities/SystemItem.php index ffbe29a8fdaaa..376e516f0e8d2 100644 --- a/administrator/components/com_cpanel/Entities/SystemItem.php +++ b/administrator/components/com_cpanel/Entities/SystemItem.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -33,29 +33,29 @@ class SystemItem private $link; /** - * An optional badge of the item + * An optional type for the ajax request * * @var string|null */ - private $badge; + private $type; /** * Class constructor. * * @param string $title The title of the item * @param string $link The link for the item - * @param string $badge The optional badge for the item + * @param string $type The type, requested by the ajax request * * @since 4.0.0 */ - public function __construct($title, $link, $badge = '') + public function __construct($title, $link, $type = '') { $this->title = $title; $this->link = $link; - if (!empty($badge)) + if (!empty($type)) { - $this->badge = $badge; + $this->type = $type; } } @@ -84,14 +84,14 @@ public function getLink() } /** - * The string to display in the notification badge if there is one. Else null. + * The type to load in the notification badge if there is one. Else null. * * @return string|null * * @since 4.0.0 */ - public function getBadge() + public function getType() { - return $this->badge; + return $this->type; } } diff --git a/administrator/components/com_cpanel/Model/SystemModel.php b/administrator/components/com_cpanel/Model/SystemModel.php index 6edfce0ac1006..372837dbb6a80 100644 --- a/administrator/components/com_cpanel/Model/SystemModel.php +++ b/administrator/components/com_cpanel/Model/SystemModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -64,37 +64,22 @@ public function getItems() if ($user->authorise('core.manage', 'com_checkin')) { - /** @var \Joomla\Component\Checkin\Administrator\Model\CheckinModel $checkinModel */ - $checkinModel = $this->bootComponent('com_checkin')->getMVCFactory()->createModel('Checkin', 'Administrator', ['ignore_request' => true]); - $checkins = count($checkinModel->getItems()); - $maintainSection->addItem( - new SystemItem('MOD_MENU_GLOBAL_CHECKIN', 'index.php?option=com_checkin', $checkins) + new SystemItem('MOD_MENU_GLOBAL_CHECKIN', 'index.php?option=com_checkin', 'checkins') ); } if ($user->authorise('core.manage', 'com_installer')) { - /** @var \Joomla\Component\Installer\Administrator\Extension\InstallerComponent $installerComponent */ - $installerComponent = $this->bootComponent('com_installer'); - - /** @var \Joomla\Component\Installer\Administrator\Model\WarningsModel $warningsModel */ - $warningsModel = $installerComponent->getMVCFactory()->createModel('Warnings', 'Administrator', ['ignore_request' => true]); - $warningMessages = count($warningsModel->getItems()); - $infoSection->addItem( - new SystemItem('MOD_MENU_INFORMATION_WARNINGS', 'index.php?option=com_installer&view=warnings', $warningMessages) + new SystemItem('MOD_MENU_INFORMATION_WARNINGS', 'index.php?option=com_installer&view=warnings', 'installationwarnings') ); } if ($user->authorise('core.manage', 'com_postinstall')) { - /** @var \Joomla\Component\Postinstall\Administrator\Model\MessagesModel $messagesModel */ - $messagesModel = $this->bootComponent('com_postinstall')->getMVCFactory()->createModel('Messages', 'Administrator', ['ignore_request' => true]); - $messages = count($messagesModel->getItems()); - $infoSection->addItem( - new SystemItem('MOD_MENU_INFORMATION_POST_INSTALL_MESSAGES', 'index.php?option=com_postinstall', $messages) + new SystemItem('MOD_MENU_INFORMATION_POST_INSTALL_MESSAGES', 'index.php?option=com_postinstall', 'postinstall') ); } @@ -107,38 +92,19 @@ public function getItems() if ($user->authorise('core.manage', 'com_installer')) { - /** @var \Joomla\Component\Installer\Administrator\Model\DatabaseModel $warningsModel */ - $databaseModel = $installerComponent->getMVCFactory()->createModel('Database', 'Administrator', ['ignore_request' => true]); - $changeSet = $databaseModel->getItems(); - $changeSetCount = 0; - - foreach ($changeSet as $item) - { - $changeSetCount += $item['errorsCount']; - } - $infoSection->addItem( - new SystemItem( - 'MOD_MENU_SYSTEM_INFORMATION_DATABASE', - 'index.php?option=com_installer&view=database', - $changeSetCount === 0 ? '' : $changeSetCount - ) + new SystemItem('MOD_MENU_SYSTEM_INFORMATION_DATABASE', 'index.php?option=com_installer&view=database', 'databaseupdate') ); } // Install if ($user->authorise('core.manage', 'com_installer')) { - /** @var \Joomla\Component\Installer\Administrator\Model\DiscoverModel $discoverModel */ - $discoverModel = $this->bootComponent('com_installer')->getMVCFactory()->createModel('Discover', 'Administrator', ['ignore_request' => true]); - $discoverModel->discover(); - $discoveredExtensions = count($discoverModel->getItems()); - $installSection->addItem( new SystemItem('MOD_MENU_INSTALL_EXTENSIONS', 'index.php?option=com_installer&view=install') ); $installSection->addItem( - new SystemItem('MOD_MENU_INSTALL_DISCOVER', 'index.php?option=com_installer&view=discover', $discoveredExtensions) + new SystemItem('MOD_MENU_INSTALL_DISCOVER', 'index.php?option=com_installer&view=discover', 'extensiondiscover') ); $installSection->addItem( new SystemItem('MOD_MENU_INSTALL_LANGUAGES', 'index.php?option=com_installer&view=languages') @@ -199,27 +165,15 @@ public function getItems() if ($user->authorise('core.manage', 'com_joomlaupdate')) { - /** @var \Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel $joomlaUpdateModel */ - $joomlaUpdateModel = $this->bootComponent('com_joomlaupdate')->getMVCFactory()->createModel('Update', 'Administrator', ['ignore_request' => true]); - $joomlaUpdateModel->refreshUpdates(true); - $joomlaUpdate = $joomlaUpdateModel->getUpdateInformation(); - $hasUpdate = $joomlaUpdate['hasUpdate'] ? $joomlaUpdate['latest'] : ''; - $updateSection->addItem( - new SystemItem('MOD_MENU_UPDATE_JOOMLA', 'index.php?option=com_joomlaupdate', $hasUpdate) + new SystemItem('MOD_MENU_UPDATE_JOOMLA', 'index.php?option=com_joomlaupdate', 'systemupdate') ); } if ($user->authorise('core.manage', 'com_installer')) { - Updater::getInstance()->findUpdates(); - - /** @var \Joomla\Component\Installer\Administrator\Model\UpdateModel $updateModel */ - $updateModel = $installerComponent->getMVCFactory()->createModel('Update', 'Administrator', ['ignore_request' => true]); - $extensionsCount = count($updateModel->getItems()); - $updateSection->addItem( - new SystemItem('MOD_MENU_UPDATE_EXTENSIONS', 'index.php?option=com_installer&view=update', $extensionsCount) + new SystemItem('MOD_MENU_UPDATE_EXTENSIONS', 'index.php?option=com_installer&view=update', 'extensionupdate') ); $updateSection->addItem( diff --git a/administrator/components/com_cpanel/View/Cpanel/HtmlView.php b/administrator/components/com_cpanel/View/Cpanel/HtmlView.php index 9b2770fdba95a..e09180c12f260 100644 --- a/administrator/components/com_cpanel/View/Cpanel/HtmlView.php +++ b/administrator/components/com_cpanel/View/Cpanel/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/View/Help/HtmlView.php b/administrator/components/com_cpanel/View/Help/HtmlView.php index 7bcf38bc4ff75..c421866fb126d 100644 --- a/administrator/components/com_cpanel/View/Help/HtmlView.php +++ b/administrator/components/com_cpanel/View/Help/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/View/System/HtmlView.php b/administrator/components/com_cpanel/View/System/HtmlView.php index 87f8c8346e957..3e0cd9cc81518 100644 --- a/administrator/components/com_cpanel/View/System/HtmlView.php +++ b/administrator/components/com_cpanel/View/System/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/cpanel.xml b/administrator/components/com_cpanel/cpanel.xml index 82f6e5c762049..0135ea451cd4f 100644 --- a/administrator/components/com_cpanel/cpanel.xml +++ b/administrator/components/com_cpanel/cpanel.xml @@ -3,7 +3,7 @@ com_cpanel Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_cpanel/services/provider.php b/administrator/components/com_cpanel/services/provider.php index 4c481ee6d1ac2..e5f6c97e1c3f0 100644 --- a/administrator/components/com_cpanel/services/provider.php +++ b/administrator/components/com_cpanel/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/tmpl/cpanel/default.php b/administrator/components/com_cpanel/tmpl/cpanel/default.php index e68533e3640a0..ff70da5a2adbe 100644 --- a/administrator/components/com_cpanel/tmpl/cpanel/default.php +++ b/administrator/components/com_cpanel/tmpl/cpanel/default.php @@ -3,14 +3,22 @@ * @package Joomla.Administrator * @subpackage com_cpanel * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Helper\ModuleHelper; +use Joomla\CMS\HTML\HTMLHelper; + +HTMLHelper::_('behavior.core'); +Text::script('COM_CPANEL_UNPUBLISH_MODULE_SUCCESS'); +Text::script('COM_CPANEL_UNPUBLISH_MODULE_ERROR'); + +HTMLHelper::_('script', 'com_cpanel/admin-cpanel-default.min.js', array('version' => 'auto', 'relative' => true)); $user = Factory::getUser(); ?> @@ -18,6 +26,7 @@
+
-
+
modules as $module) diff --git a/administrator/components/com_cpanel/tmpl/help/default.php b/administrator/components/com_cpanel/tmpl/help/default.php index d4ef90fde5d82..69e0c7358b2c5 100644 --- a/administrator/components/com_cpanel/tmpl/help/default.php +++ b/administrator/components/com_cpanel/tmpl/help/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_cpanel/tmpl/system/default.php b/administrator/components/com_cpanel/tmpl/system/default.php index 3c28404b00fc5..310c829bd91e8 100644 --- a/administrator/components/com_cpanel/tmpl/system/default.php +++ b/administrator/components/com_cpanel/tmpl/system/default.php @@ -3,14 +3,17 @@ * @package Joomla.Administrator * @subpackage com_admin * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +HTMLHelper::_('script', 'com_cpanel/admin-system-loader.js', ['version' => 'auto', 'relative' => true]); + /** @var \Joomla\Component\Cpanel\Administrator\View\System\HtmlView $this */ ?> @@ -25,9 +28,9 @@ getItems() as $item) : ?>
  • getTitle()); ?> - getBadge())) : ?> - - getBadge()); ?> + getType())) : ?> + + diff --git a/administrator/components/com_csp/Controller/DisplayController.php b/administrator/components/com_csp/Controller/DisplayController.php index 32b0886217325..cb3c68b1b8021 100644 --- a/administrator/components/com_csp/Controller/DisplayController.php +++ b/administrator/components/com_csp/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/Controller/ReportsController.php b/administrator/components/com_csp/Controller/ReportsController.php index 08671a53c2d81..f68b254087f93 100644 --- a/administrator/components/com_csp/Controller/ReportsController.php +++ b/administrator/components/com_csp/Controller/ReportsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/Helper/ReporterHelper.php b/administrator/components/com_csp/Helper/ReporterHelper.php index e11b924cfa89e..6f122497ba773 100644 --- a/administrator/components/com_csp/Helper/ReporterHelper.php +++ b/administrator/components/com_csp/Helper/ReporterHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/Model/ReportModel.php b/administrator/components/com_csp/Model/ReportModel.php index 6c88f63018bcb..7029d7f979f83 100644 --- a/administrator/components/com_csp/Model/ReportModel.php +++ b/administrator/components/com_csp/Model/ReportModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/Model/ReportsModel.php b/administrator/components/com_csp/Model/ReportsModel.php index 98be9c635bfec..a21f15ba93a53 100644 --- a/administrator/components/com_csp/Model/ReportsModel.php +++ b/administrator/components/com_csp/Model/ReportsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/Table/ReportTable.php b/administrator/components/com_csp/Table/ReportTable.php index 8731f9ee248b2..d0d99124e3ec8 100644 --- a/administrator/components/com_csp/Table/ReportTable.php +++ b/administrator/components/com_csp/Table/ReportTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/View/Reports/HtmlView.php b/administrator/components/com_csp/View/Reports/HtmlView.php index 545c14d9233a3..6bdf8d753c910 100644 --- a/administrator/components/com_csp/View/Reports/HtmlView.php +++ b/administrator/components/com_csp/View/Reports/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/csp.xml b/administrator/components/com_csp/csp.xml index 7759c53f74991..f955c1f2cf005 100644 --- a/administrator/components/com_csp/csp.xml +++ b/administrator/components/com_csp/csp.xml @@ -3,7 +3,7 @@ com_csp Joomla! Project May 2018 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_csp/services/provider.php b/administrator/components/com_csp/services/provider.php index 825ac0df56d67..a0f65a79e7f32 100644 --- a/administrator/components/com_csp/services/provider.php +++ b/administrator/components/com_csp/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_csp/tmpl/reports/default.php b/administrator/components/com_csp/tmpl/reports/default.php index 317f3d13ffd36..7f40b237ede66 100644 --- a/administrator/components/com_csp/tmpl/reports/default.php +++ b/administrator/components/com_csp/tmpl/reports/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_csp * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Controller/DisplayController.php b/administrator/components/com_fields/Controller/DisplayController.php index 0ac67aea0e1bc..78cf7f8ebff2f 100644 --- a/administrator/components/com_fields/Controller/DisplayController.php +++ b/administrator/components/com_fields/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Controller/FieldController.php b/administrator/components/com_fields/Controller/FieldController.php index 1698f846b0121..7f1014d7edfdb 100644 --- a/administrator/components/com_fields/Controller/FieldController.php +++ b/administrator/components/com_fields/Controller/FieldController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,11 +13,9 @@ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\BaseDatabaseModel; -use Joomla\CMS\Session\Session; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; use Joomla\Registry\Registry; @@ -132,7 +130,7 @@ protected function allowEdit($data = array(), $key = 'id') */ public function batch($model = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Set the model $model = $this->getModel('Field'); diff --git a/administrator/components/com_fields/Controller/FieldsController.php b/administrator/components/com_fields/Controller/FieldsController.php index 484d5cf58cc6b..cba400e444530 100644 --- a/administrator/components/com_fields/Controller/FieldsController.php +++ b/administrator/components/com_fields/Controller/FieldsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Controller/GroupController.php b/administrator/components/com_fields/Controller/GroupController.php index affde2bf3a9b1..692cc724c2923 100644 --- a/administrator/components/com_fields/Controller/GroupController.php +++ b/administrator/components/com_fields/Controller/GroupController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,11 +12,9 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\BaseDatabaseModel; -use Joomla\CMS\Session\Session; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; use Joomla\Registry\Registry; @@ -79,7 +77,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu */ public function batch($model = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Set the model $model = $this->getModel('Group'); diff --git a/administrator/components/com_fields/Controller/GroupsController.php b/administrator/components/com_fields/Controller/GroupsController.php index bc07f2fbc32cb..42e7c49bbe842 100644 --- a/administrator/components/com_fields/Controller/GroupsController.php +++ b/administrator/components/com_fields/Controller/GroupsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Dispatcher/Dispatcher.php b/administrator/components/com_fields/Dispatcher/Dispatcher.php index e3c6399ef1351..9edbb585a1056 100644 --- a/administrator/components/com_fields/Dispatcher/Dispatcher.php +++ b/administrator/components/com_fields/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Field/FieldcontextsField.php b/administrator/components/com_fields/Field/FieldcontextsField.php index 23e1c9b58d29b..793a8b736d64c 100644 --- a/administrator/components/com_fields/Field/FieldcontextsField.php +++ b/administrator/components/com_fields/Field/FieldcontextsField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,16 +13,14 @@ use Joomla\CMS\Factory; use Joomla\CMS\Fields\FieldsServiceInterface; -use Joomla\CMS\Form\FormHelper; - -FormHelper::loadFieldClass('list'); +use Joomla\CMS\Form\Field\ListField; /** * Fields Contexts * * @since 3.7.0 */ -class FieldcontextsField extends \JFormFieldList +class FieldcontextsField extends ListField { public $type = 'Fieldcontexts'; diff --git a/administrator/components/com_fields/Field/FieldgroupsField.php b/administrator/components/com_fields/Field/FieldgroupsField.php index a7c26547416af..e1d9ab0cd451c 100644 --- a/administrator/components/com_fields/Field/FieldgroupsField.php +++ b/administrator/components/com_fields/Field/FieldgroupsField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,17 +12,16 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\Utilities\ArrayHelper; -FormHelper::loadFieldClass('list'); /** * Fields Groups * * @since 3.7.0 */ -class FieldgroupsField extends \JFormFieldList +class FieldgroupsField extends ListField { public $type = 'Fieldgroups'; diff --git a/administrator/components/com_fields/Field/Modal/FieldField.php b/administrator/components/com_fields/Field/Modal/FieldField.php index edfe6972e4ca0..c4fb9f2604728 100644 --- a/administrator/components/com_fields/Field/Modal/FieldField.php +++ b/administrator/components/com_fields/Field/Modal/FieldField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Field/SectionField.php b/administrator/components/com_fields/Field/SectionField.php index 86b267d4e8033..bdea06aee7c75 100644 --- a/administrator/components/com_fields/Field/SectionField.php +++ b/administrator/components/com_fields/Field/SectionField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,16 +12,14 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Form\FormHelper; - -FormHelper::loadFieldClass('list'); +use Joomla\CMS\Form\Field\ListField; /** * Fields Section * * @since 3.7.0 */ -class SectionField extends \JFormFieldList +class SectionField extends ListField { public $type = 'Section'; diff --git a/administrator/components/com_fields/Field/TypeField.php b/administrator/components/com_fields/Field/TypeField.php index de8cddf169ab7..cfbd63afce5fb 100644 --- a/administrator/components/com_fields/Field/TypeField.php +++ b/administrator/components/com_fields/Field/TypeField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,18 +12,17 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\HTML\HTMLHelper; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; -FormHelper::loadFieldClass('list'); - /** * Fields Type * * @since 3.7.0 */ -class TypeField extends \JFormFieldList +class TypeField extends ListField { public $type = 'Type'; diff --git a/administrator/components/com_fields/Field/fieldlayout.php b/administrator/components/com_fields/Field/fieldlayout.php new file mode 100644 index 0000000000000..eb2a449ff5a46 --- /dev/null +++ b/administrator/components/com_fields/Field/fieldlayout.php @@ -0,0 +1,165 @@ +form->getValue('context'))[0]; + + if ($extension) + { + // Get the database object and a new query object. + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + // Build the query. + $query->select('element, name') + ->from('#__extensions') + ->where('client_id = 0') + ->where('type = ' . $db->quote('template')) + ->where('enabled = 1'); + + // Set the query and load the templates. + $db->setQuery($query); + $templates = $db->loadObjectList('element'); + + // Build the search paths for component layouts. + $component_path = JPath::clean(JPATH_SITE . '/components/' . $extension . '/layouts/field'); + + // Prepare array of component layouts + $component_layouts = array(); + + // Prepare the grouped list + $groups = array(); + + // Add "Use Default" + $groups[]['items'][] = JHtml::_('select.option', '', JText::_('JOPTION_USE_DEFAULT')); + + // Add the layout options from the component path. + if (is_dir($component_path) && ($component_layouts = JFolder::files($component_path, '^[^_]*\.php$', false, true))) + { + // Create the group for the component + $groups['_'] = array(); + $groups['_']['id'] = $this->id . '__'; + $groups['_']['text'] = JText::sprintf('JOPTION_FROM_COMPONENT'); + $groups['_']['items'] = array(); + + foreach ($component_layouts as $i => $file) + { + // Add an option to the component group + $value = basename($file, '.php'); + $component_layouts[$i] = $value; + + if ($value === 'render') + { + continue; + } + + $groups['_']['items'][] = JHtml::_('select.option', $value, $value); + } + } + + // Loop on all templates + if ($templates) + { + foreach ($templates as $template) + { + $files = array(); + $template_paths = array( + JPath::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/' . $extension . '/field'), + JPath::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/com_fields/field'), + JPath::clean(JPATH_SITE . '/templates/' . $template->element . '/html/layouts/field'), + ); + + // Add the layout options from the template paths. + foreach ($template_paths as $template_path) + { + if (is_dir($template_path)) + { + $files = array_merge($files, JFolder::files($template_path, '^[^_]*\.php$', false, true)); + } + } + + foreach ($files as $i => $file) + { + $value = basename($file, '.php'); + + // Remove the default "render.php" or layout files that exist in the component folder + if ($value === 'render' || in_array($value, $component_layouts)) + { + unset($files[$i]); + } + } + + if (count($files)) + { + // Create the group for the template + $groups[$template->name] = array(); + $groups[$template->name]['id'] = $this->id . '_' . $template->element; + $groups[$template->name]['text'] = JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name); + $groups[$template->name]['items'] = array(); + + foreach ($files as $file) + { + // Add an option to the template group + $value = basename($file, '.php'); + $groups[$template->name]['items'][] = JHtml::_('select.option', $value, $value); + } + } + } + } + + // Compute attributes for the grouped list + $attr = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; + $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; + + // Prepare HTML code + $html = array(); + + // Compute the current selected values + $selected = array($this->value); + + // Add a grouped list + $html[] = JHtml::_( + 'select.groupedlist', $groups, $this->name, + array('id' => $this->id, 'group.id' => 'id', 'list.attr' => $attr, 'list.select' => $selected) + ); + + return implode($html); + } + + return ''; + } +} diff --git a/administrator/components/com_fields/Helper/FieldsHelper.php b/administrator/components/com_fields/Helper/FieldsHelper.php index b579fa3151407..85b03e79abc0b 100644 --- a/administrator/components/com_fields/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/Helper/FieldsHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -333,9 +333,9 @@ public static function prepareForm($context, Form $form, $data) /* * Setting some parameters for the category field */ - $form->setFieldAttribute('catid', 'custom-fields-enabled', true); - $form->setFieldAttribute('catid', 'custom-fields-cat-id', $assignedCatids); - $form->setFieldAttribute('catid', 'custom-fields-section', $section); + $form->setFieldAttribute('catid', 'refresh-enabled', true); + $form->setFieldAttribute('catid', 'refresh-cat-id', $assignedCatids); + $form->setFieldAttribute('catid', 'refresh-section', $section); } // Getting the fields diff --git a/administrator/components/com_fields/Model/FieldModel.php b/administrator/components/com_fields/Model/FieldModel.php index 0e672cefb74d4..060a260c1ae3a 100644 --- a/administrator/components/com_fields/Model/FieldModel.php +++ b/administrator/components/com_fields/Model/FieldModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -528,7 +528,7 @@ public function getForm($data = array(), $loadData = true) // Get the form. $form = $this->loadForm( - 'com_fields.field' . $context, 'field', + 'com_fields.field.' . $context, 'field', array( 'control' => 'jform', 'load_data' => true, @@ -986,7 +986,7 @@ protected function preprocessForm(\JForm $form, $data, $group = 'content') throw new SectionNotFoundException; } - $cat = $componentObject->getCategory(); + $cat = $componentObject->getCategory([], $section ?: ''); if ($cat->get('root')->hasChildren()) { diff --git a/administrator/components/com_fields/Model/FieldsModel.php b/administrator/components/com_fields/Model/FieldsModel.php index 13ab958edd342..764902bea433d 100644 --- a/administrator/components/com_fields/Model/FieldsModel.php +++ b/administrator/components/com_fields/Model/FieldsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -164,7 +164,7 @@ protected function getListQuery() $query->select('ua.name AS author_name')->join('LEFT', '#__users AS ua ON ua.id = a.created_user_id'); // Join over the field groups. - $query->select('g.title AS group_title, g.access as group_access, g.state AS group_state'); + $query->select('g.title AS group_title, g.access as group_access, g.state AS group_state, g.note as group_note'); $query->join('LEFT', '#__fields_groups AS g ON g.id = a.group_id'); // Filter by context @@ -196,7 +196,13 @@ protected function getListQuery() if ($parts) { // Get the category - $cat = Categories::getInstance(str_replace('com_', '', $parts[0])); + $cat = Categories::getInstance(str_replace('com_', '', $parts[0]) . '.' . $parts[1]); + + // If there is no category for the component and section, so check the component only + if (!$cat) + { + $cat = Categories::getInstance(str_replace('com_', '', $parts[0])); + } if ($cat) { diff --git a/administrator/components/com_fields/Model/GroupModel.php b/administrator/components/com_fields/Model/GroupModel.php index bd799c6bc3509..114c11c5cf85b 100644 --- a/administrator/components/com_fields/Model/GroupModel.php +++ b/administrator/components/com_fields/Model/GroupModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Model/GroupsModel.php b/administrator/components/com_fields/Model/GroupsModel.php index e862786faea9b..cad334b9be3bd 100644 --- a/administrator/components/com_fields/Model/GroupsModel.php +++ b/administrator/components/com_fields/Model/GroupsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Plugin/FieldsListPlugin.php b/administrator/components/com_fields/Plugin/FieldsListPlugin.php index f3ddd9149dcd3..7263ccd16581b 100644 --- a/administrator/components/com_fields/Plugin/FieldsListPlugin.php +++ b/administrator/components/com_fields/Plugin/FieldsListPlugin.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/Plugin/FieldsPlugin.php b/administrator/components/com_fields/Plugin/FieldsPlugin.php index 592bc0958b69e..e9061d1f9a1fc 100644 --- a/administrator/components/com_fields/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/Plugin/FieldsPlugin.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -189,6 +189,7 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $node->setAttribute('name', $field->name); $node->setAttribute('type', $field->type); $node->setAttribute('label', $field->label); + $node->setAttribute('labelclass', $field->params->get('label_class')); $node->setAttribute('description', $field->description); $node->setAttribute('class', $field->params->get('class')); $node->setAttribute('hint', $field->params->get('hint')); diff --git a/administrator/components/com_fields/Table/FieldTable.php b/administrator/components/com_fields/Table/FieldTable.php index 8e3ec9d0ec336..3a555a9a1b96f 100644 --- a/administrator/components/com_fields/Table/FieldTable.php +++ b/administrator/components/com_fields/Table/FieldTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -143,16 +143,14 @@ public function check() } else { + $this->modified_time = $this->getDbo()->getNullDate(); + $this->modified_by = 0; + if (!(int) $this->created_time) { $this->created_time = $date->toSql(); } - if (!(int) $this->modified_time) - { - $this->modified_time = $date->toSql(); - } - if (empty($this->created_user_id)) { $this->created_user_id = $user->get('id'); diff --git a/administrator/components/com_fields/Table/GroupTable.php b/administrator/components/com_fields/Table/GroupTable.php index 37284c4fcdaa5..7530f575ef8d3 100644 --- a/administrator/components/com_fields/Table/GroupTable.php +++ b/administrator/components/com_fields/Table/GroupTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -102,6 +102,9 @@ public function check() } else { + $this->modified = $this->getDbo()->getNullDate(); + $this->modified_by = 0; + if (!(int) $this->created) { $this->created = $date->toSql(); diff --git a/administrator/components/com_fields/View/Field/HtmlView.php b/administrator/components/com_fields/View/Field/HtmlView.php index eab5e44dacfd3..d6b8775448d08 100644 --- a/administrator/components/com_fields/View/Field/HtmlView.php +++ b/administrator/components/com_fields/View/Field/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -117,9 +117,10 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew) { + ToolbarHelper::apply('field.apply'); + ToolbarHelper::saveGroup( [ - ['apply', 'field.apply'], ['save', 'field.save'], ['save2new', 'field.save2new'] ], @@ -138,7 +139,8 @@ protected function addToolbar() // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - $toolbarButtons[] = ['apply', 'field.apply']; + ToolbarHelper::apply('field.apply'); + $toolbarButtons[] = ['save', 'field.save']; // We can save this record, but check the create permission to see if we can return to make a new one. diff --git a/administrator/components/com_fields/View/Fields/HtmlView.php b/administrator/components/com_fields/View/Fields/HtmlView.php index bc48a39f985c8..e5723d6749722 100644 --- a/administrator/components/com_fields/View/Fields/HtmlView.php +++ b/administrator/components/com_fields/View/Fields/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/View/Group/HtmlView.php b/administrator/components/com_fields/View/Group/HtmlView.php index 8a8b2ea1397c2..8829eb3719310 100644 --- a/administrator/components/com_fields/View/Group/HtmlView.php +++ b/administrator/components/com_fields/View/Group/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -144,9 +144,10 @@ protected function addToolbar() // For new records, check the create permission. if ($isNew) { + ToolbarHelper::apply('group.apply'); + ToolbarHelper::saveGroup( [ - ['apply', 'group.apply'], ['save', 'group.save'], ['save2new', 'group.save2new'] ], @@ -165,7 +166,8 @@ protected function addToolbar() // Can't save the record if it's checked out and editable if (!$checkedOut && $itemEditable) { - $toolbarButtons[] = ['apply', 'group.apply']; + ToolbarHelper::apply('group.apply'); + $toolbarButtons[] = ['save', 'group.save']; // We can save this record, but check the create permission to see if we can return to make a new one. diff --git a/administrator/components/com_fields/View/Groups/HtmlView.php b/administrator/components/com_fields/View/Groups/HtmlView.php index ef066b0bce431..5e545ea5277ae 100644 --- a/administrator/components/com_fields/View/Groups/HtmlView.php +++ b/administrator/components/com_fields/View/Groups/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/fields.xml b/administrator/components/com_fields/fields.xml index 4015afce26185..d4b3596c5c22e 100644 --- a/administrator/components/com_fields/fields.xml +++ b/administrator/components/com_fields/fields.xml @@ -3,7 +3,7 @@ com_fields Joomla! Project March 2016 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_fields/forms/field.xml b/administrator/components/com_fields/forms/field.xml index 17906b556b1d9..e469b812752e2 100644 --- a/administrator/components/com_fields/forms/field.xml +++ b/administrator/components/com_fields/forms/field.xml @@ -206,6 +206,13 @@
    + + + + + + + + + + + + + @@ -242,15 +271,12 @@ - - - - + name="label_render_class" + type="textarea" + label="COM_FIELDS_FIELD_LABEL_RENDER_CLASS_LABEL" + size="40" + showon="showlabel:1" + /> COM_FIELDS_FIELD_DISPLAY_NO_DISPLAY + + diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php index 13d8d76526870..7d9de1972cab3 100644 --- a/administrator/components/com_fields/helpers/fields.php +++ b/administrator/components/com_fields/helpers/fields.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/services/provider.php b/administrator/components/com_fields/services/provider.php index da5185fbc8594..3f5f3e216a8d2 100644 --- a/administrator/components/com_fields/services/provider.php +++ b/administrator/components/com_fields/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_fields/tmpl/field/edit.php b/administrator/components/com_fields/tmpl/field/edit.php index 98b1d0293a32d..f95a7e533303f 100644 --- a/administrator/components/com_fields/tmpl/field/edit.php +++ b/administrator/components/com_fields/tmpl/field/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/field/modal.php b/administrator/components/com_fields/tmpl/field/modal.php index 6ab9a96aab686..cd5c4a3199409 100644 --- a/administrator/components/com_fields/tmpl/field/modal.php +++ b/administrator/components/com_fields/tmpl/field/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/field/modal_options.php b/administrator/components/com_fields/tmpl/field/modal_options.php index 40d07743d73af..c1c1dfcac891c 100644 --- a/administrator/components/com_fields/tmpl/field/modal_options.php +++ b/administrator/components/com_fields/tmpl/field/modal_options.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/fields/default.php b/administrator/components/com_fields/tmpl/fields/default.php index 9555a2743b2a2..6d43e413cbf54 100644 --- a/administrator/components/com_fields/tmpl/fields/default.php +++ b/administrator/components/com_fields/tmpl/fields/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -25,13 +25,20 @@ $userId = $user->get('id'); $context = $this->escape($this->state->get('filter.context')); $component = $this->state->get('filter.component'); +$section = $this->state->get('filter.section'); $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'); // The category object of the component -$category = Categories::getInstance(str_replace('com_', '', $component)); +$category = Categories::getInstance(str_replace('com_', '', $component) . '.' . $section); + +// If there is no category for the component and section, then check the component only +if (!$category) +{ + $category = Categories::getInstance(str_replace('com_', '', $component)); +} if ($saveOrder && !empty($this->items)) { diff --git a/administrator/components/com_fields/tmpl/fields/default_batch_body.php b/administrator/components/com_fields/tmpl/fields/default_batch_body.php index b2be9c0cafde4..da6c62b81a365 100644 --- a/administrator/components/com_fields/tmpl/fields/default_batch_body.php +++ b/administrator/components/com_fields/tmpl/fields/default_batch_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/fields/default_batch_footer.php b/administrator/components/com_fields/tmpl/fields/default_batch_footer.php index c758c6437e0f6..9ae14560a39fe 100644 --- a/administrator/components/com_fields/tmpl/fields/default_batch_footer.php +++ b/administrator/components/com_fields/tmpl/fields/default_batch_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -11,9 +11,9 @@ use Joomla\CMS\Language\Text; ?> - - \ No newline at end of file + diff --git a/administrator/components/com_fields/tmpl/fields/modal.php b/administrator/components/com_fields/tmpl/fields/modal.php index 25fc4a5c18519..3c512df66dd07 100644 --- a/administrator/components/com_fields/tmpl/fields/modal.php +++ b/administrator/components/com_fields/tmpl/fields/modal.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/group/edit.php b/administrator/components/com_fields/tmpl/group/edit.php index 23875b2075ebf..7af0e4ed0ff7e 100644 --- a/administrator/components/com_fields/tmpl/group/edit.php +++ b/administrator/components/com_fields/tmpl/group/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/groups/default.php b/administrator/components/com_fields/tmpl/groups/default.php index 01588a65bdc99..6deb6e5f56598 100644 --- a/administrator/components/com_fields/tmpl/groups/default.php +++ b/administrator/components/com_fields/tmpl/groups/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/groups/default_batch_body.php b/administrator/components/com_fields/tmpl/groups/default_batch_body.php index 06b3e42c75dfb..12e807bb36c66 100644 --- a/administrator/components/com_fields/tmpl/groups/default_batch_body.php +++ b/administrator/components/com_fields/tmpl/groups/default_batch_body.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_fields/tmpl/groups/default_batch_footer.php b/administrator/components/com_fields/tmpl/groups/default_batch_footer.php index 90e776c34cad5..86dca38324298 100644 --- a/administrator/components/com_fields/tmpl/groups/default_batch_footer.php +++ b/administrator/components/com_fields/tmpl/groups/default_batch_footer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_fields * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; @@ -11,9 +11,9 @@ use Joomla\CMS\Language\Text; ?> - - \ No newline at end of file + diff --git a/administrator/components/com_finder/Controller/DisplayController.php b/administrator/components/com_finder/Controller/DisplayController.php index f530a39bdf3ea..36db39810a1f8 100644 --- a/administrator/components/com_finder/Controller/DisplayController.php +++ b/administrator/components/com_finder/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Controller/FilterController.php b/administrator/components/com_finder/Controller/FilterController.php index ddb71172ba8ef..5a2c34d94f22b 100644 --- a/administrator/components/com_finder/Controller/FilterController.php +++ b/administrator/components/com_finder/Controller/FilterController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -35,7 +35,7 @@ class FilterController extends FormController public function save($key = null, $urlVar = null) { // Check for request forgeries. - \JSession::checkToken() or jexit(\JText::_('JINVALID_TOKEN')); + $this->checkToken(); $app = Factory::getApplication(); $input = $app->input; diff --git a/administrator/components/com_finder/Controller/FiltersController.php b/administrator/components/com_finder/Controller/FiltersController.php index 80447b3a26376..107d169c762e2 100644 --- a/administrator/components/com_finder/Controller/FiltersController.php +++ b/administrator/components/com_finder/Controller/FiltersController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Controller/IndexController.php b/administrator/components/com_finder/Controller/IndexController.php index 13c830676b19c..d64bc8933cfd6 100644 --- a/administrator/components/com_finder/Controller/IndexController.php +++ b/administrator/components/com_finder/Controller/IndexController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -45,7 +45,7 @@ public function getModel($name = 'Index', $prefix = 'Administrator', $config = a */ public function purge() { - \JSession::checkToken() or jexit(\JText::_('JINVALID_TOKEN')); + $this->checkToken(); // Remove the script time limit. @set_time_limit(0); diff --git a/administrator/components/com_finder/Controller/IndexerController.php b/administrator/components/com_finder/Controller/IndexerController.php index 3a519be11e534..4e86871aeb688 100644 --- a/administrator/components/com_finder/Controller/IndexerController.php +++ b/administrator/components/com_finder/Controller/IndexerController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -62,7 +62,7 @@ public function start() $this->app->allowCache(false); // Check for a valid token. If invalid, send a 403 with the error message. - Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN'), 403)); + Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN_NOTICE'), 403)); // Put in a buffer to silence noise. ob_start(); @@ -130,7 +130,7 @@ public function batch() $this->app->allowCache(false); // Check for a valid token. If invalid, send a 403 with the error message. - Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN'), 403)); + Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN_NOTICE'), 403)); // Put in a buffer to silence noise. ob_start(); @@ -246,7 +246,7 @@ public function optimize() $this->app->allowCache(false); // Check for a valid token. If invalid, send a 403 with the error message. - Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN'), 403)); + Session::checkToken('request') or static::sendResponse(new \Exception(\JText::_('JINVALID_TOKEN_NOTICE'), 403)); // Put in a buffer to silence noise. ob_start(); diff --git a/administrator/components/com_finder/Controller/MapsController.php b/administrator/components/com_finder/Controller/MapsController.php index eb86d60f26de3..7b4a5700ed5fa 100644 --- a/administrator/components/com_finder/Controller/MapsController.php +++ b/administrator/components/com_finder/Controller/MapsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Controller/SearchesController.php b/administrator/components/com_finder/Controller/SearchesController.php index 3e435d2690017..34bfe9f4b151d 100644 --- a/administrator/components/com_finder/Controller/SearchesController.php +++ b/administrator/components/com_finder/Controller/SearchesController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Extension/FinderComponent.php b/administrator/components/com_finder/Extension/FinderComponent.php index cbd9c7374cebf..4514b2679e446 100644 --- a/administrator/components/com_finder/Extension/FinderComponent.php +++ b/administrator/components/com_finder/Extension/FinderComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Field/BranchesField.php b/administrator/components/com_finder/Field/BranchesField.php index ffded897c3024..79217bc88540e 100644 --- a/administrator/components/com_finder/Field/BranchesField.php +++ b/administrator/components/com_finder/Field/BranchesField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Field/ContentmapField.php b/administrator/components/com_finder/Field/ContentmapField.php index 541bd1b2168f8..32735c6efc0b0 100644 --- a/administrator/components/com_finder/Field/ContentmapField.php +++ b/administrator/components/com_finder/Field/ContentmapField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Field/ContenttypesField.php b/administrator/components/com_finder/Field/ContenttypesField.php index 2e97103fb2a08..e19fbbd36d3a2 100644 --- a/administrator/components/com_finder/Field/ContenttypesField.php +++ b/administrator/components/com_finder/Field/ContenttypesField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Field/SearchfilterField.php b/administrator/components/com_finder/Field/SearchfilterField.php index 9b24acbd2e9bc..2e24e83cac051 100644 --- a/administrator/components/com_finder/Field/SearchfilterField.php +++ b/administrator/components/com_finder/Field/SearchfilterField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Helper/FinderHelper.php b/administrator/components/com_finder/Helper/FinderHelper.php index f37f4fe0f13de..104751a39ac5a 100644 --- a/administrator/components/com_finder/Helper/FinderHelper.php +++ b/administrator/components/com_finder/Helper/FinderHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Helper/FinderHelperLanguage.php b/administrator/components/com_finder/Helper/FinderHelperLanguage.php index 871ba7034defa..99cef9bdc4e66 100644 --- a/administrator/components/com_finder/Helper/FinderHelperLanguage.php +++ b/administrator/components/com_finder/Helper/FinderHelperLanguage.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ diff --git a/administrator/components/com_finder/Model/FilterModel.php b/administrator/components/com_finder/Model/FilterModel.php index c7d117c16f03e..58e6eef79d3a5 100644 --- a/administrator/components/com_finder/Model/FilterModel.php +++ b/administrator/components/com_finder/Model/FilterModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Model/FiltersModel.php b/administrator/components/com_finder/Model/FiltersModel.php index 55f5276b0d74e..d16d62499129b 100644 --- a/administrator/components/com_finder/Model/FiltersModel.php +++ b/administrator/components/com_finder/Model/FiltersModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Model/IndexModel.php b/administrator/components/com_finder/Model/IndexModel.php index 3ccecff74f508..5a0e0e6a1bf8e 100644 --- a/administrator/components/com_finder/Model/IndexModel.php +++ b/administrator/components/com_finder/Model/IndexModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -353,7 +353,19 @@ public function purge() // Truncate the taxonomy table and insert the root node. $db->truncateTable('#__finder_taxonomy'); - $root = (object) array('id' => 1, 'parent_id' => 0, 'title' => 'ROOT', 'state' => 0, 'access' => 0, 'ordering' => 0); + $root = (object) array( + 'id' => 1, + 'parent_id' => 0, + 'lft' => 0, + 'rgt' => 1, + 'level' => 0, + 'path' => '', + 'title' => 'ROOT', + 'alias' => 'root', + 'state' => 1, + 'access' => 1, + 'language' => '*' + ); $db->insertObject('#__finder_taxonomy', $root); // Truncate the tokens tables. diff --git a/administrator/components/com_finder/Model/IndexerModel.php b/administrator/components/com_finder/Model/IndexerModel.php index 80b803f202240..71c582cabb3ba 100644 --- a/administrator/components/com_finder/Model/IndexerModel.php +++ b/administrator/components/com_finder/Model/IndexerModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Model/MapsModel.php b/administrator/components/com_finder/Model/MapsModel.php index 3fb39b5487023..b33d586ac0cfe 100644 --- a/administrator/components/com_finder/Model/MapsModel.php +++ b/administrator/components/com_finder/Model/MapsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -165,24 +165,13 @@ protected function getListQuery() // Select all fields from the table. $query = $db->getQuery(true) - ->select('a.id, a.parent_id, a.title, a.state, a.access, a.ordering') - ->select('CASE WHEN a.parent_id = 1 THEN 1 ELSE 2 END AS level') - ->select('p.title AS parent_title') + ->select('a.id, a.parent_id, a.lft, a.rgt, a.level, a.path, a.title, a.alias, a.state, a.access, a.language') ->from($db->quoteName('#__finder_taxonomy', 'a')) - ->leftJoin($db->quoteName('#__finder_taxonomy', 'p') . ' ON p.id = a.parent_id') ->where('a.parent_id != 0'); - $childQuery = $db->getQuery(true) - ->select('parent_id') - ->select('COUNT(*) AS num_children') - ->from($db->quoteName('#__finder_taxonomy')) - ->where('parent_id != 0') - ->group('parent_id'); - - // Join to get children. - $query->select('b.num_children'); - $query->select('CASE WHEN a.parent_id = 1 THEN a.title ELSE p.title END AS branch_title'); - $query->leftJoin('(' . $childQuery . ') AS b ON b.parent_id = a.id'); + // Join to get the branch title + $query->select([$query->qn('b.id', 'branch_id'), $query->qn('b.title', 'branch_title')]) + ->leftJoin($query->qn('#__finder_taxonomy', 'b') . ' ON b.level = 1 AND b.lft <= a.lft AND a.rgt <= b.rgt'); // Join to get the map links. $stateQuery = $db->getQuery(true) @@ -229,16 +218,16 @@ protected function getListQuery() } // Handle the list ordering. - $listOrdering = $this->getState('list.ordering', 'd.branch_title'); + $listOrdering = $this->getState('list.ordering', 'a.lft'); $listDirn = $this->getState('list.direction', 'ASC'); - if ($listOrdering === 'd.branch_title') + if ($listOrdering === 'a.state') { - $query->order("branch_title $listDirn, level ASC, a.title $listDirn"); + $query->order("a.state $listDirn, a.lft $listDirn, level ASC"); } - elseif ($listOrdering === 'a.state') + else { - $query->order("a.state $listDirn, branch_title $listDirn, level ASC"); + $query->order($listOrdering . ' ' . $listDirn); } return $query; @@ -311,7 +300,7 @@ public function getTable($type = 'Map', $prefix = 'Administrator', $config = arr * * @since 2.5 */ - protected function populateState($ordering = 'd.branch_title', $direction = 'ASC') + protected function populateState($ordering = 'a.lft', $direction = 'ASC') { // Load the filter state. $this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string')); diff --git a/administrator/components/com_finder/Model/SearchesModel.php b/administrator/components/com_finder/Model/SearchesModel.php index a7acd23f72863..0b01f289d24d6 100644 --- a/administrator/components/com_finder/Model/SearchesModel.php +++ b/administrator/components/com_finder/Model/SearchesModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Model/StatisticsModel.php b/administrator/components/com_finder/Model/StatisticsModel.php index f0c15f99a970c..f60efce80840d 100644 --- a/administrator/components/com_finder/Model/StatisticsModel.php +++ b/administrator/components/com_finder/Model/StatisticsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Service/HTML/Filter.php b/administrator/components/com_finder/Service/HTML/Filter.php index c2a02abe8818e..c5d1bb147f361 100644 --- a/administrator/components/com_finder/Service/HTML/Filter.php +++ b/administrator/components/com_finder/Service/HTML/Filter.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -84,8 +84,8 @@ public function slider($options = array()) ->where('t.parent_id = 1') ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') - ->group('t.id, t.parent_id, t.state, t.access, t.ordering, t.title, c.parent_id') - ->order('t.ordering, t.title'); + ->group('t.id, t.parent_id, t.state, t.access, t.title, c.parent_id') + ->order('t.lft, t.title'); // Limit the branch children to a predefined filter. if ($filter) @@ -131,10 +131,11 @@ public function slider($options = array()) $query->clear() ->select('t.*') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') - ->where('t.parent_id = ' . (int) $bk) + ->where('t.lft > ' . (int) $bv->lft) + ->where('t.rgt < ' . (int) $bv->rgt) ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') - ->order('t.ordering, t.title'); + ->order('t.lft, t.title'); // Self-join to get the parent title. $query->select('e.title AS parent_title') @@ -195,7 +196,7 @@ public function slider($options = array()) $html .= '
    '; $html .= ''; $html .= '
    '; } @@ -280,8 +281,8 @@ public function select($idxQuery, $options) ->where('c.access IN (' . $groups . ')') ->group($db->quoteName('t.id')) ->group($db->quoteName('t.parent_id')) - ->group('t.title, t.state, t.access, t.ordering') - ->order('t.ordering, t.title'); + ->group('t.title, t.state, t.access, t.lft') + ->order('t.lft, t.title'); // Limit the branch children to a predefined filter. if (!empty($filter->data)) @@ -320,10 +321,11 @@ public function select($idxQuery, $options) $query->clear() ->select('t.*') ->from($db->quoteName('#__finder_taxonomy') . ' AS t') - ->where('t.parent_id = ' . (int) $bk) + ->where('t.lft >= ' . (int) $bv->lft) + ->where('t.rgt <= ' . (int) $bv->rgt) ->where('t.state = 1') ->where('t.access IN (' . $groups . ')') - ->order('t.ordering, t.title'); + ->order('t.lft, t.title'); // Self-join to get the parent title. $query->select('e.title AS parent_title') @@ -362,7 +364,14 @@ public function select($idxQuery, $options) $title = $language->hasKey($key) ? Text::_($key) : $node->title; } - $branches[$bk]->nodes[$node_id]->title = $title; + if ($node->level > 2) + { + $branches[$bk]->nodes[$node_id]->title = str_repeat('-', $node->level - 2) . $title; + } + else + { + $branches[$bk]->nodes[$node_id]->title = $title; + } } // Add the Search All option to the branch. diff --git a/administrator/components/com_finder/Service/HTML/Finder.php b/administrator/components/com_finder/Service/HTML/Finder.php index 3127ab519ea25..64fe6e1a75909 100644 --- a/administrator/components/com_finder/Service/HTML/Finder.php +++ b/administrator/components/com_finder/Service/HTML/Finder.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Service/HTML/Query.php b/administrator/components/com_finder/Service/HTML/Query.php index ca1555bf1a571..17f1ae5f53513 100644 --- a/administrator/components/com_finder/Service/HTML/Query.php +++ b/administrator/components/com_finder/Service/HTML/Query.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Table/FilterTable.php b/administrator/components/com_finder/Table/FilterTable.php index 2368f7f1025d6..0eb548cfaf805 100644 --- a/administrator/components/com_finder/Table/FilterTable.php +++ b/administrator/components/com_finder/Table/FilterTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/Table/LinkTable.php b/administrator/components/com_finder/Table/LinkTable.php index 4eeafc53bec24..f1ed5fd8c306e 100644 --- a/administrator/components/com_finder/Table/LinkTable.php +++ b/administrator/components/com_finder/Table/LinkTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Finder\Administrator\Table; diff --git a/administrator/components/com_finder/Table/MapTable.php b/administrator/components/com_finder/Table/MapTable.php index 2715cce6d9f9f..7a8a32eb9088d 100644 --- a/administrator/components/com_finder/Table/MapTable.php +++ b/administrator/components/com_finder/Table/MapTable.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,7 +11,9 @@ defined('_JEXEC') or die; -use Joomla\CMS\Table\Table; +use Joomla\CMS\Application\ApplicationHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Table\Nested; use Joomla\Database\DatabaseDriver; use Joomla\Utilities\ArrayHelper; @@ -20,7 +22,7 @@ * * @since 2.5 */ -class MapTable extends Table +class MapTable extends Nested { /** * Constructor @@ -32,6 +34,46 @@ class MapTable extends Table public function __construct(DatabaseDriver $db) { parent::__construct('#__finder_taxonomy', 'id', $db); + $this->access = (int) Factory::getConfig()->get('access'); + } + + /** + * Override check function + * + * @return boolean + * + * @see Table::check() + * @since 4.0.0 + */ + public function check() + { + try + { + parent::check(); + } + catch (\Exception $e) + { + $this->setError($e->getMessage()); + + return false; + } + + // Check for a title. + if (trim($this->title) == '') + { + $this->setError(Text::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY')); + + return false; + } + + $this->alias = ApplicationHelper::stringURLSafe($this->title, $this->language); + + if (trim($this->alias) == '') + { + $this->alias = md5(serialize($this->getProperties())); + } + + return true; } /** diff --git a/administrator/components/com_finder/View/Filter/HtmlView.php b/administrator/components/com_finder/View/Filter/HtmlView.php index ad7e3274ebbe3..23b9376ebe499 100644 --- a/administrator/components/com_finder/View/Filter/HtmlView.php +++ b/administrator/components/com_finder/View/Filter/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -123,9 +123,10 @@ protected function addToolbar() // For new records, check the create permission. if ($canDo->get('core.create')) { + ToolbarHelper::apply('filter.apply'); + ToolbarHelper::saveGroup( [ - ['apply', 'filter.apply'], ['save', 'filter.save'], ['save2new', 'filter.save2new'] ], @@ -143,7 +144,8 @@ protected function addToolbar() // Since it's an existing record, check the edit permission. if (!$checkedOut && $canDo->get('core.edit')) { - $toolbarButtons[] = ['apply', 'filter.apply']; + ToolbarHelper::apply('filter.apply'); + $toolbarButtons[] = ['save', 'filter.save']; // We can save this record, but check the create permission to see if we can return to make a new one. diff --git a/administrator/components/com_finder/View/Filters/HtmlView.php b/administrator/components/com_finder/View/Filters/HtmlView.php index 62ae64a016f50..a4b698898fcba 100644 --- a/administrator/components/com_finder/View/Filters/HtmlView.php +++ b/administrator/components/com_finder/View/Filters/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/View/Index/HtmlView.php b/administrator/components/com_finder/View/Index/HtmlView.php index fecdaa73aa16d..9b338b0b0a796 100644 --- a/administrator/components/com_finder/View/Index/HtmlView.php +++ b/administrator/components/com_finder/View/Index/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/View/Indexer/HtmlView.php b/administrator/components/com_finder/View/Indexer/HtmlView.php index 43eca298f9680..433191319c95b 100644 --- a/administrator/components/com_finder/View/Indexer/HtmlView.php +++ b/administrator/components/com_finder/View/Indexer/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/View/Maps/HtmlView.php b/administrator/components/com_finder/View/Maps/HtmlView.php index a8ecc9b5718f2..85f06bee218f8 100644 --- a/administrator/components/com_finder/View/Maps/HtmlView.php +++ b/administrator/components/com_finder/View/Maps/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/View/Searches/HtmlView.php b/administrator/components/com_finder/View/Searches/HtmlView.php index 8e1f2c8d9f8bc..52b34c700e660 100644 --- a/administrator/components/com_finder/View/Searches/HtmlView.php +++ b/administrator/components/com_finder/View/Searches/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/View/Statistics/HtmlView.php b/administrator/components/com_finder/View/Statistics/HtmlView.php index aaffb21992fa2..77d53216d6707 100644 --- a/administrator/components/com_finder/View/Statistics/HtmlView.php +++ b/administrator/components/com_finder/View/Statistics/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/finder.xml b/administrator/components/com_finder/finder.xml index 8363d548cef01..2e3baff5ea895 100644 --- a/administrator/components/com_finder/finder.xml +++ b/administrator/components/com_finder/finder.xml @@ -2,7 +2,7 @@ com_finder Joomla! Project - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. August 2011 GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org diff --git a/administrator/components/com_finder/helpers/indexer/adapter.php b/administrator/components/com_finder/helpers/indexer/adapter.php index 6ef6b2e422958..528fd16083291 100644 --- a/administrator/components/com_finder/helpers/indexer/adapter.php +++ b/administrator/components/com_finder/helpers/indexer/adapter.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -160,7 +160,7 @@ public function __construct(&$subject, $config) /** * Method to get the adapter state and push it into the indexer. * - * @return boolean True on success. + * @return void * * @since 2.5 * @throws Exception on error. @@ -312,7 +312,7 @@ abstract protected function index(FinderIndexerResult $item); * * @param integer $id The ID of the item to reindex. * - * @return boolean True on success. + * @return void * * @since 2.5 * @throws Exception on database error. @@ -902,12 +902,9 @@ protected function pluginDisable($pks) protected function translateState($item, $category = null) { // If category is present, factor in its states as well - if ($category !== null) + if ($category !== null && $category == 0) { - if ($category == 0) - { - $item = 0; - } + $item = 0; } // Translate the state diff --git a/administrator/components/com_finder/helpers/indexer/driver/mysql.php b/administrator/components/com_finder/helpers/indexer/driver/mysql.php index 124a390f4704d..671ef6994a7f4 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/mysql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/mysql.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -57,7 +57,7 @@ public function index($item, $format = 'html') // Get the signatures of the item. $curSig = static::getSignature($item); - $oldSig = isset($link->md5sum) ? $link->md5sum : null; + $oldSig = $link->md5sum ?? null; // Get the other item information. $linkId = empty($link->link_id) ? null : $link->link_id; @@ -104,69 +104,35 @@ public function index($item, $format = 'html') * already exists in the database, we need to use an UPDATE query. * Otherwise, we need to use an INSERT to get the link id back. */ + $entry = new stdClass; + $entry->url = $item->url; + $entry->route = $item->route; + $entry->title = $item->title; + $entry->description = $item->description; + $entry->indexdate = JFactory::getDate()->toSql(); + $entry->state = (int) $item->state; + $entry->access = (int) $item->access; + $entry->language = $item->language; + $entry->type_id = (int) $item->type_id; + $entry->object = ''; + $entry->publish_start_date = $item->publish_start_date; + $entry->publish_end_date = $item->publish_end_date; + $entry->start_date = $item->start_date; + $entry->end_date = $item->end_date; + $entry->list_price = (double) ($item->list_price ?: 0); + $entry->sale_price = (double) ($item->sale_price ?: 0); if ($isNew) { - $columnsArray = array( - $db->quoteName('url'), $db->quoteName('route'), $db->quoteName('title'), $db->quoteName('description'), - $db->quoteName('indexdate'), $db->quoteName('published'), $db->quoteName('state'), $db->quoteName('access'), - $db->quoteName('language'), $db->quoteName('type_id'), $db->quoteName('object'), $db->quoteName('publish_start_date'), - $db->quoteName('publish_end_date'), $db->quoteName('start_date'), $db->quoteName('end_date'), $db->quoteName('list_price'), - $db->quoteName('sale_price') - ); - - // Insert the link. - $query->clear() - ->insert($db->quoteName('#__finder_links')) - ->columns($columnsArray) - ->values( - $db->quote($item->url) . ', ' - . $db->quote($item->route) . ', ' - . $db->quote($item->title) . ', ' - . $db->quote($item->description) . ', ' - . $query->currentTimestamp() . ', ' - . '1, ' - . (int) $item->state . ', ' - . (int) $item->access . ', ' - . $db->quote($item->language) . ', ' - . (int) $item->type_id . ', ' - . $db->quote(serialize($item)) . ', ' - . $db->quote($item->publish_start_date) . ', ' - . $db->quote($item->publish_end_date) . ', ' - . $db->quote($item->start_date) . ', ' - . $db->quote($item->end_date) . ', ' - . (double) ($item->list_price ?: 0) . ', ' - . (double) ($item->sale_price ?: 0) - ); - $db->setQuery($query); - $db->execute(); - - // Get the link id. + // Insert the link and get its id. + $db->insertObject('#__finder_links', $entry); $linkId = (int) $db->insertid(); } else { // Update the link. - $query->clear() - ->update($db->quoteName('#__finder_links')) - ->set($db->quoteName('route') . ' = ' . $db->quote($item->route)) - ->set($db->quoteName('title') . ' = ' . $db->quote($item->title)) - ->set($db->quoteName('description') . ' = ' . $db->quote($item->description)) - ->set($db->quoteName('indexdate') . ' = ' . $query->currentTimestamp()) - ->set($db->quoteName('state') . ' = ' . (int) $item->state) - ->set($db->quoteName('access') . ' = ' . (int) $item->access) - ->set($db->quoteName('language') . ' = ' . $db->quote($item->language)) - ->set($db->quoteName('type_id') . ' = ' . (int) $item->type_id) - ->set($db->quoteName('object') . ' = ' . $db->quote(serialize($item))) - ->set($db->quoteName('publish_start_date') . ' = ' . $db->quote($item->publish_start_date)) - ->set($db->quoteName('publish_end_date') . ' = ' . $db->quote($item->publish_end_date)) - ->set($db->quoteName('start_date') . ' = ' . $db->quote($item->start_date)) - ->set($db->quoteName('end_date') . ' = ' . $db->quote($item->end_date)) - ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ?: 0)) - ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ?: 0)) - ->where('link_id = ' . (int) $linkId); - $db->setQuery($query); - $db->execute(); + $entry->link_id = $linkId; + $db->updateObject('#__finder_links', $entry, 'link_id'); } // Set up the variables we will need during processing. @@ -211,8 +177,7 @@ public function index($item, $format = 'html') if ($group === static::PATH_CONTEXT) { $ip = JFile::stripExt($ip); - $ip = str_replace('/', ' ', $ip); - $ip = str_replace('-', ' ', $ip); + $ip = str_replace(array('/', '-'), ' ', $ip); } // Tokenize a string of content and add it to the database. @@ -261,10 +226,18 @@ public function index($item, $format = 'html') foreach ($nodes as $node) { // Add the node to the tree. - $nodeId = FinderIndexerTaxonomy::addNode($branch, $node->title, $node->state, $node->access); + if ($node->nested) + { + $nodeId = FinderIndexerTaxonomy::addNestedNode($branch, $node->node, $node->state, $node->access, $node->language); + } + else + { + $nodeId = FinderIndexerTaxonomy::addNode($branch, $node->title, $node->state, $node->access, $node->language); + } // Add the link => node map. FinderIndexerTaxonomy::addMap($linkId, $nodeId); + $node->id = $nodeId; // Tokenize the node title and add them to the database. $count += $this->tokenizeToDb($node->title, static::META_CONTEXT, $item->language, $format); @@ -398,6 +371,7 @@ public function index($item, $format = 'html') $query->clear() ->update($db->quoteName('#__finder_links')) ->set($db->quoteName('md5sum') . ' = ' . $db->quote($curSig)) + ->set($db->quoteName('object') . ' = ' . $db->quote(serialize($item))) ->where($db->quoteName('link_id') . ' = ' . $db->quote($linkId)); $db->setQuery($query); $db->execute(); @@ -508,15 +482,15 @@ protected function toggleTables($memory) // Set the internal state. $state = $memory; } - // We must be setting the tables to the MyISAM engine. + // We must be setting the tables to the InnoDB engine. elseif ($memory === false && $state !== false) { - // Set the tokens table to MyISAM. - $db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens') . ' ENGINE = MYISAM'); + // Set the tokens table to InnoDB. + $db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens') . ' ENGINE = INNODB'); $db->execute(); - // Set the tokens aggregate table to MyISAM. - $db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens_aggregate') . ' ENGINE = MYISAM'); + // Set the tokens aggregate table to InnoDB. + $db->setQuery('ALTER TABLE ' . $db->quoteName('#__finder_tokens_aggregate') . ' ENGINE = INNODB'); $db->execute(); // Set the internal state. diff --git a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php index adcbe727c6daa..acba32a7d47e5 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -56,7 +56,7 @@ public function index($item, $format = 'html') $isNew = empty($link->link_id) ? true : false; // Check the signatures. If they match, the item is up to date. - if (!$isNew && $curSig == $oldSig) + if (!$isNew && $curSig === $oldSig) { return $linkId; } @@ -96,69 +96,35 @@ public function index($item, $format = 'html') * already exists in the database, we need to use an UPDATE query. * Otherwise, we need to use an INSERT to get the link id back. */ + $entry = new stdClass; + $entry->url = $item->url; + $entry->route = $item->route; + $entry->title = $item->title; + $entry->description = $item->description; + $entry->indexdate = JFactory::getDate()->toSql(); + $entry->state = (int) $item->state; + $entry->access = (int) $item->access; + $entry->language = $item->language; + $entry->type_id = (int) $item->type_id; + $entry->object = ''; + $entry->publish_start_date = $item->publish_start_date; + $entry->publish_end_date = $item->publish_end_date; + $entry->start_date = $item->start_date; + $entry->end_date = $item->end_date; + $entry->list_price = (double) ($item->list_price ?: 0); + $entry->sale_price = (double) ($item->sale_price ?: 0); if ($isNew) { - $columnsArray = array( - $db->quoteName('url'), $db->quoteName('route'), $db->quoteName('title'), $db->quoteName('description'), - $db->quoteName('indexdate'), $db->quoteName('published'), $db->quoteName('state'), $db->quoteName('access'), - $db->quoteName('language'), $db->quoteName('type_id'), $db->quoteName('object'), $db->quoteName('publish_start_date'), - $db->quoteName('publish_end_date'), $db->quoteName('start_date'), $db->quoteName('end_date'), $db->quoteName('list_price'), - $db->quoteName('sale_price') - ); - - // Insert the link. - $query->clear() - ->insert($db->quoteName('#__finder_links')) - ->columns($columnsArray) - ->values( - $db->quote($item->url) . ', ' - . $db->quote($item->route) . ', ' - . $db->quote($item->title) . ', ' - . $db->quote($item->description) . ', ' - . $query->currentTimestamp() . ', ' - . '1, ' - . (int) $item->state . ', ' - . (int) $item->access . ', ' - . $db->quote($item->language) . ', ' - . (int) $item->type_id . ', ' - . $db->quote(serialize($item)) . ', ' - . $db->quote($item->publish_start_date) . ', ' - . $db->quote($item->publish_end_date) . ', ' - . $db->quote($item->start_date) . ', ' - . $db->quote($item->end_date) . ', ' - . (double) ($item->list_price ?: 0) . ', ' - . (double) ($item->sale_price ?: 0) - ); - $db->setQuery($query); - $db->execute(); - - // Get the link id. + // Insert the link and get its id. + $db->insertObject('#__finder_links', $entry); $linkId = (int) $db->insertid(); } else { // Update the link. - $query->clear() - ->update($db->quoteName('#__finder_links')) - ->set($db->quoteName('route') . ' = ' . $db->quote($item->route)) - ->set($db->quoteName('title') . ' = ' . $db->quote($item->title)) - ->set($db->quoteName('description') . ' = ' . $db->quote($item->description)) - ->set($db->quoteName('indexdate') . ' = ' . $query->currentTimestamp()) - ->set($db->quoteName('state') . ' = ' . (int) $item->state) - ->set($db->quoteName('access') . ' = ' . (int) $item->access) - ->set($db->quoteName('language') . ' = ' . $db->quote($item->language)) - ->set($db->quoteName('type_id') . ' = ' . (int) $item->type_id) - ->set($db->quoteName('object') . ' = ' . $db->quote(serialize($item))) - ->set($db->quoteName('publish_start_date') . ' = ' . $db->quote($item->publish_start_date)) - ->set($db->quoteName('publish_end_date') . ' = ' . $db->quote($item->publish_end_date)) - ->set($db->quoteName('start_date') . ' = ' . $db->quote($item->start_date)) - ->set($db->quoteName('end_date') . ' = ' . $db->quote($item->end_date)) - ->set($db->quoteName('list_price') . ' = ' . (double) ($item->list_price ?: 0)) - ->set($db->quoteName('sale_price') . ' = ' . (double) ($item->sale_price ?: 0)) - ->where('link_id = ' . (int) $linkId); - $db->setQuery($query); - $db->execute(); + $entry->link_id = $linkId; + $db->updateObject('#__finder_links', $entry, 'link_id'); } // Set up the variables we will need during processing. @@ -203,8 +169,7 @@ public function index($item, $format = 'html') if ($group === static::PATH_CONTEXT) { $ip = JFile::stripExt($ip); - $ip = str_replace('/', ' ', $ip); - $ip = str_replace('-', ' ', $ip); + $ip = str_replace(array('/', '-'), ' ', $ip); } // Tokenize a string of content and add it to the database. @@ -253,10 +218,18 @@ public function index($item, $format = 'html') foreach ($nodes as $node) { // Add the node to the tree. - $nodeId = FinderIndexerTaxonomy::addNode($branch, $node->title, $node->state, $node->access); + if ($node->nested) + { + $nodeId = FinderIndexerTaxonomy::addNestedNode($branch, $node->node, $node->state, $node->access, $node->language); + } + else + { + $nodeId = FinderIndexerTaxonomy::addNode($branch, $node->title, $node->state, $node->access, $node->language); + } // Add the link => node map. FinderIndexerTaxonomy::addMap($linkId, $nodeId); + $node->id = $nodeId; // Tokenize the node title and add them to the database. $count += $this->tokenizeToDb($node->title, static::META_CONTEXT, $item->language, $format); @@ -274,28 +247,28 @@ public function index($item, $format = 'html') * table. */ $query = 'INSERT INTO ' . $db->quoteName('#__finder_tokens_aggregate') . - ' (' . $db->quoteName('term_id') . - ', ' . $db->quoteName('term') . - ', ' . $db->quoteName('stem') . - ', ' . $db->quoteName('common') . - ', ' . $db->quoteName('phrase') . - ', ' . $db->quoteName('term_weight') . - ', ' . $db->quoteName('context') . - ', ' . $db->quoteName('context_weight') . - ', ' . $db->quoteName('language') . ')' . - ' SELECT' . - ' t.term_id, t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context,' . - ' ROUND( t1.weight * COUNT( t2.term ) * %F, 8 ) AS context_weight, t1.language' . - ' FROM (' . - ' SELECT DISTINCT t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context, t1.language' . - ' FROM ' . $db->quoteName('#__finder_tokens') . ' AS t1' . - ' WHERE t1.context = %d' . - ' ) AS t1' . - ' JOIN ' . $db->quoteName('#__finder_tokens') . ' AS t2 ON t2.term = t1.term' . - ' LEFT JOIN ' . $db->quoteName('#__finder_terms') . ' AS t ON t.term = t1.term' . - ' WHERE t2.context = %d AND t.term_id IS NOT NULL' . - ' GROUP BY t1.term, t.term_id, t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context, t1.language' . - ' ORDER BY t1.term DESC'; + ' (' . $db->quoteName('term_id') . + ', ' . $db->quoteName('term') . + ', ' . $db->quoteName('stem') . + ', ' . $db->quoteName('common') . + ', ' . $db->quoteName('phrase') . + ', ' . $db->quoteName('term_weight') . + ', ' . $db->quoteName('context') . + ', ' . $db->quoteName('context_weight') . + ', ' . $db->quoteName('language') . ')' . + ' SELECT' . + ' t.term_id, t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context,' . + ' ROUND( t1.weight * COUNT( t2.term ) * %F, 8 ) AS context_weight, t1.language' . + ' FROM (' . + ' SELECT DISTINCT t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context, t1.language' . + ' FROM ' . $db->quoteName('#__finder_tokens') . ' AS t1' . + ' WHERE t1.context = %d' . + ' ) AS t1' . + ' JOIN ' . $db->quoteName('#__finder_tokens') . ' AS t2 ON t2.term = t1.term' . + ' LEFT JOIN ' . $db->quoteName('#__finder_terms') . ' AS t ON t.term = t1.term' . + ' WHERE t2.context = %d AND t.term_id IS NOT NULL' . + ' GROUP BY t1.term, t.term_id, t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context, t1.language' . + ' ORDER BY t1.term DESC'; // Iterate through the contexts and aggregate the tokens per context. foreach ($state->weights as $context => $multiplier) @@ -323,7 +296,7 @@ public function index($item, $format = 'html') ' WHERE ta.term_id = 0' ); - if ($db->loadRow() == null) + if ($db->loadRow() === null) { $db->setQuery( 'INSERT INTO ' . $db->quoteName('#__finder_terms') . @@ -401,6 +374,7 @@ public function index($item, $format = 'html') $query->clear() ->update($db->quoteName('#__finder_links')) ->set($db->quoteName('md5sum') . ' = ' . $db->quote($curSig)) + ->set($db->quoteName('object') . ' = ' . $db->quote(serialize($item))) ->where($db->quoteName('link_id') . ' = ' . $db->quote($linkId)); $db->setQuery($query); $db->execute(); diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php index 69f43863f5d82..fedfa0da4569c 100644 --- a/administrator/components/com_finder/helpers/indexer/helper.php +++ b/administrator/components/com_finder/helpers/indexer/helper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -49,7 +49,7 @@ public static function parse($input, $format = 'html') * @param string $lang The language of the input. * @param boolean $phrase Flag to indicate whether input could be a phrase. [optional] * - * @return array An array of FinderIndexerToken objects. + * @return array|FinderIndexerToken An array of FinderIndexerToken objects or a single FinderIndexerToken object. * * @since 2.5 */ @@ -224,7 +224,7 @@ public static function addContentType($title, $mime = null) { static $types; - $db = JFactory::getDbo(); + $db = JFactory::getDbo(); $query = $db->getQuery(true); // Check if the types are loaded. @@ -393,7 +393,7 @@ public static function getPrimaryLanguage($lang) * @since 2.5 * @throws Exception on database error. */ - public static function getContentExtras(FinderIndexerResult &$item) + public static function getContentExtras(FinderIndexerResult $item) { // Load the finder plugin group. JPluginHelper::importPlugin('finder'); @@ -433,7 +433,7 @@ public static function prepareContent($text, $params = null, FinderIndexerResult } // Create a mock content object. - $content = JTable::getInstance('Content'); + $content = JTable::getInstance('Content'); $content->text = $text; if ($item) diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php index c2c3b3aaf01d7..08c3e5994ee8a 100644 --- a/administrator/components/com_finder/helpers/indexer/indexer.php +++ b/administrator/components/com_finder/helpers/indexer/indexer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -100,7 +100,7 @@ abstract class FinderIndexer /** * Reusable Query Template. To be used with clone. * - * @var JDatabaseQuery + * @var Joomla\Database\QueryInterface * @since 3.8.0 */ protected $addTokensToDbQueryTemplate; @@ -116,7 +116,10 @@ public function __construct() $db = $this->db; - // Set up query template for addTokensToDb + /** + * Set up query template for addTokensToDb, we will be cloning this template when needed. + * This is about twice as fast as calling the clear function or setting up a new object. + */ $this->addTokensToDbQueryTemplate = $db->getQuery(true)->insert($db->quoteName('#__finder_tokens')) ->columns( array( @@ -170,7 +173,7 @@ public static function getInstance() public static function getState() { // First, try to load from the internal state. - if (!empty(static::$state)) + if ((bool) static::$state) { return static::$state; } @@ -424,8 +427,7 @@ protected function tokenizeToDb($input, $context, $lang, $format) // Parse, tokenise and add tokens to the database. $count = $this->tokenizeToDbShort($string, $context, $lang, $format, $count); - unset($string); - unset($tokens); + unset($string, $tokens); } return $count; @@ -484,8 +486,8 @@ private function tokenizeToDbShort($input, $context, $lang, $format, $count) /** * Method to add a set of tokens to the database. * - * @param FinderIndexerToken[] $tokens An array or single FinderIndexerToken object. - * @param mixed $context The context of the tokens. See context constants. [optional] + * @param FinderIndexerToken[]|FinderIndexerToken $tokens An array or single FinderIndexerToken object. + * @param mixed $context The context of the tokens. See context constants. [optional] * * @return integer The number of tokens inserted into the database. * @@ -506,45 +508,65 @@ protected function addTokensToDb($tokens, $context = '') // Get the database object. $db = $this->db; - $query = clone $this->addTokensToDbQueryTemplate; - - // Check if a single FinderIndexerToken object was given and make it to be an array of FinderIndexerToken objects - $tokens = is_array($tokens) ? $tokens : array($tokens); - // Count the number of token values. $values = 0; - // Break into chunks of no more than 1000 items - $chunks = array_chunk($tokens, 1000); - - foreach ($chunks as $tokens) + if (($tokens instanceof FinderIndexerToken) === false) { - $query->clear('values'); + // Break into chunks of no more than 1000 items + $chunks = count($tokens) > 1000 + ? array_chunk($tokens, 1000) + : array($tokens); - // Iterate through the tokens to create SQL value sets. - foreach ($tokens as $token) + foreach ($chunks as $chunkTokens) { - if ($filterCommon && $token->common) + $query = clone $this->addTokensToDbQueryTemplate; + + // Iterate through the tokens to create SQL value sets. + foreach ($chunkTokens as $token) { - continue; + if ($filterCommon && $token->common) + { + continue; + } + + if ($filterNumeric && $token->numeric) + { + continue; + } + + $query->values( + $db->quote($token->term) . ', ' + . $db->quote($token->stem) . ', ' + . (int) $token->common . ', ' + . (int) $token->phrase . ', ' + . $db->quote($token->weight) . ', ' + . (int) $context . ', ' + . $db->quote($token->language) + ); + $values++; } - if ($filterNumeric && $token->numeric) + if ($query->values) { - continue; + $db->setQuery($query)->execute(); } - - $query->values( - $db->quote($token->term) . ', ' - . $db->quote($token->stem) . ', ' - . (int) $token->common . ', ' - . (int) $token->phrase . ', ' - . $db->quote($token->weight) . ', ' - . (int) $context . ', ' - . $db->quote($token->language) - ); - ++$values; } + } + else + { + $query = clone $this->addTokensToDbQueryTemplate; + + $query->values( + $db->quote($tokens->term) . ', ' + . $db->quote($tokens->stem) . ', ' + . (int) $tokens->common . ', ' + . (int) $tokens->phrase . ', ' + . $db->escape((float) $tokens->weight) . ', ' + . (int) $context . ', ' + . $db->quote($tokens->language) + ); + $values++; if ($query->values) { diff --git a/administrator/components/com_finder/helpers/indexer/language.php b/administrator/components/com_finder/helpers/indexer/language.php index 57c0ffdd99a0d..a645ef5826899 100644 --- a/administrator/components/com_finder/helpers/indexer/language.php +++ b/administrator/components/com_finder/helpers/indexer/language.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/da.php b/administrator/components/com_finder/helpers/indexer/language/da.php index b43399da38386..b8f32e31ff768 100644 --- a/administrator/components/com_finder/helpers/indexer/language/da.php +++ b/administrator/components/com_finder/helpers/indexer/language/da.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/de.php b/administrator/components/com_finder/helpers/indexer/language/de.php index e8a3f7c406e45..1f59903d09133 100644 --- a/administrator/components/com_finder/helpers/indexer/language/de.php +++ b/administrator/components/com_finder/helpers/indexer/language/de.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/el.php b/administrator/components/com_finder/helpers/indexer/language/el.php index 34b72089685bf..be1b5daa28821 100644 --- a/administrator/components/com_finder/helpers/indexer/language/el.php +++ b/administrator/components/com_finder/helpers/indexer/language/el.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * The Greek stemmer was adapted for Joomla! 4 by Nicholas K. Dionysopoulos . This is diff --git a/administrator/components/com_finder/helpers/indexer/language/en.php b/administrator/components/com_finder/helpers/indexer/language/en.php index 3ca92161d4d80..c04b7442d9ca5 100644 --- a/administrator/components/com_finder/helpers/indexer/language/en.php +++ b/administrator/components/com_finder/helpers/indexer/language/en.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/es.php b/administrator/components/com_finder/helpers/indexer/language/es.php index c19e1c9187f29..d941f389528cf 100644 --- a/administrator/components/com_finder/helpers/indexer/language/es.php +++ b/administrator/components/com_finder/helpers/indexer/language/es.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/fr.php b/administrator/components/com_finder/helpers/indexer/language/fr.php index 1db6c798932af..51157f18e0d7a 100644 --- a/administrator/components/com_finder/helpers/indexer/language/fr.php +++ b/administrator/components/com_finder/helpers/indexer/language/fr.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/it.php b/administrator/components/com_finder/helpers/indexer/language/it.php index aea7d18bffd53..e1df4288edddb 100644 --- a/administrator/components/com_finder/helpers/indexer/language/it.php +++ b/administrator/components/com_finder/helpers/indexer/language/it.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/nl.php b/administrator/components/com_finder/helpers/indexer/language/nl.php index 8d785e92f2e58..c06e11ab3a011 100644 --- a/administrator/components/com_finder/helpers/indexer/language/nl.php +++ b/administrator/components/com_finder/helpers/indexer/language/nl.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/nn.php b/administrator/components/com_finder/helpers/indexer/language/nn.php index 38d4cb047ef17..051bf934bd55a 100644 --- a/administrator/components/com_finder/helpers/indexer/language/nn.php +++ b/administrator/components/com_finder/helpers/indexer/language/nn.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/pt.php b/administrator/components/com_finder/helpers/indexer/language/pt.php index f9e5072dc8892..1fecc18091d85 100644 --- a/administrator/components/com_finder/helpers/indexer/language/pt.php +++ b/administrator/components/com_finder/helpers/indexer/language/pt.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/ro.php b/administrator/components/com_finder/helpers/indexer/language/ro.php index e3be94c873f39..27a8201763ab4 100644 --- a/administrator/components/com_finder/helpers/indexer/language/ro.php +++ b/administrator/components/com_finder/helpers/indexer/language/ro.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/ru.php b/administrator/components/com_finder/helpers/indexer/language/ru.php index df5982751c8d0..7ca4da2c96141 100644 --- a/administrator/components/com_finder/helpers/indexer/language/ru.php +++ b/administrator/components/com_finder/helpers/indexer/language/ru.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/sv.php b/administrator/components/com_finder/helpers/indexer/language/sv.php index 3d8fff3c215ab..2912fa285ef24 100644 --- a/administrator/components/com_finder/helpers/indexer/language/sv.php +++ b/administrator/components/com_finder/helpers/indexer/language/sv.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/language/zh.php b/administrator/components/com_finder/helpers/indexer/language/zh.php index 60c33c380a56c..b972ec3077405 100644 --- a/administrator/components/com_finder/helpers/indexer/language/zh.php +++ b/administrator/components/com_finder/helpers/indexer/language/zh.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/parser.php b/administrator/components/com_finder/helpers/indexer/parser.php index 9237195a3be18..d8c6cb58cf2cf 100644 --- a/administrator/components/com_finder/helpers/indexer/parser.php +++ b/administrator/components/com_finder/helpers/indexer/parser.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php index 41ee325409e1d..3a19ead3d433b 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/html.php +++ b/administrator/components/com_finder/helpers/indexer/parser/html.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -101,6 +101,8 @@ protected function process($input) * @param string $endTag String representing the end tag. * * @return string with blocks removed. + * + * @since 3.4 */ private function removeBlocks($input, $startTag, $endTag) { diff --git a/administrator/components/com_finder/helpers/indexer/parser/rtf.php b/administrator/components/com_finder/helpers/indexer/parser/rtf.php index fbb2563d2c4db..80fa1d1ac2d7e 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/rtf.php +++ b/administrator/components/com_finder/helpers/indexer/parser/rtf.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -30,12 +30,12 @@ class FinderIndexerParserRtf extends FinderIndexerParser protected function process($input) { // Remove embedded pictures. - $input = preg_replace('#{\\\pict[^}]*}#mis', '', $input); + $input = preg_replace('#{\\\pict[^}]*}#mi', '', $input); // Remove control characters. $input = str_replace(array('{', '}', "\\\n"), array(' ', ' ', "\n"), $input); - $input = preg_replace('#\\\([^;]+?);#mis', ' ', $input); - $input = preg_replace('#\\\[\'a-zA-Z0-9]+#mis', ' ', $input); + $input = preg_replace('#\\\([^;]+?);#m', ' ', $input); + $input = preg_replace('#\\\[\'a-zA-Z0-9]+#mi', ' ', $input); return $input; } diff --git a/administrator/components/com_finder/helpers/indexer/parser/txt.php b/administrator/components/com_finder/helpers/indexer/parser/txt.php index 4b8b516823589..0af671c969fc6 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/txt.php +++ b/administrator/components/com_finder/helpers/indexer/parser/txt.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php index 7942598000ca0..54dde8a5efda4 100644 --- a/administrator/components/com_finder/helpers/indexer/query.php +++ b/administrator/components/com_finder/helpers/indexer/query.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -111,7 +111,7 @@ class FinderIndexerQuery * Allow empty searches * * @var boolean - * @since __DEPLOY_VERSION__ + * @since 4.0.0 */ public $empty; @@ -197,34 +197,34 @@ public function __construct($options) $this->dates = new Registry; // Populate the temporary date storage. - if (isset($options['date1']) && !empty($options['date1'])) + if (!empty($options['date1'])) { $this->dates->set('date1', $options['date1']); } - if (isset($options['date2']) && !empty($options['date1'])) + if (!empty($options['date2'])) { $this->dates->set('date2', $options['date2']); } - if (isset($options['when1']) && !empty($options['date1'])) + if (!empty($options['when1'])) { $this->dates->set('when1', $options['when1']); } - if (isset($options['when2']) && !empty($options['date1'])) + if (!empty($options['when2'])) { $this->dates->set('when2', $options['when2']); } // Process the static taxonomy filters. - if (isset($options['filter']) && !empty($options['filter'])) + if (!empty($options['filter'])) { $this->processStaticTaxonomy($options['filter']); } // Process the dynamic taxonomy filters. - if (isset($options['filters']) && !empty($options['filters'])) + if (!empty($options['filters'])) { $this->processDynamicTaxonomy($options['filters']); } @@ -281,10 +281,10 @@ public function __construct($options) * * @since 2.5 */ - public function toUri($base = null) + public function toUri($base = '') { // Set the base if not specified. - if (empty($base)) + if ($base === '') { $base = 'index.php?option=com_finder&view=search'; } @@ -293,7 +293,7 @@ public function toUri($base = null) $uri = JUri::getInstance($base); // Add the static taxonomy filter if present. - if (!empty($this->filter)) + if ((bool) $this->filter) { $uri->setVar('f', $this->filter); } @@ -302,7 +302,7 @@ public function toUri($base = null) $t = JFactory::getApplication()->input->request->get('t', array(), 'array'); // Add the dynamic taxonomy filters if present. - if (!empty($this->filters)) + if ((bool) $this->filters) { foreach ($this->filters as $nodes) { @@ -540,7 +540,7 @@ protected function processStaticTaxonomy($filterId) $filters = ArrayHelper::toInteger($filters); // Remove any values of zero. - if (array_search(0, $filters, true) !== false) + if (in_array(0, $filters, true) !== false) { unset($filters[array_search(0, $filters, true)]); } @@ -603,7 +603,7 @@ protected function processDynamicTaxonomy($filters) $filters = ArrayHelper::toInteger($filters); // Remove any values of zero. - if (array_search(0, $filters, true) !== false) + if (in_array(0, $filters, true) !== false) { unset($filters[array_search(0, $filters, true)]); } @@ -616,6 +616,7 @@ protected function processDynamicTaxonomy($filters) // Get the database object. $db = JFactory::getDbo(); + $query = $db->getQuery(true); /* @@ -651,7 +652,7 @@ protected function processDynamicTaxonomy($filters) foreach ($results as $result) { // Check if the branch has been cleared. - if (!in_array($result->branch, $cleared)) + if (!in_array($result->branch, $cleared, true)) { // Clear the branch. $this->filters[$result->branch] = array(); @@ -708,7 +709,7 @@ protected function processDates($date1, $date2, $when1, $when2) { // Set the date filter. $this->date1 = $date->toSql(); - $this->when1 = in_array($when1, $whens) ? $when1 : 'before'; + $this->when1 = in_array($when1, $whens, true) ? $when1 : 'before'; } // The value of 'today' is a special case that we need to handle. @@ -725,7 +726,7 @@ protected function processDates($date1, $date2, $when1, $when2) { // Set the date filter. $this->date2 = $date->toSql(); - $this->when2 = in_array($when2, $whens) ? $when2 : 'before'; + $this->when2 = in_array($when2, $whens, true) ? $when2 : 'before'; } return true; @@ -833,7 +834,7 @@ protected function processString($input, $lang, $mode) { // Set the date filter. $this->date1 = $date->toSql(); - $this->when1 = in_array($modifier, $whens) ? $modifier : 'before'; + $this->when1 = in_array($modifier, $whens, true) ? $modifier : 'before'; } break; @@ -841,7 +842,7 @@ protected function processString($input, $lang, $mode) // Handle a taxonomy branch filter. default: - { + { // Try to find the node id. $return = FinderIndexerTaxonomy::getNodeByTitle($modifier, $value); @@ -849,7 +850,7 @@ protected function processString($input, $lang, $mode) if ($return) { // Check if the branch has been cleared. - if (!in_array($modifier, $cleared)) + if (!in_array($modifier, $cleared, true)) { // Clear the branch. $this->filters[$modifier] = array(); @@ -882,7 +883,7 @@ protected function processString($input, $lang, $mode) $matches = array(); // Extract the tokens enclosed in double quotes. - if (preg_match_all('#\"([^"]+)\"#mi', $input, $matches)) + if (preg_match_all('#\"([^"]+)\"#m', $input, $matches)) { /* * One or more phrases were found so we need to iterate through @@ -942,7 +943,7 @@ protected function processString($input, $lang, $mode) if (count($chunk)) { $phrases[] = implode(' ', $chunk); - $terms[] = implode(' ', $chunk); + $terms[] = implode(' ', $chunk); } } } @@ -950,14 +951,14 @@ protected function processString($input, $lang, $mode) { // The phrase is <= $tuplecount words so we can use it as is. $phrases[] = $match; - $terms[] = $match; + $terms[] = $match; } } } } // Add the remaining terms if present. - if (!empty($input)) + if ((bool) $input) { $terms = array_merge($terms, explode(' ', $input)); } @@ -973,7 +974,7 @@ protected function processString($input, $lang, $mode) if (JDEBUG) { $debugStrings = array('**', '??'); - $operators = str_replace($debugStrings, '', $operators); + $operators = str_replace($debugStrings, '', $operators); } /* @@ -984,16 +985,18 @@ protected function processString($input, $lang, $mode) for ($i = 0, $c = count($terms); $i < $c; $i++) { // Check if the term is followed by an operator that we understand. - if (isset($terms[$i + 1]) && in_array($terms[$i + 1], $operators)) + if (isset($terms[$i + 1]) && in_array($terms[$i + 1], $operators, true)) { // Get the operator mode. - $op = array_search($terms[$i + 1], $operators); + $op = array_search($terms[$i + 1], $operators, true); // Handle the AND operator. if ($op === 'AND' && isset($terms[$i + 2])) { // Tokenize the current term. $token = FinderIndexerHelper::tokenize($terms[$i], $lang, true); + + // Todo: The previous function call may return an array, which seems not to be handled by the next one, which expects an object $token = $this->getTokenData(array_shift($token)); if ($params->get('filter_commonwords', 0) && $token->common) @@ -1011,7 +1014,7 @@ protected function processString($input, $lang, $mode) // Add the current token to the stack. $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); // Skip the next token (the mode operator). $this->operators[] = $terms[$i + 1]; @@ -1025,23 +1028,21 @@ protected function processString($input, $lang, $mode) // Add the token after the next token to the stack. $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); // Remove the processed phrases if possible. - if (($pk = array_search($terms[$i], $phrases)) !== false) + if (($pk = array_search($terms[$i], $phrases, true)) !== false) { unset($phrases[$pk]); } - if (($pk = array_search($terms[$i + 2], $phrases)) !== false) + if (($pk = array_search($terms[$i + 2], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); - unset($terms[$i + 2]); + unset($terms[$i], $terms[$i + 1], $terms[$i + 2]); // Adjust the loop. $i += 2; @@ -1068,10 +1069,10 @@ protected function processString($input, $lang, $mode) $token->required = false; // Add the current token to the stack. - if (count($token->matches)) + if ((bool) $token->matches) { $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); } else { @@ -1089,10 +1090,10 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the token after the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); } else { @@ -1100,20 +1101,18 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrases if possible. - if (($pk = array_search($terms[$i], $phrases)) !== false) + if (($pk = array_search($terms[$i], $phrases, true)) !== false) { unset($phrases[$pk]); } - if (($pk = array_search($terms[$i + 2], $phrases)) !== false) + if (($pk = array_search($terms[$i + 2], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); - unset($terms[$i + 2]); + unset($terms[$i], $terms[$i + 1], $terms[$i + 2]); // Adjust the loop. $i += 2; @@ -1121,7 +1120,7 @@ protected function processString($input, $lang, $mode) } } // Handle an orphaned OR operator. - elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators) === 'OR') + elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators, true) === 'OR') { // Skip the next token (the mode operator). $this->operators[] = $terms[$i]; @@ -1130,12 +1129,12 @@ protected function processString($input, $lang, $mode) $other = FinderIndexerHelper::tokenize($terms[$i + 1], $lang, true); $other = $this->getTokenData(array_shift($other)); - if ($params->get('filter_commonwords', 0) && $token->common) + if ($params->get('filter_commonwords', 0) && $other->common) { continue; } - if ($params->get('filter_numeric', 0) && $token->numeric) + if ($params->get('filter_numeric', 0) && $other->numeric) { continue; } @@ -1144,10 +1143,10 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the token after the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); } else { @@ -1155,21 +1154,20 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrase if possible. - if (($pk = array_search($terms[$i + 1], $phrases)) !== false) + if (($pk = array_search($terms[$i + 1], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); + unset($terms[$i], $terms[$i + 1]); // Adjust the loop. $i++; continue; } // Handle the NOT operator. - elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators) === 'NOT') + elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators, true) === 'NOT') { // Skip the next token (the mode operator). $this->operators[] = $terms[$i]; @@ -1178,12 +1176,12 @@ protected function processString($input, $lang, $mode) $other = FinderIndexerHelper::tokenize($terms[$i + 1], $lang, true); $other = $this->getTokenData(array_shift($other)); - if ($params->get('filter_commonwords', 0) && $token->common) + if ($params->get('filter_commonwords', 0) && $other->common) { continue; } - if ($params->get('filter_numeric', 0) && $token->numeric) + if ($params->get('filter_numeric', 0) && $other->numeric) { continue; } @@ -1192,7 +1190,7 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->excluded[] = $other; } @@ -1202,14 +1200,13 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrase if possible. - if (($pk = array_search($terms[$i + 1], $phrases)) !== false) + if (($pk = array_search($terms[$i + 1], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); + unset($terms[$i], $terms[$i + 1]); // Adjust the loop. $i++; @@ -1243,10 +1240,10 @@ protected function processString($input, $lang, $mode) // Add the current token to the stack. $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); // Remove the processed term if possible. - if (($pk = array_search($phrases[$i], $terms)) !== false) + if (($pk = array_search($phrases[$i], $terms, true)) !== false) { unset($terms[$pk]); } @@ -1258,10 +1255,10 @@ protected function processString($input, $lang, $mode) /* * Handle any remaining tokens using the standard processing mechanism. */ - if (!empty($terms)) + if ((bool) $terms) { // Tokenize the terms. - $terms = implode(' ', $terms); + $terms = implode(' ', $terms); $tokens = FinderIndexerHelper::tokenize($terms, $lang, false); // Make sure we are working with an array. @@ -1284,13 +1281,13 @@ protected function processString($input, $lang, $mode) } // Set the required flag for the token. - $token->required = $mode === 'AND' ? ($token->phrase ? false : true) : false; + $token->required = $mode === 'AND' ? (!$token->phrase) : false; // Add the token to the appropriate stack. - if (count($token->matches) || $token->required) + if ($token->required || (bool) $token->matches) { $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); } else { @@ -1345,11 +1342,8 @@ protected function getTokenData($token) $db->setQuery($query); $matches = $db->loadObjectList(); - // Setup the container. - $token->matches = array(); - // Check the matching terms. - if (!empty($matches)) + if ((bool) $matches) { // Add the matches to the token. for ($i = 0, $c = count($matches); $i < $c; $i++) @@ -1406,7 +1400,7 @@ protected function getTokenData($token) // Get the closest match. $keys = array_keys($suggestions); - $key = $keys[0]; + $key = $keys[0]; // Add the suggested term. $token->suggestion = $results[$key]->term; diff --git a/administrator/components/com_finder/helpers/indexer/result.php b/administrator/components/com_finder/helpers/indexer/result.php index 58629d069bf27..6b39e4c7f1b09 100644 --- a/administrator/components/com_finder/helpers/indexer/result.php +++ b/administrator/components/com_finder/helpers/indexer/result.php @@ -3,12 +3,13 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\Tree\ImmutableNodeInterface; JLoader::register('FinderIndexer', __DIR__ . '/indexer.php'); /** @@ -21,7 +22,7 @@ * * @since 2.5 */ -class FinderIndexerResult +class FinderIndexerResult implements Serializable { /** * An array of extra result properties. @@ -324,14 +325,11 @@ public function getInstructions() public function addInstruction($group, $property) { // Check if the group exists. We can't add instructions for unknown groups. - if (array_key_exists($group, $this->instructions)) + // Check if the property exists in the group. + if (array_key_exists($group, $this->instructions) && !in_array($property, $this->instructions[$group], true)) { - // Check if the property exists in the group. - if (!in_array($property, $this->instructions[$group])) - { - // Add the property to the group. - $this->instructions[$group][] = $property; - } + // Add the property to the group. + $this->instructions[$group][] = $property; } } @@ -375,9 +373,6 @@ public function getTaxonomy($branch = null) // Get the taxonomy branch if available. if ($branch !== null && isset($this->taxonomy[$branch])) { - // Filter the input. - $branch = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,_]+#mui', ' ', $branch); - return $this->taxonomy[$branch]; } @@ -387,28 +382,62 @@ public function getTaxonomy($branch = null) /** * Method to add a taxonomy map for an item. * - * @param string $branch The title of the taxonomy branch to add the node to. - * @param string $title The title of the taxonomy node. - * @param integer $state The published state of the taxonomy node. [optional] - * @param integer $access The access level of the taxonomy node. [optional] + * @param string $branch The title of the taxonomy branch to add the node to. + * @param string $title The title of the taxonomy node. + * @param integer $state The published state of the taxonomy node. [optional] + * @param integer $access The access level of the taxonomy node. [optional] + * @param string $language The language of the taxonomy. [optional] * * @return void * * @since 2.5 */ - public function addTaxonomy($branch, $title, $state = 1, $access = 1) + public function addTaxonomy($branch, $title, $state = 1, $access = 1, $language = '') { // Filter the input. $branch = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,_]+#mui', ' ', $branch); // Create the taxonomy node. - $node = new JObject; + $node = new stdClass; $node->title = $title; $node->state = (int) $state; $node->access = (int) $access; + $node->language = $language; + $node->nested = false; + + // Add the node to the taxonomy branch. + $this->taxonomy[$branch][] = $node; + } + + /** + * Method to add a nested taxonomy map for an item. + * + * @param string $branch The title of the taxonomy branch to add the node to. + * @param ImmutableNodeInterface $contentNode The node object. + * @param integer $state The published state of the taxonomy node. [optional] + * @param integer $access The access level of the taxonomy node. [optional] + * @param string $language The language of the taxonomy. [optional] + * + * @return void + * + * @since 4.0.0 + */ + public function addNestedTaxonomy($branch, ImmutableNodeInterface $contentNode, $state = 1, $access = 1, $language = '') + { + // Filter the input. + $branch = preg_replace('#[^\pL\pM\pN\p{Pi}\p{Pf}\'+-.,_]+#mui', ' ', $branch); + + // Create the taxonomy node. + $node = new stdClass; + $node->title = $contentNode->title; + $node->state = (int) $state; + $node->access = (int) $access; + $node->language = $language; + $node->nested = true; + $node->node = $contentNode; // Add the node to the taxonomy branch. - $this->taxonomy[$branch][$node->title] = $node; + $this->taxonomy[$branch][] = $node; } /** @@ -425,4 +454,103 @@ public function setLanguage() $this->language = $this->defaultLanguage; } } + + /** + * Helper function to serialise the data of a FinderIndexerResult object + * + * @return string The serialised data + * + * @since 4.0.0 + */ + public function serialize() + { + $taxonomy = array(); + + foreach ($this->taxonomy as $branch => $nodes) + { + $taxonomy[$branch] = array(); + + foreach ($nodes as $node) + { + if ($node->nested) + { + $n = clone $node; + unset($n->node); + $taxonomy[$branch][] = $n; + } + else + { + $taxonomy[$branch][] = $node; + } + } + } + + return serialize( + [ + $this->access, + $this->defaultLanguage, + $this->description, + $this->elements, + $this->end_date, + $this->instructions, + $this->language, + $this->list_price, + $this->publish_end_date, + $this->publish_start_date, + $this->published, + $this->route, + $this->sale_price, + $this->start_date, + $this->state, + $taxonomy, + $this->title, + $this->type_id, + $this->url + ] + ); + } + + /** + * Helper function to unserialise the data for this object + * + * @param string $serialized Serialised data to unserialise + * + * @return void + * + * @since 4.0.0 + */ + public function unserialize($serialized) + { + list( + $this->access, + $this->defaultLanguage, + $this->description, + $this->elements, + $this->end_date, + $this->instructions, + $this->language, + $this->list_price, + $this->publish_end_date, + $this->publish_start_date, + $this->published, + $this->route, + $this->sale_price, + $this->start_date, + $this->state, + $this->taxonomy, + $this->title, + $this->type_id, + $this->url + ) = unserialize($serialized); + + foreach ($this->taxonomy as $nodes) + { + foreach ($nodes as $node) + { + $curTaxonomy = FinderIndexerTaxonomy::getTaxonomy($node->id); + $node->state = $curTaxonomy->state; + $node->access = $curTaxonomy->access; + } + } + } } diff --git a/administrator/components/com_finder/helpers/indexer/taxonomy.php b/administrator/components/com_finder/helpers/indexer/taxonomy.php index 0b90dde30d38f..e93cea84585d9 100644 --- a/administrator/components/com_finder/helpers/indexer/taxonomy.php +++ b/administrator/components/com_finder/helpers/indexer/taxonomy.php @@ -3,12 +3,15 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\Tree\NodeInterface; +use Joomla\Component\Finder\Administrator\Table\MapTable; + /** * Taxonomy base class for the Finder indexer package. * @@ -17,15 +20,23 @@ class FinderIndexerTaxonomy { /** - * An internal cache of taxonomy branch data. + * An internal cache of taxonomy data. * * @var array - * @since 2.5 + * @since 4.0.0 + */ + public static $taxonomies = array(); + + /** + * An internal cache of branch data. + * + * @var array + * @since 4.0.0 */ public static $branches = array(); /** - * An internal cache of taxonomy node data. + * An internal cache of taxonomy node data for inserting it. * * @var array * @since 2.5 @@ -46,111 +57,127 @@ class FinderIndexerTaxonomy */ public static function addBranch($title, $state = 1, $access = 1) { - // Check to see if the branch is in the cache. - if (isset(static::$branches[$title])) - { - return static::$branches[$title]->id; - } + $node = new stdClass; + $node->title = $title; + $node->state = $state; + $node->access = $access; + $node->parent_id = 1; + $node->language = ''; + + return self::storeNode($node, 1); + } - // Check to see if the branch is in the table. - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select('*') - ->from($db->quoteName('#__finder_taxonomy')) - ->where($db->quoteName('parent_id') . ' = 1') - ->where($db->quoteName('title') . ' = ' . $db->quote($title)); - $db->setQuery($query); + /** + * Method to add a node to the taxonomy tree. + * + * @param string $branch The title of the branch to store the node in. + * @param string $title The title of the node. + * @param integer $state The published state of the node. [optional] + * @param integer $access The access state of the node. [optional] + * @param string $language The language of the node. [optional] + * + * @return integer The id of the node. + * + * @since 2.5 + * @throws Exception on database error. + */ + public static function addNode($branch, $title, $state = 1, $access = 1, $language = '') + { + // Get the branch id, insert it if it does not exist. + $branchId = static::addBranch($branch); - // Get the result. - $result = $db->loadObject(); + $node = new stdClass; + $node->title = $title; + $node->state = $state; + $node->access = $access; + $node->parent_id = $branchId; + $node->language = $language; - // Check if the database matches the input data. - if (!empty($result) && $result->state == $state && $result->access == $access) - { - // The data matches, add the item to the cache. - static::$branches[$title] = $result; + return self::storeNode($node, $branchId); + } - return static::$branches[$title]->id; + /** + * Method to add a nested node to the taxonomy tree. + * + * @param string $branch The title of the branch to store the node in. + * @param NodeInterface $node The source-node of the taxonomy node. + * @param integer $state The published state of the node. [optional] + * @param integer $access The access state of the node. [optional] + * @param string $language The language of the node. [optional] + * @param integer $branchId ID of a branch if known. [optional] + * + * @return integer The id of the node. + * + * @since 4.0.0 + */ + public static function addNestedNode($branch, NodeInterface $node, $state = 1, $access = 1, $language = '', $branchId = null) + { + if (!$branchId) + { + // Get the branch id, insert it if it does not exist. + $branchId = static::addBranch($branch); } - /* - * The database did not match the input. This could be because the - * state has changed or because the branch does not exist. Let's figure - * out which case is true and deal with it. - */ - $branch = new JObject; + $parent = $node->getParent(); - if (empty($result)) + if ($parent && $parent->title !='ROOT') { - // Prepare the branch object. - $branch->parent_id = 1; - $branch->title = $title; - $branch->state = (int) $state; - $branch->access = (int) $access; + $parentId = self::addNestedNode($branch, $parent, $state, $access, $language = '', $branchId); } else { - // Prepare the branch object. - $branch->id = (int) $result->id; - $branch->parent_id = (int) $result->parent_id; - $branch->title = $result->title; - $branch->state = (int) $result->title; - $branch->access = (int) $result->access; - $branch->ordering = (int) $result->ordering; + $parentId = $branchId; } - // Store the branch. - static::storeNode($branch); - - // Add the branch to the cache. - static::$branches[$title] = $branch; + $temp = new stdClass; + $temp->title = $node->title; + $temp->state = $state; + $temp->access = $access; + $temp->parent_id = $parentId; + $temp->language = $language; - return static::$branches[$title]->id; + return self::storeNode($temp, $parentId); } /** - * Method to add a node to the taxonomy tree. - * - * @param string $branch The title of the branch to store the node in. - * @param string $title The title of the node. - * @param integer $state The published state of the node. [optional] - * @param integer $access The access state of the node. [optional] - * - * @return integer The id of the node. - * - * @since 2.5 - * @throws Exception on database error. + * A helper method to store a node in the taxonomy + * + * @param object $node The node data to include + * @param integer $parent_id The parent id of the node to add. + * + * @return integer The id of the inserted node. + * + * @since 4.0.0 */ - public static function addNode($branch, $title, $state = 1, $access = 1) + protected static function storeNode($node, $parent_id) { // Check to see if the node is in the cache. - if (isset(static::$nodes[$branch][$title])) + if (isset(static::$nodes[$parent_id . ':' . $node->title])) { - return static::$nodes[$branch][$title]->id; + return static::$nodes[$parent_id . ':' . $node->title]->id; } - // Get the branch id, insert it if it does not exist. - $branchId = static::addBranch($branch); - // Check to see if the node is in the table. $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__finder_taxonomy')) - ->where($db->quoteName('parent_id') . ' = ' . $db->quote($branchId)) - ->where($db->quoteName('title') . ' = ' . $db->quote($title)); + ->where($db->quoteName('parent_id') . ' = ' . $db->quote($parent_id)) + ->where($db->quoteName('title') . ' = ' . $db->quote($node->title)) + ->where($db->quoteName('language') . ' = ' . $db->quote($node->language)); + $db->setQuery($query); // Get the result. $result = $db->loadObject(); // Check if the database matches the input data. - if (!empty($result) && $result->state == $state && $result->access == $access) + if ((bool) $result && $result->state == $node->state && $result->access == $node->access) { // The data matches, add the item to the cache. - static::$nodes[$branch][$title] = $result; + static::$nodes[$parent_id . ':' . $node->title] = $result; - return static::$nodes[$branch][$title]->id; + return static::$nodes[$parent_id . ':' . $node->title]->id; } /* @@ -158,34 +185,38 @@ public static function addNode($branch, $title, $state = 1, $access = 1) * state has changed or because the node does not exist. Let's figure * out which case is true and deal with it. */ - $node = new JObject; + /** TODO: use factory? **/ + $nodeTable = new MapTable($db); if (empty($result)) { // Prepare the node object. - $node->parent_id = (int) $branchId; - $node->title = $title; - $node->state = (int) $state; - $node->access = (int) $access; + $nodeTable->title = $node->title; + $nodeTable->state = (int) $node->state; + $nodeTable->access = (int) $node->access; + $nodeTable->language = $node->language; + $nodeTable->setLocation((int) $parent_id, 'last-child'); } else { // Prepare the node object. - $node->id = (int) $result->id; - $node->parent_id = (int) $result->parent_id; - $node->title = $result->title; - $node->state = (int) $result->title; - $node->access = (int) $result->access; - $node->ordering = (int) $result->ordering; + $nodeTable->id = (int) $result->id; + $nodeTable->title = $result->title; + $nodeTable->state = (int) $result->title; + $nodeTable->access = (int) $result->access; + $nodeTable->language = $node->language; + $nodeTable->setLocation($result->parent_id, 'last-child'); } - // Store the node. - static::storeNode($node); + // Store the branch. + $nodeTable->check(); + $nodeTable->store(); + $nodeTable->rebuildPath($nodeTable->id); // Add the node to the cache. - static::$nodes[$branch][$title] = $node; + static::$nodes[$parent_id . ':' . $nodeTable->title] = (object) $nodeTable->getProperties(); - return static::$nodes[$branch][$title]->id; + return static::$nodes[$parent_id . ':' . $nodeTable->title]->id; } /** @@ -213,16 +244,11 @@ public static function addMap($linkId, $nodeId) $db->execute(); $id = (int) $db->loadResult(); - $map = new JObject; - $map->link_id = (int) $linkId; - $map->node_id = (int) $nodeId; - - if ($id) - { - $db->updateObject('#__finder_taxonomy_map', $map, array('link_id', 'node_id')); - } - else + if (!$id) { + $map = new stdClass; + $map->link_id = (int) $linkId; + $map->node_id = (int) $nodeId; $db->insertObject('#__finder_taxonomy_map', $map); } @@ -352,31 +378,76 @@ public static function removeOrphanNodes() } /** - * Method to store a node to the database. This method will accept either a branch or a node. - * - * @param object $item The item to store. - * - * @return boolean True on success. - * - * @since 2.5 - * @throws Exception on database error. + * Get a taxonomy based on its id or all taxonomies + * + * @param integer $id Id of the taxonomy + * + * @return object|array A taxonomy object or an array of all taxonomies + * + * @since 4.0.0 */ - protected static function storeNode($item) + public static function getTaxonomy($id = 0) { - $db = JFactory::getDbo(); + if (!count(self::$taxonomies)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + $query->select(array('id','parent_id','lft','rgt','level','path','title','alias','state','access','language')) + ->from($db->quoteName('#__finder_taxonomy')) + ->order($db->quoteName('lft')); - // Check if we are updating or inserting the item. - if (empty($item->id)) + $db->setQuery($query); + self::$taxonomies = $db->loadObjectList('id'); + } + + if ($id == 0) { - // Insert the item. - $db->insertObject('#__finder_taxonomy', $item, 'id'); + return self::$taxonomies; } - else + + if (isset(self::$taxonomies[$id])) { - // Update the item. - $db->updateObject('#__finder_taxonomy', $item, 'id'); + return self::$taxonomies[$id]; } - return true; + return false; + } + + /** + * Get a taxonomy branch object based on its title or all branches + * + * @param string $title Title of the branch + * + * @return object|array The object with the branch data or an array of all branches + * + * @since 4.0.0 + */ + public static function getBranch($title = '') + { + if (!count(self::$branches)) + { + $taxonomies = self::getTaxonomy(); + + foreach ($taxonomies as $t) + { + if ($t->level == 1) + { + self::$branches[$t->title] = $t; + } + } + } + + if ($title == '') + { + return self::$branches; + } + + if (isset(self::$branches[$title])) + { + return self::$branches[$title]; + } + + return false; } } diff --git a/administrator/components/com_finder/helpers/indexer/token.php b/administrator/components/com_finder/helpers/indexer/token.php index 40ea5ec9ff406..7a524534abcfc 100644 --- a/administrator/components/com_finder/helpers/indexer/token.php +++ b/administrator/components/com_finder/helpers/indexer/token.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -87,6 +87,30 @@ class FinderIndexerToken */ public $language; + /** + * The container for matches. + * + * @var array + * @since 3.8.12 + */ + public $matches = array(); + + /** + * Is derived token (from individual words) + * + * @var boolean + * @since 3.8.12 + */ + public $derived; + + /** + * The suggested term + * + * @var string + * @since 3.8.12 + */ + public $suggestion; + /** * Method to construct the token object. * @@ -145,9 +169,9 @@ public function __construct($term, $lang, $spacer = ' ') * 3. If numeric, multiply weight by 1.5. * 4. Round weight to 4 decimal points. */ - $this->weight = (($this->length >= 15 ? 15 : $this->length) / 15); - $this->weight = ($this->common == true ? $this->weight / 8 : $this->weight); - $this->weight = ($this->numeric == true ? $this->weight * 1.5 : $this->weight); + $this->weight = ($this->length >= 15 ? 15 : $this->length) / 15; + $this->weight = $this->common === true ? $this->weight / 8 : $this->weight; + $this->weight = $this->numeric === true ? $this->weight * 1.5 : $this->weight; $this->weight = round($this->weight, 4); } } diff --git a/administrator/components/com_finder/helpers/language.php b/administrator/components/com_finder/helpers/language.php index bdeb2e3718e0e..f26abe21d1701 100644 --- a/administrator/components/com_finder/helpers/language.php +++ b/administrator/components/com_finder/helpers/language.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/services/provider.php b/administrator/components/com_finder/services/provider.php index f0a0aaf5784b5..625d15aef1fdb 100644 --- a/administrator/components/com_finder/services/provider.php +++ b/administrator/components/com_finder/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/sql/install.mysql.sql b/administrator/components/com_finder/sql/install.mysql.sql index 71e4f42ea8235..5c744d2e071bd 100644 --- a/administrator/components/com_finder/sql/install.mysql.sql +++ b/administrator/components/com_finder/sql/install.mysql.sql @@ -85,26 +85,33 @@ CREATE TABLE IF NOT EXISTS `#__finder_logging` ( -- CREATE TABLE IF NOT EXISTS `#__finder_taxonomy` ( - `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, + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `parent_id` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `lft` INT(11) NOT NULL DEFAULT '0', + `rgt` INT(11) NOT NULL DEFAULT '0', + `level` INT(10) UNSIGNED NOT NULL DEFAULT '0', + `path` VARCHAR(400) NOT NULL DEFAULT '', + `title` VARCHAR(255) NOT NULL DEFAULT '', + `alias` VARCHAR(400) NOT NULL DEFAULT '', + `state` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + `access` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', + `language` CHAR(7) NOT NULL DEFAULT '', 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`) + INDEX `idx_state` (`state`), + INDEX `idx_access` (`access`), + INDEX `idx_path` (`path`(100)), + INDEX `idx_left_right` (`lft`, `rgt`), + INDEX `idx_alias` (`alias`(100)), + INDEX `idx_language` (`language`), + INDEX `idx_parent_published` (`parent_id`, `state`, `access`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci; -- -- Dumping data for table `#__finder_taxonomy` -- -REPLACE INTO `#__finder_taxonomy` (`id`, `parent_id`, `title`, `state`, `access`, `ordering`) VALUES -(1, 0, 'ROOT', 0, 0, 0); +INSERT INTO `#__finder_taxonomy` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `state`, `access`, `language`) VALUES +(1, 0, 0, 1, 0, '', 'ROOT', 'root', 1, 1, '*'); -- -- Table structure for table `#__finder_taxonomy_map` diff --git a/administrator/components/com_finder/sql/install.postgresql.sql b/administrator/components/com_finder/sql/install.postgresql.sql index 086964f903f0f..95d1abbd9afd7 100644 --- a/administrator/components/com_finder/sql/install.postgresql.sql +++ b/administrator/components/com_finder/sql/install.postgresql.sql @@ -84,29 +84,32 @@ CREATE INDEX "#__finder_logging_idx_searchterm" on "#__finder_logging" ("searcht CREATE TABLE IF NOT EXISTS "#__finder_taxonomy" ( "id" serial NOT NULL, "parent_id" integer DEFAULT 0 NOT NULL, - "title" character varying(255) NOT NULL, + "lft" integer DEFAULT 0 NOT NULL, + "rgt" integer DEFAULT 0 NOT NULL, + "level" integer DEFAULT 0 NOT NULL, + "path" VARCHAR(400) NOT NULL DEFAULT '', + "title" VARCHAR(255) NOT NULL DEFAULT '', + "alias" VARCHAR(400) NOT NULL DEFAULT '', "state" smallint DEFAULT 1 NOT NULL, - "access" smallint DEFAULT 0 NOT NULL, - "ordering" smallint DEFAULT 0 NOT NULL, + "access" smallint DEFAULT 1 NOT NULL, + "language" varchar(7) DEFAULT '' NOT NULL, PRIMARY KEY ("id") ); -CREATE INDEX "#__finder_taxonomy_parent_id" on "#__finder_taxonomy" ("parent_id"); CREATE INDEX "#__finder_taxonomy_state" on "#__finder_taxonomy" ("state"); -CREATE INDEX "#__finder_taxonomy_ordering" on "#__finder_taxonomy" ("ordering"); CREATE INDEX "#__finder_taxonomy_access" on "#__finder_taxonomy" ("access"); +CREATE INDEX "#__finder_taxonomy_path" on "#__finder_taxonomy" ("path"); +CREATE INDEX "#__finder_taxonomy_lft_rgt" on "#__finder_taxonomy" ("lft", "rgt"); +CREATE INDEX "#__finder_taxonomy_alias" on "#__finder_taxonomy" ("alias"); +CREATE INDEX "#__finder_taxonomy_language" on "#__finder_taxonomy" ("language"); CREATE INDEX "#__finder_taxonomy_idx_parent_published" on "#__finder_taxonomy" ("parent_id", "state", "access"); -- -- Dumping data for table #__finder_taxonomy -- -UPDATE "#__finder_taxonomy" SET ("id", "parent_id", "title", "state", "access", "ordering") = (1, 0, 'ROOT', 0, 0, 0) -WHERE "id"=1; - -INSERT INTO "#__finder_taxonomy" ("id", "parent_id", "title", "state", "access", "ordering") -SELECT 1, 0, 'ROOT', 0, 0, 0 WHERE 1 NOT IN -(SELECT 1 FROM "#__finder_taxonomy" WHERE "id"=1); - +INSERT INTO "#__finder_taxonomy" ("id", "parent_id", "lft", "rgt", "level", "path", "title", "alias", "state", "access", "language") VALUES +(1, 0, 0, 1, 0, '', 'ROOT', 'root', 1, 1, '*'); +SELECT setval('#__finder_taxonomy_id_seq', 2, false); -- -- Table: #__finder_taxonomy_map diff --git a/administrator/components/com_finder/tmpl/filter/edit.php b/administrator/components/com_finder/tmpl/filter/edit.php index 73125baf6c856..678f56be2f5be 100644 --- a/administrator/components/com_finder/tmpl/filter/edit.php +++ b/administrator/components/com_finder/tmpl/filter/edit.php @@ -3,12 +3,14 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\Layout\LayoutHelper; + JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); JHtml::_('behavior.core'); @@ -24,7 +26,7 @@ - + 'details')); ?> @@ -47,7 +49,7 @@
    - +
    @@ -55,10 +57,10 @@ - + - + diff --git a/administrator/components/com_finder/tmpl/filters/default.php b/administrator/components/com_finder/tmpl/filters/default.php index 577e852e8b035..5c46d1d0e340e 100644 --- a/administrator/components/com_finder/tmpl/filters/default.php +++ b/administrator/components/com_finder/tmpl/filters/default.php @@ -3,33 +3,37 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; -$user = JFactory::getUser(); +$user = Factory::getUser(); $userId = $user->get('id'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -JText::script('COM_FINDER_INDEX_CONFIRM_DELETE_PROMPT'); +Text::script('COM_FINDER_INDEX_CONFIRM_DELETE_PROMPT'); HTMLHelper::_('script', 'com_finder/filters.js', ['version' => 'auto', 'relative' => true]); ?> - +
    sidebar; ?>
    - $this)); ?> + $this)); ?> items)) : ?>
    - +
    @@ -39,25 +43,25 @@ @@ -75,17 +79,17 @@ ?>
    - + - + - + - + - + - + - +
    - filter_id); ?> + filter_id); ?> - state, $i, 'filters.', $canChange); ?> + state, $i, 'filters.', $canChange); ?> checked_out) : ?> - editor, $item->checked_out_time, 'filters.', $canCheckIn); ?> + editor, $item->checked_out_time, 'filters.', $canCheckIn); ?> - + @@ -95,7 +99,7 @@ created_by_alias ?: $item->user_name; ?> - created, JText::_('DATE_FORMAT_LC4')); ?> + created, Text::_('DATE_FORMAT_LC4')); ?> map_count; ?> @@ -114,7 +118,7 @@ - + diff --git a/administrator/components/com_finder/tmpl/index/default.php b/administrator/components/com_finder/tmpl/index/default.php index 093b039768190..6d239c982e5c6 100644 --- a/administrator/components/com_finder/tmpl/index/default.php +++ b/administrator/components/com_finder/tmpl/index/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,6 +11,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; use Joomla\Component\Finder\Administrator\Helper\FinderHelperLanguage; JHtml::_('bootstrap.popover'); @@ -30,7 +31,7 @@
    - $this)); ?> + $this)); ?> + @@ -79,7 +84,7 @@ + + + diff --git a/administrator/components/com_finder/tmpl/searches/default.php b/administrator/components/com_finder/tmpl/searches/default.php index af64740cef3a1..cb823ce72110c 100644 --- a/administrator/components/com_finder/tmpl/searches/default.php +++ b/administrator/components/com_finder/tmpl/searches/default.php @@ -3,13 +3,14 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\LayoutHelper; // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); @@ -26,7 +27,7 @@
    - $this, 'options' => array('filterButton' => false))); ?> + $this, 'options' => array('filterButton' => false))); ?> items)) : ?>
    diff --git a/administrator/components/com_finder/tmpl/statistics/default.php b/administrator/components/com_finder/tmpl/statistics/default.php index 484d4fa079235..7366f61d3b913 100644 --- a/administrator/components/com_finder/tmpl/statistics/default.php +++ b/administrator/components/com_finder/tmpl/statistics/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Controller/DatabaseController.php b/administrator/components/com_installer/Controller/DatabaseController.php index 2831f06f70db9..78b77191e1b9a 100644 --- a/administrator/components/com_installer/Controller/DatabaseController.php +++ b/administrator/components/com_installer/Controller/DatabaseController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -36,8 +36,8 @@ class DatabaseController extends BaseController */ public function fix() { - // Check for request forgeries - Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + // Check for request forgeries. + $this->checkToken(); // Get items to fix the database. $cid = $this->input->get('cid', array(), 'array'); diff --git a/administrator/components/com_installer/Controller/DiscoverController.php b/administrator/components/com_installer/Controller/DiscoverController.php index a3ff9b0f6c5c4..0f45e198e60f2 100644 --- a/administrator/components/com_installer/Controller/DiscoverController.php +++ b/administrator/components/com_installer/Controller/DiscoverController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -30,6 +30,8 @@ class DiscoverController extends BaseController */ public function refresh() { + $this->checkToken(); + /* @var \Joomla\Component\Installer\Administrator\Model\DiscoverModel $model */ $model = $this->getModel('discover'); $model->discover(); @@ -45,6 +47,8 @@ public function refresh() */ public function install() { + $this->checkToken(); + /* @var \Joomla\Component\Installer\Administrator\Model\DiscoverModel $model */ $model = $this->getModel('discover'); $model->discover_install(); @@ -60,6 +64,8 @@ public function install() */ public function purge() { + $this->checkToken(); + /* @var \Joomla\Component\Installer\Administrator\Model\DiscoverModel $model */ $model = $this->getModel('discover'); $model->purge(); diff --git a/administrator/components/com_installer/Controller/DisplayController.php b/administrator/components/com_installer/Controller/DisplayController.php index fbaa4d1f28013..0acfc8fd5ab88 100644 --- a/administrator/components/com_installer/Controller/DisplayController.php +++ b/administrator/components/com_installer/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -58,8 +58,6 @@ public function display($cachable = false, $urlparams = false) // Push document object into the view. $view->document = $document; - // Load the submenu. - InstallerHelper::addSubmenu($vName); $view->display(); } diff --git a/administrator/components/com_installer/Controller/InstallController.php b/administrator/components/com_installer/Controller/InstallController.php index d4b21e31042a5..6ee17393073ff 100644 --- a/administrator/components/com_installer/Controller/InstallController.php +++ b/administrator/components/com_installer/Controller/InstallController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,11 +11,9 @@ defined('_JEXEC') or die; -use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\Response\JsonResponse; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; /** @@ -35,7 +33,7 @@ class InstallController extends BaseController public function install() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); /* @var \Joomla\Component\Installer\Administrator\Model\InstallModel $model */ $model = $this->getModel('install'); diff --git a/administrator/components/com_installer/Controller/ManageController.php b/administrator/components/com_installer/Controller/ManageController.php index 0f47b81fc1399..67a43cfa09646 100644 --- a/administrator/components/com_installer/Controller/ManageController.php +++ b/administrator/components/com_installer/Controller/ManageController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,11 +11,13 @@ defined('_JEXEC') or die; +use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Response\JsonResponse; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; +use Joomla\Component\Installer\Administrator\Model\ManageModel; use Joomla\Utilities\ArrayHelper; /** @@ -49,12 +51,14 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @return void * + * @throws \Exception + * * @since 1.6 */ public function publish() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); $values = array('publish' => 1, 'unpublish' => 0); @@ -67,7 +71,7 @@ public function publish() } else { - /* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */ + /** @var ManageModel $model */ $model = $this->getModel('manage'); // Change the state of the records. @@ -98,14 +102,16 @@ public function publish() * * @return void * + * @throws \Exception + * * @since 1.5 */ public function remove() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); - /* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */ + /** @var ManageModel $model */ $model = $this->getModel('manage'); $eid = $this->input->get('cid', array(), 'array'); @@ -126,9 +132,9 @@ public function remove() public function refresh() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); - /* @var \Joomla\Component\Installer\Administrator\Model\ManageModel $model */ + /** @var ManageModel $model */ $model = $this->getModel('manage'); $uid = $this->input->get('cid', array(), 'array'); @@ -136,4 +142,29 @@ public function refresh() $model->refresh($uid); $this->setRedirect(Route::_('index.php?option=com_installer&view=manage', false)); } + + /** + * Load the changelog for a given extension. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function loadChangelog() + { + /** @var ManageModel $model */ + $model = $this->getModel('manage'); + + $eid = $this->input->get('eid', 0, 'int'); + $source = $this->input->get('source', 'manage', 'string'); + + if (!$eid) + { + return; + } + + $output = $model->loadChangelog($eid, $source); + + echo (new JsonResponse($output)); + } } diff --git a/administrator/components/com_installer/Controller/UpdateController.php b/administrator/components/com_installer/Controller/UpdateController.php index 69a8f1472a62a..68f4838b4862f 100644 --- a/administrator/components/com_installer/Controller/UpdateController.php +++ b/administrator/components/com_installer/Controller/UpdateController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -37,7 +37,7 @@ class UpdateController extends BaseController public function update() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); /* @var \Joomla\Component\Installer\Administrator\Model\UpdateModel $model */ $model = $this->getModel('update'); @@ -84,7 +84,7 @@ public function update() */ public function find() { - (Session::checkToken() or Session::checkToken('get')) or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken('request'); // Get the caching duration. $params = ComponentHelper::getComponent('com_installer')->getParams(); @@ -120,7 +120,7 @@ public function find() public function purge() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); /* @var \Joomla\Component\Installer\Administrator\Model\UpdateModel $model */ $model = $this->getModel('update'); @@ -150,7 +150,7 @@ public function ajax() { $app->setHeader('status', 403, true); $app->sendHeaders(); - echo Text::_('JINVALID_TOKEN'); + echo Text::_('JINVALID_TOKEN_NOTICE'); $app->close(); } diff --git a/administrator/components/com_installer/Controller/UpdatesitesController.php b/administrator/components/com_installer/Controller/UpdatesitesController.php index 50484c9b61d21..eb769deed58ab 100644 --- a/administrator/components/com_installer/Controller/UpdatesitesController.php +++ b/administrator/components/com_installer/Controller/UpdatesitesController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -60,7 +60,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu public function publish() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); $values = array('publish' => 1, 'unpublish' => 0); @@ -101,7 +101,7 @@ public function publish() public function delete() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $ids = $this->input->get('cid', array(), 'array'); @@ -126,7 +126,7 @@ public function delete() public function rebuild() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Rebuild the update sites. $this->getModel('Updatesites')->rebuild(); diff --git a/administrator/components/com_installer/Extension/InstallerComponent.php b/administrator/components/com_installer/Extension/InstallerComponent.php index a4ea5cccdb428..b1e94ca19f06e 100644 --- a/administrator/components/com_installer/Extension/InstallerComponent.php +++ b/administrator/components/com_installer/Extension/InstallerComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Field/ExtensionstatusField.php b/administrator/components/com_installer/Field/ExtensionstatusField.php index 9bd1cf764452d..eddddd370b1c0 100644 --- a/administrator/components/com_installer/Field/ExtensionstatusField.php +++ b/administrator/components/com_installer/Field/ExtensionstatusField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,17 +11,15 @@ defined('_JEXEC') or die; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; -FormHelper::loadFieldClass('list'); - /** * Extension Status field. * * @since 3.5 */ -class ExtensionstatusField extends \JFormFieldList +class ExtensionstatusField extends ListField { /** * The form field type. diff --git a/administrator/components/com_installer/Field/FolderField.php b/administrator/components/com_installer/Field/FolderField.php index ebb803890a185..83d79f4b8a667 100644 --- a/administrator/components/com_installer/Field/FolderField.php +++ b/administrator/components/com_installer/Field/FolderField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,17 +11,15 @@ defined('_JEXEC') or die; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; -FormHelper::loadFieldClass('list'); - /** * Folder field. * * @since 3.5 */ -class FolderField extends \JFormFieldList +class FolderField extends ListField { /** * The form field type. diff --git a/administrator/components/com_installer/Field/LocationField.php b/administrator/components/com_installer/Field/LocationField.php index e64c3bc68ed91..a53749f081d9f 100644 --- a/administrator/components/com_installer/Field/LocationField.php +++ b/administrator/components/com_installer/Field/LocationField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,17 +11,15 @@ defined('_JEXEC') or die; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; -FormHelper::loadFieldClass('list'); - /** * Location field. * * @since 3.5 */ -class LocationField extends \JFormFieldList +class LocationField extends ListField { /** * The form field type. diff --git a/administrator/components/com_installer/Field/TypeField.php b/administrator/components/com_installer/Field/TypeField.php index 6d09ec8ba3357..3574dddb41203 100644 --- a/administrator/components/com_installer/Field/TypeField.php +++ b/administrator/components/com_installer/Field/TypeField.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,17 +11,15 @@ defined('_JEXEC') or die; -use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Form\Field\ListField; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; -FormHelper::loadFieldClass('list'); - /** - * Type field. + * Form field for a list of extension types. * * @since 3.5 */ -class TypeField extends \JFormFieldList +class TypeField extends ListField { /** * The form field type. diff --git a/administrator/components/com_installer/Helper/InstallerHelper.php b/administrator/components/com_installer/Helper/InstallerHelper.php index 311b33081d575..e14d5305185a0 100644 --- a/administrator/components/com_installer/Helper/InstallerHelper.php +++ b/administrator/components/com_installer/Helper/InstallerHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,59 +22,6 @@ */ class InstallerHelper { - /** - * Configure the Linkbar. - * - * @param string $vName The name of the active view. - * - * @return void - * - * @since 1.6 - */ - public static function addSubmenu($vName = 'install') - { - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_INSTALL'), - 'index.php?option=com_installer', - $vName == 'install' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_UPDATE'), - 'index.php?option=com_installer&view=update', - $vName == 'update' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_MANAGE'), - 'index.php?option=com_installer&view=manage', - $vName == 'manage' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_DISCOVER'), - 'index.php?option=com_installer&view=discover', - $vName == 'discover' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_DATABASE'), - 'index.php?option=com_installer&view=database', - $vName == 'database' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_WARNINGS'), - 'index.php?option=com_installer&view=warnings', - $vName == 'warnings' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_LANGUAGES'), - 'index.php?option=com_installer&view=languages', - $vName == 'languages' - ); - \JHtmlSidebar::addEntry( - Text::_('COM_INSTALLER_SUBMENU_UPDATESITES'), - 'index.php?option=com_installer&view=updatesites', - $vName == 'updatesites' - ); - } - /** * Get a list of filter options for the extension types. * diff --git a/administrator/components/com_installer/Model/DatabaseModel.php b/administrator/components/com_installer/Model/DatabaseModel.php index f733fa292921a..f7c47a66d2275 100644 --- a/administrator/components/com_installer/Model/DatabaseModel.php +++ b/administrator/components/com_installer/Model/DatabaseModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Model/DiscoverModel.php b/administrator/components/com_installer/Model/DiscoverModel.php index 24c693a726b78..1213b91976dd3 100644 --- a/administrator/components/com_installer/Model/DiscoverModel.php +++ b/administrator/components/com_installer/Model/DiscoverModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Model/InstallModel.php b/administrator/components/com_installer/Model/InstallModel.php index b640cddbc7f38..0bfb3704621a9 100644 --- a/administrator/components/com_installer/Model/InstallModel.php +++ b/administrator/components/com_installer/Model/InstallModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Model/InstallerModel.php b/administrator/components/com_installer/Model/InstallerModel.php index 4007720276507..6b7e32d86e269 100644 --- a/administrator/components/com_installer/Model/InstallerModel.php +++ b/administrator/components/com_installer/Model/InstallerModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -189,8 +189,15 @@ protected function translate(&$items) $lang->load("$extension.sys", JPATH_SITE, null, false, true); break; case 'library': - $extension = 'lib_' . $item->element; - $lang->load("$extension.sys", JPATH_SITE, null, false, true); + $parts = explode('/', $item->element); + $vendor = (isset($parts[1]) ? $parts[0] : null); + $extension = 'lib_' . ($vendor ? implode('_', $parts) : $item->element); + + if (!$lang->load("$extension.sys", $path, null, false, true)) + { + $source = $path . '/libraries/' . ($vendor ? $vendor . '/' . $parts[1] : $item->element); + $lang->load("$extension.sys", $source, null, false, true); + } break; case 'module': $extension = $item->element; diff --git a/administrator/components/com_installer/Model/LanguagesModel.php b/administrator/components/com_installer/Model/LanguagesModel.php index ea27b0ab9751c..bd6bfebdd8c05 100644 --- a/administrator/components/com_installer/Model/LanguagesModel.php +++ b/administrator/components/com_installer/Model/LanguagesModel.php @@ -2,7 +2,7 @@ /** * @package Joomla.Administrator * @subpackage com_installer - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Model/ManageModel.php b/administrator/components/com_installer/Model/ManageModel.php index 4baa85e51607c..b0a706f4af34a 100644 --- a/administrator/components/com_installer/Model/ManageModel.php +++ b/administrator/components/com_installer/Model/ManageModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,11 +11,14 @@ defined('_JEXEC') or die; +use Joomla\CMS\Changelog\Changelog; use Joomla\CMS\Extension\ExtensionHelper; use Joomla\CMS\Factory; use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\Text; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Table\Extension; use Joomla\Component\Templates\Administrator\Table\StyleTable; use Joomla\Database\DatabaseQuery; @@ -64,6 +67,8 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu * * @return void * + * @throws \Exception + * * @since 1.6 */ protected function populateState($ordering = 'name', $direction = 'asc') @@ -94,6 +99,8 @@ protected function populateState($ordering = 'name', $direction = 'asc') * * @return boolean True on success * + * @throws \Exception + * * @since 1.5 */ public function publish(&$eid = array(), $value = 1) @@ -117,7 +124,7 @@ public function publish(&$eid = array(), $value = 1) } // Get a table object for the extension type - $table = new \Joomla\CMS\Table\Extension($this->getDbo()); + $table = new Extension($this->getDbo()); // Enable the extension in the table and store it in the database foreach ($eid as $i => $id) @@ -145,6 +152,10 @@ public function publish(&$eid = array(), $value = 1) { $table->enabled = $value; } + + $context = $this->option . '.' . $this->name; + JPluginHelper::importPlugin('extension'); + JEventDispatcher::getInstance()->trigger('onExtensionChangeState', array($context, $eid, $value)); if (!$table->store()) { @@ -182,7 +193,7 @@ public function refresh($eid) // Get an installer object for the extension type $installer = Installer::getInstance(); - $result = 0; + $result = 0; // Uninstall the chosen extensions foreach ($eid as $id) @@ -200,6 +211,8 @@ public function refresh($eid) * * @return boolean True on success * + * @throws \Exception + * * @since 1.5 */ public function remove($eid = array()) @@ -222,10 +235,10 @@ public function remove($eid = array()) // Get an installer object for the extension type $installer = Installer::getInstance(); - $row = new \Joomla\CMS\Table\Extension($this->getDbo()); + $row = new \Joomla\CMS\Table\Extension($this->getDbo()); // Uninstall the chosen extensions - $msgs = array(); + $msgs = array(); $result = false; foreach ($eid as $id) @@ -235,7 +248,7 @@ public function remove($eid = array()) $result = false; $langstring = 'COM_INSTALLER_TYPE_TYPE_' . strtoupper($row->type); - $rowtype = Text::_($langstring); + $rowtype = Text::_($langstring); if (strpos($rowtype, $langstring) !== false) { @@ -376,4 +389,79 @@ protected function getListQuery() return $query; } + + /** + * Load the changelog details for a given extension. + * + * @param integer $eid The extension ID + * @param string $source The view the changelog is for, this is used to determine which version number to show + * + * @return string The output to show in the modal. + * + * @since __DEPLOY_VERSION__ + */ + public function loadChangelog($eid, $source) + { + // Get the changelog URL + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->select( + $db->quoteName( + array( + 'extensions.element', + 'extensions.type', + 'extensions.changelogurl', + 'extensions.manifest_cache', + 'extensions.client_id' + ) + ) + ) + ->select($db->quoteName('updates.version', 'updateVersion')) + ->from($db->quoteName('#__extensions', 'extensions')) + ->leftJoin( + $db->quoteName('#__updates', 'updates') + . ' ON ' . $db->quoteName('updates.extension_id') . ' = ' . $db->quoteName('extensions.extension_id') + ) + ->where($db->quoteName('extensions.extension_id') . ' = ' . (int) $eid); + $db->setQuery($query); + + $extensions = $db->loadObjectList(); + $this->translate($extensions); + $extension = array_shift($extensions); + + if (!$extension->changelogurl) + { + return ''; + } + + $changelog = new Changelog; + $changelog->setVersion($source === 'manage' ? $extension->version : $extension->updateVersion); + $changelog->loadFromXml($extension->changelogurl); + + // Read all the entries + $entries = array( + 'security' => array(), + 'fix' => array(), + 'addition' => array(), + 'change' => array(), + 'remove' => array(), + 'language' => array(), + 'note' => array() + ); + + array_walk( + $entries, + function (&$value, $name) use ($changelog) { + if ($field = $changelog->get($name)) + { + $value = $changelog->get($name)->data; + } + } + ); + + $layout = new FileLayout('joomla.installer.changelog'); + $output = $layout->render($entries); + + return $output; + } } diff --git a/administrator/components/com_installer/Model/UpdateModel.php b/administrator/components/com_installer/Model/UpdateModel.php index 96550956db0e2..5b328d7dc5a75 100644 --- a/administrator/components/com_installer/Model/UpdateModel.php +++ b/administrator/components/com_installer/Model/UpdateModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -459,6 +459,16 @@ private function install($update) $installer = Installer::getInstance(); $update->set('type', $package['type']); + // Check the package + $check = InstallerHelper::isChecksumValid($package['packagefile'], $update); + + // The validation was not successful. Just a warning for now. + // TODO: In Joomla 4 this will abort the installation + if ($check === InstallerHelper::HASH_NOT_VALIDATED) + { + $app->enqueueMessage(Text::_('COM_INSTALLER_INSTALL_CHECKSUM_WRONG'), 'error'); + } + // Install the package if (!$installer->update($package['dir'])) { diff --git a/administrator/components/com_installer/Model/UpdatesitesModel.php b/administrator/components/com_installer/Model/UpdatesitesModel.php index 3215389eefa0a..ac34a2958385e 100644 --- a/administrator/components/com_installer/Model/UpdatesitesModel.php +++ b/administrator/components/com_installer/Model/UpdatesitesModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -337,7 +337,10 @@ public function rebuild() $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) - ->where($db->quoteName('name') . ' = ' . $db->quote($manifest->name)) + ->where('(' + . $db->quoteName('name') . ' = ' . $db->quote($manifest->name) + . ' OR ' . $db->quoteName('name') . ' = ' . $db->quote($manifest->packagename) + . ')' ) ->where($db->quoteName('type') . ' = ' . $db->quote($manifest['type'])) ->where($db->quoteName('extension_id') . ' NOT IN (' . $joomlaCoreExtensionIds . ')') ->where($db->quoteName('state') . ' != -1'); diff --git a/administrator/components/com_installer/Model/WarningsModel.php b/administrator/components/com_installer/Model/WarningsModel.php index 3349eae63c0a9..2de105dc783e4 100644 --- a/administrator/components/com_installer/Model/WarningsModel.php +++ b/administrator/components/com_installer/Model/WarningsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Service/HTML/Manage.php b/administrator/components/com_installer/Service/HTML/Manage.php index bd7767fce2c53..9ab1d7da2b7a7 100644 --- a/administrator/components/com_installer/Service/HTML/Manage.php +++ b/administrator/components/com_installer/Service/HTML/Manage.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/Service/HTML/Updatesites.php b/administrator/components/com_installer/Service/HTML/Updatesites.php index dcab1f4cba74f..76fb46b8cea94 100644 --- a/administrator/components/com_installer/Service/HTML/Updatesites.php +++ b/administrator/components/com_installer/Service/HTML/Updatesites.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/View/Database/HtmlView.php b/administrator/components/com_installer/View/Database/HtmlView.php index 4feb61e748dc4..b3778a238e110 100644 --- a/administrator/components/com_installer/View/Database/HtmlView.php +++ b/administrator/components/com_installer/View/Database/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/View/Discover/HtmlView.php b/administrator/components/com_installer/View/Discover/HtmlView.php index 4c81893949df9..6171fb6c364ce 100644 --- a/administrator/components/com_installer/View/Discover/HtmlView.php +++ b/administrator/components/com_installer/View/Discover/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -70,8 +70,6 @@ protected function addToolbar() ToolbarHelper::custom('discover.refresh', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_DISCOVER', false); ToolbarHelper::divider(); - \JHtmlSidebar::setAction('index.php?option=com_installer&view=discover'); - parent::addToolbar(); ToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DISCOVER'); diff --git a/administrator/components/com_installer/View/Install/HtmlView.php b/administrator/components/com_installer/View/Install/HtmlView.php index a93b8b60cdd14..cbc2822378d09 100644 --- a/administrator/components/com_installer/View/Install/HtmlView.php +++ b/administrator/components/com_installer/View/Install/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/View/Installer/HtmlView.php b/administrator/components/com_installer/View/Installer/HtmlView.php index 821b5738a4148..e385693dd7adf 100644 --- a/administrator/components/com_installer/View/Installer/HtmlView.php +++ b/administrator/components/com_installer/View/Installer/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -111,8 +111,5 @@ protected function addToolbar() ToolbarHelper::preferences('com_installer'); ToolbarHelper::divider(); } - - // Render side bar. - $this->sidebar = \JHtmlSidebar::render(); } } diff --git a/administrator/components/com_installer/View/Languages/HtmlView.php b/administrator/components/com_installer/View/Languages/HtmlView.php index ab792d044347f..80f46b7485e5a 100644 --- a/administrator/components/com_installer/View/Languages/HtmlView.php +++ b/administrator/components/com_installer/View/Languages/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/View/Manage/HtmlView.php b/administrator/components/com_installer/View/Manage/HtmlView.php index 1bf14267e7041..c94de5562bfb3 100644 --- a/administrator/components/com_installer/View/Manage/HtmlView.php +++ b/administrator/components/com_installer/View/Manage/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -82,8 +82,6 @@ protected function addToolbar() ToolbarHelper::divider(); } - \JHtmlSidebar::setAction('index.php?option=com_installer&view=manage'); - parent::addToolbar(); ToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_MANAGE'); } diff --git a/administrator/components/com_installer/View/Update/HtmlView.php b/administrator/components/com_installer/View/Update/HtmlView.php index cd8da65ed9681..ed85362446d53 100644 --- a/administrator/components/com_installer/View/Update/HtmlView.php +++ b/administrator/components/com_installer/View/Update/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -81,8 +81,6 @@ protected function addToolbar() ToolbarHelper::custom('update.purge', 'purge', 'purge', 'COM_INSTALLER_TOOLBAR_PURGE', false); ToolbarHelper::divider(); - \JHtmlSidebar::setAction('index.php?option=com_installer&view=manage'); - parent::addToolbar(); ToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATE'); } diff --git a/administrator/components/com_installer/View/Updatesites/HtmlView.php b/administrator/components/com_installer/View/Updatesites/HtmlView.php index 2c30599b82958..dcfe7829136ed 100644 --- a/administrator/components/com_installer/View/Updatesites/HtmlView.php +++ b/administrator/components/com_installer/View/Updatesites/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -88,8 +88,6 @@ protected function addToolbar() ToolbarHelper::custom('updatesites.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false); } - \JHtmlSidebar::setAction('index.php?option=com_installer&view=updatesites'); - parent::addToolbar(); ToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATESITES'); } diff --git a/administrator/components/com_installer/View/Warnings/HtmlView.php b/administrator/components/com_installer/View/Warnings/HtmlView.php index 28ef41ba10a20..117e87fd9d47a 100644 --- a/administrator/components/com_installer/View/Warnings/HtmlView.php +++ b/administrator/components/com_installer/View/Warnings/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/helpers/installer.php b/administrator/components/com_installer/helpers/installer.php index 5782954a3b90b..2f877afef44ec 100644 --- a/administrator/components/com_installer/helpers/installer.php +++ b/administrator/components/com_installer/helpers/installer.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/installer.xml b/administrator/components/com_installer/installer.xml index 1072e086fac56..cb93aac8d7c6b 100644 --- a/administrator/components/com_installer/installer.xml +++ b/administrator/components/com_installer/installer.xml @@ -3,7 +3,7 @@ com_installer Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_installer/services/provider.php b/administrator/components/com_installer/services/provider.php index 7a4224b83ff7a..e0e26c8366fc2 100644 --- a/administrator/components/com_installer/services/provider.php +++ b/administrator/components/com_installer/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/tmpl/database/default.php b/administrator/components/com_installer/tmpl/database/default.php index 65c85630176dc..01c3da3de43c5 100644 --- a/administrator/components/com_installer/tmpl/database/default.php +++ b/administrator/components/com_installer/tmpl/database/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -24,10 +24,7 @@
    -
    - sidebar; ?> -
    -
    +
    $this)); ?> diff --git a/administrator/components/com_installer/tmpl/discover/default.php b/administrator/components/com_installer/tmpl/discover/default.php index f853060289ff2..3fd27d66b140e 100644 --- a/administrator/components/com_installer/tmpl/discover/default.php +++ b/administrator/components/com_installer/tmpl/discover/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,10 +22,7 @@
    -
    - sidebar; ?> -
    -
    +
    showMessage) : ?> loadTemplate('message'); ?> diff --git a/administrator/components/com_installer/tmpl/discover/default_item.php b/administrator/components/com_installer/tmpl/discover/default_item.php index 180487ee7f861..10ec81b90d791 100644 --- a/administrator/components/com_installer/tmpl/discover/default_item.php +++ b/administrator/components/com_installer/tmpl/discover/default_item.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/tmpl/install/default.php b/administrator/components/com_installer/tmpl/install/default.php index 1d53f35020689..03b2962e83acc 100644 --- a/administrator/components/com_installer/tmpl/install/default.php +++ b/administrator/components/com_installer/tmpl/install/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -31,10 +31,7 @@
    -
    - sidebar; ?> -
    -
    +
    showMessage) : ?> diff --git a/administrator/components/com_installer/tmpl/installer/default_ftp.php b/administrator/components/com_installer/tmpl/installer/default_ftp.php index efc78402c7aea..c9e491d3b79f2 100644 --- a/administrator/components/com_installer/tmpl/installer/default_ftp.php +++ b/administrator/components/com_installer/tmpl/installer/default_ftp.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -12,7 +12,7 @@ use Joomla\CMS\Language\Text; ?> -
    +
    diff --git a/administrator/components/com_installer/tmpl/installer/default_message.php b/administrator/components/com_installer/tmpl/installer/default_message.php index d7a25f6592d99..c99ddbd703fc4 100644 --- a/administrator/components/com_installer/tmpl/installer/default_message.php +++ b/administrator/components/com_installer/tmpl/installer/default_message.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_installer/tmpl/languages/default.php b/administrator/components/com_installer/tmpl/languages/default.php index a4b102b2b7bc4..ac3ae2ff108ac 100644 --- a/administrator/components/com_installer/tmpl/languages/default.php +++ b/administrator/components/com_installer/tmpl/languages/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,10 +22,7 @@
    -
    - sidebar; ?> -
    -
    +
    $this, 'options' => array('filterButton' => false))); ?> items)) : ?> diff --git a/administrator/components/com_installer/tmpl/manage/default.php b/administrator/components/com_installer/tmpl/manage/default.php index 08717b91bd46d..a510f977ae020 100644 --- a/administrator/components/com_installer/tmpl/manage/default.php +++ b/administrator/components/com_installer/tmpl/manage/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,10 +22,7 @@
    -
    - sidebar; ?> -
    -
    +
    showMessage) : ?> loadTemplate('message'); ?> @@ -107,14 +104,34 @@ type_translated; ?>
    , diff --git a/administrator/components/com_finder/tmpl/indexer/default.php b/administrator/components/com_finder/tmpl/indexer/default.php index c0b35de438b48..da945a7b07429 100644 --- a/administrator/components/com_finder/tmpl/indexer/default.php +++ b/administrator/components/com_finder/tmpl/indexer/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_finder/tmpl/maps/default.php b/administrator/components/com_finder/tmpl/maps/default.php index 2f17fac643bb0..e04f3ead91b6a 100644 --- a/administrator/components/com_finder/tmpl/maps/default.php +++ b/administrator/components/com_finder/tmpl/maps/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_finder * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -65,6 +65,11 @@ + +
    + +
    parent_title, '**') === 'Language') + if (trim($item->branch_title, '**') === 'Language') { $title = FinderHelperLanguage::branchLanguageTitle($item->title); } @@ -89,9 +94,7 @@ $title = $lang->hasKey($key) ? Text::_($key) : $item->title; } ?> - num_children === 0) : ?> - - + —', $item->level - 1); ?> @@ -101,16 +104,16 @@ - num_children !== 0) : ?> + rgt - $item->lft > 1) : ?> - num_children; ?> + rgt - $item->lft) / 2); ?> - - num_children === 0) : ?> + level > 1) : ?> count_published; ?> @@ -118,13 +121,18 @@ - num_children === 0) : ?> + level > 1) : ?> count_unpublished; ?> - + language; ?> +
    - version != '' ? $item->version : ' '; ?> + version !== '') : ?> + changelogurl !== null) : ?> + + version?> + + Text::sprintf('COM_INSTALLER_CHANGELOG_TITLE', $item->name, $item->version), + ), + '' + ); + ?> + + version; ?> + + - creationDate != '' ? $item->creationDate : ' '; ?> + creationDate) && $item->creationDate !== '' ? $item->creationDate : ' '; ?> - author != '' ? $item->author : ' '; ?> + author) && $item->author !== '' ? $item->author : ' '; ?> diff --git a/administrator/components/com_installer/tmpl/update/default.php b/administrator/components/com_installer/tmpl/update/default.php index 6b8e3a0f8d26a..cd4ca6ddf9966 100644 --- a/administrator/components/com_installer/tmpl/update/default.php +++ b/administrator/components/com_installer/tmpl/update/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,22 +22,18 @@
    -
    - sidebar; ?> -
    -
    +
    showMessage) : ?> loadTemplate('message'); ?> - ftp) : ?> loadTemplate('ftp'); ?> $this)); ?> items)) : ?>
    - +
    @@ -46,9 +42,9 @@ - @@ -64,8 +60,11 @@ - + + diff --git a/administrator/components/com_installer/tmpl/updatesites/default.php b/administrator/components/com_installer/tmpl/updatesites/default.php index eb9e2d1047e55..e295ab7304d09 100644 --- a/administrator/components/com_installer/tmpl/updatesites/default.php +++ b/administrator/components/com_installer/tmpl/updatesites/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,10 +22,7 @@
    -
    - sidebar; ?> -
    -
    +
    $this)); ?> items)) : ?> diff --git a/administrator/components/com_installer/tmpl/warnings/default.php b/administrator/components/com_installer/tmpl/warnings/default.php index 29e33bfee5c81..2c90198305349 100644 --- a/administrator/components/com_installer/tmpl/warnings/default.php +++ b/administrator/components/com_installer/tmpl/warnings/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_installer * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,10 +17,7 @@
    -
    - sidebar; ?> -
    -
    +
    messages)) : ?> messages as $message) : ?> diff --git a/administrator/components/com_joomlaupdate/Controller/DisplayController.php b/administrator/components/com_joomlaupdate/Controller/DisplayController.php index a0ef90caf6682..858bb159cc8c2 100644 --- a/administrator/components/com_joomlaupdate/Controller/DisplayController.php +++ b/administrator/components/com_joomlaupdate/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/Controller/UpdateController.php b/administrator/components/com_joomlaupdate/Controller/UpdateController.php index df306ec332ea5..71244b0483fe4 100644 --- a/administrator/components/com_joomlaupdate/Controller/UpdateController.php +++ b/administrator/components/com_joomlaupdate/Controller/UpdateController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -36,7 +36,7 @@ class UpdateController extends BaseController */ public function download() { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; @@ -55,12 +55,30 @@ public function download() $this->_applyCredentials(); /* @var \Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel $model */ - $model = $this->getModel('Update'); - $file = $model->download(); + $model = $this->getModel('Update'); + $result = $model->download(); + $file = $result['basename']; $message = null; $messageType = null; + // The validation was not successful for now just a warning. + // TODO: In Joomla 4 this will abort the installation + if ($result['check'] === false) + { + $message = Text::_('COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_WRONG'); + $messageType = 'warning'; + + try + { + Log::add($message, Log::INFO, 'Update'); + } + catch (\RuntimeException $exception) + { + // Informational log only + } + } + if ($file) { $this->app->setUserState('com_joomlaupdate.file', $file); @@ -95,7 +113,7 @@ public function download() */ public function install() { - Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken('get'); $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; @@ -228,7 +246,7 @@ public function cleanup() public function purge() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Purge updates /* @var \Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel $model */ @@ -249,7 +267,7 @@ public function purge() public function upload() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)? Factory::getUser()->authorise('core.admin') or jexit(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN')); @@ -284,7 +302,7 @@ public function upload() public function captive() { // Check for request forgeries - Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken('get'); // Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)? if (!Factory::getUser()->authorise('core.admin')) @@ -316,7 +334,7 @@ public function captive() public function confirm() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Did a non Super User tried to upload something (a.k.a. pathetic hacking attempt)? if (!$this->app->getIdentity()->authorise('core.admin')) @@ -446,7 +464,7 @@ protected function _applyCredentials() public function finaliseconfirm() { // Check for request forgeries - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Did a non Super User try do this? if (!Factory::getUser()->authorise('core.admin')) @@ -508,7 +526,7 @@ public function fetchExtensionCompatibility() { echo new JsonResponse($updateFileUrl); } - catch (Exception $e) + catch (\Exception $e) { echo $e; } diff --git a/administrator/components/com_joomlaupdate/Dispatcher/Dispatcher.php b/administrator/components/com_joomlaupdate/Dispatcher/Dispatcher.php new file mode 100644 index 0000000000000..8c9b08b3faba6 --- /dev/null +++ b/administrator/components/com_joomlaupdate/Dispatcher/Dispatcher.php @@ -0,0 +1,37 @@ +app->isClient('administrator') && !$this->app->getIdentity()->authorise('core.admin', $this->option)) + { + throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); + } + } +} diff --git a/administrator/components/com_joomlaupdate/Helper/Select.php b/administrator/components/com_joomlaupdate/Helper/Select.php index 3bdb466263d27..0a3da5bad8771 100644 --- a/administrator/components/com_joomlaupdate/Helper/Select.php +++ b/administrator/components/com_joomlaupdate/Helper/Select.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/Model/UpdateModel.php index ddeaad13abd80..848c9980fdf41 100644 --- a/administrator/components/com_joomlaupdate/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/Model/UpdateModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -21,6 +21,7 @@ use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Http\HttpFactory; use Joomla\CMS\Installer\Installer; +use Joomla\CMS\Installer\InstallerHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; use Joomla\CMS\MVC\Model\BaseDatabaseModel; @@ -180,7 +181,7 @@ public function getUpdateInformation() 'installed' => \JVERSION, 'latest' => null, 'object' => null, - 'hasUpdate' => false + 'hasUpdate' => false, ); // Fetch the update information from the database. @@ -272,7 +273,7 @@ public function purge() /** * Downloads the update package to the site. * - * @return boolean|string False on failure, basename of the file in any other case. + * @return array * * @since 2.5.4 */ @@ -299,8 +300,9 @@ public function download() } // Find the path to the temp directory and the local package. - $tempdir = Factory::getApplication()->get('tmp_path'); - $target = $tempdir . '/' . $basename; + $tempdir = Factory::getApplication()->get('tmp_path'); + $target = $tempdir . '/' . $basename; + $response = []; // Do we have a cached file? $exists = File::exists($target); @@ -317,7 +319,7 @@ public function download() $mirror++; } - return $download; + $response['basename'] = $download; } else { @@ -335,12 +337,49 @@ public function download() $mirror++; } - return $download; + $response['basename'] = $download; } // Yes, it's there, skip downloading. - return $basename; + $response['basename'] = $basename; } + + $response['check'] = $this->isChecksumValid($target, $updateInfo['object']); + + return $response; + } + + /** + * Return the result of the checksum of a package with the SHA256/SHA384/SHA512 tags in the update server manifest + * + * @param string $packagefile Location of the package to be installed + * @param Update $updateObject The Update Object + * + * @return boolean False in case the validation did not work; true in any other case. + * + * @note This method has been forked from (JInstallerHelper::isChecksumValid) so it + * does not depend on an up-to-date InstallerHelper at the update time + * + * @since 3.9.0 + */ + private function isChecksumValid($packagefile, $updateObject) + { + $hashes = array('sha256', 'sha384', 'sha512'); + foreach ($hashes as $hash) + { + if ($updateObject->get($hash, false)) + { + $hashPackage = hash_file($hash, $packagefile); + $hashRemote = $updateObject->$hash->_data; + if ($hashPackage !== $hashRemote) + { + // Return false in case the hash did not match + return false; + } + } + } + // Well nothing was provided or all worked + return true; } /** diff --git a/administrator/components/com_joomlaupdate/View/Joomlaupdate/HtmlView.php b/administrator/components/com_joomlaupdate/View/Joomlaupdate/HtmlView.php index 30b633a1ee612..c695c36c5e389 100644 --- a/administrator/components/com_joomlaupdate/View/Joomlaupdate/HtmlView.php +++ b/administrator/components/com_joomlaupdate/View/Joomlaupdate/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/View/Update/HtmlView.php b/administrator/components/com_joomlaupdate/View/Update/HtmlView.php index e19d8ed5b5045..9c7a11397c681 100644 --- a/administrator/components/com_joomlaupdate/View/Update/HtmlView.php +++ b/administrator/components/com_joomlaupdate/View/Update/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/View/Upload/HtmlView.php b/administrator/components/com_joomlaupdate/View/Upload/HtmlView.php index d980b709753c0..d43bb96f3950c 100644 --- a/administrator/components/com_joomlaupdate/View/Upload/HtmlView.php +++ b/administrator/components/com_joomlaupdate/View/Upload/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/joomlaupdate.xml b/administrator/components/com_joomlaupdate/joomlaupdate.xml index a35accbd79c10..50e968a6c90a1 100644 --- a/administrator/components/com_joomlaupdate/joomlaupdate.xml +++ b/administrator/components/com_joomlaupdate/joomlaupdate.xml @@ -3,7 +3,7 @@ com_joomlaupdate Joomla! Project February 2012 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_joomlaupdate/restore_finalisation.php b/administrator/components/com_joomlaupdate/restore_finalisation.php index 929671fda816f..d822ecdf29428 100644 --- a/administrator/components/com_joomlaupdate/restore_finalisation.php +++ b/administrator/components/com_joomlaupdate/restore_finalisation.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * Important Notes: diff --git a/administrator/components/com_joomlaupdate/services/provider.php b/administrator/components/com_joomlaupdate/services/provider.php index c9e34bd5a0e67..7507de9b26d69 100644 --- a/administrator/components/com_joomlaupdate/services/provider.php +++ b/administrator/components/com_joomlaupdate/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/complete.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/complete.php index 306df1e7827b0..cef581f9a7564 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/complete.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/complete.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default.php index 819797bfd2d7e..0211840f31e12 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_nodownload.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_nodownload.php index 05be6a6fab7c2..5e8cce4e40a2c 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_nodownload.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_nodownload.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_preupdatecheck.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_preupdatecheck.php index 54ed79ad163d3..a70db094201eb 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_preupdatecheck.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_preupdatecheck.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_reinstall.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_reinstall.php index b654a96073cdd..7b7940003c03b 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_reinstall.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_reinstall.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_update.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_update.php index 706cb7f3343c8..967c4d08ba8ef 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_update.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_update.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_updatemefirst.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_updatemefirst.php index dba036fbd0dad..dc1af201ce75f 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_updatemefirst.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_updatemefirst.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_upload.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_upload.php index 4b43e7f35deea..4a42b89dce34f 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_upload.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_upload.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/update/default.php b/administrator/components/com_joomlaupdate/tmpl/update/default.php index e6bb2c7d056df..e85c98ec70eec 100644 --- a/administrator/components/com_joomlaupdate/tmpl/update/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/update/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php b/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php index c3459b2a98ede..65a20f29f2eef 100644 --- a/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php +++ b/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_joomlaupdate/tmpl/upload/captive.php b/administrator/components/com_joomlaupdate/tmpl/upload/captive.php index 690cc22bb206e..ffc4af45894a7 100644 --- a/administrator/components/com_joomlaupdate/tmpl/upload/captive.php +++ b/administrator/components/com_joomlaupdate/tmpl/upload/captive.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_joomlaupdate * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Controller/DisplayController.php b/administrator/components/com_languages/Controller/DisplayController.php index ae09fb05a5c1f..7858dfe81d613 100644 --- a/administrator/components/com_languages/Controller/DisplayController.php +++ b/administrator/components/com_languages/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Controller/InstalledController.php b/administrator/components/com_languages/Controller/InstalledController.php index 7d25e43619fec..1ba5b01dbb5e6 100644 --- a/administrator/components/com_languages/Controller/InstalledController.php +++ b/administrator/components/com_languages/Controller/InstalledController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,9 +14,9 @@ use Joomla\CMS\Factory; use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\Language; +use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; -use Joomla\CMS\Session\Session; /** * Languages Controller. @@ -33,7 +33,7 @@ class InstalledController extends BaseController public function setDefault() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $cid = $this->input->get('cid', ''); $model = $this->getModel('installed'); @@ -50,8 +50,16 @@ public function setDefault() $newLang->load('com_languages', JPATH_ADMINISTRATOR); } - $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED'); - $type = 'message'; + if (Multilanguage::isEnabled() && $model->getState('client_id') == 0) + { + $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_MULTILANG_SAVED'); + $type = 'message'; + } + else + { + $msg = Text::_('COM_LANGUAGES_MSG_DEFAULT_LANGUAGE_SAVED'); + $type = 'message'; + } } else { @@ -71,7 +79,7 @@ public function setDefault() public function switchAdminLanguage() { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $cid = $this->input->get('cid', ''); $model = $this->getModel('installed'); diff --git a/administrator/components/com_languages/Controller/LanguageController.php b/administrator/components/com_languages/Controller/LanguageController.php index 7beb036496fa1..698222db41e1a 100644 --- a/administrator/components/com_languages/Controller/LanguageController.php +++ b/administrator/components/com_languages/Controller/LanguageController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Controller/LanguagesController.php b/administrator/components/com_languages/Controller/LanguagesController.php index bed0b954f2735..e7900cb072c5f 100644 --- a/administrator/components/com_languages/Controller/LanguagesController.php +++ b/administrator/components/com_languages/Controller/LanguagesController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Controller/OverrideController.php b/administrator/components/com_languages/Controller/OverrideController.php index a8b84f8379e9d..88cdbd4478585 100644 --- a/administrator/components/com_languages/Controller/OverrideController.php +++ b/administrator/components/com_languages/Controller/OverrideController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,7 +15,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; /** * Languages Override Controller @@ -72,7 +71,7 @@ public function edit($key = null, $urlVar = null) public function save($key = null, $urlVar = null) { // Check for request forgeries. - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $app = $this->app; $model = $this->getModel(); @@ -197,7 +196,7 @@ public function save($key = null, $urlVar = null) */ public function cancel($key = null) { - Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken(); $context = "$this->option.edit.$this->context"; diff --git a/administrator/components/com_languages/Controller/OverridesController.php b/administrator/components/com_languages/Controller/OverridesController.php index 0db6957023946..2440130438f99 100644 --- a/administrator/components/com_languages/Controller/OverridesController.php +++ b/administrator/components/com_languages/Controller/OverridesController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,7 +14,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\Router\Route; -use Joomla\CMS\Session\Session; /** * Languages Overrides Controller. @@ -41,7 +40,7 @@ class OverridesController extends AdminController public function delete() { // Check for request forgeries. - Session::checkToken() or die(Text::_('JINVALID_TOKEN')); + $this->checkToken(); // Get items to dlete from the request. $cid = $this->input->get('cid', array(), 'array'); diff --git a/administrator/components/com_languages/Controller/StringsController.php b/administrator/components/com_languages/Controller/StringsController.php index 6831d90736045..28c0c9b7ed8e6 100644 --- a/administrator/components/com_languages/Controller/StringsController.php +++ b/administrator/components/com_languages/Controller/StringsController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Extension/LanguagesComponent.php b/administrator/components/com_languages/Extension/LanguagesComponent.php index 993fa91d115f3..038afa68c7621 100644 --- a/administrator/components/com_languages/Extension/LanguagesComponent.php +++ b/administrator/components/com_languages/Extension/LanguagesComponent.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Field/LanguageclientField.php b/administrator/components/com_languages/Field/LanguageclientField.php new file mode 100644 index 0000000000000..e66c7de45f4f5 --- /dev/null +++ b/administrator/components/com_languages/Field/LanguageclientField.php @@ -0,0 +1,80 @@ +cache)) + { + return $this->cache; + } + + // Get all languages of frontend and backend. + $languages = array(); + $site_languages = LanguageHelper::getKnownLanguages(JPATH_SITE); + $admin_languages = LanguageHelper::getKnownLanguages(JPATH_ADMINISTRATOR); + + // Create a single array of them. + foreach ($site_languages as $tag => $language) + { + $languages[$tag . '0'] = Text::sprintf('COM_LANGUAGES_VIEW_OVERRIDES_LANGUAGES_BOX_ITEM', $language['name'], Text::_('JSITE')); + } + + foreach ($admin_languages as $tag => $language) + { + $languages[$tag . '1'] = Text::sprintf('COM_LANGUAGES_VIEW_OVERRIDES_LANGUAGES_BOX_ITEM', $language['name'], Text::_('JADMINISTRATOR')); + } + + // Sort it by language tag and by client after that. + ksort($languages); + + // Add the languages to the internal cache. + $this->cache = array_merge(parent::getOptions(), $languages); + + return $this->cache; + } +} diff --git a/administrator/components/com_languages/Helper/LanguagesHelper.php b/administrator/components/com_languages/Helper/LanguagesHelper.php index 3eefcde432395..2a1b42b4c999d 100644 --- a/administrator/components/com_languages/Helper/LanguagesHelper.php +++ b/administrator/components/com_languages/Helper/LanguagesHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,6 +11,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; /** @@ -49,29 +50,16 @@ public static function addSubmenu($vName) /** * Method for parsing ini files. * - * @param string $filename Path and name of the ini file to parse. + * @param string $fileName Path and name of the ini file to parse. * * @return array Array of strings found in the file, the array indices will be the keys. On failure an empty array will be returned. * * @since 2.5 + * @deprecated 3.9.0 Use \Joomla\CMS\Language\LanguageHelper::parseIniFile() instead. */ - public static function parseFile($filename) + public static function parseFile($fileName) { - if (!is_file($filename)) - { - return array(); - } - - $contents = file_get_contents($filename); - $contents = str_replace('"_QQ_"', '\\"', $contents); - $strings = @parse_ini_string($contents, INI_SCANNER_RAW); - - if ($strings === false) - { - return array(); - } - - return $strings; + return LanguageHelper::parseIniFile($fileName); } /** diff --git a/administrator/components/com_languages/Helper/MultilangstatusHelper.php b/administrator/components/com_languages/Helper/MultilangstatusHelper.php index 18f3345cab364..bb5335f6326d0 100644 --- a/administrator/components/com_languages/Helper/MultilangstatusHelper.php +++ b/administrator/components/com_languages/Helper/MultilangstatusHelper.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Model/InstalledModel.php b/administrator/components/com_languages/Model/InstalledModel.php index 5da55a4f34c76..aca6e6a913992 100644 --- a/administrator/components/com_languages/Model/InstalledModel.php +++ b/administrator/components/com_languages/Model/InstalledModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -51,7 +51,7 @@ class InstalledModel extends ListModel protected $data = null; /** - * @var int total number pf languages + * @var int total number of languages */ protected $total = null; diff --git a/administrator/components/com_languages/Model/LanguageModel.php b/administrator/components/com_languages/Model/LanguageModel.php index 0db27b84c1fad..341eb09081089 100644 --- a/administrator/components/com_languages/Model/LanguageModel.php +++ b/administrator/components/com_languages/Model/LanguageModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Model/LanguagesModel.php b/administrator/components/com_languages/Model/LanguagesModel.php index 0ad7bc212a981..33777c0d6c063 100644 --- a/administrator/components/com_languages/Model/LanguagesModel.php +++ b/administrator/components/com_languages/Model/LanguagesModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Model/OverrideModel.php b/administrator/components/com_languages/Model/OverrideModel.php index 6f78f2efd67f2..029459d292dee 100644 --- a/administrator/components/com_languages/Model/OverrideModel.php +++ b/administrator/components/com_languages/Model/OverrideModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,6 @@ use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\AdminModel; -use Joomla\Component\Languages\Administrator\Helper\LanguagesHelper; /** * Languages Override Model @@ -98,10 +97,10 @@ protected function loadFormData() public function getItem($pk = null) { $input = Factory::getApplication()->input; - $pk = (!empty($pk)) ? $pk : $input->get('id'); - $filename = constant('JPATH_' . strtoupper($this->getState('filter.client'))) + $pk = !empty($pk) ? $pk : $input->get('id'); + $fileName = constant('JPATH_' . strtoupper($this->getState('filter.client'))) . '/language/overrides/' . $this->getState('filter.language', 'en-GB') . '.override.ini'; - $strings = LanguagesHelper::parseFile($filename); + $strings = LanguageHelper::parseIniFile($fileName); $result = new \stdClass; $result->key = ''; @@ -113,10 +112,10 @@ public function getItem($pk = null) $result->override = $strings[$pk]; } - $opposite_filename = constant('JPATH_' . strtoupper($this->getState('filter.client') == 'site' ? 'administrator' : 'site')) + $oppositeFileName = constant('JPATH_' . strtoupper($this->getState('filter.client') == 'site' ? 'administrator' : 'site')) . '/language/overrides/' . $this->getState('filter.language', 'en-GB') . '.override.ini'; - $opposite_strings = LanguagesHelper::parseFile($opposite_filename); - $result->both = isset($opposite_strings[$pk]) && ($opposite_strings[$pk] == $strings[$pk]); + $oppositeStrings = LanguageHelper::parseIniFile($oppositeFileName); + $result->both = isset($oppositeStrings[$pk]) && ($oppositeStrings[$pk] == $strings[$pk]); return $result; } @@ -157,8 +156,8 @@ public function save($data, $opposite_client = false) $client = $client ? 'administrator' : 'site'; // Parse the override.ini file in oder to get the keys and strings. - $filename = constant('JPATH_' . strtoupper($client)) . '/language/overrides/' . $language . '.override.ini'; - $strings = LanguagesHelper::parseFile($filename); + $fileName = constant('JPATH_' . strtoupper($client)) . '/language/overrides/' . $language . '.override.ini'; + $strings = LanguageHelper::parseIniFile($fileName); if (isset($strings[$data['id']])) { @@ -183,7 +182,7 @@ public function save($data, $opposite_client = false) } // Write override.ini file with the strings. - if (LanguageHelper::saveToIniFile($filename, $strings) === false) + if (LanguageHelper::saveToIniFile($fileName, $strings) === false) { return false; } diff --git a/administrator/components/com_languages/Model/OverridesModel.php b/administrator/components/com_languages/Model/OverridesModel.php index a6df1e110c5b2..43b5c3942ca4b 100644 --- a/administrator/components/com_languages/Model/OverridesModel.php +++ b/administrator/components/com_languages/Model/OverridesModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,14 +11,12 @@ defined('_JEXEC') or die; -use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Component\Languages\Administrator\Helper\LanguagesHelper; /** * Languages Overrides Model @@ -38,9 +36,15 @@ class OverridesModel extends ListModel */ public function __construct($config = array(), MVCFactoryInterface $factory = null) { - parent::__construct($config, $factory); + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'key', + 'text', + ); + } - $this->filter_fields = array('key', 'text'); + parent::__construct($config, $factory); } /** @@ -63,16 +67,16 @@ public function getOverrides($all = false) return $this->cache[$store]; } - $client = in_array($this->state->get('filter.client'), array(0, 'site')) ? 'SITE' : 'ADMINISTRATOR'; + $client = strtoupper($this->getState('filter.client')); // Parse the override.ini file in order to get the keys and strings. - $filename = constant('JPATH_' . $client) . '/language/overrides/' . $this->getState('filter.language') . '.override.ini'; - $strings = LanguagesHelper::parseFile($filename); + $fileName = constant('JPATH_' . $client) . '/language/overrides/' . $this->getState('filter.language') . '.override.ini'; + $strings = LanguageHelper::parseIniFile($fileName); // Delete the override.ini file if empty. - if (file_exists($filename) && empty($strings)) + if (file_exists($fileName) && $strings === array()) { - File::delete($filename); + File::delete($fileName); } // Filter the loaded strings according to the search box. @@ -160,82 +164,29 @@ public function getTotal() */ protected function populateState($ordering = 'key', $direction = 'asc') { - $app = Factory::getApplication(); + // We call populate state first so that we can then set the filter.client and filter.language properties in afterwards + parent::populateState($ordering, $direction); - // Use default language of frontend for default filter. - $default = ComponentHelper::getParams('com_languages')->get('site') . '0'; + $app = Factory::getApplication(); - $old_language_client = $app->getUserState('com_languages.overrides.filter.language_client', ''); - $language_client = $this->getUserStateFromRequest('com_languages.overrides.filter.language_client', 'filter_language_client', $default, 'cmd'); - - if ($old_language_client != $language_client) - { - $client = substr($language_client, -1); - $language = substr($language_client, 0, -1); - } - else - { - $client = $app->getUserState('com_languages.overrides.filter.client', 0); - $language = $app->getUserState('com_languages.overrides.filter.language', 'en-GB'); - } + $language_client = $this->getUserStateFromRequest('com_languages.overrides.language_client', 'language_client', '', 'cmd'); + $client = substr($language_client, -1); + $language = substr($language_client, 0, -1); // Sets the search filter. $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); - $this->setState('filter.language_client', $language . $client); + $this->setState('language_client', $language . $client); $this->setState('filter.client', $client ? 'administrator' : 'site'); $this->setState('filter.language', $language); + // Add the 'language_client' value to the session to display a message if none selected + $app->setUserState('com_languages.overrides.language_client', $language . $client); + // Add filters to the session because they won't be stored there by 'getUserStateFromRequest' if they aren't in the current request. $app->setUserState('com_languages.overrides.filter.client', $client); $app->setUserState('com_languages.overrides.filter.language', $language); - - // List state information - parent::populateState($ordering, $direction); - } - - /** - * Method to get all found languages of frontend and backend. - * - * The resulting array has entries of the following style: - * 0|1 => - - * - * @return array Sorted associative array of languages. - * - * @since 2.5 - */ - public function getLanguages() - { - // Try to load the data from internal storage. - if (!empty($this->cache['languages'])) - { - return $this->cache['languages']; - } - - // Get all languages of frontend and backend. - $languages = array(); - $site_languages = LanguageHelper::getKnownLanguages(JPATH_SITE); - $admin_languages = LanguageHelper::getKnownLanguages(JPATH_ADMINISTRATOR); - - // Create a single array of them. - foreach ($site_languages as $tag => $language) - { - $languages[$tag . '0'] = Text::sprintf('COM_LANGUAGES_VIEW_OVERRIDES_LANGUAGES_BOX_ITEM', $language['name'], Text::_('JSITE')); - } - - foreach ($admin_languages as $tag => $language) - { - $languages[$tag . '1'] = Text::sprintf('COM_LANGUAGES_VIEW_OVERRIDES_LANGUAGES_BOX_ITEM', $language['name'], Text::_('JADMINISTRATOR')); - } - - // Sort it by language tag and by client after that. - ksort($languages); - - // Add the languages to the internal cache. - $this->cache['languages'] = $languages; - - return $this->cache['languages']; } /** @@ -261,8 +212,8 @@ public function delete($cids) $client = $filterclient == 0 ? 'SITE' : 'ADMINISTRATOR'; // Parse the override.ini file in oder to get the keys and strings. - $filename = constant('JPATH_' . $client) . '/language/overrides/' . $this->getState('filter.language') . '.override.ini'; - $strings = LanguagesHelper::parseFile($filename); + $fileName = constant('JPATH_' . $client) . '/language/overrides/' . $this->getState('filter.language') . '.override.ini'; + $strings = LanguageHelper::parseIniFile($fileName); // Unset strings that shall be deleted foreach ($cids as $key) @@ -274,7 +225,7 @@ public function delete($cids) } // Write override.ini file with the strings. - if (LanguageHelper::saveToIniFile($filename, $strings) === false) + if (LanguageHelper::saveToIniFile($fileName, $strings) === false) { return false; } diff --git a/administrator/components/com_languages/Model/StringsModel.php b/administrator/components/com_languages/Model/StringsModel.php index 5d5d83ac0fb87..ed2eb0c710ff5 100644 --- a/administrator/components/com_languages/Model/StringsModel.php +++ b/administrator/components/com_languages/Model/StringsModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/Service/HTML/Languages.php b/administrator/components/com_languages/Service/HTML/Languages.php index 152157e2df621..f0a7834df91f6 100644 --- a/administrator/components/com_languages/Service/HTML/Languages.php +++ b/administrator/components/com_languages/Service/HTML/Languages.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/View/Installed/HtmlView.php b/administrator/components/com_languages/View/Installed/HtmlView.php index 1fbbac8383ce7..8a4a5a5d7fa04 100644 --- a/administrator/components/com_languages/View/Installed/HtmlView.php +++ b/administrator/components/com_languages/View/Installed/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/View/Language/HtmlView.php b/administrator/components/com_languages/View/Language/HtmlView.php index 1ee6d964fb8a5..b234c8b96ae2c 100644 --- a/administrator/components/com_languages/View/Language/HtmlView.php +++ b/administrator/components/com_languages/View/Language/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -98,7 +98,8 @@ protected function addToolbar() if (($isNew && $canDo->get('core.create')) || (!$isNew && $canDo->get('core.edit'))) { - $toolbarButtons[] = ['apply', 'language.apply']; + ToolbarHelper::apply('language.apply'); + $toolbarButtons[] = ['save', 'language.save']; } diff --git a/administrator/components/com_languages/View/Languages/HtmlView.php b/administrator/components/com_languages/View/Languages/HtmlView.php index c6b85a536b4f8..1c25ca7ead6ce 100644 --- a/administrator/components/com_languages/View/Languages/HtmlView.php +++ b/administrator/components/com_languages/View/Languages/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/View/Multilangstatus/HtmlView.php b/administrator/components/com_languages/View/Multilangstatus/HtmlView.php index 1563ad374406e..7cee6a2385b33 100644 --- a/administrator/components/com_languages/View/Multilangstatus/HtmlView.php +++ b/administrator/components/com_languages/View/Multilangstatus/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/View/Override/HtmlView.php b/administrator/components/com_languages/View/Override/HtmlView.php index 3feaa3e7d04f4..e68ccc0f13852 100644 --- a/administrator/components/com_languages/View/Override/HtmlView.php +++ b/administrator/components/com_languages/View/Override/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -63,6 +63,17 @@ public function display($tpl = null) $this->item = $this->get('Item'); $this->state = $this->get('State'); + $app = Factory::getApplication(); + + $languageClient = $app->getUserStateFromRequest('com_languages.overrides.language_client', 'language_client'); + + if ($languageClient == null) + { + $app->enqueueMessage(Text::_('COM_LANGUAGES_OVERRIDE_FIRST_SELECT_MESSAGE'), 'warning'); + + $app->redirect('index.php?option=com_languages&view=overrides'); + } + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -107,7 +118,8 @@ protected function addToolbar() if ($canDo->get('core.edit')) { - $toolbarButtons[] = ['apply', 'override.apply']; + ToolbarHelper::apply('override.apply'); + $toolbarButtons[] = ['save', 'override.save']; } diff --git a/administrator/components/com_languages/View/Overrides/HtmlView.php b/administrator/components/com_languages/View/Overrides/HtmlView.php index ae1e697309bf0..34b6822e8de65 100644 --- a/administrator/components/com_languages/View/Overrides/HtmlView.php +++ b/administrator/components/com_languages/View/Overrides/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,7 +13,6 @@ use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; -use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; @@ -77,10 +76,12 @@ class HtmlView extends BaseHtmlView */ public function display($tpl = null) { - $this->state = $this->get('State'); - $this->items = $this->get('Overrides'); - $this->languages = $this->get('Languages'); - $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->items = $this->get('Overrides'); + $this->languages = $this->get('Languages'); + $this->pagination = $this->get('Pagination'); + $this->filterForm = $this->get('FilterForm'); + $this->activeFilters = $this->get('ActiveFilters'); LanguagesHelper::addSubmenu('overrides'); @@ -133,13 +134,6 @@ protected function addToolbar() \JHtmlSidebar::setAction('index.php?option=com_languages&view=overrides'); - \JHtmlSidebar::addFilter( - '', - 'filter_language_client', - HTMLHelper::_('select.options', $this->languages, null, 'text', $this->state->get('filter.language_client')), - true - ); - $this->sidebar = \JHtmlSidebar::render(); } } diff --git a/administrator/components/com_languages/forms/filter_overrides.xml b/administrator/components/com_languages/forms/filter_overrides.xml new file mode 100644 index 0000000000000..b26f410cb0192 --- /dev/null +++ b/administrator/components/com_languages/forms/filter_overrides.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/administrator/components/com_languages/languages.xml b/administrator/components/com_languages/languages.xml index 1e25fdff91774..c42f07ff2d553 100644 --- a/administrator/components/com_languages/languages.xml +++ b/administrator/components/com_languages/languages.xml @@ -3,7 +3,7 @@ com_languages Joomla! Project April 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org diff --git a/administrator/components/com_languages/layouts/joomla/searchtools/default.php b/administrator/components/com_languages/layouts/joomla/searchtools/default.php new file mode 100644 index 0000000000000..5aba624733477 --- /dev/null +++ b/administrator/components/com_languages/layouts/joomla/searchtools/default.php @@ -0,0 +1,62 @@ +activeFilters['language_client']); +} + +// Set some basic options +$customOptions = array( + 'filtersHidden' => $data['options']['filtersHidden'] ?? empty($data['view']->activeFilters), + 'defaultLimit' => $data['options']['defaultLimit'] ?? Factory::getApplication()->get('list_limit', 20), + 'searchFieldSelector' => '#filter_search', + 'orderFieldSelector' => '#list_fullordering', +); + +$data['options'] = array_merge($customOptions, $data['options']); + +$formSelector = !empty($data['options']['formSelector']) ? $data['options']['formSelector'] : '#adminForm'; + +// Load search tools +HTMLHelper::_('searchtools.form', $formSelector, $data['options']); + +$filtersClass = isset($data['view']->activeFilters) && $data['view']->activeFilters ? ' js-stools-container-filters-visible' : ''; +?> + diff --git a/administrator/components/com_languages/services/provider.php b/administrator/components/com_languages/services/provider.php index 11bed945f7fd4..b8ccddbcacb68 100644 --- a/administrator/components/com_languages/services/provider.php +++ b/administrator/components/com_languages/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/installed/default.php b/administrator/components/com_languages/tmpl/installed/default.php index 7d74178f9a80f..937b6e1573cba 100644 --- a/administrator/components/com_languages/tmpl/installed/default.php +++ b/administrator/components/com_languages/tmpl/installed/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/language/edit.php b/administrator/components/com_languages/tmpl/language/edit.php index 34a896d9bffb6..050513ee4be60 100644 --- a/administrator/components/com_languages/tmpl/language/edit.php +++ b/administrator/components/com_languages/tmpl/language/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/languages/default.php b/administrator/components/com_languages/tmpl/languages/default.php index 6e070ff3f4d5c..2952c0b01efad 100644 --- a/administrator/components/com_languages/tmpl/languages/default.php +++ b/administrator/components/com_languages/tmpl/languages/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/multilangstatus/default.php b/administrator/components/com_languages/tmpl/multilangstatus/default.php index 1060a03e1efe8..5775de60d7eb9 100644 --- a/administrator/components/com_languages/tmpl/multilangstatus/default.php +++ b/administrator/components/com_languages/tmpl/multilangstatus/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/override/edit.php b/administrator/components/com_languages/tmpl/override/edit.php index aa4bf37a50a20..c263318aa9da1 100644 --- a/administrator/components/com_languages/tmpl/override/edit.php +++ b/administrator/components/com_languages/tmpl/override/edit.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_languages/tmpl/overrides/default.php b/administrator/components/com_languages/tmpl/overrides/default.php index e3cda21c33cf5..17e1817e15627 100644 --- a/administrator/components/com_languages/tmpl/overrides/default.php +++ b/administrator/components/com_languages/tmpl/overrides/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_languages * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -11,19 +11,19 @@ use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; -use Joomla\Component\Languages\Administrator\Helper\LanguagesHelper; -$client = $this->state->get('filter.client') == '0' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); +$client = $this->state->get('filter.client') == 'site' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); $language = $this->state->get('filter.language'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); -$opposite_client = $this->state->get('filter.client') == '1' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); -$opposite_filename = constant('JPATH_' . strtoupper(1 - $this->state->get('filter.client')? 'administrator' : 'site')) +$oppositeClient = $this->state->get('filter.client') == 'administrator' ? Text::_('JSITE') : Text::_('JADMINISTRATOR'); +$oppositeFilename = constant('JPATH_' . strtoupper($this->state->get('filter.client') === 'site' ? 'administrator' : 'site')) . '/language/overrides/' . $this->state->get('filter.language', 'en-GB') . '.override.ini'; -$opposite_strings = LanguagesHelper::parseFile($opposite_filename); +$oppositeStrings = LanguageHelper::parseIniFile($oppositeFilename); ?>
    @@ -33,21 +33,8 @@
    -
    - -
    - - pagination->getLimitBox(); ?> -
    -
    + $this)); ?> +
    items)) : ?>
    @@ -63,10 +50,10 @@
    @@ -120,8 +107,6 @@ - - diff --git a/administrator/components/com_login/Controller/DisplayController.php b/administrator/components/com_login/Controller/DisplayController.php index 58a9756b79d53..51f05e15115f7 100644 --- a/administrator/components/com_login/Controller/DisplayController.php +++ b/administrator/components/com_login/Controller/DisplayController.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,7 +13,6 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; -use Joomla\CMS\Session\Session; use Joomla\CMS\Uri\Uri; /** @@ -69,7 +68,7 @@ public function display($cachable = false, $urlparams = false) public function login() { // Check for request forgeries. - Session::checkToken('request') or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken('request'); $app = $this->app; @@ -106,7 +105,7 @@ public function login() */ public function logout() { - Session::checkToken('request') or jexit(Text::_('JINVALID_TOKEN')); + $this->checkToken('request'); $app = $this->app; diff --git a/administrator/components/com_login/Dispatcher/Dispatcher.php b/administrator/components/com_login/Dispatcher/Dispatcher.php index cf260ed8ae3f5..652db39db6ca2 100644 --- a/administrator/components/com_login/Dispatcher/Dispatcher.php +++ b/administrator/components/com_login/Dispatcher/Dispatcher.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_login/Model/LoginModel.php b/administrator/components/com_login/Model/LoginModel.php index 3cfcf88c20dd6..01924a6d913b9 100644 --- a/administrator/components/com_login/Model/LoginModel.php +++ b/administrator/components/com_login/Model/LoginModel.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_login/View/Login/HtmlView.php b/administrator/components/com_login/View/Login/HtmlView.php index 3ccb64f63d049..5d809ef734457 100644 --- a/administrator/components/com_login/View/Login/HtmlView.php +++ b/administrator/components/com_login/View/Login/HtmlView.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_login/login.xml b/administrator/components/com_login/login.xml index 6bbcccdd56171..af62cc6368872 100644 --- a/administrator/components/com_login/login.xml +++ b/administrator/components/com_login/login.xml @@ -3,7 +3,7 @@ com_loginJoomla! ProjectApril 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved.GNU General Public License version 2 or later; see LICENSE.txtadmin@joomla.orgwww.joomla.org diff --git a/administrator/components/com_login/services/provider.php b/administrator/components/com_login/services/provider.php index 7ec2625b167ec..d33a92205bcf0 100644 --- a/administrator/components/com_login/services/provider.php +++ b/administrator/components/com_login/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_login/tmpl/login/default.php b/administrator/components/com_login/tmpl/login/default.php index f13423f9ead68..dc71d2c85b6c9 100644 --- a/administrator/components/com_login/tmpl/login/default.php +++ b/administrator/components/com_login/tmpl/login/default.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_login * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,7 @@ * in your layout override. */ $loginmodule = \Joomla\Component\Login\Administrator\Model\LoginModel::getLoginModule('mod_login'); -echo ModuleHelper::renderModule($loginmodule, array('style' => 'rounded', 'id' => 'section-box')); +echo ModuleHelper::renderModule($loginmodule, array('id' => 'section-box')); /** @@ -30,5 +30,5 @@ // Render the login modules if ($module->module != 'mod_login'){ - echo ModuleHelper::renderModule($module, array('style' => 'rounded', 'id' => 'section-box')); + echo ModuleHelper::renderModule($module, array('id' => 'section-box')); } diff --git a/administrator/components/com_mailto/mailto.xml b/administrator/components/com_mailto/mailto.xml index b121d9cd916ab..60fa5c113661c 100644 --- a/administrator/components/com_mailto/mailto.xml +++ b/administrator/components/com_mailto/mailto.xml @@ -3,7 +3,7 @@ com_mailtoJoomla! ProjectApril 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txtadmin@joomla.orgwww.joomla.org diff --git a/administrator/components/com_mailto/services/provider.php b/administrator/components/com_mailto/services/provider.php index 1b505913adf0b..3a2cec31aa93f 100644 --- a/administrator/components/com_mailto/services/provider.php +++ b/administrator/components/com_mailto/services/provider.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_mailto * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/administrator/components/com_media/layouts/toolbar/create-folder.php b/administrator/components/com_media/layouts/toolbar/create-folder.php index f19753d40a6d1..13731d105e7e8 100644 --- a/administrator/components/com_media/layouts/toolbar/create-folder.php +++ b/administrator/components/com_media/layouts/toolbar/create-folder.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_media * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,5 +14,5 @@ $title = Text::_('COM_MEDIA_CREATE_NEW_FOLDER'); ?> diff --git a/administrator/components/com_media/layouts/toolbar/delete.php b/administrator/components/com_media/layouts/toolbar/delete.php index bdf2fc52f5280..c22c92ede8d5a 100644 --- a/administrator/components/com_media/layouts/toolbar/delete.php +++ b/administrator/components/com_media/layouts/toolbar/delete.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_media * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -13,6 +13,6 @@ $title = Text::_('JTOOLBAR_DELETE'); ?> - \ No newline at end of file + diff --git a/administrator/components/com_media/layouts/toolbar/upload.php b/administrator/components/com_media/layouts/toolbar/upload.php index 0ccf094e4d5e9..b288b73bbafc4 100644 --- a/administrator/components/com_media/layouts/toolbar/upload.php +++ b/administrator/components/com_media/layouts/toolbar/upload.php @@ -3,7 +3,7 @@ * @package Joomla.Administrator * @subpackage com_media * - * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -14,5 +14,5 @@ $title = Text::_('JTOOLBAR_UPLOAD'); ?> \ No newline at end of file + + diff --git a/administrator/components/com_media/media.xml b/administrator/components/com_media/media.xml index 8aac624eaafed..5f1dcbd7cc86a 100644 --- a/administrator/components/com_media/media.xml +++ b/administrator/components/com_media/media.xml @@ -3,7 +3,7 @@ com_mediaJoomla! ProjectApril 2006 - (C) 2005 - 2018 Open Source Matters. All rights reserved. + (C) 2005 - 2019 Open Source Matters. All rights reserved.GNU General Public License version 2 or later; see LICENSE.txtadmin@joomla.orgwww.joomla.org diff --git a/administrator/components/com_media/package-lock.json b/administrator/components/com_media/package-lock.json index 97d6d34f2f607..36fe04ad2058e 100644 --- a/administrator/components/com_media/package-lock.json +++ b/administrator/components/com_media/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "JSONStream": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.3.tgz", - "integrity": "sha512-3Sp6WZZ/lXl+nTDoGpGWHEpTnnC6X5fnkolYZR6nwIfzbxxvA8utPWe1gCt7i0m9uVGsSz2IS8K8mJ7HmlduMg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "requires": { "jsonparse": "^1.2.0", @@ -27,25 +27,37 @@ "dev": true }, "acorn-dynamic-import": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", - "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", - "dev": true, - "requires": { - "acorn": "^5.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true }, "acorn-node": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.5.2.tgz", - "integrity": "sha512-krFKvw/d1F17AN3XZbybIUzEY4YEPNiGo05AfP3dBlfVKrMHETKpgjpuZkSF8qDNt9UkQcqj7am8yJLseklCMg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", + "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", "dev": true, "requires": { - "acorn": "^5.7.1", - "acorn-dynamic-import": "^3.0.0", + "acorn": "^6.0.2", + "acorn-dynamic-import": "^4.0.0", + "acorn-walk": "^6.1.0", "xtend": "^4.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", + "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", + "dev": true + } } }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -1187,36 +1199,37 @@ } }, "browserify": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", - "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", + "version": "16.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", + "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", "dev": true, "requires": { "JSONStream": "^1.0.3", "assert": "^1.4.0", "browser-pack": "^6.0.1", "browser-resolve": "^1.11.0", - "browserify-zlib": "~0.1.2", - "buffer": "^4.1.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", "cached-path-relative": "^1.0.0", - "concat-stream": "~1.5.1", + "concat-stream": "^1.6.0", "console-browserify": "^1.1.0", "constants-browserify": "~1.0.0", "crypto-browserify": "^3.0.0", "defined": "^1.0.0", "deps-sort": "^2.0.0", - "domain-browser": "~1.1.0", + "domain-browser": "^1.2.0", "duplexer2": "~0.1.2", - "events": "~1.1.0", + "events": "^2.0.0", "glob": "^7.1.0", "has": "^1.0.0", "htmlescape": "^1.1.0", - "https-browserify": "~0.0.0", + "https-browserify": "^1.0.0", "inherits": "~2.0.1", "insert-module-globals": "^7.0.0", "labeled-stream-splicer": "^2.0.0", - "module-deps": "^4.0.8", - "os-browserify": "~0.1.1", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", "parents": "^1.0.1", "path-browserify": "~0.0.0", "process": "~0.11.0", @@ -1229,16 +1242,46 @@ "shell-quote": "^1.6.1", "stream-browserify": "^2.0.0", "stream-http": "^2.0.0", - "string_decoder": "~0.10.0", + "string_decoder": "^1.1.1", "subarg": "^1.0.0", "syntax-error": "^1.1.1", "through2": "^2.0.0", "timers-browserify": "^1.0.1", - "tty-browserify": "~0.0.0", + "tty-browserify": "0.0.1", "url": "~0.11.0", "util": "~0.10.1", - "vm-browserify": "~0.0.1", + "vm-browserify": "^1.0.0", "xtend": "^4.0.0" + }, + "dependencies": { + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "events": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "dev": true + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + } } }, "browserify-aes": { @@ -1304,12 +1347,12 @@ } }, "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "~0.2.0" + "pako": "~1.0.5" } }, "browserslist": { @@ -1375,9 +1418,9 @@ } }, "cached-path-relative": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.2.tgz", + "integrity": "sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg==", "dev": true }, "camelcase": { @@ -1684,36 +1727,15 @@ "dev": true }, "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "inherits": "~2.0.1", - "readable-stream": "~2.0.0", - "typedarray": "~0.0.5" - }, - "dependencies": { - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - } - } + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "config-chain": { @@ -2148,13 +2170,22 @@ } }, "detective": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", - "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", + "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", "dev": true, "requires": { - "acorn": "^5.2.1", - "defined": "^1.0.0" + "acorn-node": "^1.6.1", + "defined": "^1.0.0", + "minimist": "^1.1.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, "diffie-hellman": { @@ -2735,7 +2766,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -2756,12 +2788,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2776,17 +2810,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2903,7 +2940,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2915,6 +2953,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2929,6 +2968,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2936,12 +2976,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2960,6 +3002,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3040,7 +3083,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3052,6 +3096,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3137,7 +3182,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -3173,6 +3219,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3192,6 +3239,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3235,12 +3283,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -3545,9 +3595,9 @@ } }, "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, "icss-replace-symbols": { @@ -3636,20 +3686,6 @@ "through2": "^2.0.0", "undeclared-identifiers": "^1.1.2", "xtend": "^4.0.0" - }, - "dependencies": { - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - } } }, "interpret": { @@ -4397,22 +4433,22 @@ } }, "module-deps": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.0.tgz", + "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", "dev": true, "requires": { "JSONStream": "^1.0.3", "browser-resolve": "^1.7.0", "cached-path-relative": "^1.0.0", - "concat-stream": "~1.5.0", + "concat-stream": "~1.6.0", "defined": "^1.0.0", - "detective": "^4.0.0", + "detective": "^5.0.2", "duplexer2": "^0.1.2", "inherits": "^2.0.1", "parents": "^1.0.0", "readable-stream": "^2.0.2", - "resolve": "^1.1.3", + "resolve": "^1.4.0", "stream-combiner2": "^1.1.1", "subarg": "^1.0.0", "through2": "^2.0.0", @@ -4770,9 +4806,9 @@ } }, "os-browserify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", - "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, "os-homedir": { @@ -4837,9 +4873,9 @@ "dev": true }, "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", + "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", "dev": true }, "parents": { @@ -6572,10 +6608,13 @@ } }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } }, "strip-ansi": { "version": "3.0.1", @@ -6681,12 +6720,12 @@ "dev": true }, "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "^2.1.5", + "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, diff --git a/administrator/components/com_media/package.json b/administrator/components/com_media/package.json index dbb0cf971484b..65c35942dd310 100644 --- a/administrator/components/com_media/package.json +++ b/administrator/components/com_media/package.json @@ -23,7 +23,7 @@ "babel-preset-env": "^1.6.1", "babel-preset-es2015": "^6.24.0", "babelify": "^7.2.0", - "browserify": "^13.0.1", + "browserify": "^16.2.3", "cross-env": "^3.0.0", "css-loader": "^0.25.0", "extract-text-webpack-plugin": "^3.0.2", diff --git a/administrator/components/com_media/resources/scripts/app/Api.js b/administrator/components/com_media/resources/scripts/app/Api.js index 40a078811aa24..e85da3ba1c84d 100644 --- a/administrator/components/com_media/resources/scripts/app/Api.js +++ b/administrator/components/com_media/resources/scripts/app/Api.js @@ -124,7 +124,7 @@ class Api { data: JSON.stringify(data), headers: {'Content-Type': 'application/json'}, onSuccess: (response) => { - notifications.success('COM_MEDIA_UPDLOAD_SUCCESS'); + notifications.success('COM_MEDIA_UPLOAD_SUCCESS'); resolve(this._normalizeItem(JSON.parse(response).data)) }, onError: (xhr) => { @@ -138,7 +138,7 @@ class Api { /** * Rename an item * @param path - * @param newName + * @param newPath * @return {Promise.} */ rename(path, newPath) { diff --git a/administrator/components/com_media/resources/scripts/components/app.vue b/administrator/components/com_media/resources/scripts/components/app.vue index 739cee1d3e0a1..b9c2cc1dfcfd4 100644 --- a/administrator/components/com_media/resources/scripts/components/app.vue +++ b/administrator/components/com_media/resources/scripts/components/app.vue @@ -20,7 +20,7 @@ \ No newline at end of file + diff --git a/administrator/components/com_media/resources/scripts/components/breadcrumb/breadcrumb.vue b/administrator/components/com_media/resources/scripts/components/breadcrumb/breadcrumb.vue index 5f8fcbd33692b..68c9de6b3a7d1 100644 --- a/administrator/components/com_media/resources/scripts/components/breadcrumb/breadcrumb.vue +++ b/administrator/components/com_media/resources/scripts/components/breadcrumb/breadcrumb.vue @@ -1,9 +1,11 @@ \ No newline at end of file diff --git a/administrator/components/com_media/resources/scripts/components/browser/browser.vue b/administrator/components/com_media/resources/scripts/components/browser/browser.vue index 0d65c2b3d77fc..8883fa95dbe9b 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/browser.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/browser.vue @@ -9,7 +9,7 @@ ref="browserItems">
    -

    Drop file(s) to Upload

    +

    {{ translate('COM_MEDIA_DROP_FILE') }}

    @@ -18,8 +18,8 @@
  • {{ translate('COM_MEDIA_MEDIA_NAME') }}
  • {{ translate('COM_MEDIA_MEDIA_SIZE') }}
  • {{ translate('COM_MEDIA_MEDIA_DIMENSION') }}
  • -
  • {{ translate('COM_MEDIA_MEDIA_CREATED_AT') }}
  • -
  • {{ translate('COM_MEDIA_MEDIA_MODIFIED_AT') }}
  • +
  • {{ translate('COM_MEDIA_MEDIA_DATE_CREATED') }}
  • +
  • {{ translate('COM_MEDIA_MEDIA_DATE_MODIFIED') }}
  • @@ -79,9 +79,10 @@ methods: { /* Unselect all browser items */ unselectAllBrowserItems(event) { + const clickedDelete = (event.target.id !== undefined && event.target.id === 'mediaDelete') ? true : false; const notClickedBrowserItems = (this.$refs.browserItems && !this.$refs.browserItems.contains(event.target)) || event.target === this.$refs.browserItems; const notClickedInfobar = this.$refs.infobar !== undefined && !this.$refs.infobar.$el.contains(event.target); - const clickedOutside = notClickedBrowserItems && notClickedInfobar; + const clickedOutside = notClickedBrowserItems && notClickedInfobar && !clickedDelete; if (clickedOutside) { this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS); } diff --git a/administrator/components/com_media/resources/scripts/components/browser/items/directory.vue b/administrator/components/com_media/resources/scripts/components/browser/items/directory.vue index d3902a7c5b2fe..f2bfea4f1a636 100644 --- a/administrator/components/com_media/resources/scripts/components/browser/items/directory.vue +++ b/administrator/components/com_media/resources/scripts/components/browser/items/directory.vue @@ -1,5 +1,5 @@
    + - + - + + + + @@ -105,6 +104,28 @@ version; ?> + changelogurl !== null) : ?> + + + + Text::sprintf('COM_INSTALLER_CHANGELOG_TITLE', $item->name, $item->version), + ), + '' + ); + ?> + + + + + + + folder_translated; ?> - + - + @@ -101,9 +88,9 @@