mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
A little more thinking out loud ... regular users are welcome to give feedback via area51
git-svn-id: file:///svn/phpbb/trunk@4088 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
bf99fa324f
commit
99910d51cb
1 changed files with 413 additions and 270 deletions
|
@ -8,10 +8,10 @@ if ( !empty($setmodules) )
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = basename(__FILE__);
|
$filename = basename(__FILE__);
|
||||||
$module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=newstyle";
|
$module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=styles";
|
||||||
$module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=edittemplate";
|
$module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=templates";
|
||||||
$module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=edittheme";
|
$module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=themes";
|
||||||
$module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=editimageset";
|
$module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=imagesets";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ if (!$auth->acl_get('a_styles'))
|
||||||
|
|
||||||
//
|
//
|
||||||
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
||||||
|
$action = (isset($_REQUEST['action'])) ? htmlspecialchars($_REQUEST['action']) : '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,9 +136,23 @@ switch ($mode)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edittemplate':
|
|
||||||
|
|
||||||
$tplcols = (isset($_POST['tplcols'])) ? max(60, intval($_POST['tplcols'])) : 90;
|
|
||||||
|
|
||||||
|
|
||||||
|
case 'templates':
|
||||||
|
|
||||||
|
$template_id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : '';
|
||||||
|
|
||||||
|
switch ($action)
|
||||||
|
{
|
||||||
|
case 'preview':
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'edit':
|
||||||
|
|
||||||
|
$tplcols = (isset($_POST['tplcols'])) ? max(60, intval($_POST['tplcols'])) : 76;
|
||||||
$tplrows = (isset($_POST['tplrows'])) ? max(4, intval($_POST['tplrows'])) : 30;
|
$tplrows = (isset($_POST['tplrows'])) ? max(4, intval($_POST['tplrows'])) : 30;
|
||||||
$tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
|
$tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
|
||||||
$tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
|
$tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
|
||||||
|
@ -200,7 +215,7 @@ switch ($mode)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$tplroot_options = get_templates($tplroot);
|
// $tplroot_options = get_templates($tplroot);
|
||||||
|
|
||||||
$tplname_options = '';
|
$tplname_options = '';
|
||||||
$dp = @opendir($phpbb_root_path . 'cache/templates/' . $tplroot . '/');
|
$dp = @opendir($phpbb_root_path . 'cache/templates/' . $tplroot . '/');
|
||||||
|
@ -224,11 +239,7 @@ switch ($mode)
|
||||||
|
|
||||||
<p><?php echo $user->lang['Edit_template_explain']; ?></p>
|
<p><?php echo $user->lang['Edit_template_explain']; ?></p>
|
||||||
|
|
||||||
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=edittemplate"; ?>">
|
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=edit"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||||
|
|
||||||
<p><?php echo $user->lang['Select_template']; ?>: <select name="tplroot"><?php echo $tplroot_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="Select" /></p>
|
|
||||||
|
|
||||||
<table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -252,202 +263,58 @@ switch ($mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'delete':
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'export':
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 'edittheme':
|
|
||||||
|
|
||||||
$theme_id = (isset($_POST['themeroot'])) ? $_POST['themeroot'] : '';
|
|
||||||
|
|
||||||
if (isset($_POST['update']))
|
|
||||||
{
|
|
||||||
$sql = "SELECT theme_id, theme_name
|
|
||||||
FROM " . STYLES_CSS_TABLE . "
|
|
||||||
WHERE theme_id = $theme_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$theme_name = $row['theme_name'];
|
|
||||||
|
|
||||||
$css_data = (!empty($_POST['css_data'])) ? htmlentities($_POST['css_data']) : '';
|
|
||||||
$css_external = (!empty($_POST['css_data'])) ? $_POST['css_data'] : '';
|
|
||||||
|
|
||||||
$sql = "UPDATE " > STYLES_CSS_TABLE . "
|
|
||||||
SET css_data = '$css_data', css_external = '$css_external'
|
|
||||||
WHERE theme_id = $theme_id";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
add_log('admin', 'log_theme_edit', $theme_name);
|
|
||||||
|
|
||||||
message_die(MESSAGE, $user->lang['Success_theme_update']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
adm_page_header($user->lang['Edit_theme']);
|
adm_page_header($user->lang['EDIT_TEMPLATE']);
|
||||||
|
|
||||||
$sql = "SELECT theme_id, theme_name
|
?>
|
||||||
FROM " . STYLES_CSS_TABLE;
|
<h2><?php echo $user->lang['Edit_template']; ?></h2>
|
||||||
|
|
||||||
|
<p><?php echo $user->lang['Edit_template_explain']; ?></p>
|
||||||
|
|
||||||
|
<form name="templates" method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<th>Template name</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = 'SELECT template_id, template_name
|
||||||
|
FROM ' . STYLES_TPL_TABLE;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$theme_options = '';
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
$theme_options .= (($theme_options != '') ? ', ' : '') . '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>';
|
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=edit&id=" . $row['template_id']; ?>"><?php echo $row['template_name']; ?></a></td>
|
||||||
|
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=bbcode&id=" . $row['template_id']; ?>">BBCode</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=delete&id=" . $row['template_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=export&id=" . $row['template_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=templates&action=preview&id=" . $row['template_id']; ?>">Preview</a> </td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
while ($row = $db->sql_fetchrow($result));
|
while ($row = $db->sql_fetchrow($result));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$css_data = '';
|
|
||||||
$css_external = '';
|
|
||||||
if ($theme_id)
|
|
||||||
{
|
|
||||||
$sql = "SELECT css_data, css_external
|
|
||||||
FROM " . STYLES_CSS_TABLE . "
|
|
||||||
WHERE theme_id = $theme_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']);
|
|
||||||
$css_external = $row['css_external'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$user->lang = array_merge($user->lang, array(
|
|
||||||
'SELECT_CLASS' => 'Select class',
|
|
||||||
'style_body' => 'Body',
|
|
||||||
'style_p' => 'Paragraphs',
|
|
||||||
'style_th' => 'Table Header Cell',
|
|
||||||
'style_td' => 'Table Data Cell',
|
|
||||||
'style_postdetails' => 'Post Information',
|
|
||||||
'style_postbody' => 'Post text',
|
|
||||||
'style_gen' => 'General Text',
|
|
||||||
'style_genmed' => 'Medium Text',
|
|
||||||
'style_gensmall' => 'Small Text',
|
|
||||||
'style_copyright' => 'Copyright Text',
|
|
||||||
|
|
||||||
));
|
|
||||||
|
|
||||||
$base_classes = array(
|
|
||||||
'body',
|
|
||||||
'p',
|
|
||||||
'th',
|
|
||||||
'td',
|
|
||||||
'postdetails',
|
|
||||||
'postbody',
|
|
||||||
'gen',
|
|
||||||
'gensmall',
|
|
||||||
'copyright'
|
|
||||||
);
|
|
||||||
|
|
||||||
$class_options = '';
|
|
||||||
foreach ($base_classes as $class)
|
|
||||||
{
|
|
||||||
$class_options .= '<option value="' . $class . '">' . $user->lang['style_' . $class] . '</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$imglist = filelist($phpbb_root_path . 'templates');
|
|
||||||
|
|
||||||
$bg_imglist = '';
|
|
||||||
foreach ($imglist as $img)
|
|
||||||
{
|
|
||||||
$img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file'];
|
|
||||||
|
|
||||||
// $selected = ' selected="selected"';
|
|
||||||
$bg_imglist .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
|
|
||||||
}
|
|
||||||
$bg_imglist = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>----------</option>' . $bg_imglist;
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script language="javascript" type="text/javascript">
|
|
||||||
<!--
|
|
||||||
|
|
||||||
function swatch(field)
|
|
||||||
{
|
|
||||||
window.open('./swatch.php?form=style&name=' + field, '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-->
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h2><?php echo $user->lang['Edit_theme']; ?></h2>
|
|
||||||
|
|
||||||
<p><?php echo $user->lang['Edit_theme_explain']; ?></p>
|
|
||||||
|
|
||||||
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"><table width="95%" cellspacing="1" cellpadding="1" border="0" align="center">
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right"><?php echo $user->lang['SELECT_CLASS']; ?>: <select name="class"><?php echo $class_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['SELECT']; ?>" tabindex="100" /></td>
|
<td class="cat" colspan="2"> </td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
|
||||||
<tr>
|
|
||||||
<th>Parameter</th>
|
|
||||||
<th>Value</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Background image:</td>
|
|
||||||
<td class="row2"><select name="backgroundimage"><?php echo $bg_imglist ?></select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Repeat background:</td>
|
|
||||||
<td class="row2"><select name="repeat"><option value="no">No</option><option value="x">Horizontally Only</option><option value="y">Vertically Only</option><option value="yes">Both Directions</option></select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Background color:</td>
|
|
||||||
<td class="row2"><input class="post" type="text" name="bgcolor" value="" size="6" maxlength="6" /> [ <a href="swatch.php" onclick="swatch('bgcolor');return false" target="_swatch">Web-safe Colour Swatch</a> ]</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Foreground color:</td>
|
|
||||||
<td class="row2"><input class="post" type="text" name="color" value="" size="6" maxlength="6" /> [ <a href="swatch.php" onclick="swatch('color');return false" target="_swatch">Web-safe Colour Swatch</a> ]</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Font:</td>
|
|
||||||
<td class="row2"><input class="post" type="text" name="fontface" value="" size="40" maxlength="255" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Font size:</td>
|
|
||||||
<td class="row2"><input class="post" type="text" name="fontsize" value="" size="3" maxlength="3" /> <select name="fontsizescale"><option value="pt">pt</option><option value="px">px</option><option value="em">em</option><option value="%">%</option></select></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Font Bold:</td>
|
|
||||||
<td class="row2"><input type="radio" name="bold" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="bold" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Font Italic:</td>
|
|
||||||
<td class="row2"><input type="radio" name="italic" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="italic" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Font Underline:</td>
|
|
||||||
<td class="row2"><input type="radio" name="underline" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="underline" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="row1">Line spacing:</td>
|
|
||||||
<td class="row2"><input class="post" type="text" name="linespacing" value="" size="3" maxlength="3" /> <select name="linespacingscale"><option value="pt">pt</option><option value="px">px</option><option value="em">em</option><option value="%">%</option></select></td>
|
|
||||||
</tr>
|
|
||||||
<!-- tr>
|
|
||||||
<td class="row1" width="40%">Advanced: <br /><span class="gensmall">Enter here any additional CSS parameters and their values. Enter each parameter on a new row and terminate each with semi-colon ;</td>
|
|
||||||
<td class="row2"><textarea name="freeform" cols="40" rows="3"></textarea></td>
|
|
||||||
</tr -->
|
|
||||||
<tr>
|
|
||||||
<td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
|
|
||||||
</tr>
|
|
||||||
</table></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
|
@ -465,27 +332,303 @@ function swatch(field)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
case 'themes':
|
||||||
|
|
||||||
|
$theme_id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : '';
|
||||||
|
|
||||||
//
|
switch ($action)
|
||||||
function get_templates($tplroot = '')
|
{
|
||||||
{
|
case 'preview':
|
||||||
global $db;
|
|
||||||
|
break;
|
||||||
$sql = "SELECT template_name, template_path
|
|
||||||
FROM " . STYLES_TPL_TABLE . "
|
case 'edit':
|
||||||
ORDER BY template_name";
|
|
||||||
$result = $db->sql_query($sql);
|
if (isset($_POST['update']))
|
||||||
|
|
||||||
$tplroot_options = '';
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
{
|
||||||
$selected = ($tplroot == $row['template_path']) ? ' selected="selected"' : '';
|
|
||||||
$tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tplroot_options;
|
|
||||||
|
$class = (isset($_POST['classname'])) ? htmlspecialchars($_POST['classname']) : '';
|
||||||
|
|
||||||
|
if ($theme_id)
|
||||||
|
{
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . STYLES_CSS_TABLE . "
|
||||||
|
WHERE theme_id = $theme_id";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($theme_data = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->lang = array_merge($user->lang, array(
|
||||||
|
'SELECT_CLASS' => 'Select class',
|
||||||
|
|
||||||
|
'style_cat_general' => 'General classes',
|
||||||
|
'style_cat_bbcode' => 'BBCode classes',
|
||||||
|
'style_body' => 'Body',
|
||||||
|
'style_p' => 'Paragraphs',
|
||||||
|
'style_th' => 'Table Header Cell',
|
||||||
|
'style_td' => 'Table Data Cell',
|
||||||
|
'style_postdetails' => 'Post Information',
|
||||||
|
'style_postbody' => 'Post text',
|
||||||
|
'style_gen' => 'General Text',
|
||||||
|
'style_genmed' => 'Medium Text',
|
||||||
|
'style_gensmall' => 'Small Text',
|
||||||
|
'style_copyright' => 'Copyright Text',
|
||||||
|
|
||||||
|
'style_b' => 'Bold',
|
||||||
|
'style_u' => 'Underline',
|
||||||
|
'style_i' => 'Italics',
|
||||||
|
'style_color' => 'Colour',
|
||||||
|
'style_size' => 'Size',
|
||||||
|
'style_code' => 'Code',
|
||||||
|
'style_quote' => 'Quote',
|
||||||
|
'style_flash' => 'Flash',
|
||||||
|
'style_syntaxbg' => 'Syntax Background',
|
||||||
|
'style_syntaxcomment' => 'Syntax Comments',
|
||||||
|
'style_syntaxdefault' => 'Syntax Default',
|
||||||
|
'style_syntaxhtml' => 'Syntax HTML',
|
||||||
|
'style_syntaxkeyword' => 'Syntax Keyword',
|
||||||
|
'style_syntaxstring' => 'Syntax String',
|
||||||
|
|
||||||
|
));
|
||||||
|
|
||||||
|
$base_classes = array(
|
||||||
|
'general' => array(
|
||||||
|
'body',
|
||||||
|
'p',
|
||||||
|
'th',
|
||||||
|
'td',
|
||||||
|
'postdetails',
|
||||||
|
'postbody',
|
||||||
|
'gen',
|
||||||
|
'gensmall',
|
||||||
|
'copyright'
|
||||||
|
),
|
||||||
|
'bbcode' => array(
|
||||||
|
'b',
|
||||||
|
'u',
|
||||||
|
'i',
|
||||||
|
'color',
|
||||||
|
'size',
|
||||||
|
'code',
|
||||||
|
'quote',
|
||||||
|
'flash',
|
||||||
|
'syntaxbg',
|
||||||
|
'syntaxcomment',
|
||||||
|
'syntaxdefault',
|
||||||
|
'syntaxhtml',
|
||||||
|
'syntaxkeyword',
|
||||||
|
'syntaxstring',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$class_options = '';
|
||||||
|
foreach ($base_classes as $category => $class_ary)
|
||||||
|
{
|
||||||
|
$class_options .= '<option class="sep">' . $user->lang['style_cat_' . $category] . '</option>';
|
||||||
|
foreach ($class_ary as $class_name)
|
||||||
|
{
|
||||||
|
$selected = ($class_name == $class) ? ' selected="selected"' : '';
|
||||||
|
$class_options .= '<option value="' . $class_name . '"' . $selected . '>' . $user->lang['style_' . $class_name] . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grab list of potential images for class backgrounds
|
||||||
|
$imglist = filelist($phpbb_root_path . 'templates');
|
||||||
|
|
||||||
|
$bg_imglist = '';
|
||||||
|
foreach ($imglist as $img)
|
||||||
|
{
|
||||||
|
$img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file'];
|
||||||
|
|
||||||
|
// $selected = ' selected="selected"';
|
||||||
|
$bg_imglist .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
|
||||||
|
}
|
||||||
|
$bg_imglist = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>' . $user->lang['NONE'] . '</option>' . $bg_imglist;
|
||||||
|
|
||||||
|
|
||||||
|
// Output the page
|
||||||
|
adm_page_header($user->lang['EDIT_THEME']);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script language="javascript" type="text/javascript">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
function swatch(field)
|
||||||
|
{
|
||||||
|
window.open('./swatch.php?form=style&name=' + field, '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<h2><?php echo $user->lang['Edit_theme']; ?></h2>
|
||||||
|
|
||||||
|
<p><?php echo $user->lang['Edit_theme_explain']; ?></p>
|
||||||
|
|
||||||
|
<p>Selected Theme: <b><?php echo $theme_data['theme_name']; ?></b></p>
|
||||||
|
|
||||||
|
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=$action&id=$theme_id"; ?>"><table width="95%" cellspacing="1" cellpadding="1" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<td align="right"><?php echo $user->lang['SELECT_CLASS']; ?>: <select name="classname" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();"><?php echo $class_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['SELECT']; ?>" tabindex="100" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<th>Parameter</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2"><b>Background</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="40%"><b>Color:</b> <br /><span class="gensmall">This is a hex-triplet of the form RRGGBB</span></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="bgcolor" value="" size="6" maxlength="6" /> [ <a href="swatch.php" onclick="swatch('bgcolor');return false" target="_swatch">Web-safe Colour Swatch</a> ]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Image:</b></td>
|
||||||
|
<td class="row2"><select name="backgroundimage"><?php echo $bg_imglist ?></select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Repeat background:</b></td>
|
||||||
|
<td class="row2"><select name="repeat"><option value="no">No</option><option value="x">Horizontally Only</option><option value="y">Vertically Only</option><option value="yes">Both Directions</option></select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2"><b>Text</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="40%"><b>Color:</b> <br /><span class="gensmall">This is a hex-triplet of the form RRGGBB</span></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="color" value="" size="6" maxlength="6" /> [ <a href="swatch.php" onclick="swatch('color');return false" target="_swatch">Web-safe Colour Swatch</a> ]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="40%"><b>Font:</b> <br /><span class="gensmall">You can specify multiple fonts seperated by commas</span></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="fontface" value="" size="40" maxlength="255" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Size:</b></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="fontsize" value="" size="3" maxlength="3" /> <select name="fontsizescale"><option value="pt">pt</option><option value="px">px</option><option value="em">em</option><option value="%">%</option></select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Bold:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="bold" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="bold" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Italic:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="italic" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="italic" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Underline:</b></td>
|
||||||
|
<td class="row2"><input type="radio" name="underline" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="underline" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Line spacing:</b></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="linespacing" value="" size="3" maxlength="3" /> <select name="linespacingscale"><option value="pt">pt</option><option value="px">px</option><option value="em">em</option><option value="%">%</option></select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2"><b>Borders</b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="40%"><b>Color:</b> <br /><span class="gensmall">This is a hex-triplet of the form RRGGBB</span></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="bordercolor" value="" size="6" maxlength="6" /> [ <a href="swatch.php" onclick="swatch('bordercolor');return false" target="_swatch">Web-safe Colour Swatch</a> ]</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Width:</b></td>
|
||||||
|
<td class="row2"><input class="post" type="text" name="borderwidth" value="" size="2" maxlength="2" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1"><b>Style:</b></td>
|
||||||
|
<td class="row2"><select name="borderstyle"><option value="none">None</option><option value="solid">Solid</option><option value="dashed">Dashed</option><option value="dotted">Dotted</option></select></td>
|
||||||
|
</tr>
|
||||||
|
<!-- tr>
|
||||||
|
<td class="row1" width="40%">Advanced: <br /><span class="gensmall">Enter here any additional CSS parameters and their values. Enter each parameter on a new row and terminate each with semi-colon ;</td>
|
||||||
|
<td class="row2"><textarea name="freeform" cols="40" rows="3"></textarea></td>
|
||||||
|
</tr -->
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="submit" name="preview" value="<?php echo $user->lang['PREVIEW']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
|
</tr>
|
||||||
|
</table></form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
adm_page_footer();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'delete':
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'export':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
adm_page_header($user->lang['EDIT_THEME']);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<h2><?php echo $user->lang['Edit_theme']; ?></h2>
|
||||||
|
|
||||||
|
<p><?php echo $user->lang['Edit_theme_explain']; ?></p>
|
||||||
|
|
||||||
|
<p>Selected Theme: <b>subSilver</b></p>
|
||||||
|
|
||||||
|
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
|
<tr>
|
||||||
|
<th>Theme name</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql = 'SELECT theme_id, theme_name
|
||||||
|
FROM ' . STYLES_CSS_TABLE;
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=edit&id=" . $row['theme_id']; ?>"><?php echo $row['theme_name']; ?></a></td>
|
||||||
|
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=recreate&id=" . $row['theme_id']; ?>">Recreate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=delete&id=" . $row['theme_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=export&id=" . $row['theme_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=preview&id=" . $row['theme_id']; ?>">Preview</a> </td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
while ($row = $db->sql_fetchrow($result));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2"> </td>
|
||||||
|
</tr>
|
||||||
|
</table></form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
adm_page_footer();
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue