* adjust for integrate ranzhi.

This commit is contained in:
wangyidong
2016-04-11 17:30:27 +08:00
parent 7fea820831
commit ac2bfc94dd
3 changed files with 14 additions and 11 deletions
+12 -9
View File
@@ -260,17 +260,20 @@ class block extends control
if($mode == 'getblocklist')
{
$blocks = $this->block->getAvailableBlocks($module);
if($this->selfCall)
if(!$this->selfCall)
{
$blocks = json_decode($blocks, true);
$blockPairs = array('' => '') + $blocks;
$block = $this->block->getBlock($index);
echo "<th>{$this->lang->block->lblBlock}</th>";
echo '<td>' . html::select('moduleBlock', $blockPairs, ($block and $block->source != '') ? $block->block : '', "class='form-control' onchange='getBlockParams(this.value, \"$module\")'") . '</td>';
if(isset($block->source)) echo "<script>$(function(){getBlockParams($('#moduleBlock').val(), '{$block->source}')})</script>";
echo $blocks;
return true;
}
$blocks = json_decode($blocks, true);
$blockPairs = array('' => '') + $blocks;
$block = $this->block->getBlock($index);
echo "<th>{$this->lang->block->lblBlock}</th>";
echo '<td>' . html::select('moduleBlock', $blockPairs, ($block and $block->source != '') ? $block->block : '', "class='form-control' onchange='getBlockParams(this.value, \"$module\")'") . '</td>';
if(isset($block->source)) echo "<script>$(function(){getBlockParams($('#moduleBlock').val(), '{$block->source}')})</script>";
}
elseif($mode == 'getblockform')
{
+1 -1
View File
@@ -66,7 +66,7 @@ function getBlockParams(type, moduleID)
$(function()
{
$('#modules').change(function(){getBlocks($(this).val())});
getBlocks($('#modules').val());
if($('#modules').size() > 0) getBlocks($('#modules').val());
$(document).on('click', '.dropdown-menu.buttons .btn', function()
{
+1 -1
View File
@@ -25,6 +25,6 @@
<?php endif;?>
<tr><?php if(!empty($blocks)) echo $blocks;?></tr>
</table>
<div id='blockParam'><?php if(!empty($blocks)) echo $blocks;?></div>
<div id='blockParam'></div>
<?php js::set('index', $index)?>
<?php include '../../common/view/footer.lite.html.php';?>