Merge pull request #496 from marc1706/ticket/495
[ticket/495] Correctly load template files for modules
This commit is contained in:
@@ -692,6 +692,7 @@ class portal_module
|
|||||||
'ICON_MOVE_LEFT_DISABLED' => '<img src="' . $this->root_path . 'adm/images/icon_left_disabled.gif" alt="' . $this->user->lang['MOVE_LEFT'] . '" title="' . $this->user->lang['MOVE_LEFT'] . '" />',
|
'ICON_MOVE_LEFT_DISABLED' => '<img src="' . $this->root_path . 'adm/images/icon_left_disabled.gif" alt="' . $this->user->lang['MOVE_LEFT'] . '" title="' . $this->user->lang['MOVE_LEFT'] . '" />',
|
||||||
'ICON_MOVE_RIGHT' => '<img src="' . $this->root_path . 'adm/images/icon_right.gif" alt="' . $this->user->lang['MOVE_RIGHT'] . '" title="' . $this->user->lang['MOVE_RIGHT'] . '" />',
|
'ICON_MOVE_RIGHT' => '<img src="' . $this->root_path . 'adm/images/icon_right.gif" alt="' . $this->user->lang['MOVE_RIGHT'] . '" title="' . $this->user->lang['MOVE_RIGHT'] . '" />',
|
||||||
'ICON_MOVE_RIGHT_DISABLED' => '<img src="' . $this->root_path . 'adm/images/icon_right_disabled.gif" alt="' . $this->user->lang['MOVE_RIGHT'] . '" title="' . $this->user->lang['MOVE_RIGHT'] . '" />',
|
'ICON_MOVE_RIGHT_DISABLED' => '<img src="' . $this->root_path . 'adm/images/icon_right_disabled.gif" alt="' . $this->user->lang['MOVE_RIGHT'] . '" title="' . $this->user->lang['MOVE_RIGHT'] . '" />',
|
||||||
|
'B3P_U_ACTION' => $this->modules_manager->get_module_link('modules', $module_id),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<h1>{L_ACP_PORTAL_MODULES}</h1>
|
<h1>{L_ACP_PORTAL_MODULES}</h1>
|
||||||
<p>{L_ACP_PORTAL_MODULES_EXP}</p>
|
<p>{L_ACP_PORTAL_MODULES_EXP}</p>
|
||||||
|
|
||||||
<form id="acp_portal_modules" method="post" action="{U_ACTION}" data-ajax="true">
|
<form id="acp_portal_modules" method="post" action="{B3P_U_ACTION}" data-ajax="true">
|
||||||
<fieldset class="tabulated">
|
<fieldset class="tabulated">
|
||||||
<legend>{L_ACP_PORTAL_MODULES}</legend>
|
<legend>{L_ACP_PORTAL_MODULES}</legend>
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ class helper
|
|||||||
if (is_array($template_module))
|
if (is_array($template_module))
|
||||||
{
|
{
|
||||||
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
||||||
'TEMPLATE_FILE' => 'portal/modules/' . $template_module['template'],
|
'TEMPLATE_FILE' => $this->parse_template_file($template_module['template']),
|
||||||
'IMAGE_SRC' => $this->path_helper->get_web_root_path() . ltrim($this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $template_module['image_src'], './'),
|
'IMAGE_SRC' => $this->path_helper->get_web_root_path() . ltrim($this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $template_module['image_src'], './'),
|
||||||
'TITLE' => $template_module['title'],
|
'TITLE' => $template_module['title'],
|
||||||
'CODE' => $template_module['code'],
|
'CODE' => $template_module['code'],
|
||||||
@@ -238,7 +238,7 @@ class helper
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
||||||
'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
|
'TEMPLATE_FILE' => $this->parse_template_file($template_module),
|
||||||
'IMAGE_SRC' => $this->path_helper->get_web_root_path() . ltrim($this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $row['module_image_src'], './'),
|
'IMAGE_SRC' => $this->path_helper->get_web_root_path() . ltrim($this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $row['module_image_src'], './'),
|
||||||
'IMAGE_WIDTH' => $row['module_image_width'],
|
'IMAGE_WIDTH' => $row['module_image_width'],
|
||||||
'IMAGE_HEIGHT' => $row['module_image_height'],
|
'IMAGE_HEIGHT' => $row['module_image_height'],
|
||||||
@@ -264,4 +264,21 @@ class helper
|
|||||||
// Obtain portal config
|
// Obtain portal config
|
||||||
obtain_portal_config();
|
obtain_portal_config();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse template file by prefixing default modules with the portal path
|
||||||
|
*
|
||||||
|
* @param string $template_file HTML template
|
||||||
|
*
|
||||||
|
* @return string Parsed template file
|
||||||
|
*/
|
||||||
|
protected function parse_template_file($template_file)
|
||||||
|
{
|
||||||
|
if (strpos($template_file, '@') === false)
|
||||||
|
{
|
||||||
|
$template_file = 'portal/modules/' . $template_file;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $template_file;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user