- added a theme editor

- some adjustments in acp_styles.php
- fixed storing themes in db (needs revisiting)


git-svn-id: file:///svn/phpbb/trunk@5953 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2006-05-20 23:56:12 +00:00
parent 5029170afb
commit 5fb416fc26
5 changed files with 903 additions and 250 deletions

View file

@ -108,7 +108,35 @@
</table></td>
</tr>
</table></form>
<!-- ELSEIF S_EDIT_TEMPLATE -->
<!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME -->
<script language="javascript" type="text/javascript" defer="defer">
<!--
function append_text_rows(form_name, value)
{
url = document.getElementById(form_name).action;
var_start = url.indexOf('&text_rows=');
if (var_start == -1)
{
document.getElementById(form_name).action = url + "&text_rows=" + value;
}
else
{
url_start = url.substring(0, var_start + 1);
var_end = url.substring(var_start + 1).indexOf('&');
if (var_end == -1)
{
document.getElementById(form_name).action = url_start + "text_rows=" + value;
}
else
{
document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value;
}
}
}
//-->
</script>
<!-- IF S_EDIT_TEMPLATE -->
<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
@ -116,13 +144,15 @@
<p>{L_EDIT_TEMPLATE_EXPLAIN}</p>
<p>{L_SELECTED_TEMPLATE}: <b>{SELECTED_TEMPLATE}</b></p>
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_SELECT_TEMPLATE}</legend>
<dl>
<dt><label for="template_file">{L_TEMPLATE_FILE}: </label></dt>
<dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select>&nbsp; <input class="btnlite" type="submit" value="{L_SELECT}" /></dd>
<dt><label for="template_file">{L_TEMPLATE_FILE}:</label></dt>
<dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="btnlite" type="submit" value="{L_SELECT}" /></dd>
</dl>
</fieldset>
@ -171,24 +201,179 @@
<fieldset>
<legend>{L_TEMPLATE_EDITOR}</legend>
<dl>
<dt><label>{L_SELECTED_TEMPLATE}: </label></dt>
<dt><label>{L_SELECTED_TEMPLATE_FILE}:</label></dt>
<dd>{TEMPLATE_FILE}</dd>
</dl>
<dl>
<dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}</label></dt>
<dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}:</label></dt>
<dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
</dl>
<textarea id="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}" name="template_data">{TEMPLATE_DATA}</textarea>
<textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea>
</fieldset>
<fieldset class="quick">
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input class="button1" type="submit" name="save" value="{L_SUBMIT}" />
<input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_EDIT_THEME -->
<script language="javascript" type="text/javascript">
<!--
function swatch(field)
{
window.open('{UA_SWATCH}' + field, '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636');
return false;
}
function change_editor_height(height)
{
editor = document.getElementById('css_data');
editor.rows = Math.max(5, Math.min(height, 999));
append_text_rows('acp_styles', height);
append_text_rows('acp_theme', height);
append_text_rows('acp_custom_class', height);
}
//-->
</script>
<h1>{L_EDIT_THEME}</h1>
<p>{L_EDIT_THEME_EXPLAIN}</p>
<p>{L_SELECTED_THEME}: <b>{SELECTED_THEME}</b></p>
<!-- IF S_SHOWCSS -->
<h3>{L_SHOW_RAW_CSS_NOTE}</h3>
<p>{L_SHOW_RAW_CSS_EXPLAIN}</p>
<!-- ENDIF -->
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_SELECT_CLASS}</legend>
<dl>
<dt><label for="css_class">{L_SELECT_CLASS}:</label></dt>
<dd><select id="css_class" name="css_class" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_CLASSES}</select> <input class="btnlite" type="submit" id="select_class" name="select_class" value="{L_SELECT}" /></dd>
</dl>
<!-- IF S_CLASS -->
<dl>
<dt><label>{L_SELECTED_CLASS}:</label></dt>
<dd>{S_CLASS}</dd>
</dl>
<!-- ENDIF -->
</fieldset>
</form>
<!-- IF S_CLASS -->
<form id="acp_theme" method="post" action="{U_ACTION}">
<!-- IF S_SHOWCSS -->
<fieldset>
<legend>{L_THEME_EDITOR}</legend>
<dl>
<dt><label for="text_rows">{L_THEME_EDITOR_HEIGHT}:</label></dt>
<dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
</dl>
<textarea id="css_data" name="css_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{CSS_DATA}</textarea>
</fieldset>
<!-- ELSE -->
<fieldset>
<legend>{L_BACKGROUND}</legend>
<dl>
<dt><label for="background_color">{L_BACKGROUND_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt>
<dd><input id="background_color" name="background_color" type="text" value="{BACKGROUND_COLOR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="#" onclick="swatch('background_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
</dl>
<dl>
<dt><label for="backround_image">{L_BACKGROUND_IMAGE}:</label></td>
<dd><select id="background_image" name="background_image">{S_BACKGROUND_IMAGE}</select></dd>
</dl>
<dl>
<dt><label for="background_repeat">{L_BACKGROUND_REPEAT}:</label></dt>
<dd><select id="background_repeat" name="background_repeat">{S_BACKGROUND_REPEAT}</select></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_FOREGROUND}</legend>
<dl>
<dt><label for="font_color">{L_FONT_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt>
<dd><input id="font_color" name="font_color" type="text" value="{FONT_COLOR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="#" onclick="swatch('font_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
</dl>
<dl>
<dt><label for="font_family">{L_FONT_FACE}:</label><br /><span>{L_FONT_FACE_EXPLAIN}</span></dt>
<dd><input id="font_family" name="font_family" type="text" value="{FONT_FAMILY}" size="40" maxlength="255" /></dd>
</dl>
<dl>
<dt><label for="font_size">{L_FONT_SIZE}:</label></dt>
<dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="3" maxlength="3" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd>
</dl>
<dl>
<dt><label for="font_weight">{L_BOLD}:</label></dt>
<dd><input id="font_weight" type="radio" name="font_weight" value="bold"<!-- IF FONT_WEIGHT eq "bold" --> checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" name="font_weight" value="normal"<!-- IF FONT_WEIGHT eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} &nbsp; <input type="radio" name="font_weight" value=""<!-- IF not FONT_WEIGHT --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd>
</dl>
<dl>
<dt><label for="font_style">{L_ITALIC}:</label></dt>
<dd><input id="font_style" type="radio" name="font_style" value="italic"<!-- IF FONT_STYLE eq "italic" --> checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" name="font_style" value="normal"<!-- IF FONT_STYLE eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} &nbsp; <input type="radio" name="font_style" value=""<!-- IF not FONT_STYLE --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd>
</dl>
<dl>
<dt><label for="text_decoration">{L_UNDERLINE}:</label></dt>
<dd><input id="text_decoration" type="radio" name="text_decoration" value="underline"<!-- IF TEXT_DECORATION eq "underline" --> checked="checked"<!-- ENDIF --> /> {L_YES} &nbsp; <input type="radio" name="text_decoration" value="normal"<!-- IF TEXT_DECORATION eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} &nbsp; <input type="radio" name="text_decoration" value=""<!-- IF not TEXT_DECORATION --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd>
</dl>
<dl>
<dt><label for="line_height">{L_LINE_SPACING}</label></dt>
<dd><input id="line_height" name="line_height" type="text" value="{LINE_HEIGHT}" size="3" maxlength="3" /> <select id="line_height_unit" name="line_height_unit">{S_LINE_HEIGHT_UNITS}</select></dd>
</dl>
</fieldset>
<!-- ENDIF -->
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<!-- IF S_SHOWCSS -->
<input class="button2" type="submit" id="hidecss" name="hidecss" value="{L_HIDE_CSS}" />&nbsp;
<!-- ELSE -->
<input class="button2" type="submit" id="showcss" name="showcss" value="{L_SHOW_CSS}" />&nbsp;
<!-- ENDIF -->
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset>
</form>
<!-- ENDIF -->
<br />
<h1>{L_CUSTOM_CLASS}</h1>
<p>{L_CUSTOM_CLASS_EXPLAIN}</p>
<form id="acp_custom_class" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_CUSTOM_CLASS}</legend>
<dl>
<dt><label for="custom_class">{L_CSS_CLASS_NAME}:</label></dt></dt>
<dd><input id="custom_class" name="custom_class" type="text" value="" maxlength="40" size="40" /></dd>
</dl>
</fieldset>
<fieldset class="quick">
<input class="button1" type="submit" id="add_custom" name="add_custom" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_EXPORT -->
<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
@ -273,7 +458,10 @@
<!-- IF S_STYLE -->
<a href="{installed.U_STYLE_ACT_DEACT}">{installed.L_STYLE_ACT_DEACT}</a> |
<!-- ENDIF -->
{installed.S_OPTIONS} | <a href="{installed.U_PREVIEW}" onclick="this.target='_preview';">{L_PREVIEW}</a>
{installed.S_OPTIONS}
<!-- IF S_STYLE -->
| <a href="{installed.U_PREVIEW}" onclick="this.target='_preview';">{L_PREVIEW}</a>
<!-- ENDIF -->
</td>
<!-- END installed -->
<tr>
@ -286,7 +474,7 @@
<!-- ENDIF -->
<!-- BEGIN uninstalled -->
<tr>
<td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->>{uninstalled.NAME}<br /><b class="small">{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</b></td>
<td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><b>{uninstalled.NAME}</b><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td>
<td style="text-align: center;"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td>
</tr>
<!-- END uninstalled -->

View file

@ -136,11 +136,8 @@ pagination_sep = \'{PAGINATION_SEP}\'
return $this->edit_imageset($style_id);
case 'template':
return $this->edit_template($style_id);
/**
* @todo Implement the theme editor
*/
//case 'theme':
// return $this->edit_theme($style_id);
case 'theme':
return $this->edit_theme($style_id);
}
}
break;
@ -260,7 +257,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if ($theme_row['theme_storedb'] && file_exists("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"))
{
$theme_data = implode('', file("{$phpbb_root_path}styles/" . $theme_row['theme_path'] . '/theme/stylesheet.css'));
$theme_data = file_get_contents("{$phpbb_root_path}styles/" . $theme_row['theme_path'] . '/theme/stylesheet.css');
// Match CSS imports
$matches = array();
@ -277,7 +274,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Save CSS contents
$sql_ary = array(
'theme_mtime' => @filemtime("{$phpbb_root_path}styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
'theme_data' => $theme_data
'theme_data' => str_replace('./', 'styles/' . $theme_info['theme_path'] . '/theme/', $theme_data)
);
$sql = 'UPDATE ' . STYLES_CSS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
@ -383,7 +380,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'U_STYLE_ACT_DEACT' => $this->u_action . '&amp;action=' . $stylevis . '&amp;id=' . $row[$mode . '_id'],
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
'S_OPTIONS' => implode(' | ', $s_options),
'U_PREVIEW' => "{$phpbb_root_path}index.$phpEx$SID&amp;$mode=" . $row[$mode . '_id'],
'U_PREVIEW' => ($mode == 'style') ? "{$phpbb_root_path}index.$phpEx$SID&amp;$mode=" . $row[$mode . '_id'] : '',
'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
@ -460,8 +457,10 @@ pagination_sep = \'{PAGINATION_SEP}\'
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$save_changes = (isset($_POST['save'])) ? true : false;
// make sure template_file path doesn't go upwards ;-)
// make sure template_file path doesn't go upwards
$template_file = str_replace('..', '.', $template_file);
// we want newlines no carriage returns!
$template_data = str_replace(array("\n\r", "\r"), array("\n", "\n"), $template_data);
// Retrieve some information about the template
$sql = 'SELECT template_storedb, template_path, template_name
@ -524,7 +523,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// destroy the cached version of the template
@unlink("{$phpbb_root_path}cache/tpl_{$template_info['template_name']}_" . str_replace('/', '.', $template_file) . ".$phpEx");
add_log('admin', 'LOG_EDIT_TEMPLATE', $template_info['template_name'], $template_file);
add_log('admin', 'LOG_TEMPLATE_EDIT', $template_info['template_name'], $template_file);
trigger_error($user->lang['TEMPLATE_FILE_UPDATED'] . $additional . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$template_id&amp;text_rows=$text_rows&amp;template_file=$template_file"));
}
@ -643,6 +642,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$template_id&amp;text_rows=$text_rows",
'U_BACK' => $this->u_action,
'SELECTED_TEMPLATE' => $template_info['template_name'],
'TEMPLATE_FILE' => $template_file,
'TEMPLATE_DATA' => htmlentities($template_data),
'TEXT_ROWS' => $text_rows)
@ -650,9 +650,430 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
/**
* Edit imagesets
* Provides a css editor and a basic easier to use stylesheet editing tool for less experienced (or lazy) users
*
* @param int $theme_id specifies which theme is being edited
*/
function edit_imageset($style_id)
function edit_theme($theme_id)
{
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $config, $db, $cache, $user, $template;
$this->page_title = 'EDIT_THEME';
// get user input
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$hide_css = request_var('hidecss', false);
$show_css = !$hide_css && request_var('showcss', false);
$edit_class = request_var('css_class', '');
$custom_class = request_var('custom_class', '');
$css_data = (!empty($_POST['css_data'])) ? ((STRIP) ? stripslashes($_POST['css_data']) : $_POST['css_data']) : '';
$submit = isset($_POST['submit']) ? true : false;
$add_custom = isset($_POST['add_custom']) ? true : false;
$matches = array();
// we want newlines no carriage returns!
$css_data = str_replace(array("\n\r", "\r"), array("\n", "\n"), $css_data);
// Retrieve some information about the theme
$sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data
FROM ' . STYLES_CSS_TABLE . "
WHERE theme_id = $theme_id";
$result = $db->sql_query($sql);
if (!($theme_info = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_THEME']);
}
$db->sql_freeresult($result);
$stylesheet_path = $phpbb_root_path . 'styles/' . $theme_info['theme_path'] . '/theme/stylesheet.css';
// Get the CSS data from either database or filesystem
if (!$theme_info['theme_storedb'])
{
if (!file_exists($stylesheet_path) || !($stylesheet = file_get_contents($stylesheet_path)))
{
trigger_error($user->lang['NO_THEME']);
}
}
else
{
$stylesheet = &$theme_info['theme_data'];
}
// Pull out a list of classes
$classes = array();
if (preg_match_all('/^([a-z0-9\.:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
{
$classes = $matches[1];
}
// Generate html for the list of classes
$s_hidden_fields = array();
$s_classes = '';
sort($classes);
foreach ($classes as $class)
{
$selected = ($class == $edit_class) ? ' selected="selected"' : '';
$s_classes .= '<option value="' . $class . '"' . $selected . '>' . $class . '</option>';
}
$template->assign_vars(array(
'S_EDIT_THEME' => true,
'S_SHOWCSS' => $show_css,
'S_CLASSES' => $s_classes,
'S_CLASS' => $edit_class,
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;showcss=$show_css&amp;text_rows=$text_rows",
'U_BACK' => $this->u_action,
'SELECTED_THEME' => $theme_info['theme_name'],
'TEXT_ROWS' => $text_rows)
);
// only continue if we are really editing anything
if (!$edit_class && !$add_custom)
{
return;
}
// These are the elements for the simple view
$match_elements = array(
'colors' => array('background-color', 'color',),
'sizes' => array('font-size', 'line-height',),
'images' => array('background-image',),
'repeat' => array('background-repeat',),
'other' => array('font-weight', 'font-family', 'font-style', 'text-decoration',),
);
// Used in an sprintf statement to generate appropriate output for rawcss mode
$map_elements = array(
'colors' => '%s',
'sizes' => '%d',
'images' => 'url(\'./%s\')',
'repeat' => '%s',
'other' => '%s',
);
$units = array('px', '%', 'em', 'pt');
$repeat_types = array(
'' => $user->lang['UNSET'],
'none' => $user->lang['REPEAT_NO'],
'repeat-x' => $user->lang['REPEAT_X'],
'repeat-y' => $user->lang['REPEAT_Y'],
'both' => $user->lang['REPEAT_ALL'],
);
// Fill css_data with the class contents from the stylesheet
// in case we just selected a class and it's not filled yet
if (!$css_data && !$submit && !isset($_POST['hidecss']) && !isset($_POST['showcss']) && !$add_custom)
{
preg_match('#^[ \t]*?' . preg_quote($edit_class, '#') . '[ \t\n]*?\{(.*?)\}#ms', $stylesheet, $matches);
if (!isset($matches[1]))
{
trigger_error($user->lang['NO_CLASS']);
}
$css_data = implode(";\n", array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $matches[1]))), array('')));
if ($css_data)
{
$css_data .= ';';
}
}
// If we don't show raw css and the user did not submit any modification
// then generate a list of css elements and output them via the template
if (!$show_css && !$submit && !$add_custom)
{
$css_elements = array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $css_data))), array(''));
// Grab list of potential images for the "images" type
$imglist = filelist($phpbb_root_path . 'styles/' . $theme_info['theme_name'] . '/theme');
foreach ($match_elements as $type => $match_ary)
{
foreach ($match_ary as $match)
{
$var = str_replace('-', '_', $match);
$value = '';
$unit = '';
if (sizeof($css_elements))
{
// first read in the setting
foreach ($css_elements as $key => $element)
{
if (preg_match('#^' . preg_quote($match, '#') . ':[ \t\n]*?(.*?)$#', $element, $matches))
{
switch ($type)
{
case 'sizes':
$value = trim($matches[1]);
if (preg_match('#(.*?)(px|%|em|pt)#', $matches[1], $matches))
{
$unit = trim($matches[2]);
$value = trim($matches[1]);
}
break;
case 'images':
if (preg_match('#url\(\'(.*?)\'\)#', $matches[1], $matches))
{
$value = trim($matches[1]);
}
break;
case 'colors':
$value = trim($matches[1]);
if ($value[0] == '#')
{
$value = substr($value, 1);
}
break;
default:
$value = trim($matches[1]);
}
// Remove this element from array
unset($css_elements[$key]);
break;
}
}
}
// then display it in the template
switch ($type)
{
case 'sizes':
// generate a list of units
$s_units = '';
foreach ($units as $unit_option)
{
$selected = ($unit_option == $unit) ? ' selected="selected"' : '';
$s_units .= "<option value=\"$unit_option\"$selected>$unit_option</option>";
}
$s_units = '<option value=""' . (($unit == '') ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option>' . $s_units;
$template->assign_vars(array(
strtoupper($var) => $value,
'S_' . strtoupper($var) . '_UNITS' => $s_units)
);
break;
case 'images':
// generate a list of images for this setting
$s_imglist = '';
foreach ($imglist as $path => $img_ary)
{
foreach ($img_ary as $img)
{
$img = htmlspecialchars(((substr($path, 0, 1) == '/') ? substr($path, 1) : $path) . $img);
$selected = (preg_match('#' . preg_quote($img) . '$#', $value)) ? ' selected="selected"' : '';
$s_imglist .= "<option value=\"$img\"$selected>$img</option>";
}
}
$s_imglist = '<option value=""' . (($value == '') ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option>' . $s_imglist;
$template->assign_vars(array(
'S_' . strtoupper($var) => $s_imglist)
);
unset($s_imglist);
break;
case 'repeat':
// generate a list of repeat options
$s_repeat_types = '';
foreach ($repeat_types as $repeat_type => $repeat_lang)
{
$selected = ($value == $repeat_type) ? ' selected="selected"' : '';
$s_repeat_types .= "<option value=\"$repeat_type\"$selected>$repeat_lang</option>";
}
$template->assign_vars(array(
'S_' . strtoupper($var) => $s_repeat_types)
);
default:
$template->assign_vars(array(
strtoupper($var) => $value)
);
}
}
}
// Any remaining elements must be custom data so we save that in a hidden field
if (sizeof($css_elements))
{
$s_hidden_fields['cssother'] = implode(' ;; ', $css_elements);
}
unset($imglist, $css_elements);
}
// else if we are showing raw css or the user submitted data from the simple view
// then we need to turn the given information into raw css
elseif (!$css_data && !$add_custom)
{
foreach ($match_elements as $type => $match_ary)
{
foreach ($match_ary as $match)
{
$var = str_replace('-', '_', $match);
$value = '';
$unit = '';
// retrieve and validate date for this setting
switch ($type)
{
case 'sizes':
$value = request_var($var, 0);
$unit = request_var($var . '_unit', '');
if ((request_var($var, '') === '') || !in_array($unit, $units))
{
continue 2;
}
break;
case 'images':
$value = str_replace('..', '.', request_var($var, ''));
if (!file_exists($value))
{
continue 2;
}
break;
case 'colors':
$value = request_var($var, '');
if (preg_match('#^(?:[A-Z0-9]{6}|[A-Z]{3})$#', $value))
{
$value = '#' . $value;
}
break;
default:
$value = request_var($var, '');
}
// use the element mapping to create raw css code
if ($value !== '')
{
$css_data .= $match . ': ' . sprintf($map_elements[$type], $value) . $unit . ";\n";
}
}
}
// append additional data sent to us
if ($other = request_var('cssother', ''))
{
$css_data .= str_replace(' ;; ', ";\n", $other) . ';';
$css_data = preg_replace("#\*/;\n#", "*/\n", $css_data);
}
}
// make sure we have $show_css set, so we can link to the show_css page if we need to
elseif (!$hide_css)
{
$show_css = true;
}
if ($submit || $add_custom)
{
if ($submit)
{
// if the user submitted a modification replace the old class definition in the stylesheet
// with the new one
if (preg_match('#^' . preg_quote($edit_class, '#') . '[ \t\n]*?\{(.*?)\}#ms', $stylesheet))
{
$stylesheet = preg_replace('#^(' . preg_quote($edit_class, '#') . '[ \t\n]*?\{).*?(\})#ms', "$1\n\t" . str_replace("\n", "\n\t", $css_data) . "\n$2", $stylesheet);
}
$message = $user->lang['THEME_UPDATED'];
}
else
{
// check whether the custom class name is valid
if (!preg_match('/^[a-z0-9#:.\- ]+$/i', $add_custom))
{
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"));
}
else
{
// append an empty class definition to the stylesheet
$stylesheet .= "\n$custom_class\n{\n}";
$message = $user->lang['THEME_CLASS_ADDED'];
}
}
// where should we store the CSS?
if (!$theme_info['theme_storedb'] && file_exists($stylesheet_path) && is_writeable($stylesheet_path))
{
// write stylesheet to file
if (!($fp = fopen($stylesheet_path, 'wb')))
{
trigger_error($user->lang['NO_THEME']);
}
fwrite($fp, $stylesheet);
fclose($fp);
}
else
{
// match CSS imports
preg_match_all('/@import url\(\"(.*)\"\);/i', $stylesheet, $matches);
if (sizeof($matches))
{
foreach ($matches[0] as $idx => $match)
{
$stylesheet = str_replace($match, $this->load_css_file($style_row['theme_path'], $matches[1][$idx]), $stylesheet);
}
}
// Write stylesheet to db
$sql_ary = array(
'theme_mtime' => time(),
'theme_storedb' => 1,
'theme_data' => str_replace('./', 'styles/' . $theme_info['theme_path'] . '/theme/', $stylesheet),
);
$sql = 'UPDATE ' . STYLES_CSS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE theme_id = ' . $theme_id;
$db->sql_query($sql);
// notify the user if the template was not stored in the db before the mofication
if (!$theme_info['theme_storedb'])
{
add_log('admin', 'LOG_THEME_EDIT_DETAILS', $theme_info['theme_name']);
$message .= '<br />' . $user->lang['EDIT_THEME_STORED_DB'];
}
}
$cache->destroy('sql', STYLES_CSS_TABLE);
add_log('admin', ($add_custom) ? 'LOG_THEME_EDIT_ADD' : 'LOG_THEME_EDIT', $theme_info['theme_name'], ($add_custom) ? $custom_class : $edit_class);
trigger_error($message . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;css_class=$edit_class&amp;showcss=$show_css&amp;text_rows=$text_rows"));
}
unset($matches);
$s_hidden_fields['css_class'] = $edit_class;
$template->assign_vars(array(
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&amp;form=acp_theme&amp;name=",
'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=acp_theme&name=",
'CSS_DATA' => htmlspecialchars($css_data))
);
}
/**
* Edit imagesets
*
* @param int $imageset_id specifies which imageset is being edited
*/
function edit_imageset($imageset_id)
{
global $db, $user, $phpbb_root_path, $cache, $template;
@ -663,12 +1084,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
$imgsize = (!empty($_POST['imgsize'])) ? true : false;
$imgwidth = (isset($_POST['imgwidth'])) ? intval($_POST['imgwidth']) : '';
if ($style_id)
if ($imageset_id)
{
$sql_select = ($imgname) ? ", $imgname" : '';
$sql = "SELECT imageset_path, imageset_name, imageset_copyright$sql_select
FROM " . STYLES_IMAGE_TABLE . "
WHERE imageset_id = $style_id";
WHERE imageset_id = $imageset_id";
$result = $db->sql_query($sql);
if (!extract($db->sql_fetchrow($result)))
@ -724,7 +1145,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$sql = 'UPDATE ' . STYLES_IMAGE_TABLE . "
SET $imgname = '" . $db->sql_escape($imgpath) . "'
WHERE imageset_id = $style_id";
WHERE imageset_id = $imageset_id";
$db->sql_query($sql);
$cache->destroy('sql', STYLES_IMAGE_TABLE);
@ -816,7 +1237,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'IMAGELIST_OPTIONS' => $imagesetlist_options,
'IMAGE_SIZE' => $imgsize_bool,
'IMAGE_REQUEST' => (!empty($imgname)) ? '../styles/' . $imageset_path . '/imageset/' . str_replace('{LANG}', $imglang, current(explode('*', $$imgname))) : '',
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$style_id",
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$imageset_id",
'U_BACK' => $this->u_action,
'NAME' => $imageset_name,
'ERROR' => !$valid_name
@ -1431,9 +1852,9 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
$theme_data = '';
if ($style_row['theme_storedb'])
if (!$style_row['theme_storedb'])
{
$theme_data = implode('', file("{$phpbb_root_path}styles/" . $style_row['theme_path'] . '/theme/stylesheet.css'));
$theme_data = file_get_contents("{$phpbb_root_path}styles/" . $style_row['theme_path'] . '/theme/stylesheet.css');
// Match CSS imports
$matches = array();
@ -1588,12 +2009,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
global $phpbb_root_path;
$handle = "{$phpbb_root_path}styles/$path/theme/$filename";
$file = "{$phpbb_root_path}styles/$path/theme/$filename";
if ($fp = @fopen($handle, 'r'))
if (file_exists($file) && ($content = file_get_contents($file)))
{
$content = trim(@fread($fp, filesize($handle)));
@fclose($fp);
$content = trim($content);
}
else
{
@ -1650,7 +2070,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'template_filename' => "$pathfile$file",
'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
'template_mtime' => filemtime("{$phpbb_root_path}styles/$path$pathfile$file"),
'template_data' => implode('', file("{$phpbb_root_path}styles/$path$pathfile$file")),
'template_data' => file_get_contents("{$phpbb_root_path}styles/$path$pathfile$file"),
);
if ($mode == 'insert')
@ -2230,7 +2650,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
case 'theme':
$sql_ary += array(
'theme_storedb' => (!is_writeable("{$phpbb_root_path}styles/$path/theme/stylesheet.css")) ? 1 : $store_db,
'theme_data' => ($store_db) ? (($root_path) ? str_replace('./', "styles/$path/theme/", implode('', file("$root_path/$mode/stylesheet.css"))) : '') : '',
'theme_data' => ($store_db) ? (($root_path) ? str_replace('./', "styles/$path/theme/", file_get_contents("$root_path/$mode/stylesheet.css")) : '') : '',
'theme_mtime' => ($store_db) ? filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css") : 0
);
break;

View file

@ -535,6 +535,7 @@ $lang = array_merge($lang, array(
'LOG_TEMPLATE_ADD_DB' => '<b>Added new template set to database</b><br />&#187; %s',
'LOG_TEMPLATE_ADD_FS' => '<b>Add new template set on filesystem</b><br />&#187; %s',
'LOG_TEMPLATE_DELETE' => '<b>Deleted template set</b><br />&#187; %s',
'LOG_TEMPLATE_EDIT' => '<b>Edited template set <i>%s</i></b><br />&#187; %s',
'LOG_TEMPLATE_EDIT_DETAILS' => '<b>Edited template details</b><br />&#187; %s',
'LOG_TEMPLATE_EXPORT' => '<b>Exported template set</b><br />&#187; %s',
@ -542,6 +543,8 @@ $lang = array_merge($lang, array(
'LOG_THEME_ADD_FS' => '<b>Add new theme on filesystem</b><br />&#187; %s',
'LOG_THEME_DELETE' => '<b>Theme deleted</b><br />&#187; %s',
'LOG_THEME_EDIT_DETAILS' => '<b>Edited theme details</b><br />&#187; %s',
'LOG_THEME_EDIT' => '<b>Edited theme <i>%s</i></b><br />&#187; Modified class <i>%s</i>',
'LOG_THEME_EDIT_ADD' => '<b>Edited theme <i>%s</i></b><br />&#187; Added class <i>%s</i>',
'LOG_THEME_EXPORT' => '<b>Exported theme</b><br />&#187; %s',
'LOG_USER_ACTIVE' => '<b>User activated</b><br />&#187; %s',

View file

@ -43,12 +43,23 @@ $lang = array_merge($lang, array(
'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).',
'ARCHIVE_FORMAT' => 'Archive file type',
'BACKGROUND' => 'Background',
'BACKGROUND_COLOUR' => 'Background colour',
'BACKGROUND_IMAGE' => 'Background image',
'BACKGROUND_REPEAT' => 'Background repeat',
'BOLD' => 'Bold',
'CACHE' => 'Cache',
'COPYRIGHT' => 'Copyright',
'CREATE_IMAGESET' => 'Create new imageset',
'CREATE_STYLE' => 'Create new style',
'CREATE_TEMPLATE' => 'Create new template set',
'CREATE_THEME' => 'Create new theme',
'CSS_CLASS_NAME' => 'CSS class name',
'CSS_COLOUR_EXPLAIN' => 'You can either enter a hex number for the colour or use the web safe colour swatch to select one.',
'CURRENT_IMAGE' => 'Current Image',
'CUSTOM_CLASS' => 'Custom class',
'CUSTOM_CLASS_EXPLAIN' => 'You can add additional classes to this theme if you wish. You must provide the actual CSS class name below, it must be the same as that you have or will use in your template. Please remember that class names may contain only alphanumeric characters, periods (.), colons (:), dash (-) and number/hash/pound (#). The new class will be added to class selection above.',
'DEACTIVATE_DEFAULT' => 'You cannot deactivate the default style.',
'DELETE_FROM_FS' => 'Delete from filesystem',
@ -61,6 +72,7 @@ $lang = array_merge($lang, array(
'DELETE_THEME' => 'Delete theme',
'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Additionally, if you have permission you can elect to remove the theme from the filesystem. Please note that there is no undo capability. When the theme is deleted it is gone for good. It is recommended that you first export your theme for possible future use.',
'DETAILS' => 'Details',
'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.',
'EDIT_DETAILS_IMAGESET' => 'Edit imageset details',
'EDIT_DETAILS_IMAGESET_EXPLAIN' => 'Here you can edit certain imageset details such as its name.',
@ -74,18 +86,32 @@ $lang = array_merge($lang, array(
'EDIT_IMAGESET_EXPLAIN' => 'Here you can edit the individual images which define the imageset. You can also specify dimensions for the image. Dimensions are optional, specifying them can overcome certain rendering issues with some browsers. By not specifying them you reduce the size of the database record a little.',
'EDIT_TEMPLATE' => 'Edit template',
'EDIT_TEMPLATE_EXPLAIN' => 'Here you can edit your template set directly. Please remember that these edits are permanent and cannot be undone once submitted. If PHP can write to the template files in your styles directory any changes here will be written directly to those files. If PHP cannot write to those files they will be copied into the database and all changes will only be reflected there. Please take care when editing your template set, remember to close all replacement variable terms {XXXX} and conditional statements.',
'EDIT_TEMPLATE_STORED_DB' => 'The template file was unwritable so the template set is now stored in the database containing the modified file.',
'EDIT_TEMPLATE_STORED_DB' => 'The template file was unwritable so the template set is now stored in the database containing the modified file.',
'EDIT_THEME' => 'Edit theme',
'EDIT_THEME_EXPLAIN' => 'Here you can edit the selected theme, changing colours, images, etc. You can switch between a simplified interface where you can set basic colours, etc. and a more advanced "raw CSS" mode. The raw mode allows you to add additional parameters such as borders, etc. Only set parameters you need else leave them blank or undefined.',
'EDIT_THEME_STORED_DB' => 'The stylesheet file was unwritable so the stylesheet is now stored in the database containing your modification.',
'EXPORT' => 'Export',
'FOREGROUND' => 'Foreground',
'FONT_COLOUR' => 'Font colour',
'FONT_FACE' => 'Font face',
'FONT_FACE_EXPLAIN' => 'You can specify multiple fonts seperated by commas. If a user doesn\'t have the first font installed the first other working font will be chosen.',
'FONT_SIZE' => 'Font size',
'GLOBAL_IMAGES' => 'Global',
'HIDE_CSS' => 'Hide raw CSS',
'IMAGE_CONFIGURATION' => 'Image configuration',
'IMAGE_WIDTH' => 'Image width',
'IMAGE_HEIGHT' => 'Image height',
'IMAGE' => 'Image',
'IMAGE_NAME' => 'Image name',
'IMAGE_LOCATION' => 'Image location',
'IMAGE_NAME' => 'Image name',
'IMAGE_PARAMETER' => 'Parameter',
'IMAGE_VALUE' => 'Value',
'IMAGESET_ADDED' => 'New imageset added on filesystem',
'IMAGESET_ADDED_DB' => 'New imageset added to database',
'IMAGESET_UPDATED' => 'Imageset updated successfully',
'IMAGESET_DELETED' => 'Imageset deleted successfully',
'IMAGESET_DELETED_FS' => 'Imageset removed from database but some files may remain on the filesystem',
'IMAGESET_DETAILS_UPDATED' => 'Imageset details successfully updated',
@ -100,6 +126,87 @@ $lang = array_merge($lang, array(
'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s',
'IMAGESET_NAME' => 'Imageset Name',
'IMAGESET_UPDATED' => 'Imageset updated successfully',
'ITALIC' => 'Italic',
'IMG_BTN_POST' => 'New topic',
'IMG_BTN_REPLY' => 'Reply topic',
'IMG_BTN_LOCKED' => 'Topic locked',
'IMG_BTN_POST_PM' => 'New message',
'IMG_BTN_REPLY_PM' => 'Reply message',
'IMG_BTN_DELETE' => 'Delete post',
'IMG_BTN_QUOTE' => 'Quote post',
'IMG_BTN_PROFILE' => 'Show profile',
'IMG_BTN_EMAIL' => 'Send email',
'IMG_BTN_SEARCH' => 'Search posts',
'IMG_BTN_WWW' => 'Website',
'IMG_BTN_INFO' => 'Show post details',
'IMG_BTN_EDIT' => 'Edit post',
'IMG_BTN_AIM' => 'AIM',
'IMG_BTN_ICQ' => 'ICQ',
'IMG_BTN_JABBER' => 'Jabber',
'IMG_BTN_YIM' => 'YIM',
'IMG_BTN_MSNM' => 'MSNM',
'IMG_BTN_ONLINE' => 'User online',
'IMG_BTN_OFFLINE' => 'User offline',
'IMG_BTN_REPORT' => 'Report post',
'IMG_BTN_PM' => 'Send message',
'IMG_BTN_FRIEND' => 'Add as friend',
'IMG_BTN_FOE' => 'Add as foe',
'IMG_CAT_BUTTONS' => 'Localised buttons',
'IMG_CAT_CUSTOM' => 'Custom images',
'IMG_CAT_FOLDERS' => 'Topic icons',
'IMG_CAT_FORUMS' => 'Forum icons',
'IMG_CAT_ICONS' => 'General icons',
'IMG_CAT_KARMA' => 'Karma images',
'IMG_CAT_LOGOS' => 'Logos',
'IMG_CAT_POLLS' => 'Polling images',
'IMG_FOLDER' => 'Topic',
'IMG_FOLDER_ANNOUNCE' => 'Announcement',
'IMG_FOLDER_ANNOUNCE_NEW' => 'Announcement new posts',
'IMG_FOLDER_ANNOUNCE_POSTED' => 'Announcement posted to',
'IMG_FOLDER_ANNOUNCE_NEW_POSTED' => 'Announcement posted to new',
'IMG_FOLDER_GLOBAL' => 'Global',
'IMG_FOLDER_GLOBAL_NEW' => 'Global new posts',
'IMG_FOLDER_GLOBAL_POSTED' => 'Global posted to',
'IMG_FOLDER_GLOBAL_NEW_POSTED' => 'Global posted to new',
'IMG_FOLDER_HOT' => 'Topic hot',
'IMG_FOLDER_HOT_NEW' => 'Topic hot new posts',
'IMG_FOLDER_HOT_POSTED' => 'Topic hot posted to',
'IMG_FOLDER_HOT_NEW_POSTED' => 'Topic hot posted to new',
'IMG_FOLDER_LOCKED' => 'Topic locked',
'IMG_FOLDER_LOCKED_NEW' => 'Topic locked new',
'IMG_FOLDER_LOCKED_POSTED' => 'Topic locked posted to',
'IMG_FOLDER_LOCKED_NEW_POSTED' => 'Topic locked posted to new',
'IMG_FOLDER_NEW' => 'Topic new posts',
'IMG_FOLDER_NEW_POSTED' => 'Topic posted to new',
'IMG_FOLDER_POSTED' => 'Topic posted to',
'IMG_FOLDER_STICKY' => 'Sticky topic',
'IMG_FOLDER_STICKY_POSTED' => 'Sticky topic posted to',
'IMG_FOLDER_STICKY_NEW' => 'Sticky topic new posts',
'IMG_FOLDER_STICKY_NEW_POSTED' => 'Sticky topic posted to new',
'IMG_FORUM' => 'Forum',
'IMG_FORUM_NEW' => 'Forum new posts',
'IMG_FORUM_LOCKED' => 'Forum locked',
'IMG_FORUM_LINK' => 'Forum link',
'IMG_ICON_UNAPPROVED' => 'Post unapproved',
'IMG_ICON_REPORTED' => 'Post reported',
'IMG_ICON_ATTACH' => 'Attachment',
'IMG_ICON_POST' => 'Minipost',
'IMG_ICON_POST_NEW' => 'New minipost',
'IMG_ICON_POST_LATEST' => 'Last post',
'IMG_ICON_POST_NEWEST' => 'Newest post',
'IMG_KARMA_LEFT' => 'Karma left end',
'IMG_KARMA_CENTER' => 'Karma centre',
'IMG_KARMA_RIGHT' => 'Karma right end',
'IMG_POLL_LEFT' => 'Poll left end',
'IMG_POLL_RIGHT' => 'Poll right end',
'IMG_POLL_CENTER' => 'Poll centre',
'IMG_SITE_LOGO' => 'Main Logo',
'IMG_SUB_FORUM' => 'Subforum',
'IMG_SUB_FORUM_NEW' => 'Subforum new posts',
'INCLUDE_DIMENSIONS' => 'Include dimensions',
'INCLUDE_IMAGESET' => 'Include imageset',
'INCLUDE_TEMPLATE' => 'Include template',
'INCLUDE_THEME' => 'Include theme',
@ -116,8 +223,12 @@ $lang = array_merge($lang, array(
'INSTALLED_TEMPLATE' => 'Installed templates',
'INSTALLED_THEME' => 'Installed themes',
'LINE_SPACING' => 'Line spacing',
'LOCALISED_IMAGES' => 'Localised',
'EDITED_IMAGESET' => 'Edited imageset',
'NO_CLASS' => 'Cannot find class in stylesheet',
'NO_IMAGESET' => 'Cannot find imageset on filesystem',
'NO_IMAGE' => 'No Image',
'NO_STYLE' => 'Cannot find style on filesystem',
@ -135,6 +246,10 @@ $lang = array_merge($lang, array(
'OPTIONAL_BASIS' => 'Optional basis',
'REFRESH' => 'Refresh',
'REPEAT_NO' => 'None',
'REPEAT_X' => 'Only horizontally',
'REPEAT_Y' => 'Only vertically',
'REPEAT_ALL' => 'Both directions',
'REPLACE_IMAGESET' => 'Replace imageset with',
'REPLACE_IMAGESET_EXPLAIN' => 'This imageset will replace the one you are deleting in any styles that use it.',
'REPLACE_STYLE' => 'Replace style with',
@ -147,8 +262,16 @@ $lang = array_merge($lang, array(
'REQUIRES_TEMPLATE' => 'This style requires the %s template set to be installed.',
'REQUIRES_THEME' => 'This style requires the %s theme to be installed.',
'SELECT_IMAGE' => 'Select image',
'SELECT_TEMPLATE' => 'Select template file',
'SELECTED_TEMPLATE' => 'Selected template file',
'SELECT_CLASS' => 'Select CSS class',
'SELECTED_IMAGE' => 'Selected Image',
'SELECTED_IMAGESET' => 'Selected imageset',
'SELECTED_TEMPLATE' => 'Selected template',
'SELECTED_TEMPLATE_FILE' => 'Selected template file',
'SELECTED_THEME' => 'Selected theme',
'SELECTED_CLASS' => 'Selected CSS class',
'SHOW_CSS' => 'Show raw CSS',
'STORE_DATABASE' => 'Database',
'STORE_FILESYSTEM' => 'Filesystem',
'STYLE_ACTIVATE' => 'Activate',
@ -204,7 +327,10 @@ $lang = array_merge($lang, array(
'THEME_DELETED' => 'Theme deleted successfully',
'THEME_DELETED_FS' => 'Theme removed from database but files remain on the filesystem',
'THEME_DETAILS_UPDATED' => 'Theme details successfully updated',
'THEME_EDITOR' => 'Raw CSS theme editor',
'THEME_EDITOR_HEIGHT' => 'Theme editor height',
'THEME_ERR_ARCHIVE' => 'Please select an archive method',
'THEME_ERR_CLASS_CHARS' => 'Only alphanumeric characters plus ., :, - and # are valid in class names.',
'THEME_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters',
'THEME_ERR_NAME_CHARS' => 'The theme name can only contain alphanumeric characters, -, +, _ and space',
'THEME_ERR_NAME_EXIST' => 'A theme with that name already exists',
@ -217,100 +343,16 @@ $lang = array_merge($lang, array(
'THEME_LOCATION' => 'Store stylesheet in',
'THEME_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.',
'THEME_NAME' => 'Theme Name',
'THEME_CLASS_ADDED' => 'Custom class added successfully',
'THEME_UPDATED' => 'Class updated successfully',
'UNDERLINE' => 'Underline',
'UNINSTALLED_IMAGESET' => 'Uninstalled imagesets',
'UNINSTALLED_STYLE' => 'Uninstalled styles',
'UNINSTALLED_TEMPLATE' => 'Uninstalled templates',
'UNINSTALLED_THEME' => 'Uninstalled themes',
'UNSET' => 'Undefined',
// Imageset data
'SELECTED_IMAGESET' => 'Selected imageset',
'SELECT_IMAGE' => 'Select image',
'IMAGE' => 'Image',
'CURRENT_IMAGE' => 'Current Image',
'SELECTED_IMAGE' => 'Selected Image',
'INCLUDE_DIMENSIONS' => 'Include dimensions',
'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.',
'IMAGE_PARAMETER' => 'Parameter',
'IMAGE_VALUE' => 'Value',
'LOCALISED_IMAGES' => 'Localised',
'GLOBAL_IMAGES' => 'Global',
'IMG_CAT_LOGOS' => 'Logos',
'IMG_SITE_LOGO' => 'Main Logo',
'IMG_CAT_BUTTONS' => 'Localised buttons',
'IMG_BTN_POST' => 'New topic',
'IMG_BTN_REPLY' => 'Reply topic',
'IMG_BTN_LOCKED' => 'Topic locked',
'IMG_BTN_POST_PM' => 'New message',
'IMG_BTN_REPLY_PM' => 'Reply message',
'IMG_BTN_DELETE' => 'Delete post',
'IMG_BTN_QUOTE' => 'Quote post',
'IMG_BTN_PROFILE' => 'Show profile',
'IMG_BTN_EMAIL' => 'Send email',
'IMG_BTN_SEARCH' => 'Search posts',
'IMG_BTN_WWW' => 'Website',
'IMG_BTN_INFO' => 'Show post details',
'IMG_BTN_EDIT' => 'Edit post',
'IMG_BTN_AIM' => 'AIM',
'IMG_BTN_ICQ' => 'ICQ',
'IMG_BTN_JABBER' => 'Jabber',
'IMG_BTN_YIM' => 'YIM',
'IMG_BTN_MSNM' => 'MSNM',
'IMG_BTN_ONLINE' => 'User online',
'IMG_BTN_OFFLINE' => 'User offline',
'IMG_BTN_REPORT' => 'Report post',
'IMG_BTN_PM' => 'Send message',
'IMG_BTN_FRIEND' => 'Add as friend',
'IMG_BTN_FOE' => 'Add as foe',
'IMG_CAT_ICONS' => 'General icons',
'IMG_ICON_UNAPPROVED' => 'Post unapproved',
'IMG_ICON_REPORTED' => 'Post reported',
'IMG_ICON_ATTACH' => 'Attachment',
'IMG_ICON_POST' => 'Minipost',
'IMG_ICON_POST_NEW' => 'New minipost',
'IMG_ICON_POST_LATEST' => 'Last post',
'IMG_ICON_POST_NEWEST' => 'Newest post',
'IMG_CAT_FORUMS' => 'Forum icons',
'IMG_FORUM' => 'Forum',
'IMG_FORUM_NEW' => 'Forum new posts',
'IMG_FORUM_LOCKED' => 'Forum locked',
'IMG_FORUM_LINK' => 'Forum link',
'IMG_SUB_FORUM' => 'Subforum',
'IMG_SUB_FORUM_NEW' => 'Subforum new posts',
'IMG_CAT_FOLDERS' => 'Topic icons',
'IMG_FOLDER' => 'Topic',
'IMG_FOLDER_NEW' => 'Topic new posts',
'IMG_FOLDER_LOCKED' => 'Topic locked',
'IMG_FOLDER_POSTED' => 'Topic posted to',
'IMG_FOLDER_NEW_POSTED' => 'Topic posted to new',
'IMG_FOLDER_LOCKED_NEW' => 'Topic locked new',
'IMG_FOLDER_LOCKED_POSTED' => 'Topic locked posted to',
'IMG_FOLDER_LOCKED_NEW_POSTED' => 'Topic locked posted to new',
'IMG_FOLDER_HOT' => 'Topic hot',
'IMG_FOLDER_HOT_NEW' => 'Topic hot new posts',
'IMG_FOLDER_HOT_POSTED' => 'Topic hot posted to',
'IMG_FOLDER_HOT_NEW_POSTED' => 'Topic hot posted to new',
'IMG_FOLDER_STICKY' => 'Sticky topic',
'IMG_FOLDER_STICKY_POSTED' => 'Sticky topic posted to',
'IMG_FOLDER_STICKY_NEW' => 'Sticky topic new posts',
'IMG_FOLDER_STICKY_NEW_POSTED' => 'Sticky topic posted to new',
'IMG_FOLDER_ANNOUNCE' => 'Announcement',
'IMG_FOLDER_ANNOUNCE_NEW' => 'Announcement new posts',
'IMG_FOLDER_ANNOUNCE_POSTED' => 'Announcement posted to',
'IMG_FOLDER_ANNOUNCE_NEW_POSTED' => 'Announcement posted to new',
'IMG_FOLDER_GLOBAL' => 'Global',
'IMG_FOLDER_GLOBAL_NEW' => 'Global new posts',
'IMG_FOLDER_GLOBAL_POSTED' => 'Global posted to',
'IMG_FOLDER_GLOBAL_NEW_POSTED' => 'Global posted to new',
'IMG_CAT_POLLS' => 'Polling images',
'IMG_POLL_LEFT' => 'Poll left end',
'IMG_POLL_RIGHT' => 'Poll right end',
'IMG_POLL_CENTER' => 'Poll centre',
'IMG_CAT_KARMA' => 'Karma images',
'IMG_KARMA_LEFT' => 'Karma left end',
'IMG_KARMA_CENTER' => 'Karma centre',
'IMG_KARMA_RIGHT' => 'Karma right end',
'IMG_CAT_CUSTOM' => 'Custom images',
));
?>

View file

@ -84,7 +84,7 @@ if ($id && $sid)
exit;
}
$force_load = true; // Ideally this needs to be based on $config['load_tplcompile']
/*$force_load = true; // Ideally this needs to be based on $config['load_tplcompile']
if ($theme['theme_mtime'] < filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css') || $force_load)
{
@ -103,10 +103,10 @@ if ($id && $sid)
}
$sql = "UPDATE {$table_prefix}styles_theme
SET theme_data = '" . $db->sql_escape($theme['theme_data']) . "', theme_mtime = " . time() . "
SET theme_data = '" . $db->sql_escape(str_replace('./', "styles/{$theme['theme_path']}/theme/", $theme['theme_data'])) . "', theme_mtime = " . time() . "
WHERE theme_id = $id";
$db->sql_query($sql);
}
}*/
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
header('Content-type: text/css');