Merge pull request #507 from marc1706/ticket/506
[ticket/506] Move module images to styles/all folder
@@ -140,7 +140,7 @@ class portal_module
|
||||
'MODULE_IMAGE' => $module_data['module_image_src'],
|
||||
'MODULE_IMAGE_WIDTH' => $module_data['module_image_width'],
|
||||
'MODULE_IMAGE_HEIGHT' => $module_data['module_image_height'],
|
||||
'MODULE_IMAGE_SRC' => ($module_data['module_image_src']) ? $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $module_data['module_image_src'] : '',
|
||||
'MODULE_IMAGE_SRC' => ($module_data['module_image_src']) ? $this->root_path . 'styles/all/theme/images/portal/' . $module_data['module_image_src'] : '',
|
||||
'MODULE_ENABLED' => ($module_data['module_status']) ? true : false,
|
||||
'MODULE_SHOW_IMAGE' => (in_array($this->portal_columns->number_to_string($module_data['module_column']), array('center', 'top', 'bottom'))) ? false : true,
|
||||
));
|
||||
@@ -675,7 +675,7 @@ class portal_module
|
||||
|
||||
$this->template->assign_block_vars('modules_' . $template_column, array(
|
||||
'MODULE_NAME' => (isset($this->user->lang[$row['module_name']])) ? $this->user->lang[$row['module_name']] : $row['module_name'],
|
||||
'MODULE_IMAGE' => ($row['module_image_src']) ? '<img src="' . $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $row['module_image_src'] . '" alt="' . $row['module_name'] . '" />' : '',
|
||||
'MODULE_IMAGE' => ($row['module_image_src']) ? '<img src="' . $this->root_path . 'styles/all/theme/images/portal/' . $row['module_image_src'] . '" alt="' . $row['module_name'] . '" />' : '',
|
||||
'MODULE_ENABLED' => ($row['module_status']) ? true : false,
|
||||
|
||||
'U_DELETE' => $this->modules_manager->get_module_link('modules', $row['module_id']) . '&action=delete&module_classname=' . $row['module_classname'],
|
||||
|
||||
@@ -227,7 +227,7 @@ class helper
|
||||
{
|
||||
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
||||
'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/all/theme/images/portal/' . $template_module['image_src'], './'),
|
||||
'TITLE' => $template_module['title'],
|
||||
'CODE' => $template_module['code'],
|
||||
'MODULE_ID' => $row['module_id'],
|
||||
@@ -239,7 +239,7 @@ class helper
|
||||
{
|
||||
$this->template->assign_block_vars('modules_' . $this->portal_columns->number_to_string($row['module_column']), array(
|
||||
'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/all/theme/images/portal/' . $row['module_image_src'], './'),
|
||||
'IMAGE_WIDTH' => $row['module_image_width'],
|
||||
'IMAGE_HEIGHT' => $row['module_image_height'],
|
||||
'MODULE_ID' => $row['module_id'],
|
||||
|
||||
@@ -427,36 +427,24 @@ function get_portal_tracking_info($fetch_news)
|
||||
*/
|
||||
function check_file_src($value, $key, $module_id, $force_error = true)
|
||||
{
|
||||
global $db, $phpbb_root_path, $phpEx, $user;
|
||||
global $phpbb_admin_path, $portal_root_path, $phpEx, $user;
|
||||
|
||||
$error = '';
|
||||
|
||||
// We check if the chosen file is present in all active styles
|
||||
$sql = 'SELECT style_path
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1';
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
// We check if the chosen file is present in the styles/all/ folder
|
||||
if (!file_exists($portal_root_path . 'styles/all/theme/images/portal/' . $value))
|
||||
{
|
||||
if (!file_exists($phpbb_root_path . 'styles/' . $row['style_path'] . '/theme/images/portal/' . $value) &&
|
||||
!file_exists($phpbb_root_path . 'ext/board3/portal/styles/' . $row['style_path'] . '/theme/images/portal/' . $value))
|
||||
{
|
||||
$error .= $user->lang['B3P_FILE_NOT_FOUND'] . ': styles/' . $row['style_path'] . '/theme/images/portal/' . $value . '<br />';
|
||||
}
|
||||
$error .= $user->lang['B3P_FILE_NOT_FOUND'] . ': styles/all/theme/images/portal/' . $value . '<br />';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!empty($error))
|
||||
{
|
||||
if ($force_error)
|
||||
{
|
||||
trigger_error($error . adm_back_link(append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=\board3\portal\acp\portal_module&mode=config&module_id=' . $module_id)), E_USER_WARNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $error;
|
||||
trigger_error($error . adm_back_link(append_sid("{$phpbb_admin_path}index.$phpEx", 'i=\board3\portal\acp\portal_module&mode=config&module_id=' . $module_id)), E_USER_WARNING);
|
||||
}
|
||||
|
||||
return $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 738 B After Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 895 B After Width: | Height: | Size: 895 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 855 B |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -54,7 +54,7 @@
|
||||
}
|
||||
|
||||
.portal-user-icon {
|
||||
background-image: url("./images/portal/portal_user.png");
|
||||
background-image: url("../../all/theme/images/portal/portal_user.png");
|
||||
padding-left: 16px;
|
||||
padding-top: 16px;
|
||||
float: left;
|
||||
@@ -469,7 +469,7 @@ a.portal-forumtitle {
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
background-position: 0 0;
|
||||
background: url(./images/portal/portal_clock_single.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_single.png") no-repeat;
|
||||
}
|
||||
|
||||
/* Minutes start
|
||||
@@ -561,7 +561,7 @@ a.portal-forumtitle {
|
||||
.portal-clock-back-hours-up, .portal-clock-front-hours-up {
|
||||
width: 42px;
|
||||
height: 21px;
|
||||
background: url(./images/portal/portal_clock_double.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_double.png") no-repeat;
|
||||
background-position: 0 0;
|
||||
vertical-align: bottom;
|
||||
display: inline-block;
|
||||
@@ -571,7 +571,7 @@ a.portal-forumtitle {
|
||||
.portal-clock-back-hours-down, .portal-clock-front-hours-down {
|
||||
width: 42px;
|
||||
height: 20px;
|
||||
background: url(./images/portal/portal_clock_double.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_double.png") no-repeat;
|
||||
background-position: 0 -44px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- IF .attach_center -->
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><strong>{L_FILENAME}</strong></span><br style="clear:both" />
|
||||
<!-- BEGIN attach_center -->
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;" class="gensmall"><img src="{T_THEME_PATH}/images/portal/icon_topic_attach.gif" alt="" /> <a href="{attach_center.U_TOPIC}" title="{attach_center.REAL_FILENAME}"><strong>{attach_center.FILENAME}</strong></a></span><br style="clear:both" />
|
||||
<span class="imageset icon_topic_attach"></span> <a href="{attach_center.U_TOPIC}" title="{attach_center.REAL_FILENAME}"><strong>{attach_center.FILENAME}</strong></a><br style="clear:both" />
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;">{L_FILESIZE}{L_COLON}</span><span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->left<!-- ELSE -->right<!-- ENDIF -->;" class="gensmall"><strong>{attach_center.FILESIZE}</strong></span><br style="clear:both" />
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;">{L_DOWNLOADS}{L_COLON}</span><span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->left<!-- ELSE -->right<!-- ENDIF -->;" class="gensmall"><strong>{attach_center.DOWNLOAD_COUNT}</strong></span><br style="clear:both" />
|
||||
<!-- IF not attach_center.S_LAST_ROW --><hr /><!-- ENDIF -->
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!-- IF .attach_side -->
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;"><strong>{L_FILENAME}</strong></span><br style="clear:both" />
|
||||
<!-- BEGIN attach_side -->
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;" class="gensmall"><img src="{T_THEME_PATH}/images/portal/icon_topic_attach.gif" alt="" /> <a href="{attach_side.U_TOPIC}" title="{attach_side.REAL_FILENAME}"><strong>{attach_side.FILENAME}</strong></a></span><br style="clear:both" />
|
||||
<span class="imageset icon_topic_attach"></span> <a href="{attach_side.U_TOPIC}" title="{attach_side.REAL_FILENAME}"><strong>{attach_side.FILENAME}</strong></a><br style="clear:both" />
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;">{L_FILESIZE}{L_COLON}</span><span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->left<!-- ELSE -->right<!-- ENDIF -->;" class="gensmall"><strong>{attach_side.FILESIZE}</strong></span><br style="clear:both" />
|
||||
<span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->right<!-- ELSE -->left<!-- ENDIF -->;">{L_DOWNLOADS}{L_COLON}</span><span style="float:<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->left<!-- ELSE -->right<!-- ENDIF -->;" class="gensmall"><strong>{attach_side.DOWNLOAD_COUNT}</strong></span><br style="clear:both" />
|
||||
<!-- IF not attach_side.S_LAST_ROW --><hr /><!-- ENDIF -->
|
||||
|
||||
|
Before Width: | Height: | Size: 1003 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 964 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 895 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1002 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 855 B |
|
Before Width: | Height: | Size: 879 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -61,7 +61,7 @@
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
background-position: 0 0;
|
||||
background: url(./images/portal/portal_clock_single.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_single.png") no-repeat;
|
||||
}
|
||||
|
||||
/* Minutes start
|
||||
@@ -153,7 +153,7 @@
|
||||
#portal-clock-back-hours-up, #portal-clock-front-hours-up {
|
||||
width: 42px;
|
||||
height: 21px;
|
||||
background: url(./images/portal/portal_clock_double.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_double.png") no-repeat;
|
||||
background-position: 0 0;
|
||||
vertical-align: bottom;
|
||||
display: inline-block;
|
||||
@@ -163,7 +163,7 @@
|
||||
#portal-clock-back-hours-down, #portal-clock-front-hours-down {
|
||||
width: 42px;
|
||||
height: 20px;
|
||||
background: url(./images/portal/portal_clock_double.png) no-repeat;
|
||||
background: url("../../all/theme/images/portal/portal_clock_double.png") no-repeat;
|
||||
background-position: 0 -44px;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
@@ -190,16 +190,16 @@
|
||||
}
|
||||
|
||||
.portal-arrow-bullet {
|
||||
background: url(./images/portal/arrowbullet.gif) no-repeat;
|
||||
background: url("./images/portal/arrowbullet.gif") no-repeat;
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.rtl .portal-arrow-bullet {
|
||||
background: url(./images/portal/arrowbullet_rtl.gif) no-repeat;
|
||||
background: url("./images/portal/arrowbullet_rtl.gif") no-repeat;
|
||||
}
|
||||
|
||||
.portal-user-span {
|
||||
background-image: url("./images/portal/portal_user.png");
|
||||
background-image: url("../../all/theme/images/portal/portal_user.png");
|
||||
padding-left: 16px;
|
||||
padding-top: 16px;
|
||||
margin-bottom: 2px;
|
||||
|
||||
@@ -15,10 +15,14 @@ class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframe
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
global $phpbb_root_path, $portal_root_path;
|
||||
|
||||
parent::setUp();
|
||||
|
||||
global $user;
|
||||
$user = new phpbb_mock_user();
|
||||
|
||||
$portal_root_path = $phpbb_root_path . 'ext/board3/portal/';
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
@@ -29,7 +33,7 @@ class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframe
|
||||
public function test_check_file_src()
|
||||
{
|
||||
$this->assertFalse(check_file_src('portal_attach.png', '', 15, false));
|
||||
$this->assertEquals(': styles/prosilver/theme/images/portal/portal_foobar.png<br />', check_file_src('portal_foobar.png', '', 15, false));
|
||||
$this->assertEquals(': styles/all/theme/images/portal/portal_foobar.png<br />', check_file_src('portal_foobar.png', '', 15, false));
|
||||
}
|
||||
|
||||
public function test_check_file_src_error()
|
||||
@@ -38,6 +42,6 @@ class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframe
|
||||
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
|
||||
$this->setExpectedTriggerError(E_USER_WARNING);
|
||||
$this->assertEquals(': styles/prosilver/theme/images/portal/portal_foobar.png<br />', check_file_src('portal_foobar.png', '', 15));
|
||||
$this->assertEquals(': styles/all/theme/images/portal/portal_foobar.png<br />', check_file_src('portal_foobar.png', '', 15));
|
||||
}
|
||||
}
|
||||
|
||||