Author: Derick Rethans (derickr) Date: 2024-12-16T15:02:11Z Commit: https://github.com/php/web-analytics/commit/908d455796ce13c28bc465004d09c5888de46b56 Raw diff: https://github.com/php/web-analytics/commit/908d455796ce13c28bc465004d09c5888de46b56.diff
Remove unexpected files Changed paths: D www/core/Updates/5.1.2-rc1.php D www/libs/Zend/Session/SaveHandler/DbTable.php D www/libs/Zend/Session/SaveHandler/Exception.php D www/libs/Zend/Session/SaveHandler/Interface.php D www/plugins/CoreHome/javascripts/numberFormatter.js D www/plugins/CoreHome/vue/src/getFormattedEvolution.ts D www/plugins/Marketplace/vue/src/InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue D www/plugins/TagManager/stylesheets/gettingStarted.less D www/plugins/TagManager/templates/gettingStarted.twig D www/plugins/TagManager/templates/trackingHelp.twig D www/plugins/TagManager/vue/src/GettingStarted/GettingStarted.vue Diff: diff --git a/www/core/Updates/5.1.2-rc1.php b/www/core/Updates/5.1.2-rc1.php deleted file mode 100644 index 406cd87..0000000 --- a/www/core/Updates/5.1.2-rc1.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -/** - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -namespace Piwik\Updates; - -use Piwik\Common; -use Piwik\Config; -use Piwik\DataAccess\ArchiveTableCreator; -use Piwik\Db; -use Piwik\Updater; -use Piwik\Updater\Migration\Factory as MigrationFactory; -use Piwik\Updates; - -class Updates_5_1_2_rc1 extends Updates -{ - /** - * @var MigrationFactory - */ - private $migration; - - public function __construct(MigrationFactory $factory) - { - $this->migration = $factory; - } - - public function getMigrations(Updater $updater) - { - $migrations = []; - - $config = Config::getInstance(); - $dbConfig = $config->database; - - // only run migration if config is not set - if (empty($dbConfig['collation'])) { - $collation = $this->detectCollationForMigration(); - - if (null !== $collation) { - $migrations[] = $this->migration->config->set( - 'database', - 'collation', - $collation - ); - } - } - - return $migrations; - } - - public function doUpdate(Updater $updater) - { - $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); - } - - private function detectCollationForMigration(): ?string - { - try { - $db = Db::get(); - $userTable = Common::prefixTable('user'); - $userTableStatus = $db->fetchRow('SHOW TABLE STATUS WHERE Name = ?', [$userTable]); - - if (empty($userTableStatus['Collation'])) { - // if there is no user table, or no collation for it, abort detection - // this table should always exist and something must be wrong in this case - return null; - } - - $userTableCollation = $userTableStatus['Collation']; - $connectionCollation = $db->fetchOne('SELECT @@collation_connection'); - - if ($userTableCollation === $connectionCollation) { - // if the connection is matching the user table - // we should be safe to assume we have already found a config value - return $userTableCollation; - } - - $archiveTables = ArchiveTableCreator::getTablesArchivesInstalled(ArchiveTableCreator::NUMERIC_TABLE); - - if (0 === count($archiveTables)) { - // skip if there is no archive table (yet) - return null; - } - - // sort tables so we have them in order of their date - rsort($archiveTables); - - $archiveTableStatus = $db->fetchRow('SHOW TABLE STATUS WHERE Name = ?', [$archiveTables[0]]); - - if ( - !empty($archiveTableStatus['Collation']) - && $archiveTableStatus['Collation'] === $userTableCollation - ) { - // the most recent numeric archive table is matching the collation - // of the users table, should be a good config value to choose - return $userTableCollation; - } - } catch (\Exception $e) { - // rely on the system check if detection failed - } - - return null; - } -} diff --git a/www/libs/Zend/Session/SaveHandler/DbTable.php b/www/libs/Zend/Session/SaveHandler/DbTable.php deleted file mode 100644 index 9254a99..0000000 --- a/www/libs/Zend/Session/SaveHandler/DbTable.php +++ /dev/null @@ -1,591 +0,0 @@ -<?php - -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-webat this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to lice...@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Session - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DbTable.php 23775 2011-03-01 17:25:24Z ralph $ - */ - -/** - * @see Zend_Session - */ -// require_once 'Zend/Session.php'; - -/** - * @see Zend_Db_Table_Abstract - */ -// require_once 'Zend/Db/Table/Abstract.php'; - -/** - * @see Zend_Db_Table_Row_Abstract - */ -// require_once 'Zend/Db/Table/Row/Abstract.php'; - -/** - * @see Zend_Config - */ -// require_once 'Zend/Config.php'; - -/** - * Zend_Session_SaveHandler_DbTable - * - * @category Zend - * @package Zend_Session - * @subpackage SaveHandler - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Session_SaveHandler_DbTable - extends Zend_Db_Table_Abstract - implements Zend_Session_SaveHandler_Interface -{ - const PRIMARY_ASSIGNMENT = 'primaryAssignment'; - const PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath'; - const PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName'; - const PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId'; - - const MODIFIED_COLUMN = 'modifiedColumn'; - const LIFETIME_COLUMN = 'lifetimeColumn'; - const DATA_COLUMN = 'dataColumn'; - - const LIFETIME = 'lifetime'; - const OVERRIDE_LIFETIME = 'overrideLifetime'; - - const PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM'; - const PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM'; - const PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC'; - const PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE'; - - /** - * Session table primary key value assignment - * - * @var array - */ - protected $_primaryAssignment = null; - - /** - * Session table last modification time column - * - * @var string - */ - protected $_modifiedColumn = null; - - /** - * Session table lifetime column - * - * @var string - */ - protected $_lifetimeColumn = null; - - /** - * Session table data column - * - * @var string - */ - protected $_dataColumn = null; - - /** - * Session lifetime - * - * @var int - */ - protected $_lifetime = false; - - /** - * Whether or not the lifetime of an existing session should be overridden - * - * @var boolean - */ - protected $_overrideLifetime = false; - - /** - * Session save path - * - * @var string - */ - protected $_sessionSavePath; - - /** - * Session name - * - * @var string - */ - protected $_sessionName; - - /** - * Constructor - * - * $config is an instance of Zend_Config or an array of key/value pairs containing configuration options for - * Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract. These are the configuration options for - * Zend_Session_SaveHandler_DbTable: - * - * primaryAssignment => (string|array) Session table primary key value assignment - * (optional; default: 1 => sessionId) You have to assign a value to each primary key of your session table. - * The value of this configuration option is either a string if you have only one primary key or an array if - * you have multiple primary keys. The array consists of numeric keys starting at 1 and string values. There - * are some values which will be replaced by session information: - * - * sessionId => The id of the current session - * sessionName => The name of the current session - * sessionSavePath => The save path of the current session - * - * NOTE: One of your assignments MUST contain 'sessionId' as value! - * - * modifiedColumn => (string) Session table last modification time column - * - * lifetimeColumn => (string) Session table lifetime column - * - * dataColumn => (string) Session table data column - * - * lifetime => (integer) Session lifetime (optional; default: ini_get('session.gc_maxlifetime')) - * - * overrideLifetime => (boolean) Whether or not the lifetime of an existing session should be overridden - * (optional; default: false) - * - * @param Zend_Config|array $config User-provided configuration - * @return void - * @throws Zend_Session_SaveHandler_Exception - */ - public function __construct($config) - { - if ($config instanceof Zend_Config) { - $config = $config->toArray(); - } else if (!is_array($config)) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - '$config must be an instance of Zend_Config or array of key/value pairs containing ' - . 'configuration options for Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract.'); - } - - foreach ($config as $key => $value) { - do { - switch ($key) { - case self::PRIMARY_ASSIGNMENT: - $this->_primaryAssignment = $value; - break; - case self::MODIFIED_COLUMN: - $this->_modifiedColumn = (string) $value; - break; - case self::LIFETIME_COLUMN: - $this->_lifetimeColumn = (string) $value; - break; - case self::DATA_COLUMN: - $this->_dataColumn = (string) $value; - break; - case self::LIFETIME: - $this->setLifetime($value); - break; - case self::OVERRIDE_LIFETIME: - $this->setOverrideLifetime($value); - break; - default: - // unrecognized options passed to parent::__construct() - break 2; - } - unset($config[$key]); - } while (false); - } - - parent::__construct($config); - } - - /** - * Destructor - * - * @return void - */ - public function __destruct() - { - Zend_Session::writeClose(); - } - - /** - * Set session lifetime and optional whether or not the lifetime of an existing session should be overridden - * - * $lifetime === false resets lifetime to session.gc_maxlifetime - * - * @param int $lifetime - * @param boolean $overrideLifetime (optional) - * @return Zend_Session_SaveHandler_DbTable - */ - public function setLifetime($lifetime, $overrideLifetime = null) - { - if ($lifetime < 0) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - throw new Zend_Session_SaveHandler_Exception(); - } else if (empty($lifetime)) { - $this->_lifetime = (int) ini_get('session.gc_maxlifetime'); - } else { - $this->_lifetime = (int) $lifetime; - } - - if ($overrideLifetime != null) { - $this->setOverrideLifetime($overrideLifetime); - } - - return $this; - } - - /** - * Retrieve session lifetime - * - * @return int - */ - public function getLifetime() - { - return $this->_lifetime; - } - - /** - * Set whether or not the lifetime of an existing session should be overridden - * - * @param boolean $overrideLifetime - * @return Zend_Session_SaveHandler_DbTable - */ - public function setOverrideLifetime($overrideLifetime) - { - $this->_overrideLifetime = (boolean) $overrideLifetime; - - return $this; - } - - /** - * Retrieve whether or not the lifetime of an existing session should be overridden - * - * @return boolean - */ - public function getOverrideLifetime() - { - return $this->_overrideLifetime; - } - - /** - * Open Session - * - * @param string $save_path - * @param string $name - * @return boolean - */ - public function open($save_path, $name) - { - $this->_sessionSavePath = $save_path; - $this->_sessionName = $name; - - return true; - } - - /** - * Close session - * - * @return boolean - */ - public function close() - { - return true; - } - - /** - * Read session data - * - * @param string $id - * @return string - */ - public function read($id) - { - $return = ''; - - $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id)); - - if (count($rows)) { - if ($this->_getExpirationTime($row = $rows->current()) > time()) { - $return = $row->{$this->_dataColumn}; - } else { - $this->destroy($id); - } - } - - return $return; - } - - /** - * Write session data - * - * @param string $id - * @param string $data - * @return boolean - */ - public function write($id, $data) - { - $return = false; - - $data = array($this->_modifiedColumn => time(), - $this->_dataColumn => (string) $data); - - $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id)); - - if (count($rows)) { - $data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current()); - - if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) { - $return = true; - } - } else { - $data[$this->_lifetimeColumn] = $this->_lifetime; - - if ($this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data))) { - $return = true; - } - } - - return $return; - } - - /** - * Destroy session - * - * @param string $id - * @return boolean - */ - public function destroy($id) - { - $return = false; - - if ($this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) { - $return = true; - } - - return $return; - } - - /** - * Garbage Collection - * - * @param int $maxlifetime - * @return true - */ - public function gc($maxlifetime) - { - $this->delete($this->getAdapter()->quoteIdentifier($this->_modifiedColumn, true) . ' + ' - . $this->getAdapter()->quoteIdentifier($this->_lifetimeColumn, true) . ' < ' - . $this->getAdapter()->quote(time())); - - return true; - } - - /** - * Calls other protected methods for individual setup tasks and requirement checks - * - * @return void - */ - protected function _setup() - { - parent::_setup(); - - $this->_setupPrimaryAssignment(); - $this->setLifetime($this->_lifetime); - - $this->_checkRequiredColumns(); - } - - /** - * Initialize table and schema names - * - * @return void - * @throws Zend_Session_SaveHandler_Exception - */ - protected function _setupTableName() - { - if (empty($this->_name) && basename(($this->_name = session_save_path())) != $this->_name) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception('session.save_path is a path and not a table name.'); - } - - if (strpos($this->_name, '.')) { - list($this->_schema, $this->_name) = explode('.', $this->_name); - } - } - - /** - * Initialize session table primary key value assignment - * - * @return void - * @throws Zend_Session_SaveHandler_Exception - */ - protected function _setupPrimaryAssignment() - { - if ($this->_primaryAssignment === null) { - $this->_primaryAssignment = array(1 => self::PRIMARY_ASSIGNMENT_SESSION_ID); - } else if (!is_array($this->_primaryAssignment)) { - $this->_primaryAssignment = array(1 => (string) $this->_primaryAssignment); - } else if (isset($this->_primaryAssignment[0])) { - array_unshift($this->_primaryAssignment, null); - - unset($this->_primaryAssignment[0]); - } - - if (count($this->_primaryAssignment) !== count($this->_primary)) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment " - . "for each session table primary key."); - } else if (!in_array(self::PRIMARY_ASSIGNMENT_SESSION_ID, $this->_primaryAssignment)) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment " - . "for the session id ('" . self::PRIMARY_ASSIGNMENT_SESSION_ID . "')."); - } - } - - /** - * Check for required session table columns - * - * @return void - * @throws Zend_Session_SaveHandler_Exception - */ - protected function _checkRequiredColumns() - { - if ($this->_modifiedColumn === null) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - "Configuration must define '" . self::MODIFIED_COLUMN . "' which names the " - . "session table last modification time column."); - } else if ($this->_lifetimeColumn === null) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - "Configuration must define '" . self::LIFETIME_COLUMN . "' which names the " - . "session table lifetime column."); - } else if ($this->_dataColumn === null) { - /** - * @see Zend_Session_SaveHandler_Exception - */ - // require_once 'Zend/Session/SaveHandler/Exception.php'; - - throw new Zend_Session_SaveHandler_Exception( - "Configuration must define '" . self::DATA_COLUMN . "' which names the " - . "session table data column."); - } - } - - /** - * Retrieve session table primary key values - * - * @param string $id - * @param string $type (optional; default: self::PRIMARY_TYPE_NUM) - * @return array - */ - protected function _getPrimary($id, $type = null) - { - $this->_setupPrimaryKey(); - - if ($type === null) { - $type = self::PRIMARY_TYPE_NUM; - } - - $primaryArray = array(); - - foreach ($this->_primary as $index => $primary) { - switch ($this->_primaryAssignment[$index]) { - case self::PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH: - $value = $this->_sessionSavePath; - break; - case self::PRIMARY_ASSIGNMENT_SESSION_NAME: - $value = $this->_sessionName; - break; - case self::PRIMARY_ASSIGNMENT_SESSION_ID: - $value = (string) $id; - break; - default: - $value = (string) $this->_primaryAssignment[$index]; - break; - } - - switch ((string) $type) { - case self::PRIMARY_TYPE_PRIMARYNUM: - $primaryArray[$index] = $value; - break; - case self::PRIMARY_TYPE_ASSOC: - $primaryArray[$primary] = $value; - break; - case self::PRIMARY_TYPE_WHERECLAUSE: - $primaryArray[] = $this->getAdapter()->quoteIdentifier($primary, true) . ' = ' - . $this->getAdapter()->quote($value); - break; - case self::PRIMARY_TYPE_NUM: - default: - $primaryArray[] = $value; - break; - } - } - - return $primaryArray; - } - - /** - * Retrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME - * - * @param Zend_Db_Table_Row_Abstract $row - * @return int - */ - protected function _getLifetime(Zend_Db_Table_Row_Abstract $row) - { - $return = $this->_lifetime; - - if (!$this->_overrideLifetime) { - $return = (int) $row->{$this->_lifetimeColumn}; - } - - return $return; - } - - /** - * Retrieve session expiration time - * - * @param Zend_Db_Table_Row_Abstract $row - * @return int - */ - protected function _getExpirationTime(Zend_Db_Table_Row_Abstract $row) - { - return (int) $row->{$this->_modifiedColumn} + $this->_getLifetime($row); - } -} diff --git a/www/libs/Zend/Session/SaveHandler/Exception.php b/www/libs/Zend/Session/SaveHandler/Exception.php deleted file mode 100644 index 3e19768..0000000 --- a/www/libs/Zend/Session/SaveHandler/Exception.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to lice...@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Session - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $ - */ - -/** - * @see Zend_Session_Exception - */ -// require_once 'Zend/Session/Exception.php'; - -/** - * Zend_Session_SaveHandler_Exception - * - * @category Zend - * @package Zend_Session - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Session_SaveHandler_Exception extends Zend_Session_Exception -{} diff --git a/www/libs/Zend/Session/SaveHandler/Interface.php b/www/libs/Zend/Session/SaveHandler/Interface.php deleted file mode 100644 index cd85619..0000000 --- a/www/libs/Zend/Session/SaveHandler/Interface.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to lice...@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Session - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $ - * @since Preview Release 0.2 - */ - -/** - * Zend_Session_SaveHandler_Interface - * - * @category Zend - * @package Zend_Session - * @subpackage SaveHandler - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @see http://php.net/session_set_save_handler - */ -interface Zend_Session_SaveHandler_Interface -{ - - /** - * Open Session - retrieve resources - * - * @param string $save_path - * @param string $name - */ - public function open($save_path, $name); - - /** - * Close Session - free resources - * - */ - public function close(); - - /** - * Read session data - * - * @param string $id - */ - public function read($id); - - /** - * Write Session - commit data to resource - * - * @param string $id - * @param mixed $data - */ - public function write($id, $data); - - /** - * Destroy Session - remove data from resource for - * given session id - * - * @param string $id - */ - public function destroy($id); - - /** - * Garbage Collection - remove old session data older - * than $maxlifetime (in seconds) - * - * @param int $maxlifetime - */ - public function gc($maxlifetime); - -} diff --git a/www/plugins/CoreHome/javascripts/numberFormatter.js b/www/plugins/CoreHome/javascripts/numberFormatter.js deleted file mode 100644 index 75eaeb6..0000000 --- a/www/plugins/CoreHome/javascripts/numberFormatter.js +++ /dev/null @@ -1,143 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Number Formatter for formatting numbers, percent and currencies values - * - * @type {object} - */ -var NumberFormatter = (function () { - - var minimumFractionDigits = 0; - var maximumFractionDigits = 2; - - /** - * Formats the given numeric value with the given pattern - * - * @param value - * @param pattern - * @returns {string} - */ - function format(value, pattern) { - - if (!$.isNumeric(value)) { - return value; - } - pattern = pattern || piwik.numbers.patternNumber; - - var patterns = pattern.split(';'); - if (patterns.length == 1) { - // No explicit negative pattern was provided, construct it. - patterns.push('-' + patterns[0]) - } - - // Ensure that the value is positive and has the right number of digits. - var negative = value < 0; - pattern = negative ? patterns[1] : patterns[0]; - - var usesGrouping = (pattern.indexOf(',') != -1); - // if pattern has number groups, parse them. - if (usesGrouping) { - var primaryGroupMatches = pattern.match(/#+0/); - var primaryGroupSize = primaryGroupMatches[0].length; - var secondaryGroupSize = primaryGroupMatches[0].length; - var numberGroups = pattern.split(','); - // check for distinct secondary group size. - if (numberGroups.length > 2) { - secondaryGroupSize = numberGroups[1].length; - } - } - - var signMultiplier = negative ? '-1' : '1'; - value = value * signMultiplier; - // Split the number into major and minor digits. - var valueParts = value.toString().split('.'); - var majorDigits = valueParts[0]; - // Account for maximumFractionDigits = 0, where the number won't - // have a decimal point, and $valueParts[1] won't be set. - minorDigits = valueParts[1] || ''; - if (usesGrouping) { - // Reverse the major digits, since they are grouped from the right. - majorDigits = majorDigits.split('').reverse(); - // Group the major digits. - var groups = []; - groups.push(majorDigits.splice(0, primaryGroupSize).reverse().join('')); - while (majorDigits.length) { - groups.push(majorDigits.splice(0, secondaryGroupSize).reverse().join('')); - } - // Reverse the groups and the digits inside of them. - groups = groups.reverse(); - // Reconstruct the major digits. - majorDigits = groups.join(','); - } - if (minimumFractionDigits < maximumFractionDigits) { - // Strip any trailing zeroes. - var minorDigits = minorDigits.replace(/0+$/,''); - if (minorDigits.length < minimumFractionDigits) { - // Now there are too few digits, re-add trailing zeroes - // until the desired length is reached. - var neededZeroes = minimumFractionDigits - minorDigits.length; - minorDigits += (new Array(neededZeroes+1)).join('0'); - } - } - // Assemble the final number and insert it into the pattern. - value = minorDigits ? majorDigits + '.' + minorDigits : majorDigits; - value = pattern.replace(/#(?:[\.,]#+)*0(?:[,\.][0#]+)*/, value); - // Localize the number. - return replaceSymbols(value); - } - - /** - * Replaces the placeholders with real symbols - * - * @param value - * @returns {string} - */ - function replaceSymbols(value) { - var replacements = { - '.': piwik.numbers.symbolDecimal, - ',': piwik.numbers.symbolGroup, - '+': piwik.numbers.symbolPlus, - '-': piwik.numbers.symbolMinus, - '%': piwik.numbers.symbolPercent - }; - - var newValue = ''; - var valueParts = value.split(''); - - $.each(valueParts, function(index, value) { - $.each(replacements, function(char, replacement) { - if (value.indexOf(char) != -1) { - value = value.replace(char, replacement); - return false; - } - }); - newValue += value; - }); - - return newValue; - } - - /** - * Public available methods - */ - return { - - formatNumber: function (value) { - return format(value, piwik.numbers.patternNumber); - }, - - formatPercent: function (value) { - return format(value, piwik.numbers.patternPercent); - }, - - formatCurrency: function (value, currency) { - var formatted = format(value, piwik.numbers.patternCurrency); - return formatted.replace('ยค', currency); - } - } -})(); diff --git a/www/plugins/CoreHome/vue/src/getFormattedEvolution.ts b/www/plugins/CoreHome/vue/src/getFormattedEvolution.ts deleted file mode 100644 index 422bd2c..0000000 --- a/www/plugins/CoreHome/vue/src/getFormattedEvolution.ts +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import Matomo from './Matomo/Matomo'; - -function calculateEvolution(currentValue: string|number, pastValue: string|number) { - const pastValueParsed = parseInt(pastValue as string, 10); - const currentValueParsed = parseInt(currentValue as string, 10) - pastValueParsed; - - let evolution: number; - - if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) { - evolution = 0; - } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) { - evolution = 100; - } else { - evolution = (currentValueParsed / pastValueParsed) * 100; - } - - return evolution; -} - -function formatEvolution(evolution: number) { - return `${evolution > 0 ? Matomo.numbers.symbolPlus : ''}${Math.round(evolution)}}%`; -} - -export default function getFormattedEvolution( - currentValue: string|number, - pastValue: string|number, -): string { - const evolution = calculateEvolution(currentValue, pastValue); - return formatEvolution(evolution); -} diff --git a/www/plugins/Marketplace/vue/src/InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue b/www/plugins/Marketplace/vue/src/InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue deleted file mode 100644 index 4790962..0000000 --- a/www/plugins/Marketplace/vue/src/InstallAllPaidPluginsButton/InstallAllPaidPluginsButton.vue +++ /dev/null @@ -1,91 +0,0 @@ -<!-- - Matomo - free/libre analytics platform - - @link https://matomo.org - @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later ---> - -<template> - <button - class="btn" - @click.prevent="onInstallAllPaidPlugins()" - :disabled="disabled" - > - <MatomoLoader v-if="loading" /> - {{ translate('Marketplace_InstallPurchasedPlugins') }} - </button> - <div - class="ui-confirm" - id="installAllPaidPluginsAtOnce" - ref="installAllPaidPluginsAtOnce" - > - <h2>{{ translate('Marketplace_InstallAllPurchasedPlugins') }}</h2> - <p> - {{ translate('Marketplace_InstallThesePlugins') }} - </p> - <ul> - <li v-for="pluginDisplayName in paidPluginsToInstallAtOnce" :key="pluginDisplayName"> - {{ pluginDisplayName }} - </li> - </ul> - <p> - <input - role="install" - type="button" - :data-href="installAllPaidPluginsLink" - :value="translate( - 'Marketplace_InstallAllPurchasedPluginsAction', - paidPluginsToInstallAtOnce.length, - )" - /> - <input - role="cancel" - type="button" - :value="translate('General_Cancel')" - /> - </p> - </div> -</template> - -<script lang="ts"> -import { defineComponent } from 'vue'; -import { Matomo, MatomoUrl, MatomoLoader } from 'CoreHome'; - -export default defineComponent({ - components: { MatomoLoader }, - props: { - paidPluginsToInstallAtOnce: { - type: Array, - required: true, - }, - installNonce: { - type: String, - required: true, - }, - loading: { - type: Boolean, - required: true, - }, - disabled: { - type: Boolean, - required: false, - default: false, - }, - }, - methods: { - onInstallAllPaidPlugins() { - Matomo.helper.modalConfirm(this.$refs.installAllPaidPluginsAtOnce as HTMLElement); - }, - }, - computed: { - installAllPaidPluginsLink() { - return `?${MatomoUrl.stringify({ - ...MatomoUrl.urlParsed.value, - module: 'Marketplace', - action: 'installAllPaidPlugins', - nonce: this.installNonce, - })}`; - }, - }, -}); -</script> diff --git a/www/plugins/TagManager/stylesheets/gettingStarted.less b/www/plugins/TagManager/stylesheets/gettingStarted.less deleted file mode 100644 index 085cb64..0000000 --- a/www/plugins/TagManager/stylesheets/gettingStarted.less +++ /dev/null @@ -1,8 +0,0 @@ -.tagManagerGettingStarted { - ul { - margin-left: 20px; - li { - list-style-type: disc; - } - } -} \ No newline at end of file diff --git a/www/plugins/TagManager/templates/gettingStarted.twig b/www/plugins/TagManager/templates/gettingStarted.twig deleted file mode 100755 index 5bc5ebb..0000000 --- a/www/plugins/TagManager/templates/gettingStarted.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% extends '@TagManager/tagmanager.twig' %} - -{% set title %}{{ 'TagManager_GettingStarted'|translate|e }}{% endset %} - -{% block content %} -<div - vue-entry="TagManager.GettingStarted" - can-edit="{{ canEdit|default(null)|json_encode }}" -></div> -{% endblock %} diff --git a/www/plugins/TagManager/templates/trackingHelp.twig b/www/plugins/TagManager/templates/trackingHelp.twig deleted file mode 100644 index d605844..0000000 --- a/www/plugins/TagManager/templates/trackingHelp.twig +++ /dev/null @@ -1,2 +0,0 @@ -<h3>{{ 'TagManager_TagManager'|translate }}</h3> -<p>{{ 'TagManager_TagManagerTrackingInfo'|translate('<a href="' ~ linkTo({module: 'TagManager', action: 'gettingStarted'})~'">', '</a>', '<a href="' ~ linkTo({module: 'TagManager', action: 'manageContainers'})~'">', '</a>')|raw }}</p> \ No newline at end of file diff --git a/www/plugins/TagManager/vue/src/GettingStarted/GettingStarted.vue b/www/plugins/TagManager/vue/src/GettingStarted/GettingStarted.vue deleted file mode 100644 index 3f9e369..0000000 --- a/www/plugins/TagManager/vue/src/GettingStarted/GettingStarted.vue +++ /dev/null @@ -1,107 +0,0 @@ -<!-- - Matomo - free/libre analytics platform - @link https://matomo.org - @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later ---> - -<template> - <div class="tagManagerGettingStarted"> - <h2>{{ translate('TagManager_GettingStarted') }}</h2> - <ContentBlock :content-title="translate('CorePluginsAdmin_WhatIsTagManager')"> - <p>{{ translate('TagManager_GettingStartedWhatIsIntro') }}</p> - - <ul> - <li>{{ translate('TagManager_GettingStartedAnalyticsTracking') }}</li> - <li>{{ translate('TagManager_GettingStartedConversionTracking') }}</li> - <li>{{ translate('TagManager_GettingStartedNewsletterSignups') }}</li> - <li>{{ translate('TagManager_GettingStartedExitActions') }}</li> - <li>{{ translate('TagManager_GettingStartedRemarketing') }}</li> - <li>{{ translate('TagManager_GettingStartedSocialWidgets') }}</li> - <li>{{ translate('TagManager_GettingStartedAffiliates') }}</li> - <li>{{ translate('TagManager_GettingStartedAds') }}</li> - <li>{{ translate('TagManager_GettingStartedAndMore') }}</li> - </ul> - - <p> - <br /> - {{ translate('TagManager_GettingStartedMainComponents') }} - </p> - <ul> - <li>{{ translate('TagManager_GettingStartedTagComponent') }}</li> - <li>{{ translate('TagManager_GettingStartedTriggerComponent') }}</li> - <li>{{ translate('TagManager_GettingStartedVariableComponent') }}</li> - </ul> - </ContentBlock> - <ContentBlock :content-title="translate('TagManager_GettingStartedWhyDoINeed')"> - <p> - {{ translate('TagManager_GettingStartedWhyMakesLifeEasier') }} - <br /><br /> - {{ translate('TagManager_GettingStartedWhyThirdPartySnippets') }} - <br /><br /> - {{ translate('TagManager_GettingStartedWhyAccuracyPerformance') }} - </p> - </ContentBlock> - - <ContentBlock - v-if="canEdit" - :content-title="translate('TagManager_GettingStartedHowDoI')" - > - <p> - <span v-html="$sanitize(gettingStartedHowCreateContainerText)"></span> - {{ translate('TagManager_GettingStartedHowCopyCode') }} - <br /><br /> - {{ translate('TagManager_GettingStartedHowAddTagsToContainer') }} - </p> - </ContentBlock> - - <ContentBlock :content-title="translate('TagManager_GettingStartedWhatIfUnsupported')"> - <p> - {{ translate('TagManager_GettingStartedCustomTags') }} - <br /><br /> - <span v-html="$sanitize(gettingStartedContributeTagsText)"></span> - </p> - </ContentBlock> - </div> -</template> - -<script lang="ts"> -import { defineComponent } from 'vue'; -import { - ContentBlock, - translate, - MatomoUrl, - externalLink, - Matomo, -} from 'CoreHome'; - -export default defineComponent({ - props: { - canEdit: Boolean, - }, - components: { - ContentBlock, - }, - computed: { - gettingStartedHowCreateContainerText() { - const link = `?${MatomoUrl.stringify({ - module: 'TagManager', - action: 'manageContainers', - idSite: Matomo.idSite || MatomoUrl.parsed.value.idSite, - })}`; - - return translate( - 'TagManager_GettingStartedHowCreateContainer', - `<a href="${link}">`, - '</a>', - ); - }, - gettingStartedContributeTagsText() { - return translate( - 'TagManager_GettingStartedContributeTags', - externalLink('https://developer.matomo.org/guides/tagmanager/settingup'), - '</a>', - ); - }, - }, -}); -</script>