Skip to content

Commit

Permalink
Merge branch 'feature/fixbuilder' into feature/appstat
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasites committed Apr 28, 2023
2 parents 5e45bbb + fe894f0 commit 7c3393e
Show file tree
Hide file tree
Showing 67 changed files with 1,366 additions and 202 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# miniShop 2

![Code Quality](https://github.com/modx-pro/miniShop2/actions/workflows/phpcs.yml/badge.svg)
![Test](https://github.com/modx-pro/miniShop2/actions/workflows/eslint.yml/badge.svg)
![Linting](https://github.com/modx-pro/miniShop2/actions/workflows/lint.yml/badge.svg)
[![Contributors](https://img.shields.io/github/contributors/modx-pro/miniShop2.svg?style=flat-square)](https://github.com/modx-pro/miniShop2/graphs/contributors)
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-2.0)

Expand Down
57 changes: 57 additions & 0 deletions _build/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
//MODX BUILD ENVIRONMENT GUI v1

const MODX_CORE_PATH = MODX_BASE_PATH . 'core/';

if (!isset($_REQUEST['getpackage']) && empty($_REQUEST['getpackage'])) {

$current_dir = dirname(__FILE__);

$scanned_directory = array_diff(scandir($current_dir), array('..', '.'));
echo "<h1>MODX build environment GUI</h1>";
echo "<b>Available packages for build:</b> (with versions from build.config.php if exists)<br/><br/>";
//echo "<b>Данные о версии берутся из файла конфигурации пакета</b> (build.config.php)<br/><br/>";
foreach ($scanned_directory as $packagename) {
if (is_dir($current_dir.'/'.$packagename)) {
$config = file_get_contents($current_dir.'/'.$packagename.'/'."build.config.php");
/*parse version*/
$version_preg = "#PKG_VERSION['\",=\s]*([0-9\.]+)#";
$release_preg = "#PKG_RELEASE['\",=\s]*([a-z0-9\.]+)['\"]#";
$version = '';
$matches = [];
if (preg_match($version_preg, $config, $matches)) {
$version .= $matches[1];
}
if (preg_match($release_preg, $config, $matches)) {
$version .= '-'.$matches[1];
}
echo "<b>{$packagename}</b>&nbsp;<a target='_blank' href='/_build/{$packagename}/build.transport.php'>[build package]</a> (".$version.")<br/><br/>";
}
}

echo "<div style='color:#aaa; margin-top: 200px'>Made for MODX RSC by @dimasites and friends</div>";

}else{
// Define paths
if (isset($_SERVER['MODX_BASE_PATH'])) {
define('MODX_BASE_PATH', $_SERVER['MODX_BASE_PATH']);
} elseif (file_exists(dirname(__FILE__, 2) . '/core')) {
define('MODX_BASE_PATH', dirname(__FILE__, 2) . '/');
} else {
define('MODX_BASE_PATH', dirname(__FILE__, 3) . '/');
}

$file = MODX_CORE_PATH.'packages/'.$_REQUEST['getpackage'].'.transport.zip';

if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const PKG_NAME = 'miniShop2';
define('PKG_NAME_LOWER', strtolower(PKG_NAME));

const PKG_VERSION = '4.1.4';
const PKG_VERSION = '4.1.5';
const PKG_RELEASE = 'pl';
const PKG_AUTO_INSTALL = true;

Expand Down
4 changes: 2 additions & 2 deletions _build/build.model.php → _build/minishop2/build.model.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
}

// Define sources
$root = dirname(__FILE__, 2) . '/';
$root = dirname(__FILE__, 3) . '/';
$sources = [
'root' => $root,
'build' => $root . '_build/',
'build' => $root . '_build/' . PKG_NAME_LOWER . '/',
'source_core' => $root . 'core/components/' . PKG_NAME_LOWER,
'model' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/',
'schema' => $root . 'core/components/' . PKG_NAME_LOWER . '/model/schema/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
}

// Define sources
$root = dirname(__FILE__, 2) . '/';
$root = dirname(__FILE__, 3) . '/';

$sources = [
'root' => $root,
'build' => $root . '_build/',
'data' => $root . '_build/data/',
'resolvers' => $root . '_build/resolvers/',
'build' => $root . '_build/' . PKG_NAME_LOWER . '/',
'data' => $root . '_build/' . PKG_NAME_LOWER . '/data/',
'resolvers' => $root . '_build/' . PKG_NAME_LOWER . '/resolvers/',
'chunks' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/chunks/',
'snippets' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/snippets/',
'plugins' => $root . 'core/components/' . PKG_NAME_LOWER . '/elements/plugins/',
Expand Down Expand Up @@ -303,8 +304,13 @@
}
}
$modx->log(modX::LOG_LEVEL_INFO, "\n<br />Execution time: {$totalTime}\n");

$download_url = '/_build/index.php?getpackage='.PKG_NAME_LOWER.'-'.PKG_VERSION.'-'.PKG_RELEASE;
$modx->log(modX::LOG_LEVEL_INFO,"\n<br /><a target='_blank' href='{$download_url}'>Download package</a><br />\n");

echo '</pre>';

if (!empty($_GET['download'])) {
echo '<script>document.location.href = "/core/packages/' . $signature . '.transport.zip' . '";</script>';
}

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
'action' => 'system/settings',
'params' => '&ns=minishop2',
],
'ms2_help' => [
'description' => 'ms2_help_desc',
'parent' => 'minishop2',
'menuindex' => 3,
'action' => 'mgr/help',
],
];

foreach ($tmp as $k => $v) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 24 additions & 18 deletions assets/components/minishop2/css/mgr/bootstrap.buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

display: inline-block;

margin-bottom: 0;
padding: 6px 12px;

font-size: 14px;
font-weight: normal;
line-height: 1.4286;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;

background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
border-radius: 4px
}

.btn:focus, .btn:active:focus, .btn.active:focus {
Expand All @@ -35,16 +39,18 @@
}

.btn:active, .btn.active {
outline: 0;
background-image: none;
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125)
outline: 0;
-webkit-box-shadow: inset 0 3px 5px rgb(0 0 0 / 12.5%);
box-shadow: inset 0 3px 5px rgb(0 0 0 / 12.5%)
}

.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
cursor: not-allowed;
pointer-events: none;
cursor: not-allowed;

opacity: .65;
/* stylelint-disable-next-line function-no-unknown */
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none
Expand Down Expand Up @@ -207,9 +213,9 @@
}

.btn-link {
color: #428bca;
font-weight: normal;
cursor: pointer;
font-weight: normal;
color: #428bca;
border-radius: 0
}

Expand Down Expand Up @@ -258,8 +264,8 @@
.btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0
padding-right: 0;
padding-left: 0
}

.btn-block + .btn-block {
Expand Down
109 changes: 109 additions & 0 deletions assets/components/minishop2/css/mgr/help.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#minishop2-help-text {
box-sizing: border-box;
width: 100%;
margin: 24px 0;
padding: 18px;

background: #fff;
border: 1px solid #e4e4e4;
border-radius: 3px;
box-shadow: 0 1px 0 #e4e4e4;
}


#minishop2-help-text .icon {
margin-right: 5px;
}

#minishop2-help-text img {
float: right;
max-height: 100px;
padding-left: 30px;
}

#minishop2-help-text p {
margin-bottom: 20px;
}

#minishop2-help-text p:last-child {
margin-bottom: 0;
}

#minishop2-help-text textarea {
width: calc(100% - 10px);
height: 250px;
}

#minishop2-help-links {
overflow: hidden;
width: 100%;
margin-bottom: 1em;
}

#minishop2-help-links ul {
width: 100%;
margin: 0;
}

#minishop2-help-links ul li {
position: relative;

float: left;
display: table;

box-sizing: border-box;
width: 16.5%;
min-height: 130px;
margin: 0;
padding: 0 1%;
}

@media (width <= 1023px) {
#minishop2-help-links ul li {
width: 33%;
padding: 5px;
}
}

#minishop2-help-links ul li a {
position: relative;

display: table-cell;

padding: 10px;

font-weight: bold;
color: #53595f;
text-align: center;
text-decoration: none;
vertical-align: middle;

background-color: #fff;
border: 1px solid #e4e4e4;
border-radius: 3px;
box-shadow: 0 1px 0 #e4e4e4;
}

#minishop2-help-links ul li a span {
display: block;
line-height: 1.2;
}

#minishop2-help-links ul li a .title {
font-size: 12px;
}

#minishop2-help-links ul li a .text {
font-weight: normal;
}

#minishop2-help-links ul li a .icon {
display: block;
width: auto;
margin: 0 auto;
padding: 0 0 10px;
}

#minishop2-help-links ul li a:hover .icon {
color: #3697cd;
}
Loading

0 comments on commit 7c3393e

Please sign in to comment.