-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add a menu entry/button to create multiple translations in selectable contexts - Include a possible scrollbar height in the context grid height - [#204] New event when TV values have been synchronized - Add an option to link a new created translation with all existing translations - [#202] Fix synchronized TVs never triggered - Don't change the parent of a new linked resource to a folder
- Loading branch information
Showing
59 changed files
with
1,130 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
/** | ||
* Resolves install statistics | ||
* | ||
* @package glossary | ||
* @subpackage build | ||
* | ||
* @var array $options | ||
* @var xPDOObject $object | ||
* @var xPDOTransport $transport | ||
*/ | ||
|
||
$url = 'https://treehillstudio.com/extras/package/statistics'; | ||
$params = []; | ||
|
||
/** @var xPDO $modx */ | ||
$modx =& $object->xpdo; | ||
$c = $modx->newQuery('transport.modTransportPackage'); | ||
$c->where( | ||
[ | ||
'workspace' => 1, | ||
"(SELECT | ||
`signature` | ||
FROM {$modx->getTableName('transport.modTransportPackage')} AS `latestPackage` | ||
WHERE `latestPackage`.`package_name` = `modTransportPackage`.`package_name` | ||
ORDER BY | ||
`latestPackage`.`version_major` DESC, | ||
`latestPackage`.`version_minor` DESC, | ||
`latestPackage`.`version_patch` DESC, | ||
IF(`release` = '' OR `release` = 'ga' OR `release` = 'pl','z',`release`) DESC, | ||
`latestPackage`.`release_index` DESC | ||
LIMIT 1,1) = `modTransportPackage`.`signature`", | ||
] | ||
); | ||
$c->where( | ||
[ | ||
'modTransportPackage.signature:LIKE' => $options['namespace'] . '-%', | ||
'modTransportPackage.installed:IS NOT' => null | ||
] | ||
); | ||
$c->limit(1); | ||
|
||
/** @var modTransportPackage $oldPackage */ | ||
$oldPackage = $modx->getObject('transport.modTransportPackage', $c); | ||
|
||
$oldVersion = ''; | ||
if ($oldPackage) { | ||
$oldVersion = $oldPackage->get('version_major') . | ||
'.' . $oldPackage->get('version_minor') . | ||
'.' . $oldPackage->get('version_patch') . | ||
'-' . $oldPackage->get('release'); | ||
} | ||
|
||
$version = ''; | ||
if ($transport->version) { | ||
$version = $transport->version; | ||
} | ||
|
||
$modxVersionObj = $modx->getObject('modSystemSetting', ['key' => 'settings_version']); | ||
$modxVersion = ($modxVersionObj) ? $modxVersionObj->get('value') : ''; | ||
$managerLang = $modx->getOption('manager_language'); | ||
|
||
$action = ''; | ||
switch ($options[xPDOTransport::PACKAGE_ACTION]) { | ||
case xPDOTransport::ACTION_INSTALL: | ||
$action = 'install'; | ||
break; | ||
case xPDOTransport::ACTION_UPGRADE: | ||
$action = 'upgrade'; | ||
break; | ||
case xPDOTransport::ACTION_UNINSTALL: | ||
$action = 'uninstall'; | ||
break; | ||
} | ||
|
||
$params = [ | ||
'name' => $options['namespace'], | ||
'uuid' => $modx->uuid ?? 'unknown', | ||
'host' => $modx->getOption('http_host', null, 'unknown'), | ||
'php_version' => phpversion(), | ||
'modx_version' => $modxVersion, | ||
'manager_lang' => $managerLang, | ||
'installation_type' => $action, | ||
'package_version_from' => $oldVersion, | ||
'package_version' => $version, | ||
'date' => time() | ||
]; | ||
|
||
/** | ||
* Curl POST. | ||
*/ | ||
$curl = curl_init(); | ||
if ($curl) { | ||
curl_setopt($curl, CURLOPT_URL, $url); | ||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | ||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); | ||
curl_setopt($curl, CURLOPT_POST, true); | ||
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); | ||
curl_setopt($curl, CURLOPT_TIMEOUT, 5); | ||
|
||
$response = curl_exec($curl); | ||
$responseInfo = curl_getinfo($curl); | ||
$curlError = curl_error($curl); | ||
curl_close($curl); | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
}, | ||
"require": { | ||
"php": ">=7.2", | ||
"ext-curl": "*", | ||
"ext-json": "*", | ||
"ext-pdo": "*" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.