Vergleich admin/modules/style/themes.php - 1.8.0 - 1.8.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 72Zeile 72
	echo $form->generate_hidden_field("selector", htmlspecialchars_uni($mybb->input['selector']), array('id' => 'hidden_selector'))."\n";

$table = new Table;

	echo $form->generate_hidden_field("selector", htmlspecialchars_uni($mybb->input['selector']), array('id' => 'hidden_selector'))."\n";

$table = new Table;

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










	if($lang->settings['rtl'] === true)
{
$div_align = "left";
}
else
{
$div_align = "right";
}

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

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

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

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

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



	$table->construct_row();

	$table->construct_row();

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



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

	$table->construct_row();

$table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>");

	$table->construct_row();

$table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>");

Zeile 265Zeile 274
	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{

	// Recommended themes = Default; Otherwise search results & pagination
if($mybb->request_method == "post")
{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version));

		$table->output("<span style=\"float: right;\"><small><a href=\"http://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));

	}
else
{

	}
else
{

		$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/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=\"http://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));

	}

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

Zeile 1134Zeile 1143
			if(!$ts_check)
{
unset($properties['templateset']);

			if(!$ts_check)
{
unset($properties['templateset']);

			}

			}

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

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

Zeile 1146Zeile 1155
		}

if(empty($errors))

		}

if(empty($errors))

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


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

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


$plugins->run_hooks("admin_style_themes_edit_commit");






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


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


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

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

		}


		}


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

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

Zeile 1191Zeile 1200
						$inherited_load[] = $value;
}
}

						$inherited_load[] = $value;
}
}

			}
}
}


			}
}
}


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

$inherited_themes = array();

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

$inherited_themes = array();

	if(count($inherited_load) > 0)

	if(count($inherited_load) > 0)

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

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

Zeile 1221Zeile 1230
			}

$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 1232Zeile 1241
			// 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 1243Zeile 1252

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


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

		}

		}


asort($orders, SORT_NUMERIC);



asort($orders, SORT_NUMERIC);


Zeile 1254Zeile 1263
		$update_array = array(
"properties" => $db->escape_string(serialize($properties))
);

		$update_array = array(
"properties" => $db->escape_string(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']}");

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


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



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


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

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

				}

				}

			}
}


			}
}


Zeile 1369Zeile 1382
				if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
{
$sep = " {$lang->and} ";

				if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
{
$sep = " {$lang->and} ";

				}


				}


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

++$count;

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

++$count;

			}

			}

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

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))
{
$attached_to = '';

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

if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))
{
$attached_to = '';

			$got_color = false;

 

$applied_to_count = count($style['applied_to']);
$count = 0;
$sep = " ";
$name = "";


$applied_to_count = count($style['applied_to']);
$count = 0;
$sep = " ";
$name = "";

 

$colors = array();

if(!is_array($properties['colors']))
{
$properties['colors'] = array();
}


foreach($style['applied_to'] as $name => $actions)
{


foreach($style['applied_to'] as $name => $actions)
{

				if(strpos($name, ".php") === false)
{
$got_color = true; // Maybe...

				if(!$name)
{


					continue;
}


					continue;
}


				if(!$name)






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

if(count($colors))

				{

				{

 
					// Colors override files and are handled below.

					continue;

					continue;

				}



				}

// It's a file:

				++$count;

				++$count;





				if($actions[0] != "global")
{
$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";

				if($actions[0] != "global")
{
$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";

Zeile 1412Zeile 1437
				if($count == $applied_to_count && $count > 1)
{
$sep = " {$lang->and} ";

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

				}

				}

				$attached_to .= $sep.$name;

$sep = $lang->comma;

				$attached_to .= $sep.$name;

$sep = $lang->comma;

			}

			}


if($attached_to)


if($attached_to)

			{

			{

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

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


$colors = array();
if($got_color == true && is_array($properties['colors']))


if(count($colors))


			{

			{

				// We might have colors here...
foreach($style['applied_to'] as $name => $actions)
{
if(strpos($name, ".php") !== false)
{
continue;
}

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


				// Attached to color instead of files.















				$count = 1;

				$count = 1;

				$plural = 's';

 
				$color_list = $sep = '';

				$color_list = $sep = '';

				if(count($colors == 1))
{
$plural = '';
}

 

foreach($colors as $color)
{


foreach($colors as $color)
{

Zeile 1462Zeile 1467
					$sep = ', ';
}


					$sep = ', ';
}


				$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to, $plural)." {$color_list}</small>";

				$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";

			}

if($attached_to == '')

			}

if($attached_to == '')

Zeile 1487Zeile 1492
		}

$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_text_box("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;')), 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 1501Zeile 1506
	echo '<br />';

// Theme Properties table

	echo '<br />';

// Theme Properties table

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

	}

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

Zeile 1513Zeile 1518

$options = build_theme_array($theme['tid']);
$form_container->output_row($lang->parent_theme." <em>*</em>", $lang->parent_theme_desc, $form->generate_select_box('pid', $options, $theme['pid'], array('id' => 'pid')), 'pid');


$options = build_theme_array($theme['tid']);
$form_container->output_row($lang->parent_theme." <em>*</em>", $lang->parent_theme_desc, $form->generate_select_box('pid', $options, $theme['pid'], array('id' => 'pid')), 'pid');





	$options = array();
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
$options['all'] = $lang->all_user_groups;
while($usergroup = $db->fetch_array($query))

	$options = array();
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
$options['all'] = $lang->all_user_groups;
while($usergroup = $db->fetch_array($query))

	{

	{

		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');

		$options[(int)$usergroup['gid']] = $usergroup['title'];
}
$form_container->output_row($lang->allowed_user_groups, $lang->allowed_user_groups_desc, $form->generate_select_box('allowedgroups[]', $options, explode(",", $theme['allowedgroups']), array('id' => 'allowedgroups', 'multiple' => true, 'size' => 5)), 'allowedgroups');





	$options = array();
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))

	$options = array();
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title'));
while($templateset = $db->fetch_array($query))

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

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

		}

		}

	}

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

$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');
$form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');

	}

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

$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir');
$form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');

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



$form_container->end();


Zeile 1627Zeile 1632
	$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 1708Zeile 1713
			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);


			// 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 1727Zeile 1732
				}
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
}

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





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

$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");

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

$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");





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


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


Zeile 1752Zeile 1757
	{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");
$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));

	{
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'");
$stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));





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

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

Zeile 1802Zeile 1807
	$count = 0;
if(is_array($applied_to) && $applied_to['global'][0] != "global")
{

	$count = 0;
if(is_array($applied_to) && $applied_to['global'][0] != "global")
{

		$got_color = false;

 
		$check_actions = "";

		$check_actions = "";









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

if(!is_array($properties['colors']))
{
$properties['colors'] = array();
}


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

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

			if(strpos($name, ".php") === false)







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

if(count($stylesheet['colors']))

			{

			{

				$got_color = true; // Maybe...

				// Colors override files and are handled below.

				continue;
}


				continue;
}


			$short_name = substr($name, 0, -4);


			// It's a file:


			$action_list = "";
if($actions[0] != "global")
{
$action_list = implode(',', $actions);

			$action_list = "";
if($actions[0] != "global")
{
$action_list = implode(',', $actions);

			}

			}


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


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

Zeile 1831Zeile 1846
				$global_action_checked[2] = "checked=\"checked\"";
$global_action_checked[1] = "";
}

				$global_action_checked[2] = "checked=\"checked\"";
$global_action_checked[1] = "";
}





			$specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>

			$specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>

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

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

				</tr>
</table>
</dd>
</dl>";

$form_container = new FormContainer();
$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}');";

++$count;
}


				</tr>
</table>
</dd>
</dl>";

$form_container = new FormContainer();
$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}');";

++$count;
}


		if($check_actions)
{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";
$global_checked[1] = "";
}

		if($check_actions)
{
$global_checked[3] = "";
$global_checked[2] = "checked=\"checked\"";
$global_checked[1] = "";
}


$stylesheet['colors'] = array();
if($got_color == true && is_array($properties['colors']))
{
// We might have colors here...
foreach($applied_to as $name => $actions)
{
if(strpos($name, ".php") !== false)
{
continue;
}

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

if(!empty($stylesheet['colors']))
{
$global_checked[3] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[1] = "";
}
}
}



if(!empty($stylesheet['colors']))
{
$global_checked[3] = "checked=\"checked\"";
$global_checked[2] = "";
$global_checked[1] = "";
}
}





















	$specific_files .= "</div>";

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

	$specific_files .= "</div>";

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





	if(is_array($properties['colors']))
{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

	if(is_array($properties['colors']))
{
$specific_colors = "<div id=\"attach_2\" class=\"attachs\">";

Zeile 1922Zeile 1918
			if($(this).prop(\'checked\') == true)
{
checked = $(this).val();

			if($(this).prop(\'checked\') == true)
{
checked = $(this).val();

			}
});

			}
});

		$(\'.\'+id+\'s\').each(function(e)
{
$(this).hide();

		$(\'.\'+id+\'s\').each(function(e)
{
$(this).hide();

Zeile 2055Zeile 2051

// Cache the stylesheet to the file
if(!cache_stylesheet($theme['tid'], $stylesheet['name'], $new_stylesheet))


// Cache the stylesheet to the file
if(!cache_stylesheet($theme['tid'], $stylesheet['name'], $new_stylesheet))

		{

		{

			$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);
}


			$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);
}


Zeile 2142Zeile 2138
		'title' => $lang->edit_stylesheet_simple_mode,
'link' => "index.php?module=style-themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=simple",
'description' => $lang->edit_stylesheet_simple_mode_desc

		'title' => $lang->edit_stylesheet_simple_mode,
'link' => "index.php?module=style-themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=simple",
'description' => $lang->edit_stylesheet_simple_mode_desc

	);


	);


	$sub_tabs['edit_stylesheet_advanced'] = array(
'title' => $lang->edit_stylesheet_advanced_mode,
'link' => "index.php?module=style-themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=advanced",

	$sub_tabs['edit_stylesheet_advanced'] = array(
'title' => $lang->edit_stylesheet_advanced_mode,
'link' => "index.php?module=style-themes&amp;action=edit_stylesheet&amp;tid={$mybb->input['tid']}&amp;file=".htmlspecialchars_uni($mybb->input['file'])."&amp;mode=advanced",

Zeile 2175Zeile 2171
	{
$editable_selector = $css_array[$mybb->input['selector']];
$selector = $mybb->input['selector'];

	{
$editable_selector = $css_array[$mybb->input['selector']];
$selector = $mybb->input['selector'];

	}


	}


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


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


Zeile 2187Zeile 2183
			$properties[$_p] = '';
}
}

			$properties[$_p] = '';
}
}





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

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





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

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

	$table->construct_row();

	$table->construct_row();

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

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

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

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

	$table->construct_row();

	$table->construct_row();

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

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

Zeile 2229Zeile 2225
$(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'].'");

$(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'].'");

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

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

</script>';

$form->end();

</script>';

$form->end();

Zeile 2686Zeile 2682

foreach($mybb->input['applied_to'] as $name => $actions)
{


foreach($mybb->input['applied_to'] as $name => $actions)
{

			$short_name = substr($name, 0, -4);


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

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

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

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

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

Zeile 2845Zeile 2839
	$form_container->output_row("", "", $actions);

$form_container->end();

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

$form_container->end();





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

$form->output_submit_wrapper($buttons);

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

$form->output_submit_wrapper($buttons);

Zeile 2871Zeile 2865
});
//]]>
</script>';

});
//]]>
</script>';





	$form->end();

	$form->end();





	$page->output_footer();

	$page->output_footer();

}


}


if($mybb->input['action'] == "set_default")
{
if(!verify_post_check($mybb->input['my_post_key']))

if($mybb->input['action'] == "set_default")
{
if(!verify_post_check($mybb->input['my_post_key']))

Zeile 2936Zeile 2930
		$updated_users = array(
"style" => $theme['tid']
);

		$updated_users = array(
"style" => $theme['tid']
);


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

 

$plugins->run_hooks("admin_style_themes_force_commit");


$plugins->run_hooks("admin_style_themes_force_commit");

 

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


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


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