当前位置: 首页>>代码示例>>PHP>>正文


PHP zotop::model方法代码示例

本文整理汇总了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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:32,代码来源:login.php

示例2: actionDelete

 public function actionDelete($id)
 {
     $file = zotop::model('zotop.file');
     $delete = $file->delete($id);
     if ($delete) {
         msg::success('删除成功', request::referer());
     }
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:8,代码来源:file.php

示例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;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:9,代码来源:blog.php

示例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);
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:9,代码来源:detail.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:9,代码来源:index.php

示例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());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:10,代码来源:category.php

示例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;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:13,代码来源:modelcontent.php

示例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());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:14,代码来源:folder.php

示例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());
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:15,代码来源:module.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:16,代码来源:manage.php

示例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');
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:18,代码来源:default.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:18,代码来源:setting.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:18,代码来源:setting.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:19,代码来源:mine.php

示例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();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:20,代码来源:mine.php


注:本文中的zotop::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。