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


PHP msg::error方法代碼示例

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


在下文中一共展示了msg::error方法的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: 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

示例3: onChangePassword

 public function onChangePassword()
 {
     $user = zotop::model('zotop.user');
     $user->id = (int) zotop::user('id');
     $user->username = (string) zotop::user('username');
     if (form::isPostBack()) {
         $user->read();
         $password = request::post('password');
         $newpassword = request::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('密碼修改成功,請記住您的新密碼'), 'reload');
     }
     $page['title'] = '修改我的密碼';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     form::header(array('title' => '修改密碼', 'description' => '為確保賬戶安全,請不要使用過於簡單的密碼,並及時的更換密碼', 'icon' => ''));
     form::field(array('type' => 'label', 'label' => zotop::t('賬戶名稱'), 'name' => 'username', 'value' => $user->username, 'valid' => '', 'description' => zotop::t('')));
     form::field(array('type' => 'password', 'label' => zotop::t('原密碼'), 'name' => 'password', 'value' => '', 'valid' => 'required:true', 'description' => zotop::t('為確保安全,請輸入你的密碼')));
     form::field(array('type' => 'password', 'label' => zotop::t('新密碼'), 'id' => 'newpassword', 'name' => 'newpassword', 'value' => '', 'valid' => 'required:true,minlength:6,maxlength:32', 'description' => zotop::t('請輸入您的新密碼,6~32位之間')));
     form::field(array('type' => 'password', 'label' => zotop::t('確認新密碼'), 'name' => 'newpassword2', 'value' => '', 'valid' => 'required:true,equalTo:"#newpassword"', 'description' => zotop::t('為確保安全,請再次輸入您的新密碼')));
     form::buttons(array('type' => 'submit'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:34,代碼來源:mine.php

示例4: onDefault

 public function onDefault()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect('database/table');
     }
     msg::error('連接數據庫失敗', '請檢查數據庫配置是否正確');
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:8,代碼來源:index.php

示例5: actionIndex

 public function actionIndex()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect(zotop::url('database/table'));
     }
     msg::error('連接數據庫失敗,請檢查數據庫配置是否正確');
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:8,代碼來源:index.php

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

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

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

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

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

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

示例12: deleteAction

 public function deleteAction($id)
 {
     $user = zotop::model('zotop.user');
     $usergroup = zotop::model('zotop.usergroup');
     $usergroup->id = $id;
     $usergroup->read();
     if ($usergroup->id == 1) {
         msg::error('超級管理員組無法被刪除');
     }
     if ($user->countByGroupid($id) > 0) {
         msg::error('該用戶組下麵尚有用戶,無法被刪除');
     }
     zotop::run('zotop.usergroup.delete', $usergroup);
     if ($usergroup->delete()) {
         $usergroup->cache();
         msg::success('刪除成功,正在重載數據,請稍後……', zotop::url('zotop/usergroup'));
     }
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:18,代碼來源:usergroup.php

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

示例14: onInstall

 public function onInstall($id = '')
 {
     $module = zotop::model('zotop.module');
     $modules = $module->notInstalled();
     //模塊安裝
     if (!empty($id)) {
         $install = $module->install($id);
         if ($install) {
             msg::success('操作成功', '模塊安裝成功,請稍候', zotop::url('zotop/module/install'));
         }
         msg::error('操作失敗', '模塊安裝失敗,請檢查模塊是否已經存在!');
     }
     $page['title'] = '模塊安裝';
     page::header($page);
     page::top();
     page::navbar($this->navbar());
     //block::header('操作說明');
     echo '<ul class="notice">';
     echo '	<li>安裝模塊前,請確認將該模塊文件夾上傳至服務器上的模塊目錄下麵目錄下麵(/zotop/modules)</li>';
     echo '	<li>上傳完成後,刷新頁麵,模塊將會出現在下麵的待安裝模塊列表中</li>';
     echo '</ul>';
     //block::footer();
     block::header('待安裝模塊');
     $column = array();
     $column['logo w30'] = '';
     $column['name'] = '名稱';
     $column['version w50'] = '版本';
     $column['manage edit'] = '安裝';
     $column['manage delete'] = '刪除';
     table::header('list', $column);
     foreach ($modules as $module) {
         $column = array();
         $column['logo w30'] = html::image($module['icon'], array('width' => '32px'));
         $column['name'] = '<a><b>' . $module['name'] . '</b></a><h5>' . $module['description'] . '</h5>';
         $column['version'] = $module['version'];
         $column['manage edit'] = html::a(zotop::url('zotop/module/install', array('id' => $module['id'])), '安裝', array('class' => 'confirm'));
         $column['manage delete'] = '刪除';
         table::row($column);
     }
     table::footer();
     block::footer();
     page::bottom();
     page::footer();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:44,代碼來源:module.php

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


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