mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Fix for creating tags not setting home dashboard as default
This commit is contained in:
@@ -145,11 +145,38 @@ class ItemController extends Controller
|
|||||||
//
|
//
|
||||||
$data['tags'] = Item::ofType('tag')->orderBy('title', 'asc')->pluck('title', 'id');
|
$data['tags'] = Item::ofType('tag')->orderBy('title', 'asc')->pluck('title', 'id');
|
||||||
$data['tags']->prepend(__('app.dashboard'), 0);
|
$data['tags']->prepend(__('app.dashboard'), 0);
|
||||||
$data['current_tags'] = collect([0 => __('app.dashboard')]);
|
$data['current_tags'] = '0';
|
||||||
return view('items.create', $data);
|
return view('items.create', $data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
// Get the item
|
||||||
|
$item = Item::find($id);
|
||||||
|
if($item->appid === null && $item->class !== null) { // old apps wont have an app id so set it
|
||||||
|
$app = Application::where('class', $item->class)->first();
|
||||||
|
if($app) {
|
||||||
|
$item->appid = $app->appid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['item'] = $item;
|
||||||
|
$data['tags'] = Item::ofType('tag')->orderBy('title', 'asc')->pluck('title', 'id');
|
||||||
|
$data['tags']->prepend(__('app.dashboard'), 0);
|
||||||
|
$data['current_tags'] = $data['item']->tags();
|
||||||
|
//$data['current_tags'] = $data['item']->parent;
|
||||||
|
//die(print_r($data['current_tags']));
|
||||||
|
// show the edit form and pass the nerd
|
||||||
|
return view('items.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function storelogic($request, $id = null)
|
public function storelogic($request, $id = null)
|
||||||
{
|
{
|
||||||
$application = Application::single($request->input('appid'));
|
$application = Application::single($request->input('appid'));
|
||||||
@@ -238,31 +265,6 @@ class ItemController extends Controller
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
// Get the item
|
|
||||||
$item = Item::find($id);
|
|
||||||
if($item->appid === null && $item->class !== null) { // old apps wont have an app id so set it
|
|
||||||
$app = Application::where('class', $item->class)->first();
|
|
||||||
if($app) {
|
|
||||||
$item->appid = $app->appid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$data['item'] = $item;
|
|
||||||
$data['tags'] = Item::ofType('tag')->orderBy('title', 'asc')->pluck('title', 'id');
|
|
||||||
$data['tags']->prepend(__('app.dashboard'), 0);
|
|
||||||
$data['current_tags'] = $data['item']->tags();
|
|
||||||
//$data['current_tags'] = $data['item']->parent;
|
|
||||||
//die(print_r($data['current_tags']));
|
|
||||||
// show the edit form and pass the nerd
|
|
||||||
return view('items.edit', $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
|
|||||||
Reference in New Issue
Block a user