diff --git a/Changelog b/Changelog index 5cf52a195..4257cf121 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-04-19 DariusIII + * Chg: Update ShowsController add show-remove option * Chg: Add PredbController * Chg: Add NzbController * Chg: Add MusicController diff --git a/app/Http/Controllers/Admin/ShowsController.php b/app/Http/Controllers/Admin/ShowsController.php index 3a84ca7d4..4ba061a9b 100644 --- a/app/Http/Controllers/Admin/ShowsController.php +++ b/app/Http/Controllers/Admin/ShowsController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use App\Models\Release; use App\Models\Video; use Illuminate\Http\Request; use Blacklight\processing\tv\TV; @@ -77,4 +78,33 @@ class ShowsController extends BasePageController ); $this->adminrender(); } + + /** + * @param $id + * + * @throws \Exception + */ + public function destroy($id) + { + $this->setAdminPrefs(); + + $success = false; + + if ($id) { + $success = Release::removeVideoIdFromReleases($id); + $this->smarty->assign('videoid', $id); + } + + $this->smarty->assign('success', $success); + + $title = 'Remove Video and Episode IDs from Releases'; + $content = $this->smarty->fetch('show-remove.tpl'); + $this->smarty->assign( + [ + 'title' => $title, + 'content' => $content, + ] + ); + $this->adminrender(); + } } diff --git a/public/oldadmin/predb.php b/public/oldadmin/predb.php deleted file mode 100644 index a92c1c333..000000000 --- a/public/oldadmin/predb.php +++ /dev/null @@ -1,37 +0,0 @@ -setAdminPrefs(); - -$offset = (request()->has('offset') && ctype_digit(request()->input('offset'))) ? request()->input('offset') : 0; - -if (request()->has('presearch')) { - $lastSearch = request()->input('presearch'); - $parr = Predb::getAll($offset, config('nntmux.items_per_page'), request()->input('presearch')); -} else { - $lastSearch = ''; - $parr = Predb::getAll($offset, config('nntmux.items_per_page')); -} - -$page->smarty->assign('pagertotalitems', $parr['count']); -$page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page')); -$page->smarty->assign('pagerquerybase', WWW_TOP.'/predb.php?offset='); -$page->smarty->assign('pagerquerysuffix', '#results'); -$page->smarty->assign('lastSearch', $lastSearch); - -$page->smarty->assign('pager', $page->smarty->fetch('pager.tpl')); -$page->smarty->assign('results', $parr['arr']); - -$page->title = 'Browse PreDb'; -$page->meta_title = 'View PreDb info'; -$page->meta_keywords = 'view,predb,info,description,details'; -$page->meta_description = 'View PreDb info'; - -$page->content = $page->smarty->fetch('predb.tpl'); -$page->adminrender(); diff --git a/public/oldadmin/show-remove.php b/public/oldadmin/show-remove.php deleted file mode 100755 index b458f0019..000000000 --- a/public/oldadmin/show-remove.php +++ /dev/null @@ -1,22 +0,0 @@ -setAdminPrefs(); - -$success = false; - -if (request()->has('id')) { - $success = Release::removeVideoIdFromReleases(request()->input('id')); - $page->smarty->assign('videoid', request()->input('id')); -} - -$page->smarty->assign('success', $success); - -$page->title = 'Remove Video and Episode IDs from Releases'; -$page->content = $page->smarty->fetch('show-remove.tpl'); -$page->adminrender(); diff --git a/routes/web.php b/routes/web.php index c89be436a..7ec6f3736 100644 --- a/routes/web.php +++ b/routes/web.php @@ -282,6 +282,8 @@ Route::middleware('admin')->prefix('admin')->group(function () { Route::post('show-list', 'ShowsController@index'); Route::get('show-edit', 'ShowsController@edit'); Route::post('show-edit', 'ShowsController@edit'); + Route::get('show-remove', 'ShowsController@destroy'); + Route::post('show-remove', 'ShowsController@destroy'); Route::get('comments-list', 'CommentsController@index'); Route::post('comments-list', 'CommentsController@index'); Route::get('comments-delete/{id}', 'CommentsController@destroy');