* finish task #2937.

This commit is contained in:
wangyidong
2017-03-10 15:00:33 +08:00
parent eaeab89f53
commit af8ad0420f
9 changed files with 83 additions and 10 deletions

View File

@@ -49,9 +49,10 @@ class block extends control
if(!common::hasPriv($moduleKey, 'index')) unset($modules[$moduleKey]);
}
$modules['dynamic'] = $this->lang->block->dynamic;
$modules['flowchart'] = $this->lang->block->lblFlowchart;
$modules['html'] = 'HTML';
$closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : '';
if(strpos(",$closedBlock,", ",|dynamic,") === false) $modules['dynamic'] = $this->lang->block->dynamic;
if(strpos(",$closedBlock,", ",|flowchart,") === false) $modules['flowchart'] = $this->lang->block->lblFlowchart;
if(strpos(",$closedBlock,", ",|html,") === false) $modules['html'] = 'HTML';
$modules = array('' => '') + $modules;
$hiddenBlocks = $this->block->getHiddenBlocks();
@@ -614,4 +615,20 @@ class block extends control
{
$this->display();
}
/**
* Close block forever.
*
* @param int $blockID
* @access public
* @return void
*/
public function close($blockID)
{
$block = $this->block->getByID($blockID);
$closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : '';
$this->dao->delete()->from(TABLE_BLOCK)->where('source')->eq($block->source)->andWhere('block')->eq($block->block)->exec();
$this->loadModel('setting')->setItem('system.block.closed', $closedBlock . ",{$block->source}|{$block->block}");
die(js::reload('parent'));
}
}