* adjust for dao when tutorialMode.

This commit is contained in:
wangyidong
2016-05-24 14:13:42 +08:00
parent 2082aee081
commit 30903e10a7
4 changed files with 10 additions and 1 deletions
+5
View File
@@ -20,6 +20,11 @@ helper::import(dirname(dirname(__FILE__)) . '/base/dao/dao.class.php');
*/
class dao extends baseDAO
{
public function exec($sql = '')
{
if(isset($_SESSION['tutorialMode']) and $_SESSION['tutorialMode']) die(js::alert($this->lang->error->tutorialData));
return parent::exec($sql);
}
}
/**
+1
View File
@@ -385,6 +385,7 @@ $lang->error->accessDenied = 'No purview';
$lang->error->pasteImg = 'Your browser does not support the paste image!';
$lang->error->noData = 'No data';
$lang->error->editedByOther = 'The record may have been changed. Please refresh and re edit!';
$lang->error->tutorialData = 'Novice mode will not insert data, please exit it to operation';
/* Pager. */
$lang->pager = new stdclass();
+1
View File
@@ -385,6 +385,7 @@ $lang->error->accessDenied = '您没有访问权限';
$lang->error->pasteImg = '您的浏览器不支持粘贴图片!';
$lang->error->noData = '没有数据';
$lang->error->editedByOther = '该记录可能已经被改动。请刷新页面重新编辑!';
$lang->error->tutorialData = '新手模式下不会插入数据,请退出新手模式操作';
/* 分页信息。*/
$lang->pager = new stdclass();
+3 -1
View File
@@ -31,8 +31,8 @@ class tutorial extends control
{
$setting = isset($this->config->tutorial->tasks->setting) ? $this->config->tutorial->tasks->setting : '';
$this->session->set('tutorialMode', true);
$this->loadModel('setting')->setItem($this->app->user->account . '.common.global.novice', true);
$this->session->set('tutorialMode', true);
$this->view->title = $this->lang->tutorial->common;
$this->view->current = $task;
@@ -55,7 +55,9 @@ class tutorial extends control
if($finish == 'keepAll') $this->send(array('result' => 'fail', 'message' => $this->lang->tutorial->ajaxSetError));
$account = $this->app->user->account;
$this->session->set('tutorialMode', false);
$this->loadModel('setting')->setItem("$account.tutorial.tasks.setting", $finish);
$this->session->set('tutorialMode', true);
$this->send(array('result' => 'success'));
}