public function deleteTemplateEntry($element, $client=1)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			$query = "DELETE FROM `#__extensions` WHERE `type` = 'template' AND `element` = '{$element}' AND `client_id` = '{$client}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();

			$this->log(sprintf('Removed extension entry for template "%s"', $element));

			if ($this->baseDb->tableExists('#__template_styles'))
			{
				$query = "DELETE FROM `#__template_styles` WHERE `template` = '{$element}' AND `client_id` = '{$client}'";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed style entry for template "%s"', $element));

				// Now make sure we have an enabled template (don't really care which one it is)
				$query = "SELECT `id` FROM `#__template_styles` WHERE `home` = 1 AND `client_id` = '{$client}'";
				$this->baseDb->setQuery($query);
				if (!$this->baseDb->loadResult())
				{
					$query = "SELECT `id` FROM `#__template_styles` WHERE `client_id` = '{$client}' ORDER BY `id` DESC LIMIT 1";
					$this->baseDb->setQuery($query);
					if ($id = $this->baseDb->loadResult())
					{
						$query = "UPDATE `#__template_styles` SET `home` = 1 WHERE `id` = '{$id}'";
						$this->baseDb->setQuery($query);
						$this->baseDb->query();

						$this->log(sprintf('Setting "home" for template style "%s"', $id));
					}
				}
			}

			return true;
		}

		return false;
	}
public function deleteTemplateEntry($element, $client=1)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			$query = "DELETE FROM `#__extensions` WHERE `type` = 'template' AND `element` = '{$element}' AND `client_id` = '{$client}'";
			$this->baseDb->setQuery($query);
			$this->baseDb->query();

			$this->log(sprintf('Removed extension entry for template "%s"', $element));

			if ($this->baseDb->tableExists('#__template_styles'))
			{
				$query = "DELETE FROM `#__template_styles` WHERE `template` = '{$element}' AND `client_id` = '{$client}'";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed style entry for template "%s"', $element));

				// Now make sure we have an enabled template (don't really care which one it is)
				$query = "SELECT `id` FROM `#__template_styles` WHERE `home` = 1 AND `client_id` = '{$client}'";
				$this->baseDb->setQuery($query);
				if (!$this->baseDb->loadResult())
				{
					$query = "SELECT `id` FROM `#__template_styles` WHERE `client_id` = '{$client}' ORDER BY `id` DESC LIMIT 1";
					$this->baseDb->setQuery($query);
					if ($id = $this->baseDb->loadResult())
					{
						$query = "UPDATE `#__template_styles` SET `home` = 1 WHERE `id` = '{$id}'";
						$this->baseDb->setQuery($query);
						$this->baseDb->query();

						$this->log(sprintf('Setting "home" for template style "%s"', $id));
					}
				}
			}

			return true;
		}

		return false;
	}
public function deleteTemplateEntry ( $ element , $ client = 1 ) { if ( $ this -> baseDb -> tableExists ( '#__extensions' ) ) { $ query = "DELETE FROM `#__extensions` WHERE `type` = 'template' AND `element` = '{$element}' AND `client_id` = '{$client}'" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Removed extension entry for template "%s"' , $ element ) ) ; if ( $ this -> baseDb -> tableExists ( '#__template_styles' ) ) { $ query = "DELETE FROM `#__template_styles` WHERE `template` = '{$element}' AND `client_id` = '{$client}'" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Removed style entry for template "%s"' , $ element ) ) ; // Now make sure we have an enabled template (don't really care which one it is) $ query = "SELECT `id` FROM `#__template_styles` WHERE `home` = 1 AND `client_id` = '{$client}'" ; $ this -> baseDb -> setQuery ( $ query ) ; if ( ! $ this -> baseDb -> loadResult ( ) ) { $ query = "SELECT `id` FROM `#__template_styles` WHERE `client_id` = '{$client}' ORDER BY `id` DESC LIMIT 1" ; $ this -> baseDb -> setQuery ( $ query ) ; if ( $ id = $ this -> baseDb -> loadResult ( ) ) { $ query = "UPDATE `#__template_styles` SET `home` = 1 WHERE `id` = '{$id}'" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Setting "home" for template style "%s"' , $ id ) ) ; } } } return true ; } return false ; }
Remove template entires from the appropriate tables

@param   string  $name    Template element name
@param   int     $client  Client id
@return  bool
Remove template entires from the appropriate tables