From b5e317ad067d0c417db77ae9fcc4cc6a8668df9c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 1 Dec 2014 14:31:36 +0100 Subject: [PATCH] [ticket/416] Allow adding links module more than once B3P-416 --- modules/links.php | 12 +++++++----- .../template/portal/modules/links_side.html | 12 ++++++++---- .../template/portal/modules/links_side.html | 12 ++++++++---- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/links.php b/modules/links.php index 8f929b3e..4b1e287a 100644 --- a/modules/links.php +++ b/modules/links.php @@ -56,13 +56,13 @@ class links extends module_base /** @var \phpbb\config\config */ protected $config; - /** @var \phpbb\db\driver */ + /** @var \phpbb\db\driver\driver_interface */ protected $db; /** @var \phpbb\request\request */ protected $request; - /** @var \phpbb\template */ + /** @var \phpbb\template\template */ protected $template; /** @var string PHP file extension */ @@ -81,9 +81,9 @@ class links extends module_base * Construct a links object * * @param \phpbb\config\config $config phpBB config - * @param \phpbb\db\driver $db phpBB db driver + * @param \phpbb\db\driver\driver_interface $db phpBB db driver * @param \phpbb\request\request $request phpBB request - * @param \phpbb\template $template phpBB template + * @param \phpbb\template\template $template phpBB template * @param string $phpEx php file extension * @param string $phpbb_root_path phpBB root path * @param \phpbb\user $user phpBB user object @@ -113,6 +113,8 @@ class links extends module_base // get user's groups $groups_ary = get_user_groups(); + $this->template->assign_block_vars('portal_links', array('MODULE_ID' => $module_id)); + for ($i = 0; $i < sizeof($links); $i++) { if ($links[$i]['type'] == self::LINK_INT) @@ -130,7 +132,7 @@ class links extends module_base if (!empty($permission_check) || $links[$i]['permission'] == '') { - $this->template->assign_block_vars('portallinks', array( + $this->template->assign_block_vars('portal_links.links', array( 'LINK_TITLE' => (isset($this->user->lang[$links[$i]['title']])) ? $this->user->lang[$links[$i]['title']] : $links[$i]['title'], 'LINK_URL' => $cur_url, 'MODULE_ID' => $module_id, diff --git a/styles/prosilver/template/portal/modules/links_side.html b/styles/prosilver/template/portal/modules/links_side.html index d22f5f83..73201945 100644 --- a/styles/prosilver/template/portal/modules/links_side.html +++ b/styles/prosilver/template/portal/modules/links_side.html @@ -1,11 +1,15 @@ + + {$LR_BLOCK_H_L} {$TITLE}{$LR_BLOCK_H_R}
-{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} \ No newline at end of file +{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + + diff --git a/styles/subsilver2/template/portal/modules/links_side.html b/styles/subsilver2/template/portal/modules/links_side.html index 7230e1b1..cbc47b35 100644 --- a/styles/subsilver2/template/portal/modules/links_side.html +++ b/styles/subsilver2/template/portal/modules/links_side.html @@ -1,9 +1,11 @@ + + {$LR_BLOCK_H_L} {$TITLE}{$LR_BLOCK_H_R} - + @@ -12,6 +14,8 @@ {L_LINKS_NO_LINKS}
- +
- onclick="window.open('{portallinks.LINK_URL}'); return false;"> {portallinks.LINK_TITLE} + onclick="window.open('{portal_links.links.LINK_URL}'); return false;"> {portal_links.links.LINK_TITLE}
-{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} \ No newline at end of file +{$LR_BLOCK_F_L}{$LR_BLOCK_F_R} + +