Пример #1
0
 public function __construct($config = array())
 {
     if (!$this->test()) {
         zotop::error(zotop::t('The memcache extension is not available'));
     }
     $host = $config['host'];
     $host = empty($host) ? zotop::config('system.cache.memcache.host') : $host;
     $host = empty($host) ? '127.0.0.1' : $host;
     $post = $config['post'];
     $port = empty($port) ? zotop::config('system.cache.memcache.port') : $port;
     $port = empty($port) ? '11211' : $port;
     $timeout = isset($config['timeout']) ? (bool) $config['timeout'] : false;
     $persistent = isset($config['persistent']) ? (bool) $config['persistent'] : false;
     unset($config);
     //是否持久链接
     $connect = $persistent ? 'pconnect' : 'connect';
     $this->memcache =& new Memcache();
     if ($timeout === false) {
         $this->connected = @$this->memcache->{$connect}($host, $port);
     } else {
         $this->connected = @$this->memcache->{$connect}($host, $port, $timeout);
     }
     if (!$this->connected) {
         zotop::error(zotop::t('无法连接memcache服务器 “{$host}:{$port}”,请检查参数配置是否正确', array('host' => $host, 'port' => $port)));
     }
 }
Пример #2
0
 public static function show(array $msg)
 {
     $page = new page();
     $page->set('msg', $msg);
     $message = $page->render('msg');
     if ($message !== false) {
         echo $message;
     } else {
         $page->title = $msg['type'];
         $page->body = array('class' => 'msg');
         $page->header();
         $page->add('');
         $page->add('<div id="icon"><div class="zotop-icon zotop-icon-' . $msg['type'] . '"></div></div>');
         $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
         $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
         $page->add('	<div id="msg-life">' . (int) $msg['life'] . '</div>');
         $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
         $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
         $page->add('	<div id="msg-detail">' . $msg['detail'] . '</div>');
         $page->add('	<div id="msg-action">' . $msg['action'] . '</div>');
         $page->add('	<div id="msg-file">' . $msg['file'] . '</div>');
         $page->add('	<div id="msg-line">' . $msg['line'] . '</div>');
         if (!empty($msg['url'])) {
             $page->add('	<div>');
             $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
             $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
             $page->add('	</div>');
         }
         $page->add('</div>');
         $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
         $page->footer();
     }
     exit;
 }
Пример #3
0
 public function onDefault()
 {
     if (form::isPostBack()) {
         msg::error('开发中', '数据保存开发中,请稍后……');
     }
     $header['title'] = '系统设置';
     page::header($header);
     page::top();
     page::navbar($this->navbar(), 'main');
     form::header();
     block::header('网站基本信息');
     form::field(array('type' => 'text', 'label' => zotop::t('网站名称'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('网站名称,将显示在标题和导航中')));
     form::field(array('type' => 'text', 'label' => zotop::t('网站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('网站域名地址,不包含http://,如:www.zotop.com')));
     form::field(array('type' => 'text', 'label' => zotop::t('备案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('页面底部可以显示 ICP 备案信息,如果网站已备案,在此输入您的授权码,它将显示在页面底部,如果没有请留空')));
     form::field(array('type' => 'select', 'options' => array('0' => '不显示', '1' => '显示'), 'label' => zotop::t('授权信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('页脚部位显示程序官方网站链接')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about')));
     block::footer();
     block::header('联系信息设置');
     form::field(array('type' => 'text', 'label' => zotop::t('公司名称'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('网站隶属的公司或者组织名称')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('网站简介'), 'name' => 'zotop.site.about', 'value' => ''));
     block::footer();
     form::buttons(array('type' => 'submit'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
Пример #4
0
 public static function theme()
 {
     //系统默认返回的主题为system
     $theme = zotop::config('system.theme');
     $theme = empty($theme) ? 'system' : $theme;
     return $theme;
 }
Пример #5
0
 public static function hash()
 {
     $hash = zotop::config('system.safety.authkey');
     $hash = empty($hash) ? 'zotop form hash!' : $hash;
     $hash = substr(time(), 0, -7) . $hash;
     $hash = strtoupper(md5($hash));
     return $hash;
 }
Пример #6
0
 public static function config()
 {
     //打包全部配置
     zotop::config(include ZPATH_DATA . DS . 'config.php');
     zotop::config('zotop.database', include ZPATH_DATA . DS . 'database.php');
     zotop::config('zotop.application', include ZPATH_DATA . DS . 'application.php');
     zotop::config('zotop.module', include ZPATH_DATA . DS . 'module.php');
     zotop::config('zotop.router', include ZPATH_DATA . DS . 'router.php');
     zotop::data(ZPATH_RUNTIME . DS . 'config.php', zotop::config());
 }
Пример #7
0
 public function bottom($str = '')
 {
     $html[] = '';
     $html[] = '</div>';
     $html[] = '<div id="footer">';
     if (!empty($str)) {
         $html[] = '<div id="bottom" class="clearfix">' . $str . '</div>';
     }
     $html[] = '</div>';
     $html[] = '<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{#runtime}</b>,memory:<b>{#memory}</b>,includefiles:<b>{#include}</b>,queries:<b>{#queries}</b>,caches:<b>{#caches}</b></div>';
     echo implode("\n", $html);
 }
Пример #8
0
 public static function bottom($str = '')
 {
     $html[] = '';
     $html[] = '</div>';
     $html[] = '<div id="footer">';
     if (!empty($str)) {
         $html[] = $str;
     }
     $html[] = '</div>';
     $html[] = '<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{$runtime}</b>,memory:<b>{$memory}</b>,includefiles:<b>{$include}</b></div>';
     $html[] = '</div>';
     echo implode("\n", $html);
 }
Пример #9
0
 public function bottom()
 {
     $bottom = $this->render('bottom');
     if (!$bottom) {
         $html[] = '';
         $html[] = '</div>';
         $html[] = '<div id="footer">';
         $html[] = '	<div id="powered">powered by <b>' . zotop::config('zotop.name') . '</b> runtime:<b>{#runtime}</b>,memory:<b>{#memory}</b>,includefiles:<b>{#include}</b>,queries:<b>{#queries}</b></div>';
         $html[] = '</div>';
         $bottom = implode("\n", $html);
     }
     echo $bottom;
 }
Пример #10
0
 public static function runtime()
 {
     if (!is_file(ZOTOP_RUNTIME . DS . '~runtime.php')) {
         $registers = zotop::register();
         $content = array();
         $content[] = '<?php';
         foreach ($registers as $file) {
             $content[] = file::compile($file);
         }
         $content[] = '?>';
         file::write(ZOTOP_RUNTIME . DS . '~runtime.php', implode("\n", $content));
     }
     //缓存配置文件
     zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config());
 }
Пример #11
0
 public function __construct()
 {
     //调用父类的初始化函数
     parent::__construct();
     //初始化上传对象
     $this->upload = new upload();
     $this->upload->files = array();
     $this->upload->savepath = trim(zotop::config('system.upload.dir'), '/') . '/' . trim(zotop::config('system.upload.filepath'), '/');
     $this->upload->allowexts = 'jpg|jpeg|gif|bmp|png|doc|docx|xls|ppt|pdf|txt|rar|zip';
     $this->upload->maxsize = (int) zotop::config('system.upload.maxsize');
     $this->upload->overwrite = true;
     $this->upload->filename = 'md5';
     $this->upload->field = 'file';
     $this->upload->error = 0;
     $this->upload->msg = '';
 }
Пример #12
0
 public function __construct()
 {
     //调用父类的初始化函数
     parent::__construct();
     //初始化上传对象
     $this->upload = new upload();
     $this->upload->files = array();
     $this->upload->savepath = trim(zotop::config('upload.dir'), '/') . '/' . trim(zotop::config('upload.filepath'), '/');
     $this->upload->alowexts = 'jpg|jpeg|gif|bmp|png';
     $this->upload->maxsize = 0;
     $this->upload->overwrite = true;
     $this->upload->filename = 'md5';
     $this->upload->field = 'file';
     $this->upload->error = 0;
     $this->upload->msg = '';
 }
Пример #13
0
 public function onDefault()
 {
     $header['title'] = '关于我们';
     dialog::header($header);
     dialog::top();
     echo '<div style="padding:4px 15px;">';
     echo '<table class="list">';
     echo '<tr><td class="list-side">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
     echo '<tr><td class="list-side">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
     echo '<tr><td class="list-side">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
     echo '<tr><td class="list-side">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
     echo '<tr><td class="list-side">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
     echo '</table>';
     echo '</div>';
     dialog::bottom();
     dialog::footer();
 }
Пример #14
0
 /**
  * 应用程序初始化
  *
  * @return null
  */
 public static function init()
 {
     //错误及异常处理
     error_reporting(E_ERROR | E_WARNING | E_PARSE);
     set_error_handler(array('application', 'error'));
     set_exception_handler(array('application', 'exception'));
     //时区设置
     if (function_exists('date_default_timezone_set')) {
         $timezone = zotop::config('zotop.locale.timezone');
         $timezone = empty($timezone) ? date_default_timezone_get() : $timezone;
         if ($timezone) {
             date_default_timezone_set($timezone);
         }
     }
     //输出头
     header("Content-Type: text/html;charset=utf-8");
 }
Пример #15
0
 /**
  * 运行时执行,并加载相关文件
  */
 public static function run()
 {
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . 'config.php', zotop::config());
     //打包全部hook文件
     $hooks = runtime::compile(runtime::$hooks);
     if (!empty($hooks)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php', $hooks, true);
     }
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '_hooks.php');
     //打包核心文件
     $libraries = zotop::register();
     $libraries = runtime::compile($libraries);
     if (!empty($libraries)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APP_NAME . '.php', $libraries, true);
     }
 }
Пример #16
0
 public function onDefault($status = -1)
 {
     $header['title'] = '短消息';
     page::header($header);
     page::top();
     page::navbar(array(array('id' => 'main', 'title' => '短消息列表', 'href' => url::build('zotop/msg')), array('id' => 'send', 'title' => '发送短消息', 'href' => url::build('zotop/msg/send'), 'class' => 'dialog {width:600}')), 'main');
     echo '<div style="padding:4px 15px;">';
     echo '<table class="list">';
     echo '<tr><td class="list-side">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>';
     echo '<tr><td class="list-side">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>';
     echo '<tr><td class="list-side">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>';
     echo '<tr><td class="list-side">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>';
     echo '<tr><td class="list-side">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>';
     echo '</table>';
     echo '</div>';
     page::bottom();
     page::footer();
 }
Пример #17
0
 public function header()
 {
     $html[] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
     $html[] = '<head>';
     $html[] = '	<title>' . $this->title . ' ' . zotop::config("zotop.title") . '</title>';
     $html[] = '	' . html::meta('keywords', $this->keywords);
     $html[] = '	' . html::meta('description', $this->description);
     $html[] = '	' . html::meta('Content-Type', 'text/html;charset=utf-8');
     $html[] = '	' . html::meta('X-UA-Compatible', 'IE=EmulateIE7');
     $html[] = '	' . html::stylesheet(ZOTOP_APP_URL_CSS . '/zotop.css', array('id' => 'zotop'));
     $html[] = '	' . html::stylesheet(ZOTOP_APP_URL_CSS . '/global.css', array('id' => 'global'));
     $html[] = '	' . html::link(ZOTOP_APP_URL_IMAGE . '/fav.ico', array('rel' => 'shortcut icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(ZOTOP_APP_URL_IMAGE . '/fav.ico', array('rel' => 'icon', 'type' => 'image/x-icon'));
     $html[] = '	' . html::link(ZOTOP_APP_URL_IMAGE . '/fav.ico', array('rel' => 'bookmark', 'type' => 'image/x-icon'));
     $html[] = '</head>';
     $html[] = '<body' . html::attributes($this->body) . '>';
     $str = implode("\n", $html);
     echo $str;
 }
Пример #18
0
 /**
  * 运行时执行,并加载相关文件
  */
 public static function build()
 {
     runtime::config();
     runtime::library();
     runtime::hooks();
     //打包配置文件
     zotop::data(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.config.php', zotop::config());
     //打包全部hook文件
     $hooks = runtime::compile(runtime::$hooks);
     if (!empty($hooks)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php', $hooks, true);
     }
     //加载hooks以便核心文件使用
     zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.hooks.php');
     //打包核心文件
     $libraries = zotop::register();
     $libraries = runtime::compile($libraries);
     if (!empty($libraries)) {
         file::write(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION_GROUP . '.core.php', $libraries, true);
     }
 }
Пример #19
0
 /**
  * 类初始化
  *
  * @param   string|array  config 配置
  * @return  object
  */
 public function __construct($config = array())
 {
     //支持json格式的缓存配置
     if (is_string($config)) {
         $config = json_decode($config, true);
     }
     if (is_array($config)) {
         $config += array('driver' => zotop::config('system.cache.driver'), 'expire' => (int) zotop::config('system.cache.expire'));
     }
     if (empty($config['driver'])) {
         $config['driver'] = 'file';
     }
     //缓存驱动程序
     $driver = 'cache_' . strtolower($config['driver']);
     //加载驱动程序
     if (!zotop::autoload($driver)) {
         zotop::error(zotop::t('未能找到缓存驱动 "{$driver}"', $config));
     }
     $this->driver = new $driver($config);
     return $this->driver;
 }
Пример #20
0
 /**
  * 获取当前的URl参数,如:index.php/cms/index/index/1/2,所有的URI最后不含有斜线
  *
  * @return string URI;
  */
 public static function findURI()
 {
     $uri = '';
     if (isset($_GET['zotop'])) {
         $uri = $_GET['zotop'];
         zotop::config('zotop.url.model', 2);
         //将url模式重新设置为兼容模式
     } elseif (isset($_SERVER['PATH_INFO']) and $_SERVER['PATH_INFO']) {
         $uri = $_SERVER['PATH_INFO'];
     } else {
         $uri = $_SERVER['PHP_SELF'];
         if (strpos($uri, APPBASE) !== FALSE) {
             $uri = (string) substr($uri, strpos($uri, APPBASE) + strlen(APPBASE));
         }
     }
     //URI别名,实现自定义路由功能
     $uri = router::alias($uri);
     //应用程序入口文件处理,去掉开始结尾的斜线
     $uri = trim($uri, '/');
     $uri = preg_replace('#//+#', '/', $uri);
     self::$uri = $uri;
 }
Пример #21
0
 public static function show($msg = array())
 {
     $header['title'] = '用户登录';
     $header['body']['class'] = "msg";
     page::header($header);
     page::add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
     page::add('	<div id="msg-type">' . $msg['type'] . '</div>');
     page::add('	<div id="msg-life">' . $msg['life'] . '</div>');
     page::add('	<div class="zotop-msg zotop-msg-' . $msg['type'] . '">');
     page::add('		<div class="zotop-msg-icon"></div>');
     page::add('		<div class="zotop-msg-content">');
     page::add('			<div id="msg-title">' . $msg['title'] . '</div>');
     page::add('			<div id="msg-content">' . $msg['content'] . '</div>');
     page::add('			<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
     page::add('			<div id="msg-extra">' . $msg['extra'] . '</div>');
     page::add('			<div id="msg-powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
     page::add('		</div>');
     page::add('		</div>');
     page::add('</div>');
     page::footer();
     exit;
 }
Пример #22
0
 public static function show(array $msg)
 {
     $page = new page();
     $page->title = $msg['type'];
     $page->body = array('class' => 'msg');
     $page->header();
     $page->add('<div id="msg" class="' . $msg['type'] . ' clearfix">');
     $page->add('	<div id="msg-type">' . $msg['type'] . '</div>');
     $page->add('	<div id="msg-life">' . $msg['life'] . '</div>');
     $page->add('	<div id="msg-title">' . $msg['title'] . '</div>');
     $page->add('	<div id="msg-content">' . $msg['content'] . '</div>');
     $page->add('	<div id="msg-extra">' . $msg['extra'] . '</div>');
     if (!empty($msg['url'])) {
         $page->add('	<div>');
         $page->add('		<div><b>如果页面没有自动跳转,请点击以下链接</b></div>');
         $page->add('		<a href="' . $msg['url'] . '" id="msg-url">' . $msg['url'] . '</a>');
         $page->add('	</div>');
     }
     $page->add('</div>');
     $page->add('<div id="powered">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</div>');
     $page->footer();
     exit;
 }
Пример #23
0
 /**
  * 连接系统默认的数据库
  *
  * @param $config array  数据库参数
  * @return object 数据库连接
  */
 public static function db($settings = array())
 {
     $config = array('driver' => zotop::config('zotop.db.driver'), 'username' => zotop::config('zotop.db.username'), 'password' => zotop::config('zotop.db.password'), 'hostname' => zotop::config('zotop.db.hostname'), 'hostport' => zotop::config('zotop.db.hostport'), 'database' => zotop::config('zotop.db.database'), 'prefix' => zotop::config('zotop.db.prefix'), 'charset' => zotop::config('zotop.db.charset'));
     $config = array_merge($config, $settings);
     return database::instance($config);
 }
Пример #24
0
//加载核心文件
if (is_file(ZOTOP_APP . DS . '~runtime.php')) {
    require ZOTOP_APP . DS . '~runtime.php';
} else {
    //加载系统核心
    require ZOTOP_LIB . DS . 'zotop' . DS . 'core' . DS . 'zotop.php';
    //注册别名,自动加载系统库文件
    zotop::register(include ZOTOP_LIB . DS . 'alias.php');
    zotop::register(include ZOTOP_APP . DS . 'alias.php');
}
//配置的初始化
if (is_file(ZOTOP_RUNTIME . DS . '~config.php')) {
    zotop::config(include ZOTOP_RUNTIME . DS . '~config.php');
} else {
    zotop::config(include ZOTOP_SYSTEM . DS . 'config.php');
    zotop::config(include ZOTOP_CONFIG . DS . 'config.php');
    zotop::config('zotop.database', include ZOTOP_CONFIG . DS . 'database.php');
    zotop::config('zotop.application', include ZOTOP_CONFIG . DS . 'application.php');
    zotop::config('zotop.module', include ZOTOP_CONFIG . DS . 'module.php');
    zotop::config('zotop.router', include ZOTOP_CONFIG . DS . 'router.php');
    //缓存配置文件
    zotop::data(ZOTOP_RUNTIME . DS . '~config.php', zotop::config());
}
//启动底层系统
zotop::boot();
//hook的初始化
if (is_file(ZOTOP_RUNTIME . DS . '~hook.php')) {
    zotop::load(ZOTOP_RUNTIME . DS . '~hook.php');
} else {
    //生成全局hook文件
}
Пример #25
0
 public function onDefault()
 {
     $header['title'] = '控制中心';
     $header['js'] = url::module() . '/admin/js/index.js';
     $header['body']['class'] = 'frame';
     page::header($header);
     $html[] = '';
     $html[] = '<script type="text/javascript">';
     $html[] = '	zotop.url.frame.side="' . zotop::url('zotop/side') . '"';
     $html[] = '	zotop.url.frame.main="' . zotop::url('zotop/main') . '"';
     $html[] = '	zotop.url.msg.unread="' . zotop::url('zotop/msg/unread') . '"';
     $html[] = '</script>';
     $html[] = '	<div id="header">';
     $html[] = '		<div id="top">';
     $html[] = '			<div id="logo"><a href="' . zotop::url('zotop/main') . '" target="mainIframe" onfocus="this.blur();" title="首页"></a></div>';
     $html[] = '			<div id="action">';
     $html[] = '				<div id="topbar">';
     $html[] = '					<a href="javascript:notepad()">记事本</a><b>|</b>';
     $html[] = '					<a href="' . zotop::url('zotop/setting') . '" target="mainIframe">系统设置</a><b>|</b>';
     $html[] = '					<a href="' . zotop::url('zotop/about') . '" target="mainIframe" class="dialog {width:450,height:160}">关于</a>';
     $html[] = '				</div>';
     $html[] = '				<div id="user">';
     $html[] = '					<span id="user-info"><b>' . zotop::user('username') . '</b>(administrator)</span>';
     $html[] = '					<span id="user-action">';
     $html[] = '						<span id="msg"><a href="' . zotop::url('zotop/msg') . '" target="mainIframe">短消息</a><span id="msg-unread"><a href="' . zotop::url('zotop/msg/default/0') . '" target="mainIframe"><span id="msg-unread-num">0</span>条未读</a></span><b>|</b></span>';
     $html[] = '						<a href="' . zotop::url('zotop/user/changepassword') . '" target="mainIframe">修改我的密码</a><b>|</b>';
     $html[] = '						<a href="' . zotop::url('zotop/login/logout') . '" id="logout" class="confirm {content:\'<h1>您确定要退出登录?</h1>退出登陆后将默认将返回系统登录页面\',yes:\'安全退出\'}">安全退出</a>';
     $html[] = '					</span>';
     $html[] = '				</div>';
     $html[] = '				<div id="navbar">';
     $html[] = '					<ul>';
     $html[] = '						<li><a href="' . zotop::url('zotop/main') . '" target="mainIframe"><span>控制中心</span></a></li>';
     $html[] = '						<li><a href="' . zotop::url('content') . '" target="mainIframe"><span>内容管理</span></a></li>';
     $html[] = '						<li><a href="' . zotop::url('member') . '" target="mainIframe"><span>会员管理</span></a></li>';
     $html[] = '						<li><a href="' . zotop::url('zotop/test') . '" target="mainIframe"><span>系统管理</span></a></li>';
     $html[] = '					</ul>';
     $html[] = '				</div>';
     $html[] = '			</div>';
     $html[] = '		</div>';
     $html[] = '		<div id="position">';
     $html[] = '		</div>';
     $html[] = '	</div>';
     $html[] = '	<div id="body">';
     $html[] = '		<div id="side">';
     $html[] = '		<div id="side-inner">';
     $html[] = '			<div id="side-header">';
     $html[] = '				<div class="side-block-header">';
     $html[] = '					<div class="side-block-title">应用列表</div>';
     $html[] = '					<div class="side-block-action"><a href="#">管理</a></div>';
     $html[] = '				</div>';
     $html[] = '				<div class="side-block-body">';
     $html[] = '					<ul id="applications">';
     $html[] = '						<li><a href="' . zotop::url('zotop/main') . '" target="mainIframe">控制中心</a></li>';
     $html[] = '						<li><a href="' . zotop::url('zotop/test') . '" target="mainIframe">表单测试</a></li>';
     $html[] = '						<li><a href="' . zotop::url('database') . '" target="mainIframe">数据库管理</a></li>';
     $html[] = '						<li><a href="' . zotop::url('zotop/io') . '" target="mainIframe">文件管理</a></li>';
     $html[] = '					</ul>';
     $html[] = '				</div>';
     $html[] = '				<div class="side-block-footer">';
     $html[] = '				</div>';
     $html[] = '			</div>';
     $html[] = '			<div id="side-body">';
     $html[] = '				<div class="side-block-header">';
     $html[] = '					<div class="side-block-title">内容管理</div>';
     $html[] = '					<div class="side-block-action"><a href="javascript:zotop.frame.side().location.reload();">刷新</a> <a href="#" title="栏目管理">管理</a></div>';
     $html[] = '				</div>';
     $html[] = '			</div>';
     $html[] = '			<div id="side-extra">';
     $html[] = '				<div class="inner">';
     $html[] = '				' . html::iframe('sideIframe', 'about:blank', array('frameborder' => 'no', 'scrolling' => 'auto', 'width' => '100%', 'height' => '100%'));
     $html[] = '				</div>';
     $html[] = '			</div>';
     $html[] = '			<div id="side-footer">';
     $html[] = '				<div>Powered by <a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.name') . ' ' . zotop::config('zotop.version') . '</a></div>';
     $html[] = '			</div>';
     $html[] = '		</div>';
     $html[] = '		</div>';
     $html[] = '		<div id="main">';
     $html[] = '			' . html::iframe('mainIframe', 'about:blank', array('frameborder' => 'no', 'scrolling' => 'auto', 'width' => '100%', 'height' => '100%'));
     $html[] = '		</div>';
     $html[] = '	</div>';
     $html[] = '	<div id="footer">';
     $html[] = '	</div>';
     echo implode("\n", $html);
     page::footer();
 }
Пример #26
0
<div style="padding:4px 15px;">
	<table class="table">
		<tr><td class="w80">程序名称:</td><td><?php 
echo zotop::config('zotop.name') . ' (' . zotop::config('zotop.version') . ') ';
?>
</td></tr>
		<tr><td class="w80">程序设计:</td><td><?php 
echo zotop::config('zotop.author');
?>
</td></tr>
		<tr><td class="w80">程序开发:</td><td><?php 
echo zotop::config('zotop.authors');
?>
</td></tr>
		<tr><td class="w80">官方网站:</td><td><a href="<?php 
echo zotop::config('zotop.homepage');
?>
" target="_blank"><?php 
echo zotop::config('zotop.homepage');
?>
</a></td></tr>
		<tr><td class="w80">安装时间:</td><td><?php 
echo zotop::config('zotop.install.time');
?>
</td></tr>
	</table>
</div>
<div class="zotop-toolbar right"><button class="button zotop-dialog-close">关闭</button></div>
<?php 
$this->bottom();
$this->footer();
Пример #27
0
 public static function theme()
 {
     $theme = zotop::config('site.theme');
     $theme = empty($theme) ? 'default' : $theme;
     return $theme;
 }
Пример #28
0
 public static function config($name, $value = null)
 {
     return zotop::config('blog.' . $name);
 }
Пример #29
0
define('ZOTOP_RUNTIME', ZOTOP . DS . 'runtime');
define('TIME', time());
//加载核心文件
if (file_exists(ZOTOP_RUNTIME . DS . '~runtime.php') && $debug == 'ddd') {
    require ZOTOP_RUNTIME . DS . '~runtime.php';
} else {
    //加载系统核心
    require ZOTOP_LIBRARIES . DS . 'zotop' . DS . 'core' . DS . 'zotop.php';
    //注册别名,自动加载系统库文件
    zotop::register(include ZOTOP_LIBRARIES . DS . 'zotop' . DS . 'library.php');
    zotop::register(include APP_ROOT . DS . 'library.php');
}
//配置的初始化
if (file_exists(ZOTOP_RUNTIME . DS . '~config.php')) {
    zotop::config(include ZOTOP_RUNTIME . DS . '~config.php');
} else {
    zotop::config(include ZOTOP_CONFIG . DS . 'zotop.php');
    zotop::config(include ZOTOP_CONFIG . DS . 'setting.php');
    zotop::config('zotop.database', include ZOTOP_CONFIG . DS . 'database.php');
    zotop::config('zotop.application', include ZOTOP_CONFIG . DS . 'application.php');
    zotop::config('zotop.module', include ZOTOP_CONFIG . DS . 'module.php');
    zotop::config('zotop.router', include ZOTOP_CONFIG . DS . 'router.php');
}
//启动底层系统
zotop::boot();
//hook的初始化
if (is_file(ZOTOP_RUNTIME . DS . '~hook.php')) {
    zotop::load(ZOTOP_RUNTIME . DS . '~hook.php');
} else {
    //生成全局hook文件
}
Пример #30
0
 /**
  * 连接系统默认的数据库
  *
  * @param $config array  数据库参数
  * @return object 数据库连接
  */
 public static function db($config = array())
 {
     if (empty($config)) {
         $config = zotop::config('zotop.database');
     }
     $db = database::instance($config);
     return $db;
 }