Commit 65b48fa6 authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлена подгрузка параметров с уже установленными значениями (необходимо...

- Добавлена подгрузка параметров с уже установленными значениями (необходимо для формы редактирования)
parent 07e57c23
...@@ -49,10 +49,10 @@ class ConditionBase { ...@@ -49,10 +49,10 @@ class ConditionBase {
/** /**
* @param $group_key * @param $group_key
* @param $condition_key * @param $condition_key
* @param null $value * @param array $values
* @return array * @return array
*/ */
public function getParams($group_key, $condition_key, $value=null){ public function getParams($group_key, $condition_key, $values=array()){
$result = []; $result = [];
if (isset($this->config['params'])) { if (isset($this->config['params'])) {
foreach($this->config['params'] as $name=>$param) { foreach($this->config['params'] as $name=>$param) {
...@@ -60,7 +60,7 @@ class ConditionBase { ...@@ -60,7 +60,7 @@ class ConditionBase {
switch($type) { switch($type) {
case 'text': case 'text':
default: default:
$result[] = '<input type="text" value="'.((!is_null($value)) ? $value : '').'" name="Conditions['.$group_key.']['.$this->getId().$condition_key.'][params]['.$name.']" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>'; $result[] = '<input type="text" value="'.((array_key_exists($name, $values)) ? $values[$name] : '').'" name="Conditions['.$group_key.']['.$this->getId().$condition_key.'][params]['.$name.']" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment