Vergleich admin/modules/style/themes.php - 1.4.1 - 1.4.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 18Zeile 18
require_once MYBB_ADMIN_DIR."inc/functions_themes.php";

$page->extra_header .= "

require_once MYBB_ADMIN_DIR."inc/functions_themes.php";

$page->extra_header .= "

<script language=\"Javascript\" type=\"text/javascript\">

<script type=\"text/javascript\">

//<![CDATA[
var save_changes_lang_string = '{$lang->save_changes_js}';
var delete_lang_string = '{$lang->delete}';

//<![CDATA[
var save_changes_lang_string = '{$lang->save_changes_js}';
var delete_lang_string = '{$lang->delete}';

Zeile 143Zeile 143
							break;
case 3: // UPLOAD_ERR_PARTIAL
$errors[] = $lang->error_uploadfailed_php3;

							break;
case 3: // UPLOAD_ERR_PARTIAL
$errors[] = $lang->error_uploadfailed_php3;

							break;
case 4: // UPLOAD_ERR_NO_FILE
$errors[] = $lang->error_uploadfailed_php4;

 
							break;
case 6: // UPLOAD_ERR_NO_TMP_DIR
$errors[] = $lang->error_uploadfailed_php6;

							break;
case 6: // UPLOAD_ERR_NO_TMP_DIR
$errors[] = $lang->error_uploadfailed_php6;

Zeile 160Zeile 157
				}

if(!$errors)

				}

if(!$errors)

				{

				{

					// Was the temporary file found?
if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					// Was the temporary file found?
if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
{
$errors[] = $lang->error_uploadfailed_lost;

					}

					}

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

					// Get the contents
$contents = @file_get_contents($_FILES['local_file']['tmp_name']);
// Delete the temporary file if possible

Zeile 175Zeile 172
					{
$errors[] = $lang->error_uploadfailed_nocontents;
}

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

				}

				}

			}
else if(!empty($mybb->input['url']))
{

			}
else if(!empty($mybb->input['url']))
{

Zeile 185Zeile 182
				{
$errors[] = $lang->error_local_file;
}

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

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

			}

if(!$errors)

			}

if(!$errors)

Zeile 340Zeile 342
		$properties = unserialize($theme['properties']);

$xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";

		$properties = unserialize($theme['properties']);

$xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\r\n";

		$xml .= "<theme name=\"".$theme['name']."\" version=\"".$mybb->version_code."\">\r\n";

		$xml .= "<theme name=\"".htmlspecialchars_uni($theme['name'])."\" version=\"".$mybb->version_code."\">\r\n";

		$xml .= "\t<properties>\r\n";
foreach($properties as $property => $value)
{

		$xml .= "\t<properties>\r\n";
foreach($properties as $property => $value)
{

Zeile 468Zeile 470
		$theme['name'] = rawurlencode($theme['name']);
header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
header("Content-type: application/octet-stream");

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

		header("Content-Length: ".my_strlen($xml));

		header("Content-Length: ".strlen($xml));

		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

Zeile 671Zeile 673
}

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

}

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

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

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

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

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

	}

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

	}

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

Zeile 692Zeile 694
			'tablespace' => intval($mybb->input['tablespace']),
'borderwidth' => intval($mybb->input['borderwidth'])
);

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

		

		

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

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

		}

		}

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

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

Zeile 713Zeile 715
			}
}
if(is_array($allowedgroups))

			}
}
if(is_array($allowedgroups))

		{

		{

			$allowedgroups = implode(",", $allowedgroups);
}


			$allowedgroups = implode(",", $allowedgroups);
}


Zeile 779Zeile 781
		if($file == 'inherited')
{
continue;

		if($file == 'inherited')
{
continue;

		}

		}

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

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

		{

		{

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

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

Zeile 795Zeile 797
					}
}
}

					}
}
}

		}
}


		}
}


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

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

Zeile 809Zeile 811
		while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

		while($inherited_theme = $db->fetch_array($query))
{
$inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];

		}
}

$theme_stylesheets = array();

		}
}

$theme_stylesheets = array();

	
if(count($inherited_load) > 0)
{

	
if(count($inherited_load) > 0)
{

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

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

				{

				{

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

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

Zeile 943Zeile 945
		else
{
$attached_to = "<small>{$lang->attached_to_all_pages}</small>";

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

		}

$popup = new PopupMenu("style_{$style['sid']}", $lang->options);

		}

$popup = new PopupMenu("style_{$style['sid']}", $lang->options);

		
$popup->add_item($lang->edit_style, "index.php?module=style/themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");
$popup->add_item($lang->properties, "index.php?module=style/themes&amp;action=stylesheet_properties&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");

		
$popup->add_item($lang->edit_style, "index.php?module=style/themes&amp;action=edit_stylesheet&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");
$popup->add_item($lang->properties, "index.php?module=style/themes&amp;action=stylesheet_properties&amp;file=".htmlspecialchars_uni($filename)."&amp;tid={$theme['tid']}");

Zeile 1009Zeile 1011
				continue;
}
$options[$dir] = ucfirst(str_replace('_', ' ', $dir));

				continue;
}
$options[$dir] = ucfirst(str_replace('_', ' ', $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->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->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');

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

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

	

	

	if(!$theme['tid'])
{
flash_message($lang->error_invalid_theme, 'error');

	if(!$theme['tid'])
{
flash_message($lang->error_invalid_theme, 'error');

Zeile 1045Zeile 1047
	if(!$parent_list)
{
$parent_list = 1;

	if(!$parent_list)
{
$parent_list = 1;

	}

	}

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

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

Zeile 1103Zeile 1105
		$stylesheets[basename($file)] = $stylesheet2;
}


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


	$this_stylesheet = $stylesheets[$stylesheet['cachefile']];	






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

$this_stylesheet = $stylesheets[$stylesheet['cachefile']];

	unset($stylesheets);

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

	unset($stylesheets);

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

Zeile 1111Zeile 1118
		if(!$mybb->input['name'])
{
$errors[] = $lang->error_missing_stylesheet_name;

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

		}


		}


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

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

Zeile 1155Zeile 1162
			// Update Stylesheet			
$update_array = array(
'name' => $db->escape_string($mybb->input['name']),

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

				'attachedto' => $db->escape_string(implode('|', $attached)),
'lastmodified' => TIME_NOW

				'attachedto' => $db->escape_string(implode('|', $attached))


			);

if($stylesheet['name'] != $mybb->input['name'])

			);

if($stylesheet['name'] != $mybb->input['name'])

Zeile 1169Zeile 1175
			// If the name changed, re-cache our stylesheet
if($stylesheet['name'] != $mybb->input['name'])
{

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

 
				$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);

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

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

Zeile 1211Zeile 1218
	}

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

Zeile 1402Zeile 1409
		if($theme['tid'] != $stylesheet['tid'])
{
$sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);

		if($theme['tid'] != $stylesheet['tid'])
{
$sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);

		}


		}


		// Insert the modified CSS
$new_stylesheet = $stylesheet['stylesheet'];


		// Insert the modified CSS
$new_stylesheet = $stylesheet['stylesheet'];


Zeile 1435Zeile 1442

// Now we have the new stylesheet, save it
$updated_stylesheet = array(


// 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)),
"lastmodified" => TIME_NOW
);

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

Zeile 1468Zeile 1476
		else
{
echo "1";

		else
{
echo "1";

			exit;
}
}

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

			exit;
}
}

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

	
$css_array = css_to_array($stylesheet['stylesheet']);
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);

	
$css_array = css_to_array($stylesheet['stylesheet']);
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);

	

	

	// 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
$file_stylesheets = unserialize($theme['stylesheets']);

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

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

	}

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

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

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

		{
continue;
}

		{
continue;
}

Zeile 1508Zeile 1516
		foreach($action_stylesheet as $action => $style)
{
foreach($style as $stylesheet2)

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

			{

			{

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

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

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

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

		}


		}


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

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

	

	

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


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


Zeile 1544Zeile 1552
	<script type=\"text/javascript\">
var my_post_key = '".$mybb->post_code."';
</script>";

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

	

	

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


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


Zeile 1564Zeile 1572
		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");

		}

		}

	}

$sub_tabs['edit_stylesheet'] = array(

	}

$sub_tabs['edit_stylesheet'] = array(

Zeile 1699Zeile 1707

// Now we have the new stylesheet, save it
$updated_stylesheet = array(


// 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'])),
"lastmodified" => TIME_NOW
);

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

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

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

		}
}

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

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

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

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

		}
}

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

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

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

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

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

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

Zeile 1755Zeile 1764
						$inherited_load[] = $value;
}
}

						$inherited_load[] = $value;
}
}

			}
}

			}
}

	}

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

	}

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

	{

	{

		if(is_array($stylesheet2['inherited']))
{
foreach($stylesheet2['inherited'] as $inherited_file => $tid)

		if(is_array($stylesheet2['inherited']))
{
foreach($stylesheet2['inherited'] as $inherited_file => $tid)

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


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


	$page->extra_header .= '



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

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

 
	}

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

	
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style/themes&amp;action=edit&amp;tid={$mybb->input['tid']}");
$page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "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 1844Zeile 1856

$form->end();



$form->end();


	echo "<script language=\"Javascript\" type=\"text/javascript\">
Event.observe('edit_stylesheet', 'submit', function()



	if($admin_options['codepress'] != 0)
{
echo "<script type=\"text/javascript\">
Event.observe('edit_stylesheet', 'submit', function()

	{
if($('stylesheet_cp')) {
var area = $('stylesheet_cp');

	{
if($('stylesheet_cp')) {
var area = $('stylesheet_cp');

Zeile 1855Zeile 1869
		}
});
</script>";

		}
});
</script>";

 
	}

	
$page->output_footer();
}

	
$page->output_footer();
}

Zeile 1946Zeile 1961
			{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))

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

				{

				{

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

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

Zeile 2012Zeile 2027
						$attached_id = intval(str_replace('attached_', '', $id));

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

						$attached_id = intval(str_replace('attached_', '', $id));

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

						{

						{

							// We have custom actions for attached files							
$actions_list = $mybb->input['action_list_'.$attached_id];
}

							// We have custom actions for attached files							
$actions_list = $mybb->input['action_list_'.$attached_id];
}

Zeile 2025Zeile 2040
						$attached[] = $attached_to;
}
}

						$attached[] = $attached_to;
}
}

			}

			}

			
// Add Stylesheet
$insert_array = array(

			
// Add Stylesheet
$insert_array = array(

Zeile 2038Zeile 2053
			);			

$sid = $db->insert_query("themestylesheets", $insert_array);

			);			

$sid = $db->insert_query("themestylesheets", $insert_array);

			

			

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

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

Zeile 2046Zeile 2061
			
// Update the CSS file list for this theme
update_theme_stylesheet_list($theme['tid']);

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

			

			

			// Log admin action
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']));
}

			// Log admin action
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']));
}

	}

	}

	

	

	$page->extra_header .= '



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

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

	<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script>
<script type="text/javascript">
CodePress.language = \'css\';
</script>';

 
	}

	
$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->add_breadcrumb_item("Add Stylesheet");

	$page->add_breadcrumb_item($lang->add_stylesheet);

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


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


Zeile 2114Zeile 2132
		{
$add_checked[2] = "checked=\"checked\"";
$add_checked[1] = "";

		{
$add_checked[2] = "checked=\"checked\"";
$add_checked[1] = "";

		}

		}

	}
else
{

	}
else
{

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

++$count;

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

++$count;

		}
}

		}
}

	else
{
$global_checked[1] = "checked=\"checked\"";

	else
{
$global_checked[1] = "checked=\"checked\"";

Zeile 2252Zeile 2270

$form->output_submit_wrapper($buttons);



$form->output_submit_wrapper($buttons);


	echo "<script language=\"Javascript\" type=\"text/javascript\">



	if($admin_options['codepress'] != 0)
{
echo "<script type=\"text/javascript\">

	Event.observe('add_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

	Event.observe('add_stylesheet', 'submit', function()
{
if($('stylesheet_cp')) {

Zeile 2263Zeile 2283
		}
});
</script>\n";

		}
});
</script>\n";




	}


	echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
echo '<script type="text/javascript">
Event.observe(window, "load", function() {

	echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
echo '<script type="text/javascript">
Event.observe(window, "load", function() {

Zeile 2273Zeile 2294
});
//]]>
</script>';

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

	

	

	$form->end();

$page->output_footer();

	$form->end();

$page->output_footer();

Zeile 2281Zeile 2302

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


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

 
	if(!verify_post_check($mybb->input['my_post_key']))
{
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=style/themes");
}


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


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