本文整理汇总了PHP中zotop::model方法的典型用法代码示例。如果您正苦于以下问题:PHP zotop::model方法的具体用法?PHP zotop::model怎么用?PHP zotop::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zotop
的用法示例。
在下文中一共展示了zotop::model方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onDefault
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();
}
示例2: actionDelete
public function actionDelete($id)
{
$file = zotop::model('zotop.file');
$delete = $file->delete($id);
if ($delete) {
msg::success('删除成功', request::referer());
}
}
示例3: author
public function author($userid = '')
{
$userid = empty($userid) ? $this->userid : $userid;
$author = empty($author) ? $this->author : $author;
if (empty($author) && !empty($userid)) {
$author = zotop::model('system.user')->getName($userid);
}
return empty($author) ? '' : $author;
}
示例4: actionDetail
public function actionDetail($id)
{
$content = zotop::model('content.content');
$content->read($id);
$page = new page();
$page->set('content', $content);
$page->set('body', array('class' => 'detail'));
$page->display($content->template);
}
示例5: actionSide
public function actionSide()
{
$category = zotop::model('content.category');
$tree = $category->getTree(0, '<span class="zotop-icon zotop-icon-$icon"></span><a href="' . zotop::url('content/content/index/$id') . '" target="mainIframe">$title</a>');
$page = new side();
$page->set('title', zotop::t('文件管理'));
$page->set('tree', $tree);
$page->display();
}
示例6: actionDelete
public function actionDelete($id)
{
$category = zotop::model('blog.category');
$category->id = $id;
$category->delete();
if (!$category->error()) {
msg::success('删除成功', zotop::url('blog/category/index'));
}
msg::error($category->msg());
}
示例7: table
public function table()
{
if (empty($this->_table)) {
$model = zotop::model('content.model');
$models = $model->cache();
$this->_table = $models[$this->modelid]['tablename'];
if (empty($this->_table)) {
$this->error(zotop::t('未找到模型数据表'));
return false;
}
}
return $this->_table;
}
示例8: actionDelete
public function actionDelete($id)
{
$folder = zotop::model('system.folder');
$folder->id = $id;
$folder->read();
if ($folder->count('parentid', $folder->id) > 0) {
msg::error('删除失败,请先删除子类别');
}
$folder->delete();
if (!$folder->error()) {
msg::success('删除成功', zotop::url('system/folder/index/' . $folder->parentid));
}
msg::error($folder->msg());
}
示例9: actionStatus
public function actionStatus($id, $status = -1)
{
$module = zotop::model('system.module');
$module->id = $id;
$module->read();
if ($module->type == 'core') {
msg::error('系统模块不允许被禁用!');
}
$update = $module->update(array('status' => (int) $status), $id);
if (!$module->error()) {
$module->cache(true);
msg::success('操作成功', zotop::url('system/module'));
}
msg::error($module->msg());
}
示例10: actionBakup
public function actionBakup()
{
$db = zotop::model('database.database');
if (form::isPostBack()) {
msg::error('功能开发中……');
}
$database = $db->db()->config();
$tables = $db->tables();
$page = new page();
$page->title = '数据库备份';
$page->set('position', $database['database'] . ' @ ' . $database['hostname']);
$page->set('navbar', $this->navbar());
$page->set('database', $database);
$page->set('tables', $tables);
$page->display();
}
示例11: actionShow
public function actionShow($id)
{
$blog = zotop::model('blog.blog');
$blog->category = zotop::model('blog.category');
$blog->read($id);
$blog->category->read($blog->categoryid);
$categorys = $blog->category->getAll();
//渲染页面
$page = new page();
$page->set('title', $blog->title . ' ' . $blog->category->title);
$page->set('keywords', $blog->keywords . ' ' . $blog->category->keywords);
$page->set('description', $blog->description . ' ' . $blog->category->description);
$page->set('body', array('class' => 'detail'));
$page->set('id', $id);
$page->set('blog', $blog);
$page->set('categorys', $categorys);
$page->display('blog.show');
}
示例12: actionUpload
public function actionUpload()
{
$config = zotop::model('zotop.config');
if (form::isPostBack()) {
$post = form::post();
$save = $config->save($post);
if ($save) {
msg::success('保存成功,重新加载中,请稍后……');
}
msg::error($save);
}
$fields = $config->fields('upload');
$page = new page();
$page->set('title', '上传设置');
$page->set('navbar', $this->navbar());
$page->set('fields', $fields);
$page->display();
}
示例13: actionTheme
public function actionTheme()
{
$config = zotop::model('system.config');
if (form::isPostBack()) {
$post = form::post();
$config->save($post);
if ($config->error()) {
msg::error($config->msg());
}
msg::success('保存成功');
}
$theme = $config->fields('system.theme');
$page = new page();
$page->set('title', zotop::t('系统设置'));
$page->set('navbar', $this->navbar());
$page->set('theme', $theme);
$page->display();
}
示例14: changeInfoAction
public function changeInfoAction()
{
$user = zotop::model('zotop.user');
$user->id = (int) zotop::user('id');
if (form::isPostBack()) {
$post = form::post();
$update = $user->update($post, $user->id);
if ($update) {
msg::success('资料设置成功,正在刷新页面,请稍后……', url::current());
}
msg::error();
}
$data = $user->read();
$page = new page();
$page->title = '修改我的基本信息';
$page->set('navbar', $this->navbar());
$page->set('data', $data);
$page->display();
}
示例15: actionInfo
public function actionInfo()
{
$user = zotop::model('system.user');
$user->id = (int) zotop::user('id');
if (form::isPostBack()) {
$post = form::post();
$update = $user->update($post, $user->id);
if ($update) {
msg::success('资料设置成功,正在刷新页面,请稍后……', url::location());
}
msg::error();
}
$data = $user->read();
$page = new page();
$page->title = zotop::t('个人中心');
$page->set('navbar', $this->navbar());
$page->set('globalid', $user->globalid());
$page->set('data', $data);
$page->display();
}