* adjust for block.
This commit is contained in:
@@ -15,48 +15,40 @@ $webRoot = $config->webRoot;
|
||||
$jsRoot = $webRoot . "js/";
|
||||
$themeRoot = $webRoot . "theme/";
|
||||
?>
|
||||
<form method='post' id='blockForm' target='hiddenwin' class='form form-horizontal' action='<?php echo $this->createLink('block', 'set', "id=$id&type=$type&source=$source")?>'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<?php include './publicform.html.php'?>
|
||||
<?php foreach($params as $key => $param):?>
|
||||
<tr>
|
||||
<th><?php echo $param['name']?></th>
|
||||
<td>
|
||||
<?php
|
||||
if(!isset($param['control'])) $param['control'] = 'input';
|
||||
if(!method_exists('html', $param['control'])) $param['control'] = 'input';
|
||||
<?php include './publicform.html.php'?>
|
||||
<?php echo html::hidden('actionLink', $this->createLink('block', 'set', "id=$id&type=$type&source=$source"));?>
|
||||
<?php foreach($params as $key => $param):?>
|
||||
<div class='form-group'>
|
||||
<label for='<?php echo $key?>' class='col-sm-3'><?php echo $param['name']?></label>
|
||||
<div class='col-sm-7'>
|
||||
<?php
|
||||
if(!isset($param['control'])) $param['control'] = 'input';
|
||||
if(!method_exists('html', $param['control'])) $param['control'] = 'input';
|
||||
|
||||
$control = $param['control'];
|
||||
$attr = empty($param['attr']) ? '' : $param['attr'];
|
||||
$default = $block ? (isset($block->params->$key) ? $block->params->$key : '') : (isset($param['default']) ? $param['default'] : '');
|
||||
$options = isset($param['options']) ? $param['options'] : array();
|
||||
if($control == 'select' or $control == 'radio' or $control == 'checkbox')
|
||||
{
|
||||
$chosen = $control == 'select' ? 'chosen' : '';
|
||||
if(strpos($attr, 'multiple') !== false)
|
||||
{
|
||||
echo html::$control("params[$key][]", $options, $default, "class='form-control " . $chosen . "' $attr");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::$control("params[$key]", $options, $default, "class='form-control " . $chosen . "' $attr");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::$control("params[$key]", $default, "class='form-control' $attr");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><th></th><td><?php echo html::submitButton()?></td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
$control = $param['control'];
|
||||
$attr = empty($param['attr']) ? '' : $param['attr'];
|
||||
$default = $block ? (isset($block->params->$key) ? $block->params->$key : '') : (isset($param['default']) ? $param['default'] : '');
|
||||
$options = isset($param['options']) ? $param['options'] : array();
|
||||
if($control == 'select' or $control == 'radio' or $control == 'checkbox')
|
||||
{
|
||||
$chosen = $control == 'select' ? 'chosen' : '';
|
||||
if(strpos($attr, 'multiple') !== false)
|
||||
{
|
||||
echo html::$control("params[$key][]", $options, $default, "class='form-control " . $chosen . "' $attr");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::$control("params[$key]", $options, $default, "class='form-control " . $chosen . "' $attr");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::$control("params[$key]", $default, "class='form-control' $attr");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php if(!isset($block->name)):?>
|
||||
<script>
|
||||
$(function()
|
||||
|
||||
Reference in New Issue
Block a user