Commit 64ce103e authored by Shakarim Sapa's avatar Shakarim Sapa

- Метод отвечающий за генерацию списка параметров вынесен в родительский класс всех условий;

parent 30b6c2d2
...@@ -88,24 +88,6 @@ class Conditions { ...@@ -88,24 +88,6 @@ class Conditions {
return null; return null;
} }
/**
* @param $param
* @return string
*/
public function getParamInput($param){
if (empty($param['type']))
return '<input type="text" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
switch($param['type']) {
case 'text':
$result = '<input type="text" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
break;
default:
$result = '<input type="text" class="form-control" style="margin-top: 5px;" placeholder="'.((isset($param['placeholder'])) ? $param['placeholder'] : '').'"/>';
break;
}
return $result;
}
/** /**
* @return string * @return string
*/ */
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>Условие: <?php echo $object->getName(); ?></strong> <strong>Условие: <?php echo $object->getName(); ?></strong>
<?php <?php
foreach($object->config['params'] as $name=>$param) { foreach($object->getParams as $param) {
echo Conditions::init()->getParamInput($param); echo $param;
} }
?> ?>
</div> </div>
\ No newline at end of file
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