Skip to content

Commit ca5e31a

Browse files
committed
[K7.0] Replace deprecated usage of $this->get() by $model->get in
view/user and view/topic
1 parent 34f3fbe commit ca5e31a

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

src/site/src/View/Topic/HtmlView.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ class HtmlView extends KunenaView
192192
public function displayUnread($tpl = null)
193193
{
194194
// Redirect unread layout to the page that contains the first unread message
195-
$category = $this->get('Category');
196-
$topic = $this->get('Topic');
195+
$model = $this->getModel();
196+
$category = $model->getCategory();
197+
$topic = $model->getTopic();
197198
KunenaTopicHelper::fetchNewStatus([$topic->id => $topic]);
198199

199200
$message = KunenaMessage::getInstance($topic->lastread ? $topic->lastread : $topic->last_post_id);
@@ -241,9 +242,10 @@ public function displayDefault($tpl = null)
241242

242243
$this->setLayout($this->layout);
243244

244-
$this->category = $this->get('Category');
245-
$this->topic = $this->get('Topic');
246-
$this->message = $this->get('Messages');
245+
$model = $this->getModel();
246+
$this->category = $model->getCategory();
247+
$this->topic = $model->getTopic();
248+
$this->message = $model->getMessages();
247249
$channels = $this->category->getChannels();
248250

249251
$options = [];
@@ -297,8 +299,8 @@ public function displayDefault($tpl = null)
297299
return;
298300
}
299301

300-
$this->messages = $this->get('Messages');
301-
$this->total = $this->get('Total');
302+
$this->messages = $model->getMessages();
303+
$this->total = model->getTotal();
302304

303305
// If page does not exist, redirect to the last page (no redirect in embedded mode).
304306
if (empty($this->embedded) && $this->total && $this->total <= $this->state->get('list.start')) {
@@ -333,7 +335,7 @@ public function displayDefault($tpl = null)
333335
$this->app->getDispatcher()->dispatch('onKunenaPrepare', $prepareEvent);
334336
}
335337

336-
$this->moderators = $this->get('Moderators');
338+
$this->moderators = $model->getModerators();
337339
$this->usertopic = $this->topic->getUserTopic();
338340

339341
$this->pagination = $this->getPagination(5);

src/site/src/View/User/HtmlView.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ public function displayUser($tpl = null)
179179
{
180180
$this->layout = 'user';
181181
$this->params = $this->state->get('params');
182-
$this->topics = $this->get('Topics');
183-
$this->total = $this->get('Total');
184-
$this->topicActions = $this->get('TopicActions');
185-
$this->actionMove = $this->get('ActionMove');
182+
$model = $this->getModel();
183+
$this->topics = $model->getTopics();
184+
$this->total = $model->getTotal();
185+
$this->topicActions = $model->getTopicActions();
186+
$this->actionMove = $model->getActionMove();
186187
$this->message_ordering = $this->me->getMessageOrdering();
187188

188189
$this->URL = KunenaRoute::_();
@@ -214,11 +215,12 @@ public function displayUser($tpl = null)
214215
public function displayPosts($tpl = null)
215216
{
216217
$this->layout = 'posts';
218+
$model = $this->getModel();
217219
$this->params = $this->state->get('params');
218-
$this->messages = $this->get('Messages');
219-
$this->topics = $this->get('Topics');
220-
$this->total = $this->get('Total');
221-
$this->postActions = $this->get('PostActions');
220+
$this->messages = $model->getMessages();
221+
$this->topics = $model->getTopics();
222+
$this->total = $model->getTotal();
223+
$this->postActions = $model->get('PostActions');
222224
$this->actionMove = false;
223225
$this->message_ordering = $this->me->getMessageOrdering();
224226

0 commit comments

Comments
 (0)