Vergleich admin/modules/style/themes.php - 1.8.20 - 1.8.21

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 243Zeile 243
	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 262
				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 473Zeile 471
		if($(\'#\'+id+\'_\'+checked))
{
$(\'#\'+id+\'_\'+checked).show();

		if($(\'#\'+id+\'_\'+checked))
{
$(\'#\'+id+\'_\'+checked).show();

		}
}

		}
}

</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">
<dt><label style="display: block;"><input type="radio" name="import" value="0" '.$import_checked[1].' class="imports_check" onclick="checkAction(\'import\');" style="vertical-align: middle;" /> '.$lang->local_file.'</label></dt>

</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">
<dt><label style="display: block;"><input type="radio" name="import" value="0" '.$import_checked[1].' class="imports_check" onclick="checkAction(\'import\');" style="vertical-align: middle;" /> '.$lang->local_file.'</label></dt>

Zeile 558Zeile 556

// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)


// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)

		{

		{

			if($file == 'inherited' || !is_array($action_stylesheet))
{
continue;

			if($file == 'inherited' || !is_array($action_stylesheet))
{
continue;

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

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

			{

			{

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


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


Zeile 600Zeile 598
				{
$theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet;
$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];

				{
$theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet;
$theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];

				}
}

				}
}

		}

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

		}

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

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

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

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

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


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


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

	);

	);


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


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

Zeile 701Zeile 699
		'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",
'description' => $lang->duplicate_theme_desc
);

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





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

if($errors)

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

if($errors)

Zeile 714Zeile 712

$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name']));
$form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme');


$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name']));
$form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme');

	$form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');

$form_container->end();

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

$form->output_submit_wrapper($buttons);

$form->end();

$page->output_footer();

	$form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');

$form_container->end();

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

$form->output_submit_wrapper($buttons);

$form->end();

$page->output_footer();

}

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

}

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

Zeile 740Zeile 738
	}

$plugins->run_hooks("admin_style_themes_duplicate");

	}

$plugins->run_hooks("admin_style_themes_duplicate");





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

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

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

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





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

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

Zeile 766Zeile 764
			if($mybb->input['duplicate_templates'])
{
$nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));

			if($mybb->input['duplicate_templates'])
{
$nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));





				// Copy all old Templates to our new templateset
$query = $db->simple_select("templates", "*", "sid='{$sid}'");
while($template = $db->fetch_array($query))

				// Copy all old Templates to our new templateset
$query = $db->simple_select("templates", "*", "sid='{$sid}'");
while($template = $db->fetch_array($query))

Zeile 849Zeile 847
		'link' => "index.php?module=style-themes&amp;action=duplicate&amp;tid={$mybb->input['tid']}",
'description' => $lang->duplicate_theme_desc
);

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





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

if($errors)

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

if($errors)

Zeile 859Zeile 857
	else
{
$mybb->input['duplicate_templates'] = true;

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

	}

	}


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



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


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

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

		{

		{

			$errors[] = $lang->error_missing_name;

			$errors[] = $lang->error_missing_name;

		}

		}

		else if(in_array($mybb->input['name'], $themes))
{
$errors[] = $lang->error_theme_already_exists;

		else if(in_array($mybb->input['name'], $themes))
{
$errors[] = $lang->error_theme_already_exists;

		}


		}


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

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





			$plugins->run_hooks("admin_style_themes_add_commit");

			$plugins->run_hooks("admin_style_themes_add_commit");





			// Log admin action
log_admin_action($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}");

Zeile 933Zeile 931
	$form_container->end();

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

	$form_container->end();

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


$form->output_submit_wrapper($buttons);

$form->end();

$page->output_footer();
}



$form->output_submit_wrapper($buttons);

$form->end();

$page->output_footer();
}


if($mybb->input['action'] == "delete")
{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

if($mybb->input['action'] == "delete")
{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");

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

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





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

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

			}
}


			}
}


		if($update_array['pid'])
{
$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");

		if($update_array['pid'])
{
$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'");

Zeile 1169Zeile 1167
			}
}
if($properties['templateset'])

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

		{

		{

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

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

Zeile 1181Zeile 1179
		{
$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 1196Zeile 1194
			if($theme['def'] == 1)
{
$cache->update_default_theme();

			if($theme['def'] == 1)
{
$cache->update_default_theme();

			}

			}


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


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

Zeile 1207Zeile 1205
	}

// Fetch list of all of the stylesheets for this theme

	}

// Fetch list of all of the stylesheets for this theme

	$file_stylesheets = my_unserialize($theme['stylesheets']);

	$file_stylesheets = my_unserialize($theme['stylesheets']);


$stylesheets = array();
$inherited_load = array();


$stylesheets = array();
$inherited_load = array();

Zeile 1238Zeile 1236
	}

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

	}

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

	$inherited_load = array_unique($inherited_load);

	$inherited_load = array_unique($inherited_load);


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


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

Zeile 1247Zeile 1245
		while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

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

		}


		}


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

		$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['name']] = $theme_stylesheet;
}

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

		}

		}

	}

// Save any stylesheet orders

	}

// Save any stylesheet orders

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

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

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

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

			}
}

			}
}


asort($orders, SORT_NUMERIC);



asort($orders, SORT_NUMERIC);


Zeile 1446Zeile 1444
				if(array_key_exists($name, $properties['colors']))
{
$colors[] = $properties['colors'][$name];

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

				}


				}


				if(count($colors))
{
// Colors override files and are handled below.

				if(count($colors))
{
// Colors override files and are handled below.

Zeile 1569Zeile 1567
	$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($dir == ".svn" || $dir == "." || $dir == ".." || is_dir($editor_theme_root.$dir) || get_extension($editor_theme_root.$dir) != 'css')

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

			{

			{

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

				continue;
}
$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->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
$form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace', 'min' => 0)), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth', 'min' => 0)), 'borderwidth');

	$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->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
$form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace', 'min' => 0)), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth', 'min' => 0)), 'borderwidth');


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

	}

	}

	else
{
$colors = array('none' => $lang->colors_please_select);

	else
{
$colors = array('none' => $lang->colors_please_select);

Zeile 1618Zeile 1616

$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color');
$form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));


$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color');
$form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));


$form_container->end();



$form_container->end();


	$buttons = array();
$buttons[] = $form->generate_submit_button($lang->save_theme_properties);
$form->output_submit_wrapper($buttons);

	$buttons = array();
$buttons[] = $form->generate_submit_button($lang->save_theme_properties);
$form->output_submit_wrapper($buttons);

Zeile 1696Zeile 1694
			if($theme['tid'] != $stylesheet['tid'])
{
$stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']);

			if($theme['tid'] != $stylesheet['tid'])
{
$stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']);

			}

			}


$attached = array();
if($mybb->input['attach'] == 1)


$attached = array();
if($mybb->input['attach'] == 1)

			{

			{

				// Our stylesheet is attached to custom pages in MyBB
foreach($mybb->input as $id => $value)
{

				// Our stylesheet is attached to custom pages in MyBB
foreach($mybb->input as $id => $value)
{

Zeile 1725Zeile 1723

$attached[] = $attached_to;
}


$attached[] = $attached_to;
}

				}

				}

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

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

				{

				{

					$errors[] = $lang->error_no_color_picked;

					$errors[] = $lang->error_no_color_picked;

				}

				}

				else
{
$attached = $mybb->input['color'];

				else
{
$attached = $mybb->input['color'];

				}

				}

			}

// Update Stylesheet

			}

// Update Stylesheet

Zeile 1744Zeile 1742
				'name' => $db->escape_string($mybb->input['name']),
'attachedto' => $db->escape_string(implode('|', $attached))
);

				'name' => $db->escape_string($mybb->input['name']),
'attachedto' => $db->escape_string(implode('|', $attached))
);


if($stylesheet['name'] != $mybb->input['name'])


if($stylesheet['name'] != $mybb->input['name'])

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

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

			}

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

			}

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


// If the name changed, re-cache our stylesheet
$theme_c = $update_d = false;


// If the name changed, re-cache our stylesheet
$theme_c = $update_d = false;

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

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





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

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





			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");





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


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


Zeile 1789Zeile 1787
	$page->add_breadcrumb_item(htmlspecialchars_uni($stylesheet['name'])." {$lang->properties}", "index.php?module=style-themes&amp;action=edit_properties&amp;tid={$mybb->input['tid']}");

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

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

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





	// If the stylesheet and theme do not match, we must be editing something that is inherited
if($this_stylesheet['inherited'][$stylesheet['name']])
{

	// If the stylesheet and theme do not match, we must be editing something that is inherited
if($this_stylesheet['inherited'][$stylesheet['name']])
{

Zeile 1809Zeile 1807

$applied_to = $this_stylesheet['applied_to'];
unset($this_stylesheet);


$applied_to = $this_stylesheet['applied_to'];
unset($this_stylesheet);





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

foreach($mybb->input as $name => $value)

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

foreach($mybb->input as $name => $value)

		{

		{

			if(strpos($name, "attached") !== false)
{
list(, $id) = explode('_', $name);

			if(strpos($name, "attached") !== false)
{
list(, $id) = explode('_', $name);

Zeile 1828Zeile 1826
					$applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
}
}

					$applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
}
}

		}
}

		}
}

	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 1849Zeile 1847
		$stylesheet['colors'] = array();

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

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

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

		{

		{

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

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

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

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

		{

		{

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

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

Zeile 1934Zeile 1932
	{
$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_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 = \'\';

$(\'.\'+id+\'s_check\').each(function(e, val)
{
if($(this).prop(\'checked\') == true)
{
checked = $(this).val();
}
});
$(\'.\'+id+\'s\').each(function(e)
{


$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)
{
if($(this).prop(\'checked\') == true)
{
checked = $(this).val();
}
});
$(\'.\'+id+\'s\').each(function(e)
{

			$(this).hide();
});
if($(\'#\'+id+\'_\'+checked))

			$(this).hide();
});
if($(\'#\'+id+\'_\'+checked))

Zeile 1981Zeile 1979

echo $form->generate_hidden_field("file", htmlspecialchars_uni($stylesheet['name']))."<br />\n";
echo $form->generate_hidden_field("tid", $theme['tid'])."<br />\n";


echo $form->generate_hidden_field("file", htmlspecialchars_uni($stylesheet['name']))."<br />\n";
echo $form->generate_hidden_field("tid", $theme['tid'])."<br />\n";





	$form_container = new FormContainer("{$lang->edit_stylesheet_properties_for} ".htmlspecialchars_uni($stylesheet['name']));
$form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');

$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);

	$form_container = new FormContainer("{$lang->edit_stylesheet_properties_for} ".htmlspecialchars_uni($stylesheet['name']));
$form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');

$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);





	$form_container->end();

	$form_container->end();





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

$form->output_submit_wrapper($buttons);

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

$form->output_submit_wrapper($buttons);





	echo <<<EOF


	echo <<<EOF


	<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1820"></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 2003Zeile 2001
	</script>
EOF;


	</script>
EOF;


	$form->end();


	$form->end();


	$page->output_footer();
}


	$page->output_footer();
}


Zeile 2274Zeile 2272
}

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

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

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

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

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

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

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

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

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

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

Zeile 2363Zeile 2361
<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 2639Zeile 2637
<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 2903Zeile 2901
	}

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?ver=1820"></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 2981Zeile 2979
		$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($theme['tid'], $theme['name']);


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