* finish task #2937.
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user