FIX: lots of bugfixes, sorry for ugly commit
This commit is contained in:
@@ -7,6 +7,7 @@ use App\CMS\Widgets\Exceptions\MissingParameterException;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Content\Content;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
|
||||
class Menu implements PublicWidget
|
||||
{
|
||||
@@ -66,10 +67,10 @@ class Menu implements PublicWidget
|
||||
|
||||
public static function selectContentPages($ids)
|
||||
{
|
||||
$allowedStatuses = [Content::STATUS_PUBLIC];
|
||||
$allowedStatuses = [IContent::STATUS_PUBLIC];
|
||||
|
||||
if (\Auth::user()) {
|
||||
$allowedStatuses[] = Content::STATUS_PROTECTED;
|
||||
$allowedStatuses[] = IContent::STATUS_PROTECTED;
|
||||
}
|
||||
|
||||
$pages = Content::where('language', LaravelLocalization::getCurrentLocale())
|
||||
|
||||
@@ -4,9 +4,9 @@ namespace App\CMS\Widgets\Menu\Presenters;
|
||||
use App\CMS\Contracts\Repositories\Content as ContentContract;
|
||||
use App\CMS\Contracts\Widgets\WidgetRenderer;
|
||||
use App\CMS\Widgets\Menu\Menu as WidgetMenu;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\Widgets\Widget;
|
||||
use App\Models\Widgets\WidgetType;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -79,24 +79,19 @@ class Menu implements WidgetRenderer
|
||||
*/
|
||||
public static function renderAddForm(WidgetType $type)
|
||||
{
|
||||
$extensions = App::make('registerMenuExtension')
|
||||
->get();
|
||||
|
||||
$widget = new Widget();
|
||||
$content = new Content();
|
||||
$content = app(ContentContract::class);
|
||||
|
||||
// get list of all pages
|
||||
$pages = $content->getOverview()
|
||||
->get();
|
||||
$pages = $content->getOverview();
|
||||
$widget->settings = new \stdClass();
|
||||
$widget->settings->links = [];
|
||||
|
||||
$widget->settingsObj = new \stdClass();
|
||||
$widget->settingsObj->links = new \stdClass();
|
||||
|
||||
return view('admin.widgets.menu.new', [
|
||||
'type' => $type,
|
||||
'widget' => $widget,
|
||||
'pages' => $pages,
|
||||
'extensions' => $extensions
|
||||
'type' => $type,
|
||||
'widget' => $widget,
|
||||
'pages' => $pages,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user