Vergleich admin/inc/functions_themes.php - 1.8.17 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
{
global $mybb, $db;


{
global $mybb, $db;


	require_once MYBB_ROOT."inc/class_xml.php";

$parser = new XMLParser($xml);

	$parser = create_xml_parser($xml);



	$tree = $parser->get_tree();

if(!is_array($tree) || !is_array($tree['theme']))

	$tree = $parser->get_tree();

if(!is_array($tree) || !is_array($tree['theme']))

Zeile 30Zeile 28
	}

$theme = $tree['theme'];

	}

$theme = $tree['theme'];





	// Do we have MyBB 1.2 template's we're importing?
$css_120 = "";


	// Do we have MyBB 1.2 template's we're importing?
$css_120 = "";


Zeile 44Zeile 42
			foreach($values as $property => $value)
{
if(is_array($value))

			foreach($values as $property => $value)
{
if(is_array($value))

				{

				{

					$property = str_replace('_', ':', $property);

$css_120 .= "}\n{$name} {$property} {\n";

					$property = str_replace('_', ':', $property);

$css_120 .= "}\n{$name} {$property} {\n";

Zeile 90Zeile 88

unset($theme['cssbits']);
unset($theme['themebits']);


unset($theme['cssbits']);
unset($theme['themebits']);

	}


	}


	if(is_array($theme['properties']))
{
foreach($theme['properties'] as $property => $value)
{
if($property == "tag" || $property == "value")

	if(is_array($theme['properties']))
{
foreach($theme['properties'] as $property => $value)
{
if($property == "tag" || $property == "value")

			{

			{

				continue;

				continue;

			}


			}


			if($property == 'colors' || $property == 'disporder')
{
$data = my_unserialize($value['value']);

			if($property == 'colors' || $property == 'disporder')
{
$data = my_unserialize($value['value']);

Zeile 115Zeile 113
			}

$properties[$property] = $value['value'];

			}

$properties[$property] = $value['value'];

		}

		}

	}

if(empty($mybb->input['name']))

	}

if(empty($mybb->input['name']))

Zeile 130Zeile 128

$query = $db->simple_select("themes", "tid", "name='".$db->escape_string($name)."'", array("limit" => 1));
$existingtheme = $db->fetch_array($query);


$query = $db->simple_select("themes", "tid", "name='".$db->escape_string($name)."'", array("limit" => 1));
$existingtheme = $db->fetch_array($query);

	if(!empty($options['force_name_check']) && $existingtheme['tid'])

	if(!empty($options['force_name_check']) && $existingtheme)

	{
return -3;
}

	{
return -3;
}

	else if($existingtheme['tid'])

	else if($existingtheme)

	{
$options['tid'] = $existingtheme['tid'];
}

	{
$options['tid'] = $existingtheme['tid'];
}

Zeile 146Zeile 144

// Do we have any templates to insert?
if(!empty($theme['templates']['template']) && empty($options['no_templates']))


// Do we have any templates to insert?
if(!empty($theme['templates']['template']) && empty($options['no_templates']))

	{
if($options['templateset'])
{
$sid = $options['templateset'];
}
else
{
$sid = $db->insert_query("templatesets", array('title' => $db->escape_string($name)." Templates"));
}


	{	










		$templates = $theme['templates']['template'];
if(is_array($templates))
{

		$templates = $theme['templates']['template'];
if(is_array($templates))
{

Zeile 166Zeile 155
			}
}


			}
}


 
		// Security check

		$security_check = false;

		$security_check = false;

		$templatecache = array();
foreach($templates as $template)
{

		foreach($templates as $template)
{


			if(check_template($template['value']))
{
$security_check = true;
break;
}

			if(check_template($template['value']))
{
$security_check = true;
break;
}

 
		}

if($security_check == true)
{
return -4;
}

if(!empty($options['templateset']))
{
$sid = (int)$options['templateset'];
}
else
{
$sid = $db->insert_query("templatesets", array('title' => $db->escape_string($name)." Templates"));
}





 
		$templatecache = array();
foreach($templates as $template)
{

			$templatecache[] = array(
"title" => $db->escape_string($template['attributes']['name']),
"template" => $db->escape_string($template['value']),

			$templatecache[] = array(
"title" => $db->escape_string($template['attributes']['name']),
"template" => $db->escape_string($template['value']),

Zeile 183Zeile 190
				"version" => $db->escape_string($template['attributes']['version']),
"dateline" => TIME_NOW
);

				"version" => $db->escape_string($template['attributes']['version']),
"dateline" => TIME_NOW
);

		}

if($security_check == true)
{
return -4;
}

foreach($templatecache as $template)

		}

foreach($templatecache as $template)






		{
// PostgreSQL causes apache to stop sending content sometimes and
// causes the page to stop loading during many queries all at one time

		{
// PostgreSQL causes apache to stop sending content sometimes and
// causes the page to stop loading during many queries all at one time

Zeile 199Zeile 201
				echo " ";
flush();
}

				echo " ";
flush();
}





			$db->insert_query("templates", $template);
}

			$db->insert_query("templates", $template);
}





		$properties['templateset'] = $sid;
}


		$properties['templateset'] = $sid;
}


Zeile 213Zeile 215
		if(!isset($options['parent']))
{
$options['parent'] = 0;

		if(!isset($options['parent']))
{
$options['parent'] = 0;

		}

		}

		$theme_id = build_new_theme($name, $properties, $options['parent']);

		$theme_id = build_new_theme($name, $properties, $options['parent']);

	}

	}

	// Overriding an existing - delete refs.
else
{

	// Overriding an existing - delete refs.
else
{

Zeile 232Zeile 234
		{
// Trick the system into thinking we have a good array =P
$theme['stylesheets']['stylesheet'] = array($theme['stylesheets']['stylesheet']);

		{
// Trick the system into thinking we have a good array =P
$theme['stylesheets']['stylesheet'] = array($theme['stylesheets']['stylesheet']);

		}


		}


		// Retrieve a list of inherited stylesheets
$query = $db->simple_select("themes", "stylesheets", "tid = '{$theme_id}'");
if($db->num_rows($query))
{
$inherited_stylesheets = my_unserialize($db->fetch_field($query, "stylesheets"));


		// Retrieve a list of inherited stylesheets
$query = $db->simple_select("themes", "stylesheets", "tid = '{$theme_id}'");
if($db->num_rows($query))
{
$inherited_stylesheets = my_unserialize($db->fetch_field($query, "stylesheets"));


			if(is_array($inherited_stylesheets['inherited']))

			if(isset($inherited_stylesheets['inherited']) && is_array($inherited_stylesheets['inherited']))

			{
$loop = 1;
foreach($inherited_stylesheets['inherited'] as $action => $stylesheets)

			{
$loop = 1;
foreach($inherited_stylesheets['inherited'] as $action => $stylesheets)

Zeile 262Zeile 264
		$loop = 1;
foreach($theme['stylesheets']['stylesheet'] as $stylesheet)
{

		$loop = 1;
foreach($theme['stylesheets']['stylesheet'] as $stylesheet)
{

 
			$stylesheet['attributes']['name'] = my_substr($stylesheet['attributes']['name'], 0, 30);


			if(substr($stylesheet['attributes']['name'], -4) != ".css")
{
continue;

			if(substr($stylesheet['attributes']['name'], -4) != ".css")
{
continue;

Zeile 334Zeile 338
	}

update_theme_stylesheet_list($theme_id);

	}

update_theme_stylesheet_list($theme_id);





	// And done?
return $theme_id;
}

	// And done?
return $theme_id;
}

Zeile 354Zeile 358
	{
$find[] = "{{$variable}}";
$replace[] = $variables[$variable];

	{
$find[] = "{{$variable}}";
$replace[] = $variables[$variable];

	}

	}

	return str_replace($find, $replace, $string);
}

	return str_replace($find, $replace, $string);
}





/**
* Caches a stylesheet to the file system.
*

/**
* Caches a stylesheet to the file system.
*

Zeile 374Zeile 378
	$filename = basename($filename);
$tid = (int) $tid;
$theme_directory = "cache/themes/theme{$tid}";

	$filename = basename($filename);
$tid = (int) $tid;
$theme_directory = "cache/themes/theme{$tid}";

 

if(substr($filename, -4) != ".css")
{
return false;
}


// If we're in safe mode save to the main theme folder by default
if($mybb->safemode)


// If we're in safe mode save to the main theme folder by default
if($mybb->safemode)

Zeile 623Zeile 632
		);
$properties['logo'] = parse_theme_variables($properties['logo'], $theme_vars);
}

		);
$properties['logo'] = parse_theme_variables($properties['logo'], $theme_vars);
}

 

$updated_theme = array();

	if(!empty($stylesheets))
{
$updated_theme['stylesheets'] = $db->escape_string(my_serialize($stylesheets));

	if(!empty($stylesheets))
{
$updated_theme['stylesheets'] = $db->escape_string(my_serialize($stylesheets));

Zeile 642Zeile 653
 *
* @param string $css The incoming CSS
* @return array Parsed CSS file as array, false on failure

 *
* @param string $css The incoming CSS
* @return array Parsed CSS file as array, false on failure

 */

 */

function css_to_array($css)
{
// Normalise line breaks

function css_to_array($css)
{
// Normalise line breaks

Zeile 701Zeile 712
 * @param int $selected_item
*
* @return string

 * @param int $selected_item
*
* @return string

 */

 */

function get_selectors_as_options($css, $selected_item=null)
{
$select = "";

function get_selectors_as_options($css, $selected_item=null)
{
$select = "";

Zeile 741Zeile 752
/**
* @param array $a
* @param array $b

/**
* @param array $a
* @param array $b

 *

 *

 * @return int
*/
function css_selectors_sort_cmp($a, $b)

 * @return int
*/
function css_selectors_sort_cmp($a, $b)

Zeile 780Zeile 791

/**
* Parses CSS supported properties and returns them as an array.


/**
* Parses CSS supported properties and returns them as an array.

 *

 *

 * @param string $values Value of CSS properties from within class or selector
* @return array Array of CSS properties
*/
function parse_css_properties($values)
{

 * @param string $values Value of CSS properties from within class or selector
* @return array Array of CSS properties
*/
function parse_css_properties($values)
{

	$css_bits = array();



	$css_bits = array(
'extra' => null,
);


if(!$values)
{


if(!$values)
{

Zeile 829Zeile 842
 * @param string $class_id (Optional) The optional friendly class id value just incase the CSS is not found in the file.
*
* @return string The altered CSS.

 * @param string $class_id (Optional) The optional friendly class id value just incase the CSS is not found in the file.
*
* @return string The altered CSS.

 */

 */

function insert_into_css($new_css, $selector="", $css="", $class_id="")
{
$new_css = str_replace(array("\r\n", "\n", "\r"), "\n", $new_css);

$generated_css = '';

function insert_into_css($new_css, $selector="", $css="", $class_id="")
{
$new_css = str_replace(array("\r\n", "\n", "\r"), "\n", $new_css);

$generated_css = '';





	// Build the new CSS properties list
$new_css = explode("\n", $new_css);
foreach($new_css as $css_line)
{
$generated_css .= "\t".trim($css_line)."\n";

	// Build the new CSS properties list
$new_css = explode("\n", $new_css);
foreach($new_css as $css_line)
{
$generated_css .= "\t".trim($css_line)."\n";

	}

	}


$parsed_css = array();



$parsed_css = array();


Zeile 852Zeile 865
	}

if(!$class_id)

	}

if(!$class_id)

	{

	{

		$class_id = $parsed_css[$selector]['class_name'];

		$class_id = $parsed_css[$selector]['class_name'];

	}

	}


// The specified class ID cannot be found, add CSS to end of file
if(!$css || !$parsed_css[$selector])


// The specified class ID cannot be found, add CSS to end of file
if(!$css || !$parsed_css[$selector])

Zeile 869Zeile 882
		$css = preg_replace("#^(?!@)\s*([a-z0-9a+\\\[\]\-\"=_:>\*\.\#\,\s\(\)\|~\^]+)(\s*)\{(\n*)#isu", "\n$1 {\n", $css);
$css = preg_replace("#\s{1,}\{#", " {", $css);
$existing_block = $parsed_css[$selector];

		$css = preg_replace("#^(?!@)\s*([a-z0-9a+\\\[\]\-\"=_:>\*\.\#\,\s\(\)\|~\^]+)(\s*)\{(\n*)#isu", "\n$1 {\n", $css);
$css = preg_replace("#\s{1,}\{#", " {", $css);
$existing_block = $parsed_css[$selector];





		$break = strrpos($selector, "_");
$actual_occurance = 0;
if($break !== false)
{
$actual_occurance = (int)substr($selector, ($break+1));

		$break = strrpos($selector, "_");
$actual_occurance = 0;
if($break !== false)
{
$actual_occurance = (int)substr($selector, ($break+1));

		}


		}


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

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

Zeile 923Zeile 936

$new_stylesheet = array();
foreach($stylesheet as $key => $value)


$new_stylesheet = array();
foreach($stylesheet as $key => $value)

	{

	{

		if(!is_numeric($key))
{
$new_stylesheet[$db->escape_string($key)] = $db->escape_string($value);
}
}

		if(!is_numeric($key))
{
$new_stylesheet[$db->escape_string($key)] = $db->escape_string($value);
}
}





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

return $sid;

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

return $sid;

Zeile 947Zeile 960
	global $mybb, $db, $cache, $plugins;

$stylesheets = array();

	global $mybb, $db, $cache, $plugins;

$stylesheets = array();





	$child_list = make_child_theme_list($tid);
$parent_list = make_parent_theme_list($tid);

	$child_list = make_child_theme_list($tid);
$parent_list = make_parent_theme_list($tid);





	if(!is_array($parent_list))
{
return false;

	if(!is_array($parent_list))
{
return false;

Zeile 970Zeile 983
			}

$stylesheets[$stylesheet['name']] = $stylesheet;

			}

$stylesheets[$stylesheet['name']] = $stylesheet;

		}

		}

	}

$theme_stylesheets = array();

	}

$theme_stylesheets = array();

Zeile 982Zeile 995

foreach($parent_list as $theme_id)
{


foreach($parent_list as $theme_id)
{

			if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))

			if(!empty($mybb->settings['usecdn']) && !empty($mybb->settings['cdnpath']))

			{
$cdnpath = rtrim($mybb->settings['cdnpath'], '/\\').'/';
if(file_exists($cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(

			{
$cdnpath = rtrim($mybb->settings['cdnpath'], '/\\').'/';
if(file_exists($cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(

Zeile 995Zeile 1008
				}
}
else

				}
}
else

			{

			{

				if(file_exists(MYBB_ROOT."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(
MYBB_ROOT."cache/themes/theme{$theme_id}/{$stylesheet['name']}"
) >= $stylesheet['lastmodified']

				if(file_exists(MYBB_ROOT."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(
MYBB_ROOT."cache/themes/theme{$theme_id}/{$stylesheet['name']}"
) >= $stylesheet['lastmodified']

Zeile 1006Zeile 1019
				}
}
}

				}
}
}

		



		if(is_object($plugins))
{
$plugins->run_hooks('update_theme_stylesheet_list_set_css_url', $css_url);

		if(is_object($plugins))
{
$plugins->run_hooks('update_theme_stylesheet_list_set_css_url', $css_url);

Zeile 1042Zeile 1055
				{
$theme_stylesheets['inherited']["{$attached_file}_{$action}"][$css_url] = $stylesheet['inherited'];
}

				{
$theme_stylesheets['inherited']["{$attached_file}_{$action}"][$css_url] = $stylesheet['inherited'];
}

			}
}

			}
}

	}

// Now we have our list of built stylesheets, save them

	}

// Now we have our list of built stylesheets, save them

Zeile 1055Zeile 1068
	if($update_disporders)
{
if(!is_array($theme) || !$theme)

	if($update_disporders)
{
if(!is_array($theme) || !$theme)

		{

		{

			$theme_cache = cache_themes();
$theme = $theme_cache[$tid];
}

			$theme_cache = cache_themes();
$theme = $theme_cache[$tid];
}

Zeile 1066Zeile 1079
		if(!is_array($properties))
{
$properties = my_unserialize($theme['properties']);

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

		}

$max_disporder = 0;

		}

$max_disporder = 0;


foreach($stylesheets as $stylesheet)
{


foreach($stylesheets as $stylesheet)
{

Zeile 1077Zeile 1090
				$orphaned_stylesheets[] = $stylesheet['name'];
continue;
}

				$orphaned_stylesheets[] = $stylesheet['name'];
continue;
}

			



			if($properties['disporder'][$stylesheet['name']] > $max_disporder)
{
$max_disporder = $properties['disporder'][$stylesheet['name']];

			if($properties['disporder'][$stylesheet['name']] > $max_disporder)
{
$max_disporder = $properties['disporder'][$stylesheet['name']];

Zeile 1160Zeile 1173
		if(is_array($parents))
{
$themes = array_merge($themes, $parents);

		if(is_array($parents))
{
$themes = array_merge($themes, $parents);

		}
}


		}
}


	return $themes;
}


	return $themes;
}


Zeile 1209Zeile 1222
	}

return $themes;

	}

return $themes;

}


}


/**
* @return array
*/

/**
* @return array
*/

Zeile 1223Zeile 1236
		$query = $db->simple_select("themes", "*", "", array('order_by' => "pid, name"));
while($theme = $db->fetch_array($query))
{

		$query = $db->simple_select("themes", "*", "", array('order_by' => "pid, name"));
while($theme = $db->fetch_array($query))
{

 
			$theme['users'] = 0;

			$theme['properties'] = my_unserialize($theme['properties']);
$theme['stylesheets'] = my_unserialize($theme['stylesheets']);
$theme_cache[$theme['tid']] = $theme;

			$theme['properties'] = my_unserialize($theme['properties']);
$theme['stylesheets'] = my_unserialize($theme['stylesheets']);
$theme_cache[$theme['tid']] = $theme;

Zeile 1230Zeile 1244
			if($theme['def'] == 1)
{
$theme_cache['default'] = $theme['tid'];

			if($theme['def'] == 1)
{
$theme_cache['default'] = $theme['tid'];

			}
}
}


			}
}
}


	// Do we have no themes assigned as default?
if(empty($theme_cache['default']))
{

	// Do we have no themes assigned as default?
if(empty($theme_cache['default']))
{

Zeile 1265Zeile 1279
				$user_themes['style'] = $themes['default'];
}


				$user_themes['style'] = $themes['default'];
}


			if($themes[$user_themes['style']]['users'] > 0)

			if(isset($themes[$user_themes['style']]['users']) && $themes[$user_themes['style']]['users'] > 0)

			{
$themes[$user_themes['style']]['users'] += (int)$user_themes['users'];
}
else
{
$themes[$user_themes['style']]['users'] = (int)$user_themes['users'];

			{
$themes[$user_themes['style']]['users'] += (int)$user_themes['users'];
}
else
{
$themes[$user_themes['style']]['users'] = (int)$user_themes['users'];

			}
}

// Restrucure the theme array to something we can "loop-de-loop" with
foreach($themes as $key => $theme)
{
if($key == "default")
{
continue;
}


			}
}

// Restrucure the theme array to something we can "loop-de-loop" with
foreach($themes as $key => $theme)
{
if($key == "default")
{
continue;
}


			$theme_cache[$theme['pid']][$theme['tid']] = $theme;
}
$theme_cache['num_themes'] = count($themes);
unset($themes);

			$theme_cache[$theme['pid']][$theme['tid']] = $theme;
}
$theme_cache['num_themes'] = count($themes);
unset($themes);

	}

if(!is_array($theme_cache[$parent]))

	}

if(!isset($theme_cache[$parent]) || !is_array($theme_cache[$parent]))

	{
return;
}

	{
return;
}

Zeile 1297Zeile 1311
	foreach($theme_cache[$parent] as $theme)
{
$popup = new PopupMenu("theme_{$theme['tid']}", $lang->options);

	foreach($theme_cache[$parent] as $theme)
{
$popup = new PopupMenu("theme_{$theme['tid']}", $lang->options);

 
		$set_default = '';

		if($theme['tid'] > 1)
{
$popup->add_item($lang->edit_theme, "index.php?module=style-themes&action=edit&tid={$theme['tid']}");

		if($theme['tid'] > 1)
{
$popup->add_item($lang->edit_theme, "index.php?module=style-themes&action=edit&tid={$theme['tid']}");

Zeile 1306Zeile 1321
			if($theme_cache['num_themes'] > 2)
{
$popup->add_item($lang->delete_theme, "index.php?module=style-themes&action=delete&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_deletion}')");

			if($theme_cache['num_themes'] > 2)
{
$popup->add_item($lang->delete_theme, "index.php?module=style-themes&action=delete&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_deletion}')");

			}

			}


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


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

Zeile 1318Zeile 1333
				$set_default = "<img src=\"styles/{$page->style}/images/icons/default.png\" alt=\"{$lang->default_theme}\" style=\"vertical-align: middle;\" title=\"{$lang->default_theme}\" />";
}
$popup->add_item($lang->force_on_users, "index.php?module=style-themes&amp;action=force&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_forced}')");

				$set_default = "<img src=\"styles/{$page->style}/images/icons/default.png\" alt=\"{$lang->default_theme}\" style=\"vertical-align: middle;\" title=\"{$lang->default_theme}\" />";
}
$popup->add_item($lang->force_on_users, "index.php?module=style-themes&amp;action=force&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_forced}')");

 
			$set_default = "<div class=\"float_right\">{$set_default}</div>";

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

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

		$table->construct_cell("<div class=\"float_right\">{$set_default}</div><div style=\"margin-left: {$padding}px;\"><strong>{$theme['name']}</strong></div>");

		$table->construct_cell("{$set_default}<div style=\"margin-left: {$padding}px;\"><strong>{$theme['name']}</strong></div>");

		$table->construct_cell(my_number_format($theme['users']), array("class" => "align_center"));
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();

		$table->construct_cell(my_number_format($theme['users']), array("class" => "align_center"));
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();

Zeile 1354Zeile 1370
			if($key == "default")
{
continue;

			if($key == "default")
{
continue;

			}

			}


$theme_cache[$theme['pid']][$theme['tid']] = $theme;


$theme_cache[$theme['pid']][$theme['tid']] = $theme;

		}

		}

		unset($theme);

		unset($theme);

	}

if(!is_array($theme_cache[$parent]) || $ignoretid === $parent)

	}

if(!isset($theme_cache[$parent]) || !is_array($theme_cache[$parent]) || $ignoretid === $parent)

	{
return null;

	{
return null;

	}

	}


foreach($theme_cache[$parent] as $theme)
{


foreach($theme_cache[$parent] as $theme)
{

Zeile 1379Zeile 1395
	}

if(!$parent)

	}

if(!$parent)

	{

	{

		return $list;
}
}

		return $list;
}
}

Zeile 1415Zeile 1431
			foreach($style as $stylesheet2)
{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;

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

				if(isset($file_stylesheets['inherited'][$file."_".$action]) && 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 1429Zeile 1445

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


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

		if(is_array($stylesheet2['inherited']))

		if(isset($stylesheet2['inherited']) && is_array($stylesheet2['inherited']))

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

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

Zeile 1452Zeile 1468
 */
function upgrade_css_120_to_140($css)
{

 */
function upgrade_css_120_to_140($css)
{

 
	global $mybb;

	// Update our CSS to the new stuff in 1.4
$parsed_css = css_to_array($css);


	// Update our CSS to the new stuff in 1.4
$parsed_css = css_to_array($css);


Zeile 1546Zeile 1563

foreach($to_add as $class_id => $array)
{


foreach($to_add as $class_id => $array)
{

		if($already_parsed[$class_id])

		if(isset($already_parsed[$class_id]))

		{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];

		{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];