Silly silly Paul, smacked handy and no tea

git-svn-id: file:///svn/phpbb/trunk@4359 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-08-10 10:53:50 +00:00
parent baa01d15f2
commit 35c8d412a7

View file

@ -25,10 +25,10 @@ if (!empty($setmodules))
} }
$filename = basename(__FILE__); $filename = basename(__FILE__);
$module['STYLE']['MANAGE_STYLE'] = $filename . "$SID&mode=styles"; $module['STYLE']['MANAGE_STYLE'] = "$filename$SID&mode=styles";
$module['STYLE']['MANAGE_TEMPLATE'] = $filename . "$SID&mode=templates"; $module['STYLE']['MANAGE_TEMPLATE'] = "$filename$SID&mode=templates";
$module['STYLE']['MANAGE_THEME'] = $filename . "$SID&mode=themes"; $module['STYLE']['MANAGE_THEME'] = "$filename$SID&mode=themes";
$module['STYLE']['MANAGE_IMAGESET'] = $filename . "$SID&mode=imagesets"; $module['STYLE']['MANAGE_IMAGESET'] = "$filename$SID&mode=imagesets";
return; return;
} }
@ -48,7 +48,7 @@ if (!$auth->acl_get('a_styles'))
// Get some vars // Get some vars
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
$update = ($update) ? true : false; $update = (isset($_POST['update'])) ? true : false;
if (isset($_REQUEST['action'])) if (isset($_REQUEST['action']))
{ {
@ -85,6 +85,27 @@ foreach (array('zip' => 'zlib', 'tar' => '', 'tar.gz' => 'zlib', 'tar.bz2' => 'b
} }
switch ($action)
{
case 'export':
break;
case 'refresh':
break;
case 'add':
case 'install':
case 'details':
break;
case 'preview':
break;
}
// What shall we do today then? // What shall we do today then?
switch ($mode) switch ($mode)
{ {
@ -170,7 +191,7 @@ switch ($mode)
<p><?php echo $user->lang['DELETE_STYLE_EXPLAIN']; ?></p> <p><?php echo $user->lang['DELETE_STYLE_EXPLAIN']; ?></p>
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;id=$id"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> <form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;id=$style_id"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $user->lang['DELETE_STYLE']; ?></td> <th colspan="2"><?php echo $user->lang['DELETE_STYLE']; ?></td>
</tr> </tr>
@ -322,7 +343,7 @@ switch ($mode)
{ {
$imageset_cfg = addslashes($imageset_name) . "\n"; $imageset_cfg = addslashes($imageset_name) . "\n";
$imageset_cfg .= addslashes($imageset_copyright) . "\n"; $imageset_cfg .= addslashes($imageset_copyright) . "\n";
$imageset_cfg .= addslashes($config['version']) . "\n"; $imageset_cfg .= addslashes($config['version']);
foreach (array_keys($style_row) as $key) foreach (array_keys($style_row) as $key)
{ {
@ -373,7 +394,7 @@ switch ($mode)
<p><?php echo $user->lang['STYLE_EXPORT_EXPLAIN']; ?></p> <p><?php echo $user->lang['STYLE_EXPORT_EXPLAIN']; ?></p>
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;id=$id"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> <form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;id=$style_id"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $user->lang['STYLE_EXPORT']; ?></td> <th colspan="2"><?php echo $user->lang['STYLE_EXPORT']; ?></td>
</tr> </tr>
@ -518,7 +539,7 @@ switch ($mode)
// Installing, importing/uploading then grab the element info else grab the // Installing, importing/uploading then grab the element info else grab the
// submitted params // submitted params ... stylecfg will be set if this is true (see above)
if (sizeof($stylecfg)) if (sizeof($stylecfg))
{ {
$style_name = trim($stylecfg[0]); $style_name = trim($stylecfg[0]);
@ -528,6 +549,7 @@ switch ($mode)
$reqd_theme = trim($stylecfg[4]); $reqd_theme = trim($stylecfg[4]);
$reqd_imageset = trim($stylecfg[5]); $reqd_imageset = trim($stylecfg[5]);
// Check to see if each element is already installed, if it is grab the id
foreach ($element_ary as $element => $table) foreach ($element_ary as $element => $table)
{ {
$l_element = strtoupper($element); $l_element = strtoupper($element);
@ -611,7 +633,8 @@ switch ($mode)
{ {
foreach ($element_ary as $element => $table) foreach ($element_ary as $element => $table)
{ {
// Zero id value ... need to install element // Zero id value ... need to install element ... run usual checks
// and do the install if necessary
if (!${$element . '_id'}) if (!${$element . '_id'})
{ {
$l_element = strtoupper($element); $l_element = strtoupper($element);
@ -838,10 +861,8 @@ switch ($mode)
} }
} }
// Something went wrong ... so we'll clean up any decompressed // Something went wrong ... so we'll clean up any decompressed uploaded/imported
// uploaded/imported archives. It means the user will have to // archives.
// reupload but hum ho it's better than leaving old files
// laying around
if ($tmp_path) if ($tmp_path)
{ {
cleanup_folder($tmp_path); cleanup_folder($tmp_path);
@ -1143,10 +1164,37 @@ switch ($mode)
adm_page_footer(); adm_page_footer();
break; break;
// IMAGESETS // IMAGESETS
case 'imagesets': case 'imagesets':
$imageset_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0; $imageset_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0;
$imglist = array(
'buttons' => array(
'btn_post', 'btn_post_pm', 'btn_reply', 'btn_reply_pm', 'btn_locked', 'btn_profile', 'btn_pm', 'btn_delete', 'btn_ip', 'btn_quote', 'btn_search', 'btn_edit', 'btn_report', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline', 'btn_topic_watch', 'btn_topic_unwatch',
),
'icons' => array(
'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',),
'forums' => array(
'forum', 'forum_new', 'forum_locked', 'forum_link', 'sub_forum', 'sub_forum_new',),
'folders' => array(
'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted',),
'polls' => array(
'poll_left', 'poll_center', 'poll_right',),
'custom' => array(),
);
switch ($action) switch ($action)
{ {
case 'export': case 'export':
@ -1173,7 +1221,7 @@ switch ($mode)
$cfg = addslashes($imageset_name) . "\n"; $cfg = addslashes($imageset_name) . "\n";
$cfg .= addslashes($imageset_copyright) . "\n"; $cfg .= addslashes($imageset_copyright) . "\n";
$cfg .= addslashes($config['version']) . "\n"; $cfg .= addslashes($config['version']);
foreach (array_keys($row) as $key) foreach (array_keys($row) as $key)
{ {
@ -1229,23 +1277,6 @@ switch ($mode)
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$imglist = array(
'buttons' => array(
'btn_post', 'btn_post_pm', 'btn_reply', 'btn_reply_pm', 'btn_locked', 'btn_profile', 'btn_pm', 'btn_delete', 'btn_ip', 'btn_quote', 'btn_search', 'btn_edit', 'btn_report', 'btn_email', 'btn_www', 'btn_icq', 'btn_aim', 'btn_yim', 'btn_msnm', 'btn_jabber', 'btn_online', 'btn_offline', 'btn_topic_watch', 'btn_topic_unwatch',
),
'icons' => array(
'icon_unapproved', 'icon_reported', 'icon_attach', 'icon_post', 'icon_post_new', 'icon_post_latest', 'icon_post_newest',),
'forums' => array(
'forum', 'forum_new', 'forum_locked', 'forum_link', 'sub_forum', 'sub_forum_new',),
'folders' => array(
'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted',),
'polls' => array(
'poll_left', 'poll_center', 'poll_right',),
'custom' => array(),
);
$test_ary = array(); $test_ary = array();
foreach ($imglist as $category => $img_ary) foreach ($imglist as $category => $img_ary)
{ {
@ -1360,7 +1391,7 @@ switch ($mode)
// TEMPLATES // TEMPLATES
case 'templates': case 'templates':
$template_id = (isset($_REQUEST['id'])) ? $_REQUEST['id'] : false; $template_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : false;
$tpllist = array( $tpllist = array(
'misc' => array( 'misc' => array(