Vergleich admin/modules/style/themes.php - 1.8.13 - 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>{$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();
}
}

if($table->num_rows() == 0)

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

if($table->num_rows() == 0)

	{

	{

		$table->construct_cell($lang->error_no_results_found, array("colspan" => 3));
$table->construct_row();
}

		$table->construct_cell($lang->error_no_results_found, array("colspan" => 3));
$table->construct_row();
}

Zeile 233Zeile 231
	{
$default_class = '';
$value = htmlspecialchars_uni($mybb->input['keywords']);

	{
$default_class = '';
$value = htmlspecialchars_uni($mybb->input['keywords']);

	}

	}

	else
{
$default_class = "search_default";

	else
{
$default_class = "search_default";

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}')

			{

			{

				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 347Zeile 343
					if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					}

					}

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

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

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

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

Zeile 538Zeile 534
		foreach($properties as $property => $value)
{
if($property == "inherited") continue;

		foreach($properties as $property => $value)
{
if($property == "inherited") continue;





			if(is_array($value))
{
$value = my_serialize($value);

			if(is_array($value))
{
$value = my_serialize($value);

Zeile 549Zeile 545
			$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n";
}
$xml .= "\t</properties>\r\n";

			$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n";
}
$xml .= "\t</properties>\r\n";





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


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

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

			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($lang->duplicate_theme, "index.php?module=style-themes&amp;action=duplicate&amp;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($lang->duplicate_theme, "index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['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);
}

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

if($errors)

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

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

	$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->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
if($mybb->input['no'])
{

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

Zeile 978Zeile 969
			if(!$theme2['stylesheets']['inherited'])
{
continue;

			if(!$theme2['stylesheets']['inherited'])
{
continue;

			}

			}


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


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

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)
{
flash_message($lang->error_inheriting_stylesheets, 'error');
admin_redirect("index.php?module=style-themes");


if($inherited_stylesheets == true)
{
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))


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

Zeile 1015Zeile 1006
			@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']}/{$filename_min}");
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");





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

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





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





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

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

// Log admin action


$plugins->run_hooks("admin_style_themes_delete_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_deleted, 'success');
admin_redirect("index.php?module=style-themes");


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

Zeile 1084Zeile 1075
		);

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

		);

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

		{

		{

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


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


Zeile 1094Zeile 1085

foreach($colors as $color)
{


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 1168Zeile 1166
		}
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 1214Zeile 1212
	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 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))
{

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

Zeile 1261Zeile 1254
			}

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

			}

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

		}
}

		}
}


// Save any stylesheet orders
if($mybb->request_method == "post" && $mybb->input['do'] == "save_orders")


// Save any stylesheet orders
if($mybb->request_method == "post" && $mybb->input['do'] == "save_orders")

Zeile 1344Zeile 1337
	$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

// Display Order form

	$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

// Display Order form

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

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

	echo $form->generate_hidden_field("do", 'save_orders');

// Order the stylesheets

	echo $form->generate_hidden_field("do", 'save_orders');

// Order the stylesheets

Zeile 1459Zeile 1452

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


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

				}

				}


if($count == $applied_to_count && $count > 1)
{


if($count == $applied_to_count && $count > 1)
{

Zeile 1472Zeile 1469
				$attached_to .= $sep.$name;

$sep = $lang->comma;

				$attached_to .= $sep.$name;

$sep = $lang->comma;

			}


			}


			if($attached_to)
{
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>";

			if($attached_to)
{
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>";

Zeile 1558Zeile 1555
		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');

		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');





	$options = array();
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))
{
$options[(int)$templateset['sid']] = $templateset['title'];

	$options = array();
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))
{
$options[(int)$templateset['sid']] = $templateset['title'];

	}

	}

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

	if($dh = @opendir($editor_theme_root))

	{

	{

		while($dir = readdir($dh))
{
if($dir == ".svn" || $dir == "." || $dir == ".." || is_dir($editor_theme_root.$dir) || get_extension($editor_theme_root.$dir) != 'css')

		while($dir = readdir($dh))
{
if($dir == ".svn" || $dir == "." || $dir == ".." || is_dir($editor_theme_root.$dir) || get_extension($editor_theme_root.$dir) != 'css')

Zeile 1579Zeile 1576
			}
$options[$dir] = ucfirst(str_replace(array('_', '.css'), array(' ', ''), $dir));
}

			}
$options[$dir] = ucfirst(str_replace(array('_', '.css'), array(' ', ''), $dir));
}

	}


	}


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

$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');

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

$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');

Zeile 1591Zeile 1588
	$form_container->end();

$form_container = new FormContainer($lang->colors_manage);

	$form_container->end();

$form_container = new FormContainer($lang->colors_manage);





	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;

Zeile 1602Zeile 1599
		$colors = array_merge($colors, $properties['colors']);

$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));

		$colors = array_merge($colors, $properties['colors']);

$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));





		$mybb->input['colors'] = '';
foreach($properties['colors'] as $key => $color)
{

		$mybb->input['colors'] = '';
foreach($properties['colors'] as $key => $color)
{

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 1709Zeile 1709
						$attached_id = (int)str_replace('attached_', '', $id);

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

						$attached_id = (int)str_replace('attached_', '', $id);

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

						{

						{

							// We have custom actions for attached files
$actions_list = $mybb->input['action_list_'.$attached_id];
}

							// We have custom actions for attached files
$actions_list = $mybb->input['action_list_'.$attached_id];
}

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

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

			{

			{

				if(!is_array($mybb->input['color']))
{
$errors[] = $lang->error_no_color_picked;

				if(!is_array($mybb->input['color']))
{
$errors[] = $lang->error_no_color_picked;

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 1847Zeile 1847
		if(!is_array($properties['colors']))
{
$properties['colors'] = array();

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

		}

		}


foreach($applied_to as $name => $actions)
{


foreach($applied_to as $name => $actions)
{

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 .= $form_container->end(true)."</div>";
}

$actions = '<script type="text/javascript">
function checkAction(id)
{
var checked = \'\';

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

$actions = '<script type="text/javascript">
function checkAction(id)
{
var checked = \'\';


$(\'.\'+id+\'s_check\').each(function(e, val)
{


$(\'.\'+id+\'s_check\').each(function(e, val)
{

Zeile 1986Zeile 1986
	$form_container->end();

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

	$form_container->end();

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


$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


	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 2000Zeile 2000
EOF;

$form->end();

EOF;

$form->end();





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 2015Zeile 2015
	{
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_simple");

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

	$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");

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

Zeile 2031Zeile 2031

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


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

	{
flash_message($lang->error_invalid_stylesheet, 'error');

	{
flash_message($lang->error_invalid_stylesheet, 'error');

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


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


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 2161Zeile 2161
		if($stylesheet['tid'] == 1)
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert");

		if($stylesheet['tid'] == 1)
{
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert");

		}

		}

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

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

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.'";
});
//]]>
</script>';

//<![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.'";
});
//]]>
</script>';





	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 2282Zeile 2282
	}

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


	$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 2313Zeile 2313
		// 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($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 2359Zeile 2359
<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/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=1813"></script>

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

';
}


';
}


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 2635Zeile 2635
<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/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=1813"></script>

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

';
}


';
}


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