Added bugfix that prevents duplicate menu items when 2 or more blocks of the same module are added

This commit is contained in:
Marc Alexander
2010-12-31 14:01:49 +00:00
parent a6bf86183f
commit b4ebd132f7
6 changed files with 12 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ while ($row = $db->sql_fetchrow($result))
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $template_module['image_src'],
'TITLE' => $template_module['title'],
'CODE' => $template_module['code'],
'MODULE_ID' => $row['module_id'],
));
}
else
@@ -113,6 +114,7 @@ while ($row = $db->sql_fetchrow($result))
$template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'],
'MODULE_ID' => $row['module_id'],
));
}
unset($template_module);

View File

@@ -94,6 +94,7 @@ class portal_links_module
$template->assign_block_vars('portallinks', array(
'LINK_TITLE' => (isset($user->lang[$links[$i]['title']])) ? $user->lang[$links[$i]['title']] : $links[$i]['title'],
'LINK_URL' => $cur_url,
'MODULE_ID' => $module_id,
));
}
}

View File

@@ -80,6 +80,7 @@ class portal_main_menu_module
{
$template->assign_block_vars('portalmenu', array(
'CAT_TITLE' => (isset($user->lang[$links[$i]['title']])) ? $user->lang[$links[$i]['title']] : $links[$i]['title'],
'MODULE_ID' => $module_id,
));
}
else

View File

@@ -3,7 +3,7 @@
<div class="portal-navigation">
<ul>
<!-- BEGIN portallinks -->
<li><a href="{portallinks.LINK_URL}" title="{portallinks.LINK_TITLE}">{portallinks.LINK_TITLE}</a></li>
<!-- IF $MODULE_ID eq portallinks.MODULE_ID --><li><a href="{portallinks.LINK_URL}" title="{portallinks.LINK_TITLE}">{portallinks.LINK_TITLE}</a></li><!-- ENDIF -->
<!-- BEGINELSE -->
<span style="float:left;" class="gensmall"><strong>{L_LINKS_NO_LINKS}</strong></span><br />
<!-- END portallinks -->

View File

@@ -2,6 +2,7 @@
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="16" height="16" alt="" />&nbsp;<!-- ENDIF -->{L_M_MENU}{$LR_BLOCK_H_R}
<div class="portal-navigation">
<!-- BEGIN portalmenu -->
<!-- IF $MODULE_ID eq portalmenu.MODULE_ID -->
<div class="menutitle">{portalmenu.CAT_TITLE}</div>
<ul>
<!-- BEGIN links -->
@@ -9,6 +10,7 @@
<!-- END links -->
</ul>
<hr class="dashed" />
<!-- ENDIF -->
<!-- BEGINELSE -->
<ul>
<span style="float:left;" class="gensmall"><strong>{L_MENU_NO_LINKS}</strong></span><br />

View File

@@ -19,6 +19,7 @@
<!-- DEFINE $IMAGE_SRC = '{modules_top.IMAGE_SRC}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_top.CODE}' -->
<!-- DEFINE $CUSTOM_TITLE = '{modules_top.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_top.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_top -->
</td>
@@ -32,6 +33,7 @@
<!-- DEFINE $IMAGE_SRC = '{modules_left.IMAGE_SRC}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_left.CODE}' -->
<!-- DEFINE $CUSTOM_TITLE = '{modules_left.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_left.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_left -->
</td>
@@ -44,6 +46,7 @@
<!-- DEFINE $IMAGE_SRC = '{modules_center.IMAGE_SRC}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_center.CODE}' -->
<!-- DEFINE $CUSTOM_TITLE = '{modules_center.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_center.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_center -->
<!-- IF S_DISPLAY_JUMPBOX and S_IS_FIXXXXXXXXXXXXXXED -->
@@ -60,6 +63,7 @@
<!-- DEFINE $IMAGE_SRC = '{modules_right.IMAGE_SRC}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_right.CODE}' -->
<!-- DEFINE $CUSTOM_TITLE = '{modules_right.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_right.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_right -->
</td>
@@ -73,6 +77,7 @@
<!-- DEFINE $IMAGE_SRC = '{modules_bottom.IMAGE_SRC}' -->
<!-- DEFINE $CUSTOM_CODE = '{modules_bottom.CODE}' -->
<!-- DEFINE $CUSTOM_TITLE = '{modules_bottom.TITLE}' -->
<!-- DEFINE $MODULE_ID = '{modules_bottom.MODULE_ID}' -->
<!-- INCLUDE {$TEMPLATE_FILE} -->
<!-- END modules_bottom -->
</td>