Exemplo n.º 1
0
 /**
  * 编辑功能权限入库
  *
  * @access private
  */
 private function updatePermission()
 {
     $params = new AclSave();
     $manager = new AclProcess();
     $httpReferer = Session::getOldInput('http_referer');
     $params->setAttributes((array) Request::input('data'));
     if ($manager->editAcl($params) !== false) {
         $backUrl = !empty($httpReferer) ? $httpReferer : route('foundation.acl.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
Exemplo n.º 2
0
 /**
  * 编辑入库
  *
  * @access private
  */
 private function editShopCategory()
 {
     $params = new CategorySave();
     $manager = new ProductCategoryProcess();
     $httpReferer = Session::getOldInput('http_referer');
     $data = (array) Request::input('data');
     $data['update_time'] = time();
     $params->setAttributes($data);
     if ($manager->editShopCategory($params) !== false) {
         $backUrl = !empty($httpReferer) ? $httpReferer : route('shop.category.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
Exemplo n.º 3
0
 /**
  * 编辑用户组入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = (array) Request::input('data');
     app('param.admin.groupsave')->setAttributes($data);
     if (app('process.admin.group')->editGroup(app('param.admin.groupsave'))) {
         $this->setActionLog();
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'foundation.group.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error(app('process.admin.group')->getErrorMessage());
 }
Exemplo n.º 4
0
 /**
  * 更新用户信息到数据库
  *
  * @access private
  */
 private function updateUserInfoToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.info_incomplete'));
     }
     $param = new \App\Services\Admin\User\Param\UserSave();
     $param->setAttributes($data);
     $manager = new UserActionProcess();
     if ($manager->editUser($param)) {
         $this->setActionLog();
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'foundation.user.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
Exemplo n.º 5
0
 /**
  * 编辑文章入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $data = (array) Request::input('data');
     $id = intval(Request::input('id'));
     $data['tags'] = explode(';', $data['tags']);
     $param = new \App\Services\Admin\Content\Param\ContentSave();
     $param->setAttributes($data);
     $manager = new ContentActionProcess();
     if ($manager->editContent($param, $id) !== false) {
         return Js::locate(R('common', 'blog.content.index'), 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
Exemplo n.º 6
0
 /**
  * 编辑文章入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = (array) Request::input('data');
     $data['tags'] = explode(';', $data['tags']);
     $this->contentSave->setAttributes($data);
     $id = intval(Request::input('id'));
     if ($this->contentProcess->editContent($this->contentSave, $id) !== false) {
         $this->setActionLog(['param' => $this->contentSave]);
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'blog.content.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($this->contentProcess->getErrorMessage());
 }
Exemplo n.º 7
0
 /**
  * 编辑文章分类入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $param = new \App\Services\Admin\Category\Param\CategorySave();
     $param->setAttributes($data);
     $manager = new CategoryActionProcess();
     if ($manager->editCategory($param)) {
         return Js::locate(R('common', 'blog.category.index'), 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
 /**
  * 编辑推荐位入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $this->pSave->setAttributes($data);
     if ($this->pProcess->editPosition($this->pSave)) {
         $this->setActionLog(['param' => $this->pSave]);
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'blog.position.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($this->pProcess->getErrorMessage());
 }
Exemplo n.º 9
0
 /**
  * 编辑用户组入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $params = new \App\Services\Admin\Group\Param\GroupSave();
     $params->setAttributes($data);
     $manager = new GroupActionProcess();
     if ($manager->editGroup($params)) {
         $this->setActionLog();
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'foundation.group.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }
Exemplo n.º 10
0
 /**
  * 排序权限功能
  *
  * @access public
  */
 public function sort()
 {
     $sort = Request::input('sort');
     if (!$sort or !is_array($sort)) {
         return Js::error(Lang::get('common.choose_checked'));
     }
     foreach ($sort as $key => $value) {
         if (app('model.admin.permission')->sortPermission($key, $value) === false) {
             $err = true;
         }
     }
     if (isset($err)) {
         return Js::error(Lang::get('common.action_error'));
     }
     return Js::locate(R('common', 'foundation.acl.index'), 'parent');
 }
Exemplo n.º 11
0
 /**
  * 编辑用户组
  *
  * @access private
  */
 private function updateGroup()
 {
     $params = new GroupSave();
     $manager = new GroupProcess();
     $httpReferer = Session::getOldInput('http_referer');
     $params->setAttributes((array) Request::input('data'));
     if (!$manager->editGroup($params)) {
         return Js::error($manager->getErrorMessage());
     }
     $this->setActionLog();
     return Js::locate(!empty($httpReferer) ? $httpReferer : route('foundation.group.index'), 'parent');
 }
Exemplo n.º 12
0
 /**
  * 编辑工作流步骤入库处理
  *
  * @access private
  */
 private function updateWorkflowStep()
 {
     $this->checkFormHash();
     $stepId = (int) Request::input('workflow_step_id');
     $workflowId = (int) Request::input('workflow_id');
     $data = (array) Request::input('data');
     $data['id'] = $stepId;
     $data['workflow_id'] = $workflowId;
     $params = new WorkflowStepSave();
     $manager = new Process();
     $params->setAttributes($data);
     if (!$manager->editWorkflowStep($params)) {
         return Js::error($manager->getErrorMessage());
     }
     $this->setActionLog();
     return Js::locate(route('workflow.step.index', ['id' => $workflowId]), 'parent');
 }
Exemplo n.º 13
0
 /**
  * 编辑工作流入库处理
  *
  * @access private
  */
 private function updateWorkflow()
 {
     $params = new WorkflowSave();
     $manager = new Process();
     $params->setAttributes((array) Request::input('data'));
     if (!$manager->editWorkflow($params)) {
         return Js::error($manager->getErrorMessage());
     }
     $this->setActionLog();
     return Js::locate(route('workflow.index.index'), 'parent');
 }
Exemplo n.º 14
0
 /**
  * 编辑工作流步骤入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $this->checkFormHash();
     $stepId = (int) Request::input('workflow_step_id');
     $workflowId = (int) Request::input('workflow_id');
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $data['id'] = $stepId;
     $data['workflow_id'] = $workflowId;
     $this->wstepSave->setAttributes($data);
     if ($this->workflowProcess->editWorkflowStep($this->wstepSave)) {
         $this->setActionLog();
         return Js::locate(R('common', 'workflow.step.index', ['id' => $workflowId]), 'parent');
     }
     return Js::error($this->workflowProcess->getErrorMessage());
 }
Exemplo n.º 15
0
 /**
  * 编辑工作流入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $this->workflowSaveParam->setAttributes($data);
     if ($this->workflowProcess->editWorkflow($this->workflowSaveParam)) {
         $this->setActionLog();
         return Js::locate(R('common', 'workflow.index.index'), 'parent');
     }
     return Js::error($this->workflowProcess->getErrorMessage());
 }
Exemplo n.º 16
0
 /**
  * 更新用户信息到数据库
  *
  * @access private
  */
 private function updateUserInfo()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = (array) Request::input('data');
     $manager = new UserProcess();
     if (!$manager->editUser($manager->userSaveParams($data))) {
         return Js::error($manager->getErrorMessage());
     }
     $this->setActionLog();
     return Js::locate(!empty($httpReferer) ? $httpReferer : route('foundation.user.index'), 'parent');
 }
Exemplo n.º 17
0
 /**
  * 编辑工作流入库处理
  *
  * @access private
  */
 private function updateDatasToDatabase()
 {
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $params = new \App\Services\Admin\Workflow\Param\WorkflowSave();
     $params->setAttributes($data);
     $manager = new Process();
     if ($manager->editWorkflow($params)) {
         $this->setActionLog();
         return Js::locate(R('common', 'workflow.index.index'), 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }