Code: Alles auswählen
//
// Unable to open the file writeable do something here as an attempt
// to get around that...
//
$s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />';
$s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />';
$download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['Download'] . '" />' . $s_hidden_fields;
$template->set_filenames(array(
"body" => "message_body.tpl")
);
$template->assign_vars(array(
"MESSAGE_TITLE" => $lang['ExPORT 192,168,2,32,128,10
($HTTP_POST_VARS['send_file'])
{
header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\"");
header("Content-disposition: attachment; filename=theme_info.cfg");
echo stripslashes($HTTP_POST_VARS['theme_info']);
}
else
{
$template->set_filenames(array(
"body" => "admin/styles_exporter.tpl")
);
if( $dir = @opendir($phpbb_root_path . 'templates/') )
{
$s_template_select = '<select name="export_template">';
while( $file = @readdir($dir) )
{
if( !is_file(phpbb_realpath($phpbb_root_path . 'templates/' . $file)) && !is_link(phpbb_realpath($phpbb_root_path . 'templates/' .$file)) && $file != "." && $file != ".." && $file != "CVS" )
{
$s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n";
}
}
$s_template_select .= '</select>';
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_template_dir']);
}
$template->assign_vars(array(
"L_STYLE_EXPORTER" => $lang['Export_themes'],
"L_EXPORTER_EXPLAIN" => $lang['Export_explain'],
"L_TEMPLATE_SELECT" => $lang['Select_template'],
"L_SUBMIT" => $lang['Submit'],
"S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"),
"S_TEMPLATE_SELECT" => $s_template_select)
);
$template->pparse("body");
}
break;
Code: Alles auswählen
//
// Unable to open the file writeable do something here as an attempt
// to get around that...
//
$s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />';
$s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />';
$download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['Download'] . '" />' . $s_hidden_fields;
$template->set_filenames(array(
"body" => "message_body.tpl")
);
$template->assign_vars(array(
"MESSAGE_TITLE" => $lang['Export_themes'],
"MESSAGE_TEXT" => $lang['Download_theme_cfg'] . "<br /><br />" . $download_form)
);
$template->pparse('body');
exit();
}
$result = @fputs($fp, $theme_data, strlen($theme_data));
fclose($fp);
$message = $lang['Theme_info_saved'] . "<br /><br />" . sprintf($lang['Click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
else if($HTTP_POST_VARS['send_file'])
{
header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\"");
header("Content-disposition: attachment; filename=theme_info.cfg");
echo stripslashes($HTTP_POST_VARS['theme_info']);
}
else
{
$template->set_filenames(array(
"body" => "admin/styles_exporter.tpl")
);
if( $dir = @opendir($phpbb_root_path . 'templates/') )
{
$s_template_select = '<select name="export_template">';
while( $file = @readdir($dir) )
{
if( !is_file(phpbb_realpath($phpbb_root_path . 'templates/' . $file)) && !is_link(phpbb_realpath($phpbb_root_path . 'templates/' .$file)) && $file != "." && $file != ".." && $file != "CVS" )
{
$s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n";
}
}
$s_template_select .= '</select>';
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_template_dir']);
}
$template->assign_vars(array(
"L_STYLE_EXPORTER" => $lang['Export_themes'],
"L_EXPORTER_EXPLAIN" => $lang['Export_explain'],
"L_TEMPLATE_SELECT" => $lang['Select_template'],
"L_SUBMIT" => $lang['Submit'],
"S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"),
"S_TEMPLATE_SELECT" => $s_template_select)
);
$template->pparse("body");
}
break;