english/administrator/components/com_modules/models/module.php
/**
	 * Method to delete rows.
	 *
	 * @param	array	$pks	An array of item ids.
	 *
	 * @return	boolean	Returns true on success, false on failure.
	 * @since	1.6
	 */
Method to delete rows.
@param       array   $pks    An array of item ids.

@return      boolean Returns true on success, false on failure.
Method to delete rows . @param array $pks An array of item ids . @return boolean Returns true on success false on failure .
public function delete(&$pks)
	{
		$pks	= (array) $pks;
		$user	= JFactory::getUser();
		$table	= $this->getTable();
		foreach ($pks as $i => $pk)
		{
			if ($table->load($pk)) {
				if (!$user->authorise('core.delete', 'com_modules') ||
							$table->published != -2) {
					JError::raiseWarning(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
					return;
				}
				if (!$table->delete($pk)) {
					throw new Exception($table->getError());
				}
				else {
					$db		= $this->getDbo();
					$query	= $db->getQuery(true);
					$query->delete();
					$query->from('#__modules_menu');
					$query->where('moduleid='.(int)$pk);
					$db->setQuery((string)$query);
					$db->query();
				}
				parent::cleanCache($table->module, $table->client_id);
			}
			else {
				throw new Exception($table->getError());
			}
		}
		$this->cleanCache();
		return true;
	}
public function delete ( & $ pks ) { $ pks = ( array ) $ pks ; $ user = JFactory :: getUser ( ) ; $ table = $ this -> getTable ( ) ; foreach ( $ pks as $ i => $ pk ) { if ( $ table -> load ( $ pk ) ) { if ( ! $ user -> authorise ( 'core.delete' , 'com_modules' ) || $ table -> published != - 2 ) { JError :: raiseWarning ( 403 , JText :: _ ( 'JERROR_CORE_DELETE_NOT_PERMITTED' ) ) ; return ; } if ( ! $ table -> delete ( $ pk ) ) { throw new Exception ( $ table -> getError ( ) ) ; } else { $ db = $ this -> getDbo ( ) ; $ query = $ db -> getQuery ( true ) ; $ query -> delete ( ) ; $ query -> from ( '#__modules_menu' ) ; $ query -> where ( 'moduleid=' . ( int ) $ pk ) ; $ db -> setQuery ( ( string ) $ query ) ; $ db -> query ( ) ; } parent :: cleanCache ( $ table -> module , $ table -> client_id ) ; } else { throw new Exception ( $ table -> getError ( ) ) ; } } $ this -> cleanCache ( ) ; return true ; }
Method to delete rows.
Method to delete rows .
// Initialise variables. // Iterate the items to delete each one. // Access checks. //	throw new Exception(JText::_('JERROR_CORE_DELETE_NOT_PERMITTED')); // Delete the menu assignments // Clear module cache // Clear modules cache