Skip to content

Commit

Permalink
[new] PayBas#82 special page with recent topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajaki authored and Sajaki committed Feb 7, 2018
1 parent 0873417 commit f5bdc87
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- '@path_helper'
- '@ext.manager'
- '%core.root_path%'
- '@paybas.recenttopics.functions'
paybas.recenttopics.functions:
class: paybas\recenttopics\core\recenttopics
arguments:
Expand Down
18 changes: 12 additions & 6 deletions controller/page_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class page_controller
*/
protected $root_path;

/* @var recenttopics */
protected $rt_functions;

/**
* page constructor.
*
Expand Down Expand Up @@ -99,7 +102,8 @@ public function __construct(
$php_ext,
\phpbb\path_helper $path_helper,
\phpbb\extension\manager $phpbb_extension_manager,
$root_path
$root_path,
\paybas\recenttopics\core\recenttopics $functions
)
{
$this->config = $config;
Expand All @@ -116,6 +120,7 @@ public function __construct(
$this->ext_path = $this->phpbb_extension_manager->get_extension_path('paybas/recenttopics', true);
$this->ext_path_web = $this->path_helper->get_web_root_path($this->ext_path);
$this->root_path = $root_path;
$this->rt_functions = $functions;
}

/**
Expand All @@ -127,16 +132,17 @@ public function __construct(
*/
public function display()
{
$page = "recent_topics_page.html";

$page = "demo_body.html";
$this->template->assign_var('DEMO_MESSAGE', $this->user->lang['RECENT_TOPICS']);
if (isset($this->config['rt_index']) && $this->config['rt_index'])
{
$this->rt_functions->display_recent_topics();
}

// Load the requested page by route
try
{
$title = $this->user->lang['RECENT_TOPICS'];
// full rendered page source that will be output on the screen.
$response = $this->helper->render($page, $title);
$response = $this->helper->render($page, $this->user->lang['RECENT_TOPICS']);
}
catch (\phpbb\pages\exception\base $e)
{
Expand Down
5 changes: 0 additions & 5 deletions styles/all/template/demo_body.html

This file was deleted.

4 changes: 4 additions & 0 deletions styles/all/template/recent_topics_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% INCLUDE 'simple_header.html' %}
{% INCLUDE 'recent_topics_body_topbottom.html' %}

{% INCLUDE 'simple_footer.html' %}

0 comments on commit f5bdc87

Please sign in to comment.