Use root namespace

This commit is contained in:
Dennis Eichhorn 2018-05-30 13:39:00 +02:00
parent 0bd61648b0
commit 58377a15b4
11 changed files with 49 additions and 16 deletions

View File

@ -38,7 +38,7 @@ class Navigation
*/ */
public static function install(string $path = null, DatabasePool $dbPool = null) : void public static function install(string $path = null, DatabasePool $dbPool = null) : void
{ {
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); $navData = \json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer'; $class = '\\Modules\\Navigation\\Admin\\Installer';
/** @var $class \Modules\Navigation\Admin\Installer */ /** @var $class \Modules\Navigation\Admin\Installer */

View File

@ -151,6 +151,10 @@ final class Controller extends ModuleAbstract implements WebInterface
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import'); $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
$interface = InterfaceManagerMapper::get((int) $request->getData('id'));
$view->addData('interface', $interface);
return $view; return $view;
} }
} }

View File

@ -30,7 +30,7 @@ final class GSDCostCenterMapper extends DataMapperAbstract
/** /**
* Columns. * Columns.
* *
* @var array * @var array<string, array<string, string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static $columns = [

View File

@ -30,7 +30,7 @@ final class GSDCostObjectMapper extends DataMapperAbstract
/** /**
* Columns. * Columns.
* *
* @var array * @var array<string, array<string, string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static $columns = [

View File

@ -0,0 +1,15 @@
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Task') ?></h1></header>
<div class="inner">
<form id="fTask" method="PUT" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/task?{?}&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed">
<tbody>
</table>
</form>
</div>
</section>
</div>
</div>

View File

@ -3,6 +3,6 @@
"version": "1.0.0", "version": "1.0.0",
"website": "", "website": "",
"path": "GSD", "path": "GSD",
"export": true, "export": false,
"import": false "import": true
} }

View File

@ -3,6 +3,6 @@
"version": "1.0.0", "version": "1.0.0",
"website": "", "website": "",
"path": "Intrexx", "path": "Intrexx",
"export": true, "export": false,
"import": false "import": true
} }

View File

@ -48,7 +48,7 @@ final class InterfaceManager
/** /**
* Info data. * Info data.
* *
* @var array * @var array<string, mixed>
* @since 1.0.0 * @since 1.0.0
*/ */
private $info = []; private $info = [];
@ -89,6 +89,18 @@ final class InterfaceManager
return $this->path; return $this->path;
} }
/**
* Get info path
*
* @return string
*
* @since 1.0.0
*/
public function getInterfacePath() : string
{
return $this->info['path'];
}
/** /**
* Get info name * Get info name
* *
@ -136,11 +148,11 @@ final class InterfaceManager
*/ */
public function load() : void public function load() : void
{ {
if (!file_exists($this->path)) { if (!\file_exists($this->path)) {
throw new PathException($this->path); throw new PathException($this->path);
} }
$this->info = json_decode(file_get_contents($this->path), true); $this->info = \json_decode(file_get_contents($this->path), true);
} }
/** /**
@ -152,11 +164,11 @@ final class InterfaceManager
*/ */
public function update() : void public function update() : void
{ {
if (!file_exists($this->path)) { if (!\file_exists($this->path)) {
throw new PathException($this->path); throw new PathException($this->path);
} }
file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT)); \file_put_contents($this->path, \json_encode($this->info, JSON_PRETTY_PRINT));
} }
/** /**
@ -182,7 +194,7 @@ final class InterfaceManager
/** /**
* Get info data. * Get info data.
* *
* @return array * @return array<string, mixed>
* *
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -33,7 +33,7 @@ class InterfaceManagerMapper extends DataMapperAbstract
/** /**
* Columns. * Columns.
* *
* @var array * @var array<string, array<string, string>>
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $columns = [ protected static $columns = [

View File

@ -28,7 +28,7 @@ echo $this->getData('nav')->render();
<td class="wf-100"><?= $this->getHtml('Title') ?> <td class="wf-100"><?= $this->getHtml('Title') ?>
<tbody> <tbody>
<?php $count = 0; foreach ($interfaces as $key => $value) : $count++; <?php $count = 0; foreach ($interfaces as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/exchange/export/profile?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/exchange/import/profile?{?}&id=' . $value->getId()); ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td data-label="<?= $this->getHtml('Title') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -14,4 +14,6 @@
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render();
include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php';