58 lines
1.5 KiB
PHP
58 lines
1.5 KiB
PHP
<?php
|
|
namespace App\CMS\Widgets\SocialButtons\Presenters;
|
|
|
|
use App\Models\Widgets\Widget;
|
|
use App\Models\Widgets\WidgetType;
|
|
use App\Models\Settings as SettingsModel;
|
|
use App\CMS\Contracts\Widgets\WidgetRenderer;
|
|
use App\CMS\Widgets\SocialButtons\Presenters\Route;
|
|
use Illuminate\Http\Request;
|
|
use Modules\Blog\Article\Entities\Article as ArticleModel;
|
|
use Modules\Blog\Article\Handlers\Article;
|
|
|
|
class SocialButtons implements WidgetRenderer
|
|
{
|
|
/**
|
|
* Method used for displaying widget.
|
|
*
|
|
* This method renders some HTML code for displaying.
|
|
*
|
|
* @param Widget $widget
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public static function render(Widget $widget)
|
|
{
|
|
return view('visitor.widgets.shareButtons.all', compact('widget'));
|
|
}
|
|
|
|
/**
|
|
* Display form for creating new instance of widget
|
|
*
|
|
* @param WidgetType $type
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public static function renderAddForm(WidgetType $type)
|
|
{
|
|
return view('admin.widgets.socialButtons.new', [
|
|
'type' => $type,
|
|
'widget' => new Widget(),
|
|
'settings' => new \stdClass()
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Display form for editing already existing widget
|
|
*
|
|
* @param Widget $widget
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public static function renderEditForm(Widget $widget)
|
|
{
|
|
$settings = $widget->settings;
|
|
return view('admin.widgets.socialButtons.edit', ['widget' => $widget, 'settings' => $settings]);
|
|
}
|
|
}
|