本文整理汇总了PHP中zotop类的典型用法代码示例。如果您正苦于以下问题:PHP zotop类的具体用法?PHP zotop怎么用?PHP zotop使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了zotop类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: codemirror
function codemirror($attrs)
{
$url = zotop::module('codemirror', 'url');
$options = new stdClass();
$options->path = $url . '/codemirror/js/';
$options->parserfile = array('parsexml.js');
$options->stylesheet = array($url . '/codemirror/css/xmlcolors.css');
$options->height = is_numeric($attrs['height']) ? $attrs['height'] . 'px' : $attrs['height'];
$options->width = is_numeric($attrs['width']) ? $width . 'px' : $attrs['width'];
$options->continuousScanning = 500;
$options->autoMatchParens = true;
if ($attrs['linenumbers'] !== false) {
$options->lineNumbers = true;
$options->textWrapping = false;
}
if ($attrs['tabmode'] == '') {
$options->tabMode = 'shift';
}
$html = array();
$html[] = html::script($url . '/codemirror/js/codemirror.js');
$html[] = html::stylesheet($url . '/codemirror/css/codemirror.css');
$html[] = ' ' . field::textarea($attrs);
$html[] = '<script type="text/javascript">';
$html[] = ' var editor = CodeMirror.fromTextArea("' . $attrs['name'] . '", ' . json_encode($options) . ');';
$html[] = '$(function(){';
$html[] = ' $("form").submit(function(){';
$html[] = ' $("textarea[name=+' . $attrs['name'] . '+]").val(editor.getCode());';
$html[] = ' });';
$html[] = '})';
$html[] = '</script>';
return implode("\n", $html);
}
示例2: __construct
public function __construct()
{
if (!zotop::user()) {
zotop::redirect('zotop/login');
}
$this->__init();
}
示例3: msg_useraction
function msg_useraction()
{
?>
<span id="msg">
<a href="<?php
echo zotop::url('msg/list');
?>
" target="mainIframe">短消息</a>
<span id="msg-unread">
<a href="<?php
echo zotop::url('msg/list/unread');
?>
" target="mainIframe"><span id="msg-unread-num">0</span>条未读</a>
</span>
<b>|</b>
</span>
<script>
//获取未读消息数目
function getUnreadMsg(){
var url = "<?php
echo zotop::url('msg/list/unread');
?>
";
$.get(url,'',function(msg){
msg.num = parseInt(msg.num);
$('#msg-unread-num').html(msg.num);
},'json');
};
//定时获取未读短消息数目
(function(){
setInterval(getUnreadMsg,10000);
})();
</script>
<?php
}
示例4: onDefault
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();
}
示例5: onSide
public function onSide()
{
$header['title'] = '系统管理';
$header['js'][] = url::module() . '/admin/js/side.js';
$header['body']['class'] = 'side';
page::header($header);
block::header(array('title' => '系统工具', 'class' => 'show'));
echo '<ul id="applications" class="list">';
echo ' <li><a href="' . zotop::url('zotop/system/reboot') . '" target="mainIframe">系统关闭与重启</a></li>';
echo ' <li><a href="' . zotop::url('zotop/system/clearcahce') . '" target="mainIframe">缓存清理</a></li>';
echo ' <li><a href="' . zotop::url('zotop/setting') . '" target="mainIframe">系统设置</a></li>';
echo ' <li><a href="' . zotop::url('zotop/database') . '" target="mainIframe">数据库备份与还原</a></li>';
echo ' <li><a href="' . zotop::url('database') . '" target="mainIframe">数据库管理</a></li>';
echo ' <li><a href="' . zotop::url('filemanager') . '" target="mainIframe">文件管理</a></li>';
echo '</ul>';
block::footer();
block::header(array('title' => '模块管理', 'class' => 'show'));
echo '<ul class="list">';
echo ' <li><a href="' . zotop::url('zotop/module') . '" target="mainIframe">模块管理</a></li>';
echo ' <li><a href="' . zotop::url('zotop/module/add') . '" target="mainIframe">模块添加</a></li>';
echo ' <li><a href="' . zotop::url('zotop/module/install') . '" target="mainIframe">模块安装</a></li>';
echo '</ul>';
block::footer();
block::header(array('title' => '管理员设置', 'class' => 'show'));
echo '<ul class="list">';
echo ' <li><a href="' . zotop::url('zotop/user') . '" target="mainIframe">系统用户管理</a></li>';
echo ' <li><a href="' . zotop::url('zotop/usergroup') . '" target="mainIframe">系统用户组管理</a></li>';
echo ' <li><a href="' . zotop::url('zotop/role') . '" target="mainIframe">系统角色管理</a></li>';
echo '</ul>';
block::footer();
//echo '<div style="height:600px;"></div>';
page::footer();
}
示例6: __construct
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)));
}
}
示例7: editAction
public function editAction($tablename)
{
if (form::isPostBack()) {
$tablename = request::post('tablename');
$name = request::post('name');
$comment = request::post('comment');
$primary = request::post('primary');
if (strtolower($tablename) !== strtolower($name)) {
$rename = zotop::db()->table($tablename)->rename($name);
}
if ($comment !== NULL) {
$comment = zotop::db()->table($name)->comment($comment);
}
if ($primary) {
$primary = zotop::db()->table($name)->primary($primary);
}
$this->success('数据表设置成功,正在刷新页面,请稍后……', zotop::url('database/table'));
}
$db = zotop::db();
$database = $db->config();
$tables = $db->tables(true);
$table = $tables[$tablename];
if (!isset($table)) {
$this->error(zotop::t('数据表{$tablename}不存在', array('tablename' => $tablename)));
}
$page = new dialog();
$page->title = '数据库管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 编辑:' . $tablename;
$page->set('database', $database);
$page->set('table', $table);
$page->display();
}
示例8: onDefault
public function onDefault()
{
$header['title'] = '控制面板';
$header['js'][] = url::module() . '/admin/js/side.js';
$header['body']['class'] = 'side';
page::header($header);
block::header(array('title' => '应用列表', 'action' => '<a href="#" title="栏目管理">管理</a>'));
echo '<ul id="applications" class="list">';
echo ' <li><a href="' . zotop::url('zotop/main') . '" target="mainIframe">控制中心</a></li>';
echo ' <li><a href="' . zotop::url('zotop/test') . '" target="mainIframe">表单测试</a></li>';
echo ' <li><a href="' . zotop::url('database') . '" target="mainIframe">数据库管理</a></li>';
echo ' <li><a href="' . zotop::url('filemanager') . '" target="mainIframe">文件管理</a></li>';
echo '</ul>';
block::footer();
block::header(array('title' => '内容管理', 'action' => '<a href="javascript:zotop.frame.side().location.reload();">刷新</a> <a href="#" title="栏目管理">管理</a>'));
echo '<ul class="list">';
echo ' <li><a href="' . zotop::url('zotop/main') . '" target="mainIframe">控制中心</a></li>';
echo ' <li><a href="' . zotop::url('zotop/test') . '" target="mainIframe">表单测试</a></li>';
echo ' <li><a href="' . zotop::url('database') . '" target="mainIframe">数据库管理</a></li>';
echo ' <li><a href="' . zotop::url('filemanager') . '" target="mainIframe">文件管理</a></li>';
echo '</ul>';
block::footer();
//echo '<div style="height:600px;"></div>';
page::footer();
}
示例9: theme
public static function theme()
{
//系统默认返回的主题为system
$theme = zotop::config('system.theme');
$theme = empty($theme) ? 'system' : $theme;
return $theme;
}
示例10: actionDelete
public function actionDelete($tablename)
{
$delete = zotop::db()->table($tablename)->drop();
if (!$delete) {
msg::error(zotop::t('删除数据表{$tablename}失败', array('tablename' => $tablename)));
}
msg::success('删除成功', zotop::url('database/table'));
}
示例11: __construct
public function __construct()
{
$this->db = zotop::db();
//数据库
if (!user::isLogin()) {
//url::redirect('system/login');
}
}
示例12: actionDelete
public function actionDelete($id)
{
$file = zotop::model('zotop.file');
$delete = $file->delete($id);
if ($delete) {
msg::success('删除成功', request::referer());
}
}
示例13: hash
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;
}
示例14: onDefault
public function onDefault()
{
$db = zotop::db();
if ($db->connect()) {
zotop::redirect('database/table');
}
msg::error('连接数据库失败', '请检查数据库配置是否正确');
}
示例15: actionIndex
public function actionIndex()
{
$db = zotop::db();
if ($db->connect()) {
zotop::redirect(zotop::url('database/table'));
}
msg::error('连接数据库失败,请检查数据库配置是否正确');
}