Vergleich admin/modules/style/themes.php - 1.4.0 - 1.4.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 18Zeile 18
require_once MYBB_ADMIN_DIR."inc/functions_themes.php";

$page->extra_header .= "

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";

$page->extra_header .= "

<script language=\"Javascript\" type=\"text/javascript\">

<script type=\"text/javascript\">

//<![CDATA[
var save_changes_lang_string = '{$lang->save_changes_js}';
var delete_lang_string = '{$lang->delete}';

//<![CDATA[
var save_changes_lang_string = '{$lang->save_changes_js}';
var delete_lang_string = '{$lang->delete}';

Zeile 340Zeile 340
		$properties = unserialize($theme['properties']);

$xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";

		$properties = unserialize($theme['properties']);

$xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";

		$xml .= "<theme name=\"".$theme['name']."\" version=\"".$mybb->version_code."\">\r\n";

		$xml .= "<theme name=\"".htmlspecialchars_uni($theme['name'])."\" version=\"".$mybb->version_code."\">\r\n";

		$xml .= "\t<properties>\r\n";
foreach($properties as $property => $value)
{

		$xml .= "\t<properties>\r\n";
foreach($properties as $property => $value)
{

Zeile 467Zeile 467
		
$theme['name'] = rawurlencode($theme['name']);
header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");

		
$theme['name'] = rawurlencode($theme['name']);
header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");

		header("Content-Length: ".my_strlen($xml));

 
		header("Content-type: application/octet-stream");

		header("Content-type: application/octet-stream");

 
		header("Content-Length: ".my_strlen($xml));

		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

Zeile 547Zeile 547
	while($theme = $db->fetch_array($query))
{
$themes[$theme['tid']] = $theme['name'];

	while($theme = $db->fetch_array($query))
{
$themes[$theme['tid']] = $theme['name'];

	}

$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style/themes&amp;action=add");


	}

$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style/themes&amp;action=add");


	$page->output_header("{$lang->themes} - {$lang->create_new_theme}");

$page->output_nav_tabs($sub_tabs, 'create_theme');

	$page->output_header("{$lang->themes} - {$lang->create_new_theme}");

$page->output_nav_tabs($sub_tabs, 'create_theme');

	

	

	if($errors)
{
$page->output_inline_error($errors);
}

$form = new Form("index.php?module=style/themes&amp;action=add", "post");

	if($errors)
{
$page->output_inline_error($errors);
}

$form = new Form("index.php?module=style/themes&amp;action=add", "post");

	

	

	$form_container = new FormContainer($lang->create_a_theme);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid');

	$form_container = new FormContainer($lang->create_a_theme);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid');

Zeile 571Zeile 571
	$buttons[] = $form->generate_submit_button($lang->create_new_theme);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->create_new_theme);

$form->output_submit_wrapper($buttons);

	

	

	$form->end();

$page->output_footer();
}

if($mybb->input['action'] == "delete")

	$form->end();

$page->output_footer();
}

if($mybb->input['action'] == "delete")

{

{

	$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);


	$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);


Zeile 633Zeile 633
		{			
flash_message($lang->error_inheriting_stylesheets, 'error');
admin_redirect("index.php?module=style/themes");

		{			
flash_message($lang->error_inheriting_stylesheets, 'error');
admin_redirect("index.php?module=style/themes");

		}


		}


		$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'");
while($cachefile = $db->fetch_array($query))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");

		$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'");
while($cachefile = $db->fetch_array($query))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");

		

		

		$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");

// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");

		$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");

// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");

		

		

		@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");

$children = make_child_theme_list($theme['tid']);

		@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");

$children = make_child_theme_list($theme['tid']);

Zeile 662Zeile 662
		log_admin_action($theme['tid'], $theme['name']);

flash_message($lang->success_theme_deleted, 'success');

		log_admin_action($theme['tid'], $theme['name']);

flash_message($lang->success_theme_deleted, 'success');

		admin_redirect("index.php?module=style/themes");

		admin_redirect("index.php?module=style/themes");

	}
else
{

	}
else
{

Zeile 691Zeile 691
			'logo' => $mybb->input['logo'],
'tablespace' => intval($mybb->input['tablespace']),
'borderwidth' => intval($mybb->input['borderwidth'])

			'logo' => $mybb->input['logo'],
'tablespace' => intval($mybb->input['tablespace']),
'borderwidth' => intval($mybb->input['borderwidth'])

		);


		);


		if($properties['templateset'] <= 0)
{
$errors[] = $lang->error_invalid_templateset;

		if($properties['templateset'] <= 0)
{
$errors[] = $lang->error_invalid_templateset;

Zeile 749Zeile 749
		if(!$properties['templateset'])
{
$errors[] = $lang->error_invalid_templateset;

		if(!$properties['templateset'])
{
$errors[] = $lang->error_invalid_templateset;

		}

		}

		if(!$properties['editortheme'] || !@is_dir(MYBB_ROOT."jscripts/editor_themes/".$properties['editortheme']))
{
$errors[] = $lang->error_invalid_editortheme;

		if(!$properties['editortheme'] || !@is_dir(MYBB_ROOT."jscripts/editor_themes/".$properties['editortheme']))
{
$errors[] = $lang->error_invalid_editortheme;

		}

		}

		
if(empty($errors))
{

		
if(empty($errors))
{

Zeile 777Zeile 777
	foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited')

	foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited')

		{

		{

			continue;
}


			continue;
}


Zeile 862Zeile 862
			$filename = $theme_stylesheets[$style['sid']];
}
else

			$filename = $theme_stylesheets[$style['sid']];
}
else

		{

		{

			$filename = basename($filename);
$style['sid'] = $theme_stylesheets[$filename]['sid'];

			$filename = basename($filename);
$style['sid'] = $theme_stylesheets[$filename]['sid'];

		}


		}


		// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);

		// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);

		

		

		$filename = $theme_stylesheets[$filename]['name'];

$inherited = "";

		$filename = $theme_stylesheets[$filename]['name'];

$inherited = "";

Zeile 890Zeile 890
			$inherited = " <small>({$lang->inherited_from}";
$sep = " ";
$inherited_count = count($inherited_ary);

			$inherited = " <small>({$lang->inherited_from}";
$sep = " ";
$inherited_count = count($inherited_ary);

			$count = 0;

			$count = 0;

			
foreach($inherited_ary as $tid => $file)
{

			
foreach($inherited_ary as $tid => $file)
{

Zeile 918Zeile 918
			foreach($style['applied_to'] as $name => $actions)
{
if(!$name)

			foreach($style['applied_to'] as $name => $actions)
{
if(!$name)

				{

				{

					continue;
}


					continue;
}


Zeile 1003Zeile 1003
	if($dh = @opendir($editor_theme_root))
{
while($dir = readdir($dh))

	if($dh = @opendir($editor_theme_root))
{
while($dir = readdir($dh))

		{

		{

			if($dir == ".svn" || $dir == "." || $dir == ".." || !is_dir($editor_theme_root.$dir))
{
continue;

			if($dir == ".svn" || $dir == "." || $dir == ".." || !is_dir($editor_theme_root.$dir))
{
continue;

Zeile 1103Zeile 1103
		$stylesheets[basename($file)] = $stylesheet2;
}


		$stylesheets[basename($file)] = $stylesheet2;
}


	$this_stylesheet = $stylesheets[$stylesheet['cachefile']];	






	if(!array_key_exists($stylesheet['cachefile'], $stylesheets) && array_key_exists("css.php?stylesheet=".$stylesheet['tid'], $stylesheets))
{
$stylesheet['cachefile'] = "css.php?stylesheet=".$stylesheet['tid'];
}

$this_stylesheet = $stylesheets[$stylesheet['cachefile']];

	unset($stylesheets);

if($mybb->request_method == "post")
{
if(!$mybb->input['name'])

	unset($stylesheets);

if($mybb->request_method == "post")
{
if(!$mybb->input['name'])

		{

		{

			$errors[] = $lang->error_missing_stylesheet_name;
}


			$errors[] = $lang->error_missing_stylesheet_name;
}


Zeile 1117Zeile 1122
		{
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])

		{
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])

			{

			{

				$stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
}


				$stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
}


Zeile 1135Zeile 1140
					{
// We have a custom attached file
$attached_id = intval(str_replace('attached_', '', $id));

					{
// We have a custom attached file
$attached_id = intval(str_replace('attached_', '', $id));

						

						

						if($mybb->input['action_'.$attached_id] == 1)
{
// We have custom actions for attached files

						if($mybb->input['action_'.$attached_id] == 1)
{
// We have custom actions for attached files

Zeile 1145Zeile 1150
						if($actions_list)
{
$attached_to .= "?".$actions_list;

						if($actions_list)
{
$attached_to .= "?".$actions_list;

						}

						}

						
$attached[] = $attached_to;
}

						
$attached[] = $attached_to;
}

				}

				}

			}

// Update Stylesheet
$update_array = array(
'name' => $db->escape_string($mybb->input['name']),

			}

// Update Stylesheet
$update_array = array(
'name' => $db->escape_string($mybb->input['name']),

				'attachedto' => $db->escape_string(implode('|', $attached)),
'lastmodified' => TIME_NOW

				'attachedto' => $db->escape_string(implode('|', $attached))


			);


			);


			if($stylesheet['name'] != $mybb->input['name'])
{
$update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
}


			if($stylesheet['name'] != $mybb->input['name'])
{
$update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
}


			$db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);

// If the name changed, re-cache our stylesheet
if($stylesheet['name'] != $mybb->input['name'])
{

			$db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);

// If the name changed, re-cache our stylesheet
if($stylesheet['name'] != $mybb->input['name'])
{

 
				$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

			}

			}

			
// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

			
// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

Zeile 1201Zeile 1206
		
// Show inherited warning
if($stylesheet['tid'] == 1)

		
// Show inherited warning
if($stylesheet['tid'] == 1)

		{

		{

			$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));
}
else

			$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));
}
else

Zeile 1256Zeile 1261

$action_list = "";
if($actions[0] != "global")


$action_list = "";
if($actions[0] != "global")

			{

			{

				$action_list = implode(',', $actions);

				$action_list = implode(',', $actions);

			}


			}


			if($actions[0] == "global")
{
$global_action_checked[1] = "checked=\"checked\"";

			if($actions[0] == "global")
{
$global_action_checked[1] = "checked=\"checked\"";

Zeile 1283Zeile 1288
			</table>
</dd>
</dl>";

			</table>
</dd>
</dl>";

			

			

			$form_container = new FormContainer();
$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.gif\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");


			$form_container = new FormContainer();
$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.gif\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");


Zeile 1366Zeile 1371

// Shows the page where you can actually edit a particular selector or the whole stylesheet
if($mybb->input['action'] == "edit_stylesheet" && (!$mybb->input['mode'] || $mybb->input['mode'] == "simple"))


// Shows the page where you can actually edit a particular selector or the whole stylesheet
if($mybb->input['action'] == "edit_stylesheet" && (!$mybb->input['mode'] || $mybb->input['mode'] == "simple"))

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'])
{

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'])
{

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");
}

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");
}

Zeile 1777Zeile 1782
	$this_stylesheet = $stylesheets[$stylesheet['name']];	
unset($stylesheets);


	$this_stylesheet = $stylesheets[$stylesheet['name']];	
unset($stylesheets);


	$page->extra_header .= '



	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

	


	}


	$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&amp;action=edit&amp;tid={$mybb->input['tid']}");
$page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style/themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=advanced");


	$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&amp;action=edit&amp;tid={$mybb->input['tid']}");
$page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style/themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=advanced");


Zeile 1824Zeile 1832
	{
// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");

	{
// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");

		$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');
}

		$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');
}

	
$form = new Form("index.php?module=style/themes&amp;action=edit_stylesheet&amp;mode=advanced", "post", "edit_stylesheet");
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n";

	
$form = new Form("index.php?module=style/themes&amp;action=edit_stylesheet&amp;mode=advanced", "post", "edit_stylesheet");
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n";

Zeile 1844Zeile 1852

$form->end();



$form->end();


	echo "<script language=\"Javascript\" type=\"text/javascript\">



	if($admin_options['codepress'] != 0)
{
echo "<script type=\"text/javascript\">

	Event.observe('edit_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

	Event.observe('edit_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

Zeile 1855Zeile 1865
		}
});
</script>";

		}
});
</script>";

	


	}


	$page->output_footer();
}


	$page->output_footer();
}


Zeile 1866Zeile 1877
	$theme = $db->fetch_array($query);

if(!$theme['tid'])

	$theme = $db->fetch_array($query);

if(!$theme['tid'])

	{

	{

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");

	}

	}

	
$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);

	
$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);

Zeile 1882Zeile 1893
	$stylesheet = $db->fetch_array($query);

// Does the theme not exist? or are we trying to delete the master?

	$stylesheet = $db->fetch_array($query);

// Does the theme not exist? or are we trying to delete the master?

	if(!$stylesheet['sid'] || $stylesheet['tid'] == 1)
{

	if(!$stylesheet['sid'] || $stylesheet['tid'] == 1)
{

		flash_message($lang->error_invalid_stylesheet, 'error');
admin_redirect("index.php?module=style/themes");
}

// User clicked no
if($mybb->input['no'])

		flash_message($lang->error_invalid_stylesheet, 'error');
admin_redirect("index.php?module=style/themes");
}

// User clicked no
if($mybb->input['no'])

	{

	{

		admin_redirect("index.php?module=style/themes");
}


		admin_redirect("index.php?module=style/themes");
}


Zeile 1901Zeile 1912
		
// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

		
// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

		

		

		// Log admin action
log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $theme['name']);


		// Log admin action
log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $theme['name']);


Zeile 1911Zeile 1922
	else
{
$page->output_confirm_action("index.php?module=style/themes&amp;action=force&amp;tid={$theme['tid']}", $lang->confirm_stylesheet_deletion);

	else
{
$page->output_confirm_action("index.php?module=style/themes&amp;action=force&amp;tid={$theme['tid']}", $lang->confirm_stylesheet_deletion);

	}

	}

}

if($mybb->input['action'] == "add_stylesheet")

}

if($mybb->input['action'] == "add_stylesheet")

Zeile 1921Zeile 1932
	$theme = $db->fetch_array($query);

if(!$theme['tid'])

	$theme = $db->fetch_array($query);

if(!$theme['tid'])

	{

	{

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");
}

		flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style/themes");
}

Zeile 1938Zeile 1949
		if($file == 'inherited')
{
continue;

		if($file == 'inherited')
{
continue;

		}


		}


		foreach($action_stylesheet as $action => $style)
{
foreach($style as $stylesheet2)

		foreach($action_stylesheet as $action => $style)
{
foreach($style as $stylesheet2)

Zeile 1994Zeile 2005
			{
// Custom stylesheet
$stylesheet = $mybb->input['stylesheet'];

			{
// Custom stylesheet
$stylesheet = $mybb->input['stylesheet'];

			}

$attached = array();

			}

$attached = array();

			
if($mybb->input['attach'] == 1)
{

			
if($mybb->input['attach'] == 1)
{

Zeile 2052Zeile 2063
		
flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));

		
flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style/themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));

		}
}

		}
}

	

	

	$page->extra_header .= '



	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

 
	}

	
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&amp;action=edit&amp;tid={$mybb->input['tid']}");

	
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&amp;action=edit&amp;tid={$mybb->input['tid']}");

	$page->add_breadcrumb_item("Add Stylesheet");

	$page->add_breadcrumb_item($lang->add_stylesheet);

	
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");


	
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");


Zeile 2111Zeile 2125
			$add_checked[2] = "";
}
else

			$add_checked[2] = "";
}
else

		{

		{

			$add_checked[2] = "checked=\"checked\"";
$add_checked[1] = "";
}

			$add_checked[2] = "checked=\"checked\"";
$add_checked[1] = "";
}

Zeile 2251Zeile 2265
	$buttons[] = $form->generate_submit_button($lang->save_stylesheet);

$form->output_submit_wrapper($buttons);

	$buttons[] = $form->generate_submit_button($lang->save_stylesheet);

$form->output_submit_wrapper($buttons);

	
echo "<script language=\"Javascript\" type=\"text/javascript\">



	
if($admin_options['codepress'] != 0)
{
echo "<script type=\"text/javascript\">

	Event.observe('add_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

	Event.observe('add_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

Zeile 2263Zeile 2279
		}
});
</script>\n";

		}
});
</script>\n";




	}


	echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
echo '<script type="text/javascript">
Event.observe(window, "load", function() {

	echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
echo '<script type="text/javascript">
Event.observe(window, "load", function() {

Zeile 2273Zeile 2290
});
//]]>
</script>';

});
//]]>
</script>';

	

	

	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 2281Zeile 2298

if($mybb->input['action'] == "set_default")
{


if($mybb->input['action'] == "set_default")
{

 
	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=style/themes");
}


	$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);


	$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);