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


PHP form::isPostBack方法代码示例

本文整理汇总了PHP中form::isPostBack方法的典型用法代码示例。如果您正苦于以下问题:PHP form::isPostBack方法的具体用法?PHP form::isPostBack怎么用?PHP form::isPostBack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在form的用法示例。


在下文中一共展示了form::isPostBack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onDefault

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

示例2: actionEdit

 public function actionEdit($id)
 {
     $blog = zotop::model('blog.blog');
     $status = $blog->status();
     $category = zotop::model('blog.category');
     $categorys = $category->getAll();
     if (form::isPostBack()) {
         $post = form::post();
         $blog->edit($post, $id);
         if (!$blog->error()) {
             msg::success('保存成功', form::referer());
         }
         msg::error($blog->msg());
     }
     //读取数据
     $data = $blog->read($id);
     $categoryid = $data['categoryid'];
     //渲染页面
     $page = new page();
     $page->set('title', '编辑日志');
     $page->set('navbar', $this->navbar($categoryid));
     $page->set('globalid', $blog->globalid());
     $page->set('data', $data);
     $page->set('status', $status);
     $page->set('categoryid', $categoryid);
     $page->set('categorys', $categorys);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:28,代码来源:index.php

示例3: actionEdit

 public function actionEdit($id, $type = '')
 {
     $config = zotop::model('system.config');
     $config->id = $id;
     if (form::isPostBack()) {
         $post = form::post();
         $post['settings'] = json_encode($post['settings']);
         $update = $config->update($post, $id);
         if ($update) {
             $config->cache(true);
             msg::success('保存成功,重新加载中,请稍后……', zotop::url('system/config/index/' . $post['parentid']));
         }
         msg::error($update);
     }
     $field = $config->read();
     $field['settings'] = (array) json_decode($field['settings']);
     //重新选择
     if (!empty($type)) {
         $field['type'] = $type;
     } else {
         $type = $field['type'];
     }
     $page = new dialog();
     $page->set('title', '编辑');
     $page->set('body', array('style' => 'min-width:600px;'));
     $page->set('field', $field);
     $page->set('type', $type);
     $page->set('types', $config->getControlTypes());
     $page->set('attrs', $config->getControlAttrs($type, $field));
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:31,代码来源:config.php

示例4: actionNewfile

 public function actionNewfile($dir = '')
 {
     $dir = empty($dir) ? zotop::get('dir') : $dir;
     $dir = trim(url::decode($dir), '/');
     $file = 'newfile.php';
     if (form::isPostBack()) {
         $file = zotop::post('name');
         $title = zotop::post('title');
         $description = zotop::post('description');
         $filepath = site::template($dir . DS . $file);
         $filecontent = "<?php\r\n/**\r\n * title:{$title}\r\n * description:{$description}\r\n*/\r\n?>";
         if (file::exists($filepath)) {
             msg::error(zotop::t('新建失败,当前目录已经存在文件:{$file}', array('file' => $file)));
         }
         if (file::write($filepath, $filecontent)) {
             msg::success('新建文件成功');
         }
         msg::error('新建文件失败');
     }
     $page = new dialog();
     $page->title = zotop::t('模板编辑器');
     $page->set('dir', $dir);
     $page->set('file', $file);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:25,代码来源:template.php

示例5: editAction

 public function editAction($id, $type = '')
 {
     $config = zotop::model('zotop.config');
     $config->id = $id;
     if (form::isPostBack()) {
         $post = form::post();
         $post['settings'] = json_encode($post['settings']);
         $update = $config->update($post, $id);
         if ($update) {
             msg::success('保存成功,重新加载中,请稍后……', zotop::url('zotop/config/index', array('parentid' => $post['parentid'])));
         }
         msg::error(zotop::dump($post, true));
     }
     $field = $config->read();
     $field['settings'] = (array) json_decode($field['settings']);
     $type = empty($type) ? $field['type'] : $type;
     $field['type'] = $type;
     $page = new dialog();
     $page->set('title', '编辑');
     $page->set('body', array('style' => 'min-width:600px;'));
     $page->set('field', $field);
     $page->set('type', $type);
     $page->set('types', $config->types());
     $page->set('controls', $config->controls());
     $page->set('attrs', $config->attrs($type));
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:27,代码来源:config.php

示例6: 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

示例7: sqlAction

 public function sqlAction()
 {
     if (form::isPostBack()) {
         msg::error('该功能已经被禁用,请进入设置开启');
     }
     $page = new dialog();
     $page->title = '数据库管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 执行sql语句';
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:9,代码来源:table.php

示例8: actionImageFromUrl

 public function actionImageFromUrl($globalid, $field, $image)
 {
     if (form::isPostBack()) {
         msg::error('远程获取中……');
     }
     $page = new dialog();
     $page->set('title', '网络图片');
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:10,代码来源:upload.php

示例9: actionEdit

 public function actionEdit($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');
         if ($fieldname != $field['name']) {
             $result = zotop::db()->table($tablename)->field($fieldname)->rename($field['name']);
         }
         $result = zotop::db()->table($tablename)->modify($field);
         if ($result) {
             msg::success('字段修改成功', zotop::url('database/field/index', array('tablename' => $tablename)));
         }
     }
     $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)) {
         msg::error('字段不存在,请勿修改浏览器参数');
     }
     $positions = array();
     $positions[-1] = '位于表头';
     if ($fields) {
         foreach ($fields as $key => $val) {
             $positions[$key] = '位于 ' . $key . ' 之后';
         }
     }
     $positions[0] = ' ';
     $page = new dialog();
     $page->title = '编辑字段';
     $page->set('database', $database);
     $page->set('tables', $tables);
     $page->set('field', $field);
     $page->set('positions', $positions);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:49,代码来源:field.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: indexAction

 public function indexAction()
 {
     $user = zotop::model('zotop.user');
     if (form::isPostBack()) {
         $post = array();
         $post['username'] = request::post('username');
         $post['password'] = request::post('password');
         $post['logintime'] = time();
         zotop::cookie('admin.username', $post['username'], 3600);
         if (empty($post['username'])) {
             msg::error(zotop::t('登陆失败,请输入登陆账户名称'));
         }
         if (empty($post['password'])) {
             msg::error(zotop::t('登陆失败,请输入登陆账户密码'));
         }
         if (!$user->isValidUserName($post['username'])) {
             msg::error(zotop::t('登陆失败,请输入有效的账户名称'));
         }
         if (!$user->isValidPassword($post['password'])) {
             msg::error(zotop::t('登陆失败,请输入有效的账户密码'));
         }
         //读取用户
         $data = $user->read(array('username', '=', $post['username']));
         //验证
         if ($data == false) {
             msg::error(zotop::t('账户名称`{$username}`不存在,请检查是否输入有误!', array('username' => $post['username'])));
         }
         if ($user->password($post['password']) != $data['password']) {
             msg::error(zotop::t('账户密码`{$password}`错误,请检查是否输入有误!', array('password' => $post['password'])));
         }
         //用户登入
         $user->login();
         //跳转
         msg::success('登陆成功,系统正在加载中', url::current(), 2);
     }
     if (!empty($this->user)) {
         $this->redirect('zotop/index');
     }
     $data = $user->read(array('username', '=', 'admin'));
     $page = new page();
     $page->title = '系统登陆';
     $page->body = array('class' => 'login');
     $page->addScript('$this/js/login.js');
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:45,代码来源:login.php

示例12: actionEdit

 public function actionEdit($id)
 {
     $category = zotop::model('blog.category');
     if (form::isPostBack()) {
         $post = form::post();
         $category->update($post, $id);
         if (!$category->error()) {
             msg::success('保存成功', zotop::url('blog/category/index'));
         }
         msg::error($category->msg());
     }
     $category->id = $id;
     $data = $category->read();
     $page = new dialog();
     $page->set('title', '编辑分类');
     $page->set('data', $data);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:18,代码来源:category.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: 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

示例15: addAction

 public function addAction()
 {
     $user = zotop::model('zotop.user');
     $usergroup = zotop::model('zotop.usergroup');
     if (form::isPostBack()) {
         $post = form::post();
         if (empty($post['id'])) {
             $post['id'] = $user->max('id') + 1;
         }
         if (empty($post['username'])) {
             msg::error('帐户名称不能为空');
         }
         if (empty($post['password'])) {
             msg::error('帐户密码不能为空');
         }
         if ($post['password'] != $_POST['_password']) {
             msg::error('两次输入的密码不一致');
         }
         if ($user->isExist('username', $post['username'])) {
             msg::error('帐户名称<b>' . $post['username'] . '</b>已经存在');
         }
         if ($user->isExist('email', $post['email'])) {
             msg::error('电子邮件<b>' . $post['email'] . '</b>已经存在');
         }
         $post['password'] = $user->password($post['password']);
         $post['loginnum'] = $post['loginnum'] || 0;
         $post['createtime'] = $post['createtime'] || TIME;
         $post['modelid'] = 'system';
         $insert = $user->insert($post);
         if ($insert) {
             msg::success('保存成功,正在返回列表页面,请稍后……', zotop::url('zotop/user'));
         }
     }
     //获取用户组
     $usergroups = $usergroup->getIndex('system');
     $page = new page();
     $page->set('title', '添加新用户');
     $page->set('position', $position);
     $page->set('navbar', $this->navbar());
     $page->set('data', $data);
     $page->set('usergroups', $usergroups);
     $page->display();
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:43,代码来源:user.php


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