Vergleich admin/modules/style/themes.php - 1.8.11 - 1.8.26

  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("https://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?api=2&type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);


if(!$contents)
{


if(!$contents)
{

Zeile 208Zeile 208
			$result['thumbnail']['value'] = htmlspecialchars_uni($result['thumbnail']['value']);
$result['name']['value'] = htmlspecialchars_uni($result['name']['value']);
$result['description']['value'] = htmlspecialchars_uni($result['description']['value']);

			$result['thumbnail']['value'] = htmlspecialchars_uni($result['thumbnail']['value']);
$result['name']['value'] = htmlspecialchars_uni($result['name']['value']);
$result['description']['value'] = htmlspecialchars_uni($result['description']['value']);

			$result['author']['value'] = $post_parser->parse_message($result['author']['value'], array(
'allow_html' => true
)
);

			$result['author']['url']['value'] = htmlspecialchars_uni($result['author']['url']['value']);
$result['author']['name']['value'] = htmlspecialchars_uni($result['author']['name']['value']);



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

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

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

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

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} <a href=\"{$result['author']['url']['value']}\" target=\"_blank\" rel=\"noopener\">{$result['author']['name']['value']}</a></small></i>");
$table->construct_cell("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center"));

			$table->construct_row();
}
}

			$table->construct_row();
}
}

Zeile 243Zeile 241
	echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
echo "<script type=\"text/javascript\">
var form = $(\"#search_form\");

	echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n";
echo "<script type=\"text/javascript\">
var form = $(\"#search_form\");

		form.submit(function()

		form.on('submit', function()

		{
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '{$lang->search_for_themes}')
{

		{
var search = $('#search_keywords');
if(search.val() == '' || search.val() == '{$lang->search_for_themes}')
{

				search.focus();

				search.trigger('focus');

				return false;
}
});

var search = $('#search_keywords');

				return false;
}
});

var search = $('#search_keywords');

		search.focus(function()

		search.on('focus', function()

		{
var search_focus = $(this);
if(search_focus.val() == '{$lang->search_for_themes}')

		{
var search_focus = $(this);
if(search_focus.val() == '{$lang->search_for_themes}')

Zeile 262Zeile 260
				search_focus.removeClass('search_default');
search_focus.val('');
}

				search_focus.removeClass('search_default');
search_focus.val('');
}

		});

search.blur(function()

		}).on('blur', function()



		{
var search_blur = $(this);
if(search_blur.val() == '')

		{
var search_blur = $(this);
if(search_blur.val() == '')

Zeile 286Zeile 282
	// 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=\"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));

		$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$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=\"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));

		$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$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 391Zeile 387

// Log admin action
log_admin_action($theme_id);


// Log admin action
log_admin_action($theme_id);





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

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

Zeile 560Zeile 556
		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;

			}

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

			}

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

			{

			{

				foreach($style as $stylesheet)
{
$stylesheets[$stylesheet]['applied_to'][$file][] = $action;

				foreach($style as $stylesheet)
{
$stylesheets[$stylesheet]['applied_to'][$file][] = $action;

Zeile 578Zeile 574
						}
}
}

						}
}
}

			}
}


			}
}


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

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

		$inherited_load = array_unique($inherited_load);

$inherited_themes = array();
if(count($inherited_load) > 0)

		$inherited_load = array_unique($inherited_load);

$inherited_themes = $theme_stylesheets = array();
if(count($inherited_load) > 0)

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

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

		}

$theme_stylesheets = array();

 




		if(count($inherited_load) > 0)
{

 
			$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

			$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{

Zeile 652Zeile 643
		$xml .= "\t</stylesheets>\r\n";

if($mybb->input['include_templates'] != 0)

		$xml .= "\t</stylesheets>\r\n";

if($mybb->input['include_templates'] != 0)

		{

		{

			$xml .= "\t<templates>\r\n";

			$xml .= "\t<templates>\r\n";

			$query = $db->simple_select("templates", "*", "sid='".$properties['templateset']."'");

			$query = $db->simple_select("templates", "*", "sid='".(int)$properties['templateset']."'");

			while($template = $db->fetch_array($query))
{
$template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);

			while($template = $db->fetch_array($query))
{
$template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);

Zeile 667Zeile 658
		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

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


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


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

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

Zeile 680Zeile 671
	}

$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($lang->export_theme, "index.php?module=style-themes&amp;action=export");

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





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

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


$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['export_theme'] = array(
'title' => $lang->export_theme,
'link' => "index.php?module=style-themes&amp;action=export&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['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
);


		'description' => $lang->export_theme_desc
);


Zeile 708Zeile 699
	);

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

	);

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





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

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





	$form = new Form("index.php?module=style-themes&amp;action=export", "post");
echo $form->generate_hidden_field("tid", $theme['tid']);


	$form = new Form("index.php?module=style-themes&amp;action=export", "post");
echo $form->generate_hidden_field("tid", $theme['tid']);


Zeile 724Zeile 715
	$form_container->end();

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

	$form_container->end();

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





	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();

Zeile 739Zeile 730

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


// Does the theme not exist?
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 749Zeile 740
	if($mybb->request_method == "post")
{
if($mybb->input['name'] == "")

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

		{

		{

			$errors[] = $lang->error_missing_name;
}
else

			$errors[] = $lang->error_missing_name;
}
else

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

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

			$sid = $properties['templateset'];

			$sid = (int)$properties['templateset'];

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

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

Zeile 783Zeile 774
						"version" => $db->escape_string($template['version']),
"dateline" => TIME_NOW
);

						"version" => $db->escape_string($template['version']),
"dateline" => TIME_NOW
);





					if($db->engine == "pgsql")
{
echo " ";
flush();

					if($db->engine == "pgsql")
{
echo " ";
flush();

					}

					}


$db->insert_query("templates", $insert);
}


$db->insert_query("templates", $insert);
}

Zeile 803Zeile 794

$nprops[$property] = $value;
if($properties['inherited'][$property])


$nprops[$property] = $value;
if($properties['inherited'][$property])

					{

					{

						$nprops['inherited'][$property] = $properties['inherited'][$property];
}
else

						$nprops['inherited'][$property] = $properties['inherited'][$property];
}
else

Zeile 818Zeile 809
			update_theme_stylesheet_list($tid);

$plugins->run_hooks("admin_style_themes_duplicate_commit");

			update_theme_stylesheet_list($tid);

$plugins->run_hooks("admin_style_themes_duplicate_commit");





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

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

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

flash_message($lang->success_duplicated_theme, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid=".$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']}");


Zeile 909Zeile 900
			$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);

$plugins->run_hooks("admin_style_themes_add_commit");

			$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);

$plugins->run_hooks("admin_style_themes_add_commit");


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


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


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->output_header("{$lang->themes} - {$lang->create_new_theme}");

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

if($errors)

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

if($errors)

Zeile 936Zeile 927
	$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->end();

	$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->end();





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

Zeile 952Zeile 943
	$theme = $db->fetch_array($query);

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

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

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

	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	}

// User clicked no

	}

// User clicked no

Zeile 976Zeile 967
			$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

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

			$theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);

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

			{

			{

				continue;
}

				continue;
}





			$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
}

			$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
}





		$inherited_stylesheets = false;

// Are any other themes relying on stylesheets from this theme? Get a list and show an error

		$inherited_stylesheets = false;

// Are any other themes relying on stylesheets from this theme? Get a list and show an error

Zeile 995Zeile 986
					if(strpos($filepath, "cache/themes/theme{$theme['tid']}") !== false)
{
$inherited_stylesheets = true;

					if(strpos($filepath, "cache/themes/theme{$theme['tid']}") !== false)
{
$inherited_stylesheets = true;

					}
}
}

					}
}
}

		}

if($inherited_stylesheets == true)

		}

if($inherited_stylesheets == true)

Zeile 1008Zeile 999

$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'");
while($cachefile = $db->fetch_array($query))


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

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

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

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

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

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

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

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

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





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

foreach($children as $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($child_tid != 0)
{
$child_tids[] = $child_tid;

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

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

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





		$plugins->run_hooks("admin_style_themes_delete_commit");

		$plugins->run_hooks("admin_style_themes_delete_commit");





		// Log admin action

		// Log admin action

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

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


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


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

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

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

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

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

Zeile 1070Zeile 1061
	}

$plugins->run_hooks("admin_style_themes_edit");

	}

$plugins->run_hooks("admin_style_themes_edit");





	if($mybb->request_method == "post" && !$mybb->input['do'])
{
$properties = array(

	if($mybb->request_method == "post" && !$mybb->input['do'])
{
$properties = array(

Zeile 1081Zeile 1072
			'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT),
'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),
'color' => $mybb->input['color']

			'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT),
'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),
'color' => $mybb->input['color']

		);


		);


		if($properties['color'] == 'none')

		if($properties['color'] == 'none')

		{

		{

			unset($properties['color']);
}

			unset($properties['color']);
}





		if($mybb->input['colors'])
{
$colors = explode("\n", $mybb->input['colors']);

foreach($colors as $color)
{

		if($mybb->input['colors'])
{
$colors = explode("\n", $mybb->input['colors']);

foreach($colors as $color)
{

				$color = explode("=", $color);

$properties['colors'][$color[0]] = $color[1];








				$color = trim($color);
if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
{
$color = explode("=", $color);
$properties['colors'][$color[0]] = $color[1];
}
else
{
$errors[] = $lang->sprintf($lang->error_invalid_color, $color);
}

			}
}


			}
}


Zeile 1164Zeile 1162
			if(!$parent_check)
{
$errors[] = $lang->error_invalid_parent_theme;

			if(!$parent_check)
{
$errors[] = $lang->error_invalid_parent_theme;

			}
}

			}
}

		if($properties['templateset'])
{

		if($properties['templateset'])
{

			$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'");

			$query = $db->simple_select("templatesets", "sid", "sid='".(int)$properties['templateset']."'");

			$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)
{

			$ts_check = $db->fetch_field($query, "sid");
if(!$ts_check)
{

Zeile 1179Zeile 1177
		{
$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']))

		if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme']))

		{
$errors[] = $lang->error_invalid_editortheme;
}

		{
$errors[] = $lang->error_invalid_editortheme;
}

Zeile 1197Zeile 1195
			}

// Log admin action

			}

// Log admin action

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

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


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


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

Zeile 1238Zeile 1236
	$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 = $theme_stylesheets = array();

	if(count($inherited_load) > 0)
{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");

	if(count($inherited_load) > 0)
{
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");

Zeile 1246Zeile 1244
		{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
}

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

	}

$theme_stylesheets = array();

 




	if(count($inherited_load) > 0)
{

 
		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
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;

		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
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['sid']] = $theme_stylesheet['name'];
}


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

Zeile 1424Zeile 1417
		}

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))

		}

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))

		{
$attached_to = '';

		{
$attached_to = '';


$applied_to_count = count($style['applied_to']);
$count = 0;


$applied_to_count = count($style['applied_to']);
$count = 0;

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

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

				{
continue;

				{
continue;

				}

if(array_key_exists($name, $properties['colors']))

				}

if(array_key_exists($name, $properties['colors']))

Zeile 1452Zeile 1445
				}

if(count($colors))

				}

if(count($colors))

				{

				{

					// Colors override files and are handled below.
continue;
}

// It's a file:
++$count;

					// Colors override files and are handled below.
continue;
}

// It's a file:
++$count;

 

$name = htmlspecialchars_uni($name);


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


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

 
					$actions = array_map('htmlspecialchars_uni', $actions);


					$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
}


					$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
}


Zeile 1568Zeile 1565
	$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');

$options = array();

	$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');

$options = array();

	$editor_theme_root = MYBB_ROOT."jscripts/sceditor/editor_themes/";

	$editor_theme_root = MYBB_ROOT."jscripts/sceditor/themes/";

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

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

Zeile 1595Zeile 1592
	if(!$properties['colors'] || !is_array($properties['colors']))
{
$color_setting = $lang->colors_no_color_setting;

	if(!$properties['colors'] || !is_array($properties['colors']))
{
$color_setting = $lang->colors_no_color_setting;

	}
else
{

	}
else
{

		$colors = array('none' => $lang->colors_please_select);
$colors = array_merge($colors, $properties['colors']);


		$colors = array('none' => $lang->colors_please_select);
$colors = array_merge($colors, $properties['colors']);


Zeile 1683Zeile 1680
		if(get_extension($mybb->input['name']) != "css")
{
// Does not end with '.css'

		if(get_extension($mybb->input['name']) != "css")
{
// Does not end with '.css'

			$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);




			$errors[] = $lang->sprintf(
$lang->error_missing_stylesheet_extension,
htmlspecialchars_uni($mybb->input['name'])
);

		}

if(!$errors)

		}

if(!$errors)

Zeile 1773Zeile 1773
			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action

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

			log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], $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 1804Zeile 1804
	}

$applied_to = $this_stylesheet['applied_to'];

	}

$applied_to = $this_stylesheet['applied_to'];

	unset($this_stylesheet);

	unset($this_stylesheet);


if($errors)
{


if($errors)
{

Zeile 1825Zeile 1825
				}
}
}

				}
}
}

	}

	}

	else
{
$mybb->input['name'] = $stylesheet['name'];
}

	else
{
$mybb->input['name'] = $stylesheet['name'];
}





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

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

Zeile 1845Zeile 1845
		$stylesheet['colors'] = array();

if(!is_array($properties['colors']))

		$stylesheet['colors'] = array();

if(!is_array($properties['colors']))

		{

		{

			$properties['colors'] = array();
}


			$properties['colors'] = array();
}


Zeile 1929Zeile 1929
	if(is_array($properties['colors']))
{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

	if(is_array($properties['colors']))
{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

		$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';

$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />
".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))."
";

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);

		$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';

$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />
".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))."
";

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);

		$specific_colors .= $form_container->end(true)."</div>";
}


		$specific_colors .= $form_container->end(true)."</div>";
}


Zeile 1971Zeile 1971
		'.$specific_colors_option.'
'.$specific_colors.'
</dl>

		'.$specific_colors_option.'
'.$specific_colors.'
</dl>

	<script type="text/javascript">

	<script type="text/javascript">

	checkAction(\'attach\');'.$check_actions.'
</script>';


	checkAction(\'attach\');'.$check_actions.'
</script>';


Zeile 1991Zeile 1991

echo <<<EOF



echo <<<EOF


	<script type="text/javascript" src="./jscripts/theme_properties.js"></script>

	<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1821"></script>

	<script type="text/javascript">
<!---
themeProperties.setup('{$count}');

	<script type="text/javascript">
<!---
themeProperties.setup('{$count}');

Zeile 2006Zeile 2006

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

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");

Zeile 2024Zeile 2024
	if(!$parent_list)
{
$parent_list = 1;

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


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


Zeile 2035Zeile 2035
		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");
}





	if($mybb->request_method == "post")
{
$sid = $stylesheet['sid'];

	if($mybb->request_method == "post")
{
$sid = $stylesheet['sid'];

Zeile 2056Zeile 2056

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


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

		{

		{

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

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

Zeile 2078Zeile 2078
		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)),

			"stylesheet" => $db->escape_string($new_stylesheet),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

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


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


$(document).ready(function() {

$(function() {

//<![CDATA[
ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'");
lang.saving = "'.$lang->saving.'";

//<![CDATA[
ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'");
lang.saving = "'.$lang->saving.'";

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


//]]>
</script>';


	$form->end();


	$form->end();


	$page->output_footer();
}

	$page->output_footer();
}





if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")

if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

{
// Fetch the theme we want to edit this stylesheet in
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

if(!$theme['tid'] || $theme['tid'] == 1)
{
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");


Zeile 2306Zeile 2306

// 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'])

		{

		{

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

// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

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

// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])),

			"stylesheet" => $db->escape_string($mybb->input['stylesheet']),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

Zeile 2322Zeile 2322
		if(!cache_stylesheet($theme['tid'], $stylesheet['name'], $mybb->input['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);

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

		}


		}


		// 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 2350Zeile 2350
	unset($stylesheets);

if($admin_options['codepress'] != 0)

	unset($stylesheets);

if($admin_options['codepress'] != 0)

	{

	{

		$page->extra_header .= '

		$page->extra_header .= '

<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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?ver=1808"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script>

';
}


';
}


Zeile 2373Zeile 2373
	{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");
$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));

	{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");
$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));





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

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

Zeile 2458Zeile 2458
	if(!$parent_list)
{
$parent_list = 1;

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


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

Zeile 2490Zeile 2490
		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

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

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


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


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

Zeile 2618Zeile 2618
			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

			log_admin_action($sid, $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));

			log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['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']));


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']));

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

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

<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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?ver=1808"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script>
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></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->add_stylesheet);
$properties = my_unserialize($theme['properties']);

	$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->add_stylesheet);
$properties = my_unserialize($theme['properties']);

Zeile 2648Zeile 2648
	$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,


$sub_tabs['add_stylesheet'] = array(
'title' => $lang->add_stylesheet,

Zeile 2668Zeile 2668
	);

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

	);

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





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

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

Zeile 2679Zeile 2679
			{
list(, $id) = explode('_', $name);
$id = (int)$id;

			{
list(, $id) = explode('_', $name);
$id = (int)$id;





				$mybb->input['applied_to'][$value] = array(0 => 'global');

if($mybb->input['action_'.$id] == 1)

				$mybb->input['applied_to'][$value] = array(0 => 'global');

if($mybb->input['action_'.$id] == 1)

Zeile 2690Zeile 2690
		}

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

		}

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

		{

		{

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

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

Zeile 2721Zeile 2721
		$check_actions = "";

foreach($mybb->input['applied_to'] as $name => $actions)

		$check_actions = "";

foreach($mybb->input['applied_to'] as $name => $actions)

		{

		{

			$action_list = "";
if($actions[0] != "global")
{
$action_list = implode(',', $actions);

			$action_list = "";
if($actions[0] != "global")
{
$action_list = implode(',', $actions);

			}

			}


if($actions[0] == "global")
{


if($actions[0] == "global")
{

Zeile 2751Zeile 2751
				</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.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);

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





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

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





			$check_actions .= "\n\tcheckAction('action_{$count}');";

			$check_actions .= "\n\tcheckAction('action_{$count}');";





			++$count;

			++$count;

		}


		}


		if($check_actions)
{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";
$global_checked[1] = "";

		if($check_actions)
{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";
$global_checked[1] = "";

		}

		}

	}
else if($mybb->input['attach'] == 2)
{

	}
else if($mybb->input['attach'] == 2)
{

Zeile 2779Zeile 2779
		{
// We might have colors here...
foreach($mybb->input['color'] as $color)

		{
// We might have colors here...
foreach($mybb->input['color'] as $color)

			{

			{

				// Verify this is a color for this theme
if(array_key_exists($color, $properties['colors']))
{

				// Verify this is a color for this theme
if(array_key_exists($color, $properties['colors']))
{

Zeile 2795Zeile 2795
			}
}
}

			}
}
}





	$specific_files .= "</div>";

// Colors

	$specific_files .= "</div>";

// Colors

Zeile 2805Zeile 2805
	{
$specific_colors = "<br /><div id=\"attach_2\" class=\"attachs\">";
$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt>';

	{
$specific_colors = "<br /><div id=\"attach_2\" class=\"attachs\">";
$specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt>';





		$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />

		$specific_color = "
<small>{$lang->colors_add_edit_desc}</small>
<br /><br />

Zeile 2899Zeile 2899
	}

echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></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" src="./jscripts/theme_properties.js?ver=1821"></script>';

	echo '<script type="text/javascript">
$(function() {
//<![CDATA[

	echo '<script type="text/javascript">
$(function() {
//<![CDATA[

Zeile 2919Zeile 2919
	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');

	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='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

// Does the theme not exist?
if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

$plugins->run_hooks("admin_style_themes_set_default");


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

$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$theme = $db->fetch_array($query);

// Does the theme not exist?
if(!$theme['tid'] || $theme['tid'] == 1)
{
flash_message($lang->error_invalid_theme, 'error');
admin_redirect("index.php?module=style-themes");
}

$plugins->run_hooks("admin_style_themes_set_default");


	$cache->update('default_theme', $theme);

$db->update_query("themes", array('def' => 0));

	$cache->update('default_theme', $theme);

$db->update_query("themes", array('def' => 0));

Zeile 2942Zeile 2942
	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

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

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


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


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

Zeile 2955Zeile 2955

// Does the theme not exist?
if(!$theme['tid'] || $theme['tid'] == 1)


// Does the theme not exist?
if(!$theme['tid'] || $theme['tid'] == 1)

	{

	{

		flash_message($lang->error_invalid_theme, 'error');

		flash_message($lang->error_invalid_theme, 'error');

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

$plugins->run_hooks("admin_style_themes_force");


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

$plugins->run_hooks("admin_style_themes_force");


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

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

Zeile 2977Zeile 2977
		$plugins->run_hooks("admin_style_themes_force_commit");

$db->update_query("users", $updated_users);

		$plugins->run_hooks("admin_style_themes_force_commit");

$db->update_query("users", $updated_users);

 

// The theme has to be accessible to all usergroups in order to force on all users
if($theme['allowedgroups'] !== "all")
{
$db->update_query("themes", array("allowedgroups" => "all"), "tid='{$theme['tid']}'");
}


// Log admin action


// Log admin action

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

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


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


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