Commit e2fde3a9 authored by Shakarim Sapa's avatar Shakarim Sapa

- Внесены изменения в input-ы отвечающие за передачу параметров условий....

- Внесены изменения в input-ы отвечающие за передачу параметров условий. Теперь они сгруппированы таким образом что их можно обработать в модели.
parent c00b0960
......@@ -47,9 +47,11 @@ class ConditionBase {
}
/**
* @return array|string
* @param $group_key
* @param $condition_key
* @return array
*/
public function getParams(){
public function getParams($group_key, $condition_key){
$result = [];
if (isset($this->config['params'])) {
foreach($this->config['params'] as $name=>$param) {
......@@ -57,7 +59,7 @@ class ConditionBase {
switch($type) {
case 'text':
default:
$result[] = '<input type="text" name="Conditions[]['.$name.']" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
$result[] = '<input type="text" name="Conditions['.$group_key.']['.$this->getId().$condition_key.']['.$name.']" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
break;
}
}
......
<?php use \common\modules\triggers\components\conditions\Conditions; ?>
<?php $condition_key = rand(100,999); ?>
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>Условие: <?php echo $object->getName(); ?></strong>
<input type="hidden" name="Conditions[<?php echo $key; ?>][<?php echo $object->getId().$condition_key; ?>][id]" value="<?php echo $object->getId(); ?>"/>
<?php
foreach($object->getParams() as $param) {
foreach($object->getParams($key, $condition_key) as $param) {
echo $param;
}
?>
......
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