FEATURE: add permissions into widgets and fix few bugs
This commit is contained in:
@@ -13,7 +13,6 @@ class Search extends Controller
|
||||
{
|
||||
/**
|
||||
* Create form for searching
|
||||
*
|
||||
* @return $this|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function getSearch()
|
||||
@@ -37,7 +36,6 @@ class Search extends Controller
|
||||
|
||||
/**
|
||||
* Method used for performing search.
|
||||
*
|
||||
* This method iterates over all registered search engines and returns results for each engine apart.
|
||||
*
|
||||
* @param string $term search text
|
||||
@@ -60,10 +58,16 @@ class Search extends Controller
|
||||
// try to find given term
|
||||
$results = $search->search($term);
|
||||
|
||||
$content = $presenter->render($results);
|
||||
|
||||
if (is_null($content)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// create result object
|
||||
$resultsParts[$search->getId()] = [
|
||||
'name' => $search->getName(),
|
||||
'content' => $presenter->render($results),
|
||||
'content' => $content,
|
||||
'count' => count($results)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Widgets;
|
||||
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Models\Widgets\Widget;
|
||||
use App\Models\Widgets\WidgetType;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
|
||||
class WidgetsOverview extends Controller
|
||||
{
|
||||
/**
|
||||
* Display list of all widgets
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$widgets = Widget::where('language', LaravelLocalization::getCurrentLocale())
|
||||
->paginate(25);
|
||||
|
||||
return view('admin.widgets.overview', ['widgets' => $widgets]);
|
||||
$widgetTypes = WidgetType::all();
|
||||
|
||||
return view('admin.widgets.overview', compact('widgetTypes', 'widgets'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user