Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	Draw/Controller.js
#	Draw/Models/DrawType.enum.js
#	Draw/Models/Editor.js
#	Media/Models/UploadFile.php
This commit is contained in:
Dennis Eichhorn 2017-01-26 16:42:29 +01:00
commit 164c44922e
20 changed files with 629 additions and 42 deletions

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -16,7 +16,7 @@
namespace Modules\Editor\Admin; namespace Modules\Editor\Admin;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\ActivateAbstract; use phpOMS\Module\ActivateAbstract;
use phpOMS\Module\InfoManager; use phpOMS\Module\InfoManager;
@ -37,7 +37,7 @@ class Activate extends ActivateAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function activate(Pool $dbPool, InfoManager $info) public static function activate(DatabasePool $dbPool, InfoManager $info)
{ {
parent::activate($dbPool, $info); parent::activate($dbPool, $info);
} }

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -16,7 +16,7 @@
namespace Modules\Editor\Admin; namespace Modules\Editor\Admin;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\DeactivateAbstract; use phpOMS\Module\DeactivateAbstract;
use phpOMS\Module\InfoManager; use phpOMS\Module\InfoManager;
@ -37,7 +37,7 @@ class Deactivate extends DeactivateAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function deactivate(Pool $dbPool, InfoManager $info) public static function deactivate(DatabasePool $dbPool, InfoManager $info)
{ {
parent::deactivate($dbPool, $info); parent::deactivate($dbPool, $info);
} }

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -14,7 +14,7 @@
* @link http://orange-management.com * @link http://orange-management.com
*/ */
namespace Modules\Editor\Admin\Install; namespace Modules\Editor\Admin\Install;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
/** /**
* Navigation class. * Navigation class.
@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool;
*/ */
class Navigation class Navigation
{ {
public static function install(Pool $dbPool) public static function install(string $path, DatabasePool $dbPool)
{ {
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -16,15 +16,15 @@
namespace Modules\Editor\Admin; namespace Modules\Editor\Admin;
use phpOMS\DataStorage\Database\DatabaseType; use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager; use phpOMS\Module\InfoManager;
use phpOMS\Module\InstallerAbstract; use phpOMS\Module\InstallerAbstract;
/** /**
* Calendar install class. * Editor install class.
* *
* @category Modules * @category Modules
* @package Modules\Calendar * @package Modules\Editor
* @author OMS Development Team <dev@oms.com> * @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com> * @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0 * @license OMS License 1.0
@ -37,12 +37,45 @@ class Installer extends InstallerAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function install(Pool $dbPool, InfoManager $info) public static function install(string $path, DatabasePool $dbPool, InfoManager $info)
{ {
parent::install($dbPool, $info); parent::install($path, $dbPool, $info);
switch ($dbPool->get('core')->getType()) { switch ($dbPool->get('core')->getType()) {
case DatabaseType::MYSQL: case DatabaseType::MYSQL:
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'editor_doc` (
`editor_doc_id` int(11) NOT NULL AUTO_INCREMENT,
`editor_doc_title` varchar(250) NOT NULL,
`editor_doc_plain` text NOT NULL,
`editor_doc_content` text NOT NULL,
`editor_doc_path` varchar(255) NOT NULL,
`editor_doc_created_at` datetime NOT NULL,
`editor_doc_created_by` int(11) NOT NULL,
PRIMARY KEY (`editor_doc_id`),
KEY `editor_doc_created_by` (`editor_doc_created_by`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'editor_doc`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'editor_doc_ibfk_1` FOREIGN KEY (`editor_doc_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'editor_tag` (
`editor_tag_id` int(11) NOT NULL AUTO_INCREMENT,
`editor_tag_doc` int(11) NOT NULL,
`editor_tag_tag` varchar(20) NOT NULL,
PRIMARY KEY (`editor_tag_id`),
KEY `editor_tag_doc` (`editor_tag_doc`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'editor_tag`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'editor_tag_ibfk_1` FOREIGN KEY (`editor_tag_doc`) REFERENCES `' . $dbPool->get('core')->prefix . 'editor_doc` (`editor_doc_id`);'
)->execute();
break; break;
} }
} }

12
Admin/Routes/Web/Api.php Normal file
View File

@ -0,0 +1,12 @@
<?php
use phpOMS\Router\RouteVerb;
return [
'^.*/api/editor.*$' => [
[
'dest' => '\Modules\Editor\Controller:apiEditorCreate',
'verb' => RouteVerb::SET,
],
],
];

View File

@ -19,4 +19,10 @@ return [
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
], ],
], ],
'^.*/backend/editor/single.*$' => [
[
'dest' => '\Modules\Editor\Controller:viewEditorSingle',
'verb' => RouteVerb::GET,
],
],
]; ];

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -16,7 +16,7 @@
namespace Modules\Editor\Admin; namespace Modules\Editor\Admin;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UninstallAbstract; use phpOMS\Module\UninstallAbstract;
/** /**
@ -36,7 +36,7 @@ class Uninstall extends UninstallAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function uninstall(Pool $dbPool, InfoManager $info) public static function uninstall(DatabasePool $dbPool, InfoManager $info)
{ {
parent::uninstall($dbPool, $info); parent::uninstall($dbPool, $info);
} }

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -16,7 +16,7 @@
namespace Modules\Editor\Admin; namespace Modules\Editor\Admin;
use phpOMS\DataStorage\Database\Pool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UpdateAbstract; use phpOMS\Module\UpdateAbstract;
use phpOMS\System\File\Directory; use phpOMS\System\File\Directory;
@ -37,7 +37,7 @@ class Update extends UpdateAbstract
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function update(Pool $dbPool, array $info) public static function update(DatabasePool $dbPool, array $info)
{ {
Directory::deletePath(__DIR__ . '/Update'); Directory::deletePath(__DIR__ . '/Update');
mkdir('Update'); mkdir('Update');

0
Controller.js Normal file
View File

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -15,8 +15,11 @@
*/ */
namespace Modules\Editor; namespace Modules\Editor;
use Model\Message\FormValidation;
use Modules\Navigation\Models\Navigation; use Modules\Navigation\Models\Navigation;
use Modules\Navigation\Views\NavigationView; use Modules\Navigation\Views\NavigationView;
use Modules\Editor\Models\EditorDoc;
use Modules\Editor\Models\EditorDocMapper;
use phpOMS\Asset\AssetType; use phpOMS\Asset\AssetType;
use phpOMS\Contract\RenderableInterface; use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestAbstract;
@ -46,7 +49,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
const MODULE_PATH = __DIR__; /* public */ const MODULE_PATH = __DIR__;
/** /**
* Module version. * Module version.
@ -54,7 +57,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
const MODULE_VERSION = '1.0.0'; /* public */ const MODULE_VERSION = '1.0.0';
/** /**
* Module name. * Module name.
@ -62,7 +65,7 @@ class Controller extends ModuleAbstract implements WebInterface
* @var string * @var string
* @since 1.0.0 * @since 1.0.0
*/ */
const MODULE_NAME = 'Editor'; /* public */ const MODULE_NAME = 'Editor';
/** /**
* Providing. * Providing.
@ -94,7 +97,7 @@ class Controller extends ModuleAbstract implements WebInterface
public function setUpEditorEditor(RequestAbstract $request, ResponseAbstract $response, $data = null) public function setUpEditorEditor(RequestAbstract $request, ResponseAbstract $response, $data = null)
{ {
$head = $response->get('Content')->getData('head'); $head = $response->get('Content')->getData('head');
$head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Editor/ModuleEditor.js'); $head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Editor/Controller.js');
} }
/** /**
@ -132,7 +135,73 @@ class Controller extends ModuleAbstract implements WebInterface
$view->setTemplate('/Modules/Editor/Theme/Backend/editor-list'); $view->setTemplate('/Modules/Editor/Theme/Backend/editor-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response)); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
$docs = EditorDocMapper::getNewest(50);
$view->addData('docs', $docs);
return $view; return $view;
} }
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return \Serializable
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewEditorSingle(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/Editor/Theme/Backend/editor');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
$doc = EditorDocMapper::get((int) $request->getData('id'));
$view->addData('doc', $doc);
return $view;
}
private function validateEditorCreate(RequestAbstract $request) : array
{
$val = [];
if (
($val['title'] = empty($request->getData('title')))
|| ($val['plain'] = empty($request->getData('plain')))
) {
return $val;
}
return [];
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function apiEditorCreate(RequestAbstract $request, ResponseAbstract $response, $data = null)
{
if (!empty($val = $this->validateEditorCreate($request))) {
$response->set('editor_create', new FormValidation($val));
return;
}
$doc = new EditorDoc();
$doc->setTitle($request->getData('title') ?? '');
$doc->setPlain($request->getData('plain') ?? '');
$doc->setContent($request->getData('plain') ?? '');
$doc->setCreatedAt(new \DateTime('now'));
$doc->setCreatedBy($request->getAccount());
EditorDocMapper::create($doc);
$response->set('editor', $doc->jsonSerialize());
}
} }

28
Models/Editor.js Normal file
View File

@ -0,0 +1,28 @@
(function (jsOMS)
{
"use strict";
jsOMS.Modules.Editor.Editor = function (editor)
{
};
jsOMS.Modules.Editor.prototype.getSelectedText = function()
{
var text = '';
var activeEl = document.activeElement;
var activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
if (
(activeElTagName === 'textarea' || activeElTagName === 'input') &&
/^(?:text|search|password|tel|url)$/i.test(activeEl.type) &&
(typeof activeEl.selectionStart === 'number')
) {
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
} else if (window.getSelection) {
text = window.getSelection().toString();
}
return text;
};
}(window.jsOMS = window.jsOMS || {})
);

275
Models/EditorDoc.php Normal file
View File

@ -0,0 +1,275 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Editor\Models;
use phpOMS\Contract\ArrayableInterface;
/**
* News article class.
*
* @category Module
* @package Framework
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class EditorDoc implements ArrayableInterface, \JsonSerializable
{
/**
* Article ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
/**
* Title.
*
* @var string
* @since 1.0.0
*/
private $title = '';
/**
* Content.
*
* @var string
* @since 1.0.0
*/
private $content = '';
/**
* Unparsed.
*
* @var string
* @since 1.0.0
*/
private $plain = '';
/**
* Doc path for organizing.
*
* @var string
* @since 1.0.0
*/
private $path = '';
/**
* Created.
*
* @var \DateTime
* @since 1.0.0
*/
private $createdAt = null;
/**
* Creator.
*
* @var int
* @since 1.0.0
*/
private $createdBy = 0;
/**
* Constructor.
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct()
{
$this->createdAt = new \DateTime('NOW');
}
/**
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getContent() : string
{
return $this->content;
}
/**
* @param string $content
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setContent(string $content)
{
$this->content = $content;
}
/**
* @param string $plain
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setPlain(string $plain)
{
$this->plain = $plain;
}
/**
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getPlain() : string
{
return $this->plain;
}
/**
* @return \DateTime
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getCreatedAt() : \DateTime
{
return $this->createdAt;
}
/**
* @return int
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getId() : int
{
return $this->id;
}
/**
* @return int
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getCreatedBy() : int
{
return $this->createdBy;
}
/**
* @param int $id
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setCreatedBy(int $id)
{
$this->createdBy = $id;
}
/**
* @param \DateTime $createdAt
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getTitle() : string
{
return $this->title;
}
/**
* @param string $title
*
* @return mixed
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setTitle(string $title)
{
$this->title = $title;
}
/**
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getPath() : string
{
return $this->path;
}
/**
* @param string $path
*
* @return mixed
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setPath(string $path)
{
$this->path = $path;
}
public function toArray() : array
{
return [
'id' => $this->id,
'title' => $this->title,
'plain' => $this->plain,
'content' => $this->content,
'createdAt' => $this->createdAt,
'createdBy' => $this->createdBy,
];
}
public function __toString()
{
return json_encode($this->toArray());
}
public function jsonSerialize()
{
return $this->toArray();
}
}

132
Models/EditorDocMapper.php Normal file
View File

@ -0,0 +1,132 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\Editor\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract;
use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Query\Column;
use phpOMS\DataStorage\Database\RelationType;
class EditorDocMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array
* @since 1.0.0
*/
static protected $columns = [
'editor_doc_id' => ['name' => 'editor_doc_id', 'type' => 'int', 'internal' => 'id'],
'editor_doc_created_by' => ['name' => 'editor_doc_created_by', 'type' => 'string', 'internal' => 'createdBy'],
'editor_doc_title' => ['name' => 'editor_doc_title', 'type' => 'string', 'internal' => 'title'],
'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'],
'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'],
'editor_doc_path' => ['name' => 'editor_doc_path', 'type' => 'string', 'internal' => 'path'],
'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
];
static protected $belongsTo = [
'createdBy' => [
'mapper' => AccountMapper::class,
'src' => 'editor_doc_created_by',
],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'editor_doc';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'editor_doc_id';
/**
* Created at.
*
* @var string
* @since 1.0.0
*/
protected static $createdAt = 'editor_doc_created_at';
/**
* Create object.
*
* @param mixed $obj Object
* @param int $relations Behavior for relations creation
*
* @return mixed
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public static function create($obj, int $relations = RelationType::ALL)
{
try {
$objId = parent::create($obj, $relations);
$query = new Builder(self::$db);
$query->prefix(self::$db->getPrefix())
->insert(
'account_permission_account',
'account_permission_from',
'account_permission_for',
'account_permission_id1',
'account_permission_id2',
'account_permission_r',
'account_permission_w',
'account_permission_m',
'account_permission_d',
'account_permission_p'
)
->into('account_permission')
->values($obj->getCreatedBy(), 'editor', 'editor', 1, $objId, 1, 1, 1, 1, 1);
self::$db->con->prepare($query->toSql())->execute();
} catch (\Exception $e) {
return false;
}
return $objId;
}
/**
* Find.
*
* @param array $columns Columns to select
*
* @return Builder
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public static function find(...$columns) : Builder
{
return parent::find(...$columns)->from('account_permission')
->where('account_permission.account_permission_for', '=', 'editor')
->where('account_permission.account_permission_id1', '=', 1)
->where('news.news_id', '=', new Column('account_permission.account_permission_id2'))
->where('account_permission.account_permission_r', '=', 1);
}
}

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -24,6 +24,8 @@ return ['Editor' => [
'Name' => 'Name', 'Name' => 'Name',
'Permission' => 'Permission', 'Permission' => 'Permission',
'Preview' => 'Preview', 'Preview' => 'Preview',
'Save' => 'Save',
'Start' => 'Start', 'Start' => 'Start',
'Text' => 'Text', 'Text' => 'Text',
'Title' => 'Title',
]]; ]];

View File

@ -1,6 +1,27 @@
<section class="box w-100"> <?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright 2013 Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$doc = $this->getData('doc') ?? null;
?>
<section class="box w-100">
<div class="inner"> <div class="inner">
<input type="text" placeholder="&#xf040; This is a news title" form="newsForm"> <input type="text" name="title" form="docForm">
</div> </div>
</section> </section>
@ -25,18 +46,19 @@
<div class="box w-100"> <div class="box w-100">
<div class="tabular"> <div class="tabular">
<ul class="tab-links"> <ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getText('Plain') ?></label> <li><label for="c-tab-1"><?= $this->getText('Text') ?></label>
<li><label for="c-tab-2"><?= $this->getText('Preview') ?></label> <li><label for="c-tab-2"><?= $this->getText('Preview') ?></label>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-1" checked> <input type="radio" id="c-tab-1" name="tabular-1" checked>
<div class="tab"> <div class="tab">
<textarea style="height: 300px" placeholder="&#xf040;" form="newsForm"></textarea><input type="hidden" id="iParsed" name="parsed"> <textarea style="height: 300px" placeholder="&#xf040;" name="plain" form="docForm"><?= isset($doc) ? $doc->getPlain() : ''; ?></textarea><input type="hidden" id="iParsed" name="parsed">
</div> </div>
<input type="radio" id="c-tab-2" name="tabular-1"> <input type="radio" id="c-tab-2" name="tabular-1">
<div class="tab"> <div class="tab">
<?= isset($doc) ? $doc->getContent() : ''; ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -21,8 +21,9 @@ echo $this->getData('nav')->render(); ?>
<section class="box w-100"> <section class="box w-100">
<div class="inner"> <div class="inner">
<form> <form id="fEditor" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/api/editor?csrf={$CSRF}'); ?>">
<input type="text" class="wf-100"> <input name="title" type="text" class="wf-100">
<input type="submit" value="<?= $this->getText('Save'); ?>">
</form> </form>
</div> </div>
</section> </section>
@ -95,7 +96,7 @@ echo $this->getData('nav')->render(); ?>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab2-1" name="tabular-2" checked> <input type="radio" id="c-tab2-1" name="tabular-2" checked>
<div class="tab"> <div class="tab">
<textarea class="wf-100"></textarea> <textarea name="plain" class="wf-100" form="fEditor"></textarea>
</div> </div>
<input type="radio" id="c-tab2-2" name="tabular-2"> <input type="radio" id="c-tab2-2" name="tabular-2">
<div class="tab"> <div class="tab">
@ -113,7 +114,7 @@ echo $this->getData('nav')->render(); ?>
<option> <option>
</select> </select>
<tr><td colspan="2"><label><?= $this->getText('GroupUser') ?></label> <tr><td colspan="2"><label><?= $this->getText('GroupUser') ?></label>
<tr><td><input id="iPermission" name="group" type="text" placeholder="&#xf084;"><td><button><?= $this->getText('Add', 0, 0) ?></button> <tr><td><input id="iPermission" name="group" type="text" placeholder="&#xf084;"><td><button><?= $this->getText('Add') ?></button>
</table> </table>
</form> </form>
</div> </div>

View File

@ -2,7 +2,7 @@
/** /**
* Orange Management * Orange Management
* *
* PHP Version 7.0 * PHP Version 7.1
* *
* @category TBD * @category TBD
* @package TBD * @package TBD
@ -22,20 +22,27 @@ $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(20); $footerView->setPages(20);
$footerView->setPage(1); $footerView->setPage(1);
$docs = $this->getData('docs');
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="box"> <div class="box">
<table class="table"> <table class="table">
<caption><?= $this->getText('Documents'); ?></caption> <caption><?= $this->getText('Documents'); ?></caption>
<thead> <thead>
<tr> <tr>
<td class="wf-100"><?= $this->getText('Name'); ?> <td class="wf-100"><?= $this->getText('Title'); ?>
<td><?= $this->getText('Creator'); ?> <td><?= $this->getText('Creator'); ?>
<td><?= $this->getText('Created'); ?> <td><?= $this->getText('Created'); ?>
<tfoot> <tfoot>
<tr> <tr>
<td colspan="3"><?= $footerView->render(); ?> <td colspan="3"><?= $footerView->render(); ?>
<tbody> <tbody>
<?php $count = 0; foreach([] as $key => $value) : $count++; ?> <?php $count = 0; foreach($docs as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/editor/single?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getTitle(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedBy(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getCreatedAt()->format('Y-m-d H:i:s'); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
<?php if($count === 0) : ?> <?php if($count === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?> <tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>