public function deleteModuleEntry($element, $client=null)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			// Delete module entry
			$query = "DELETE FROM `#__extensions` WHERE `element` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$this->baseDb->query();

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

			// See if entries are present in #__modules table as well
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}
		else
		{
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}

		return false;
	}
public function deleteModuleEntry($element, $client=null)
	{
		if ($this->baseDb->tableExists('#__extensions'))
		{
			// Delete module entry
			$query = "DELETE FROM `#__extensions` WHERE `element` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$this->baseDb->query();

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

			// See if entries are present in #__modules table as well
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}
		else
		{
			$query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ((isset($client)) ? " AND `client_id` = " . $this->baseDb->quote($client) : '');
			$this->baseDb->setQuery($query);
			$ids = $this->baseDb->loadColumn();

			if ($ids && count($ids) > 0)
			{
				// Delete modules and module menu entries
				$query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode(',', $ids) . ")";
				$this->baseDb->setQuery($query);
				$this->baseDb->query();

				$this->log(sprintf('Removed module/menu entries for module "%s"', $element));
			}

			return true;
		}

		return false;
	}
public function deleteModuleEntry ( $ element , $ client = null ) { if ( $ this -> baseDb -> tableExists ( '#__extensions' ) ) { // Delete module entry $ query = "DELETE FROM `#__extensions` WHERE `element` = '{$element}'" . ( ( isset ( $ client ) ) ? " AND `client_id` = " . $ this -> baseDb -> quote ( $ client ) : '' ) ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Removed extension entry for module "%s"' , $ element ) ) ; // See if entries are present in #__modules table as well $ query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ( ( isset ( $ client ) ) ? " AND `client_id` = " . $ this -> baseDb -> quote ( $ client ) : '' ) ; $ this -> baseDb -> setQuery ( $ query ) ; $ ids = $ this -> baseDb -> loadColumn ( ) ; if ( $ ids && count ( $ ids ) > 0 ) { // Delete modules and module menu entries $ query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode ( ',' , $ ids ) . ")" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode ( ',' , $ ids ) . ")" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Removed module/menu entries for module "%s"' , $ element ) ) ; } return true ; } else { $ query = "SELECT `id` FROM `#__modules` WHERE `module` = '{$element}'" . ( ( isset ( $ client ) ) ? " AND `client_id` = " . $ this -> baseDb -> quote ( $ client ) : '' ) ; $ this -> baseDb -> setQuery ( $ query ) ; $ ids = $ this -> baseDb -> loadColumn ( ) ; if ( $ ids && count ( $ ids ) > 0 ) { // Delete modules and module menu entries $ query = "DELETE FROM `#__modules` WHERE `id` IN (" . implode ( ',' , $ ids ) . ")" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ query = "DELETE FROM `#__modules_menu` WHERE `moduleid` IN (" . implode ( ',' , $ ids ) . ")" ; $ this -> baseDb -> setQuery ( $ query ) ; $ this -> baseDb -> query ( ) ; $ this -> log ( sprintf ( 'Removed module/menu entries for module "%s"' , $ element ) ) ; } return true ; } return false ; }
Remove module entries from the appropriate table, depending on the CMS version

@param   string  $name    Plugin name
@param   int     $client  Client (site=0, admin=1)
@return  bool
Remove module entries from the appropriate table depending on the CMS version