Merge branch 'dev' into module_profiler
This commit is contained in:
@@ -16,28 +16,6 @@ use Modules\Blog\Article\Entities\Comment;
|
||||
|
||||
class Article extends Handler implements ContentTitles, AdvancedContentModifier, InstallableModule
|
||||
{
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$content->comments = new Collection();
|
||||
if (isset($content->moduleSettings['allowComments']) && $content->moduleSettings['allowComments']) {
|
||||
$content->comments = Comment::where('content_id', $content->id)
|
||||
->with('author')
|
||||
->where('approved', 1)
|
||||
->orderBy('created_at')
|
||||
->get();
|
||||
}
|
||||
|
||||
return Controller::VisitorsView($content->template, ['page' => $content, 'extra' => $parameters]);
|
||||
}
|
||||
|
||||
public static function getExtendedFormInputsCreate()
|
||||
{
|
||||
$sections = parent::getExtendedFormInputsCreate();
|
||||
@@ -52,41 +30,6 @@ class Article extends Handler implements ContentTitles, AdvancedContentModifier,
|
||||
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
|
||||
*
|
||||
@@ -198,17 +141,6 @@ class Article extends Handler implements ContentTitles, AdvancedContentModifier,
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Load some extra data for content management form?
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function loadExtraData(Content $content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this module support categories?
|
||||
*
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace Modules\Blog\Article\Pipeline\DisplayContent;
|
||||
|
||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||
use App\Models\Content\Content;
|
||||
use Illuminate\Support\Collection;
|
||||
use Modules\Blog\Article\Entities\Comment;
|
||||
use Modules\Blog\Article\Handlers\Article;
|
||||
|
||||
class LoadCommentsForBlogpost implements Process
|
||||
{
|
||||
/**
|
||||
* Process and modify given page
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function handle(Content & $content)
|
||||
{
|
||||
if ($content->moduleHandler != Article::class)
|
||||
return;
|
||||
|
||||
$content->comments = new Collection();
|
||||
if (isset($content->moduleSettings['allowComments']) && $content->moduleSettings['allowComments']) {
|
||||
$content->comments = Comment::where('content_id', $content->id)
|
||||
->with('author')
|
||||
->where('approved', 1)
|
||||
->orderBy('created_at')
|
||||
->get();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 (trim($content->moduleHandler, '\\') !== Article::class) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = $content->moduleSettings;
|
||||
$settings['allowComments'] = isset($input['allowComments']) ? (int)$input['allowComments'] : 0;
|
||||
$content->moduleSettings = $settings;
|
||||
$content->save();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php namespace Modules\Blog\Article\Providers;
|
||||
|
||||
use App\Providers\ModuleServiceProvider;
|
||||
use Modules\Blog\Article\Pipeline\DisplayContent\LoadCommentsForBlogpost;
|
||||
use Modules\Blog\Article\Pipeline\SaveContent\TurnCommentsOnOrOff;
|
||||
|
||||
class ArticleServiceProvider extends ModuleServiceProvider
|
||||
{
|
||||
@@ -14,6 +16,11 @@ class ArticleServiceProvider extends ModuleServiceProvider
|
||||
parent::boot();
|
||||
|
||||
$this->app->register(ArticleEventServiceProvider::class);
|
||||
|
||||
// load comments for blogpost
|
||||
app('displayPipeline')->add(LoadCommentsForBlogpost::class);
|
||||
|
||||
app('saveContentPipeline')->add(TurnCommentsOnOrOff::class);
|
||||
}
|
||||
|
||||
protected function setModuleAlias()
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<div class="card-header">
|
||||
<div class="header-block">
|
||||
<p class="title">
|
||||
<img src="@gravatar($comment->author->email, 25)" class="img-rounded" alt="">
|
||||
{{$comment->author->name}} ({{$comment->author->email}})
|
||||
<img src="@gravatar($comment->email, 25)" class="img-rounded" alt="">
|
||||
{{$comment->name}} ({{$comment->email}})
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -21,12 +21,12 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
@lang('article::comments.createdAt', ['date' => \App\CMS\Helpers\Template::date($comment->created_at)])
|
||||
@lang('article::comments.createdAt', ['date' => \App\CMS\Helpers\Date::date($comment->created_at)])
|
||||
|
|
||||
|
||||
@lang('article::comments.commentedArticle'):
|
||||
|
||||
@if($comment->article)
|
||||
@if(!is_null($comment->article))
|
||||
<a href="{{route('page.content', ['url' => $comment->article->url])}}" target="_blank">
|
||||
{{$comment->article->title}}
|
||||
</a>
|
||||
|
||||
@@ -1,18 +1,8 @@
|
||||
<?php
|
||||
namespace Modules\Blog\ArticleList\Handlers;
|
||||
|
||||
use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
use App\CMS\Handlers\Handler;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Modules\Blog\Article\Entities\Article as ArticleModel;
|
||||
use Modules\Blog\Article\Handlers\Article;
|
||||
use Modules\Categories\Entities\Category;
|
||||
|
||||
class ArticleList extends Handler
|
||||
{
|
||||
@@ -28,114 +18,7 @@ class ArticleList extends Handler
|
||||
}, 20, ['icon' => 'fa fa-fw fa-book']);
|
||||
}
|
||||
|
||||
$blogSubmenu->route('content.new', trans('articlelist::module.name'), ['id' => 'blog-articlelist'], 100, ['icon' => 'fa fa-fw fa-list-alt']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter articles on article list using archive
|
||||
*
|
||||
* @param $articles
|
||||
*/
|
||||
protected static function archive(&$articles)
|
||||
{
|
||||
$year = Input::get('y');
|
||||
$month = Input::get('m');
|
||||
$day = Input::get('d');
|
||||
|
||||
if ($year) {
|
||||
$articles = $articles->where(DB::raw('YEAR(created_at)'), $year);
|
||||
}
|
||||
|
||||
if ($month) {
|
||||
$articles = $articles->where(DB::raw('MONTH(created_at)'), $month);
|
||||
}
|
||||
|
||||
if ($day) {
|
||||
$articles = $articles->where(DB::raw('DAY(created_at)'), $day);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter article list to some specified category
|
||||
*
|
||||
* Category URL is specified as GET attribute "category"
|
||||
*
|
||||
* @param $articles
|
||||
*/
|
||||
protected static function category(&$articles)
|
||||
{
|
||||
$categoryUrl = Input::get('category');
|
||||
|
||||
$categoriesEnabled = \Module::get('Categories')
|
||||
->enabled();
|
||||
|
||||
if ($categoryUrl && $categoriesEnabled) {
|
||||
$category = Category::where('url', $categoryUrl)
|
||||
->firstOrFail();
|
||||
|
||||
$subcategories = $category->getChildren()
|
||||
->toArray();
|
||||
|
||||
$categories = [$category->id];
|
||||
$categories = array_merge($categories, array_map(function ($cat) {
|
||||
return $cat['id'];
|
||||
}, $subcategories));
|
||||
|
||||
$articles = $articles->whereIn('category_id', $categories);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$articles = ArticleModel::where('moduleHandler', Article::class)
|
||||
->with('comments')
|
||||
->with('category')
|
||||
->where(function ($query) {
|
||||
$query->where('publishedFrom', '<', Carbon::now())
|
||||
->orWhereNull('publishedFrom');
|
||||
})
|
||||
->where(function ($query) {
|
||||
$query->where('publishedTo', '>', Carbon::now())
|
||||
->orWhereNull('publishedTo');
|
||||
})
|
||||
->orderBy('publishedFrom', 'DESC')
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
// show articles for not-logged users of even for logged onew?
|
||||
$articles = !Auth::user() ? $articles->where('status', IContent::STATUS_PUBLIC) : $articles->whereIn('status', [
|
||||
IContent::STATUS_PUBLIC,
|
||||
IContent::STATUS_PROTECTED
|
||||
]);
|
||||
|
||||
// selected articles from archive?
|
||||
self::archive($articles);
|
||||
|
||||
// is given any category?
|
||||
self::category($articles);
|
||||
|
||||
// show articles only from specified user
|
||||
$author = Input::get('author');
|
||||
if ($author) {
|
||||
$user = User::findOrFail($author);
|
||||
|
||||
$articles = $articles->where('user_id', $user->id);
|
||||
}
|
||||
|
||||
$articles = $articles->paginate(setting('articlesPerPage', 20));
|
||||
|
||||
return Controller::VisitorsView($content->template, [
|
||||
'page' => $content,
|
||||
'articles' => $articles,
|
||||
'extra' => $parameters
|
||||
]);
|
||||
$blogSubmenu->route('content.new', trans('articlelist::module.name'), ['id' => config('articlelist.alias')], 100, ['icon' => 'fa fa-fw fa-list-alt']);
|
||||
}
|
||||
|
||||
public static function supportCategories()
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
namespace Modules\Blog\ArticleList\Pipeline\DisplayContent;
|
||||
|
||||
use App\CMS\Contracts\Content\DisplayPipeline\Process;
|
||||
use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Modules\Blog\Article\Entities\Article as ArticleModel;
|
||||
use Modules\Blog\Article\Handlers\Article;
|
||||
use Modules\Blog\ArticleList\Handlers\ArticleList;
|
||||
|
||||
class LoadArticlesForList implements Process
|
||||
{
|
||||
/**
|
||||
* Process and modify given page
|
||||
*
|
||||
* @param Content $page
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function handle(Content & $page)
|
||||
{
|
||||
// load articles only for article list
|
||||
if ($page->moduleHandler != ArticleList::class)
|
||||
return;
|
||||
|
||||
$articles = ArticleModel::where('moduleHandler', Article::class)
|
||||
->with('comments')
|
||||
->with('category')
|
||||
->where(function ($query) {
|
||||
$query->where('publishedFrom', '<', Carbon::now())
|
||||
->orWhereNull('publishedFrom');
|
||||
})
|
||||
->where(function ($query) {
|
||||
$query->where('publishedTo', '>', Carbon::now())
|
||||
->orWhereNull('publishedTo');
|
||||
})
|
||||
->orderBy('publishedFrom', 'DESC')
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
// show articles for not-logged users of even for logged onew?
|
||||
$articles = !Auth::user() ? $articles->where('status', IContent::STATUS_PUBLIC) : $articles->whereIn('status', [
|
||||
IContent::STATUS_PUBLIC,
|
||||
IContent::STATUS_PROTECTED
|
||||
]);
|
||||
|
||||
// selected articles from archive?
|
||||
$this->archive($articles);
|
||||
|
||||
// is given any category?
|
||||
$this->category($articles);
|
||||
|
||||
// show articles only from specified user
|
||||
$author = Input::get('author');
|
||||
if ($author) {
|
||||
$user = User::findOrFail($author);
|
||||
|
||||
$articles = $articles->where('user_id', $user->id);
|
||||
}
|
||||
|
||||
$page->articles = $articles->paginate(setting('articlesPerPage', 20));
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter articles on article list using archive
|
||||
*
|
||||
* @param $articles
|
||||
*/
|
||||
protected function archive(&$articles)
|
||||
{
|
||||
$year = Input::get('y');
|
||||
$month = Input::get('m');
|
||||
$day = Input::get('d');
|
||||
|
||||
if ($year) {
|
||||
$articles = $articles->where(DB::raw('YEAR(created_at)'), $year);
|
||||
}
|
||||
|
||||
if ($month) {
|
||||
$articles = $articles->where(DB::raw('MONTH(created_at)'), $month);
|
||||
}
|
||||
|
||||
if ($day) {
|
||||
$articles = $articles->where(DB::raw('DAY(created_at)'), $day);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter article list to some specified category
|
||||
*
|
||||
* Category URL is specified as GET attribute "category"
|
||||
*
|
||||
* @param $articles
|
||||
*/
|
||||
protected function category(&$articles)
|
||||
{
|
||||
$categoryUrl = Input::get('category');
|
||||
|
||||
$categoriesEnabled = \Module::get('Categories')
|
||||
->enabled();
|
||||
|
||||
if ($categoryUrl && $categoriesEnabled) {
|
||||
$category = Category::where('url', $categoryUrl)
|
||||
->firstOrFail();
|
||||
|
||||
$subcategories = $category->getChildren()
|
||||
->toArray();
|
||||
|
||||
$categories = [$category->id];
|
||||
$categories = array_merge($categories, array_map(function ($cat) {
|
||||
return $cat['id'];
|
||||
}, $subcategories));
|
||||
|
||||
$articles = $articles->whereIn('category_id', $categories);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php namespace Modules\Blog\ArticleList\Providers;
|
||||
|
||||
use App\Providers\ModuleServiceProvider;
|
||||
use Modules\Blog\ArticleList\Pipeline\DisplayContent\LoadArticlesForList;
|
||||
|
||||
class ArticleListServiceProvider extends ModuleServiceProvider
|
||||
{
|
||||
@@ -13,4 +14,11 @@ class ArticleListServiceProvider extends ModuleServiceProvider
|
||||
{
|
||||
$this->path = __DIR__;
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
app('displayPipeline')->add(LoadArticlesForList::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,47 +16,6 @@ class ContactForm extends Handler implements ContentTitles, AdvancedContentModif
|
||||
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()
|
||||
{
|
||||
$handler = config('contactform.handler');
|
||||
@@ -190,15 +149,4 @@ class ContactForm extends Handler implements ContentTitles, AdvancedContentModif
|
||||
public static function delete(Content $content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Load some extra data for content management form?
|
||||
*
|
||||
* @param Content $content
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function loadExtraData(Content $content)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
namespace Modules\ContactForm\Pipeline\SavePipeline;
|
||||
|
||||
use App\CMS\Contracts\Content\SavePipeline\Process;
|
||||
use App\Models\Content\Content;
|
||||
use Modules\ContactForm\Handlers\ContactForm;
|
||||
|
||||
class SaveContactInformation implements Process
|
||||
{
|
||||
/**
|
||||
* Process and modify given page
|
||||
*
|
||||
* @param Content $page
|
||||
* @param array $input
|
||||
*
|
||||
* @return void>
|
||||
*/
|
||||
function handle(Content & $page, array & $input)
|
||||
{
|
||||
if (trim($page->moduleHandler, '\\') != ContactForm::class) {
|
||||
return;
|
||||
}
|
||||
|
||||
$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 Modules\ContactForm\Handlers\ContactForm;
|
||||
use Modules\ContactForm\Pipeline\SavePipeline\SaveContactInformation;
|
||||
use Modules\ContactForm\Widgets\Address\Address;
|
||||
use Modules\ContactForm\Widgets\Form\Form;
|
||||
|
||||
@@ -16,6 +17,8 @@ class ContactFormServiceProvider extends ModuleServiceProvider
|
||||
{
|
||||
parent::boot();
|
||||
$this->registerWidgets();
|
||||
|
||||
app('saveContentPipeline')->add(SaveContactInformation::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,26 +77,26 @@
|
||||
@lang('contactform::admin/content.email')
|
||||
</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">
|
||||
@lang('contactform::admin/content.phone')
|
||||
</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">
|
||||
@lang('contactform::admin/content.compName')
|
||||
</label>
|
||||
|
||||
<input class="form-control" type="text" name="companyName"
|
||||
value="{{$page->moduleSettings->companyName or ""}}" />
|
||||
value="{{$page->moduleSettings['companyName'] or ''}}" />
|
||||
|
||||
<label class="label-control">
|
||||
@lang('contactform::admin/content.address')
|
||||
</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 class="column col-lg-6">
|
||||
@@ -105,14 +105,14 @@
|
||||
</label>
|
||||
|
||||
<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">
|
||||
@lang('contactform::admin/content.subject')
|
||||
</label>
|
||||
|
||||
<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="column col-lg-6">
|
||||
@@ -120,7 +120,7 @@
|
||||
@lang('contactform::admin/content.gpsLat')
|
||||
</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" />
|
||||
</div>
|
||||
<div class="column col-lg-6">
|
||||
@@ -128,7 +128,7 @@
|
||||
@lang('contactform::admin/content.gpsLng')
|
||||
</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" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<p>
|
||||
<strong>Ahoj {{$data->name}}</strong>
|
||||
</p>
|
||||
{{$data->message}}
|
||||
@@ -24,15 +24,15 @@ class Presenter implements WidgetRenderer
|
||||
if (!$form)
|
||||
return null;
|
||||
|
||||
$formData = json_decode($form->moduleSettings);
|
||||
$formData = $form->moduleSettings;
|
||||
|
||||
$code = '<div class="address-widget ' . e($widget->container_class) . '"';
|
||||
if ($widget->container_id) {
|
||||
$code .= ' id="' . e($widget->container_id).'"';
|
||||
}
|
||||
$code .= '>';
|
||||
$code .= "<p class='name'>".e($formData->companyName).'</p>';
|
||||
$code .= nl2br($formData->address);
|
||||
$code .= "<p class='name'>".e($formData['companyName']).'</p>';
|
||||
$code .= nl2br($formData['address']);
|
||||
$code .= "</div>";
|
||||
|
||||
return $code;
|
||||
|
||||
Reference in New Issue
Block a user