FEATURE: add widget with address block
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace Modules\ContactForm\Widgets\Address;
|
||||
|
||||
use App\Models\Widget;
|
||||
use App\Widgets\Contracts\WidgetRenderer;
|
||||
use App\Widgets\NonInstallableWidget;
|
||||
|
||||
class Address extends NonInstallableWidget
|
||||
{
|
||||
/**
|
||||
* Name getter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return 'contactform::admin/widgets.address.name';
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getDescription()
|
||||
{
|
||||
return 'contactform::admin/widgets.address.description';
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for presenter/renderer of this widget
|
||||
*
|
||||
* @return WidgetRenderer
|
||||
*/
|
||||
public static function getPresenter()
|
||||
{
|
||||
return Presenter::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Widget $widget
|
||||
* @param \stdClass $data
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function save(Widget $widget, \stdClass $data)
|
||||
{
|
||||
$widget->settings = json_encode(['contactFormId' => $data->contactFormId,]);
|
||||
|
||||
return $widget;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user