/** * 返回当前时间或者当前时间戳 * * @param bool $format 是否格式化时间 * * @return string */ public static function current($format = false) { static $time = ''; if (empty($time)) { $time = time(); } $time = $format ? time::format($time) : $time; return $time; }
public function onDefault() { $site = array(); $site['name'] = zotop::config('zotop.site.name'); $site['totalsize'] = zotop::config('zotop.ftp.size'); $site['totalsize'] = (int) $site['totalsize'] == 0 ? '--' : format::byte($site['totalsize']); $database = array(); $database['size'] = zotop::db()->size(); $database['size'] = format::byte($database['size']); $page['title'] = '控制中心'; $page['css'][] = url::module() . '/admin/css/main.css'; zotop::add('zotop.main.main', array(&$this, 'notepad')); zotop::add('zotop.main.main', array(&$this, 'mylog')); page::header($page); page::top(); page::navbar($this->navbar(), 'main'); page::add(''); page::add('<div id="user" class="clearfix">'); page::add(' <div id="userface"><span class="image">' . html::image(zotop::user('image')) . '</span></div>'); page::add(' <div id="userinfo">'); page::add(' <h2 id="welcome">欢迎您,' . zotop::user('name') . ' <span id="sign">' . zotop::user('sign') . '</span></h2>'); page::add(' <div id="login">登录时间:' . time::format(zotop::user('logintime')) . ' 登录次数:' . zotop::user('loginnum') . ' 登录IP:' . zotop::user('loginip') . '</div>'); //加载hook zotop::run('zotop.main.action'); page::add(''); page::add('</div>'); page::add('<div class="grid-m-s">'); page::add('<div class="col-main">'); page::add('<div class="col-main-inner">'); zotop::run('zotop.main.main'); page::add('</div>'); page::add('</div>'); page::add('<div class="col-sub">'); zotop::run('zotop.main.sub'); block::header(array('title' => '网站信息', 'action' => '<a class="more" href="' . zotop::url('zotop/info/site') . '">详细</a>')); echo '<table class="table">'; echo '<tr><td class="w80">网站名称:</td><td>' . $site['name'] . '</td></tr>'; echo '<tr><td class="w80">空间占用:</td><td>' . $site['totalsize'] . '</td></tr>'; echo '<tr><td class="w80">已上传文件:</td><td></td></tr>'; echo '<tr><td class="w80">数据库大小:</td><td>' . $database['size'] . '</td></tr>'; echo '</table>'; block::footer(); block::header(array('title' => '系统信息', 'action' => '<a class="more" href="' . zotop::url('zotop/main/system') . '">详细</a>')); echo '<table class="table">'; echo '<tr><td class="w80">程序版本:</td><td>' . zotop::config('zotop.version') . '</td></tr>'; echo '<tr><td class="w80">程序设计:</td><td>' . zotop::config('zotop.author') . '</td></tr>'; echo '<tr><td class="w80">程序开发:</td><td>' . zotop::config('zotop.authors') . '</td></tr>'; echo '<tr><td class="w80">官方网站:</td><td><a href="' . zotop::config('zotop.homepage') . '" target="_blank">' . zotop::config('zotop.homepage') . '</a></td></tr>'; echo '<tr><td class="w80">安装时间:</td><td>' . zotop::config('zotop.install') . '</td></tr>'; echo '</table>'; block::footer(); page::add('</div>'); page::add('</div>'); page::bottom('<span class="zotop-tip">上次登录时间:' . time::format(zotop::user('logintime')) . '</span>'); page::footer(); }
public function onDefault() { $module = zotop::model('zotop.module'); $list = $module->getAll(array('select' => '*', 'orderby' => 'updatetime desc')); $module->getStructure(); $page['title'] = '模块管理'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(); $column = array(); $column['status w30 center'] = '状态'; $column['modulename'] = '模块ID'; $column['name'] = '模块名称'; $column['path'] = '安装目录'; $column['varsion w60 center'] = '版本号'; $column['updatetime w150'] = '更新时间'; $column['manage lock'] = '锁定'; $column['manage rename'] = '设置'; $column['manage edit'] = '权限'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($list as $module) { $module['status-icon'] = $module['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/ok.gif'); $column = array(); $column['status w30 center'] = $module['status-icon']; $column['name w80'] = $module['id']; $column['modulename'] = '<a><b>' . $module['name'] . '</b></a><h5>' . $module['description'] . '</h5>'; $column['loginnum w60'] = $module['path']; $column['loginip w60 center'] = $module['version']; $column['logintime w150'] = time::format($module['updatetime']); if ($module['status'] == -1) { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'], 'status' => 0)) . '">启用</a>'; } else { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/module/lock', array('id' => $module['id'])) . '">禁用</a>'; } $column['manage setting'] = '<a href="' . zotop::url('zotop/module/setting', array('id' => $module['id'])) . '">设置</a>'; $column['manage priv'] = '<a href="' . zotop::url('zotop/module/priv', array('id' => $module['id'])) . '">权限</a>'; $column['manage delete'] = '<a>卸载</a>'; table::row($column); } table::footer(); form::buttons(); form::footer(); page::bottom(); page::footer(); }
public function onDefault() { $User = zotop::model('zotop.user'); $list = $User->getAll(array('select' => '*', 'where' => array('modelid', '=', 'system'), 'orderby' => 'logintime desc')); $page['title'] = '系统用户管理'; page::header($page); page::top(); page::navbar($this->navbar()); form::header(); $column = array(); $column['status w30 center'] = '状态'; $column['username'] = '******'; $column['name'] = '姓名'; $column['loginnum'] = '登录次数'; $column['loginip w120'] = '登录IP'; $column['logintime w150'] = '登录时间'; $column['manage lock'] = '锁定'; $column['manage rename'] = '修改密码'; $column['manage edit'] = '编辑'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($list as $user) { $user['status-icon'] = $user['status'] == -1 ? html::image(url::theme() . '/image/icon/lock.gif') : html::image(url::theme() . '/image/icon/user.gif'); $column = array(); $column['status w30 center'] = $user['status-icon']; $column['username'] = '******' . $user['username'] . '</b></a><h5>' . $user['email'] . '</h5>'; $column['name w60'] = $user['name']; $column['loginnum w60'] = $user['loginnum']; $column['loginip w120'] = $user['loginip']; $column['logintime w150'] = time::format($user['logintime']); if ($user['status'] == -1) { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'], 'status' => 0)) . '">解锁</a>'; } else { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('zotop/user/lock', array('id' => $user['id'])) . '">锁定</a>'; } $column['manage rename'] = '<a href="' . zotop::url('zotop/user/changepassword', array('id' => $user['id'])) . '">修改密码</a>'; $column['manage edit'] = '<a href="' . zotop::url('zotop/user/changeinfo', array('id' => $user['id'])) . '">编辑</a>'; $column['manage delete'] = '<a>删除</a>'; table::row($column); } table::footer(); form::buttons(); form::footer(); page::bottom(); page::footer(); }
$column['usergroup'] = '用户组'; $column['name'] = '姓名'; $column['loginnum'] = '登录次数'; $column['loginip'] = '最后登录IP/登录时间'; $column['manage lock'] = '锁定'; $column['manage edit'] = '编辑'; $column['manage delete'] = '删除'; table::header('list', $column); foreach ($users as $user) { $column = array(); $column['status w30 center'] = $user['status'] == -1 ? '<span class="zotop-icon zotop-icon-lock"></span>' : '<span class="zotop-icon zotop-icon-ok"></span>'; $column['username'] = '******' . $user['username'] . '</b></a><h5>' . $user['email'] . '</h5>'; $column['usergroup w100'] = $usergroups[$user['groupid']]; $column['name w80'] = $user['name']; $column['loginnum w60'] = $user['loginnum']; $column['loginip w140'] = $user['loginip'] . '<h5>' . time::format($user['logintime']) . '</h5>'; if ($user['status'] == -1) { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/user/lock/' . $user['id'] . '/0') . '">' . zotop::t('解锁') . '</a>'; } else { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/user/lock/' . $user['id']) . '">' . zotop::t('锁定') . '</a>'; } $column['manage edit'] = '<a href="' . zotop::url('system/user/changeinfo/' . $user['id']) . '">' . zotop::t('编辑') . '</a>'; $column['manage delete'] = '<a href="' . zotop::url('system/user/delete/' . $user['id']) . '" class="confirm">' . zotop::t('删除') . '</a>'; table::row($column); } table::footer(); //form::footer(); } ?> <?php
//$column['path'] = '安装目录'; $column['varsion w60 center'] = '版本号'; $column['updatetime'] = '更新时间'; $column['manage rename'] = '设置'; $column['manage edit'] = '权限'; $column['manage lock'] = '禁用'; $column['manage delete'] = '卸载'; table::header('list', $column); foreach ($modules as $module) { $column = array(); $column['status w30 center'] = $module['status'] == -1 ? '<span class="zotop-icon zotop-icon-lock"></span>' : '<span class="zotop-icon zotop-icon-ok"></span>'; $column['logo center'] = empty($module['icon']) ? '<div class="zotop-icon zotop-icon-module"></div>' : html::image($module['icon'], array('width' => '32px')); $column['name'] = '<a class="dialog" href="' . zotop::url('system/module/about/' . $module['id']) . '"><b>' . $module['name'] . ' ( ' . $module['id'] . ' )</b></a><h5>' . $module['description'] . '</h5>'; //$column['loginnum w60'] = $module['path']; $column['loginip w60 center'] = $module['version']; $column['logintime w130'] = time::format($module['updatetime']); $column['manage setting'] = file::exists($module['path'] . DS . 'admin' . DS . 'setting.php') ? '<a href="' . zotop::url($module['id'] . '/setting') . '">设置</a>' : '<span class="disabled">设置</span>'; $column['manage priv'] = file::exists($module['path'] . DS . 'admin' . DS . 'priv.php') ? '<a href="' . zotop::url($module['id'] . '/priv') . '">权限</a>' : '<span class="disabled">权限</span>'; if ($module['type'] == 'core') { $column['manage lock'] = '<span class="disabled">禁用</span>'; } else { if ($module['status'] == -1) { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/module/status/' . $module['id'] . '/0') . '">启用</a>'; } else { $column['manage lock'] = '<a class="confirm" href="' . zotop::url('system/module/status/' . $module['id'] . '/-1') . '">禁用</a>'; } } $column['manage delete'] = $module['type'] == 'core' ? '<span class="disabled">卸载</span>' : '<a class="confirm" href="' . zotop::url('system/module/uninstall/' . $module['id']) . '">卸载</a>'; table::row($column); } table::footer();
<a>修改资料</a> <a>修改密码</a> <a>修改图像</a> </div> </span> </div> <div id="userinfo"> <h2 id="welcome">欢迎您,<?php echo $user['name']; ?> <span id="sign"><?php echo $user['sign']; ?> </span></h2> <div id="login">登录时间:<?php echo time::format($user['logintime']); ?> 登录次数:<?php echo $user['loginnum']; ?> 登录IP:<?php echo $user['loginip']; ?> </div> <div> <a href="<?php echo zotop::url('system/mine/changeinfo'); ?> ">修改我的资料</a> <a href="<?php
?> </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="block-footer"></div> </div> </div> </div> <?php $this->bottom('<span class="zotop-tip">上次登录时间:' . time::format($this->user['logintime']) . '</span>'); $this->footer();
public function __toString() { return (string) $this->hora->format('H:i'); }
?> </div> <div class="grid grid-m-s"> <div class="column-main"> <div class="column-main-inner"> <div class="detail"> <div class="title clearfix"> <h1 id="title"><?php echo $blog->title; ?> </h1> <h2 id="info">作者:<?php echo $blog->author(); ?> 发布时间:<?php echo time::format($blog->createtime); ?> </h2> </div> <?php if (!empty($blog->description)) { ?> <div class="description"><?php echo $blog->description; ?> </div> <?php } ?> <div id="content" class="content clearfix"> <?php
$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();
?> </div> <div class="grid grid-m-s"> <div class="column-main"> <div class="column-main-inner"> <div class="detail"> <div class="title clearfix"> <h1 id="title"><?php echo $content->title; ?> </h1> <h2 id="info">作者:<?php echo $content->author; ?> 发布时间:<?php echo time::format($content->createtime); ?> </h2> </div> <?php if ($content->summary != '') { ?> <div class="summary"><?php echo $content->summary; ?> </div> <?php } ?> <div id="content" class="content clearfix"> <?php
echo $module['description']; ?> </td></tr> <tr><td class="w80">模块版本:</td><td><?php echo $module['version']; ?> </td></tr> <tr><td class="w80">程序开发:</td><td><?php echo $module['author']; ?> </td></tr> <tr><td class="w80">官方网站:</td><td><a href="<?php echo $module['homepage']; ?> " target="_blank"><?php echo $module['homepage']; ?> </a></td></tr> <tr><td class="w80">安装时间:</td><td><?php echo time::format($module['installtime']); ?> </td></tr> </table> <?php //box::footer(); ?> </div> </div> <?php $this->bottom(); $this->footer();
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['atime w120'] = '最后修改时间'; table::header('list', $column); foreach ($blogs['data'] as $blog) { $column = array(); $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>
$column['name'] = '<a href="' . zotop::url('webftp/index/index', array('dir' => rawurlencode($dir . '/' . $folder))) . '"><b>' . $folder . '</b></a>'; $column['name'] .= '<h5>'; $column['name'] .= '<a href="' . zotop::url('webftp/folder/rename', array('dir' => rawurlencode($dir), 'file' => $file)) . '" class="dialog">重命名</a>'; $column['name'] .= ' <a href="' . zotop::url('webftp/folder/delete', array('dir' => rawurlencode($dir), 'file' => $file)) . '" class="dialog">删除</a>'; $column['name'] .= '</h5>'; $column['type w60'] = '文件夹'; $column['encoding w60'] = ''; $column['size w60'] = '--'; $column['atime w120'] = time::format(@fileatime($path . DS . $folder)); $column['mtime w120'] = time::format(@filemtime($path . DS . $folder)); table::row($column); } foreach ($files as $file) { $column = array(); $column['center'] = '<div class="zotop-icon zotop-icon-file ' . file::ext($file) . '"></div>'; $column['name'] = '<div><b>' . $file . '</b></div>'; $column['name'] .= '<h5>'; $column['name'] .= '<a href="' . zotop::url('webftp/file/edit', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">编辑</a>'; $column['name'] .= ' <a href="' . zotop::url('webftp/file/rename', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">重命名</a>'; $column['name'] .= ' <a href="' . zotop::url('webftp/file/delete', array('file' => url::encode($dir . '/' . $file))) . '" class="dialog">删除</a>'; $column['name'] .= '</h5>'; $column['type w60'] = '文件'; $column['encoding w60'] = file::isUTF8($path . DS . $file) ? 'UTF8' : ''; $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)); table::row($column); } table::footer(); $this->bottom(); $this->footer();
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(); }
<li> <div class="title"> <h2><?php echo html::a(zotop::url('blog/' . $blog['id']), $blog['title'], array('style' => $blog['style'])); ?> </h2> <h3> 类别:<a href="<?php echo zotop::url("blog/list/{$blog['categoryid']}"); ?> "><?php echo $categorys[$blog['categoryid']]['title']; ?> </a> 时间:<?php echo time::format($blog['createtime']); ?> <?php echo (int) $blog['comment'] >= 0 ? html::a('', zotop::t('评论') . ':(' . (int) $blog['comment'] . ')') : ''; ?> </h3> </div> <?php if (!empty($blog['description'])) { ?> <div class="summary"><?php echo $blog['description']; ?> </div> <?php }
public function actionEdit($id) { $content = zotop::model('content.content'); //读取并设置内容 $data = $content->read($id); $data['createtime'] = time::format($data['createtime']); $data['url'] = $data['link'] == 1 ? $data['url'] : ''; //获取栏目 $categoryid = $content->categoryid; //实例化模块、栏目及字段 $model = zotop::model('content.model'); $field = zotop::model('content.field'); $category = zotop::model('content.category'); //读取栏目信息 if ($categoryid) { $categorydata = $category->read($categoryid); $modelid = $category->modelid; $position = $category->getPosition($categoryid); foreach ($position as $p) { $pos[zotop::url('content/content/index/' . $p['id'])] = $p['title']; } } $fields = array(); //读取模块设置 if ($modelid) { $modeldata = $model->read($modelid); if ($modeldata) { $fields = $field->getFields($modelid, $data); } } $page = new page(); $page->set('title', zotop::t('内容管理')); $page->set('position', array(zotop::url('content') => zotop::t('内容管理'), zotop::url('content/content') => zotop::t('内容库')) + (array) $pos + array('编辑内容')); $page->set('navbar', $this->navbar($content->categoryid)); $page->set('categorydata', $categorydata); $page->set('fields', $fields); $page->set('modeldata', $modeldata); $page->set('data', $data); $page->display('content.content.post'); }