|
|
@ -164,6 +164,7 @@ class MainController extends Controller |
|
|
|
{ |
|
|
|
case 'deletetopic': |
|
|
|
case 'locktopic': |
|
|
|
case 'sticktopic': |
|
|
|
case 'movetopic': |
|
|
|
$t = $this->getModel('PostsModel')->getTopic($_GET['id']); |
|
|
|
|
|
|
@ -232,6 +233,19 @@ class MainController extends Controller |
|
|
|
} |
|
|
|
$lockv = true; |
|
|
|
break; |
|
|
|
case 'sticktopic': |
|
|
|
if ($t['topic_sticky'] == false) |
|
|
|
{ |
|
|
|
$this->getModel('PostsModel')->stickTopic($_GET['id']); |
|
|
|
$this->getView('MainView')->forum_message('Topic sticked. Redirecting...', buildURL('index.php?mode=viewtopic&id='.$_GET['id'])); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
$this->getModel('PostsModel')->stickTopic($_GET['id'], false); |
|
|
|
$this->getView('MainView')->forum_message('Topic unsticked. Redirecting...', buildURL('index.php?mode=viewtopic&id='.$_GET['id'])); |
|
|
|
} |
|
|
|
$lockv = true; |
|
|
|
break; |
|
|
|
case 'movetopic': |
|
|
|
if ($this->getModel('ForumsModel')->getForum($_POST['forum_id']) == null) |
|
|
|
$this->getView('MainView')->forum_message('Forum does not exist!', buildURL('index.php?mode=viewtopic&id='.$_GET['id'])); |
|
|
@ -251,6 +265,7 @@ class MainController extends Controller |
|
|
|
{ |
|
|
|
case 'deletetopic': |
|
|
|
case 'locktopic': |
|
|
|
case 'sticktopic': |
|
|
|
case 'movetopic': |
|
|
|
$this->forward(buildURL('index.php?mode=viewtopic&id='.$_GET['id'])); |
|
|
|
break; |
|
|
@ -276,6 +291,12 @@ class MainController extends Controller |
|
|
|
else |
|
|
|
$this->getView('MainView')->confirm_action('Do you want unlock topic <span style="font-weight: bold">#'.$_GET['id'].'</span>?'); |
|
|
|
break; |
|
|
|
case 'sticktopic': |
|
|
|
if ($t['topic_sticky'] == false) |
|
|
|
$this->getView('MainView')->confirm_action('Do you want stick topic <span style="font-weight: bold">#'.$_GET['id'].'</span>?'); |
|
|
|
else |
|
|
|
$this->getView('MainView')->confirm_action('Do you want unstick topic <span style="font-weight: bold">#'.$_GET['id'].'</span>?'); |
|
|
|
break; |
|
|
|
case 'movetopic': |
|
|
|
$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel')); |
|
|
|
$this->getView('MainView')->move_topic(); |
|
|
|