aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_styles.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-05-16 14:14:57 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-05-16 14:14:57 +0000
commit6814ab81d70ff7f614aedecae53b36445e6faeb2 (patch)
tree87f6e8916f33cf25970294c490120b25b2b1dd93 /phpBB/includes/acp/acp_styles.php
parent89aff527278a9d0a13ddead8d631820b80b9023c (diff)
downloadforums-6814ab81d70ff7f614aedecae53b36445e6faeb2.tar
forums-6814ab81d70ff7f614aedecae53b36445e6faeb2.tar.gz
forums-6814ab81d70ff7f614aedecae53b36445e6faeb2.tar.bz2
forums-6814ab81d70ff7f614aedecae53b36445e6faeb2.tar.xz
forums-6814ab81d70ff7f614aedecae53b36445e6faeb2.zip
Revisiting #11024
Making a few things prettier in the progress. git-svn-id: file:///svn/phpbb/trunk@7607 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r--phpBB/includes/acp/acp_styles.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 12327694cf..d42e52ea15 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -934,13 +934,13 @@ parse_css_file = {PARSE_CSS_FILE}
$marker = 'MARKER' . time();
$code = highlight_string(str_replace("\n", $marker, $code), true);
$code = str_replace($marker, "\n", $code);
-
$str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':');
$str_to = array('<span class="', '<span class="syntax', '</span>', '', '', '&#91;', '&#93;', '&#46;', '&#58;');
$code = str_replace($str_from, $str_to, $code);
$code = preg_replace('#^(<span class="[a-z_]+">)\n?(.*?)\n?(</span>)$#ism', '$1$2$3', $code);
-
+ $code = substr($code, strlen('<span class="syntaxhtml">'));
+ $code = substr($code, 0, -1 * strlen('</ span>'));
$code = explode("\n", $code);
foreach ($code as $key => $line)
@@ -976,9 +976,14 @@ parse_css_file = {PARSE_CSS_FILE}
foreach ($file_ary as $file)
{
- $file = str_replace('/', '.', $file);
+ $file = str_replace('/', '.', $file);
+
+ // perform some dirty guessing to get the path right.
+ // We assume that three dots in a row were '../'
+ $tpl_file = str_replace('.', '/', $file);
+ $tpl_file = str_replace('///', '../', $tpl_file);
+
$filename = "{$cache_prefix}_$file.html.$phpEx";
-
$template->assign_block_vars('file', array(
'U_VIEWSOURCE' => $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
@@ -987,7 +992,7 @@ parse_css_file = {PARSE_CSS_FILE}
'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
'FILENAME' => $file,
'FILESIZE' => sprintf('%.1f KB', filesize("{$phpbb_root_path}cache/$filename") / 1024),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . str_replace('.', '/', $file) . '.html') : $filemtime[$file . '.html']))
+ 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
);
}
unset($filemtime);