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
File: Text.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
namespace Nextend\Framework\Form\Element;
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
use Nextend\Framework\Asset\Js\Js;
[6] Fix | Delete
use Nextend\Framework\Form\AbstractField;
[7] Fix | Delete
use Nextend\Framework\Form\ContainerInterface;
[8] Fix | Delete
use Nextend\Framework\Form\TraitFieldset;
[9] Fix | Delete
use Nextend\Framework\View\Html;
[10] Fix | Delete
[11] Fix | Delete
class Text extends AbstractField implements ContainerInterface {
[12] Fix | Delete
[13] Fix | Delete
use TraitFieldset;
[14] Fix | Delete
[15] Fix | Delete
protected $attributes = array();
[16] Fix | Delete
[17] Fix | Delete
public $fieldType = 'text';
[18] Fix | Delete
[19] Fix | Delete
protected $unit = false;
[20] Fix | Delete
[21] Fix | Delete
protected function addScript() {
[22] Fix | Delete
Js::addInline('new _N2.FormElementText("' . $this->fieldID . '");');
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
protected function fetchElement() {
[26] Fix | Delete
[27] Fix | Delete
$this->addScript();
[28] Fix | Delete
[29] Fix | Delete
if ($this->getValue() === '') {
[30] Fix | Delete
$this->class .= 'n2_field_text--empty ';
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
$html = Html::openTag('div', array(
[34] Fix | Delete
'class' => 'n2_field_text ' . $this->getClass()
[35] Fix | Delete
));
[36] Fix | Delete
[37] Fix | Delete
$html .= $this->pre();
[38] Fix | Delete
$html .= Html::tag('input', $this->attributes + array(
[39] Fix | Delete
'type' => $this->fieldType,
[40] Fix | Delete
'id' => $this->fieldID,
[41] Fix | Delete
'name' => $this->getFieldName(),
[42] Fix | Delete
'value' => $this->getValue(),
[43] Fix | Delete
'style' => $this->getStyle(),
[44] Fix | Delete
'autocomplete' => 'off'
[45] Fix | Delete
), false, false);
[46] Fix | Delete
[47] Fix | Delete
$html .= $this->post();
[48] Fix | Delete
[49] Fix | Delete
if (!empty($this->unit)) {
[50] Fix | Delete
$html .= Html::tag('div', array(
[51] Fix | Delete
'class' => 'n2_field_text__unit'
[52] Fix | Delete
), $this->unit);
[53] Fix | Delete
}
[54] Fix | Delete
$html .= "</div>";
[55] Fix | Delete
[56] Fix | Delete
return $html;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
public function setUnit($unit) {
[60] Fix | Delete
$this->unit = $unit;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
protected function pre() {
[64] Fix | Delete
return '';
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
protected function post() {
[68] Fix | Delete
[69] Fix | Delete
if ($this->first) {
[70] Fix | Delete
$html = '';
[71] Fix | Delete
[72] Fix | Delete
$element = $this->first;
[73] Fix | Delete
while ($element) {
[74] Fix | Delete
[75] Fix | Delete
$html .= $this->decorateElement($element);
[76] Fix | Delete
[77] Fix | Delete
$element = $element->getNext();
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
return '<div class="n2_field_text__post">' . $html . '</div>';
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
return '';
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* @param AbstractField $element
[88] Fix | Delete
*
[89] Fix | Delete
* @return string
[90] Fix | Delete
*/
[91] Fix | Delete
public function decorateElement($element) {
[92] Fix | Delete
[93] Fix | Delete
list($label, $fieldHTML) = $element->render();
[94] Fix | Delete
[95] Fix | Delete
return $fieldHTML;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function