當前位置: 首頁>>代碼示例>>PHP>>正文


PHP zotop::post方法代碼示例

本文整理匯總了PHP中zotop::post方法的典型用法代碼示例。如果您正苦於以下問題:PHP zotop::post方法的具體用法?PHP zotop::post怎麽用?PHP zotop::post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在zotop的用法示例。


在下文中一共展示了zotop::post方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add

 public function add($data)
 {
     $data['id'] = empty($data['id']) ? $this->max('id') + 1 : $data['id'];
     $data['createtime'] = empty($data['createtime']) ? TIME : $data['createtime'];
     $data['updatetime'] = empty($data['updatetime']) ? TIME : $data['updatetime'];
     $data['order'] = (int) $data['order'];
     $data['userid'] = empty($data['userid']) ? (int) $this->user('id') : (int) $data['userid'];
     $data['link'] = (int) $data['link'];
     $color = arr::take('title_color', $data);
     $weight = arr::take('title_weight', $data);
     $data['style'] = (empty($color) ? '' : 'color:' . $color . ';') . (empty($weight) ? '' : 'font-weight:' . $weight . ';');
     if (empty($data['title'])) {
         $this->error('標題不能為空');
         return false;
     }
     if (!$data['link'] && empty($data['content'])) {
         $this->error('內容不能為空');
         return false;
     }
     if ($data['link'] && empty($data['url'])) {
         $this->error('轉向鏈接不能為空');
         return false;
     }
     $this->id = $this->insert($data);
     //更新文件全局編號和狀態
     $file = zotop::model('system.file');
     $file->refresh(zotop::post('_GLOBALID'), $this->globalid());
     return $this->id;
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:29,代碼來源:blog.php

示例2: actionPassword

 public function actionPassword()
 {
     $user = zotop::model('system.user');
     $user->id = (int) zotop::user('id');
     $user->username = (string) zotop::user('username');
     if (form::isPostBack()) {
         $user->read();
         $password = zotop::post('password');
         $newpassword = zotop::post('newpassword');
         if ($user->password($password) != $user->password) {
             msg::error(zotop::t('您輸入的原密碼:<b>{$password}</b>錯誤,請確認', array('password' => $password)));
         }
         if ($newpassword != request::post('newpassword2')) {
             msg::error(zotop::t('兩次輸入的新密碼不一致,請確認'));
         }
         if ($newpassword != $password) {
             $update = $user->update(array('id' => $user->id, 'password' => $user->password($newpassword)));
         }
         msg::success(zotop::t('密碼修改成功,請記住您的新密碼'), url::current());
     }
     $page = new page();
     $page->title = zotop::t('個人中心');
     $page->set('user', $user);
     $page->set('navbar', $this->navbar());
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:26,代碼來源:mine.php

示例3: actionIndex

 public function actionIndex($parentid = 0)
 {
     $category = zotop::model('content.category');
     if (form::isPostBack()) {
         $ids = zotop::post('id');
         $category->order($ids);
         if (!$category->error()) {
             msg::success('保存成功');
         }
         msg::error($category->msg());
     }
     $categorys = $category->db()->where('parentid', '=', $parentid)->orderby('order', 'asc')->getAll();
     $types = $category->types();
     $model = zotop::model('content.model');
     $models = $model->cache();
     $position = $category->getPosition($parentid);
     foreach ($position as $p) {
         $pos[zotop::url('content/category/index/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('欄目管理'));
     $page->set('position', array(zotop::url('content') => zotop::t('內容管理'), zotop::url('content/category') => zotop::t('欄目管理')) + (array) $pos + array('欄目列表'));
     $page->set('navbar', $this->navbar($parentid));
     $page->set('categorys', $categorys);
     $page->set('models', $models);
     $page->set('types', $types);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:28,代碼來源:category.php

示例4: actionUpload

 public function actionUpload()
 {
     $file = zotop::model('system.file');
     $file->upload->allowexts = 'jpg|jpeg|png|gif';
     $folder = zotop::model('system.folder');
     if (form::isPostBack()) {
         $file->globalid = zotop::post('globalid');
         $file->field = zotop::post('field');
         $file->description = zotop::post('description');
         $files = $file->upload();
         if (!$file->error() && isset($files[0]['path'])) {
             msg::success('圖片上傳成功', zotop::url('system/image/upload'));
         }
         msg::error($file->msg());
     }
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $categorys = $tree->getOptionsArray();
     $page = new dialog();
     $page->set('title', '本地上傳');
     $page->set('navbar', $this->navbar());
     $page->set('allowexts', $file->upload->allowexts);
     $page->set('maxsize', $file->upload->maxsize);
     $page->set('categorys', $categorys);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:26,代碼來源:image.php

示例5: actionEdit

 public function actionEdit($tablename)
 {
     if (form::isPostBack()) {
         $tablename = zotop::post('tablename');
         $name = zotop::post('name');
         $comment = zotop::post('comment');
         $primary = zotop::post('primary');
         if (strtolower($tablename) !== strtolower($name)) {
             $rename = zotop::db()->table($tablename)->rename($name);
         }
         if ($comment !== NULL) {
             $comment = zotop::db()->table($name)->comment($comment);
         }
         if ($primary) {
             $primary = zotop::db()->table($name)->primary($primary);
         }
         msg::success('數據表設置成功,正在刷新頁麵,請稍後……', zotop::url('database/table'));
     }
     $db = zotop::db();
     $database = $db->config();
     $tables = $db->tables(true);
     $table = $tables[$tablename];
     if (!isset($table)) {
         msg::error(zotop::t('數據表{$tablename}不存在', array('tablename' => $tablename)));
     }
     $page = new dialog();
     $page->title = '數據庫管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 編輯:' . $tablename;
     $page->set('database', $database);
     $page->set('table', $table);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:31,代碼來源:table.php

示例6: referer

 public static function referer($url = '')
 {
     static $referer;
     if (empty($url)) {
         $url = zotop::post('_REFERER');
         return $url;
     }
     $referer = $url;
     return $referer;
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:10,代碼來源:form.php

示例7: actionEditor

 public function actionEditor($file)
 {
     $filepath = realpath(ZOTOP_PATH_ROOT . DS . trim($file, '/'));
     if (empty($file)) {
         return false;
     }
     if (form::isPostBack()) {
         $content = zotop::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('內容為空,無法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('內容保存成功!');
     }
     $content = file::read($filepath);
     $page = new dialog();
     $page->title = '文件編輯器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('content', $content);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:23,代碼來源:file.php

示例8: actionInstall

 public function actionInstall($id = '')
 {
     $id = empty($id) ? zotop::post('id') : $id;
     $module = zotop::model('system.module');
     $modules = $module->getUnInstalled();
     if (!isset($modules[$id])) {
         msg::error(array('title' => zotop::t('安裝失敗'), 'content' => zotop::t('未找到模塊<b>{$id}</b>,請檢查', array('id' => $id))));
     }
     if (form::isPostBack()) {
         $install = $module->install($modules[$id]['path']);
         if ($install) {
             $module->cache(true);
             msg::success(zotop::t('模塊安裝成功'), zotop::url('system/module'));
         }
     }
     $moduleFile = $modules[$id]['path'] . DS . 'module.php';
     if (!file::exists($moduleFile)) {
         msg::error(array('title' => zotop::t('安裝失敗'), 'content' => zotop::t('未找到模塊標記文件<b>module.php</b>,請檢查')));
     }
     $page = new dialog();
     $page->set('title', '安裝模塊');
     $page->set('module', $modules[$id]);
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:24,代碼來源:module.php

示例9: actionEdit

 public function actionEdit($tablename, $fieldname)
 {
     if (form::isPostBack()) {
         $field = array();
         $field['name'] = zotop::post('name');
         $field['length'] = zotop::post('len');
         $field['type'] = zotop::post('type');
         $field['collation'] = zotop::post('collation');
         $field['null'] = zotop::post('null');
         $field['default'] = zotop::post('default');
         $field['attribute'] = zotop::post('attribute');
         $field['extra'] = zotop::post('extra');
         $field['comment'] = zotop::post('comment');
         $field['position'] = zotop::post('position');
         $fieldname = zotop::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/' . $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: 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


注:本文中的zotop::post方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。