<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright EB Dynamics, Inc., Edward Lemmers, P.E.
// For licensing, see license.txt.
// Revised: 8/1/2009	ELL
// Added ability to operate using different class tables.  This was done to give the ability
// to style calendar grids and event grids without adding 14 more classes to the site style list.
// Renamed from delete_tag.php to delete_class.php.
// Added feed thru to show/hide custom styles.
// Revised: 9/15/2009	ELL
// Added removal of class from CSS table as well.  Otherwise, style sheet will continue to contain this style even
// though you cannot edit it.
// Revised: 2/8/2012	ELL
// Added table prefix handling.
//
	include ("check_session.php");

	$class = $_REQUEST['class'];
	$search = array("PERIOD", "POUND", "SPACE", "COMMA");
	$replace = array(".", "#", " ", ",");
	$class = str_replace($search, $replace, $class);
	$style_sheet = $_REQUEST['style_sheet'];
	$class_table = $style_sheet . "_classes";
	$css_table = $style_sheet . "_css";
	
	// Go ahead and delete tag from class table.
	$query = "DELETE FROM `" . BWB_TABLE_PREFIX . $class_table . "` WHERE `class` = '$class'";
	$result = mysql_query($query, $bwb_link);
	
	// Also remove tag from tag from css table.
	$query = "DELETE FROM `" . BWB_TABLE_PREFIX . $css_table . "` WHERE `class` = '$class'";
	$result = mysql_query($query, $bwb_link);
	
	header("Location: classes.php?style_sheet=$style_sheet&show_class_editor=1");
	
?>
