Skip to content

Commit a205cef

Browse files
committed
Merge branch 'demo/1.21' into demo/1.23
# Conflicts: # src/Classes/Controllers/IndexController.php # src/Classes/LazyLoader.php # src/Classes/ViewModels/ModuleViewModel.php # src/Templates/Footer.tmpl.php # src/Templates/ModuleInfo.tmpl.php # src/Templates/ModuleListingModule.tmpl.php
2 parents 44f1d55 + 663b664 commit a205cef

14 files changed

+85
-100
lines changed

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
define('LOADED_FROM_INDEX', true);
13+
define('MMLC_ROOT', '');
1314

1415
ini_set('display_errors', 1);
1516
ini_set('display_startup_errors', 1);

src/Classes/AccessFileCreator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AccessFileCreator
1717
{
1818
public function renewAccessFiles(): void
1919
{
20+
return;
2021
$this->checkAndCreateAccess(App::getConfigRoot(), []);
2122
$this->checkAndCreateAccess(App::getArchivesRoot(), []);
2223
$this->checkAndCreateAccess(App::getSrcRoot() . '/Classes', []);

src/Classes/Controllers/IndexController.php

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,32 @@ public function invoke()
6565
return $this->invokeLazyModuleChangeCount();
6666
case 'lazySystemUpdateCount':
6767
return $this->invokeLazySystemUpdateCount();
68-
case 'loadRemoteModule':
69-
return $this->invokePull();
70-
case 'install':
71-
return $this->invokeInstall();
72-
case 'loadAndInstall':
73-
return $this->invokeInstall();
74-
case 'update':
75-
return $this->invokeUpdate();
76-
case 'revertChanges':
77-
return $this->invokeDiscard();
78-
case 'uninstall':
79-
return $this->invokeUninstall();
80-
case 'unloadLocalModule':
81-
return $this->invokeDelete();
82-
case 'signIn':
83-
return $this->invokeSignIn();
84-
case 'signOut':
85-
return $this->invokeSignOut();
86-
case 'selfUpdate':
87-
return $this->invokeSelfUpdate();
88-
case 'reportIssue':
89-
return $this->invokeReportIssue();
90-
case 'support':
91-
return $this->invokeSupport();
92-
case 'settings':
93-
return $this->invokeSettings();
68+
// case 'install':
69+
// return $this->invokeInstall();
70+
// case 'update':
71+
// return $this->invokeUpdate();
72+
// case 'uninstall':
73+
// return $this->invokeUninstall();
74+
// case 'loadRemoteModule':
75+
// return $this->invokeLoadRemoteModule();
76+
// case 'loadAndInstall':
77+
// return $this->invokeLoadAndInstall();
78+
// case 'unloadLocalModule':
79+
// return $this->invokeUnloadLocalModule();
80+
// case 'revertChanges':
81+
// return $this->invokeRevertChanges();
82+
// case 'signIn':
83+
// return $this->invokeSignIn();
84+
// case 'signOut':
85+
// return $this->invokeSignOut();
86+
// case 'selfUpdate':
87+
// return $this->invokeSelfUpdate();
88+
// case 'reportIssue':
89+
// return $this->invokeReportIssue();
90+
// case 'support':
91+
// return $this->invokeSupport();
92+
// case 'settings':
93+
// return $this->invokeSettings();
9494
default:
9595
return $this->invokeIndex();
9696
}
@@ -706,6 +706,7 @@ public function calcSystemUpdateCount()
706706

707707
public function checkAccessRight()
708708
{
709+
return;
709710
if (empty($_SESSION['accessRight']) || $_SESSION['accessRight'] !== true) {
710711
return $this->redirect('/?action=signIn');
711712
}

src/Classes/Helpers/TemplateHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function loadStyleSheet(string $stylesheetPath): string
2828
$attributes = [
2929
'rel' => 'stylesheet',
3030
'type' => 'text/css',
31-
'href' => $stylesheetPath . '?v=' . hash_file('crc32', $absPath),
31+
'href' => MMLC_ROOT . $stylesheetPath . '?v=' . hash_file('crc32', $absPath),
3232
];
3333
$attributesToString = [];
3434

src/Classes/LazyLoader.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ class LazyLoader
1717
{
1818
public static function createUrl($module, $dataField)
1919
{
20-
$url = '?action=lazyModuleInfo&archiveName='
21-
. $module->getArchiveName()
22-
. '&version='
23-
. $module->getVersion()
24-
. '&data=' . $dataField;
20+
$url = MMLC_ROOT . '?action=lazyModuleInfo&archiveName=' . $module->getArchiveName() . '&version=' . $module->getVersion() . '&data=' . $dataField;
2521
return $url;
2622
}
2723

@@ -76,19 +72,19 @@ public static function loadModuleChangelog($module, $target, $default = '')
7672

7773
public static function loadModuleUpdateCount($target)
7874
{
79-
$url = '?action=lazyModuleUpdateCount';
75+
$url = MMLC_ROOT . '?action=lazyModuleUpdateCount';
8076
return self::createScript($target, $url, '0');
8177
}
8278

8379
public static function loadModuleChangeCount($target)
8480
{
85-
$url = '?action=lazyModuleChangeCount';
81+
$url = MMLC_ROOT . '?action=lazyModuleChangeCount';
8682
return self::createScript($target, $url, '0');
8783
}
8884

8985
public static function loadSystemUpdateCount($target)
9086
{
91-
$url = '?action=lazySystemUpdateCount';
87+
$url = MMLC_ROOT . '?action=lazySystemUpdateCount';
9288
return self::createScript($target, $url, '0');
9389
}
9490
}

src/Classes/ShopInfo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public static function getTemplates(): array
8888

8989
public static function getAdminDir(): string
9090
{
91+
return '';
9192
return Config::getAdminDir() ?? self::scanForAdminDir();
9293
}
9394

src/Classes/ViewModels/ModuleViewModel.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,18 @@ private function getUrl(string $action, string $ref, ?Module $module = null, arr
249249
$module = $this->module;
250250
}
251251

252-
$queryString = http_build_query($queryParams);
253-
if ($queryString) {
254-
$queryString = '&' . $queryString;
255-
}
252+
return $this->getUrlPretty($module);
256253

257254
return
258255
'?action=' . $action .
259256
'&archiveName=' . $module->getArchiveName() .
260257
'&version=' . $module->getVersion() .
261-
'&ref=' . $ref
262-
. $queryString;
258+
'&ref=' . $ref;
259+
}
260+
261+
private function getUrlPretty(Module $module): string
262+
{
263+
return MMLC_ROOT . $module->getArchiveName() . '/' . $module->getVersion();
263264
}
264265

265266
/**

src/Templates/Footer.tmpl.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
?>
88

9-
<script src="src/Templates/Scripts/bootstrap.bundle.min.js"></script>
10-
<script src="src/Templates/Scripts/lightbox.js"></script>
11-
<script src="src/Templates/Scripts/ModuleActionButtons.js"></script>
12-
<script src="src/Templates/Scripts/Expandable.js"></script>
9+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/bootstrap.bundle.min.js"></script>
10+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/lightbox.js"></script>
11+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/ModuleActionButtons.js"></script>
12+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/Expandable.js"></script>
1313

1414
<script>
1515
function filterModule(searchString)

src/Templates/Head.tmpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
echo TemplateHelper::loadStyleSheet('src/Templates/Styles/style.css');
1919
?>
2020

21-
<script src="src/Templates/Scripts/jquery-3.3.1.min.js"></script>
21+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/jquery-3.3.1.min.js"></script>

src/Templates/ModuleInfo.tmpl.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<html lang="de">
2424
<head>
2525
<?php include 'Head.tmpl.php' ?>
26-
<link rel="stylesheet" href="src/Templates/Styles/highlight-github.css">
27-
<link rel="stylesheet" href="src/Templates/Styles/github-markdown-css.css">
28-
<script src="src/Templates/Scripts/highlight.min.js"></script>
29-
<script src="src/Templates/Scripts/language-smarty.js"></script>
26+
<link rel="stylesheet" href="<?= MMLC_ROOT ?>src/Templates/Styles/highlight-github.css">
27+
<link rel="stylesheet" href="<?= MMLC_ROOT ?>src/Templates/Styles/github-markdown-css.css">
28+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/highlight.min.js"></script>
29+
<script src="<?= MMLC_ROOT ?>src/Templates/Scripts/language-smarty.js"></script>
3030
<script>
3131
hljs.configure({
3232
languages: ['smarty', 'php', 'js'],
@@ -41,6 +41,7 @@
4141

4242
<div class="block">
4343
<div class="content">
44+
<?php /*
4445
<?= $notificationView->renderFlashMessages() ?>
4546
4647
<?php if ($moduleView->isRepairable()) { ?>
@@ -65,6 +66,7 @@
6566
<?php if (!$moduleView->isCompatible()) { ?>
6667
<?= $notificationView->renderMultibleFlashMessages($moduleView->getCompatibleStrings()) ?>
6768
<?php } ?>
69+
*/ ?>
6870

6971
<div class="row">
7072
<div class="col">
@@ -87,11 +89,16 @@
8789
<?php } ?>
8890
</div>
8991
</div>
92+
93+
<div class="alert alert-primary" role="alert">
94+
<i class="fas fa-info-circle fa-fw"></i>
95+
<a href="https://module-loader.de/documentation.php#system-requirements">Installiere dir den MMLC</a>. Danach kannst du das modified Modul <strong><?= $moduleView->getName() ?></strong> mit dem MMLC in deinen Shop installieren.
96+
</div>
9097
</div>
9198
</div>
9299

93100
<div class="content">
94-
<?php include 'ModuleInfoButtons.tmpl.php'; ?>
101+
<?php //include 'ModuleInfoButtons.tmpl.php'; ?>
95102

96103
<div class="row">
97104
<div class="col-3">
@@ -294,8 +301,7 @@
294301
<div class="expandable">
295302
<?php foreach ($module->getVersions() as $moduleVersion) {?>
296303
<?php $moduleVersionView = new ModuleViewModel($moduleVersion) ?>
297-
<a href="?action=moduleInfo&archiveName=<?= $moduleVersion->getArchiveName() ?>&version=<?= $moduleVersion->getVersion()?>">
298-
<?= $moduleVersionView->getVersionAndGitBranch(); ?>
304+
<a href="<?= $moduleVersionView->getModuleInfoUrl() ?>"><?= $moduleVersionView->getVersionAndGitBranch(); ?>
299305
</a>
300306
<?php if ($moduleVersion->isInstalled()) { ?>
301307
<span>installiert</span>
@@ -315,14 +321,16 @@
315321
<td>
316322
<?php if ($module->getRequire()) { ?>
317323
<?php foreach ($module->getRequire() as $archiveName => $version) { ?>
318-
<a href="?action=moduleInfo&archiveName=<?= $archiveName?>"><?= $archiveName?></a><span>: <?= $version ?></span><br>
324+
<?php $moduleVersionView = new ModuleViewModel($moduleVersion) ?>
325+
<a href="<?= $moduleVersionView->getModuleInfoUrl() ?>"><?= $archiveName?></a><span>: <?= $version ?></span><br>
319326
<?php } ?>
320327
<?php } else { ?>
321328
keine Abhängigkeit vorhanden
322329
<?php } ?>
323330
</td>
324331
</tr>
325332

333+
<?php /*
326334
<tr>
327335
<td>Benutzt von</td>
328336
<td>
@@ -335,6 +343,7 @@
335343
<?php } ?>
336344
</td>
337345
</tr>
346+
*/ ?>
338347
</tbody>
339348
</table>
340349

src/Templates/ModuleListing.tmpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="content module-listing">
2121

2222
<div>
23-
<?= $notificationView->renderFlashMessages() ?>
23+
<?php //$notificationView->renderFlashMessages() ?>
2424

2525
<div class="search">
2626
<input type="text" value="" placeholder="Suche Modul- oder Archivname"

src/Templates/ModuleListingModule.tmpl.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,22 @@
1212

1313
$dataTags = $module->getName() . ' ' . $module->getArchiveName() . ' ' . str_replace(',', ' ', $module->getTags());
1414

15-
if ($module->isCompatible()) {
16-
$compatibility = 'kompatibel';
17-
$tooltip = 'Dieses Modul wurde getestet und funktioniert mit deiner Version von modified.';
18-
} else {
19-
$compatibility = 'inkompatibel';
20-
$tooltip = 'Dieses Modul wurde nicht mit deiner Version von modified getestet.';
21-
}
15+
// if ($module->isCompatible()) {
16+
// $compatibility = 'kompatibel';
17+
// $tooltip = 'Dieses Modul wurde getestet und funktioniert mit deiner Version von modified.';
18+
// } else {
19+
// $compatibility = 'inkompatibel';
20+
// $tooltip = 'Dieses Modul wurde noch nicht mit deiner Version von modified getestet.';
21+
// }
2222

2323
$modulePrice = $module->isInstalled() ? 'installiert' : $moduleView->getPriceFormated();
2424
$moduleLink = '?action=moduleInfo&archiveName=' . $module->getArchiveName() . '&version=' . $module->getVersion();
25+
$moduleLink = $moduleView->getModuleInfoUrl();
2526
$moduleDeveloper = $module->getDeveloper();
2627
$moduleDeveloperWebsite = $module->getDeveloperWebsite();
2728
?>
2829

29-
<div class="card module-serach-box <?= $module->isCompatible() ? 'compatible' : 'incompatible'; ?>" data-tags="<?= $dataTags ?>">
30+
<div class="card module-serach-box compatible" data-tags="<?= $dataTags ?>">
3031
<a href="<?= $moduleLink ?>">
3132
<img src="<?= $module->getIconUri(); ?>" class="card-img-top" alt="<?= $module->getName(); ?>">
3233
</a>
@@ -48,12 +49,8 @@
4849
<?= $modulePrice ?>
4950
</div>
5051

51-
<div class="card-compatibility" data-tooltip="<?= $tooltip; ?>">
52-
<?= $compatibility; ?>
53-
</div>
54-
5552
<p class="card-text"><?= strip_tags($module->getShortDescription()); ?></p>
5653

57-
<a href="<?= $moduleLink ?>" class="btn <?= $module->isCompatible() ? 'btn-primary' : 'btn-secondary'; ?>">Details</a>
54+
<a href="<?= $moduleLink ?>" class="btn btn-primary">Details</a>
5855
</div>
5956
</div>

src/Templates/Navi.tmpl.php

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,16 @@
1313
<div class="wrapper">
1414
<div class="logo">
1515
<picture>
16-
<source src="src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo">
16+
<source src="<?= MMLC_ROOT ?>src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo">
1717

18-
<img src="src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo">
18+
<img src="<?= MMLC_ROOT ?>src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo">
1919
</picture>
2020
</div>
2121

2222
<ul class="navi-main row">
23-
<li><a href="?filterModules=all">Alle</a></li>
24-
<li><a href="?filterModules=loaded">Geladen</a></li>
25-
<li><a href="?filterModules=installed">Installiert</a></li>
26-
<li><a href="?filterModules=updatable">Updates <span id="moduleUpdateCount" class="badge badge-light">0<span></a></li>
27-
<li><a href="?filterModules=changed">Geändert <span id="moduleChangeCount" class="badge badge-light">0<span></a></li>
28-
<li><a href="?filterModules=notloaded">Nicht geladen</a></li>
23+
<li><a href="<?= MMLC_ROOT ?>?filterModules=all">Übersicht aller Module</a></li>
24+
<li><a href="https://module-loader.de">module-loader.de</a></li>
25+
<li><a href="https://module-loader.de/imprint.php">Impressum</a></li>
2926
</ul>
30-
31-
<div></div>
32-
33-
<div class="menu">
34-
<picture class="menu-icon">
35-
<source src="src/Templates/Images/menu.png">
36-
<source src="src/Templates/Images/menu.svg">
37-
38-
<img src="src/Templates/Images/menu.png" alt="Menu">
39-
</picture>
40-
41-
<ul class="menu-items">
42-
<li><a class="icon externalLink" href="<?php echo ShopInfo::getAdminUrl() . '/start.php' ?>">zurück zum Shopadmin</a></li>
43-
<li><a class="icon help" href="?action=support">Hilfe & Support</a></li>
44-
<li><a class="icon system" href="?action=selfUpdate">System <span id="systemUpdateCount" class="badge badge-light">0<span></a></li>
45-
<li><a class="icon settings" href="?action=settings">Einstellungen</a></li>
46-
<li><a class="icon signOut" href="?action=signOut">Abmelden</a></li>
47-
</ul>
48-
</div>
4927
</div>
5028
</div>

src/Templates/SignIn.tmpl.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<body id="signIn">
3636
<div class="content">
3737
<div class="test">
38-
<img src="src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo" class="logo">
38+
<img src="<?= MMLC_ROOT ?>src/Templates/Images/mmlc-logo-transparent.png" alt="MMLC Logo" class="logo">
3939

4040
<div class="signin-frame">
4141
<form action="?action=signIn" method="post">
@@ -44,9 +44,9 @@
4444
<div>
4545
<label for="username">
4646
<picture>
47-
<source src="src/Templates/Images/user.png">
47+
<source src="<?= MMLC_ROOT ?>src/Templates/Images/user.png">
4848

49-
<img src="src/Templates/Images/user.png">
49+
<img src="<?= MMLC_ROOT ?>src/Templates/Images/user.png">
5050
</picture>
5151
</label>
5252
<input id="username" type="text" name="username" value="<?php echo empty($_POST['username']) ? '' : $_POST['username'] ?>" placeholder="Benutzername">
@@ -55,9 +55,9 @@
5555
<div>
5656
<label for="password">
5757
<picture>
58-
<source src="src/Templates/Images/password.png">
58+
<source src="<?= MMLC_ROOT ?>src/Templates/Images/password.png">
5959

60-
<img src="src/Templates/Images/password.png">
60+
<img src="<?= MMLC_ROOT ?>src/Templates/Images/password.png">
6161
</picture>
6262
</label>
6363

0 commit comments

Comments
 (0)