2012-12-19 09:38:56 +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'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2013-03-18 02:19:44 +00:00
|
|
|
/********* Bootstrap ******/
|
|
|
|
'bootstrap'=>array(
|
2013-03-15 04:16:07 +00:00
|
|
|
$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'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2012-12-19 09:38:56 +00:00
|
|
|
|
|
|
|
/********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'
|
|
|
|
)
|
2012-12-26 09:13:31 +00:00
|
|
|
),
|
2012-12-19 09:38:56 +00:00
|
|
|
|
2012-12-26 09:13:31 +00:00
|
|
|
//inputbg
|
|
|
|
'inputbg' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/jquery.inputbg.js'
|
|
|
|
)
|
|
|
|
),
|
2012-12-19 09:38:56 +00:00
|
|
|
|
2012-12-26 09:13:31 +00:00
|
|
|
//loadinglayer
|
|
|
|
'loadinglayer' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/jquery.loadinglayer.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2013-04-19 10:03:57 +00:00
|
|
|
//admin_plugin
|
|
|
|
'admin_plugin' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/custom/admin_plugin.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2013-03-22 03:47:41 +00:00
|
|
|
'jplayer' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jplayer/jquery.jplayer.min.js'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2013-04-19 10:03:57 +00:00
|
|
|
//slides
|
2012-12-27 09:14:41 +00:00
|
|
|
'slides' => array(
|
|
|
|
$this->ScriptKey => array(
|
2013-03-19 09:16:41 +00:00
|
|
|
'/js/lib/jquery.slides.min.js'
|
2012-12-27 09:14:41 +00:00
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2013-01-08 03:37:24 +00:00
|
|
|
'datatable' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.datatable/jquery.dataTables.min.js'
|
|
|
|
),
|
|
|
|
$this->CSSKey => array(
|
|
|
|
'/js/lib/jquery.datatable/datatable.css'
|
|
|
|
)
|
2013-04-10 08:47:05 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
'masonry' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/jquery.masonry.min.js'
|
|
|
|
),
|
|
|
|
),
|
2013-10-28 14:54:21 +00:00
|
|
|
|
|
|
|
'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'
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
2012-12-19 09:38:56 +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-05-09 06:22:07 +00:00
|
|
|
'kindeditor' => array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'/js/lib/kindeditor/kindeditor-min.js',
|
|
|
|
'/js/lib/kindeditor/lang/zh_CN.js'
|
|
|
|
)
|
|
|
|
),
|
2014-09-02 05:20:24 +00:00
|
|
|
//Tianditu
|
|
|
|
'tianditu'=>array(
|
|
|
|
$this->ScriptKey => array(
|
|
|
|
'http://api.tianditu.com/js/maps.js'
|
|
|
|
)
|
|
|
|
),
|
2012-12-19 09:38:56 +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
|
|
|
|
|
2013-05-06 09:01:14 +00:00
|
|
|
//加载页面中的JS
|
|
|
|
function AppendModel($render,$model)
|
|
|
|
{
|
|
|
|
|
|
|
|
$model = trim($model);
|
|
|
|
|
|
|
|
$render->headScript()->appendFile("/js/lib/custom/models/".$model.".js");
|
|
|
|
|
|
|
|
}//
|
2012-12-19 09:38:56 +00:00
|
|
|
}
|