mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-30 15:20:36 +00:00
markets: allow to change base coin (experimental)
This commit is contained in:
parent
53b1e06b63
commit
e3a485179b
2 changed files with 11 additions and 0 deletions
|
@ -33,6 +33,11 @@ class db_markets extends CActiveRecord
|
||||||
public function save($runValidation=true,$attributes=null)
|
public function save($runValidation=true,$attributes=null)
|
||||||
{
|
{
|
||||||
if (empty($this->base_coin)) $this->base_coin = null;
|
if (empty($this->base_coin)) $this->base_coin = null;
|
||||||
|
else if ($this->base_coin == 'BTC') $this->base_coin = null;
|
||||||
|
else if (strpos($this->name, $this->base_coin) === false) {
|
||||||
|
$parts = explode(' ', $this->name);
|
||||||
|
$this->name = trim($parts[0].' '.$this->base_coin);
|
||||||
|
}
|
||||||
if (empty($this->message)) $this->message = null;
|
if (empty($this->message)) $this->message = null;
|
||||||
|
|
||||||
return parent::save($runValidation, $attributes);
|
return parent::save($runValidation, $attributes);
|
||||||
|
|
|
@ -15,6 +15,12 @@ echo CUFHtml::activeTextField($market, 'deposit_address', array('maxlength'=>200
|
||||||
echo "<p class='formHint2'>.</p>";
|
echo "<p class='formHint2'>.</p>";
|
||||||
echo CUFHtml::closeCtrlHolder();
|
echo CUFHtml::closeCtrlHolder();
|
||||||
|
|
||||||
|
echo CUFHtml::openActiveCtrlHolder($market, 'base_coin');
|
||||||
|
echo CUFHtml::activeLabelEx($market, 'base_coin');
|
||||||
|
echo CUFHtml::activeTextField($market, 'base_coin', array('maxlength'=>16,'style'=>'width: 40px;'));
|
||||||
|
echo "<p class='formHint2'>Default (empty) is BTC</p>";
|
||||||
|
echo CUFHtml::closeCtrlHolder();
|
||||||
|
|
||||||
echo CUFHtml::closeTag('fieldset');
|
echo CUFHtml::closeTag('fieldset');
|
||||||
showSubmitButton('Save');
|
showSubmitButton('Save');
|
||||||
echo CUFHtml::endForm();
|
echo CUFHtml::endForm();
|
||||||
|
|
Loading…
Add table
Reference in a new issue