mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-18 02:58:41 +00:00
cleanup and tests added for ci/cd
This commit is contained in:
parent
99687a2fee
commit
81581f6103
|
|
@ -94,6 +94,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the content
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -104,7 +106,9 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $content
|
* Set the content
|
||||||
|
*
|
||||||
|
* @param string $content Content
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
@ -116,7 +120,9 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $plain
|
* Set the plain text
|
||||||
|
*
|
||||||
|
* @param string $plain Plain text
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
@ -128,6 +134,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the plain text
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -138,6 +146,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get created at
|
||||||
|
*
|
||||||
* @return \DateTime
|
* @return \DateTime
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -148,6 +158,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the id
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -158,6 +170,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get created by
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -168,7 +182,9 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $id
|
* Set created by
|
||||||
|
*
|
||||||
|
* @param int $id Creator
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -178,6 +194,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the title
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -188,7 +206,9 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $title
|
* Set the title
|
||||||
|
*
|
||||||
|
* @param string $title Title
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
|
|
@ -200,6 +220,8 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the path
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
@ -210,7 +232,9 @@ class EditorDoc implements ArrayableInterface, \JsonSerializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* Set the path if file
|
||||||
|
*
|
||||||
|
* @param string $path Path to file
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,12 @@ use phpOMS\Views\View;
|
||||||
*/
|
*/
|
||||||
class BaseView extends View
|
class BaseView extends View
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Editor id
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
private $id = '';
|
private $id = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -47,6 +53,13 @@ class BaseView extends View
|
||||||
$this->addData('text', $view);
|
$this->addData('text', $view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the editor id
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderId() : string
|
public function renderId() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->id);
|
return $this->printHtml($this->id);
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ use phpOMS\Views\View;
|
||||||
*/
|
*/
|
||||||
class TextView extends View
|
class TextView extends View
|
||||||
{
|
{
|
||||||
private $id = '';
|
private string $id = '';
|
||||||
private $name = '';
|
private string $name = '';
|
||||||
private $form = '';
|
private string $form = '';
|
||||||
private $plain = '';
|
private string $plain = '';
|
||||||
private $preview = '';
|
private string $preview = '';
|
||||||
private $tplText = '';
|
private string $tplText = '';
|
||||||
private $tplValue = '';
|
private string $tplValue = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
|
@ -47,36 +47,87 @@ class TextView extends View
|
||||||
$this->setTemplate('/Modules/Editor/Theme/Backend/Components/Editor/inline-editor');
|
$this->setTemplate('/Modules/Editor/Theme/Backend/Components/Editor/inline-editor');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the form id
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderId() : string
|
public function renderId() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->id);
|
return $this->printHtml($this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the form name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderName() : string
|
public function renderName() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->name);
|
return $this->printHtml($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the form attribute name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderForm() : string
|
public function renderForm() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->form);
|
return $this->printHtml($this->form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the preview
|
||||||
|
*
|
||||||
|
* Usually markdown
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderPreview() : string
|
public function renderPreview() : string
|
||||||
{
|
{
|
||||||
return $this->preview;
|
return $this->preview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the plain text
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderPlain() : string
|
public function renderPlain() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->plain);
|
return $this->printHtml($this->plain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render template text reference
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderTplText() : string
|
public function renderTplText() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->tplText);
|
return $this->printHtml($this->tplText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render template value reference
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function renderTplValue() : string
|
public function renderTplValue() : string
|
||||||
{
|
{
|
||||||
return $this->printHtml($this->tplValue);
|
return $this->printHtml($this->tplValue);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user