aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/admin_styles.php563
1 files changed, 353 insertions, 210 deletions
diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php
index 7fbf6a9e0d..953052f207 100644
--- a/phpBB/adm/admin_styles.php
+++ b/phpBB/adm/admin_styles.php
@@ -8,10 +8,10 @@ if ( !empty($setmodules) )
}
$filename = basename(__FILE__);
- $module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=newstyle";
- $module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=edittemplate";
- $module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=edittheme";
- $module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=editimageset";
+ $module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=styles";
+ $module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=templates";
+ $module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=themes";
+ $module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=imagesets";
return;
}
@@ -30,6 +30,7 @@ if (!$auth->acl_get('a_styles'))
//
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
+$action = (isset($_REQUEST['action'])) ? htmlspecialchars($_REQUEST['action']) : '';
@@ -135,88 +136,102 @@ switch ($mode)
break;
- case 'edittemplate':
- $tplcols = (isset($_POST['tplcols'])) ? max(60, intval($_POST['tplcols'])) : 90;
- $tplrows = (isset($_POST['tplrows'])) ? max(4, intval($_POST['tplrows'])) : 30;
- $tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
- $tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
- $str = '';
- if (isset($_POST['tpl_compile']) && !empty($_POST['decompile']))
- {
- $str = "<?php\n" . $template->compile(stripslashes($_POST['decompile'])) . "\n?".">";
-
- $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'w+');
- fwrite ($fp, $str);
- fclose($fp);
- @chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644);
- add_log('admin', 'log_template_edit', $tplname, $tplroot);
+ case 'templates':
- exit;
- }
- else if (!empty($tplname) && isset($_POST['tpl_name']))
- {
- $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r');
- while (!feof($fp))
- {
- $str .= fread($fp, 4096);
- }
- @fclose($fp);
-
- $match_preg = array(
- '#\$this\->_tpl_include\(\'(.*?)\'\);#',
- '#echo \$this->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\];#',
- '#echo \(\(isset\(\$this\->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\]\)\).*?;#',
- '#if \(.*?\[\'\.\'\]\[0\]\[\'(.*?)\'\]\) \{ #',
- '#\$_(.*?)_count.*?;if \(.*?\)\{#',
- );
-
- $replace_preg = array(
- '<!-- INCLUDE $1 -->',
- '{$1}',
- '{$1}',
- '<!-- IF \1 -->',
- '<!-- BEGIN \1 -->',
- );
-
- $str = preg_replace($match_preg, $replace_preg, $str);
- $str = str_replace('<?php ', '', $str);
- $str = str_replace(' ?>', '', $str);
- }
- else
- {
- $str = (!empty($_POST['decompile'])) ? stripslashes($_POST['decompile']) : '';
- }
+ $template_id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : '';
- if (isset($_POST['tpl_download']))
+ switch ($action)
{
- header("Content-Type: text/html; name=\"" . $tplname . ".html\"");
- header("Content-disposition: attachment; filename=" . $tplname . ".html");
- echo $str;
- exit;
-
- }
-
- $tplroot_options = get_templates($tplroot);
-
- $tplname_options = '';
- $dp = @opendir($phpbb_root_path . 'cache/templates/' . $tplroot . '/');
- while ($file = readdir($dp))
- {
- if (strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $file))
- {
- $tpl = substr($file, 0, strpos($file, '.'));
- $selected = ($tplname == $tpl) ? ' selected="selected"' : '';
- $tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
- }
- }
- closedir($dp);
-
- //
- adm_page_header($user->lang['Edit_template']);
+ 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;
+ $tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
+ $tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
+
+ $str = '';
+ if (isset($_POST['tpl_compile']) && !empty($_POST['decompile']))
+ {
+ $str = "<?php\n" . $template->compile(stripslashes($_POST['decompile'])) . "\n?".">";
+
+ $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'w+');
+ fwrite ($fp, $str);
+ fclose($fp);
+
+ @chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644);
+
+ add_log('admin', 'log_template_edit', $tplname, $tplroot);
+
+ exit;
+ }
+ else if (!empty($tplname) && isset($_POST['tpl_name']))
+ {
+ $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r');
+ while (!feof($fp))
+ {
+ $str .= fread($fp, 4096);
+ }
+ @fclose($fp);
+
+ $match_preg = array(
+ '#\$this\->_tpl_include\(\'(.*?)\'\);#',
+ '#echo \$this->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\];#',
+ '#echo \(\(isset\(\$this\->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\]\)\).*?;#',
+ '#if \(.*?\[\'\.\'\]\[0\]\[\'(.*?)\'\]\) \{ #',
+ '#\$_(.*?)_count.*?;if \(.*?\)\{#',
+ );
+
+ $replace_preg = array(
+ '<!-- INCLUDE $1 -->',
+ '{$1}',
+ '{$1}',
+ '<!-- IF \1 -->',
+ '<!-- BEGIN \1 -->',
+ );
+
+ $str = preg_replace($match_preg, $replace_preg, $str);
+ $str = str_replace('<?php ', '', $str);
+ $str = str_replace(' ?>', '', $str);
+ }
+ else
+ {
+ $str = (!empty($_POST['decompile'])) ? stripslashes($_POST['decompile']) : '';
+ }
+
+ if (isset($_POST['tpl_download']))
+ {
+ header("Content-Type: text/html; name=\"" . $tplname . ".html\"");
+ header("Content-disposition: attachment; filename=" . $tplname . ".html");
+ echo $str;
+ exit;
+
+ }
+
+// $tplroot_options = get_templates($tplroot);
+
+ $tplname_options = '';
+ $dp = @opendir($phpbb_root_path . 'cache/templates/' . $tplroot . '/');
+ while ($file = readdir($dp))
+ {
+ if (strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $file))
+ {
+ $tpl = substr($file, 0, strpos($file, '.'));
+ $selected = ($tplname == $tpl) ? ' selected="selected"' : '';
+ $tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
+ }
+ }
+ closedir($dp);
+
+ //
+ adm_page_header($user->lang['Edit_template']);
?>
@@ -224,11 +239,7 @@ switch ($mode)
<p><?php echo $user->lang['Edit_template_explain']; ?></p>
-<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=edittemplate"; ?>">
-
-<p><?php echo $user->lang['Select_template']; ?>: <select name="tplroot"><?php echo $tplroot_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="tpl_root" value="Select" /></p>
-
-<table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
+<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=edit"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
<tr>
<td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
@@ -248,129 +259,201 @@ switch ($mode)
<?php
- adm_page_footer();
- break;
-
-
-
+ adm_page_footer();
+ break;
+ break;
+ case 'delete':
+ break;
+ case 'export':
+ break;
+ }
+ adm_page_header($user->lang['EDIT_TEMPLATE']);
+?>
+<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&amp;mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
+ <tr>
+ <th>Template name</th>
+ <th>&nbsp;</th>
+ </tr>
+<?php
+ $sql = 'SELECT template_id, template_name
+ FROM ' . STYLES_TPL_TABLE;
+ $result = $db->sql_query($sql);
- case 'edittheme':
+ if ($row = $db->sql_fetchrow($result))
+ {
+ do
+ {
+ $row_class = ($row_class != 'row1') ? 'row1' : 'row2';
- $theme_id = (isset($_POST['themeroot'])) ? $_POST['themeroot'] : '';
+?>
+ <tr>
+ <td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=edit&amp;id=" . $row['template_id']; ?>"><?php echo $row['template_name']; ?></a></td>
+ <td class="<?php echo $row_class; ?>" nowrap="nowrap">&nbsp;<a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=bbcode&amp;id=" . $row['template_id']; ?>">BBCode</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=delete&amp;id=" . $row['template_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=export&amp;id=" . $row['template_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=templates&amp;action=preview&amp;id=" . $row['template_id']; ?>">Preview</a>&nbsp;</td>
+ </tr>
+<?php
- if (isset($_POST['update']))
+ }
+ while ($row = $db->sql_fetchrow($result));
+ }
+ else
{
- $sql = "SELECT theme_id, theme_name
- FROM " . STYLES_CSS_TABLE . "
- WHERE theme_id = $theme_id";
- $result = $db->sql_query($sql);
+ }
+ $db->sql_freeresult($result);
- 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'] : '';
+?>
+ <tr>
+ <td class="cat" colspan="2">&nbsp;</td>
+ </tr>
+</table></form>
- $sql = "UPDATE " > STYLES_CSS_TABLE . "
- SET css_data = '$css_data', css_external = '$css_external'
- WHERE theme_id = $theme_id";
- $db->sql_query($sql);
+<?php
- add_log('admin', 'log_theme_edit', $theme_name);
+ adm_page_footer();
- message_die(MESSAGE, $user->lang['Success_theme_update']);
- }
- }
+ break;
- adm_page_header($user->lang['Edit_theme']);
- $sql = "SELECT theme_id, theme_name
- FROM " . STYLES_CSS_TABLE;
- $result = $db->sql_query($sql);
- $theme_options = '';
- if ($row = $db->sql_fetchrow($result))
- {
- do
- {
- $theme_options .= (($theme_options != '') ? ', ' : '') . '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>';
- }
- while ($row = $db->sql_fetchrow($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'];
+ case 'themes':
-// $selected = ' selected="selected"';
- $bg_imglist .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
- }
- $bg_imglist = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>----------</option>' . $bg_imglist;
+ $theme_id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : '';
+ switch ($action)
+ {
+ case 'preview':
+
+ break;
+
+ case 'edit':
+
+ if (isset($_POST['update']))
+ {
+ }
+
+
+ $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']);
?>
@@ -386,13 +469,16 @@ function swatch(field)
//-->
</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&amp;mode=$mode"; ?>"><table width="95%" cellspacing="1" cellpadding="1" border="0" align="center">
+<p>Selected Theme: <b><?php echo $theme_data['theme_name']; ?></b></p>
+
+<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;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="class"><?php echo $class_options; ?></select>&nbsp; <input class="liteoption" type="submit" value="<?php echo $user->lang['SELECT']; ?>" tabindex="100" /></td>
+ <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>&nbsp; <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">
@@ -401,51 +487,72 @@ function swatch(field)
<th>Value</th>
</tr>
<tr>
- <td class="row1">Background image:</td>
+ <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">Repeat background:</td>
+ <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="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>
+ <td class="cat" colspan="2"><b>Text</b></td>
</tr>
<tr>
- <td class="row1">Foreground color:</td>
+ <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">Font:</td>
+ <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">Font size:</td>
+ <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">Font Bold:</td>
+ <td class="row1"><b>Bold:</b></td>
<td class="row2"><input type="radio" name="bold" value="1" /> <?php echo $user->lang['YES']; ?> &nbsp; <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="row1"><b>Italic:</b></td>
<td class="row2"><input type="radio" name="italic" value="1" /> <?php echo $user->lang['YES']; ?> &nbsp; <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="row1"><b>Underline:</b></td>
<td class="row2"><input type="radio" name="underline" value="1" /> <?php echo $user->lang['YES']; ?> &nbsp; <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="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="liteoption" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
+ <td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="preview" value="<?php echo $user->lang['PREVIEW']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
</tr>
</table></td>
</tr>
@@ -453,39 +560,75 @@ function swatch(field)
<?php
- adm_page_footer();
+ adm_page_footer();
+ break;
- 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&amp;mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
+ <tr>
+ <th>Theme name</th>
+ <th>&nbsp;</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&amp;mode=themes&amp;action=edit&amp;id=" . $row['theme_id']; ?>"><?php echo $row['theme_name']; ?></a></td>
+ <td class="<?php echo $row_class; ?>" nowrap="nowrap">&nbsp;<a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=themes&amp;action=recreate&amp;id=" . $row['theme_id']; ?>">Recreate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=themes&amp;action=delete&amp;id=" . $row['theme_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=themes&amp;action=export&amp;id=" . $row['theme_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&amp;mode=themes&amp;action=preview&amp;id=" . $row['theme_id']; ?>">Preview</a>&nbsp;</td>
+ </tr>
+<?php
+ }
+ while ($row = $db->sql_fetchrow($result));
+ }
+ else
+ {
+ }
+ $db->sql_freeresult($result);
+?>
+ <tr>
+ <td class="cat" colspan="2">&nbsp;</td>
+ </tr>
+</table></form>
+
+<?php
+
+ adm_page_footer();
+
+ break;
-}
-//
-function get_templates($tplroot = '')
-{
- global $db;
- $sql = "SELECT template_name, template_path
- FROM " . STYLES_TPL_TABLE . "
- ORDER BY template_name";
- $result = $db->sql_query($sql);
- $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;
}
?> \ No newline at end of file