english/administrator/components/com_templates/models/style.php
/**
	 * Method to delete rows.
	 *
	 * @param	array	An array of item ids.
	 *
	 * @return	boolean	Returns true on success, false on failure.
	 */
Method to delete rows.
@param       array   An array of item ids.

@return      boolean Returns true on success, false on failure.
Method to delete rows . @param array 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_templates')) {
					throw new Exception(JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
				}
				if ($table->home != '0'){
					JError::raiseWarning(SOME_ERROR_NUMBER,Jtext::_('COM_TEMPLATES_STYLE_CANNOT_DELETE_DEFAULT_STYLE'));
					return false;
				}
				if (!$table->delete($pk)) {
					$this->setError($table->getError());
					return false;
				}
			}
			else {
				$this->setError($table->getError());
				return false;
			}
		}
		$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_templates' ) ) { throw new Exception ( JText :: _ ( 'JERROR_CORE_DELETE_NOT_PERMITTED' ) ) ; } if ( $ table -> home != '0' ) { JError :: raiseWarning ( SOME_ERROR_NUMBER , Jtext :: _ ( 'COM_TEMPLATES_STYLE_CANNOT_DELETE_DEFAULT_STYLE' ) ) ; return false ; } if ( ! $ table -> delete ( $ pk ) ) { $ this -> setError ( $ table -> getError ( ) ) ; return false ; } } else { $ this -> setError ( $ table -> getError ( ) ) ; return false ; } } $ this -> cleanCache ( ) ; return true ; }
Method to delete rows.
Method to delete rows .
// Initialise variables. // Iterate the items to delete each one. // Access checks. // You should not delete a default style // Clean cache