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


PHP Response::jsonError方法代码示例

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


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

示例1: importdbfieldsAction

 /**
  * Import DB fields into the form object
  */
 public function importdbfieldsAction()
 {
     $connection = Request::post('connection', 'string', false);
     $table = Request::post('table', 'string', false);
     $conType = Request::post('type', 'integer', false);
     $importFields = Request::post('importfields', 'array', array());
     if ($connection === false || !$table || empty($importFields) || $conType === false) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $conManager = new Backend_Orm_Connections_Manager($this->_configMain->get('db_configs'));
     $cfg = $conManager->getConnection($conType, $connection);
     if (!$cfg) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $cfg = $cfg->__toArray();
     $tableFields = Backend_Designer_Import::getTableFields($cfg, $table);
     if ($tableFields === false) {
         Response::jsonError($this->_lang->CANT_CONNECT);
     }
     foreach ($importFields as $name) {
         if (isset($tableFields[$name]) && !empty($tableFields[$name])) {
             $this->_importDbField($name, $tableFields[$name]);
         }
     }
     $this->_storeProject();
     Response::jsonSuccess();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:30,代码来源:Form.php

示例2: updateAction

 public function updateAction()
 {
     $this->_checkCanEdit();
     $data = Request::post('data', 'raw', false);
     if ($data === false) {
         Response::jsonError($this->_lang->INVALID_VALUE);
     }
     $data = json_decode($data, true);
     if (!isset($data[0])) {
         $data = array($data);
     }
     $manager = new Backend_Fmodules_Manager();
     $manager->removeAll();
     if (!empty($data)) {
         foreach ($data as $v) {
             if (empty($v)) {
                 continue;
             }
             $name = $v['name'];
             unset($v['name']);
             $manager->addModule($name, $v);
         }
     }
     if ($manager->save()) {
         Response::jsonSuccess();
     } else {
         Response::jsonError($this->_lang->CANT_WRITE_FS);
     }
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:29,代码来源:Controller.php

示例3: _getEvent

 protected function _getEvent()
 {
     $event = Request::post('event', 'string', false);
     if (!strlen($event) || $event === false) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     return $event;
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:8,代码来源:Gridfilterevents.php

示例4: getModule

 public function getModule()
 {
     $dataObject = Request::post('d_object', 'string', false);
     if (!$dataObject || !Db_Object_Config::configExists($dataObject)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     return ucfirst($dataObject);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:8,代码来源:Vc.php

示例5: _errorResponse

 /**
  * Send JSON error message
  *
  * @return string
  */
 protected function _errorResponse($msg)
 {
     if (Request::isAjax()) {
         Response::jsonError($msg);
     } else {
         Response::redirect(Request::url(array('index'), true));
     }
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:13,代码来源:Authorised.php

示例6: _getObject

 /**
  * Check requested object
  * Get requested object from project
  * @return Ext_Object
  */
 protected function _getObject()
 {
     $name = Request::post('object', 'string', '');
     $project = $this->_getProject();
     if (!strlen($name) || !$project->objectExists($name)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     return $project->getObject($name);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:14,代码来源:Sub.php

示例7: resetAction

 public function resetAction()
 {
     $this->_checkCanDelete();
     if (Backend_Cache_Manager::resetAll()) {
         Response::jsonSuccess();
     } else {
         Response::jsonError($this->_lang->CANT_RESET_CACHE);
     }
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:9,代码来源:Controller.php

示例8: updateObject

 /**
  * Update object
  * @param Db_Object $object
  * @return void
  */
 public function updateObject(Db_Object $object)
 {
     $changeVal = Request::post('changeVal', 'bool', false);
     if ($changeVal) {
         $object->set('hash', Utils::hash($object->get('hash')));
     }
     if (!$object->save()) {
         Response::jsonError($this->_lang->CANT_EXEC);
     }
     Response::jsonSuccess(array('id' => $object->getId()));
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:16,代码来源:Controller.php

示例9: actionsAction

 public function actionsAction()
 {
     $controller = Request::post('controller', 'string', '');
     if (!strlen($controller)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     if (strpos($controller, '.php') !== false) {
         $controller = Utils::classFromPath($controller);
     }
     $actions = Backend_Designer_Code::getPossibleActions($controller);
     Response::jsonSuccess($actions);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:12,代码来源:Url.php

示例10: savepermissionsAction

 /**
  * Save permissions action
  */
 public function savepermissionsAction()
 {
     $this->_checkCanEdit();
     $data = Request::post('data', 'raw', false);
     $groupId = Request::post('group_id', 'int', false);
     $data = json_decode($data, true);
     if (empty($data) || !$groupId) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     if (Model::factory('acl_simple')->updateGroupPermissions($groupId, $data)) {
         Response::jsonSuccess();
     } else {
         Response::jsonError($this->_lang->CANT_EXEC);
     }
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:18,代码来源:Controller.php

示例11: objectcodeAction

 /**
  * Get JS code for object
  */
 public function objectcodeAction()
 {
     $object = Request::post('object', 'string', '');
     $project = $this->_getProject();
     if (!$project->objectExists($object)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $projectCfg = $project->getConfig();
     Ext_Code::setRunNamespace($projectCfg['runnamespace']);
     Ext_Code::setNamespace($projectCfg['namespace']);
     $templates = $this->_config->get('templates');
     $replaces = array(array('tpl' => $templates['wwwroot'], 'value' => $this->_configMain->get('wwwroot')), array('tpl' => $templates['adminpath'], 'value' => $this->_configMain->get('adminPath')), array('tpl' => $templates['urldelimiter'], 'value' => $this->_configMain->get('urlDelimiter')));
     $code = $project->getObjectCode($object, $replaces);
     Response::jsonSuccess($code);
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:18,代码来源:Code.php

示例12: saveAction

 /**
  * Save ActionJs code
  */
 public function saveAction()
 {
     $code = Request::post('code', 'raw', false);
     if ($code === false) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $project = $this->_getProject();
     $actionjs = str_replace('../', '', $project->actionjs);
     if ($actionjs[0] !== '.') {
         $actionjs = '.' . $actionjs;
     }
     if (!@file_put_contents($actionjs, $code)) {
         Response::jsonError($this->_lang->CANT_WRITE_FS . ' ' . $actionjs);
     }
     Response::jsonSuccess();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:19,代码来源:Actionjs.php

示例13: setpropertyAction

 /**
  * Set object property
  */
 public function setpropertyAction()
 {
     $id = Request::post('id', 'string', false);
     $property = Request::post('name', 'string', false);
     $value = Request::post('value', 'raw', false);
     if (!$id || !$this->_object->getFiltersFeature()->filterExists($id)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $object = $this->_object->getFiltersFeature()->getFilter($id);
     if (!$object->isValidProperty($property)) {
         Response::jsonError();
     }
     $object->{$property} = $value;
     $this->_storeProject();
     Response::jsonSuccess();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:19,代码来源:Gridfilter.php

示例14: setpropertyAction

 /**
  * Set object property
  */
 public function setpropertyAction()
 {
     $this->_checkColumn();
     $action = Request::post('id', 'string', false);
     if ($action === false || !$this->_column->actionExists($action)) {
         Response::jsonError($this->_lang->WRONG_REQUEST . ' invalid action');
     }
     $action = $this->_column->getAction($action);
     $property = Request::post('name', 'string', false);
     $value = Request::post('value', 'raw', false);
     if (!$action->isValidProperty($property)) {
         Response::jsonError();
     }
     $action->{$property} = $value;
     $this->_storeProject();
     Response::jsonSuccess();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:20,代码来源:Gridcolumnactions.php

示例15: importfieldsAction

 /**
  * Import fields into the form object
  */
 public function importfieldsAction()
 {
     $importObject = Request::post('importobject', 'string', false);
     $importFields = Request::post('importfields', 'array', array());
     if (!$importObject || empty($importFields) || !Db_Object_Config::configExists($importObject)) {
         Response::jsonError($this->_lang->WRONG_REQUEST);
     }
     $importObjectConfig = Db_Object_Config::getInstance($importObject);
     foreach ($importFields as $name) {
         if ($importObjectConfig->fieldExists($name)) {
             $this->_importOrmField($name, $importObjectConfig);
         }
     }
     $this->_object->objectName = $importObject;
     $this->_storeProject();
     Response::jsonSuccess();
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:20,代码来源:Crudwindow.php


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