Vergleich admin/modules/style/themes.php - 1.8.4 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 168Zeile 168
	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	$contents = fetch_remote_file("http://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);

	$contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);


if(!$contents)
{


if(!$contents)
{

Zeile 214Zeile 214
			);
$result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));


			);
$result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));


			$table->construct_cell("<img src=\"http://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

			$table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");

			$table->construct_cell("<strong><a href=\"http://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));

			$table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));

			$table->construct_row();
}
}

			$table->construct_row();
}
}

Zeile 286Zeile 286
	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{

	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

		$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

	}
else
{

	}
else
{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

		$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

	}

echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&amp;action=browse{$keywords}&amp;page={page}");

	}

echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&amp;action=browse{$keywords}&amp;page={page}");

Zeile 614Zeile 614
		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

				$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

				$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

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

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

Zeile 756Zeile 756
		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'");
$numthemes = $db->fetch_field($query, 'numthemes');

		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'");
$numthemes = $db->fetch_field($query, 'numthemes');

			



			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

Zeile 766Zeile 766
		if(!$errors)
{
$properties = my_unserialize($theme['properties']);

		if(!$errors)
{
$properties = my_unserialize($theme['properties']);

			$sid = $properties['sid'];

			$sid = $properties['templateset'];

			$nprops = null;
if($mybb->input['duplicate_templates'])
{

			$nprops = null;
if($mybb->input['duplicate_templates'])
{

Zeile 836Zeile 836
	$sub_tabs['edit_stylesheets'] = array(
'title' => $lang->edit_stylesheets,
'link' => "index.php?module=style-themes&amp;action=edit&amp;tid={$mybb->input['tid']}",

	$sub_tabs['edit_stylesheets'] = array(
'title' => $lang->edit_stylesheets,
'link' => "index.php?module=style-themes&amp;action=edit&amp;tid={$mybb->input['tid']}",

	);


	);


	$sub_tabs['add_stylesheet'] = array(
'title' => $lang->add_stylesheet,
'link' => "index.php?module=style-themes&amp;action=add_stylesheet&amp;tid={$mybb->input['tid']}",

	$sub_tabs['add_stylesheet'] = array(
'title' => $lang->add_stylesheet,
'link' => "index.php?module=style-themes&amp;action=add_stylesheet&amp;tid={$mybb->input['tid']}",

	);

	);


$sub_tabs['export_theme'] = array(
'title' => $lang->export_theme,
'link' => "index.php?module=style-themes&amp;action=export&amp;tid={$mybb->input['tid']}",
'description' => $lang->export_theme_desc


$sub_tabs['export_theme'] = array(
'title' => $lang->export_theme,
'link' => "index.php?module=style-themes&amp;action=export&amp;tid={$mybb->input['tid']}",
'description' => $lang->export_theme_desc

	);

	);


$sub_tabs['duplicate_theme'] = array(
'title' => $lang->duplicate_theme,
'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",
'description' => $lang->duplicate_theme_desc
);


$sub_tabs['duplicate_theme'] = array(
'title' => $lang->duplicate_theme,
'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",
'description' => $lang->duplicate_theme_desc
);





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

if($errors)

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

if($errors)

Zeile 862Zeile 862
		$page->output_inline_error($errors);
}
else

		$page->output_inline_error($errors);
}
else

	{
$mybb->input['duplicate_templates'] = true;

	{
$mybb->input['duplicate_templates'] = true;

	}

$form = new Form("index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}", "post");

	}

$form = new Form("index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}", "post");

Zeile 916Zeile 916
			flash_message($lang->success_theme_created, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
}

			flash_message($lang->success_theme_created, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
}

	}

	}


$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");


Zeile 969Zeile 969
	if($mybb->request_method == "post")
{
$inherited_theme_cache = array();

	if($mybb->request_method == "post")
{
$inherited_theme_cache = array();





		$query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name"));
while($theme2 = $db->fetch_array($query))
{
$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

if(!$theme2['stylesheets']['inherited'])

		$query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name"));
while($theme2 = $db->fetch_array($query))
{
$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

if(!$theme2['stylesheets']['inherited'])

			{

			{

				continue;
}


				continue;
}


Zeile 996Zeile 996
					{
$inherited_stylesheets = true;
}

					{
$inherited_stylesheets = true;
}

				}

				}

			}
}


			}
}


Zeile 1010Zeile 1010
		while($cachefile = $db->fetch_array($query))
{
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");

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

 

$filename_min = str_replace('.css', '.min.css', $cachefile['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");

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


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


Zeile 1022Zeile 1025

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



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


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

$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'");













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

foreach($children as $child_tid)
{
if($child_tid != 0)
{
$child_tids[] = $child_tid;
}
}

if(!empty($child_tids))
{
$db->update_query("themes", array('pid' => $theme['pid']), "tid IN (".implode(',', $child_tids).")");
}


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

$plugins->run_hooks("admin_style_themes_delete_commit");

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

$plugins->run_hooks("admin_style_themes_delete_commit");

Zeile 1092Zeile 1106
		}

$theme_properties = my_unserialize($theme['properties']);

		}

$theme_properties = my_unserialize($theme['properties']);

		if($theme_properties['disporder'])

		if(is_array($theme_properties['disporder']))

		{
$properties['disporder'] = $theme_properties['disporder'];

		{
$properties['disporder'] = $theme_properties['disporder'];

 
		}
else
{
$errors[] = $lang->error_no_display_order;

		}

$allowedgroups = array();

		}

$allowedgroups = array();

Zeile 1132Zeile 1150
		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'");
$numthemes = $db->fetch_field($query, 'numthemes');

		{
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'");
$numthemes = $db->fetch_field($query, 'numthemes');





			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

			if($numthemes)
{
$errors[] = $lang->error_theme_already_exists;

			}

			}

		}

if($update_array['pid'])

		}

if($update_array['pid'])

Zeile 1158Zeile 1176
			}
}
if(!$properties['templateset'])

			}
}
if(!$properties['templateset'])

		{

		{

			$errors[] = $lang->error_invalid_templateset;

			$errors[] = $lang->error_invalid_templateset;

		}

		}

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

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

Zeile 1169Zeile 1187
		if(empty($errors))
{
$plugins->run_hooks("admin_style_themes_edit_commit");

		if(empty($errors))
{
$plugins->run_hooks("admin_style_themes_edit_commit");





			$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");

			$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");

 
			update_theme_stylesheet_list($theme['tid']);


if($theme['def'] == 1)
{


if($theme['def'] == 1)
{

Zeile 1181Zeile 1200
			log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));

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

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

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

			admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}
}


			admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}
}


	// Fetch list of all of the stylesheets for this theme
$file_stylesheets = my_unserialize($theme['stylesheets']);


	// Fetch list of all of the stylesheets for this theme
$file_stylesheets = my_unserialize($theme['stylesheets']);


Zeile 1195Zeile 1214
	foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited' || !is_array($action_stylesheet))

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

		{

		{

			continue;
}


			continue;
}


Zeile 1211Zeile 1230
					{
$inherited_load[] = $value;
}

					{
$inherited_load[] = $value;
}

				}

				}

			}

			}

		}
}

$inherited_load[] = $mybb->input['tid'];
$inherited_load = array_unique($inherited_load);

		}
}

$inherited_load[] = $mybb->input['tid'];
$inherited_load = array_unique($inherited_load);


$inherited_themes = array();


$inherited_themes = array();

	if(count($inherited_load) > 0)
{

	if(count($inherited_load) > 0)
{

		$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
while($inherited_theme = $db->fetch_array($query))

		$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
while($inherited_theme = $db->fetch_array($query))

		{

		{

			$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
}
}

			$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
}
}





	$theme_stylesheets = array();

if(count($inherited_load) > 0)

	$theme_stylesheets = array();

if(count($inherited_load) > 0)

Zeile 1237Zeile 1256
		while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))

		while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))

			{

			{

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

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

			}


			}


			$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['name'];
}
}

			$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['name'];
}
}

Zeile 1249Zeile 1268
	if($mybb->request_method == "post" && $mybb->input['do'] == "save_orders")
{
if(!is_array($mybb->input['disporder']))

	if($mybb->request_method == "post" && $mybb->input['do'] == "save_orders")
{
if(!is_array($mybb->input['disporder']))

		{

		{

			// Error out
flash_message($lang->error_no_display_order, 'error');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");

			// Error out
flash_message($lang->error_no_display_order, 'error');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");

		}

		}


$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)


$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)

Zeile 1263Zeile 1282
				$order = (int)$mybb->input['disporder'][$properties['sid']];

$orders[$properties['name']] = $order;

				$order = (int)$mybb->input['disporder'][$properties['sid']];

$orders[$properties['name']] = $order;

			}
}

asort($orders, SORT_NUMERIC);

			}
}

asort($orders, SORT_NUMERIC);


// Save the orders in the theme properties
$properties = my_unserialize($theme['properties']);


// Save the orders in the theme properties
$properties = my_unserialize($theme['properties']);

Zeile 1275Zeile 1294
		$update_array = array(
"properties" => $db->escape_string(my_serialize($properties))
);

		$update_array = array(
"properties" => $db->escape_string(my_serialize($properties))
);





		$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");

if($theme['def'] == 1)

		$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");

if($theme['def'] == 1)

Zeile 1288Zeile 1307

flash_message($lang->success_stylesheet_order_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");


flash_message($lang->success_stylesheet_order_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['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(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&amp;action=edit&amp;tid={$mybb->input['tid']}");


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



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


Zeile 1338Zeile 1357
		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

		{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

				$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

				$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

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


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


Zeile 1355Zeile 1374
	{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

	{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{

			$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

			$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);

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

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

Zeile 1372Zeile 1391
		$inherited = "";
$inherited_ary = array();
if(is_array($style['inherited']))

		$inherited = "";
$inherited_ary = array();
if(is_array($style['inherited']))

		{

		{

			foreach($style['inherited'] as $tid)
{
if($inherited_themes[$tid])
{
$inherited_ary[$tid] = $inherited_themes[$tid];

			foreach($style['inherited'] as $tid)
{
if($inherited_themes[$tid])
{
$inherited_ary[$tid] = $inherited_themes[$tid];

				}

				}

			}
}

			}
}





		if(!empty($inherited_ary))
{
$inherited = " <small>({$lang->inherited_from}";

		if(!empty($inherited_ary))
{
$inherited = " <small>({$lang->inherited_from}";

Zeile 1397Zeile 1416
				}

$inherited .= $sep.$file;

				}

$inherited .= $sep.$file;

				$sep = $lang->comma;


				$sep = $lang->comma;


				++$count;
}
$inherited .= ")</small>";

				++$count;
}
$inherited .= ")</small>";

Zeile 1738Zeile 1757
				$update_d = true;

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

				$update_d = true;

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

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))

				if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet['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']}");

				{
$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']}");

			}





$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
}


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


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





			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));





			flash_message($lang->success_stylesheet_properties_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}

			flash_message($lang->success_stylesheet_properties_updated, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
}

Zeile 1772Zeile 1794

// 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));

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

		}

		}

		else
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));

		else
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));

Zeile 1782Zeile 1804
	}

$applied_to = $this_stylesheet['applied_to'];

	}

$applied_to = $this_stylesheet['applied_to'];

	unset($this_stylesheet);

	unset($this_stylesheet);


if($errors)
{


if($errors)
{

Zeile 1812Zeile 1834
	$global_checked[1] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[3] = "";

	$global_checked[1] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[3] = "";





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

$specific_files = "<div id=\"attach_1\" class=\"attachs\">";

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

$specific_files = "<div id=\"attach_1\" class=\"attachs\">";

Zeile 1821Zeile 1843
	{
$check_actions = "";
$stylesheet['colors'] = array();

	{
$check_actions = "";
$stylesheet['colors'] = array();





		if(!is_array($properties['colors']))
{
$properties['colors'] = array();

		if(!is_array($properties['colors']))
{
$properties['colors'] = array();

Zeile 1874Zeile 1896

$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.png\" 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.png\" 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->output_row("", "", $specific_file);

$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";

			$form_container->output_row("", "", $specific_file);

$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";

Zeile 2033Zeile 2055
		}

$css_to_insert = '';

		}

$css_to_insert = '';

		foreach($mybb->input['css_bits'] as $field => $value)

		foreach($mybb->input['css_bits'] as $field => $value)

		{
if(!trim($value) || !trim($field))
{

		{
if(!trim($value) || !trim($field))
{

Zeile 2231Zeile 2253

$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


	echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';

	echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';

	echo '<script type="text/javascript">

$(document).ready(function() {

	echo '<script type="text/javascript">

$(document).ready(function() {

Zeile 2242Zeile 2264
//]]>
</script>';


//]]>
</script>';


	$form->end();

$page->output_footer();
}


	$form->end();

$page->output_footer();
}


if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")
{
// Fetch the theme we want to edit this stylesheet in

if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")
{
// Fetch the theme we want to edit this stylesheet in

Zeile 2257Zeile 2279
	{
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");

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");


	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");


	$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);
if(!$parent_list)
{
$parent_list = 1;
}

	$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);
if(!$parent_list)
{
$parent_list = 1;
}





	$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1));
$stylesheet = $db->fetch_array($query);

// Does the theme not exist?
if(!$stylesheet['sid'])

	$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1));
$stylesheet = $db->fetch_array($query);

// Does the theme not exist?
if(!$stylesheet['sid'])

	{

	{

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

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

Zeile 2337Zeile 2359
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>

<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>

<script src="./jscripts/codemirror/addon/search/search.js"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>

';
}


';
}


Zeile 2458Zeile 2480
	{
$db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

	{
$db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

 

$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']);
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");


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


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

Zeile 2610Zeile 2635
<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>

<script src="./jscripts/codemirror/mode/css/css.js"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>

<script src="./jscripts/codemirror/addon/search/search.js"></script>

<script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>

';
}


';
}


Zeile 2873Zeile 2898
			});</script>';
}


			});</script>';
}


	echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';

	echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>';
echo '<script type="text/javascript">
$(function() {

	echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>';
echo '<script type="text/javascript">
$(function() {