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(); }
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 onSend() { $header['title'] = '发送短消息'; dialog::header($header); form::header(array('title' => '', 'description' => '请输入收信人的账户并输入短消息内容', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('收信人'), 'name' => 'sendto', 'value' => '', 'description' => '请输入收信人的账户名称,多个账户之间请用’逗号‘隔开')); form::field(array('type' => 'textarea', 'label' => zotop::t('内 容'), 'name' => 'content', 'value' => '')); form::buttons(array('type' => 'submit', 'value' => '发 送'), array('type' => 'button', 'name' => 'close', 'value' => '取消', 'class' => 'zotop-dialog-close')); form::footer(); dialog::footer(); }
public function onBing() { $header['title'] = 'Bing搜索'; dialog::header($header); dialog::navbar($this->navbar(), 'bing'); form::header(array('title' => '', 'description' => '<span class="zotop-tip">请先搜索图片,然后插入</span>')); dialog::add(html::iframe('images', 'about:blank', array('width' => '100%', 'style' => 'width:100%;height:200px;'))); form::buttons(array('id' => 'UploadImages', 'type' => 'submit', 'value' => '插入图片'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close')); form::footer(); dialog::footer(); }
public function onImage() { $header['title'] = '上传图片'; $header['js'][] = url::module() . '/admin/js/upload.js'; dialog::header($header); form::header(array('title' => '', 'description' => '', 'class' => 'ajax')); form::add(array('type' => 'text', 'label' => t('图片地址'), 'name' => 'image', 'value' => 'http://www.baidu.com/logo.gif', 'description' => '请输入图片地址测试赋值')); form::add(array('type' => 'textarea', 'label' => t('图片说明'), 'name' => 'content', 'value' => '')); form::buttons(array('id' => 'UploadImage', 'type' => 'button', 'value' => '上传图片'), array('type' => 'button', 'value' => '取消', 'class' => 'zotop-dialog-close')); form::footer(); dialog::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 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 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 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(); }
$this->navbar(); ?> <style type="text/css"> </style> <?php form::header(); $column = array(); $column['status w30 center'] = '状态'; $column['title'] = '名称'; $column['tablename'] = '数据表名称'; $column['manage field'] = '字段管理'; $column['manage status'] = '状态'; $column['manage edit'] = '编辑'; $column['manage delete'] = '删除'; table::header('list sortable', $column); foreach ($models as $row) { $column = array(); $column['status w30 center'] = '<input name="id[]" type="hidden" value="' . $row['id'] . '"/><span class="zotop-icon zotop-icon-status' . (int) $row['status'] . '"></span>'; $column['title'] .= '<a href="' . zotop::url('content/field/index/' . $row['id']) . '"><b>' . $row['name'] . '</b></a><h5>' . $row['description'] . '</h5>'; $column['tablename w300'] = $row['tablename']; $column['manage field'] = '<a href="' . zotop::url('content/field/index/' . $row['id']) . '">字段管理</a>'; $column['manage status'] = (int) $row['status'] ? '<a href="' . zotop::url('content/model/status/' . $row['id'] . '/0') . '" class="confirm">禁用</a>' : '<a href="' . zotop::url('content/model/status/' . $row['id'] . '/1') . '" class="confirm">启用</a>'; $column['manage edit'] = '<a href="' . zotop::url('content/model/edit/' . $row['id']) . '">修改</a>'; $column['manage delete'] = '<a href="' . zotop::url('content/model/delete/' . $row['id']) . '" class="confirm">删除</a>'; table::row($column); } table::footer(); form::buttons(array('type' => 'submit', 'value' => '保存排序'), array('type' => 'back')); form::footer(); $this->bottom(); $this->footer();
return false; } $(function(){ $('#saveback').click(function(){ content_postform_submit('saveback'); }); $('#savedraft').click(function(){ content_postform_submit('savedraft'); }); }); </script> <style type="text/css"> table.field td.field-side{} </style> <?php form::header(array('action' => zotop::url('content/content/save'))); form::field(array('type' => 'hidden', 'name' => 'id', 'label' => '编号', 'value' => $data['id'], 'description' => '')); form::field(array('type' => 'hidden', 'name' => 'categoryid', 'label' => '栏目编号', 'value' => $data['categoryid'], 'description' => '')); form::field(array('type' => 'hidden', 'name' => 'modelid', 'label' => '模型编号', 'value' => $data['modelid'], 'description' => '')); foreach ($fields as $field) { form::field($field); } form::field(array('type' => 'template', 'name' => 'template', 'label' => '模板设置', 'value' => $data['template'], 'valid' => '')); form::field(array('type' => 'time', 'name' => 'createtime', 'label' => '发布时间', 'value' => $data['createtime'], 'valid' => '')); form::field(array('type' => 'radio', 'options' => array(-50 => zotop::t('草稿'), 0 => zotop::t('等待审核'), 1 => zotop::t('通过审核'), 100 => zotop::t('发布')), 'name' => 'status', 'label' => '默认状态', 'value' => $data['status'], 'valid' => '')); form::field(array('type' => 'radio', 'options' => array(0 => zotop::t('允许'), -1 => zotop::t('不允许')), 'name' => 'comment', 'label' => '评论', 'value' => (int) $data['comment'] >= 0 ? 0 : -1, 'valid' => '')); form::buttons(array('type' => 'submit', 'id' => 'submit', 'value' => zotop::t('保存')), array('type' => 'submit', 'id' => 'savedraft', 'value' => zotop::t('保存为草稿')), array('type' => 'submit', 'id' => 'saveback', 'value' => zotop::t('保存并返回'))); form::footer(); $this->bottom(); $this->footer();
//$column['default w100'] = $field['default']; //$column['comment'] = $field['comment']; $column['manage pri'] = '<a href="' . zotop::url('database/field/primaryKey', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为主键?</h2>\'}">主键</a>'; $column['manage index'] = '<a href="' . zotop::url('database/field/addIndex', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要索引该字段?</h2>\'}">索引</a>'; $column['manage unique'] = '<a href="' . zotop::url('database/field/unique', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为唯一?</h2>\'}">唯一</a>'; if (stripos((string) $field['type'], 'varchar') !== false || stripos((string) $field['type'], 'text') !== false) { $column['manage fulltext'] = '<a href="' . zotop::url('database/field/fulltext', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm {content:\'<h2>确定要将该字段设置为全文索引?</h2>\'}">全文</a>'; } else { $column['manage fulltext'] = '<a class="disabled">全文</a>'; } $column['manage edit'] = '<a href="' . zotop::url('database/field/edit', array('table' => $tablename, 'field' => $field['name'])) . '" class="dialog">修改</a>'; $column['manage delete'] = '<a href="' . zotop::url('database/field/delete', array('table' => $tablename, 'field' => $field['name'])) . '" class="confirm">删除</a>'; table::row($column, 'select'); } table::footer(); form::buttons(array('type' => 'submit', 'value' => '浏览选中项')); form::footer(); $this->bottom(); ?> </div> </div> <div id="side"> <?php block::header('数据表信息'); table::header(); table::row(array('w60 bold' => '名称', '2' => '' . $table['name'] . '')); table::row(array('w60 bold' => '大小', '2' => '' . format::byte($table['size']) . '')); table::row(array('w60 bold' => '记录数', '2' => '<b>' . $table['rows'] . '</b> ')); table::row(array('w60 bold' => '整理', '2' => '' . $table['collation'] . '')); table::row(array('w60 bold' => '创建时间', '2' => '' . $table['createtime'] . '')); table::row(array('w60 bold' => '更新时间', '2' => '' . $table['updatetime'] . ''));
form::header(array('valid' => 'false', 'class' => 'list', 'action' => zotop::url('system/file/action'))); $column = array(); $column['select'] = html::checkbox(array('name' => 'table', 'class' => 'selectAll')); $column['w40 center'] = '图标'; $column['name'] = '名称'; $column['user_name'] = '用户名'; //$column['type'] = '类型'; $column['size w60'] = '大小'; $column['atime w120'] = '创建时间'; table::header('list', $column); foreach ($files as $file) { $column = array(); $column['select'] = html::checkbox(array('name' => 'id[]', 'value' => $file['id'], 'class' => 'select')); $column['center w40'] = $file['type'] == 'image' ? '<div class="image">' . html::image($file['path'], array('style' => 'display:none;')) . '</div>' : '<div class="zotop-icon zotop-icon-file ' . file::ext($file['path']) . '"></div>'; $column['name'] = '<div><b>' . $file['name'] . '</b></div>'; $column['name'] .= '<h5>'; $column['name'] .= '<a href="' . zotop::url('system/file/down/' . $file['id']) . '">下载</a>'; $column['name'] .= ' <a href="' . zotop::url('system/file/edit/' . $file['id']) . '" class="dialog">编辑</a>'; $column['name'] .= ' <a href="' . zotop::url('system/file/delete/' . $file['id']) . '" class="confirm">删除</a>'; $column['name'] .= '</h5>'; $column['user_name w100'] = '<a><b>' . $file['user_username'] . '</b></a><div class="textflow w100">' . $file['user_name'] . '</div>'; //$column['type w60'] = ''.$file['type'].''; $column['size w60'] = '' . format::byte($file['size']) . ''; $column['atime w120'] = '' . time::format($file['createtime']) . ''; table::row($column); } table::footer(); form::buttons(array('type' => 'submit', 'value' => '永久删除')); form::footer($pagination); $this->bottom(); $this->footer();
$column = array(); $column['select'] = html::checkbox(array('name' => 'table', 'class' => 'selectAll')); $column['order w30 center'] = '权重'; $column['status w30 center'] = '状态'; $column['title'] = '名称'; $column['model w60 center'] = '类型'; $column['category w100 center'] = '栏目名称'; $column['creator w150'] = '发布者/发布时间'; $column['manage edit'] = '编辑'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($contents as $row) { $column = array(); $column['select'] = html::checkbox(array('name' => 'id[]', 'value' => $row['id'], 'class' => 'select')); $column['order w30 center'] = $row['order'] ? '<span class="red important">' . $row['order'] . '</span>' : '0'; $column['status w30 center'] = '<span class="zotop-icon zotop-icon-status' . (int) $row['status'] . '"></span>'; $column['title'] .= $row['link'] ? '<span class="zotop-icon zotop-icon-link" title="' . zotop::t('链接') . '"></span>' : ''; $column['title'] .= $row['image'] ? '<span class="zotop-icon zotop-icon-image" title="' . zotop::t('图片') . '"></span>' : ''; $column['title'] .= '<span class="title textflow"><a href="' . zotop::url('content/content/preview/' . $row['id']) . '" ' . html::attributes('style', $row['style']) . ' target="_blank">' . $row['title'] . '</a></span>'; $column['model w60 center'] = isset($models[$row['modelid']]) ? '<div class="w60 textflow">' . $models[$row['modelid']]['title'] . '</div>' : '--'; $column['category w100 center'] = isset($categories[$row['categoryid']]) ? '<div class="w100 textflow"><a>' . $categories[$row['categoryid']]['title'] . '</a></div>' : '--'; $column['creator w150'] = '<b>' . $row['username'] . '</b>' . '<h5>' . time::format($row['createtime']) . '</h5>'; $column['manage edit'] = '<a href="' . zotop::url('content/content/edit/' . $row['id']) . '">编辑</a>'; $column['manage delete'] = (int) $row['system'] ? '<span class="disabled">删除</span>' : '<a href="' . zotop::url('content/content/delete/' . $row['id']) . '" class="confirm1">删除</a>'; table::row($column); } table::footer('选择:<a href="javascript:void(0);" class="selectAll" flag="true">全部</a> - <a href="javascript:void(0);" class="selectAll" flag="false">无</a>'); form::buttons(array('type' => 'select', 'name' => 'operation', 'id' => 'operation', 'class' => 'short', 'options' => array('status100' => $statuses['100'], 'status0' => $statuses['0'], 'status-1' => $statuses['-1'], 'status-50' => $statuses['-50'], 'order' => '权重->', 'move' => '移动->', 'delete' => '永久删除')), array('type' => 'text', 'name' => 'order', 'id' => 'order', 'value' => '50', 'title' => '权重参数,必须是数字', 'class' => 'small', 'style' => 'width:30px;padding:4px;display:none;'), array('type' => 'text', 'name' => 'categoryid', 'id' => 'categoryid', 'value' => $categoryid, 'class' => 'small', 'style' => 'width:30px;padding:4px;display:none;'), array('type' => 'text', 'name' => 'selectcategory', 'id' => 'selectcategory', 'value' => '选择栏目…', 'title' => '选择栏目…', 'readonly' => 'readonly', 'class' => 'small', 'style' => 'width:120px;padding:4px;display:none;cursor:pointer;'), array('type' => 'submit', 'value' => '执行操作')); form::footer($pagination); $this->bottom(); $this->footer();
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(); }
$('button[name=options]').click(function(){ location.href = "<?php echo zotop::url('site://'); ?> "; }); }); </script> <div id="topbar"> <a href="<?php echo zotop::url('site://'); ?> ">网站首页</a> <b>|</b> <a href="javascript:void(0);" class="addFavorite">加入收藏夹</a> <b>|</b> <a href="<?php echo zotop::url('zotop/login/shortcut', array('title' => url::encode($title), 'url' => url::encode(url::location()))); ?> ">设为桌面图标</a> </div> <?php box::header(array('title' => $title, 'icon' => 'user', 'action' => '')); form::header(array('title' => '', 'description' => '请输入您的帐户和密码登录', 'class' => 'small')); form::field(array('type' => 'text', 'label' => zotop::t('帐 户'), 'name' => 'username', 'value' => zotop::cookie('username'), 'valid' => 'required:true')); form::field(array('type' => 'password', 'label' => zotop::t('密 码'), 'name' => 'password', 'value' => '', 'valid' => 'required:true')); form::buttons(array('type' => 'submit', 'value' => '登录'), array('type' => 'button', 'name' => 'options', 'value' => '取消')); form::footer(); box::footer(); $this->footer();
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(); }
<?php $this->header(); $this->top(); $this->navbar(); ?> <script type="text/javascript"> </script> <?php form::header(); form::field(array('type' => 'hidden', 'label' => zotop::t('分类编号'), 'name' => 'id', 'value' => $data['id'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'text', 'label' => zotop::t('分类标题'), 'name' => 'title', 'value' => $data['title'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::field(array('type' => 'image', 'label' => zotop::t('分类图片'), 'name' => 'image', 'value' => $data['image'], 'description' => zotop::t(''))); form::field(array('type' => 'textarea', 'label' => zotop::t('分类说明'), 'name' => 'description', 'value' => $data['description'], 'description' => zotop::t(''))); form::field(array('type' => 'hidden', 'label' => zotop::t('分类排序'), 'name' => 'order', 'value' => $data['order'], 'valid' => 'required:true', 'description' => zotop::t(''))); form::buttons(array('type' => 'submit', 'value' => '保存'), array('type' => 'button', 'value' => '关闭', 'class' => 'zotop-dialog-close')); form::footer(); $this->bottom(); $this->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(); }
public static function buttons() { $buttons = func_get_args(); if (!empty($buttons) && !empty($buttons[0])) { if (is_array($buttons)) { $html[] = '<div class="buttons">'; foreach ($buttons as $button) { $html[] = field::get($button); } $html[] = '</div>'; } else { $html[] = $buttons; } form::$buttons = implode("\n", $html); } }
$column['select'] = html::checkbox(array('name' => 'id[]', 'value' => $blog['id'], 'class' => 'select')); $column['w30 center'] = '<span title="' . $blogstatus[$blog['status']] . '" class="zotop-icon zotop-icon-status' . $blog['status'] . '"></span>'; $column['order w30 center'] = empty($blog['order']) ? '0' : '<b class="red">' . $blog['order'] . '</b>'; $column['title'] = '<b' . (empty($blog['style']) ? '' : ' style="' . $blog['style'] . '"') . '>' . $blog['title'] . '</b>'; $column['title'] .= '<h5>'; $column['title'] .= '<a href="' . zotop::url('site://blog/index/view', array('id' => $blog['id'])) . '" target="_blank">查看</a>'; $column['title'] .= ' <a href="' . zotop::url('blog/index/edit', array('id' => $blog['id'])) . '">编辑</a>'; $column['title'] .= ' <a href="' . zotop::url('blog/index/delete', array('id' => $blog['id'])) . '" class="confirm">删除</a>'; $column['title'] .= '</h5>'; $column['categoryid w50'] = '<div class="w60 textflow" title="' . $categorys[$blog['categoryid']]['title'] . '">' . $categorys[$blog['categoryid']]['title'] . '</div>'; $column['comment w30 center'] = empty($blog['comment']) ? '0' : '<b class="red">' . $blog['comment'] . '</b>'; $column['atime w120'] = '' . time::format($blog['updatetime']) . ''; table::row($column); } table::footer(); form::buttons(array('type' => 'select', 'name' => 'operation', 'id' => 'operation', 'class' => 'short', 'options' => array('status100' => $blogstatus['100'], 'status0' => $blogstatus['0'], 'status-1' => $blogstatus['-1'], 'status-50' => $blogstatus['-50'], 'order' => '权重->', 'move' => '移动->', 'delete' => '永久删除')), array('type' => 'text', 'name' => 'order', 'id' => 'order', 'value' => '50', 'title' => '权重参数,必须是数字', 'style' => 'width:30px;padding:4px;display:none;'), array('type' => 'select', 'options' => arr::hashmap($categorys, 'id', 'title'), 'name' => 'categoryid', 'id' => 'categoryid', 'value' => $categoryid, 'class' => 'short', 'style' => 'display:none;'), array('type' => 'submit', 'value' => '执行操作')); form::footer($pagination); $this->bottom(); $this->mainFooter(); $this->sideHeader(); ?> <?php block::header(array('title' => '日志分类', 'action' => '<a href="' . zotop::url('blog/category/index') . '" class="dialog">管理</a><a href="' . zotop::url('blog/category/add', array('referer' => url::encode(url::location()))) . '" class="dialog">添加</a>')); ?> <div class="navbarlist"> <ul> <li<?php echo empty($categoryid) ? ' class="selected"' : ''; ?> ><a href="<?php
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(); }
$this->header(); ?> <script> zotop.form.callback = function(msg){ if( msg.type == 'success' ){ if ( msg.url ) { location.href = msg.url; } return true; } zotop.msg.show(msg); return false; } $(function(){ $('input[name=globalid]').val(dialog.args.globalid); $('input[name=field]').val(dialog.args.field); }); </script> <?php $this->navbar(); form::header(array('enctype' => 'multipart/form-data', 'description' => '<span class="zotop-icon zotop-icon-notice"></span>请从您的电脑中选择要上传的图片并设置图片标签后上传')); form::field(array('type' => 'file', 'label' => zotop::t('图片选择'), 'name' => 'file', 'value' => '', 'description' => '请从您的电脑中选择要上传的图片')); form::field(array('type' => 'text', 'label' => zotop::t('图片描述'), 'name' => 'description', 'value' => '', 'description' => '请输入图片的描述信息')); form::field(array('type' => 'hidden', 'label' => zotop::t('唯一编号'), 'name' => 'globalid', 'value' => '', 'description' => '')); form::field(array('type' => 'hidden', 'label' => zotop::t('字段名称'), 'name' => 'field', 'value' => '', 'description' => '字段名称')); form::buttons(array('type' => 'submit', 'value' => '上传图片'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close')); form::footer(); $this->footer();
$this->header(); ?> <script type="text/javascript"> $(function(){ $('#image-preview').zoomImage(500,300); zotop.form.callback = function(msg,$form){ zotop.msg.show(msg); if( msg.type == 'success' ){ dialog.opener.location.reload(); dialog.close(); return true; } return false; } }) </script> <div id="image-preview" style="margin:10px;text-align:center;height:300px;overflow:hidden;"> <?php echo html::image($image['path'], array('style' => 'display:none')); ?> </div> <?php form::header(); form::field(array('type' => 'select', 'options' => $categorys, 'label' => zotop::t('图片分类'), 'name' => 'folderid', 'value' => $image['folderid'], 'description' => '')); form::field(array('type' => 'text', 'name' => 'name', 'label' => zotop::t('图片名称'), 'value' => $image['name'], 'valid' => 'required:true')); form::field(array('type' => 'textarea', 'name' => 'description', 'label' => zotop::t('图片描述'), 'value' => $image['description'], 'valid' => '')); form::buttons(array('type' => 'submit', 'id' => 'submit', 'value' => zotop::t('保存')), array('type' => 'button', 'id' => 'close', 'value' => zotop::t('关闭'), 'class' => 'zotop-dialog-close')); form::footer(); $this->footer();
<?php $this->header(); $this->top(); $this->navbar(); ?> <script type="text/javascript"> $(function(){ $('.ok').click(function(){ var id = $('input[name=id]:checked').val(); var title = $('input[name=id]:checked').next().text(); dialog.callback(id,title); dialog.close(); }); }); </script> <style type="text/css"> body.dialog {} body.dialog .form-body{height:300px;overflow:auto;border:solid 1px #ebebeb;margin:5px;background:#fff;} body.dialog .treeview{padding:10px;} </style> <?php form::header(array('icon' => 'category', 'title' => zotop::t('选择栏目'), 'description' => zotop::t('选择栏目并确定'))); form::field('<div class="tree">'); form::field('<div class="tree-root"><input type="radio" name="id" id="id_0" value="0" checked> <label for="id_0"><span class="zotop-icon"></span>根目录</label></div>'); form::field($tree); form::field('</div>'); form::buttons(array('type' => 'button', 'value' => '确定', 'class' => 'ok'), array('type' => 'button', 'value' => '关闭', 'class' => 'zotop-dialog-close')); form::footer(); $this->bottom(); $this->footer();
$column['manage delete'] = '删除'; table::header('list', $column); foreach ($tables as $table) { $column = array(); $column['select'] = html::checkbox(array('name' => 'table[]', 'value' => $table['name'], 'class' => 'select')); $column['name'] = '<a href="' . zotop::url('database/field/index', array('tablename' => $table['name'])) . '"><b>' . $table['name'] . '</b></a><h5>' . $table['comment'] . '</h5>'; $column['size w60'] = (string) format::byte($table['size']); $column['Rows w60'] = $table['rows']; $column['Engine w60'] = $table['engine']; $column['collation w100'] = $table['collation']; $column['manage view w60'] = '<a href="' . zotop::url('database/table/edit', array('tablename' => $table['name'])) . '" class="dialog">设置</a>'; $column['manage delete'] = '<a href="' . zotop::url('database/table/delete', array('tablename' => $table['name'])) . '" class="confirm">删除</a>'; table::row($column, 'select'); } table::footer(); form::buttons(array('type' => 'select', 'name' => 'operation', 'style' => 'width:180px', 'options' => array('optimize' => '优化', 'delete' => '删除'), 'value' => 'check'), array('type' => 'submit', 'value' => '执行操作')); form::footer(); $this->bottom(); ?> </div> </div> <div id="side"> <?php block::header('数据库基本信息'); table::header(); table::row(array('w60' => '主机名称', '2' => '' . $database['hostname'] . '')); table::row(array('w60' => '端口', '2' => '' . $database['hostport'] . '')); table::row(array('w60' => '数据库', '2' => '' . $database['database'] . '')); table::row(array('w60' => '用户名', '2' => '' . $database['username'] . '')); table::row(array('w60' => '密码', '2' => '' . $database['password'] . '')); table::row(array('w60' => '版本', '2' => '' . $database['version'] . ''));
var url = $('input[name=file]').val(); var download = $('input[name=download]:checked').val(); if( download == 0 ){ callback(url); }else{ $('form.form').submit(); } }); }); //预览 $(function(){ preview($('#file').val()); }); $(function(){ $('#file').change(function(){ preview($(this).val()); }); }); </script> <div id="image-preview" style="margin:10px;text-align:center;height:260px;overflow:hidden;text-align:center;border:solid 1px #ebebeb;background:#fff;"> <div class="loader" style="line-height:260px;_margin-top:130px;">预览图片请先输入图片URL地址</div> </div > <?php form::header(); form::field(array('type' => 'text', 'label' => zotop::t('图片地址'), 'name' => 'file', 'value' => strtolower(substr($image, 0, 7)) == 'http://' ? $image : 'http://', 'description' => '请输入一个完整的图片地址,如:http://www.zotop.com/logo.png')); form::field(array('type' => 'radio', 'options' => array('1' => '将图片从远程自动上传到服务器', '0' => '不自动获取,直接插入图片地址'), 'label' => zotop::t('远程获取'), 'name' => 'download', 'value' => '0', 'class' => 'block', 'description' => '')); form::buttons(array('type' => 'button', 'value' => '插入图片', 'id' => 'insert'), array('type' => 'button', 'value' => zotop::t('取消'), 'class' => 'zotop-dialog-close')); form::footer(); $this->footer();
<?php $this->header(); $this->top(); $this->navbar(); ?> <style type="text/css"> table.field td.field-side{width:80px;} </style> <?php form::header(); form::field(array('type' => 'hidden', 'name' => 'id', 'label' => '编号', 'value' => $data['id'], 'description' => '')); form::field(array('type' => 'hidden', 'name' => 'categoryid', 'label' => '栏目编号', 'value' => $data['categoryid'], 'description' => '')); form::field(array('type' => 'hidden', 'name' => 'modelid', 'label' => '模型编号', 'value' => $data['modelid'], 'description' => '')); foreach ($fields as $field) { form::field($field); } form::field(array('type' => 'template', 'name' => 'template', 'label' => '模板设置', 'value' => $data['template'], 'valid' => '')); form::field(array('type' => 'radio', 'options' => array(-50 => zotop::t('草稿'), 0 => zotop::t('等待审核'), 1 => zotop::t('通过审核'), 100 => zotop::t('发布')), 'name' => 'status', 'label' => '默认状态', 'value' => $data['status'], 'valid' => '')); form::field(array('type' => 'radio', 'options' => array(0 => zotop::t('允许'), -1 => zotop::t('不允许')), 'name' => 'comment', 'label' => '评论', 'value' => (int) $data['comment'] >= 0 ? 0 : -1, 'valid' => '')); form::field(array('type' => 'time', 'name' => 'createtime', 'label' => '发布时间', 'value' => $data['createtime'], 'valid' => '')); form::buttons(array('type' => 'submit', 'id' => 'save', 'value' => zotop::t('发布')), array('type' => 'button', 'id' => 'savedraft', 'value' => zotop::t('保存')), array('type' => 'back')); form::footer(); $this->bottom(); $this->footer();
<?php $this->header(); $this->top(); $this->navbar(); echo html::msg('<h2>安全提示</h2><div>请不要使用过于简单的密码,如:111111、123456、生日密码、电话号码等,并及时的更换密码</div>'); form::header(); form::field(array('type' => 'disabled', 'label' => '账户名称', 'name' => 'username', 'value' => $user->username, 'valid' => '', 'description' => '')); form::field(array('type' => 'password', 'label' => '原密码', 'name' => 'password', 'value' => '', 'valid' => 'required:true', 'description' => '为确保安全,请输入你的密码')); form::field(array('type' => 'password', 'label' => '新密码', 'id' => 'newpassword', 'name' => 'newpassword', 'value' => '', 'valid' => 'required:true,minlength:6,maxlength:32', 'description' => '请输入您的新密码,6~32位之间')); form::field(array('type' => 'password', 'label' => '确认新密码', 'name' => 'newpassword2', 'value' => '', 'valid' => "required:true,equalTo:'#newpassword'", 'description' => '为确保安全,请再次输入您的新密码')); form::buttons(array('type' => 'submit'), array('type' => 'back')); form::footer(); $this->bottom(); $this->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(); }