mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-01-11 17:18:42 +00:00
continue implementation
This commit is contained in:
parent
19fc8601cf
commit
0f36d2c16b
82
Theme/Backend/Components/Compound/BaseView.php
Normal file
82
Theme/Backend/Components/Compound/BaseView.php
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Editor
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Editor\Theme\Backend\Components\Compound;
|
||||
|
||||
use phpOMS\Localization\L11nManager;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
/**
|
||||
* Component view.
|
||||
*
|
||||
* @package Modules\Editor
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class BaseView extends View
|
||||
{
|
||||
/**
|
||||
* Form id
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $form = '';
|
||||
|
||||
/**
|
||||
* Virtual path of the media file
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $virtualPath = '';
|
||||
|
||||
/**
|
||||
* Name of the image preview
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public string $name = '';
|
||||
|
||||
public array $files = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(L11nManager $l11n = null, RequestAbstract $request, ResponseAbstract $response)
|
||||
{
|
||||
parent::__construct($l11n, $request, $response);
|
||||
$this->setTemplate('/Modules/Editor/Theme/Backend/Components/Compound/compound');
|
||||
|
||||
$this->data['editor'] = new \Modules\Editor\Theme\Backend\Components\Editor\BaseView($l11n, $request, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(mixed ...$data) : string
|
||||
{
|
||||
/** @var array{0:string, 1?:string, 2?:string} $data */
|
||||
$this->form = $data[0];
|
||||
$this->virtualPath = $data[1] ?? $this->virtualPath;
|
||||
$this->files = $data[2] ?? $this->files;
|
||||
|
||||
return parent::render();
|
||||
}
|
||||
}
|
||||
50
Theme/Backend/Components/Compound/compound.tpl.php
Normal file
50
Theme/Backend/Components/Compound/compound.tpl.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Editor', 'Editor', 'Backend'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<input name="title" type="text" class="wf-100" value="">
|
||||
<div class="form-group">
|
||||
<?= $this->data['editor']->render('note-editor'); ?>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= $this->data['editor']->getData('text')->render('note-editor', 'plain', 'fNote'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input id="bAttributeAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
||||
<input id="bAttributeSave" formmethod="post" type="submit" class="save-form hidden button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
||||
<input type="submit" class="cancel-form hidden button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Notes', 'Editor', 'Backend'); ?><i class="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table class="default">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'Editor', 'Backend'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<tbody id="iEditorInput-tags" class="tags" data-limit="0" data-active="true" data-form="<?= $this->form; ?>">
|
||||
<template id="iEditorInput-tagTemplate">
|
||||
<tr data-tpl-value="/id" data-value="" data-uuid="" data-name="editor-list">
|
||||
<td>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id" data-value=""></td>
|
||||
<td data-tpl-text="/title" data-tpl-value="/title" data-value=""></td>
|
||||
</template>
|
||||
<?php foreach ($this->files as $file) : ?>
|
||||
<tr data-tpl-value="/id" data-value="" data-uuid="" data-name="editor-list">
|
||||
<td>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id" data-value=""><?= $this->printHtml($file->id); ?></td>
|
||||
<td data-tpl-text="/title" data-tpl-value="/title" data-value=""><?= $this->printHtml($file->name); ?></td>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</desction>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -18,6 +18,8 @@ return ['Editor' => [
|
|||
'Creator' => 'Creator',
|
||||
'Documents' => 'Documents',
|
||||
'Editor' => 'Editor',
|
||||
'Note' => 'Note',
|
||||
'Notes' => 'Notes',
|
||||
'GroupUser' => 'Group/User',
|
||||
'Insert' => 'Insert',
|
||||
'Layout' => 'Layout',
|
||||
|
|
|
|||
|
|
@ -41,15 +41,17 @@ echo $this->data['nav']->render(); ?>
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<?= $this->getData('editor')->getData('text')->render(
|
||||
'editor',
|
||||
'plain',
|
||||
'fEditor',
|
||||
$doc->plain,
|
||||
$doc->content
|
||||
); ?>
|
||||
</div>
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<?= $this->getData('editor')->getData('text')->render(
|
||||
'editor',
|
||||
'plain',
|
||||
'fEditor',
|
||||
$doc->plain,
|
||||
$doc->content
|
||||
); ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4">
|
||||
|
|
|
|||
|
|
@ -31,43 +31,24 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->printHtml($doc->title); ?></div>
|
||||
<div calss="portlet-body">
|
||||
<article>
|
||||
<?= $doc->content; ?>
|
||||
</article>
|
||||
<?php if ($editable || !empty($tags)) : ?>
|
||||
<div class="portlet-foot">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 overflowfix">
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
|
||||
<div class="portlet-body">
|
||||
<article><?= $doc->content; ?></article>
|
||||
<?php if (!empty($tags)) : ?>
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= !empty($tag->icon) ? '<i class="' . $this->printHtml($tag->icon) . '"></i>' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($files)) : ?>
|
||||
<div>
|
||||
<?php foreach ($files as $media) : ?>
|
||||
<span><a class="content" href="<?= UriFactory::build('{/base}/media/single?id=' . $media->id);?>"><?= $media->name; ?></a></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if ($editable) : ?>
|
||||
<div class="col-xs-6 end-xs plain-grid">
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build('{/base}/editor/edit?id=' . $doc->id); ?>"><?= $this->getHtml('Edit', '0', '0'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($files)) : ?>
|
||||
<?php if ($editable) : ?>
|
||||
<div class="portlet-foot">
|
||||
<ul>
|
||||
<?php foreach ($files as $file) :
|
||||
$url = $file->extension === 'collection'
|
||||
? UriFactory::build('{/base}/media/list?path=' . \rtrim($file->getVirtualPath(), '/') . '/' . $file->name)
|
||||
: UriFactory::build('{/base}/media/single?id=' . $file->id
|
||||
. '&path={?path}' . (
|
||||
$file->id === 0
|
||||
? '/' . $file->name
|
||||
: ''
|
||||
)
|
||||
);
|
||||
?>
|
||||
<li><a class="content" href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build('{/base}/editor/edit?id=' . $doc->id); ?>"><?= $this->getHtml('Edit', '0', '0'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user