增加站点首页节点类型

hotfix/远程访问多媒体中心
尹诚诚 7 years ago
parent 4339d76897
commit 411bdce7b7

@ -615,6 +615,7 @@ $config['area_type'] = array(
'大使馆' => 'y', '大使馆' => 'y',
'公民游' => 'z', '公民游' => 'z',
'交换链接' => 'k', '交换链接' => 'k',
'首页' => 'h',
'FAQ' => 'q' 'FAQ' => 'q'
); );

@ -0,0 +1,42 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Home extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->permission->is_admin();
//$this->output->enable_profiler(TRUE);
$this->load->model('Area_model');
$this->load->model('Information_model');
$this->load->model('InfoContents_model');
$this->load->model('InfoStructures_model');
}
//站点首页
public function index()
{
$home_id=1;
//查询结构根节点,当为空则建立
$rootStructure = $this->Information_model->GetRoot('h', $home_id);
if ($rootStructure == FALSE)
{
$this->InfoContents_model->Add('', 'HomePage', 'root', '', '', '', '', '', '', 0, 0, '', '', 0, 0, '', '', $home_id, 'h', 0,
'','');
$this->InfoStructures_model->Add(0, $this->InfoContents_model->insert_id);
$is_id = $this->InfoStructures_model->insert_id;
}
else
{
$is_id = $rootStructure->is_id;
}
redirect(site_url('information/edit/' . $is_id));
}
}

@ -5,7 +5,9 @@
<dl> <dl>
<dt>系统模块</dt> <dt>系统模块</dt>
<dd>
<a href="<?php echo site_url('home') ?>">站点首页</a>
</dd>
<dd> <dd>
<a href="<?php echo site_url('special') ?>">专题管理</a> <a href="<?php echo site_url('special') ?>">专题管理</a>
</dd> </dd>

Loading…
Cancel
Save