2016-08-21 23:06:17 +04:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
require_once "tools.php";
|
|
|
|
|
require_once "tools_session.php";
|
|
|
|
|
|
|
|
|
|
class UISideBar
|
|
|
|
|
{
|
2016-08-23 18:08:07 +04:00
|
|
|
|
private $active;
|
|
|
|
|
|
|
|
|
|
private $screen_width;
|
|
|
|
|
private $screen_height;
|
|
|
|
|
|
|
|
|
|
private $sidebar_width; //bootstarp中屏幕被分为12列宽,我们在PC桌面宽度环境,导航栏宽度设为1。手机/平板纵屏中,导航栏宽度设为2
|
2016-08-21 23:06:17 +04:00
|
|
|
|
|
2016-08-28 20:04:16 +04:00
|
|
|
|
public function __construct($a,$sw)
|
2016-08-21 23:06:17 +04:00
|
|
|
|
{
|
|
|
|
|
$this->active=$a;
|
2016-08-28 20:04:16 +04:00
|
|
|
|
$this->sidebar_width=$sw;
|
2016-08-21 23:06:17 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function echo_item($link,$text)
|
|
|
|
|
{
|
|
|
|
|
echo '<a class="list-group-item';
|
|
|
|
|
|
|
|
|
|
if($link==$this->active)
|
|
|
|
|
echo ' active';
|
|
|
|
|
|
|
|
|
|
echo '" href="'.$link.'.php">'.$text.'</a>';
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-28 20:04:16 +04:00
|
|
|
|
public function start($list)
|
2016-08-21 23:06:17 +04:00
|
|
|
|
{
|
2016-08-28 20:04:16 +04:00
|
|
|
|
echo '<div class="row" style="margin-left: 0px; margin-right: 0px;">';
|
2016-08-23 18:08:07 +04:00
|
|
|
|
echo '<div class="col-xs-'.$this->sidebar_width.' bs-docs-sidebar" style="padding-top: 15px;">
|
2016-08-21 23:06:17 +04:00
|
|
|
|
<div class="list-group bs-docs-sidenav affix-top">';
|
|
|
|
|
|
2016-08-28 20:04:16 +04:00
|
|
|
|
foreach($list as $link => $text)
|
2016-08-27 11:12:13 +04:00
|
|
|
|
$this->echo_item($link,$text);
|
2016-08-21 23:06:17 +04:00
|
|
|
|
|
|
|
|
|
echo '</div>
|
|
|
|
|
</div>
|
2016-08-28 13:31:43 +04:00
|
|
|
|
<div div class="col-xs-'.(12-$this->sidebar_width).'" style="padding-left: 0px;">';
|
2016-08-21 23:06:17 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function end()
|
|
|
|
|
{
|
2016-08-28 20:04:16 +04:00
|
|
|
|
echo '</div>
|
|
|
|
|
</div>';
|
2016-08-21 23:06:17 +04:00
|
|
|
|
}
|
|
|
|
|
};//class UISideBar
|
|
|
|
|
?>
|