2014-05-12 02:56:55 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Theme 主题
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Theme
|
|
|
|
{
|
|
|
|
private $render; //传入Zend Render对象
|
|
|
|
public $plus; //插件
|
|
|
|
public $ScriptKey = "js"; //js 文件键名
|
|
|
|
public $CSSKey = "css"; //css 文件键名
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
{
|
|
|
|
$this->_init_plus();
|
|
|
|
}
|
|
|
|
|
|
|
|
//初始化插件
|
|
|
|
function _init_plus()
|
|
|
|
{
|
|
|
|
$this->plus = array(
|
|
|
|
|
|
|
|
/**********Jquery公共库******/
|
|
|
|
|
|
|
|
//Jquery
|
|
|
|
'jquery'=>array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.lasted.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//Jquery UI
|
|
|
|
'jquery_ui'=>array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.lasted.js',
|
|
|
|
'/js/lib/jquery.ui/jquery-ui.lasted.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey =>array(
|
|
|
|
'/js/lib/jquery.ui/jquery-ui.lasted.css'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
/********* Bootstrap ******/
|
|
|
|
'bootstrap'=>array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/bootstrap/js/bootstrap.min.js',
|
|
|
|
),
|
|
|
|
$this->CSSKey =>array(
|
|
|
|
'/js/lib/bootstrap/css/bootstrap.min.css',
|
|
|
|
'/js/lib/bootstrap/css/bootstrap-responsive.min.css'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
/********Jquery 插件********/
|
|
|
|
|
|
|
|
//colorbox
|
|
|
|
'colorbox' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.colorbox/jquery.colorbox-min.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/jquery.colorbox/style2/colorbox.css'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//inputbg
|
|
|
|
'inputbg' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/jquery.inputbg.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//loadinglayer
|
|
|
|
'loadinglayer' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/jquery.loadinglayer.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//admin_plugin
|
|
|
|
'admin_plugin' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/admin_plugin.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
'jplayer' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jplayer/jquery.jplayer.min.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//slides
|
|
|
|
'slides' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.slides.min.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
'datatable' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.datatable/jquery.dataTables.min.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/jquery.datatable/datatable.css'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
'masonry' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.masonry.min.js'
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
'uploadify' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/uploadify/jquery.uploadify.min.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/uploadify/uploadify.css'
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
'datepicker' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/datepicker/jquery-ui-1.10.3.custom.min.css'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
'highstock' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/highstock/highstock.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2014-06-12 08:39:57 +00:00
|
|
|
'highcharts' => array(
|
|
|
|
$this->ScriptKey => array(
|
2015-01-22 04:13:24 +00:00
|
|
|
'/js/lib/highcharts/highcharts.js',
|
|
|
|
'/js/lib/highcharts/highcharts-more.js'
|
2014-06-12 08:39:57 +00:00
|
|
|
)
|
|
|
|
),
|
2015-01-30 15:22:50 +00:00
|
|
|
|
|
|
|
'jquery-fileupload' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.fileupload/vendor/jquery.ui.widget.js',
|
|
|
|
'/js/lib/jquery.fileupload/jquery.iframe-transport.js',
|
|
|
|
'/js/lib/jquery.fileupload/jquery.fileupload.js',
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/jquery.fileupload/css/jquery.fileupload.css',
|
|
|
|
)
|
|
|
|
),
|
2014-06-12 08:39:57 +00:00
|
|
|
|
2014-05-12 02:56:55 +00:00
|
|
|
/*********谷歌地图*********/
|
|
|
|
|
|
|
|
//Google Map API v3
|
|
|
|
'google_map_v3'=>array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'http://maps.google.com/maps/api/js?sensor=false&language=zh-cn'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
//Google Map API v3 - KeyDragZone
|
|
|
|
'google_map_keydragzone' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/google-map/keydragzoom.js'
|
|
|
|
)
|
|
|
|
),
|
2014-06-14 01:44:23 +00:00
|
|
|
//Google Map API v3
|
|
|
|
'tianditu'=>array(
|
|
|
|
$this->ScriptKey => array(
|
2019-01-24 17:03:33 +00:00
|
|
|
'http://api.tianditu.gov.cn/api?v=3.0&tk=68c9e51b96659e06167c6d43a454251d'
|
2014-06-14 01:44:23 +00:00
|
|
|
)
|
|
|
|
),
|
2014-05-12 02:56:55 +00:00
|
|
|
);//插件列表
|
|
|
|
|
|
|
|
}// _init_plus()
|
|
|
|
|
|
|
|
//前台添加插件
|
|
|
|
function AppendPlus($render,$plus_name){
|
|
|
|
|
|
|
|
$plus_name = strtolower($plus_name);
|
|
|
|
|
|
|
|
$plusing = $this->plus;
|
|
|
|
|
|
|
|
if(!empty($plusing[$plus_name][$this->ScriptKey]))
|
|
|
|
{
|
|
|
|
foreach($plusing[$plus_name][$this->ScriptKey] as $k=>$v)
|
|
|
|
{
|
|
|
|
$render->headScript()->appendFile($v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!empty($plusing[$plus_name][$this->CSSKey]))
|
|
|
|
{
|
|
|
|
foreach($plusing[$plus_name][$this->CSSKey] as $k=>$v)
|
|
|
|
{
|
|
|
|
$render->headLink()->appendStylesheet($v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}// AppendPlus
|
|
|
|
|
|
|
|
//加载页面中的JS
|
|
|
|
function AppendModel($render,$model)
|
|
|
|
{
|
|
|
|
|
|
|
|
$model = trim($model);
|
|
|
|
|
|
|
|
$render->headScript()->appendFile("/js/lib/custom/models/".$model.".js");
|
|
|
|
|
|
|
|
}//
|
|
|
|
}
|