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; }
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(); }
public function onDefault() { if (form::isPostBack()) { $post = array(); $post['username'] = request::post('username'); $post['password'] = request::post('password'); $post['logintime'] = time(); $user = zotop::model('zotop.user'); $data = $user->read($post['username'], 'username'); //zotop::dump($data); if ($data == false) { msg::error('登陆失败', zotop::t('账户名称`{$username}`不存在,请检查!', array('username' => $post['username']))); } zotop::user($data); msg::success('登陆成功', '登陆成功,系统正在加载中', 'reload', 2); } if (zotop::user() != null) { zotop::redirect('zotop/index'); } $header['title'] = '用户登录'; $header['js'] = url::module() . '/admin/js/login.js'; $header['body']['class'] = "login"; page::header($header); block::header(array('id' => 'LoginWindow', 'title' => '用户登录')); form::header(array('title' => '', 'description' => '请输入用户名和密码', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('帐 户(U)'), 'name' => 'username', 'value' => zotop::user('username'), 'valid' => 'required:true')); form::field(array('type' => 'password', 'label' => zotop::t('密 码(P)'), 'name' => 'password', 'value' => '')); form::buttons(array('type' => 'submit', 'value' => '登 陆'), array('type' => 'button', 'name' => 'options', 'value' => '选 项')); form::footer(); block::footer(); page::footer(); }
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(); }
public function onDefault() { $header['title'] = '图片库'; page::header($header); page::top(); page::bottom(); page::footer(); }
public function onDefault() { $header['title'] = '侧边条'; $header['body']['class'] = 'side'; page::header($header); echo '<div style="height:600px;">dddd</div>'; page::footer(); }
public function onInfo() { $header['title'] = '控制中心'; page::header($header); page::top(); page::navbar($this->navbar()); page::bottom(); page::footer(); }
public function onInfo() { $header['title'] = '控制中心'; page::header($header); page::top(); page::navbar(array(array('id' => 'main', 'title' => '首页', 'href' => url::build('zotop/index/main')), array('id' => 'info', 'title' => '系统信息', 'href' => url::build('zotop/index/info')))); page::bottom(); page::footer(); }
public function onDefault($status = -1) { $header['title'] = '测试文件系统'; page::header($header); page::top(); echo "<pre>"; //print_r(file::brower(ZOTOP_SYSTEM,'php')); print_r(file::brower(ZOTOP_SYSTEM)); echo "</pre>"; page::footer(); }
public function onDefault() { $tables = $this->db->table()->get(true); $header['title'] = '数据库管理'; page::header($header); page::add('<div id="page" class="clearfix">'); page::add('<div id="side">'); block::header('数据库基本信息'); table::header(); table::row(array('w60' => '数据库名称', '2' => '' . $this->db->config['database'] . '')); table::row(array('w60' => '数据库版本', '2' => '' . $this->db->version(true) . '')); table::row(array('w60' => '数据库大小', '2' => '<b>' . $this->db->size() . '</b> ')); table::row(array('w60' => '数据表个数', '2' => '<b>' . count($tables) . '</b> 个')); table::footer(); block::footer(); page::add('</div>'); page::add('<div id="main">'); page::top(); page::navbar($this->navbar(), 'table'); //zotop::dump($tables); form::header(array('class' => 'ajax')); $column['select'] = '<input name="id" class="selectAll" type="checkbox"/>'; $column['name'] = '数据表名称'; $column['size w60'] = '大小'; $column['Rows w60'] = '记录数'; $column['Engine w60'] = '类型'; $column['Collation w100'] = '整理'; $column['manage view w60'] = '浏览'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($tables as $table) { $size = $table['Data_length'] + $table['Index_length']; $column = array(); $column['select'] = '<input name="id[]" class="select" type="checkbox"/>'; $column['name'] = '<b>' . $table['Name'] . '</b><h5>' . $table['Comment'] . '</h5>'; $column['size w60'] = (string) format::size($size); $column['Rows w60'] = $table['Rows']; $column['Engine w60'] = $table['Engine']; $column['collation w100'] = $table['Collation']; $column['manage view w60'] = '<a href="' . url::build('system/database/table/record') . '">浏览</a>'; $column['manage delete'] = '<a href="' . url::build('system/database/table/delete') . '" class="confirm">删除</a>'; table::row($column); } table::footer(); page::add('<div style="height:200px;"></div>'); form::buttons(array('type' => 'select', 'style' => 'width:180px', 'options' => array('check' => '优化', 'delete' => '删除')), array('type' => 'submit', 'value' => '执行操作')); form::footer(); page::bottom(); page::add('</div>'); page::add('</div>'); page::footer(); }
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(); }
public function onEdit($file) { if (form::isPostBack()) { $content = request::post('source'); msg::success('保存测试', '测试,继续编辑或者返回' . zotop::dump($content, true), 'reload'); } $source = file::read(ROOT . $file); $page['title'] = '文件编辑器'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(array('class' => 'sourceEditor')); form::field(array('type' => 'label', 'label' => zotop::t('文件名称'), 'name' => 'filename', 'value' => $file, 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'source', 'label' => zotop::t('文件内容'), 'name' => 'source', 'value' => $source, 'valid' => 'required:true', 'description' => zotop::t(''))); form::buttons(array('type' => 'submit', 'value' => '保存文件'), array('type' => 'back')); form::footer(); page::bottom(); page::footer(); }
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; }
public function onDefault() { $header['title'] = '用户登录'; $header['js'] = ' $(function(){ $("div.block").show().center().drag(".block-header"); window.onresize=function(){ $("div.block").center(); }; }) '; $header['body']['class'] = "login"; page::header($header); block::header(array('id' => 'LoginWindow', 'title' => '用户登录')); form::header(array('title' => '', 'description' => '请输入用户名和密码', 'class' => 'ajax')); form::add(array('type' => 'text', 'label' => t('帐 户(U)'), 'name' => 'username', 'value' => '')); form::add(array('type' => 'password', 'label' => t('密 码(P)'), 'name' => 'password', 'value' => '')); form::buttons(array('type' => 'submit', 'value' => '登 陆'), array('type' => 'button', 'name' => 'options', 'value' => '选 项')); form::footer(); block::footer(); page::footer(); }
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; }
public function onDefault() { $header['title'] = '测试表单'; page::header($header); page::top(); page::navbar(array(array('id' => 'form', 'title' => '测试表单', 'href' => url::build('system/test')), array('id' => 'info', 'title' => '系统信息', 'href' => url::build('system/index/info'))), 'form'); form::header(array('class' => 'ajax')); block::header(array('title' => '基本信息', 'action' => 'more')); form::add(array('type' => 'checkbox', 'label' => t('多选框'), 'name' => 'test1', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('1', '2'), 'description' => '最多只允许选择三项')); form::add(array('type' => 'checkbox', 'label' => t('多选框'), 'name' => 'test11', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1'), 'value' => array('1', '2'), 'class' => 'block', 'description' => '最多只允许选择三项')); form::add(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test22', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => array('2', '4'), 'description' => '提示信息')); form::add(array('type' => 'select', 'label' => '下拉列表', 'name' => 'test2', 'options' => array('1' => 'a1', '2' => 'a2', '3' => 'a1', '4' => 'a2', '5' => 'a1', '6' => 'a2'), 'value' => '2', 'description' => '提示信息')); form::add(array('type' => 'text', 'label' => '文本框', 'name' => 'test3', 'value' => '2的飞洒的发生地', 'description' => '提示信息')); block::footer(); block::header(array('title' => '高级信息', 'action' => 'more')); form::add(array('type' => 'image', 'label' => '上传图片', 'name' => 'test4', 'value' => '2的飞洒的发生地', 'valid' => 'required:true', 'description' => '提示信息')); form::add(array('type' => 'textarea', 'label' => '文本框', 'name' => 'test32', 'value' => '2的飞洒的发生地', 'valid' => 'required:true,maxlength:500', 'description' => '提示信息')); form::add(array('label' => '组合', 'type' => 'group', 'fields' => array(array('label' => '年', 'name' => 'year', 'type' => 'text'), array('label' => '月', 'name' => 'month', 'type' => 'text'), array('label' => '日', 'name' => 'day', 'type' => 'text')), 'description' => '生成一个复合控件')); block::footer(); form::buttons(array('type' => 'submit'), array('type' => 'reset')); form::footer(); page::bottom(); page::footer(); }
public function onPhpInfo() { ob_start(); phpinfo(); $phpinfo = ob_get_contents(); ob_clean(); if (preg_match('/<body><div class="center">([\\s\\S]*?)<\\/div><\\/body>/', $phpinfo, $match)) { $phpinfo = $match[1]; } $phpinfo = str_replace('class="e"', 'style="color:#ff6600;"', $phpinfo); $phpinfo = str_replace('class="v"', '', $phpinfo); $phpinfo = str_replace('<table', '<table class="table list" style="table-layout:fixed;"', $phpinfo); $phpinfo = str_replace('<tr class="h">', '<tr class="title">', $phpinfo); $phpinfo = preg_replace('/<a href="http:\\/\\/www.php.net\\/"><img(.*)alt="PHP Logo" \\/><\\/a><h1 class="p">(.*)<\\/h1>/', "<h1>\\2</h1>", $phpinfo); $page['title'] = 'PHP探针'; page::header($page); page::top(); page::navbar($this->navbar()); echo $phpinfo; page::bottom(); page::footer(); }
public function header() { $this->body = array_merge((array) $this->body, array('class' => 'side')); $this->addScript('$common/js/zotop.side.js'); return parent::header(); }
public function onBackup() { $header['title'] = '数据库管理 <i>></i> 数据表设置:' . $tablename . ' '; page::header($header); page::top(); page::navbar($this->navbar(), 'backup'); form::header(); form::field(array('type' => 'select', 'options' => array('all' => '全部数据', 'custom' => '自定义备份'), 'name' => 'type', 'label' => '备份类型', 'value' => 'all', 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'length', 'label' => '分卷长度', 'value' => '2048', 'description' => '分卷备份时文件长度限制,单位:<b>KB</b>', 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'filename', 'label' => '备份文件名', 'value' => '', 'valid' => '{required:true}')); form::buttons(array('type' => 'submit'), array('type' => 'button', 'value' => '返回前页', 'class' => 'back', 'onclick' => 'history.go(-1);')); form::footer(); page::bottom(); page::footer(); }
public function onAdd() { if (form::isPostBack()) { $module = zotop::model('zotop.module'); $post = form::post(); $result = $module->insert($post); if ($result) { msg::success('保存成功', '添加成功,正在刷新页面,请稍后……', zotop::url('zotop/module')); } } $page['title'] = '新建模块'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(); block::header('基本信息'); form::field(array('type' => 'text', 'label' => '模块ID', 'name' => 'id', 'value' => $data['id'], 'valid' => 'required:true,minlength:3,maxlength:32,remote:"' . zotop::url('zotop/module/checkid') . '"', 'description' => '允许使用数字、英文字符(不区分大小写)或者下划线,不允许使用其它特殊字符,3~32位')); form::field(array('type' => 'text', 'label' => '模块名称', 'name' => 'name', 'value' => $data['name'], 'valid' => 'required:true', 'description' => '')); form::field(array('type' => 'radio', 'options' => array('system' => '核心模块', 'plugin' => '插件模块'), 'label' => '模块类型', 'name' => 'type', 'value' => $data['type'], 'valid' => 'required:true', 'description' => '')); form::field(array('type' => 'text', 'label' => '访问地址', 'name' => 'url', 'value' => $data['url'], 'valid' => 'url:true', 'description' => '可以为模块绑定访问域名,如:http://bbs.***.com/ 如果不绑定域名,请留空')); form::field(array('type' => 'textarea', 'label' => '模块说明', 'name' => 'description', 'value' => $data['description'], 'valid' => '', 'description' => '')); block::footer(); block::header('开发者信息'); form::field(array('type' => 'text', 'label' => '开发者', 'name' => 'author', 'value' => $data['author'], 'valid' => 'required:true', 'description' => '')); form::field(array('type' => 'text', 'label' => '电子邮件', 'name' => 'email', 'value' => $data['email'], 'valid' => 'required:true,email:true', 'description' => '')); form::field(array('type' => 'text', 'label' => '官方网站', 'name' => 'site', 'value' => $data['site'], 'valid' => 'required:true', 'description' => '')); block::footer(); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); page::bottom(); page::footer(); }
public static function header($header = array()) { $header['js']['dialog'] = url::common() . '/js/zotop.dialog.js'; $header['body']['class'] = 'dialog'; parent::header($header); }
public function onEdit($tablename, $fieldname) { if (form::isPostBack()) { $field = array(); $field['name'] = request::post('name'); $field['length'] = request::post('len'); $field['type'] = request::post('type'); $field['collation'] = request::post('collation'); $field['null'] = request::post('null'); $field['default'] = request::post('default'); $field['attribute'] = request::post('attribute'); $field['extra'] = request::post('extra'); $field['comment'] = request::post('comment'); $field['position'] = request::post('position'); $fieldname = request::post('fieldname'); $result = zotop::db()->table($tablename)->field($fieldname)->rename($field['name']); $result = zotop::db()->table($tablename)->modify($field); if ($result) { msg::success('修改成功', '<h2>字段修改成功</h2>', form::referer()); } } $tables = zotop::db()->tables(true); $table = $tables[$tablename]; $fields = array(); if (isset($table)) { $fields = zotop::db()->table($tablename)->fields(true); } $field = $fields[$fieldname]; if (!isset($field)) { zotop::error(-10, '字段不存在,请勿修改浏览器参数'); } $positions = array(); $positions[-1] = '位于表头'; if ($fields) { foreach ($fields as $key => $val) { $positions[$key] = '位于 ' . $key . ' 之后'; } } $positions[0] = ' '; $header['title'] = '<a href="' . zotop::url('zotop/database') . '">数据库管理</a> <i>></i> <a href="' . zotop::url('system/database/fields/', array('table' => $tablename)) . '">数据表 [ ' . $tablename . ' ] </a> <i>></i> 字段修改'; page::header($header); page::top(); page::navbar($this->navbar($tablename), 'edit'); form::header(); form::field(array('type' => 'hidden', 'name' => 'fieldname', 'label' => '字段名称', 'value' => $field['name'], 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'name', 'label' => '字段名称', 'value' => $field['name'], 'valid' => '{required:true}', 'description' => '请输入字段的名称,3到32位,请勿使用特殊字符')); form::field(array('type' => 'text', 'name' => 'type', 'label' => '字段类型', 'value' => $field['type'], 'valid' => '{required:true}')); form::field(array('type' => 'text', 'name' => 'len', 'label' => '长度/值', 'value' => $field['length'], 'valid' => '{number:true,min:1}', 'description' => '请输入字段的长度,如果字段无须定义长度,请保持空值')); form::field(array('type' => 'hidden', 'name' => 'collation', 'label' => '整理', 'value' => $field['collation'], 'valid' => '', 'description' => '默认使用 <b>utf8_general_ci</b>: Unicode (多语言), 不区分大小写')); form::field(array('type' => 'select', 'options' => array('' => ' ', 'UNSIGNED' => 'UNSIGNED', 'UNSIGNED ZEROFILL' => 'UNSIGNED ZEROFILL', 'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP'), 'name' => 'attribute', 'label' => '属性', 'value' => $field['attribute'], 'valid' => '')); form::field(array('type' => 'select', 'options' => array('' => 'NULL', 'NOT NULL' => 'NOT NULL'), 'name' => 'null', 'label' => 'null', 'value' => $field['null'], 'valid' => '')); form::field(array('type' => 'text', 'name' => 'default', 'label' => '默认值', 'value' => $field['default'], 'valid' => '', 'description' => '如果需要可以为字段设置一个默认值')); form::field(array('type' => 'select', 'options' => array('' => '', 'AUTO_INCREMENT' => 'AUTO_INCREMENT'), 'name' => 'extra', 'label' => '额外', 'value' => $field['extra'], 'valid' => '', 'description' => '设置为自动增加:<b>AUTO_INCREMENT</b>时,该字段必须为数字类型')); form::field(array('type' => 'text', 'name' => 'comment', 'label' => '注释', 'value' => $field['comment'], 'valid' => '')); form::field(array('type' => 'select', 'name' => 'position', 'options' => $positions, 'label' => zotop::t('字段位置'), 'value' => $position, 'description' => '')); form::buttons(array('type' => 'submit'), array('type' => 'reset')); form::footer(); page::bottom(); page::footer(); }
public function onEdit($id) { $role = zotop::model('zotop.role'); $role->id = (int) $id; if (form::isPostBack()) { $post = form::post(); $result = $role->update($post); if ($result) { msg::success('操作成功', '保存成功,正在刷新页面,请稍后……', zotop::url('zotop/role')); } } $fields = $role->read(); $page['title'] = '编辑系统角色'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(); form::field(array('type' => 'text', 'label' => '角色名称', 'name' => 'name', 'value' => $fields['name'], 'valid' => 'required:true,maxlength:50', 'description' => zotop::t(''))); form::field(array('type' => 'textarea', 'label' => '角色说明', 'name' => 'description', 'value' => $fields['description'], 'valid' => '', 'description' => '')); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); page::bottom(); page::footer(); }
<!-- __ / _) .-^^^-/ / __/ / <__.|_|-|_| T-REX FRAMEWORK 3.0 * Index Page: Here are a example of T-Rex in real world application. --> <?php require_once 'controller/config.php'; $p = new page(); $p->header('T-Rex Framework'); ?> <div class="row" style="margin-bottom: 1%;"> <div class="col-md-12"> <div class="col-md-6"> <p style="text-align: center;border: 1px solid #999;padding: 4px;">T-Rex comes with Bootstrap, JQuery, FontAwesome and <b>ready for use in AWS</b>.</p> <p style="text-align: justify"> The structure of T-Rex is pretty simple, all pages have a MVC model. Like this one.<br> Using the class page() you can easily access models, views and controllers.<br> Each of them need to follow a pattern, like:<br> <ul> <li>To add a <u>model</u> on index, called <b>menu</b>: <ul> <li> You need to go to <u>model/index</u> folder and add a file with the name <b>index_menu.php</b>. </li> <li>
public function onChangeInfo($id) { $user = zotop::model('zotop.user'); $user->id = (int) $id; if (form::isPostBack()) { $post = form::post(); $update = $user->update($post, $user->id); if ($update) { msg::success('保存成功', '资料设置成功,正在刷新页面,请稍后……', zotop::url('zotop/user')); } } $data = $user->read(); $data['updatetime'] = TIME; $page['title'] = '修改我的资料'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(); block::header('账户信息'); form::field(array('type' => 'label', 'label' => zotop::t('账户名称'), 'name' => 'username', 'value' => $data['username'], 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'text', 'label' => zotop::t('安全问题'), 'name' => 'question', 'value' => $data['question'], 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'text', 'label' => zotop::t('安全答案'), 'name' => 'answer', 'value' => $data['answer'], 'valid' => '', 'description' => zotop::t(''))); block::footer(); block::header('个人信息'); form::field(array('type' => 'text', 'label' => zotop::t('真实姓名'), 'name' => 'name', 'value' => $data['name'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'radio', 'options' => array('男' => '男', '女' => '女'), 'label' => zotop::t('性别'), 'name' => 'gender', 'value' => $data['gender'], 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'image', 'label' => zotop::t('头像'), 'name' => 'image', 'value' => $data['image'], 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'text', 'label' => zotop::t('电子邮件'), 'name' => 'email', 'value' => $data['email'], 'valid' => 'required:true,email:true', 'description' => zotop::t(''))); form::field(array('type' => 'textarea', 'label' => zotop::t('个人签名'), 'name' => 'sign', 'value' => $data['sign'], 'valid' => '', 'description' => zotop::t(''))); form::field(array('type' => 'hidden', 'label' => zotop::t('更新时间'), 'name' => 'updatetime', 'value' => $data['updatetime'], 'valid' => '', 'description' => zotop::t(''))); block::footer(); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); page::bottom(); page::footer(); }
<?php include "system/external_construct_page.php"; $page = new page($pdo); $page->header($title); $page->footer();
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(); }
<?php include "system/external_construct_page.php"; $id = clear("id"); //nacteni dat o kategorii ------------------------------------------------------ $category = new category($pdo, $id); if (!$category->id) { go_out(); } $page = new page($pdo); $page->add_description($category->description); $page->header($category->title); $page->footer();
public function header() { $this->body = array_merge((array) $this->body, array('class' => 'dialog')); $this->addScript('$common/js/zotop.dialog.js'); parent::header(); }
public function onDefault($dir = '') { $path = ROOT . DS . trim($dir, DS); $path = path::clean($path); $folders = dir::folders($path); $files = dir::files($path); $fileext = array('php', 'css', 'js', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'psd', 'html', 'htm', 'tpl', 'rar', 'zip', 'mp3'); $page['title'] = '文件管理器'; page::header($page); page::add('<div id="page" class="clearfix">'); page::add('<div id="main">'); page::add('<div id="main-inner">'); page::top(); page::navbar($this->navbar(), 'default'); $column = array(); $column['select'] = ''; $column['name'] = '名称'; $column['type'] = '类型'; $column['size w60'] = '大小'; $column['atime w120'] = '创建时间'; $column['mtime w120'] = '修改时间'; $column['manage rename w80'] = '重命名'; $column['manage edit w80'] = '编辑'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($folders as $folder) { $column = array(); $column['select w20 center'] = html::image(url::theme() . '/image/fileext/folder.gif'); $column['name'] = '<a href="' . zotop::url('filemanager/index/default', array('dir' => $dir . DS . $folder)) . '"><b>' . $folder . '</b></a>'; $column['type w60'] = '文件夹'; $column['size w60'] = '--'; $column['atime w120'] = time::format(@fileatime($path . DS . $folder)); $column['mtime w120'] = time::format(@filemtime($path . DS . $folder)); $column['manage rename w80'] = '<a>重命名</a>'; $column['manage edit w80'] = '<a class="disabled">编辑</a>'; $column['manage delete'] = '<a>删除</a>'; table::row($column); } foreach ($files as $file) { $column = array(); $column['select w20 center'] = in_array(file::ext($file), $fileext) ? html::image(url::theme() . '/image/fileext/' . file::ext($file) . '.gif') : html::image(url::theme() . '/image/fileext/unknown.gif'); $column['name'] = '<a href="' . zotop::url('filemanager/index/default', array('dir' => $dir . DS . $file)) . '"><b>' . $file . '</b></a>'; $column['type w60'] = '文件'; $column['size w60'] = format::byte(@filesize($path . DS . $file)); $column['atime w120'] = time::format(@fileatime($path . DS . $file)); $column['mtime w120'] = time::format(@filemtime($path . DS . $file)); $column['manage rename w80'] = '<a>重命名</a>'; $column['manage edit w80'] = '<a href="' . zotop::url('filemanager/file/edit', array('filename' => $dir . DS . $file, 'dir' => '***')) . '">编辑</a>'; $column['manage delete'] = '<a>删除</a>'; table::row($column); } table::footer(); page::bottom(); page::add('</div>'); page::add('</div>'); page::add('<div id="side">'); block::header('快捷操作'); echo '<ul class="list">'; echo '<li class="file"><a href="' . zotop::url('zotop/file/newfile') . '" class="dialog">新建文件</a></li>'; echo '<li class="folder"><a href="' . zotop::url('zotop/file/newfolder') . '" class="dialog">新建文件夹</a></li>'; echo '<li class="folder"><a href="' . zotop::url('zotop/file/upload') . '" class="dialog">文件上传</a></li>'; echo '</ul>'; block::footer(); block::header('其他位置'); echo '<ul class="list">'; echo '<li class="root"><a>根目录</a></li>'; echo '<li class="root"><a>模板目录</a></li>'; echo '<li class="root"><a>模块目录</a></li>'; echo '<li class="root"><a>缓存目录</a></li>'; echo '</ul>'; block::footer(); page::add('</div>'); page::add('</div>'); page::footer(); }