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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 216Zeile 216

$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("<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><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));

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

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

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

		form.submit(function()

		form.on('submit', function()

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

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

				search.focus();

				search.trigger('focus');

				return false;
}
});

var search = $('#search_keywords');

				return false;
}
});

var search = $('#search_keywords');

		search.focus(function()

		search.on('focus', function()

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

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

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

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

		});

search.blur(function()

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



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

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

Zeile 284Zeile 282
	echo $search->end();

// Recommended themes = Default; Otherwise search results & pagination

	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\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));
}

	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
{

	else
{

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

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

	}

	}





	echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&amp;action=browse{$keywords}&amp;page={page}");

	echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&amp;action=browse{$keywords}&amp;page={page}");





	$page->output_footer();
}

	$page->output_footer();
}





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

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

Zeile 307Zeile 305
		if(!$_FILES['local_file'] && !$mybb->input['url'])
{
$errors[] = $lang->error_missing_url;

		if(!$_FILES['local_file'] && !$mybb->input['url'])
{
$errors[] = $lang->error_missing_url;

		}

		}


if(!$errors)
{


if(!$errors)
{

Zeile 388Zeile 386
				if($theme_id > -1)
{
$plugins->run_hooks("admin_style_themes_import_commit");

				if($theme_id > -1)
{
$plugins->run_hooks("admin_style_themes_import_commit");





					// Log admin action
log_admin_action($theme_id);


					// Log admin action
log_admin_action($theme_id);


Zeile 418Zeile 416

$query = $db->simple_select("themes", "tid, name");
while($theme = $db->fetch_array($query))


$query = $db->simple_select("themes", "tid, name");
while($theme = $db->fetch_array($query))

	{

	{

		$themes[$theme['tid']] = $theme['name'];
}

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

		$themes[$theme['tid']] = $theme['name'];
}

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





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

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





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

if($errors)

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

if($errors)

	{

	{

		$page->output_inline_error($errors);

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

		$page->output_inline_error($errors);

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

Zeile 510Zeile 508
	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 584Zeile 582
		$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 592Zeile 590
			{
$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", "*", "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 667Zeile 660
		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_export_commit");

// Log admin action

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

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


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


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

Zeile 911Zeile 904
			$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(htmlspecialchars_uni($mybb->input['name']), $tid);

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


flash_message($lang->success_theme_created, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);


flash_message($lang->success_theme_created, 'success');
admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);

Zeile 1046Zeile 1039
		$plugins->run_hooks("admin_style_themes_delete_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_delete_commit");

// Log admin action

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

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


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


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

Zeile 1094Zeile 1087

foreach($colors as $color)
{


foreach($colors as $color)
{

				$color = explode("=", $color);

$properties['colors'][$color[0]] = $color[1];








				$color = trim($color);
if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
{
$color = explode("=", $color);
$properties['colors'][$color[0]] = $color[1];
}
else
{
$errors[] = $lang->sprintf($lang->error_invalid_color, $color);
}

			}

			}

		}

		}


if($properties['templateset'] <= 0)
{
$errors[] = $lang->error_invalid_templateset;


if($properties['templateset'] <= 0)
{
$errors[] = $lang->error_invalid_templateset;

		}

		}


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


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

		{

		{

			$properties['disporder'] = $theme_properties['disporder'];
}
else
{
$errors[] = $lang->error_no_display_order;

			$properties['disporder'] = $theme_properties['disporder'];
}
else
{
$errors[] = $lang->error_no_display_order;

		}


		}


		$allowedgroups = array();
if(is_array($mybb->input['allowedgroups']))

		$allowedgroups = array();
if(is_array($mybb->input['allowedgroups']))

		{

		{

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

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

Zeile 1132Zeile 1132
		if(is_array($allowedgroups))
{
$allowedgroups = implode(",", $allowedgroups);

		if(is_array($allowedgroups))
{
$allowedgroups = implode(",", $allowedgroups);

		}


		}


		$update_array = array(
'name' => $db->escape_string($mybb->input['name']),
'pid' => $mybb->get_input('pid', MyBB::INPUT_INT),

		$update_array = array(
'name' => $db->escape_string($mybb->input['name']),
'pid' => $mybb->get_input('pid', MyBB::INPUT_INT),

Zeile 1143Zeile 1143

// perform validation
if(!$update_array['name'])


// perform validation
if(!$update_array['name'])

		{

		{

			$errors[] = $lang->error_missing_name;
}
else

			$errors[] = $lang->error_missing_name;
}
else

Zeile 1152Zeile 1152
			$numthemes = $db->fetch_field($query, 'numthemes');

if($numthemes)

			$numthemes = $db->fetch_field($query, 'numthemes');

if($numthemes)

			{

			{

				$errors[] = $lang->error_theme_already_exists;

				$errors[] = $lang->error_theme_already_exists;

			}
}

			}
}


if($update_array['pid'])
{


if($update_array['pid'])
{

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

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

			{

			{

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

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

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

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

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

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

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

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

Zeile 1197Zeile 1197
			}

// Log admin action

			}

// Log admin action

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

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


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


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

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


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


	$inherited_themes = array();

	$inherited_themes = $theme_stylesheets = array();

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

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

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

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

	}

$theme_stylesheets = array();

 




	if(count($inherited_load) > 0)
{

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

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

Zeile 1459Zeile 1454

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


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

 

$name = htmlspecialchars_uni($name);


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


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

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


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

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

				}


				}


				if($count == $applied_to_count && $count > 1)
{
$sep = " {$lang->and} ";
}
$attached_to .= $sep.$name;

				if($count == $applied_to_count && $count > 1)
{
$sep = " {$lang->and} ";
}
$attached_to .= $sep.$name;





				$sep = $lang->comma;

				$sep = $lang->comma;

			}

			}


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


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

			}

			}


if(count($colors))
{


if(count($colors))
{

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

$options = array();

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

$options = array();

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

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

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

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

Zeile 1612Zeile 1611
			}

$mybb->input['colors'] .= "{$key}={$color}";

			}

$mybb->input['colors'] .= "{$key}={$color}";

		}
}


		}
}


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

$form_container->end();

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

$form_container->end();





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

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

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

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

	}

$plugins->run_hooks("admin_style_themes_stylesheet_properties");


	}

$plugins->run_hooks("admin_style_themes_stylesheet_properties");


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

Zeile 1651Zeile 1650

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





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

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

Zeile 1663Zeile 1662
	$stylesheets = fetch_theme_stylesheets($theme);

if(!array_key_exists($stylesheet['cachefile'], $stylesheets) && array_key_exists("css.php?stylesheet=".$stylesheet['tid'], $stylesheets))

	$stylesheets = fetch_theme_stylesheets($theme);

if(!array_key_exists($stylesheet['cachefile'], $stylesheets) && array_key_exists("css.php?stylesheet=".$stylesheet['tid'], $stylesheets))

	{

	{

		$stylesheet['cachefile'] = "css.php?stylesheet=".$stylesheet['tid'];
}


		$stylesheet['cachefile'] = "css.php?stylesheet=".$stylesheet['tid'];
}


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

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

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




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

		}

if(!$errors)

		}

if(!$errors)

Zeile 1730Zeile 1732
					$errors[] = $lang->error_no_color_picked;
}
else

					$errors[] = $lang->error_no_color_picked;
}
else

				{

				{

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

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

Zeile 1773Zeile 1775
			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

// Log admin action

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

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


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


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

Zeile 1811Zeile 1813
		$page->output_inline_error($errors);

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

		$page->output_inline_error($errors);

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

		{

		{

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

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

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

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

		}
}

		}
}

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

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





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

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

Zeile 1845Zeile 1847
		$stylesheet['colors'] = array();

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

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

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

		{

		{

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

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

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

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

		{

		{

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

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

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

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


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

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

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

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


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

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

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

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

			{
checked = $(this).val();
}

			{
checked = $(this).val();
}

Zeile 1991Zeile 1993

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

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

	}

	}


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


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

Zeile 2078Zeile 2080
		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)),

			"stylesheet" => $db->escape_string($new_stylesheet),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

Zeile 2119Zeile 2121

// Has the file on the file system been modified?
if(resync_stylesheet($stylesheet))


// Has the file on the file system been modified?
if(resync_stylesheet($stylesheet))

	{

	{

		// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");
$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');

		// Need to refetch new stylesheet as it was modified
$query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'");
$stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');

Zeile 2130Zeile 2132

// Do we not have any selectors? Send em to the full edit page
if(!$selector_list)


// Do we not have any selectors? Send em to the full edit page
if(!$selector_list)

	{

	{

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

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





	// Fetch list of all of the stylesheets for this theme
$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);

	// Fetch list of all of the stylesheets for this theme
$stylesheets = fetch_theme_stylesheets($theme);
$this_stylesheet = $stylesheets[$stylesheet['name']];
unset($stylesheets);





	$page->extra_header .= "
<script type=\"text/javascript\">
var my_post_key = '".$mybb->post_code."';

	$page->extra_header .= "
<script type=\"text/javascript\">
var my_post_key = '".$mybb->post_code."';

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

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

		}

		}

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

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

Zeile 2256Zeile 2258
	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 2268Zeile 2270

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

	}

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

Zeile 2313Zeile 2315
		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

		// Now we have the new stylesheet, save it
$updated_stylesheet = array(
"cachefile" => $db->escape_string($stylesheet['name']),

			"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])),

			"stylesheet" => $db->escape_string($mybb->input['stylesheet']),

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

			"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");

Zeile 2352Zeile 2354
	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

<link href="./jscripts/codemirror/lib/codemirror.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>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>
<script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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=1821"></script>

';
}


';
}


Zeile 2490Zeile 2492
		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

		$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit");

// Log admin action

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

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


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


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

Zeile 2618Zeile 2620
			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

			$plugins->run_hooks("admin_style_themes_add_stylesheet_commit");

// Log admin action

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

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


flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));


flash_message($lang->success_stylesheet_added, 'success');
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));

Zeile 2628Zeile 2630
	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

	if($admin_options['codepress'] != 0)
{
$page->extra_header .= '

<link href="./jscripts/codemirror/lib/codemirror.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>
<script src="./jscripts/codemirror/addon/dialog/dialog.js"></script>
<script src="./jscripts/codemirror/addon/search/searchcursor.js"></script>
<script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>

<link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet">
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet">
<script src="./jscripts/codemirror/lib/codemirror.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=1821"></script>

';
}


';
}


Zeile 2899Zeile 2901
	}

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

	}

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

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

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

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

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

Zeile 2942Zeile 2944
	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

	$plugins->run_hooks("admin_style_themes_set_default_commit");

// Log admin action

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

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


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


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

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

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

		$plugins->run_hooks("admin_style_themes_force_commit");

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

 

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


// Log admin action


// Log admin action

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

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


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


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