Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/smart-sl.../Nextend/Framewor.../Form/Element/Text
File: Number.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Nextend\Framework\Form\Element\Text;
[2] Fix | Delete
[3] Fix | Delete
use Nextend\Framework\Asset\Js\Js;
[4] Fix | Delete
use Nextend\Framework\Form\Element\Text;
[5] Fix | Delete
use Nextend\Framework\View\Html;
[6] Fix | Delete
[7] Fix | Delete
class Number extends Text {
[8] Fix | Delete
[9] Fix | Delete
protected $class = 'n2_field_number ';
[10] Fix | Delete
[11] Fix | Delete
protected $min = false;
[12] Fix | Delete
protected $max = false;
[13] Fix | Delete
protected $sublabel = '';
[14] Fix | Delete
[15] Fix | Delete
protected $units = false;
[16] Fix | Delete
[17] Fix | Delete
protected function fetchElement() {
[18] Fix | Delete
[19] Fix | Delete
if ($this->min === false) {
[20] Fix | Delete
$this->min = '-Number.MAX_VALUE';
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
if ($this->max === false) {
[24] Fix | Delete
$this->max = 'Number.MAX_VALUE';
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
$this->addScript();
[28] Fix | Delete
[29] Fix | Delete
$this->renderRelatedFields();
[30] Fix | Delete
[31] Fix | Delete
$html = Html::openTag('div', array(
[32] Fix | Delete
'class' => 'n2_field_text ' . $this->getClass()
[33] Fix | Delete
));
[34] Fix | Delete
[35] Fix | Delete
if (!empty($this->sublabel)) {
[36] Fix | Delete
$html .= Html::tag('div', array(
[37] Fix | Delete
'class' => 'n2_field_text__pre_label'
[38] Fix | Delete
), $this->sublabel);
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
$html .= $this->pre();
[42] Fix | Delete
[43] Fix | Delete
$html .= Html::tag('input', array(
[44] Fix | Delete
'type' => $this->fieldType,
[45] Fix | Delete
'id' => $this->fieldID,
[46] Fix | Delete
'name' => $this->getFieldName(),
[47] Fix | Delete
'value' => $this->getValue(),
[48] Fix | Delete
'style' => $this->getStyle(),
[49] Fix | Delete
'autocomplete' => 'off'
[50] Fix | Delete
), false, false);
[51] Fix | Delete
[52] Fix | Delete
$html .= $this->post();
[53] Fix | Delete
[54] Fix | Delete
if ($this->unit) {
[55] Fix | Delete
$html .= Html::tag('div', array(
[56] Fix | Delete
'class' => 'n2_field_number__unit'
[57] Fix | Delete
), $this->unit);
[58] Fix | Delete
}
[59] Fix | Delete
$html .= "</div>";
[60] Fix | Delete
[61] Fix | Delete
return $html;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
protected function addScript() {
[65] Fix | Delete
Js::addInline('new _N2.FormElementNumber("' . $this->fieldID . '", ' . $this->min . ', ' . $this->max . ', ' . json_encode($this->units) . ');');
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
public function setMin($min) {
[69] Fix | Delete
$this->min = $min;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* @param int $max
[74] Fix | Delete
*/
[75] Fix | Delete
public function setMax($max) {
[76] Fix | Delete
$this->max = $max;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* @param string $sublabel
[81] Fix | Delete
*/
[82] Fix | Delete
public function setSublabel($sublabel) {
[83] Fix | Delete
$this->sublabel = $sublabel;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* @param bool|array $units
[88] Fix | Delete
*/
[89] Fix | Delete
public function setUnits($units) {
[90] Fix | Delete
$this->units = $units;
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
public function setWide($wide) {
[94] Fix | Delete
switch ($wide) {
[95] Fix | Delete
case 2:
[96] Fix | Delete
$this->style .= 'width:20px;';
[97] Fix | Delete
break;
[98] Fix | Delete
case 3:
[99] Fix | Delete
$this->style .= 'width:26px;';
[100] Fix | Delete
break;
[101] Fix | Delete
case 4:
[102] Fix | Delete
$this->style .= 'width:32px;';
[103] Fix | Delete
break;
[104] Fix | Delete
case 5:
[105] Fix | Delete
$this->style .= 'width:44px;';
[106] Fix | Delete
break;
[107] Fix | Delete
case 6:
[108] Fix | Delete
$this->style .= 'width:60px;';
[109] Fix | Delete
break;
[110] Fix | Delete
}
[111] Fix | Delete
}
[112] Fix | Delete
}
[113] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function