49 lines
2.0 KiB
PHP
49 lines
2.0 KiB
PHP
<?php
|
||
/**
|
||
* The model file of doc module of ZenTaoMS.
|
||
*
|
||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU Lesser General Public License as published by
|
||
* the Free Software Foundation, either version 3 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* ZenTaoMS is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU Lesser General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU Lesser General Public License
|
||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||
*
|
||
* @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
|
||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||
* @package doc
|
||
* @version $Id: model.php 881 2010-06-22 06:50:32Z chencongzhi520 $
|
||
* @link http://www.zentaoms.com
|
||
*/
|
||
?>
|
||
<?php
|
||
class docModel extends model
|
||
{
|
||
/* 设置菜单。*/
|
||
public function setMenu($libs, $libID, $extra = '')
|
||
{
|
||
/* 获得当前的模块和方法,传递给switchDocLib方法,供页面跳转使用。*/
|
||
$currentModule = $this->app->getModuleName();
|
||
$currentMethod = $this->app->getMethodName();
|
||
|
||
$selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '$currentModule', '$currentMethod', '$extra');\"");
|
||
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow);
|
||
foreach($this->lang->doc->menu as $key => $menu)
|
||
{
|
||
if($key != 'list') common::setMenuVars($this->lang->doc->menu, $key, $libID);
|
||
}
|
||
}
|
||
|
||
public function getLibs()
|
||
{
|
||
$libs = $this->dao->select('id, name')->from(TABLE_DOCLIB)->fetchPairs();
|
||
return $this->lang->doc->systemLibs + $libs;
|
||
}
|
||
}
|