Vergleich admin/modules/style/themes.php - 1.8.3 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 35Zeile 35
if($mybb->input['action'] == "xmlhttp_stylesheet" && $mybb->request_method == "post")
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

Zeile 155Zeile 155

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


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

		$url_page = "&page=".$mybb->get_input('page', 1);

		$url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 379Zeile 379
				$options = array(
'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1),
'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),

				$options = array(
'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1),
'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),

					'version_compat' => (int)$mybb->input['version_compat'],
'parent' => $mybb->get_input('tid', 1),

					'version_compat' => $mybb->get_input('version_compat', MyBB::INPUT_INT),
'parent' => $mybb->get_input('tid', MyBB::INPUT_INT),

					'force_name_check' => true,
);
$theme_id = import_theme_xml($contents, $options);

					'force_name_check' => true,
);
$theme_id = import_theme_xml($contents, $options);

Zeile 516Zeile 516

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

Zeile 541Zeile 541

if(is_array($value))
{


if(is_array($value))
{

				$value = serialize($value);

				$value = my_serialize($value);

			}

$value = str_replace(']]>', ']]]]><![CDATA[>', $value);

			}

$value = str_replace(']]>', ']]]]><![CDATA[>', $value);

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

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

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

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

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

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

Zeile 734Zeile 734

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

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

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

			



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

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

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

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

			$sid = $properties['sid'];

			$sid = $properties['templateset'];

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

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

Zeile 823Zeile 823
			log_admin_action($tid, $theme['tid']);

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

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

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

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

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


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

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

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

Zeile 871Zeile 871
	$form_container = new FormContainer($lang->duplicate_theme);
$form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->input['duplicate_templates'], 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");

	$form_container = new FormContainer($lang->duplicate_theme);
$form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->input['duplicate_templates'], 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");


$form_container->end();

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



$form_container->end();

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


	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();

Zeile 923Zeile 923
	$page->output_header("{$lang->themes} - {$lang->create_new_theme}");

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

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

$page->output_nav_tabs($sub_tabs, 'create_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=add", "post");

	}

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

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

	$form->output_submit_wrapper($buttons);

$form->end();

Zeile 947Zeile 947
}

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

}

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

{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
$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");
}

// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=style-themes");
}

$plugins->run_hooks("admin_style_themes_delete");

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

{
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
$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");
}

// User clicked no
if($mybb->input['no'])
{
admin_redirect("index.php?module=style-themes");
}

$plugins->run_hooks("admin_style_themes_delete");

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

		$inherited_theme_cache = array();

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

		$inherited_theme_cache = array();

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

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

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

 

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

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


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


Zeile 1045Zeile 1048

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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





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

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

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

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

			'templateset' => (int)$mybb->input['templateset'],

			'templateset' => $mybb->get_input('templateset', MyBB::INPUT_INT),

			'editortheme' => $mybb->input['editortheme'],
'imgdir' => $mybb->input['imgdir'],
'logo' => $mybb->input['logo'],

			'editortheme' => $mybb->input['editortheme'],
'imgdir' => $mybb->input['imgdir'],
'logo' => $mybb->input['logo'],

			'tablespace' => (int)$mybb->input['tablespace'],
'borderwidth' => (int)$mybb->input['borderwidth'],

			'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT),
'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),

			'color' => $mybb->input['color']
);


			'color' => $mybb->input['color']
);


Zeile 1092Zeile 1095
		}

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

		}

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

		if($theme_properties['disporder'])

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

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

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

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

		}

$allowedgroups = array();

		}

$allowedgroups = array();

Zeile 1118Zeile 1125

$update_array = array(
'name' => $db->escape_string($mybb->input['name']),


$update_array = array(
'name' => $db->escape_string($mybb->input['name']),

			'pid' => $mybb->get_input('pid', 1),

			'pid' => $mybb->get_input('pid', MyBB::INPUT_INT),

			'allowedgroups' => $allowedgroups,

			'allowedgroups' => $allowedgroups,

			'properties' => $db->escape_string(serialize($properties))

			'properties' => $db->escape_string(my_serialize($properties))

		);

// perform validation

		);

// perform validation

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

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

 
			update_theme_stylesheet_list($theme['tid']);


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


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

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

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

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

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

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

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


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


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

Zeile 1235Zeile 1243
	{
$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(!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'];

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

		}

		}

	}

// Save any stylesheet orders

	}

// Save any stylesheet orders

Zeile 1261Zeile 1269
			if(is_array($properties))
{
$order = (int)$mybb->input['disporder'][$properties['sid']];

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





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

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

		}


		}


		asort($orders, SORT_NUMERIC);

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

		asort($orders, SORT_NUMERIC);

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





		$update_array = array(

		$update_array = array(

			"properties" => $db->escape_string(serialize($properties))

			"properties" => $db->escape_string(my_serialize($properties))

		);

		);





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

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

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

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





		// normalize for consistency
update_theme_stylesheet_list($theme['tid'], false, true);

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

		// normalize for consistency
update_theme_stylesheet_list($theme['tid'], false, true);

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

	}

	}


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



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


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

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

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

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

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

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

			}


			}


			if(basename($filename) != $style_name)
{
continue;
}

$ordered_stylesheets[$filename] = $style;

			if(basename($filename) != $style_name)
{
continue;
}

$ordered_stylesheets[$filename] = $style;

		}

		}

	}

foreach($ordered_stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)

	}

foreach($ordered_stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)

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

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

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

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

Zeile 1368Zeile 1376
		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 1376Zeile 1384
			foreach($style['inherited'] as $tid)
{
if($inherited_themes[$tid])

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

				{

				{

					$inherited_ary[$tid] = $inherited_themes[$tid];
}
}

					$inherited_ary[$tid] = $inherited_themes[$tid];
}
}

Zeile 1392Zeile 1400
			foreach($inherited_ary as $tid => $file)
{
if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)

			foreach($inherited_ary as $tid => $file)
{
if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)

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

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


$inherited .= $sep.$file;
$sep = $lang->comma;


$inherited .= $sep.$file;
$sep = $lang->comma;

Zeile 1504Zeile 1512
		}

$table->construct_cell("<strong><a href=\"index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}");

		}

$table->construct_cell("<strong><a href=\"index.php?module=style-themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}");

		$table->construct_cell($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;')), array("class" => "align_center"));

		$table->construct_cell($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;', 'min' => 0)), array("class" => "align_center"));

		$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
}

		$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
}

Zeile 1521Zeile 1529
	if($errors)
{
$page->output_inline_error($errors);

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

	}


	}


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

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

Zeile 1566Zeile 1574

$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->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')), 'tablespace');
$form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth')), 'borderwidth');

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


Zeile 1576Zeile 1584
	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);
$colors = array_merge($colors, $properties['colors']);

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

	else
{
$colors = array('none' => $lang->colors_please_select);
$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 1603Zeile 1611

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


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

	$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();

	$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();

}

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

}

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

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

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

		}


		}


		// Get 30 chars only because we don't want more than that
$mybb->input['name'] = my_substr($mybb->input['name'], 0, 30);
if(get_extension($mybb->input['name']) != "css")

		// Get 30 chars only because we don't want more than that
$mybb->input['name'] = my_substr($mybb->input['name'], 0, 30);
if(get_extension($mybb->input['name']) != "css")

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

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

				}

				}

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

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

			}

			}


// Update Stylesheet
$update_array = array(


// Update Stylesheet
$update_array = array(

Zeile 1727Zeile 1735
				$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($stylesheet['name'] != $mybb->input['name'])

			// If the name changed, re-cache our stylesheet
$theme_c = $update_d = false;
if($stylesheet['name'] != $mybb->input['name'])

Zeile 1736Zeile 1744
				// Update the theme stylesheet list if the name is changed
$theme_c = $theme;
$update_d = true;

				// Update the theme stylesheet list if the name is changed
$theme_c = $theme;
$update_d = true;





				$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

				$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
{
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1);
}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");

 

$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 the CSS file list for this theme

Zeile 1986Zeile 1997
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

Zeile 2025Zeile 2036
		}

// Insert the modified CSS

		}

// Insert the modified CSS

		$new_stylesheet = $stylesheet['stylesheet'];

		$new_stylesheet = $stylesheet['stylesheet'];


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


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

Zeile 2231Zeile 2242

$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


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

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

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

$(document).ready(function() {
//<![CDATA[

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

$(document).ready(function() {
//<![CDATA[

	new ThemeSelector("./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'].'");

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

	lang.saving = "'.$lang->saving.'";
});
//]]>

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

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

Zeile 2331Zeile 2342
	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">

<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>

<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>

Zeile 2391Zeile 2402
	$table = new Table;
$table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30')));
$table->construct_row();

	$table = new Table;
$table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30')));
$table->construct_row();

	$table->output("{$lang->full_stylesheet_for} ".htmlspecialchars_uni($stylesheet['name']));

	$table->output($lang->full_stylesheet_for.' '.htmlspecialchars_uni($stylesheet['name']), 1, 'tfixed');


$buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save'));
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));


$buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save'));
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));

Zeile 2402Zeile 2413

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


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

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {

				lineNumbers: true,

				lineNumbers: true,

				tabMode: \"indent\",
theme: \"mybb\",
lineWrapping: true
});</script>";




				lineWrapping: true,
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/css",
theme: "mybb"
});</script>';

	}

$page->output_footer();

	}

$page->output_footer();

Zeile 2417Zeile 2431
if($mybb->input['action'] == "delete_stylesheet")
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

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

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

 

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


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


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

Zeile 2476Zeile 2493
if($mybb->input['action'] == "add_stylesheet")
{
// Fetch the theme we want to edit this stylesheet in

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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

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

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

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

Zeile 2570Zeile 2587
			// Add Stylesheet
$insert_array = array(
'name' => $db->escape_string($mybb->input['name']),

			// Add Stylesheet
$insert_array = array(
'name' => $db->escape_string($mybb->input['name']),

				'tid' => $mybb->get_input('tid', 1),

				'tid' => $mybb->get_input('tid', MyBB::INPUT_INT),

				'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)),
'stylesheet' => $db->escape_string($stylesheet),
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),

				'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)),
'stylesheet' => $db->escape_string($stylesheet),
'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),

Zeile 2601Zeile 2618
	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">

<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>

<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.js"></script>
<script src="./jscripts/codemirror/mode/css/css.js"></script>

Zeile 2824Zeile 2841

echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";



echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";


	$form_container = new FormContainer("{$lang->add_stylesheet_to} ".htmlspecialchars_uni($theme['name']));

	$form_container = new FormContainer($lang->add_stylesheet_to.' '.htmlspecialchars_uni($theme['name']), 'tfixed');

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

Zeile 2858Zeile 2875

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


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

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {

				lineNumbers: true,

				lineNumbers: true,

				tabMode: \"indent\",
theme: \"mybb\",
lineWrapping: true
});</script>";




				lineWrapping: true,
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/css",
theme: "mybb"
});</script>';

	}


	}


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

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

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

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

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


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


	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?

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

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

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

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

	$db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', 1)."'");

	$db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");


$plugins->run_hooks("admin_style_themes_set_default_commit");



$plugins->run_hooks("admin_style_themes_set_default_commit");


Zeile 2919Zeile 2939

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


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

	$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");

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

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

// Does the theme not exist?

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

// Does the theme not exist?