mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-01 03:08:41 +00:00
Render values in editor
This commit is contained in:
parent
c2d051357a
commit
4548d11c3e
|
|
@ -128,6 +128,9 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
|
||||
$view->addData('doc', $doc);
|
||||
|
||||
$editor = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($this->app, $request, $response);
|
||||
$view->addData('editor', $editor);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ use phpOMS\Views\View;
|
|||
*/
|
||||
class TextView extends View
|
||||
{
|
||||
private $id = '';
|
||||
private $name = '';
|
||||
private $form = '';
|
||||
private $id = '';
|
||||
private $name = '';
|
||||
private $form = '';
|
||||
private $plain = '';
|
||||
private $preview = '';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
@ -58,14 +60,26 @@ class TextView extends View
|
|||
return $this->form;
|
||||
}
|
||||
|
||||
public function getPreview() : string
|
||||
{
|
||||
return $this->preview;
|
||||
}
|
||||
|
||||
public function getPlain() : string
|
||||
{
|
||||
return $this->plain;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(...$data) : string
|
||||
{
|
||||
$this->id = $data[0] ?? '';
|
||||
$this->name = $data[1] ?? '';
|
||||
$this->form = $data[2] ?? '';
|
||||
$this->id = $data[0] ?? '';
|
||||
$this->name = $data[1] ?? '';
|
||||
$this->form = $data[2] ?? '';
|
||||
$this->plain = $data[3] ?? '';
|
||||
$this->preview = $data[4] ?? '';
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,20 @@
|
|||
<div class="tab-content">
|
||||
<input type="radio" id="<?= $this->printHtml($this->getId()); ?>-c-tab-1" name="tabular-1" checked>
|
||||
<div class="tab">
|
||||
<textarea style="height: 300px" placeholder="" name="<?= $this->printHtml($this->getName()); ?>" form="<?= $this->printHtml($this->getForm()); ?>"><?= $this->printHtml(isset($doc) ? $doc->getPlain() : ''); ?></textarea><input type="hidden" id="<?= $this->printHtml($this->getId()); ?>-parsed">
|
||||
<textarea
|
||||
style="height: 300px"
|
||||
placeholder=""
|
||||
name="<?= $this->printHtml($this->getName()); ?>"
|
||||
form="<?= $this->printHtml($this->getForm()); ?>">
|
||||
<?= $this->printHtml($this->getPlain()); ?>
|
||||
</textarea><input type="hidden" id="<?= $this->printHtml($this->getId()); ?>-parsed">
|
||||
</div>
|
||||
|
||||
<input type="radio" id="<?= $this->printHtml($this->getId()); ?>-c-tab-2" name="tabular-1">
|
||||
<div class="tab">
|
||||
<?= $this->printHtml(isset($doc) ? $doc->getContent() : ''); ?>
|
||||
<section class="box wf-100">
|
||||
<article><?= $this->getPreview(); ?></article>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package TBD
|
||||
* @package Modules\Editor
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -1,9 +1,73 @@
|
|||
<?= $this->getData('nav')->render(); ?>
|
||||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.2
|
||||
*
|
||||
* @package Modules\Editor
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://website.orange-management.de
|
||||
*/
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$doc = $this->getData('doc');
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="box wf-100">
|
||||
<article><?= $this->getData('doc')->getContent(); ?></article>
|
||||
<div class="inner">
|
||||
<form id="fEditor" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/lang}/api/editor?{?}&csrf={$CSRF}'); ?>">
|
||||
<div class="ipt-wrap">
|
||||
<div class="ipt-first"><input name="title" type="text" class="wf-100" value="<?= $doc->getTitle(); ?>"></div>
|
||||
<div class="ipt-second"><input type="submit" value="<?= $this->getHtml('Save') ?>"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="box wf-100">
|
||||
<div class="inner">
|
||||
<?= $this->getData('editor')->render('editor'); ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="box col-xs-12">
|
||||
<?= $this->getData('editor')->getData('text')->render(
|
||||
'editor',
|
||||
'plain',
|
||||
'fEditor',
|
||||
$doc->getPlain(),
|
||||
$doc->getContent()
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="box wf-100">
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout">
|
||||
<tr><td colspan="2"><label><?= $this->getHtml('Permission'); ?></label>
|
||||
<tr><td><select>
|
||||
<option>
|
||||
</select>
|
||||
<tr><td colspan="2"><label><?= $this->getHtml('GroupUser'); ?></label>
|
||||
<tr><td><input id="iPermission" name="group" type="text" placeholder=""><td><button><?= $this->getHtml('Add'); ?></button>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user