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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 168Zeile 168
	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	// Convert to mods site version codes
$search_version = ($major_version_code/100).'x';


	$contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);

	$contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?api=2&type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);


if(!$contents)
{


if(!$contents)
{

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

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

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

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



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

$table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

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

$table->construct_cell("<img src=\"https://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100));

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>");

			$table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} <a href=\"{$result['author']['url']['value']}\" target=\"_blank\" rel=\"noopener\">{$result['author']['name']['value']}</a></small></i>");

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

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

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

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

		form.submit(function()

		form.on('submit', function()

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

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

				search.focus();

				search.trigger('focus');

				return false;
}
});

var search = $('#search_keywords');

				return false;
}
});

var search = $('#search_keywords');

		search.focus(function()

		search.on('focus', function()

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

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

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

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

		});

search.blur(function()

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



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

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

Zeile 273Zeile 269
				search_blur.val('{$lang->search_for_themes}');
}
});

				search_blur.val('{$lang->search_for_themes}');
}
});





		// fix the styling used if we have a different default value
if(search.val() != '{$lang->search_for_themes}')
{

		// fix the styling used if we have a different default value
if(search.val() != '{$lang->search_for_themes}')
{

Zeile 282Zeile 278
		</script>\n";
echo "</div>\n";
echo $search->end();

		</script>\n";
echo "</div>\n";
echo $search->end();





	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{
$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{
$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

	}

	}

	else
{
$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

	else
{
$table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));

Zeile 301Zeile 297
if($mybb->input['action'] == "import")
{
$plugins->run_hooks("admin_style_themes_import");

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





	if($mybb->request_method == "post")
{
if(!$_FILES['local_file'] && !$mybb->input['url'])

	if($mybb->request_method == "post")
{
if(!$_FILES['local_file'] && !$mybb->input['url'])

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

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

		}

		}

	}
</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">

	}
</script>
<dl style="margin-top: 0; margin-bottom: 0; width: 35%;">

Zeile 560Zeile 556
		foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited' || !is_array($action_stylesheet))

		foreach($file_stylesheets as $file => $action_stylesheet)
{
if($file == 'inherited' || !is_array($action_stylesheet))

			{
continue;
}

			{
continue;
}


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


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

Zeile 582Zeile 578
		}

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

		}

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

		$inherited_load = array_unique($inherited_load);

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

		$inherited_load = array_unique($inherited_load);

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

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

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

		}

$theme_stylesheets = array();

 




		if(count($inherited_load) > 0)
{

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

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

Zeile 654Zeile 645
		if($mybb->input['include_templates'] != 0)
{
$xml .= "\t<templates>\r\n";

		if($mybb->input['include_templates'] != 0)
{
$xml .= "\t<templates>\r\n";

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

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

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

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

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

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

			$sid = $properties['templateset'];

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

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

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

Zeile 1175Zeile 1166
		}
if($properties['templateset'])
{

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

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

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

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

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

Zeile 1186Zeile 1177
		{
$errors[] = $lang->error_invalid_templateset;
}

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

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

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

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

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

Zeile 1245Zeile 1236
	$inherited_load[] = $mybb->input['tid'];
$inherited_load = array_unique($inherited_load);


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


	$inherited_themes = array();

	$inherited_themes = $theme_stylesheets = array();

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

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

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

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

	}

$theme_stylesheets = array();

 




	if(count($inherited_load) > 0)
{

 
		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))
{
$theme_stylesheets[$theme_stylesheet['name']] = $theme_stylesheet;

		$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc'));
while($theme_stylesheet = $db->fetch_array($query))
{
if(!isset($theme_stylesheets[$theme_stylesheet['name']]) && in_array($theme_stylesheet['tid'], $inherited_load))
{
$theme_stylesheets[$theme_stylesheet['name']] = $theme_stylesheet;

			}

			}


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


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

		}

		}

	}

// Save any stylesheet orders

	}

// Save any stylesheet orders

Zeile 1279Zeile 1265
			// Error out
flash_message($lang->error_no_display_order, 'error');
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");

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

		}


		}


		$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)
{

		$orders = array();
foreach($theme_stylesheets as $stylesheet => $properties)
{

Zeile 1289Zeile 1275
				$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);

// 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(
"properties" => $db->escape_string(my_serialize($properties))
);

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

		$update_array = array(
"properties" => $db->escape_string(my_serialize($properties))
);

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





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

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

Zeile 1314Zeile 1300

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


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

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

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





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

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

	);


	);


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

Zeile 1341Zeile 1327
		'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
);





	$properties = my_unserialize($theme['properties']);
$page->output_nav_tabs($sub_tabs, 'edit_stylesheets');


	$properties = my_unserialize($theme['properties']);
$page->output_nav_tabs($sub_tabs, 'edit_stylesheets');


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

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





	// Order the stylesheets
$ordered_stylesheets = array();


	// Order the stylesheets
$ordered_stylesheets = array();


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

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

			}

			}


if(basename($filename) != $style_name)
{


if(basename($filename) != $style_name)
{

Zeile 1376Zeile 1362
			$ordered_stylesheets[$filename] = $style;
}
}

			$ordered_stylesheets[$filename] = $style;
}
}





	foreach($ordered_stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{
$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
$filename = $theme_stylesheets[$style['sid']];

	foreach($ordered_stylesheets as $filename => $style)
{
if(strpos($filename, 'css.php?stylesheet=') !== false)
{
$style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
$filename = $theme_stylesheets[$style['sid']];

		}

		}

		else
{
$filename = basename($filename);

		else
{
$filename = basename($filename);

Zeile 1392Zeile 1378

// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);


// Has the file on the file system been modified?
resync_stylesheet($theme_stylesheets[$filename]);





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

$inherited = "";

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

$inherited = "";

Zeile 1466Zeile 1452

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


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

 

$name = htmlspecialchars_uni($name);


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


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

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


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


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


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

$options = array();

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

$options = array();

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

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

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

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

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

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

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




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

		}

if(!$errors)
{
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])

		}

if(!$errors)
{
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme
if($theme['tid'] != $stylesheet['tid'])

			{

			{

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

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





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

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

Zeile 1719Zeile 1712
						{
// 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];

						}


						}


						if($actions_list)
{
$attached_to .= "?".$actions_list;

						if($actions_list)
{
$attached_to .= "?".$actions_list;

Zeile 1728Zeile 1721

$attached[] = $attached_to;
}


$attached[] = $attached_to;
}

				}

				}

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

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

Zeile 1751Zeile 1744
			if($stylesheet['name'] != $mybb->input['name'])
{
$update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));

			if($stylesheet['name'] != $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);


Zeile 1811Zeile 1804
	}

$applied_to = $this_stylesheet['applied_to'];

	}

$applied_to = $this_stylesheet['applied_to'];

	unset($this_stylesheet);


	unset($this_stylesheet);


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

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





		foreach($mybb->input as $name => $value)
{
if(strpos($name, "attached") !== false)

		foreach($mybb->input as $name => $value)
{
if(strpos($name, "attached") !== false)

Zeile 1832Zeile 1825
				}
}
}

				}
}
}

	}

	}

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

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

Zeile 1843Zeile 1836
	$global_checked[3] = "";

$form = new Form("index.php?module=style-themes&amp;action=stylesheet_properties", "post");

	$global_checked[3] = "";

$form = new Form("index.php?module=style-themes&amp;action=stylesheet_properties", "post");





	$specific_files = "<div id=\"attach_1\" class=\"attachs\">";
$count = 0;
if(is_array($applied_to) && $applied_to['global'][0] != "global")

	$specific_files = "<div id=\"attach_1\" class=\"attachs\">";
$count = 0;
if(is_array($applied_to) && $applied_to['global'][0] != "global")

Zeile 1905Zeile 1898
			$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");

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

			$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} &nbsp;".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");

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





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

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

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

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





			++$count;
}


			++$count;
}


Zeile 1917Zeile 1910
		{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";

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

			$global_checked[1] = "";

			$global_checked[1] = "";

		}

if(!empty($stylesheet['colors']))

		}

if(!empty($stylesheet['colors']))

Zeile 1926Zeile 1919
			$global_checked[2] = "";
$global_checked[1] = "";
}

			$global_checked[2] = "";
$global_checked[1] = "";
}

	}

$specific_files .= "</div>";

	}

$specific_files .= "</div>";


// Colors
$specific_colors = $specific_colors_option = '';


// Colors
$specific_colors = $specific_colors_option = '';





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

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

	{

	{

		$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

		$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

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

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

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);
$specific_colors .= $form_container->end(true)."</div>";
}

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

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

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

$form_container = new FormContainer();
$form_container->output_row("", "", $specific_color);
$specific_colors .= $form_container->end(true)."</div>";
}

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


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


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

Zeile 1962Zeile 1955
			}
});
$(\'.\'+id+\'s\').each(function(e)

			}
});
$(\'.\'+id+\'s\').each(function(e)

		{

		{

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

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

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

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

	<script type="text/javascript">

	<script type="text/javascript">

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


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


Zeile 1998Zeile 1991

echo <<<EOF



echo <<<EOF


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

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

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

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

Zeile 2013Zeile 2006

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


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

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

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

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

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

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");

	}

$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");

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


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


$(document).ready(function() {

$(function() {

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

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

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


//]]>
</script>';


	$form->end();


	$form->end();


	$page->output_footer();
}

	$page->output_footer();
}





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

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

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

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

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


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


	$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 2366Zeile 2359
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

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

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

';
}


';
}


Zeile 2642Zeile 2635
<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

<script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script>

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

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

';
}


';
}


Zeile 2906Zeile 2899
	}

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

	}

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

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

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

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

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

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

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

		$plugins->run_hooks("admin_style_themes_force_commit");

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

 

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


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


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