FEATURE #2354 @2h30m: add pipeline for edit and create new content
This commit is contained in:
@@ -5,27 +5,6 @@ use App\Http\Requests\Request;
|
|||||||
use App\Models\Content\Content;
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
interface AdvancedContentModifier {
|
interface AdvancedContentModifier {
|
||||||
/**
|
|
||||||
* Save module-specific values into database
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param array $inputData
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public static function createNew(Content &$content, array $inputData);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used for editing existing content page.
|
|
||||||
*
|
|
||||||
* Reason why it is separated from createNew() method is simple - we need to save history of changes.
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param $request
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public static function edit(Content $content, $request);
|
|
||||||
/**
|
/**
|
||||||
* Method called right after content page is marked as deleted
|
* Method called right after content page is marked as deleted
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,10 +7,9 @@ interface Pipeline {
|
|||||||
/**
|
/**
|
||||||
* Add new process into pipeline
|
* Add new process into pipeline
|
||||||
*
|
*
|
||||||
* @param Process $proces
|
* @param string $process
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function add($process);
|
function add($process);
|
||||||
function run(Content $page);
|
function run(Content $page);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Contracts\Content\SavePipeline;
|
||||||
|
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
interface Pipeline {
|
||||||
|
/**
|
||||||
|
* Add new process into pipeline
|
||||||
|
*
|
||||||
|
* @param string $process
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function add($process);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save content page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return Content
|
||||||
|
*/
|
||||||
|
function run(Content & $page, array $input);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Contracts\Content\SavePipeline;
|
||||||
|
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
interface Process {
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
function handle(Content & $page, array & $input);
|
||||||
|
}
|
||||||
@@ -6,16 +6,6 @@ use App\Models\Content\Content;
|
|||||||
|
|
||||||
interface AppHandler extends BaseModuleHandler
|
interface AppHandler extends BaseModuleHandler
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Render given module into visitor area.
|
|
||||||
*
|
|
||||||
* @param Content $content DB model from table contents
|
|
||||||
* @param array $parameters parameters used for modifications/custom settings of given model
|
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
// public function render(Content $content, $parameters);
|
|
||||||
|
|
||||||
public static function getHistoryHandler();
|
public static function getHistoryHandler();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,21 +27,4 @@ interface TemplateHandler extends BaseModuleHandler
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getPublicTemplatePaths();
|
public static function getPublicTemplatePaths();
|
||||||
|
|
||||||
/**
|
|
||||||
* Modify input data into format which can be understood by edit template
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
*/
|
|
||||||
public static function beforePopulatingEditForm(Content & $content);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Slightly modify Content object before saving into database.
|
|
||||||
*
|
|
||||||
* This way we can do almost whatever we want - even in template
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param $request
|
|
||||||
*/
|
|
||||||
public static function beforeSave(Content & $content, $request);
|
|
||||||
}
|
}
|
||||||
@@ -96,37 +96,4 @@ class CurrentTemplate implements TemplateHandler
|
|||||||
{
|
{
|
||||||
return call_user_func([self::handler(), 'getPublicTemplatePaths']);
|
return call_user_func([self::handler(), 'getPublicTemplatePaths']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare Content object to be rendered using Blade template
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
*/
|
|
||||||
public static function beforeRender(Content & $content)
|
|
||||||
{
|
|
||||||
call_user_func_array([self::handler(), 'beforeRender'], [&$content]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Modify input data into format which can be understood by edit template
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
*/
|
|
||||||
public static function beforePopulatingEditForm(Content & $content)
|
|
||||||
{
|
|
||||||
call_user_func_array([self::handler(), 'beforePopulatingEditForm'], [&$content]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Slightly modify Content object before saving into database.
|
|
||||||
*
|
|
||||||
* This way we can do almost whatever we want - even in template
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param $request
|
|
||||||
*/
|
|
||||||
public static function beforeSave(Content & $content, $request)
|
|
||||||
{
|
|
||||||
call_user_func_array([self::handler(), 'beforeSave'], [&$content, $request]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -37,32 +37,18 @@ class EditContent implements Interaction
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
*
|
*
|
||||||
* @return mixed|void
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($data, $parameters)
|
public function handle($data, $parameters)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var $page Content
|
* @var $page Content
|
||||||
*/
|
*/
|
||||||
list($page, $titlePhoto, $relatedFiles) = $parameters;
|
list($page) = $parameters;
|
||||||
|
|
||||||
// let template to modify request and content page
|
app('saveContentPipeline')->run($page, $data);
|
||||||
CurrentTemplate::beforeSave($page, $data);
|
|
||||||
|
|
||||||
// upload file - if provided
|
return $page;
|
||||||
$data['titlePhoto'] = isset($data['existingTitlePhoto']) ? $data['existingTitlePhoto'] : null;
|
|
||||||
|
|
||||||
if (!is_null($titlePhoto)) {
|
|
||||||
$file = $this->file->upload($titlePhoto);
|
|
||||||
$data['titlePhoto'] = $file ? $file['filename'] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$page->update($data);
|
|
||||||
$this->module->callOnString($page->moduleHandler, 'edit', [$page, $data]);
|
|
||||||
|
|
||||||
// move to interaction
|
|
||||||
$keepAssigned = isset($data['keepAssigned']) ? $data['keepAssigned'] : [];
|
|
||||||
$page->uploadRelatedFiles($relatedFiles, $keepAssigned);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,29 +43,14 @@ class NewContent implements Interaction
|
|||||||
*/
|
*/
|
||||||
public function handle($data, $parameters)
|
public function handle($data, $parameters)
|
||||||
{
|
{
|
||||||
list($moduleHandler, $titlePhoto, $relatedFiles) = $parameters;
|
list($moduleHandler) = $parameters;
|
||||||
|
|
||||||
// upload file - if provided
|
|
||||||
$file = !is_null($titlePhoto) ? $this->file->upload($titlePhoto) : null;
|
|
||||||
|
|
||||||
$data['userId'] = \Auth::user()->id;
|
$data['userId'] = \Auth::user()->id;
|
||||||
$data['language'] = LaravelLocalization::getCurrentLocale();
|
$data['language'] = LaravelLocalization::getCurrentLocale();
|
||||||
$data['titlePhoto'] = $file ? $file['filename'] : null;
|
|
||||||
$data['moduleHandler'] = $moduleHandler;
|
$data['moduleHandler'] = $moduleHandler;
|
||||||
|
|
||||||
$page = Content::create($data);
|
$page = new Content();
|
||||||
|
app('saveContentPipeline')->run($page, $data);
|
||||||
// save module-specific stuff
|
|
||||||
$this->module->callOnString($moduleHandler, 'createNew', [&$page, $data]);
|
|
||||||
|
|
||||||
// let template to modify data and content page
|
|
||||||
CurrentTemplate::beforeSave($page, $data);
|
|
||||||
|
|
||||||
// save content of page before (possible) uploading related files
|
|
||||||
$page->save();
|
|
||||||
|
|
||||||
// upload files assigned to content page
|
|
||||||
$page->uploadRelatedFiles($relatedFiles);
|
|
||||||
|
|
||||||
return $page;
|
return $page;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\CMS\Pipeline;
|
namespace App\CMS\Pipeline;
|
||||||
|
|
||||||
use App\CMS\Contracts\Content\DisplayPipeline\Pipeline;
|
|
||||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
|
||||||
use App\CMS\Pipeline\Exceptions\InvalidProcessType;
|
use App\CMS\Pipeline\Exceptions\InvalidProcessType;
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Models\Content\Content;
|
|
||||||
|
|
||||||
class DisplayPipeline implements Pipeline
|
abstract class AbstractPipeline {
|
||||||
{
|
|
||||||
protected $processes = [];
|
protected $processes = [];
|
||||||
protected $beforeStart = null;
|
protected $beforeStart = null;
|
||||||
protected $beforeRender = null;
|
protected $beforeRender = null;
|
||||||
|
protected $acceptedProcessInterface = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check if given classname implements valid Process interface
|
||||||
|
*
|
||||||
|
* @param $classname
|
||||||
|
*
|
||||||
|
* @throws InvalidProcessType
|
||||||
|
*/
|
||||||
|
protected function checkValidProcess($classname)
|
||||||
|
{
|
||||||
|
if (is_null($this->acceptedProcessInterface))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!in_array($this->acceptedProcessInterface, class_implements($classname))) {
|
||||||
|
throw new InvalidProcessType($classname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add new process into pipeline
|
* Add new process into pipeline
|
||||||
@@ -28,20 +41,6 @@ class DisplayPipeline implements Pipeline
|
|||||||
$this->processes[] = $process;
|
$this->processes[] = $process;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* check if given classname implements Process interface
|
|
||||||
*
|
|
||||||
* @param $classname
|
|
||||||
*
|
|
||||||
* @throws InvalidProcessType
|
|
||||||
*/
|
|
||||||
protected function checkValidProcess($classname)
|
|
||||||
{
|
|
||||||
if (!in_array(Process::class, class_implements($classname))) {
|
|
||||||
throw new InvalidProcessType($classname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param null $beforeStart
|
* @param null $beforeStart
|
||||||
*/
|
*/
|
||||||
@@ -69,44 +68,4 @@ class DisplayPipeline implements Pipeline
|
|||||||
|
|
||||||
$this->beforeRender = $beforeRender;
|
$this->beforeRender = $beforeRender;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Run pipeline
|
|
||||||
*
|
|
||||||
* @param Content $page
|
|
||||||
*
|
|
||||||
* @return Content
|
|
||||||
*/
|
|
||||||
function run(Content $page)
|
|
||||||
{
|
|
||||||
$this->runBeforeStart($page);
|
|
||||||
|
|
||||||
foreach ($this->processes as $process) {
|
|
||||||
/**
|
|
||||||
* @var $run Process
|
|
||||||
*/
|
|
||||||
$run = new $process;
|
|
||||||
$run->handle($page);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->runBeforeRender($page);
|
|
||||||
|
|
||||||
return $page;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function runBeforeStart($page)
|
|
||||||
{
|
|
||||||
if (!is_null($this->beforeStart)) {
|
|
||||||
$process = new $this->beforeStart;
|
|
||||||
$process->handle($page);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function runBeforeRender($page)
|
|
||||||
{
|
|
||||||
if (!is_null($this->beforeRender)) {
|
|
||||||
$process = new $this->beforeRender;
|
|
||||||
$process->handle($page);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Pipeline\DisplayPipeline;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\DisplayPipeline\Pipeline;
|
||||||
|
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||||
|
use App\CMS\Pipeline\AbstractPipeline;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
class DisplayPipeline extends AbstractPipeline implements Pipeline
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* DisplayPipeline constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->acceptedProcessInterface = Process::class;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run pipeline
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
*
|
||||||
|
* @return Content
|
||||||
|
*/
|
||||||
|
function run(Content $page)
|
||||||
|
{
|
||||||
|
$this->runBeforeStart($page);
|
||||||
|
|
||||||
|
foreach ($this->processes as $process) {
|
||||||
|
/**
|
||||||
|
* @var $run Process
|
||||||
|
*/
|
||||||
|
$run = new $process;
|
||||||
|
$run->handle($page);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->runBeforeRender($page);
|
||||||
|
|
||||||
|
return $page;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function runBeforeStart($page)
|
||||||
|
{
|
||||||
|
if (!is_null($this->beforeStart)) {
|
||||||
|
$process = new $this->beforeStart;
|
||||||
|
$process->handle($page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function runBeforeRender($page)
|
||||||
|
{
|
||||||
|
if (!is_null($this->beforeRender)) {
|
||||||
|
$process = new $this->beforeRender;
|
||||||
|
$process->handle($page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\CMS\Pipeline\Process;
|
namespace App\CMS\Pipeline\DisplayPipeline\Process;
|
||||||
|
|
||||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||||
use App\Models\Content\Content;
|
use App\Models\Content\Content;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\CMS\Pipeline\Process;
|
namespace App\CMS\Pipeline\DisplayPipeline\Process;
|
||||||
|
|
||||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||||
use App\Models\Content\Content;
|
use App\Models\Content\Content;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Pipeline\SavePipeline\Process;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
class SaveCommonFields implements Process {
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function handle(Content & $page, array &$input)
|
||||||
|
{
|
||||||
|
($page->exists == false) ? $page = Content::create($input): $page->update($input);
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
-31
@@ -1,32 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Models\Content\ModelTraits;
|
namespace App\CMS\Pipeline\SavePipeline\Process;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
use App\Models\Content\ContentHasFile;
|
use App\Models\Content\ContentHasFile;
|
||||||
use App\Models\FileManager\Directory;
|
use App\Models\FileManager\Directory;
|
||||||
use App\Models\FileManager\File;
|
use App\Models\FileManager\File;
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
|
|
||||||
trait Content
|
class UploadRelatedFiles implements Process
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Upload and assign files to newly created content page
|
* Process and modify given page
|
||||||
*
|
*
|
||||||
* @param $files
|
* @param Content $page
|
||||||
* @param $assignedFiles
|
* @param array $input
|
||||||
* @param null $revisionId
|
|
||||||
*
|
*
|
||||||
* @return int
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function uploadRelatedFiles($files, $assignedFiles = [], $revisionId = null)
|
function handle(Content & $page, array & $input)
|
||||||
{
|
{
|
||||||
$changed = 0;
|
$files = $input['files'];
|
||||||
|
$assignedFiles = isset($input['keepAssigned']) ? $input['keepAssigned'] : [];
|
||||||
|
|
||||||
// check if any file was removed
|
// check if any file was removed
|
||||||
$changed += $this->removeRelatedFiles($revisionId, $assignedFiles);
|
$this->removeRelatedFiles($page, $assignedFiles);
|
||||||
|
|
||||||
// allow uploading only on created pages
|
// allow uploading only on created pages
|
||||||
if (!$this->id || !$files[0]) {
|
if (!$page->id || !$files[0]) {
|
||||||
return $changed;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find or create new directory for files assigned to content
|
// find or create new directory for files assigned to content
|
||||||
@@ -37,7 +38,7 @@ trait Content
|
|||||||
$data = new \stdClass();
|
$data = new \stdClass();
|
||||||
$data->directoryId = $directory->id;
|
$data->directoryId = $directory->id;
|
||||||
|
|
||||||
$fileModel = App::make(File::class);
|
$fileModel = app(File::class);
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if (!$file) {
|
if (!$file) {
|
||||||
@@ -48,38 +49,27 @@ trait Content
|
|||||||
// add assignement
|
// add assignement
|
||||||
ContentHasFile::create([
|
ContentHasFile::create([
|
||||||
'file_id' => $uploaded['id'],
|
'file_id' => $uploaded['id'],
|
||||||
'content_id' => $this->id
|
'content_id' => $page->id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($revisionId) {
|
|
||||||
$this->saveHistory($revisionId, 'file', null, ['file' => $uploaded['file']->getClientOriginalName()]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$changed++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $changed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete files from association
|
* Delete files from association
|
||||||
*
|
*
|
||||||
* @param $revisionId
|
* @param Content $page
|
||||||
*
|
* @param $assignedFiles
|
||||||
* @return int
|
|
||||||
*/
|
*/
|
||||||
private function removeRelatedFiles($revisionId, $assignedFiles)
|
private function removeRelatedFiles(Content $page, $assignedFiles)
|
||||||
{
|
{
|
||||||
$allFiles = $this->files()
|
$allFiles = $page->files()
|
||||||
->whereNotIn('id', array_keys($assignedFiles))
|
->whereNotIn('id', array_keys($assignedFiles))
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
foreach ($allFiles as $file) {
|
foreach ($allFiles as $file) {
|
||||||
ContentHasFile::where('content_id', $this->id)
|
ContentHasFile::where('content_id', $page->id)
|
||||||
->where('file_id', $file->id)
|
->where('file_id', $file->id)
|
||||||
->delete();
|
->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
return count($allFiles);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Pipeline\SavePipeline\Process;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
use App\Models\FileManager\File;
|
||||||
|
|
||||||
|
class UploadTitlePhoto implements Process {
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function handle(Content & $page, array & $input)
|
||||||
|
{
|
||||||
|
$fileModel = app(File::class);
|
||||||
|
$titlePhoto = isset($input['titlePhotoFile']) ? $input['titlePhotoFile'] : null;
|
||||||
|
|
||||||
|
// upload file - if provided
|
||||||
|
$page->titlePhoto = isset($input['existingTitlePhoto']) ? $input['existingTitlePhoto'] : null;
|
||||||
|
|
||||||
|
if (!is_null($titlePhoto)) {
|
||||||
|
$file = $fileModel->upload($titlePhoto);
|
||||||
|
|
||||||
|
$page->titlePhoto = $file ? $file['filename'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$page->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\CMS\Pipeline\SavePipeline;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Pipeline;
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\CMS\Pipeline\AbstractPipeline;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
class SavePipeline extends AbstractPipeline implements Pipeline
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* SavePipeline constructor.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->acceptedProcessInterface = Process::class;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save content page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return Content
|
||||||
|
*/
|
||||||
|
function run(Content & $page, array $input)
|
||||||
|
{
|
||||||
|
$this->runBeforeStart($page, $input);
|
||||||
|
|
||||||
|
foreach ($this->processes as $process) {
|
||||||
|
/**
|
||||||
|
* @var $run Process
|
||||||
|
*/
|
||||||
|
$run = new $process;
|
||||||
|
$run->handle($page, $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->runAfter($page, $input);
|
||||||
|
|
||||||
|
return $page;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run process as first - if specified
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*/
|
||||||
|
protected function runBeforeStart(Content $page, array $input)
|
||||||
|
{
|
||||||
|
if (!is_null($this->beforeStart)) {
|
||||||
|
app($this->beforeStart)->handle($page, $input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run some process in the end - if exists
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*/
|
||||||
|
protected function runAfter(Content $page, array $input)
|
||||||
|
{
|
||||||
|
if (!is_null($this->beforeRender)) {
|
||||||
|
app($this->beforeRender)->handle($page, $input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,11 +103,8 @@ class CreateNewContent extends Controller
|
|||||||
{
|
{
|
||||||
$module = $this->module->getOne($moduleId);
|
$module = $this->module->getOne($moduleId);
|
||||||
|
|
||||||
$titlePhoto = $request->file('titlePhoto');
|
|
||||||
$relatedFiles = $request->all()['files'];
|
|
||||||
|
|
||||||
// create new page
|
// create new page
|
||||||
Interaction::handle(NewContent::class, $request->all(), $module->handler, $titlePhoto, $relatedFiles);
|
Interaction::handle(NewContent::class, $request->all(), $module->handler);
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('content.overview')
|
->route('content.overview')
|
||||||
|
|||||||
@@ -87,9 +87,6 @@ class EditContent extends Controller
|
|||||||
$categories = $this->category->getForModule($module);
|
$categories = $this->category->getForModule($module);
|
||||||
$history = $this->history->getStructuredHistoryOf($page);
|
$history = $this->history->getStructuredHistoryOf($page);
|
||||||
|
|
||||||
// modify data for edit form according to installed template
|
|
||||||
CurrentTemplate::beforePopulatingEditForm($page);
|
|
||||||
|
|
||||||
// render view
|
// render view
|
||||||
return view('admin.content.edit', [
|
return view('admin.content.edit', [
|
||||||
'pageHeading' => $pageHeading,
|
'pageHeading' => $pageHeading,
|
||||||
@@ -132,10 +129,7 @@ class EditContent extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// edit page
|
// edit page
|
||||||
$titlePhoto = $request->file('titlePhoto');
|
Interaction::handle(EditContentInteraction::class, $request->all(), $page);
|
||||||
$relatedFiles = $request->all()['files'];
|
|
||||||
|
|
||||||
Interaction::handle(EditContentInteraction::class, $request->all(), $page, $titlePhoto, $relatedFiles);
|
|
||||||
|
|
||||||
// something was changed, inform user
|
// something was changed, inform user
|
||||||
return redirect()
|
return redirect()
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use Modules\Categories\Entities\Category;
|
|||||||
*/
|
*/
|
||||||
class Content extends Model
|
class Content extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes, ModelTraits\Content, Nullable;
|
use SoftDeletes, Nullable;
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'userId',
|
'userId',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ trait ContentHistory
|
|||||||
/**
|
/**
|
||||||
* Returns history grouped by revisions (edit_batches)
|
* Returns history grouped by revisions (edit_batches)
|
||||||
*
|
*
|
||||||
* @param Content $content
|
* @param ContentModel $content
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,9 +13,13 @@ use App\CMS\Handlers\Search\Content;
|
|||||||
use App\CMS\Handlers\Search\Files;
|
use App\CMS\Handlers\Search\Files;
|
||||||
use App\CMS\Handlers\Search\Presenters\AdminContent as AdminContentPresenter;
|
use App\CMS\Handlers\Search\Presenters\AdminContent as AdminContentPresenter;
|
||||||
use App\CMS\Handlers\Search\Presenters\AdminFiles;
|
use App\CMS\Handlers\Search\Presenters\AdminFiles;
|
||||||
use App\CMS\Pipeline\DisplayPipeline;
|
use App\CMS\Pipeline\DisplayPipeline\DisplayPipeline;
|
||||||
use App\CMS\Pipeline\Process\AddViewedToPage;
|
use App\CMS\Pipeline\DisplayPipeline\Process\AddViewedToPage;
|
||||||
use App\CMS\Pipeline\Process\CompileShortcodes;
|
use App\CMS\Pipeline\DisplayPipeline\Process\CompileShortcodes;
|
||||||
|
use App\CMS\Pipeline\SavePipeline\Process\SaveCommonFields;
|
||||||
|
use App\CMS\Pipeline\SavePipeline\Process\UploadRelatedFiles;
|
||||||
|
use App\CMS\Pipeline\SavePipeline\Process\UploadTitlePhoto;
|
||||||
|
use App\CMS\Pipeline\SavePipeline\SavePipeline;
|
||||||
use App\CMS\Repositories\Content\Content as ContentRepository;
|
use App\CMS\Repositories\Content\Content as ContentRepository;
|
||||||
use App\CMS\Repositories\Module as ModuleRepository;
|
use App\CMS\Repositories\Module as ModuleRepository;
|
||||||
use App\CMS\Repositories\Templates\Template as TemplateRepository;
|
use App\CMS\Repositories\Templates\Template as TemplateRepository;
|
||||||
@@ -45,6 +49,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$this->registerSettings();
|
$this->registerSettings();
|
||||||
$this->registerSearch();
|
$this->registerSearch();
|
||||||
$this->registerDisplayPipeline();
|
$this->registerDisplayPipeline();
|
||||||
|
$this->registerSavePipeline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +78,11 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
return new DisplayPipeline();
|
return new DisplayPipeline();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// create singleton for display pipeline - pipeline used for displaying visitor pages
|
||||||
|
$this->app->singleton('saveContentPipeline', function ($app) {
|
||||||
|
return new SavePipeline();
|
||||||
|
});
|
||||||
|
|
||||||
// create registrator for template directories
|
// create registrator for template directories
|
||||||
$this->app->singleton('registerTemplateDir', function ($app) {
|
$this->app->singleton('registerTemplateDir', function ($app) {
|
||||||
return new TemplateRegistrator($app);
|
return new TemplateRegistrator($app);
|
||||||
@@ -132,4 +142,13 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$registrator->add(AddViewedToPage::class);
|
$registrator->add(AddViewedToPage::class);
|
||||||
$registrator->add(CompileShortcodes::class);
|
$registrator->add(CompileShortcodes::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function registerSavePipeline()
|
||||||
|
{
|
||||||
|
$pipeline = $this->app->make('saveContentPipeline');
|
||||||
|
|
||||||
|
$pipeline->add(SaveCommonFields::class);
|
||||||
|
$pipeline->add(UploadTitlePhoto::class);
|
||||||
|
$pipeline->add(UploadRelatedFiles::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,41 +30,6 @@ class Article extends Handler implements ContentTitles, AdvancedContentModifier,
|
|||||||
return self::getExtendedFormInputsCreate();
|
return self::getExtendedFormInputsCreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save module-specific values into database
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param Request $request
|
|
||||||
*
|
|
||||||
* @return mixed|void
|
|
||||||
*/
|
|
||||||
public static function createNew(Content &$content, array $inputData)
|
|
||||||
{
|
|
||||||
$content->moduleSettings = ['allowComments' => (int)isset($inputData['allowComments'])];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used for editing existing content page.
|
|
||||||
*
|
|
||||||
* Reason why it is separated from createNew() method is simple - we need to save history of changes.
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param Request $request
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public static function edit(Content $content, $request)
|
|
||||||
{
|
|
||||||
$settings = $content->moduleSettings;
|
|
||||||
if (!is_object($settings))
|
|
||||||
$settings = new \stdClass();
|
|
||||||
|
|
||||||
$settings->allowComments = isset($request['allowComments']) ? (int)$request['allowComments'] : 0;
|
|
||||||
|
|
||||||
$content->moduleSettings = $settings;
|
|
||||||
$content->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register admin menu
|
* Register admin menu
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class LoadCommentsForBlogpost implements Process
|
|||||||
*/
|
*/
|
||||||
function handle(Content & $content)
|
function handle(Content & $content)
|
||||||
{
|
{
|
||||||
if ($content->handler != Article::class)
|
if ($content->moduleHandler != Article::class)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$content->comments = new Collection();
|
$content->comments = new Collection();
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
namespace Modules\Blog\Article\Pipeline\SaveContent;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
use Modules\Blog\Article\Handlers\Article;
|
||||||
|
|
||||||
|
class TurnCommentsOnOrOff implements Process
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $content
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function handle(Content & $content, array & $input)
|
||||||
|
{
|
||||||
|
if ($content->moduleHandler !== Article::class) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$settings = $content->moduleSettings;
|
||||||
|
$settings['allowComments'] = isset($input['allowComments']) ? (int)$input['allowComments'] : 0;
|
||||||
|
$content->moduleSettings = $settings;
|
||||||
|
$content->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Providers\ModuleServiceProvider;
|
use App\Providers\ModuleServiceProvider;
|
||||||
use Modules\Blog\Article\Pipeline\DisplayContent\LoadCommentsForBlogpost;
|
use Modules\Blog\Article\Pipeline\DisplayContent\LoadCommentsForBlogpost;
|
||||||
|
use Modules\Blog\Article\Pipeline\SaveContent\TurnCommentsOnOrOff;
|
||||||
|
|
||||||
class ArticleServiceProvider extends ModuleServiceProvider
|
class ArticleServiceProvider extends ModuleServiceProvider
|
||||||
{
|
{
|
||||||
@@ -17,8 +18,9 @@ class ArticleServiceProvider extends ModuleServiceProvider
|
|||||||
$this->app->register(ArticleEventServiceProvider::class);
|
$this->app->register(ArticleEventServiceProvider::class);
|
||||||
|
|
||||||
// load comments for blogpost
|
// load comments for blogpost
|
||||||
$pipeline = app('displayPipeline');
|
app('displayPipeline')->add(LoadCommentsForBlogpost::class);
|
||||||
$pipeline->add(LoadCommentsForBlogpost::class);
|
|
||||||
|
app('saveContentPipeline')->add(TurnCommentsOnOrOff::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setModuleAlias()
|
protected function setModuleAlias()
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class LoadArticlesForList implements Process
|
|||||||
function handle(Content & $page)
|
function handle(Content & $page)
|
||||||
{
|
{
|
||||||
// load articles only for article list
|
// load articles only for article list
|
||||||
if ($page->handler != ArticleList::class)
|
if ($page->moduleHandler != ArticleList::class)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$articles = ArticleModel::where('moduleHandler', Article::class)
|
$articles = ArticleModel::where('moduleHandler', Article::class)
|
||||||
|
|||||||
@@ -16,47 +16,6 @@ class ContactForm extends Handler implements ContentTitles, AdvancedContentModif
|
|||||||
return ContactFormHistory::class;
|
return ContactFormHistory::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save module-specific values into database
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param array $inputData
|
|
||||||
*
|
|
||||||
* @return mixed|void
|
|
||||||
*/
|
|
||||||
public static function createNew(Content &$content, array $inputData)
|
|
||||||
{
|
|
||||||
$settings = [
|
|
||||||
'phone' => $inputData['phone'],
|
|
||||||
'email' => $inputData['email'],
|
|
||||||
'contactEmail' => $inputData['contactEmail'],
|
|
||||||
'subject' => $inputData['subject'],
|
|
||||||
'companyName' => $inputData['companyName'],
|
|
||||||
'address' => $inputData['address'],
|
|
||||||
'gpsLat' => $inputData['gpsLat'],
|
|
||||||
'gpsLng' => $inputData['gpsLng'],
|
|
||||||
];
|
|
||||||
|
|
||||||
// save settings
|
|
||||||
$content->moduleSettings = $settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method used for editing existing content page.
|
|
||||||
*
|
|
||||||
* Reason why it is separated from createNew() method is simple - we need to save history of changes.
|
|
||||||
*
|
|
||||||
* @param Content $content
|
|
||||||
* @param $request
|
|
||||||
*
|
|
||||||
* @return mixed|void
|
|
||||||
*/
|
|
||||||
public static function edit(Content $content, $request)
|
|
||||||
{
|
|
||||||
self::createNew($content, $request);
|
|
||||||
$content->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getModuleId()
|
public static function getModuleId()
|
||||||
{
|
{
|
||||||
$handler = config('contactform.handler');
|
$handler = config('contactform.handler');
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
namespace Modules\ContactForm\Pipeline\SavePipeline;
|
||||||
|
|
||||||
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||||
|
use App\Models\Content\Content;
|
||||||
|
|
||||||
|
class SaveContactInformation implements Process
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Process and modify given page
|
||||||
|
*
|
||||||
|
* @param Content $page
|
||||||
|
* @param array $input
|
||||||
|
*
|
||||||
|
* @return void>
|
||||||
|
*/
|
||||||
|
function handle(Content & $page, array & $input)
|
||||||
|
{
|
||||||
|
|
||||||
|
$settings = [
|
||||||
|
'phone' => $input['phone'],
|
||||||
|
'email' => $input['email'],
|
||||||
|
'contactEmail' => $input['contactEmail'],
|
||||||
|
'subject' => $input['subject'],
|
||||||
|
'companyName' => $input['companyName'],
|
||||||
|
'address' => $input['address'],
|
||||||
|
'gpsLat' => $input['gpsLat'],
|
||||||
|
'gpsLng' => $input['gpsLng'],
|
||||||
|
];
|
||||||
|
|
||||||
|
// save settings
|
||||||
|
$page->moduleSettings = $settings;
|
||||||
|
$page->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use App\Providers\ModuleServiceProvider;
|
use App\Providers\ModuleServiceProvider;
|
||||||
use Modules\ContactForm\Handlers\ContactForm;
|
use Modules\ContactForm\Handlers\ContactForm;
|
||||||
|
use Modules\ContactForm\Pipeline\SavePipeline\SaveContactInformation;
|
||||||
use Modules\ContactForm\Widgets\Address\Address;
|
use Modules\ContactForm\Widgets\Address\Address;
|
||||||
use Modules\ContactForm\Widgets\Form\Form;
|
use Modules\ContactForm\Widgets\Form\Form;
|
||||||
|
|
||||||
@@ -16,6 +17,8 @@ class ContactFormServiceProvider extends ModuleServiceProvider
|
|||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
$this->registerWidgets();
|
$this->registerWidgets();
|
||||||
|
|
||||||
|
app('saveContentPipeline')->add(SaveContactInformation::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -77,26 +77,26 @@
|
|||||||
@lang('contactform::admin/content.email')
|
@lang('contactform::admin/content.email')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="email" name="email" value="{{$page->moduleSettings->email or ""}}" />
|
<input class="form-control" type="email" name="email" value="{{$page->moduleSettings['email'] or ''}}" />
|
||||||
|
|
||||||
<label class="label-control">
|
<label class="label-control">
|
||||||
@lang('contactform::admin/content.phone')
|
@lang('contactform::admin/content.phone')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="tel" name="phone" value="{{$page->moduleSettings->phone or ""}}" />
|
<input class="form-control" type="tel" name="phone" value="{{$page->moduleSettings['phone'] or ''}}" />
|
||||||
|
|
||||||
<label class="label-control">
|
<label class="label-control">
|
||||||
@lang('contactform::admin/content.compName')
|
@lang('contactform::admin/content.compName')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="text" name="companyName"
|
<input class="form-control" type="text" name="companyName"
|
||||||
value="{{$page->moduleSettings->companyName or ""}}" />
|
value="{{$page->moduleSettings['companyName'] or ''}}" />
|
||||||
|
|
||||||
<label class="label-control">
|
<label class="label-control">
|
||||||
@lang('contactform::admin/content.address')
|
@lang('contactform::admin/content.address')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<textarea rows="3" class="form-control" name="address">{{$page->moduleSettings->address or ""}}</textarea>
|
<textarea rows="3" class="form-control" name="address">{{$page->moduleSettings['address'] or ''}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column col-lg-6">
|
<div class="column col-lg-6">
|
||||||
@@ -105,14 +105,14 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="email" name="contactEmail"
|
<input class="form-control" type="email" name="contactEmail"
|
||||||
value="{{$page->moduleSettings->contactEmail or \Auth::user()->email}}" />
|
value="{{$page->moduleSettings['contactEmail'] or \Auth::user()->email}}" />
|
||||||
|
|
||||||
<label class="label-control">
|
<label class="label-control">
|
||||||
@lang('contactform::admin/content.subject')
|
@lang('contactform::admin/content.subject')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="text" name="subject"
|
<input class="form-control" type="text" name="subject"
|
||||||
value="{{$page->moduleSettings->subject or trans('contactform::admin/content.defaultSubject')}}" />
|
value="{{$page->moduleSettings['subject'] or trans('contactform::admin/content.defaultSubject')}}" />
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="column col-lg-6">
|
<div class="column col-lg-6">
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
@lang('contactform::admin/content.gpsLat')
|
@lang('contactform::admin/content.gpsLat')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="text" value="{{$page->moduleSettings->gpsLat or ""}}"
|
<input class="form-control" type="text" value="{{$page->moduleSettings['gpsLat'] or ''}}"
|
||||||
name="gpsLat" />
|
name="gpsLat" />
|
||||||
</div>
|
</div>
|
||||||
<div class="column col-lg-6">
|
<div class="column col-lg-6">
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
@lang('contactform::admin/content.gpsLng')
|
@lang('contactform::admin/content.gpsLng')
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input class="form-control" type="text" value="{{$page->moduleSettings->gpsLng or ""}}"
|
<input class="form-control" type="text" value="{{$page->moduleSettings['gpsLng'] or ''}}"
|
||||||
name="gpsLng" />
|
name="gpsLng" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
<label class="control-label">
|
<label class="control-label">
|
||||||
@lang('admin/contents.uploadTitleImage')
|
@lang('admin/contents.uploadTitleImage')
|
||||||
</label>
|
</label>
|
||||||
<input type="file" id="titlePhoto" accept=".jpg,.jpeg,.png" name="titlePhoto" class="form-control" />
|
<input type="file" id="titlePhotoFile" accept=".jpg,.jpeg,.png" name="titlePhotoFile" class="form-control" />
|
||||||
|
|
||||||
@include('admin.snippets.hasError', ['field' => 'titlePhoto'])
|
@include('admin.snippets.hasError', ['field' => 'titlePhotoFile'])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user