Vergleich admin/modules/style/themes.php - 1.6.3 - 1.6.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: themes.php 5380 2011-02-21 12:04:43Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

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


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


	if(!$theme['tid'])

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

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

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

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

	{

	{

		$parent_list = 1;
}


		$parent_list = 1;
}


Zeile 74Zeile 74
	$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));

Zeile 112Zeile 112
		'title' => $lang->import_a_theme,
'link' => "index.php?module=style-themes&amp;action=import",
'description' => $lang->import_a_theme_desc

		'title' => $lang->import_a_theme,
'link' => "index.php?module=style-themes&amp;action=import",
'description' => $lang->import_a_theme_desc

	);


	);


	$sub_tabs['browse_themes'] = array(
'title' => $lang->browse_themes,
'link' => "index.php?module=style-themes&amp;action=browse",

	$sub_tabs['browse_themes'] = array(
'title' => $lang->browse_themes,
'link' => "index.php?module=style-themes&amp;action=browse",

Zeile 178Zeile 178
	$parser = new XMLParser($contents);
$tree = $parser->get_tree();


	$parser = new XMLParser($contents);
$tree = $parser->get_tree();


	if(!array_key_exists("results", $tree))

	if(!is_array($tree) || !isset($tree['results']))

	{
$page->output_inline_error($lang->error_communication_problem);
$page->output_footer();

	{
$page->output_inline_error($lang->error_communication_problem);
$page->output_footer();

Zeile 192Zeile 192
			$only_theme = $tree['results']['result'];
unset($tree['results']['result']);
$tree['results']['result'][0] = $only_theme;

			$only_theme = $tree['results']['result'];
unset($tree['results']['result']);
$tree['results']['result'][0] = $only_theme;

		}

		}

	
foreach($tree['results']['result'] as $result)
{

	
foreach($tree['results']['result'] as $result)
{

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

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

	}

	}


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


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

Zeile 231Zeile 231
			{
search.focus();
return false;

			{
search.focus();
return false;

			}

			}

		}

var search = document.getElementById('search_keywords');

		}

var search = document.getElementById('search_keywords');

Zeile 349Zeile 349
			{
// UPLOAD_ERR_NO_FILE
$errors[] = $lang->error_uploadfailed_php4;

			{
// UPLOAD_ERR_NO_FILE
$errors[] = $lang->error_uploadfailed_php4;

			}

			}

			
if(!$errors)
{

			
if(!$errors)
{

Zeile 385Zeile 385
						case -3:
$errors[] = $lang->error_theme_already_exists;
break;

						case -3:
$errors[] = $lang->error_theme_already_exists;
break;

 
						case -4:
$errors[] = $lang->error_theme_security_problem;

					}
}
}

					}
}
}

Zeile 633Zeile 635
		$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'], $theme['name']);

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

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

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

Zeile 710Zeile 712
			$plugins->run_hooks("admin_style_themes_add_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_add_commit");

// Log admin action

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

			log_admin_action(htmlspecialchars_uni($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 837Zeile 839
		$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'], $theme['name']);

		log_admin_action($theme['tid'], htmlspecialchars_uni($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 856Zeile 858
	$theme = $db->fetch_array($query);

// Does the theme not exist?

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

// Does the theme not exist?

	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 884Zeile 886
			foreach($mybb->input['allowedgroups'] as $gid)
{
if($gid == "all")

			foreach($mybb->input['allowedgroups'] as $gid)
{
if($gid == "all")

				{

				{

					$allowedgroups = "all";
break;
}

					$allowedgroups = "all";
break;
}

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

$plugins->run_hooks("admin_style_themes_edit_commit");

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

$plugins->run_hooks("admin_style_themes_edit_commit");

			

			

			// Log admin action

			// Log admin action

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

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

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

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

Zeile 973Zeile 975
				if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action])))
{
$stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];

				if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action])))
{
$stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];

					foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
{
$inherited_load[] = $value;
}
}
}

					foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
{
$inherited_load[] = $value;
}
}
}

		}
}


		}
}


Zeile 986Zeile 988
	$inherited_load = array_unique($inherited_load);

$inherited_themes = array();

	$inherited_load = array_unique($inherited_load);

$inherited_themes = array();

	if(count($inherited_load) > 0)

	if(count($inherited_load) > 0)

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

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

		{

		{

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

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

Zeile 1002Zeile 1004
		$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))
{

			if(!$theme_stylesheets[$theme_stylesheet['cachefile']] && in_array($theme_stylesheet['tid'], $inherited_load))

			if(!isset($theme_stylesheets[$theme_stylesheet['cachefile']]) && in_array($theme_stylesheet['tid'], $inherited_load))

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

		}
}

		}
}

	
$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 1024Zeile 1026
	$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 1038Zeile 1040
	$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

foreach($stylesheets as $filename => $style)

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

foreach($stylesheets as $filename => $style)

	{

	{

		if(strpos($filename, 'css.php?stylesheet=') !== false)
{
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

		if(strpos($filename, 'css.php?stylesheet=') !== false)
{
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);

Zeile 1054Zeile 1056
		resync_stylesheet($theme_stylesheets[$filename]);

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

		resync_stylesheet($theme_stylesheets[$filename]);

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

		

		

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

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

Zeile 1064Zeile 1066
				if($inherited_themes[$tid])
{
$inherited_ary[$tid] = $inherited_themes[$tid];

				if($inherited_themes[$tid])
{
$inherited_ary[$tid] = $inherited_themes[$tid];

				}
}
}


				}
}
}


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

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

Zeile 1077Zeile 1079
			
foreach($inherited_ary as $tid => $file)
{

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

				if($count == $applied_to_count && $count != 0)

				if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)

				{
$sep = ", {$lang->and} ";
}

				{
$sep = ", {$lang->and} ";
}

Zeile 1090Zeile 1092
			$inherited .= ")</small>";
}


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


		if(is_array($style['applied_to']) && $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 = "<small>{$lang->attached_to}";


		{
$attached_to = "<small>{$lang->attached_to}";


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


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


	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 1375Zeile 1377
			$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'], $theme['name']);

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

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

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

Zeile 1560Zeile 1562
}

// Shows the page where you can actually edit a particular selector or the whole stylesheet

}

// Shows the page where you can actually edit a particular selector or the whole stylesheet

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

if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))

{
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");


{
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");


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


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


	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 1650Zeile 1652
		$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit");

// Log admin action

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

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


if(!$mybb->input['ajax'])
{


if(!$mybb->input['ajax'])
{

Zeile 1808Zeile 1810
	
// Get the properties from this item
$properties = parse_css_properties($editable_selector['values']);

	
// Get the properties from this item
$properties = parse_css_properties($editable_selector['values']);

	










foreach(array('background', 'color', 'width', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-decoration') as $_p)
{
if(!isset($properties[$_p]))
{
$properties[$_p] = '';
}
}


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

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

Zeile 1822Zeile 1832
	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_row();

	$table->construct_row();

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));

	$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));
$table->construct_row();
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;'));

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


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


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

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

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

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

	}


	}


	$parent_list = make_parent_theme_list($theme['tid']);
$parent_list = implode(',', $parent_list);
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 1920Zeile 1930
		$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced_commit");

// Log admin action

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

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


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


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

		

		

		if(!$mybb->input['save_close'])

		if(!$mybb->input['save_close'])

		{

		{

			admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");

			admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");

		}

		}

		else

		else

		{

		{

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

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

		}
}

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

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

// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited')
{
continue;
}

foreach($action_stylesheet as $action => $style)
{
foreach($style as $stylesheet2)
{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
{
$stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
{
$inherited_load[] = $value;
}
}
}
}
}

		}
}

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

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

// Now we loop through the list of stylesheets for each file
foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited')
{
continue;
}

foreach($action_stylesheet as $action => $style)
{
foreach($style as $stylesheet2)
{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))
{
$stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
{
$inherited_load[] = $value;
}
}
}
}
}

	
foreach($stylesheets as $file => $stylesheet2)
{

	
foreach($stylesheets as $file => $stylesheet2)
{

Zeile 1978Zeile 1988
		
$stylesheets[basename($file)] = $stylesheet2;
unset($stylesheets[$file]);

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

	}

	}

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

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

Zeile 2002Zeile 2012
	if($this_stylesheet['inherited'][$stylesheet['name']])
{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");

	if($this_stylesheet['inherited'][$stylesheet['name']])
{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");

		$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));

		$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));

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

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

Zeile 2074Zeile 2084
if($mybb->input['action'] == "delete_stylesheet")
{
$plugins->run_hooks("admin_style_themes_delete_stylesheet");

if($mybb->input['action'] == "delete_stylesheet")
{
$plugins->run_hooks("admin_style_themes_delete_stylesheet");

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

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

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

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

		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 2090Zeile 2100
	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 2099Zeile 2109
	if(!$stylesheet['sid'] || $stylesheet['tid'] == 1)
{
flash_message($lang->error_invalid_stylesheet, 'error');

	if(!$stylesheet['sid'] || $stylesheet['tid'] == 1)
{
flash_message($lang->error_invalid_stylesheet, 'error');

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

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

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

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

Zeile 2115Zeile 2125
		
// 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']);

		

		

		$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'], $theme['name']);


		log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], htmlspecialchars_uni($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 2138Zeile 2148
	$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'");
$theme = $db->fetch_array($query);


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


	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 2159Zeile 2169
		}

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

		}

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

		{

		{

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

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

Zeile 2171Zeile 2181
						$inherited_load[] = $value;
}
}

						$inherited_load[] = $value;
}
}

			}
}
}


			}
}
}


	foreach($stylesheets as $file => $stylesheet2)
{
if(is_array($stylesheet2['inherited']))

	foreach($stylesheets as $file => $stylesheet2)
{
if(is_array($stylesheet2['inherited']))

Zeile 2184Zeile 2194
				$stylesheet2['inherited'][basename($inherited_file)] = $tid;
unset($stylesheet2['inherited'][$inherited_file]);
}

				$stylesheet2['inherited'][basename($inherited_file)] = $tid;
unset($stylesheet2['inherited'][$inherited_file]);
}

		}

		}

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

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

Zeile 2192Zeile 2202
	
if($mybb->request_method == "post")
{

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

 
		// Remove special characters
$mybb->input['name'] = preg_replace('#([^a-z0-9-_\.]+)#i', '', $mybb->input['name']);

		if(!$mybb->input['name'] || $mybb->input['name'] == ".css")
{
$errors[] = $lang->error_missing_stylesheet_name;
}

if(substr($mybb->input['name'], -4) != ".css")

		if(!$mybb->input['name'] || $mybb->input['name'] == ".css")
{
$errors[] = $lang->error_missing_stylesheet_name;
}

if(substr($mybb->input['name'], -4) != ".css")

		{

		{

			// Does not end with '.css'
$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);
}

			// Does not end with '.css'
$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);
}

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

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

			}

			}

			else
{
// Custom stylesheet

			else
{
// Custom stylesheet

Zeile 2237Zeile 2249
						$attached_to = $value;

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

						$attached_to = $value;

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 2275Zeile 2287
			$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'], $theme['name']);

			log_admin_action($sid, $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($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 2316Zeile 2328
	$page->output_nav_tabs($sub_tabs, 'add_stylesheet');

if($errors)

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

if($errors)

	{

	{

		$page->output_inline_error($errors);

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

		$page->output_inline_error($errors);

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

Zeile 2358Zeile 2370
	$specific_files = "<div id=\"attach_1\" class=\"attachs\">";
$count = 0;


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


	if(is_array($mybb->input['applied_to']) && $mybb->input['applied_to']['global'][0] != "global")

	if(is_array($mybb->input['applied_to']) && (!isset($mybb->input['applied_to']['global']) || $mybb->input['applied_to']['global'][0] != "global"))

	{
$check_actions = "";


	{
$check_actions = "";


Zeile 2394Zeile 2406
			<table cellpadding=\"4\">
<tr>
<td>".$form->generate_text_box('action_list_'.$count, $action_list, array('id' => 'action_list_'.$count, 'style' => 'width: 190px;'))."</td>

			<table cellpadding=\"4\">
<tr>
<td>".$form->generate_text_box('action_list_'.$count, $action_list, array('id' => 'action_list_'.$count, 'style' => 'width: 190px;'))."</td>

				</tr>
</table>

				</tr>
</table>

		</dd>
</dl>";


		</dd>
</dl>";


Zeile 2473Zeile 2485
		<dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"2\" {$add_checked[2]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->write_own}</strong></label></dt>
<span id=\"add_2\" class=\"adds\"><br />".$form->generate_text_area('stylesheet', $mybb->input['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => 'codepress css', 'rows' => '30'))."</span>
</dl>";

		<dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"2\" {$add_checked[2]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->write_own}</strong></label></dt>
<span id=\"add_2\" class=\"adds\"><br />".$form->generate_text_area('stylesheet', $mybb->input['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => 'codepress css', 'rows' => '30'))."</span>
</dl>";

	

	

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

$form_container->end();

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

$form_container->end();

Zeile 2526Zeile 2538
	$theme = $db->fetch_array($query);

// Does the theme not exist?

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

// Does the theme not exist?

	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 2538Zeile 2550
	$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'], $theme['name']);


	log_admin_action($theme['tid'], htmlspecialchars_uni($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");
}





if($mybb->input['action'] == "force")
{
$plugins->run_hooks("admin_style_themes_force");

if($mybb->input['action'] == "force")
{
$plugins->run_hooks("admin_style_themes_force");

Zeile 2552Zeile 2564
	$theme = $db->fetch_array($query);

// Does the theme not exist?

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

// Does the theme not exist?

	if(!$theme['tid'])

	if(!$theme['tid'] || $theme['tid'] == 1)

	{
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 2575Zeile 2587
		$plugins->run_hooks("admin_style_themes_force_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_force_commit");

// Log admin action

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

		log_admin_action($theme['tid'], htmlspecialchars_uni($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");