* Add new block set method and more link.

This commit is contained in:
Yagami
2020-08-24 15:33:30 +08:00
parent fe575297f0
commit 5d75ef450c
10 changed files with 214 additions and 72 deletions
+21 -13
View File
@@ -59,6 +59,7 @@ class block extends control
if(strpos(",$closedBlock,", ",|flowchart,") === false and $this->config->global->flow == 'full') $modules['flowchart'] = $this->lang->block->lblFlowchart;
if(strpos(",$closedBlock,", ",|welcome,") === false and $this->config->global->flow == 'full') $modules['welcome'] = $this->lang->block->welcome;
if(strpos(",$closedBlock,", ",|html,") === false) $modules['html'] = 'HTML';
if(strpos(",$closedBlock,", ",|contribute,") === false) $modules['contribute'] = $this->lang->block->contribute;
$modules = array('' => '') + $modules;
$hiddenBlocks = $this->block->getHiddenBlocks();
@@ -207,11 +208,11 @@ class block extends control
public function dashboard($module, $type = '')
{
if($this->loadModel('user')->isLogon()) $this->session->set('blockModule', $module);
$blocks = $this->block->getBlockList($module);
$blocks = $this->block->getBlockList($module, $type);
$inited = empty($this->config->$module->common->blockInited) ? '' : $this->config->$module->common->blockInited;
/* Init block when vist index first. */
if(empty($blocks) and !$inited and !defined('TUTORIAL'))
if((empty($blocks) and !$inited and !defined('TUTORIAL')) || (empty($blocks) and $module == 'program'))
{
if($this->block->initBlock($module, $type)) die(js::reload());
}
@@ -322,6 +323,19 @@ class block extends control
$this->display();
}
/**
* Print contribute block.
*
* @access public
* @return void
*/
public function contribute()
{
$this->view->data = $this->block->getContributeBlockData();
$this->display();
}
/**
* Print block.
*
@@ -374,6 +388,10 @@ class block extends control
{
$html = $this->fetch('block', 'welcome');
}
elseif($block->block == 'contribute')
{
$html = $this->fetch('block', 'contribute');
}
echo $html;
}
@@ -1062,6 +1080,7 @@ class block extends control
*/
public function printCmmiReportBlock()
{
$this->loadModel('program');
$program = $this->loadModel('project')->getByID($this->session->program);
$today = date('Y-m-d', strtotime(helper::today()));
$date = date('Ymd', strtotime($this->loadModel('weekly')->getThisMonday($today)));
@@ -1455,17 +1474,6 @@ class block extends control
$this->display();
}
/**
* Print contribute block.
*
* @access public
* @return void
*/
public function printContributeBlock()
{
$this->view->data = $this->block->getContributeBlockData();
}
/**
* Print recent program block.
*