Skip to content
This repository has been archived by the owner on Dec 4, 2019. It is now read-only.

Commit

Permalink
Move topic reply page to action class.
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Jul 1, 2014
1 parent c9138da commit 4199151
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
23 changes: 23 additions & 0 deletions src/FluxBB/Actions/ReplyPage.php
@@ -0,0 +1,23 @@
<?php

namespace FluxBB\Actions;

use Symfony\Component\HttpFoundation\Request;
use FluxBB\Models\Topic;

class ReplyPage extends Page
{
protected $viewName = 'fluxbb::posting.post';


protected function handleRequest(Request $request)
{
$tid = \Route::input('id');

// Fetch some info about the topic
$topic = Topic::with('forum.perms')->findOrFail($tid);

$this->data['topic'] = $topic;
$this->data['action'] = trans('fluxbb::post.post_a_reply');
}
}
15 changes: 0 additions & 15 deletions src/FluxBB/Controllers/PostingController.php
Expand Up @@ -17,21 +17,6 @@

class PostingController extends BaseController
{
public function getReply($tid)
{
$topic = Topic::with('forum.perms')
->where('id', '=', $tid)
->first();

if (is_null($topic)) {
App::abort(404);
}

return View::make('fluxbb::posting.post')
->with('topic', $topic)
->with('action', trans('fluxbb::post.post_a_reply'));
}

public function getTopic($fid)
{
$forum = Forum::with('perms')
Expand Down
5 changes: 1 addition & 4 deletions src/routes.php
Expand Up @@ -44,10 +44,7 @@
'as' => 'post_quote',
'uses' => 'FluxBB\Controllers\PostingController@getQuote',
));
Route::get('topic/{id}/reply', array(
'as' => 'reply',
'uses' => 'FluxBB\Controllers\PostingController@getReply',
));
Route::get('topic/{id}/reply', array('as' => 'reply', 'uses' => $actionRoute('FluxBB\Actions\ReplyPage')));
Route::post('topic/{id}/reply', $actionRoute('FluxBB\Actions\Reply'));
Route::get('forum/{id}/topic/new', array(
'as' => 'new_topic',
Expand Down

0 comments on commit 4199151

Please sign in to comment.