contract PausableToken is ERC827Token, Ownable {

  bool public transfersEnabled;

  modifier ifTransferAllowed {
    require(transfersEnabled || msg.sender == owner);
    _;
  }

  /**
   * @dev Constructor that gives msg.sender all of existing tokens.
   */
  function PausableToken(bool _transfersEnabled) public {
    transfersEnabled = _transfersEnabled;
  }

  function setTransfersEnabled(bool _transfersEnabled) public onlyOwner {
    transfersEnabled = _transfersEnabled;
  }

  // ERC20 versions
  function transferFrom(address _from, address _to, uint256 _value) public ifTransferAllowed returns (bool) {
    return super.transferFrom(_from, _to, _value);
  }

  function transfer(address _to, uint256 _value) public ifTransferAllowed returns (bool) {
    return super.transfer(_to, _value);
  }

  function approve(address _spender, uint256 _value) public ifTransferAllowed returns (bool) {
    return super.approve(_spender, _value);
  }

  function increaseApproval(address _spender, uint _addedValue) public ifTransferAllowed returns (bool) {
    return super.increaseApproval(_spender, _addedValue);
  }

  function decreaseApproval(address _spender, uint _subtractedValue) public ifTransferAllowed returns (bool) {
    return super.decreaseApproval(_spender, _subtractedValue);
  }

  // ERC827 versions
  function approve(address _spender, uint256 _value, bytes _data) public ifTransferAllowed returns (bool) {
    return super.approve(_spender, _value, _data);
  }

  function transfer(address _to, uint256 _value, bytes _data) public ifTransferAllowed returns (bool) {
    return super.transfer(_to, _value, _data);
  }

  function transferFrom( address _from, address _to, uint256 _value, bytes _data) public ifTransferAllowed returns (bool) {
    return super.transferFrom(_from, _to, _value, _data);
  }

  function increaseApproval(address _spender, uint _addedValue, bytes _data) public ifTransferAllowed returns (bool) {
    return super.increaseApproval(_spender, _addedValue, _data);
  }

  function decreaseApproval(address _spender, uint _subtractedValue, bytes _data) public ifTransferAllowed returns (bool) {
    return super.decreaseApproval(_spender, _subtractedValue, _data);
  }

}
function transferFrom(address _from, address _to, uint256 _value) public ifTransferAllowed returns (bool) {
  return super.transferFrom(_from, _to, _value);
}

// ERC20 versions