Use editor layout

This commit is contained in:
Dennis Eichhorn 2018-06-01 18:40:30 +02:00
parent 20131ab6d0
commit 098982ea9e
7 changed files with 36 additions and 18 deletions

View File

@ -156,6 +156,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$view->addData('unit', UnitMapper::get((int) $request->getData('id')));
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}
@ -187,6 +190,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$selectorView = new \Modules\Organization\Theme\Backend\Components\UnitTagSelector\UnitTagSelectorView($this->app, $request, $response);
$view->addData('unit-selector', $selectorView);
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}
@ -253,6 +259,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$view->addData('department', DepartmentMapper::get((int) $request->getData('id')));
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}
@ -287,6 +296,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$unitSelectorView = new \Modules\Organization\Theme\Backend\Components\UnitTagSelector\UnitTagSelectorView($this->app, $request, $response);
$view->addData('unit-selector', $unitSelectorView);
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}
@ -353,6 +365,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$view->addData('position', PositionMapper::get((int) $request->getData('id')));
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}
@ -387,6 +402,9 @@ final class Controller extends ModuleAbstract implements WebInterface
$departmentSelectorView = new \Modules\Organization\Theme\Backend\Components\DepartmentTagSelector\DepartmentTagSelectorView($this->app, $request, $response);
$view->addData('department-selector', $departmentSelectorView);
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
$view->addData('editor', $editor);
return $view;
}

View File

@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Department') ?></h1></header>
<div class="inner">
<form id="fDepartmentCreate" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/rootPath}{/lang}/api/organization/department'); ?>">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" placeholder="&#xf040; R&D" required>
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -30,7 +30,8 @@ echo $this->getData('nav')->render(); ?>
<tr><td><label for="iUnit"><?= $this->getHtml('Unit') ?></label>
<tr><td><?= $this->getData('unit-selector')->render('iUnit', false); ?>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription" placeholder="&#xf040;"></textarea>
<tr><td><?= $this->getData('editor')->render('department-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('department-editor', 'description', 'fDepartmentCreate'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>">
</table>
</form>

View File

@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Department') ?></h1></header>
<div class="inner">
<form id="iDepartment" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/backend/organization/department?{?}') ?>" method="PUT">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($department->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -36,8 +36,8 @@ echo $this->getData('nav')->render(); ?>
<option><?= $this->getHtml('Active') ?>
<option><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription"><?= $this->printHtml($department->getDescription()); ?></textarea>
<tr><td><?= $this->getData('editor')->render('department-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('department-editor', 'description', 'iDepartment'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>

View File

@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Position') ?></h1></header>
<div class="inner">
<form id="fPositionCreate" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/rootPath}{/lang}/api/organization/position'); ?>">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" placeholder="&#xf040; Orange Management" required>
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -34,8 +34,8 @@ echo $this->getData('nav')->render(); ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::ACTIVE); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::INACTIVE); ?>"><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription" placeholder="&#xf040;"></textarea>
<tr><td><?= $this->getData('editor')->render('position-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('position-editor', 'description', 'fPositionCreate'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>">
</table>
</form>

View File

@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Position') ?></h1></header>
<div class="inner">
<form id="iPosition" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/backend/organization/position?{?}') ?>" method="PUT">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($position->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -36,8 +36,8 @@ echo $this->getData('nav')->render(); ?>
<option><?= $this->getHtml('Active') ?>
<option><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription"><?= $this->printHtml($position->getDescription()); ?></textarea>
<tr><td><?= $this->getData('editor')->render('position-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('position-editor', 'description', 'iPosition'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>

View File

@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Unit') ?></h1></header>
<div class="inner">
<form id="fUnitCreate" method="put" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/organization/unit'); ?>">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" placeholder="&#xf040; Orange Management" required>
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -32,8 +32,8 @@ echo $this->getData('nav')->render(); ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::ACTIVE); ?>"><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::INACTIVE); ?>"><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td><textarea name="description" id="iDescription" placeholder="&#xf040;"></textarea>
<tr><td><?= $this->getData('editor')->render('unit-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('unit-editor', 'description', 'fUnitCreate'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Create', 0, 0); ?>">
</table>
</form>

View File

@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>
<header><h1><?= $this->getHtml('Unit') ?></h1></header>
<div class="inner">
<form id="iUnit" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/organization/unit') ?>" method="post">
<table class="layout wf-100">
<table class="layout wf-100" style="table-layout: fixed">
<tr><td><label for="iName"><?= $this->getHtml('Name') ?></label>
<tr><td><input type="text" name="name" id="iName" value="<?= $this->printHtml($unit->getName()); ?>">
<tr><td><label for="iParent"><?= $this->getHtml('Parent') ?></label>
@ -34,9 +34,8 @@ echo $this->getData('nav')->render(); ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::ACTIVE); ?>"<?= \Modules\Organization\Models\Status::ACTIVE === $unit->getStatus() ? ' selected' : ''; ?>><?= $this->getHtml('Active') ?>
<option value="<?= $this->printHtml(\Modules\Organization\Models\Status::INACTIVE); ?>"<?= \Modules\Organization\Models\Status::INACTIVE === $unit->getStatus() ? ' selected' : ''; ?>><?= $this->getHtml('Inactive') ?>
</select>
<tr><td><label for="iDescription"><?= $this->getHtml('Description') ?></label>
<tr><td>
<textarea name="description" id="iDescription"><?= $this->printHtml($unit->getDescription()); ?></textarea>
<tr><td><?= $this->getData('editor')->render('unit-editor'); ?>
<tr><td><?= $this->getData('editor')->getData('text')->render('unit-editor', 'description', 'iUnit'); ?>
<tr><td><input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', 0); ?>">
</table>
</form>